@univerjs/engine-render 1.0.0-rc.0 → 1.0.1
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/{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 +3903 -1756
- 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 +3819 -1681
- package/lib/index.js +3819 -1681
- package/lib/types/basics/document-node-tools.d.ts +2 -0
- package/lib/types/basics/i-document-skeleton-cached.d.ts +32 -6
- package/lib/types/basics/interfaces.d.ts +14 -5
- package/lib/types/basics/tools.d.ts +4 -2
- package/lib/types/basics/transformer-config.d.ts +4 -0
- package/lib/types/components/docs/custom-glyph-renderer.d.ts +36 -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 +20 -2
- package/lib/types/components/docs/extensions/font-and-base-line.d.ts +5 -1
- package/lib/types/components/docs/layout/block/column.d.ts +3 -2
- package/lib/types/components/docs/layout/block/paragraph/layout-ruler.d.ts +14 -5
- package/lib/types/components/docs/layout/block/table.d.ts +5 -4
- package/lib/types/components/docs/layout/doc-skeleton.d.ts +13 -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/page.d.ts +6 -2
- package/lib/types/components/docs/layout/shaping-engine/font-cache.d.ts +2 -2
- package/lib/types/components/docs/layout/tools.d.ts +17 -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 +9 -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 +3 -1
- package/lib/types/index.d.ts +7 -3
- package/lib/types/scene-viewer.d.ts +2 -1
- package/lib/types/scene.d.ts +2 -1
- package/lib/types/scene.input-manager.d.ts +2 -0
- package/lib/types/scene.transformer.d.ts +6 -2
- package/lib/types/shape/control.d.ts +5 -1
- package/lib/types/worker-layout.d.ts +9 -0
- package/lib/umd/index.js +4 -5
- package/package.json +6 -6
|
@@ -18,6 +18,7 @@ import type { IBreakPoints } from '../line-breaker';
|
|
|
18
18
|
import { Break } from '../break';
|
|
19
19
|
export declare class LineBreakerLinkEnhancer implements IBreakPoints {
|
|
20
20
|
private _lineBreaker;
|
|
21
|
+
private readonly _allowLinkBreaks;
|
|
21
22
|
private _curBreak;
|
|
22
23
|
private _nextBreak;
|
|
23
24
|
private _isInLink;
|
|
@@ -25,6 +26,6 @@ export declare class LineBreakerLinkEnhancer implements IBreakPoints {
|
|
|
25
26
|
private _index;
|
|
26
27
|
private _linkSlice;
|
|
27
28
|
content: string;
|
|
28
|
-
constructor(_lineBreaker: IBreakPoints);
|
|
29
|
+
constructor(_lineBreaker: IBreakPoints, _allowLinkBreaks?: boolean);
|
|
29
30
|
nextBreakPoint(): Nullable<Break>;
|
|
30
31
|
}
|
|
@@ -13,12 +13,21 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
import type { IAdjustability, IDocumentSkeletonBullet, IDocumentSkeletonDivide, IDocumentSkeletonGlyph } from '../../../../basics/i-document-skeleton-cached';
|
|
16
|
+
import type { IAdjustability, IDocumentSkeletonBullet, IDocumentSkeletonDivide, IDocumentSkeletonFontStyle, IDocumentSkeletonGlyph } from '../../../../basics/i-document-skeleton-cached';
|
|
17
17
|
import type { IFontCreateConfig } from '../../../../basics/interfaces';
|
|
18
|
+
import type { IDocumentCompatibilityPolicy } from '../../document-compatibility';
|
|
18
19
|
import { GlyphType } from '../../../../basics/i-document-skeleton-cached';
|
|
19
20
|
export declare function isSpace(char: string): boolean;
|
|
21
|
+
export declare function getGlyphGroupFontBoundingBox(policy: IDocumentCompatibilityPolicy | undefined, ...glyphGroups: IDocumentSkeletonGlyph[][]): {
|
|
22
|
+
boundingBoxAscent: number;
|
|
23
|
+
boundingBoxDescent: number;
|
|
24
|
+
normalLineHeight: number;
|
|
25
|
+
};
|
|
26
|
+
export declare function getTextHorizontalScale(percent?: number): number;
|
|
20
27
|
export declare function isJustifiable(content: string): boolean;
|
|
21
|
-
export declare function baseAdjustability(content: string, width: number): IAdjustability;
|
|
28
|
+
export declare function baseAdjustability(content: string, width: number, emWidth?: number): IAdjustability;
|
|
29
|
+
export declare function getGlyphGroupStretchability(glyphGroup: IDocumentSkeletonGlyph[]): number;
|
|
30
|
+
export declare function getGlyphGroupShrinkability(glyphGroup: IDocumentSkeletonGlyph[], punctuationOnly?: boolean): number;
|
|
22
31
|
export declare function createSkeletonWordGlyph(content: string, config: IFontCreateConfig, glyphWidth?: number): IDocumentSkeletonGlyph;
|
|
23
32
|
export declare function createSkeletonLetterGlyph(content: string, config: IFontCreateConfig, glyphMetrics?: number | {
|
|
24
33
|
ascent?: number;
|
|
@@ -41,10 +50,25 @@ export declare function createSkeletonWholeEntityGlyph(raw: string, config: IFon
|
|
|
41
50
|
export declare function createSkeletonTabGlyph(config: IFontCreateConfig, glyphWidth?: number): IDocumentSkeletonGlyph;
|
|
42
51
|
export declare function createHyphenDashGlyph(config: IFontCreateConfig): IDocumentSkeletonGlyph;
|
|
43
52
|
export declare function createSkeletonCustomBlockGlyph(config: IFontCreateConfig, glyphWidth?: number, glyphHeight?: number, drawingId?: string): IDocumentSkeletonGlyph;
|
|
44
|
-
export declare function
|
|
45
|
-
export declare function
|
|
53
|
+
export declare function getPairKerningAdjustment(left: string, right: string, font: IDocumentSkeletonFontStyle): number;
|
|
54
|
+
export declare function applyGlyphKerning(glyphs: IDocumentSkeletonGlyph[]): void;
|
|
55
|
+
export declare function getGlyphPairKerningAdjustment(left?: IDocumentSkeletonGlyph, right?: IDocumentSkeletonGlyph): number;
|
|
56
|
+
/** Shared by skeleton layout and lightweight host measurement; offsets also drive painting. */
|
|
57
|
+
export declare function measureTextWithCharacterSpacing(content: string, spacing: number | undefined, measure: (text: string) => number, pairAdjustment?: (left: string, right: string) => number): {
|
|
58
|
+
content: string;
|
|
59
|
+
width: number;
|
|
60
|
+
inkWidth: number;
|
|
61
|
+
segments: Array<{
|
|
62
|
+
content: string;
|
|
63
|
+
left: number;
|
|
64
|
+
}>;
|
|
65
|
+
} | undefined;
|
|
66
|
+
export declare function _createSkeletonWordOrLetter(glyphType: GlyphType, raw: string, config: IFontCreateConfig, glyphWidth?: number): IDocumentSkeletonGlyph;
|
|
67
|
+
export declare function createSkeletonBulletGlyph(glyph: IDocumentSkeletonGlyph, bulletSkeleton: IDocumentSkeletonBullet, charSpaceApply: number, documentCompatibilityPolicy?: IDocumentCompatibilityPolicy): IDocumentSkeletonGlyph;
|
|
46
68
|
export declare function setGlyphGroupLeft(glyphGroup: IDocumentSkeletonGlyph[], left?: number): void;
|
|
47
69
|
export declare function setGlyphLeft(glyph: IDocumentSkeletonGlyph, left?: number): void;
|
|
48
70
|
export declare function addGlyphToDivide(divide: IDocumentSkeletonDivide, glyphGroup: IDocumentSkeletonGlyph[], offsetLeft?: number): void;
|
|
71
|
+
export declare function removeGlyphAutoSpacing(glyph: IDocumentSkeletonGlyph, side: 0 | 1): void;
|
|
49
72
|
export declare function glyphShrinkRight(glyph: IDocumentSkeletonGlyph, amount: number): void;
|
|
50
73
|
export declare function glyphShrinkLeft(glyph: IDocumentSkeletonGlyph, amount: number): void;
|
|
74
|
+
export declare function preserveLineStartPunctuationSpace(glyph: IDocumentSkeletonGlyph): void;
|
|
@@ -13,18 +13,21 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
import type { IDocumentBody, ITable, Nullable } from '@univerjs/core';
|
|
16
|
+
import type { IDocumentBody, ITable, ITableCellBorder, ITableRow, Nullable } from '@univerjs/core';
|
|
17
17
|
import type { IDocumentSkeletonPage, ISkeletonResourceReference } from '../../../../basics/i-document-skeleton-cached';
|
|
18
18
|
import type { ISectionBreakConfig } from '../../../../basics/interfaces';
|
|
19
19
|
import type { DataStreamTreeNode } from '../../view-model/data-stream-tree-node';
|
|
20
20
|
import type { DocumentViewModel } from '../../view-model/document-view-model';
|
|
21
21
|
import type { ILayoutContext } from '../tools';
|
|
22
22
|
import { BreakType } from '../../../../basics/i-document-skeleton-cached';
|
|
23
|
-
export declare function createSkeletonPage(ctx: ILayoutContext, sectionBreakConfig: ISectionBreakConfig, skeletonResourceReference: ISkeletonResourceReference, pageNumber?: number, breakType?: BreakType): IDocumentSkeletonPage;
|
|
23
|
+
export declare function createSkeletonPage(ctx: ILayoutContext, sectionBreakConfig: ISectionBreakConfig, skeletonResourceReference: ISkeletonResourceReference, pageNumber?: number, breakType?: BreakType, pageContext?: Pick<IDocumentSkeletonPage, 'type' | 'segmentId'>): IDocumentSkeletonPage;
|
|
24
24
|
export declare function createNullCellPage(ctx: ILayoutContext, sectionBreakConfig: ISectionBreakConfig, tableConfig: ITable, row: number, col: number, availableHeight?: number, maxCellPageHeight?: number, inheritDocumentLinePitch?: boolean, enableDocumentTableLineGrid?: boolean, cellPageHeights?: readonly number[]): {
|
|
25
25
|
page: IDocumentSkeletonPage;
|
|
26
26
|
sectionBreakConfig: ISectionBreakConfig;
|
|
27
|
+
verticalCellWidth: number | undefined;
|
|
27
28
|
};
|
|
29
|
+
export declare function getCellBorderWidth(border: ITableCellBorder | undefined): number;
|
|
30
|
+
export declare function getRowBorderInset(row: ITableRow, edge: 'borderTop' | 'borderBottom', tableBoundary?: boolean): number;
|
|
28
31
|
export declare function createSkeletonCellPages(ctx: ILayoutContext, viewModel: DocumentViewModel, cellNode: DataStreamTreeNode, sectionBreakConfig: ISectionBreakConfig, tableConfig: ITable, row: number, col: number, availableHeight?: number, maxCellPageHeight?: number, cellPageHeights?: readonly number[]): IDocumentSkeletonPage[];
|
|
29
32
|
export interface ICellSkeletonBuildState {
|
|
30
33
|
ctx: ILayoutContext;
|
|
@@ -34,6 +37,7 @@ export interface ICellSkeletonBuildState {
|
|
|
34
37
|
sectionBreakConfig: ISectionBreakConfig;
|
|
35
38
|
cellSectionBreakConfig: ISectionBreakConfig;
|
|
36
39
|
tableConfig: ITable;
|
|
40
|
+
verticalCellWidth?: number;
|
|
37
41
|
paragraphIndex: number;
|
|
38
42
|
layoutAnchor: Nullable<number>;
|
|
39
43
|
pages: IDocumentSkeletonPage[];
|
|
@@ -52,14 +52,14 @@ export declare class FontCache {
|
|
|
52
52
|
/** Transfers browser-only normal spacing measurements to the document layout Worker. */
|
|
53
53
|
static getNormalLineHeightCache(): Record<string, number>;
|
|
54
54
|
static setNormalLineHeightCache(metrics: Record<string, number>): void;
|
|
55
|
-
static getTextSize(content: string, fontStyle: IDocumentSkeletonFontStyle, includeNormalFontLeading?: boolean): IDocumentSkeletonBoundingBox;
|
|
55
|
+
static getTextSize(content: string, fontStyle: IDocumentSkeletonFontStyle, includeNormalFontLeading?: boolean, useUnhintedMetrics?: boolean): IDocumentSkeletonBoundingBox;
|
|
56
56
|
/**
|
|
57
57
|
* Measure text on another canvas.
|
|
58
58
|
* @param content
|
|
59
59
|
* @param fontString
|
|
60
60
|
* @returns IMeasureTextCache
|
|
61
61
|
*/
|
|
62
|
-
static getMeasureText(content: string, fontString: string): IMeasureTextCache;
|
|
62
|
+
static getMeasureText(content: string, fontString: string, kerning?: CanvasFontKerning): IMeasureTextCache;
|
|
63
63
|
private static _createMeasureContext;
|
|
64
64
|
private static _getFontSizeFromStyle;
|
|
65
65
|
private static _clearMeasureCache;
|
|
@@ -13,11 +13,12 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
import type { DocumentDataModel, ICustomRangeForInterceptor, INumberUnit, IObjectPositionH, IObjectPositionV,
|
|
16
|
+
import type { DocumentDataModel, ICustomRangeForInterceptor, IDocDrawingBase, INumberUnit, IObjectPositionH, IObjectPositionV, Nullable, PositionedObjectLayoutType } from '@univerjs/core';
|
|
17
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
|
+
import type { IDocumentLayoutParagraph, IDocumentLayoutParagraphStyle, IDocumentLayoutTextStyle } from '../document-layout-presentation';
|
|
21
22
|
import type { DataStreamTreeNode } from '../view-model/data-stream-tree-node';
|
|
22
23
|
import type { DocumentViewModel } from '../view-model/document-view-model';
|
|
23
24
|
import type { DocumentEndnoteLayout } from './endnote-layout';
|
|
@@ -70,7 +71,10 @@ export declare function getCharSpaceConfig(sectionBreakConfig: ISectionBreakConf
|
|
|
70
71
|
gridType: GridType;
|
|
71
72
|
snapToGrid: BooleanNumber;
|
|
72
73
|
};
|
|
74
|
+
export declare function getLineMetricGlyphs(glyphGroup: IDocumentSkeletonGlyph[], documentCompatibilityPolicy?: IDocumentCompatibilityPolicy, previousGlyphs?: IDocumentSkeletonGlyph[]): IDocumentSkeletonGlyph[];
|
|
75
|
+
export declare function getDrawingMLLineBaseline(lineHeight: number, ascent: number, descent: number): number;
|
|
73
76
|
export declare function updateBlockIndex(pages: IDocumentSkeletonPage[], start?: number, documentCompatibilityPolicy?: IDocumentCompatibilityPolicy): void;
|
|
77
|
+
export declare function isParagraphEnd(line: IDocumentSkeletonLine): boolean;
|
|
74
78
|
export declare function hasSameParagraphBorderSet(first: IDocumentSkeletonParagraphBorders, second: IDocumentSkeletonParagraphBorders): boolean;
|
|
75
79
|
export declare function updateInlineDrawingCoordsAndBorder(ctx: ILayoutContext, pages: IDocumentSkeletonPage[]): void;
|
|
76
80
|
export declare function updateParagraphBorders(ctx: ILayoutContext, pages: IDocumentSkeletonPage[], targetPages?: IDocumentSkeletonPage[]): void;
|
|
@@ -98,7 +102,7 @@ export interface IDocumentSkeletonLineContext {
|
|
|
98
102
|
visualLeft?: number;
|
|
99
103
|
visualWidth?: number;
|
|
100
104
|
}
|
|
101
|
-
export type DocumentSkeletonTableSource = 'page' | 'column' | 'header' | 'footer';
|
|
105
|
+
export type DocumentSkeletonTableSource = 'page' | 'table-cell' | 'column' | 'header' | 'footer';
|
|
102
106
|
type HeaderFooterSkeletonMap = Map<string, Map<number, IDocumentSkeletonPage>>;
|
|
103
107
|
export interface IDocumentSkeletonTableCellGeometry {
|
|
104
108
|
cell: IDocumentSkeletonPage;
|
|
@@ -158,27 +162,29 @@ export declare function compareDocumentSkeletonNestedPagePathOrder(pos1: {
|
|
|
158
162
|
export declare function columnIterator(pages: IDocumentSkeletonPage[], iteratorFunction: (column: IDocumentSkeletonColumn) => void): void;
|
|
159
163
|
export declare function getPositionHorizon(positionH: IObjectPositionH, column: IDocumentSkeletonColumn, page: IDocumentSkeletonPage, objectWidth: number, isPageBreak?: boolean): number | undefined;
|
|
160
164
|
export declare function getPositionVertical(positionV: IObjectPositionV, page: IDocumentSkeletonPage, lineTop: number, lineHeight: number, objectHeight: number, blockAnchorTop?: number, isPageBreak?: boolean): number | undefined;
|
|
161
|
-
export declare function getGlyphGroupWidth(divide: IDocumentSkeletonDivide): number;
|
|
165
|
+
export declare function getGlyphGroupWidth(divide: IDocumentSkeletonDivide, excludeTrailingSpaces?: boolean): number;
|
|
162
166
|
interface IFontCreateConfig {
|
|
163
167
|
documentCompatibilityPolicy?: IDocumentCompatibilityPolicy;
|
|
164
168
|
fontStyle: IDocumentSkeletonFontStyle;
|
|
165
|
-
textStyle:
|
|
169
|
+
textStyle: IDocumentLayoutTextStyle;
|
|
166
170
|
charSpace: number;
|
|
167
171
|
gridType: GridType;
|
|
168
172
|
snapToGrid: BooleanNumber;
|
|
169
173
|
pageWidth: number;
|
|
174
|
+
balanceSingleByteDoubleByteWidth?: BooleanNumber;
|
|
170
175
|
}
|
|
171
176
|
export declare function clearFontCreateConfigCache(): void;
|
|
172
|
-
export declare function getFontConfigFromLastGlyph(glyph: IDocumentSkeletonGlyph, sectionBreakConfig: ISectionBreakConfig, paragraphStyle:
|
|
177
|
+
export declare function getFontConfigFromLastGlyph(glyph: IDocumentSkeletonGlyph, sectionBreakConfig: ISectionBreakConfig, paragraphStyle: IDocumentLayoutParagraphStyle): {
|
|
173
178
|
documentCompatibilityPolicy: IDocumentCompatibilityPolicy;
|
|
174
179
|
fontStyle: IDocumentSkeletonFontStyle;
|
|
175
|
-
textStyle:
|
|
180
|
+
textStyle: IDocumentLayoutTextStyle;
|
|
181
|
+
balanceSingleByteDoubleByteWidth: BooleanNumber | undefined;
|
|
176
182
|
charSpace: number;
|
|
177
183
|
gridType: GridType;
|
|
178
184
|
snapToGrid: BooleanNumber;
|
|
179
185
|
pageWidth: number;
|
|
180
186
|
};
|
|
181
|
-
export declare function getFontCreateConfig(index: number, viewModel: DocumentViewModel, paragraphNode: DataStreamTreeNode, sectionBreakConfig: ISectionBreakConfig, paragraph:
|
|
187
|
+
export declare function getFontCreateConfig(index: number, viewModel: DocumentViewModel, paragraphNode: DataStreamTreeNode, sectionBreakConfig: ISectionBreakConfig, paragraph: IDocumentLayoutParagraph): IFontCreateConfig;
|
|
182
188
|
export declare function getCustomRangeGlyphWidth(index: number, viewModel: DocumentViewModel, paragraphNode: DataStreamTreeNode, config: IFontCreateConfig): number | undefined;
|
|
183
189
|
/**
|
|
184
190
|
* Returns whether a custom range should occupy one measured glyph in the
|
|
@@ -214,6 +220,7 @@ export interface IFloatObject {
|
|
|
214
220
|
angle: number;
|
|
215
221
|
behindDoc?: BooleanNumber;
|
|
216
222
|
layoutType?: PositionedObjectLayoutType;
|
|
223
|
+
effectExtent?: IDocDrawingBase['effectExtent'];
|
|
217
224
|
type: FloatObjectType;
|
|
218
225
|
positionV: IObjectPositionV;
|
|
219
226
|
}
|
|
@@ -239,7 +246,7 @@ export interface ILayoutContext {
|
|
|
239
246
|
endnoteLayout?: DocumentEndnoteLayout;
|
|
240
247
|
/** Virtual marker in a note body; it never consumes a persisted character. */
|
|
241
248
|
noteLabel?: string;
|
|
242
|
-
noteReferenceTextStyle?:
|
|
249
|
+
noteReferenceTextStyle?: IDocumentLayoutTextStyle;
|
|
243
250
|
/** Preserve the local note segment when the paragraph/table pipeline opens a continuation page. */
|
|
244
251
|
noteSegmentId?: string;
|
|
245
252
|
footnoteFirstColumn?: {
|
|
@@ -249,6 +256,8 @@ export interface ILayoutContext {
|
|
|
249
256
|
viewModel: DocumentViewModel;
|
|
250
257
|
dataModel: DocumentDataModel;
|
|
251
258
|
docsConfig: IDocsConfig;
|
|
259
|
+
modernPageWidth?: number;
|
|
260
|
+
modernHorizontalMargin?: number;
|
|
252
261
|
skeleton: IDocumentSkeletonCached;
|
|
253
262
|
layoutStartPointer: Record<string, Nullable<number>>;
|
|
254
263
|
isDirty: boolean;
|
|
@@ -0,0 +1,20 @@
|
|
|
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 { IPageBorders } from '@univerjs/core';
|
|
17
|
+
import type { IDocumentSkeletonPage } from '../../basics/i-document-skeleton-cached';
|
|
18
|
+
import type { UniverRenderingContext } from '../../context';
|
|
19
|
+
/** Draws section page borders without contributing to text/table layout. */
|
|
20
|
+
export declare function drawPageBorders(ctx: UniverRenderingContext, page: IDocumentSkeletonPage, borders: IPageBorders | undefined, pageLeft: number, pageTop: number, firstPageInSection: boolean): void;
|
|
@@ -0,0 +1,16 @@
|
|
|
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
|
+
export declare function getTopmostDocsTableHit<T>(tables: readonly T[], hitBody: (table: T) => boolean, hitControls: (table: T) => boolean, isNestedTable?: (outer: T, inner: T) => boolean): T | undefined;
|
|
@@ -13,6 +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 { DocumentFlavor } from '@univerjs/core';
|
|
17
|
+
import type { IDocumentSkeletonPage } from '../../basics/i-document-skeleton-cached';
|
|
18
|
+
/** Shared by the canvas renderer and interactive table viewport provider. */
|
|
19
|
+
export declare function getDocsTableLayoutViewportWidth(page: Pick<IDocumentSkeletonPage, 'pageWidth' | 'marginLeft' | 'marginRight'> & Partial<Pick<IDocumentSkeletonPage, 'type'>>, tableLeft: number, tableSource: unknown, documentFlavor?: DocumentFlavor): number;
|
|
16
20
|
export interface IDocsTableRenderViewport {
|
|
17
21
|
contentWidth: number;
|
|
18
22
|
leadingInsetLeft?: number;
|
|
@@ -25,6 +25,7 @@ export declare class DataStreamTreeNode {
|
|
|
25
25
|
blocks: number[];
|
|
26
26
|
constructor(nodeType: DataStreamTreeNodeType, content?: string | undefined);
|
|
27
27
|
static create(nodeType: DataStreamTreeNodeType, content?: string): DataStreamTreeNode;
|
|
28
|
+
get contentStartIndex(): number;
|
|
28
29
|
dispose(): void;
|
|
29
30
|
getProps(): {
|
|
30
31
|
children: DataStreamTreeNode[];
|
|
@@ -13,7 +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 { DocumentDataModel,
|
|
16
|
+
import type { DocumentDataModel, ICustomBlock, ICustomDecorationForInterceptor, ICustomRangeForInterceptor, ICustomTable, IDisposable, ITable, JSONXActions, Nullable } from '@univerjs/core';
|
|
17
|
+
import type { IDocumentLayoutBody, IDocumentLayoutColumnGroup, IDocumentLayoutCustomColumnGroup, IDocumentLayoutParagraph, IDocumentLayoutSectionBreak, IDocumentLayoutSnapshot, IDocumentLayoutTextRun } from '../document-layout-presentation';
|
|
17
18
|
import { DataStreamTreeNode } from './data-stream-tree-node';
|
|
18
19
|
interface ITableNodeCache {
|
|
19
20
|
table: DataStreamTreeNode;
|
|
@@ -36,8 +37,8 @@ interface ITableCoupleCache {
|
|
|
36
37
|
tableSource: ITable;
|
|
37
38
|
}
|
|
38
39
|
interface IColumnGroupCoupleCache {
|
|
39
|
-
columnGroup:
|
|
40
|
-
columnGroupSource:
|
|
40
|
+
columnGroup: IDocumentLayoutCustomColumnGroup;
|
|
41
|
+
columnGroupSource: IDocumentLayoutColumnGroup;
|
|
41
42
|
}
|
|
42
43
|
export declare class DocumentViewModel implements IDisposable {
|
|
43
44
|
private _documentDataModel;
|
|
@@ -82,16 +83,16 @@ export declare class DocumentViewModel implements IDisposable {
|
|
|
82
83
|
getEditArea(): DocumentEditArea;
|
|
83
84
|
setEditArea(editArea: DocumentEditArea): void;
|
|
84
85
|
getChildren(): DataStreamTreeNode[];
|
|
85
|
-
getBody():
|
|
86
|
-
getSnapshot():
|
|
86
|
+
getBody(): IDocumentLayoutBody | undefined;
|
|
87
|
+
getSnapshot(): IDocumentLayoutSnapshot;
|
|
87
88
|
getDataModel(): DocumentDataModel;
|
|
88
89
|
getSelfOrHeaderFooterViewModel(segmentId?: string): DocumentViewModel;
|
|
89
90
|
reset(documentDataModel: DocumentDataModel): void;
|
|
90
91
|
resetByValidatedTextMutation(documentDataModel: DocumentDataModel, actions: JSONXActions): boolean;
|
|
91
92
|
resetByValidatedMetadataMutation(documentDataModel: DocumentDataModel, actions: JSONXActions): boolean;
|
|
92
|
-
getSectionBreak(index: number):
|
|
93
|
-
getParagraph(index: number):
|
|
94
|
-
getTextRun(index: number): Nullable<
|
|
93
|
+
getSectionBreak(index: number): IDocumentLayoutSectionBreak | undefined;
|
|
94
|
+
getParagraph(index: number): IDocumentLayoutParagraph | undefined;
|
|
95
|
+
getTextRun(index: number): Nullable<IDocumentLayoutTextRun>;
|
|
95
96
|
getCustomBlock(index: number): ICustomBlock | undefined;
|
|
96
97
|
getCustomBlockWithoutSetCurrentIndex(index: number): ICustomBlock | undefined;
|
|
97
98
|
getTableByStartIndex(index: number): ITableCoupleCache | undefined;
|
|
@@ -13,10 +13,11 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
import type {
|
|
16
|
+
import type { IRange, IScale, Nullable } from '@univerjs/core';
|
|
17
17
|
import type { BaseObject } from '../base-object';
|
|
18
18
|
import type { IBoundRectNoAngle, Vector2 } from '../basics/vector2';
|
|
19
19
|
import type { UniverRenderingContext } from '../context';
|
|
20
|
+
import type { IDocumentLayoutRenderConfig } from './docs/document-layout-presentation';
|
|
20
21
|
import { Registry } from '@univerjs/core';
|
|
21
22
|
export interface IExtensionConfig {
|
|
22
23
|
originTranslate?: Vector2;
|
|
@@ -24,7 +25,7 @@ export interface IExtensionConfig {
|
|
|
24
25
|
spanPointWithFont?: Vector2;
|
|
25
26
|
centerPoint?: Vector2;
|
|
26
27
|
alignOffset?: Vector2;
|
|
27
|
-
renderConfig?:
|
|
28
|
+
renderConfig?: IDocumentLayoutRenderConfig;
|
|
28
29
|
}
|
|
29
30
|
export interface IDrawInfo {
|
|
30
31
|
viewRanges: IRange[];
|
|
@@ -17,7 +17,8 @@ import type { IRange } from '@univerjs/core';
|
|
|
17
17
|
import type { SpreadsheetSkeleton } from '../sheet.render-skeleton';
|
|
18
18
|
import { ComponentExtension } from '../../extension';
|
|
19
19
|
export declare enum SHEET_EXTENSION_TYPE {
|
|
20
|
-
|
|
20
|
+
BACKGROUND = 0,
|
|
21
|
+
GRID = 1
|
|
21
22
|
}
|
|
22
23
|
/**
|
|
23
24
|
* for distinguish doc & slides extensions, now only used when metric performance.
|
|
@@ -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;
|
|
@@ -185,7 +187,7 @@ export declare class SpreadsheetSkeleton extends SheetSkeleton {
|
|
|
185
187
|
_setBorderStylesCache(row: number, col: number, style: Nullable<IStyleData>, options: ISetStylesCacheForOneCellOptions | undefined): void;
|
|
186
188
|
_setBgStylesCache(row: number, col: number, style: Nullable<IStyleData>, options: ISetStylesCacheForOneCellOptions | undefined): void;
|
|
187
189
|
private _applyShrinkToFit;
|
|
188
|
-
private
|
|
190
|
+
private _applyNumberDisplay;
|
|
189
191
|
_setFontStylesCache(row: number, col: number, cellData: Nullable<ICellDataForSheetInterceptor>, style: IStyleData, hasMergeData?: boolean): void;
|
|
190
192
|
/**
|
|
191
193
|
* Set border background and font to this._stylesCache cell by cell.
|
package/lib/types/index.d.ts
CHANGED
|
@@ -24,11 +24,14 @@ 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';
|
|
@@ -41,8 +44,9 @@ export { compareDocumentSkeletonNestedPagePathOrder, documentSkeletonLineIterato
|
|
|
41
44
|
export type { IDocumentSkeletonColumnPagePathInfo, IDocumentSkeletonLineContext, IDocumentSkeletonLineIteratorOptions, IDocumentSkeletonTableCellGeometry, IDocumentSkeletonTableContext, IDocumentSkeletonTableIteratorOptions } from './components/docs/layout/tools';
|
|
42
45
|
export { getLastColumn } from './components/docs/layout/tools';
|
|
43
46
|
export { Liquid } from './components/docs/liquid';
|
|
47
|
+
export { getTopmostDocsTableHit } from './components/docs/table-hit-test';
|
|
44
48
|
export type { DocsTableRenderViewportProvider, IDocsTableRenderViewport, } from './components/docs/table-render-viewport';
|
|
45
|
-
export { getDocsTableRenderViewport, getDocsTableViewportLeft, setDocsTableRenderViewportProvider, } from './components/docs/table-render-viewport';
|
|
49
|
+
export { getDocsTableLayoutViewportWidth, getDocsTableRenderViewport, getDocsTableViewportLeft, setDocsTableRenderViewportProvider, } from './components/docs/table-render-viewport';
|
|
46
50
|
export { DataStreamTreeNode } from './components/docs/view-model/data-stream-tree-node';
|
|
47
51
|
export { DocumentViewModel } from './components/docs/view-model/document-view-model';
|
|
48
52
|
export { DocumentEditArea } from './components/docs/view-model/document-view-model';
|
|
@@ -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';
|
|
@@ -293,7 +294,7 @@ export declare class Scene extends Disposable {
|
|
|
293
294
|
* @param {Vector2} coord
|
|
294
295
|
* @return {Nullable<BaseObject | Scene>} object under the pointer
|
|
295
296
|
*/
|
|
296
|
-
pick(coord: Vector2): Nullable<BaseObject | Scene>;
|
|
297
|
+
pick(coord: Vector2, deviceType?: DeviceType): Nullable<BaseObject | Scene>;
|
|
297
298
|
triggerPointerUp(evt: IPointerEvent | IMouseEvent): boolean;
|
|
298
299
|
triggerMouseWheel(evt: IWheelEvent): boolean;
|
|
299
300
|
triggerSingleClick(evt: IPointerEvent | IMouseEvent): boolean;
|
|
@@ -41,6 +41,7 @@ export declare class InputManager extends Disposable {
|
|
|
41
41
|
private _delayedTripeTimeout;
|
|
42
42
|
private _doubleClickOccurred;
|
|
43
43
|
private _tripleClickState;
|
|
44
|
+
private _lastClickTime;
|
|
44
45
|
private _currentObject;
|
|
45
46
|
constructor(scene: Scene);
|
|
46
47
|
/**
|
|
@@ -74,6 +75,7 @@ export declare class InputManager extends Disposable {
|
|
|
74
75
|
* @param offsetY
|
|
75
76
|
*/
|
|
76
77
|
private _getObjectAtPos;
|
|
78
|
+
private _getObjectAtEvent;
|
|
77
79
|
/**
|
|
78
80
|
*
|
|
79
81
|
* If currentObject is null, return true
|
|
@@ -42,11 +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>;
|
|
49
50
|
moveEnabled: boolean;
|
|
51
|
+
moveOnlyWhenSelected: boolean;
|
|
50
52
|
resizeEnabled: boolean;
|
|
51
53
|
rotateEnabled: boolean;
|
|
52
54
|
rotationSnaps: number[];
|
|
@@ -118,8 +120,7 @@ export declare class Transformer extends Disposable implements ITransformerConfi
|
|
|
118
120
|
private _startStateMap;
|
|
119
121
|
private _viewportScrollX;
|
|
120
122
|
private _viewportScrollY;
|
|
121
|
-
private
|
|
122
|
-
private _topScenePointerUpSub;
|
|
123
|
+
private _finishGesture;
|
|
123
124
|
private _cancelFocusSubscription;
|
|
124
125
|
private _transformerControlMap;
|
|
125
126
|
private _selectedObjectMap;
|
|
@@ -132,6 +133,9 @@ export declare class Transformer extends Disposable implements ITransformerConfi
|
|
|
132
133
|
updateZeroPoint(left: number, top: number): void;
|
|
133
134
|
changeNotification(): this;
|
|
134
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;
|
|
135
139
|
resetProps(config?: ITransformerConfig): void;
|
|
136
140
|
getScene(): Scene;
|
|
137
141
|
clearControls(changeSelf?: boolean): void;
|
|
@@ -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
|
}
|
|
@@ -24,11 +24,19 @@ export interface IDocumentLayoutSessionStartOptions {
|
|
|
24
24
|
priorityAnchor?: number;
|
|
25
25
|
invalidation?: IDocumentLayoutInvalidation;
|
|
26
26
|
waitForHyphenationPatterns?: boolean;
|
|
27
|
+
modernPageWidth?: number;
|
|
28
|
+
modernHorizontalMargin?: number;
|
|
27
29
|
}
|
|
28
30
|
export interface IDocumentLayoutStepResult {
|
|
29
31
|
progress: IDocumentLayoutProgress;
|
|
30
32
|
publication: IDocumentLayoutGeometryPublication | null;
|
|
31
33
|
}
|
|
34
|
+
export interface IDocumentLayoutPageResolution {
|
|
35
|
+
pageIndex: number;
|
|
36
|
+
pageNumber: number;
|
|
37
|
+
startOffset: number;
|
|
38
|
+
endOffset: number;
|
|
39
|
+
}
|
|
32
40
|
/**
|
|
33
41
|
* Worker-safe owner of the document view model and incremental layout state.
|
|
34
42
|
* Scheduling, transport, presentation and model revision ordering belong to callers.
|
|
@@ -50,6 +58,7 @@ export declare class DocumentLayoutSession extends Disposable {
|
|
|
50
58
|
step(generation: number, budgetMs?: number, maxWorkUnits?: number): IDocumentLayoutStepResult;
|
|
51
59
|
publishBacklog(generation: number): IDocumentLayoutStepResult;
|
|
52
60
|
getPage(pageIndex: number): IDocumentLayoutPagePublication | null;
|
|
61
|
+
resolvePageByOffset(offset: number): IDocumentLayoutPageResolution | null;
|
|
53
62
|
cancel(generation?: number): void;
|
|
54
63
|
resetDataModel(dataModel: DocumentDataModel): void;
|
|
55
64
|
getProgress(): Nullable<IDocumentLayoutProgress>;
|