@univerjs/engine-render 0.2.12 → 0.2.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 +1 -19
- package/lib/es/index.js +18832 -20350
- package/lib/types/basics/range.d.ts +24 -14
- package/lib/types/basics/tools.d.ts +22 -2
- package/lib/types/basics/transform.d.ts +24 -24
- package/lib/types/components/docs/layout/doc-skeleton.d.ts +3 -3
- package/lib/types/components/docs/layout/model/line.d.ts +1 -1
- package/lib/types/components/docs/layout/tools.d.ts +2 -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/custom.d.ts +1 -1
- package/lib/types/components/sheets/extensions/font.d.ts +2 -11
- package/lib/types/components/sheets/extensions/marker.d.ts +1 -1
- package/lib/types/components/sheets/extensions/row-header-layout.d.ts +2 -2
- package/lib/types/components/sheets/extensions/sheet-extension.d.ts +2 -2
- package/lib/types/components/sheets/interfaces.d.ts +2 -6
- package/lib/types/components/sheets/row-header.d.ts +1 -1
- package/lib/types/components/sheets/sheet-skeleton.d.ts +28 -14
- package/lib/types/components/sheets/spreadsheet.d.ts +3 -3
- package/lib/types/components/slides/slide.d.ts +1 -1
- package/lib/types/context.d.ts +7 -0
- package/lib/types/engine.d.ts +2 -2
- package/lib/types/index.d.ts +20 -27
- package/lib/types/render-engine.d.ts +2 -2
- package/lib/types/render-manager/render-manager.service.d.ts +5 -5
- package/lib/types/scene.d.ts +5 -5
- package/lib/types/shape/rect.d.ts +15 -6
- package/lib/types/viewport.d.ts +25 -13
- package/lib/umd/index.js +1 -19
- package/package.json +7 -7
- package/lib/types/components/docs/text-selection/convert-rect-range.d.ts +0 -29
- package/lib/types/components/docs/text-selection/convert-text-range.d.ts +0 -65
- package/lib/types/components/docs/text-selection/range-interface.d.ts +0 -21
- package/lib/types/components/docs/text-selection/rect-range.d.ts +0 -48
- package/lib/types/components/docs/text-selection/selection-utils.d.ts +0 -27
- package/lib/types/components/docs/text-selection/text-range.d.ts +0 -68
- package/lib/types/components/docs/text-selection/text-selection-render-manager.d.ts +0 -193
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ITextRangeParam } from '@univerjs/core';
|
|
2
|
-
import {
|
|
1
|
+
import { ITextRangeParam, Nullable } from '@univerjs/core';
|
|
2
|
+
import { INodePosition } from './interfaces';
|
|
3
3
|
export interface ITextSelectionStyle {
|
|
4
4
|
strokeWidth: number;
|
|
5
5
|
stroke: string;
|
|
@@ -8,19 +8,29 @@ export interface ITextSelectionStyle {
|
|
|
8
8
|
}
|
|
9
9
|
export declare const NORMAL_TEXT_SELECTION_PLUGIN_STYLE: ITextSelectionStyle;
|
|
10
10
|
export interface ITextRangeWithStyle extends ITextRangeParam {
|
|
11
|
+
startNodePosition?: Nullable<INodePosition>;
|
|
12
|
+
endNodePosition?: Nullable<INodePosition>;
|
|
11
13
|
style?: ITextSelectionStyle;
|
|
12
|
-
rangeType?: DOC_RANGE_TYPE;
|
|
13
14
|
}
|
|
14
|
-
export interface
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
15
|
+
export interface IRectRangeWithStyle extends ITextRangeWithStyle {
|
|
16
|
+
startRow: number;
|
|
17
|
+
startColumn: number;
|
|
18
|
+
endRow: number;
|
|
19
|
+
endColumn: number;
|
|
20
|
+
tableId: string;
|
|
21
|
+
spanEntireRow: boolean;
|
|
22
|
+
spanEntireColumn: boolean;
|
|
23
|
+
spanEntireTable: boolean;
|
|
21
24
|
}
|
|
22
|
-
export
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
25
|
+
export type ISuccinctDocRangeParam = Pick<ITextRangeWithStyle, 'startOffset' | 'endOffset' | 'segmentId' | 'segmentPage' | 'style' | 'rangeType'>;
|
|
26
|
+
export interface IDocSelectionInnerParam {
|
|
27
|
+
textRanges: ITextRangeWithStyle[];
|
|
28
|
+
rectRanges: IRectRangeWithStyle[];
|
|
29
|
+
segmentId: string;
|
|
30
|
+
isEditing: boolean;
|
|
31
|
+
style: ITextSelectionStyle;
|
|
32
|
+
segmentPage: number;
|
|
33
|
+
options?: {
|
|
34
|
+
[key: string]: boolean;
|
|
35
|
+
};
|
|
26
36
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { IRange, IRangeWithCoord, IScale, ISelectionCellWithMergeInfo, IStyleBase, LocaleService, Nullable } from '@univerjs/core';
|
|
2
|
-
import { IBoundRectNoAngle } from './vector2';
|
|
1
|
+
import { IRange, IRangeWithCoord, IScale, ISelectionCell, ISelectionCellWithMergeInfo, IStyleBase, LocaleService, Nullable } from '@univerjs/core';
|
|
3
2
|
import { IDocumentSkeletonFontStyle } from './i-document-skeleton-cached';
|
|
3
|
+
import { IBoundRectNoAngle } from './vector2';
|
|
4
4
|
export declare const getColor: (RgbArray: number[], opacity?: number) => string;
|
|
5
5
|
export declare const toPx: (num: number | string, ReferenceValue: Nullable<number>) => number;
|
|
6
6
|
/**
|
|
@@ -71,6 +71,26 @@ export declare function getCellPositionByIndex(row: number, column: number, rowH
|
|
|
71
71
|
startX: number;
|
|
72
72
|
endX: number;
|
|
73
73
|
};
|
|
74
|
+
export declare function getCellByIndexWithMergeInfo(row: number, column: number, rowHeightAccumulation: number[], columnWidthAccumulation: number[], mergeDataInfo: ISelectionCell): {
|
|
75
|
+
isMerged: boolean;
|
|
76
|
+
isMergedMainCell: boolean;
|
|
77
|
+
actualRow: number;
|
|
78
|
+
actualColumn: number;
|
|
79
|
+
startY: number;
|
|
80
|
+
endY: number;
|
|
81
|
+
startX: number;
|
|
82
|
+
endX: number;
|
|
83
|
+
mergeInfo: {
|
|
84
|
+
startRow: number;
|
|
85
|
+
startColumn: number;
|
|
86
|
+
endRow: number;
|
|
87
|
+
endColumn: number;
|
|
88
|
+
startY: number;
|
|
89
|
+
endY: number;
|
|
90
|
+
startX: number;
|
|
91
|
+
endX: number;
|
|
92
|
+
};
|
|
93
|
+
};
|
|
74
94
|
export declare function getCellByIndex(row: number, column: number, rowHeightAccumulation: number[], columnWidthAccumulation: number[], mergeData: IRange[]): ISelectionCellWithMergeInfo;
|
|
75
95
|
/**
|
|
76
96
|
* Determine whether there are any cells in a row that are not in the merged cells, mainly used for the calculation of auto height
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ITransformState } from '@univerjs/core';
|
|
2
|
-
import { IRect } from './interfaces';
|
|
3
2
|
import { Vector2 } from './vector2';
|
|
3
|
+
import { IRect } from './interfaces';
|
|
4
4
|
export declare const INITIAL_MATRIX: number[];
|
|
5
5
|
export declare class Transform {
|
|
6
6
|
dirty: boolean;
|
|
@@ -9,10 +9,10 @@ export declare class Transform {
|
|
|
9
9
|
static create(m?: number[]): Transform;
|
|
10
10
|
reset(): void;
|
|
11
11
|
/**
|
|
12
|
-
* Copy
|
|
12
|
+
* Copy universheet.Transform object
|
|
13
13
|
* @method
|
|
14
|
-
* @name
|
|
15
|
-
* @returns {
|
|
14
|
+
* @name universheet.Transform#copy
|
|
15
|
+
* @returns {universheet.Transform}
|
|
16
16
|
* @example
|
|
17
17
|
* const tr = shape.getTransform().copy()
|
|
18
18
|
*/
|
|
@@ -21,7 +21,7 @@ export declare class Transform {
|
|
|
21
21
|
/**
|
|
22
22
|
* Transform point
|
|
23
23
|
* @method
|
|
24
|
-
* @name
|
|
24
|
+
* @name universheet.Transform#point
|
|
25
25
|
* @param {object} point 2D point(x, y)
|
|
26
26
|
* @returns {object} 2D point(x, y)
|
|
27
27
|
*/
|
|
@@ -32,30 +32,30 @@ export declare class Transform {
|
|
|
32
32
|
* @name universheet.Transform#translate
|
|
33
33
|
* @param {number} x
|
|
34
34
|
* @param {number} y
|
|
35
|
-
* @returns {
|
|
35
|
+
* @returns {universheet.Transform}
|
|
36
36
|
*/
|
|
37
37
|
translate(x: number, y: number): this;
|
|
38
38
|
/**
|
|
39
39
|
* Apply scale
|
|
40
40
|
* @method
|
|
41
|
-
* @name
|
|
41
|
+
* @name universheet.Transform#scale
|
|
42
42
|
* @param {number} sx
|
|
43
43
|
* @param {number} sy
|
|
44
|
-
* @returns {
|
|
44
|
+
* @returns {universheet.Transform}
|
|
45
45
|
*/
|
|
46
46
|
scale(sx: number, sy: number): this;
|
|
47
47
|
/**
|
|
48
48
|
* Apply rotation
|
|
49
49
|
* @method
|
|
50
|
-
* @name
|
|
50
|
+
* @name universheet.Transform#rotate
|
|
51
51
|
* @param {number} Degree Angle in Degree
|
|
52
|
-
* @returns {
|
|
52
|
+
* @returns {universheet.Transform}
|
|
53
53
|
*/
|
|
54
54
|
rotate(deg: number): this;
|
|
55
55
|
/**
|
|
56
56
|
* Returns the translation
|
|
57
57
|
* @method
|
|
58
|
-
* @name
|
|
58
|
+
* @name universheet.Transform#getTranslation
|
|
59
59
|
* @returns {object} 2D point(x, y)
|
|
60
60
|
*/
|
|
61
61
|
getTranslation(): {
|
|
@@ -65,51 +65,51 @@ export declare class Transform {
|
|
|
65
65
|
/**
|
|
66
66
|
* Apply skew
|
|
67
67
|
* @method
|
|
68
|
-
* @name
|
|
68
|
+
* @name universheet.Transform#skew
|
|
69
69
|
* @param {number} sx
|
|
70
70
|
* @param {number} sy
|
|
71
|
-
* @returns {
|
|
71
|
+
* @returns {universheet.Transform}
|
|
72
72
|
*/
|
|
73
73
|
skew(sx: number, sy: number): this;
|
|
74
74
|
/**
|
|
75
75
|
* Transform multiplication
|
|
76
76
|
* @method
|
|
77
|
-
* @name
|
|
78
|
-
* @param {
|
|
79
|
-
* @returns {
|
|
77
|
+
* @name universheet.Transform#multiply
|
|
78
|
+
* @param {universheet.Transform} matrix
|
|
79
|
+
* @returns {universheet.Transform}
|
|
80
80
|
*/
|
|
81
81
|
multiply(matrix: Transform): this;
|
|
82
82
|
/**
|
|
83
83
|
* Invert the matrix
|
|
84
84
|
* @method
|
|
85
|
-
* @name
|
|
86
|
-
* @returns {
|
|
85
|
+
* @name universheet.Transform#invert
|
|
86
|
+
* @returns {universheet.Transform}
|
|
87
87
|
*/
|
|
88
88
|
invert(): this;
|
|
89
89
|
/**
|
|
90
90
|
* return matrix
|
|
91
91
|
* @method
|
|
92
|
-
* @name
|
|
92
|
+
* @name universheet.Transform#getMatrix
|
|
93
93
|
*/
|
|
94
94
|
getMatrix(): number[];
|
|
95
95
|
/**
|
|
96
96
|
* return matrix
|
|
97
97
|
* @method
|
|
98
|
-
* @name
|
|
98
|
+
* @name universheet.Transform#getMatrix
|
|
99
99
|
*/
|
|
100
100
|
getMatrixByAccurate(accurate?: number): number[];
|
|
101
101
|
/**
|
|
102
102
|
* set to absolute position via translation
|
|
103
103
|
* @method
|
|
104
|
-
* @name
|
|
105
|
-
* @returns {
|
|
104
|
+
* @name universheet.Transform#setAbsolutePosition
|
|
105
|
+
* @returns {universheet.Transform}
|
|
106
106
|
*/
|
|
107
107
|
setAbsolutePosition(coord: Vector2): this;
|
|
108
108
|
/**
|
|
109
109
|
* convert transformation matrix back into node's attributes
|
|
110
110
|
* @method
|
|
111
|
-
* @name
|
|
112
|
-
* @returns {
|
|
111
|
+
* @name universheet.Transform#decompose
|
|
112
|
+
* @returns {universheet.Transform}
|
|
113
113
|
*/
|
|
114
114
|
decompose(): {
|
|
115
115
|
x: number;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { LocaleService, Nullable } from '@univerjs/core';
|
|
2
|
-
import { IDocumentSkeletonCached, IDocumentSkeletonGlyph, IDocumentSkeletonPage
|
|
2
|
+
import { PageLayoutType, IDocumentSkeletonCached, IDocumentSkeletonGlyph, IDocumentSkeletonPage } from '../../../basics/i-document-skeleton-cached';
|
|
3
|
+
import { Skeleton } from '../../skeleton';
|
|
4
|
+
import { DocumentEditArea, DocumentViewModel } from '../view-model/document-view-model';
|
|
3
5
|
import { INodeInfo, INodePosition, INodeSearch } from '../../../basics/interfaces';
|
|
4
6
|
import { IViewportInfo, Vector2 } from '../../../basics/vector2';
|
|
5
|
-
import { Skeleton } from '../../skeleton';
|
|
6
|
-
import { DocumentViewModel, DocumentEditArea } from '../view-model/document-view-model';
|
|
7
7
|
export declare enum DocumentSkeletonState {
|
|
8
8
|
PENDING = "pending",
|
|
9
9
|
CALCULATING = "calculating",
|
|
@@ -17,6 +17,6 @@ export declare function calculateLineTopByDrawings(lineHeight: number | undefine
|
|
|
17
17
|
export declare function updateDivideInfo(divide: IDocumentSkeletonDivide, states: Partial<IDocumentSkeletonDivide>): void;
|
|
18
18
|
export declare function setLineMarginBottom(line: IDocumentSkeletonLine, marginBottom: number): void;
|
|
19
19
|
export declare function collisionDetection(drawing: IDocumentSkeletonDrawing, lineHeight: number, lineTop: number, columnLeft: number, columnWidth: number): boolean;
|
|
20
|
-
export declare function getBoundingBox(angle: number, left: number, width: number, top: number, height: number): import('
|
|
20
|
+
export declare function getBoundingBox(angle: number, left: number, width: number, top: number, height: number): import('../../../..').IRect;
|
|
21
21
|
export declare function createAndUpdateBlockAnchor(paragraphIndex: number, line: IDocumentSkeletonLine, top: number, drawingAnchor?: Map<number, IDocumentSkeletonDrawingAnchor>): void;
|
|
22
22
|
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { DocumentDataModel, INumberUnit, IObjectPositionH, IObjectPositionV, IParagraph, IParagraphStyle, ITextStyle, Nullable
|
|
1
|
+
import { BooleanNumber, GridType, SpacingRule, DocumentDataModel, INumberUnit, IObjectPositionH, IObjectPositionV, IParagraph, IParagraphStyle, ITextStyle, Nullable } from '@univerjs/core';
|
|
2
2
|
import { IDocumentSkeletonCached, IDocumentSkeletonColumn, IDocumentSkeletonDivide, IDocumentSkeletonDrawing, IDocumentSkeletonFontStyle, IDocumentSkeletonGlyph, IDocumentSkeletonLine, IDocumentSkeletonPage, IDocumentSkeletonSection, ISkeletonResourceReference } from '../../../basics/i-document-skeleton-cached';
|
|
3
3
|
import { IDocsConfig, IParagraphConfig, ISectionBreakConfig } from '../../../basics/interfaces';
|
|
4
4
|
import { DataStreamTreeNode } from '../view-model/data-stream-tree-node';
|
|
@@ -101,4 +101,5 @@ export declare const DEFAULT_PAGE_SIZE: {
|
|
|
101
101
|
export declare function prepareSectionBreakConfig(ctx: ILayoutContext, nodeIndex: number): ISectionBreakConfig;
|
|
102
102
|
export declare function resetContext(ctx: ILayoutContext): void;
|
|
103
103
|
export declare function mergeByV<T = unknown>(object: unknown, originObject: unknown, type: 'max' | 'min'): T;
|
|
104
|
+
export declare function getPageFromPath(skeletonData: IDocumentSkeletonCached, path: (string | number)[]): Nullable<IDocumentSkeletonPage>;
|
|
104
105
|
export {};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { IRange, IScale } from '@univerjs/core';
|
|
2
|
+
import { SheetExtension } from './sheet-extension';
|
|
2
3
|
import { UniverRenderingContext } from '../../../context';
|
|
3
4
|
import { IDrawInfo } from '../../extension';
|
|
4
5
|
import { SpreadsheetSkeleton } from '../sheet-skeleton';
|
|
5
|
-
import { SheetExtension } from './sheet-extension';
|
|
6
6
|
export declare class Background extends SheetExtension {
|
|
7
7
|
uKey: string;
|
|
8
8
|
Z_INDEX: number;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { IRange, IScale } from '@univerjs/core';
|
|
2
|
+
import { SheetExtension } from './sheet-extension';
|
|
2
3
|
import { UniverRenderingContext } from '../../../context';
|
|
3
4
|
import { SpreadsheetSkeleton } from '../sheet-skeleton';
|
|
4
|
-
import { SheetExtension } from './sheet-extension';
|
|
5
5
|
export declare class Border extends SheetExtension {
|
|
6
6
|
uKey: string;
|
|
7
7
|
Z_INDEX: number;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { IRange, IScale } from '@univerjs/core';
|
|
2
|
+
import { SheetExtension } from './sheet-extension';
|
|
2
3
|
import { UniverRenderingContext } from '../../../context';
|
|
3
4
|
import { SpreadsheetSkeleton } from '../sheet-skeleton';
|
|
4
|
-
import { SheetExtension } from './sheet-extension';
|
|
5
5
|
export declare class Custom extends SheetExtension {
|
|
6
6
|
protected Z_INDEX: number;
|
|
7
7
|
uKey: string;
|
|
@@ -1,17 +1,8 @@
|
|
|
1
1
|
import { IRange, IScale } from '@univerjs/core';
|
|
2
|
-
import { UniverRenderingContext } from '../../../context';
|
|
3
|
-
import { IDrawInfo } from '../../extension';
|
|
4
2
|
import { SpreadsheetSkeleton } from '../sheet-skeleton';
|
|
5
3
|
import { SheetExtension } from './sheet-extension';
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
leftOffset?: number;
|
|
9
|
-
rightOffset?: number;
|
|
10
|
-
topOffset?: number;
|
|
11
|
-
downOffset?: number;
|
|
12
|
-
isSkip?: boolean;
|
|
13
|
-
};
|
|
14
|
-
}
|
|
4
|
+
import { UniverRenderingContext } from '../../../context';
|
|
5
|
+
import { IDrawInfo } from '../../extension';
|
|
15
6
|
export declare class Font extends SheetExtension {
|
|
16
7
|
uKey: string;
|
|
17
8
|
Z_INDEX: number;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { IRange, IScale } from '@univerjs/core';
|
|
2
|
+
import { SheetExtension } from './sheet-extension';
|
|
2
3
|
import { UniverRenderingContext } from '../../../context';
|
|
3
4
|
import { SpreadsheetSkeleton } from '../sheet-skeleton';
|
|
4
|
-
import { SheetExtension } from './sheet-extension';
|
|
5
5
|
export declare class Marker extends SheetExtension {
|
|
6
6
|
protected Z_INDEX: number;
|
|
7
7
|
uKey: string;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { IScale } from '@univerjs/core';
|
|
2
|
+
import { SheetExtension } from './sheet-extension';
|
|
2
3
|
import { UniverRenderingContext } from '../../../context';
|
|
3
|
-
import { SpreadsheetSkeleton } from '../sheet-skeleton';
|
|
4
4
|
import { IARowCfg, IARowCfgObj, IColumnStyleCfg, IRowStyleCfg } from '../interfaces';
|
|
5
|
-
import {
|
|
5
|
+
import { SpreadsheetSkeleton } from '../sheet-skeleton';
|
|
6
6
|
export interface IRowsHeaderCfgParam {
|
|
7
7
|
headerStyle?: Partial<IRowStyleCfg>;
|
|
8
8
|
rowsCfg?: IARowCfg[];
|
|
@@ -18,9 +18,9 @@ export declare class SheetExtension extends ComponentExtension<SpreadsheetSkelet
|
|
|
18
18
|
* @param rowHeightAccumulation
|
|
19
19
|
* @param columnWidthAccumulation
|
|
20
20
|
* @param dataMergeCache
|
|
21
|
-
* @returns ISelectionCellWithMergeInfo
|
|
21
|
+
* @returns {ISelectionCellWithMergeInfo} cell Position & mergeInfo
|
|
22
22
|
*/
|
|
23
|
-
|
|
23
|
+
getCellByIndex(rowIndex: number, columnIndex: number, rowHeightAccumulation: number[], columnWidthAccumulation: number[], dataMergeCache: IRange[]): import('@univerjs/core').ISelectionCellWithMergeInfo;
|
|
24
24
|
isRenderDiffRangesByCell(rangeP: IRange, diffRanges?: IRange[]): boolean;
|
|
25
25
|
isRenderDiffRangesByColumn(curStartColumn: number, curEndColumn: number, diffRanges?: IRange[]): boolean;
|
|
26
26
|
isRenderDiffRangesByRow(curStartRow: number, curEndRow: number, diffRanges?: IRange[]): boolean;
|
|
@@ -19,12 +19,8 @@ export interface IFontCacheItem {
|
|
|
19
19
|
horizontalAlign: HorizontalAlign;
|
|
20
20
|
wrapStrategy: WrapStrategy;
|
|
21
21
|
}
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
}
|
|
25
|
-
interface fontCache {
|
|
26
|
-
[key: string]: ObjectMatrix<IFontCacheItem>;
|
|
27
|
-
}
|
|
22
|
+
type backgroundCache = Record<string, ObjectMatrix<string>>;
|
|
23
|
+
type fontCache = Record<string, ObjectMatrix<IFontCacheItem>>;
|
|
28
24
|
export interface IStylesCache {
|
|
29
25
|
background?: backgroundCache;
|
|
30
26
|
backgroundPositions?: ObjectMatrix<ISelectionCellWithMergeInfo>;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Nullable } from '@univerjs/core';
|
|
2
|
+
import { SpreadsheetHeader } from './sheet-component';
|
|
2
3
|
import { IViewportInfo, Vector2 } from '../../basics/vector2';
|
|
3
4
|
import { UniverRenderingContext } from '../../context';
|
|
4
5
|
import { IRowsHeaderCfgParam, RowHeaderLayout } from './extensions/row-header-layout';
|
|
5
|
-
import { SpreadsheetHeader } from './sheet-component';
|
|
6
6
|
import { SpreadsheetSkeleton } from './sheet-skeleton';
|
|
7
7
|
export declare class SpreadsheetRowHeader extends SpreadsheetHeader {
|
|
8
8
|
getDocuments(): void;
|
|
@@ -1,19 +1,15 @@
|
|
|
1
|
-
import { BooleanNumber, DocumentDataModel, HorizontalAlign, IContextService, LocaleService, ObjectMatrix, VerticalAlign, WrapStrategy, ICellData, IColumnRange, IPaddingData, IPosition, IRange, IRowAutoHeightInfo, ISelectionCellWithMergeInfo, ISize, ITextRotation, IWorksheetData, Nullable, Styles, Worksheet } from '@univerjs/core';
|
|
2
|
-
import { IBoundRectNoAngle, IViewportInfo } from '../../basics/vector2';
|
|
1
|
+
import { BooleanNumber, DocumentDataModel, HorizontalAlign, IContextService, LocaleService, ObjectMatrix, VerticalAlign, WrapStrategy, ICellData, IColumnRange, IPaddingData, IPosition, IRange, IRowAutoHeightInfo, IRowRange, ISelectionCellWithMergeInfo, ISize, ITextRotation, IWorksheetData, Nullable, Styles, Worksheet } from '@univerjs/core';
|
|
3
2
|
import { DocumentSkeleton } from '../docs/layout/doc-skeleton';
|
|
4
3
|
import { Skeleton } from '../skeleton';
|
|
5
|
-
import {
|
|
4
|
+
import { IBoundRectNoAngle, IViewportInfo } from '../../basics/vector2';
|
|
5
|
+
import { IFontCacheItem, IStylesCache } from './interfaces';
|
|
6
6
|
/**
|
|
7
7
|
* Obtain the height and width of a cell's text, taking into account scenarios with rotated text.
|
|
8
8
|
* @param documentSkeleton Data of the document's ViewModel
|
|
9
9
|
* @param angleInDegree The rotation angle of an Excel cell, it's **degree**
|
|
10
10
|
*/
|
|
11
11
|
export declare function getDocsSkeletonPageSize(documentSkeleton: DocumentSkeleton, angleInDegree?: number): Nullable<Required<ISize>>;
|
|
12
|
-
interface
|
|
13
|
-
startRow: number;
|
|
14
|
-
endRow: number;
|
|
15
|
-
startColumn: number;
|
|
16
|
-
endColumn: number;
|
|
12
|
+
interface IRowColumnRange extends IRowRange, IColumnRange {
|
|
17
13
|
}
|
|
18
14
|
export interface IDocumentLayoutObject {
|
|
19
15
|
documentModel: Nullable<DocumentDataModel>;
|
|
@@ -53,14 +49,15 @@ export declare class SpreadsheetSkeleton extends Skeleton {
|
|
|
53
49
|
private _rowHeaderWidth;
|
|
54
50
|
private _columnHeaderHeight;
|
|
55
51
|
/**
|
|
56
|
-
*
|
|
52
|
+
* Range of visible area(range in viewBounds)
|
|
57
53
|
*/
|
|
58
54
|
private _rowColumnSegment;
|
|
59
55
|
private _dataMergeCache;
|
|
56
|
+
private _dataMergeCacheMap;
|
|
60
57
|
private _overflowCache;
|
|
61
58
|
private _stylesCache;
|
|
62
59
|
/** A matrix to store if a (row, column) position has render cache. */
|
|
63
|
-
private
|
|
60
|
+
private _cellBgAndBorderCache;
|
|
64
61
|
private _showGridlines;
|
|
65
62
|
private _marginTop;
|
|
66
63
|
private _marginLeft;
|
|
@@ -78,9 +75,9 @@ export declare class SpreadsheetSkeleton extends Skeleton {
|
|
|
78
75
|
get rowHeaderWidth(): number;
|
|
79
76
|
get columnHeaderHeight(): number;
|
|
80
77
|
/**
|
|
81
|
-
*
|
|
78
|
+
* Range of visible area(range in viewBounds)
|
|
82
79
|
*/
|
|
83
|
-
get rowColumnSegment():
|
|
80
|
+
get rowColumnSegment(): IRowColumnRange;
|
|
84
81
|
get dataMergeCache(): IRange[];
|
|
85
82
|
get stylesCache(): IStylesCache;
|
|
86
83
|
get overflowCache(): ObjectMatrix<IRange>;
|
|
@@ -102,6 +99,12 @@ export declare class SpreadsheetSkeleton extends Skeleton {
|
|
|
102
99
|
setOverflowCache(value: ObjectMatrix<IRange>): void;
|
|
103
100
|
setMarginLeft(left: number): void;
|
|
104
101
|
setMarginTop(top: number): void;
|
|
102
|
+
getFont(rowIndex: number, columnIndex: number): Nullable<IFontCacheItem>;
|
|
103
|
+
/**
|
|
104
|
+
* Get range in visible area (range in viewbounds) and set into this._rowColumnSegment.
|
|
105
|
+
* @param bounds
|
|
106
|
+
* @returns boolean
|
|
107
|
+
*/
|
|
105
108
|
calculateSegment(bounds?: IViewportInfo): boolean;
|
|
106
109
|
calculateWithoutClearingCache(bounds?: IViewportInfo): Nullable<SpreadsheetSkeleton>;
|
|
107
110
|
calculate(bounds?: IViewportInfo): Nullable<SpreadsheetSkeleton>;
|
|
@@ -236,10 +239,19 @@ export declare class SpreadsheetSkeleton extends Skeleton {
|
|
|
236
239
|
private _getOverflowBound;
|
|
237
240
|
intersectMergeRange(row: number, column: number): boolean;
|
|
238
241
|
private _calculateStylesCache;
|
|
242
|
+
/**
|
|
243
|
+
* Any changes to sheet model would reset cache.
|
|
244
|
+
*/
|
|
239
245
|
private _resetCache;
|
|
240
246
|
resetCache(): void;
|
|
241
247
|
private _makeDocumentSkeletonDirty;
|
|
242
|
-
|
|
248
|
+
/**
|
|
249
|
+
* Set border background and font to this._stylesCache { border font background }
|
|
250
|
+
* @param row {number}
|
|
251
|
+
* @param col {number}
|
|
252
|
+
* @param options {{ mergeRange: IRange; cacheItem: ICacheItem } | undefined}
|
|
253
|
+
*/
|
|
254
|
+
private _setStylesCache;
|
|
243
255
|
private _updateConfigAndGetDocumentModel;
|
|
244
256
|
private _getDocumentDataByStyle;
|
|
245
257
|
/**
|
|
@@ -250,10 +262,12 @@ export declare class SpreadsheetSkeleton extends Skeleton {
|
|
|
250
262
|
private _setBorderProps;
|
|
251
263
|
private _getFontFormat;
|
|
252
264
|
private _getOtherStyle;
|
|
265
|
+
private _getMergeCellsCache;
|
|
266
|
+
private _getCellMergeInfo;
|
|
253
267
|
/**
|
|
254
268
|
* Cache the merged cells on the current screen to improve computational performance.
|
|
255
269
|
* @param mergeData all marge data
|
|
256
|
-
* @param
|
|
270
|
+
* @param range current screen range, include row and column
|
|
257
271
|
*/
|
|
258
272
|
private _getMergeCells;
|
|
259
273
|
}
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { IRange } from '@univerjs/core';
|
|
2
|
+
import { Documents } from '../docs/document';
|
|
3
|
+
import { IPaintForRefresh, IPaintForScrolling, SHEET_VIEWPORT_KEY } from './interfaces';
|
|
4
|
+
import { SheetComponent } from './sheet-component';
|
|
2
5
|
import { IBoundRectNoAngle, IViewportInfo, Vector2 } from '../../basics/vector2';
|
|
3
6
|
import { Canvas } from '../../canvas';
|
|
4
7
|
import { UniverRenderingContext2D } from '../../context';
|
|
5
8
|
import { Scene } from '../../scene';
|
|
6
|
-
import { Documents } from '../docs/document';
|
|
7
9
|
import { Background } from './extensions/background';
|
|
8
10
|
import { Border } from './extensions/border';
|
|
9
11
|
import { Font } from './extensions/font';
|
|
10
|
-
import { SheetComponent } from './sheet-component';
|
|
11
12
|
import { SpreadsheetSkeleton } from './sheet-skeleton';
|
|
12
|
-
import { IPaintForRefresh, IPaintForScrolling, SHEET_VIEWPORT_KEY } from './interfaces';
|
|
13
13
|
export declare class Spreadsheet extends SheetComponent {
|
|
14
14
|
private _allowCache;
|
|
15
15
|
private _backgroundExtension;
|
|
@@ -17,7 +17,7 @@ export declare class Slide extends SceneViewer {
|
|
|
17
17
|
*/
|
|
18
18
|
addPageScene(pageScene: Scene): void;
|
|
19
19
|
changePage(id?: string): void;
|
|
20
|
-
hasPage(key: string): import('
|
|
20
|
+
hasPage(key: string): import('../..').ThinScene | undefined;
|
|
21
21
|
addNavigation(): void;
|
|
22
22
|
removeNavigation(): void;
|
|
23
23
|
enableNav(): void;
|
package/lib/types/context.d.ts
CHANGED
|
@@ -15,9 +15,14 @@
|
|
|
15
15
|
*/
|
|
16
16
|
export declare class UniverRenderingContext2D implements CanvasRenderingContext2D {
|
|
17
17
|
__mode: string;
|
|
18
|
+
private _system;
|
|
19
|
+
private _browser;
|
|
18
20
|
readonly canvas: HTMLCanvasElement;
|
|
19
21
|
_context: CanvasRenderingContext2D;
|
|
22
|
+
private _systemType;
|
|
23
|
+
private _browserType;
|
|
20
24
|
constructor(context: CanvasRenderingContext2D);
|
|
25
|
+
isContextLost(): boolean;
|
|
21
26
|
get globalAlpha(): number;
|
|
22
27
|
set globalAlpha(val: number);
|
|
23
28
|
get globalCompositeOperation(): GlobalCompositeOperation;
|
|
@@ -151,6 +156,8 @@ export declare class UniverRenderingContext2D implements CanvasRenderingContext2
|
|
|
151
156
|
* @method
|
|
152
157
|
*/
|
|
153
158
|
closePath(): void;
|
|
159
|
+
getSystemType(): string;
|
|
160
|
+
getBrowserType(): string;
|
|
154
161
|
/**
|
|
155
162
|
* Chrome hardware acceleration causes canvas stroke to fail to draw lines on Mac.
|
|
156
163
|
*/
|
package/lib/types/engine.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { Observable, Subject } from 'rxjs';
|
|
2
|
+
import { Canvas, CanvasRenderMode } from './canvas';
|
|
3
|
+
import { ThinEngine } from './thin-engine';
|
|
2
4
|
import { CURSOR_TYPE } from './basics/const';
|
|
3
5
|
import { ITimeMetric } from './basics/interfaces';
|
|
4
6
|
import { IBasicFrameInfo } from './basics/performance-monitor';
|
|
5
|
-
import { Canvas, CanvasRenderMode } from './canvas';
|
|
6
7
|
import { Scene } from './scene';
|
|
7
|
-
import { ThinEngine } from './thin-engine';
|
|
8
8
|
export declare class Engine extends ThinEngine<Scene> {
|
|
9
9
|
renderEvenInBackground: boolean;
|
|
10
10
|
private readonly _beginFrame$;
|
package/lib/types/index.d.ts
CHANGED
|
@@ -15,43 +15,36 @@
|
|
|
15
15
|
*/
|
|
16
16
|
export * from './base-object';
|
|
17
17
|
export * from './basics';
|
|
18
|
+
export { getOffsetRectForDom } from './basics/position';
|
|
18
19
|
export * from './canvas';
|
|
19
20
|
export * from './components';
|
|
21
|
+
export { DocBackground } from './components/docs/doc-background';
|
|
22
|
+
export { Documents } from './components/docs/document';
|
|
23
|
+
export type { IPageRenderConfig } from './components/docs/document';
|
|
24
|
+
export type { IDocumentOffsetConfig } from './components/docs/document';
|
|
25
|
+
export { getTableIdAndSliceIndex } from './components/docs/layout/block/table';
|
|
26
|
+
export { DocumentSkeleton } from './components/docs/layout/doc-skeleton';
|
|
27
|
+
export type { IFindNodeRestrictions } from './components/docs/layout/doc-skeleton';
|
|
28
|
+
export { getCharSpaceApply, getLastLine, getNumberUnitValue, getPageFromPath, glyphIterator, lineIterator } from './components/docs/layout/tools';
|
|
29
|
+
export { Liquid } from './components/docs/liquid';
|
|
30
|
+
export { DataStreamTreeNode } from './components/docs/view-model/data-stream-tree-node';
|
|
31
|
+
export { DocumentViewModel } from './components/docs/view-model/document-view-model';
|
|
32
|
+
export { DocumentEditArea } from './components/docs/view-model/document-view-model';
|
|
33
|
+
export { parseDataStreamToTree } from './components/docs/view-model/document-view-model';
|
|
34
|
+
export { DEFAULT_PADDING_DATA } from './components/sheets/sheet-skeleton';
|
|
20
35
|
export * from './context';
|
|
21
36
|
export * from './custom';
|
|
22
37
|
export * from './engine';
|
|
23
38
|
export * from './group';
|
|
24
39
|
export * from './layer';
|
|
25
40
|
export { IRenderingEngine, UniverRenderEnginePlugin } from './render-engine';
|
|
26
|
-
export { type RenderComponentType,
|
|
27
|
-
export {
|
|
41
|
+
export { IRenderManagerService, type RenderComponentType, RenderManagerService } from './render-manager/render-manager.service';
|
|
42
|
+
export { type IRender, type IRenderContext, type IRenderModule, RenderUnit } from './render-manager/render-unit';
|
|
28
43
|
export * from './scene';
|
|
44
|
+
export { type IChangeObserverConfig } from './scene.transformer';
|
|
29
45
|
export * from './scene-viewer';
|
|
30
46
|
export * from './scroll-timer';
|
|
31
47
|
export * from './shape';
|
|
32
|
-
export * from './viewport';
|
|
33
|
-
export { DocumentViewModel } from './components/docs/view-model/document-view-model';
|
|
34
|
-
export { getAnchorBounding, TEXT_RANGE_LAYER_INDEX, TextRange, getLineBounding } from './components/docs/text-selection/text-range';
|
|
35
|
-
export { RectRange, convertPositionsToRectRanges } from './components/docs/text-selection/rect-range';
|
|
36
|
-
export { NodePositionConvertToCursor } from './components/docs/text-selection/convert-text-range';
|
|
37
|
-
export { Liquid } from './components/docs/liquid';
|
|
38
|
-
export { getCanvasOffsetByEngine } from './components/docs/text-selection/selection-utils';
|
|
39
|
-
export { ITextSelectionRenderManager, TextSelectionRenderManager, } from './components/docs/text-selection/text-selection-render-manager';
|
|
40
|
-
export type { IActiveTextRange, IEditorInputConfig, ITextSelectionInnerParam } from './components/docs/text-selection/text-selection-render-manager';
|
|
41
|
-
export { Documents } from './components/docs/document';
|
|
42
|
-
export { DocBackground } from './components/docs/doc-background';
|
|
43
|
-
export type { IPageRenderConfig } from './components/docs/document';
|
|
44
|
-
export { DocumentSkeleton } from './components/docs/layout/doc-skeleton';
|
|
45
48
|
export { ThinEngine } from './thin-engine';
|
|
46
|
-
export {
|
|
47
|
-
export
|
|
48
|
-
export { DEFAULT_PADDING_DATA } from './components/sheets/sheet-skeleton';
|
|
49
|
-
export { DocumentEditArea } from './components/docs/view-model/document-view-model';
|
|
50
|
-
export { lineIterator, glyphIterator } from './components/docs/layout/tools';
|
|
51
|
-
export { getOneTextSelectionRange } from './components/docs/text-selection/convert-text-range';
|
|
52
|
-
export { getLastLine } from './components/docs/layout/tools';
|
|
53
|
-
export { DataStreamTreeNode } from './components/docs/view-model/data-stream-tree-node';
|
|
54
|
-
export type { IDocRange } from './components/docs/text-selection/range-interface';
|
|
55
|
-
export { isInSameTableCell, isValidRectRange, NodePositionConvertToRectRange } from './components/docs/text-selection/convert-rect-range';
|
|
56
|
-
export { parseDataStreamToTree } from './components/docs/view-model/document-view-model';
|
|
57
|
-
export { DOC_RANGE_TYPE } from './components/docs/text-selection/range-interface';
|
|
49
|
+
export { ThinScene } from './thin-scene';
|
|
50
|
+
export * from './viewport';
|
|
@@ -4,11 +4,11 @@ import { IUniverEngineRenderConfig } from './controllers/config.schema';
|
|
|
4
4
|
/**
|
|
5
5
|
* The global rendering engine.
|
|
6
6
|
*/
|
|
7
|
-
export declare const IRenderingEngine: import('@
|
|
7
|
+
export declare const IRenderingEngine: import('@wendellhu/redi').IdentifierDecorator<Engine>;
|
|
8
8
|
export declare class UniverRenderEnginePlugin extends Plugin {
|
|
9
9
|
private readonly _config;
|
|
10
10
|
readonly _injector: Injector;
|
|
11
11
|
private readonly _configService;
|
|
12
12
|
static pluginName: string;
|
|
13
|
-
constructor(_config: Partial<IUniverEngineRenderConfig
|
|
13
|
+
constructor(_config: Partial<IUniverEngineRenderConfig> | undefined, _injector: Injector, _configService: IConfigService);
|
|
14
14
|
}
|