postext 0.3.15 → 0.3.17
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/dist/__tests__/createLayout.test.js +12 -13
- package/dist/__tests__/createLayout.test.js.map +1 -1
- package/dist/__tests__/defaults/resourceTypes.test.d.ts +2 -0
- package/dist/__tests__/defaults/resourceTypes.test.d.ts.map +1 -0
- package/dist/__tests__/defaults/resourceTypes.test.js +69 -0
- package/dist/__tests__/defaults/resourceTypes.test.js.map +1 -0
- package/dist/__tests__/exports.test.js +54 -0
- package/dist/__tests__/exports.test.js.map +1 -1
- package/dist/__tests__/parse/inlineRef.test.d.ts +2 -0
- package/dist/__tests__/parse/inlineRef.test.d.ts.map +1 -0
- package/dist/__tests__/parse/inlineRef.test.js +83 -0
- package/dist/__tests__/parse/inlineRef.test.js.map +1 -0
- package/dist/__tests__/parse/resourceDirective.test.d.ts +2 -0
- package/dist/__tests__/parse/resourceDirective.test.d.ts.map +1 -0
- package/dist/__tests__/parse/resourceDirective.test.js +55 -0
- package/dist/__tests__/parse/resourceDirective.test.js.map +1 -0
- package/dist/__tests__/pipeline/floatPlacement.test.d.ts +2 -0
- package/dist/__tests__/pipeline/floatPlacement.test.d.ts.map +1 -0
- package/dist/__tests__/pipeline/floatPlacement.test.js +141 -0
- package/dist/__tests__/pipeline/floatPlacement.test.js.map +1 -0
- package/dist/__tests__/pipeline/inlineRefRender.test.d.ts +2 -0
- package/dist/__tests__/pipeline/inlineRefRender.test.d.ts.map +1 -0
- package/dist/__tests__/pipeline/inlineRefRender.test.js +107 -0
- package/dist/__tests__/pipeline/inlineRefRender.test.js.map +1 -0
- package/dist/__tests__/pipeline/resourceNumbering.test.d.ts +2 -0
- package/dist/__tests__/pipeline/resourceNumbering.test.d.ts.map +1 -0
- package/dist/__tests__/pipeline/resourceNumbering.test.js +186 -0
- package/dist/__tests__/pipeline/resourceNumbering.test.js.map +1 -0
- package/dist/__tests__/table/model.test.d.ts +2 -0
- package/dist/__tests__/table/model.test.d.ts.map +1 -0
- package/dist/__tests__/table/model.test.js +187 -0
- package/dist/__tests__/table/model.test.js.map +1 -0
- package/dist/canvas-backend/blockRender.d.ts.map +1 -1
- package/dist/canvas-backend/blockRender.js +25 -6
- package/dist/canvas-backend/blockRender.js.map +1 -1
- package/dist/canvas-backend/headerFooter.d.ts +3 -2
- package/dist/canvas-backend/headerFooter.d.ts.map +1 -1
- package/dist/canvas-backend/headerFooter.js +63 -2
- package/dist/canvas-backend/headerFooter.js.map +1 -1
- package/dist/canvas-backend/index.d.ts +2 -0
- package/dist/canvas-backend/index.d.ts.map +1 -1
- package/dist/canvas-backend/index.js +11 -0
- package/dist/canvas-backend/index.js.map +1 -1
- package/dist/canvas-backend/renderResourceBlock.d.ts +28 -0
- package/dist/canvas-backend/renderResourceBlock.d.ts.map +1 -0
- package/dist/canvas-backend/renderResourceBlock.js +146 -0
- package/dist/canvas-backend/renderResourceBlock.js.map +1 -0
- package/dist/defaults/bodyText.d.ts.map +1 -1
- package/dist/defaults/bodyText.js +30 -0
- package/dist/defaults/bodyText.js.map +1 -1
- package/dist/defaults/captionStyle.d.ts +9 -0
- package/dist/defaults/captionStyle.d.ts.map +1 -0
- package/dist/defaults/captionStyle.js +74 -0
- package/dist/defaults/captionStyle.js.map +1 -0
- package/dist/defaults/debug.d.ts.map +1 -1
- package/dist/defaults/debug.js +6 -0
- package/dist/defaults/debug.js.map +1 -1
- package/dist/defaults/headerFooter.d.ts +20 -18
- package/dist/defaults/headerFooter.d.ts.map +1 -1
- package/dist/defaults/headerFooter.js +269 -165
- package/dist/defaults/headerFooter.js.map +1 -1
- package/dist/defaults/headings.d.ts.map +1 -1
- package/dist/defaults/headings.js +29 -6
- package/dist/defaults/headings.js.map +1 -1
- package/dist/defaults/index.d.ts +3 -0
- package/dist/defaults/index.d.ts.map +1 -1
- package/dist/defaults/index.js +19 -0
- package/dist/defaults/index.js.map +1 -1
- package/dist/defaults/resourceTypes.d.ts +8 -0
- package/dist/defaults/resourceTypes.d.ts.map +1 -0
- package/dist/defaults/resourceTypes.js +43 -0
- package/dist/defaults/resourceTypes.js.map +1 -0
- package/dist/defaults/shared.d.ts.map +1 -1
- package/dist/defaults/shared.js +30 -0
- package/dist/defaults/shared.js.map +1 -1
- package/dist/defaults/tableStyle.d.ts +11 -0
- package/dist/defaults/tableStyle.d.ts.map +1 -0
- package/dist/defaults/tableStyle.js +114 -0
- package/dist/defaults/tableStyle.js.map +1 -0
- package/dist/design/layout.d.ts +94 -0
- package/dist/design/layout.d.ts.map +1 -0
- package/dist/design/layout.js +642 -0
- package/dist/design/layout.js.map +1 -0
- package/dist/design/placeholders.d.ts +29 -0
- package/dist/design/placeholders.d.ts.map +1 -0
- package/dist/design/placeholders.js +126 -0
- package/dist/design/placeholders.js.map +1 -0
- package/dist/html-backend.d.ts.map +1 -1
- package/dist/html-backend.js +91 -1
- package/dist/html-backend.js.map +1 -1
- package/dist/index.d.ts +12 -5
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -2
- package/dist/index.js.map +1 -1
- package/dist/knuthPlass/richAdapter.d.ts +1 -0
- package/dist/knuthPlass/richAdapter.d.ts.map +1 -1
- package/dist/knuthPlass/richAdapter.js +2 -1
- package/dist/knuthPlass/richAdapter.js.map +1 -1
- package/dist/measure/cache.js +1 -1
- package/dist/measure/cache.js.map +1 -1
- package/dist/measure/rich.d.ts +7 -0
- package/dist/measure/rich.d.ts.map +1 -1
- package/dist/measure/rich.js +30 -0
- package/dist/measure/rich.js.map +1 -1
- package/dist/numbering.d.ts +16 -0
- package/dist/numbering.d.ts.map +1 -1
- package/dist/numbering.js +28 -18
- package/dist/numbering.js.map +1 -1
- package/dist/parse/blockParser.d.ts.map +1 -1
- package/dist/parse/blockParser.js +37 -9
- package/dist/parse/blockParser.js.map +1 -1
- package/dist/parse/inlineFormatting.d.ts +38 -0
- package/dist/parse/inlineFormatting.d.ts.map +1 -1
- package/dist/parse/inlineFormatting.js +84 -0
- package/dist/parse/inlineFormatting.js.map +1 -1
- package/dist/parse/sourceMapping.d.ts.map +1 -1
- package/dist/parse/sourceMapping.js +20 -0
- package/dist/parse/sourceMapping.js.map +1 -1
- package/dist/parse/types.d.ts +20 -1
- package/dist/parse/types.d.ts.map +1 -1
- package/dist/pipeline/build.d.ts.map +1 -1
- package/dist/pipeline/build.js +389 -17
- package/dist/pipeline/build.js.map +1 -1
- package/dist/pipeline/buildBlockKind.d.ts +14 -0
- package/dist/pipeline/buildBlockKind.d.ts.map +1 -1
- package/dist/pipeline/buildBlockKind.js +16 -1
- package/dist/pipeline/buildBlockKind.js.map +1 -1
- package/dist/pipeline/buildHelpers.d.ts.map +1 -1
- package/dist/pipeline/buildHelpers.js +7 -1
- package/dist/pipeline/buildHelpers.js.map +1 -1
- package/dist/pipeline/buildMeasurement.d.ts +17 -1
- package/dist/pipeline/buildMeasurement.d.ts.map +1 -1
- package/dist/pipeline/buildMeasurement.js +32 -0
- package/dist/pipeline/buildMeasurement.js.map +1 -1
- package/dist/pipeline/config.d.ts.map +1 -1
- package/dist/pipeline/config.js +3 -1
- package/dist/pipeline/config.js.map +1 -1
- package/dist/pipeline/floatPlacement.d.ts +45 -0
- package/dist/pipeline/floatPlacement.d.ts.map +1 -0
- package/dist/pipeline/floatPlacement.js +68 -0
- package/dist/pipeline/floatPlacement.js.map +1 -0
- package/dist/pipeline/headerFooter.d.ts +23 -7
- package/dist/pipeline/headerFooter.d.ts.map +1 -1
- package/dist/pipeline/headerFooter.js +258 -100
- package/dist/pipeline/headerFooter.js.map +1 -1
- package/dist/pipeline/placeholders.d.ts +6 -0
- package/dist/pipeline/placeholders.d.ts.map +1 -1
- package/dist/pipeline/placeholders.js +46 -0
- package/dist/pipeline/placeholders.js.map +1 -1
- package/dist/pipeline/placement.d.ts +15 -2
- package/dist/pipeline/placement.d.ts.map +1 -1
- package/dist/pipeline/placement.js +38 -3
- package/dist/pipeline/placement.js.map +1 -1
- package/dist/pipeline/resourceLayout.d.ts +58 -0
- package/dist/pipeline/resourceLayout.d.ts.map +1 -0
- package/dist/pipeline/resourceLayout.js +338 -0
- package/dist/pipeline/resourceLayout.js.map +1 -0
- package/dist/pipeline/resourceNumbering.d.ts +54 -0
- package/dist/pipeline/resourceNumbering.d.ts.map +1 -0
- package/dist/pipeline/resourceNumbering.js +218 -0
- package/dist/pipeline/resourceNumbering.js.map +1 -0
- package/dist/pipeline/styles.d.ts +6 -0
- package/dist/pipeline/styles.d.ts.map +1 -1
- package/dist/pipeline/styles.js +1 -1
- package/dist/pipeline/styles.js.map +1 -1
- package/dist/table/model.d.ts +53 -0
- package/dist/table/model.d.ts.map +1 -0
- package/dist/table/model.js +253 -0
- package/dist/table/model.js.map +1 -0
- package/dist/types.d.ts +397 -41
- package/dist/types.d.ts.map +1 -1
- package/dist/vdt.d.ts +165 -18
- package/dist/vdt.d.ts.map +1 -1
- package/dist/vdt.js.map +1 -1
- package/package.json +1 -1
package/dist/vdt.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { DocumentMetadata, PostextResource, ResolvedPageConfig, ResolvedLayoutConfig, ResolvedBodyTextConfig, ResolvedHeadingsConfig, ResolvedUnorderedListsConfig, ResolvedOrderedListsConfig, ResolvedMathConfig,
|
|
1
|
+
import type { DocumentMetadata, PostextResource, Resource, TableCellAlign, TableCellVerticalAlign, ResolvedPageConfig, ResolvedLayoutConfig, ResolvedBodyTextConfig, ResolvedHeadingsConfig, ResolvedTableStyleConfig, ResolvedCaptionStyleConfig, ResolvedUnorderedListsConfig, ResolvedOrderedListsConfig, ResolvedMathConfig, ResolvedDesignSlot } from './types';
|
|
2
2
|
import type { NumeralStyle } from './numbering';
|
|
3
3
|
import type { MathRender } from './math/types';
|
|
4
4
|
export interface BoundingBox {
|
|
@@ -12,11 +12,13 @@ export interface ResolvedConfig {
|
|
|
12
12
|
layout: ResolvedLayoutConfig;
|
|
13
13
|
bodyText: ResolvedBodyTextConfig;
|
|
14
14
|
headings: ResolvedHeadingsConfig;
|
|
15
|
+
tableStyle: ResolvedTableStyleConfig;
|
|
16
|
+
captionStyle: ResolvedCaptionStyleConfig;
|
|
15
17
|
unorderedLists: ResolvedUnorderedListsConfig;
|
|
16
18
|
orderedLists: ResolvedOrderedListsConfig;
|
|
17
19
|
math: ResolvedMathConfig;
|
|
18
|
-
header:
|
|
19
|
-
footer:
|
|
20
|
+
header: ResolvedDesignSlot;
|
|
21
|
+
footer: ResolvedDesignSlot;
|
|
20
22
|
}
|
|
21
23
|
export type VDTBlockType = 'paragraph' | 'heading' | 'resource' | 'blockquote' | 'listItem' | 'footnoteRef' | 'mathDisplay';
|
|
22
24
|
export type TextAlign = 'left' | 'justify' | 'center';
|
|
@@ -28,6 +30,13 @@ export interface VDTLineSegment {
|
|
|
28
30
|
italic?: boolean;
|
|
29
31
|
/** Present when `kind === 'math'`. The rendered formula. */
|
|
30
32
|
mathRender?: MathRender;
|
|
33
|
+
/** Present when this segment renders an inline `:ref{…}` to a resource.
|
|
34
|
+
* Renderers recolour it (link colour) and the PDF backend emits a link
|
|
35
|
+
* annotation to the resource's named destination. */
|
|
36
|
+
refResourceId?: string;
|
|
37
|
+
/** True when this segment is part of a caption's numbered label, so renderers
|
|
38
|
+
* paint it in the configured caption-label colour. */
|
|
39
|
+
captionLabel?: boolean;
|
|
31
40
|
}
|
|
32
41
|
export interface VDTLine {
|
|
33
42
|
text: string;
|
|
@@ -50,12 +59,96 @@ export interface VDTLine {
|
|
|
50
59
|
* to the normal space width of the block's font. 1.0 means natural spacing. */
|
|
51
60
|
justifiedSpaceRatio?: number;
|
|
52
61
|
}
|
|
62
|
+
/** A single laid-out table cell: its primary grid position, pixel rect within
|
|
63
|
+
* the block, alignment, header flag, and the measured rich-text lines of its
|
|
64
|
+
* content. Cells covered by a merge are omitted (only the primary is kept). */
|
|
65
|
+
export interface VDTResourceTableCell {
|
|
66
|
+
row: number;
|
|
67
|
+
col: number;
|
|
68
|
+
colSpan: number;
|
|
69
|
+
rowSpan: number;
|
|
70
|
+
isHeader: boolean;
|
|
71
|
+
align: TableCellAlign;
|
|
72
|
+
verticalAlign: TableCellVerticalAlign;
|
|
73
|
+
/** Pixel rect of the cell relative to the resource block origin. */
|
|
74
|
+
rect: BoundingBox;
|
|
75
|
+
/** Measured content lines, with bboxes relative to the cell's text origin. */
|
|
76
|
+
lines: VDTLine[];
|
|
77
|
+
}
|
|
78
|
+
/** Laid-out table geometry for a `kind: 'table'` resource block. */
|
|
79
|
+
export interface VDTResourceTableLayout {
|
|
80
|
+
/** Body-cell font strings used for the rich-text line renderer. */
|
|
81
|
+
fontString: string;
|
|
82
|
+
boldFontString: string;
|
|
83
|
+
italicFontString: string;
|
|
84
|
+
boldItalicFontString: string;
|
|
85
|
+
/** Body-cell text colour (hex). */
|
|
86
|
+
color: string;
|
|
87
|
+
/** Header-cell font strings. Header cells are measured with these, so the
|
|
88
|
+
* renderer must paint header cells with the same set. */
|
|
89
|
+
headerFontString: string;
|
|
90
|
+
headerBoldFontString: string;
|
|
91
|
+
headerItalicFontString: string;
|
|
92
|
+
headerBoldItalicFontString: string;
|
|
93
|
+
/** Header-cell text colour (hex). */
|
|
94
|
+
headerColor: string;
|
|
95
|
+
/** Border colour (hex). */
|
|
96
|
+
borderColor: string;
|
|
97
|
+
/** Border thickness in px; `0` means no borders. */
|
|
98
|
+
borderWidthPx: number;
|
|
99
|
+
/** Header background colour (hex), or undefined for no fill. */
|
|
100
|
+
headerBackground?: string;
|
|
101
|
+
/** Body background colour (hex), or undefined for no fill. */
|
|
102
|
+
bodyBackground?: string;
|
|
103
|
+
cells: VDTResourceTableCell[];
|
|
104
|
+
/** Column x-edges (length = columnCount + 1) relative to block origin. */
|
|
105
|
+
columnEdges: number[];
|
|
106
|
+
/** Row y-edges (length = rowCount + 1) relative to the table's top. */
|
|
107
|
+
rowEdges: number[];
|
|
108
|
+
}
|
|
109
|
+
/** The resolved, measured content of a resource block. */
|
|
110
|
+
export interface ResolvedResourceBlock {
|
|
111
|
+
/** The source resource. */
|
|
112
|
+
resource: Resource;
|
|
113
|
+
kind: 'bitmap' | 'svg' | 'table';
|
|
114
|
+
/** Rendered number string (e.g. `"1.7"`) for this resource. */
|
|
115
|
+
number: string;
|
|
116
|
+
/** Caption prefix from the resource type (e.g. `"Figure"`). */
|
|
117
|
+
captionPrefix: string;
|
|
118
|
+
/** Pixel rect of the figure body (image / table area) relative to the block
|
|
119
|
+
* origin. Caption is laid out below it. */
|
|
120
|
+
bodyRect: BoundingBox;
|
|
121
|
+
/** For bitmap/svg: the out-of-band binary id to resolve at render time. */
|
|
122
|
+
fileId?: string;
|
|
123
|
+
/** For bitmap: the source format (e.g. `'png'`, `'jpeg'`, `'webp'`). */
|
|
124
|
+
format?: string;
|
|
125
|
+
/** Measured caption lines (bboxes relative to the block origin), already
|
|
126
|
+
* including the prefix + number. Empty when there is no caption. */
|
|
127
|
+
captionLines: VDTLine[];
|
|
128
|
+
/** Font strings used to render the caption (normal / bold / italic / bold+italic). */
|
|
129
|
+
captionFontString: string;
|
|
130
|
+
captionBoldFontString: string;
|
|
131
|
+
captionItalicFontString: string;
|
|
132
|
+
captionBoldItalicFontString: string;
|
|
133
|
+
/** Caption description text colour (hex). */
|
|
134
|
+
captionColor: string;
|
|
135
|
+
/** Caption numbered-label colour (hex); applied to segments tagged
|
|
136
|
+
* `captionLabel`. */
|
|
137
|
+
captionLabelColor: string;
|
|
138
|
+
/** Link colour (hex) used for inline `:ref` segments inside the caption. */
|
|
139
|
+
linkColor: string;
|
|
140
|
+
/** Table geometry, present only when `kind === 'table'`. */
|
|
141
|
+
table?: VDTResourceTableLayout;
|
|
142
|
+
}
|
|
53
143
|
export interface VDTBlock {
|
|
54
144
|
id: string;
|
|
55
145
|
type: VDTBlockType;
|
|
56
146
|
bbox: BoundingBox;
|
|
57
147
|
lines: VDTLine[];
|
|
58
148
|
resource?: PostextResource;
|
|
149
|
+
/** Resolved resource embed (issue #49). Present only for `type ===
|
|
150
|
+
* 'resource'` blocks; carries the measured image/table + caption layout. */
|
|
151
|
+
resourceBlock?: ResolvedResourceBlock;
|
|
59
152
|
pageIndex: number;
|
|
60
153
|
columnIndex: number;
|
|
61
154
|
dirty: boolean;
|
|
@@ -69,6 +162,8 @@ export interface VDTBlock {
|
|
|
69
162
|
color: string;
|
|
70
163
|
boldColor?: string;
|
|
71
164
|
italicColor?: string;
|
|
165
|
+
/** Colour for inline `:ref` segments (`refResourceId` set). */
|
|
166
|
+
refColor?: string;
|
|
72
167
|
textAlign: TextAlign;
|
|
73
168
|
/** Character offset in the original markdown where the source content for this block starts */
|
|
74
169
|
sourceStart?: number;
|
|
@@ -99,6 +194,15 @@ export interface VDTBlock {
|
|
|
99
194
|
/** Original TeX source for math spans/blocks — used for warnings and the
|
|
100
195
|
* disabled-math fallback rendering. */
|
|
101
196
|
tex?: string;
|
|
197
|
+
/** When true, the block is skipped during rendering but still reserves
|
|
198
|
+
* its bbox space within the column flow. Used for headings with
|
|
199
|
+
* `span: 'page'` whose visual output is produced by an opener band. */
|
|
200
|
+
hidden?: boolean;
|
|
201
|
+
/** Optional in-column design slot rendered in place of the block's default
|
|
202
|
+
* text content. Populated for heading blocks whose level has
|
|
203
|
+
* `advancedDesign.enabled` and (for `span: 'column'`) at least one
|
|
204
|
+
* element. Renderers render this instead of `lines` when present. */
|
|
205
|
+
designOverlay?: VDTDesignSlot;
|
|
102
206
|
}
|
|
103
207
|
export interface VDTColumn {
|
|
104
208
|
index: number;
|
|
@@ -112,35 +216,78 @@ export interface VDTFootnoteArea {
|
|
|
112
216
|
notes: VDTBlock[];
|
|
113
217
|
separator: boolean;
|
|
114
218
|
}
|
|
115
|
-
/**
|
|
116
|
-
export interface
|
|
219
|
+
/** Line of wrapped text inside a `VDTDesignTextBlock`. */
|
|
220
|
+
export interface VDTDesignTextLine {
|
|
221
|
+
text: string;
|
|
222
|
+
/** X offset of the line's visible content inside the element's content box. */
|
|
223
|
+
xOffset: number;
|
|
224
|
+
/** Y offset of the line baseline relative to the element's y. */
|
|
225
|
+
baselineY: number;
|
|
226
|
+
/** Measured width of the visible text. */
|
|
227
|
+
width: number;
|
|
228
|
+
}
|
|
229
|
+
/** Rounded-rectangle box style resolved to absolute px / hex values. */
|
|
230
|
+
export interface VDTDesignBoxStyle {
|
|
231
|
+
backgroundColor?: string;
|
|
232
|
+
borderColor?: string;
|
|
233
|
+
borderWidthPx: number;
|
|
234
|
+
borderRadiusPx: number;
|
|
235
|
+
}
|
|
236
|
+
/** Text block rendered inside a design slot (header / footer / heading). */
|
|
237
|
+
export interface VDTDesignTextBlock {
|
|
238
|
+
kind: 'text';
|
|
239
|
+
bbox: BoundingBox;
|
|
240
|
+
fontString: string;
|
|
241
|
+
color: string;
|
|
242
|
+
/** Absolute-page-coordinate baselines per line, already offset. */
|
|
243
|
+
lines: VDTDesignTextLine[];
|
|
244
|
+
box?: VDTDesignBoxStyle;
|
|
245
|
+
/** Whether rendering should clip to `bbox`. */
|
|
246
|
+
clip: boolean;
|
|
247
|
+
}
|
|
248
|
+
/** Rendered rule inside a design slot. */
|
|
249
|
+
export interface VDTDesignRuleBlock {
|
|
117
250
|
kind: 'rule';
|
|
118
251
|
bbox: BoundingBox;
|
|
119
252
|
color: string;
|
|
120
253
|
thicknessPx: number;
|
|
254
|
+
direction: 'horizontal' | 'vertical';
|
|
121
255
|
}
|
|
122
|
-
/**
|
|
123
|
-
export interface
|
|
124
|
-
kind: '
|
|
256
|
+
/** Decorative rounded box. */
|
|
257
|
+
export interface VDTDesignBoxBlock {
|
|
258
|
+
kind: 'box';
|
|
125
259
|
bbox: BoundingBox;
|
|
126
|
-
|
|
127
|
-
align: HeaderFooterHAlign;
|
|
128
|
-
fontString: string;
|
|
129
|
-
color: string;
|
|
130
|
-
baseline: number;
|
|
260
|
+
box: VDTDesignBoxStyle;
|
|
131
261
|
}
|
|
132
|
-
export type
|
|
133
|
-
export interface
|
|
262
|
+
export type VDTDesignBlock = VDTDesignTextBlock | VDTDesignRuleBlock | VDTDesignBoxBlock;
|
|
263
|
+
export interface VDTDesignSlot {
|
|
134
264
|
bbox: BoundingBox;
|
|
135
|
-
blocks:
|
|
265
|
+
blocks: VDTDesignBlock[];
|
|
136
266
|
}
|
|
267
|
+
/** @deprecated Use `VDTDesignSlot`. */
|
|
268
|
+
export type VDTHeaderFooterSlot = VDTDesignSlot;
|
|
269
|
+
/** @deprecated Use `VDTDesignBlock`. */
|
|
270
|
+
export type VDTHeaderFooterBlock = VDTDesignBlock;
|
|
271
|
+
/** @deprecated Use `VDTDesignTextBlock`. */
|
|
272
|
+
export type VDTHeaderFooterTextBlock = VDTDesignTextBlock;
|
|
273
|
+
/** @deprecated Use `VDTDesignRuleBlock`. */
|
|
274
|
+
export type VDTRuleBlock = VDTDesignRuleBlock;
|
|
137
275
|
export interface VDTPage {
|
|
138
276
|
index: number;
|
|
139
277
|
width: number;
|
|
140
278
|
height: number;
|
|
141
279
|
columns: VDTColumn[];
|
|
142
|
-
header?:
|
|
143
|
-
footer?:
|
|
280
|
+
header?: VDTDesignSlot;
|
|
281
|
+
footer?: VDTDesignSlot;
|
|
282
|
+
/** Optional full-width opener band above the column flow, used for
|
|
283
|
+
* heading-level `span: 'page'` chapter openers. */
|
|
284
|
+
openerBand?: VDTDesignSlot;
|
|
285
|
+
/** Floated resource blocks (figures / tables) reserved into a band at the
|
|
286
|
+
* top or bottom of this page. They live outside the column flow — their
|
|
287
|
+
* bands shrink the columns' usable height — and are rendered after the
|
|
288
|
+
* columns, clipped to the content area rather than to a single column so a
|
|
289
|
+
* `span: 'page'` float can cross the gutter. */
|
|
290
|
+
floats?: VDTBlock[];
|
|
144
291
|
marginNotes: VDTBlock[];
|
|
145
292
|
footnoteArea?: VDTFootnoteArea;
|
|
146
293
|
/** Numeric counter for this page from the active page-numbering sequence.
|
package/dist/vdt.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vdt.d.ts","sourceRoot":"","sources":["../src/vdt.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK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AM,GACnB,WAAW,CAWb;AAED,wBAAgB,aAAa,CAC3B,KAAK,EAAE,MAAM,EACb,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,MAAM,GACb,OAAO,CAWT;AAED,wBAAgB,eAAe,CAC7B,KAAK,EAAE,MAAM,EACb,IAAI,EAAE,WAAW,GAChB,SAAS,CAQX;AAED,wBAAgB,cAAc,CAC5B,EAAE,EAAE,MAAM,EACV,IAAI,EAAE,YAAY,EAClB,UAAU,EAAE,MAAM,EAClB,KAAK,EAAE,MAAM,EACb,SAAS,GAAE,SAAkB,GAC5B,QAAQ,CAcV"}
|
package/dist/vdt.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vdt.js","sourceRoot":"","sources":["../src/vdt.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"vdt.js","sourceRoot":"","sources":["../src/vdt.ts"],"names":[],"mappings":"AAoYA,8EAA8E;AAC9E,oBAAoB;AACpB,8EAA8E;AAE9E,MAAM,UAAU,iBAAiB,CAC/B,CAAS,EACT,CAAS,EACT,KAAa,EACb,MAAc;IAEd,OAAO,EAAE,CAAC,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC;AACjC,CAAC;AAED,MAAM,UAAU,iBAAiB,CAC/B,MAAsB,EACtB,YAAoB;IAEpB,OAAO;QACL,KAAK,EAAE,EAAE;QACT,MAAM,EAAE,EAAE;QACV,MAAM;QACN,YAAY;QACZ,UAAU,EAAE,CAAC;QACb,SAAS,EAAE,KAAK;QAChB,cAAc,EAAE,CAAC;QACjB,QAAQ,EAAE,EAAE;KACb,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,aAAa,CAC3B,KAAa,EACb,KAAa,EACb,MAAc;IAEd,OAAO;QACL,KAAK;QACL,KAAK;QACL,MAAM;QACN,OAAO,EAAE,EAAE;QACX,WAAW,EAAE,EAAE;QACf,eAAe,EAAE,KAAK,GAAG,CAAC;QAC1B,SAAS,EAAE,MAAM,CAAC,KAAK,GAAG,CAAC,CAAC;QAC5B,gBAAgB,EAAE,SAAS;KAC5B,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,eAAe,CAC7B,KAAa,EACb,IAAiB;IAEjB,OAAO;QACL,KAAK;QACL,IAAI;QACJ,MAAM,EAAE,EAAE;QACV,eAAe,EAAE,IAAI,CAAC,MAAM;QAC5B,cAAc,EAAE,CAAC;KAClB,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,cAAc,CAC5B,EAAU,EACV,IAAkB,EAClB,UAAkB,EAClB,KAAa,EACb,YAAuB,MAAM;IAE7B,OAAO;QACL,EAAE;QACF,IAAI;QACJ,IAAI,EAAE,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE;QACzC,KAAK,EAAE,EAAE;QACT,SAAS,EAAE,CAAC,CAAC;QACb,WAAW,EAAE,CAAC,CAAC;QACf,KAAK,EAAE,IAAI;QACX,aAAa,EAAE,KAAK;QACpB,UAAU;QACV,KAAK;QACL,SAAS;KACV,CAAC;AACJ,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "postext",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.17",
|
|
4
4
|
"description": "A programmable typesetter for the web. Layout engine that applies professional editorial rules — columns, orphan/widow prevention, resource placement, footnotes — to semantic content. Built on @chenglou/pretext for DOM-free text measurement.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|