@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.
Files changed (116) hide show
  1. package/lib/cjs/{af-B2UUzO69.js → af-nci0ERu_.js} +0 -1
  2. package/lib/cjs/{as-DbZDYp6O.js → as-9-ZvOvbK.js} +0 -1
  3. package/lib/cjs/{be-BBx0lyG-.js → be-CPDnc13A.js} +0 -1
  4. package/lib/cjs/{bg-DeX16RKi.js → bg-Tu2vvwIU.js} +0 -1
  5. package/lib/cjs/{bn-3fjitMC3.js → bn-CP4-u1Rh.js} +0 -1
  6. package/lib/cjs/{ca-BxC8Zblv.js → ca-9lX3QWYB.js} +0 -1
  7. package/lib/cjs/{cop-TvdaSBlz.js → cop-BpbDnfNH.js} +0 -1
  8. package/lib/cjs/{cs-MSNfJH-L.js → cs-6wd1Lm8r.js} +0 -1
  9. package/lib/cjs/{cu-7FYbjEBr.js → cu-DoUwo0RX.js} +0 -1
  10. package/lib/cjs/{cy-CPuxVqb_.js → cy-uvacbUjY.js} +0 -1
  11. package/lib/cjs/{da-BWsE849b.js → da-vuRoJfkB.js} +0 -1
  12. package/lib/cjs/{de-1901-BYSTp3Fp.js → de-1901-C-Rx0RIO.js} +0 -1
  13. package/lib/cjs/{de-1996-DWtCfm_A.js → de-1996-CqTjCS2g.js} +0 -1
  14. package/lib/cjs/{de-ch-1901-rWVcF3cs.js → de-ch-1901-j-eB6ude.js} +0 -1
  15. package/lib/cjs/{el-monoton-BEUGM9Fi.js → el-monoton-CdxEzdnL.js} +0 -1
  16. package/lib/cjs/{el-polyton-Bvh6HAfD.js → el-polyton-QS0KX3lc.js} +0 -1
  17. package/lib/cjs/{en-gb-Dcrai7kY.js → en-gb-B4rmyRrO.js} +0 -1
  18. package/lib/cjs/{es-CVNdGI0L.js → es-BA4drX0l.js} +0 -1
  19. package/lib/cjs/{et-7Rdfp2-O.js → et-C7DwwRsT.js} +0 -1
  20. package/lib/cjs/{eu-DyEtVwHo.js → eu-ClKht9Pp.js} +0 -1
  21. package/lib/cjs/{fi-DzRES2Ke.js → fi-DuHvPYlK.js} +0 -1
  22. package/lib/cjs/{fr-DJMVMLCz.js → fr-B6k7oFRi.js} +0 -1
  23. package/lib/cjs/{fur-CzhK3vxZ.js → fur-BNKRNrN9.js} +0 -1
  24. package/lib/cjs/{ga-HXzOFdlG.js → ga-BZ0KaaVs.js} +0 -1
  25. package/lib/cjs/{gl-C5TM79ih.js → gl-CctrPjLD.js} +0 -1
  26. package/lib/cjs/{grc-CPQF-xFI.js → grc-BE-oBfLv.js} +0 -1
  27. package/lib/cjs/{gu-AqCkEYxo.js → gu-Bv2fvk65.js} +0 -1
  28. package/lib/cjs/{hi-DugLLbv4.js → hi-D9Q0HIae.js} +0 -1
  29. package/lib/cjs/{hr-LSMYFsyP.js → hr-BWOyJbhV.js} +0 -1
  30. package/lib/cjs/{hsb-BlnRYHkg.js → hsb-DbVr5Yti.js} +0 -1
  31. package/lib/cjs/{hu-Dwvtkpy7.js → hu-CZLP-2fR.js} +0 -1
  32. package/lib/cjs/{hy-BsG06_IV.js → hy-ZPOiR2Pl.js} +0 -1
  33. package/lib/cjs/{ia-BMOUZLGD.js → ia-COSQW4z-.js} +0 -1
  34. package/lib/cjs/{id-DhSs0vqq.js → id-5X-mf3_K.js} +0 -1
  35. package/lib/cjs/index.js +3903 -1756
  36. package/lib/cjs/{is-iJhrS7Aw.js → is-B0v_L_rD.js} +0 -1
  37. package/lib/cjs/{it-Aam-BmsV.js → it-BYUjiLCa.js} +0 -1
  38. package/lib/cjs/{ka-CfLSYpVb.js → ka-CqhPSSIU.js} +0 -1
  39. package/lib/cjs/{kmr-DYCscIsi.js → kmr-BuxJ3UNX.js} +0 -1
  40. package/lib/cjs/{kn-OCEDIM_O.js → kn-CqFXlbev.js} +0 -1
  41. package/lib/cjs/{la-DFS3RPxE.js → la-BFXoayQr.js} +0 -1
  42. package/lib/cjs/{la-x-classic-BocVpbl6.js → la-x-classic-BYzNHSGU.js} +0 -1
  43. package/lib/cjs/{la-x-liturgic-CpZYm3b6.js → la-x-liturgic-vXxx2nLG.js} +0 -1
  44. package/lib/cjs/{lt-NC6HHzxn.js → lt-D2dXvF2J.js} +0 -1
  45. package/lib/cjs/{lv-BMFTm6cB.js → lv-bwpCf-Pe.js} +0 -1
  46. package/lib/cjs/{ml-DDWi25Fi.js → ml-Cg8vxrAK.js} +0 -1
  47. package/lib/cjs/{mn-cyrl-TCUeX7is.js → mn-cyrl-B6DZDQQA.js} +0 -1
  48. package/lib/cjs/{mn-cyrl-x-lmc-BCmp3Ybn.js → mn-cyrl-x-lmc-CXBgZUX1.js} +0 -1
  49. package/lib/cjs/{mr-1gjg-u15.js → mr-BBVGX8dy.js} +0 -1
  50. package/lib/cjs/{mul-ethi-B9a4BMM6.js → mul-ethi-CHBVIYMf.js} +0 -1
  51. package/lib/cjs/{nb-DS_J6lre.js → nb-BCuMJhLv.js} +0 -1
  52. package/lib/cjs/{nl-CBtSVLcv.js → nl-8OOgTtzV.js} +0 -1
  53. package/lib/cjs/{nn-DYJOn4Sh.js → nn-XJlYZMaR.js} +0 -1
  54. package/lib/cjs/{no-C20NyT1P.js → no-BYOYolO_.js} +0 -1
  55. package/lib/cjs/{oc-CrKqER_F.js → oc-OPfeuk3n.js} +0 -1
  56. package/lib/cjs/{or-ZqEtsnaq.js → or-1B6R0ukY.js} +0 -1
  57. package/lib/cjs/{pa-BD3r0Teo.js → pa-D7Ec6DsZ.js} +0 -1
  58. package/lib/cjs/{pi-CQUwMUvz.js → pi-CrindCzM.js} +0 -1
  59. package/lib/cjs/{pl-CawofTLo.js → pl-Bhte1xma.js} +0 -1
  60. package/lib/cjs/{pms-DMqDXwo-.js → pms-B5-d2U_Z.js} +0 -1
  61. package/lib/cjs/{pt-BIiUaINZ.js → pt-CtFPi0Il.js} +0 -1
  62. package/lib/cjs/{rm-B_-8T7Y1.js → rm-fgO3AV82.js} +0 -1
  63. package/lib/cjs/{ro-B2Xhfkgx.js → ro-BUB-IxaH.js} +0 -1
  64. package/lib/cjs/{ru-lj-rTTpe.js → ru-BYdNAMwp.js} +0 -1
  65. package/lib/cjs/{sa-D3h-cY2Z.js → sa-BX4Bcw9p.js} +0 -1
  66. package/lib/cjs/{sh-cyrl-0o7p_z-7.js → sh-cyrl-BMS20HU0.js} +0 -1
  67. package/lib/cjs/{sh-latn-BTi9p-0q.js → sh-latn-B5r4ufen.js} +0 -1
  68. package/lib/cjs/{sk-D6mOX2KK.js → sk-B2xqlAKO.js} +0 -1
  69. package/lib/cjs/{sl-Bzz3gkvn.js → sl-BQIVIls0.js} +0 -1
  70. package/lib/cjs/{sr-cyrl-V07WO3rb.js → sr-cyrl-DYfSvoxX.js} +0 -1
  71. package/lib/cjs/{sv-CyQXUuzx.js → sv-Dnaw_W7A.js} +0 -1
  72. package/lib/cjs/{ta-Brwz0zYf.js → ta-UtrX1d-L.js} +0 -1
  73. package/lib/cjs/{te-CgvirCa4.js → te-Cd9aOzWW.js} +0 -1
  74. package/lib/cjs/{th-PlSNhaza.js → th-DMVAQILd.js} +0 -1
  75. package/lib/cjs/{tk-O54r2ybT.js → tk-CmEXyO1-.js} +0 -1
  76. package/lib/cjs/{tr-Dh1h3Dno.js → tr--Z-rfClX.js} +0 -1
  77. package/lib/cjs/{uk-E2mCrVCU.js → uk-COcQB_vY.js} +0 -1
  78. package/lib/cjs/{zh-latn-pinyin-C2RfFfDl.js → zh-latn-pinyin-Cw5tH1Uh.js} +0 -1
  79. package/lib/es/index.js +3819 -1681
  80. package/lib/index.js +3819 -1681
  81. package/lib/types/basics/document-node-tools.d.ts +2 -0
  82. package/lib/types/basics/i-document-skeleton-cached.d.ts +32 -6
  83. package/lib/types/basics/interfaces.d.ts +14 -5
  84. package/lib/types/basics/tools.d.ts +4 -2
  85. package/lib/types/basics/transformer-config.d.ts +4 -0
  86. package/lib/types/components/docs/custom-glyph-renderer.d.ts +36 -0
  87. package/lib/types/components/docs/document-compatibility.d.ts +5 -3
  88. package/lib/types/components/docs/document-layout-presentation.d.ts +104 -0
  89. package/lib/types/components/docs/document.d.ts +20 -2
  90. package/lib/types/components/docs/extensions/font-and-base-line.d.ts +5 -1
  91. package/lib/types/components/docs/layout/block/column.d.ts +3 -2
  92. package/lib/types/components/docs/layout/block/paragraph/layout-ruler.d.ts +14 -5
  93. package/lib/types/components/docs/layout/block/table.d.ts +5 -4
  94. package/lib/types/components/docs/layout/doc-skeleton.d.ts +13 -0
  95. package/lib/types/components/docs/layout/line-breaker/enhancers/link-enhancer.d.ts +2 -1
  96. package/lib/types/components/docs/layout/model/glyph.d.ts +28 -4
  97. package/lib/types/components/docs/layout/model/page.d.ts +6 -2
  98. package/lib/types/components/docs/layout/shaping-engine/font-cache.d.ts +2 -2
  99. package/lib/types/components/docs/layout/tools.d.ts +17 -8
  100. package/lib/types/components/docs/page-borders.d.ts +20 -0
  101. package/lib/types/components/docs/table-hit-test.d.ts +16 -0
  102. package/lib/types/components/docs/table-render-viewport.d.ts +4 -0
  103. package/lib/types/components/docs/view-model/data-stream-tree-node.d.ts +1 -0
  104. package/lib/types/components/docs/view-model/document-view-model.d.ts +9 -8
  105. package/lib/types/components/extension.d.ts +3 -2
  106. package/lib/types/components/sheets/extensions/sheet-extension.d.ts +2 -1
  107. package/lib/types/components/sheets/sheet.render-skeleton.d.ts +3 -1
  108. package/lib/types/index.d.ts +7 -3
  109. package/lib/types/scene-viewer.d.ts +2 -1
  110. package/lib/types/scene.d.ts +2 -1
  111. package/lib/types/scene.input-manager.d.ts +2 -0
  112. package/lib/types/scene.transformer.d.ts +6 -2
  113. package/lib/types/shape/control.d.ts +5 -1
  114. package/lib/types/worker-layout.d.ts +9 -0
  115. package/lib/umd/index.js +4 -5
  116. package/package.json +6 -6
