@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
|
@@ -16,8 +16,23 @@
|
|
|
16
16
|
import type { Nullable } from '@univerjs/core';
|
|
17
17
|
import type { IDocumentSkeletonColumnGroup, IDocumentSkeletonPage } from '../../../../basics/i-document-skeleton-cached';
|
|
18
18
|
import type { ISectionBreakConfig } from '../../../../basics/interfaces';
|
|
19
|
+
import type { IDocumentLayoutColumnGroup } from '../../document-layout-presentation';
|
|
19
20
|
import type { DataStreamTreeNode } from '../../view-model/data-stream-tree-node';
|
|
20
21
|
import type { DocumentViewModel } from '../../view-model/document-view-model';
|
|
21
22
|
import type { ILayoutContext } from '../tools';
|
|
23
|
+
interface IColumnGroupLayoutColumn {
|
|
24
|
+
columnId: string;
|
|
25
|
+
left: number;
|
|
26
|
+
top: number;
|
|
27
|
+
width: number;
|
|
28
|
+
}
|
|
29
|
+
interface IColumnGroupLayout {
|
|
30
|
+
mode: 'horizontal' | 'stack';
|
|
31
|
+
width: number;
|
|
32
|
+
height: number;
|
|
33
|
+
columns: IColumnGroupLayoutColumn[];
|
|
34
|
+
}
|
|
22
35
|
export declare function createColumnGroupSkeleton(ctx: ILayoutContext, curPage: IDocumentSkeletonPage, viewModel: DocumentViewModel, columnGroupNode: DataStreamTreeNode, sectionBreakConfig: ISectionBreakConfig): Nullable<IDocumentSkeletonColumnGroup>;
|
|
23
36
|
export declare function appendColumnGroupBlockLine(page: IDocumentSkeletonPage, columnGroup: IDocumentSkeletonColumnGroup): boolean;
|
|
37
|
+
export declare function calculateColumnGroupLayout(source: IDocumentLayoutColumnGroup, availableWidth: number, columnHeights: number[]): IColumnGroupLayout;
|
|
38
|
+
export {};
|
|
@@ -13,31 +13,40 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
+
import type { ITabStop } from '@univerjs/core';
|
|
16
17
|
import type { IDocumentSkeletonColumn, IDocumentSkeletonDivide, IDocumentSkeletonDrawing, IDocumentSkeletonGlyph, IDocumentSkeletonLine, IDocumentSkeletonPage, IDocumentSkeletonSection, IDocumentSkeletonTable } from '../../../../../basics/i-document-skeleton-cached';
|
|
17
18
|
import type { IParagraphConfig, IParagraphTableCache, ISectionBreakConfig } from '../../../../../basics/interfaces';
|
|
18
19
|
import type { IFloatObject, ILayoutContext } from '../../tools';
|
|
19
20
|
import { BooleanNumber, GridType, SpacingRule } from '@univerjs/core';
|
|
20
21
|
import { BreakPointType } from '../../line-breaker/break';
|
|
21
|
-
declare function isGlyphGroupBeyondDivideWidth(glyphGroup: IDocumentSkeletonGlyph[], offsetLeft: number, divideWidth: number, hangingPunctuation?: boolean): boolean;
|
|
22
|
-
export declare function layoutParagraph(ctx: ILayoutContext, glyphGroup: IDocumentSkeletonGlyph[], pages: IDocumentSkeletonPage[], sectionBreakConfig: ISectionBreakConfig, paragraphConfig: IParagraphConfig, isParagraphFirstShapedText: boolean, breakPointType?: BreakPointType, renderBullet?: boolean): IDocumentSkeletonPage[];
|
|
23
|
-
declare function _adjustExplicitTabStop(divide: IDocumentSkeletonDivide, followingGlyphs: IDocumentSkeletonGlyph[], paragraphConfig: IParagraphConfig): void;
|
|
22
|
+
declare function isGlyphGroupBeyondDivideWidth(glyphGroup: IDocumentSkeletonGlyph[], offsetLeft: number, divideWidth: number, hangingPunctuation?: boolean, precedingGlyphs?: IDocumentSkeletonGlyph[], preserveWordSpacing?: boolean, lineWrapTolerance?: number, includeParagraphMark?: boolean, justifyWordSpacing?: boolean): boolean;
|
|
23
|
+
export declare function layoutParagraph(ctx: ILayoutContext, glyphGroup: IDocumentSkeletonGlyph[], pages: IDocumentSkeletonPage[], sectionBreakConfig: ISectionBreakConfig, paragraphConfig: IParagraphConfig, isParagraphFirstShapedText: boolean, breakPointType?: BreakPointType, renderBullet?: boolean, startNewLine?: boolean): IDocumentSkeletonPage[];
|
|
24
|
+
declare function _adjustExplicitTabStop(divide: IDocumentSkeletonDivide, followingGlyphs: IDocumentSkeletonGlyph[], paragraphConfig: IParagraphConfig, tabStops?: ITabStop[] | undefined): void;
|
|
25
|
+
declare function __getWrapTablePosition(table: IDocumentSkeletonTable, column: IDocumentSkeletonColumn, lineTop: number, lineHeight: number, drawingAnchorTop?: number): {
|
|
26
|
+
left: number;
|
|
27
|
+
top: number;
|
|
28
|
+
} | undefined;
|
|
24
29
|
declare function __avoidFlowAffectingDrawingsForTable(table: IDocumentSkeletonTable, page: IDocumentSkeletonPage, column: IDocumentSkeletonColumn): void;
|
|
25
|
-
declare function
|
|
30
|
+
declare function __avoidNonOverlappingFloatingTables(table: IDocumentSkeletonTable, page: IDocumentSkeletonPage): void;
|
|
31
|
+
declare function _updateAndPositionTable(ctx: ILayoutContext, lineTop: number, lineHeight: number, page: IDocumentSkeletonPage, pages: IDocumentSkeletonPage[], column: IDocumentSkeletonColumn, section: IDocumentSkeletonSection, skeTablesInParagraph: IParagraphTableCache[], paragraphIndex: number, sectionBreakConfig: ISectionBreakConfig, drawingAnchorTop?: number): boolean;
|
|
32
|
+
export declare function isNonFlowFloatingAnchor(glyphGroup: IDocumentSkeletonGlyph[], paragraphNonInlineSkeDrawings?: Map<string, IDocumentSkeletonDrawing>): boolean;
|
|
26
33
|
declare function _reLayoutCheck(ctx: ILayoutContext, floatObjects: IFloatObject[], column: IDocumentSkeletonColumn, paragraphIndex: number): void;
|
|
27
34
|
export declare const __testing: {
|
|
28
35
|
reLayoutCheck: typeof _reLayoutCheck;
|
|
36
|
+
getWrapTablePosition: typeof __getWrapTablePosition;
|
|
29
37
|
avoidFlowAffectingDrawingsForTable: typeof __avoidFlowAffectingDrawingsForTable;
|
|
38
|
+
avoidNonOverlappingFloatingTables: typeof __avoidNonOverlappingFloatingTables;
|
|
30
39
|
isGlyphGroupBeyondDivideWidth: typeof isGlyphGroupBeyondDivideWidth;
|
|
31
40
|
checkPageBreak: typeof __checkPageBreak;
|
|
32
41
|
updateAndPositionTable: typeof _updateAndPositionTable;
|
|
33
42
|
adjustExplicitTabStop: typeof _adjustExplicitTabStop;
|
|
34
43
|
};
|
|
35
|
-
export declare function getLineHeightMetrics(glyphLineHeight: number, paragraphLineGapDefault: number, linePitch: number, gridType: GridType, lineSpacing: number, spacingRule: SpacingRule, snapToGrid: BooleanNumber, useWordStyleLineHeight?: boolean, scaleAutoLineSpacingByGlyphHeight?: boolean, normalLineHeight?: number, snapAutoLineSpacingToWholeGridLines?: boolean): {
|
|
44
|
+
export declare function getLineHeightMetrics(glyphLineHeight: number, paragraphLineGapDefault: number, linePitch: number, gridType: GridType, lineSpacing: number, spacingRule: SpacingRule, snapToGrid: BooleanNumber, useWordStyleLineHeight?: boolean, scaleAutoLineSpacingByGlyphHeight?: boolean, normalLineHeight?: number, snapAutoLineSpacingToWholeGridLines?: boolean, drawingMLLineHeight?: number, topAlignExactLineSpacing?: boolean): {
|
|
36
45
|
paddingTop: number;
|
|
37
46
|
paddingBottom: number;
|
|
38
47
|
contentHeight: number;
|
|
39
48
|
lineSpacingApply: number;
|
|
40
49
|
};
|
|
41
|
-
export declare function updateInlineDrawingPosition(line: IDocumentSkeletonLine, paragraphInlineSkeDrawings?: Map<string, IDocumentSkeletonDrawing>, unitId?: string, blockAnchorTop?: number, paragraphNonInlineSkeDrawings?: Map<string, IDocumentSkeletonDrawing
|
|
50
|
+
export declare function updateInlineDrawingPosition(line: IDocumentSkeletonLine, paragraphInlineSkeDrawings?: Map<string, IDocumentSkeletonDrawing>, unitId?: string, blockAnchorTop?: number, paragraphNonInlineSkeDrawings?: Map<string, IDocumentSkeletonDrawing>, documentCompatibilityPolicy?: IParagraphConfig['documentCompatibilityPolicy']): void;
|
|
42
51
|
declare function __checkPageBreak(column: IDocumentSkeletonColumn): boolean;
|
|
43
52
|
export {};
|
|
@@ -13,8 +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 { ISectionBreakConfig } from '../../../../../basics';
|
|
17
16
|
import type { IDocumentSkeletonPage } from '../../../../../basics/i-document-skeleton-cached';
|
|
17
|
+
import type { ISectionBreakConfig } from '../../../../../basics/interfaces';
|
|
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
|
export declare function lineAdjustment(pages: IDocumentSkeletonPage[], viewModel: DocumentViewModel, paragraphNode: DataStreamTreeNode, sectionBreakConfig: ISectionBreakConfig): void;
|
|
@@ -20,4 +20,4 @@ import type { DataStreamTreeNode } from '../../../view-model/data-stream-tree-no
|
|
|
20
20
|
import type { DocumentViewModel } from '../../../view-model/document-view-model';
|
|
21
21
|
import type { ILayoutContext } from '../../tools';
|
|
22
22
|
import type { IShapedText } from './shaping';
|
|
23
|
-
export declare function lineBreaking(ctx: ILayoutContext, viewModel: DocumentViewModel, shapedTextList: IShapedText[], curPage: IDocumentSkeletonPage, paragraphNode: DataStreamTreeNode, sectionBreakConfig: ISectionBreakConfig, tableSkeleton: Nullable<IDocumentSkeletonTable>, tablePageBreakBefore?: boolean): IDocumentSkeletonPage[];
|
|
23
|
+
export declare function lineBreaking(ctx: ILayoutContext, viewModel: DocumentViewModel, shapedTextList: IShapedText[], curPage: IDocumentSkeletonPage, paragraphNode: DataStreamTreeNode, sectionBreakConfig: ISectionBreakConfig, tableSkeleton: Nullable<IDocumentSkeletonTable>, tablePageBreakBefore?: boolean, nextParagraphNode?: DataStreamTreeNode): IDocumentSkeletonPage[];
|
|
@@ -18,4 +18,4 @@ import type { ISectionBreakConfig } from '../../../../../basics/interfaces';
|
|
|
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
|
-
export declare function dealWidthParagraph(ctx: ILayoutContext, viewModel: DocumentViewModel, paragraphNode: DataStreamTreeNode, curPage: IDocumentSkeletonPage, sectionBreakConfig: ISectionBreakConfig): IDocumentSkeletonPage[];
|
|
21
|
+
export declare function dealWidthParagraph(ctx: ILayoutContext, viewModel: DocumentViewModel, paragraphNode: DataStreamTreeNode, curPage: IDocumentSkeletonPage, sectionBreakConfig: ISectionBreakConfig, nextParagraphNode?: DataStreamTreeNode): IDocumentSkeletonPage[];
|
|
@@ -13,12 +13,15 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
+
import type { IParagraphStyle } from '@univerjs/core';
|
|
16
17
|
import type { IDocumentSkeletonGlyph } from '../../../../../basics/i-document-skeleton-cached';
|
|
17
18
|
import type { ISectionBreakConfig } from '../../../../../basics/interfaces';
|
|
18
19
|
import type { DataStreamTreeNode } from '../../../view-model/data-stream-tree-node';
|
|
19
20
|
import type { DocumentViewModel } from '../../../view-model/document-view-model';
|
|
20
21
|
import type { ILayoutContext } from '../../tools';
|
|
22
|
+
import { Lang } from '../../hyphenation/lang';
|
|
21
23
|
import { BreakPointType } from '../../line-breaker/break';
|
|
24
|
+
export declare function getHyphenationLanguage(ctx: ILayoutContext, content: string, paragraphStyle: IParagraphStyle, sectionBreakConfig: ISectionBreakConfig): Lang;
|
|
22
25
|
export interface IShapedText {
|
|
23
26
|
text: string;
|
|
24
27
|
glyphs: IDocumentSkeletonGlyph[];
|
|
@@ -19,7 +19,13 @@ 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
|
-
export
|
|
22
|
+
export interface IDealWithSectionOptions {
|
|
23
|
+
startParagraphIndex?: number;
|
|
24
|
+
maxParagraphs?: number;
|
|
25
|
+
}
|
|
26
|
+
export declare function dealWithSection(ctx: ILayoutContext, viewModel: DocumentViewModel, sectionNode: DataStreamTreeNode, curPage: IDocumentSkeletonPage, sectionBreakConfig: ISectionBreakConfig, layoutAnchor: Nullable<number>, options?: IDealWithSectionOptions): {
|
|
23
27
|
pages: IDocumentSkeletonPage[];
|
|
24
28
|
renderedBlockIdMap: Map<string, boolean>;
|
|
29
|
+
nextParagraphIndex: number;
|
|
30
|
+
complete: boolean;
|
|
25
31
|
};
|
|
@@ -14,18 +14,74 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
import type { INumberUnit, ITable, Nullable } from '@univerjs/core';
|
|
17
|
-
import type { IDocumentSkeletonPage,
|
|
17
|
+
import type { IDocumentSkeletonPage, IDocumentSkeletonRow, IDocumentSkeletonTable } from '../../../../basics/i-document-skeleton-cached';
|
|
18
|
+
import type { ISectionBreakConfig } from '../../../../basics/interfaces';
|
|
18
19
|
import type { DataStreamTreeNode } from '../../view-model/data-stream-tree-node';
|
|
19
20
|
import type { DocumentViewModel } from '../../view-model/document-view-model';
|
|
21
|
+
import type { DocumentFootnoteLayout } from '../footnote-layout';
|
|
22
|
+
import type { ICellSkeletonBuildState } from '../model/page';
|
|
20
23
|
import type { ILayoutContext } from '../tools';
|
|
21
24
|
import { TableAlignmentType } from '@univerjs/core';
|
|
25
|
+
export interface ITableSkeletonBuildState {
|
|
26
|
+
ctx: ILayoutContext;
|
|
27
|
+
curPage: IDocumentSkeletonPage;
|
|
28
|
+
viewModel: DocumentViewModel;
|
|
29
|
+
tableNode: DataStreamTreeNode;
|
|
30
|
+
sectionBreakConfig: ISectionBreakConfig;
|
|
31
|
+
table: ITable;
|
|
32
|
+
tableSkeleton: IDocumentSkeletonTable;
|
|
33
|
+
rowIndex: number;
|
|
34
|
+
rowTop: number;
|
|
35
|
+
tableWidth: number;
|
|
36
|
+
complete: boolean;
|
|
37
|
+
currentRowNode: Nullable<DataStreamTreeNode>;
|
|
38
|
+
currentRowSkeleton: Nullable<IDocumentSkeletonRow>;
|
|
39
|
+
currentColumnIndex: number;
|
|
40
|
+
currentRowLeft: number;
|
|
41
|
+
currentRowHeight: number;
|
|
42
|
+
mergedCellContentHeights: Map<string, number>;
|
|
43
|
+
currentCellBuild: Nullable<ICellSkeletonBuildState>;
|
|
44
|
+
}
|
|
45
|
+
export declare function startTableSkeletonBuild(ctx: ILayoutContext, curPage: IDocumentSkeletonPage, viewModel: DocumentViewModel, tableNode: DataStreamTreeNode, sectionBreakConfig: ISectionBreakConfig): Nullable<ITableSkeletonBuildState>;
|
|
46
|
+
export declare function stepTableSkeletonBuild(state: ITableSkeletonBuildState): boolean;
|
|
47
|
+
export declare function cachePrecomputedTableSkeleton(ctx: ILayoutContext, tableNode: DataStreamTreeNode, tableSkeleton: IDocumentSkeletonTable): void;
|
|
22
48
|
export declare function createTableSkeleton(ctx: ILayoutContext, curPage: IDocumentSkeletonPage, viewModel: DocumentViewModel, tableNode: DataStreamTreeNode, sectionBreakConfig: ISectionBreakConfig): Nullable<IDocumentSkeletonTable>;
|
|
23
|
-
export declare function rollbackListCache(listLevel: Map<string, IParagraphList[][]>, table: DataStreamTreeNode): void;
|
|
24
49
|
export interface ISlicedTableSkeletonParams {
|
|
25
50
|
skeTables: IDocumentSkeletonTable[];
|
|
26
51
|
fromCurrentPage: boolean;
|
|
27
52
|
}
|
|
53
|
+
export interface ISlicedTableSkeletonBuildState {
|
|
54
|
+
ctx: ILayoutContext;
|
|
55
|
+
curPage: IDocumentSkeletonPage;
|
|
56
|
+
viewModel: DocumentViewModel;
|
|
57
|
+
tableNode: DataStreamTreeNode;
|
|
58
|
+
sectionBreakConfig: ISectionBreakConfig;
|
|
59
|
+
availableHeight: number;
|
|
60
|
+
table: ITable;
|
|
61
|
+
skeTables: IDocumentSkeletonTable[];
|
|
62
|
+
createCache: ICreateTableCache;
|
|
63
|
+
rowIndex: number;
|
|
64
|
+
columnIndex: number;
|
|
65
|
+
preparedCellPages: Map<number, IDocumentSkeletonPage[]>;
|
|
66
|
+
cellPageHeights?: number[];
|
|
67
|
+
pendingCellBuild: Nullable<ICellSkeletonBuildState>;
|
|
68
|
+
complete: boolean;
|
|
69
|
+
result: Nullable<ISlicedTableSkeletonParams>;
|
|
70
|
+
}
|
|
71
|
+
interface ICreateTableCache {
|
|
72
|
+
rowTop: number;
|
|
73
|
+
tableWidth: number;
|
|
74
|
+
remainHeight: number;
|
|
75
|
+
repeatRows: DataStreamTreeNode[];
|
|
76
|
+
repeatRowsHeight: number;
|
|
77
|
+
notes?: ReturnType<DocumentFootnoteLayout['createTablePagination']>;
|
|
78
|
+
fromCurrentPage?: boolean;
|
|
79
|
+
}
|
|
80
|
+
export declare function startTableSkeletonsBuild(ctx: ILayoutContext, curPage: IDocumentSkeletonPage, viewModel: DocumentViewModel, tableNode: DataStreamTreeNode, sectionBreakConfig: ISectionBreakConfig, availableHeight: number): Nullable<ISlicedTableSkeletonBuildState>;
|
|
81
|
+
export declare function stepTableSkeletonsBuild(state: ISlicedTableSkeletonBuildState): boolean;
|
|
82
|
+
export declare function cachePrecomputedSlicedTableSkeletons(ctx: ILayoutContext, tableNode: DataStreamTreeNode, availableHeight: number, result: ISlicedTableSkeletonParams): void;
|
|
28
83
|
export declare function createTableSkeletons(ctx: ILayoutContext, curPage: IDocumentSkeletonPage, viewModel: DocumentViewModel, tableNode: DataStreamTreeNode, sectionBreakConfig: ISectionBreakConfig, availableHeight: number): ISlicedTableSkeletonParams;
|
|
84
|
+
export declare function resolveTableLayoutColumns(table: ITable, availableWidth: number, traditional?: boolean): ITable;
|
|
29
85
|
export declare function getTableLeft(pageWidth: number, tableWidth: number, align: TableAlignmentType, indent?: INumberUnit): number;
|
|
30
86
|
export declare function getNullTableSkeleton(st: number, ed: number, table: ITable): IDocumentSkeletonTable;
|
|
31
87
|
export declare function getTableSliceId(tableId: string, sliceIndex: number): string;
|
|
@@ -33,3 +89,4 @@ export declare function getTableIdAndSliceIndex(tableSliceId: string): {
|
|
|
33
89
|
tableId: string;
|
|
34
90
|
sliceIndex: number;
|
|
35
91
|
};
|
|
92
|
+
export {};
|
|
@@ -18,6 +18,8 @@ import type { IDocumentSkeletonCached, IDocumentSkeletonGlyph, IDocumentSkeleton
|
|
|
18
18
|
import type { INodeInfo, INodePosition, INodeSearch } from '../../../basics/interfaces';
|
|
19
19
|
import type { IViewportInfo, Vector2 } from '../../../basics/vector2';
|
|
20
20
|
import type { DocumentViewModel } from '../view-model/document-view-model';
|
|
21
|
+
import type { IDocumentLayoutGeometryPublication, IDocumentLayoutPagePublication } from './document-layout-publication';
|
|
22
|
+
import type { DocumentLayoutReason, IDocumentLayoutApplyResult, IDocumentLayoutInvalidation, IDocumentLayoutPageRange, IDocumentLayoutProgress, IDocumentLayoutProtectedRange } from './document-layout-types';
|
|
21
23
|
import type { IDocumentPaginationMetrics } from './tools';
|
|
22
24
|
import { Skeleton } from '@univerjs/core';
|
|
23
25
|
import { PageLayoutType } from '../../../basics/i-document-skeleton-cached';
|
|
@@ -28,6 +30,10 @@ export declare enum DocumentSkeletonState {
|
|
|
28
30
|
READY = "ready",
|
|
29
31
|
INVALID = "invalid"
|
|
30
32
|
}
|
|
33
|
+
export interface IDocumentCustomBlockPresentationRefreshResult {
|
|
34
|
+
didRefresh: boolean;
|
|
35
|
+
requiresLayout: boolean;
|
|
36
|
+
}
|
|
31
37
|
export interface IFindNodeRestrictions {
|
|
32
38
|
strict: boolean;
|
|
33
39
|
segmentId: string;
|
|
@@ -37,15 +43,34 @@ export declare class DocumentSkeleton extends Skeleton {
|
|
|
37
43
|
private _docViewModel;
|
|
38
44
|
private _dirty$;
|
|
39
45
|
readonly dirty$: import("rxjs").Observable<boolean>;
|
|
46
|
+
private _layoutProgress$;
|
|
47
|
+
readonly layoutProgress$: import("rxjs").Observable<IDocumentLayoutProgress>;
|
|
48
|
+
private readonly _layoutPageMaterialized$;
|
|
49
|
+
readonly layoutPageMaterialized$: import("rxjs").Observable<void>;
|
|
40
50
|
private _skeletonData;
|
|
41
51
|
private _findLiquid;
|
|
42
52
|
private _hyphen;
|
|
43
53
|
private _languageDetector;
|
|
44
|
-
private _iteratorCount;
|
|
45
54
|
private _initialWidth;
|
|
46
55
|
private _paginationMetrics;
|
|
47
|
-
|
|
48
|
-
|
|
56
|
+
private _lastCompleteSkeletonData;
|
|
57
|
+
private _pendingInvalidationAnchor;
|
|
58
|
+
private _layoutGeneration;
|
|
59
|
+
private _activeLayout;
|
|
60
|
+
private _externalLayoutProgress;
|
|
61
|
+
private _externalProtectedPages;
|
|
62
|
+
private _externalProtectedContinuousLayout;
|
|
63
|
+
private _topLevelBlockSections;
|
|
64
|
+
private _topLevelBlocks;
|
|
65
|
+
private readonly _isolateIncrementalPublications;
|
|
66
|
+
private _modernPageWidth;
|
|
67
|
+
private _modernHorizontalMargin;
|
|
68
|
+
constructor(_docViewModel: DocumentViewModel, localeService: LocaleService, options?: {
|
|
69
|
+
isolateIncrementalPublications?: boolean;
|
|
70
|
+
});
|
|
71
|
+
static create(docViewModel: DocumentViewModel, localeService: LocaleService, options?: {
|
|
72
|
+
isolateIncrementalPublications?: boolean;
|
|
73
|
+
}): DocumentSkeleton;
|
|
49
74
|
dispose(): void;
|
|
50
75
|
getViewModel(): DocumentViewModel;
|
|
51
76
|
/**
|
|
@@ -53,7 +78,70 @@ export declare class DocumentSkeleton extends Skeleton {
|
|
|
53
78
|
* PS: This method has significant impact on performance.
|
|
54
79
|
*/
|
|
55
80
|
calculate(bounds?: IViewportInfo): void;
|
|
81
|
+
startIncrementalLayout(options?: {
|
|
82
|
+
reason?: DocumentLayoutReason;
|
|
83
|
+
anchor?: number;
|
|
84
|
+
priorityAnchor?: number;
|
|
85
|
+
invalidation?: IDocumentLayoutInvalidation;
|
|
86
|
+
modernPageWidth?: number;
|
|
87
|
+
modernHorizontalMargin?: number;
|
|
88
|
+
bounds?: IViewportInfo;
|
|
89
|
+
reuseUnaffectedTail?: boolean;
|
|
90
|
+
/** The caller proved this edit only changes offset-preserving render metadata. */
|
|
91
|
+
allowMetadataOnlyStructuralTailReuse?: boolean;
|
|
92
|
+
preserveInteractionWindow?: boolean;
|
|
93
|
+
/** Cooperative schedulers wait for code-split dictionaries before publishing. */
|
|
94
|
+
waitForHyphenationPatterns?: boolean;
|
|
95
|
+
}): number;
|
|
96
|
+
private _prepareIncrementalLayoutStart;
|
|
97
|
+
private _preparePaginatedParagraphPrefix;
|
|
98
|
+
private _prepareContinuousPrefix;
|
|
99
|
+
private _findBodyPageIndex;
|
|
100
|
+
private _getTopLevelBlocks;
|
|
101
|
+
private _copySkeletonResources;
|
|
102
|
+
cancelIncrementalLayout(generation?: number): void;
|
|
103
|
+
stepIncrementalLayout(generation: number, budgetMs?: number, maxWorkUnits?: number): IDocumentLayoutProgress;
|
|
104
|
+
/**
|
|
105
|
+
* Publishes at most one page that a previous layout slice has already
|
|
106
|
+
* completed. It never advances shaping or pagination work.
|
|
107
|
+
*/
|
|
108
|
+
publishIncrementalLayoutBacklog(generation: number): IDocumentLayoutProgress;
|
|
109
|
+
private _stepIncrementalLayout;
|
|
110
|
+
private _createPublishablePartialSkeleton;
|
|
111
|
+
private _createSharedPublishablePartialSkeleton;
|
|
112
|
+
private _findPublishablePriorityPageIndex;
|
|
113
|
+
private _finalizePaginatedPagesForPublication;
|
|
114
|
+
getLayoutProgress(): Nullable<IDocumentLayoutProgress>;
|
|
115
|
+
/**
|
|
116
|
+
* Opens a presentation barrier before an external executor starts layout.
|
|
117
|
+
* The Main interaction snapshot remains authoritative inside its protected
|
|
118
|
+
* page or block range while the external executor publishes a newer tail.
|
|
119
|
+
*/
|
|
120
|
+
beginExternalLayout(options: {
|
|
121
|
+
reason: DocumentLayoutReason;
|
|
122
|
+
protectedRange?: IDocumentLayoutProtectedRange;
|
|
123
|
+
}): void;
|
|
124
|
+
cancelExternalLayout(): void;
|
|
125
|
+
/**
|
|
126
|
+
* Whether this skeleton owns a fully finalized layout that can be used as
|
|
127
|
+
* stable geometry while a later incremental generation is still running.
|
|
128
|
+
*/
|
|
129
|
+
hasCompleteLayout(): boolean;
|
|
56
130
|
getSkeletonData(): Nullable<IDocumentSkeletonCached>;
|
|
131
|
+
/** Invalidate measurements captured before the requested fonts finished loading. */
|
|
132
|
+
invalidateFontMetrics(fontStyles: readonly string[]): void;
|
|
133
|
+
/**
|
|
134
|
+
* Refreshes Custom Block viewport-only metrics without rebuilding document flow.
|
|
135
|
+
* Pure presentation metrics are published as one batch. Flow metrics are only
|
|
136
|
+
* replaced for compatible drawings; incompatible drawings retain their stable
|
|
137
|
+
* flow geometry while callers schedule a normal layout generation.
|
|
138
|
+
*/
|
|
139
|
+
refreshCustomBlockPresentationViewports(): IDocumentCustomBlockPresentationRefreshResult;
|
|
140
|
+
applyLayoutPublication(publication: IDocumentLayoutGeometryPublication, progress: IDocumentLayoutProgress, materializedPageRange?: IDocumentLayoutPageRange): IDocumentLayoutApplyResult;
|
|
141
|
+
applyLayoutPagePublication(publication: IDocumentLayoutPagePublication, materializedPageRange: IDocumentLayoutPageRange): boolean;
|
|
142
|
+
private _compactMaterializedPages;
|
|
143
|
+
private _applyExternalLayoutResources;
|
|
144
|
+
private _resolveProtectedContinuousPublication;
|
|
57
145
|
/**
|
|
58
146
|
* Returns a cloned snapshot of the most recent layout's bounded pagination counters.
|
|
59
147
|
* These diagnostics describe renderer work and are not part of the document model.
|
|
@@ -69,6 +157,7 @@ export declare class DocumentSkeleton extends Skeleton {
|
|
|
69
157
|
findPositionByGlyph(glyph: IDocumentSkeletonGlyph, segmentPage: number): Nullable<INodeSearch>;
|
|
70
158
|
findCharIndexByPosition(position: INodePosition): Nullable<number>;
|
|
71
159
|
findNodePositionByCharIndex(charIndex: number, isBack?: boolean, segmentId?: string, segmentPIndex?: number): Nullable<INodePosition>;
|
|
160
|
+
findBodyPageIndexByCharIndex(charIndex: number): number;
|
|
72
161
|
findNodeByCharIndex(charIndex: number, segmentId?: string, segmentPageIndex?: number): Nullable<IDocumentSkeletonGlyph>;
|
|
73
162
|
findGlyphByPosition(position: Nullable<INodePosition>): IDocumentSkeletonGlyph | undefined;
|
|
74
163
|
findEditAreaByCoord(coord: Vector2, pageLayoutType: PageLayoutType, pageMarginLeft: number, pageMarginTop: number): {
|
|
@@ -77,10 +166,28 @@ export declare class DocumentSkeleton extends Skeleton {
|
|
|
77
166
|
page: Nullable<IDocumentSkeletonPage>;
|
|
78
167
|
};
|
|
79
168
|
findNodeByCoord(coord: Vector2, pageLayoutType: PageLayoutType, pageMarginLeft: number, pageMarginTop: number, restrictions?: IFindNodeRestrictions): Nullable<INodeInfo>;
|
|
169
|
+
private _findNodeByCoord;
|
|
80
170
|
private _collectNearestNode;
|
|
171
|
+
private _getHitTestPageLayout;
|
|
172
|
+
private _collectNearestTableNode;
|
|
173
|
+
private _collectNearestColumnGroupNode;
|
|
174
|
+
private _collectNearestTextNode;
|
|
175
|
+
private _collectNearestInkNode;
|
|
81
176
|
private _getNearestNode;
|
|
82
177
|
private _getPageBoundingBox;
|
|
83
178
|
private _translatePage;
|
|
179
|
+
private _getLayoutProgress;
|
|
180
|
+
private _tryConvergeUnaffectedTail;
|
|
181
|
+
private _isPriorityAnchorReady;
|
|
182
|
+
private _tryReuseInteractionPageTail;
|
|
183
|
+
private _prepareIncrementalHyphenation;
|
|
184
|
+
private _advanceIncrementalLayout;
|
|
185
|
+
private _resumeAfterSealedInteractionPage;
|
|
186
|
+
private _captureIncrementalParagraphCheckpoint;
|
|
187
|
+
private _restoreIncrementalParagraphCheckpoint;
|
|
188
|
+
private _initializeIncrementalSection;
|
|
189
|
+
private _restartDirtyIncrementalLayout;
|
|
190
|
+
private _finishIncrementalLayout;
|
|
84
191
|
private _prepareLayoutContext;
|
|
85
192
|
/**
|
|
86
193
|
* \v COLUMN_BREAK
|
|
@@ -110,6 +217,7 @@ export declare class DocumentSkeleton extends Skeleton {
|
|
|
110
217
|
* @returns view model: skeleton
|
|
111
218
|
*/
|
|
112
219
|
private _createSkeleton;
|
|
220
|
+
private _createSkeletonPass;
|
|
113
221
|
private _addNewSectionByContinuous;
|
|
114
222
|
private _addNewSectionByNextColumn;
|
|
115
223
|
private _restoreContinuousSection;
|
|
@@ -0,0 +1,104 @@
|
|
|
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 { IDocDrawingBase, IDocumentData, ITable, ITableRow } from '@univerjs/core';
|
|
17
|
+
import type { IDocumentSkeletonCached, IDocumentSkeletonColumn, IDocumentSkeletonColumnGroup, IDocumentSkeletonColumnGroupColumn, IDocumentSkeletonDivide, IDocumentSkeletonDrawing, IDocumentSkeletonGlyph, IDocumentSkeletonLine, IDocumentSkeletonNote, IDocumentSkeletonNoteDecoration, IDocumentSkeletonPage, IDocumentSkeletonRow, IDocumentSkeletonSection, IDocumentSkeletonTable } from '../../../basics/i-document-skeleton-cached';
|
|
18
|
+
export type IDocumentSkeletonGlyphPatch = Omit<IDocumentSkeletonGlyph, 'parent'>;
|
|
19
|
+
export interface IDocumentSkeletonDividePatch extends Omit<IDocumentSkeletonDivide, 'glyphGroup' | 'parent'> {
|
|
20
|
+
glyphGroup: IDocumentSkeletonGlyphPatch[];
|
|
21
|
+
}
|
|
22
|
+
export interface IDocumentSkeletonLinePatch extends Omit<IDocumentSkeletonLine, 'divides' | 'parent'> {
|
|
23
|
+
divides: IDocumentSkeletonDividePatch[];
|
|
24
|
+
}
|
|
25
|
+
export interface IDocumentSkeletonColumnPatch extends Omit<IDocumentSkeletonColumn, 'lines' | 'parent'> {
|
|
26
|
+
lines: IDocumentSkeletonLinePatch[];
|
|
27
|
+
}
|
|
28
|
+
export interface IDocumentSkeletonSectionPatch extends Omit<IDocumentSkeletonSection, 'columns' | 'parent'> {
|
|
29
|
+
columns: IDocumentSkeletonColumnPatch[];
|
|
30
|
+
}
|
|
31
|
+
export interface IDocumentSkeletonDrawingPatch extends Omit<IDocumentSkeletonDrawing, 'drawingOrigin'> {
|
|
32
|
+
drawingOrigin?: IDocDrawingBase;
|
|
33
|
+
}
|
|
34
|
+
export interface IDocumentSkeletonRowPatch extends Omit<IDocumentSkeletonRow, 'cells' | 'parent' | 'rowSource'> {
|
|
35
|
+
cells: IDocumentSkeletonPagePatch[];
|
|
36
|
+
rowSource?: ITableRow;
|
|
37
|
+
rowSourceIndex?: number;
|
|
38
|
+
}
|
|
39
|
+
export interface IDocumentSkeletonTablePatch extends Omit<IDocumentSkeletonTable, 'rows' | 'parent' | 'tableSource'> {
|
|
40
|
+
rows: IDocumentSkeletonRowPatch[];
|
|
41
|
+
tableSource?: ITable;
|
|
42
|
+
tableSourceId?: string;
|
|
43
|
+
}
|
|
44
|
+
export interface IDocumentSkeletonColumnGroupColumnPatch extends Omit<IDocumentSkeletonColumnGroupColumn, 'page' | 'parent'> {
|
|
45
|
+
page: IDocumentSkeletonPagePatch;
|
|
46
|
+
}
|
|
47
|
+
export interface IDocumentSkeletonColumnGroupPatch extends Omit<IDocumentSkeletonColumnGroup, 'columns' | 'parent'> {
|
|
48
|
+
columns: IDocumentSkeletonColumnGroupColumnPatch[];
|
|
49
|
+
}
|
|
50
|
+
export interface IDocumentSkeletonPagePatch extends Omit<IDocumentSkeletonPage, 'sections' | 'skeDrawings' | 'skeTables' | 'skeColumnGroups' | 'notes' | 'noteDecorations' | 'parent'> {
|
|
51
|
+
sections: IDocumentSkeletonSectionPatch[];
|
|
52
|
+
skeDrawings: Array<[string, IDocumentSkeletonDrawingPatch]>;
|
|
53
|
+
skeTables: Array<[string, IDocumentSkeletonTablePatch]>;
|
|
54
|
+
skeColumnGroups: Array<[string, IDocumentSkeletonColumnGroupPatch]>;
|
|
55
|
+
noteDecorations?: Array<Omit<IDocumentSkeletonNoteDecoration, 'page'> & {
|
|
56
|
+
page: IDocumentSkeletonPagePatch;
|
|
57
|
+
}>;
|
|
58
|
+
notes?: Array<Omit<IDocumentSkeletonNote, 'page' | 'parent'> & {
|
|
59
|
+
page: IDocumentSkeletonPagePatch;
|
|
60
|
+
}>;
|
|
61
|
+
}
|
|
62
|
+
export type IDocumentSkeletonPageGeometryPatch = Omit<IDocumentSkeletonPagePatch, 'sections' | 'skeDrawings' | 'skeTables' | 'skeColumnGroups' | 'notes' | 'noteDecorations'>;
|
|
63
|
+
export type IDocumentSkeletonSectionGeometryPatch = Omit<IDocumentSkeletonSectionPatch, 'columns'>;
|
|
64
|
+
export type IDocumentSkeletonColumnGeometryPatch = Omit<IDocumentSkeletonColumnPatch, 'lines'>;
|
|
65
|
+
export interface IDocumentSkeletonContinuousFlowPatch {
|
|
66
|
+
sectionIndex: number;
|
|
67
|
+
section: IDocumentSkeletonSectionGeometryPatch;
|
|
68
|
+
columnIndex: number;
|
|
69
|
+
column: IDocumentSkeletonColumnGeometryPatch;
|
|
70
|
+
lineIndex: number;
|
|
71
|
+
lines: IDocumentSkeletonLinePatch[];
|
|
72
|
+
trailingColumns: IDocumentSkeletonColumnPatch[];
|
|
73
|
+
trailingSections: IDocumentSkeletonSectionPatch[];
|
|
74
|
+
}
|
|
75
|
+
export interface IDocumentSkeletonContinuousBlockPatch {
|
|
76
|
+
pageIndex: number;
|
|
77
|
+
page: IDocumentSkeletonPageGeometryPatch;
|
|
78
|
+
flow: IDocumentSkeletonContinuousFlowPatch;
|
|
79
|
+
skeDrawings: Array<[string, IDocumentSkeletonDrawingPatch]>;
|
|
80
|
+
skeTables: Array<[string, IDocumentSkeletonTablePatch]>;
|
|
81
|
+
skeColumnGroups: Array<[string, IDocumentSkeletonColumnGroupPatch]>;
|
|
82
|
+
previousHeight: number;
|
|
83
|
+
heightDelta: number;
|
|
84
|
+
}
|
|
85
|
+
export interface IDocumentSkeletonContinuousSnapshot {
|
|
86
|
+
height: number;
|
|
87
|
+
lineEnds: number[];
|
|
88
|
+
}
|
|
89
|
+
export declare function serializeDocumentSkeletonLine(source: IDocumentSkeletonLine): IDocumentSkeletonLinePatch;
|
|
90
|
+
export declare function serializeDocumentSkeletonPage(source: IDocumentSkeletonPage, omitResourceSources?: boolean): IDocumentSkeletonPagePatch;
|
|
91
|
+
export declare function hydrateDocumentSkeletonLine(source: IDocumentSkeletonLinePatch, parent: IDocumentSkeletonColumn): IDocumentSkeletonLine;
|
|
92
|
+
export declare function hydrateDocumentSkeletonPage(source: IDocumentSkeletonPagePatch, parent?: IDocumentSkeletonCached | IDocumentSkeletonRow | IDocumentSkeletonColumnGroupColumn, snapshot?: IDocumentData): IDocumentSkeletonPage;
|
|
93
|
+
export declare function hydrateDocumentSkeletonPagePlaceholder(source: IDocumentSkeletonPagePatch, parent?: IDocumentSkeletonCached): IDocumentSkeletonPage;
|
|
94
|
+
export declare function hydrateDocumentSkeletonPageMaterializationPlaceholder(source: IDocumentSkeletonPagePatch, parent?: IDocumentSkeletonCached): IDocumentSkeletonPage;
|
|
95
|
+
/**
|
|
96
|
+
* Serializes only the changed suffix of a continuous document's logical page.
|
|
97
|
+
* The boundary line is deliberately republished because paragraph spacing can
|
|
98
|
+
* alter it when the next block is appended.
|
|
99
|
+
*/
|
|
100
|
+
export declare function serializeDocumentSkeletonContinuousBlock(currentPage: IDocumentSkeletonPage, previousSnapshot: IDocumentSkeletonContinuousSnapshot | null, replacementOffset?: number, omitResourceSources?: boolean): {
|
|
101
|
+
block: IDocumentSkeletonContinuousBlockPatch;
|
|
102
|
+
snapshot: IDocumentSkeletonContinuousSnapshot;
|
|
103
|
+
};
|
|
104
|
+
export declare function applyDocumentSkeletonContinuousBlock(target: IDocumentSkeletonCached, patch: IDocumentSkeletonContinuousBlockPatch, snapshot?: IDocumentData): IDocumentSkeletonPage;
|
|
@@ -0,0 +1,50 @@
|
|
|
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 { IDocumentSkeletonDrawingAnchor, IParagraphList } from '../../../basics/i-document-skeleton-cached';
|
|
17
|
+
import type { IDocumentSkeletonContinuousBlockPatch, IDocumentSkeletonPagePatch } from './document-layout-page-patch';
|
|
18
|
+
export type IDocumentLayoutListLevelPublication = Array<[string, IParagraphList[][]]>;
|
|
19
|
+
export type IDocumentLayoutDrawingAnchorPublication = Array<[
|
|
20
|
+
string,
|
|
21
|
+
Array<[number, Omit<IDocumentSkeletonDrawingAnchor, 'elements'>]>
|
|
22
|
+
]>;
|
|
23
|
+
export interface IDocumentLayoutPagePublication {
|
|
24
|
+
pageIndex: number;
|
|
25
|
+
page: IDocumentSkeletonPagePatch;
|
|
26
|
+
}
|
|
27
|
+
export interface IDocumentLayoutResourcePublication {
|
|
28
|
+
reset: boolean;
|
|
29
|
+
skeHeaders: Array<[string, Array<[number, IDocumentSkeletonPagePatch]>]>;
|
|
30
|
+
skeFooters: Array<[string, Array<[number, IDocumentSkeletonPagePatch]>]>;
|
|
31
|
+
skeListLevel: IDocumentLayoutListLevelPublication | null;
|
|
32
|
+
drawingAnchor: IDocumentLayoutDrawingAnchorPublication | null;
|
|
33
|
+
}
|
|
34
|
+
interface IDocumentLayoutGeometryPublicationBase {
|
|
35
|
+
left: number;
|
|
36
|
+
top: number;
|
|
37
|
+
st: number;
|
|
38
|
+
ed?: number;
|
|
39
|
+
resources: IDocumentLayoutResourcePublication;
|
|
40
|
+
}
|
|
41
|
+
export interface IDocumentLayoutPageGeometryPublication extends IDocumentLayoutGeometryPublicationBase {
|
|
42
|
+
kind: 'page';
|
|
43
|
+
pages: IDocumentLayoutPagePublication[];
|
|
44
|
+
}
|
|
45
|
+
export interface IDocumentLayoutBlockGeometryPublication extends IDocumentLayoutGeometryPublicationBase {
|
|
46
|
+
kind: 'block';
|
|
47
|
+
block: IDocumentSkeletonContinuousBlockPatch;
|
|
48
|
+
}
|
|
49
|
+
export type IDocumentLayoutGeometryPublication = IDocumentLayoutPageGeometryPublication | IDocumentLayoutBlockGeometryPublication;
|
|
50
|
+
export {};
|
|
@@ -0,0 +1,65 @@
|
|
|
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 type DocumentLayoutMode = 'paginated' | 'continuous';
|
|
17
|
+
export type DocumentLayoutReason = 'initial' | 'edit';
|
|
18
|
+
export interface IDocumentLayoutInvalidation {
|
|
19
|
+
/** First offset changed in the pre-mutation document. */
|
|
20
|
+
oldStart: number;
|
|
21
|
+
/** Exclusive end of the changed range in the pre-mutation document. */
|
|
22
|
+
oldEnd: number;
|
|
23
|
+
/** Exclusive end of the changed range in the post-mutation document. */
|
|
24
|
+
newEnd: number;
|
|
25
|
+
}
|
|
26
|
+
export interface IDocumentLayoutProtectedPageRange {
|
|
27
|
+
mode: 'paginated';
|
|
28
|
+
startPageIndex: number;
|
|
29
|
+
endPageIndex: number;
|
|
30
|
+
}
|
|
31
|
+
export type IDocumentLayoutPageRange = Pick<IDocumentLayoutProtectedPageRange, 'startPageIndex' | 'endPageIndex'>;
|
|
32
|
+
export interface IDocumentLayoutProtectedContinuousRange {
|
|
33
|
+
mode: 'continuous';
|
|
34
|
+
startOffset: number;
|
|
35
|
+
endOffset: number;
|
|
36
|
+
}
|
|
37
|
+
export type IDocumentLayoutProtectedRange = IDocumentLayoutProtectedPageRange | IDocumentLayoutProtectedContinuousRange;
|
|
38
|
+
export interface IDocumentLayoutApplyResult {
|
|
39
|
+
didReplaceProtectedPages: boolean;
|
|
40
|
+
}
|
|
41
|
+
export interface IDocumentLayoutProgress {
|
|
42
|
+
generation: number;
|
|
43
|
+
publicationRevision: number;
|
|
44
|
+
didPublish: boolean;
|
|
45
|
+
/** The publication atomically replaced the page containing the edit anchor. */
|
|
46
|
+
didPublishAnchor: boolean;
|
|
47
|
+
publishedPageCount: number;
|
|
48
|
+
reason: DocumentLayoutReason;
|
|
49
|
+
mode: DocumentLayoutMode;
|
|
50
|
+
complete: boolean;
|
|
51
|
+
cancelled: boolean;
|
|
52
|
+
anchorReady: boolean;
|
|
53
|
+
laidOutThrough: number;
|
|
54
|
+
/** Last logical offset whose exit geometry cannot be changed by the next block. */
|
|
55
|
+
stableLaidOutThrough: number;
|
|
56
|
+
pageCount: number;
|
|
57
|
+
processedBlockCount: number;
|
|
58
|
+
totalBlockCount: number;
|
|
59
|
+
estimatedPageCount: number;
|
|
60
|
+
estimatedHeight: number;
|
|
61
|
+
elapsedTime: number;
|
|
62
|
+
maxBlockDuration: number;
|
|
63
|
+
/** Main has sealed the protected interaction page and should hand the remaining suffix to Worker. */
|
|
64
|
+
interactionWindowComplete?: boolean;
|
|
65
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
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 { IDocumentSkeletonPage } from '../../../basics/i-document-skeleton-cached';
|
|
17
|
+
import type { ISectionBreakConfig } from '../../../basics/interfaces';
|
|
18
|
+
import type { ILayoutContext } from './tools';
|
|
19
|
+
/** Endnotes occupy document flow after a section or the final body section. */
|
|
20
|
+
export declare class DocumentEndnoteLayout {
|
|
21
|
+
private readonly _ctx;
|
|
22
|
+
constructor(_ctx: ILayoutContext);
|
|
23
|
+
finishSection(pages: IDocumentSkeletonPage[], sectionIndex: number, config: ISectionBreakConfig): void;
|
|
24
|
+
private _layoutDecoration;
|
|
25
|
+
}
|
|
26
|
+
export declare function getEndnoteFlowBottom(page: IDocumentSkeletonPage): number;
|