postext 1.79.0 → 1.81.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__/defaults/captionStyle.test.js +1 -1
- package/dist/__tests__/defaults/captionStyle.test.js.map +1 -1
- package/dist/__tests__/defaults/designComposition.test.d.ts +2 -0
- package/dist/__tests__/defaults/designComposition.test.d.ts.map +1 -0
- package/dist/__tests__/defaults/designComposition.test.js +100 -0
- package/dist/__tests__/defaults/designComposition.test.js.map +1 -0
- package/dist/__tests__/exports.test.js +18 -0
- package/dist/__tests__/exports.test.js.map +1 -1
- package/dist/__tests__/html-backend/htmlBook.test.d.ts +2 -0
- package/dist/__tests__/html-backend/htmlBook.test.d.ts.map +1 -0
- package/dist/__tests__/html-backend/htmlBook.test.js +130 -0
- package/dist/__tests__/html-backend/htmlBook.test.js.map +1 -0
- package/dist/__tests__/hyphenation/exceptionsByLanguage.test.d.ts +2 -0
- package/dist/__tests__/hyphenation/exceptionsByLanguage.test.d.ts.map +1 -0
- package/dist/__tests__/hyphenation/exceptionsByLanguage.test.js +60 -0
- package/dist/__tests__/hyphenation/exceptionsByLanguage.test.js.map +1 -0
- package/dist/__tests__/hyphenation/exceptionsByLanguageBook.test.d.ts +2 -0
- package/dist/__tests__/hyphenation/exceptionsByLanguageBook.test.d.ts.map +1 -0
- package/dist/__tests__/hyphenation/exceptionsByLanguageBook.test.js +87 -0
- package/dist/__tests__/hyphenation/exceptionsByLanguageBook.test.js.map +1 -0
- package/dist/__tests__/hyphenation/exceptionsFile.test.d.ts +2 -0
- package/dist/__tests__/hyphenation/exceptionsFile.test.d.ts.map +1 -0
- package/dist/__tests__/hyphenation/exceptionsFile.test.js +95 -0
- package/dist/__tests__/hyphenation/exceptionsFile.test.js.map +1 -0
- package/dist/__tests__/pipeline/resources/captionHyphenation.test.d.ts +2 -0
- package/dist/__tests__/pipeline/resources/captionHyphenation.test.d.ts.map +1 -0
- package/dist/__tests__/pipeline/resources/captionHyphenation.test.js +252 -0
- package/dist/__tests__/pipeline/resources/captionHyphenation.test.js.map +1 -0
- package/dist/__tests__/pipeline/text/lineEdgeRulesElsewhere.test.d.ts +2 -0
- package/dist/__tests__/pipeline/text/lineEdgeRulesElsewhere.test.d.ts.map +1 -0
- package/dist/__tests__/pipeline/text/lineEdgeRulesElsewhere.test.js +217 -0
- package/dist/__tests__/pipeline/text/lineEdgeRulesElsewhere.test.js.map +1 -0
- package/dist/bundle/design.d.ts.map +1 -1
- package/dist/bundle/design.js +4 -3
- package/dist/bundle/design.js.map +1 -1
- package/dist/checks/snippetEdges.d.ts +32 -0
- package/dist/checks/snippetEdges.d.ts.map +1 -0
- package/dist/checks/snippetEdges.js +57 -0
- package/dist/checks/snippetEdges.js.map +1 -0
- package/dist/checks/spaceBreaks.d.ts +7 -0
- package/dist/checks/spaceBreaks.d.ts.map +1 -1
- package/dist/checks/spaceBreaks.js +21 -13
- package/dist/checks/spaceBreaks.js.map +1 -1
- package/dist/checks/stacks.d.ts +6 -1
- package/dist/checks/stacks.d.ts.map +1 -1
- package/dist/checks/stacks.js +33 -24
- package/dist/checks/stacks.js.map +1 -1
- package/dist/defaults/resources/captionStyle.d.ts.map +1 -1
- package/dist/defaults/resources/captionStyle.js +26 -0
- package/dist/defaults/resources/captionStyle.js.map +1 -1
- package/dist/defaults/resources/tableStyle.d.ts.map +1 -1
- package/dist/defaults/resources/tableStyle.js +6 -0
- package/dist/defaults/resources/tableStyle.js.map +1 -1
- package/dist/defaults/text/bodyText/defaults.d.ts.map +1 -1
- package/dist/defaults/text/bodyText/defaults.js +7 -2
- package/dist/defaults/text/bodyText/defaults.js.map +1 -1
- package/dist/defaults/text/bodyText/resolve.d.ts.map +1 -1
- package/dist/defaults/text/bodyText/resolve.js +3 -1
- package/dist/defaults/text/bodyText/resolve.js.map +1 -1
- package/dist/designs/conventions.d.ts +34 -0
- package/dist/designs/conventions.d.ts.map +1 -0
- package/dist/designs/conventions.js +85 -0
- package/dist/designs/conventions.js.map +1 -0
- package/dist/designs/design.d.ts +6 -0
- package/dist/designs/design.d.ts.map +1 -1
- package/dist/designs/design.js +11 -0
- package/dist/designs/design.js.map +1 -1
- package/dist/designs/index.d.ts +3 -1
- package/dist/designs/index.d.ts.map +1 -1
- package/dist/designs/index.js +2 -1
- package/dist/designs/index.js.map +1 -1
- package/dist/designs/parts.d.ts +18 -7
- package/dist/designs/parts.d.ts.map +1 -1
- package/dist/designs/parts.js +65 -34
- package/dist/designs/parts.js.map +1 -1
- package/dist/html-backend/book.d.ts +93 -0
- package/dist/html-backend/book.d.ts.map +1 -0
- package/dist/html-backend/book.js +150 -0
- package/dist/html-backend/book.js.map +1 -0
- package/dist/html-backend/html-backend.d.ts +2 -0
- package/dist/html-backend/html-backend.d.ts.map +1 -1
- package/dist/html-backend/html-backend.js +3 -0
- package/dist/html-backend/html-backend.js.map +1 -1
- package/dist/hyphenation/exceptionsFile.d.ts +76 -0
- package/dist/hyphenation/exceptionsFile.d.ts.map +1 -0
- package/dist/hyphenation/exceptionsFile.js +247 -0
- package/dist/hyphenation/exceptionsFile.js.map +1 -0
- package/dist/hyphenation/hyphenate.d.ts +8 -1
- package/dist/hyphenation/hyphenate.d.ts.map +1 -1
- package/dist/hyphenation/hyphenate.js +28 -13
- package/dist/hyphenation/hyphenate.js.map +1 -1
- package/dist/hyphenation/hyphenationExceptions.d.ts +10 -0
- package/dist/hyphenation/hyphenationExceptions.d.ts.map +1 -1
- package/dist/hyphenation/hyphenationExceptions.js +30 -0
- package/dist/hyphenation/hyphenationExceptions.js.map +1 -1
- package/dist/index.d.ts +4 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -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 +2 -0
- package/dist/knuthPlass/richAdapter.js.map +1 -1
- package/dist/measure/plain.d.ts.map +1 -1
- package/dist/measure/plain.js +6 -0
- package/dist/measure/plain.js.map +1 -1
- package/dist/measure/rich/greedyRules.d.ts +28 -0
- package/dist/measure/rich/greedyRules.d.ts.map +1 -0
- package/dist/measure/rich/greedyRules.js +77 -0
- package/dist/measure/rich/greedyRules.js.map +1 -0
- package/dist/measure/rich/measure.d.ts.map +1 -1
- package/dist/measure/rich/measure.js +12 -0
- package/dist/measure/rich/measure.js.map +1 -1
- package/dist/measure/rich/tokenize.js +1 -1
- package/dist/measure/rich/tokenize.js.map +1 -1
- package/dist/pipeline/blocks/measureContentBlock/measureOptions.d.ts.map +1 -1
- package/dist/pipeline/blocks/measureContentBlock/measureOptions.js +6 -5
- package/dist/pipeline/blocks/measureContentBlock/measureOptions.js.map +1 -1
- package/dist/pipeline/blocks/measureContentBlock.d.ts.map +1 -1
- package/dist/pipeline/blocks/measureContentBlock.js +3 -0
- package/dist/pipeline/blocks/measureContentBlock.js.map +1 -1
- package/dist/pipeline/build/pass/setup/contentSetup.d.ts +1 -0
- package/dist/pipeline/build/pass/setup/contentSetup.d.ts.map +1 -1
- package/dist/pipeline/build/pass/setup/passFinish.d.ts.map +1 -1
- package/dist/pipeline/build/pass/setup/passFinish.js +9 -3
- package/dist/pipeline/build/pass/setup/passFinish.js.map +1 -1
- package/dist/pipeline/build/pass.js +2 -1
- package/dist/pipeline/build/pass.js.map +1 -1
- package/dist/pipeline/contentWarnings/formatWarning.js +11 -3
- package/dist/pipeline/contentWarnings/formatWarning.js.map +1 -1
- package/dist/pipeline/contentWarnings/layoutWarnings.d.ts +10 -0
- package/dist/pipeline/contentWarnings/layoutWarnings.d.ts.map +1 -1
- package/dist/pipeline/contentWarnings/layoutWarnings.js +22 -0
- package/dist/pipeline/contentWarnings/layoutWarnings.js.map +1 -1
- package/dist/pipeline/contentWarnings.d.ts +1 -1
- package/dist/pipeline/contentWarnings.d.ts.map +1 -1
- package/dist/pipeline/contentWarnings.js +1 -1
- package/dist/pipeline/contentWarnings.js.map +1 -1
- package/dist/pipeline/contents/indexDirective.d.ts.map +1 -1
- package/dist/pipeline/contents/indexDirective.js +4 -1
- package/dist/pipeline/contents/indexDirective.js.map +1 -1
- package/dist/pipeline/contents/toc.d.ts.map +1 -1
- package/dist/pipeline/contents/toc.js +5 -2
- package/dist/pipeline/contents/toc.js.map +1 -1
- package/dist/pipeline/resources/resourceLayout/captions.d.ts.map +1 -1
- package/dist/pipeline/resources/resourceLayout/captions.js +3 -2
- package/dist/pipeline/resources/resourceLayout/captions.js.map +1 -1
- package/dist/pipeline/resources/resourceLayout/resourceBlock/captionNotes.d.ts.map +1 -1
- package/dist/pipeline/resources/resourceLayout/resourceBlock/captionNotes.js +3 -2
- package/dist/pipeline/resources/resourceLayout/resourceBlock/captionNotes.js.map +1 -1
- package/dist/pipeline/resources/resourceLayout/resourceBlock.js +1 -1
- package/dist/pipeline/resources/resourceLayout/resourceBlock.js.map +1 -1
- package/dist/pipeline/resources/resourceLayout/snippets.d.ts +18 -10
- package/dist/pipeline/resources/resourceLayout/snippets.d.ts.map +1 -1
- package/dist/pipeline/resources/resourceLayout/snippets.js +33 -20
- package/dist/pipeline/resources/resourceLayout/snippets.js.map +1 -1
- package/dist/pipeline/styles.d.ts +4 -0
- package/dist/pipeline/styles.d.ts.map +1 -1
- package/dist/pipeline/styles.js +1 -1
- package/dist/pipeline/styles.js.map +1 -1
- package/dist/pipeline/text/lineEdgeRules.d.ts +17 -0
- package/dist/pipeline/text/lineEdgeRules.d.ts.map +1 -0
- package/dist/pipeline/text/lineEdgeRules.js +28 -0
- package/dist/pipeline/text/lineEdgeRules.js.map +1 -0
- package/dist/pipeline/text/verse.d.ts +4 -1
- package/dist/pipeline/text/verse.d.ts.map +1 -1
- package/dist/pipeline/text/verse.js +4 -4
- package/dist/pipeline/text/verse.js.map +1 -1
- package/dist/pipeline/text/verseLines.d.ts +4 -1
- package/dist/pipeline/text/verseLines.d.ts.map +1 -1
- package/dist/pipeline/text/verseLines.js +1 -1
- package/dist/pipeline/text/verseLines.js.map +1 -1
- package/dist/types/resources/tableStyles.d.ts +28 -0
- package/dist/types/resources/tableStyles.d.ts.map +1 -1
- package/dist/types/text/locale.d.ts +16 -0
- package/dist/types/text/locale.d.ts.map +1 -1
- package/dist/vdt/contentWarnings/text.d.ts +22 -9
- package/dist/vdt/contentWarnings/text.d.ts.map +1 -1
- package/dist/word/semantic/media/captions.js +1 -1
- package/dist/word/semantic/media/captions.js.map +1 -1
- package/dist/word/semantic/prose/caption.d.ts.map +1 -1
- package/dist/word/semantic/prose/caption.js +4 -3
- package/dist/word/semantic/prose/caption.js.map +1 -1
- package/dist/word/semantic/table/styles.js +2 -2
- package/dist/word/semantic/table/styles.js.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/designs/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,eAAe,EAAE,YAAY,EAAE,YAAY,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAClL,YAAY,EAAE,UAAU,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAC5E,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,YAAY,EAAE,eAAe,EAAE,gBAAgB,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/designs/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,eAAe,EAAE,YAAY,EAAE,YAAY,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAClL,YAAY,EAAE,UAAU,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAC5E,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,YAAY,EAAE,eAAe,EAAE,gBAAgB,EAAE,aAAa,EAAE,eAAe,EAAE,0BAA0B,EAAE,MAAM,aAAa,CAAC;AACtK,YAAY,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AACzD,YAAY,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACzE,OAAO,EAAE,uBAAuB,EAAE,wBAAwB,EAAE,2BAA2B,EAAE,4BAA4B,EAAE,MAAM,kBAAkB,CAAC;AAChJ,YAAY,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAC"}
|
package/dist/designs/index.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export { DESIGN_PARTS, DESIGN_PART_KEYS, DESIGN_CARRIED_KEYS, DESIGN_PART_SLOTS, designPartSlots, designPartOf, isDesignPart, readDesignSlot, writeDesignSlot } from './parts.js';
|
|
2
|
-
export { extractDesign, applyDesign, revertDesign, pickDesignParts, usedFontFamilies, designFileIds, readDesignParts } from './design.js';
|
|
2
|
+
export { extractDesign, applyDesign, revertDesign, pickDesignParts, usedFontFamilies, designFileIds, readDesignParts, designPartsWithComposition } from './design.js';
|
|
3
3
|
export { designMissingStyles } from './missingStyles.js';
|
|
4
|
+
export { COMPOSITION_CONVENTIONS, compositionConventionFor, compositionConventionDesign, followsCompositionConvention } from './conventions.js';
|
|
4
5
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/designs/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,eAAe,EAAE,YAAY,EAAE,YAAY,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAElL,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,YAAY,EAAE,eAAe,EAAE,gBAAgB,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/designs/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,eAAe,EAAE,YAAY,EAAE,YAAY,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAElL,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,YAAY,EAAE,eAAe,EAAE,gBAAgB,EAAE,aAAa,EAAE,eAAe,EAAE,0BAA0B,EAAE,MAAM,aAAa,CAAC;AAEtK,OAAO,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAEzD,OAAO,EAAE,uBAAuB,EAAE,wBAAwB,EAAE,2BAA2B,EAAE,4BAA4B,EAAE,MAAM,kBAAkB,CAAC"}
|
package/dist/designs/parts.d.ts
CHANGED
|
@@ -16,24 +16,35 @@
|
|
|
16
16
|
* - `layout`: the writing mode belongs to the writing system; the rest of
|
|
17
17
|
* `layout` (columns, gutters, floats, balancing) is the page part.
|
|
18
18
|
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
19
|
+
* - `bodyText`: the composition rules (#1540) — where hyphens may fall,
|
|
20
|
+
* the letters a hyphen leaves, the stacks, the citation and operator
|
|
21
|
+
* breaks, a hyphen at a column's foot — are the composition part, the
|
|
22
|
+
* rest is the text part. So the rules of a language's tradition are
|
|
23
|
+
* saved and applied apart from the type they are set in.
|
|
24
|
+
*
|
|
25
|
+
* A dotted entry (`page.binding`, `bodyText.hyphenation.ladders`) claims
|
|
26
|
+
* that one field, however deep; the whole-key entry (`page`) takes every
|
|
27
|
+
* field the dotted entries leave.
|
|
21
28
|
*/
|
|
22
29
|
import type { PostextConfig } from '../types.js';
|
|
23
30
|
import type { PageConfig } from '../types/page.js';
|
|
24
31
|
import type { LayoutConfig } from '../types/layout.js';
|
|
32
|
+
import type { BodyTextConfig } from '../types/text/bodyText/config.js';
|
|
33
|
+
import type { HyphenationConfig } from '../types/text/locale.js';
|
|
25
34
|
/** A part of a design: a group of the Design panel. */
|
|
26
|
-
export type DesignPart = 'page' | 'writing' | 'colors' | 'text' | 'headings' | 'lists' | 'figures' | 'callouts' | 'exercises' | 'comics' | 'running' | 'parts' | 'output' | 'folio' | 'advanced';
|
|
35
|
+
export type DesignPart = 'page' | 'writing' | 'colors' | 'text' | 'composition' | 'headings' | 'lists' | 'figures' | 'callouts' | 'exercises' | 'comics' | 'running' | 'parts' | 'output' | 'folio' | 'advanced';
|
|
27
36
|
/** Every part, in the Design panel's order. */
|
|
28
37
|
export declare const DESIGN_PARTS: readonly DesignPart[];
|
|
29
|
-
/** A top-level setting, or one field of `page` or `
|
|
30
|
-
|
|
38
|
+
/** A top-level setting, or one field of `page`, `layout` or `bodyText`
|
|
39
|
+
* (`bodyText.hyphenation` one level further). */
|
|
40
|
+
export type DesignKeyPath = keyof PostextConfig | `page.${keyof PageConfig & string}` | `layout.${keyof LayoutConfig & string}` | `bodyText.${keyof BodyTextConfig & string}` | `bodyText.hyphenation.${keyof HyphenationConfig & string}`;
|
|
31
41
|
/** The settings of each part. */
|
|
32
42
|
export declare const DESIGN_PART_KEYS: {
|
|
33
43
|
readonly page: readonly ["page", "layout", "pageTemplates"];
|
|
34
44
|
readonly writing: readonly ["cjk", "layout.writingMode", "page.binding"];
|
|
35
45
|
readonly colors: readonly ["colorPalette", "contrast"];
|
|
36
46
|
readonly text: readonly ["bodyText", "paragraphStyles", "chipStyles", "characterStyles", "markStyles", "codeStyle", "math", "footnotes", "links", "lineNumbers", "citations", "symbolFont"];
|
|
47
|
+
readonly composition: readonly ["bodyText.hyphenation.minWordLength", "bodyText.hyphenation.leftMin", "bodyText.hyphenation.rightMin", "bodyText.hyphenation.capitalized", "bodyText.hyphenation.fewerHyphens", "bodyText.hyphenation.ladders", "bodyText.hyphenation.maxConsecutive", "bodyText.hyphenation.ladderPenalty", "bodyText.hyphenation.lastWord", "bodyText.hyphenation.lastWordPenalty", "bodyText.hyphenateAcrossColumns", "bodyText.stacks", "bodyText.stackMinCharacters", "bodyText.stackPenalty", "bodyText.citationBreaks", "bodyText.citationBreakPenalty", "bodyText.operatorBreaks", "bodyText.operatorBreakPenalty"];
|
|
37
48
|
readonly headings: readonly ["headings", "headingStyles", "toc", "index", "crossRefs"];
|
|
38
49
|
readonly lists: readonly ["unorderedLists", "orderedLists"];
|
|
39
50
|
readonly figures: readonly ["captionStyle", "tableStyle", "tableStyles", "diagramStyle", "scoreStyle", "scoreStyles", "videoStyle", "labelStyles"];
|
|
@@ -55,9 +66,9 @@ export declare const DESIGN_CARRIED_KEYS: readonly ["customFonts", "chapterStyle
|
|
|
55
66
|
export interface DesignPartSlot {
|
|
56
67
|
part: DesignPart;
|
|
57
68
|
key: keyof PostextConfig;
|
|
58
|
-
/** One field of `key
|
|
69
|
+
/** One field of `key`, dotted when it is deeper (`hyphenation.ladders`). */
|
|
59
70
|
field?: string;
|
|
60
|
-
/** The fields of `key` that belong to other parts. */
|
|
71
|
+
/** The fields of `key` that belong to other parts (dotted as `field`). */
|
|
61
72
|
except?: readonly string[];
|
|
62
73
|
}
|
|
63
74
|
/** Every slot, in part order. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parts.d.ts","sourceRoot":"","sources":["../../src/designs/parts.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"parts.d.ts","sourceRoot":"","sources":["../../src/designs/parts.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AACjD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AACvD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAA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;AAED;kEACkE;AAClE,wBAAgB,YAAY,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,UAAU,GAAG,SAAS,CAWhF;AA4BD;4EAC4E;AAC5E,wBAAgB,cAAc,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,cAAc,GAAG,OAAO,CAS5E;AAED;;mBAEmB;AACnB,wBAAgB,eAAe,CAAC,CAAC,SAAS,MAAM,EAAE,MAAM,EAAE,CAAC,EAAE,IAAI,EAAE,cAAc,EAAE,KAAK,EAAE,OAAO,GAAG,CAAC,CAkBpG"}
|
package/dist/designs/parts.js
CHANGED
|
@@ -16,12 +16,19 @@
|
|
|
16
16
|
* - `layout`: the writing mode belongs to the writing system; the rest of
|
|
17
17
|
* `layout` (columns, gutters, floats, balancing) is the page part.
|
|
18
18
|
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
19
|
+
* - `bodyText`: the composition rules (#1540) — where hyphens may fall,
|
|
20
|
+
* the letters a hyphen leaves, the stacks, the citation and operator
|
|
21
|
+
* breaks, a hyphen at a column's foot — are the composition part, the
|
|
22
|
+
* rest is the text part. So the rules of a language's tradition are
|
|
23
|
+
* saved and applied apart from the type they are set in.
|
|
24
|
+
*
|
|
25
|
+
* A dotted entry (`page.binding`, `bodyText.hyphenation.ladders`) claims
|
|
26
|
+
* that one field, however deep; the whole-key entry (`page`) takes every
|
|
27
|
+
* field the dotted entries leave.
|
|
21
28
|
*/
|
|
22
29
|
/** Every part, in the Design panel's order. */
|
|
23
30
|
export const DESIGN_PARTS = [
|
|
24
|
-
'page', 'writing', 'colors', 'text', 'headings', 'lists', 'figures',
|
|
31
|
+
'page', 'writing', 'colors', 'text', 'composition', 'headings', 'lists', 'figures',
|
|
25
32
|
'callouts', 'exercises', 'comics', 'running', 'parts', 'output', 'folio', 'advanced',
|
|
26
33
|
];
|
|
27
34
|
/** The settings of each part. */
|
|
@@ -33,6 +40,16 @@ export const DESIGN_PART_KEYS = {
|
|
|
33
40
|
'bodyText', 'paragraphStyles', 'chipStyles', 'characterStyles', 'markStyles', 'codeStyle',
|
|
34
41
|
'math', 'footnotes', 'links', 'lineNumbers', 'citations', 'symbolFont',
|
|
35
42
|
],
|
|
43
|
+
composition: [
|
|
44
|
+
'bodyText.hyphenation.minWordLength', 'bodyText.hyphenation.leftMin', 'bodyText.hyphenation.rightMin',
|
|
45
|
+
'bodyText.hyphenation.capitalized', 'bodyText.hyphenation.fewerHyphens',
|
|
46
|
+
'bodyText.hyphenation.ladders', 'bodyText.hyphenation.maxConsecutive', 'bodyText.hyphenation.ladderPenalty',
|
|
47
|
+
'bodyText.hyphenation.lastWord', 'bodyText.hyphenation.lastWordPenalty',
|
|
48
|
+
'bodyText.hyphenateAcrossColumns',
|
|
49
|
+
'bodyText.stacks', 'bodyText.stackMinCharacters', 'bodyText.stackPenalty',
|
|
50
|
+
'bodyText.citationBreaks', 'bodyText.citationBreakPenalty',
|
|
51
|
+
'bodyText.operatorBreaks', 'bodyText.operatorBreakPenalty',
|
|
52
|
+
],
|
|
36
53
|
headings: ['headings', 'headingStyles', 'toc', 'index', 'crossRefs'],
|
|
37
54
|
lists: ['unorderedLists', 'orderedLists'],
|
|
38
55
|
figures: ['captionStyle', 'tableStyle', 'tableStyles', 'diagramStyle', 'scoreStyle', 'scoreStyles', 'videoStyle', 'labelStyles'],
|
|
@@ -108,19 +125,43 @@ export function designPartOf(key, field) {
|
|
|
108
125
|
return whole;
|
|
109
126
|
}
|
|
110
127
|
const isObject = (v) => typeof v === 'object' && v !== null && !Array.isArray(v);
|
|
128
|
+
/** The value at the dotted `path` of `node`, or undefined. */
|
|
129
|
+
function getAt(node, path) {
|
|
130
|
+
let at = node;
|
|
131
|
+
for (const k of path.split('.')) {
|
|
132
|
+
if (!isObject(at))
|
|
133
|
+
return undefined;
|
|
134
|
+
at = at[k];
|
|
135
|
+
}
|
|
136
|
+
return at;
|
|
137
|
+
}
|
|
138
|
+
/** `node` (an object, or nothing) with the dotted `path` set to `value`,
|
|
139
|
+
* or removed when it is undefined; the objects on the way are copied, and
|
|
140
|
+
* one left with no field goes too (undefined when `node` is left empty). */
|
|
141
|
+
function setAt(node, path, value) {
|
|
142
|
+
const [k, ...rest] = path;
|
|
143
|
+
const out = isObject(node) ? { ...node } : {};
|
|
144
|
+
const child = rest.length === 0 ? value : setAt(out[k], rest, value);
|
|
145
|
+
if (child === undefined)
|
|
146
|
+
delete out[k];
|
|
147
|
+
else
|
|
148
|
+
out[k] = child;
|
|
149
|
+
return Object.keys(out).length > 0 ? out : undefined;
|
|
150
|
+
}
|
|
111
151
|
/** The value of `slot` in `config` (an override works as well): undefined
|
|
112
152
|
* when it is unset (an object slot left with no field counts as unset). */
|
|
113
153
|
export function readDesignSlot(config, slot) {
|
|
114
154
|
const value = config[slot.key];
|
|
115
155
|
if (slot.field !== undefined)
|
|
116
|
-
return
|
|
156
|
+
return getAt(value, slot.field);
|
|
117
157
|
if (!slot.except || !isObject(value))
|
|
118
158
|
return value;
|
|
119
|
-
|
|
120
|
-
for (const
|
|
121
|
-
if (
|
|
122
|
-
rest
|
|
123
|
-
|
|
159
|
+
let rest = value;
|
|
160
|
+
for (const path of slot.except) {
|
|
161
|
+
if (getAt(rest, path) !== undefined)
|
|
162
|
+
rest = setAt(rest, path.split('.'), undefined);
|
|
163
|
+
}
|
|
164
|
+
return rest;
|
|
124
165
|
}
|
|
125
166
|
/** `config` with `slot` set to `value` (unset when undefined), the other
|
|
126
167
|
* parts' fields of the same key kept. Returns a new object; `config` is
|
|
@@ -128,35 +169,25 @@ export function readDesignSlot(config, slot) {
|
|
|
128
169
|
export function writeDesignSlot(config, slot, value) {
|
|
129
170
|
const next = { ...config };
|
|
130
171
|
const current = next[slot.key];
|
|
172
|
+
let written;
|
|
131
173
|
if (slot.field !== undefined) {
|
|
132
|
-
|
|
133
|
-
if (value === undefined)
|
|
134
|
-
delete obj[slot.field];
|
|
135
|
-
else
|
|
136
|
-
obj[slot.field] = value;
|
|
137
|
-
if (Object.keys(obj).length > 0)
|
|
138
|
-
next[slot.key] = obj;
|
|
139
|
-
else
|
|
140
|
-
delete next[slot.key];
|
|
141
|
-
return next;
|
|
174
|
+
written = setAt(current, slot.field.split('.'), value);
|
|
142
175
|
}
|
|
143
|
-
if (!slot.except) {
|
|
144
|
-
|
|
145
|
-
delete next[slot.key];
|
|
146
|
-
else
|
|
147
|
-
next[slot.key] = value;
|
|
148
|
-
return next;
|
|
176
|
+
else if (!slot.except) {
|
|
177
|
+
written = value;
|
|
149
178
|
}
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
179
|
+
else {
|
|
180
|
+
// The design's value, less any field of another part it carries, with
|
|
181
|
+
// the book's fields of the other parts put back.
|
|
182
|
+
let merged = isObject(value) ? value : undefined;
|
|
183
|
+
for (const path of slot.except)
|
|
184
|
+
merged = setAt(merged, path.split('.'), getAt(current, path));
|
|
185
|
+
written = merged;
|
|
186
|
+
}
|
|
187
|
+
if (written === undefined)
|
|
159
188
|
delete next[slot.key];
|
|
189
|
+
else
|
|
190
|
+
next[slot.key] = written;
|
|
160
191
|
return next;
|
|
161
192
|
}
|
|
162
193
|
//# sourceMappingURL=parts.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parts.js","sourceRoot":"","sources":["../../src/designs/parts.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"parts.js","sourceRoot":"","sources":["../../src/designs/parts.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAeH,+CAA+C;AAC/C,MAAM,CAAC,MAAM,YAAY,GAA0B;IACjD,MAAM,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,EAAE,aAAa,EAAE,UAAU,EAAE,OAAO,EAAE,SAAS;IAClF,UAAU,EAAE,WAAW,EAAE,QAAQ,EAAE,SAAS,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C;QACxB,OAAO,GAAG,KAAK,CAAC;IAClB,CAAC;SAAM,CAAC;QACN,sEAAsE;QACtE,iDAAiD;QACjD,IAAI,MAAM,GAAqB,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC;QACnE,KAAK,MAAM,IAAI,IAAI,IAAI,CAAC,MAAM;YAAE,MAAM,GAAG,KAAK,CAAC,MAAM,EAAE,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE,KAAK,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC,CAAC;QAC9F,OAAO,GAAG,MAAM,CAAC;IACnB,CAAC;IACD,IAAI,OAAO,KAAK,SAAS;QAAE,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;;QAC5C,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,OAAO,CAAC;IAC9B,OAAO,IAAS,CAAC;AACnB,CAAC"}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import type { CustomFontFamily, Resource } from '../types.js';
|
|
2
|
+
import type { VDTDocument } from '../vdt.js';
|
|
3
|
+
/** One `@font-face` of the page: the file's URL as the host serves it (a
|
|
4
|
+
* data URI, a path beside the page). */
|
|
5
|
+
export interface HtmlBookFace {
|
|
6
|
+
family: string;
|
|
7
|
+
weight: number | string;
|
|
8
|
+
style: string;
|
|
9
|
+
url: string;
|
|
10
|
+
/** The characters the file holds, when it is one slice of a face. */
|
|
11
|
+
unicodeRange?: string;
|
|
12
|
+
}
|
|
13
|
+
/** A family the book may not hand on (`redistributable: false`, #993):
|
|
14
|
+
* set in the open family it names as `standIn`, under its own name, or,
|
|
15
|
+
* without one, named without its file. */
|
|
16
|
+
export interface HtmlBookFontNote {
|
|
17
|
+
family: string;
|
|
18
|
+
standIn?: string;
|
|
19
|
+
}
|
|
20
|
+
/** What the page could not do as asked: the HTML backend's warnings
|
|
21
|
+
* (`html.missingImage`, `html.svgFontUnavailable`…) and the families
|
|
22
|
+
* left out of it (`fontStoodIn`, `fontWithheld`). */
|
|
23
|
+
export interface HtmlBookWarning {
|
|
24
|
+
kind: string;
|
|
25
|
+
severity: 'info' | 'warning';
|
|
26
|
+
message: string;
|
|
27
|
+
}
|
|
28
|
+
export interface RenderHtmlBookOptions {
|
|
29
|
+
/** The page's `<title>`. */
|
|
30
|
+
title: string;
|
|
31
|
+
/** The page's `lang`. */
|
|
32
|
+
lang: string;
|
|
33
|
+
/** Pages side by side (`multi`, the default) or one under another. */
|
|
34
|
+
mode?: 'single' | 'multi';
|
|
35
|
+
/** The fonts the pages are set in, as `@font-face` rules. */
|
|
36
|
+
faces: readonly HtmlBookFace[];
|
|
37
|
+
/** The families left out ({@link HtmlBookFontNote}), reported first. */
|
|
38
|
+
fontNotes?: readonly HtmlBookFontNote[];
|
|
39
|
+
/** A picture's URL by its `fileId`: the bytes of {@link htmlBookFiles}
|
|
40
|
+
* served by the host. Undefined draws a placeholder. */
|
|
41
|
+
pictureUrl: (fileId: string) => string | undefined;
|
|
42
|
+
/** A self-hosted video's URL by its `fileId`. */
|
|
43
|
+
videoUrl?: (fileId: string) => string | undefined;
|
|
44
|
+
/** Self-hosted videos shown as their posters (a page with no file
|
|
45
|
+
* beside it has no video to play). */
|
|
46
|
+
videoPosters?: boolean;
|
|
47
|
+
onWarning?: (warning: HtmlBookWarning) => void;
|
|
48
|
+
}
|
|
49
|
+
/** What a family left out of the page is reported as. */
|
|
50
|
+
export declare function fontNoteWarning(note: HtmlBookFontNote, output?: string): HtmlBookWarning;
|
|
51
|
+
/** One `@font-face` rule; `unicode-range` only on a slice. */
|
|
52
|
+
export declare function htmlFontFaceRule(face: HtmlBookFace): string;
|
|
53
|
+
/**
|
|
54
|
+
* The book's chapters (one document each, in order, as `buildBundle` or a
|
|
55
|
+
* print chain gives them) as one self-contained HTML page. The pages are
|
|
56
|
+
* the print layout in page pixels (`page.dpi`), shown at 96 dpi as a
|
|
57
|
+
* browser sizes a printed inch; the paper colour fills the window; a
|
|
58
|
+
* reference to a figure another chapter placed links to it; a book with
|
|
59
|
+
* exercises gets the script that makes them answerable.
|
|
60
|
+
*/
|
|
61
|
+
export declare function renderHtmlBook(docs: readonly VDTDocument[], options: RenderHtmlBookOptions): string;
|
|
62
|
+
/** A file the page refers to: a picture (SVGs as the screen shows them,
|
|
63
|
+
* recoloured for single ink) or a self-hosted video. */
|
|
64
|
+
export interface HtmlBookFile {
|
|
65
|
+
fileId: string;
|
|
66
|
+
kind: 'picture' | 'video';
|
|
67
|
+
/** The bytes to serve, or the SVG markup. */
|
|
68
|
+
content: Uint8Array | string;
|
|
69
|
+
}
|
|
70
|
+
/** The pictures (and, with `videos`, the self-hosted videos) the book's
|
|
71
|
+
* resources name and `bytesOf` has, in the order the resources list
|
|
72
|
+
* them, each once. `inkHex`: the single-ink colour (`diagramInkHex`), or
|
|
73
|
+
* null. */
|
|
74
|
+
export declare function htmlBookFiles(resources: readonly Resource[], bytesOf: (fileId: string) => Uint8Array | undefined, options: {
|
|
75
|
+
inkHex: string | null;
|
|
76
|
+
videos?: boolean;
|
|
77
|
+
}): HtmlBookFile[];
|
|
78
|
+
/**
|
|
79
|
+
* The faces a file that leaves the app may carry (#993): every face of
|
|
80
|
+
* `used` but those of a family marked `redistributable: false`, whose
|
|
81
|
+
* place is taken by the faces `standIn` gives for it (the open family it
|
|
82
|
+
* names as its fallback, under its own name), once per family. The notes
|
|
83
|
+
* say which families were stood in or left without a file.
|
|
84
|
+
*/
|
|
85
|
+
export declare function redistributableFaces<F extends {
|
|
86
|
+
family: string;
|
|
87
|
+
}>(used: Iterable<F>, customFonts: readonly Pick<CustomFontFamily, 'name' | 'redistributable'>[] | undefined, standIn: (family: string) => Promise<(F & {
|
|
88
|
+
standsInFor?: string;
|
|
89
|
+
})[]>): Promise<{
|
|
90
|
+
faces: F[];
|
|
91
|
+
notes: HtmlBookFontNote[];
|
|
92
|
+
}>;
|
|
93
|
+
//# sourceMappingURL=book.d.ts.map
|
|
@@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C,EAAE,CAAC;IAAC,KAAK,EAAE,gBAAgB,EAAE,CAAA;CAAE,CAAC,CAsBpD"}
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
// A whole book as one HTML page (#1544): every chapter's pages, positioned
|
|
2
|
+
// text the browser can select, search and read aloud, with the page's
|
|
3
|
+
// fonts, the exercise script and the links between chapters. The command
|
|
4
|
+
// line's `postext html` and the Sandbox's Library (Download as HTML) both
|
|
5
|
+
// write the page here; each host resolves where pictures, videos and font
|
|
6
|
+
// files live (data URIs, files beside the page) and hands over the URLs.
|
|
7
|
+
// No file system, no DOM: the module runs in Node, Bun, a page or a worker.
|
|
8
|
+
import { applySingleInkToSvg } from '../svg/singleInk.js';
|
|
9
|
+
import { screenSvgColors } from '../svg/spotPaints.js';
|
|
10
|
+
import { exerciseDataOf } from '../exercises/digital.js';
|
|
11
|
+
import { EXERCISE_SCRIPT } from '../exercises/runtime.js';
|
|
12
|
+
import { formatWarning } from '../pipeline/contentWarnings.js';
|
|
13
|
+
import { anchoredResourceIds } from './segmentText.js';
|
|
14
|
+
import { HTML_TEXT_RESET, renderToHtml } from './render.js';
|
|
15
|
+
/** What a family left out of the page is reported as. */
|
|
16
|
+
export function fontNoteWarning(note, output = 'HTML') {
|
|
17
|
+
return note.standIn
|
|
18
|
+
? { kind: 'fontStoodIn', severity: 'info', message: `"${note.family}" may not be copied out of the book: the ${output} sets it in ${note.standIn}, under the same name` }
|
|
19
|
+
: { kind: 'fontWithheld', severity: 'info', message: `"${note.family}" may not be copied out of the book: the ${output} names it without its file` };
|
|
20
|
+
}
|
|
21
|
+
const escapeHtml = (s) => s.replace(/[&<>"]/g, (c) => ({ '&': '&', '<': '<', '>': '>', '"': '"' })[c]);
|
|
22
|
+
/** One `@font-face` rule; `unicode-range` only on a slice. */
|
|
23
|
+
export function htmlFontFaceRule(face) {
|
|
24
|
+
return `@font-face{font-family:${JSON.stringify(face.family)};font-weight:${face.weight};font-style:${face.style};font-display:block;src:url(${JSON.stringify(face.url)})${face.unicodeRange ? `;unicode-range:${face.unicodeRange}` : ''}}`;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* The book's chapters (one document each, in order, as `buildBundle` or a
|
|
28
|
+
* print chain gives them) as one self-contained HTML page. The pages are
|
|
29
|
+
* the print layout in page pixels (`page.dpi`), shown at 96 dpi as a
|
|
30
|
+
* browser sizes a printed inch; the paper colour fills the window; a
|
|
31
|
+
* reference to a figure another chapter placed links to it; a book with
|
|
32
|
+
* exercises gets the script that makes them answerable.
|
|
33
|
+
*/
|
|
34
|
+
export function renderHtmlBook(docs, options) {
|
|
35
|
+
const { onWarning } = options;
|
|
36
|
+
for (const note of options.fontNotes ?? [])
|
|
37
|
+
onWarning?.(fontNoteWarning(note));
|
|
38
|
+
const refTargets = new Set(docs.flatMap((d) => [...anchoredResourceIds(d)]));
|
|
39
|
+
// The URLs serve the pictures as the screen shows them (single ink
|
|
40
|
+
// applied by htmlBookFiles): no filter on top.
|
|
41
|
+
const resourceImageUrl = Object.assign((fileId) => options.pictureUrl(fileId), { singleInk: false });
|
|
42
|
+
const renderOptions = {
|
|
43
|
+
mode: options.mode ?? 'multi',
|
|
44
|
+
refTargets,
|
|
45
|
+
resourceImageUrl,
|
|
46
|
+
resourceVideoUrl: (fileId) => options.videoUrl?.(fileId),
|
|
47
|
+
...(options.videoPosters ? { videos: { files: 'poster' } } : {}),
|
|
48
|
+
singleInk: false,
|
|
49
|
+
onWarning: (w) => onWarning?.({ kind: `html.${w.kind}`, severity: 'warning', message: formatWarning(w) }),
|
|
50
|
+
};
|
|
51
|
+
const body = docs.map((d) => renderToHtml(d, renderOptions)).join('\n');
|
|
52
|
+
// Exercises (#1230): the script that makes them answerable, checks
|
|
53
|
+
// them and keeps the answers in the browser, under the file's path.
|
|
54
|
+
const exercises = docs.some((d) => exerciseDataOf(d) !== undefined)
|
|
55
|
+
? `<script>${EXERCISE_SCRIPT.replace(/<\/(script)/gi, '<\\/$1')}</script>`
|
|
56
|
+
: '';
|
|
57
|
+
// The pages are the print layout, in page pixels (page.dpi, 300 by
|
|
58
|
+
// default): shown at 96 dpi, as a browser sizes a printed inch.
|
|
59
|
+
const dpi = docs[0]?.config.page.dpi ?? 96;
|
|
60
|
+
const zoom = Math.round((96 / dpi) * 10000) / 10000;
|
|
61
|
+
// The paper colour fills the window, as in the Sandbox's HTML view
|
|
62
|
+
// (a translucent colour over white).
|
|
63
|
+
const paper = docs[0]?.config.page.backgroundColor?.hex;
|
|
64
|
+
const background = !paper || paper === 'transparent' ? '#ffffff' : `linear-gradient(${paper},${paper}),#ffffff`;
|
|
65
|
+
return [
|
|
66
|
+
'<!doctype html>',
|
|
67
|
+
`<html lang="${escapeHtml(options.lang)}">`,
|
|
68
|
+
'<head>',
|
|
69
|
+
'<meta charset="utf-8">',
|
|
70
|
+
'<meta name="viewport" content="width=device-width, initial-scale=1">',
|
|
71
|
+
`<meta name="generator" content="postext">`,
|
|
72
|
+
`<title>${escapeHtml(options.title)}</title>`,
|
|
73
|
+
'<style>',
|
|
74
|
+
...options.faces.map(htmlFontFaceRule),
|
|
75
|
+
`html,body{margin:0;background:${background}}body{${HTML_TEXT_RESET}}`,
|
|
76
|
+
`.postext-book{zoom:${zoom};padding:24px 0}`,
|
|
77
|
+
'.postext-book .pt-page{margin-left:auto;margin-right:auto}',
|
|
78
|
+
'</style>',
|
|
79
|
+
'</head>',
|
|
80
|
+
'<body>',
|
|
81
|
+
'<main class="postext-book">',
|
|
82
|
+
body,
|
|
83
|
+
'</main>',
|
|
84
|
+
...(exercises ? [exercises] : []),
|
|
85
|
+
'</body>',
|
|
86
|
+
'</html>',
|
|
87
|
+
'',
|
|
88
|
+
].join('\n');
|
|
89
|
+
}
|
|
90
|
+
/** The pictures (and, with `videos`, the self-hosted videos) the book's
|
|
91
|
+
* resources name and `bytesOf` has, in the order the resources list
|
|
92
|
+
* them, each once. `inkHex`: the single-ink colour (`diagramInkHex`), or
|
|
93
|
+
* null. */
|
|
94
|
+
export function htmlBookFiles(resources, bytesOf, options) {
|
|
95
|
+
const out = [];
|
|
96
|
+
const seen = new Set();
|
|
97
|
+
for (const r of resources) {
|
|
98
|
+
const fileId = r.kind === 'svg' ? r.svg?.fileId : r.kind === 'bitmap' ? r.bitmap?.fileId : r.kind === 'video' ? r.video?.poster?.fileId : undefined;
|
|
99
|
+
const bytes = fileId ? bytesOf(fileId) : undefined;
|
|
100
|
+
if (fileId && bytes && !seen.has(fileId)) {
|
|
101
|
+
seen.add(fileId);
|
|
102
|
+
// A spot ink named in a paint is the print PDF's: here, the colour.
|
|
103
|
+
const text = r.kind === 'svg' ? new TextDecoder().decode(bytes) : undefined;
|
|
104
|
+
const svg = text !== undefined ? screenSvgColors(text) : undefined;
|
|
105
|
+
const content = svg !== undefined && (options.inkHex || svg !== text) ? (options.inkHex ? applySingleInkToSvg(svg, options.inkHex) : svg) : bytes;
|
|
106
|
+
out.push({ fileId, kind: 'picture', content });
|
|
107
|
+
}
|
|
108
|
+
// Self-hosted videos go beside the page; embedded, they show their poster.
|
|
109
|
+
const video = r.kind === 'video' ? r.video?.fileId : undefined;
|
|
110
|
+
const videoBytes = video && options.videos ? bytesOf(video) : undefined;
|
|
111
|
+
if (video && videoBytes && !seen.has(video)) {
|
|
112
|
+
seen.add(video);
|
|
113
|
+
out.push({ fileId: video, kind: 'video', content: videoBytes });
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
return out;
|
|
117
|
+
}
|
|
118
|
+
/**
|
|
119
|
+
* The faces a file that leaves the app may carry (#993): every face of
|
|
120
|
+
* `used` but those of a family marked `redistributable: false`, whose
|
|
121
|
+
* place is taken by the faces `standIn` gives for it (the open family it
|
|
122
|
+
* names as its fallback, under its own name), once per family. The notes
|
|
123
|
+
* say which families were stood in or left without a file.
|
|
124
|
+
*/
|
|
125
|
+
export async function redistributableFaces(used, customFonts, standIn) {
|
|
126
|
+
const withheld = new Set((customFonts ?? []).filter((f) => f.redistributable === false).map((f) => f.name.toLowerCase()));
|
|
127
|
+
const faces = [];
|
|
128
|
+
const notes = [];
|
|
129
|
+
const told = new Set();
|
|
130
|
+
for (const f of used) {
|
|
131
|
+
const key = f.family.toLowerCase();
|
|
132
|
+
if (!withheld.has(key)) {
|
|
133
|
+
faces.push(f);
|
|
134
|
+
continue;
|
|
135
|
+
}
|
|
136
|
+
if (told.has(key))
|
|
137
|
+
continue;
|
|
138
|
+
told.add(key);
|
|
139
|
+
const stand = await standIn(f.family);
|
|
140
|
+
if (stand.length > 0) {
|
|
141
|
+
notes.push({ family: f.family, standIn: stand[0].standsInFor ?? f.family });
|
|
142
|
+
faces.push(...stand);
|
|
143
|
+
}
|
|
144
|
+
else {
|
|
145
|
+
notes.push({ family: f.family });
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
return { faces, notes };
|
|
149
|
+
}
|
|
150
|
+
//# sourceMappingURL=book.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"book.js","sourceRoot":"","sources":["../../src/html-backend/book.ts"],"names":[],"mappings":"AAAA,2EAA2E;AAC3E,sEAAsE;AACtE,yEAAyE;AACzE,0EAA0E;AAC1E,0EAA0E;AAC1E,yEAAyE;AACzE,4EAA4E;AAK5E,OAAO,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAC1D,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AACzD,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAC/D,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,EAAE,eAAe,EAAE,YAAY,EAA0B,MAAM,aAAa,CAAC;AAoDpF,yDAAyD;AACzD,MAAM,UAAU,eAAe,CAAC,IAAsB,EAAE,MAAM,GAAG,MAAM;IACrE,OAAO,IAAI,CAAC,OAAO;QACjB,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/B,KAAK,MAAM,CAAC,IAAI,IAAI,EAAE,CAAC;QACrB,MAAM,GAAG,GAAG,CAAC,CAAC,MAAM,CAAC,WAAW,EAAE,CAAC;QACnC,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC;YACvB,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;YACd,SAAS;QACX,CAAC;QACD,IAAI,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC;YAAE,SAAS;QAC5B,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;QACd,MAAM,KAAK,GAAG,MAAM,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC;QACtC,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YACrB,KAAK,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,OAAO,EAAE,KAAK,CAAC,CAAC,CAAE,CAAC,WAAW,IAAI,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC;YAC7E,KAAK,CAAC,IAAI,CAAC,GAAG,KAAK,CAAC,CAAC;QACvB,CAAC;aAAM,CAAC;YACN,KAAK,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC;QACnC,CAAC;IACH,CAAC;IACD,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC;AAC1B,CAAC"}
|
|
@@ -2,4 +2,6 @@ export { HTML_TEXT_RESET, renderToHtmlIndexed, renderToHtml } from './render.js'
|
|
|
2
2
|
export type { RenderHtmlOptions, HtmlRenderIndexPage, HtmlRenderIndex } from './render.js';
|
|
3
3
|
export { anchoredResourceIds } from './segmentText.js';
|
|
4
4
|
export { tintHex, tintFilterElement } from './images.js';
|
|
5
|
+
export { renderHtmlBook, htmlBookFiles, htmlFontFaceRule, redistributableFaces, fontNoteWarning } from './book.js';
|
|
6
|
+
export type { RenderHtmlBookOptions, HtmlBookFace, HtmlBookFile, HtmlBookFontNote, HtmlBookWarning } from './book.js';
|
|
5
7
|
//# sourceMappingURL=html-backend.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"html-backend.d.ts","sourceRoot":"","sources":["../../src/html-backend/html-backend.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,mBAAmB,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AACjF,YAAY,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAC3F,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,EAAE,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC"}
|
|
1
|
+
{"version":3,"file":"html-backend.d.ts","sourceRoot":"","sources":["../../src/html-backend/html-backend.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,mBAAmB,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AACjF,YAAY,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAC3F,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,EAAE,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAGzD,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AACnH,YAAY,EAAE,qBAAqB,EAAE,YAAY,EAAE,YAAY,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC"}
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
export { HTML_TEXT_RESET, renderToHtmlIndexed, renderToHtml } from './render.js';
|
|
2
2
|
export { anchoredResourceIds } from './segmentText.js';
|
|
3
3
|
export { tintHex, tintFilterElement } from './images.js';
|
|
4
|
+
// A whole book as one HTML page (#1544): the CLI's `postext html` and the
|
|
5
|
+
// Sandbox's Library write it here.
|
|
6
|
+
export { renderHtmlBook, htmlBookFiles, htmlFontFaceRule, redistributableFaces, fontNoteWarning } from './book.js';
|
|
4
7
|
//# sourceMappingURL=html-backend.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"html-backend.js","sourceRoot":"","sources":["../../src/html-backend/html-backend.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,mBAAmB,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAEjF,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,EAAE,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC"}
|
|
1
|
+
{"version":3,"file":"html-backend.js","sourceRoot":"","sources":["../../src/html-backend/html-backend.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,mBAAmB,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAEjF,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,EAAE,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AACzD,0EAA0E;AAC1E,mCAAmC;AACnC,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC"}
|