postext 1.35.0 → 1.36.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/dist/__bench__/composedPage.bench.test.d.ts +2 -0
- package/dist/__bench__/composedPage.bench.test.d.ts.map +1 -0
- package/dist/__bench__/composedPage.bench.test.js +95 -0
- package/dist/__bench__/composedPage.bench.test.js.map +1 -0
- package/dist/__tests__/composed/fit.test.d.ts +2 -0
- package/dist/__tests__/composed/fit.test.d.ts.map +1 -0
- package/dist/__tests__/composed/fit.test.js +405 -0
- package/dist/__tests__/composed/fit.test.js.map +1 -0
- package/dist/__tests__/composed/layout.test.js +2 -1
- package/dist/__tests__/composed/layout.test.js.map +1 -1
- package/dist/__tests__/composed/pageMemo.test.d.ts +2 -0
- package/dist/__tests__/composed/pageMemo.test.d.ts.map +1 -0
- package/dist/__tests__/composed/pageMemo.test.js +128 -0
- package/dist/__tests__/composed/pageMemo.test.js.map +1 -0
- package/dist/__tests__/composed/sourceMap.test.d.ts +2 -0
- package/dist/__tests__/composed/sourceMap.test.d.ts.map +1 -0
- package/dist/__tests__/composed/sourceMap.test.js +369 -0
- package/dist/__tests__/composed/sourceMap.test.js.map +1 -0
- package/dist/__tests__/composed/templateFrameRects.test.d.ts +2 -0
- package/dist/__tests__/composed/templateFrameRects.test.d.ts.map +1 -0
- package/dist/__tests__/composed/templateFrameRects.test.js +37 -0
- package/dist/__tests__/composed/templateFrameRects.test.js.map +1 -0
- package/dist/__tests__/design/imageAltText.test.js +2 -1
- package/dist/__tests__/design/imageAltText.test.js.map +1 -1
- package/dist/__tests__/exports.test.js +22 -0
- package/dist/__tests__/exports.test.js.map +1 -1
- package/dist/__tests__/pipeline/contourWrap.test.d.ts +2 -0
- package/dist/__tests__/pipeline/contourWrap.test.d.ts.map +1 -0
- package/dist/__tests__/pipeline/contourWrap.test.js +412 -0
- package/dist/__tests__/pipeline/contourWrap.test.js.map +1 -0
- package/dist/__tests__/toc.test.js +3 -2
- package/dist/__tests__/toc.test.js.map +1 -1
- package/dist/bundle/codec.d.ts +16 -0
- package/dist/bundle/codec.d.ts.map +1 -1
- package/dist/bundle/codec.js +44 -2
- package/dist/bundle/codec.js.map +1 -1
- package/dist/bundle/index.d.ts +1 -1
- package/dist/bundle/index.d.ts.map +1 -1
- package/dist/bundle/index.js +1 -1
- package/dist/bundle/index.js.map +1 -1
- package/dist/canvas-backend/composed.d.ts.map +1 -1
- package/dist/canvas-backend/composed.js +5 -2
- package/dist/canvas-backend/composed.js.map +1 -1
- package/dist/composed/contour.d.ts +21 -0
- package/dist/composed/contour.d.ts.map +1 -0
- package/dist/composed/contour.js +34 -0
- package/dist/composed/contour.js.map +1 -0
- package/dist/composed/geometry.d.ts +8 -0
- package/dist/composed/geometry.d.ts.map +1 -1
- package/dist/composed/geometry.js +26 -0
- package/dist/composed/geometry.js.map +1 -1
- package/dist/composed/ids.d.ts +22 -0
- package/dist/composed/ids.d.ts.map +1 -0
- package/dist/composed/ids.js +32 -0
- package/dist/composed/ids.js.map +1 -0
- package/dist/composed/pageMemo.d.ts +72 -0
- package/dist/composed/pageMemo.d.ts.map +1 -0
- package/dist/composed/pageMemo.js +287 -0
- package/dist/composed/pageMemo.js.map +1 -0
- package/dist/composed/paint.d.ts +21 -7
- package/dist/composed/paint.d.ts.map +1 -1
- package/dist/composed/paint.js +33 -5
- package/dist/composed/paint.js.map +1 -1
- package/dist/composed/reflowLog.d.ts +11 -1
- package/dist/composed/reflowLog.d.ts.map +1 -1
- package/dist/composed/reflowLog.js +45 -2
- package/dist/composed/reflowLog.js.map +1 -1
- package/dist/composed/slotChecks.d.ts.map +1 -1
- package/dist/composed/slotChecks.js +3 -1
- package/dist/composed/slotChecks.js.map +1 -1
- package/dist/composed/sourceMap.d.ts +118 -0
- package/dist/composed/sourceMap.d.ts.map +1 -0
- package/dist/composed/sourceMap.js +668 -0
- package/dist/composed/sourceMap.js.map +1 -0
- package/dist/composed/spread.d.ts.map +1 -1
- package/dist/composed/spread.js +10 -11
- package/dist/composed/spread.js.map +1 -1
- package/dist/composed/templates.d.ts +1 -0
- package/dist/composed/templates.d.ts.map +1 -1
- package/dist/composed/templates.js +4 -0
- package/dist/composed/templates.js.map +1 -1
- package/dist/composed/types.d.ts +15 -32
- package/dist/composed/types.d.ts.map +1 -1
- package/dist/composed/validate.d.ts.map +1 -1
- package/dist/composed/validate.js +3 -2
- package/dist/composed/validate.js.map +1 -1
- package/dist/composed/wrap.d.ts.map +1 -1
- package/dist/composed/wrap.js +7 -1
- package/dist/composed/wrap.js.map +1 -1
- package/dist/contour/index.d.ts +134 -0
- package/dist/contour/index.d.ts.map +1 -0
- package/dist/contour/index.js +354 -0
- package/dist/contour/index.js.map +1 -0
- package/dist/contour/png.d.ts +16 -0
- package/dist/contour/png.d.ts.map +1 -0
- package/dist/contour/png.js +173 -0
- package/dist/contour/png.js.map +1 -0
- package/dist/html-backend.js +2 -2
- 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 +13 -3
- package/dist/index.js.map +1 -1
- package/dist/measure/rich.d.ts.map +1 -1
- package/dist/measure/rich.js +2 -0
- package/dist/measure/rich.js.map +1 -1
- package/dist/parse/blockParser.d.ts.map +1 -1
- package/dist/parse/blockParser.js +44 -3
- package/dist/parse/blockParser.js.map +1 -1
- package/dist/parse/types.d.ts +20 -0
- package/dist/parse/types.d.ts.map +1 -1
- package/dist/pipeline/build.d.ts.map +1 -1
- package/dist/pipeline/build.js +108 -8
- package/dist/pipeline/build.js.map +1 -1
- package/dist/pipeline/buildMeasurement.d.ts +7 -2
- package/dist/pipeline/buildMeasurement.d.ts.map +1 -1
- package/dist/pipeline/buildMeasurement.js +10 -5
- package/dist/pipeline/buildMeasurement.js.map +1 -1
- package/dist/pipeline/calloutLayout.d.ts +20 -14
- package/dist/pipeline/calloutLayout.d.ts.map +1 -1
- package/dist/pipeline/calloutLayout.js +20 -2
- package/dist/pipeline/calloutLayout.js.map +1 -1
- package/dist/pipeline/composedLayout.d.ts +36 -5
- package/dist/pipeline/composedLayout.d.ts.map +1 -1
- package/dist/pipeline/composedLayout.js +553 -68
- package/dist/pipeline/composedLayout.js.map +1 -1
- package/dist/pipeline/contentWarnings.d.ts.map +1 -1
- package/dist/pipeline/contentWarnings.js +13 -4
- package/dist/pipeline/contentWarnings.js.map +1 -1
- package/dist/pipeline/floatPlacement.d.ts +2 -0
- package/dist/pipeline/floatPlacement.d.ts.map +1 -1
- package/dist/pipeline/floatPlacement.js +1 -0
- package/dist/pipeline/floatPlacement.js.map +1 -1
- package/dist/pipeline/frameLayout.d.ts +3 -3
- package/dist/pipeline/frameLayout.d.ts.map +1 -1
- package/dist/pipeline/headerFooter.d.ts +9 -0
- package/dist/pipeline/headerFooter.d.ts.map +1 -1
- package/dist/pipeline/headerFooter.js +56 -4
- package/dist/pipeline/headerFooter.js.map +1 -1
- package/dist/pipeline/measureContentBlock.d.ts.map +1 -1
- package/dist/pipeline/measureContentBlock.js +1 -0
- package/dist/pipeline/measureContentBlock.js.map +1 -1
- package/dist/pipeline/outline.d.ts.map +1 -1
- package/dist/pipeline/outline.js +2 -0
- package/dist/pipeline/outline.js.map +1 -1
- package/dist/pipeline/textWrap.d.ts +4 -1
- package/dist/pipeline/textWrap.d.ts.map +1 -1
- package/dist/pipeline/textWrap.js +17 -3
- package/dist/pipeline/textWrap.js.map +1 -1
- package/dist/pipeline/toc.d.ts.map +1 -1
- package/dist/pipeline/toc.js +1 -0
- package/dist/pipeline/toc.js.map +1 -1
- package/dist/types.d.ts +64 -2
- package/dist/types.d.ts.map +1 -1
- package/dist/vdt.d.ts +155 -11
- package/dist/vdt.d.ts.map +1 -1
- package/dist/vdt.js.map +1 -1
- package/package.json +1 -1
|
@@ -14,6 +14,9 @@ import type { ResourceNumberingMap } from './resourceNumbering';
|
|
|
14
14
|
import type { CaptionCitations } from './citations';
|
|
15
15
|
export interface MeasurementInput {
|
|
16
16
|
vdtType: VDTBlock['type'];
|
|
17
|
+
/** Offset of the Markdown body in the chapter file: a figure's labels
|
|
18
|
+
* carry absolute offsets (#857). */
|
|
19
|
+
bodyOffset?: number;
|
|
17
20
|
rawBlock: ContentBlock;
|
|
18
21
|
contentBlock: ContentBlock;
|
|
19
22
|
style: BlockStyle;
|
|
@@ -67,7 +70,9 @@ export interface MeasurementResult {
|
|
|
67
70
|
asideHeight?: number;
|
|
68
71
|
}
|
|
69
72
|
/** The labels of a `:::figure` block (#854) as the VDT carries them
|
|
70
|
-
* (`ResolvedResourceBlock.labels`)
|
|
71
|
-
|
|
73
|
+
* (`ResolvedResourceBlock.labels`), their offsets absolute in the
|
|
74
|
+
* chapter file (`bodyOffset` added), with their stable id, their anchor
|
|
75
|
+
* and the source of each character (#857); undefined when it has none. */
|
|
76
|
+
export declare function figureLabels(block: Pick<ContentBlock, 'figure'>, bodyOffset?: number): VDTFigureLabel[] | undefined;
|
|
72
77
|
export declare function runMeasurement(input: MeasurementInput): MeasurementResult;
|
|
73
78
|
//# sourceMappingURL=buildMeasurement.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"buildMeasurement.d.ts","sourceRoot":"","sources":["../../src/pipeline/buildMeasurement.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAC7C,OAAO,KAAK,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AACvD,OAAO,KAAK,EAAE,cAAc,EAAE,QAAQ,EAAE,qBAAqB,EAAE,cAAc,EAAE,MAAM,QAAQ,CAAC;AAC9F,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAC3C,OAAO,KAAK,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAClE,OAAO,EAAE,YAAY,EAAgE,MAAM,YAAY,CAAC;AACxG,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAC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,aAAa,CAAC;IACxB,iBAAiB,CAAC,EAAE,UAAU,CAAC,OAAO,UAAU,CAAC,CAAC;IAClD,4EAA4E;IAC5E,aAAa,CAAC,EAAE,qBAAqB,CAAC;IACtC,qEAAqE;IACrE,SAAS,CAAC,EAAE,eAAe,CAAC;IAC5B,uEAAuE;IACvE,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED;;;2EAG2E;AAC3E,wBAAgB,YAAY,CAAC,KAAK,EAAE,IAAI,CAAC,YAAY,EAAE,QAAQ,CAAC,EAAE,UAAU,SAAI,GAAG,cAAc,EAAE,GAAG,SAAS,CAa9G;AAED,wBAAgB,cAAc,CAAC,KAAK,EAAE,gBAAgB,GAAG,iBAAiB,CA+FzE"}
|
|
@@ -6,8 +6,10 @@ import { measureBlock, measureRichBlock, cachedMeasureBlock, cachedMeasureRichBl
|
|
|
6
6
|
import { renderMath } from '../math';
|
|
7
7
|
import { layoutResourceBlock } from './resourceLayout';
|
|
8
8
|
/** The labels of a `:::figure` block (#854) as the VDT carries them
|
|
9
|
-
* (`ResolvedResourceBlock.labels`)
|
|
10
|
-
|
|
9
|
+
* (`ResolvedResourceBlock.labels`), their offsets absolute in the
|
|
10
|
+
* chapter file (`bodyOffset` added), with their stable id, their anchor
|
|
11
|
+
* and the source of each character (#857); undefined when it has none. */
|
|
12
|
+
export function figureLabels(block, bodyOffset = 0) {
|
|
11
13
|
const labels = block.figure?.labels;
|
|
12
14
|
if (!labels || labels.length === 0)
|
|
13
15
|
return undefined;
|
|
@@ -15,8 +17,11 @@ export function figureLabels(block) {
|
|
|
15
17
|
text: l.text,
|
|
16
18
|
at: 'anchor' in l.at ? { anchor: l.at.anchor } : { x: l.at.x, y: l.at.y },
|
|
17
19
|
...(l.style !== undefined ? { style: l.style } : {}),
|
|
18
|
-
sourceStart: l.textStart,
|
|
19
|
-
sourceEnd: l.textEnd,
|
|
20
|
+
sourceStart: l.textStart + bodyOffset,
|
|
21
|
+
sourceEnd: l.textEnd + bodyOffset,
|
|
22
|
+
...(l.id !== undefined ? { id: l.id } : {}),
|
|
23
|
+
...(l.anchorRef !== undefined ? { anchorRef: l.anchorRef } : {}),
|
|
24
|
+
...(l.sourceMap.length === l.text.length ? { sourceMap: l.sourceMap.map((o) => o + bodyOffset) } : {}),
|
|
20
25
|
}));
|
|
21
26
|
}
|
|
22
27
|
export function runMeasurement(input) {
|
|
@@ -60,7 +65,7 @@ export function runMeasurement(input) {
|
|
|
60
65
|
};
|
|
61
66
|
// A `:::figure`'s labels (#862) ride on its block: a copy, so a
|
|
62
67
|
// cached layout of the same resource keeps none of them.
|
|
63
|
-
const labels = figureLabels(contentBlock);
|
|
68
|
+
const labels = figureLabels(contentBlock, input.bodyOffset);
|
|
64
69
|
const resourceBlock = labels ? { ...block, labels } : block;
|
|
65
70
|
return { measured, resourceBlock, ...(tableRows ? { tableRows } : {}), ...(asideHeight !== undefined ? { asideHeight } : {}) };
|
|
66
71
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"buildMeasurement.js","sourceRoot":"","sources":["../../src/pipeline/buildMeasurement.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAOH,OAAO,EAAE,YAAY,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,sBAAsB,EAAE,MAAM,YAAY,CAAC;AACxG,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,mBAAmB,EAA6C,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"buildMeasurement.js","sourceRoot":"","sources":["../../src/pipeline/buildMeasurement.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAOH,OAAO,EAAE,YAAY,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,sBAAsB,EAAE,MAAM,YAAY,CAAC;AACxG,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,mBAAmB,EAA6C,MAAM,kBAAkB,CAAC;AAyDlG;;;2EAG2E;AAC3E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AY,EAAE,cAAc,EAAE,KAAK,CAAC,CAAC;QAC1H,CAAC,CAAC,CAAC,OAAO;YACN,CAAC,CAAC,gBAAgB,CAAC,YAAY,CAAC,KAAK,EAAE,KAAK,CAAC,UAAU,EAAE,KAAK,CAAC,cAAe,EAAE,KAAK,CAAC,gBAAiB,EAAE,KAAK,CAAC,oBAAqB,EAAE,eAAe,EAAE,KAAK,CAAC,YAAY,EAAE,cAAc,CAAC;YAC1L,CAAC,CAAC,YAAY,CAAC,YAAY,CAAC,IAAI,EAAE,KAAK,CAAC,UAAU,EAAE,eAAe,EAAE,KAAK,CAAC,YAAY,EAAE,cAAc,CAAC,CAAC,CAAC;IAChH,OAAO,EAAE,QAAQ,EAAE,CAAC;AACtB,CAAC"}
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
*/
|
|
41
41
|
import type { ContentBlock, DirectiveAttrs } from '../parse';
|
|
42
42
|
import type { CalloutPlacement, CalloutSpan, ResolvedCalloutStyleConfig } from '../types';
|
|
43
|
-
import { type ResolvedConfig, type VDTBlock, type VDTDesignBlock } from '../vdt';
|
|
43
|
+
import { type ResolvedConfig, type VDTBlock, type VDTDesignBlock, type VDTExclusionContour } from '../vdt';
|
|
44
44
|
import { type BlockMeasureContext } from './measureContentBlock';
|
|
45
45
|
import { type ParagraphContainerPlan } from './paragraphContainers';
|
|
46
46
|
import { type GalleyItem } from './columnsGroup';
|
|
@@ -164,13 +164,15 @@ export interface CalloutLayoutInput {
|
|
|
164
164
|
* its marker column and tab), that the box's text runs round (#855,
|
|
165
165
|
* `exclude: 'push'` frames): a line meeting one is set short on the
|
|
166
166
|
* side the rectangle covers. Applied to the text children that open in
|
|
167
|
-
* the range laid out; a figure or a formula is not moved.
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
167
|
+
* the range laid out; a figure or a formula is not moved. One with a
|
|
168
|
+
* `contour` (#883, in the same coordinates) sets each line short by the
|
|
169
|
+
* shape's width beside it instead. */
|
|
170
|
+
exclusions?: readonly BoxExclusion[];
|
|
171
|
+
/** A frame of a composed page whose pictures the reflow ladder scales
|
|
172
|
+
* (#858, `fit.imageMinScale`): each bitmap, SVG or video poster among
|
|
173
|
+
* the children is set at this share of the width it would take, below
|
|
174
|
+
* 1. */
|
|
175
|
+
pictureScale?: number;
|
|
174
176
|
}
|
|
175
177
|
/** A box width the first child of a continuation was counted at (see
|
|
176
178
|
* `CalloutLayoutInput.lineWidths`). */
|
|
@@ -306,14 +308,18 @@ export declare function offsetCalloutToAbsolute(result: CalloutLayoutResult, x:
|
|
|
306
308
|
* {@link offsetCalloutToAbsolute}.
|
|
307
309
|
*/
|
|
308
310
|
export declare function layoutCallout(input: CalloutLayoutInput): CalloutLayoutResult;
|
|
309
|
-
/**
|
|
310
|
-
*
|
|
311
|
-
|
|
312
|
-
* covers (the wider side left free when it stands inside the measure). */
|
|
313
|
-
export declare function exclusionInsets(exclusions: readonly {
|
|
311
|
+
/** A rectangle a box's text runs round (`CalloutLayoutInput.exclusions`),
|
|
312
|
+
* with the shape inside it a contour wrap runs round (#883). */
|
|
313
|
+
export interface BoxExclusion {
|
|
314
314
|
x: number;
|
|
315
315
|
y: number;
|
|
316
316
|
width: number;
|
|
317
317
|
height: number;
|
|
318
|
-
|
|
318
|
+
contour?: VDTExclusionContour;
|
|
319
|
+
}
|
|
320
|
+
/** The line insets of a text set from `y0` in `[x, x + width]` with lines
|
|
321
|
+
* `lineHeight` apart, beside the rectangles of `exclusions` (#855): a line
|
|
322
|
+
* that meets one, even in part, is set short on the side the rectangle
|
|
323
|
+
* covers (the wider side left free when it stands inside the measure). */
|
|
324
|
+
export declare function exclusionInsets(exclusions: readonly BoxExclusion[], x: number, width: number, y0: number, lineHeight: number): LineInsetStep[];
|
|
319
325
|
//# sourceMappingURL=calloutLayout.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"calloutLayout.d.ts","sourceRoot":"","sources":["../../src/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MAAM,EAAE,mBAAmB,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,IAAI,CAS/F;AAgBD;;;GAGG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,kBAAkB,GAAG,mBAAmB,CAg1C5E;AA4FD;iEACiE;AACjE,MAAM,WAAW,YAAY;IAC3B,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,mBAAmB,CAAC;CAC/B;AAED;;;2EAG2E;AAC3E,wBAAgB,eAAe,CAC7B,UAAU,EAAE,SAAS,YAAY,EAAE,EACnC,CAAC,EAAE,MAAM,EACT,KAAK,EAAE,MAAM,EACb,EAAE,EAAE,MAAM,EACV,UAAU,EAAE,MAAM,GACjB,aAAa,EAAE,CA4BjB"}
|
|
@@ -45,6 +45,7 @@ import { suffixJoiner } from '../parse/inlineFormatting';
|
|
|
45
45
|
import { spaceDirectiveLines } from '../parse/attrs';
|
|
46
46
|
import { dimensionToPx } from '../units';
|
|
47
47
|
import { createBoundingBox, createVDTBlock, pictureTraits, } from '../vdt';
|
|
48
|
+
import { contourInsetSteps, shiftContour } from '../contour';
|
|
48
49
|
import { buildFontString, measureBlock, measureRichBlock } from '../measure';
|
|
49
50
|
import { graphemeCount } from '../measure/graphemes';
|
|
50
51
|
import { applyStyleAttrs, isMarkerBlock, widthLessEndIndent } from './buildHelpers';
|
|
@@ -447,7 +448,10 @@ export function layoutCallout(input) {
|
|
|
447
448
|
// The label tab's rise (see "Label tab" below), known here so a frame's
|
|
448
449
|
// exclusions and exact height (#855) are read in box coordinates.
|
|
449
450
|
const riseAhead = style.label && !input.continuation && labelText.trim().length > 0 ? Math.max(0, px(style.label.offset)) : 0;
|
|
450
|
-
const exclusions = (input.exclusions ?? []).map((e) => ({
|
|
451
|
+
const exclusions = (input.exclusions ?? []).map((e) => ({
|
|
452
|
+
x: e.x - markerColumn, y: e.y - riseAhead, width: e.width, height: e.height,
|
|
453
|
+
...(e.contour ? { contour: shiftContour(e.contour, -markerColumn, -riseAhead) } : {}),
|
|
454
|
+
}));
|
|
451
455
|
// --- Title -----------------------------------------------------------------
|
|
452
456
|
// A continuation repeats the title, with its suffix, only when the style
|
|
453
457
|
// asks for it (`repeatTitle`); the repeat is pagination furniture.
|
|
@@ -708,11 +712,20 @@ export function layoutCallout(input) {
|
|
|
708
712
|
...(Math.abs(groupWidths[groupWidths.length - 1].width - width) > 0.5 ? [{ fromLine: lineCut.from, columnWidth: width }] : []),
|
|
709
713
|
])
|
|
710
714
|
: undefined;
|
|
711
|
-
|
|
715
|
+
let measuredBlock = acrossGroup
|
|
712
716
|
?? (lineCut ? undefined : measureFirstChildAcrossWidths(raw, blockIdx, k, width, styleOverride))
|
|
713
717
|
?? measureContentBlock(raw, blockIdx, width, derivedCtx, { styleOverride });
|
|
714
718
|
if (!measuredBlock)
|
|
715
719
|
return undefined;
|
|
720
|
+
// A picture the reflow ladder scales (#858): set again at that share of
|
|
721
|
+
// its width.
|
|
722
|
+
const pictureScale = input.pictureScale;
|
|
723
|
+
const picture = measuredBlock.resourceBlock;
|
|
724
|
+
if (pictureScale !== undefined && pictureScale > 0 && pictureScale < 1 && picture && picture.kind !== 'table' && !picture.rotation) {
|
|
725
|
+
const smaller = measureContentBlock(raw, blockIdx, width, derivedCtx, { styleOverride, figureMaxBodyWidth: picture.bodyRect.width * pictureScale });
|
|
726
|
+
if (smaller)
|
|
727
|
+
measuredBlock = smaller;
|
|
728
|
+
}
|
|
716
729
|
const { kind, mathDisplayRender, resourceBlock, code } = measuredBlock;
|
|
717
730
|
let { measured, prefixLen, absoluteSourceMap, letterSpacingPx, runtTracking } = measuredBlock;
|
|
718
731
|
const { vdtType, headingLevel, numberPrefix, numberSeparator, headingNumber, listBullet, listDepth, listKind, bulletXOffsetInColumn, strikethroughText } = kind;
|
|
@@ -1818,6 +1831,11 @@ export function exclusionInsets(exclusions, x, width, y0, lineHeight) {
|
|
|
1818
1831
|
const roomLeft = ex.x - x;
|
|
1819
1832
|
const roomRight = right - exRight;
|
|
1820
1833
|
const coversLeft = roomLeft <= roomRight;
|
|
1834
|
+
if (ex.contour) {
|
|
1835
|
+
// A contour (#883): each line as short as the shape is wide beside it.
|
|
1836
|
+
steps.push(...contourInsetSteps(ex.contour, coversLeft ? 'left' : 'right', x, width, y0, lineHeight, from, to));
|
|
1837
|
+
continue;
|
|
1838
|
+
}
|
|
1821
1839
|
steps.push({
|
|
1822
1840
|
fromLine: from,
|
|
1823
1841
|
toLine: to,
|