@univerjs/engine-render 1.0.0-insiders.20260813-7c9aa50 → 1.0.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/{af-B2UUzO69.js → af-nci0ERu_.js} +0 -1
- package/lib/cjs/{as-DbZDYp6O.js → as-9-ZvOvbK.js} +0 -1
- package/lib/cjs/{be-BBx0lyG-.js → be-CPDnc13A.js} +0 -1
- package/lib/cjs/{bg-DeX16RKi.js → bg-Tu2vvwIU.js} +0 -1
- package/lib/cjs/{bn-3fjitMC3.js → bn-CP4-u1Rh.js} +0 -1
- package/lib/cjs/{ca-BxC8Zblv.js → ca-9lX3QWYB.js} +0 -1
- package/lib/cjs/{cop-TvdaSBlz.js → cop-BpbDnfNH.js} +0 -1
- package/lib/cjs/{cs-MSNfJH-L.js → cs-6wd1Lm8r.js} +0 -1
- package/lib/cjs/{cu-7FYbjEBr.js → cu-DoUwo0RX.js} +0 -1
- package/lib/cjs/{cy-CPuxVqb_.js → cy-uvacbUjY.js} +0 -1
- package/lib/cjs/{da-BWsE849b.js → da-vuRoJfkB.js} +0 -1
- package/lib/cjs/{de-1901-BYSTp3Fp.js → de-1901-C-Rx0RIO.js} +0 -1
- package/lib/cjs/{de-1996-DWtCfm_A.js → de-1996-CqTjCS2g.js} +0 -1
- package/lib/cjs/{de-ch-1901-rWVcF3cs.js → de-ch-1901-j-eB6ude.js} +0 -1
- package/lib/cjs/{el-monoton-BEUGM9Fi.js → el-monoton-CdxEzdnL.js} +0 -1
- package/lib/cjs/{el-polyton-Bvh6HAfD.js → el-polyton-QS0KX3lc.js} +0 -1
- package/lib/cjs/{en-gb-Dcrai7kY.js → en-gb-B4rmyRrO.js} +0 -1
- package/lib/cjs/{es-CVNdGI0L.js → es-BA4drX0l.js} +0 -1
- package/lib/cjs/{et-7Rdfp2-O.js → et-C7DwwRsT.js} +0 -1
- package/lib/cjs/{eu-DyEtVwHo.js → eu-ClKht9Pp.js} +0 -1
- package/lib/cjs/{fi-DzRES2Ke.js → fi-DuHvPYlK.js} +0 -1
- package/lib/cjs/{fr-DJMVMLCz.js → fr-B6k7oFRi.js} +0 -1
- package/lib/cjs/{fur-CzhK3vxZ.js → fur-BNKRNrN9.js} +0 -1
- package/lib/cjs/{ga-HXzOFdlG.js → ga-BZ0KaaVs.js} +0 -1
- package/lib/cjs/{gl-C5TM79ih.js → gl-CctrPjLD.js} +0 -1
- package/lib/cjs/{grc-CPQF-xFI.js → grc-BE-oBfLv.js} +0 -1
- package/lib/cjs/{gu-AqCkEYxo.js → gu-Bv2fvk65.js} +0 -1
- package/lib/cjs/{hi-DugLLbv4.js → hi-D9Q0HIae.js} +0 -1
- package/lib/cjs/{hr-LSMYFsyP.js → hr-BWOyJbhV.js} +0 -1
- package/lib/cjs/{hsb-BlnRYHkg.js → hsb-DbVr5Yti.js} +0 -1
- package/lib/cjs/{hu-Dwvtkpy7.js → hu-CZLP-2fR.js} +0 -1
- package/lib/cjs/{hy-BsG06_IV.js → hy-ZPOiR2Pl.js} +0 -1
- package/lib/cjs/{ia-BMOUZLGD.js → ia-COSQW4z-.js} +0 -1
- package/lib/cjs/{id-DhSs0vqq.js → id-5X-mf3_K.js} +0 -1
- package/lib/cjs/index.js +13007 -5653
- package/lib/cjs/{is-iJhrS7Aw.js → is-B0v_L_rD.js} +0 -1
- package/lib/cjs/{it-Aam-BmsV.js → it-BYUjiLCa.js} +0 -1
- package/lib/cjs/{ka-CfLSYpVb.js → ka-CqhPSSIU.js} +0 -1
- package/lib/cjs/{kmr-DYCscIsi.js → kmr-BuxJ3UNX.js} +0 -1
- package/lib/cjs/{kn-OCEDIM_O.js → kn-CqFXlbev.js} +0 -1
- package/lib/cjs/{la-DFS3RPxE.js → la-BFXoayQr.js} +0 -1
- package/lib/cjs/{la-x-classic-BocVpbl6.js → la-x-classic-BYzNHSGU.js} +0 -1
- package/lib/cjs/{la-x-liturgic-CpZYm3b6.js → la-x-liturgic-vXxx2nLG.js} +0 -1
- package/lib/cjs/{lt-NC6HHzxn.js → lt-D2dXvF2J.js} +0 -1
- package/lib/cjs/{lv-BMFTm6cB.js → lv-bwpCf-Pe.js} +0 -1
- package/lib/cjs/{ml-DDWi25Fi.js → ml-Cg8vxrAK.js} +0 -1
- package/lib/cjs/{mn-cyrl-TCUeX7is.js → mn-cyrl-B6DZDQQA.js} +0 -1
- package/lib/cjs/{mn-cyrl-x-lmc-BCmp3Ybn.js → mn-cyrl-x-lmc-CXBgZUX1.js} +0 -1
- package/lib/cjs/{mr-1gjg-u15.js → mr-BBVGX8dy.js} +0 -1
- package/lib/cjs/{mul-ethi-B9a4BMM6.js → mul-ethi-CHBVIYMf.js} +0 -1
- package/lib/cjs/{nb-DS_J6lre.js → nb-BCuMJhLv.js} +0 -1
- package/lib/cjs/{nl-CBtSVLcv.js → nl-8OOgTtzV.js} +0 -1
- package/lib/cjs/{nn-DYJOn4Sh.js → nn-XJlYZMaR.js} +0 -1
- package/lib/cjs/{no-C20NyT1P.js → no-BYOYolO_.js} +0 -1
- package/lib/cjs/{oc-CrKqER_F.js → oc-OPfeuk3n.js} +0 -1
- package/lib/cjs/{or-ZqEtsnaq.js → or-1B6R0ukY.js} +0 -1
- package/lib/cjs/{pa-BD3r0Teo.js → pa-D7Ec6DsZ.js} +0 -1
- package/lib/cjs/{pi-CQUwMUvz.js → pi-CrindCzM.js} +0 -1
- package/lib/cjs/{pl-CawofTLo.js → pl-Bhte1xma.js} +0 -1
- package/lib/cjs/{pms-DMqDXwo-.js → pms-B5-d2U_Z.js} +0 -1
- package/lib/cjs/{pt-BIiUaINZ.js → pt-CtFPi0Il.js} +0 -1
- package/lib/cjs/{rm-B_-8T7Y1.js → rm-fgO3AV82.js} +0 -1
- package/lib/cjs/{ro-B2Xhfkgx.js → ro-BUB-IxaH.js} +0 -1
- package/lib/cjs/{ru-lj-rTTpe.js → ru-BYdNAMwp.js} +0 -1
- package/lib/cjs/{sa-D3h-cY2Z.js → sa-BX4Bcw9p.js} +0 -1
- package/lib/cjs/{sh-cyrl-0o7p_z-7.js → sh-cyrl-BMS20HU0.js} +0 -1
- package/lib/cjs/{sh-latn-BTi9p-0q.js → sh-latn-B5r4ufen.js} +0 -1
- package/lib/cjs/{sk-D6mOX2KK.js → sk-B2xqlAKO.js} +0 -1
- package/lib/cjs/{sl-Bzz3gkvn.js → sl-BQIVIls0.js} +0 -1
- package/lib/cjs/{sr-cyrl-V07WO3rb.js → sr-cyrl-DYfSvoxX.js} +0 -1
- package/lib/cjs/{sv-CyQXUuzx.js → sv-Dnaw_W7A.js} +0 -1
- package/lib/cjs/{ta-Brwz0zYf.js → ta-UtrX1d-L.js} +0 -1
- package/lib/cjs/{te-CgvirCa4.js → te-Cd9aOzWW.js} +0 -1
- package/lib/cjs/{th-PlSNhaza.js → th-DMVAQILd.js} +0 -1
- package/lib/cjs/{tk-O54r2ybT.js → tk-CmEXyO1-.js} +0 -1
- package/lib/cjs/{tr-Dh1h3Dno.js → tr--Z-rfClX.js} +0 -1
- package/lib/cjs/{uk-E2mCrVCU.js → uk-COcQB_vY.js} +0 -1
- package/lib/cjs/{zh-latn-pinyin-C2RfFfDl.js → zh-latn-pinyin-Cw5tH1Uh.js} +0 -1
- package/lib/es/index.js +12920 -5579
- package/lib/index.js +12920 -5579
- package/lib/types/basics/document-node-tools.d.ts +2 -0
- package/lib/types/basics/i-document-skeleton-cached.d.ts +82 -8
- package/lib/types/basics/index.d.ts +1 -0
- package/lib/types/basics/interfaces.d.ts +17 -5
- package/lib/types/basics/performance-monitor.d.ts +5 -0
- package/lib/types/basics/range.d.ts +1 -1
- package/lib/types/basics/tools.d.ts +4 -2
- package/lib/types/basics/transformer-config.d.ts +36 -1
- package/lib/types/components/docs/custom-glyph-renderer.d.ts +36 -0
- package/lib/types/components/docs/doc-background.d.ts +8 -0
- package/lib/types/components/docs/document-compatibility.d.ts +5 -3
- package/lib/types/components/docs/document-layout-presentation.d.ts +104 -0
- package/lib/types/components/docs/document.d.ts +21 -3
- package/lib/types/components/docs/extensions/font-and-base-line.d.ts +5 -1
- package/lib/types/components/docs/layout/block/column.d.ts +15 -0
- package/lib/types/components/docs/layout/block/paragraph/layout-ruler.d.ts +15 -6
- 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 +59 -2
- package/lib/types/components/docs/layout/doc-skeleton.d.ts +111 -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/line-breaker/enhancers/link-enhancer.d.ts +2 -1
- package/lib/types/components/docs/layout/model/glyph.d.ts +28 -4
- package/lib/types/components/docs/layout/model/line.d.ts +3 -2
- package/lib/types/components/docs/layout/model/page.d.ts +24 -4
- package/lib/types/components/docs/layout/note-numbering.d.ts +33 -0
- package/lib/types/components/docs/layout/shaping-engine/font-cache.d.ts +13 -2
- package/lib/types/components/docs/layout/style/color.d.ts +17 -0
- package/lib/types/components/docs/layout/tools.d.ts +48 -8
- package/lib/types/components/docs/page-borders.d.ts +20 -0
- package/lib/types/components/docs/table-hit-test.d.ts +16 -0
- package/lib/types/components/docs/table-render-viewport.d.ts +4 -0
- package/lib/types/components/docs/view-model/data-stream-tree-node.d.ts +1 -0
- package/lib/types/components/docs/view-model/document-view-model.d.ts +29 -8
- package/lib/types/components/extension.d.ts +3 -2
- package/lib/types/components/sheets/extensions/sheet-extension.d.ts +2 -1
- package/lib/types/components/sheets/sheet.render-skeleton.d.ts +5 -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 +12 -3
- package/lib/types/layer.d.ts +14 -1
- package/lib/types/render-manager/render-manager.service.d.ts +3 -1
- package/lib/types/scene-viewer.d.ts +2 -1
- package/lib/types/scene.d.ts +21 -1
- package/lib/types/scene.input-manager.d.ts +7 -0
- package/lib/types/scene.transformer.d.ts +8 -2
- package/lib/types/services/canvas-color.service.d.ts +2 -4
- package/lib/types/shape/control.d.ts +5 -1
- package/lib/types/shape/scroll-bar.d.ts +2 -2
- package/lib/types/shape/shape.d.ts +9 -0
- package/lib/types/viewport.d.ts +3 -1
- package/lib/types/worker-layout.d.ts +71 -0
- package/lib/umd/index.js +5 -4
- package/package.json +6 -6
|
@@ -39,8 +39,10 @@ export declare const DEFAULT_PADDING_DATA: {
|
|
|
39
39
|
r: number;
|
|
40
40
|
};
|
|
41
41
|
export declare const RENDER_RAW_FORMULA_KEY = "RENDER_RAW_FORMULA";
|
|
42
|
+
export declare const FULL_WIDTH_HORIZONTAL_ALIGNMENTS: Set<HorizontalAlign>;
|
|
42
43
|
export declare function getShrinkToFitScale(contentWidth: number, availableWidth: number, fontSize: number): number;
|
|
43
44
|
export declare function getGeneralNumberDisplayText(value: number, displayText: string, fontString: string, availableWidth: number): string;
|
|
45
|
+
export declare function getCustomNumberDisplayText(displayText: string, fontString: string, availableWidth: number): string;
|
|
44
46
|
export declare function scaleDocumentDataForShrinkToFit(documentData: IDocumentData, scale: number, fallbackFontSize: number): IDocumentData;
|
|
45
47
|
export interface ICacheItem {
|
|
46
48
|
bg: boolean;
|
|
@@ -82,6 +84,7 @@ export declare class SpreadsheetSkeleton extends SheetSkeleton {
|
|
|
82
84
|
private _handleBorderMatrix;
|
|
83
85
|
private _showGridlines;
|
|
84
86
|
private _gridlinesColor;
|
|
87
|
+
private _defaultGridlinesColor;
|
|
85
88
|
private _scene;
|
|
86
89
|
constructor(worksheet: Worksheet, _styles: Styles, _localeService: LocaleService, _contextService: IContextService, _configService: IConfigService, _injector: Injector);
|
|
87
90
|
registerGetCellHeight(): void;
|
|
@@ -102,6 +105,7 @@ export declare class SpreadsheetSkeleton extends SheetSkeleton {
|
|
|
102
105
|
get incrementalFontRenderRanges(): IRange[];
|
|
103
106
|
get showGridlines(): BooleanNumber;
|
|
104
107
|
get gridlinesColor(): string | undefined;
|
|
108
|
+
get defaultGridlinesColor(): string;
|
|
105
109
|
dispose(): void;
|
|
106
110
|
setOverflowCache(value: ObjectMatrix<IRange>): void;
|
|
107
111
|
getFont(rowIndex: number, columnIndex: number): Nullable<IFontCacheItem>;
|
|
@@ -183,7 +187,7 @@ export declare class SpreadsheetSkeleton extends SheetSkeleton {
|
|
|
183
187
|
_setBorderStylesCache(row: number, col: number, style: Nullable<IStyleData>, options: ISetStylesCacheForOneCellOptions | undefined): void;
|
|
184
188
|
_setBgStylesCache(row: number, col: number, style: Nullable<IStyleData>, options: ISetStylesCacheForOneCellOptions | undefined): void;
|
|
185
189
|
private _applyShrinkToFit;
|
|
186
|
-
private
|
|
190
|
+
private _applyNumberDisplay;
|
|
187
191
|
_setFontStylesCache(row: number, col: number, cellData: Nullable<ICellDataForSheetInterceptor>, style: IStyleData, hasMergeData?: boolean): void;
|
|
188
192
|
/**
|
|
189
193
|
* Set border background and font to this._stylesCache cell by cell.
|
|
@@ -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
|
@@ -24,22 +24,29 @@ export * from './canvas';
|
|
|
24
24
|
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
|
+
export { getDocCustomGlyphRenderer, registerDocCustomGlyphRenderer, } from './components/docs/custom-glyph-renderer';
|
|
28
|
+
export type { DocCustomGlyphRenderer, IDocCustomGlyphRendererRegistration, IDocCustomGlyphRenderInput, } from './components/docs/custom-glyph-renderer';
|
|
27
29
|
export { DocBackground } from './components/docs/doc-background';
|
|
28
30
|
export { DOCS_EXTENSION_TYPE } from './components/docs/doc-extension';
|
|
29
31
|
export { Documents } from './components/docs/document';
|
|
30
|
-
export type { IPageRenderConfig } from './components/docs/document';
|
|
31
|
-
export
|
|
32
|
+
export type { IDocumentGlyphPaint, IDocumentOffsetConfig, IPageRenderConfig } from './components/docs/document';
|
|
33
|
+
export { getDocumentLayoutPresentation, registerDocumentLayoutPresentation } from './components/docs/document-layout-presentation';
|
|
34
|
+
export type { IDocumentLayoutBody, IDocumentLayoutParagraph, IDocumentLayoutParagraphStyle, IDocumentLayoutPresentation, IDocumentLayoutSnapshot, IDocumentLayoutTextRun, IDocumentLayoutTextStyle, } from './components/docs/document-layout-presentation';
|
|
32
35
|
export { getTableIdAndSliceIndex } from './components/docs/layout/block/table';
|
|
33
36
|
export { measureDocumentNoWrapTextRangeWidth, measureDocumentNoWrapTextWidth, measureDocumentUnbreakableTextWidth, measureDocumentWrappedTextWidth, } from './components/docs/layout/doc-no-wrap-measure';
|
|
34
37
|
export * from './components/docs/layout/doc-simple-skeleton';
|
|
35
38
|
export { DocumentSkeleton } from './components/docs/layout/doc-skeleton';
|
|
36
39
|
export type { IFindNodeRestrictions } from './components/docs/layout/doc-skeleton';
|
|
40
|
+
export type { IDocumentLayoutPagePublication } from './components/docs/layout/document-layout-publication';
|
|
41
|
+
export type { DocumentLayoutMode, DocumentLayoutReason, IDocumentLayoutApplyResult, IDocumentLayoutInvalidation, IDocumentLayoutPageRange, IDocumentLayoutProgress, IDocumentLayoutProtectedContinuousRange, IDocumentLayoutProtectedPageRange, IDocumentLayoutProtectedRange, } from './components/docs/layout/document-layout-types';
|
|
42
|
+
export { invalidateDocumentFontMetrics } from './components/docs/layout/shaping-engine/font-cache';
|
|
37
43
|
export { compareDocumentSkeletonNestedPagePathOrder, documentSkeletonLineIterator, documentSkeletonTableIterator, getCharSpaceApply, getDocumentSkeletonColumnPagePathInfo, getDocumentSkeletonNestedPageOffset, getLastLine, getNumberUnitValue, getPageFromPath, glyphIterator, lineIterator, } from './components/docs/layout/tools';
|
|
38
44
|
export type { IDocumentSkeletonColumnPagePathInfo, IDocumentSkeletonLineContext, IDocumentSkeletonLineIteratorOptions, IDocumentSkeletonTableCellGeometry, IDocumentSkeletonTableContext, IDocumentSkeletonTableIteratorOptions } from './components/docs/layout/tools';
|
|
39
45
|
export { getLastColumn } from './components/docs/layout/tools';
|
|
40
46
|
export { Liquid } from './components/docs/liquid';
|
|
47
|
+
export { getTopmostDocsTableHit } from './components/docs/table-hit-test';
|
|
41
48
|
export type { DocsTableRenderViewportProvider, IDocsTableRenderViewport, } from './components/docs/table-render-viewport';
|
|
42
|
-
export { getDocsTableRenderViewport, getDocsTableViewportLeft, setDocsTableRenderViewportProvider, } from './components/docs/table-render-viewport';
|
|
49
|
+
export { getDocsTableLayoutViewportWidth, getDocsTableRenderViewport, getDocsTableViewportLeft, setDocsTableRenderViewportProvider, } from './components/docs/table-render-viewport';
|
|
43
50
|
export { DataStreamTreeNode } from './components/docs/view-model/data-stream-tree-node';
|
|
44
51
|
export { DocumentViewModel } from './components/docs/view-model/document-view-model';
|
|
45
52
|
export { DocumentEditArea } from './components/docs/view-model/document-view-model';
|
|
@@ -65,3 +72,5 @@ export * from './scroll-timer';
|
|
|
65
72
|
export { CanvasColorService, DumbCanvasColorService, ICanvasColorService } from './services/canvas-color.service';
|
|
66
73
|
export * from './shape';
|
|
67
74
|
export * from './viewport';
|
|
75
|
+
export { DocumentLayoutSession } from './worker-layout';
|
|
76
|
+
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
|
|
@@ -14,6 +14,7 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
import type { Nullable } from '@univerjs/core';
|
|
17
|
+
import type { DeviceType } from './basics/i-events';
|
|
17
18
|
import type { IObjectFullState } from './basics/interfaces';
|
|
18
19
|
import type { IViewportInfo, Vector2 } from './basics/vector2';
|
|
19
20
|
import type { UniverRenderingContext } from './context';
|
|
@@ -36,7 +37,7 @@ export declare class SceneViewer extends BaseObject {
|
|
|
36
37
|
enableSelectedClipElement(): void;
|
|
37
38
|
disableSelectedClipElement(): void;
|
|
38
39
|
allowSelectedClipElement(): boolean;
|
|
39
|
-
pick(coord: Vector2): Nullable<BaseObject | Scene>;
|
|
40
|
+
pick(coord: Vector2, deviceType?: DeviceType): Nullable<BaseObject | Scene>;
|
|
40
41
|
dispose(): void;
|
|
41
42
|
private _initialProps;
|
|
42
43
|
}
|
package/lib/types/scene.d.ts
CHANGED
|
@@ -26,6 +26,7 @@ import type { SceneViewer } from './scene-viewer';
|
|
|
26
26
|
import type { Viewport } from './viewport';
|
|
27
27
|
import { Disposable, EventSubject } from '@univerjs/core';
|
|
28
28
|
import { CURSOR_TYPE, RENDER_CLASS_TYPE } from './basics/const';
|
|
29
|
+
import { DeviceType } from './basics/i-events';
|
|
29
30
|
import { Transform } from './basics/transform';
|
|
30
31
|
import { Layer } from './layer';
|
|
31
32
|
import { Transformer } from './scene.transformer';
|
|
@@ -55,6 +56,14 @@ export declare class Scene extends Disposable {
|
|
|
55
56
|
private _evented;
|
|
56
57
|
private _layers;
|
|
57
58
|
private _viewports;
|
|
59
|
+
private _preserveEngineOnRender;
|
|
60
|
+
private _hasPostRenderCanvasMutation;
|
|
61
|
+
private _scrollbarDragViewport;
|
|
62
|
+
private _isScrollbarSeeking;
|
|
63
|
+
private _isScrollbarPreviewDirty;
|
|
64
|
+
private _lastScrollbarSeekInputAt;
|
|
65
|
+
private _estimatedFullRenderDuration;
|
|
66
|
+
private _renderedViewportScrollPositions;
|
|
58
67
|
private _cursor;
|
|
59
68
|
private _defaultCursor;
|
|
60
69
|
private _addObject$;
|
|
@@ -121,6 +130,11 @@ export declare class Scene extends Disposable {
|
|
|
121
130
|
attachControl(options?: ISceneInputControlOptions): this | undefined;
|
|
122
131
|
detachControl(): this;
|
|
123
132
|
makeDirty(state?: boolean): this;
|
|
133
|
+
makeDirtyForScrolling(): this;
|
|
134
|
+
beginScrollbarDrag(viewport: Viewport): void;
|
|
135
|
+
updateScrollbarDrag(viewport: Viewport): void;
|
|
136
|
+
endScrollbarDrag(viewport: Viewport): void;
|
|
137
|
+
isScrollRenderPending(): boolean;
|
|
124
138
|
makeDirtyNoParent(state?: boolean): this;
|
|
125
139
|
enableLayerCache(...layerIndexes: number[]): void;
|
|
126
140
|
disableLayerCache(...layerIndexes: number[]): void;
|
|
@@ -218,6 +232,12 @@ export declare class Scene extends Disposable {
|
|
|
218
232
|
getViewports(): Viewport[];
|
|
219
233
|
getMainViewport(): Viewport;
|
|
220
234
|
getViewport(key: string): Viewport | undefined;
|
|
235
|
+
private _createScrollRenderState;
|
|
236
|
+
private _renderScrollbarSeekPreview;
|
|
237
|
+
private _shouldDeferScrollbarSeekRender;
|
|
238
|
+
private _recordRenderedViewportScrollPositions;
|
|
239
|
+
private _recordFullRenderDuration;
|
|
240
|
+
private _notifyAfterRender;
|
|
221
241
|
render(parentCtx?: UniverRenderingContext): void;
|
|
222
242
|
requestRender(parentCtx?: UniverRenderingContext): Promise<unknown>;
|
|
223
243
|
/**
|
|
@@ -274,7 +294,7 @@ export declare class Scene extends Disposable {
|
|
|
274
294
|
* @param {Vector2} coord
|
|
275
295
|
* @return {Nullable<BaseObject | Scene>} object under the pointer
|
|
276
296
|
*/
|
|
277
|
-
pick(coord: Vector2): Nullable<BaseObject | Scene>;
|
|
297
|
+
pick(coord: Vector2, deviceType?: DeviceType): Nullable<BaseObject | Scene>;
|
|
278
298
|
triggerPointerUp(evt: IPointerEvent | IMouseEvent): boolean;
|
|
279
299
|
triggerMouseWheel(evt: IWheelEvent): boolean;
|
|
280
300
|
triggerSingleClick(evt: IPointerEvent | IMouseEvent): boolean;
|
|
@@ -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,10 +35,13 @@ 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;
|
|
39
43
|
private _tripleClickState;
|
|
44
|
+
private _lastClickTime;
|
|
40
45
|
private _currentObject;
|
|
41
46
|
constructor(scene: Scene);
|
|
42
47
|
/**
|
|
@@ -70,6 +75,7 @@ export declare class InputManager extends Disposable {
|
|
|
70
75
|
* @param offsetY
|
|
71
76
|
*/
|
|
72
77
|
private _getObjectAtPos;
|
|
78
|
+
private _getObjectAtEvent;
|
|
73
79
|
/**
|
|
74
80
|
*
|
|
75
81
|
* If currentObject is null, return true
|
|
@@ -86,5 +92,6 @@ export declare class InputManager extends Disposable {
|
|
|
86
92
|
private _isPointerSwiping;
|
|
87
93
|
private _prePointerDoubleOrTripleClick;
|
|
88
94
|
private _resetDoubleClickParam;
|
|
95
|
+
private _resetClickSequence;
|
|
89
96
|
get capturedObject(): BaseObject | null;
|
|
90
97
|
}
|
|
@@ -42,10 +42,13 @@ export interface IChangeObserverConfig {
|
|
|
42
42
|
*/
|
|
43
43
|
export declare class Transformer extends Disposable implements ITransformerConfig {
|
|
44
44
|
private _scene;
|
|
45
|
+
private static readonly _selectionTapMovementThreshold;
|
|
45
46
|
isCropper: boolean;
|
|
46
47
|
hoverEnabled: boolean;
|
|
47
48
|
hoverEnterFunc: Nullable<(e: IPointerEvent | IMouseEvent) => void>;
|
|
48
49
|
hoverLeaveFunc: Nullable<(e: IPointerEvent | IMouseEvent) => void>;
|
|
50
|
+
moveEnabled: boolean;
|
|
51
|
+
moveOnlyWhenSelected: boolean;
|
|
49
52
|
resizeEnabled: boolean;
|
|
50
53
|
rotateEnabled: boolean;
|
|
51
54
|
rotationSnaps: number[];
|
|
@@ -117,8 +120,7 @@ export declare class Transformer extends Disposable implements ITransformerConfi
|
|
|
117
120
|
private _startStateMap;
|
|
118
121
|
private _viewportScrollX;
|
|
119
122
|
private _viewportScrollY;
|
|
120
|
-
private
|
|
121
|
-
private _topScenePointerUpSub;
|
|
123
|
+
private _finishGesture;
|
|
122
124
|
private _cancelFocusSubscription;
|
|
123
125
|
private _transformerControlMap;
|
|
124
126
|
private _selectedObjectMap;
|
|
@@ -131,6 +133,9 @@ export declare class Transformer extends Disposable implements ITransformerConfi
|
|
|
131
133
|
updateZeroPoint(left: number, top: number): void;
|
|
132
134
|
changeNotification(): this;
|
|
133
135
|
getSelectedObjectMap(): Map<string, BaseObject>;
|
|
136
|
+
/** Complete the current object transform before another gesture takes ownership of the scene. */
|
|
137
|
+
finishTransform(): void;
|
|
138
|
+
private _bindGestureEnd;
|
|
134
139
|
resetProps(config?: ITransformerConfig): void;
|
|
135
140
|
getScene(): Scene;
|
|
136
141
|
clearControls(changeSelf?: boolean): void;
|
|
@@ -183,6 +188,7 @@ export declare class Transformer extends Disposable implements ITransformerConfi
|
|
|
183
188
|
private _getSouthWestPoints;
|
|
184
189
|
private _checkTransformerType;
|
|
185
190
|
private _updateControlIterator;
|
|
191
|
+
private _getControlState;
|
|
186
192
|
private _updateControl;
|
|
187
193
|
private _hideControl;
|
|
188
194
|
private _attachHover;
|
|
@@ -32,13 +32,11 @@ export declare class DumbCanvasColorService implements ICanvasColorService {
|
|
|
32
32
|
export declare class CanvasColorService extends Disposable implements ICanvasColorService {
|
|
33
33
|
private readonly _themeService;
|
|
34
34
|
private readonly _darkModeCache;
|
|
35
|
-
private readonly
|
|
35
|
+
private readonly _resolvedThemeColors;
|
|
36
36
|
private _invertAlgo;
|
|
37
37
|
constructor(_themeService: ThemeService);
|
|
38
38
|
getRenderColor(inputColor: string): string;
|
|
39
|
-
private
|
|
40
|
-
private _resolveThemeColor;
|
|
39
|
+
private _cacheThemeColors;
|
|
41
40
|
}
|
|
42
|
-
export declare function getDarkRenderColorOverride(color: string): string | null;
|
|
43
41
|
export declare function hexToRgb(_hex: string): RGBColorType;
|
|
44
42
|
export declare function rgbToHex(rgbColor: RGBColorType): string;
|
|
@@ -13,5 +13,9 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
|
|
16
|
+
import { Vector2 } from '../basics/vector2';
|
|
17
|
+
import { Rect } from './rect';
|
|
18
|
+
/** A precise mouse handle with a zoom-independent touch target. */
|
|
19
|
+
export declare class Control extends Rect {
|
|
20
|
+
getTouchHitDistance(coord: Vector2): number;
|
|
17
21
|
}
|
|
@@ -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,6 +139,8 @@ export declare abstract class Shape<T extends IShapeProps> extends BaseObject {
|
|
|
132
139
|
toJson(): {
|
|
133
140
|
[x: string]: any;
|
|
134
141
|
};
|
|
142
|
+
transformByState(option: IObjectFullState): this | undefined;
|
|
143
|
+
translate(x?: number | string, y?: number | string): this;
|
|
135
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;
|
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 {};
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2023-present DreamNum Co., Ltd.
|
|
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
|
+
import type { DocumentDataModel, LocaleService, Nullable } from '@univerjs/core';
|
|
17
|
+
import type { IDocumentSkeletonPage } from './basics/i-document-skeleton-cached';
|
|
18
|
+
import type { IDocumentLayoutGeometryPublication, IDocumentLayoutPagePublication } from './components/docs/layout/document-layout-publication';
|
|
19
|
+
import type { DocumentLayoutReason, IDocumentLayoutInvalidation, IDocumentLayoutProgress } from './components/docs/layout/document-layout-types';
|
|
20
|
+
import { Disposable } from '@univerjs/core';
|
|
21
|
+
export interface IDocumentLayoutSessionStartOptions {
|
|
22
|
+
reason?: DocumentLayoutReason;
|
|
23
|
+
anchor?: number;
|
|
24
|
+
priorityAnchor?: number;
|
|
25
|
+
invalidation?: IDocumentLayoutInvalidation;
|
|
26
|
+
waitForHyphenationPatterns?: boolean;
|
|
27
|
+
modernPageWidth?: number;
|
|
28
|
+
modernHorizontalMargin?: number;
|
|
29
|
+
}
|
|
30
|
+
export interface IDocumentLayoutStepResult {
|
|
31
|
+
progress: IDocumentLayoutProgress;
|
|
32
|
+
publication: IDocumentLayoutGeometryPublication | null;
|
|
33
|
+
}
|
|
34
|
+
export interface IDocumentLayoutPageResolution {
|
|
35
|
+
pageIndex: number;
|
|
36
|
+
pageNumber: number;
|
|
37
|
+
startOffset: number;
|
|
38
|
+
endOffset: number;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Worker-safe owner of the document view model and incremental layout state.
|
|
42
|
+
* Scheduling, transport, presentation and model revision ordering belong to callers.
|
|
43
|
+
*/
|
|
44
|
+
export declare class DocumentLayoutSession extends Disposable {
|
|
45
|
+
private readonly _viewModel;
|
|
46
|
+
private readonly _skeleton;
|
|
47
|
+
private _lastPublishedPageCount;
|
|
48
|
+
private _layoutReason;
|
|
49
|
+
private _didPublishEditAnchor;
|
|
50
|
+
private _continuousPageSnapshot;
|
|
51
|
+
private _continuousReplacementOffset;
|
|
52
|
+
private readonly _publishedHeaderPages;
|
|
53
|
+
private readonly _publishedFooterPages;
|
|
54
|
+
private _resetPublishedResources;
|
|
55
|
+
private _pendingPaginatedCompletion;
|
|
56
|
+
constructor(dataModel: DocumentDataModel, localeService: LocaleService);
|
|
57
|
+
start(options?: IDocumentLayoutSessionStartOptions): number;
|
|
58
|
+
step(generation: number, budgetMs?: number, maxWorkUnits?: number): IDocumentLayoutStepResult;
|
|
59
|
+
publishBacklog(generation: number): IDocumentLayoutStepResult;
|
|
60
|
+
getPage(pageIndex: number): IDocumentLayoutPagePublication | null;
|
|
61
|
+
resolvePageByOffset(offset: number): IDocumentLayoutPageResolution | null;
|
|
62
|
+
cancel(generation?: number): void;
|
|
63
|
+
resetDataModel(dataModel: DocumentDataModel): void;
|
|
64
|
+
getProgress(): Nullable<IDocumentLayoutProgress>;
|
|
65
|
+
static hydratePage(publication: IDocumentLayoutPagePublication, snapshot?: ReturnType<DocumentDataModel['getSnapshot']>): IDocumentSkeletonPage;
|
|
66
|
+
dispose(): void;
|
|
67
|
+
private _collectPublications;
|
|
68
|
+
private _publishPaginatedCompletionBacklog;
|
|
69
|
+
private _collectPublication;
|
|
70
|
+
private _collectResourcePublication;
|
|
71
|
+
}
|