@univerjs/engine-render 1.0.0-insiders.20260809-70eefdd → 1.0.0-rc.0
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/LICENSE +176 -0
- package/README.md +0 -1
- package/lib/cjs/index.js +17525 -11746
- package/lib/es/index.js +17519 -11749
- package/lib/index.js +17519 -11749
- package/lib/types/basics/i-document-skeleton-cached.d.ts +60 -3
- package/lib/types/basics/index.d.ts +1 -0
- package/lib/types/basics/interfaces.d.ts +4 -0
- package/lib/types/basics/performance-monitor.d.ts +5 -0
- package/lib/types/basics/range.d.ts +1 -1
- package/lib/types/basics/transformer-config.d.ts +32 -1
- package/lib/types/components/docs/doc-background.d.ts +8 -0
- package/lib/types/components/docs/doc-extension.d.ts +3 -1
- package/lib/types/components/docs/document-compatibility.d.ts +1 -1
- package/lib/types/components/docs/document.d.ts +4 -3
- package/lib/types/components/docs/extensions/font-and-base-line.d.ts +1 -0
- package/lib/types/components/docs/layout/block/column.d.ts +15 -1
- package/lib/types/components/docs/layout/block/paragraph/layout-ruler.d.ts +6 -4
- package/lib/types/components/docs/layout/block/paragraph/line-adjustment.d.ts +1 -1
- package/lib/types/components/docs/layout/block/paragraph/linebreaking.d.ts +1 -1
- package/lib/types/components/docs/layout/block/paragraph/paragraph-layout.d.ts +1 -1
- package/lib/types/components/docs/layout/block/paragraph/shaping.d.ts +3 -0
- package/lib/types/components/docs/layout/block/section.d.ts +7 -1
- package/lib/types/components/docs/layout/block/table.d.ts +57 -1
- package/lib/types/components/docs/layout/doc-skeleton.d.ts +98 -3
- package/lib/types/components/docs/layout/document-layout-page-patch.d.ts +104 -0
- package/lib/types/components/docs/layout/document-layout-publication.d.ts +50 -0
- package/lib/types/components/docs/layout/document-layout-types.d.ts +65 -0
- package/lib/types/components/docs/layout/endnote-layout.d.ts +26 -0
- package/lib/types/components/docs/layout/footnote-layout.d.ts +70 -0
- package/lib/types/components/docs/layout/hyphenation/hyphen.d.ts +2 -0
- package/lib/types/components/docs/layout/model/line.d.ts +3 -2
- package/lib/types/components/docs/layout/model/page.d.ts +19 -2
- package/lib/types/components/docs/layout/note-numbering.d.ts +33 -0
- package/lib/types/components/docs/layout/shaping-engine/font-cache.d.ts +12 -1
- package/lib/types/components/docs/layout/style/color.d.ts +17 -0
- package/lib/types/components/docs/layout/tools.d.ts +33 -1
- package/lib/types/components/docs/view-model/document-view-model.d.ts +21 -1
- package/lib/types/components/sheets/constants.d.ts +2 -0
- package/lib/types/components/sheets/extensions/column-header-layout.d.ts +1 -1
- package/lib/types/components/sheets/extensions/row-header-layout.d.ts +1 -1
- package/lib/types/components/sheets/sheet.render-skeleton.d.ts +8 -1
- package/lib/types/components/sheets/spreadsheet.d.ts +5 -2
- package/lib/types/components/sheets/watermark/watermark-layer.d.ts +2 -1
- package/lib/types/context.d.ts +4 -0
- package/lib/types/engine.d.ts +1 -0
- package/lib/types/index.d.ts +6 -0
- package/lib/types/layer.d.ts +14 -1
- package/lib/types/render-manager/render-manager.service.d.ts +3 -1
- package/lib/types/scene.d.ts +19 -0
- package/lib/types/scene.input-manager.d.ts +5 -0
- package/lib/types/scene.transformer.d.ts +2 -0
- package/lib/types/services/canvas-color.service.d.ts +4 -3
- package/lib/types/shape/checkbox.d.ts +2 -0
- package/lib/types/shape/image.d.ts +4 -0
- package/lib/types/shape/scroll-bar.d.ts +2 -2
- package/lib/types/shape/shape.d.ts +10 -1
- package/lib/types/viewport.d.ts +3 -1
- package/lib/types/worker-layout.d.ts +62 -0
- package/lib/umd/index.js +4 -2
- package/package.json +4 -4
|
@@ -14,14 +14,17 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
import type { DocumentDataModel, ICustomRangeForInterceptor, INumberUnit, IObjectPositionH, IObjectPositionV, IParagraph, IParagraphStyle, ITextStyle, Nullable, PositionedObjectLayoutType } from '@univerjs/core';
|
|
17
|
-
import type { IDocumentSkeletonCached, IDocumentSkeletonColumn, IDocumentSkeletonDivide, IDocumentSkeletonFontStyle, IDocumentSkeletonGlyph, IDocumentSkeletonLine, IDocumentSkeletonPage, IDocumentSkeletonRow, IDocumentSkeletonSection, IDocumentSkeletonTable, ISkeletonResourceReference } from '../../../basics/i-document-skeleton-cached';
|
|
17
|
+
import type { IDocumentSkeletonCached, IDocumentSkeletonColumn, IDocumentSkeletonDivide, IDocumentSkeletonFontStyle, IDocumentSkeletonGlyph, IDocumentSkeletonLine, IDocumentSkeletonPage, IDocumentSkeletonParagraphBorders, IDocumentSkeletonRow, IDocumentSkeletonSection, IDocumentSkeletonTable, ISkeletonResourceReference } from '../../../basics/i-document-skeleton-cached';
|
|
18
18
|
import type { IDocsConfig, IParagraphConfig, ISectionBreakConfig } from '../../../basics/interfaces';
|
|
19
19
|
import type { IBoundRectNoAngle } from '../../../basics/vector2';
|
|
20
20
|
import type { IDocumentCompatibilityPolicy } from '../document-compatibility';
|
|
21
21
|
import type { DataStreamTreeNode } from '../view-model/data-stream-tree-node';
|
|
22
22
|
import type { DocumentViewModel } from '../view-model/document-view-model';
|
|
23
|
+
import type { DocumentEndnoteLayout } from './endnote-layout';
|
|
24
|
+
import type { DocumentFootnoteLayout } from './footnote-layout';
|
|
23
25
|
import type { Hyphen } from './hyphenation/hyphen';
|
|
24
26
|
import type { LanguageDetector } from './hyphenation/language-detector';
|
|
27
|
+
import type { INoteReferenceLayout } from './note-numbering';
|
|
25
28
|
import { BooleanNumber, GridType, SpacingRule } from '@univerjs/core';
|
|
26
29
|
export declare function getLastPage(pages: IDocumentSkeletonPage[]): IDocumentSkeletonPage;
|
|
27
30
|
export declare function getLastSection(page: IDocumentSkeletonPage): IDocumentSkeletonSection;
|
|
@@ -50,6 +53,7 @@ export declare function isBlankColumn(column: IDocumentSkeletonColumn): boolean;
|
|
|
50
53
|
export declare function getNumberUnitValue(unitValue: Nullable<INumberUnit>, benchMark: number): number;
|
|
51
54
|
export declare function getCharSpaceApply(charSpace: number | undefined, defaultTabStop: number, gridType?: GridType, snapToGrid?: BooleanNumber): number;
|
|
52
55
|
export declare function validationGrid(gridType?: GridType, snapToGrid?: BooleanNumber): boolean;
|
|
56
|
+
export declare function reachesNextDocumentGridLine(lineSpacing: number, spaceBelow: number, linePitch: number): boolean;
|
|
53
57
|
export declare function getLineHeightConfig(sectionBreakConfig: ISectionBreakConfig, paragraphConfig: IParagraphConfig): {
|
|
54
58
|
paragraphLineGapDefault: number;
|
|
55
59
|
linePitch: number;
|
|
@@ -67,7 +71,9 @@ export declare function getCharSpaceConfig(sectionBreakConfig: ISectionBreakConf
|
|
|
67
71
|
snapToGrid: BooleanNumber;
|
|
68
72
|
};
|
|
69
73
|
export declare function updateBlockIndex(pages: IDocumentSkeletonPage[], start?: number, documentCompatibilityPolicy?: IDocumentCompatibilityPolicy): void;
|
|
74
|
+
export declare function hasSameParagraphBorderSet(first: IDocumentSkeletonParagraphBorders, second: IDocumentSkeletonParagraphBorders): boolean;
|
|
70
75
|
export declare function updateInlineDrawingCoordsAndBorder(ctx: ILayoutContext, pages: IDocumentSkeletonPage[]): void;
|
|
76
|
+
export declare function updateParagraphBorders(ctx: ILayoutContext, pages: IDocumentSkeletonPage[], targetPages?: IDocumentSkeletonPage[]): void;
|
|
71
77
|
export declare function glyphIterator(pages: IDocumentSkeletonPage[], cb: (glyph: IDocumentSkeletonGlyph, divide: IDocumentSkeletonDivide, line: IDocumentSkeletonLine, column: IDocumentSkeletonColumn, section: IDocumentSkeletonSection, page: IDocumentSkeletonPage) => void): void;
|
|
72
78
|
export declare function lineIterator(pagesOrCells: (IDocumentSkeletonPage)[], cb: (line: IDocumentSkeletonLine, column: IDocumentSkeletonColumn, section: IDocumentSkeletonSection, page: IDocumentSkeletonPage) => void): void;
|
|
73
79
|
export type DocumentSkeletonLineSource = 'page' | 'table-cell' | 'column';
|
|
@@ -154,6 +160,7 @@ export declare function getPositionHorizon(positionH: IObjectPositionH, column:
|
|
|
154
160
|
export declare function getPositionVertical(positionV: IObjectPositionV, page: IDocumentSkeletonPage, lineTop: number, lineHeight: number, objectHeight: number, blockAnchorTop?: number, isPageBreak?: boolean): number | undefined;
|
|
155
161
|
export declare function getGlyphGroupWidth(divide: IDocumentSkeletonDivide): number;
|
|
156
162
|
interface IFontCreateConfig {
|
|
163
|
+
documentCompatibilityPolicy?: IDocumentCompatibilityPolicy;
|
|
157
164
|
fontStyle: IDocumentSkeletonFontStyle;
|
|
158
165
|
textStyle: ITextStyle;
|
|
159
166
|
charSpace: number;
|
|
@@ -163,6 +170,7 @@ interface IFontCreateConfig {
|
|
|
163
170
|
}
|
|
164
171
|
export declare function clearFontCreateConfigCache(): void;
|
|
165
172
|
export declare function getFontConfigFromLastGlyph(glyph: IDocumentSkeletonGlyph, sectionBreakConfig: ISectionBreakConfig, paragraphStyle: IParagraphStyle): {
|
|
173
|
+
documentCompatibilityPolicy: IDocumentCompatibilityPolicy;
|
|
166
174
|
fontStyle: IDocumentSkeletonFontStyle;
|
|
167
175
|
textStyle: ITextStyle;
|
|
168
176
|
charSpace: number;
|
|
@@ -226,6 +234,18 @@ export interface IDocumentPaginationMetrics {
|
|
|
226
234
|
peakCheckpointLineCount: number;
|
|
227
235
|
}
|
|
228
236
|
export interface ILayoutContext {
|
|
237
|
+
noteReferences?: ReadonlyMap<number, INoteReferenceLayout>;
|
|
238
|
+
footnoteLayout?: DocumentFootnoteLayout;
|
|
239
|
+
endnoteLayout?: DocumentEndnoteLayout;
|
|
240
|
+
/** Virtual marker in a note body; it never consumes a persisted character. */
|
|
241
|
+
noteLabel?: string;
|
|
242
|
+
noteReferenceTextStyle?: ITextStyle;
|
|
243
|
+
/** Preserve the local note segment when the paragraph/table pipeline opens a continuation page. */
|
|
244
|
+
noteSegmentId?: string;
|
|
245
|
+
footnoteFirstColumn?: {
|
|
246
|
+
index: number;
|
|
247
|
+
top: number;
|
|
248
|
+
};
|
|
229
249
|
viewModel: DocumentViewModel;
|
|
230
250
|
dataModel: DocumentDataModel;
|
|
231
251
|
docsConfig: IDocsConfig;
|
|
@@ -242,6 +262,18 @@ export interface ILayoutContext {
|
|
|
242
262
|
sectionBreakConfigCache: Map<number, ISectionBreakConfig>;
|
|
243
263
|
paragraphsOpenNewPage: Set<number>;
|
|
244
264
|
paginationMetrics?: IDocumentPaginationMetrics;
|
|
265
|
+
/**
|
|
266
|
+
* Incremental layout may defer an expensive split-table calculation after
|
|
267
|
+
* the normal line-layout path has resolved its exact pagination context.
|
|
268
|
+
* Synchronous callers leave this unset.
|
|
269
|
+
*/
|
|
270
|
+
deferSlicedTableLayout?: (request: {
|
|
271
|
+
curPage: IDocumentSkeletonPage;
|
|
272
|
+
viewModel: DocumentViewModel;
|
|
273
|
+
tableNode: DataStreamTreeNode;
|
|
274
|
+
sectionBreakConfig: ISectionBreakConfig;
|
|
275
|
+
availableHeight: number;
|
|
276
|
+
}) => boolean;
|
|
245
277
|
hyphen: Hyphen;
|
|
246
278
|
languageDetector: LanguageDetector;
|
|
247
279
|
}
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
import type { DocumentDataModel, IColumnGroup, ICustomBlock, ICustomColumnGroup, ICustomDecorationForInterceptor, ICustomRangeForInterceptor, ICustomTable, IDisposable, IParagraph, ISectionBreak, ITable, ITextRun, Nullable } from '@univerjs/core';
|
|
16
|
+
import type { DocumentDataModel, IColumnGroup, ICustomBlock, ICustomColumnGroup, ICustomDecorationForInterceptor, ICustomRangeForInterceptor, ICustomTable, IDisposable, IParagraph, ISectionBreak, ITable, ITextRun, JSONXActions, Nullable } from '@univerjs/core';
|
|
17
17
|
import { DataStreamTreeNode } from './data-stream-tree-node';
|
|
18
18
|
interface ITableNodeCache {
|
|
19
19
|
table: DataStreamTreeNode;
|
|
@@ -52,11 +52,23 @@ export declare class DocumentViewModel implements IDisposable {
|
|
|
52
52
|
private _columnGroupCache;
|
|
53
53
|
private _tableNodeCache;
|
|
54
54
|
private _children;
|
|
55
|
+
private _treeNodes;
|
|
56
|
+
private _treeNodesByStartIndex;
|
|
57
|
+
private _plainTopLevelParagraphNodes;
|
|
58
|
+
private _metadataCachesDirty;
|
|
59
|
+
private _textRunsOrderedAndDisjoint;
|
|
60
|
+
private _paragraphsOrdered;
|
|
61
|
+
private _sectionBreaksOrdered;
|
|
62
|
+
private _customBlocksOrdered;
|
|
63
|
+
private _tablesOrdered;
|
|
64
|
+
private _columnGroupsOrdered;
|
|
65
|
+
private _lastTextRun;
|
|
55
66
|
private _editArea;
|
|
56
67
|
private readonly _editAreaChange$;
|
|
57
68
|
readonly editAreaChange$: import("rxjs").Observable<Nullable<DocumentEditArea>>;
|
|
58
69
|
private _headerTreeMap;
|
|
59
70
|
private _footerTreeMap;
|
|
71
|
+
private _noteTreeMap;
|
|
60
72
|
private readonly _segmentViewModels$;
|
|
61
73
|
readonly segmentViewModels$: import("rxjs").Observable<DocumentViewModel[]>;
|
|
62
74
|
constructor(_documentDataModel: DocumentDataModel, _tableSource?: Record<string, ITable> | undefined);
|
|
@@ -66,6 +78,7 @@ export declare class DocumentViewModel implements IDisposable {
|
|
|
66
78
|
headerTreeMap: Map<string, DocumentViewModel>;
|
|
67
79
|
footerTreeMap: Map<string, DocumentViewModel>;
|
|
68
80
|
};
|
|
81
|
+
getNoteTreeMap(): ReadonlyMap<string, DocumentViewModel>;
|
|
69
82
|
getEditArea(): DocumentEditArea;
|
|
70
83
|
setEditArea(editArea: DocumentEditArea): void;
|
|
71
84
|
getChildren(): DataStreamTreeNode[];
|
|
@@ -74,6 +87,8 @@ export declare class DocumentViewModel implements IDisposable {
|
|
|
74
87
|
getDataModel(): DocumentDataModel;
|
|
75
88
|
getSelfOrHeaderFooterViewModel(segmentId?: string): DocumentViewModel;
|
|
76
89
|
reset(documentDataModel: DocumentDataModel): void;
|
|
90
|
+
resetByValidatedTextMutation(documentDataModel: DocumentDataModel, actions: JSONXActions): boolean;
|
|
91
|
+
resetByValidatedMetadataMutation(documentDataModel: DocumentDataModel, actions: JSONXActions): boolean;
|
|
77
92
|
getSectionBreak(index: number): ISectionBreak | undefined;
|
|
78
93
|
getParagraph(index: number): IParagraph | undefined;
|
|
79
94
|
getTextRun(index: number): Nullable<ITextRun>;
|
|
@@ -87,6 +102,11 @@ export declare class DocumentViewModel implements IDisposable {
|
|
|
87
102
|
getCustomDecorationRaw(index: number): import("@univerjs/core").ICustomDecoration | undefined;
|
|
88
103
|
getCustomDecoration(index: number): Nullable<ICustomDecorationForInterceptor>;
|
|
89
104
|
private _buildAllCache;
|
|
105
|
+
private _insertPlainText;
|
|
106
|
+
private _deletePlainText;
|
|
107
|
+
private _findParagraphNode;
|
|
108
|
+
private _rebuildTreeNodes;
|
|
109
|
+
private _collectNodePath;
|
|
90
110
|
private _buildParagraphCache;
|
|
91
111
|
private _buildSectionBreakCache;
|
|
92
112
|
private _buildCustomBlockCache;
|
|
@@ -19,6 +19,8 @@ export declare const FONT_EXTENSION_Z_INDEX = 45;
|
|
|
19
19
|
export declare const BG_Z_INDEX = 21;
|
|
20
20
|
export declare const PRINTING_BG_Z_INDEX = 21;
|
|
21
21
|
export declare const EXPAND_SIZE_FOR_RENDER_OVERFLOW = 20;
|
|
22
|
+
export declare const MIN_TEXT_RENDER_HEIGHT_IN_SCREEN_PX = 4;
|
|
23
|
+
export declare function shouldRenderRowText(rowHeight: number, scaleY?: number): boolean;
|
|
22
24
|
export declare const sheetContentViewportKeys: SHEET_VIEWPORT_KEY[];
|
|
23
25
|
export declare const sheetHeaderViewportKeys: SHEET_VIEWPORT_KEY[];
|
|
24
26
|
export declare const MEASURE_EXTENT = 10000;
|
|
@@ -35,7 +35,7 @@ export declare class ColumnHeaderLayout extends SheetExtension {
|
|
|
35
35
|
constructor(cfg?: IColumnsHeaderCfgParam);
|
|
36
36
|
configHeaderColumn(cfg: IColumnsHeaderCfgParam, sheetId?: string): void;
|
|
37
37
|
getColumnsCfg(sheetId: string): Record<number, IAColumnCfg>;
|
|
38
|
-
getHeaderStyle(sheetId: string): IHeaderStyleCfg;
|
|
38
|
+
getHeaderStyle(sheetId: string, isPrinting?: boolean): IHeaderStyleCfg;
|
|
39
39
|
getCfgOfCurrentColumn(columnsCfg: Record<number, IAColumnCfg>, headerStyle: IHeaderStyleCfg, colIndex: number): [IAColumnCfgObj, boolean];
|
|
40
40
|
setStyleToCtx(ctx: UniverRenderingContext, columnStyle: Partial<IHeaderStyleCfg>): void;
|
|
41
41
|
draw(ctx: UniverRenderingContext, parentScale: IScale, spreadsheetSkeleton: SpreadsheetSkeleton): void;
|
|
@@ -32,7 +32,7 @@ export declare class RowHeaderLayout extends SheetExtension {
|
|
|
32
32
|
constructor(cfg?: IRowsHeaderCfgParam);
|
|
33
33
|
configHeaderRow(cfg: IRowsHeaderCfgParam, sheetId?: string): void;
|
|
34
34
|
getRowsCfg(sheetId: string): Record<number, IARowCfg>;
|
|
35
|
-
getHeaderStyle(sheetId: string): IRowStyleCfg;
|
|
35
|
+
getHeaderStyle(sheetId: string, isPrinting?: boolean): IRowStyleCfg;
|
|
36
36
|
getCfgOfCurrentRow(rowsCfg: Record<number, IARowCfg>, headerStyle: IHeaderStyleCfg, rowIndex: number): [IARowCfgObj, boolean];
|
|
37
37
|
setStyleToCtx(ctx: UniverRenderingContext, rowStyle: Partial<IHeaderStyleCfg>): void;
|
|
38
38
|
draw(ctx: UniverRenderingContext, parentScale: IScale, spreadsheetSkeleton: SpreadsheetSkeleton): void;
|
|
@@ -52,6 +52,10 @@ interface ISetStylesCacheForOneCellOptions {
|
|
|
52
52
|
reuseExisting?: boolean;
|
|
53
53
|
hasMergeData?: boolean;
|
|
54
54
|
rowVisible?: boolean;
|
|
55
|
+
skipFontCache?: boolean;
|
|
56
|
+
}
|
|
57
|
+
export interface ISetStylesCacheOptions {
|
|
58
|
+
scaleY?: number;
|
|
55
59
|
}
|
|
56
60
|
export interface IGetPosByRowColOptions {
|
|
57
61
|
closeFirst?: boolean;
|
|
@@ -78,6 +82,7 @@ export declare class SpreadsheetSkeleton extends SheetSkeleton {
|
|
|
78
82
|
private _handleBorderMatrix;
|
|
79
83
|
private _showGridlines;
|
|
80
84
|
private _gridlinesColor;
|
|
85
|
+
private _defaultGridlinesColor;
|
|
81
86
|
private _scene;
|
|
82
87
|
constructor(worksheet: Worksheet, _styles: Styles, _localeService: LocaleService, _contextService: IContextService, _configService: IConfigService, _injector: Injector);
|
|
83
88
|
registerGetCellHeight(): void;
|
|
@@ -98,6 +103,7 @@ export declare class SpreadsheetSkeleton extends SheetSkeleton {
|
|
|
98
103
|
get incrementalFontRenderRanges(): IRange[];
|
|
99
104
|
get showGridlines(): BooleanNumber;
|
|
100
105
|
get gridlinesColor(): string | undefined;
|
|
106
|
+
get defaultGridlinesColor(): string;
|
|
101
107
|
dispose(): void;
|
|
102
108
|
setOverflowCache(value: ObjectMatrix<IRange>): void;
|
|
103
109
|
getFont(rowIndex: number, columnIndex: number): Nullable<IFontCacheItem>;
|
|
@@ -116,8 +122,9 @@ export declare class SpreadsheetSkeleton extends SheetSkeleton {
|
|
|
116
122
|
/**
|
|
117
123
|
* Set border background and font to this._stylesCache by visible range, which derives from bounds)
|
|
118
124
|
* @param vpInfo viewBounds
|
|
125
|
+
* @param options screen scale
|
|
119
126
|
*/
|
|
120
|
-
setStylesCache(vpInfo?: IViewportInfo): Nullable<SpreadsheetSkeleton>;
|
|
127
|
+
setStylesCache(vpInfo?: IViewportInfo, options?: ISetStylesCacheOptions): Nullable<SpreadsheetSkeleton>;
|
|
121
128
|
/**
|
|
122
129
|
* Calc all auto height by getDocsSkeletonPageSize in ranges
|
|
123
130
|
* @param ranges
|
|
@@ -15,7 +15,6 @@
|
|
|
15
15
|
*/
|
|
16
16
|
import type { IPosition, IRange } from '@univerjs/core';
|
|
17
17
|
import type { IBoundRectNoAngle, IViewportInfo, Vector2 } from '../../basics/vector2';
|
|
18
|
-
import type { Canvas } from '../../canvas';
|
|
19
18
|
import type { UniverRenderingContext2D } from '../../context';
|
|
20
19
|
import type { Scene } from '../../scene';
|
|
21
20
|
import type { Background } from './extensions/background';
|
|
@@ -23,10 +22,12 @@ import type { Border } from './extensions/border';
|
|
|
23
22
|
import type { Font } from './extensions/font';
|
|
24
23
|
import type { IPaintForRefresh, IPaintForScrolling } from './interfaces';
|
|
25
24
|
import type { SpreadsheetSkeleton } from './sheet.render-skeleton';
|
|
25
|
+
import { Canvas } from '../../canvas';
|
|
26
26
|
import { Documents } from '../docs/document';
|
|
27
27
|
import { SheetComponent } from './sheet-component';
|
|
28
28
|
export declare class Spreadsheet extends SheetComponent {
|
|
29
29
|
private _allowCache;
|
|
30
|
+
private _scrollBufferCanvases;
|
|
30
31
|
private _backgroundExtension;
|
|
31
32
|
private _borderExtension;
|
|
32
33
|
private _fontExtension;
|
|
@@ -79,7 +80,9 @@ export declare class Spreadsheet extends SheetComponent {
|
|
|
79
80
|
renderByViewports(mainCtx: UniverRenderingContext2D, viewportInfo: IViewportInfo, spreadsheetSkeleton: SpreadsheetSkeleton): void;
|
|
80
81
|
private _getMergeRepairBounds;
|
|
81
82
|
private _getRepaintBounds;
|
|
82
|
-
paintNewAreaForScrolling(viewportInfo: IViewportInfo, param: IPaintForScrolling, mergeRepairBounds?: IBoundRectNoAngle[]):
|
|
83
|
+
paintNewAreaForScrolling(viewportInfo: IViewportInfo, param: IPaintForScrolling, mergeRepairBounds?: IBoundRectNoAngle[]): Canvas;
|
|
84
|
+
private _copyCacheForScrolling;
|
|
85
|
+
private _getScrollBufferCanvas;
|
|
83
86
|
/**
|
|
84
87
|
* Redraw the entire viewport.
|
|
85
88
|
*/
|
|
@@ -15,13 +15,14 @@
|
|
|
15
15
|
*/
|
|
16
16
|
import type { IUser } from '@univerjs/core';
|
|
17
17
|
import type { UniverRenderingContext } from '../../../context';
|
|
18
|
+
import type { ILayerRenderOptions } from '../../../layer';
|
|
18
19
|
import type { IWatermarkConfigWithType } from './type';
|
|
19
20
|
import { Layer } from '../../../layer';
|
|
20
21
|
export declare class WatermarkLayer extends Layer {
|
|
21
22
|
private _config;
|
|
22
23
|
private _image;
|
|
23
24
|
private _user;
|
|
24
|
-
render(ctx?: UniverRenderingContext, isMaxLayer?: boolean): this;
|
|
25
|
+
render(ctx?: UniverRenderingContext, isMaxLayer?: boolean, options?: ILayerRenderOptions): this;
|
|
25
26
|
updateConfig(config?: IWatermarkConfigWithType, user?: IUser): void;
|
|
26
27
|
private _renderWatermark;
|
|
27
28
|
}
|
package/lib/types/context.d.ts
CHANGED
|
@@ -21,6 +21,8 @@ export interface IUniverRenderingContextOptions {
|
|
|
21
21
|
export declare class UniverRenderingContext2D implements CanvasRenderingContext2D {
|
|
22
22
|
__mode: string;
|
|
23
23
|
private _transformCache;
|
|
24
|
+
private _bitmapMutationId;
|
|
25
|
+
private _bitmapMutationTrackingDepth;
|
|
24
26
|
readonly canvas: HTMLCanvasElement;
|
|
25
27
|
_context: CanvasRenderingContext2D;
|
|
26
28
|
private _systemType;
|
|
@@ -31,6 +33,8 @@ export declare class UniverRenderingContext2D implements CanvasRenderingContext2
|
|
|
31
33
|
private _id;
|
|
32
34
|
getId(): string;
|
|
33
35
|
setId(id: string): void;
|
|
36
|
+
detectBitmapMutation(callback: () => void): boolean;
|
|
37
|
+
private _markBitmapMutation;
|
|
34
38
|
isContextLost(): boolean;
|
|
35
39
|
get globalAlpha(): number;
|
|
36
40
|
set globalAlpha(val: number);
|
package/lib/types/engine.d.ts
CHANGED
package/lib/types/index.d.ts
CHANGED
|
@@ -25,6 +25,7 @@ export * from './components';
|
|
|
25
25
|
export type { DocsCustomBlockRenderViewportProvider, IDocsCustomBlockRenderViewport, IDocsCustomBlockRenderViewportInput } from './components/docs/custom-block-render-viewport';
|
|
26
26
|
export { getDocsCustomBlockRenderViewport, setDocsCustomBlockRenderViewportProvider } from './components/docs/custom-block-render-viewport';
|
|
27
27
|
export { DocBackground } from './components/docs/doc-background';
|
|
28
|
+
export { DOCS_EXTENSION_TYPE } from './components/docs/doc-extension';
|
|
28
29
|
export { Documents } from './components/docs/document';
|
|
29
30
|
export type { IPageRenderConfig } from './components/docs/document';
|
|
30
31
|
export type { IDocumentOffsetConfig } from './components/docs/document';
|
|
@@ -33,6 +34,9 @@ export { measureDocumentNoWrapTextRangeWidth, measureDocumentNoWrapTextWidth, me
|
|
|
33
34
|
export * from './components/docs/layout/doc-simple-skeleton';
|
|
34
35
|
export { DocumentSkeleton } from './components/docs/layout/doc-skeleton';
|
|
35
36
|
export type { IFindNodeRestrictions } from './components/docs/layout/doc-skeleton';
|
|
37
|
+
export type { IDocumentLayoutPagePublication } from './components/docs/layout/document-layout-publication';
|
|
38
|
+
export type { DocumentLayoutMode, DocumentLayoutReason, IDocumentLayoutApplyResult, IDocumentLayoutInvalidation, IDocumentLayoutPageRange, IDocumentLayoutProgress, IDocumentLayoutProtectedContinuousRange, IDocumentLayoutProtectedPageRange, IDocumentLayoutProtectedRange, } from './components/docs/layout/document-layout-types';
|
|
39
|
+
export { invalidateDocumentFontMetrics } from './components/docs/layout/shaping-engine/font-cache';
|
|
36
40
|
export { compareDocumentSkeletonNestedPagePathOrder, documentSkeletonLineIterator, documentSkeletonTableIterator, getCharSpaceApply, getDocumentSkeletonColumnPagePathInfo, getDocumentSkeletonNestedPageOffset, getLastLine, getNumberUnitValue, getPageFromPath, glyphIterator, lineIterator, } from './components/docs/layout/tools';
|
|
37
41
|
export type { IDocumentSkeletonColumnPagePathInfo, IDocumentSkeletonLineContext, IDocumentSkeletonLineIteratorOptions, IDocumentSkeletonTableCellGeometry, IDocumentSkeletonTableContext, IDocumentSkeletonTableIteratorOptions } from './components/docs/layout/tools';
|
|
38
42
|
export { getLastColumn } from './components/docs/layout/tools';
|
|
@@ -64,3 +68,5 @@ export * from './scroll-timer';
|
|
|
64
68
|
export { CanvasColorService, DumbCanvasColorService, ICanvasColorService } from './services/canvas-color.service';
|
|
65
69
|
export * from './shape';
|
|
66
70
|
export * from './viewport';
|
|
71
|
+
export { DocumentLayoutSession } from './worker-layout';
|
|
72
|
+
export type { IDocumentLayoutSessionStartOptions, IDocumentLayoutStepResult } from './worker-layout';
|
package/lib/types/layer.d.ts
CHANGED
|
@@ -13,16 +13,29 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
+
import type { IBoundRectNoAngle, IViewportInfo } from './basics/vector2';
|
|
16
17
|
import type { UniverRenderingContext } from './context';
|
|
17
18
|
import type { Scene } from './scene';
|
|
18
19
|
import { Disposable } from '@univerjs/core';
|
|
19
20
|
import { BaseObject } from './base-object';
|
|
21
|
+
export interface IScrollRenderInfo {
|
|
22
|
+
bounds: IBoundRectNoAngle;
|
|
23
|
+
offsetX: number;
|
|
24
|
+
offsetY: number;
|
|
25
|
+
}
|
|
26
|
+
export interface ILayerRenderOptions {
|
|
27
|
+
dirtyBounds?: IBoundRectNoAngle[];
|
|
28
|
+
preserveCache?: boolean;
|
|
29
|
+
viewportInfos?: Map<string, IViewportInfo>;
|
|
30
|
+
}
|
|
31
|
+
export declare function scrollAndClearCanvas(ctx: UniverRenderingContext, pixelRatio: number, scrollRenderInfos: IScrollRenderInfo[], dirtyBounds: IBoundRectNoAngle[]): void;
|
|
20
32
|
export declare class Layer extends Disposable {
|
|
21
33
|
private _scene;
|
|
22
34
|
private _zIndex;
|
|
23
35
|
private _allowCache;
|
|
24
36
|
private _objects;
|
|
25
37
|
private _cacheCanvas;
|
|
38
|
+
private _cacheValid;
|
|
26
39
|
protected _dirty: boolean;
|
|
27
40
|
private _debounceDirtyFunc;
|
|
28
41
|
constructor(_scene: Scene, objects?: BaseObject[], _zIndex?: number, _allowCache?: boolean);
|
|
@@ -59,7 +72,7 @@ export declare class Layer extends Disposable {
|
|
|
59
72
|
makeDirty(state?: boolean): this;
|
|
60
73
|
makeDirtyWithDebounce(state?: boolean): void;
|
|
61
74
|
isDirty(): boolean;
|
|
62
|
-
render(parentCtx?: UniverRenderingContext, isMaxLayer?: boolean): this;
|
|
75
|
+
render(parentCtx?: UniverRenderingContext, isMaxLayer?: boolean, options?: ILayerRenderOptions): this;
|
|
63
76
|
private _layerBehavior;
|
|
64
77
|
private _initialCacheCanvas;
|
|
65
78
|
private _draw;
|
|
@@ -50,6 +50,7 @@ export interface IRenderManagerService extends IDisposable {
|
|
|
50
50
|
* @param dep
|
|
51
51
|
*/
|
|
52
52
|
registerRenderModule<T extends UnitModel>(type: UniverInstanceType, dep: Dependency<T>): IDisposable;
|
|
53
|
+
registerRenderModule(type: UniverInstanceType, dep: Dependency): IDisposable;
|
|
53
54
|
}
|
|
54
55
|
export declare class RenderManagerService extends Disposable implements IRenderManagerService {
|
|
55
56
|
protected readonly _injector: Injector;
|
|
@@ -71,6 +72,7 @@ export declare class RenderManagerService extends Disposable implements IRenderM
|
|
|
71
72
|
* @param type
|
|
72
73
|
* @param depCtor
|
|
73
74
|
*/
|
|
75
|
+
registerRenderModule<T extends UnitModel>(type: UniverInstanceType, depCtor: Dependency<T>): IDisposable;
|
|
74
76
|
registerRenderModule(type: UniverInstanceType, depCtor: Dependency): IDisposable;
|
|
75
77
|
/**
|
|
76
78
|
* get render dependencies from _renderDependencies
|
|
@@ -78,7 +80,7 @@ export declare class RenderManagerService extends Disposable implements IRenderM
|
|
|
78
80
|
* @returns Dependency[]
|
|
79
81
|
*/
|
|
80
82
|
private _getRenderDepsByType;
|
|
81
|
-
private
|
|
83
|
+
private _initThemeListener;
|
|
82
84
|
/**
|
|
83
85
|
* create renderUnit & init deps from renderDependencies
|
|
84
86
|
* @param unitId
|
package/lib/types/scene.d.ts
CHANGED
|
@@ -55,6 +55,14 @@ export declare class Scene extends Disposable {
|
|
|
55
55
|
private _evented;
|
|
56
56
|
private _layers;
|
|
57
57
|
private _viewports;
|
|
58
|
+
private _preserveEngineOnRender;
|
|
59
|
+
private _hasPostRenderCanvasMutation;
|
|
60
|
+
private _scrollbarDragViewport;
|
|
61
|
+
private _isScrollbarSeeking;
|
|
62
|
+
private _isScrollbarPreviewDirty;
|
|
63
|
+
private _lastScrollbarSeekInputAt;
|
|
64
|
+
private _estimatedFullRenderDuration;
|
|
65
|
+
private _renderedViewportScrollPositions;
|
|
58
66
|
private _cursor;
|
|
59
67
|
private _defaultCursor;
|
|
60
68
|
private _addObject$;
|
|
@@ -121,6 +129,11 @@ export declare class Scene extends Disposable {
|
|
|
121
129
|
attachControl(options?: ISceneInputControlOptions): this | undefined;
|
|
122
130
|
detachControl(): this;
|
|
123
131
|
makeDirty(state?: boolean): this;
|
|
132
|
+
makeDirtyForScrolling(): this;
|
|
133
|
+
beginScrollbarDrag(viewport: Viewport): void;
|
|
134
|
+
updateScrollbarDrag(viewport: Viewport): void;
|
|
135
|
+
endScrollbarDrag(viewport: Viewport): void;
|
|
136
|
+
isScrollRenderPending(): boolean;
|
|
124
137
|
makeDirtyNoParent(state?: boolean): this;
|
|
125
138
|
enableLayerCache(...layerIndexes: number[]): void;
|
|
126
139
|
disableLayerCache(...layerIndexes: number[]): void;
|
|
@@ -218,6 +231,12 @@ export declare class Scene extends Disposable {
|
|
|
218
231
|
getViewports(): Viewport[];
|
|
219
232
|
getMainViewport(): Viewport;
|
|
220
233
|
getViewport(key: string): Viewport | undefined;
|
|
234
|
+
private _createScrollRenderState;
|
|
235
|
+
private _renderScrollbarSeekPreview;
|
|
236
|
+
private _shouldDeferScrollbarSeekRender;
|
|
237
|
+
private _recordRenderedViewportScrollPositions;
|
|
238
|
+
private _recordFullRenderDuration;
|
|
239
|
+
private _notifyAfterRender;
|
|
221
240
|
render(parentCtx?: UniverRenderingContext): void;
|
|
222
241
|
requestRender(parentCtx?: UniverRenderingContext): Promise<unknown>;
|
|
223
242
|
/**
|
|
@@ -24,6 +24,8 @@ export declare class InputManager extends Disposable {
|
|
|
24
24
|
static LongPressDelay: number;
|
|
25
25
|
/** Time in milliseconds with two consecutive clicks will be considered as a double or triple click */
|
|
26
26
|
static DoubleClickDelay: number;
|
|
27
|
+
/** The allowed distance between two consecutive touch taps. */
|
|
28
|
+
static TouchDoubleClickMovementThreshold: number;
|
|
27
29
|
static TripleClickDelay: number;
|
|
28
30
|
/** If you need to check double click without raising a single click at first click, enable this flag */
|
|
29
31
|
static ExclusiveDoubleClickMode: boolean;
|
|
@@ -33,6 +35,8 @@ export declare class InputManager extends Disposable {
|
|
|
33
35
|
private _onInput$;
|
|
34
36
|
private _currentMouseEnterPicked;
|
|
35
37
|
private _startingPosition;
|
|
38
|
+
private _pointerDownPosition;
|
|
39
|
+
private _pointerDragged;
|
|
36
40
|
private _delayedTimeout;
|
|
37
41
|
private _delayedTripeTimeout;
|
|
38
42
|
private _doubleClickOccurred;
|
|
@@ -86,5 +90,6 @@ export declare class InputManager extends Disposable {
|
|
|
86
90
|
private _isPointerSwiping;
|
|
87
91
|
private _prePointerDoubleOrTripleClick;
|
|
88
92
|
private _resetDoubleClickParam;
|
|
93
|
+
private _resetClickSequence;
|
|
89
94
|
get capturedObject(): BaseObject | null;
|
|
90
95
|
}
|
|
@@ -46,6 +46,7 @@ export declare class Transformer extends Disposable implements ITransformerConfi
|
|
|
46
46
|
hoverEnabled: boolean;
|
|
47
47
|
hoverEnterFunc: Nullable<(e: IPointerEvent | IMouseEvent) => void>;
|
|
48
48
|
hoverLeaveFunc: Nullable<(e: IPointerEvent | IMouseEvent) => void>;
|
|
49
|
+
moveEnabled: boolean;
|
|
49
50
|
resizeEnabled: boolean;
|
|
50
51
|
rotateEnabled: boolean;
|
|
51
52
|
rotationSnaps: number[];
|
|
@@ -183,6 +184,7 @@ export declare class Transformer extends Disposable implements ITransformerConfi
|
|
|
183
184
|
private _getSouthWestPoints;
|
|
184
185
|
private _checkTransformerType;
|
|
185
186
|
private _updateControlIterator;
|
|
187
|
+
private _getControlState;
|
|
186
188
|
private _updateControl;
|
|
187
189
|
private _hideControl;
|
|
188
190
|
private _attachHover;
|
|
@@ -31,11 +31,12 @@ export declare class DumbCanvasColorService implements ICanvasColorService {
|
|
|
31
31
|
*/
|
|
32
32
|
export declare class CanvasColorService extends Disposable implements ICanvasColorService {
|
|
33
33
|
private readonly _themeService;
|
|
34
|
-
private readonly
|
|
34
|
+
private readonly _darkModeCache;
|
|
35
|
+
private readonly _resolvedThemeColors;
|
|
35
36
|
private _invertAlgo;
|
|
36
37
|
constructor(_themeService: ThemeService);
|
|
37
|
-
getRenderColor(
|
|
38
|
+
getRenderColor(inputColor: string): string;
|
|
39
|
+
private _cacheThemeColors;
|
|
38
40
|
}
|
|
39
|
-
export declare function getDarkRenderColorOverride(color: string): string | null;
|
|
40
41
|
export declare function hexToRgb(_hex: string): RGBColorType;
|
|
41
42
|
export declare function rgbToHex(rgbColor: RGBColorType): string;
|
|
@@ -20,6 +20,8 @@ export interface ICheckboxShapeProps extends IShapeProps {
|
|
|
20
20
|
checked?: boolean;
|
|
21
21
|
}
|
|
22
22
|
export declare const CHECK_OBJECT_ARRAY: string[];
|
|
23
|
+
export declare function isCheckboxGlyph(content: string): boolean;
|
|
24
|
+
export declare function getCheckboxShapeSize(fontSize?: number): number;
|
|
23
25
|
export declare class CheckboxShape extends Shape<ICheckboxShapeProps> {
|
|
24
26
|
_checked: boolean;
|
|
25
27
|
constructor(key: string, props: ICheckboxShapeProps);
|
|
@@ -63,6 +63,8 @@ export declare class Image extends Shape<IImageProps> {
|
|
|
63
63
|
private _renderByCropper;
|
|
64
64
|
private _transformCalculateSrcRect;
|
|
65
65
|
private _clipService;
|
|
66
|
+
private _rasterCacheSource;
|
|
67
|
+
private _autoRasterCache;
|
|
66
68
|
objectType: ObjectType;
|
|
67
69
|
isDrawingObject: boolean;
|
|
68
70
|
constructor(id: string, config: IImageProps);
|
|
@@ -70,6 +72,7 @@ export declare class Image extends Shape<IImageProps> {
|
|
|
70
72
|
get prstGeom(): Nullable<string>;
|
|
71
73
|
get opacity(): number;
|
|
72
74
|
get clipBounds(): Nullable<IShapeClipBounds>;
|
|
75
|
+
private _shouldRasterCache;
|
|
73
76
|
setOpacity(opacity: number): void;
|
|
74
77
|
setClipBounds(clipBounds?: Nullable<IShapeClipBounds>): void;
|
|
75
78
|
setClipService(clipService: Nullable<IImageShapeClipService>): void;
|
|
@@ -100,6 +103,7 @@ export declare class Image extends Shape<IImageProps> {
|
|
|
100
103
|
private _transformBySrcRect;
|
|
101
104
|
render(mainCtx: UniverRenderingContext, bounds?: IViewportInfo): this;
|
|
102
105
|
protected _draw(ctx: UniverRenderingContext, _bounds?: IViewportInfo, renderWidth?: number, renderHeight?: number): void;
|
|
106
|
+
private _drawNative;
|
|
103
107
|
private _init;
|
|
104
108
|
private _updateSrcRectByTransform;
|
|
105
109
|
set transform(trans: Transform);
|
|
@@ -75,7 +75,6 @@ export declare class ScrollBar extends Disposable {
|
|
|
75
75
|
private _pendingBarDeltaX;
|
|
76
76
|
private _pendingBarDeltaY;
|
|
77
77
|
private _pendingBarScrollFrameId;
|
|
78
|
-
private _pendingBarScrollThrottleId;
|
|
79
78
|
private _horizonPointerMoveSub;
|
|
80
79
|
private _horizonPointerUpSub;
|
|
81
80
|
private _verticalPointerMoveSub;
|
|
@@ -85,6 +84,8 @@ export declare class ScrollBar extends Disposable {
|
|
|
85
84
|
private _thumbActiveBackgroundColor;
|
|
86
85
|
private _trackBackgroundColor;
|
|
87
86
|
private _trackBorderColor;
|
|
87
|
+
private _trackBackgroundOpacity;
|
|
88
|
+
private _trackBorderOpacity;
|
|
88
89
|
/**
|
|
89
90
|
* The thickness of a scrolling track
|
|
90
91
|
* ThumbSize = trackSize - thumbMargin * 2
|
|
@@ -143,7 +144,6 @@ export declare class ScrollBar extends Disposable {
|
|
|
143
144
|
static attachTo(view: Viewport, props?: IScrollBarProps): ScrollBar;
|
|
144
145
|
dispose(): void;
|
|
145
146
|
private _scheduleBarScrollDelta;
|
|
146
|
-
private _requestPendingBarScrollFrame;
|
|
147
147
|
private _flushPendingBarScroll;
|
|
148
148
|
private _applyPendingBarScroll;
|
|
149
149
|
render(ctx: UniverRenderingContext, left?: number, top?: number): void;
|
|
@@ -33,8 +33,10 @@ export interface IShapeProps extends IObjectFullState, ISize, IOffset, IScale {
|
|
|
33
33
|
visible?: boolean;
|
|
34
34
|
paintFirst?: PaintFirst;
|
|
35
35
|
stroke?: Nullable<string | CanvasGradient>;
|
|
36
|
+
strokeOpacity?: number;
|
|
36
37
|
strokeScaleEnabled?: boolean;
|
|
37
38
|
fill?: Nullable<string | CanvasGradient>;
|
|
39
|
+
fillOpacity?: number;
|
|
38
40
|
fillAfterStrokeEnabled?: boolean;
|
|
39
41
|
hitStrokeWidth?: number | string;
|
|
40
42
|
strokeLineJoin?: LineJoin;
|
|
@@ -58,14 +60,17 @@ export declare abstract class Shape<T extends IShapeProps> extends BaseObject {
|
|
|
58
60
|
private _renderCacheCanvas;
|
|
59
61
|
private _renderCacheBounds;
|
|
60
62
|
private _renderCachePixelRatio;
|
|
63
|
+
private _renderCacheTransformSize;
|
|
61
64
|
private _hoverCursor;
|
|
62
65
|
private _moveCursor;
|
|
63
66
|
private _fillRule;
|
|
64
67
|
private _globalCompositeOperation;
|
|
65
68
|
private _paintFirst;
|
|
66
69
|
private _stroke;
|
|
70
|
+
private _strokeOpacity?;
|
|
67
71
|
private _strokeScaleEnabled;
|
|
68
72
|
private _fill;
|
|
73
|
+
private _fillOpacity?;
|
|
69
74
|
private _fillAfterStrokeEnabled;
|
|
70
75
|
private _hitStrokeWidth;
|
|
71
76
|
private _strokeLineJoin;
|
|
@@ -90,8 +95,10 @@ export declare abstract class Shape<T extends IShapeProps> extends BaseObject {
|
|
|
90
95
|
get globalCompositeOperation(): string;
|
|
91
96
|
get paintFirst(): PaintFirst;
|
|
92
97
|
get stroke(): Nullable<string | CanvasGradient>;
|
|
98
|
+
get strokeOpacity(): number | undefined;
|
|
93
99
|
get strokeScaleEnabled(): boolean;
|
|
94
100
|
get fill(): Nullable<string | CanvasGradient>;
|
|
101
|
+
get fillOpacity(): number | undefined;
|
|
95
102
|
get fillAfterStrokeEnabled(): boolean;
|
|
96
103
|
get hitStrokeWidth(): string | number;
|
|
97
104
|
get strokeLineJoin(): LineJoin;
|
|
@@ -132,7 +139,9 @@ export declare abstract class Shape<T extends IShapeProps> extends BaseObject {
|
|
|
132
139
|
toJson(): {
|
|
133
140
|
[x: string]: any;
|
|
134
141
|
};
|
|
135
|
-
|
|
142
|
+
transformByState(option: IObjectFullState): this | undefined;
|
|
143
|
+
translate(x?: number | string, y?: number | string): this;
|
|
144
|
+
protected _renderWithCache(ctx: UniverRenderingContext, bounds: IBoundRectNoAngle, draw: (cacheContext: UniverRenderingContext) => void, fixedPixelRatio?: number): void;
|
|
136
145
|
protected _releaseRenderCache(): void;
|
|
137
146
|
protected _draw(ctx: UniverRenderingContext, bounds?: IViewportInfo): void;
|
|
138
147
|
private _initialProps;
|
package/lib/types/viewport.d.ts
CHANGED
|
@@ -253,6 +253,7 @@ export declare class Viewport {
|
|
|
253
253
|
get _deltaViewportScrollX(): number;
|
|
254
254
|
get _deltaViewportScrollY(): number;
|
|
255
255
|
get canvas(): UniverCanvas | null;
|
|
256
|
+
swapCacheCanvas(cacheCanvas: UniverCanvas): UniverCanvas | null;
|
|
256
257
|
enable(): void;
|
|
257
258
|
disable(): void;
|
|
258
259
|
/**
|
|
@@ -343,7 +344,7 @@ export declare class Viewport {
|
|
|
343
344
|
* @param objects
|
|
344
345
|
* @param isMaxLayer
|
|
345
346
|
*/
|
|
346
|
-
render(parentCtx?: UniverRenderingContext, objects?: BaseObject[], isMaxLayer?: boolean): void;
|
|
347
|
+
render(parentCtx?: UniverRenderingContext, objects?: BaseObject[], isMaxLayer?: boolean, viewportInfo?: IViewportInfo): void;
|
|
347
348
|
private _makeDefaultViewport;
|
|
348
349
|
calcViewportInfo(): IViewportInfo;
|
|
349
350
|
/**
|
|
@@ -431,6 +432,7 @@ export declare class Viewport {
|
|
|
431
432
|
private _diffViewBound;
|
|
432
433
|
private _calcDiffCacheBound;
|
|
433
434
|
private _drawScrollbar;
|
|
435
|
+
renderScrollbarOnly(ctx: UniverRenderingContext, pixelRatio: number): void;
|
|
434
436
|
setViewportSize(props?: IViewProps): void;
|
|
435
437
|
}
|
|
436
438
|
export {};
|