@univerjs/engine-render 1.0.4 → 1.1.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/lib/cjs/index.js +392 -338
- package/lib/es/index.js +387 -333
- package/lib/index.js +387 -333
- package/lib/types/basics/i-document-skeleton-cached.d.ts +4 -0
- package/lib/types/basics/interfaces.d.ts +3 -0
- package/lib/types/components/docs/document.d.ts +1 -0
- package/lib/types/components/docs/layout/block/paragraph/layout-ruler.d.ts +1 -1
- package/lib/types/components/docs/layout/block/section.d.ts +1 -0
- package/lib/types/components/docs/layout/doc-simple-skeleton.d.ts +2 -1
- package/lib/types/components/docs/layout/doc-skeleton.d.ts +3 -0
- package/lib/types/components/docs/layout/model/page.d.ts +2 -2
- package/lib/types/components/sheets/extensions/font.d.ts +1 -1
- package/lib/types/components/sheets/sheet.render-skeleton.d.ts +1 -0
- package/lib/types/shape/text.d.ts +2 -0
- package/lib/umd/index.js +5 -5
- package/package.json +5 -5
|
@@ -42,6 +42,7 @@ export interface ISkeletonResourceReference {
|
|
|
42
42
|
drawingAnchor?: Map<string, Map<number, IDocumentSkeletonDrawingAnchor>>;
|
|
43
43
|
}
|
|
44
44
|
export interface IDocumentSkeletonDrawingAnchor {
|
|
45
|
+
left?: number;
|
|
45
46
|
elements: IDocumentSkeletonLine[];
|
|
46
47
|
paragraphIndex: number;
|
|
47
48
|
top: number;
|
|
@@ -318,6 +319,9 @@ export interface IDocumentSkeletonDrawing {
|
|
|
318
319
|
initialState: boolean;
|
|
319
320
|
drawingOrigin: IDocDrawingBase;
|
|
320
321
|
columnLeft: number;
|
|
322
|
+
blockAnchorLeft?: number;
|
|
323
|
+
normalizeTraditionalColumnAnchor?: boolean;
|
|
324
|
+
pageAnchorLeft?: number;
|
|
321
325
|
isPageBreak: boolean;
|
|
322
326
|
lineTop: number;
|
|
323
327
|
lineHeight: number;
|
|
@@ -61,6 +61,7 @@ export interface IFontLocale {
|
|
|
61
61
|
defaultFontSize: number;
|
|
62
62
|
}
|
|
63
63
|
export interface IDocsConfig extends IReferenceSource, IDocumentLayout {
|
|
64
|
+
lineGap?: number;
|
|
64
65
|
localeService: LocaleService;
|
|
65
66
|
documentTextStyle?: IDocumentLayoutTextStyle;
|
|
66
67
|
documentCompatibilityPolicy?: IDocumentCompatibilityPolicy;
|
|
@@ -138,6 +139,8 @@ export interface IFontCreateConfig {
|
|
|
138
139
|
}
|
|
139
140
|
export interface INodeInfo {
|
|
140
141
|
node: IDocumentSkeletonGlyph;
|
|
142
|
+
/** The pointer is inside the glyph's content box, excluding line spacing and paragraph margins. */
|
|
143
|
+
isInsideGlyph?: boolean;
|
|
141
144
|
ratioX: number;
|
|
142
145
|
ratioY: number;
|
|
143
146
|
segmentId: string;
|
|
@@ -57,6 +57,7 @@ export declare class Documents extends DocComponent {
|
|
|
57
57
|
getOffsetConfig(): IDocumentOffsetConfig;
|
|
58
58
|
getEngine(): Nullable<import("../..").Engine>;
|
|
59
59
|
isHit(coord: Vector2): boolean;
|
|
60
|
+
private _isHitTable;
|
|
60
61
|
changeSkeleton(newSkeleton: DocumentSkeleton): this;
|
|
61
62
|
/** Editor-only emphasis; standalone and export renderers retain full document colors. */
|
|
62
63
|
setInactiveAreaOpacity(opacity: number): void;
|
|
@@ -47,6 +47,6 @@ export declare function getLineHeightMetrics(glyphLineHeight: number, paragraphL
|
|
|
47
47
|
contentHeight: number;
|
|
48
48
|
lineSpacingApply: number;
|
|
49
49
|
};
|
|
50
|
-
export declare function updateInlineDrawingPosition(line: IDocumentSkeletonLine, paragraphInlineSkeDrawings?: Map<string, IDocumentSkeletonDrawing>, unitId?: string, blockAnchorTop?: number, paragraphNonInlineSkeDrawings?: Map<string, IDocumentSkeletonDrawing>, documentCompatibilityPolicy?: IParagraphConfig['documentCompatibilityPolicy']): void;
|
|
50
|
+
export declare function updateInlineDrawingPosition(line: IDocumentSkeletonLine, paragraphInlineSkeDrawings?: Map<string, IDocumentSkeletonDrawing>, unitId?: string, blockAnchorTop?: number, paragraphNonInlineSkeDrawings?: Map<string, IDocumentSkeletonDrawing>, documentCompatibilityPolicy?: IParagraphConfig['documentCompatibilityPolicy'], blockAnchorLeft?: number, normalizeTraditionalColumnAnchor?: boolean): void;
|
|
51
51
|
declare function __checkPageBreak(column: IDocumentSkeletonColumn): boolean;
|
|
52
52
|
export {};
|
|
@@ -25,11 +25,12 @@ export declare class DocSimpleSkeleton {
|
|
|
25
25
|
private _warp;
|
|
26
26
|
private _width;
|
|
27
27
|
private _height;
|
|
28
|
+
private _lineGap;
|
|
28
29
|
private _lineBreaker;
|
|
29
30
|
private _lines;
|
|
30
31
|
private _dirty;
|
|
31
32
|
private _lastBreakLength;
|
|
32
|
-
constructor(_text: string, _fontStyle: string, _warp: boolean, _width: number, _height: number);
|
|
33
|
+
constructor(_text: string, _fontStyle: string, _warp: boolean, _width: number, _height: number, _lineGap?: number);
|
|
33
34
|
calculate(): ILineInfo[];
|
|
34
35
|
getLines(): ILineInfo[];
|
|
35
36
|
getTotalHeight(): number;
|
|
@@ -66,11 +66,14 @@ export declare class DocumentSkeleton extends Skeleton {
|
|
|
66
66
|
private readonly _isolateIncrementalPublications;
|
|
67
67
|
private _modernPageWidth;
|
|
68
68
|
private _modernHorizontalMargin;
|
|
69
|
+
private readonly _lineGap;
|
|
69
70
|
constructor(_docViewModel: DocumentViewModel, localeService: LocaleService, options?: {
|
|
70
71
|
isolateIncrementalPublications?: boolean;
|
|
72
|
+
lineGap?: number;
|
|
71
73
|
});
|
|
72
74
|
static create(docViewModel: DocumentViewModel, localeService: LocaleService, options?: {
|
|
73
75
|
isolateIncrementalPublications?: boolean;
|
|
76
|
+
lineGap?: number;
|
|
74
77
|
}): DocumentSkeleton;
|
|
75
78
|
dispose(): void;
|
|
76
79
|
getViewModel(): DocumentViewModel;
|
|
@@ -28,7 +28,7 @@ export declare function createNullCellPage(ctx: ILayoutContext, sectionBreakConf
|
|
|
28
28
|
};
|
|
29
29
|
export declare function getCellBorderWidth(border: ITableCellBorder | undefined): number;
|
|
30
30
|
export declare function getRowBorderInset(row: ITableRow, edge: 'borderTop' | 'borderBottom', tableBoundary?: boolean): number;
|
|
31
|
-
export declare function createSkeletonCellPages(
|
|
31
|
+
export declare function createSkeletonCellPages(parentContext: ILayoutContext, viewModel: DocumentViewModel, cellNode: DataStreamTreeNode, sectionBreakConfig: ISectionBreakConfig, tableConfig: ITable, row: number, col: number, availableHeight?: number, maxCellPageHeight?: number, cellPageHeights?: readonly number[]): IDocumentSkeletonPage[];
|
|
32
32
|
export interface ICellSkeletonBuildState {
|
|
33
33
|
ctx: ILayoutContext;
|
|
34
34
|
viewModel: DocumentViewModel;
|
|
@@ -44,7 +44,7 @@ export interface ICellSkeletonBuildState {
|
|
|
44
44
|
complete: boolean;
|
|
45
45
|
requiresSyncFallback: boolean;
|
|
46
46
|
}
|
|
47
|
-
export declare function startSkeletonCellPagesBuild(
|
|
47
|
+
export declare function startSkeletonCellPagesBuild(parentContext: ILayoutContext, viewModel: DocumentViewModel, cellNode: DataStreamTreeNode, sectionBreakConfig: ISectionBreakConfig, tableConfig: ITable, row: number, col: number, availableHeight?: number, maxCellPageHeight?: number, cellPageHeights?: readonly number[]): ICellSkeletonBuildState;
|
|
48
48
|
export declare function stepSkeletonCellPagesBuild(state: ICellSkeletonBuildState): boolean;
|
|
49
49
|
export declare function expandCellPageHeightForInlineDrawings(pages: IDocumentSkeletonPage[]): void;
|
|
50
50
|
export declare function expandCellPageHeightForFlowTables(pages: IDocumentSkeletonPage[]): void;
|
|
@@ -86,6 +86,7 @@ export declare class SpreadsheetSkeleton extends SheetSkeleton {
|
|
|
86
86
|
private _gridlinesColor;
|
|
87
87
|
private _defaultGridlinesColor;
|
|
88
88
|
private _scene;
|
|
89
|
+
readonly textLineGap: number;
|
|
89
90
|
constructor(worksheet: Worksheet, _styles: Styles, _localeService: LocaleService, _contextService: IContextService, _configService: IConfigService, _injector: Injector);
|
|
90
91
|
registerGetCellHeight(): void;
|
|
91
92
|
setScene(scene: Scene): void;
|
|
@@ -25,6 +25,7 @@ export interface ITextProps extends IShapeProps {
|
|
|
25
25
|
text: string;
|
|
26
26
|
fontStyle: string;
|
|
27
27
|
warp?: boolean;
|
|
28
|
+
lineGap?: number;
|
|
28
29
|
hAlign?: HorizontalAlign;
|
|
29
30
|
vAlign?: VerticalAlign;
|
|
30
31
|
color?: Nullable<string>;
|
|
@@ -40,6 +41,7 @@ export declare class Text extends Shape<ITextProps> {
|
|
|
40
41
|
text: string;
|
|
41
42
|
fontStyle: string;
|
|
42
43
|
warp: boolean;
|
|
44
|
+
lineGap: number;
|
|
43
45
|
hAlign: HorizontalAlign;
|
|
44
46
|
vAlign: VerticalAlign;
|
|
45
47
|
skeleton: DocSimpleSkeleton;
|