postext 1.34.0 → 1.35.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/__tests__/bundle.test.js +33 -1
- package/dist/__tests__/bundle.test.js.map +1 -1
- package/dist/__tests__/codeBlocks.test.js +88 -0
- package/dist/__tests__/codeBlocks.test.js.map +1 -1
- package/dist/__tests__/composed/fixtures/page8.d.ts +20 -0
- package/dist/__tests__/composed/fixtures/page8.d.ts.map +1 -0
- package/dist/__tests__/composed/fixtures/page8.js +162 -0
- package/dist/__tests__/composed/fixtures/page8.js.map +1 -0
- package/dist/__tests__/composed/fixtures/timeline.d.ts +26 -0
- package/dist/__tests__/composed/fixtures/timeline.d.ts.map +1 -0
- package/dist/__tests__/composed/fixtures/timeline.js +153 -0
- package/dist/__tests__/composed/fixtures/timeline.js.map +1 -0
- package/dist/__tests__/composed/groups.test.d.ts +2 -0
- package/dist/__tests__/composed/groups.test.d.ts.map +1 -0
- package/dist/__tests__/composed/groups.test.js +361 -0
- package/dist/__tests__/composed/groups.test.js.map +1 -0
- package/dist/__tests__/composed/layout.test.d.ts +2 -0
- package/dist/__tests__/composed/layout.test.d.ts.map +1 -0
- package/dist/__tests__/composed/layout.test.js +387 -0
- package/dist/__tests__/composed/layout.test.js.map +1 -0
- package/dist/__tests__/composed/outsidePrint.test.d.ts +2 -0
- package/dist/__tests__/composed/outsidePrint.test.d.ts.map +1 -0
- package/dist/__tests__/composed/outsidePrint.test.js +116 -0
- package/dist/__tests__/composed/outsidePrint.test.js.map +1 -0
- package/dist/__tests__/composed/slotChecks.test.js +6 -3
- package/dist/__tests__/composed/slotChecks.test.js.map +1 -1
- package/dist/__tests__/composed/spread.test.d.ts +2 -0
- package/dist/__tests__/composed/spread.test.d.ts.map +1 -0
- package/dist/__tests__/composed/spread.test.js +475 -0
- package/dist/__tests__/composed/spread.test.js.map +1 -0
- package/dist/__tests__/composedPaint.test.d.ts +2 -0
- package/dist/__tests__/composedPaint.test.d.ts.map +1 -0
- package/dist/__tests__/composedPaint.test.js +199 -0
- package/dist/__tests__/composedPaint.test.js.map +1 -0
- package/dist/__tests__/defaults/stripRoundTrip.test.js +3 -2
- package/dist/__tests__/defaults/stripRoundTrip.test.js.map +1 -1
- package/dist/__tests__/exports.test.js +25 -0
- package/dist/__tests__/exports.test.js.map +1 -1
- package/dist/__tests__/highlightMarks.test.d.ts +2 -0
- package/dist/__tests__/highlightMarks.test.d.ts.map +1 -0
- package/dist/__tests__/highlightMarks.test.js +169 -0
- package/dist/__tests__/highlightMarks.test.js.map +1 -0
- package/dist/__tests__/tocPartLeader.test.d.ts +2 -0
- package/dist/__tests__/tocPartLeader.test.d.ts.map +1 -0
- package/dist/__tests__/tocPartLeader.test.js +133 -0
- package/dist/__tests__/tocPartLeader.test.js.map +1 -0
- package/dist/bundle/api.d.ts +8 -0
- package/dist/bundle/api.d.ts.map +1 -1
- package/dist/bundle/api.js +6 -3
- package/dist/bundle/api.js.map +1 -1
- package/dist/bundle/codec.d.ts +5 -0
- package/dist/bundle/codec.d.ts.map +1 -1
- package/dist/bundle/codec.js +4 -0
- package/dist/bundle/codec.js.map +1 -1
- package/dist/bundle/index.d.ts +2 -2
- 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/bundle/manifest.d.ts +14 -0
- package/dist/bundle/manifest.d.ts.map +1 -1
- package/dist/bundle/manifest.js +13 -0
- package/dist/bundle/manifest.js.map +1 -1
- package/dist/bundle/types.d.ts +7 -0
- package/dist/bundle/types.d.ts.map +1 -1
- package/dist/canvas-backend/annotations.d.ts +6 -0
- package/dist/canvas-backend/annotations.d.ts.map +1 -1
- package/dist/canvas-backend/annotations.js +39 -0
- package/dist/canvas-backend/annotations.js.map +1 -1
- package/dist/canvas-backend/blockRender.d.ts.map +1 -1
- package/dist/canvas-backend/blockRender.js +6 -1
- package/dist/canvas-backend/blockRender.js.map +1 -1
- package/dist/canvas-backend/composed.d.ts +19 -0
- package/dist/canvas-backend/composed.d.ts.map +1 -0
- package/dist/canvas-backend/composed.js +68 -0
- package/dist/canvas-backend/composed.js.map +1 -0
- package/dist/canvas-backend/index.d.ts.map +1 -1
- package/dist/canvas-backend/index.js +15 -1
- package/dist/canvas-backend/index.js.map +1 -1
- package/dist/canvas-backend/renderResourceBlock.d.ts.map +1 -1
- package/dist/canvas-backend/renderResourceBlock.js +4 -1
- package/dist/canvas-backend/renderResourceBlock.js.map +1 -1
- package/dist/composed/geometry.d.ts +108 -0
- package/dist/composed/geometry.d.ts.map +1 -0
- package/dist/composed/geometry.js +241 -0
- package/dist/composed/geometry.js.map +1 -0
- package/dist/composed/groups.d.ts +95 -0
- package/dist/composed/groups.d.ts.map +1 -0
- package/dist/composed/groups.js +359 -0
- package/dist/composed/groups.js.map +1 -0
- package/dist/composed/labelText.d.ts +15 -0
- package/dist/composed/labelText.d.ts.map +1 -0
- package/dist/composed/labelText.js +16 -0
- package/dist/composed/labelText.js.map +1 -0
- package/dist/composed/paint.d.ts +64 -0
- package/dist/composed/paint.d.ts.map +1 -0
- package/dist/composed/paint.js +128 -0
- package/dist/composed/paint.js.map +1 -0
- package/dist/composed/reflowLog.d.ts +39 -0
- package/dist/composed/reflowLog.d.ts.map +1 -0
- package/dist/composed/reflowLog.js +123 -0
- package/dist/composed/reflowLog.js.map +1 -0
- package/dist/composed/slotChecks.d.ts +7 -2
- package/dist/composed/slotChecks.d.ts.map +1 -1
- package/dist/composed/slotChecks.js +21 -0
- package/dist/composed/slotChecks.js.map +1 -1
- package/dist/composed/spread.d.ts +106 -0
- package/dist/composed/spread.d.ts.map +1 -0
- package/dist/composed/spread.js +178 -0
- package/dist/composed/spread.js.map +1 -0
- package/dist/composed/types.d.ts +1 -44
- package/dist/composed/types.d.ts.map +1 -1
- package/dist/composed/wrap.d.ts +52 -0
- package/dist/composed/wrap.d.ts.map +1 -0
- package/dist/composed/wrap.js +234 -0
- package/dist/composed/wrap.js.map +1 -0
- package/dist/configWarnings.js +1 -1
- package/dist/configWarnings.js.map +1 -1
- package/dist/defaults/codeStyle.d.ts.map +1 -1
- package/dist/defaults/codeStyle.js +1 -0
- package/dist/defaults/codeStyle.js.map +1 -1
- package/dist/defaults/headerFooter.d.ts.map +1 -1
- package/dist/defaults/headerFooter.js +4 -0
- package/dist/defaults/headerFooter.js.map +1 -1
- package/dist/defaults/index.d.ts +1 -0
- package/dist/defaults/index.d.ts.map +1 -1
- package/dist/defaults/index.js +9 -0
- package/dist/defaults/index.js.map +1 -1
- package/dist/defaults/markStyles.d.ts +23 -0
- package/dist/defaults/markStyles.d.ts.map +1 -0
- package/dist/defaults/markStyles.js +80 -0
- package/dist/defaults/markStyles.js.map +1 -0
- package/dist/defaults/shared.d.ts.map +1 -1
- package/dist/defaults/shared.js +12 -0
- package/dist/defaults/shared.js.map +1 -1
- package/dist/design/bidiText.d.ts +4 -1
- package/dist/design/bidiText.d.ts.map +1 -1
- package/dist/design/bidiText.js +5 -2
- package/dist/design/bidiText.js.map +1 -1
- package/dist/design/layout.d.ts +19 -0
- package/dist/design/layout.d.ts.map +1 -1
- package/dist/design/layout.js +110 -8
- package/dist/design/layout.js.map +1 -1
- package/dist/design/placeholders.d.ts +28 -2
- package/dist/design/placeholders.d.ts.map +1 -1
- package/dist/design/placeholders.js +24 -1
- package/dist/design/placeholders.js.map +1 -1
- package/dist/design/richText.d.ts +2 -0
- package/dist/design/richText.d.ts.map +1 -1
- package/dist/design/richText.js.map +1 -1
- package/dist/highlightMarks.d.ts +33 -0
- package/dist/highlightMarks.d.ts.map +1 -0
- package/dist/highlightMarks.js +209 -0
- package/dist/highlightMarks.js.map +1 -0
- package/dist/html-backend.d.ts.map +1 -1
- package/dist/html-backend.js +96 -9
- package/dist/html-backend.js.map +1 -1
- package/dist/htmlAnnotations.d.ts +5 -0
- package/dist/htmlAnnotations.d.ts.map +1 -1
- package/dist/htmlAnnotations.js +16 -0
- package/dist/htmlAnnotations.js.map +1 -1
- package/dist/index.d.ts +13 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +12 -2
- package/dist/index.js.map +1 -1
- package/dist/knuthPlass/richAdapter.d.ts +3 -0
- package/dist/knuthPlass/richAdapter.d.ts.map +1 -1
- package/dist/knuthPlass/richAdapter.js +3 -2
- package/dist/knuthPlass/richAdapter.js.map +1 -1
- package/dist/measure/cache.js +3 -3
- package/dist/measure/cache.js.map +1 -1
- package/dist/measure/chipEdges.d.ts +13 -1
- package/dist/measure/chipEdges.d.ts.map +1 -1
- package/dist/measure/chipEdges.js +59 -1
- package/dist/measure/chipEdges.js.map +1 -1
- package/dist/measure/links.d.ts.map +1 -1
- package/dist/measure/links.js +78 -5
- package/dist/measure/links.js.map +1 -1
- package/dist/measure/rich.d.ts +3 -0
- package/dist/measure/rich.d.ts.map +1 -1
- package/dist/measure/rich.js +19 -4
- package/dist/measure/rich.js.map +1 -1
- package/dist/parse/inlineFormatting.d.ts +14 -0
- package/dist/parse/inlineFormatting.d.ts.map +1 -1
- package/dist/parse/inlineFormatting.js +104 -5
- package/dist/parse/inlineFormatting.js.map +1 -1
- package/dist/parse/links.js +1 -1
- package/dist/parse/links.js.map +1 -1
- package/dist/parse/softBreaks.js +1 -1
- package/dist/parse/softBreaks.js.map +1 -1
- package/dist/parse/sourceMapping.d.ts.map +1 -1
- package/dist/parse/sourceMapping.js +19 -3
- package/dist/parse/sourceMapping.js.map +1 -1
- package/dist/parse/types.d.ts +24 -0
- package/dist/parse/types.d.ts.map +1 -1
- package/dist/pipeline/build.d.ts.map +1 -1
- package/dist/pipeline/build.js +213 -301
- package/dist/pipeline/build.js.map +1 -1
- package/dist/pipeline/buildMeasurement.d.ts +4 -1
- package/dist/pipeline/buildMeasurement.d.ts.map +1 -1
- package/dist/pipeline/buildMeasurement.js +19 -1
- package/dist/pipeline/buildMeasurement.js.map +1 -1
- package/dist/pipeline/calloutLayout.d.ts +36 -1
- package/dist/pipeline/calloutLayout.d.ts.map +1 -1
- package/dist/pipeline/calloutLayout.js +93 -3
- package/dist/pipeline/calloutLayout.js.map +1 -1
- package/dist/pipeline/codeInline.d.ts +10 -1
- package/dist/pipeline/codeInline.d.ts.map +1 -1
- package/dist/pipeline/codeInline.js +96 -15
- package/dist/pipeline/codeInline.js.map +1 -1
- package/dist/pipeline/composedLayout.d.ts +93 -0
- package/dist/pipeline/composedLayout.d.ts.map +1 -0
- package/dist/pipeline/composedLayout.js +520 -0
- package/dist/pipeline/composedLayout.js.map +1 -0
- package/dist/pipeline/config.d.ts.map +1 -1
- package/dist/pipeline/config.js +2 -1
- package/dist/pipeline/config.js.map +1 -1
- package/dist/pipeline/contentWarnings.d.ts.map +1 -1
- package/dist/pipeline/contentWarnings.js +39 -2
- package/dist/pipeline/contentWarnings.js.map +1 -1
- package/dist/pipeline/floatSlots.js +1 -1
- package/dist/pipeline/floatSlots.js.map +1 -1
- package/dist/pipeline/frameLayout.d.ts +120 -0
- package/dist/pipeline/frameLayout.d.ts.map +1 -0
- package/dist/pipeline/frameLayout.js +279 -0
- package/dist/pipeline/frameLayout.js.map +1 -0
- package/dist/pipeline/headerFooter.d.ts.map +1 -1
- package/dist/pipeline/headerFooter.js +96 -3
- package/dist/pipeline/headerFooter.js.map +1 -1
- package/dist/pipeline/pageRoles.d.ts +1 -0
- package/dist/pipeline/pageRoles.d.ts.map +1 -1
- package/dist/pipeline/pageRoles.js +3 -0
- package/dist/pipeline/pageRoles.js.map +1 -1
- package/dist/pipeline/placement.js +1 -1
- package/dist/pipeline/placement.js.map +1 -1
- package/dist/pipeline/resourceLayout.d.ts.map +1 -1
- package/dist/pipeline/resourceLayout.js +5 -3
- package/dist/pipeline/resourceLayout.js.map +1 -1
- package/dist/pipeline/tabs.js +1 -1
- package/dist/pipeline/tabs.js.map +1 -1
- package/dist/types.d.ts +89 -3
- package/dist/types.d.ts.map +1 -1
- package/dist/vdt.d.ts +247 -1
- package/dist/vdt.d.ts.map +1 -1
- package/dist/vdt.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The box typesetter (#855): lay a run of content blocks out as a box of a
|
|
3
|
+
* callout style at a width, and cut it at a height, resumably.
|
|
4
|
+
*
|
|
5
|
+
* Factored out of `placeDocumentPass` (`build.ts`) with an explicit pass
|
|
6
|
+
* context so callouts and the frames of composed pages (DESIGN §5.1) share
|
|
7
|
+
* it: a callout's fragments (`keepTogether: false`) and a frame's content
|
|
8
|
+
* cut at the frame's foot are the same operation. Nothing here reads the
|
|
9
|
+
* page or the cursor; the pass context hands in what the layout needs.
|
|
10
|
+
*/
|
|
11
|
+
import type { ContentBlock } from '../parse';
|
|
12
|
+
import type { ResolvedCalloutStyleConfig } from '../types';
|
|
13
|
+
import type { ResolvedConfig, VDTBlock } from '../vdt';
|
|
14
|
+
import type { BlockMeasureContext } from './measureContentBlock';
|
|
15
|
+
import type { ParagraphContainerPlan } from './paragraphContainers';
|
|
16
|
+
import { type CalloutLayoutInput, type CalloutLayoutResult, type CalloutLineWidth, type GroupPos, type PlannedCallout } from './calloutLayout';
|
|
17
|
+
/** What a frame of a composed page (#855) adds to a box's layout: its exact
|
|
18
|
+
* height, where content shorter than it sits, and the rectangles its text
|
|
19
|
+
* runs round. Absent for callouts. */
|
|
20
|
+
export type FrameBoxOptions = Pick<CalloutLayoutInput, 'boxHeight' | 'verticalAlign' | 'exclusions'>;
|
|
21
|
+
/** What the box typesetter reads of a layout pass. */
|
|
22
|
+
export interface FrameLayoutPass {
|
|
23
|
+
/** The pass's content blocks (after every block transform). */
|
|
24
|
+
readonly contentBlocks: readonly ContentBlock[];
|
|
25
|
+
/** The pass's configuration (`layout.flowColumns`,
|
|
26
|
+
* `layout.boxChildSplitMinLines`). */
|
|
27
|
+
readonly resolved: ResolvedConfig;
|
|
28
|
+
/** The configuration boxes are laid out with: `resolved` plus the
|
|
29
|
+
* synthetic box styles of the pass. */
|
|
30
|
+
readonly calloutResolved: ResolvedConfig;
|
|
31
|
+
readonly paragraphContainers: ParagraphContainerPlan;
|
|
32
|
+
/** The measure context the children of the box that opens at `startIdx`
|
|
33
|
+
* are set with (a main-flow group's box sets its blocks as the text
|
|
34
|
+
* around it is set). */
|
|
35
|
+
measureCtxFor(startIdx: number, style: ResolvedCalloutStyleConfig): BlockMeasureContext;
|
|
36
|
+
/** Lays out a comic strip among a box's children (see
|
|
37
|
+
* `CalloutLayoutInput.stripBlock`). */
|
|
38
|
+
stripBlock(raw: ContentBlock, idx: number, width: number): VDTBlock | undefined;
|
|
39
|
+
/** The height of an empty, full-height column of the current page (see
|
|
40
|
+
* {@link tallerThanColumn}). */
|
|
41
|
+
columnHeight(): number;
|
|
42
|
+
}
|
|
43
|
+
/** A position inside a box's children where a fragment starts or ends:
|
|
44
|
+
* before child `child` (a position in `children`), past its first
|
|
45
|
+
* `line` text lines. `line: 0` is the child's head; a cut with
|
|
46
|
+
* `line > 0` falls inside that child, between two of its lines. */
|
|
47
|
+
export interface CalloutCut {
|
|
48
|
+
child: number;
|
|
49
|
+
line: number;
|
|
50
|
+
/** For a cut inside a child (`line > 0`): the box widths that child's
|
|
51
|
+
* lines up to `line` were counted at, from line `fromLine` on (see
|
|
52
|
+
* `CalloutLayoutInput.lineWidths`). A box that goes on in a column of
|
|
53
|
+
* another width breaks the child again from them. */
|
|
54
|
+
widths?: readonly CalloutLineWidth[];
|
|
55
|
+
/** A cut inside the `:::columns` group whose opening marker is at
|
|
56
|
+
* position `open` (#634): where each of its streams stands (one for a
|
|
57
|
+
* snake group). `child` is then the earliest of them, `line` 0. */
|
|
58
|
+
group?: {
|
|
59
|
+
open: number;
|
|
60
|
+
pos: readonly GroupPos[];
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
/** The widths a child's lines are counted at in a fragment `width` wide
|
|
64
|
+
* that opens `from` (see `CalloutCut.widths`). */
|
|
65
|
+
export declare const cutWidths: (from: CalloutCut, width: number) => readonly CalloutLineWidth[];
|
|
66
|
+
export declare const CUT_START: CalloutCut;
|
|
67
|
+
export interface CalloutLayouter {
|
|
68
|
+
/** Content blocks between the fence markers. */
|
|
69
|
+
children: readonly ContentBlock[];
|
|
70
|
+
/** Content index of `children[0]`. */
|
|
71
|
+
childBase: number;
|
|
72
|
+
/** Positions in `children` of the blocks the box lays out (marker
|
|
73
|
+
* blocks of nested containers and directives are skipped). */
|
|
74
|
+
realAt: readonly number[];
|
|
75
|
+
/** The cut past the last child (the end of the box). */
|
|
76
|
+
end: CalloutCut;
|
|
77
|
+
/** `:::columns` groups among the children ([start, end] marker
|
|
78
|
+
* positions): only the cuts the group itself offers fall inside one
|
|
79
|
+
* (#634), and none inside a group of a nested box. */
|
|
80
|
+
groups: readonly [number, number][];
|
|
81
|
+
/** Lay out the children from cut `from` to cut `to` at `width` as one
|
|
82
|
+
* box — a `continuation` (every fragment after the head) without
|
|
83
|
+
* title / icon. A cut inside a child keeps only the lines on its side. */
|
|
84
|
+
layoutRange: (from: CalloutCut, to: CalloutCut, width: number, frameId: string, continuation: boolean, mirrored?: boolean, frame?: FrameBoxOptions) => CalloutLayoutResult;
|
|
85
|
+
}
|
|
86
|
+
export declare const makeCalloutLayouter: (pass: FrameLayoutPass, startIdx: number, plan: PlannedCallout, style: ResolvedCalloutStyleConfig) => CalloutLayouter;
|
|
87
|
+
export interface CalloutFragment {
|
|
88
|
+
/** The cut the rest of the box starts at. */
|
|
89
|
+
to: CalloutCut;
|
|
90
|
+
result: CalloutLayoutResult;
|
|
91
|
+
}
|
|
92
|
+
/** The longest leading fragment of the box from cut `from` on whose box
|
|
93
|
+
* is at most `roomPx` tall. Cuts fall between children or between the
|
|
94
|
+
* lines of a text child. `splitMinLines` guards text: a cut between
|
|
95
|
+
* children leaves on each side at least that many text lines or at least
|
|
96
|
+
* one indivisible block (a figure, table, display formula or nested
|
|
97
|
+
* box); a cut inside a text child counts every line on its side, a block
|
|
98
|
+
* as one line, and leaves at least `layout.boxChildSplitMinLines` lines
|
|
99
|
+
* of that child on each side (two by default, `splitMinLines` when that
|
|
100
|
+
* is lower; EF-115). A nested box that may split
|
|
101
|
+
* itself (`keepTogether: false`, or taller than a full column) offers the cuts
|
|
102
|
+
* inside it too, by its own `splitMinLines` over its own children; the
|
|
103
|
+
* fragments on both sides redraw its frame. The full layout's geometry
|
|
104
|
+
* ranks the candidates (box bottom = content bottom at the cut + the
|
|
105
|
+
* tails of the boxes closed below it); the deepest candidate that fits
|
|
106
|
+
* is laid out for real and taken when it truly fits. `null` when none
|
|
107
|
+
* does. */
|
|
108
|
+
export declare const splitCalloutFragment: (pass: FrameLayoutPass, L: CalloutLayouter, from: CalloutCut, width: number, roomPx: number, frameId: string, continuation: boolean, minLines: number, mirrored?: boolean, frame?: FrameBoxOptions) => CalloutFragment | null;
|
|
109
|
+
/** Absolute content indices of the children a fragment from cut `from`
|
|
110
|
+
* to cut `to` of `L` touches, for the fragment's source range. */
|
|
111
|
+
export declare const fragmentRange: (L: CalloutLayouter, from: CalloutCut, to: CalloutCut) => {
|
|
112
|
+
firstChildIdx: number;
|
|
113
|
+
lastChildIdx: number;
|
|
114
|
+
};
|
|
115
|
+
/** The (rest of the) box is taller than an empty, full-height column —
|
|
116
|
+
* a whole page's content area for a page-span box: no column could
|
|
117
|
+
* hold it, so even a keep-together box splits (with the rules of a
|
|
118
|
+
* `keepTogether: false` one) rather than overflow. */
|
|
119
|
+
export declare const tallerThanColumn: (pass: FrameLayoutPass, result: CalloutLayoutResult) => boolean;
|
|
120
|
+
//# sourceMappingURL=frameLayout.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"frameLayout.d.ts","sourceRoot":"","sources":["../../src/pipeline/frameLayout.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAC7C,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,UAAU,CAAC;AAC3D,OAAO,KAAK,EAAE,cAAc,EAAE,QAAQ,EAAE,MAAM,QAAQ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AAI,GAAG,eAAe,EAAE,MAAM,UAAU,EAAE,IAAI,UAAU;;;CACkC,CAAC;AAErH;;;uDAGuD;AACvD,eAAO,MAAM,gBAAgB,GAAI,MAAM,eAAe,EAAE,QAAQ,mBAAmB,KAAG,OACrC,CAAC"}
|
|
@@ -0,0 +1,279 @@
|
|
|
1
|
+
import { isMarkerBlock } from './buildHelpers';
|
|
2
|
+
import { layoutCallout, } from './calloutLayout';
|
|
3
|
+
import { fillGalley, galleyBreaks } from './columnsGroup';
|
|
4
|
+
/** The widths a child's lines are counted at in a fragment `width` wide
|
|
5
|
+
* that opens `from` (see `CalloutCut.widths`). */
|
|
6
|
+
export const cutWidths = (from, width) => {
|
|
7
|
+
const before = from.line > 0 ? from.widths : undefined;
|
|
8
|
+
if (!before || before.length === 0)
|
|
9
|
+
return [{ fromLine: 0, width }];
|
|
10
|
+
const last = before[before.length - 1];
|
|
11
|
+
return Math.abs(last.width - width) <= 0.5 ? before : [...before, { fromLine: from.line, width }];
|
|
12
|
+
};
|
|
13
|
+
export const CUT_START = { child: 0, line: 0 };
|
|
14
|
+
export const makeCalloutLayouter = (pass, startIdx, plan, style) => {
|
|
15
|
+
const contentBlocks = pass.contentBlocks;
|
|
16
|
+
const children = contentBlocks.slice(startIdx + 1, plan.endIdx);
|
|
17
|
+
const realAt = [];
|
|
18
|
+
children.forEach((c, k) => {
|
|
19
|
+
if ((c.type !== 'directive' || (c.directiveName === 'strip' && c.comic)) && !isMarkerBlock(c))
|
|
20
|
+
realAt.push(k);
|
|
21
|
+
});
|
|
22
|
+
// `:::columns` groups among the children, as [start marker, end marker]
|
|
23
|
+
// positions: a split never cuts inside one.
|
|
24
|
+
const groups = [];
|
|
25
|
+
children.forEach((c, k) => {
|
|
26
|
+
if (c.type === 'containerStart' && c.containerName === 'columns') {
|
|
27
|
+
let e = k + 1;
|
|
28
|
+
while (e < children.length && !(children[e].type === 'containerEnd' && children[e].containerName === 'columns' && children[e].containerId === c.containerId))
|
|
29
|
+
e++;
|
|
30
|
+
groups.push([k, e]);
|
|
31
|
+
}
|
|
32
|
+
});
|
|
33
|
+
const layoutRange = (from, to, width, frameId, continuation, mirrored = false, frame) => {
|
|
34
|
+
let n = 0;
|
|
35
|
+
// A fragment that opens inside a `:::columns` group starts at its
|
|
36
|
+
// opening marker and one that ends inside it at its closing marker:
|
|
37
|
+
// the group sets the part between the cut's positions (#634).
|
|
38
|
+
const fromChild = from.group ? from.group.open : from.child;
|
|
39
|
+
const closeOfGroup = (open) => groups.find(([gs]) => gs === open)?.[1] ?? children.length - 1;
|
|
40
|
+
// A cut inside child `to.child` includes that child (its first
|
|
41
|
+
// `to.line` lines); a cut at a child's head excludes it.
|
|
42
|
+
const toChild = to.group ? closeOfGroup(to.group.open) + 1 : to.line > 0 ? to.child + 1 : to.child;
|
|
43
|
+
const inSlice = (pos) => pos.map((p) => ({ ...p, child: p.child - fromChild }));
|
|
44
|
+
// Nested boxes still open at `from` (their closing markers leading
|
|
45
|
+
// the range close them): the fragment opens inside them.
|
|
46
|
+
const open = [];
|
|
47
|
+
for (let k = 0; k < fromChild; k++) {
|
|
48
|
+
const c = children[k];
|
|
49
|
+
if (c.containerName !== 'callout')
|
|
50
|
+
continue;
|
|
51
|
+
if (c.type === 'containerStart')
|
|
52
|
+
open.push({ idx: startIdx + 1 + k, block: c });
|
|
53
|
+
else if (c.type === 'containerEnd')
|
|
54
|
+
open.pop();
|
|
55
|
+
}
|
|
56
|
+
for (let k = fromChild; k < children.length && open.length > 0; k++) {
|
|
57
|
+
const c = children[k];
|
|
58
|
+
if (c.type !== 'containerEnd' || c.containerId !== open[open.length - 1].block.containerId)
|
|
59
|
+
break;
|
|
60
|
+
open.pop();
|
|
61
|
+
}
|
|
62
|
+
return layoutCallout({
|
|
63
|
+
style,
|
|
64
|
+
attrs: plan.attrs,
|
|
65
|
+
...(contentBlocks[startIdx]?.direction ? { direction: contentBlocks[startIdx].direction } : {}),
|
|
66
|
+
continuation,
|
|
67
|
+
// Any range short of the box's end is a fragment that goes on.
|
|
68
|
+
...(to.child < children.length || to.line > 0 || to.group ? { continues: true } : {}),
|
|
69
|
+
children: children.slice(fromChild, toChild),
|
|
70
|
+
childStartIdx: startIdx + 1 + fromChild,
|
|
71
|
+
width,
|
|
72
|
+
// A main-flow group's box sets its blocks as the text around it is
|
|
73
|
+
// set: a styled section's or a part's body (#634).
|
|
74
|
+
ctx: pass.measureCtxFor(startIdx, style),
|
|
75
|
+
resolved: pass.calloutResolved,
|
|
76
|
+
containerId: plan.containerId,
|
|
77
|
+
frameId,
|
|
78
|
+
nextChildId: () => `${frameId}-c${n++}`,
|
|
79
|
+
paragraphContainers: pass.paragraphContainers,
|
|
80
|
+
...(from.line > 0 && !from.group ? { lineFrom: from.line } : {}),
|
|
81
|
+
...(from.line > 0 && !from.group && from.widths ? { lineWidths: from.widths } : {}),
|
|
82
|
+
...(to.line > 0 && !to.group ? { lineTo: to.line } : {}),
|
|
83
|
+
...(from.group ? { groupFrom: inSlice(from.group.pos) } : {}),
|
|
84
|
+
...(to.group ? { groupTo: inSlice(to.group.pos) } : {}),
|
|
85
|
+
...(open.length > 0 ? { openNested: open } : {}),
|
|
86
|
+
mirrored,
|
|
87
|
+
stripBlock: pass.stripBlock,
|
|
88
|
+
...frame,
|
|
89
|
+
});
|
|
90
|
+
};
|
|
91
|
+
return { children, childBase: startIdx + 1, realAt, end: { child: children.length, line: 0 }, layoutRange, groups };
|
|
92
|
+
};
|
|
93
|
+
/** The longest leading fragment of the box from cut `from` on whose box
|
|
94
|
+
* is at most `roomPx` tall. Cuts fall between children or between the
|
|
95
|
+
* lines of a text child. `splitMinLines` guards text: a cut between
|
|
96
|
+
* children leaves on each side at least that many text lines or at least
|
|
97
|
+
* one indivisible block (a figure, table, display formula or nested
|
|
98
|
+
* box); a cut inside a text child counts every line on its side, a block
|
|
99
|
+
* as one line, and leaves at least `layout.boxChildSplitMinLines` lines
|
|
100
|
+
* of that child on each side (two by default, `splitMinLines` when that
|
|
101
|
+
* is lower; EF-115). A nested box that may split
|
|
102
|
+
* itself (`keepTogether: false`, or taller than a full column) offers the cuts
|
|
103
|
+
* inside it too, by its own `splitMinLines` over its own children; the
|
|
104
|
+
* fragments on both sides redraw its frame. The full layout's geometry
|
|
105
|
+
* ranks the candidates (box bottom = content bottom at the cut + the
|
|
106
|
+
* tails of the boxes closed below it); the deepest candidate that fits
|
|
107
|
+
* is laid out for real and taken when it truly fits. `null` when none
|
|
108
|
+
* does. */
|
|
109
|
+
export const splitCalloutFragment = (pass, L, from, width, roomPx, frameId, continuation, minLines, mirrored = false, frame) => {
|
|
110
|
+
const full = L.layoutRange(from, L.end, width, frameId, continuation, mirrored, frame);
|
|
111
|
+
/** Figures, tables and display formulas: never cut, not text lines. */
|
|
112
|
+
const indivisible = (c) => c.type === 'resource' || c.type === 'mathDisplay';
|
|
113
|
+
const unitBottom = (u) => {
|
|
114
|
+
const b = u.kind === 'block' ? u.block.bbox : u.box.result.frame.bbox;
|
|
115
|
+
return b.y + b.height;
|
|
116
|
+
};
|
|
117
|
+
/** Room a box keeps under its last item (padding, border, icon growth). */
|
|
118
|
+
const tailOf = (r) => {
|
|
119
|
+
const last = r.units[r.units.length - 1];
|
|
120
|
+
return last ? r.frame.bbox.y + r.totalHeight - unitBottom(last) : 0;
|
|
121
|
+
};
|
|
122
|
+
if (full.units.length === 0)
|
|
123
|
+
return null;
|
|
124
|
+
// A head that goes on also carries the style's continuation marker.
|
|
125
|
+
const tail = tailOf(full) + full.continuesMarkerPx;
|
|
126
|
+
/** Candidate cuts with the head's content bottom. A `soft` cut parts a
|
|
127
|
+
* wrapped code line from its continuation (#624): taken only when no
|
|
128
|
+
* other cut fits. */
|
|
129
|
+
const candidates = [];
|
|
130
|
+
/** Collect the cuts among `units` (one box's items; `below` = the tails
|
|
131
|
+
* of the nested boxes around them), each side of a cut holding enough
|
|
132
|
+
* by the box's `min` lines: a block counts as one line, a nested box
|
|
133
|
+
* as one indivisible block. */
|
|
134
|
+
const collect = (units, minLines, below) => {
|
|
135
|
+
const min = Math.max(1, minLines);
|
|
136
|
+
const lineCount = (u) => (u.kind === 'block' ? Math.max(1, u.block.lines.length) : 1);
|
|
137
|
+
const isBlock = (u) => u.kind === 'box' || indivisible(u.block);
|
|
138
|
+
const totalLines = units.reduce((n, u) => n + lineCount(u), 0);
|
|
139
|
+
const totalBlocks = units.filter(isBlock).length;
|
|
140
|
+
/** A side of a cut holds enough: `lines` (blocks included) of which
|
|
141
|
+
* `blocks` are indivisible. Between children, one block suffices or
|
|
142
|
+
* the text lines alone meet the minimum; inside a text child, the
|
|
143
|
+
* lines do. */
|
|
144
|
+
const holds = (lines, blocks, betweenChildren) => betweenChildren ? blocks > 0 || lines - blocks >= min : lines >= min;
|
|
145
|
+
const bothHold = (lines, blocks, betweenChildren) => holds(lines, blocks, betweenChildren) && holds(totalLines - lines, totalBlocks - blocks, betweenChildren);
|
|
146
|
+
let linesBefore = 0;
|
|
147
|
+
let blocksBefore = 0;
|
|
148
|
+
units.forEach((u, i) => {
|
|
149
|
+
let next;
|
|
150
|
+
if (u.kind === 'block') {
|
|
151
|
+
const c = u.block;
|
|
152
|
+
const k = (c.contentIndex ?? L.childBase) - L.childBase;
|
|
153
|
+
next = k + 1;
|
|
154
|
+
if (!indivisible(c) && c.lines.length > 1) {
|
|
155
|
+
// The first laid-out child of a continuation opens after
|
|
156
|
+
// `from.line` lines: cuts inside it are counted from the
|
|
157
|
+
// child's own head. Each side of the box still counts all its
|
|
158
|
+
// lines against `min`, and a cut inside a child leaves at least
|
|
159
|
+
// `layout.boxChildSplitMinLines` lines of it on each side (2 by
|
|
160
|
+
// default, so no lone line: EF-115), or `min` when that is
|
|
161
|
+
// lower. The count is of this fragment's part of the child,
|
|
162
|
+
// since a part left behind already passed the test.
|
|
163
|
+
const childMin = Math.min(min, pass.resolved.layout.boxChildSplitMinLines);
|
|
164
|
+
const lineBase = k === from.child ? from.line : 0;
|
|
165
|
+
for (let l = childMin; l <= c.lines.length - childMin; l++) {
|
|
166
|
+
const line = c.lines[l - 1];
|
|
167
|
+
if (bothHold(linesBefore + l, blocksBefore, false)) {
|
|
168
|
+
candidates.push({
|
|
169
|
+
cut: { child: k, line: lineBase + l, widths: k === from.child ? cutWidths(from, width) : [{ fromLine: 0, width }] },
|
|
170
|
+
bottom: line.bbox.y + line.bbox.height + below,
|
|
171
|
+
...(c.lines[l]?.codeLine?.continued ? { soft: true } : {}),
|
|
172
|
+
});
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
else {
|
|
178
|
+
const { box } = u;
|
|
179
|
+
if (box.endIdx !== undefined)
|
|
180
|
+
next = box.endIdx + 1 - L.childBase;
|
|
181
|
+
if (!box.style.keepTogether || tallerThanColumn(pass, box.result)) {
|
|
182
|
+
collect(box.result.units, box.style.splitMinLines, below + tailOf(box.result));
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
linesBefore += lineCount(u);
|
|
186
|
+
if (isBlock(u))
|
|
187
|
+
blocksBefore++;
|
|
188
|
+
if (i < units.length - 1 && next !== undefined && bothHold(linesBefore, blocksBefore, true)) {
|
|
189
|
+
candidates.push({ cut: { child: next, line: 0 }, bottom: unitBottom(u) + below });
|
|
190
|
+
}
|
|
191
|
+
});
|
|
192
|
+
};
|
|
193
|
+
collect(full.units, minLines, 0);
|
|
194
|
+
// Inside a `:::columns` group of the box (#634): the cut the group
|
|
195
|
+
// offers for the room, where each of its sub-columns (each stream, in
|
|
196
|
+
// a parallel group) ends when the galley fills them in turn; at least
|
|
197
|
+
// one stream goes on and one moves on. A group of a nested box is
|
|
198
|
+
// never cut, nor any group under 1.24's rules (`layout.flowColumns`).
|
|
199
|
+
if (pass.resolved.layout.flowColumns) {
|
|
200
|
+
const base = from.group ? from.group.open : from.child;
|
|
201
|
+
const childMin = Math.min(Math.max(1, minLines), pass.resolved.layout.boxChildSplitMinLines);
|
|
202
|
+
for (const g of full.groups ?? []) {
|
|
203
|
+
const h = roomPx - tail - g.top;
|
|
204
|
+
if (h <= 0.5)
|
|
205
|
+
continue;
|
|
206
|
+
const reopened = from.group?.open === g.open + base ? from.group : undefined;
|
|
207
|
+
const pos = [];
|
|
208
|
+
let moved = false;
|
|
209
|
+
let left = false;
|
|
210
|
+
let used = 0;
|
|
211
|
+
g.streams.forEach((items, s) => {
|
|
212
|
+
const end = { child: (g.ends[s] ?? g.close) + base, line: 0 };
|
|
213
|
+
if (items.length === 0) {
|
|
214
|
+
pos.push(end);
|
|
215
|
+
return;
|
|
216
|
+
}
|
|
217
|
+
const breaks = galleyBreaks(items, childMin);
|
|
218
|
+
const fill = fillGalley(items, breaks, g.flow === 'snake' ? g.columns : 1, h);
|
|
219
|
+
if (fill.end) {
|
|
220
|
+
moved = true;
|
|
221
|
+
used = Math.max(used, fill.used);
|
|
222
|
+
pos.push(end);
|
|
223
|
+
return;
|
|
224
|
+
}
|
|
225
|
+
left = true;
|
|
226
|
+
if (fill.cuts.length === 0) {
|
|
227
|
+
// This stream takes nothing in the fragment: it stays where it is.
|
|
228
|
+
pos.push(reopened?.pos[s] ?? { child: items[0].child + base, line: 0 });
|
|
229
|
+
return;
|
|
230
|
+
}
|
|
231
|
+
moved = true;
|
|
232
|
+
used = Math.max(used, fill.used);
|
|
233
|
+
const b = breaks[fill.cuts[fill.cuts.length - 1]];
|
|
234
|
+
const it = items[b.item];
|
|
235
|
+
if (b.line === 0) {
|
|
236
|
+
pos.push({ child: it.child + base, line: 0 });
|
|
237
|
+
return;
|
|
238
|
+
}
|
|
239
|
+
// The sub-column widths the paragraph's lines are set at.
|
|
240
|
+
const before = it.lineBase > 0 ? reopened?.pos[s]?.widths : undefined;
|
|
241
|
+
const lastW = before?.[before.length - 1];
|
|
242
|
+
const widths = !before || before.length === 0
|
|
243
|
+
? [{ fromLine: 0, width: g.columnWidth }]
|
|
244
|
+
: Math.abs(lastW.width - g.columnWidth) <= 0.5 ? before : [...before, { fromLine: it.lineBase, width: g.columnWidth }];
|
|
245
|
+
pos.push({ child: it.child + base, line: it.lineBase + b.line, widths });
|
|
246
|
+
});
|
|
247
|
+
if (!moved || !left)
|
|
248
|
+
continue;
|
|
249
|
+
candidates.push({
|
|
250
|
+
cut: { child: Math.min(...pos.map((p) => p.child)), line: 0, group: { open: g.open + base, pos } },
|
|
251
|
+
bottom: g.top + used,
|
|
252
|
+
});
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
const insideGroup = (cut) => !cut.group && L.groups.some(([gs, ge]) => (cut.line === 0 ? gs < cut.child && cut.child <= ge : gs < cut.child && cut.child < ge));
|
|
256
|
+
const viable = candidates
|
|
257
|
+
.filter((c) => !insideGroup(c.cut))
|
|
258
|
+
.sort((a, b) => b.bottom - a.bottom);
|
|
259
|
+
// A wrapped code line stays with its continuations when a cut
|
|
260
|
+
// elsewhere fits (#624).
|
|
261
|
+
viable.sort((a, b) => (a.soft ? 1 : 0) - (b.soft ? 1 : 0));
|
|
262
|
+
for (const c of viable) {
|
|
263
|
+
if (c.bottom + tail > roomPx + 0.01)
|
|
264
|
+
continue;
|
|
265
|
+
const result = L.layoutRange(from, c.cut, width, frameId, continuation, mirrored, frame);
|
|
266
|
+
if (result.totalHeight <= roomPx + 0.01)
|
|
267
|
+
return { to: c.cut, result };
|
|
268
|
+
}
|
|
269
|
+
return null;
|
|
270
|
+
};
|
|
271
|
+
/** Absolute content indices of the children a fragment from cut `from`
|
|
272
|
+
* to cut `to` of `L` touches, for the fragment's source range. */
|
|
273
|
+
export const fragmentRange = (L, from, to) => ({ firstChildIdx: L.childBase + from.child, lastChildIdx: L.childBase + (to.line > 0 ? to.child : to.child - 1) });
|
|
274
|
+
/** The (rest of the) box is taller than an empty, full-height column —
|
|
275
|
+
* a whole page's content area for a page-span box: no column could
|
|
276
|
+
* hold it, so even a keep-together box splits (with the rules of a
|
|
277
|
+
* `keepTogether: false` one) rather than overflow. */
|
|
278
|
+
export const tallerThanColumn = (pass, result) => result.totalHeight > pass.columnHeight() + 0.01;
|
|
279
|
+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C,CAAkB,EAAE,IAAgB,EAAE,EAAc,EAAE,EAAE,CACpF,CAAC,EAAE,aAAa,EAAE,CAAC,CAAC,SAAS,GAAG,IAAI,CAAC,KAAK,EAAE,YAAY,EAAE,CAAC,CAAC,SAAS,GAAG,CAAC,EAAE,CAAC,IAAI,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC;AAErH;;;uDAGuD;AACvD,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,IAAqB,EAAE,MAA2B,EAAW,EAAE,CAC9F,MAAM,CAAC,WAAW,GAAG,IAAI,CAAC,YAAY,EAAE,GAAG,IAAI,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"headerFooter.d.ts","sourceRoot":"","sources":["../../src/pipeline/headerFooter.ts"],"names":[],"mappings":"AAGA,OAAO,EAA2B,KAAK,eAAe,EAAE,MAAM,eAAe,CAAC;AAG9E,OAAO,KAAK,EAAE,iBAAiB,EAAE,UAAU,
|
|
1
|
+
{"version":3,"file":"headerFooter.d.ts","sourceRoot":"","sources":["../../src/pipeline/headerFooter.ts"],"names":[],"mappings":"AAGA,OAAO,EAA2B,KAAK,eAAe,EAAE,MAAM,eAAe,CAAC;AAG9E,OAAO,KAAK,EAAE,iBAAiB,EAAE,UAAU,EAA+B,gBAAgB,EAAE,QAAQ,EAAE,kBAAkB,EAA6B,0BAA0B,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAC7M,OAAO,EAML,KAAK,WAAW,EAChB,KAAK,aAAa,EAClB,KAAK,cAAc,EAKnB,KAAK,iBAAiB,EAEvB,MAAM,QAAQ,CAAC;AAChB,OAAO,EAAsN,KAAK,UAAU,EAAkB,MAAM,gBAAgB,CAAC;AAWrR,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAIL,KAAK,YAAY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EAAE,MAAM,CAAC;QAAC,UAAU,CAAC,EAAE,MAAM,CAAA;KAAE,EAAE,CAAA;CAAE,EACxD,QAAQ,EAAE,SAAS,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,SAAS,CAAC,EAAE,EACzD,SAAS,EAAE,UAAU,EACrB,WAAW,EAAE,SAAS,iBAAiB,EAAE,GAAG,SAAS,GACpD,IAAI,CAaN"}
|
|
@@ -11,7 +11,9 @@ import { arabicNumbersOf, resolvedLocale } from './config';
|
|
|
11
11
|
import { classifyPages } from './pageRoles';
|
|
12
12
|
import { computeSectionStyles, createHeadingLevelResolver, headingIsHidden } from './headingStyles';
|
|
13
13
|
import { dimensionToPx } from '../units';
|
|
14
|
-
import { resolveDesignLineHeight } from '../defaults/headerFooter';
|
|
14
|
+
import { resolveDesignLineHeight, resolveDesignSlot } from '../defaults/headerFooter';
|
|
15
|
+
import { resolvePageTemplate } from '../composed/templates';
|
|
16
|
+
import { splitSpreadDecoration } from '../composed/spread';
|
|
15
17
|
import { layoutDesignSlot, textVerticalOffset, trailingTracking, } from '../design/layout';
|
|
16
18
|
import { resolveDesignText } from '../design/placeholders';
|
|
17
19
|
import { plainDesignText } from '../design/richText';
|
|
@@ -932,6 +934,8 @@ function layoutHeadersAndFooters(doc, resourceById, inputs) {
|
|
|
932
934
|
// And the paper: a page whose overrides change the entry the page colour
|
|
933
935
|
// links to paints that colour instead.
|
|
934
936
|
stampPageBackgrounds(doc, partPaletteByPageIndex, resolved.page.backgroundColor, resolved.colorPalette);
|
|
937
|
+
/** Pages of a spread whose decoration is laid (#861). */
|
|
938
|
+
const spreadDecorated = new Set();
|
|
935
939
|
for (const page of doc.pages) {
|
|
936
940
|
// Text in the flow (openers, part pages, in-column designs) reads as the
|
|
937
941
|
// page's flow does; running heads and folios are horizontal on the
|
|
@@ -964,14 +968,22 @@ function layoutHeadersAndFooters(doc, resourceById, inputs) {
|
|
|
964
968
|
: { x: trim.x, y: sheetArea.y, width: Math.max(0, sheetArea.x - trim.x), height: sheetArea.height };
|
|
965
969
|
const sheetExtras = { ...extras, frames: { ...physicalFrames, outer }, mirrored: false };
|
|
966
970
|
const section = sectionByPage[page.index];
|
|
967
|
-
|
|
968
|
-
|
|
971
|
+
// A composed page (#855) takes its template's running heads: a slot of
|
|
972
|
+
// its own, `false` for none, unset for the section's.
|
|
973
|
+
const template = page.composed
|
|
974
|
+
? resolvePageTemplate({ pageTemplates: resolved.pageTemplates, calloutStyles: resolved.calloutStyles }, page.composed.template, { parity: recto ? 'recto' : 'verso' })
|
|
975
|
+
: undefined;
|
|
976
|
+
const pageAttrs = page.composed && Object.keys(page.composed.attrs).length > 0 ? page.composed.attrs : undefined;
|
|
977
|
+
const templateSlot = (own, kind, inherited) => own === false ? { elements: [] } : own ? resolveDesignSlot(own, kind) : inherited;
|
|
978
|
+
const headerSlot = templateSlot(template?.header, 'header', section?.header ?? resolved.header);
|
|
979
|
+
const footerSlot = templateSlot(template?.footer, 'footer', section?.footer ?? resolved.footer);
|
|
969
980
|
// A comic page is all panels: no running heads or folio unless
|
|
970
981
|
// `comics.runningHeads` asks for them (its folio still counts).
|
|
971
982
|
const furniture = !page.comic || resolvedComics(resolved).runningHeads;
|
|
972
983
|
if (furniture && headerSlot.elements.length > 0) {
|
|
973
984
|
const placeholders = {
|
|
974
985
|
kind: 'header',
|
|
986
|
+
...(pageAttrs ? { pageAttrs } : {}),
|
|
975
987
|
page,
|
|
976
988
|
allPages: doc.pages,
|
|
977
989
|
metadata: doc.metadata,
|
|
@@ -1132,6 +1144,8 @@ function layoutHeadersAndFooters(doc, resourceById, inputs) {
|
|
|
1132
1144
|
const palette = { ...(partPaletteByPageIndex[page.index] ?? {}), ...(tp.palette ?? {}) };
|
|
1133
1145
|
const placeholders = {
|
|
1134
1146
|
kind: 'part',
|
|
1147
|
+
// `{leader}` fills the row with the contents' leader (#889).
|
|
1148
|
+
leader: { enabled: resolved.toc.leader.enabled, char: resolved.toc.leader.char, gap: resolved.toc.leader.gap },
|
|
1135
1149
|
page: rowPage,
|
|
1136
1150
|
allPages: doc.pages,
|
|
1137
1151
|
metadata: doc.metadata,
|
|
@@ -1219,6 +1233,7 @@ function layoutHeadersAndFooters(doc, resourceById, inputs) {
|
|
|
1219
1233
|
if (furniture && footerSlot.elements.length > 0) {
|
|
1220
1234
|
const placeholders = {
|
|
1221
1235
|
kind: 'footer',
|
|
1236
|
+
...(pageAttrs ? { pageAttrs } : {}),
|
|
1222
1237
|
page,
|
|
1223
1238
|
allPages: doc.pages,
|
|
1224
1239
|
metadata: doc.metadata,
|
|
@@ -1236,6 +1251,84 @@ function layoutHeadersAndFooters(doc, resourceById, inputs) {
|
|
|
1236
1251
|
};
|
|
1237
1252
|
page.footer = asFurniture(withMeasureWritingMode('horizontal-tb', () => layoutSlotToVdt(footerSlot, footerContainerBbox(sheetArea, metrics.physical.trimBox), page.index + pageIndexOffset, placeholders, dpi, { ...sheetExtras, slot: 'footer' })));
|
|
1238
1253
|
}
|
|
1254
|
+
// The template's decoration, laid with the frames' final boxes (its
|
|
1255
|
+
// elements may anchor to `'#frame'`), on the sheet like the running
|
|
1256
|
+
// heads; painted under the frames of layer 1 and up. A spread's (#861)
|
|
1257
|
+
// is laid once, on the sheet of its two pages, when its first page
|
|
1258
|
+
// comes, and cut for each page.
|
|
1259
|
+
const facing = page.composed?.facingPage !== undefined ? doc.pages[page.composed.facingPage] : undefined;
|
|
1260
|
+
if (page.composed && template && template.decoration.elements.length > 0 && !(facing && spreadDecorated.has(page.index))) {
|
|
1261
|
+
const pair = facing?.composed?.spread && page.composed.spread ? { left: page.composed.spread === 'left' ? page : facing, right: page.composed.spread === 'left' ? facing : page } : undefined;
|
|
1262
|
+
const trimBox = metrics.physical.trimBox;
|
|
1263
|
+
const bleedBox = metrics.physical.bleedBox;
|
|
1264
|
+
const shift = trimBox.width;
|
|
1265
|
+
/** A frame's box on the sheet (of the spread, the right page's set
|
|
1266
|
+
* `shift` along). */
|
|
1267
|
+
const named = {};
|
|
1268
|
+
/** And the box its template gave it, before groups moved it
|
|
1269
|
+
* (`declaredRect`: what a `pin`ned element keeps to). */
|
|
1270
|
+
const declared = {};
|
|
1271
|
+
const nameFrames = (p, dx) => {
|
|
1272
|
+
for (const f of p.composed?.frames ?? []) {
|
|
1273
|
+
if (f.facingBlocks)
|
|
1274
|
+
continue;
|
|
1275
|
+
const r = flowRectToPage(p, f.rect);
|
|
1276
|
+
const d = flowRectToPage(p, f.declaredRect ?? f.rect);
|
|
1277
|
+
named[f.name] = { ...r, x: r.x + dx };
|
|
1278
|
+
declared[f.name] = { ...d, x: d.x + dx };
|
|
1279
|
+
}
|
|
1280
|
+
};
|
|
1281
|
+
let container;
|
|
1282
|
+
let slotFrames = physicalFrames;
|
|
1283
|
+
if (pair) {
|
|
1284
|
+
nameFrames(pair.left, 0);
|
|
1285
|
+
nameFrames(pair.right, shift);
|
|
1286
|
+
const spreadTrim = { ...trimBox, width: shift + trimBox.width };
|
|
1287
|
+
const spreadBleed = { ...bleedBox, width: shift + bleedBox.width };
|
|
1288
|
+
const l = flowRectToPage(pair.left, pair.left.contentArea);
|
|
1289
|
+
const r = flowRectToPage(pair.right, pair.right.contentArea);
|
|
1290
|
+
const cx = Math.min(l.x, r.x + shift);
|
|
1291
|
+
const cy = Math.min(l.y, r.y);
|
|
1292
|
+
const content = { x: cx, y: cy, width: Math.max(l.x + l.width, r.x + shift + r.width) - cx, height: Math.max(l.y + l.height, r.y + r.height) - cy };
|
|
1293
|
+
container = template.area === 'trim' ? spreadTrim : template.area === 'bleed' ? spreadBleed : content;
|
|
1294
|
+
slotFrames = { page: spreadTrim, bleed: spreadBleed };
|
|
1295
|
+
}
|
|
1296
|
+
else {
|
|
1297
|
+
nameFrames(page, 0);
|
|
1298
|
+
container = template.area === 'trim' ? trimBox : template.area === 'bleed' ? bleedBox : sheetArea;
|
|
1299
|
+
}
|
|
1300
|
+
const attrSources = {};
|
|
1301
|
+
for (const [k, v] of Object.entries(page.composed.attrSources))
|
|
1302
|
+
attrSources[k] = { start: v.sourceStart, end: v.sourceEnd };
|
|
1303
|
+
const placeholders = {
|
|
1304
|
+
kind: 'composed',
|
|
1305
|
+
...(pageAttrs ? { pageAttrs } : {}),
|
|
1306
|
+
page,
|
|
1307
|
+
allPages: doc.pages,
|
|
1308
|
+
metadata: doc.metadata,
|
|
1309
|
+
chapterTitleByPageIndex,
|
|
1310
|
+
chapterTitleAtTopByPageIndex,
|
|
1311
|
+
chapterNumberAtTopByPageIndex,
|
|
1312
|
+
chapterNumberByPageIndex,
|
|
1313
|
+
chapterAttrsByPageIndex,
|
|
1314
|
+
bookTotalPages,
|
|
1315
|
+
numerals,
|
|
1316
|
+
marksFor,
|
|
1317
|
+
partTitleByPageIndex,
|
|
1318
|
+
partNumberByPageIndex,
|
|
1319
|
+
partPaletteByPageIndex,
|
|
1320
|
+
};
|
|
1321
|
+
const decoration = withMeasureWritingMode('horizontal-tb', () => layoutSlotToVdt(resolveDesignSlot(template.decoration, 'header'), container, page.index + pageIndexOffset, placeholders, dpi, { ...sheetExtras, frames: { ...slotFrames, named, declared }, attrs: page.composed.attrs, attrSources }));
|
|
1322
|
+
if (decoration && pair) {
|
|
1323
|
+
const halves = splitSpreadDecoration(decoration, shift, { left: bleedBox, right: { ...bleedBox, x: bleedBox.x + shift } });
|
|
1324
|
+
pair.left.composed.decoration = halves.left;
|
|
1325
|
+
pair.right.composed.decoration = halves.right;
|
|
1326
|
+
spreadDecorated.add(pair.left.index);
|
|
1327
|
+
spreadDecorated.add(pair.right.index);
|
|
1328
|
+
}
|
|
1329
|
+
else if (decoration)
|
|
1330
|
+
page.composed.decoration = decoration;
|
|
1331
|
+
}
|
|
1239
1332
|
}
|
|
1240
1333
|
}
|
|
1241
1334
|
/** Set `page.background` on the pages whose palette overrides (part and
|