@univerjs/engine-render 0.1.2 → 0.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cjs/index.js +2 -2
- package/lib/es/index.js +11751 -11496
- package/lib/types/basics/document-node-tools.d.ts +8 -8
- package/lib/types/basics/draw.d.ts +8 -1
- package/lib/types/basics/i-document-skeleton-cached.d.ts +13 -7
- package/lib/types/basics/interfaces.d.ts +3 -3
- package/lib/types/basics/text-rotation.d.ts +1 -1
- package/lib/types/basics/tools.d.ts +4 -0
- package/lib/types/{components/docs/block/index.d.ts → basics/viewport-subtract.d.ts} +2 -3
- package/lib/types/components/component.d.ts +2 -2
- package/lib/types/components/docs/doc-component.d.ts +4 -4
- package/lib/types/components/docs/doc-extension.d.ts +2 -2
- package/lib/types/components/docs/document.d.ts +2 -1
- package/lib/types/components/docs/extensions/background.d.ts +2 -2
- package/lib/types/components/docs/extensions/border.d.ts +2 -2
- package/lib/types/components/docs/extensions/font-and-base-line.d.ts +2 -2
- package/lib/types/components/docs/extensions/line.d.ts +2 -2
- package/lib/types/components/docs/{block → layout/block}/paragraph/bullet.d.ts +1 -1
- package/lib/types/components/docs/{block → layout/block}/paragraph/inline-drawing.d.ts +2 -2
- package/lib/types/components/docs/{block → layout/block}/paragraph/language-ruler.d.ts +7 -7
- package/lib/types/components/docs/{block → layout/block}/paragraph/layout-ruler.d.ts +3 -3
- package/lib/types/components/docs/{block/paragraph/paragraph.d.ts → layout/block/paragraph/layout.d.ts} +4 -4
- package/lib/types/components/docs/{block/paragraph/index.d.ts → layout/block/paragraph/line-adjustment.d.ts} +3 -6
- package/lib/types/components/docs/layout/block/paragraph/linebreaking.d.ts +21 -0
- package/lib/types/components/docs/layout/block/paragraph/shaping.d.ts +25 -0
- package/lib/types/components/docs/{block → layout/block}/section.d.ts +5 -5
- package/lib/types/components/docs/{doc-skeleton.d.ts → layout/doc-skeleton.d.ts} +9 -9
- package/lib/types/components/docs/layout/model/__test__/glyph.spec.d.ts +16 -0
- package/lib/types/components/docs/{common → layout/model}/column.d.ts +1 -1
- package/lib/types/components/docs/layout/model/glyph.d.ts +31 -0
- package/lib/types/components/docs/{common → layout/model}/line.d.ts +1 -1
- package/lib/types/components/docs/{common → layout/model}/page.d.ts +3 -3
- package/lib/types/components/docs/{common → layout/model}/section.d.ts +1 -1
- package/lib/types/components/docs/{common → layout}/tools.d.ts +4 -4
- package/lib/types/components/docs/{common/liquid.d.ts → liquid.d.ts} +4 -4
- package/lib/types/components/docs/{common → text-selection}/convert-cursor.d.ts +4 -4
- package/lib/types/components/docs/{common → text-selection}/text-range.d.ts +1 -1
- package/lib/types/components/docs/{text-selection-render-manager.d.ts → text-selection/text-selection-render-manager.d.ts} +14 -11
- package/lib/types/components/index.d.ts +1 -1
- package/lib/types/components/sheets/extensions/font.d.ts +10 -6
- package/lib/types/components/sheets/interfaces.d.ts +3 -2
- package/lib/types/components/sheets/sheet-skeleton.d.ts +23 -11
- package/lib/types/context.d.ts +71 -1
- package/lib/types/engine.d.ts +2 -0
- package/lib/types/index.d.ts +9 -1
- package/lib/types/layer.d.ts +1 -0
- package/lib/types/render-manager.service.d.ts +1 -0
- package/lib/types/scene.d.ts +2 -2
- package/lib/types/thin-scene.d.ts +4 -1
- package/lib/types/viewport.d.ts +0 -3
- package/lib/umd/index.js +2 -2
- package/package.json +11 -10
- package/lib/types/components/docs/common/index.d.ts +0 -24
- package/lib/types/components/docs/common/span.d.ts +0 -28
- package/lib/types/components/docs/index.d.ts +0 -22
- /package/lib/types/components/docs/{block → layout/block}/block-error.d.ts +0 -0
- /package/lib/types/components/docs/{block → layout/block}/paragraph/bullet-ruler.d.ts +0 -0
- /package/lib/types/components/docs/{linebreak → layout/linebreak}/__tests__/linebreak.spec.d.ts +0 -0
- /package/lib/types/components/docs/{linebreak → layout/linebreak}/break.d.ts +0 -0
- /package/lib/types/components/docs/{linebreak → layout/linebreak}/classes.d.ts +0 -0
- /package/lib/types/components/docs/{linebreak → layout/linebreak}/extensions/tab-linebreak-extension.d.ts +0 -0
- /package/lib/types/components/docs/{linebreak → layout/linebreak}/index.d.ts +0 -0
- /package/lib/types/components/docs/{linebreak → layout/linebreak}/linebreaker.d.ts +0 -0
- /package/lib/types/components/docs/{linebreak → layout/linebreak}/pairs.d.ts +0 -0
- /package/lib/types/components/docs/{linebreak → layout/linebreak}/rule.d.ts +0 -0
- /package/lib/types/components/docs/{linebreak → layout/linebreak}/swap.d.ts +0 -0
- /package/lib/types/components/docs/{linebreak → layout/linebreak}/tiny-inflate.d.ts +0 -0
- /package/lib/types/components/docs/{linebreak → layout/linebreak}/trie-data.d.ts +0 -0
- /package/lib/types/components/docs/{linebreak → layout/linebreak}/unicode-trie.d.ts +0 -0
- /package/lib/types/{scene.-transformer.d.ts → scene.transformer.d.ts} +0 -0
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
*/
|
|
16
16
|
import type { INumberUnit, IParagraphStyle, ITextStyle, ObjectPositionH, ObjectPositionV } from '@univerjs/core';
|
|
17
17
|
import { BooleanNumber, GridType, SpacingRule } from '@univerjs/core';
|
|
18
|
-
import type { IDocumentSkeletonColumn, IDocumentSkeletonDivide, IDocumentSkeletonLine, IDocumentSkeletonPage
|
|
18
|
+
import type { IDocumentSkeletonColumn, IDocumentSkeletonDivide, IDocumentSkeletonGlyph, IDocumentSkeletonLine, IDocumentSkeletonPage } from '../../../basics/i-document-skeleton-cached';
|
|
19
19
|
import type { IParagraphConfig, ISectionBreakConfig } from '../../../basics/interfaces';
|
|
20
20
|
import type { DataStreamTreeNode } from '../view-model/data-stream-tree-node';
|
|
21
21
|
import type { DocumentViewModel } from '../view-model/document-view-model';
|
|
@@ -39,7 +39,7 @@ export declare function getLastNotFullDivideInfo(page: IDocumentSkeletonPage): {
|
|
|
39
39
|
} | undefined;
|
|
40
40
|
export declare function getNextDivide(curLine: IDocumentSkeletonLine, curDivide: IDocumentSkeletonDivide): IDocumentSkeletonDivide | undefined;
|
|
41
41
|
export declare function getLastRemainingDivide(curLine: IDocumentSkeletonLine): IDocumentSkeletonDivide | undefined;
|
|
42
|
-
export declare function getLastSpan(page: IDocumentSkeletonPage):
|
|
42
|
+
export declare function getLastSpan(page: IDocumentSkeletonPage): IDocumentSkeletonGlyph | undefined;
|
|
43
43
|
export declare function isColumnFull(page: IDocumentSkeletonPage): boolean;
|
|
44
44
|
export declare function isBlankPage(page: IDocumentSkeletonPage): boolean;
|
|
45
45
|
export declare function isBlankColumn(column: IDocumentSkeletonColumn): boolean;
|
|
@@ -62,12 +62,12 @@ export declare function getCharSpaceConfig(sectionBreakConfig: ISectionBreakConf
|
|
|
62
62
|
snapToGrid: BooleanNumber;
|
|
63
63
|
};
|
|
64
64
|
export declare function updateBlockIndex(pages: IDocumentSkeletonPage[], start?: number): void;
|
|
65
|
-
export declare function spanIterator(pages: IDocumentSkeletonPage[], iteratorFunction: (
|
|
65
|
+
export declare function spanIterator(pages: IDocumentSkeletonPage[], iteratorFunction: (glyph: IDocumentSkeletonGlyph) => void): void;
|
|
66
66
|
export declare function lineIterator(pages: IDocumentSkeletonPage[], iteratorFunction: (line: IDocumentSkeletonLine) => void): void;
|
|
67
67
|
export declare function columnIterator(pages: IDocumentSkeletonPage[], iteratorFunction: (column: IDocumentSkeletonColumn) => void): void;
|
|
68
68
|
export declare function getPositionHorizon(positionH: ObjectPositionH, column: IDocumentSkeletonColumn, page: IDocumentSkeletonPage, objectWidth: number, isPageBreak?: boolean): number | undefined;
|
|
69
69
|
export declare function getPositionVertical(positionV: ObjectPositionV, page: IDocumentSkeletonPage, lineTop: number, lineHeight: number, objectHeight: number, blockAnchorTop?: number, isPageBreak?: boolean): number | undefined;
|
|
70
|
-
export declare function
|
|
70
|
+
export declare function getGlyphGroupWidth(divide: IDocumentSkeletonDivide): number;
|
|
71
71
|
interface IFontCreateConfig {
|
|
72
72
|
fontStyle: {
|
|
73
73
|
fontString: string;
|
|
@@ -13,8 +13,8 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
import type { IDocumentSkeletonColumn, IDocumentSkeletonDivide, IDocumentSkeletonLine, IDocumentSkeletonPage, IDocumentSkeletonSection
|
|
17
|
-
import { PageLayoutType } from '
|
|
16
|
+
import type { IDocumentSkeletonColumn, IDocumentSkeletonDivide, IDocumentSkeletonGlyph, IDocumentSkeletonLine, IDocumentSkeletonPage, IDocumentSkeletonSection } from '../../basics/i-document-skeleton-cached';
|
|
17
|
+
import { PageLayoutType } from '../../basics/i-document-skeleton-cached';
|
|
18
18
|
export declare class Liquid {
|
|
19
19
|
private _translateX;
|
|
20
20
|
private _translateY;
|
|
@@ -28,7 +28,7 @@ export declare class Liquid {
|
|
|
28
28
|
translateRestore(): void;
|
|
29
29
|
translatePagePadding(page: IDocumentSkeletonPage): void;
|
|
30
30
|
restorePagePadding(page: IDocumentSkeletonPage): void;
|
|
31
|
-
translatePage(page: IDocumentSkeletonPage, type?: PageLayoutType, left?: number, top?: number,
|
|
31
|
+
translatePage(page: IDocumentSkeletonPage, type?: PageLayoutType, left?: number, top?: number, _right?: number, _bottom?: number): {
|
|
32
32
|
x: number;
|
|
33
33
|
y: number;
|
|
34
34
|
};
|
|
@@ -48,7 +48,7 @@ export declare class Liquid {
|
|
|
48
48
|
x: number;
|
|
49
49
|
y: number;
|
|
50
50
|
};
|
|
51
|
-
translateSpan(
|
|
51
|
+
translateSpan(glyph: IDocumentSkeletonGlyph): {
|
|
52
52
|
x: number;
|
|
53
53
|
y: number;
|
|
54
54
|
};
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
import type { ITextRange, Nullable } from '@univerjs/core';
|
|
17
17
|
import type { INodePosition } from '../../../basics/interfaces';
|
|
18
18
|
import type { IPoint } from '../../../basics/vector2';
|
|
19
|
-
import type { DocumentSkeleton } from '../doc-skeleton';
|
|
19
|
+
import type { DocumentSkeleton } from '../layout/doc-skeleton';
|
|
20
20
|
import type { IDocumentOffsetConfig } from '../document';
|
|
21
21
|
export declare enum NodePositionStateType {
|
|
22
22
|
NORMAL = 0,
|
|
@@ -29,7 +29,7 @@ export declare enum NodePositionType {
|
|
|
29
29
|
column = 2,
|
|
30
30
|
line = 3,
|
|
31
31
|
divide = 4,
|
|
32
|
-
|
|
32
|
+
glyph = 5
|
|
33
33
|
}
|
|
34
34
|
export interface ICurrentNodePositionState {
|
|
35
35
|
page: NodePositionStateType;
|
|
@@ -37,7 +37,7 @@ export interface ICurrentNodePositionState {
|
|
|
37
37
|
column: NodePositionStateType;
|
|
38
38
|
line: NodePositionStateType;
|
|
39
39
|
divide: NodePositionStateType;
|
|
40
|
-
|
|
40
|
+
glyph: NodePositionStateType;
|
|
41
41
|
}
|
|
42
42
|
export declare const NodePositionMap: {
|
|
43
43
|
page: number;
|
|
@@ -45,7 +45,7 @@ export declare const NodePositionMap: {
|
|
|
45
45
|
column: number;
|
|
46
46
|
line: number;
|
|
47
47
|
divide: number;
|
|
48
|
-
|
|
48
|
+
glyph: number;
|
|
49
49
|
};
|
|
50
50
|
export declare function compareNodePositionLogic(pos1: INodePosition, pos2: INodePosition): boolean;
|
|
51
51
|
export declare function compareNodePosition(pos1: INodePosition, pos2: INodePosition): {
|
|
@@ -21,7 +21,7 @@ import type { IPoint } from '../../../basics/vector2';
|
|
|
21
21
|
import type { Scene } from '../../../scene';
|
|
22
22
|
import { Rect } from '../../../shape/rect';
|
|
23
23
|
import type { ThinScene } from '../../../thin-scene';
|
|
24
|
-
import type { DocumentSkeleton } from '../doc-skeleton';
|
|
24
|
+
import type { DocumentSkeleton } from '../layout/doc-skeleton';
|
|
25
25
|
import type { Documents } from '../document';
|
|
26
26
|
export declare const TEXT_RANGE_LAYER_INDEX = 1;
|
|
27
27
|
export declare function cursorConvertToTextRange(scene: Scene, range: ISuccinctTextRangeParam, docSkeleton: DocumentSkeleton, document: Documents): Nullable<TextRange>;
|
|
@@ -16,15 +16,15 @@
|
|
|
16
16
|
import type { Nullable } from '@univerjs/core';
|
|
17
17
|
import { ILogService, RxDisposable } from '@univerjs/core';
|
|
18
18
|
import type { Observable } from 'rxjs';
|
|
19
|
-
import type { IMouseEvent, IPointerEvent } from '
|
|
20
|
-
import type { INodePosition } from '
|
|
21
|
-
import type { ISuccinctTextRangeParam, ITextRangeWithStyle, ITextSelectionStyle, RANGE_DIRECTION } from '
|
|
22
|
-
import type { Engine } from '
|
|
23
|
-
import type { Scene } from '
|
|
24
|
-
import type { Viewport } from '
|
|
25
|
-
import {
|
|
26
|
-
import type {
|
|
27
|
-
import
|
|
19
|
+
import type { IMouseEvent, IPointerEvent } from '../../../basics/i-events';
|
|
20
|
+
import type { INodePosition } from '../../../basics/interfaces';
|
|
21
|
+
import type { ISuccinctTextRangeParam, ITextRangeWithStyle, ITextSelectionStyle, RANGE_DIRECTION } from '../../../basics/range';
|
|
22
|
+
import type { Engine } from '../../../engine';
|
|
23
|
+
import type { Scene } from '../../../scene';
|
|
24
|
+
import type { Viewport } from '../../../viewport';
|
|
25
|
+
import type { DocumentSkeleton } from '../layout/doc-skeleton';
|
|
26
|
+
import type { Documents } from '../document';
|
|
27
|
+
import { TextRange } from './text-range';
|
|
28
28
|
export declare function getCanvasOffsetByEngine(engine: Nullable<Engine>): {
|
|
29
29
|
left: number;
|
|
30
30
|
top: number;
|
|
@@ -77,6 +77,7 @@ export interface ITextSelectionRenderManager {
|
|
|
77
77
|
handleDblClick(evt: IPointerEvent | IMouseEvent): void;
|
|
78
78
|
handleTripleClick(evt: IPointerEvent | IMouseEvent): void;
|
|
79
79
|
eventTrigger(evt: IPointerEvent | IMouseEvent): void;
|
|
80
|
+
setCursorManually(evtOffsetX: number, evtOffsetY: number): void;
|
|
80
81
|
}
|
|
81
82
|
export interface IEditorInputConfig {
|
|
82
83
|
event: Event | CompositionEvent | KeyboardEvent;
|
|
@@ -111,8 +112,9 @@ export declare class TextSelectionRenderManager extends RxDisposable implements
|
|
|
111
112
|
private _container;
|
|
112
113
|
private _inputParent;
|
|
113
114
|
private _input;
|
|
114
|
-
private
|
|
115
|
-
private
|
|
115
|
+
private _moveObservers;
|
|
116
|
+
private _upObservers;
|
|
117
|
+
private _scrollTimers;
|
|
116
118
|
private _viewportScrollX;
|
|
117
119
|
private _viewportScrollY;
|
|
118
120
|
private _rangeList;
|
|
@@ -143,6 +145,7 @@ export declare class TextSelectionRenderManager extends RxDisposable implements
|
|
|
143
145
|
changeRuntime(docSkeleton: DocumentSkeleton, scene: Scene, document: Documents): void;
|
|
144
146
|
handleDblClick(evt: IPointerEvent | IMouseEvent): void;
|
|
145
147
|
handleTripleClick(evt: IPointerEvent | IMouseEvent): void;
|
|
148
|
+
setCursorManually(evtOffsetX: number, evtOffsetY: number): void;
|
|
146
149
|
eventTrigger(evt: IPointerEvent | IMouseEvent): void;
|
|
147
150
|
removeAllTextRanges(): void;
|
|
148
151
|
private _getAllTextRanges;
|
|
@@ -14,8 +14,8 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
export * from './component';
|
|
17
|
-
export * from './docs';
|
|
18
17
|
export * from './extension';
|
|
19
18
|
export * from './sheets';
|
|
20
19
|
export * from './skeleton';
|
|
20
|
+
export { RENDER_RAW_FORMULA_KEY } from './sheets/sheet-skeleton';
|
|
21
21
|
export * from './slides';
|
|
@@ -13,19 +13,23 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
import type {
|
|
17
|
-
import { ObjectMatrix } from '@univerjs/core';
|
|
16
|
+
import type { IRange, IScale } from '@univerjs/core';
|
|
18
17
|
import type { UniverRenderingContext } from '../../../context';
|
|
19
18
|
import { type SpreadsheetSkeleton } from '../sheet-skeleton';
|
|
20
|
-
import type { Spreadsheet } from '../spreadsheet';
|
|
21
19
|
import { SheetExtension } from './sheet-extension';
|
|
20
|
+
export interface ISheetFontRenderExtension {
|
|
21
|
+
fontRenderExtension?: {
|
|
22
|
+
leftOffset?: number;
|
|
23
|
+
rightOffset?: number;
|
|
24
|
+
topOffset?: number;
|
|
25
|
+
downOffset?: number;
|
|
26
|
+
isSkip?: boolean;
|
|
27
|
+
};
|
|
28
|
+
}
|
|
22
29
|
export declare class Font extends SheetExtension {
|
|
23
30
|
uKey: string;
|
|
24
31
|
Z_INDEX: number;
|
|
25
|
-
changeFontColor: ObjectMatrix<IColorStyle>;
|
|
26
|
-
get spreadsheet(): Spreadsheet;
|
|
27
32
|
getDocuments(): any;
|
|
28
|
-
setChangeFontColor(r: number, c: number, color: IColorStyle): void;
|
|
29
33
|
draw(ctx: UniverRenderingContext, parentScale: IScale, spreadsheetSkeleton: SpreadsheetSkeleton, diffRanges?: IRange[]): void;
|
|
30
34
|
private _renderDocuments;
|
|
31
35
|
private _clipRectangle;
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
*/
|
|
16
16
|
import type { BorderStyleTypes, HorizontalAlign, ISelectionCellWithCoord, ObjectMatrix, VerticalAlign, WrapStrategy } from '@univerjs/core';
|
|
17
17
|
import type { BORDER_TYPE } from '../../basics/const';
|
|
18
|
-
import type { DocumentSkeleton } from '../docs/doc-skeleton';
|
|
18
|
+
import type { DocumentSkeleton } from '../docs/layout/doc-skeleton';
|
|
19
19
|
export interface BorderCache {
|
|
20
20
|
[key: string]: BorderCacheItem | {};
|
|
21
21
|
}
|
|
@@ -26,7 +26,8 @@ export interface BorderCacheItem {
|
|
|
26
26
|
}
|
|
27
27
|
export interface IFontCacheItem {
|
|
28
28
|
documentSkeleton: DocumentSkeleton;
|
|
29
|
-
|
|
29
|
+
vertexAngle?: number;
|
|
30
|
+
centerAngle?: number;
|
|
30
31
|
verticalAlign: VerticalAlign;
|
|
31
32
|
horizontalAlign: HorizontalAlign;
|
|
32
33
|
wrapStrategy: WrapStrategy;
|
|
@@ -13,10 +13,10 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
import type { ICellData, IPaddingData, IRange, ISelectionCellWithCoord, ITextRotation, IWorksheetData,
|
|
17
|
-
import { BooleanNumber, DocumentDataModel, HorizontalAlign, ObjectMatrix, VerticalAlign, WrapStrategy } from '@univerjs/core';
|
|
16
|
+
import type { ICellData, IPaddingData, IRange, ISelectionCellWithCoord, ITextRotation, IWorksheetData, Nullable, Styles, Worksheet } from '@univerjs/core';
|
|
17
|
+
import { BooleanNumber, DocumentDataModel, HorizontalAlign, IContextService, LocaleService, ObjectMatrix, VerticalAlign, WrapStrategy } from '@univerjs/core';
|
|
18
18
|
import type { IBoundRectNoAngle, IViewportBound } from '../../basics/vector2';
|
|
19
|
-
import { DocumentSkeleton } from '../docs/doc-skeleton';
|
|
19
|
+
import { DocumentSkeleton } from '../docs/layout/doc-skeleton';
|
|
20
20
|
import { Skeleton } from '../skeleton';
|
|
21
21
|
import type { IStylesCache } from './interfaces';
|
|
22
22
|
/**
|
|
@@ -48,14 +48,16 @@ export interface IDocumentLayoutObject {
|
|
|
48
48
|
paddingData: IPaddingData;
|
|
49
49
|
fill?: Nullable<string>;
|
|
50
50
|
}
|
|
51
|
+
export declare const RENDER_RAW_FORMULA_KEY = "RENDER_RAW_FORMULA";
|
|
51
52
|
export declare class SpreadsheetSkeleton extends Skeleton {
|
|
52
53
|
private _worksheet;
|
|
53
54
|
private _config;
|
|
54
55
|
private _cellData;
|
|
55
56
|
private _styles;
|
|
57
|
+
private readonly _contextService;
|
|
56
58
|
private _rowHeightAccumulation;
|
|
57
|
-
private _rowTotalHeight;
|
|
58
59
|
private _columnWidthAccumulation;
|
|
60
|
+
private _rowTotalHeight;
|
|
59
61
|
private _columnTotalWidth;
|
|
60
62
|
private _rowHeaderWidth;
|
|
61
63
|
private _columnHeaderHeight;
|
|
@@ -63,11 +65,13 @@ export declare class SpreadsheetSkeleton extends Skeleton {
|
|
|
63
65
|
private _dataMergeCache;
|
|
64
66
|
private _overflowCache;
|
|
65
67
|
private _stylesCache;
|
|
68
|
+
/** A matrix to store if a (row, column) position has render cache. */
|
|
66
69
|
private _renderedCellCache;
|
|
67
70
|
private _showGridlines;
|
|
68
71
|
private _marginTop;
|
|
69
72
|
private _marginLeft;
|
|
70
|
-
|
|
73
|
+
private _renderRawFormula;
|
|
74
|
+
constructor(_worksheet: Worksheet | undefined, _config: IWorksheetData, _cellData: ObjectMatrix<Nullable<ICellData>>, _styles: Styles, _localeService: LocaleService, _contextService: IContextService);
|
|
71
75
|
get rowHeightAccumulation(): number[];
|
|
72
76
|
get rowTotalHeight(): number;
|
|
73
77
|
get columnWidthAccumulation(): number[];
|
|
@@ -82,14 +86,11 @@ export declare class SpreadsheetSkeleton extends Skeleton {
|
|
|
82
86
|
get mergeData(): IRange[];
|
|
83
87
|
get rowHeaderWidthAndMarginLeft(): number;
|
|
84
88
|
get columnHeaderHeightAndMarginTop(): number;
|
|
89
|
+
get worksheet(): Worksheet | undefined;
|
|
85
90
|
/**
|
|
86
91
|
* @deprecated
|
|
87
92
|
*/
|
|
88
|
-
static create(worksheet: Worksheet | undefined, config: IWorksheetData, cellData: ObjectMatrix<Nullable<ICellData>>, styles: Styles, LocaleService:
|
|
89
|
-
/**
|
|
90
|
-
* @deprecated should never expose a property that is provided by another module!
|
|
91
|
-
*/
|
|
92
|
-
getWorksheetConfig(): IWorksheetData;
|
|
93
|
+
static create(worksheet: Worksheet | undefined, config: IWorksheetData, cellData: ObjectMatrix<Nullable<ICellData>>, styles: Styles, localeService: LocaleService, contextService: IContextService): SpreadsheetSkeleton;
|
|
93
94
|
/**
|
|
94
95
|
* @deprecated should never expose a property that is provided by another module!
|
|
95
96
|
*/
|
|
@@ -98,6 +99,7 @@ export declare class SpreadsheetSkeleton extends Skeleton {
|
|
|
98
99
|
* @deprecated should never expose a property that is provided by another module!
|
|
99
100
|
*/
|
|
100
101
|
getsStyles(): Styles;
|
|
102
|
+
private _initContextListener;
|
|
101
103
|
setOverflowCache(value: ObjectMatrix<IRange>): void;
|
|
102
104
|
setMarginLeft(left: number): void;
|
|
103
105
|
setMarginTop(top: number): void;
|
|
@@ -106,7 +108,7 @@ export declare class SpreadsheetSkeleton extends Skeleton {
|
|
|
106
108
|
calculate(bounds?: IViewportBound): this;
|
|
107
109
|
calculateAutoHeightInRange(ranges: Nullable<IRange[]>): IRowAutoHeightInfo[];
|
|
108
110
|
private _calculateRowAutoHeight;
|
|
109
|
-
|
|
111
|
+
private _updateLayout;
|
|
110
112
|
private _dynamicallyUpdateRowHeaderWidth;
|
|
111
113
|
getRowColumnSegment(bounds?: IViewportBound): {
|
|
112
114
|
startRow: number;
|
|
@@ -114,6 +116,11 @@ export declare class SpreadsheetSkeleton extends Skeleton {
|
|
|
114
116
|
startColumn: number;
|
|
115
117
|
endColumn: number;
|
|
116
118
|
};
|
|
119
|
+
/**
|
|
120
|
+
* @deprecated should never expose a property that is provided by another module!
|
|
121
|
+
* @returns
|
|
122
|
+
*/
|
|
123
|
+
getWorksheetConfig(): IWorksheetData;
|
|
117
124
|
getRowColumnSegmentByViewBound(bound?: IBoundRectNoAngle): {
|
|
118
125
|
startRow: number;
|
|
119
126
|
endRow: number;
|
|
@@ -295,6 +302,11 @@ export declare class SpreadsheetSkeleton extends Skeleton {
|
|
|
295
302
|
private _setCellCache;
|
|
296
303
|
private _updateConfigAndGetDocumentModel;
|
|
297
304
|
private _getDocumentDataByStyle;
|
|
305
|
+
/**
|
|
306
|
+
* pro/issues/344
|
|
307
|
+
* In Excel, for the border rendering of merged cells to take effect, the outermost cells need to have the same border style.
|
|
308
|
+
*/
|
|
309
|
+
private _setMergeBorderProps;
|
|
298
310
|
private _setBorderProps;
|
|
299
311
|
private _getFontFormat;
|
|
300
312
|
private _getOtherStyle;
|
package/lib/types/context.d.ts
CHANGED
|
@@ -39,7 +39,7 @@ export declare class UniverRenderingContext2D implements CanvasRenderingContext2
|
|
|
39
39
|
set lineJoin(val: CanvasLineJoin);
|
|
40
40
|
get lineWidth(): number;
|
|
41
41
|
set lineWidth(val: number);
|
|
42
|
-
|
|
42
|
+
setLineWidthByPrecision(val: number): void;
|
|
43
43
|
get miterLimit(): number;
|
|
44
44
|
set miterLimit(val: number);
|
|
45
45
|
get shadowBlur(): number;
|
|
@@ -56,16 +56,31 @@ export declare class UniverRenderingContext2D implements CanvasRenderingContext2
|
|
|
56
56
|
set font(val: string);
|
|
57
57
|
get fontKerning(): CanvasFontKerning;
|
|
58
58
|
set fontKerning(val: CanvasFontKerning);
|
|
59
|
+
get fontStretch(): CanvasFontStretch;
|
|
60
|
+
set fontStretch(val: CanvasFontStretch);
|
|
61
|
+
get fontVariantCaps(): CanvasFontVariantCaps;
|
|
62
|
+
set fontVariantCaps(val: CanvasFontVariantCaps);
|
|
63
|
+
get letterSpacing(): string;
|
|
64
|
+
set letterSpacing(val: string);
|
|
65
|
+
get textRendering(): CanvasTextRendering;
|
|
66
|
+
set textRendering(val: CanvasTextRendering);
|
|
67
|
+
get wordSpacing(): string;
|
|
68
|
+
set wordSpacing(val: string);
|
|
59
69
|
get textAlign(): CanvasTextAlign;
|
|
60
70
|
set textAlign(val: CanvasTextAlign);
|
|
61
71
|
get textBaseline(): CanvasTextBaseline;
|
|
62
72
|
set textBaseline(val: CanvasTextBaseline);
|
|
63
73
|
private _getScale;
|
|
74
|
+
getScale(): {
|
|
75
|
+
scaleX: number;
|
|
76
|
+
scaleY: number;
|
|
77
|
+
};
|
|
64
78
|
getContextAttributes(): CanvasRenderingContext2DSettings;
|
|
65
79
|
isPointInStroke(x: number, y: number): boolean;
|
|
66
80
|
isPointInStroke(path: Path2D, x: number, y: number): boolean;
|
|
67
81
|
createConicGradient(startAngle: number, x: number, y: number): CanvasGradient;
|
|
68
82
|
roundRect(x: number, y: number, w: number, h: number, radii?: number | DOMPointInit | Array<number | DOMPointInit>): void;
|
|
83
|
+
roundRectByPrecision(x: number, y: number, w: number, h: number, radii?: number | DOMPointInit | Array<number | DOMPointInit>): void;
|
|
69
84
|
getTransform(): DOMMatrix;
|
|
70
85
|
resetTransform(): void;
|
|
71
86
|
drawFocusIfNeeded(element: Element): void;
|
|
@@ -80,12 +95,23 @@ export declare class UniverRenderingContext2D implements CanvasRenderingContext2
|
|
|
80
95
|
* @method
|
|
81
96
|
*/
|
|
82
97
|
arc(x: number, y: number, radius: number, startAngle: number, endAngle: number, counterClockwise?: boolean): void;
|
|
98
|
+
/**
|
|
99
|
+
* arc function.
|
|
100
|
+
* @method
|
|
101
|
+
*/
|
|
102
|
+
arcByPrecision(x: number, y: number, radius: number, startAngle: number, endAngle: number, counterClockwise?: boolean): void;
|
|
83
103
|
/**
|
|
84
104
|
* arcTo function.
|
|
85
105
|
* @method
|
|
86
106
|
*
|
|
87
107
|
*/
|
|
88
108
|
arcTo(x1: number, y1: number, x2: number, y2: number, radius: number): void;
|
|
109
|
+
/**
|
|
110
|
+
* arcTo function.
|
|
111
|
+
* @method
|
|
112
|
+
*
|
|
113
|
+
*/
|
|
114
|
+
arcToByPrecision(x1: number, y1: number, x2: number, y2: number, radius: number): void;
|
|
89
115
|
/**
|
|
90
116
|
* beginPath function.
|
|
91
117
|
* @method
|
|
@@ -96,11 +122,21 @@ export declare class UniverRenderingContext2D implements CanvasRenderingContext2
|
|
|
96
122
|
* @method
|
|
97
123
|
*/
|
|
98
124
|
bezierCurveTo(cp1x: number, cp1y: number, cp2x: number, cp2y: number, x: number, y: number): void;
|
|
125
|
+
/**
|
|
126
|
+
* bezierCurveTo function precision.
|
|
127
|
+
* @method
|
|
128
|
+
*/
|
|
129
|
+
bezierCurveToByPrecision(cp1x: number, cp1y: number, cp2x: number, cp2y: number, x: number, y: number): void;
|
|
99
130
|
/**
|
|
100
131
|
* clearRect function.
|
|
101
132
|
* @method
|
|
102
133
|
*/
|
|
103
134
|
clearRect(x: number, y: number, width: number, height: number): void;
|
|
135
|
+
/**
|
|
136
|
+
* clearRect function.
|
|
137
|
+
* @method
|
|
138
|
+
*/
|
|
139
|
+
clearRectByPrecision(x: number, y: number, width: number, height: number): void;
|
|
104
140
|
/**
|
|
105
141
|
* clip function.
|
|
106
142
|
* @method
|
|
@@ -114,6 +150,10 @@ export declare class UniverRenderingContext2D implements CanvasRenderingContext2
|
|
|
114
150
|
* @method
|
|
115
151
|
*/
|
|
116
152
|
closePath(): void;
|
|
153
|
+
/**
|
|
154
|
+
* Chrome hardware acceleration causes canvas stroke to fail to draw lines on Mac.
|
|
155
|
+
*/
|
|
156
|
+
closePathByEnv(): void;
|
|
117
157
|
/**
|
|
118
158
|
* createImageData function.
|
|
119
159
|
* @method
|
|
@@ -162,11 +202,21 @@ export declare class UniverRenderingContext2D implements CanvasRenderingContext2
|
|
|
162
202
|
* @method
|
|
163
203
|
*/
|
|
164
204
|
fillRect(x: number, y: number, width: number, height: number): void;
|
|
205
|
+
/**
|
|
206
|
+
* fillRect function precision.
|
|
207
|
+
* @method
|
|
208
|
+
*/
|
|
209
|
+
fillRectByPrecision(x: number, y: number, width: number, height: number): void;
|
|
165
210
|
/**
|
|
166
211
|
* strokeRect function.
|
|
167
212
|
* @method
|
|
168
213
|
*/
|
|
169
214
|
strokeRect(x: number, y: number, width: number, height: number): void;
|
|
215
|
+
/**
|
|
216
|
+
* strokeRect function precision.
|
|
217
|
+
* @method
|
|
218
|
+
*/
|
|
219
|
+
strokeRectPrecision(x: number, y: number, width: number, height: number): void;
|
|
170
220
|
/**
|
|
171
221
|
* fillText function.
|
|
172
222
|
* @method
|
|
@@ -192,16 +242,31 @@ export declare class UniverRenderingContext2D implements CanvasRenderingContext2
|
|
|
192
242
|
* @method
|
|
193
243
|
*/
|
|
194
244
|
lineTo(x: number, y: number): void;
|
|
245
|
+
/**
|
|
246
|
+
* lineTo function precision.
|
|
247
|
+
* @method
|
|
248
|
+
*/
|
|
249
|
+
lineToByPrecision(x: number, y: number): void;
|
|
195
250
|
/**
|
|
196
251
|
* moveTo function.
|
|
197
252
|
* @method
|
|
198
253
|
*/
|
|
199
254
|
moveTo(x: number, y: number): void;
|
|
255
|
+
/**
|
|
256
|
+
* moveTo function precision.
|
|
257
|
+
* @method
|
|
258
|
+
*/
|
|
259
|
+
moveToByPrecision(x: number, y: number): void;
|
|
200
260
|
/**
|
|
201
261
|
* rect function.
|
|
202
262
|
* @method
|
|
203
263
|
*/
|
|
204
264
|
rect(x: number, y: number, width: number, height: number): void;
|
|
265
|
+
/**
|
|
266
|
+
* rect function.
|
|
267
|
+
* @method
|
|
268
|
+
*/
|
|
269
|
+
rectByPrecision(x: number, y: number, width: number, height: number): void;
|
|
205
270
|
/**
|
|
206
271
|
* putImageData function.
|
|
207
272
|
* @method
|
|
@@ -258,6 +323,11 @@ export declare class UniverRenderingContext2D implements CanvasRenderingContext2
|
|
|
258
323
|
* @method
|
|
259
324
|
*/
|
|
260
325
|
strokeText(text: string, x: number, y: number, maxWidth?: number): void;
|
|
326
|
+
/**
|
|
327
|
+
* strokeText function precision.
|
|
328
|
+
* @method
|
|
329
|
+
*/
|
|
330
|
+
strokeTextByPrecision(text: string, x: number, y: number, maxWidth?: number): void;
|
|
261
331
|
/**
|
|
262
332
|
* transform function.
|
|
263
333
|
* @method
|
package/lib/types/engine.d.ts
CHANGED
|
@@ -52,6 +52,8 @@ export declare class Engine extends ThinEngine<Scene> {
|
|
|
52
52
|
private pointer;
|
|
53
53
|
private _mouseId;
|
|
54
54
|
private _isUsingFirefox;
|
|
55
|
+
private _previousWidth;
|
|
56
|
+
private _previousHeight;
|
|
55
57
|
constructor(elemWidth?: number, elemHeight?: number, pixelRatio?: number, mode?: CanvasRenderMode);
|
|
56
58
|
get width(): number;
|
|
57
59
|
get height(): number;
|
package/lib/types/index.d.ts
CHANGED
|
@@ -17,7 +17,6 @@ export * from './base-object';
|
|
|
17
17
|
export * from './basics';
|
|
18
18
|
export * from './canvas';
|
|
19
19
|
export * from './components';
|
|
20
|
-
export { DocumentViewModel } from './components/docs/view-model/document-view-model';
|
|
21
20
|
export * from './context';
|
|
22
21
|
export * from './custom';
|
|
23
22
|
export * from './engine';
|
|
@@ -30,3 +29,12 @@ export * from './scene-viewer';
|
|
|
30
29
|
export * from './scroll-timer';
|
|
31
30
|
export * from './shape';
|
|
32
31
|
export * from './viewport';
|
|
32
|
+
export { DocumentViewModel } from './components/docs/view-model/document-view-model';
|
|
33
|
+
export { getAnchorBounding, TEXT_RANGE_LAYER_INDEX, TextRange } from './components/docs/text-selection/text-range';
|
|
34
|
+
export { NodePositionConvertToCursor } from './components/docs/text-selection/convert-cursor';
|
|
35
|
+
export { Liquid } from './components/docs/liquid';
|
|
36
|
+
export { ITextSelectionRenderManager, TextSelectionRenderManager, getCanvasOffsetByEngine, } from './components/docs/text-selection/text-selection-render-manager';
|
|
37
|
+
export type { IActiveTextRange, IEditorInputConfig, ITextSelectionInnerParam } from './components/docs/text-selection/text-selection-render-manager';
|
|
38
|
+
export { Documents } from './components/docs/document';
|
|
39
|
+
export type { IPageRenderConfig } from './components/docs/document';
|
|
40
|
+
export { DocumentSkeleton } from './components/docs/layout/doc-skeleton';
|
package/lib/types/layer.d.ts
CHANGED
|
@@ -40,6 +40,7 @@ export declare class Layer extends Disposable {
|
|
|
40
40
|
makeDirty(state?: boolean): this;
|
|
41
41
|
isDirty(): boolean;
|
|
42
42
|
render(parentCtx?: UniverRenderingContext, isMaxLayer?: boolean): this;
|
|
43
|
+
private _layerBehavior;
|
|
43
44
|
private _initialCacheCanvas;
|
|
44
45
|
private _draw;
|
|
45
46
|
private _applyCache;
|
|
@@ -58,6 +58,7 @@ export declare class RenderManagerService implements IRenderManagerService {
|
|
|
58
58
|
get defaultEngine(): Engine;
|
|
59
59
|
dispose(): void;
|
|
60
60
|
createRenderWithParent(unitId: string, parentUnitId: string): IRender;
|
|
61
|
+
createRenderWithEngine(unitId: string, engine: Engine): IRender;
|
|
61
62
|
create(unitId: Nullable<string>): void;
|
|
62
63
|
createRender(unitId: string): IRender;
|
|
63
64
|
private _createRender;
|
package/lib/types/scene.d.ts
CHANGED
|
@@ -21,8 +21,8 @@ import type { ISceneTransformState } from './basics/interfaces';
|
|
|
21
21
|
import { Vector2 } from './basics/vector2';
|
|
22
22
|
import type { UniverRenderingContext } from './context';
|
|
23
23
|
import { Layer } from './layer';
|
|
24
|
-
import type { ITransformerConfig } from './scene
|
|
25
|
-
import { Transformer } from './scene
|
|
24
|
+
import type { ITransformerConfig } from './scene.transformer';
|
|
25
|
+
import { Transformer } from './scene.transformer';
|
|
26
26
|
import type { SceneViewer } from './scene-viewer';
|
|
27
27
|
import type { ThinEngine } from './thin-engine';
|
|
28
28
|
import { ThinScene } from './thin-scene';
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
import type { EventState, Nullable, Observer } from '@univerjs/core';
|
|
17
17
|
import { Disposable, Observable } from '@univerjs/core';
|
|
18
18
|
import type { BaseObject } from './base-object';
|
|
19
|
-
import type { EVENT_TYPE } from './basics/const';
|
|
19
|
+
import type { CURSOR_TYPE, EVENT_TYPE } from './basics/const';
|
|
20
20
|
import { RENDER_CLASS_TYPE } from './basics/const';
|
|
21
21
|
import type { IKeyboardEvent, IMouseEvent, IPointerEvent, IWheelEvent } from './basics/i-events';
|
|
22
22
|
import type { ITransformChangeState } from './basics/interfaces';
|
|
@@ -25,6 +25,7 @@ import type { IViewportBound, Vector2 } from './basics/vector2';
|
|
|
25
25
|
import type { UniverRenderingContext } from './context';
|
|
26
26
|
export declare abstract class ThinScene extends Disposable {
|
|
27
27
|
onTransformChangeObservable: Observable<ITransformChangeState>;
|
|
28
|
+
onFileLoadedObservable: Observable<string>;
|
|
28
29
|
onPointerDownObserver: Observable<IMouseEvent | IPointerEvent>;
|
|
29
30
|
onPointerMoveObserver: Observable<IMouseEvent | IPointerEvent>;
|
|
30
31
|
onPointerUpObserver: Observable<IMouseEvent | IPointerEvent>;
|
|
@@ -98,4 +99,6 @@ export declare abstract class ThinScene extends Disposable {
|
|
|
98
99
|
scaleX: number;
|
|
99
100
|
scaleY: number;
|
|
100
101
|
};
|
|
102
|
+
setCursor(val: CURSOR_TYPE): void;
|
|
103
|
+
resetCursor(): void;
|
|
101
104
|
}
|
package/lib/types/viewport.d.ts
CHANGED
|
@@ -74,7 +74,6 @@ export declare class Viewport {
|
|
|
74
74
|
onScrollStopObserver: Observable<IScrollObserverParam>;
|
|
75
75
|
onScrollByBarObserver: Observable<IScrollObserverParam>;
|
|
76
76
|
private _viewPortKey;
|
|
77
|
-
private _dirty;
|
|
78
77
|
private _topOrigin;
|
|
79
78
|
private _leftOrigin;
|
|
80
79
|
private _bottomOrigin;
|
|
@@ -133,8 +132,6 @@ export declare class Viewport {
|
|
|
133
132
|
resize(position: IViewPosition): void;
|
|
134
133
|
setPadding(param: IPosition): void;
|
|
135
134
|
resetPadding(): void;
|
|
136
|
-
makeDirty(state?: boolean, refreshParent?: boolean): void;
|
|
137
|
-
isDirty(): boolean;
|
|
138
135
|
/**
|
|
139
136
|
* scroll to position, absolute
|
|
140
137
|
* @param pos
|