postext 1.40.0 → 1.42.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__/bundleFontFallback.test.d.ts +2 -0
- package/dist/__tests__/bundleFontFallback.test.d.ts.map +1 -0
- package/dist/__tests__/bundleFontFallback.test.js +127 -0
- package/dist/__tests__/bundleFontFallback.test.js.map +1 -0
- package/dist/__tests__/calloutBodyLetterSpacing.test.d.ts +2 -0
- package/dist/__tests__/calloutBodyLetterSpacing.test.d.ts.map +1 -0
- package/dist/__tests__/calloutBodyLetterSpacing.test.js +83 -0
- package/dist/__tests__/calloutBodyLetterSpacing.test.js.map +1 -0
- package/dist/__tests__/composed/autoWidth.test.d.ts +2 -0
- package/dist/__tests__/composed/autoWidth.test.d.ts.map +1 -0
- package/dist/__tests__/composed/autoWidth.test.js +82 -0
- package/dist/__tests__/composed/autoWidth.test.js.map +1 -0
- package/dist/__tests__/composed/crossChapterJumps.test.d.ts +2 -0
- package/dist/__tests__/composed/crossChapterJumps.test.d.ts.map +1 -0
- package/dist/__tests__/composed/crossChapterJumps.test.js +299 -0
- package/dist/__tests__/composed/crossChapterJumps.test.js.map +1 -0
- package/dist/__tests__/composed/crossChapterOutline.test.d.ts +2 -0
- package/dist/__tests__/composed/crossChapterOutline.test.d.ts.map +1 -0
- package/dist/__tests__/composed/crossChapterOutline.test.js +156 -0
- package/dist/__tests__/composed/crossChapterOutline.test.js.map +1 -0
- package/dist/__tests__/composed/decorationRemove.test.d.ts +2 -0
- package/dist/__tests__/composed/decorationRemove.test.d.ts.map +1 -0
- package/dist/__tests__/composed/decorationRemove.test.js +69 -0
- package/dist/__tests__/composed/decorationRemove.test.js.map +1 -0
- package/dist/__tests__/composed/figureWords.test.js +25 -0
- package/dist/__tests__/composed/figureWords.test.js.map +1 -1
- package/dist/__tests__/composed/footHold.test.d.ts +2 -0
- package/dist/__tests__/composed/footHold.test.d.ts.map +1 -0
- package/dist/__tests__/composed/footHold.test.js +83 -0
- package/dist/__tests__/composed/footHold.test.js.map +1 -0
- package/dist/__tests__/composed/frameLook.test.d.ts +2 -0
- package/dist/__tests__/composed/frameLook.test.d.ts.map +1 -0
- package/dist/__tests__/composed/frameLook.test.js +120 -0
- package/dist/__tests__/composed/frameLook.test.js.map +1 -0
- package/dist/__tests__/composed/framePictures.test.js +58 -0
- package/dist/__tests__/composed/framePictures.test.js.map +1 -1
- package/dist/__tests__/composed/headingBadge.test.d.ts +2 -0
- package/dist/__tests__/composed/headingBadge.test.d.ts.map +1 -0
- package/dist/__tests__/composed/headingBadge.test.js +91 -0
- package/dist/__tests__/composed/headingBadge.test.js.map +1 -0
- package/dist/__tests__/composed/labels.test.js +3 -0
- package/dist/__tests__/composed/labels.test.js.map +1 -1
- package/dist/__tests__/composed/labelsChecks.test.js +69 -0
- package/dist/__tests__/composed/labelsChecks.test.js.map +1 -1
- package/dist/__tests__/composed/labelsMirrored.test.js +33 -0
- package/dist/__tests__/composed/labelsMirrored.test.js.map +1 -1
- package/dist/__tests__/composed/layoutMemo.test.d.ts +2 -0
- package/dist/__tests__/composed/layoutMemo.test.d.ts.map +1 -0
- package/dist/__tests__/composed/layoutMemo.test.js +150 -0
- package/dist/__tests__/composed/layoutMemo.test.js.map +1 -0
- package/dist/__tests__/composed/tocFrame.test.d.ts +2 -0
- package/dist/__tests__/composed/tocFrame.test.d.ts.map +1 -0
- package/dist/__tests__/composed/tocFrame.test.js +167 -0
- package/dist/__tests__/composed/tocFrame.test.js.map +1 -0
- package/dist/__tests__/exports.test.js +9 -0
- package/dist/__tests__/exports.test.js.map +1 -1
- package/dist/__tests__/pipeline/calloutLabelIcon.test.d.ts +2 -0
- package/dist/__tests__/pipeline/calloutLabelIcon.test.d.ts.map +1 -0
- package/dist/__tests__/pipeline/calloutLabelIcon.test.js +107 -0
- package/dist/__tests__/pipeline/calloutLabelIcon.test.js.map +1 -0
- package/dist/bundle/adapters.d.ts +18 -4
- package/dist/bundle/adapters.d.ts.map +1 -1
- package/dist/bundle/adapters.js +61 -13
- package/dist/bundle/adapters.js.map +1 -1
- package/dist/bundle/book.d.ts +5 -0
- package/dist/bundle/book.d.ts.map +1 -1
- package/dist/bundle/book.js +59 -8
- package/dist/bundle/book.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 +34 -7
- 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/layoutCache.d.ts +9 -0
- package/dist/bundle/layoutCache.d.ts.map +1 -1
- package/dist/bundle/layoutCache.js.map +1 -1
- package/dist/bundle/manifest.d.ts.map +1 -1
- package/dist/bundle/manifest.js +15 -2
- package/dist/bundle/manifest.js.map +1 -1
- package/dist/bundle/types.d.ts +6 -0
- package/dist/bundle/types.d.ts.map +1 -1
- package/dist/composed/carry.d.ts +55 -0
- package/dist/composed/carry.d.ts.map +1 -0
- package/dist/composed/carry.js +114 -0
- package/dist/composed/carry.js.map +1 -0
- package/dist/composed/carryTypes.d.ts +76 -0
- package/dist/composed/carryTypes.d.ts.map +1 -0
- package/dist/composed/carryTypes.js +2 -0
- package/dist/composed/carryTypes.js.map +1 -0
- package/dist/composed/continuation.d.ts +8 -0
- package/dist/composed/continuation.d.ts.map +1 -1
- package/dist/composed/continuation.js.map +1 -1
- package/dist/composed/document.d.ts +11 -0
- package/dist/composed/document.d.ts.map +1 -1
- package/dist/composed/document.js +24 -0
- package/dist/composed/document.js.map +1 -1
- package/dist/composed/geometry.d.ts +5 -1
- package/dist/composed/geometry.d.ts.map +1 -1
- package/dist/composed/geometry.js +14 -4
- package/dist/composed/geometry.js.map +1 -1
- package/dist/composed/labels.d.ts +23 -2
- package/dist/composed/labels.d.ts.map +1 -1
- package/dist/composed/labels.js +116 -5
- package/dist/composed/labels.js.map +1 -1
- package/dist/composed/slotChecks.d.ts +1 -1
- package/dist/composed/slotChecks.d.ts.map +1 -1
- package/dist/composed/slotChecks.js +5 -6
- package/dist/composed/slotChecks.js.map +1 -1
- package/dist/composed/sourceMap.d.ts +16 -0
- package/dist/composed/sourceMap.d.ts.map +1 -1
- package/dist/composed/sourceMap.js +54 -10
- package/dist/composed/sourceMap.js.map +1 -1
- package/dist/composed/templates.d.ts +38 -1
- package/dist/composed/templates.d.ts.map +1 -1
- package/dist/composed/templates.js +68 -1
- package/dist/composed/templates.js.map +1 -1
- package/dist/composed/types.d.ts +73 -6
- package/dist/composed/types.d.ts.map +1 -1
- package/dist/composed/validate.d.ts.map +1 -1
- package/dist/composed/validate.js +20 -3
- package/dist/composed/validate.js.map +1 -1
- package/dist/composed/wrap.d.ts.map +1 -1
- package/dist/composed/wrap.js +4 -4
- package/dist/composed/wrap.js.map +1 -1
- package/dist/defaults/calloutStyles.d.ts +1 -0
- package/dist/defaults/calloutStyles.d.ts.map +1 -1
- package/dist/defaults/calloutStyles.js +6 -1
- package/dist/defaults/calloutStyles.js.map +1 -1
- package/dist/design/placeholders.d.ts +5 -0
- package/dist/design/placeholders.d.ts.map +1 -1
- package/dist/design/placeholders.js +9 -2
- package/dist/design/placeholders.js.map +1 -1
- package/dist/fonts/fallback.d.ts +26 -0
- package/dist/fonts/fallback.d.ts.map +1 -0
- package/dist/fonts/fallback.js +43 -0
- package/dist/fonts/fallback.js.map +1 -0
- package/dist/index.d.ts +8 -5
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -2
- package/dist/index.js.map +1 -1
- package/dist/pipeline/anchors.d.ts.map +1 -1
- package/dist/pipeline/anchors.js +15 -1
- package/dist/pipeline/anchors.js.map +1 -1
- package/dist/pipeline/build.d.ts +12 -0
- package/dist/pipeline/build.d.ts.map +1 -1
- package/dist/pipeline/build.js +258 -30
- package/dist/pipeline/build.js.map +1 -1
- package/dist/pipeline/buildHelpers.d.ts +2 -0
- package/dist/pipeline/buildHelpers.d.ts.map +1 -1
- package/dist/pipeline/buildHelpers.js +6 -0
- package/dist/pipeline/buildHelpers.js.map +1 -1
- package/dist/pipeline/calloutLayout.d.ts +4 -17
- package/dist/pipeline/calloutLayout.d.ts.map +1 -1
- package/dist/pipeline/calloutLayout.js +44 -17
- package/dist/pipeline/calloutLayout.js.map +1 -1
- package/dist/pipeline/carriedOutline.d.ts +45 -0
- package/dist/pipeline/carriedOutline.d.ts.map +1 -0
- package/dist/pipeline/carriedOutline.js +158 -0
- package/dist/pipeline/carriedOutline.js.map +1 -0
- package/dist/pipeline/composedLayout.d.ts +20 -1
- package/dist/pipeline/composedLayout.d.ts.map +1 -1
- package/dist/pipeline/composedLayout.js +202 -19
- package/dist/pipeline/composedLayout.js.map +1 -1
- package/dist/pipeline/contentWarnings.d.ts.map +1 -1
- package/dist/pipeline/contentWarnings.js +17 -4
- package/dist/pipeline/contentWarnings.js.map +1 -1
- package/dist/pipeline/continuation.d.ts +11 -0
- package/dist/pipeline/continuation.d.ts.map +1 -1
- package/dist/pipeline/continuation.js +36 -0
- package/dist/pipeline/continuation.js.map +1 -1
- package/dist/pipeline/cutTypes.d.ts +42 -0
- package/dist/pipeline/cutTypes.d.ts.map +1 -0
- package/dist/pipeline/cutTypes.js +6 -0
- package/dist/pipeline/cutTypes.js.map +1 -0
- package/dist/pipeline/figureWords.d.ts +18 -1
- package/dist/pipeline/figureWords.d.ts.map +1 -1
- package/dist/pipeline/figureWords.js +28 -0
- package/dist/pipeline/figureWords.js.map +1 -1
- package/dist/pipeline/frameLayout.d.ts +11 -21
- package/dist/pipeline/frameLayout.d.ts.map +1 -1
- package/dist/pipeline/frameLayout.js +74 -7
- package/dist/pipeline/frameLayout.js.map +1 -1
- package/dist/pipeline/headerFooter.d.ts.map +1 -1
- package/dist/pipeline/headerFooter.js +96 -41
- package/dist/pipeline/headerFooter.js.map +1 -1
- package/dist/pipeline/index.d.ts +4 -1
- package/dist/pipeline/index.d.ts.map +1 -1
- package/dist/pipeline/index.js +3 -1
- package/dist/pipeline/index.js.map +1 -1
- package/dist/pipeline/indexDirective.d.ts.map +1 -1
- package/dist/pipeline/indexDirective.js +3 -1
- package/dist/pipeline/indexDirective.js.map +1 -1
- package/dist/pipeline/layoutMemo.d.ts +72 -0
- package/dist/pipeline/layoutMemo.d.ts.map +1 -0
- package/dist/pipeline/layoutMemo.js +160 -0
- package/dist/pipeline/layoutMemo.js.map +1 -0
- package/dist/pipeline/measureMemo.d.ts +8 -0
- package/dist/pipeline/measureMemo.d.ts.map +1 -1
- package/dist/pipeline/measureMemo.js +6 -2
- package/dist/pipeline/measureMemo.js.map +1 -1
- package/dist/pipeline/outline.d.ts.map +1 -1
- package/dist/pipeline/outline.js +31 -2
- package/dist/pipeline/outline.js.map +1 -1
- package/dist/pipeline/placeholders.d.ts +13 -0
- package/dist/pipeline/placeholders.d.ts.map +1 -1
- package/dist/pipeline/placeholders.js +20 -1
- package/dist/pipeline/placeholders.js.map +1 -1
- package/dist/pipeline/styles.d.ts.map +1 -1
- package/dist/pipeline/styles.js +3 -1
- package/dist/pipeline/styles.js.map +1 -1
- package/dist/pipeline/toc.d.ts +7 -0
- package/dist/pipeline/toc.d.ts.map +1 -1
- package/dist/pipeline/toc.js +24 -0
- package/dist/pipeline/toc.js.map +1 -1
- package/dist/types.d.ts +57 -3
- package/dist/types.d.ts.map +1 -1
- package/dist/vdt.d.ts +79 -1
- package/dist/vdt.d.ts.map +1 -1
- package/dist/vdt.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Index marks, anchors and headings written in the part of a story that
|
|
3
|
+
* went on in a page of another chapter (#988, DESIGN §5.17, §5.18).
|
|
4
|
+
*
|
|
5
|
+
* The chapter that sent the story cannot place them: the words are laid by
|
|
6
|
+
* the chapter that has the page, so the sender's own location finds no line
|
|
7
|
+
* for them and falls back on the page where the story starts. The receiving
|
|
8
|
+
* chapter knows the page and reports it ({@link locateCarriedOutline},
|
|
9
|
+
* `VDTDocument.carriedOutline`); a host with every chapter's outline puts
|
|
10
|
+
* the pages into the sender's entries ({@link mergeCarriedOutline}), keyed
|
|
11
|
+
* by the sending chapter and the offset in its body.
|
|
12
|
+
*/
|
|
13
|
+
/** The line of the character at `at` among `lines` (sorted by start): the
|
|
14
|
+
* first page's line holding it; else the line before it
|
|
15
|
+
* (`attach: 'before'`) or after it, as long as that lies within the span
|
|
16
|
+
* the lines cover. */
|
|
17
|
+
function lineAt(lines, at, attach) {
|
|
18
|
+
let lo = 0;
|
|
19
|
+
let hi = lines.length;
|
|
20
|
+
while (lo < hi) {
|
|
21
|
+
const mid = (lo + hi) >> 1;
|
|
22
|
+
if (lines[mid].start <= at)
|
|
23
|
+
lo = mid + 1;
|
|
24
|
+
else
|
|
25
|
+
hi = mid;
|
|
26
|
+
}
|
|
27
|
+
const i = lo - 1;
|
|
28
|
+
let found;
|
|
29
|
+
for (let j = i; j >= 0 && j > i - 64; j--) {
|
|
30
|
+
const l = lines[j];
|
|
31
|
+
if (at >= l.start && at < l.end && (found === undefined || l.page < found.page))
|
|
32
|
+
found = l;
|
|
33
|
+
}
|
|
34
|
+
if (found)
|
|
35
|
+
return found;
|
|
36
|
+
// Outside what this chapter laid: the mark is the sender's, not ours.
|
|
37
|
+
if (i < 0 || at > lines[lines.length - 1].end)
|
|
38
|
+
return undefined;
|
|
39
|
+
return attach === 'before' ? lines[i] : lines[i + 1] ?? lines[i];
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* What the stories carried into `doc` hold: each index mark, inline anchor
|
|
43
|
+
* and heading of a story that this chapter laid (the part the sender did
|
|
44
|
+
* not), with the page it landed on here. `baseLength` is where the carried
|
|
45
|
+
* blocks start among the chapter's content blocks, `bodyOffset` this
|
|
46
|
+
* chapter's own.
|
|
47
|
+
*/
|
|
48
|
+
export function locateCarriedOutline(doc, carried, bodyOffset) {
|
|
49
|
+
const out = [];
|
|
50
|
+
const known = new Set(doc.blocks);
|
|
51
|
+
const placed = doc.blocks.filter((b) => b.pageIndex >= 0);
|
|
52
|
+
for (const page of doc.pages)
|
|
53
|
+
for (const f of page.floats ?? [])
|
|
54
|
+
if (f.pageIndex >= 0 && !known.has(f))
|
|
55
|
+
placed.push(f);
|
|
56
|
+
for (const story of carried.stories.values()) {
|
|
57
|
+
const blocks = carried.blocks.slice(story.startIdx - carried.baseLength, story.endIdx - carried.baseLength + 1);
|
|
58
|
+
// The story's own lines: offsets in the sending chapter's file.
|
|
59
|
+
const lines = [];
|
|
60
|
+
const headingAt = new Map();
|
|
61
|
+
for (const b of placed) {
|
|
62
|
+
if (b.contentIndex === undefined || b.contentIndex < story.startIdx || b.contentIndex > story.endIdx)
|
|
63
|
+
continue;
|
|
64
|
+
if (b.type === 'heading' && !headingAt.has(b.contentIndex))
|
|
65
|
+
headingAt.set(b.contentIndex, { page: b.pageIndex, x: b.bbox.x, y: b.bbox.y });
|
|
66
|
+
if (b.hidden)
|
|
67
|
+
continue;
|
|
68
|
+
for (const l of b.lines) {
|
|
69
|
+
if (l.sourceStart !== undefined && l.sourceEnd !== undefined)
|
|
70
|
+
lines.push({ start: l.sourceStart, end: l.sourceEnd, page: b.pageIndex, x: l.bbox.x, y: l.bbox.y });
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
lines.sort((a, b) => a.start - b.start || a.page - b.page);
|
|
74
|
+
const jump = story.jump;
|
|
75
|
+
// `sourceStart` of a carried block is its sender's plus this much.
|
|
76
|
+
const delta = jump.bodyOffset - bodyOffset;
|
|
77
|
+
const chapter = story.chapter;
|
|
78
|
+
blocks.forEach((block, k) => {
|
|
79
|
+
if (block.type === 'heading') {
|
|
80
|
+
const at = headingAt.get(story.startIdx + k);
|
|
81
|
+
const id = block.attrs?.id;
|
|
82
|
+
if (at) {
|
|
83
|
+
out.push({
|
|
84
|
+
chapter,
|
|
85
|
+
kind: 'heading',
|
|
86
|
+
sourceStart: block.sourceStart - delta,
|
|
87
|
+
pageIndex: at.page,
|
|
88
|
+
...(id !== undefined && id.length > 0 ? { anchor: { id, x: at.x, y: at.y } } : {}),
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
if (lines.length === 0)
|
|
93
|
+
return;
|
|
94
|
+
for (const m of block.indexMarks ?? []) {
|
|
95
|
+
if (m.anchor < 0)
|
|
96
|
+
continue;
|
|
97
|
+
const line = lineAt(lines, m.anchor + jump.bodyOffset, m.attach);
|
|
98
|
+
if (line)
|
|
99
|
+
out.push({ chapter, kind: 'indexMark', sourceStart: m.sourceStart - delta, pageIndex: line.page });
|
|
100
|
+
}
|
|
101
|
+
for (const m of block.anchorMarks ?? []) {
|
|
102
|
+
if (m.anchor < 0)
|
|
103
|
+
continue;
|
|
104
|
+
const line = lineAt(lines, m.anchor + jump.bodyOffset, m.attach);
|
|
105
|
+
if (line)
|
|
106
|
+
out.push({ chapter, kind: 'anchor', sourceStart: m.sourceStart - delta, pageIndex: line.page, anchor: { id: m.anchorId, x: line.x, y: line.y } });
|
|
107
|
+
}
|
|
108
|
+
});
|
|
109
|
+
}
|
|
110
|
+
return out;
|
|
111
|
+
}
|
|
112
|
+
/** `doc.carriedOutline` with the pages of the book. */
|
|
113
|
+
export function carriedPlaces(doc) {
|
|
114
|
+
const offset = doc.pageIndexOffset ?? 0;
|
|
115
|
+
const out = [];
|
|
116
|
+
for (const c of doc.carriedOutline ?? []) {
|
|
117
|
+
const page = doc.pages[c.pageIndex];
|
|
118
|
+
if (page)
|
|
119
|
+
out.push({ chapter: c.chapter, kind: c.kind, sourceStart: c.sourceStart, pageLabel: page.pageLabel, pageIndex: offset + page.index, pageFormat: page.pageNumberFormat });
|
|
120
|
+
}
|
|
121
|
+
return out;
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
* `outlines` (one array of entries per chapter, as `outlineFromDoc` gives
|
|
125
|
+
* them) with the pages the receiving chapters found for the index marks,
|
|
126
|
+
* anchors and headings of the stories they carry (`carriedPlaces`, one
|
|
127
|
+
* list per chapter) put into the sending chapter's entries. A chapter
|
|
128
|
+
* nothing was carried from keeps its array.
|
|
129
|
+
*/
|
|
130
|
+
export function mergeCarriedOutline(outlines, places) {
|
|
131
|
+
const out = outlines.slice();
|
|
132
|
+
const copied = new Set();
|
|
133
|
+
for (const list of places) {
|
|
134
|
+
for (const c of list ?? []) {
|
|
135
|
+
const entries = out[c.chapter];
|
|
136
|
+
if (!entries)
|
|
137
|
+
continue;
|
|
138
|
+
const at = entries.findIndex((e) => (c.kind === 'indexMark' ? e.kind === 'indexMark' && e.indexMark?.sourceStart === c.sourceStart
|
|
139
|
+
: c.kind === 'anchor' ? e.kind === 'anchor' && e.anchorSource === c.sourceStart
|
|
140
|
+
: e.kind === 'heading' && e.headingSource === c.sourceStart));
|
|
141
|
+
if (at < 0)
|
|
142
|
+
continue;
|
|
143
|
+
if (!copied.has(c.chapter)) {
|
|
144
|
+
out[c.chapter] = entries.slice();
|
|
145
|
+
copied.add(c.chapter);
|
|
146
|
+
}
|
|
147
|
+
const mutable = out[c.chapter];
|
|
148
|
+
mutable[at] = {
|
|
149
|
+
...mutable[at],
|
|
150
|
+
pageLabel: c.pageLabel,
|
|
151
|
+
pageIndex: c.pageIndex,
|
|
152
|
+
...(c.kind === 'indexMark' ? { pageFormat: c.pageFormat } : {}),
|
|
153
|
+
};
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
return out;
|
|
157
|
+
}
|
|
158
|
+
//# sourceMappingURL=carriedOutline.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"carriedOutline.js","sourceRoot":"","sources":["../../src/pipeline/carriedOutline.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAeH;;;uBAGuB;AACvB,SAAS,MAAM,CAAC,KAAsB,EAAE,EAAU,EAAE,MAAsC;IACxF,IAAI,EAAE,GAAG,CAAC,CAAC;IACX,IAAI,EAAE,GAAG,KAAK,CAAC,MAAM,CAAC;IACtB,OAAO,EAAE,GAAG,EAAE,EAAE,CAAC;QACf,MAAM,GAAG,GAAG,CAAC,EA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C"}
|
|
@@ -36,9 +36,10 @@ import { type ContentWarning, type VDTBlock, type VDTComposedPage, type VDTPage
|
|
|
36
36
|
import { dimensionToPx } from '../units';
|
|
37
37
|
import { type FrameAreas, type Rect } from '../composed/geometry';
|
|
38
38
|
import { type ComposedContinuation, type ComposedContinuationInput } from '../composed/continuation';
|
|
39
|
-
import type { ResolvedFrame, ResolvedPageTemplate } from '../composed/types';
|
|
39
|
+
import type { FrameLook, ResolvedFrame, ResolvedPageTemplate } from '../composed/types';
|
|
40
40
|
import { type PageTemplateSource } from '../composed/templates';
|
|
41
41
|
import { type BoxExclusion, type PlannedCallout } from './calloutLayout';
|
|
42
|
+
import type { ImportedJumps } from '../composed/carry';
|
|
42
43
|
import { type FrameLayoutPass } from './frameLayout';
|
|
43
44
|
/** A story of the page: the box `composed/wrap.ts` made of a chain's
|
|
44
45
|
* content, by the name of the chain's first frame. */
|
|
@@ -107,6 +108,17 @@ export interface ComposedPageLayout {
|
|
|
107
108
|
continuations?: ComposedContinuation[];
|
|
108
109
|
}
|
|
109
110
|
export declare function layoutComposedPage(given: ComposedPageInput): ComposedPageLayout;
|
|
111
|
+
/**
|
|
112
|
+
* The pass the stories carried in from other chapters (#943) are laid with:
|
|
113
|
+
* `base` with their blocks appended to its content, and every lookup the
|
|
114
|
+
* box typesetter keys by content index answered for them from what the
|
|
115
|
+
* sender gave (heading numbers) or worked out again from the carried
|
|
116
|
+
* blocks alone (paragraph groups, ordered-list markers). A carried story's
|
|
117
|
+
* box is set in the context of the text, with the list indents its sender
|
|
118
|
+
* set its lists with; the typography of a styled section or a part of this
|
|
119
|
+
* chapter does not reach it.
|
|
120
|
+
*/
|
|
121
|
+
export declare function carriedPass(base: FrameLayoutPass, carried: ImportedJumps): FrameLayoutPass;
|
|
110
122
|
/** A frame style whose box keeps its drawn size when the frame's text is
|
|
111
123
|
* set at `scale` (#858): the frame is laid out `1 / scale` as large and
|
|
112
124
|
* painted at `scale`, so its padding, border, corner radius, stripe and
|
|
@@ -119,6 +131,13 @@ export declare function keepChromeAt(style: ResolvedCalloutStyleConfig, scale: n
|
|
|
119
131
|
* (side by side) and a measure that is the frame's. A style's placement,
|
|
120
132
|
* span, width and margins do not apply to a frame. */
|
|
121
133
|
export declare function frameStyleOf(base: ResolvedCalloutStyleConfig, frame: ResolvedFrame): ResolvedCalloutStyleConfig;
|
|
134
|
+
/** `base` with what a frame's `look` sets (#976) written over it: colours
|
|
135
|
+
* of the fill, border, stripe, icon, marker, title, text and label tab,
|
|
136
|
+
* and the tracking of the body. A fill colour turns the fill on. A part
|
|
137
|
+
* the style does not have (a label tab it lacks) is left out. Kept per
|
|
138
|
+
* style and look, so the pieces a measurement is keyed by (`body`,
|
|
139
|
+
* `lists`) keep their identity from one call to the next. */
|
|
140
|
+
export declare function styleWithLook(base: ResolvedCalloutStyleConfig, look: FrameLook): ResolvedCalloutStyleConfig;
|
|
122
141
|
/** The story heads of a composed page's stories, by the head frame's
|
|
123
142
|
* name, read from the boxes `wrapComposedPages` made (`FRAME_ATTR`). */
|
|
124
143
|
export declare function composedStories(startIdx: number, endIdx: number, plans: ReadonlyMap<number, PlannedCallout>): Map<string, ComposedStory>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"composedLayout.d.ts","sourceRoot":"","sources":["../../src/pipeline/composedLayout.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,OAAO,KAAK,EAAE,iBAAiB,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AACtE,OAAO,KAAK,EAAa,0BAA0B,EAAE,MAAM,UAAU,CAAC;AACtE,OAAO,EAAkC,KAAK,cAAc,EAAmE,KAAK,QAAQ,EAAE,KAAK,eAAe,EAAoE,KAAK,OAAO,EAAE,MAAM,QAAQ,CAAC;AAGnQ,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAIzC,OAAO,EAAoE,KAAK,UAAU,EAAE,KAAK,IAAI,EAAE,M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,MAAM,GAAG,aAAa,GAAG,SAAS,CAAC;CACjD;AAED;8BAC8B;AAC9B,wBAAgB,iBAAiB,CAC/B,MAAM,EAAE,SAAS,YAAY,EAAE,EAC/B,KAAK,EAAE,WAAW,CAAC,MAAM,EAAE,cAAc,CAAC,EAC1C,MAAM,EAAE,kBAAkB,GACzB,GAAG,CAAC,MAAM,EAAE,mBAAmB,CAAC,CAqBlC;AAED,mEAAmE;AACnE,wBAAgB,cAAc,CAAC,KAAK,EAAE,WAAW,CAAC,MAAM,EAAE,mBAAmB,CAAC,EAAE,GAAG,EAAE,MAAM,GAAG,mBAAmB,GAAG,SAAS,CAG5H"}
|
|
@@ -15,7 +15,10 @@ import { frameElementId } from '../composed/ids';
|
|
|
15
15
|
import { frameLinePx, frameRuleBlocks } from '../composed/rules';
|
|
16
16
|
import { offsetCalloutToAbsolute } from './calloutLayout';
|
|
17
17
|
import { isMarkerBlock } from './buildHelpers';
|
|
18
|
+
import { createLayoutMemo, layoutMemoSwitch } from './layoutMemo';
|
|
18
19
|
import { createMeasureMemo } from './measureMemo';
|
|
20
|
+
import { computeOrderedListRunMetrics } from './lists';
|
|
21
|
+
import { planParagraphContainers } from './paragraphContainers';
|
|
19
22
|
import { CUT_START, fragmentRange, frameCutRules, makeCalloutLayouter, splitCalloutFragment } from './frameLayout';
|
|
20
23
|
const MM_PER_IN = 25.4;
|
|
21
24
|
const NO_FIT = { patches: new Map(), text: new Map(), pictures: new Map(), yieldAll: new Set(), goOn: new Set() };
|
|
@@ -69,7 +72,7 @@ export function layoutComposedPage(given) {
|
|
|
69
72
|
// frames collapsed).
|
|
70
73
|
// The ladder lays the page again at each step: the measurements of one
|
|
71
74
|
// step answer the next (#953).
|
|
72
|
-
const memoed = { ...given, pass: { ...given.pass, measureMemo: createMeasureMemo() } };
|
|
75
|
+
const memoed = { ...given, pass: { ...given.pass, measureMemo: createMeasureMemo(), ...(layoutMemoSwitch.enabled ? { layoutMemo: createLayoutMemo() } : {}) } };
|
|
73
76
|
const input = given.continuing ? { ...memoed, template: continuationTemplate(given.template, given.continuing) } : memoed;
|
|
74
77
|
const { template, fence, dpi } = input;
|
|
75
78
|
const fi = fence.fenceIndex;
|
|
@@ -481,6 +484,75 @@ function trialPass(base, extra, originOf, measureOrigin) {
|
|
|
481
484
|
...(base.headingDesign ? { headingDesign: (raw, blockIdx, heading, width) => base.headingDesign(raw, at(blockIdx), heading, width) } : {}),
|
|
482
485
|
};
|
|
483
486
|
}
|
|
487
|
+
/**
|
|
488
|
+
* The pass the stories carried in from other chapters (#943) are laid with:
|
|
489
|
+
* `base` with their blocks appended to its content, and every lookup the
|
|
490
|
+
* box typesetter keys by content index answered for them from what the
|
|
491
|
+
* sender gave (heading numbers) or worked out again from the carried
|
|
492
|
+
* blocks alone (paragraph groups, ordered-list markers). A carried story's
|
|
493
|
+
* box is set in the context of the text, with the list indents its sender
|
|
494
|
+
* set its lists with; the typography of a styled section or a part of this
|
|
495
|
+
* chapter does not reach it.
|
|
496
|
+
*/
|
|
497
|
+
export function carriedPass(base, carried) {
|
|
498
|
+
if (carried.blocks.length === 0)
|
|
499
|
+
return base;
|
|
500
|
+
const n = base.contentBlocks.length;
|
|
501
|
+
const contentBlocks = [...base.contentBlocks, ...carried.blocks];
|
|
502
|
+
const local = planParagraphContainers(carried.blocks, base.resolved);
|
|
503
|
+
const byBlock = [...base.paragraphContainers.byBlock];
|
|
504
|
+
byBlock.length = n;
|
|
505
|
+
byBlock.push(...local.byBlock);
|
|
506
|
+
const paragraphContainers = { byId: new Map([...base.paragraphContainers.byId, ...local.byId]), byBlock };
|
|
507
|
+
const numberAt = new Map();
|
|
508
|
+
for (const story of carried.stories.values())
|
|
509
|
+
for (const [at, num] of story.numbers)
|
|
510
|
+
numberAt.set(at, num);
|
|
511
|
+
const extend = (arr, pick) => {
|
|
512
|
+
if (!arr)
|
|
513
|
+
return arr;
|
|
514
|
+
const out = [...arr];
|
|
515
|
+
out.length = n;
|
|
516
|
+
out.length = contentBlocks.length;
|
|
517
|
+
for (const [at, num] of numberAt)
|
|
518
|
+
out[at] = pick(num);
|
|
519
|
+
return out;
|
|
520
|
+
};
|
|
521
|
+
const contexts = new Map();
|
|
522
|
+
const carriedCtx = (ctx, startIdx) => {
|
|
523
|
+
const story = carried.stories.get(startIdx);
|
|
524
|
+
const of = contexts.get(ctx) ?? new Map();
|
|
525
|
+
contexts.set(ctx, of);
|
|
526
|
+
const known = of.get(startIdx);
|
|
527
|
+
if (known)
|
|
528
|
+
return known;
|
|
529
|
+
const metrics = computeOrderedListRunMetrics(carried.blocks, base.resolved, ctx.bodyStyle.fontSizePx);
|
|
530
|
+
const perBlock = new Map(ctx.orderedMetrics.perBlock);
|
|
531
|
+
for (const [i, m] of metrics.perBlock)
|
|
532
|
+
perBlock.set(n + i, m);
|
|
533
|
+
const out = {
|
|
534
|
+
...ctx,
|
|
535
|
+
contentBlocks,
|
|
536
|
+
headingPrefixes: extend(ctx.headingPrefixes, (num) => num.prefix),
|
|
537
|
+
...(ctx.headingNumbers ? { headingNumbers: extend(ctx.headingNumbers, (num) => num.value) } : {}),
|
|
538
|
+
orderedMetrics: { perBlock, maxWidthByDepth: ctx.orderedMetrics.maxWidthByDepth },
|
|
539
|
+
...(story.jump.orderedLevelIndentsPx ? { orderedLevelIndentsPx: story.jump.orderedLevelIndentsPx } : {}),
|
|
540
|
+
dropCapNotes: new Map(),
|
|
541
|
+
joiningLetterSpacing: new Set(),
|
|
542
|
+
};
|
|
543
|
+
of.set(startIdx, out);
|
|
544
|
+
return out;
|
|
545
|
+
};
|
|
546
|
+
return {
|
|
547
|
+
...base,
|
|
548
|
+
contentBlocks,
|
|
549
|
+
paragraphContainers,
|
|
550
|
+
measureCtxFor: (startIdx, style) => {
|
|
551
|
+
const ctx = base.measureCtxFor(startIdx, style);
|
|
552
|
+
return carried.stories.has(startIdx) ? carriedCtx(ctx, startIdx) : ctx;
|
|
553
|
+
},
|
|
554
|
+
};
|
|
555
|
+
}
|
|
484
556
|
/** The page's stories as `wrapComposedPages` would group them for template
|
|
485
557
|
* `alt` (#937): a story whose head names a frame of `alt` stays the story
|
|
486
558
|
* of that frame's chain, one a `takes` frame took goes to `alt`'s frame
|
|
@@ -751,13 +823,16 @@ function composePage(input, template, fit, collapsed) {
|
|
|
751
823
|
/** Whether a frame's lines are set as on a mirrored page: those of the
|
|
752
824
|
* page's own mode, not an unmirrored frame's. */
|
|
753
825
|
const mirroredIn = (frame) => input.mirrored && unmirroredAt(frame) === undefined;
|
|
754
|
-
/** The widest a picture's upright frame may be in a
|
|
755
|
-
*
|
|
756
|
-
* box's padding.
|
|
757
|
-
*
|
|
758
|
-
*
|
|
826
|
+
/** The widest a picture's upright frame may be in a frame whose lines run
|
|
827
|
+
* down the page (#960, #971): the frame's extent across its lines, less
|
|
828
|
+
* the box's padding. A vertical frame of a horizontal page is turned a
|
|
829
|
+
* quarter turn on the page, a frame of a vertical page's own mode lies in
|
|
830
|
+
* the flow, which is turned the same way; either way its pictures are
|
|
831
|
+
* laid out counter-rotated to stand upright. A horizontal frame of a
|
|
832
|
+
* vertical page is turned against the flow and already stands upright;
|
|
833
|
+
* none of that on a horizontal page's own mode. */
|
|
759
834
|
const uprightIn = (frame, across) => {
|
|
760
|
-
if (
|
|
835
|
+
if ((frame.writingMode ?? pageMode) !== 'vertical-rl')
|
|
761
836
|
return {};
|
|
762
837
|
const pad = styleOf(frame).padding;
|
|
763
838
|
const room = across - lengthPx(pad.top, dpi, input.emPx) - lengthPx(pad.bottom, dpi, input.emPx);
|
|
@@ -907,13 +982,60 @@ function composePage(input, template, fit, collapsed) {
|
|
|
907
982
|
if (known !== undefined)
|
|
908
983
|
return known;
|
|
909
984
|
const exclusions = at ? unscale(exclusionsFor(p.frame, { ...at, width }, true), s) : undefined;
|
|
910
|
-
|
|
911
|
-
|
|
985
|
+
// The room a vertical page's upright picture may take down the page
|
|
986
|
+
// is the flow's whole extent: the frame's height is what it settles.
|
|
987
|
+
const opts = { ...(exclusions ? { exclusions } : {}), ...(pic !== undefined ? { pictureScale: pic } : {}), ...(p.fromMark !== undefined ? { continuedMark: p.fromMark } : {}), ...uprightIn(p.frame, input.areas.area.height / s) };
|
|
988
|
+
const r = p.st.L.peekRange(p.st.cut, p.st.L.end, width / s, p.blockId, p.continuation, input.mirrored, Object.keys(opts).length > 0 ? opts : undefined);
|
|
912
989
|
const h = r.totalHeight * s;
|
|
913
990
|
memo.set(key, h);
|
|
914
991
|
return h;
|
|
915
992
|
};
|
|
916
993
|
};
|
|
994
|
+
/** The width an `'auto'`-width frame (#982) needs when it may take up
|
|
995
|
+
* to `room`: the right edge of its longest line (a picture counting
|
|
996
|
+
* by its own box), and what the box keeps to the right of its text
|
|
997
|
+
* (padding, a stripe). The text is set flush left whatever its
|
|
998
|
+
* alignment, so a centred title is as wide as its words, and not set
|
|
999
|
+
* to a measure it would fill. Undefined for a frame of fixed or
|
|
1000
|
+
* `'fill'` width, or one in its own writing mode. */
|
|
1001
|
+
const naturalWidthOf = (p) => {
|
|
1002
|
+
if (p.frame.width !== 'auto' || ownMode(p.frame))
|
|
1003
|
+
return undefined;
|
|
1004
|
+
const memo = new Map();
|
|
1005
|
+
return (room) => {
|
|
1006
|
+
if (!p.holds)
|
|
1007
|
+
return 0;
|
|
1008
|
+
const key = Math.round(room * 1000);
|
|
1009
|
+
const known = memo.get(key);
|
|
1010
|
+
if (known !== undefined)
|
|
1011
|
+
return known;
|
|
1012
|
+
const s = textScale(p.frame);
|
|
1013
|
+
const style = styleOf(p.frame);
|
|
1014
|
+
const flush = { ...style, body: { ...style.body, textAlign: 'left' } };
|
|
1015
|
+
const L = makeCalloutLayouter(pass, p.st.story.startIdx, p.st.story.plan, flush);
|
|
1016
|
+
// Set at a measure far wider than the room, so that nothing wraps:
|
|
1017
|
+
// the frame is then as wide as its words, and the room caps it
|
|
1018
|
+
// (text that does not fit wraps at the room, as in a shrink-wrapped
|
|
1019
|
+
// box).
|
|
1020
|
+
const r = L.layoutRange(p.st.cut, L.end, (room * 8) / s, p.blockId, p.continuation, input.mirrored);
|
|
1021
|
+
let right = 0;
|
|
1022
|
+
for (const b of r.children) {
|
|
1023
|
+
if (b.type === 'callout' || b.hidden)
|
|
1024
|
+
continue;
|
|
1025
|
+
if (b.type === 'resource' || b.lines.length === 0)
|
|
1026
|
+
right = Math.max(right, b.bbox.x + b.bbox.width);
|
|
1027
|
+
for (const l of b.lines)
|
|
1028
|
+
if (l.text.length > 0)
|
|
1029
|
+
right = Math.max(right, l.bbox.x + l.bbox.width);
|
|
1030
|
+
}
|
|
1031
|
+
const inner = r.frame.callout?.innerRect;
|
|
1032
|
+
const keep = inner ? Math.max(0, r.width - (inner.x + inner.width)) : 0;
|
|
1033
|
+
// A quarter of a pixel over: a line is never set to its exact width.
|
|
1034
|
+
const w = Math.min(room, (right + keep + 0.25) * s);
|
|
1035
|
+
memo.set(key, w);
|
|
1036
|
+
return w;
|
|
1037
|
+
};
|
|
1038
|
+
};
|
|
917
1039
|
/** The height a frame set in its own writing mode (#944) needs at
|
|
918
1040
|
* `width`: its lines run down the box, so the least height whose
|
|
919
1041
|
* lines, following each other across, fit `width`; the area's height
|
|
@@ -926,7 +1048,7 @@ function composePage(input, template, fit, collapsed) {
|
|
|
926
1048
|
if (known !== undefined)
|
|
927
1049
|
return known;
|
|
928
1050
|
const opts = { ...(pic !== undefined ? { pictureScale: pic } : {}), ...(p.fromMark !== undefined ? { continuedMark: p.fromMark } : {}), ...uprightIn(p.frame, width / s) };
|
|
929
|
-
const across = (measure) => inMode(p.frame, () => p.st.L.
|
|
1051
|
+
const across = (measure) => inMode(p.frame, () => p.st.L.peekRange(p.st.cut, p.st.L.end, measure / s, p.blockId, p.continuation, mirroredIn(p.frame), Object.keys(opts).length > 0 ? opts : undefined).totalHeight * s);
|
|
930
1052
|
const most = Math.max(input.areas.area.height, input.emPx);
|
|
931
1053
|
let h = most;
|
|
932
1054
|
if (across(most) <= width + 0.5) {
|
|
@@ -951,8 +1073,8 @@ function composePage(input, template, fit, collapsed) {
|
|
|
951
1073
|
* off a spread's spine band, #861), its `'auto'` height measured at the
|
|
952
1074
|
* width it is left with. Declared and final boxes alike: the band is
|
|
953
1075
|
* the template's, not a reflow. */
|
|
954
|
-
const placeFitted = (frame, placeable, ctx, refs, nat) => {
|
|
955
|
-
const r = placeBox(placeable, template, ctx, refs, nat);
|
|
1076
|
+
const placeFitted = (frame, placeable, ctx, refs, nat, natW) => {
|
|
1077
|
+
const r = placeBox(placeable, template, ctx, refs, nat, natW);
|
|
956
1078
|
if (!input.fitBox)
|
|
957
1079
|
return r;
|
|
958
1080
|
const keep = (placed) => {
|
|
@@ -966,7 +1088,7 @@ function composePage(input, template, fit, collapsed) {
|
|
|
966
1088
|
const first = keep(r);
|
|
967
1089
|
if (Math.abs(first.width - r.width) < 0.01)
|
|
968
1090
|
return first;
|
|
969
|
-
return keep(placeBox(placeable, template, ctx, refs, () => nat(first.width)));
|
|
1091
|
+
return keep(placeBox(placeable, template, ctx, refs, () => nat(first.width), natW));
|
|
970
1092
|
};
|
|
971
1093
|
/** A frame's height as its template declares it: its `minHeight` where
|
|
972
1094
|
* the height follows the content, else the content's (`natural`). */
|
|
@@ -979,16 +1101,17 @@ function composePage(input, template, fit, collapsed) {
|
|
|
979
1101
|
const frame = p.frame;
|
|
980
1102
|
const placeable = framePlaceable(frame);
|
|
981
1103
|
const natural = naturalOf(p);
|
|
1104
|
+
const natW = naturalWidthOf(p);
|
|
982
1105
|
const at = (refs) => {
|
|
983
|
-
const r0 = placeFitted(frame, placeable, input, refs, natural);
|
|
1106
|
+
const r0 = placeFitted(frame, placeable, input, refs, natural, natW);
|
|
984
1107
|
if (!p.holds || !exclusionsFor(frame, r0, true))
|
|
985
1108
|
return { rect: r0, natural };
|
|
986
1109
|
const round = naturalOf(p, r0);
|
|
987
|
-
return { rect: placeFitted(frame, placeable, input, refs, round), natural: round };
|
|
1110
|
+
return { rect: placeFitted(frame, placeable, input, refs, round, natW), natural: round };
|
|
988
1111
|
};
|
|
989
1112
|
const decl = frame.pin ? at(declaredRefOf) : undefined;
|
|
990
1113
|
const fin = decl ?? at(refOf);
|
|
991
|
-
const declRect = placeFitted(frame, placeable, input, declaredRefOf, declaredNatural(frame, fin.natural));
|
|
1114
|
+
const declRect = placeFitted(frame, placeable, input, declaredRefOf, declaredNatural(frame, fin.natural), natW);
|
|
992
1115
|
const rect = frame.pin ? declRect : fin.rect;
|
|
993
1116
|
declared.set(frame.name, declRect);
|
|
994
1117
|
rects.set(frame.name, rect);
|
|
@@ -1005,6 +1128,7 @@ function composePage(input, template, fit, collapsed) {
|
|
|
1005
1128
|
const mmPx = dpi / MM_PER_IN;
|
|
1006
1129
|
const yieldAll = fit.yieldAll.has(group.name);
|
|
1007
1130
|
const preps = members.map(prepare);
|
|
1131
|
+
const natWs = preps.map(naturalWidthOf);
|
|
1008
1132
|
const solve = (mode, naturals) => {
|
|
1009
1133
|
const refs = mode === 'final' ? refOf : declaredRefOf;
|
|
1010
1134
|
const ownBox = own ? placeBox(own, template, input, refs, () => 0) : undefined;
|
|
@@ -1017,7 +1141,7 @@ function composePage(input, template, fit, collapsed) {
|
|
|
1017
1141
|
const placeable = framePlaceable(f);
|
|
1018
1142
|
// On a spread the member's own box keeps off the spine band, and
|
|
1019
1143
|
// the negotiation starts from it (#861).
|
|
1020
|
-
const box = placeFitted(f, placeable, ctx, memberRefs, declaredNatural(f, natural));
|
|
1144
|
+
const box = placeFitted(f, placeable, ctx, memberRefs, declaredNatural(f, natural), natWs[k]);
|
|
1021
1145
|
ownRects.set(f.name, box);
|
|
1022
1146
|
const auto = f.height === 'auto' && !(f.grid && !placeable.heightSet);
|
|
1023
1147
|
const fill = f.height === 'fill';
|
|
@@ -1228,7 +1352,11 @@ function composePage(input, template, fit, collapsed) {
|
|
|
1228
1352
|
}
|
|
1229
1353
|
else if (holds && cont?.receivers.has(frame.name)) {
|
|
1230
1354
|
// Content from the page before (#859).
|
|
1231
|
-
|
|
1355
|
+
const came = cont.receivers.get(frame.name);
|
|
1356
|
+
vdt.continuedFrom = came.fromFrameId;
|
|
1357
|
+
// From a page of an earlier chapter (#943).
|
|
1358
|
+
if (came.foreign)
|
|
1359
|
+
vdt.continuedFromChapter = came.foreign.from;
|
|
1232
1360
|
}
|
|
1233
1361
|
if (result) {
|
|
1234
1362
|
// The marks whose `{page}` the build fills in (#917).
|
|
@@ -1419,7 +1547,7 @@ function stampFrameAttrText(box, sources, attrs, bodyOffset) {
|
|
|
1419
1547
|
export function frameStyleOf(base, frame) {
|
|
1420
1548
|
const padding = frame.padding ? { ...base.padding, ...frame.padding } : base.padding;
|
|
1421
1549
|
return {
|
|
1422
|
-
...base,
|
|
1550
|
+
...(frame.look ? styleWithLook(base, frame.look) : base),
|
|
1423
1551
|
padding,
|
|
1424
1552
|
width: 'fill',
|
|
1425
1553
|
placement: 'here',
|
|
@@ -1428,6 +1556,61 @@ export function frameStyleOf(base, frame) {
|
|
|
1428
1556
|
marginBottom: { value: 0, unit: 'px' },
|
|
1429
1557
|
};
|
|
1430
1558
|
}
|
|
1559
|
+
const lookedStyles = new WeakMap();
|
|
1560
|
+
/** `base` with what a frame's `look` sets (#976) written over it: colours
|
|
1561
|
+
* of the fill, border, stripe, icon, marker, title, text and label tab,
|
|
1562
|
+
* and the tracking of the body. A fill colour turns the fill on. A part
|
|
1563
|
+
* the style does not have (a label tab it lacks) is left out. Kept per
|
|
1564
|
+
* style and look, so the pieces a measurement is keyed by (`body`,
|
|
1565
|
+
* `lists`) keep their identity from one call to the next. */
|
|
1566
|
+
export function styleWithLook(base, look) {
|
|
1567
|
+
let byLook = lookedStyles.get(base);
|
|
1568
|
+
if (!byLook)
|
|
1569
|
+
lookedStyles.set(base, (byLook = new WeakMap()));
|
|
1570
|
+
const known = byLook.get(look);
|
|
1571
|
+
if (known)
|
|
1572
|
+
return known;
|
|
1573
|
+
const out = { ...base };
|
|
1574
|
+
if (look.background) {
|
|
1575
|
+
out.background = look.background;
|
|
1576
|
+
out.backgroundEnabled = true;
|
|
1577
|
+
}
|
|
1578
|
+
if (look.border?.color)
|
|
1579
|
+
out.border = { ...base.border, color: look.border.color };
|
|
1580
|
+
if (look.stripe?.color)
|
|
1581
|
+
out.stripe = { ...base.stripe, color: look.stripe.color };
|
|
1582
|
+
if (look.icon?.color)
|
|
1583
|
+
out.icon = { ...base.icon, color: look.icon.color };
|
|
1584
|
+
if (look.marker?.color || look.marker?.rule?.color) {
|
|
1585
|
+
out.marker = {
|
|
1586
|
+
...base.marker,
|
|
1587
|
+
...(look.marker.color ? { color: look.marker.color } : {}),
|
|
1588
|
+
...(look.marker.rule?.color ? { rule: { ...base.marker.rule, color: look.marker.rule.color } } : {}),
|
|
1589
|
+
};
|
|
1590
|
+
}
|
|
1591
|
+
if (look.titleStyle?.color)
|
|
1592
|
+
out.titleStyle = { ...base.titleStyle, color: look.titleStyle.color };
|
|
1593
|
+
if (look.body) {
|
|
1594
|
+
const b = look.body;
|
|
1595
|
+
out.body = {
|
|
1596
|
+
...base.body,
|
|
1597
|
+
...(b.color ? { color: b.color } : {}),
|
|
1598
|
+
...(b.boldColor ? { boldColor: b.boldColor } : {}),
|
|
1599
|
+
...(b.italicColor ? { italicColor: b.italicColor } : {}),
|
|
1600
|
+
...(b.letterSpacing ? (b.letterSpacing.value !== 0 ? { letterSpacing: b.letterSpacing } : { letterSpacing: undefined }) : {}),
|
|
1601
|
+
};
|
|
1602
|
+
}
|
|
1603
|
+
if (look.label && base.label) {
|
|
1604
|
+
out.label = {
|
|
1605
|
+
...base.label,
|
|
1606
|
+
...(look.label.color ? { color: look.label.color } : {}),
|
|
1607
|
+
...(look.label.background ? { background: look.label.background } : {}),
|
|
1608
|
+
...(look.label.rule?.color ? { rule: { ...base.label.rule, color: look.label.rule.color } } : {}),
|
|
1609
|
+
};
|
|
1610
|
+
}
|
|
1611
|
+
byLook.set(look, out);
|
|
1612
|
+
return out;
|
|
1613
|
+
}
|
|
1431
1614
|
/** The story heads of a composed page's stories, by the head frame's
|
|
1432
1615
|
* name, read from the boxes `wrapComposedPages` made (`FRAME_ATTR`). */
|
|
1433
1616
|
export function composedStories(startIdx, endIdx, plans) {
|