@@ -27,6 +27,8 @@ export declare function getParagraphByGlyph(glyph: Nullable<IDocumentSkeletonGly
27
27
  styleId?: string;
28
28
  paragraphStyle?: import("@univerjs/core").IParagraphStyle;
29
29
  bullet?: import("@univerjs/core").IBullet;
30
+ sourceBullet?: import("@univerjs/core").IBullet | null;
31
+ directBullet?: import("@univerjs/core").IBullet | null;
30
32
  } | undefined;
31
33
  export declare function isPlaceholderOrSpace(glyph: Nullable<IDocumentSkeletonGlyph>): boolean;
32
34
  export declare function isSameLine(glyph1: Nullable<IDocumentSkeletonGlyph>, glyph2: Nullable<IDocumentSkeletonGlyph>): boolean;
@@ -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 { BulletAlignment, ColumnSeparatorType, DataStreamTreeTokenType, IColorStyle, IColumnGroup, IDocDrawingBase, IDocumentRenderConfig, INestingLevel, IParagraph, IParagraphBorder, IParagraphProperties, ITable, ITableRow, ITextStyle, PageOrientType, TabStopLeader } from '@univerjs/core';
16
+ import type { BulletAlignment, ColumnSeparatorType, DataStreamTreeTokenType, IColorStyle, IDocDrawingBase, INestingLevel, IParagraphBorder, IParagraphProperties, ITable, ITableRow, PageOrientType, TabStopLeader } from '@univerjs/core';
17
+ import type { IDocumentLayoutColumnGroup, IDocumentLayoutParagraph, IDocumentLayoutRenderConfig, IDocumentLayoutTextStyle } from '../components/docs/document-layout-presentation';
17
18
  import type { BreakPointType } from '../components/docs/layout/line-breaker/break';
