@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
|
@@ -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,
|
|
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,14 @@ export interface IDocumentSkeletonCached extends ISkeletonResourceReference {
|
|
|
25
26
|
}
|
|
26
27
|
export interface IParagraphList {
|
|
27
28
|
bullet: IDocumentSkeletonBullet;
|
|
28
|
-
paragraph:
|
|
29
|
+
paragraph: IDocumentLayoutParagraph;
|
|
30
|
+
}
|
|
31
|
+
export interface IDocumentSkeletonParagraphBorders {
|
|
32
|
+
borderTop?: IParagraphBorder;
|
|
33
|
+
borderBottom?: IParagraphBorder;
|
|
34
|
+
borderLeft?: IParagraphBorder;
|
|
35
|
+
borderRight?: IParagraphBorder;
|
|
36
|
+
borderBetween?: IParagraphBorder;
|
|
29
37
|
}
|
|
30
38
|
export interface ISkeletonResourceReference {
|
|
31
39
|
skeHeaders: Map<string, Map<number, IDocumentSkeletonHeaderFooter>>;
|
|
@@ -42,9 +50,18 @@ export declare enum DocumentSkeletonPageType {
|
|
|
42
50
|
BODY = 0,
|
|
43
51
|
HEADER = 1,
|
|
44
52
|
FOOTER = 2,
|
|
45
|
-
CELL = 3
|
|
53
|
+
CELL = 3,
|
|
54
|
+
NOTE = 4
|
|
46
55
|
}
|
|
47
56
|
export interface IDocumentSkeletonPage {
|
|
57
|
+
/**
|
|
58
|
+
* Preserves page geometry while incremental pagination rebuilds a later page.
|
|
59
|
+
* A placeholder can retain cloned flow nodes as a non-interactive visual preview;
|
|
60
|
+
* coordinate lookup must still treat the page as non-editable.
|
|
61
|
+
*/
|
|
62
|
+
isLayoutPlaceholder?: boolean;
|
|
63
|
+
/** Canonical page geometry is available in the layout executor but not materialized on Main. */
|
|
64
|
+
isMaterializationPlaceholder?: boolean;
|
|
48
65
|
/** Stable id of the document section that owns this body page. */
|
|
49
66
|
sectionId?: string;
|
|
50
67
|
sections: IDocumentSkeletonSection[];
|
|
@@ -60,6 +77,8 @@ export interface IDocumentSkeletonPage {
|
|
|
60
77
|
originMarginBottom: number;
|
|
61
78
|
marginBottom: number;
|
|
62
79
|
left: number;
|
|
80
|
+
/** Cell lines use logical axes; the page bounds remain physical after layout. */
|
|
81
|
+
cellTextDirection?: 'tbRlV';
|
|
63
82
|
pageNumber: number;
|
|
64
83
|
pageNumberStart: number;
|
|
65
84
|
verticalAlign: boolean;
|
|
@@ -71,6 +90,12 @@ export interface IDocumentSkeletonPage {
|
|
|
71
90
|
isExplicitPageBreak?: boolean;
|
|
72
91
|
/** Internal layout provenance for a page opened because content exhausted the previous page. */
|
|
73
92
|
isNaturalPageOverflow?: boolean;
|
|
93
|
+
/** Note fragments use their own segment offsets, independent of body character indices. */
|
|
94
|
+
notes?: IDocumentSkeletonNote[];
|
|
95
|
+
/** Space reserved on this body page for footnotes, including separators and continuation notices. */
|
|
96
|
+
footnoteHeight?: number;
|
|
97
|
+
/** Positioned separators and continuation notices for both footnotes and endnotes. */
|
|
98
|
+
noteDecorations?: IDocumentSkeletonNoteDecoration[];
|
|
74
99
|
st: number;
|
|
75
100
|
ed: number;
|
|
76
101
|
/** Whether this cell page is only a layout placeholder covered by a merged cell. */
|
|
@@ -80,8 +105,25 @@ export interface IDocumentSkeletonPage {
|
|
|
80
105
|
skeColumnGroups: Map<string, IDocumentSkeletonColumnGroup>;
|
|
81
106
|
segmentId: string;
|
|
82
107
|
type: DocumentSkeletonPageType;
|
|
83
|
-
renderConfig?:
|
|
84
|
-
parent?: IDocumentSkeletonCached | IDocumentSkeletonRow;
|
|
108
|
+
renderConfig?: IDocumentLayoutRenderConfig;
|
|
109
|
+
parent?: IDocumentSkeletonCached | IDocumentSkeletonRow | IDocumentSkeletonColumnGroupColumn | IDocumentSkeletonNote;
|
|
110
|
+
}
|
|
111
|
+
export interface IDocumentSkeletonNoteDecoration {
|
|
112
|
+
noteType?: 'footnote' | 'endnote';
|
|
113
|
+
kind: 'separator' | 'continuationSeparator' | 'continuationNotice';
|
|
114
|
+
left: number;
|
|
115
|
+
top: number;
|
|
116
|
+
page: IDocumentSkeletonPage;
|
|
117
|
+
}
|
|
118
|
+
export interface IDocumentSkeletonNote {
|
|
119
|
+
noteType?: 'footnote' | 'endnote';
|
|
120
|
+
noteId: string;
|
|
121
|
+
referenceIndex: number;
|
|
122
|
+
continued: boolean;
|
|
123
|
+
left: number;
|
|
124
|
+
top: number;
|
|
125
|
+
page: IDocumentSkeletonPage;
|
|
126
|
+
parent?: IDocumentSkeletonPage;
|
|
85
127
|
}
|
|
86
128
|
export interface IDocumentSkeletonHeaderFooter extends IDocumentSkeletonPage {
|
|
87
129
|
}
|
|
@@ -127,7 +169,7 @@ export interface IDocumentSkeletonColumnGroup {
|
|
|
127
169
|
st: number;
|
|
128
170
|
ed: number;
|
|
129
171
|
columnGroupId: string;
|
|
130
|
-
columnGroupSource:
|
|
172
|
+
columnGroupSource: IDocumentLayoutColumnGroup;
|
|
131
173
|
parent?: IDocumentSkeletonPage;
|
|
132
174
|
}
|
|
133
175
|
export interface IDocumentSkeletonColumnGroupColumn {
|
|
@@ -164,6 +206,8 @@ export interface IDocumentSkeletonLine {
|
|
|
164
206
|
top: number;
|
|
165
207
|
asc: number;
|
|
166
208
|
dsc: number;
|
|
209
|
+
drawingMLBaselineHeight?: number;
|
|
210
|
+
drawingMLNormalLineHeight?: number;
|
|
167
211
|
paddingTop: number;
|
|
168
212
|
paddingBottom: number;
|
|
169
213
|
marginTop: number;
|
|
@@ -175,7 +219,16 @@ export interface IDocumentSkeletonLine {
|
|
|
175
219
|
paragraphStart: boolean;
|
|
176
220
|
isBehindTable: boolean;
|
|
177
221
|
tableId: string;
|
|
222
|
+
borderBetween?: IParagraphBorder;
|
|
223
|
+
borderTop?: IParagraphBorder;
|
|
178
224
|
borderBottom?: IParagraphBorder;
|
|
225
|
+
borderLeft?: IParagraphBorder;
|
|
226
|
+
borderRight?: IParagraphBorder;
|
|
227
|
+
paragraphBorders?: IDocumentSkeletonParagraphBorders;
|
|
228
|
+
paragraphPaddingLeft?: number;
|
|
229
|
+
paragraphPaddingRight?: number;
|
|
230
|
+
borderTopSpace?: number;
|
|
231
|
+
borderBottomSpace?: number;
|
|
179
232
|
backgroundColor?: IColorStyle;
|
|
180
233
|
bullet?: IDocumentSkeletonBullet;
|
|
181
234
|
width?: number;
|
|
@@ -204,25 +257,42 @@ export interface IDocumentSkeletonGlyph {
|
|
|
204
257
|
width: number;
|
|
205
258
|
bBox: IDocumentSkeletonBoundingBox;
|
|
206
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;
|
|
207
264
|
left: number;
|
|
208
265
|
count: number;
|
|
209
266
|
content: string;
|
|
210
267
|
raw: string;
|
|
211
268
|
adjustability: IAdjustability;
|
|
212
269
|
isJustifiable: boolean;
|
|
213
|
-
ts?:
|
|
270
|
+
ts?: IDocumentLayoutTextStyle;
|
|
214
271
|
fontStyle?: IDocumentSkeletonFontStyle;
|
|
215
272
|
parent?: IDocumentSkeletonDivide;
|
|
216
273
|
url?: string;
|
|
217
274
|
featureId?: string;
|
|
218
275
|
drawingId?: string;
|
|
276
|
+
noteId?: string;
|
|
277
|
+
noteSeparator?: boolean;
|
|
219
278
|
fauxBoldStrokeWidth?: number;
|
|
279
|
+
/** Runtime-only advance adjustment, recomputed when a shaped word is split across lines. */
|
|
280
|
+
kerningAdjustment?: number;
|
|
220
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
|
+
};
|
|
221
291
|
}
|
|
222
292
|
export interface IDocumentSkeletonBullet {
|
|
223
293
|
listId: string;
|
|
224
294
|
symbol: string;
|
|
225
|
-
ts:
|
|
295
|
+
ts: IDocumentLayoutTextStyle;
|
|
226
296
|
fontStyle?: IDocumentSkeletonFontStyle;
|
|
227
297
|
startIndexItem: number;
|
|
228
298
|
startNumber?: number;
|
|
@@ -260,6 +330,7 @@ export interface IDocumentSkeletonDrawing {
|
|
|
260
330
|
};
|
|
261
331
|
}
|
|
262
332
|
export interface IDocumentSkeletonFontStyle {
|
|
333
|
+
fontKerning?: CanvasFontKerning;
|
|
263
334
|
fontString: string;
|
|
264
335
|
fontSize: number;
|
|
265
336
|
originFontSize: number;
|
|
@@ -270,6 +341,9 @@ export interface IDocumentSkeletonBoundingBox {
|
|
|
270
341
|
width: number;
|
|
271
342
|
ba: number;
|
|
272
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;
|
|
273
347
|
normalLineHeight?: number;
|
|
274
348
|
aba: number;
|
|
275
349
|
abd: number;
|
|
@@ -31,5 +31,6 @@ export * from './text-rotation';
|
|
|
31
31
|
export * from './tools';
|
|
32
32
|
export * from './transform';
|
|
33
33
|
export type { ITransformerConfig } from './transformer-config';
|
|
34
|
+
export { DEFAULT_TRANSFORMER_CONFIG } from './transformer-config';
|
|
34
35
|
export * from './vector2';
|
|
35
36
|
export * from './zoom';
|
|
@@ -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,
|
|
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?:
|
|
65
|
+
documentTextStyle?: IDocumentLayoutTextStyle;
|
|
65
66
|
documentCompatibilityPolicy?: IDocumentCompatibilityPolicy;
|
|
66
67
|
headerTreeMap: Map<string, DocumentViewModel>;
|
|
67
68
|
footerTreeMap: Map<string, DocumentViewModel>;
|
|
@@ -77,7 +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;
|
|
83
|
+
/** Cell continuation pages retain their segment and physical row-slice budgets. */
|
|
84
|
+
cellTableId?: string;
|
|
85
|
+
/** Absolute final paragraph mark excluded by this cell's w:hideMark property. */
|
|
86
|
+
cellHiddenEndMarkIndex?: number;
|
|
87
|
+
cellPageHeights?: readonly number[];
|
|
88
|
+
fontFamilyFallbacks?: Record<string, string>;
|
|
81
89
|
headerIds?: IHeaderIds;
|
|
82
90
|
footerIds?: IFooterIds;
|
|
83
91
|
useFirstPageHeaderFooter?: BooleanNumber;
|
|
@@ -104,24 +112,28 @@ export interface IParagraphConfig {
|
|
|
104
112
|
pptxEmptyParagraphFontSize?: number;
|
|
105
113
|
pptxHasExplicitEndParaFontSize?: boolean;
|
|
106
114
|
sumPptxParagraphSpacing?: boolean;
|
|
107
|
-
docxFallbackAnchorLeft?:
|
|
115
|
+
docxFallbackAnchorLeft?: IDocumentLayoutParagraphStyle['indentStart'];
|
|
108
116
|
paragraphNonInlineSkeDrawings?: Map<string, IDocumentSkeletonDrawing>;
|
|
109
117
|
paragraphInlineSkeDrawings?: Map<string, IDocumentSkeletonDrawing>;
|
|
110
118
|
topBottomCustomBlockFlowBottom?: number;
|
|
111
119
|
skeTablesInParagraph?: IParagraphTableCache[];
|
|
112
120
|
bulletSkeleton?: IDocumentSkeletonBullet;
|
|
113
|
-
paragraphStyle?:
|
|
121
|
+
paragraphStyle?: IDocumentLayoutParagraphStyle;
|
|
122
|
+
borderTopSpace?: number;
|
|
123
|
+
borderBottomSpace?: number;
|
|
114
124
|
skeHeaders: Map<string, Map<number, IDocumentSkeletonHeaderFooter>>;
|
|
115
125
|
skeFooters: Map<string, Map<number, IDocumentSkeletonHeaderFooter>>;
|
|
116
126
|
pDrawingAnchor?: Map<number, IDocumentSkeletonDrawingAnchor>;
|
|
117
127
|
}
|
|
118
128
|
export interface IFontCreateConfig {
|
|
119
129
|
fontStyle: IDocumentSkeletonFontStyle;
|
|
120
|
-
textStyle:
|
|
130
|
+
textStyle: IDocumentLayoutTextStyle;
|
|
121
131
|
charSpace: number;
|
|
122
132
|
snapToGrid: BooleanNumber;
|
|
123
133
|
documentCompatibilityPolicy?: IDocumentCompatibilityPolicy;
|
|
124
134
|
gridType?: GridType;
|
|
135
|
+
balanceSingleByteDoubleByteWidth?: BooleanNumber;
|
|
136
|
+
balanceSpaceWidth?: boolean;
|
|
125
137
|
pageWidth?: number;
|
|
126
138
|
}
|
|
127
139
|
export interface INodeInfo {
|
|
@@ -71,6 +71,10 @@ export declare class PerformanceMonitor extends Disposable {
|
|
|
71
71
|
* Returns the frame time of the last recent frame.
|
|
72
72
|
*/
|
|
73
73
|
get instantaneousFrameTime(): number;
|
|
74
|
+
/**
|
|
75
|
+
* Estimates the browser animation-frame cadence while ignoring isolated long frames.
|
|
76
|
+
*/
|
|
77
|
+
get estimatedFrameInterval(): number;
|
|
74
78
|
/**
|
|
75
79
|
* Returns the average framerate in frames per second over the sliding window (or the subset of frames sampled so far)
|
|
76
80
|
*/
|
|
@@ -151,6 +155,7 @@ export declare class RollingAverage {
|
|
|
151
155
|
* @return Value previously recorded with add() or null if outside of range
|
|
152
156
|
*/
|
|
153
157
|
history(i: number): number;
|
|
158
|
+
percentile(percentile: number): number;
|
|
154
159
|
/**
|
|
155
160
|
* Returns true if enough samples have been taken to completely fill the sliding window
|
|
156
161
|
* @return true if sample-set saturated
|
|
@@ -37,7 +37,7 @@ export interface IRectRangeWithStyle extends ITextRangeWithStyle {
|
|
|
37
37
|
spanEntireColumn: boolean;
|
|
38
38
|
spanEntireTable: boolean;
|
|
39
39
|
}
|
|
40
|
-
export type ISuccinctDocRangeParam = Pick<ITextRangeWithStyle, 'startOffset' | 'endOffset' | 'segmentId' | 'segmentPage' | 'style' | 'rangeType'
|
|
40
|
+
export type ISuccinctDocRangeParam = Pick<ITextRangeWithStyle, 'startOffset' | 'endOffset' | 'segmentId' | 'segmentPage' | 'style' | 'rangeType'> & Partial<Pick<ITextRangeWithStyle, 'collapsed' | 'direction' | 'isActive' | 'startNodePosition' | 'endNodePosition'>>;
|
|
41
41
|
export interface IDocSelectionInnerParam {
|
|
42
42
|
textRanges: ITextRangeWithStyle[];
|
|
43
43
|
rectRanges: IRectRangeWithStyle[];
|
|
@@ -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,
|
|
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<
|
|
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;
|
|
@@ -13,11 +13,13 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
import type { Nullable } from '@univerjs/core';
|
|
16
|
+
import type { ITransformState, Nullable } from '@univerjs/core';
|
|
17
17
|
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>;
|
|
@@ -41,6 +43,9 @@ export interface ITransformerConfig {
|
|
|
41
43
|
borderDash?: number[];
|
|
42
44
|
borderSpacing?: number;
|
|
43
45
|
resizeEnabled?: boolean;
|
|
46
|
+
moveEnabled?: boolean;
|
|
47
|
+
/** Start moving only when the object was already selected before pointer down. */
|
|
48
|
+
moveOnlyWhenSelected?: boolean;
|
|
44
49
|
enabledAnchors?: number[];
|
|
45
50
|
anchorFill?: string;
|
|
46
51
|
anchorStroke?: string;
|
|
@@ -64,7 +69,37 @@ export interface ITransformerConfig {
|
|
|
64
69
|
shouldOverdrawWholeArea?: boolean;
|
|
65
70
|
/** Render transformer controls on a layer independent from the selected object. */
|
|
66
71
|
controlLayerIndex?: number;
|
|
72
|
+
/** Resolve display geometry for controls without changing the object's persisted transform. */
|
|
73
|
+
controlStateResolver?: (object: BaseObject) => ITransformState;
|
|
67
74
|
zeroLeft?: number;
|
|
68
75
|
zeroTop?: number;
|
|
69
76
|
moveBoundaryEnabled?: boolean;
|
|
70
77
|
}
|
|
78
|
+
export declare const DEFAULT_TRANSFORMER_CONFIG: {
|
|
79
|
+
moveEnabled: true;
|
|
80
|
+
resizeEnabled: true;
|
|
81
|
+
rotateEnabled: true;
|
|
82
|
+
rotateAnchorOffset: number;
|
|
83
|
+
rotateAnchorPosition: "bottom";
|
|
84
|
+
rotateLineEnabled: false;
|
|
85
|
+
rotateSize: number;
|
|
86
|
+
rotateCornerRadius: number;
|
|
87
|
+
rotateFill: string;
|
|
88
|
+
rotateStroke: string;
|
|
89
|
+
rotateStrokeWidth: number;
|
|
90
|
+
rotateIconEnabled: true;
|
|
91
|
+
rotateIconStroke: string;
|
|
92
|
+
rotateIconStrokeWidth: number;
|
|
93
|
+
borderEnabled: true;
|
|
94
|
+
borderStroke: string;
|
|
95
|
+
borderStrokeWidth: number;
|
|
96
|
+
borderSpacing: number;
|
|
97
|
+
anchorFill: string;
|
|
98
|
+
anchorStroke: string;
|
|
99
|
+
anchorStrokeWidth: number;
|
|
100
|
+
anchorSize: number;
|
|
101
|
+
anchorCornerRadius: number;
|
|
102
|
+
anchorStyle: "canva";
|
|
103
|
+
keepRatio: true;
|
|
104
|
+
moveBoundaryEnabled: true;
|
|
105
|
+
};
|
|
@@ -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;
|
|
@@ -26,11 +26,19 @@ export declare class DocBackground extends DocComponent {
|
|
|
26
26
|
private _marginStrokeColor?;
|
|
27
27
|
private _pageBackgroundSource?;
|
|
28
28
|
private _pageBackgroundImage?;
|
|
29
|
+
private _continuousSkeletonGeneration;
|
|
30
|
+
private _continuousSkeletonTimer;
|
|
31
|
+
private _continuousSkeletonVisible;
|
|
29
32
|
constructor(oKey: string, documentSkeleton?: DocumentSkeleton, config?: IDocumentsConfig);
|
|
30
33
|
static create(oKey: string, documentSkeleton?: DocumentSkeleton, config?: IDocumentsConfig): DocBackground;
|
|
34
|
+
dispose(): void;
|
|
31
35
|
setFillColors(backgroundFillColor?: string, pageFillColor?: string, pageStrokeColor?: string, marginStrokeColor?: string): void;
|
|
32
36
|
draw(ctx: UniverRenderingContext, bounds?: IViewportInfo): void;
|
|
33
37
|
private _drawWorkspaceBackground;
|
|
38
|
+
private _drawPaginatedPlaceholderPages;
|
|
39
|
+
private _drawContinuousLayoutSkeleton;
|
|
40
|
+
private _resetContinuousSkeleton;
|
|
41
|
+
private _drawSkeletonLines;
|
|
34
42
|
private _drawPageBackgroundImage;
|
|
35
43
|
private _getPageBackgroundImage;
|
|
36
44
|
changeSkeleton(newSkeleton: DocumentSkeleton): this;
|
|
@@ -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,16 +59,22 @@ 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
|
|
75
|
+
private _getDocumentFlavor;
|
|
58
76
|
private _drawLineBackground;
|
|
59
|
-
private
|
|
77
|
+
private _drawParagraphBorders;
|
|
60
78
|
private _drawGlyphGroupBackgrounds;
|
|
61
79
|
private _drawTableCell;
|
|
62
80
|
private _drawNestedPageContent;
|
|
@@ -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
|
}
|