@univerjs/engine-render 0.2.11 → 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 +27282 -28633
- package/lib/types/basics/interfaces.d.ts +7 -0
- package/lib/types/basics/performance-monitor.d.ts +56 -27
- package/lib/types/basics/range.d.ts +24 -14
- package/lib/types/basics/tools.d.ts +26 -5
- 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/line-breaker/break.d.ts +2 -1
- package/lib/types/components/docs/layout/line-breaker/enhancers/hyphen-enhancer.d.ts +1 -2
- package/lib/types/components/docs/layout/line-breaker/enhancers/link-enhancer.d.ts +15 -0
- package/lib/types/components/docs/layout/line-breaker/enhancers/utils.d.ts +18 -0
- 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/docs/view-model/document-view-model.d.ts +1 -1
- package/lib/types/components/sheets/extensions/background.d.ts +2 -2
- package/lib/types/components/sheets/extensions/border.d.ts +2 -2
- package/lib/types/components/sheets/extensions/custom.d.ts +2 -2
- 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 +6 -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 +18 -10
- package/lib/types/components/slides/slide.d.ts +1 -1
- package/lib/types/context.d.ts +7 -0
- package/lib/types/controllers/config.schema.d.ts +20 -0
- package/lib/types/engine.d.ts +33 -12
- package/lib/types/index.d.ts +20 -27
- package/lib/types/render-engine.d.ts +6 -3
- package/lib/types/render-manager/render-manager.service.d.ts +5 -5
- package/lib/types/scene.d.ts +13 -7
- package/lib/types/scene.input-manager.d.ts +8 -2
- package/lib/types/scroll-timer.d.ts +4 -1
- package/lib/types/shape/rect.d.ts +15 -6
- package/lib/types/thin-scene.d.ts +8 -3
- 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
|
@@ -100,3 +100,10 @@ export interface INodeSearch {
|
|
|
100
100
|
export interface INodePosition extends INodeSearch {
|
|
101
101
|
isBack: boolean;
|
|
102
102
|
}
|
|
103
|
+
export interface IAfterRender$Info {
|
|
104
|
+
frameTimeMetric: Record<string, number | number[]>;
|
|
105
|
+
tags: {
|
|
106
|
+
scrolling: boolean;
|
|
107
|
+
} & Record<string, any>;
|
|
108
|
+
}
|
|
109
|
+
export type ITimeMetric = [string, number];
|
|
@@ -1,32 +1,51 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
1
|
+
import { Disposable } from '@univerjs/core';
|
|
2
|
+
export declare const DEFAULT_FRAME_SAMPLE_SIZE = 60;
|
|
3
|
+
export declare const DEFAULT_FRAME_LIST_SIZE: number;
|
|
4
|
+
export interface IBasicFrameInfo {
|
|
5
|
+
FPS: number;
|
|
6
|
+
frameTime: number;
|
|
7
|
+
elapsedTime: number;
|
|
8
|
+
}
|
|
9
|
+
export interface IExtendFrameInfo extends IBasicFrameInfo {
|
|
10
|
+
[key: string]: any;
|
|
11
|
+
scrolling: boolean;
|
|
12
|
+
}
|
|
13
|
+
export interface ISummaryFrameInfo {
|
|
14
|
+
FPS: ISummaryMetric;
|
|
15
|
+
frameTime: ISummaryMetric;
|
|
16
|
+
[key: string]: ISummaryMetric;
|
|
17
|
+
}
|
|
18
|
+
export interface ISummaryMetric {
|
|
19
|
+
avg: number;
|
|
20
|
+
min: number;
|
|
21
|
+
max: number;
|
|
22
|
+
}
|
|
16
23
|
/**
|
|
17
24
|
* Performance monitor tracks rolling average frame-time and frame-time variance over a user defined sliding-window
|
|
18
25
|
*/
|
|
19
|
-
export declare class PerformanceMonitor {
|
|
26
|
+
export declare class PerformanceMonitor extends Disposable {
|
|
20
27
|
private _enabled;
|
|
21
28
|
private _rollingFrameTime;
|
|
22
29
|
private _lastFrameTimeMs;
|
|
23
30
|
/**
|
|
24
|
-
*
|
|
25
|
-
|
|
31
|
+
* Counting frame in a second.
|
|
32
|
+
*/
|
|
33
|
+
private _frameCountInLastSecond;
|
|
34
|
+
/**
|
|
35
|
+
* The millisecond value of the last second. For counting frame in a second.
|
|
36
|
+
*/
|
|
37
|
+
private _lastSecondTimeMs;
|
|
38
|
+
/**
|
|
39
|
+
* The FPS values recorded in the past 1 second.
|
|
40
|
+
*/
|
|
41
|
+
private _recFPSValueLastSecond;
|
|
42
|
+
/**
|
|
43
|
+
* @param {number} frameSampleSize The number of samples required to saturate the sliding window
|
|
26
44
|
*/
|
|
27
45
|
constructor(frameSampleSize?: number);
|
|
46
|
+
dispose(): void;
|
|
28
47
|
/**
|
|
29
|
-
* Returns the average frame time in milliseconds
|
|
48
|
+
* Returns the average frame time in milliseconds of the sliding window (or the subset of frames sampled so far)
|
|
30
49
|
*/
|
|
31
50
|
get averageFrameTime(): number;
|
|
32
51
|
/**
|
|
@@ -34,7 +53,7 @@ export declare class PerformanceMonitor {
|
|
|
34
53
|
*/
|
|
35
54
|
get averageFrameTimeVariance(): number;
|
|
36
55
|
/**
|
|
37
|
-
* Returns the frame time of the
|
|
56
|
+
* Returns the frame time of the last recent frame.
|
|
38
57
|
*/
|
|
39
58
|
get instantaneousFrameTime(): number;
|
|
40
59
|
/**
|
|
@@ -54,11 +73,13 @@ export declare class PerformanceMonitor {
|
|
|
54
73
|
*/
|
|
55
74
|
get isEnabled(): boolean;
|
|
56
75
|
/**
|
|
57
|
-
* Samples current frame
|
|
58
|
-
*
|
|
76
|
+
* Samples current frame, set averageFPS instantaneousFrameTime
|
|
77
|
+
* this method is called each frame by engine renderLoop --> endFrame.
|
|
78
|
+
* @param timestamp A timestamp in milliseconds of the current frame to compare with other frames
|
|
59
79
|
*/
|
|
60
|
-
sampleFrame(
|
|
61
|
-
|
|
80
|
+
sampleFrame(timestamp?: number): void;
|
|
81
|
+
endFrame(timestamp: number): void;
|
|
82
|
+
now(): number;
|
|
62
83
|
/**
|
|
63
84
|
* Enables contributions to the sliding window sample set
|
|
64
85
|
*/
|
|
@@ -82,12 +103,16 @@ export declare class RollingAverage {
|
|
|
82
103
|
/**
|
|
83
104
|
* Current average
|
|
84
105
|
*/
|
|
85
|
-
|
|
106
|
+
averageFrameTime: number;
|
|
86
107
|
/**
|
|
87
108
|
* Current variance
|
|
88
109
|
*/
|
|
89
110
|
variance: number;
|
|
90
111
|
protected _samples: number[];
|
|
112
|
+
/**
|
|
113
|
+
* for isStaturated
|
|
114
|
+
* max value of _sampleCount is length of _samples
|
|
115
|
+
*/
|
|
91
116
|
protected _sampleCount: number;
|
|
92
117
|
protected _pos: number;
|
|
93
118
|
protected _m2: number;
|
|
@@ -96,11 +121,15 @@ export declare class RollingAverage {
|
|
|
96
121
|
* @param length The number of samples required to saturate the sliding window
|
|
97
122
|
*/
|
|
98
123
|
constructor(length: number);
|
|
124
|
+
/**
|
|
125
|
+
* Calc average frameTime and variance.
|
|
126
|
+
*/
|
|
127
|
+
calcAverageFrameTime(): void;
|
|
99
128
|
/**
|
|
100
129
|
* Adds a sample to the sample set
|
|
101
|
-
* @param
|
|
130
|
+
* @param frameTime The sample value
|
|
102
131
|
*/
|
|
103
|
-
|
|
132
|
+
addFrameTime(frameTime: number): void;
|
|
104
133
|
/**
|
|
105
134
|
* Returns previously added values or null if outside of history or outside the sliding window domain
|
|
106
135
|
* @param i Index in history. For example, pass 0 for the most recent value and 1 for the value before that
|
|
@@ -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
|
|
@@ -128,10 +148,11 @@ export declare function inCurrentAndAboveViewRanges(ranges: IRange[], rowIndex:
|
|
|
128
148
|
*/
|
|
129
149
|
export declare function inRowViewRanges(ranges: IRange[], rowIndex: number): boolean;
|
|
130
150
|
/**
|
|
131
|
-
*
|
|
132
|
-
* @param ranges
|
|
151
|
+
* If there is an intersection in ranges to the mainRanges, extend it to the first set of ranges.
|
|
152
|
+
* @param {IRange[]} mainRanges target ranges
|
|
153
|
+
* @param {IRange[]} ranges
|
|
133
154
|
*/
|
|
134
|
-
export declare function
|
|
155
|
+
export declare function expandRangeIfIntersects(mainRanges: IRange[], ranges: IRange[]): IRange[];
|
|
135
156
|
export declare function clampRanges(range: IRange): {
|
|
136
157
|
startRow: number;
|
|
137
158
|
startColumn: number;
|
|
@@ -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",
|
|
@@ -3,7 +3,6 @@ import { Break } from '../break';
|
|
|
3
3
|
import { IBreakPoints, LineBreaker } from '../line-breaker';
|
|
4
4
|
import { Hyphen } from '../../hyphenation/hyphen';
|
|
5
5
|
import { Lang } from '../../hyphenation/lang';
|
|
6
|
-
export declare function isLetter(char: string): boolean;
|
|
7
6
|
export declare class LineBreakerHyphenEnhancer implements IBreakPoints {
|
|
8
7
|
private _lineBreaker;
|
|
9
8
|
private _hyphen;
|
|
@@ -15,7 +14,7 @@ export declare class LineBreakerHyphenEnhancer implements IBreakPoints {
|
|
|
15
14
|
private _word;
|
|
16
15
|
private _hyphenIndex;
|
|
17
16
|
private _hyphenSlice;
|
|
18
|
-
|
|
17
|
+
content: string;
|
|
19
18
|
constructor(_lineBreaker: LineBreaker, _hyphen: Hyphen, _lang: Lang, _doNotHyphenateCaps?: boolean);
|
|
20
19
|
nextBreakPoint(): Nullable<Break>;
|
|
21
20
|
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Nullable } from '@univerjs/core';
|
|
2
|
+
import { IBreakPoints, LineBreaker } from '../line-breaker';
|
|
3
|
+
import { Break } from '../break';
|
|
4
|
+
export declare class LineBreakerLinkEnhancer implements IBreakPoints {
|
|
5
|
+
private _lineBreaker;
|
|
6
|
+
private _curBreak;
|
|
7
|
+
private _nextBreak;
|
|
8
|
+
private _isInLink;
|
|
9
|
+
private _link;
|
|
10
|
+
private _index;
|
|
11
|
+
private _linkSlice;
|
|
12
|
+
content: string;
|
|
13
|
+
constructor(_lineBreaker: LineBreaker);
|
|
14
|
+
nextBreakPoint(): Nullable<Break>;
|
|
15
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2023-present DreamNum Inc.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
export declare function isLetter(char: string): boolean;
|
|
17
|
+
export declare function getWord(str: string): string;
|
|
18
|
+
export declare function getSlicePosition(lastPos: number, hyphenSlice: string[], index: number): number;
|
|
@@ -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 {};
|
|
@@ -55,7 +55,7 @@ export declare class DocumentViewModel implements IDisposable {
|
|
|
55
55
|
getCustomBlock(index: number): import('@univerjs/core').ICustomBlock | undefined;
|
|
56
56
|
getCustomBlockWithoutSetCurrentIndex(index: number): import('@univerjs/core').ICustomBlock | undefined;
|
|
57
57
|
getTable(index: number): import('@univerjs/core').ITable | undefined;
|
|
58
|
-
getCustomRangeRaw(index: number): import('@univerjs/core').ICustomRange | undefined;
|
|
58
|
+
getCustomRangeRaw(index: number): import('@univerjs/core').ICustomRange<Record<string, any>> | undefined;
|
|
59
59
|
getCustomRange(index: number): Nullable<ICustomRangeForInterceptor>;
|
|
60
60
|
getCustomDecorationRaw(index: number): import('@univerjs/core').ICustomDecoration | undefined;
|
|
61
61
|
getCustomDecoration(index: number): Nullable<ICustomDecorationForInterceptor>;
|
|
@@ -1,12 +1,12 @@
|
|
|
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;
|
|
9
9
|
PRINTING_Z_INDEX: number;
|
|
10
10
|
get zIndex(): number;
|
|
11
|
-
draw(ctx: UniverRenderingContext,
|
|
11
|
+
draw(ctx: UniverRenderingContext, _parentScale: IScale, spreadsheetSkeleton: SpreadsheetSkeleton, diffRanges: IRange[], { viewRanges, checkOutOfViewBound }: IDrawInfo): void;
|
|
12
12
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
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;
|
|
8
|
-
draw(ctx: UniverRenderingContext,
|
|
8
|
+
draw(ctx: UniverRenderingContext, _parentScale: IScale, spreadsheetSkeleton: SpreadsheetSkeleton, diffRanges: IRange[]): void;
|
|
9
9
|
private _getOverflowExclusion;
|
|
10
10
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
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;
|
|
8
|
-
draw(ctx: UniverRenderingContext,
|
|
8
|
+
draw(ctx: UniverRenderingContext, _parentScale: IScale, skeleton: SpreadsheetSkeleton, diffRanges: IRange[] | undefined): void;
|
|
9
9
|
}
|
|
@@ -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';
|
|
4
|
+
import { IARowCfg, IARowCfgObj, IColumnStyleCfg, IRowStyleCfg } from '../interfaces';
|
|
3
5
|
import { SpreadsheetSkeleton } from '../sheet-skeleton';
|
|
4
|
-
import { IARowCfg, IARowCfgObj, IColumnStyleCfg, IRowStyleCfg } from '../interfaces.ts';
|
|
5
|
-
import { SheetExtension } from './sheet-extension';
|
|
6
6
|
export interface IRowsHeaderCfgParam {
|
|
7
7
|
headerStyle?: Partial<IRowStyleCfg>;
|
|
8
8
|
rowsCfg?: IARowCfg[];
|
|
@@ -4,6 +4,10 @@ import { SpreadsheetSkeleton } from '../sheet-skeleton';
|
|
|
4
4
|
export declare enum SHEET_EXTENSION_TYPE {
|
|
5
5
|
GRID = 0
|
|
6
6
|
}
|
|
7
|
+
/**
|
|
8
|
+
* for distinguish doc & slides extensions, now only used when metric performance.
|
|
9
|
+
*/
|
|
10
|
+
export declare const SHEET_EXTENSION_PREFIX = "sheet-ext-";
|
|
7
11
|
export declare class SheetExtension extends ComponentExtension<SpreadsheetSkeleton, SHEET_EXTENSION_TYPE, IRange[]> {
|
|
8
12
|
type: SHEET_EXTENSION_TYPE;
|
|
9
13
|
/**
|
|
@@ -14,9 +18,9 @@ export declare class SheetExtension extends ComponentExtension<SpreadsheetSkelet
|
|
|
14
18
|
* @param rowHeightAccumulation
|
|
15
19
|
* @param columnWidthAccumulation
|
|
16
20
|
* @param dataMergeCache
|
|
17
|
-
* @returns ISelectionCellWithMergeInfo
|
|
21
|
+
* @returns {ISelectionCellWithMergeInfo} cell Position & mergeInfo
|
|
18
22
|
*/
|
|
19
|
-
|
|
23
|
+
getCellByIndex(rowIndex: number, columnIndex: number, rowHeightAccumulation: number[], columnWidthAccumulation: number[], dataMergeCache: IRange[]): import('@univerjs/core').ISelectionCellWithMergeInfo;
|
|
20
24
|
isRenderDiffRangesByCell(rangeP: IRange, diffRanges?: IRange[]): boolean;
|
|
21
25
|
isRenderDiffRangesByColumn(curStartColumn: number, curEndColumn: number, diffRanges?: IRange[]): boolean;
|
|
22
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;
|