18
19
  export interface IDocumentSkeletonCached extends ISkeletonResourceReference {
19
20
  pages: IDocumentSkeletonPage[];
@@ -25,7 +26,7 @@ export interface IDocumentSkeletonCached extends ISkeletonResourceReference {
25
26
  }
26
27
  export interface IParagraphList {
27
28
  bullet: IDocumentSkeletonBullet;
28
- paragraph: IParagraph;
29
+ paragraph: IDocumentLayoutParagraph;
29
30
  }
30
31
  export interface IDocumentSkeletonParagraphBorders {
31
32
  borderTop?: IParagraphBorder;
@@ -76,6 +77,8 @@ export interface IDocumentSkeletonPage {
76
77
  originMarginBottom: number;
77
78
  marginBottom: number;
78
79
  left: number;
80
+ /** Cell lines use logical axes; the page bounds remain physical after layout. */
81
+ cellTextDirection?: 'tbRlV';
79
82
  pageNumber: number;
80
83
  pageNumberStart: number;
81
84
  verticalAlign: boolean;
@@ -102,7 +105,7 @@ export interface IDocumentSkeletonPage {
102
105
  skeColumnGroups: Map<string, IDocumentSkeletonColumnGroup>;
103
106
  segmentId: string;
104
107
  type: DocumentSkeletonPageType;
105
- renderConfig?: IDocumentRenderConfig;
108
+ renderConfig?: IDocumentLayoutRenderConfig;
106
109
  parent?: IDocumentSkeletonCached | IDocumentSkeletonRow | IDocumentSkeletonColumnGroupColumn | IDocumentSkeletonNote;
107
110
  }
108
111
  export interface IDocumentSkeletonNoteDecoration {
@@ -166,7 +169,7 @@ export interface IDocumentSkeletonColumnGroup {
166
169
  st: number;
167
170
  ed: number;
168
171
  columnGroupId: string;
169
- columnGroupSource: IColumnGroup;
172
+ columnGroupSource: IDocumentLayoutColumnGroup;
170
173
  parent?: IDocumentSkeletonPage;
171
174
  }
172
175
  export interface IDocumentSkeletonColumnGroupColumn {
@@ -203,6 +206,8 @@ export interface IDocumentSkeletonLine {
203
206
  top: number;
204
207
  asc: number;
205
208
  dsc: number;
209
+ drawingMLBaselineHeight?: number;
210
+ drawingMLNormalLineHeight?: number;
206
211
  paddingTop: number;
207
212
  paddingBottom: number;
208
213
  marginTop: number;
@@ -222,6 +227,8 @@ export interface IDocumentSkeletonLine {
222
227
  paragraphBorders?: IDocumentSkeletonParagraphBorders;
223
228
  paragraphPaddingLeft?: number;
224
229
  paragraphPaddingRight?: number;
230
+ borderTopSpace?: number;
231
+ borderBottomSpace?: number;
225
232
  backgroundColor?: IColorStyle;
226
233
  bullet?: IDocumentSkeletonBullet;
227
234
  width?: number;
@@ -250,13 +257,17 @@ export interface IDocumentSkeletonGlyph {
250
257
  width: number;
251
258
  bBox: IDocumentSkeletonBoundingBox;
252
259
  xOffset: number;
260
+ /** Automatic CJK/Latin gaps on the left and right; omitted at a wrapped line edge. */
261
+ autoSpacing?: [number, number];
262
+ /** Left-side punctuation space removed during shaping, restorable at a new line boundary. */
263
+ leadingPunctuationCompression?: number;
253
264
  left: number;
254
265
  count: number;
255
266
  content: string;
256
267
  raw: string;
257
268
  adjustability: IAdjustability;
258
269
  isJustifiable: boolean;
259
- ts?: ITextStyle;
270
+ ts?: IDocumentLayoutTextStyle;
260
271
  fontStyle?: IDocumentSkeletonFontStyle;
261
272
  parent?: IDocumentSkeletonDivide;
262
273
  url?: string;
@@ -265,12 +276,23 @@ export interface IDocumentSkeletonGlyph {
265
276
  noteId?: string;
266
277
  noteSeparator?: boolean;
267
278
  fauxBoldStrokeWidth?: number;
279
+ /** Runtime-only advance adjustment, recomputed when a shaped word is split across lines. */
280
+ kerningAdjustment?: number;
268
281
  tabLeader?: TabStopLeader;
282
+ tabAlignedTextWidth?: number;
283
+ /** Runtime-only positions for tracked text that shares one shaping glyph. */
284
+ textSpacing?: {
285
+ content: string;
286
+ segments: Array<{
287
+ content: string;
288
+ left: number;
289
+ }>;
290
+ };
269
291
  }
270
292
  export interface IDocumentSkeletonBullet {
271
293
  listId: string;
272
294
  symbol: string;
273
- ts: ITextStyle;
295
+ ts: IDocumentLayoutTextStyle;
274
296
  fontStyle?: IDocumentSkeletonFontStyle;
275
297
  startIndexItem: number;
276
298
  startNumber?: number;
@@ -308,6 +330,7 @@ export interface IDocumentSkeletonDrawing {
308
330
  };
309
331
  }
310
332
  export interface IDocumentSkeletonFontStyle {
333
+ fontKerning?: CanvasFontKerning;
311
334
  fontString: string;
312
335
  fontSize: number;
313
336
  originFontSize: number;
@@ -318,6 +341,9 @@ export interface IDocumentSkeletonBoundingBox {
318
341
  width: number;
319
342
  ba: number;
320
343
  bd: number;
344
+ /** Font metrics retained for the caret when ba/bd are overridden for fixed line layout. */
345
+ fontAscent?: number;
346
+ fontDescent?: number;
321
347
  normalLineHeight?: number;
322
348
  aba: number;
323
349
  abd: number;
@@ -13,8 +13,9 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
- import type { BooleanNumber, GridType, IDocStyleBase, IDocumentLayout, IOffset, IParagraphStyle, IReferenceSource, IScale, ISectionBreakBase, ISize, ITextStyle, ITransformState, LocaleService } from '@univerjs/core';
16
+ import type { BooleanNumber, GridType, IDocStyleBase, IDocumentLayout, IOffset, IReferenceSource, IScale, ISectionBreakBase, ISize, ITransformState, LocaleService } from '@univerjs/core';
17
17
  import type { IDocumentCompatibilityPolicy } from '../components/docs/document-compatibility';
18
+ import type { IDocumentLayoutParagraphStyle, IDocumentLayoutRenderConfig, IDocumentLayoutTextStyle } from '../components/docs/document-layout-presentation';
18
19
  import type { DataStreamTreeNode } from '../components/docs/view-model/data-stream-tree-node';
19
20
  import type { DocumentViewModel } from '../components/docs/view-model/document-view-model';
20
21
  import type { DocumentSkeletonPageType, IDocumentSkeletonBullet, IDocumentSkeletonDrawing, IDocumentSkeletonDrawingAnchor, IDocumentSkeletonFontStyle, IDocumentSkeletonGlyph, IDocumentSkeletonHeaderFooter, IDocumentSkeletonTable } from './i-document-skeleton-cached';
@@ -61,7 +62,7 @@ export interface IFontLocale {
61
62
  }
62
63
  export interface IDocsConfig extends IReferenceSource, IDocumentLayout {
63
64
  localeService: LocaleService;
64
- documentTextStyle?: ITextStyle;
65
+ documentTextStyle?: IDocumentLayoutTextStyle;
65
66
  documentCompatibilityPolicy?: IDocumentCompatibilityPolicy;
66
67
  headerTreeMap: Map<string, DocumentViewModel>;
67
68
  footerTreeMap: Map<string, DocumentViewModel>;
@@ -77,10 +78,14 @@ export interface IFooterIds {
77
78
  firstPageFooterId?: string;
78
79
  }
79
80
  export interface ISectionBreakConfig extends IDocStyleBase, ISectionBreakBase, IDocsConfig {
81
+ renderConfig?: IDocumentLayoutRenderConfig;
80
82
  sectionId: string;
81
83
  /** Cell continuation pages retain their segment and physical row-slice budgets. */
82
84
  cellTableId?: string;
85
+ /** Absolute final paragraph mark excluded by this cell's w:hideMark property. */
86
+ cellHiddenEndMarkIndex?: number;
83
87
  cellPageHeights?: readonly number[];
88
+ fontFamilyFallbacks?: Record<string, string>;
84
89
  headerIds?: IHeaderIds;
85
90
  footerIds?: IFooterIds;
86
91
  useFirstPageHeaderFooter?: BooleanNumber;
@@ -107,24 +112,28 @@ export interface IParagraphConfig {
107
112
  pptxEmptyParagraphFontSize?: number;
108
113
  pptxHasExplicitEndParaFontSize?: boolean;
109
114
  sumPptxParagraphSpacing?: boolean;
110
- docxFallbackAnchorLeft?: IParagraphStyle['indentStart'];
115
+ docxFallbackAnchorLeft?: IDocumentLayoutParagraphStyle['indentStart'];
111
116
  paragraphNonInlineSkeDrawings?: Map<string, IDocumentSkeletonDrawing>;
112
117
  paragraphInlineSkeDrawings?: Map<string, IDocumentSkeletonDrawing>;
113
118
  topBottomCustomBlockFlowBottom?: number;
114
119
  skeTablesInParagraph?: IParagraphTableCache[];
115
120
  bulletSkeleton?: IDocumentSkeletonBullet;
116
- paragraphStyle?: IParagraphStyle;
121
+ paragraphStyle?: IDocumentLayoutParagraphStyle;
122
+ borderTopSpace?: number;
123
+ borderBottomSpace?: number;
117
124
  skeHeaders: Map<string, Map<number, IDocumentSkeletonHeaderFooter>>;
118
125
  skeFooters: Map<string, Map<number, IDocumentSkeletonHeaderFooter>>;
119
126
  pDrawingAnchor?: Map<number, IDocumentSkeletonDrawingAnchor>;
120
127
  }
121
128
  export interface IFontCreateConfig {
122
129
  fontStyle: IDocumentSkeletonFontStyle;
123
- textStyle: ITextStyle;
130
+ textStyle: IDocumentLayoutTextStyle;
124
131
  charSpace: number;
125
132
  snapToGrid: BooleanNumber;
126
133
  documentCompatibilityPolicy?: IDocumentCompatibilityPolicy;
127
134
  gridType?: GridType;
135
+ balanceSingleByteDoubleByteWidth?: BooleanNumber;
136
+ balanceSpaceWidth?: boolean;
128
137
  pageWidth?: number;
129
138
  }
130
139
  export interface INodeInfo {
@@ -13,7 +13,7 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
- import type { IPosition, IRange, IRangeWithCoord, IScale, IStyleBase, Nullable } from '@univerjs/core';
16
+ import type { IPosition, IRange, IRangeWithCoord, IScale, ITextStyle, Nullable } from '@univerjs/core';
17
17
  import type { IDocumentSkeletonFontStyle } from './i-document-skeleton-cached';
18
18
  import type { IBoundRectNoAngle } from './vector2';
19
19
  export declare function hasScrollableOverflow(contentSize: number, viewportSize: number): boolean;
@@ -58,7 +58,9 @@ export declare function precisionTo(num: number, accurate: number): number;
58
58
  * var time = performance.now(); for(let i=0;i<100000000;i++){ fixLineWidthByScale(i, 0.666); }; console.log(performance.now()-time);
59
59
  */
60
60
  export declare function fixLineWidthByScale(num: number, scale: number): number;
61
- export declare function getFontStyleString(textStyle?: Nullable<IStyleBase>): IDocumentSkeletonFontStyle;
61
+ export declare function getFontStyleString(textStyle?: Nullable<ITextStyle>, fontFamilyFallbacks?: Record<string, string>): IDocumentSkeletonFontStyle;
62
+ /** Office display casing preserves one source character instead of expanding forms such as ß to SS. */
63
+ export declare function getTextWithCaps(content: string, caps?: boolean): string;
62
64
  export declare function hasAllLatin(text: string): boolean;
63
65
  export declare function hasBasicLatin(text: string): boolean;
64
66
  export declare function hasLatinOneSupplement(text: string): boolean;
@@ -18,6 +18,8 @@ import type { BaseObject } from '../base-object';
18
18
  import type { IMouseEvent, IPointerEvent } from './i-events';
19
19
  export interface ITransformerConfig {
20
20
  isCropper?: boolean;
21
+ /** Minimum crop-handle hit target in screen pixels; does not change its appearance. */
22
+ cropAnchorHitSize?: number;
21
23
  hoverEnabled?: boolean;
22
24
  hoverEnterFunc?: Nullable<(e: IPointerEvent | IMouseEvent) => void>;
23
25
  hoverLeaveFunc?: Nullable<(e: IPointerEvent | IMouseEvent) => void>;
@@ -42,6 +44,8 @@ export interface ITransformerConfig {
42
44
  borderSpacing?: number;
43
45
  resizeEnabled?: boolean;
44
46
  moveEnabled?: boolean;
47
+ /** Start moving only when the object was already selected before pointer down. */
48
+ moveOnlyWhenSelected?: boolean;
45
49
  enabledAnchors?: number[];
46
50
  anchorFill?: string;
47
51
  anchorStroke?: string;
@@ -0,0 +1,36 @@
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 { IDisposable } from '@univerjs/core';
17
+ import type { UniverRenderingContext } from '../../context';
18
+ export interface IDocCustomGlyphRenderInput {
19
+ bold?: boolean;
20
+ italic?: boolean;
21
+ content: string;
22
+ context: UniverRenderingContext;
23
+ fontSizePx: number;
24
+ glyphKey?: string;
25
+ x: number;
26
+ y: number;
27
+ }
28
+ export type DocCustomGlyphRenderer = (input: IDocCustomGlyphRenderInput) => boolean;
29
+ export interface IDocCustomGlyphRendererRegistration {
30
+ fontFamily: string;
31
+ renderer: DocCustomGlyphRenderer;
32
+ strokeRenderer?: DocCustomGlyphRenderer;
33
+ }
34
+ export declare function registerDocCustomGlyphRenderer(registration: IDocCustomGlyphRendererRegistration): IDisposable;
35
+ export declare function getDocCustomGlyphRenderer(fontFamily: string | undefined): DocCustomGlyphRenderer | undefined;
36
+ export declare function getDocCustomGlyphStrokeRenderer(fontFamily: string | undefined): DocCustomGlyphRenderer | undefined;
@@ -13,7 +13,7 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
- import type { ITable } from '@univerjs/core';
16
+ import type { ITable, ITextStyle } from '@univerjs/core';
17
17
  import type { IDocumentSkeletonBoundingBox, IDocumentSkeletonFontStyle } from '../../basics/i-document-skeleton-cached';
18
18
  import { DocumentFlavor } from '@univerjs/core';
19
19
  interface IFontMetricScaleRule {
@@ -24,7 +24,7 @@ interface IFontMetricScaleRule {
24
24
  widthScale?: number;
25
25
  }
26
26
  export interface IDocumentCompatibilityPolicy {
27
- mode: 'modern' | 'traditional' | 'unspecified';
27
+ mode: 'modern' | 'traditional' | 'unspecified' | 'drawingml';
28
28
  applyDocumentDefaultParagraphStyle: boolean;
29
29
  useWordStyleLineHeight: boolean;
30
30
  font: {
@@ -36,8 +36,10 @@ export interface IDocumentCompatibilityPolicy {
36
36
  allowImportedTableMarginOverflow: boolean;
37
37
  };
38
38
  }
39
- export declare function getDocumentCompatibilityPolicy(documentFlavor?: DocumentFlavor): IDocumentCompatibilityPolicy;
39
+ export declare function getDocumentCompatibilityPolicy(documentFlavor?: DocumentFlavor, fontMetricScaleEnabled?: boolean): IDocumentCompatibilityPolicy;
40
40
  export declare function applyFontMetricCompatibility(content: string, fontStyle: IDocumentSkeletonFontStyle, bBox: IDocumentSkeletonBoundingBox, policy: IDocumentCompatibilityPolicy): IDocumentSkeletonBoundingBox;
41
+ export declare function getSmallCapsFontStyle(raw: string, textStyle: ITextStyle | undefined, fontStyle: IDocumentSkeletonFontStyle, policy: IDocumentCompatibilityPolicy): IDocumentSkeletonFontStyle;
42
+ export declare function getNominalFontLineHeight(fontSize: number, policy?: IDocumentCompatibilityPolicy): number | undefined;
41
43
  export declare function isTraditionalDocumentCompatibility(policy?: IDocumentCompatibilityPolicy): boolean;
42
44
  export declare function shouldAllowImportedTableMarginOverflow(policy: IDocumentCompatibilityPolicy, tableSource: ITable | unknown): boolean;
43
45
  export {};
@@ -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 { BooleanNumber, DocumentDataModel, IColumn, IColumnGroup, ICustomColumnGroup, IDisposable, IDocTextOutline, IDocumentBody, IDocumentData, IDocumentRenderConfig, IDocumentStyle, IParagraph, IParagraphStyle, ISectionBreak, ITextDecoration, ITextRun, ITextStyle, JSONXActions } from '@univerjs/core';
17
+ /** Transient layout data. These fields are never part of a document model or snapshot. */
18
+ export interface IDocumentLayoutTextDecoration extends ITextDecoration {
19
+ offset?: number;
20
+ offsetReference?: 'line-bottom' | 'baseline';
21
+ }
22
+ export interface IDocumentLayoutTextStyle extends ITextStyle {
23
+ fontRenderScale?: number;
24
+ textSkewX?: number;
25
+ textAdvance?: number;
26
+ customGlyphKey?: string;
27
+ customGlyphGroup?: string;
28
+ lineAscent?: number;
29
+ lineDescent?: number;
30
+ textPaintOffsets?: Array<{
31
+ x: number;
32
+ y: number;
33
+ }>;
34
+ textOutline?: IDocTextOutline & {
35
+ lineCap?: 'butt' | 'round' | 'square';
36
+ lineJoin?: 'bevel' | 'miter' | 'round';
37
+ miterLimit?: number;
38
+ };
39
+ ul?: IDocumentLayoutTextDecoration;
40
+ st?: IDocumentLayoutTextDecoration;
41
+ ol?: IDocumentLayoutTextDecoration;
42
+ }
43
+ export interface IDocumentLayoutRenderConfig extends IDocumentRenderConfig {
44
+ topAlignExactLineSpacing?: BooleanNumber;
45
+ useTextInkForHitTesting?: BooleanNumber;
46
+ preservePunctuationSpacing?: BooleanNumber;
47
+ applyTextPosition?: BooleanNumber;
48
+ paintTextOutline?: BooleanNumber;
49
+ useCustomGlyphRenderer?: BooleanNumber;
50
+ }
51
+ export interface IDocumentLayoutParagraphStyle extends IParagraphStyle {
52
+ fixedTabStops?: BooleanNumber;
53
+ textStyle?: IDocumentLayoutTextStyle;
54
+ paragraphMarkTextStyle?: IDocumentLayoutTextStyle;
55
+ }
56
+ export interface IDocumentLayoutParagraph extends IParagraph {
57
+ paragraphStyle?: IDocumentLayoutParagraphStyle;
58
+ }
59
+ export interface IDocumentLayoutTextRun extends ITextRun {
60
+ ts?: IDocumentLayoutTextStyle;
61
+ }
62
+ export interface IDocumentLayoutColumn extends IColumn {
63
+ topOffset?: IColumn['minWidth'];
64
+ }
65
+ export interface IDocumentLayoutColumnGroup extends IColumnGroup {
66
+ horizontalPadding?: IColumnGroup['gap'];
67
+ minHeight?: IColumnGroup['gap'];
68
+ clipContent?: BooleanNumber;
69
+ columns: IDocumentLayoutColumn[];
70
+ }
71
+ export interface IDocumentLayoutCustomColumnGroup extends ICustomColumnGroup {
72
+ horizontalPadding?: IColumnGroup['gap'];
73
+ minHeight?: IColumnGroup['gap'];
74
+ clipContent?: BooleanNumber;
75
+ columns?: IDocumentLayoutColumn[];
76
+ }
77
+ export interface IDocumentLayoutSectionBreak extends ISectionBreak {
78
+ renderConfig?: IDocumentLayoutRenderConfig;
79
+ }
80
+ export interface IDocumentLayoutStyle extends IDocumentStyle {
81
+ fontMetricScaleEnabled?: BooleanNumber;
82
+ textStyle?: IDocumentLayoutTextStyle;
83
+ renderConfig?: IDocumentLayoutRenderConfig;
84
+ }
85
+ export interface IDocumentLayoutBody extends IDocumentBody {
86
+ textRuns?: IDocumentLayoutTextRun[];
87
+ paragraphs?: IDocumentLayoutParagraph[];
88
+ sectionBreaks?: IDocumentLayoutSectionBreak[];
89
+ columnGroups?: IDocumentLayoutCustomColumnGroup[];
90
+ }
91
+ /** A read-only layout projection owned by an external host, not a persisted Doc snapshot. */
92
+ export interface IDocumentLayoutSnapshot extends IDocumentData {
93
+ documentStyle: IDocumentLayoutStyle;
94
+ body?: IDocumentLayoutBody;
95
+ }
96
+ /** Synchronous, model-only hooks for host layout metadata and its local undo history. */
97
+ export interface IDocumentLayoutPresentation {
98
+ getSnapshot(document: IDocumentData): IDocumentLayoutSnapshot;
99
+ captureState(): unknown;
100
+ applyActions(actions: JSONXActions, document: IDocumentData): void;
101
+ restoreState(state: unknown): void;
102
+ }
103
+ export declare function registerDocumentLayoutPresentation(model: DocumentDataModel, presentation: IDocumentLayoutPresentation): IDisposable;
104
+ export declare function getDocumentLayoutPresentation(model: DocumentDataModel): IDocumentLayoutPresentation | undefined;
@@ -13,7 +13,7 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
- import type { ICustomRange, Nullable } from '@univerjs/core';
16
+ import type { ICustomRange, IDisposable, Nullable } from '@univerjs/core';
17
17
  import type { IDocumentSkeletonGlyph, IDocumentSkeletonPage, IDocumentSkeletonSection } from '../../basics/i-document-skeleton-cached';
18
18
  import type { Transform } from '../../basics/transform';
19
19
  import type { IViewportInfo } from '../../basics/vector2';
@@ -36,10 +36,22 @@ export interface IDocumentOffsetConfig extends IPageMarginLayout {
36
36
  documentTransform: Transform;
37
37
  }
38
38
  export declare function drawSectionColumnSeparators(ctx: UniverRenderingContext, section: IDocumentSkeletonSection, height: number, offsetX?: number, offsetY?: number): void;
39
+ export interface IDocumentGlyphPaint {
40
+ group?: string;
41
+ transform: readonly [number, number, number, number, number, number];
42
+ draw(context: UniverRenderingContext): void;
43
+ }
39
44
  export declare class Documents extends DocComponent {
45
+ private _glyphPaintSink?;
46
+ private _glyphPaints;
47
+ /** Route actual Docs glyph painters into a host's ordered compositor. */
48
+ setGlyphPaintSink(sink: (paints: readonly IDocumentGlyphPaint[]) => void): IDisposable;
49
+ /** Most recent glyph frame routed to the host, also used for isolated ink measurement. */
50
+ getGlyphPaints(): readonly IDocumentGlyphPaint[];
40
51
  private readonly _pageRender$;
41
52
  readonly pageRender$: import("rxjs").Observable<IPageRenderConfig>;
42
53
  private _drawLiquid;
54
+ private _inactiveAreaOpacity;
43
55
  constructor(oKey: string, documentSkeleton?: DocumentSkeleton, config?: IDocumentsConfig);
44
56
  static create(oKey: string, documentSkeleton?: DocumentSkeleton, config?: IDocumentsConfig): Documents;
45
57
  dispose(): void;
@@ -47,14 +59,20 @@ export declare class Documents extends DocComponent {
47
59
  getEngine(): Nullable<import("../..").Engine>;
48
60
  isHit(coord: Vector2): boolean;
49
61
  changeSkeleton(newSkeleton: DocumentSkeleton): this;
62
+ /** Editor-only emphasis; standalone and export renderers retain full document colors. */
63
+ setInactiveAreaOpacity(opacity: number): void;
50
64
  protected _draw(ctx: UniverRenderingContext, bounds?: IViewportInfo): void;
51
65
  draw(ctx: UniverRenderingContext, bounds?: IViewportInfo): void;
66
+ private _drawBodySections;
67
+ private _getColumnDrawLayout;
68
+ private _drawGlyphGroup;
69
+ private _paintGlyph;
52
70
  private _drawTable;
53
71
  private _drawColumnGroups;
54
72
  private _drawTableCellBackgrounds;
55
73
  private _getTableViewport;
56
74
  private _getRenderUnitId;
57
- private _getDocumentCompatibilityPolicy;
75
+ private _getDocumentFlavor;
58
76
  private _drawLineBackground;
59
77
  private _drawParagraphBorders;
60
78
  private _drawGlyphGroupBackgrounds;
@@ -14,8 +14,8 @@
14
14
  * limitations under the License.
15
15
  */
16
16
  import type { IScale } from '@univerjs/core';
17
- import type { IBoundRectNoAngle } from '../../../basics';
18
17
  import type { IDocumentSkeletonGlyph } from '../../../basics/i-document-skeleton-cached';
18
+ import type { IBoundRectNoAngle } from '../../../basics/vector2';
19
19
  import type { UniverRenderingContext } from '../../../context';
20
20
  import type { IDrawInfo } from '../../extension';
21
21
  import { docExtension } from '../doc-extension';
@@ -46,6 +46,10 @@ export declare class FontAndBaseLine extends docExtension {
46
46
  private _colorWithOpacity;
47
47
  private _clamp;
48
48
  private _fillText;
49
+ private _paintText;
50
+ private _paintTextAtPoint;
51
+ private _paintTextAtSinglePoint;
52
+ private _paintGlyphText;
49
53
  private _getTabLeaderCharacter;
50
54
  clearCache(): void;
51
55
  }
@@ -13,9 +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 { IColumnGroup, Nullable } from '@univerjs/core';
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';
@@ -33,5 +34,5 @@ interface IColumnGroupLayout {
33
34
  }
34
35
  export declare function createColumnGroupSkeleton(ctx: ILayoutContext, curPage: IDocumentSkeletonPage, viewModel: DocumentViewModel, columnGroupNode: DataStreamTreeNode, sectionBreakConfig: ISectionBreakConfig): Nullable<IDocumentSkeletonColumnGroup>;
35
36
  export declare function appendColumnGroupBlockLine(page: IDocumentSkeletonPage, columnGroup: IDocumentSkeletonColumnGroup): boolean;
36
- export declare function calculateColumnGroupLayout(source: IColumnGroup, availableWidth: number, columnHeights: number[]): IColumnGroupLayout;
37
+ export declare function calculateColumnGroupLayout(source: IDocumentLayoutColumnGroup, availableWidth: number, columnHeights: number[]): IColumnGroupLayout;
37
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;
30
+ declare function __avoidNonOverlappingFloatingTables(table: IDocumentSkeletonTable, page: IDocumentSkeletonPage): void;
25
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>): void;
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 {};
@@ -14,7 +14,7 @@
14
14
  * limitations under the License.
15
15
  */
16
16
  import type { INumberUnit, ITable, Nullable } from '@univerjs/core';
17
- import type { IDocumentSkeletonPage, IDocumentSkeletonRow, IDocumentSkeletonTable, IParagraphList } from '../../../../basics/i-document-skeleton-cached';
17
+ import type { IDocumentSkeletonPage, IDocumentSkeletonRow, IDocumentSkeletonTable } 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';
@@ -39,13 +39,13 @@ export interface ITableSkeletonBuildState {
39
39
  currentColumnIndex: number;
40
40
  currentRowLeft: number;
41
41
  currentRowHeight: number;
42
+ mergedCellContentHeights: Map<string, number>;
42
43
  currentCellBuild: Nullable<ICellSkeletonBuildState>;
43
44
  }
44
45
  export declare function startTableSkeletonBuild(ctx: ILayoutContext, curPage: IDocumentSkeletonPage, viewModel: DocumentViewModel, tableNode: DataStreamTreeNode, sectionBreakConfig: ISectionBreakConfig): Nullable<ITableSkeletonBuildState>;
45
46
  export declare function stepTableSkeletonBuild(state: ITableSkeletonBuildState): boolean;
46
- export declare function cachePrecomputedTableSkeleton(ctx: ILayoutContext, tableStartIndex: number, tableSkeleton: IDocumentSkeletonTable): void;
47
+ export declare function cachePrecomputedTableSkeleton(ctx: ILayoutContext, tableNode: DataStreamTreeNode, tableSkeleton: IDocumentSkeletonTable): void;
47
48
  export declare function createTableSkeleton(ctx: ILayoutContext, curPage: IDocumentSkeletonPage, viewModel: DocumentViewModel, tableNode: DataStreamTreeNode, sectionBreakConfig: ISectionBreakConfig): Nullable<IDocumentSkeletonTable>;
48
- export declare function rollbackListCache(listLevel: Map<string, IParagraphList[][]>, table: DataStreamTreeNode): void;
49
49
  export interface ISlicedTableSkeletonParams {
50
50
  skeTables: IDocumentSkeletonTable[];
51
51
  fromCurrentPage: boolean;
@@ -79,8 +79,9 @@ interface ICreateTableCache {
79
79
  }
80
80
  export declare function startTableSkeletonsBuild(ctx: ILayoutContext, curPage: IDocumentSkeletonPage, viewModel: DocumentViewModel, tableNode: DataStreamTreeNode, sectionBreakConfig: ISectionBreakConfig, availableHeight: number): Nullable<ISlicedTableSkeletonBuildState>;
81
81
  export declare function stepTableSkeletonsBuild(state: ISlicedTableSkeletonBuildState): boolean;
82
- export declare function cachePrecomputedSlicedTableSkeletons(ctx: ILayoutContext, tableStartIndex: number, availableHeight: number, result: ISlicedTableSkeletonParams): void;
82
+ export declare function cachePrecomputedSlicedTableSkeletons(ctx: ILayoutContext, tableNode: DataStreamTreeNode, availableHeight: number, result: ISlicedTableSkeletonParams): void;
83
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;
84
85
  export declare function getTableLeft(pageWidth: number, tableWidth: number, align: TableAlignmentType, indent?: INumberUnit): number;
85
86
  export declare function getNullTableSkeleton(st: number, ed: number, table: ITable): IDocumentSkeletonTable;
86
87
  export declare function getTableSliceId(tableId: string, sliceIndex: number): string;
@@ -45,6 +45,8 @@ export declare class DocumentSkeleton extends Skeleton {
45
45
  readonly dirty$: import("rxjs").Observable<boolean>;
46
46
  private _layoutProgress$;
47
47
  readonly layoutProgress$: import("rxjs").Observable<IDocumentLayoutProgress>;
48
+ private readonly _layoutPageMaterialized$;
49
+ readonly layoutPageMaterialized$: import("rxjs").Observable<void>;
48
50
  private _skeletonData;
49
51
  private _findLiquid;
50
52
  private _hyphen;
@@ -61,6 +63,8 @@ export declare class DocumentSkeleton extends Skeleton {
61
63
  private _topLevelBlockSections;
62
64
  private _topLevelBlocks;
63
65
  private readonly _isolateIncrementalPublications;
66
+ private _modernPageWidth;
67
+ private _modernHorizontalMargin;
64
68
  constructor(_docViewModel: DocumentViewModel, localeService: LocaleService, options?: {
65
69
  isolateIncrementalPublications?: boolean;
66
70
  });
@@ -79,6 +83,8 @@ export declare class DocumentSkeleton extends Skeleton {
79
83
  anchor?: number;
80
84
  priorityAnchor?: number;
81
85
  invalidation?: IDocumentLayoutInvalidation;
86
+ modernPageWidth?: number;
87
+ modernHorizontalMargin?: number;
82
88
  bounds?: IViewportInfo;
83
89
  reuseUnaffectedTail?: boolean;
84
90
  /** The caller proved this edit only changes offset-preserving render metadata. */
@@ -122,6 +128,8 @@ export declare class DocumentSkeleton extends Skeleton {
122
128
  */
123
129
  hasCompleteLayout(): boolean;
124
130
  getSkeletonData(): Nullable<IDocumentSkeletonCached>;
131
+ /** Invalidate measurements captured before the requested fonts finished loading. */
132
+ invalidateFontMetrics(fontStyles: readonly string[]): void;
125
133
  /**
126
134
  * Refreshes Custom Block viewport-only metrics without rebuilding document flow.
127
135
  * Pure presentation metrics are published as one batch. Flow metrics are only
@@ -160,6 +168,11 @@ export declare class DocumentSkeleton extends Skeleton {
160
168
  findNodeByCoord(coord: Vector2, pageLayoutType: PageLayoutType, pageMarginLeft: number, pageMarginTop: number, restrictions?: IFindNodeRestrictions): Nullable<INodeInfo>;
161
169
  private _findNodeByCoord;
162
170
  private _collectNearestNode;
171
+ private _getHitTestPageLayout;
172
+ private _collectNearestTableNode;
173
+ private _collectNearestColumnGroupNode;
174
+ private _collectNearestTextNode;
175
+ private _collectNearestInkNode;
163
176
  private _getNearestNode;
164
177
  private _getPageBoundingBox;
165
178
  private _translatePage;