@univerjs/engine-render 1.0.0-alpha.5 → 1.0.0-alpha.7
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 +205 -107
- package/lib/es/index.js +205 -107
- package/lib/types/components/docs/layout/block/paragraph/layout-ruler.d.ts +6 -2
- package/lib/types/components/docs/layout/block/table.d.ts +3 -1
- package/lib/types/components/docs/layout/doc-skeleton.d.ts +1 -0
- package/lib/types/components/docs/layout/model/glyph.d.ts +5 -1
- package/lib/types/components/docs/layout/model/line.d.ts +2 -2
- package/lib/types/components/docs/layout/tools.d.ts +5 -0
- package/lib/umd/index.js +3 -3
- package/package.json +3 -3
|
@@ -13,19 +13,22 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
import type { IDocumentSkeletonColumn, IDocumentSkeletonDrawing, IDocumentSkeletonGlyph, IDocumentSkeletonLine, IDocumentSkeletonPage, IDocumentSkeletonTable } from '../../../../../basics/i-document-skeleton-cached';
|
|
17
|
-
import type { IParagraphConfig, ISectionBreakConfig } from '../../../../../basics/interfaces';
|
|
16
|
+
import type { IDocumentSkeletonColumn, IDocumentSkeletonDrawing, IDocumentSkeletonGlyph, IDocumentSkeletonLine, IDocumentSkeletonPage, IDocumentSkeletonSection, IDocumentSkeletonTable } from '../../../../../basics/i-document-skeleton-cached';
|
|
17
|
+
import type { IParagraphConfig, IParagraphTableCache, ISectionBreakConfig } from '../../../../../basics/interfaces';
|
|
18
18
|
import type { IFloatObject, ILayoutContext } from '../../tools';
|
|
19
19
|
import { BooleanNumber, GridType, SpacingRule } from '@univerjs/core';
|
|
20
20
|
import { BreakPointType } from '../../line-breaker/break';
|
|
21
21
|
declare function isGlyphGroupBeyondDivideWidth(glyphGroup: IDocumentSkeletonGlyph[], offsetLeft: number, divideWidth: number): boolean;
|
|
22
22
|
export declare function layoutParagraph(ctx: ILayoutContext, glyphGroup: IDocumentSkeletonGlyph[], pages: IDocumentSkeletonPage[], sectionBreakConfig: ISectionBreakConfig, paragraphConfig: IParagraphConfig, isParagraphFirstShapedText: boolean, breakPointType?: BreakPointType): IDocumentSkeletonPage[];
|
|
23
23
|
declare function __avoidFlowAffectingDrawingsForTable(table: IDocumentSkeletonTable, page: IDocumentSkeletonPage, column: IDocumentSkeletonColumn): void;
|
|
24
|
+
declare function _updateAndPositionTable(ctx: ILayoutContext, lineTop: number, lineHeight: number, page: IDocumentSkeletonPage, column: IDocumentSkeletonColumn, section: IDocumentSkeletonSection, skeTablesInParagraph: IParagraphTableCache[], paragraphIndex: number, sectionBreakConfig: ISectionBreakConfig, drawingAnchorTop?: number): boolean;
|
|
24
25
|
declare function _reLayoutCheck(ctx: ILayoutContext, floatObjects: IFloatObject[], column: IDocumentSkeletonColumn, paragraphIndex: number): void;
|
|
25
26
|
export declare const __testing: {
|
|
26
27
|
reLayoutCheck: typeof _reLayoutCheck;
|
|
27
28
|
avoidFlowAffectingDrawingsForTable: typeof __avoidFlowAffectingDrawingsForTable;
|
|
28
29
|
isGlyphGroupBeyondDivideWidth: typeof isGlyphGroupBeyondDivideWidth;
|
|
30
|
+
checkPageBreak: typeof __checkPageBreak;
|
|
31
|
+
updateAndPositionTable: typeof _updateAndPositionTable;
|
|
29
32
|
};
|
|
30
33
|
export declare function getLineHeightMetrics(glyphLineHeight: number, paragraphLineGapDefault: number, linePitch: number, gridType: GridType, lineSpacing: number, spacingRule: SpacingRule, snapToGrid: BooleanNumber, useWordStyleLineHeight?: boolean, scaleAutoLineSpacingByGlyphHeight?: boolean): {
|
|
31
34
|
paddingTop: number;
|
|
@@ -34,4 +37,5 @@ export declare function getLineHeightMetrics(glyphLineHeight: number, paragraphL
|
|
|
34
37
|
lineSpacingApply: number;
|
|
35
38
|
};
|
|
36
39
|
export declare function updateInlineDrawingPosition(line: IDocumentSkeletonLine, paragraphInlineSkeDrawings?: Map<string, IDocumentSkeletonDrawing>, unitId?: string, blockAnchorTop?: number, paragraphNonInlineSkeDrawings?: Map<string, IDocumentSkeletonDrawing>): void;
|
|
40
|
+
declare function __checkPageBreak(column: IDocumentSkeletonColumn): boolean;
|
|
37
41
|
export {};
|
|
@@ -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 { ITable, Nullable } from '@univerjs/core';
|
|
16
|
+
import type { INumberUnit, ITable, Nullable } from '@univerjs/core';
|
|
17
17
|
import type { IDocumentSkeletonPage, IDocumentSkeletonTable, IParagraphList, ISectionBreakConfig } from '../../../../basics';
|
|
18
18
|
import type { DataStreamTreeNode } from '../../view-model/data-stream-tree-node';
|
|
19
19
|
import type { DocumentViewModel } from '../../view-model/document-view-model';
|
|
20
20
|
import type { ILayoutContext } from '../tools';
|
|
21
|
+
import { TableAlignmentType } from '@univerjs/core';
|
|
21
22
|
export declare function createTableSkeleton(ctx: ILayoutContext, curPage: IDocumentSkeletonPage, viewModel: DocumentViewModel, tableNode: DataStreamTreeNode, sectionBreakConfig: ISectionBreakConfig): Nullable<IDocumentSkeletonTable>;
|
|
22
23
|
export declare function rollbackListCache(listLevel: Map<string, IParagraphList[][]>, table: DataStreamTreeNode): void;
|
|
23
24
|
export interface ISlicedTableSkeletonParams {
|
|
@@ -25,6 +26,7 @@ export interface ISlicedTableSkeletonParams {
|
|
|
25
26
|
fromCurrentPage: boolean;
|
|
26
27
|
}
|
|
27
28
|
export declare function createTableSkeletons(ctx: ILayoutContext, curPage: IDocumentSkeletonPage, viewModel: DocumentViewModel, tableNode: DataStreamTreeNode, sectionBreakConfig: ISectionBreakConfig, availableHeight: number): ISlicedTableSkeletonParams;
|
|
29
|
+
export declare function getTableLeft(pageWidth: number, tableWidth: number, align: TableAlignmentType, indent?: INumberUnit): number;
|
|
28
30
|
export declare function getNullTableSkeleton(st: number, ed: number, table: ITable): IDocumentSkeletonTable;
|
|
29
31
|
export declare function getTableSliceId(tableId: string, sliceIndex: number): string;
|
|
30
32
|
export declare function getTableIdAndSliceIndex(tableSliceId: string): {
|
|
@@ -21,7 +21,11 @@ export declare function isSpace(char: string): boolean;
|
|
|
21
21
|
export declare function isJustifiable(content: string): boolean;
|
|
22
22
|
export declare function baseAdjustability(content: string, width: number): IAdjustability;
|
|
23
23
|
export declare function createSkeletonWordGlyph(content: string, config: IFontCreateConfig, glyphWidth?: number): IDocumentSkeletonGlyph;
|
|
24
|
-
export declare function createSkeletonLetterGlyph(content: string, config: IFontCreateConfig,
|
|
24
|
+
export declare function createSkeletonLetterGlyph(content: string, config: IFontCreateConfig, glyphMetrics?: number | {
|
|
25
|
+
ascent?: number;
|
|
26
|
+
descent?: number;
|
|
27
|
+
width?: number;
|
|
28
|
+
}, glyphInfo?: IOpenTypeGlyphInfo): IDocumentSkeletonGlyph;
|
|
25
29
|
export declare function createSkeletonTabGlyph(config: IFontCreateConfig, glyphWidth?: number): IDocumentSkeletonGlyph;
|
|
26
30
|
export declare function createHyphenDashGlyph(config: IFontCreateConfig): IDocumentSkeletonGlyph;
|
|
27
31
|
export declare function createSkeletonCustomBlockGlyph(config: IFontCreateConfig, glyphWidth?: number, glyphHeight?: number, drawingId?: string): IDocumentSkeletonGlyph;
|
|
@@ -28,8 +28,8 @@ interface ILineBoundingBox {
|
|
|
28
28
|
marginTop?: number;
|
|
29
29
|
spaceBelowApply?: number;
|
|
30
30
|
}
|
|
31
|
-
export declare function createSkeletonLine(paragraphIndex: number, lineType: LineType, lineBoundingBox: ILineBoundingBox, columnWidth: number, lineIndex: number | undefined, isParagraphStart: boolean | undefined, paragraphConfig: IParagraphConfig, page: IDocumentSkeletonPage, headerPage: Nullable<IDocumentSkeletonPage>, footerPage: Nullable<IDocumentSkeletonPage
|
|
32
|
-
export declare function calculateLineTopByDrawings(lineHeight: number | undefined, lineTop: number | undefined, page: IDocumentSkeletonPage, headerPage: Nullable<IDocumentSkeletonPage>, footerPage: Nullable<IDocumentSkeletonPage>, columnLeft?: number, columnWidth?: number): number;
|
|
31
|
+
export declare function createSkeletonLine(paragraphIndex: number, lineType: LineType, lineBoundingBox: ILineBoundingBox, columnWidth: number, lineIndex: number | undefined, isParagraphStart: boolean | undefined, paragraphConfig: IParagraphConfig, page: IDocumentSkeletonPage, headerPage: Nullable<IDocumentSkeletonPage>, footerPage: Nullable<IDocumentSkeletonPage>, columnLeft?: number, sectionTop?: number): IDocumentSkeletonLine;
|
|
32
|
+
export declare function calculateLineTopByDrawings(lineHeight: number | undefined, lineTop: number | undefined, page: IDocumentSkeletonPage, headerPage: Nullable<IDocumentSkeletonPage>, footerPage: Nullable<IDocumentSkeletonPage>, columnLeft?: number, columnWidth?: number, sectionTop?: number): number;
|
|
33
33
|
export declare function updateDivideInfo(divide: IDocumentSkeletonDivide, states: Partial<IDocumentSkeletonDivide>): void;
|
|
34
34
|
export declare function setLineMarginBottom(line: IDocumentSkeletonLine, marginBottom: number): void;
|
|
35
35
|
export declare function collisionDetection(floatObject: IFloatObject, lineHeight: number, lineTop: number, columnLeft: number, columnWidth: number): boolean;
|
|
@@ -171,6 +171,11 @@ export declare function getFontConfigFromLastGlyph(glyph: IDocumentSkeletonGlyph
|
|
|
171
171
|
};
|
|
172
172
|
export declare function getFontCreateConfig(index: number, viewModel: DocumentViewModel, paragraphNode: DataStreamTreeNode, sectionBreakConfig: ISectionBreakConfig, paragraph: IParagraph): IFontCreateConfig;
|
|
173
173
|
export declare function getCustomRangeGlyphWidth(index: number, viewModel: DocumentViewModel, paragraphNode: DataStreamTreeNode, config: IFontCreateConfig): number | undefined;
|
|
174
|
+
export declare function getCustomRangeGlyphMetrics(index: number, viewModel: DocumentViewModel, paragraphNode: DataStreamTreeNode, config: IFontCreateConfig): {
|
|
175
|
+
ascent?: number;
|
|
176
|
+
descent?: number;
|
|
177
|
+
width?: number;
|
|
178
|
+
} | undefined;
|
|
174
179
|
export declare function getNullSkeleton(): IDocumentSkeletonCached;
|
|
175
180
|
export declare function setPageParent(pages: IDocumentSkeletonPage[], parent: IDocumentSkeletonCached): void;
|
|
176
181
|
export declare enum FloatObjectType {
|