postext 1.63.3 → 1.63.5
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/bundle/codec/files.d.ts +20 -0
- package/dist/bundle/codec/files.d.ts.map +1 -0
- package/dist/bundle/codec/files.js +92 -0
- package/dist/bundle/codec/files.js.map +1 -0
- package/dist/bundle/codec/plan.d.ts +114 -0
- package/dist/bundle/codec/plan.d.ts.map +1 -0
- package/dist/bundle/codec/plan.js +367 -0
- package/dist/bundle/codec/plan.js.map +1 -0
- package/dist/bundle/codec/read.d.ts +92 -0
- package/dist/bundle/codec/read.d.ts.map +1 -0
- package/dist/bundle/codec/read.js +249 -0
- package/dist/bundle/codec/read.js.map +1 -0
- package/dist/bundle/codec.d.ts +6 -218
- package/dist/bundle/codec.d.ts.map +1 -1
- package/dist/bundle/codec.js +3 -699
- package/dist/bundle/codec.js.map +1 -1
- package/dist/bundle/manifest/entries.d.ts +25 -0
- package/dist/bundle/manifest/entries.d.ts.map +1 -0
- package/dist/bundle/manifest/entries.js +108 -0
- package/dist/bundle/manifest/entries.js.map +1 -0
- package/dist/bundle/manifest/fileNames.d.ts +38 -0
- package/dist/bundle/manifest/fileNames.d.ts.map +1 -0
- package/dist/bundle/manifest/fileNames.js +143 -0
- package/dist/bundle/manifest/fileNames.js.map +1 -0
- package/dist/bundle/manifest/locale.d.ts +61 -0
- package/dist/bundle/manifest/locale.d.ts.map +1 -0
- package/dist/bundle/manifest/locale.js +216 -0
- package/dist/bundle/manifest/locale.js.map +1 -0
- package/dist/bundle/manifest/sizes.d.ts +18 -0
- package/dist/bundle/manifest/sizes.d.ts.map +1 -0
- package/dist/bundle/manifest/sizes.js +257 -0
- package/dist/bundle/manifest/sizes.js.map +1 -0
- package/dist/bundle/manifest/validation.d.ts +10 -0
- package/dist/bundle/manifest/validation.d.ts.map +1 -0
- package/dist/bundle/manifest/validation.js +114 -0
- package/dist/bundle/manifest/validation.js.map +1 -0
- package/dist/bundle/manifest.d.ts +7 -139
- package/dist/bundle/manifest.d.ts.map +1 -1
- package/dist/bundle/manifest.js +5 -829
- package/dist/bundle/manifest.js.map +1 -1
- package/dist/canvas-backend/blockRender/block.d.ts +5 -0
- package/dist/canvas-backend/blockRender/block.d.ts.map +1 -0
- package/dist/canvas-backend/blockRender/block.js +240 -0
- package/dist/canvas-backend/blockRender/block.js.map +1 -0
- package/dist/canvas-backend/blockRender/lines.d.ts +16 -0
- package/dist/canvas-backend/blockRender/lines.d.ts.map +1 -0
- package/dist/canvas-backend/blockRender/lines.js +192 -0
- package/dist/canvas-backend/blockRender/lines.js.map +1 -0
- package/dist/canvas-backend/blockRender/segments.d.ts +54 -0
- package/dist/canvas-backend/blockRender/segments.d.ts.map +1 -0
- package/dist/canvas-backend/blockRender/segments.js +311 -0
- package/dist/canvas-backend/blockRender/segments.js.map +1 -0
- package/dist/canvas-backend/blockRender.d.ts +2 -7
- package/dist/canvas-backend/blockRender.d.ts.map +1 -1
- package/dist/canvas-backend/blockRender.js +3 -727
- package/dist/canvas-backend/blockRender.js.map +1 -1
- package/dist/canvas-backend/renderResourceBlock/block.d.ts +9 -0
- package/dist/canvas-backend/renderResourceBlock/block.d.ts.map +1 -0
- package/dist/canvas-backend/renderResourceBlock/block.js +185 -0
- package/dist/canvas-backend/renderResourceBlock/block.js.map +1 -0
- package/dist/canvas-backend/renderResourceBlock/images.d.ts +67 -0
- package/dist/canvas-backend/renderResourceBlock/images.d.ts.map +1 -0
- package/dist/canvas-backend/renderResourceBlock/images.js +224 -0
- package/dist/canvas-backend/renderResourceBlock/images.js.map +1 -0
- package/dist/canvas-backend/renderResourceBlock/overlays.d.ts +10 -0
- package/dist/canvas-backend/renderResourceBlock/overlays.d.ts.map +1 -0
- package/dist/canvas-backend/renderResourceBlock/overlays.js +107 -0
- package/dist/canvas-backend/renderResourceBlock/overlays.js.map +1 -0
- package/dist/canvas-backend/renderResourceBlock/table.d.ts +3 -0
- package/dist/canvas-backend/renderResourceBlock/table.d.ts.map +1 -0
- package/dist/canvas-backend/renderResourceBlock/table.js +143 -0
- package/dist/canvas-backend/renderResourceBlock/table.js.map +1 -0
- package/dist/canvas-backend/renderResourceBlock/text.d.ts +11 -0
- package/dist/canvas-backend/renderResourceBlock/text.d.ts.map +1 -0
- package/dist/canvas-backend/renderResourceBlock/text.js +141 -0
- package/dist/canvas-backend/renderResourceBlock/text.js.map +1 -0
- package/dist/canvas-backend/renderResourceBlock.d.ts +4 -81
- package/dist/canvas-backend/renderResourceBlock.d.ts.map +1 -1
- package/dist/canvas-backend/renderResourceBlock.js +3 -777
- package/dist/canvas-backend/renderResourceBlock.js.map +1 -1
- package/dist/canvas-backend/verticalText/alternates.d.ts +47 -0
- package/dist/canvas-backend/verticalText/alternates.d.ts.map +1 -0
- package/dist/canvas-backend/verticalText/alternates.js +240 -0
- package/dist/canvas-backend/verticalText/alternates.js.map +1 -0
- package/dist/canvas-backend/verticalText/painter.d.ts +58 -0
- package/dist/canvas-backend/verticalText/painter.d.ts.map +1 -0
- package/dist/canvas-backend/verticalText/painter.js +329 -0
- package/dist/canvas-backend/verticalText/painter.js.map +1 -0
- package/dist/canvas-backend/verticalText.d.ts +4 -101
- package/dist/canvas-backend/verticalText.d.ts.map +1 -1
- package/dist/canvas-backend/verticalText.js +2 -562
- package/dist/canvas-backend/verticalText.js.map +1 -1
- package/dist/checks/contrast/colours.d.ts +64 -0
- package/dist/checks/contrast/colours.d.ts.map +1 -0
- package/dist/checks/contrast/colours.js +101 -0
- package/dist/checks/contrast/colours.js.map +1 -0
- package/dist/checks/contrast/document.d.ts +17 -0
- package/dist/checks/contrast/document.d.ts.map +1 -0
- package/dist/checks/contrast/document.js +132 -0
- package/dist/checks/contrast/document.js.map +1 -0
- package/dist/checks/contrast/pairs.d.ts +10 -0
- package/dist/checks/contrast/pairs.d.ts.map +1 -0
- package/dist/checks/contrast/pairs.js +462 -0
- package/dist/checks/contrast/pairs.js.map +1 -0
- package/dist/checks/contrast/types.d.ts +114 -0
- package/dist/checks/contrast/types.d.ts.map +1 -0
- package/dist/checks/contrast/types.js +2 -0
- package/dist/checks/contrast/types.js.map +1 -0
- package/dist/checks/contrast.d.ts +5 -170
- package/dist/checks/contrast.d.ts.map +1 -1
- package/dist/checks/contrast.js +3 -686
- package/dist/checks/contrast.js.map +1 -1
- package/dist/comics/layoutPage/letterPanels.d.ts +38 -0
- package/dist/comics/layoutPage/letterPanels.d.ts.map +1 -0
- package/dist/comics/layoutPage/letterPanels.js +146 -0
- package/dist/comics/layoutPage/letterPanels.js.map +1 -0
- package/dist/comics/layoutPage/letteringStyle.d.ts +31 -0
- package/dist/comics/layoutPage/letteringStyle.d.ts.map +1 -0
- package/dist/comics/layoutPage/letteringStyle.js +88 -0
- package/dist/comics/layoutPage/letteringStyle.js.map +1 -0
- package/dist/comics/layoutPage/records.d.ts +25 -0
- package/dist/comics/layoutPage/records.d.ts.map +1 -0
- package/dist/comics/layoutPage/records.js +36 -0
- package/dist/comics/layoutPage/records.js.map +1 -0
- package/dist/comics/layoutPage/settings.d.ts +64 -0
- package/dist/comics/layoutPage/settings.d.ts.map +1 -0
- package/dist/comics/layoutPage/settings.js +168 -0
- package/dist/comics/layoutPage/settings.js.map +1 -0
- package/dist/comics/layoutPage/zones.d.ts +79 -0
- package/dist/comics/layoutPage/zones.d.ts.map +1 -0
- package/dist/comics/layoutPage/zones.js +179 -0
- package/dist/comics/layoutPage/zones.js.map +1 -0
- package/dist/comics/layoutPage.d.ts +8 -113
- package/dist/comics/layoutPage.d.ts.map +1 -1
- package/dist/comics/layoutPage.js +12 -603
- package/dist/comics/layoutPage.js.map +1 -1
- package/dist/comics/lettering/letter/variants.d.ts +28 -0
- package/dist/comics/lettering/letter/variants.d.ts.map +1 -0
- package/dist/comics/lettering/letter/variants.js +269 -0
- package/dist/comics/lettering/letter/variants.js.map +1 -0
- package/dist/comics/lettering/letter.d.ts +32 -1
- package/dist/comics/lettering/letter.d.ts.map +1 -1
- package/dist/comics/lettering/letter.js +8 -270
- package/dist/comics/lettering/letter.js.map +1 -1
- package/dist/comics/lettering/shape-text/breaks.d.ts +53 -0
- package/dist/comics/lettering/shape-text/breaks.d.ts.map +1 -0
- package/dist/comics/lettering/shape-text/breaks.js +217 -0
- package/dist/comics/lettering/shape-text/breaks.js.map +1 -0
- package/dist/comics/lettering/shape-text/measure.d.ts +20 -0
- package/dist/comics/lettering/shape-text/measure.d.ts.map +1 -0
- package/dist/comics/lettering/shape-text/measure.js +160 -0
- package/dist/comics/lettering/shape-text/measure.js.map +1 -0
- package/dist/comics/lettering/shape-text/ruby.d.ts +28 -0
- package/dist/comics/lettering/shape-text/ruby.d.ts.map +1 -0
- package/dist/comics/lettering/shape-text/ruby.js +173 -0
- package/dist/comics/lettering/shape-text/ruby.js.map +1 -0
- package/dist/comics/lettering/shape-text.d.ts +7 -6
- package/dist/comics/lettering/shape-text.d.ts.map +1 -1
- package/dist/comics/lettering/shape-text.js +10 -536
- package/dist/comics/lettering/shape-text.js.map +1 -1
- package/dist/composed/overlap/ink.d.ts +48 -0
- package/dist/composed/overlap/ink.d.ts.map +1 -0
- package/dist/composed/overlap/ink.js +180 -0
- package/dist/composed/overlap/ink.js.map +1 -0
- package/dist/composed/overlap/moves.d.ts +97 -0
- package/dist/composed/overlap/moves.d.ts.map +1 -0
- package/dist/composed/overlap/moves.js +191 -0
- package/dist/composed/overlap/moves.js.map +1 -0
- package/dist/composed/overlap.d.ts +2 -2
- package/dist/composed/overlap.d.ts.map +1 -1
- package/dist/composed/overlap.js +3 -367
- package/dist/composed/overlap.js.map +1 -1
- package/dist/composed/sourceMap/chains.d.ts +27 -0
- package/dist/composed/sourceMap/chains.d.ts.map +1 -0
- package/dist/composed/sourceMap/chains.js +176 -0
- package/dist/composed/sourceMap/chains.js.map +1 -0
- package/dist/composed/sourceMap/frames.d.ts +19 -0
- package/dist/composed/sourceMap/frames.d.ts.map +1 -0
- package/dist/composed/sourceMap/frames.js +143 -0
- package/dist/composed/sourceMap/frames.js.map +1 -0
- package/dist/composed/sourceMap/text.d.ts +52 -0
- package/dist/composed/sourceMap/text.d.ts.map +1 -0
- package/dist/composed/sourceMap/text.js +200 -0
- package/dist/composed/sourceMap/text.js.map +1 -0
- package/dist/composed/sourceMap.d.ts +22 -1
- package/dist/composed/sourceMap.d.ts.map +1 -1
- package/dist/composed/sourceMap.js +7 -511
- package/dist/composed/sourceMap.js.map +1 -1
- package/dist/composed/types/frames.d.ts +290 -0
- package/dist/composed/types/frames.d.ts.map +1 -0
- package/dist/composed/types/frames.js +2 -0
- package/dist/composed/types/frames.js.map +1 -0
- package/dist/composed/types/resolved.d.ts +207 -0
- package/dist/composed/types/resolved.d.ts.map +1 -0
- package/dist/composed/types/resolved.js +2 -0
- package/dist/composed/types/resolved.js.map +1 -0
- package/dist/composed/types/templates.d.ts +152 -0
- package/dist/composed/types/templates.d.ts.map +1 -0
- package/dist/composed/types/templates.js +2 -0
- package/dist/composed/types/templates.js.map +1 -0
- package/dist/composed/types.d.ts +3 -641
- package/dist/composed/types.d.ts.map +1 -1
- package/dist/composed/types.js +8 -0
- package/dist/composed/types.js.map +1 -1
- package/dist/defaults/boxes/calloutStyles/inherit.d.ts +15 -0
- package/dist/defaults/boxes/calloutStyles/inherit.d.ts.map +1 -0
- package/dist/defaults/boxes/calloutStyles/inherit.js +64 -0
- package/dist/defaults/boxes/calloutStyles/inherit.js.map +1 -0
- package/dist/defaults/boxes/calloutStyles/resolve.d.ts +7 -0
- package/dist/defaults/boxes/calloutStyles/resolve.d.ts.map +1 -0
- package/dist/defaults/boxes/calloutStyles/resolve.js +223 -0
- package/dist/defaults/boxes/calloutStyles/resolve.js.map +1 -0
- package/dist/defaults/boxes/calloutStyles/statics.d.ts +136 -0
- package/dist/defaults/boxes/calloutStyles/statics.d.ts.map +1 -0
- package/dist/defaults/boxes/calloutStyles/statics.js +140 -0
- package/dist/defaults/boxes/calloutStyles/statics.js.map +1 -0
- package/dist/defaults/boxes/calloutStyles/strip.d.ts +10 -0
- package/dist/defaults/boxes/calloutStyles/strip.d.ts.map +1 -0
- package/dist/defaults/boxes/calloutStyles/strip.js +336 -0
- package/dist/defaults/boxes/calloutStyles/strip.js.map +1 -0
- package/dist/defaults/boxes/calloutStyles.d.ts +4 -148
- package/dist/defaults/boxes/calloutStyles.d.ts.map +1 -1
- package/dist/defaults/boxes/calloutStyles.js +4 -749
- package/dist/defaults/boxes/calloutStyles.js.map +1 -1
- package/dist/defaults/structure/headerFooter/defaults.d.ts +34 -0
- package/dist/defaults/structure/headerFooter/defaults.d.ts.map +1 -0
- package/dist/defaults/structure/headerFooter/defaults.js +162 -0
- package/dist/defaults/structure/headerFooter/defaults.js.map +1 -0
- package/dist/defaults/structure/headerFooter/legacy.d.ts +8 -0
- package/dist/defaults/structure/headerFooter/legacy.d.ts.map +1 -0
- package/dist/defaults/structure/headerFooter/legacy.js +124 -0
- package/dist/defaults/structure/headerFooter/legacy.js.map +1 -0
- package/dist/defaults/structure/headerFooter/resolve.d.ts +29 -0
- package/dist/defaults/structure/headerFooter/resolve.d.ts.map +1 -0
- package/dist/defaults/structure/headerFooter/resolve.js +231 -0
- package/dist/defaults/structure/headerFooter/resolve.js.map +1 -0
- package/dist/defaults/structure/headerFooter.d.ts +6 -58
- package/dist/defaults/structure/headerFooter.d.ts.map +1 -1
- package/dist/defaults/structure/headerFooter.js +5 -510
- package/dist/defaults/structure/headerFooter.js.map +1 -1
- package/dist/defaults/structure/headings/defaults.d.ts +46 -0
- package/dist/defaults/structure/headings/defaults.d.ts.map +1 -0
- package/dist/defaults/structure/headings/defaults.js +100 -0
- package/dist/defaults/structure/headings/defaults.js.map +1 -0
- package/dist/defaults/structure/headings/resolve.d.ts +17 -0
- package/dist/defaults/structure/headings/resolve.d.ts.map +1 -0
- package/dist/defaults/structure/headings/resolve.js +179 -0
- package/dist/defaults/structure/headings/resolve.js.map +1 -0
- package/dist/defaults/structure/headings/strip.d.ts +9 -0
- package/dist/defaults/structure/headings/strip.d.ts.map +1 -0
- package/dist/defaults/structure/headings/strip.js +323 -0
- package/dist/defaults/structure/headings/strip.js.map +1 -0
- package/dist/defaults/structure/headings.d.ts +3 -62
- package/dist/defaults/structure/headings.d.ts.map +1 -1
- package/dist/defaults/structure/headings.js +3 -594
- package/dist/defaults/structure/headings.js.map +1 -1
- package/dist/defaults/text/bodyText/arabic.d.ts +35 -0
- package/dist/defaults/text/bodyText/arabic.d.ts.map +1 -0
- package/dist/defaults/text/bodyText/arabic.js +85 -0
- package/dist/defaults/text/bodyText/arabic.js.map +1 -0
- package/dist/defaults/text/bodyText/defaults.d.ts +31 -0
- package/dist/defaults/text/bodyText/defaults.d.ts.map +1 -0
- package/dist/defaults/text/bodyText/defaults.js +128 -0
- package/dist/defaults/text/bodyText/defaults.js.map +1 -0
- package/dist/defaults/text/bodyText/resolve.d.ts +12 -0
- package/dist/defaults/text/bodyText/resolve.d.ts.map +1 -0
- package/dist/defaults/text/bodyText/resolve.js +171 -0
- package/dist/defaults/text/bodyText/resolve.js.map +1 -0
- package/dist/defaults/text/bodyText/strip.d.ts +12 -0
- package/dist/defaults/text/bodyText/strip.d.ts.map +1 -0
- package/dist/defaults/text/bodyText/strip.js +305 -0
- package/dist/defaults/text/bodyText/strip.js.map +1 -0
- package/dist/defaults/text/bodyText.d.ts +4 -70
- package/dist/defaults/text/bodyText.d.ts.map +1 -1
- package/dist/defaults/text/bodyText.js +4 -673
- package/dist/defaults/text/bodyText.js.map +1 -1
- package/dist/design/richText/ellipsis.d.ts +26 -0
- package/dist/design/richText/ellipsis.d.ts.map +1 -0
- package/dist/design/richText/ellipsis.js +173 -0
- package/dist/design/richText/ellipsis.js.map +1 -0
- package/dist/design/richText/measure.d.ts +51 -0
- package/dist/design/richText/measure.d.ts.map +1 -0
- package/dist/design/richText/measure.js +176 -0
- package/dist/design/richText/measure.js.map +1 -0
- package/dist/design/richText/parse.d.ts +120 -0
- package/dist/design/richText/parse.d.ts.map +1 -0
- package/dist/design/richText/parse.js +190 -0
- package/dist/design/richText/parse.js.map +1 -0
- package/dist/design/richText/wrap.d.ts +13 -0
- package/dist/design/richText/wrap.d.ts.map +1 -0
- package/dist/design/richText/wrap.js +176 -0
- package/dist/design/richText/wrap.js.map +1 -0
- package/dist/design/richText.d.ts +6 -199
- package/dist/design/richText.d.ts.map +1 -1
- package/dist/design/richText.js +4 -698
- package/dist/design/richText.js.map +1 -1
- package/dist/exercises/grids/arithmetic.d.ts +3 -0
- package/dist/exercises/grids/arithmetic.d.ts.map +1 -0
- package/dist/exercises/grids/arithmetic.js +214 -0
- package/dist/exercises/grids/arithmetic.js.map +1 -0
- package/dist/exercises/grids/common.d.ts +8 -0
- package/dist/exercises/grids/common.d.ts.map +1 -0
- package/dist/exercises/grids/common.js +9 -0
- package/dist/exercises/grids/common.js.map +1 -0
- package/dist/exercises/grids/crossword.d.ts +3 -0
- package/dist/exercises/grids/crossword.d.ts.map +1 -0
- package/dist/exercises/grids/crossword.js +191 -0
- package/dist/exercises/grids/crossword.js.map +1 -0
- package/dist/exercises/grids/match.d.ts +3 -0
- package/dist/exercises/grids/match.d.ts.map +1 -0
- package/dist/exercises/grids/match.js +58 -0
- package/dist/exercises/grids/match.js.map +1 -0
- package/dist/exercises/grids/wordSearch.d.ts +5 -0
- package/dist/exercises/grids/wordSearch.d.ts.map +1 -0
- package/dist/exercises/grids/wordSearch.js +122 -0
- package/dist/exercises/grids/wordSearch.js.map +1 -0
- package/dist/exercises/grids.d.ts +2 -2
- package/dist/exercises/grids.d.ts.map +1 -1
- package/dist/exercises/grids.js +4 -575
- package/dist/exercises/grids.js.map +1 -1
- package/dist/knuthPlass/breakpoints/adjust.d.ts +22 -0
- package/dist/knuthPlass/breakpoints/adjust.d.ts.map +1 -0
- package/dist/knuthPlass/breakpoints/adjust.js +39 -0
- package/dist/knuthPlass/breakpoints/adjust.js.map +1 -0
- package/dist/knuthPlass/breakpoints/search.d.ts +10 -0
- package/dist/knuthPlass/breakpoints/search.d.ts.map +1 -0
- package/dist/knuthPlass/breakpoints/search.js +439 -0
- package/dist/knuthPlass/breakpoints/search.js.map +1 -0
- package/dist/knuthPlass/breakpoints.d.ts +2 -21
- package/dist/knuthPlass/breakpoints.d.ts.map +1 -1
- package/dist/knuthPlass/breakpoints.js +2 -472
- package/dist/knuthPlass/breakpoints.js.map +1 -1
- package/dist/marks/cjkMarks/geometry.d.ts +58 -0
- package/dist/marks/cjkMarks/geometry.d.ts.map +1 -0
- package/dist/marks/cjkMarks/geometry.js +131 -0
- package/dist/marks/cjkMarks/geometry.js.map +1 -0
- package/dist/marks/cjkMarks/lineMarks.d.ts +7 -0
- package/dist/marks/cjkMarks/lineMarks.d.ts.map +1 -0
- package/dist/marks/cjkMarks/lineMarks.js +183 -0
- package/dist/marks/cjkMarks/lineMarks.js.map +1 -0
- package/dist/marks/cjkMarks/reach.d.ts +28 -0
- package/dist/marks/cjkMarks/reach.d.ts.map +1 -0
- package/dist/marks/cjkMarks/reach.js +130 -0
- package/dist/marks/cjkMarks/reach.js.map +1 -0
- package/dist/marks/cjkMarks/resources.d.ts +31 -0
- package/dist/marks/cjkMarks/resources.d.ts.map +1 -0
- package/dist/marks/cjkMarks/resources.js +46 -0
- package/dist/marks/cjkMarks/resources.js.map +1 -0
- package/dist/marks/cjkMarks.d.ts +4 -27
- package/dist/marks/cjkMarks.d.ts.map +1 -1
- package/dist/marks/cjkMarks.js +6 -479
- package/dist/marks/cjkMarks.js.map +1 -1
- package/dist/measure/canvas/ink.d.ts +67 -0
- package/dist/measure/canvas/ink.d.ts.map +1 -0
- package/dist/measure/canvas/ink.js +215 -0
- package/dist/measure/canvas/ink.js.map +1 -0
- package/dist/measure/canvas/state.d.ts +91 -0
- package/dist/measure/canvas/state.d.ts.map +1 -0
- package/dist/measure/canvas/state.js +306 -0
- package/dist/measure/canvas/state.js.map +1 -0
- package/dist/measure/canvas/widths.d.ts +27 -0
- package/dist/measure/canvas/widths.d.ts.map +1 -0
- package/dist/measure/canvas/widths.js +137 -0
- package/dist/measure/canvas/widths.js.map +1 -0
- package/dist/measure/canvas.d.ts +4 -154
- package/dist/measure/canvas.d.ts.map +1 -1
- package/dist/measure/canvas.js +4 -646
- package/dist/measure/canvas.js.map +1 -1
- package/dist/measure/cjk/cjkPunctuation/box.d.ts +71 -0
- package/dist/measure/cjk/cjkPunctuation/box.d.ts.map +1 -0
- package/dist/measure/cjk/cjkPunctuation/box.js +114 -0
- package/dist/measure/cjk/cjkPunctuation/box.js.map +1 -0
- package/dist/measure/cjk/cjkPunctuation/composition.d.ts +128 -0
- package/dist/measure/cjk/cjkPunctuation/composition.d.ts.map +1 -0
- package/dist/measure/cjk/cjkPunctuation/composition.js +157 -0
- package/dist/measure/cjk/cjkPunctuation/composition.js.map +1 -0
- package/dist/measure/cjk/cjkPunctuation/lineEdges.d.ts +63 -0
- package/dist/measure/cjk/cjkPunctuation/lineEdges.d.ts.map +1 -0
- package/dist/measure/cjk/cjkPunctuation/lineEdges.js +183 -0
- package/dist/measure/cjk/cjkPunctuation/lineEdges.js.map +1 -0
- package/dist/measure/cjk/cjkPunctuation.d.ts +8 -247
- package/dist/measure/cjk/cjkPunctuation.d.ts.map +1 -1
- package/dist/measure/cjk/cjkPunctuation.js +6 -447
- package/dist/measure/cjk/cjkPunctuation.js.map +1 -1
- package/dist/measure/plain/overwide.d.ts +70 -0
- package/dist/measure/plain/overwide.d.ts.map +1 -0
- package/dist/measure/plain/overwide.js +150 -0
- package/dist/measure/plain/overwide.js.map +1 -0
- package/dist/measure/plain/segments.d.ts +53 -0
- package/dist/measure/plain/segments.d.ts.map +1 -0
- package/dist/measure/plain/segments.js +153 -0
- package/dist/measure/plain/segments.js.map +1 -0
- package/dist/measure/plain.d.ts +2 -15
- package/dist/measure/plain.d.ts.map +1 -1
- package/dist/measure/plain.js +12 -300
- package/dist/measure/plain.js.map +1 -1
- package/dist/migrate/pageDesign/pictures.d.ts +16 -0
- package/dist/migrate/pageDesign/pictures.d.ts.map +1 -0
- package/dist/migrate/pageDesign/pictures.js +101 -0
- package/dist/migrate/pageDesign/pictures.js.map +1 -0
- package/dist/migrate/pageDesign/text.d.ts +48 -0
- package/dist/migrate/pageDesign/text.d.ts.map +1 -0
- package/dist/migrate/pageDesign/text.js +196 -0
- package/dist/migrate/pageDesign/text.js.map +1 -0
- package/dist/migrate/pageDesign/types.d.ts +137 -0
- package/dist/migrate/pageDesign/types.d.ts.map +1 -0
- package/dist/migrate/pageDesign/types.js +2 -0
- package/dist/migrate/pageDesign/types.js.map +1 -0
- package/dist/migrate/pageDesign.d.ts +4 -154
- package/dist/migrate/pageDesign.d.ts.map +1 -1
- package/dist/migrate/pageDesign.js +4 -294
- package/dist/migrate/pageDesign.js.map +1 -1
- package/dist/numerals/numbering/counters.d.ts +49 -0
- package/dist/numerals/numbering/counters.d.ts.map +1 -0
- package/dist/numerals/numbering/counters.js +311 -0
- package/dist/numerals/numbering/counters.js.map +1 -0
- package/dist/numerals/numbering/formats.d.ts +30 -0
- package/dist/numerals/numbering/formats.d.ts.map +1 -0
- package/dist/numerals/numbering/formats.js +116 -0
- package/dist/numerals/numbering/formats.js.map +1 -0
- package/dist/numerals/numbering/headings.d.ts +40 -0
- package/dist/numerals/numbering/headings.d.ts.map +1 -0
- package/dist/numerals/numbering/headings.js +64 -0
- package/dist/numerals/numbering/headings.js.map +1 -0
- package/dist/numerals/numbering/pageLabels.d.ts +43 -0
- package/dist/numerals/numbering/pageLabels.d.ts.map +1 -0
- package/dist/numerals/numbering/pageLabels.js +75 -0
- package/dist/numerals/numbering/pageLabels.js.map +1 -0
- package/dist/numerals/numbering/styles.d.ts +52 -0
- package/dist/numerals/numbering/styles.d.ts.map +1 -0
- package/dist/numerals/numbering/styles.js +43 -0
- package/dist/numerals/numbering/styles.js.map +1 -0
- package/dist/numerals/numbering.d.ts +9 -201
- package/dist/numerals/numbering.d.ts.map +1 -1
- package/dist/numerals/numbering.js +5 -595
- package/dist/numerals/numbering.js.map +1 -1
- package/dist/parse/annotations/apply.d.ts +32 -0
- package/dist/parse/annotations/apply.d.ts.map +1 -0
- package/dist/parse/annotations/apply.js +293 -0
- package/dist/parse/annotations/apply.js.map +1 -0
- package/dist/parse/annotations/scan.d.ts +55 -0
- package/dist/parse/annotations/scan.d.ts.map +1 -0
- package/dist/parse/annotations/scan.js +232 -0
- package/dist/parse/annotations/scan.js.map +1 -0
- package/dist/parse/annotations/source.d.ts +31 -0
- package/dist/parse/annotations/source.d.ts.map +1 -0
- package/dist/parse/annotations/source.js +128 -0
- package/dist/parse/annotations/source.js.map +1 -0
- package/dist/parse/annotations.d.ts +5 -86
- package/dist/parse/annotations.d.ts.map +1 -1
- package/dist/parse/annotations.js +3 -648
- package/dist/parse/annotations.js.map +1 -1
- package/dist/pipeline/blocks/measureContentBlock/helpers.d.ts +31 -0
- package/dist/pipeline/blocks/measureContentBlock/helpers.d.ts.map +1 -0
- package/dist/pipeline/blocks/measureContentBlock/helpers.js +74 -0
- package/dist/pipeline/blocks/measureContentBlock/helpers.js.map +1 -0
- package/dist/pipeline/blocks/measureContentBlock/inlineSpans.d.ts +12 -0
- package/dist/pipeline/blocks/measureContentBlock/inlineSpans.d.ts.map +1 -0
- package/dist/pipeline/blocks/measureContentBlock/inlineSpans.js +107 -0
- package/dist/pipeline/blocks/measureContentBlock/inlineSpans.js.map +1 -0
- package/dist/pipeline/blocks/measureContentBlock/measureOptions.d.ts +68 -0
- package/dist/pipeline/blocks/measureContentBlock/measureOptions.d.ts.map +1 -0
- package/dist/pipeline/blocks/measureContentBlock/measureOptions.js +90 -0
- package/dist/pipeline/blocks/measureContentBlock/measureOptions.js.map +1 -0
- package/dist/pipeline/blocks/measureContentBlock/types.d.ts +165 -0
- package/dist/pipeline/blocks/measureContentBlock/types.d.ts.map +1 -0
- package/dist/pipeline/blocks/measureContentBlock/types.js +2 -0
- package/dist/pipeline/blocks/measureContentBlock/types.js.map +1 -0
- package/dist/pipeline/blocks/measureContentBlock.d.ts +8 -172
- package/dist/pipeline/blocks/measureContentBlock.d.ts.map +1 -1
- package/dist/pipeline/blocks/measureContentBlock.js +16 -257
- package/dist/pipeline/blocks/measureContentBlock.js.map +1 -1
- package/dist/pipeline/blocks/placement/bands.d.ts +61 -0
- package/dist/pipeline/blocks/placement/bands.d.ts.map +1 -0
- package/dist/pipeline/blocks/placement/bands.js +188 -0
- package/dist/pipeline/blocks/placement/bands.js.map +1 -0
- package/dist/pipeline/blocks/placement.d.ts +2 -59
- package/dist/pipeline/blocks/placement.d.ts.map +1 -1
- package/dist/pipeline/blocks/placement.js +3 -184
- package/dist/pipeline/blocks/placement.js.map +1 -1
- package/dist/pipeline/build/pass/composed/comicText.d.ts +27 -0
- package/dist/pipeline/build/pass/composed/comicText.d.ts.map +1 -0
- package/dist/pipeline/build/pass/composed/comicText.js +89 -0
- package/dist/pipeline/build/pass/composed/comicText.js.map +1 -0
- package/dist/pipeline/build/pass/composed/jumps.d.ts +29 -0
- package/dist/pipeline/build/pass/composed/jumps.d.ts.map +1 -0
- package/dist/pipeline/build/pass/composed/jumps.js +91 -0
- package/dist/pipeline/build/pass/composed/jumps.js.map +1 -0
- package/dist/pipeline/build/pass/composed/placePage.d.ts +60 -0
- package/dist/pipeline/build/pass/composed/placePage.d.ts.map +1 -0
- package/dist/pipeline/build/pass/composed/placePage.js +368 -0
- package/dist/pipeline/build/pass/composed/placePage.js.map +1 -0
- package/dist/pipeline/build/pass/composed.d.ts +6 -7
- package/dist/pipeline/build/pass/composed.d.ts.map +1 -1
- package/dist/pipeline/build/pass/composed.js +20 -524
- package/dist/pipeline/build/pass/composed.js.map +1 -1
- package/dist/pipeline/build/pass/setup/contentSetup.d.ts +89 -0
- package/dist/pipeline/build/pass/setup/contentSetup.d.ts.map +1 -0
- package/dist/pipeline/build/pass/setup/contentSetup.js +314 -0
- package/dist/pipeline/build/pass/setup/contentSetup.js.map +1 -0
- package/dist/pipeline/build/pass/setup/pageSetup.d.ts +32 -0
- package/dist/pipeline/build/pass/setup/pageSetup.d.ts.map +1 -0
- package/dist/pipeline/build/pass/setup/pageSetup.js +147 -0
- package/dist/pipeline/build/pass/setup/pageSetup.js.map +1 -0
- package/dist/pipeline/build/pass/setup/passFinish.d.ts +95 -0
- package/dist/pipeline/build/pass/setup/passFinish.d.ts.map +1 -0
- package/dist/pipeline/build/pass/setup/passFinish.js +201 -0
- package/dist/pipeline/build/pass/setup/passFinish.js.map +1 -0
- package/dist/pipeline/build/pass/setupState.d.ts +8 -0
- package/dist/pipeline/build/pass/setupState.d.ts.map +1 -0
- package/dist/pipeline/build/pass/setupState.js +2 -0
- package/dist/pipeline/build/pass/setupState.js.map +1 -0
- package/dist/pipeline/build/pass.d.ts.map +1 -1
- package/dist/pipeline/build/pass.js +60 -654
- package/dist/pipeline/build/pass.js.map +1 -1
- package/dist/pipeline/callouts/calloutLayout/boxDecoration.d.ts +49 -0
- package/dist/pipeline/callouts/calloutLayout/boxDecoration.d.ts.map +1 -0
- package/dist/pipeline/callouts/calloutLayout/boxDecoration.js +110 -0
- package/dist/pipeline/callouts/calloutLayout/boxDecoration.js.map +1 -0
- package/dist/pipeline/callouts/calloutLayout/labelTab.d.ts +31 -0
- package/dist/pipeline/callouts/calloutLayout/labelTab.d.ts.map +1 -0
- package/dist/pipeline/callouts/calloutLayout/labelTab.js +202 -0
- package/dist/pipeline/callouts/calloutLayout/labelTab.js.map +1 -0
- package/dist/pipeline/callouts/calloutLayout/layoutCallout.d.ts.map +1 -1
- package/dist/pipeline/callouts/calloutLayout/layoutCallout.js +23 -355
- package/dist/pipeline/callouts/calloutLayout/layoutCallout.js.map +1 -1
- package/dist/pipeline/callouts/calloutLayout/layoutCalloutState.d.ts +14 -0
- package/dist/pipeline/callouts/calloutLayout/layoutCalloutState.d.ts.map +1 -0
- package/dist/pipeline/callouts/calloutLayout/layoutCalloutState.js +2 -0
- package/dist/pipeline/callouts/calloutLayout/layoutCalloutState.js.map +1 -0
- package/dist/pipeline/callouts/calloutLayout/markerColumn.d.ts +31 -0
- package/dist/pipeline/callouts/calloutLayout/markerColumn.d.ts.map +1 -0
- package/dist/pipeline/callouts/calloutLayout/markerColumn.js +75 -0
- package/dist/pipeline/callouts/calloutLayout/markerColumn.js.map +1 -0
- package/dist/pipeline/composedPages/composedLayout/composePage/run/fill.d.ts +68 -0
- package/dist/pipeline/composedPages/composedLayout/composePage/run/fill.d.ts.map +1 -0
- package/dist/pipeline/composedPages/composedLayout/composePage/run/fill.js +249 -0
- package/dist/pipeline/composedPages/composedLayout/composePage/run/fill.js.map +1 -0
- package/dist/pipeline/composedPages/composedLayout/composePage/run/measure.d.ts +50 -0
- package/dist/pipeline/composedPages/composedLayout/composePage/run/measure.d.ts.map +1 -0
- package/dist/pipeline/composedPages/composedLayout/composePage/run/measure.js +195 -0
- package/dist/pipeline/composedPages/composedLayout/composePage/run/measure.js.map +1 -0
- package/dist/pipeline/composedPages/composedLayout/composePage/run/placeGrid.d.ts +30 -0
- package/dist/pipeline/composedPages/composedLayout/composePage/run/placeGrid.d.ts.map +1 -0
- package/dist/pipeline/composedPages/composedLayout/composePage/run/placeGrid.js +174 -0
- package/dist/pipeline/composedPages/composedLayout/composePage/run/placeGrid.js.map +1 -0
- package/dist/pipeline/composedPages/composedLayout/composePage/run/placeGroup.d.ts +35 -0
- package/dist/pipeline/composedPages/composedLayout/composePage/run/placeGroup.d.ts.map +1 -0
- package/dist/pipeline/composedPages/composedLayout/composePage/run/placeGroup.js +158 -0
- package/dist/pipeline/composedPages/composedLayout/composePage/run/placeGroup.js.map +1 -0
- package/dist/pipeline/composedPages/composedLayout/composePage/run/placeModules.d.ts +37 -0
- package/dist/pipeline/composedPages/composedLayout/composePage/run/placeModules.d.ts.map +1 -0
- package/dist/pipeline/composedPages/composedLayout/composePage/run/placeModules.js +303 -0
- package/dist/pipeline/composedPages/composedLayout/composePage/run/placeModules.js.map +1 -0
- package/dist/pipeline/composedPages/composedLayout/composePage/run/state.d.ts +11 -0
- package/dist/pipeline/composedPages/composedLayout/composePage/run/state.d.ts.map +1 -0
- package/dist/pipeline/composedPages/composedLayout/composePage/run/state.js +3 -0
- package/dist/pipeline/composedPages/composedLayout/composePage/run/state.js.map +1 -0
- package/dist/pipeline/composedPages/composedLayout/composePage/run/types.d.ts +14 -0
- package/dist/pipeline/composedPages/composedLayout/composePage/run/types.d.ts.map +1 -0
- package/dist/pipeline/composedPages/composedLayout/composePage/run/types.js +2 -0
- package/dist/pipeline/composedPages/composedLayout/composePage/run/types.js.map +1 -0
- package/dist/pipeline/composedPages/composedLayout/composePage/run.d.ts +59 -0
- package/dist/pipeline/composedPages/composedLayout/composePage/run.d.ts.map +1 -0
- package/dist/pipeline/composedPages/composedLayout/composePage/run.js +171 -0
- package/dist/pipeline/composedPages/composedLayout/composePage/run.js.map +1 -0
- package/dist/pipeline/composedPages/composedLayout/composePage/state.d.ts +7 -0
- package/dist/pipeline/composedPages/composedLayout/composePage/state.d.ts.map +1 -0
- package/dist/pipeline/composedPages/composedLayout/composePage/state.js +2 -0
- package/dist/pipeline/composedPages/composedLayout/composePage/state.js.map +1 -0
- package/dist/pipeline/composedPages/composedLayout/composePage.d.ts.map +1 -1
- package/dist/pipeline/composedPages/composedLayout/composePage.js +24 -1165
- package/dist/pipeline/composedPages/composedLayout/composePage.js.map +1 -1
- package/dist/pipeline/contents/indexDirective/blocks.d.ts +9 -0
- package/dist/pipeline/contents/indexDirective/blocks.d.ts.map +1 -0
- package/dist/pipeline/contents/indexDirective/blocks.js +256 -0
- package/dist/pipeline/contents/indexDirective/blocks.js.map +1 -0
- package/dist/pipeline/contents/indexDirective/tree.d.ts +71 -0
- package/dist/pipeline/contents/indexDirective/tree.d.ts.map +1 -0
- package/dist/pipeline/contents/indexDirective/tree.js +224 -0
- package/dist/pipeline/contents/indexDirective/tree.js.map +1 -0
- package/dist/pipeline/contents/indexDirective.d.ts +2 -8
- package/dist/pipeline/contents/indexDirective.d.ts.map +1 -1
- package/dist/pipeline/contents/indexDirective.js +3 -472
- package/dist/pipeline/contents/indexDirective.js.map +1 -1
- package/dist/pipeline/pages/placeholders/chapterValues.d.ts +117 -0
- package/dist/pipeline/pages/placeholders/chapterValues.d.ts.map +1 -0
- package/dist/pipeline/pages/placeholders/chapterValues.js +236 -0
- package/dist/pipeline/pages/placeholders/chapterValues.js.map +1 -0
- package/dist/pipeline/pages/placeholders/lineText.d.ts +66 -0
- package/dist/pipeline/pages/placeholders/lineText.d.ts.map +1 -0
- package/dist/pipeline/pages/placeholders/lineText.js +173 -0
- package/dist/pipeline/pages/placeholders/lineText.js.map +1 -0
- package/dist/pipeline/pages/placeholders.d.ts +6 -179
- package/dist/pipeline/pages/placeholders.d.ts.map +1 -1
- package/dist/pipeline/pages/placeholders.js +4 -398
- package/dist/pipeline/pages/placeholders.js.map +1 -1
- package/dist/pipeline/references/citations/markers.d.ts +14 -0
- package/dist/pipeline/references/citations/markers.d.ts.map +1 -0
- package/dist/pipeline/references/citations/markers.js +106 -0
- package/dist/pipeline/references/citations/markers.js.map +1 -0
- package/dist/pipeline/references/citations/process.d.ts +56 -0
- package/dist/pipeline/references/citations/process.d.ts.map +1 -0
- package/dist/pipeline/references/citations/process.js +213 -0
- package/dist/pipeline/references/citations/process.js.map +1 -0
- package/dist/pipeline/references/citations/spans.d.ts +33 -0
- package/dist/pipeline/references/citations/spans.d.ts.map +1 -0
- package/dist/pipeline/references/citations/spans.js +127 -0
- package/dist/pipeline/references/citations/spans.js.map +1 -0
- package/dist/pipeline/references/citations.d.ts +4 -51
- package/dist/pipeline/references/citations.d.ts.map +1 -1
- package/dist/pipeline/references/citations.js +5 -438
- package/dist/pipeline/references/citations.js.map +1 -1
- package/dist/pipeline/resources/resourceLayout/resourceBlock/captionNotes.d.ts +63 -0
- package/dist/pipeline/resources/resourceLayout/resourceBlock/captionNotes.d.ts.map +1 -0
- package/dist/pipeline/resources/resourceLayout/resourceBlock/captionNotes.js +88 -0
- package/dist/pipeline/resources/resourceLayout/resourceBlock/captionNotes.js.map +1 -0
- package/dist/pipeline/resources/resourceLayout/resourceBlock/state.d.ts +9 -0
- package/dist/pipeline/resources/resourceLayout/resourceBlock/state.d.ts.map +1 -0
- package/dist/pipeline/resources/resourceLayout/resourceBlock/state.js +2 -0
- package/dist/pipeline/resources/resourceLayout/resourceBlock/state.js.map +1 -0
- package/dist/pipeline/resources/resourceLayout/resourceBlock/upright.d.ts +26 -0
- package/dist/pipeline/resources/resourceLayout/resourceBlock/upright.d.ts.map +1 -0
- package/dist/pipeline/resources/resourceLayout/resourceBlock/upright.js +90 -0
- package/dist/pipeline/resources/resourceLayout/resourceBlock/upright.js.map +1 -0
- package/dist/pipeline/resources/resourceLayout/resourceBlock.d.ts +1 -3
- package/dist/pipeline/resources/resourceLayout/resourceBlock.d.ts.map +1 -1
- package/dist/pipeline/resources/resourceLayout/resourceBlock.js +13 -159
- package/dist/pipeline/resources/resourceLayout/resourceBlock.js.map +1 -1
- package/dist/pipeline/sections/partPalette/colorKinds.d.ts +53 -0
- package/dist/pipeline/sections/partPalette/colorKinds.d.ts.map +1 -0
- package/dist/pipeline/sections/partPalette/colorKinds.js +181 -0
- package/dist/pipeline/sections/partPalette/colorKinds.js.map +1 -0
- package/dist/pipeline/sections/partPalette/flowColors.d.ts +16 -0
- package/dist/pipeline/sections/partPalette/flowColors.d.ts.map +1 -0
- package/dist/pipeline/sections/partPalette/flowColors.js +78 -0
- package/dist/pipeline/sections/partPalette/flowColors.js.map +1 -0
- package/dist/pipeline/sections/partPalette/recolor.d.ts +18 -0
- package/dist/pipeline/sections/partPalette/recolor.d.ts.map +1 -0
- package/dist/pipeline/sections/partPalette/recolor.js +188 -0
- package/dist/pipeline/sections/partPalette/recolor.js.map +1 -0
- package/dist/pipeline/sections/partPalette.d.ts +4 -49
- package/dist/pipeline/sections/partPalette.d.ts.map +1 -1
- package/dist/pipeline/sections/partPalette.js +3 -442
- package/dist/pipeline/sections/partPalette.js.map +1 -1
- package/dist/pipeline/text/lists/orderedRuns.d.ts +49 -0
- package/dist/pipeline/text/lists/orderedRuns.d.ts.map +1 -0
- package/dist/pipeline/text/lists/orderedRuns.js +256 -0
- package/dist/pipeline/text/lists/orderedRuns.js.map +1 -0
- package/dist/pipeline/text/lists.d.ts +16 -46
- package/dist/pipeline/text/lists.d.ts.map +1 -1
- package/dist/pipeline/text/lists.js +5 -255
- package/dist/pipeline/text/lists.js.map +1 -1
- package/dist/svg/fonts/inline.d.ts +30 -0
- package/dist/svg/fonts/inline.d.ts.map +1 -0
- package/dist/svg/fonts/inline.js +298 -0
- package/dist/svg/fonts/inline.js.map +1 -0
- package/dist/svg/fonts/scan.d.ts +27 -0
- package/dist/svg/fonts/scan.d.ts.map +1 -0
- package/dist/svg/fonts/scan.js +353 -0
- package/dist/svg/fonts/scan.js.map +1 -0
- package/dist/svg/fonts/types.d.ts +106 -0
- package/dist/svg/fonts/types.d.ts.map +1 -0
- package/dist/svg/fonts/types.js +4 -0
- package/dist/svg/fonts/types.js.map +1 -0
- package/dist/svg/fonts.d.ts +4 -150
- package/dist/svg/fonts.d.ts.map +1 -1
- package/dist/svg/fonts.js +3 -647
- package/dist/svg/fonts.js.map +1 -1
- package/dist/types/text/bodyText/config.d.ts +465 -0
- package/dist/types/text/bodyText/config.d.ts.map +1 -0
- package/dist/types/text/bodyText/config.js +2 -0
- package/dist/types/text/bodyText/config.js.map +1 -0
- package/dist/types/text/bodyText/options.d.ts +73 -0
- package/dist/types/text/bodyText/options.d.ts.map +1 -0
- package/dist/types/text/bodyText/options.js +2 -0
- package/dist/types/text/bodyText/options.js.map +1 -0
- package/dist/types/text/bodyText/resolved.d.ts +95 -0
- package/dist/types/text/bodyText/resolved.d.ts.map +1 -0
- package/dist/types/text/bodyText/resolved.js +2 -0
- package/dist/types/text/bodyText/resolved.js.map +1 -0
- package/dist/types/text/bodyText.d.ts +3 -623
- package/dist/types/text/bodyText.d.ts.map +1 -1
- package/dist/vdt/contentWarnings/comic.d.ts +95 -0
- package/dist/vdt/contentWarnings/comic.d.ts.map +1 -0
- package/dist/vdt/contentWarnings/comic.js +3 -0
- package/dist/vdt/contentWarnings/comic.js.map +1 -0
- package/dist/vdt/contentWarnings/composed.d.ts +126 -0
- package/dist/vdt/contentWarnings/composed.d.ts.map +1 -0
- package/dist/vdt/contentWarnings/composed.js +2 -0
- package/dist/vdt/contentWarnings/composed.js.map +1 -0
- package/dist/vdt/contentWarnings/layout.d.ts +247 -0
- package/dist/vdt/contentWarnings/layout.d.ts.map +1 -0
- package/dist/vdt/contentWarnings/layout.js +2 -0
- package/dist/vdt/contentWarnings/layout.js.map +1 -0
- package/dist/vdt/contentWarnings/markup.d.ts +211 -0
- package/dist/vdt/contentWarnings/markup.d.ts.map +1 -0
- package/dist/vdt/contentWarnings/markup.js +4 -0
- package/dist/vdt/contentWarnings/markup.js.map +1 -0
- package/dist/vdt/contentWarnings/source.d.ts +216 -0
- package/dist/vdt/contentWarnings/source.d.ts.map +1 -0
- package/dist/vdt/contentWarnings/source.js +4 -0
- package/dist/vdt/contentWarnings/source.js.map +1 -0
- package/dist/vdt/contentWarnings/text.d.ts +139 -0
- package/dist/vdt/contentWarnings/text.d.ts.map +1 -0
- package/dist/vdt/contentWarnings/text.js +4 -0
- package/dist/vdt/contentWarnings/text.js.map +1 -0
- package/dist/vdt/contentWarnings.d.ts +7 -1017
- package/dist/vdt/contentWarnings.d.ts.map +1 -1
- package/dist/vdt/pages/comic.d.ts +200 -0
- package/dist/vdt/pages/comic.d.ts.map +1 -0
- package/dist/vdt/pages/comic.js +2 -0
- package/dist/vdt/pages/comic.js.map +1 -0
- package/dist/vdt/pages/composed.d.ts +282 -0
- package/dist/vdt/pages/composed.d.ts.map +1 -0
- package/dist/vdt/pages/composed.js +2 -0
- package/dist/vdt/pages/composed.js.map +1 -0
- package/dist/vdt/pages.d.ts +6 -476
- package/dist/vdt/pages.d.ts.map +1 -1
- package/dist/word/docxRead/body.d.ts +17 -0
- package/dist/word/docxRead/body.d.ts.map +1 -0
- package/dist/word/docxRead/body.js +372 -0
- package/dist/word/docxRead/body.js.map +1 -0
- package/dist/word/docxRead/parts.d.ts +27 -0
- package/dist/word/docxRead/parts.d.ts.map +1 -0
- package/dist/word/docxRead/parts.js +160 -0
- package/dist/word/docxRead/parts.js.map +1 -0
- package/dist/word/docxRead.d.ts +1 -5
- package/dist/word/docxRead.d.ts.map +1 -1
- package/dist/word/docxRead.js +5 -526
- package/dist/word/docxRead.js.map +1 -1
- package/dist/word/inline/parse.d.ts +16 -0
- package/dist/word/inline/parse.d.ts.map +1 -0
- package/dist/word/inline/parse.js +367 -0
- package/dist/word/inline/parse.js.map +1 -0
- package/dist/word/inline/render.d.ts +44 -0
- package/dist/word/inline/render.d.ts.map +1 -0
- package/dist/word/inline/render.js +296 -0
- package/dist/word/inline/render.js.map +1 -0
- package/dist/word/inline.d.ts +4 -52
- package/dist/word/inline.d.ts.map +1 -1
- package/dist/word/inline.js +2 -657
- package/dist/word/inline.js.map +1 -1
- package/dist/word/toDocx/parse.d.ts +46 -0
- package/dist/word/toDocx/parse.d.ts.map +1 -0
- package/dist/word/toDocx/parse.js +313 -0
- package/dist/word/toDocx/parse.js.map +1 -0
- package/dist/word/toDocx/styles.d.ts +63 -0
- package/dist/word/toDocx/styles.d.ts.map +1 -0
- package/dist/word/toDocx/styles.js +239 -0
- package/dist/word/toDocx/styles.js.map +1 -0
- package/dist/word/toDocx/wordml.d.ts +24 -0
- package/dist/word/toDocx/wordml.d.ts.map +1 -0
- package/dist/word/toDocx/wordml.js +114 -0
- package/dist/word/toDocx/wordml.js.map +1 -0
- package/dist/word/toDocx.d.ts +3 -25
- package/dist/word/toDocx.d.ts.map +1 -1
- package/dist/word/toDocx.js +8 -661
- package/dist/word/toDocx.js.map +1 -1
- package/dist/word/toMarkdown/converter.d.ts +57 -0
- package/dist/word/toMarkdown/converter.d.ts.map +1 -0
- package/dist/word/toMarkdown/converter.js +600 -0
- package/dist/word/toMarkdown/converter.js.map +1 -0
- package/dist/word/toMarkdown/helpers.d.ts +98 -0
- package/dist/word/toMarkdown/helpers.d.ts.map +1 -0
- package/dist/word/toMarkdown/helpers.js +153 -0
- package/dist/word/toMarkdown/helpers.js.map +1 -0
- package/dist/word/toMarkdown.d.ts +4 -64
- package/dist/word/toMarkdown.d.ts.map +1 -1
- package/dist/word/toMarkdown.js +2 -749
- package/dist/word/toMarkdown.js.map +1 -1
- package/dist/writing/bidi/chars.d.ts +61 -0
- package/dist/writing/bidi/chars.d.ts.map +1 -0
- package/dist/writing/bidi/chars.js +145 -0
- package/dist/writing/bidi/chars.js.map +1 -0
- package/dist/writing/bidi/joining.d.ts +27 -0
- package/dist/writing/bidi/joining.d.ts.map +1 -0
- package/dist/writing/bidi/joining.js +70 -0
- package/dist/writing/bidi/joining.js.map +1 -0
- package/dist/writing/bidi/paragraph.d.ts +72 -0
- package/dist/writing/bidi/paragraph.d.ts.map +1 -0
- package/dist/writing/bidi/paragraph.js +119 -0
- package/dist/writing/bidi/paragraph.js.map +1 -0
- package/dist/writing/bidi/resolve.d.ts +14 -0
- package/dist/writing/bidi/resolve.d.ts.map +1 -0
- package/dist/writing/bidi/resolve.js +413 -0
- package/dist/writing/bidi/resolve.js.map +1 -0
- package/dist/writing/bidi.d.ts +8 -147
- package/dist/writing/bidi.d.ts.map +1 -1
- package/dist/writing/bidi.js +6 -733
- package/dist/writing/bidi.js.map +1 -1
- package/package.json +1 -1
package/dist/bundle/codec.js
CHANGED
|
@@ -3,703 +3,7 @@
|
|
|
3
3
|
// written out. `readBundle` turns manifest + files into chapters, config,
|
|
4
4
|
// resources and file payloads; `planBundle` / `resolveBundleFiles` do the
|
|
5
5
|
// reverse. Nothing here touches storage.
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
import { bitmapInfo, bundleStart, chapterFileName, extensionForBitmapFormat, extensionForImageMime, extensionForResource, extensionForVideo, fontsToCustomFonts, isBitmapFile, isBundleManifest, isPdfFile, isSvgFile, mimeForFile, pickBundleStart, pickChapterSpecs, pickLocaleOverrides, resolveBundleConfigLocale, resolveBundleLocale, resourceFromSpec, slugify, svgSize, uniqueSlug, } from './manifest.js';
|
|
10
|
-
import { CONFIG_VERSION, migrateBundleConfig } from './configVersion.js';
|
|
11
|
-
import { contourRowsOf, contourWantsAlpha, traceResourceContour, withContourTrace } from '../contour/index.js';
|
|
12
|
-
/** The configuration a bundle's own `config` is laid over: the default
|
|
13
|
-
* colour palette plus the built-in resource types localised to `locale`
|
|
14
|
-
* (what the Sandbox starts every document from). */
|
|
15
|
-
export function bundleBaseConfig(locale = 'en') {
|
|
16
|
-
return { colorPalette: cloneDefaultColorPalette(), resourceTypes: defaultResourceTypes(locale) };
|
|
17
|
-
}
|
|
18
|
-
const identityIds = { blob: (f) => f, font: (f) => f };
|
|
19
|
-
/** Chapter files a bundle reads at once. */
|
|
20
|
-
const CHAPTER_READ_CONCURRENCY = 8;
|
|
21
|
-
/** `items` mapped by `fn`, at most `limit` calls in flight, results in the
|
|
22
|
-
* order of `items`. The first rejection rejects the whole (calls already
|
|
23
|
-
* started run to their end; no new one starts). */
|
|
24
|
-
async function mapConcurrent(items, limit, fn) {
|
|
25
|
-
const results = new Array(items.length);
|
|
26
|
-
let next = 0;
|
|
27
|
-
let failed = false;
|
|
28
|
-
const worker = async () => {
|
|
29
|
-
while (!failed && next < items.length) {
|
|
30
|
-
const i = next++;
|
|
31
|
-
try {
|
|
32
|
-
results[i] = await fn(items[i]);
|
|
33
|
-
}
|
|
34
|
-
catch (err) {
|
|
35
|
-
failed = true;
|
|
36
|
-
throw err;
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
};
|
|
40
|
-
await Promise.all(Array.from({ length: Math.min(Math.max(1, limit), items.length) }, worker));
|
|
41
|
-
return results;
|
|
42
|
-
}
|
|
43
|
-
/** Read a manifest plus its files. Throws on an invalid manifest or a
|
|
44
|
-
* missing chapter, picture or font file. The configuration of a manifest
|
|
45
|
-
* stored under older rules than `CONFIG_VERSION` (none: postext 1.4 or
|
|
46
|
-
* earlier) keeps what that version laid out: the pins its stamp calls for
|
|
47
|
-
* (see `migrateBundleConfig`) apply to the manifest, the locale's
|
|
48
|
-
* overrides and the keys of the base they leave in force (all but the
|
|
49
|
-
* heading breaks). */
|
|
50
|
-
export async function readBundle(manifest, readFile, options = {}) {
|
|
51
|
-
if (!isBundleManifest(manifest))
|
|
52
|
-
throw new Error('Invalid bundle manifest (preset.json)');
|
|
53
|
-
const locale = options.locale ?? manifest.locale ?? 'en';
|
|
54
|
-
// The language the content comes in: a single-language bundle serves its
|
|
55
|
-
// own whatever the reader asks for, so its default resource types
|
|
56
|
-
// ("Figura", "Tabla") follow that, not the reader's locale (EF-150).
|
|
57
|
-
const served = resolveBundleLocale(manifest, locale);
|
|
58
|
-
const ids = options.ids ?? identityIds;
|
|
59
|
-
const onWarning = options.onWarning;
|
|
60
|
-
const measureSvg = options.measureSvg ?? svgSize;
|
|
61
|
-
const measureBitmap = options.measureBitmap ?? ((bytes) => bitmapInfo(bytes));
|
|
62
|
-
const decoder = new TextDecoder();
|
|
63
|
-
// Only the chosen locale's chapters, several at a time (a 120-chapter
|
|
64
|
-
// book is 120 round trips over HTTP), in manifest order.
|
|
65
|
-
const chapters = await mapConcurrent(pickChapterSpecs(manifest, locale), CHAPTER_READ_CONCURRENCY, async (spec) => ({ title: spec.title, file: spec.file, markdown: decoder.decode(await readFile(spec.file)) }));
|
|
66
|
-
// A bilingual bundle's per-locale wording: resource captions, notes and
|
|
67
|
-
// alt texts merged by id, config keys replaced wholesale.
|
|
68
|
-
const overrides = pickLocaleOverrides(manifest, locale);
|
|
69
|
-
const wordingById = new Map((overrides?.resources ?? []).map((r) => [r.id, r]));
|
|
70
|
-
const localizedSpecs = (manifest.resources ?? []).map((spec) => {
|
|
71
|
-
const wording = wordingById.get(spec.id);
|
|
72
|
-
if (!wording)
|
|
73
|
-
return spec;
|
|
74
|
-
const merged = { ...spec, ...wording, id: spec.id };
|
|
75
|
-
// Artwork swapped for this locale: the shared spec's intrinsic size
|
|
76
|
-
// describes the other file, so it is read from the bytes instead.
|
|
77
|
-
if ((wording.file && wording.file !== spec.file) || (wording.poster && wording.poster !== spec.poster)) {
|
|
78
|
-
if (wording.width === undefined)
|
|
79
|
-
delete merged.width;
|
|
80
|
-
if (wording.height === undefined)
|
|
81
|
-
delete merged.height;
|
|
82
|
-
if (wording.pdfFile === undefined)
|
|
83
|
-
delete merged.pdfFile;
|
|
84
|
-
if (wording.fileResolution === undefined)
|
|
85
|
-
delete merged.fileResolution;
|
|
86
|
-
}
|
|
87
|
-
return merged;
|
|
88
|
-
});
|
|
89
|
-
// The file's own resolution, when the pictures are laid out by it.
|
|
90
|
-
const localeLayout = overrides?.config?.layout;
|
|
91
|
-
const layoutPolicy = (localeLayout?.bitmapResolution !== undefined ? localeLayout : manifest.config?.layout ?? options.baseConfig?.layout)?.bitmapResolution;
|
|
92
|
-
const readResolution = options.readResolution ?? layoutPolicy === 'file';
|
|
93
|
-
const blobs = [];
|
|
94
|
-
const resources = await Promise.all(localizedSpecs.map(async (spec) => {
|
|
95
|
-
const file = spec.file;
|
|
96
|
-
if (spec.kind === 'video') {
|
|
97
|
-
// A video (#454): the file it plays (self-hosted) and its poster.
|
|
98
|
-
if (file) {
|
|
99
|
-
const bytes = await readFile(file).catch(() => null);
|
|
100
|
-
if (bytes)
|
|
101
|
-
blobs.push({ fileId: ids.blob(file), file, bytes, mime: mimeForFile(file) });
|
|
102
|
-
else
|
|
103
|
-
onWarning?.(`${spec.id}: video "${file}" not found, ignored`);
|
|
104
|
-
}
|
|
105
|
-
let resolved = spec;
|
|
106
|
-
let size;
|
|
107
|
-
if (spec.poster) {
|
|
108
|
-
const bytes = isBitmapFile(spec.poster) ? await readFile(spec.poster).catch(() => null) : null;
|
|
109
|
-
if (bytes) {
|
|
110
|
-
const mime = mimeForFile(spec.poster);
|
|
111
|
-
blobs.push({ fileId: ids.blob(spec.poster), file: spec.poster, bytes, mime });
|
|
112
|
-
if (spec.width === undefined || spec.height === undefined)
|
|
113
|
-
size = await measureBitmap(bytes, mime);
|
|
114
|
-
}
|
|
115
|
-
else {
|
|
116
|
-
onWarning?.(`${spec.id}: poster "${spec.poster}" not found or not a picture, ignored`);
|
|
117
|
-
resolved = { ...spec, poster: undefined };
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
return resourceFromSpec(resolved, size, ids.blob);
|
|
121
|
-
}
|
|
122
|
-
if (spec.kind === 'score' || (file && scoreFormatOfFile(file))) {
|
|
123
|
-
// A music example (#1172): a notation file's text is the score.
|
|
124
|
-
const bytes = file ? await readFile(file).catch(() => null) : null;
|
|
125
|
-
if (file && !bytes)
|
|
126
|
-
onWarning?.(`${spec.id}: score "${file}" not found, ignored`);
|
|
127
|
-
const source = bytes ? decoder.decode(bytes) : spec.score?.source ?? '';
|
|
128
|
-
const format = spec.score?.format ?? (file ? scoreFormatOfFile(file) : undefined) ?? 'abc';
|
|
129
|
-
return resourceFromSpec({ ...spec, kind: 'score', file: undefined, score: { ...spec.score, format, source } }, undefined, ids.blob);
|
|
130
|
-
}
|
|
131
|
-
if (!file)
|
|
132
|
-
return resourceFromSpec(spec, undefined, ids.blob);
|
|
133
|
-
const mime = mimeForFile(file);
|
|
134
|
-
const bytes = await readFile(file);
|
|
135
|
-
blobs.push({ fileId: ids.blob(file), file, bytes, mime });
|
|
136
|
-
// Optional vector print master next to an SVG: a missing or non-PDF
|
|
137
|
-
// file only costs the master, never the figure.
|
|
138
|
-
let resolved = spec;
|
|
139
|
-
const pdfFile = spec.pdfFile;
|
|
140
|
-
if (pdfFile && isSvgFile(file)) {
|
|
141
|
-
const master = isPdfFile(pdfFile) ? await readFile(pdfFile).catch(() => null) : null;
|
|
142
|
-
if (master) {
|
|
143
|
-
blobs.push({ fileId: ids.blob(pdfFile), file: pdfFile, bytes: master, mime: mimeForFile(pdfFile) });
|
|
144
|
-
}
|
|
145
|
-
else {
|
|
146
|
-
onWarning?.(`${spec.id}: print master "${pdfFile}" ${isPdfFile(pdfFile) ? 'not found' : 'is not a .pdf'}, ignored`);
|
|
147
|
-
resolved = { ...spec, pdfFile: undefined };
|
|
148
|
-
}
|
|
149
|
-
}
|
|
150
|
-
let size;
|
|
151
|
-
if (spec.width === undefined || spec.height === undefined) {
|
|
152
|
-
if (isSvgFile(file))
|
|
153
|
-
size = measureSvg(decoder.decode(bytes));
|
|
154
|
-
else if (isBitmapFile(file))
|
|
155
|
-
size = await measureBitmap(bytes, mime);
|
|
156
|
-
}
|
|
157
|
-
if (isBitmapFile(file)) {
|
|
158
|
-
if (!readResolution) {
|
|
159
|
-
if (size?.resolution)
|
|
160
|
-
size = { width: size.width, height: size.height };
|
|
161
|
-
}
|
|
162
|
-
else if (resolved.fileResolution === undefined && !size?.resolution) {
|
|
163
|
-
const info = bitmapInfo(bytes);
|
|
164
|
-
if (info?.resolution)
|
|
165
|
-
size = { ...(size ?? { width: info.width, height: info.height }), resolution: info.resolution };
|
|
166
|
-
}
|
|
167
|
-
}
|
|
168
|
-
return resourceFromSpec(resolved, size, ids.blob);
|
|
169
|
-
}));
|
|
170
|
-
const fontSet = fontsToCustomFonts(manifest.fonts ?? [], ids.font);
|
|
171
|
-
for (const w of fontSet.warnings)
|
|
172
|
-
onWarning?.(w);
|
|
173
|
-
// A font file the manifest names but the bundle does not carry (a pack
|
|
174
|
-
// that left the licensed faces out, #904) is not an error: the face is
|
|
175
|
-
// dropped with a warning, and the families the book sets in it fall back
|
|
176
|
-
// as any missing font does (the Sandbox's font checks report them).
|
|
177
|
-
// A family that names a `fallback` (#978) is kept even with no file of
|
|
178
|
-
// its own: hosts set its missing faces in the fallback, and one warning
|
|
179
|
-
// says so in place of one per file.
|
|
180
|
-
const fallbackOf = new Map(fontSet.families.flatMap((f) => (f.fallback ? [[f.name, f.fallback]] : [])));
|
|
181
|
-
const notPacked = new Set();
|
|
182
|
-
const read = await Promise.all(fontSet.files.map(async (f) => {
|
|
183
|
-
try {
|
|
184
|
-
return { ...f, bytes: await readFile(f.file) };
|
|
185
|
-
}
|
|
186
|
-
catch {
|
|
187
|
-
notPacked.add(f.fileId);
|
|
188
|
-
if (!fallbackOf.has(f.family))
|
|
189
|
-
onWarning?.(`${f.family}: font file "${f.file}" is not in the bundle, the face is left out`);
|
|
190
|
-
return null;
|
|
191
|
-
}
|
|
192
|
-
}));
|
|
193
|
-
const fonts = read.filter((f) => f !== null);
|
|
194
|
-
const families = [];
|
|
195
|
-
for (const family of fontSet.families) {
|
|
196
|
-
const variants = family.variants.filter((v) => !notPacked.has(v.fileId));
|
|
197
|
-
const fallback = fallbackOf.get(family.name);
|
|
198
|
-
if (fallback) {
|
|
199
|
-
if (variants.length < family.variants.length || family.variants.length === 0) {
|
|
200
|
-
onWarning?.(`${family.name}: ${variants.length === 0 ? 'none of its font files are' : 'some of its font files are not'} in the bundle, those faces are set in ${fallback}`);
|
|
201
|
-
}
|
|
202
|
-
families.push(variants.length === family.variants.length ? family : { ...family, variants });
|
|
203
|
-
}
|
|
204
|
-
else if (variants.length > 0)
|
|
205
|
-
families.push(variants.length === family.variants.length ? family : { ...family, variants });
|
|
206
|
-
else
|
|
207
|
-
onWarning?.(`${family.name}: none of its font files are in the bundle, it is left out`);
|
|
208
|
-
}
|
|
209
|
-
// A manifest written for older rules (postext 1.4 or earlier has no
|
|
210
|
-
// `configVersion`) is read with what its version laid out. The reader's
|
|
211
|
-
// own base configuration keeps its heading breaks, but its other keys,
|
|
212
|
-
// when no layer replaces them, are the ones the old reader set the book
|
|
213
|
-
// with, so they are pinned with the rest.
|
|
214
|
-
const readerBase = options.baseConfig ?? bundleBaseConfig(resolveBundleConfigLocale(manifest, locale));
|
|
215
|
-
const migrateOptions = { content: chapters.map((c) => c.markdown) };
|
|
216
|
-
const baseConfig = migrateBundleConfig(readerBase, [manifest.config ?? {}, overrides?.config ?? {}], manifest.configVersion, migrateOptions);
|
|
217
|
-
const customFonts = [...(manifest.config?.customFonts ?? []), ...families];
|
|
218
|
-
let config = customFonts.length > 0 ? { ...baseConfig, customFonts } : baseConfig;
|
|
219
|
-
// A book in several languages: its general settings, the shared layer
|
|
220
|
-
// alone, read the same way (#1209).
|
|
221
|
-
let sharedConfig;
|
|
222
|
-
if (manifest.localized && Object.keys(manifest.localized).length > 0) {
|
|
223
|
-
const shared = overrides?.config ? migrateBundleConfig(readerBase, [manifest.config ?? {}], manifest.configVersion, migrateOptions) : baseConfig;
|
|
224
|
-
sharedConfig = customFonts.length > 0 ? { ...shared, customFonts } : shared;
|
|
225
|
-
}
|
|
226
|
-
// An uploaded output profile (`print.customProfile`), named by its path in
|
|
227
|
-
// the bundle.
|
|
228
|
-
const profile = config.print?.customProfile;
|
|
229
|
-
if (profile) {
|
|
230
|
-
const bytes = await readFile(profile.fileId).catch(() => null);
|
|
231
|
-
if (bytes) {
|
|
232
|
-
blobs.push({ fileId: ids.blob(profile.fileId), file: profile.fileId, bytes, mime: 'application/vnd.iccprofile' });
|
|
233
|
-
config = { ...config, print: { ...config.print, customProfile: { ...profile, fileId: ids.blob(profile.fileId) } } };
|
|
234
|
-
if (sharedConfig?.print?.customProfile?.fileId === profile.fileId) {
|
|
235
|
-
sharedConfig = { ...sharedConfig, print: { ...sharedConfig.print, customProfile: { ...sharedConfig.print.customProfile, fileId: ids.blob(profile.fileId) } } };
|
|
236
|
-
}
|
|
237
|
-
}
|
|
238
|
-
else {
|
|
239
|
-
onWarning?.(`output profile "${profile.fileId}" not found, ignored`);
|
|
240
|
-
const print = { ...config.print };
|
|
241
|
-
delete print.customProfile;
|
|
242
|
-
if (print.outputProfile === 'custom')
|
|
243
|
-
delete print.outputProfile;
|
|
244
|
-
config = { ...config, print };
|
|
245
|
-
}
|
|
246
|
-
}
|
|
247
|
-
const start = pickBundleStart(manifest, locale);
|
|
248
|
-
const traced = options.traceContours === false
|
|
249
|
-
? resources
|
|
250
|
-
: await traceBundleContours(resources, blobs, config, options.decodeContour ? { decode: options.decodeContour } : {});
|
|
251
|
-
return { manifest, locale: served, chapters, config, ...(sharedConfig ? { sharedConfig } : {}), resources: traced, blobs, fonts, ...(start ? { start } : {}) };
|
|
252
|
-
}
|
|
253
|
-
/** Whether a configuration has a page-template frame that pushes with its
|
|
254
|
-
* pictures' contour (#883). */
|
|
255
|
-
function configWrapsContours(config) {
|
|
256
|
-
const frames = (patch) => (patch?.frames ?? []).some((f) => f?.wrap === 'contour');
|
|
257
|
-
return (config.pageTemplates ?? []).some((t) => frames(t) || frames(t.variants?.recto) || frames(t.variants?.verso));
|
|
258
|
-
}
|
|
259
|
-
/**
|
|
260
|
-
* Trace the alpha channel of the bitmaps a contour wrap runs round (#883):
|
|
261
|
-
* those with a `contour`, or whose placement or type wraps by contour, and
|
|
262
|
-
* all of them when a frame of the configuration does. A picture whose
|
|
263
|
-
* trace is already there (this file, this threshold) keeps it.
|
|
264
|
-
*/
|
|
265
|
-
export async function traceBundleContours(resources, blobs, config, options = {}) {
|
|
266
|
-
const all = configWrapsContours(config);
|
|
267
|
-
const types = new Map((config.resourceTypes ?? []).map((t) => [t.id, t]));
|
|
268
|
-
const bytesOf = new Map(blobs.map((b) => [b.fileId, b]));
|
|
269
|
-
return Promise.all(resources.map(async (r) => {
|
|
270
|
-
if (!r.bitmap || !contourWantsAlpha(r))
|
|
271
|
-
return r;
|
|
272
|
-
const wants = all || r.contour !== undefined || (r.placement?.wrap ?? types.get(r.typeId)?.defaultPlacement?.wrap) === 'contour';
|
|
273
|
-
if (!wants)
|
|
274
|
-
return r;
|
|
275
|
-
if (r.contour?.traced && contourRowsOf(r))
|
|
276
|
-
return r;
|
|
277
|
-
const blob = bytesOf.get(r.bitmap.fileId);
|
|
278
|
-
if (!blob)
|
|
279
|
-
return r;
|
|
280
|
-
const trace = await traceResourceContour(r, blob.bytes, blob.mime, options);
|
|
281
|
-
return trace ? withContourTrace(r, trace) : r;
|
|
282
|
-
}));
|
|
283
|
-
}
|
|
284
|
-
/** A resource minus the fields that only make sense in storage, and the
|
|
285
|
-
* alpha trace of its contour (#883), which the reader makes again from
|
|
286
|
-
* the file. */
|
|
287
|
-
function omitStorageFields(r) {
|
|
288
|
-
const copy = { ...r };
|
|
289
|
-
delete copy.createdAt;
|
|
290
|
-
delete copy.updatedAt;
|
|
291
|
-
delete copy.bitmap;
|
|
292
|
-
delete copy.svg;
|
|
293
|
-
if (copy.contour?.traced) {
|
|
294
|
-
const { traced: _t, ...contour } = copy.contour;
|
|
295
|
-
void _t;
|
|
296
|
-
copy.contour = contour;
|
|
297
|
-
}
|
|
298
|
-
return copy;
|
|
299
|
-
}
|
|
300
|
-
/** Font formats a bundle may carry (`.woff` is rejected by the PDF backend
|
|
301
|
-
* and by `fontsToCustomFonts`). */
|
|
302
|
-
export const EXPORTABLE_FONT_FORMATS = ['ttf', 'otf', 'woff2'];
|
|
303
|
-
/** Decide file names and the manifest for a bundle. Pure; the bytes are
|
|
304
|
-
* resolved by `resolveBundleFiles`. Fonts are declared in `fonts[]`,
|
|
305
|
-
* never inside `config.customFonts` (their ids are local to the writer). */
|
|
306
|
-
export function planBundle(meta, content) {
|
|
307
|
-
const warnings = [];
|
|
308
|
-
const files = [];
|
|
309
|
-
const takenResourceNames = new Set();
|
|
310
|
-
const takenFontNames = new Set();
|
|
311
|
-
const localized = content.localized && Object.keys(content.localized).length > 0 ? content.localized : undefined;
|
|
312
|
-
if (localized) {
|
|
313
|
-
if (!meta.locale)
|
|
314
|
-
throw new Error('planBundle: `localized` needs `locale`, the language of the shared content');
|
|
315
|
-
for (const key of Object.keys(localized)) {
|
|
316
|
-
if (key.trim().length === 0 || key.toLowerCase() === meta.locale.toLowerCase()) {
|
|
317
|
-
throw new Error(`planBundle: \`localized\` names the primary locale "${key}" again`);
|
|
318
|
-
}
|
|
319
|
-
}
|
|
320
|
-
}
|
|
321
|
-
// File name (slug) of each resource with a payload, for the pictures a
|
|
322
|
-
// locale brings of its own.
|
|
323
|
-
const resourceNames = new Map();
|
|
324
|
-
const resources = [];
|
|
325
|
-
for (const r of content.resources) {
|
|
326
|
-
const { bitmap, svg } = r;
|
|
327
|
-
const rest = omitStorageFields(r);
|
|
328
|
-
if (r.kind === 'video' && r.video) {
|
|
329
|
-
// A video (#454): its file (self-hosted) and its poster, side by side.
|
|
330
|
-
const { fileId: videoFileId, poster, ...video } = r.video;
|
|
331
|
-
const spec = { ...rest, video };
|
|
332
|
-
if (videoFileId || poster) {
|
|
333
|
-
const name = uniqueSlug(slugify(r.id), takenResourceNames, 'resource');
|
|
334
|
-
takenResourceNames.add(name);
|
|
335
|
-
resourceNames.set(r.id, name);
|
|
336
|
-
if (videoFileId) {
|
|
337
|
-
spec.file = `resources/${name}.${extensionForVideo(video.format)}`;
|
|
338
|
-
files.push({ path: spec.file, fileId: videoFileId, kind: 'blob', owner: r.id });
|
|
339
|
-
}
|
|
340
|
-
if (poster) {
|
|
341
|
-
spec.poster = `resources/${name}.poster.${extensionForBitmapFormat(poster.format)}`;
|
|
342
|
-
files.push({ path: spec.poster, fileId: poster.fileId, kind: 'blob', owner: r.id });
|
|
343
|
-
if (poster.width)
|
|
344
|
-
spec.width = poster.width;
|
|
345
|
-
if (poster.height)
|
|
346
|
-
spec.height = poster.height;
|
|
347
|
-
}
|
|
348
|
-
}
|
|
349
|
-
resources.push(spec);
|
|
350
|
-
continue;
|
|
351
|
-
}
|
|
352
|
-
const ext = extensionForResource(r);
|
|
353
|
-
const fileId = bitmap?.fileId ?? svg?.fileId;
|
|
354
|
-
if (!ext || !fileId) {
|
|
355
|
-
resources.push(rest);
|
|
356
|
-
continue;
|
|
357
|
-
}
|
|
358
|
-
const name = uniqueSlug(slugify(r.id), takenResourceNames, 'resource');
|
|
359
|
-
takenResourceNames.add(name);
|
|
360
|
-
resourceNames.set(r.id, name);
|
|
361
|
-
const path = `resources/${name}.${ext}`;
|
|
362
|
-
files.push({ path, fileId, kind: 'blob', owner: r.id });
|
|
363
|
-
let pdfFile;
|
|
364
|
-
if (svg?.pdfFileId) {
|
|
365
|
-
pdfFile = `resources/${name}.pdf`;
|
|
366
|
-
files.push({ path: pdfFile, fileId: svg.pdfFileId, kind: 'blob', owner: r.id });
|
|
367
|
-
}
|
|
368
|
-
const width = bitmap?.width ?? svg?.width;
|
|
369
|
-
const height = bitmap?.height ?? svg?.height;
|
|
370
|
-
resources.push({
|
|
371
|
-
...rest,
|
|
372
|
-
file: path,
|
|
373
|
-
...(pdfFile ? { pdfFile } : {}),
|
|
374
|
-
...(svg?.inlineFonts === false ? { inlineFonts: false } : {}),
|
|
375
|
-
...(width ? { width } : {}),
|
|
376
|
-
...(height ? { height } : {}),
|
|
377
|
-
...(bitmap?.resolution ? { resolution: bitmap.resolution } : {}),
|
|
378
|
-
...(bitmap?.fileResolution ? { fileResolution: bitmap.fileResolution } : {}),
|
|
379
|
-
});
|
|
380
|
-
}
|
|
381
|
-
// Fonts are shared by every locale: a family only a locale's config
|
|
382
|
-
// names joins the primary ones.
|
|
383
|
-
const families = [...(content.config.customFonts ?? [])];
|
|
384
|
-
for (const entry of Object.values(localized ?? {})) {
|
|
385
|
-
for (const family of entry.config?.customFonts ?? []) {
|
|
386
|
-
if (!families.some((f) => f.name === family.name))
|
|
387
|
-
families.push(family);
|
|
388
|
-
}
|
|
389
|
-
}
|
|
390
|
-
const fonts = [];
|
|
391
|
-
for (const family of families) {
|
|
392
|
-
// A family the document may set but not pass on: its files stay behind
|
|
393
|
-
// and no `fonts[]` entry names it, so the bundle opens with the
|
|
394
|
-
// reader's own fallback for that family.
|
|
395
|
-
if (family.redistributable === false) {
|
|
396
|
-
// A family with a `fallback` (#978) is still named, with no file, so
|
|
397
|
-
// the book that opens without its faces sets them in the fallback.
|
|
398
|
-
if (family.fallback) {
|
|
399
|
-
warnings.push(`${family.name}: font files left out of the export (the family is not redistributable); the bundle names ${family.fallback} to set it in`);
|
|
400
|
-
fonts.push({ name: family.name, variants: [], redistributable: false, fallback: family.fallback });
|
|
401
|
-
}
|
|
402
|
-
else {
|
|
403
|
-
warnings.push(`${family.name}: font files left out of the export (the family is not redistributable)`);
|
|
404
|
-
}
|
|
405
|
-
continue;
|
|
406
|
-
}
|
|
407
|
-
const variants = [];
|
|
408
|
-
for (const v of family.variants) {
|
|
409
|
-
if (!EXPORTABLE_FONT_FORMATS.includes(v.format)) {
|
|
410
|
-
warnings.push(`${family.name}: variant ${v.weight} ${v.style} skipped (.${v.format} is not supported)`);
|
|
411
|
-
continue;
|
|
412
|
-
}
|
|
413
|
-
const base = v.fileName ? slugify(v.fileName.replace(/\.[^.]+$/, '')) : '';
|
|
414
|
-
const name = uniqueSlug(base || slugify(`${family.name}-${v.weight}-${v.style}`), takenFontNames, 'font');
|
|
415
|
-
takenFontNames.add(name);
|
|
416
|
-
const path = `fonts/${name}.${v.format}`;
|
|
417
|
-
files.push({ path, fileId: v.fileId, kind: 'font', owner: family.name });
|
|
418
|
-
variants.push({ weight: v.weight, style: v.style, file: path });
|
|
419
|
-
}
|
|
420
|
-
if (variants.length > 0 || family.fallback) {
|
|
421
|
-
fonts.push({ name: family.name, variants, ...(family.fallback ? { fallback: family.fallback } : {}) });
|
|
422
|
-
}
|
|
423
|
-
}
|
|
424
|
-
const thumbExt = content.thumbnail ? extensionForImageMime(content.thumbnail.mime) : null;
|
|
425
|
-
const thumbnailPath = content.thumbnail && thumbExt ? `thumbnail.${thumbExt}` : undefined;
|
|
426
|
-
if (content.thumbnail && thumbnailPath) {
|
|
427
|
-
files.push({ path: thumbnailPath, fileId: content.thumbnail.fileId, kind: 'blob', owner: 'thumbnail' });
|
|
428
|
-
}
|
|
429
|
-
const sharedSource = content.sharedConfig ?? content.config;
|
|
430
|
-
const configWithoutFonts = { ...stripConfigDefaults(sharedSource) };
|
|
431
|
-
delete configWithoutFonts.customFonts;
|
|
432
|
-
// An uploaded output profile travels as a file, named by its path.
|
|
433
|
-
const profile = configWithoutFonts.print?.customProfile;
|
|
434
|
-
if (profile) {
|
|
435
|
-
const path = `profiles/${slugify(profile.name) || 'output-profile'}.icc`;
|
|
436
|
-
files.push({ path, fileId: profile.fileId, kind: 'blob', owner: 'print' });
|
|
437
|
-
configWithoutFonts.print = { ...configWithoutFonts.print, customProfile: { ...profile, fileId: path } };
|
|
438
|
-
}
|
|
439
|
-
// Chapter files: `chapters/01-intro.md`, or one folder per locale when
|
|
440
|
-
// any locale has chapters of its own (`chapters/es/01-intro.md`).
|
|
441
|
-
const chapterFiles = [];
|
|
442
|
-
const writeChapters = (chapters, folder) => {
|
|
443
|
-
const taken = new Set();
|
|
444
|
-
return chapters.map((c, i) => {
|
|
445
|
-
const name = chapterFileName(i, c.title, taken, chapters.length);
|
|
446
|
-
const path = folder ? name.replace(/^chapters\//, `chapters/${folder}/`) : name;
|
|
447
|
-
chapterFiles.push({ path, markdown: c.markdown });
|
|
448
|
-
return { title: c.title, file: path };
|
|
449
|
-
});
|
|
450
|
-
};
|
|
451
|
-
const perLocale = localized !== undefined && Object.values(localized).some((l) => l.chapters && l.chapters.length > 0);
|
|
452
|
-
let chapterSpecs;
|
|
453
|
-
const localeChapterFiles = {};
|
|
454
|
-
if (localized && perLocale && meta.locale) {
|
|
455
|
-
const primary = writeChapters(content.chapters, localeFolder(meta.locale));
|
|
456
|
-
const map = { [meta.locale]: primary };
|
|
457
|
-
for (const [locale, entry] of Object.entries(localized)) {
|
|
458
|
-
if (entry.chapters && entry.chapters.length > 0) {
|
|
459
|
-
map[locale] = writeChapters(entry.chapters, localeFolder(locale));
|
|
460
|
-
localeChapterFiles[locale] = map[locale].map((c) => c.file);
|
|
461
|
-
}
|
|
462
|
-
else
|
|
463
|
-
map[locale] = primary;
|
|
464
|
-
}
|
|
465
|
-
chapterSpecs = map;
|
|
466
|
-
}
|
|
467
|
-
else {
|
|
468
|
-
chapterSpecs = writeChapters(content.chapters);
|
|
469
|
-
}
|
|
470
|
-
const start = bundleStart(content.start);
|
|
471
|
-
// Per locale, what differs from the shared content: configuration keys,
|
|
472
|
-
// and the wording and artwork of resources.
|
|
473
|
-
const localizedSpecs = {};
|
|
474
|
-
const byId = new Map(content.resources.map((r) => [r.id, r]));
|
|
475
|
-
for (const [locale, entry] of Object.entries(localized ?? {})) {
|
|
476
|
-
const overrides = {};
|
|
477
|
-
if (entry.name && entry.name !== meta.name)
|
|
478
|
-
overrides.name = entry.name;
|
|
479
|
-
if (entry.description && entry.description !== meta.description)
|
|
480
|
-
overrides.description = entry.description;
|
|
481
|
-
if (entry.config) {
|
|
482
|
-
const config = localizedConfig(entry.config, configWithoutFonts, sharedSource, !!content.sharedConfig);
|
|
483
|
-
if (Object.keys(config).length > 0)
|
|
484
|
-
overrides.config = config;
|
|
485
|
-
}
|
|
486
|
-
const wording = [];
|
|
487
|
-
for (const r of entry.resources ?? []) {
|
|
488
|
-
const base = byId.get(r.id);
|
|
489
|
-
if (!base) {
|
|
490
|
-
warnings.push(`${r.id}: not among the resources, its ${locale} wording left out`);
|
|
491
|
-
continue;
|
|
492
|
-
}
|
|
493
|
-
const spec = { id: r.id };
|
|
494
|
-
for (const key of LOCALIZABLE_RESOURCE_FIELDS) {
|
|
495
|
-
const value = r[key];
|
|
496
|
-
if (value !== undefined && !sameJson(value, base[key]))
|
|
497
|
-
spec[key] = value;
|
|
498
|
-
}
|
|
499
|
-
// Artwork of its own (a picture with words in it), written in the
|
|
500
|
-
// locale's folder under the shared file's name.
|
|
501
|
-
const merged = { ...base, ...r };
|
|
502
|
-
const ext = extensionForResource(merged);
|
|
503
|
-
const fileId = r.bitmap?.fileId ?? r.svg?.fileId;
|
|
504
|
-
const pdfFileId = r.svg?.pdfFileId;
|
|
505
|
-
const ownFile = !!ext && !!fileId && fileId !== (base.bitmap?.fileId ?? base.svg?.fileId);
|
|
506
|
-
const ownMaster = !!pdfFileId && pdfFileId !== base.svg?.pdfFileId && merged.kind === 'svg';
|
|
507
|
-
let name = resourceNames.get(r.id);
|
|
508
|
-
if ((ownFile || ownMaster) && name === undefined) {
|
|
509
|
-
name = uniqueSlug(slugify(r.id), takenResourceNames, 'resource');
|
|
510
|
-
takenResourceNames.add(name);
|
|
511
|
-
resourceNames.set(r.id, name);
|
|
512
|
-
}
|
|
513
|
-
if (ownFile) {
|
|
514
|
-
spec.file = `resources/${localeFolder(locale)}/${name}.${ext}`;
|
|
515
|
-
files.push({ path: spec.file, fileId: fileId, kind: 'blob', owner: r.id, locale });
|
|
516
|
-
const width = r.bitmap?.width ?? r.svg?.width;
|
|
517
|
-
const height = r.bitmap?.height ?? r.svg?.height;
|
|
518
|
-
if (width)
|
|
519
|
-
spec.width = width;
|
|
520
|
-
if (height)
|
|
521
|
-
spec.height = height;
|
|
522
|
-
if (r.bitmap?.fileResolution)
|
|
523
|
-
spec.fileResolution = r.bitmap.fileResolution;
|
|
524
|
-
}
|
|
525
|
-
if (r.bitmap?.resolution && r.bitmap.resolution !== base.bitmap?.resolution)
|
|
526
|
-
spec.resolution = r.bitmap.resolution;
|
|
527
|
-
if (ownMaster) {
|
|
528
|
-
spec.pdfFile = `resources/${localeFolder(locale)}/${name}.pdf`;
|
|
529
|
-
files.push({ path: spec.pdfFile, fileId: pdfFileId, kind: 'blob', owner: r.id, locale });
|
|
530
|
-
}
|
|
531
|
-
if (Object.keys(spec).length > 1)
|
|
532
|
-
wording.push(spec);
|
|
533
|
-
}
|
|
534
|
-
if (wording.length > 0)
|
|
535
|
-
overrides.resources = wording;
|
|
536
|
-
// A start of its own, when it is not the shared one; an empty one
|
|
537
|
-
// says the locale's edition starts at its beginning.
|
|
538
|
-
if (entry.start !== undefined) {
|
|
539
|
-
const own = bundleStart(entry.start);
|
|
540
|
-
if (!sameJson(own, start))
|
|
541
|
-
overrides.start = own ?? {};
|
|
542
|
-
}
|
|
543
|
-
localizedSpecs[locale] = overrides;
|
|
544
|
-
}
|
|
545
|
-
// General settings of their own: the primary edition is an override too.
|
|
546
|
-
if (content.sharedConfig && meta.locale) {
|
|
547
|
-
const config = localizedConfig(content.config, configWithoutFonts, sharedSource, true);
|
|
548
|
-
if (Object.keys(config).length > 0)
|
|
549
|
-
localizedSpecs[meta.locale] = { config, ...localizedSpecs[meta.locale] };
|
|
550
|
-
}
|
|
551
|
-
const writesLocalized = Object.keys(localizedSpecs).length > 0;
|
|
552
|
-
const manifest = {
|
|
553
|
-
version: 2,
|
|
554
|
-
configVersion: CONFIG_VERSION,
|
|
555
|
-
id: meta.id,
|
|
556
|
-
name: meta.name,
|
|
557
|
-
...(meta.description ? { description: meta.description } : {}),
|
|
558
|
-
...(meta.locale ? { locale: meta.locale } : {}),
|
|
559
|
-
...(localized && meta.locale ? { locales: [meta.locale, ...Object.keys(localized)] } : {}),
|
|
560
|
-
...(thumbnailPath ? { thumbnail: thumbnailPath } : {}),
|
|
561
|
-
...(content.canvasScope === 'book' ? { view: { canvasScope: 'book' } } : {}),
|
|
562
|
-
...(start ? { start } : {}),
|
|
563
|
-
chapters: chapterSpecs,
|
|
564
|
-
config: configWithoutFonts,
|
|
565
|
-
...(resources.length > 0 ? { resources } : {}),
|
|
566
|
-
...(fonts.length > 0 ? { fonts } : {}),
|
|
567
|
-
...(localized || writesLocalized ? { localized: localizedSpecs } : {}),
|
|
568
|
-
};
|
|
569
|
-
return { manifest, files, chapterFiles, ...(Object.keys(localeChapterFiles).length > 0 ? { localeChapterFiles } : {}), warnings };
|
|
570
|
-
}
|
|
571
|
-
/** Resource fields a locale may word differently. */
|
|
572
|
-
const LOCALIZABLE_RESOURCE_FIELDS = ['caption', 'note', 'altText', 'table'];
|
|
573
|
-
/** Folder a locale's own files are written in (`chapters/es/…`). */
|
|
574
|
-
function localeFolder(locale) {
|
|
575
|
-
return slugify(locale) || 'locale';
|
|
576
|
-
}
|
|
577
|
-
function sameJson(a, b) {
|
|
578
|
-
return JSON.stringify(a) === JSON.stringify(b);
|
|
579
|
-
}
|
|
580
|
-
/** A locale's configuration as an override of the shared (stripped)
|
|
581
|
-
* settings (#1209): the fields it sets differently, `null` for a shared
|
|
582
|
-
* value it reads at its default (see `mergeConfigLayers`).
|
|
583
|
-
*
|
|
584
|
-
* The locale is stripped of its defaults as a whole, so the defaults that
|
|
585
|
-
* depend on the rest of the configuration (the language, the writing
|
|
586
|
-
* mode, a character grid) are its own: a value the shared settings drop
|
|
587
|
-
* as a default of their language is written for a locale whose default
|
|
588
|
-
* differs (`index.see.italic: true` under a Japanese locale), and one
|
|
589
|
-
* they keep that is the locale's default is not taken out by mistake.
|
|
590
|
-
* `own` is the whole edition (`whole`), or its top-level keys over the
|
|
591
|
-
* shared ones (#651: a locale that only sets `headings` on a shared
|
|
592
|
-
* character grid keeps `balancing.enabled: true`). */
|
|
593
|
-
function localizedConfig(own, shared, sharedSource, whole) {
|
|
594
|
-
const merged = whole ? { ...own } : { ...sharedSource };
|
|
595
|
-
if (!whole)
|
|
596
|
-
for (const [key, value] of Object.entries(own))
|
|
597
|
-
if (value !== undefined)
|
|
598
|
-
merged[key] = value;
|
|
599
|
-
const target = stripConfigDefaults(merged);
|
|
600
|
-
delete target.customFonts;
|
|
601
|
-
// The output profile travels once, under the shared name of its file.
|
|
602
|
-
const profile = target.print?.customProfile;
|
|
603
|
-
if (profile && profile.fileId === sharedSource.print?.customProfile?.fileId && shared.print?.customProfile) {
|
|
604
|
-
target.print = { ...target.print, customProfile: shared.print.customProfile };
|
|
605
|
-
}
|
|
606
|
-
// A `null` the locale reads the same without (the shared value is its
|
|
607
|
-
// default too) is not written.
|
|
608
|
-
return leastConfigOverride(shared, target, (c) => {
|
|
609
|
-
const out = stripConfigDefaults(c);
|
|
610
|
-
delete out.customFonts;
|
|
611
|
-
return out;
|
|
612
|
-
});
|
|
613
|
-
}
|
|
614
|
-
function toBytes(data) {
|
|
615
|
-
return data instanceof Uint8Array ? data : new Uint8Array(data);
|
|
616
|
-
}
|
|
617
|
-
/** Resolve a plan's bytes. A resource whose payload is gone is dropped from
|
|
618
|
-
* the manifest (a spec without a file would come back as a broken
|
|
619
|
-
* figure); a font variant whose file is gone is dropped likewise, and its
|
|
620
|
-
* family with it when nothing remains. */
|
|
621
|
-
export async function resolveBundleFiles(plan, sources) {
|
|
622
|
-
const warnings = [...plan.warnings];
|
|
623
|
-
const files = {};
|
|
624
|
-
const missingPaths = new Set();
|
|
625
|
-
await Promise.all(plan.files.map(async (f) => {
|
|
626
|
-
const bytes = f.kind === 'blob'
|
|
627
|
-
? await Promise.resolve(sources.readBlob(f.fileId)).catch(() => null)
|
|
628
|
-
: await Promise.resolve(sources.readFont(f.fileId)).catch(() => null);
|
|
629
|
-
if (!bytes) {
|
|
630
|
-
missingPaths.add(f.path);
|
|
631
|
-
warnings.push(f.locale ? `${f.owner}: missing ${f.locale} file, the shared one is used` : `${f.owner}: missing file, skipped`);
|
|
632
|
-
return;
|
|
633
|
-
}
|
|
634
|
-
files[f.path] = toBytes(bytes);
|
|
635
|
-
}));
|
|
636
|
-
let manifest = plan.manifest;
|
|
637
|
-
if (manifest.thumbnail && missingPaths.has(manifest.thumbnail)) {
|
|
638
|
-
manifest = { ...manifest };
|
|
639
|
-
delete manifest.thumbnail;
|
|
640
|
-
}
|
|
641
|
-
if (missingPaths.size > 0) {
|
|
642
|
-
const resources = manifest.resources
|
|
643
|
-
// A video keeps its address and player without its file or poster.
|
|
644
|
-
?.filter((r) => r.kind === 'video' || !r.file || !missingPaths.has(r.file))
|
|
645
|
-
.map((r) => {
|
|
646
|
-
if (r.kind === 'video') {
|
|
647
|
-
const spec = { ...r };
|
|
648
|
-
if (spec.file && missingPaths.has(spec.file))
|
|
649
|
-
delete spec.file;
|
|
650
|
-
if (spec.poster && missingPaths.has(spec.poster)) {
|
|
651
|
-
delete spec.poster;
|
|
652
|
-
delete spec.width;
|
|
653
|
-
delete spec.height;
|
|
654
|
-
}
|
|
655
|
-
return spec;
|
|
656
|
-
}
|
|
657
|
-
return r.pdfFile && missingPaths.has(r.pdfFile) ? { ...r, pdfFile: undefined } : r;
|
|
658
|
-
});
|
|
659
|
-
const fonts = manifest.fonts
|
|
660
|
-
?.map((fam) => ({ ...fam, variants: fam.variants.filter((v) => !missingPaths.has(v.file)) }))
|
|
661
|
-
.filter((fam) => fam.variants.length > 0);
|
|
662
|
-
manifest = {
|
|
663
|
-
...manifest,
|
|
664
|
-
...(resources && resources.length > 0 ? { resources } : {}),
|
|
665
|
-
...(fonts && fonts.length > 0 ? { fonts } : {}),
|
|
666
|
-
};
|
|
667
|
-
if (!resources || resources.length === 0)
|
|
668
|
-
delete manifest.resources;
|
|
669
|
-
if (!fonts || fonts.length === 0)
|
|
670
|
-
delete manifest.fonts;
|
|
671
|
-
// A locale whose own artwork is missing reads the shared picture.
|
|
672
|
-
if (manifest.localized) {
|
|
673
|
-
const localized = {};
|
|
674
|
-
for (const [locale, overrides] of Object.entries(manifest.localized)) {
|
|
675
|
-
const wording = overrides.resources
|
|
676
|
-
?.map((r) => {
|
|
677
|
-
const spec = { ...r };
|
|
678
|
-
if (spec.file && missingPaths.has(spec.file)) {
|
|
679
|
-
delete spec.file;
|
|
680
|
-
delete spec.width;
|
|
681
|
-
delete spec.height;
|
|
682
|
-
delete spec.pdfFile;
|
|
683
|
-
}
|
|
684
|
-
if (spec.pdfFile && missingPaths.has(spec.pdfFile))
|
|
685
|
-
delete spec.pdfFile;
|
|
686
|
-
return spec;
|
|
687
|
-
})
|
|
688
|
-
.filter((r) => Object.keys(r).length > 1);
|
|
689
|
-
const next = { ...overrides };
|
|
690
|
-
if (wording && wording.length > 0)
|
|
691
|
-
next.resources = wording;
|
|
692
|
-
else
|
|
693
|
-
delete next.resources;
|
|
694
|
-
localized[locale] = next;
|
|
695
|
-
}
|
|
696
|
-
manifest = { ...manifest, localized };
|
|
697
|
-
}
|
|
698
|
-
}
|
|
699
|
-
const enc = new TextEncoder();
|
|
700
|
-
files['preset.json'] = enc.encode(JSON.stringify(manifest, null, 2));
|
|
701
|
-
for (const c of plan.chapterFiles)
|
|
702
|
-
files[c.path] = enc.encode(c.markdown);
|
|
703
|
-
return { files, manifest, warnings, missing: [...missingPaths] };
|
|
704
|
-
}
|
|
6
|
+
export { bundleBaseConfig, readBundle } from './codec/read.js';
|
|
7
|
+
export { traceBundleContours, EXPORTABLE_FONT_FORMATS, planBundle } from './codec/plan.js';
|
|
8
|
+
export { resolveBundleFiles } from './codec/files.js';
|
|
705
9
|
//# sourceMappingURL=codec.js.map
|