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/manifest.js
CHANGED
|
@@ -1,833 +1,9 @@
|
|
|
1
1
|
// Pure helpers for bundle manifests: validation, locale resolution, file
|
|
2
2
|
// naming, and conversion of manifest entries into engine resources and
|
|
3
3
|
// custom fonts. No DOM or storage access.
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
}
|
|
10
|
-
function isNonEmptyString(v) {
|
|
11
|
-
return typeof v === 'string' && v.length > 0;
|
|
12
|
-
}
|
|
13
|
-
function isOptionalString(v) {
|
|
14
|
-
return v === undefined || typeof v === 'string';
|
|
15
|
-
}
|
|
16
|
-
function isOptionalStringList(v) {
|
|
17
|
-
return v === undefined || (Array.isArray(v) && v.every(isNonEmptyString));
|
|
18
|
-
}
|
|
19
|
-
/** The optional showcase fields: wrong types reject the manifest rather
|
|
20
|
-
* than being silently dropped. */
|
|
21
|
-
export function hasValidShowcaseMeta(v) {
|
|
22
|
-
return isOptionalStringList(v.locales)
|
|
23
|
-
&& isOptionalString(v.thumbnail)
|
|
24
|
-
&& isOptionalString(v.openLocale)
|
|
25
|
-
&& isOptionalString(v.license)
|
|
26
|
-
&& isOptionalString(v.credits)
|
|
27
|
-
&& isOptionalStringList(v.tags);
|
|
28
|
-
}
|
|
29
|
-
function isMarkdownField(v) {
|
|
30
|
-
if (isNonEmptyString(v))
|
|
31
|
-
return true;
|
|
32
|
-
if (!isRecord(v))
|
|
33
|
-
return false;
|
|
34
|
-
const values = Object.values(v);
|
|
35
|
-
return values.length > 0 && values.every(isNonEmptyString);
|
|
36
|
-
}
|
|
37
|
-
function isChapterSpec(v) {
|
|
38
|
-
return isRecord(v) && typeof v.title === 'string' && isNonEmptyString(v.file);
|
|
39
|
-
}
|
|
40
|
-
function isChapterList(v) {
|
|
41
|
-
return Array.isArray(v) && v.length > 0 && v.every(isChapterSpec);
|
|
42
|
-
}
|
|
43
|
-
function isChaptersField(v) {
|
|
44
|
-
if (isChapterList(v))
|
|
45
|
-
return true;
|
|
46
|
-
if (!isRecord(v))
|
|
47
|
-
return false;
|
|
48
|
-
const values = Object.values(v);
|
|
49
|
-
return values.length > 0 && values.every(isChapterList);
|
|
50
|
-
}
|
|
51
|
-
function isLocaleOverrides(v) {
|
|
52
|
-
if (!isRecord(v))
|
|
53
|
-
return false;
|
|
54
|
-
if (!isOptionalString(v.name) || !isOptionalString(v.description))
|
|
55
|
-
return false;
|
|
56
|
-
if (v.config !== undefined && !isRecord(v.config))
|
|
57
|
-
return false;
|
|
58
|
-
if (v.view !== undefined && !isViewField(v.view))
|
|
59
|
-
return false;
|
|
60
|
-
if (v.start !== undefined && !isRecord(v.start))
|
|
61
|
-
return false;
|
|
62
|
-
if (v.resources !== undefined) {
|
|
63
|
-
if (!Array.isArray(v.resources))
|
|
64
|
-
return false;
|
|
65
|
-
if (!v.resources.every((r) => isRecord(r) && isNonEmptyString(r.id)))
|
|
66
|
-
return false;
|
|
67
|
-
}
|
|
68
|
-
return true;
|
|
69
|
-
}
|
|
70
|
-
function isViewField(v) {
|
|
71
|
-
if (!isRecord(v))
|
|
72
|
-
return false;
|
|
73
|
-
return v.canvasScope === undefined || v.canvasScope === 'book' || v.canvasScope === 'chapter';
|
|
74
|
-
}
|
|
75
|
-
function isLocalizedField(v) {
|
|
76
|
-
return isRecord(v) && Object.values(v).every(isLocaleOverrides);
|
|
77
|
-
}
|
|
78
|
-
/** True when `data` is a valid `preset.json`, version 1 (`markdown`) or 2
|
|
79
|
-
* (`chapters`). */
|
|
80
|
-
export function isBundleManifest(data) {
|
|
81
|
-
if (!isRecord(data))
|
|
82
|
-
return false;
|
|
83
|
-
if (data.version !== 1 && data.version !== 2)
|
|
84
|
-
return false;
|
|
85
|
-
if (!isNonEmptyString(data.id) || !isNonEmptyString(data.name))
|
|
86
|
-
return false;
|
|
87
|
-
if (data.version === 1 && !isMarkdownField(data.markdown))
|
|
88
|
-
return false;
|
|
89
|
-
if (data.version === 2 && !isChaptersField(data.chapters))
|
|
90
|
-
return false;
|
|
91
|
-
if (!hasValidShowcaseMeta(data))
|
|
92
|
-
return false;
|
|
93
|
-
if (data.view !== undefined && !isViewField(data.view))
|
|
94
|
-
return false;
|
|
95
|
-
if (data.start !== undefined && !isRecord(data.start))
|
|
96
|
-
return false;
|
|
97
|
-
if (data.localized !== undefined && !isLocalizedField(data.localized))
|
|
98
|
-
return false;
|
|
99
|
-
if (data.config !== undefined && !isRecord(data.config))
|
|
100
|
-
return false;
|
|
101
|
-
if (data.resources !== undefined) {
|
|
102
|
-
if (!Array.isArray(data.resources))
|
|
103
|
-
return false;
|
|
104
|
-
if (!data.resources.every((r) => isRecord(r) && isNonEmptyString(r.id) && isNonEmptyString(r.typeId)))
|
|
105
|
-
return false;
|
|
106
|
-
}
|
|
107
|
-
if (data.fonts !== undefined) {
|
|
108
|
-
if (!Array.isArray(data.fonts))
|
|
109
|
-
return false;
|
|
110
|
-
const ok = data.fonts.every((f) => isRecord(f) && isNonEmptyString(f.name) && Array.isArray(f.variants)
|
|
111
|
-
&& (f.fallback === undefined || isNonEmptyString(f.fallback))
|
|
112
|
-
&& f.variants.every((v) => isRecord(v) && typeof v.weight === 'number' && isNonEmptyString(v.file)));
|
|
113
|
-
if (!ok)
|
|
114
|
-
return false;
|
|
115
|
-
}
|
|
116
|
-
return true;
|
|
117
|
-
}
|
|
118
|
-
// ---------------------------------------------------------------------------
|
|
119
|
-
// Locale resolution
|
|
120
|
-
/** The key of a locale → value map that serves `locale`: the one
|
|
121
|
-
* `matchContentLocale` picks (exact tag, then the same language and
|
|
122
|
-
* script, so `zh-TW` finds `zh-Hant` before `zh-Hans`, then the language
|
|
123
|
-
* in another script: `zh-TW` reads a bare `zh` rather than the manifest's
|
|
124
|
-
* English), else the one serving the manifest's own locale, then the
|
|
125
|
-
* first key. */
|
|
126
|
-
function pickLocaleKey(keys, locale, manifestLocale) {
|
|
127
|
-
return matchContentLocale(keys, locale)
|
|
128
|
-
?? (manifestLocale ? matchContentLocale(keys, manifestLocale) : undefined)
|
|
129
|
-
?? keys[0];
|
|
130
|
-
}
|
|
131
|
-
/** Whether two tags are the same tag, case and `_` separators aside. */
|
|
132
|
-
function sameTag(a, b) {
|
|
133
|
-
const ca = canonicalLocaleTag(a) ?? a;
|
|
134
|
-
const cb = canonicalLocaleTag(b) ?? b;
|
|
135
|
-
return ca.toLowerCase() === cb.toLowerCase();
|
|
136
|
-
}
|
|
137
|
-
function pickByLocale(map, locale, manifestLocale) {
|
|
138
|
-
return map[pickLocaleKey(Object.keys(map), locale, manifestLocale)];
|
|
139
|
-
}
|
|
140
|
-
/** Which markdown file a version 1 manifest serves for `locale`. */
|
|
141
|
-
export function pickMarkdownFile(manifest, locale) {
|
|
142
|
-
const md = manifest.markdown;
|
|
143
|
-
if (typeof md === 'string')
|
|
144
|
-
return md;
|
|
145
|
-
return pickByLocale(md, locale, manifest.locale);
|
|
146
|
-
}
|
|
147
|
-
/** The key a bundle's content is served under for `locale`: the key of its
|
|
148
|
-
* chapter map when the chapters are a locale map; with shared chapters
|
|
149
|
-
* and `localized` wording, the manifest's own locale or one of the
|
|
150
|
-
* localized keys; null for a bundle in a single language. */
|
|
151
|
-
function contentLocaleKey(manifest, locale) {
|
|
152
|
-
const chapterMap = manifest.version === 2 && !Array.isArray(manifest.chapters) ? manifest.chapters
|
|
153
|
-
: manifest.version === 1 && typeof manifest.markdown !== 'string' ? manifest.markdown
|
|
154
|
-
: null;
|
|
155
|
-
if (chapterMap)
|
|
156
|
-
return pickLocaleKey(Object.keys(chapterMap), locale, manifest.locale);
|
|
157
|
-
const localized = Object.keys(manifest.localized ?? {});
|
|
158
|
-
if (localized.length === 0)
|
|
159
|
-
return null;
|
|
160
|
-
// Shared chapters: the manifest's own locale is one of the candidates, so
|
|
161
|
-
// reading it — or a locale the bundle does not carry — keeps the shared
|
|
162
|
-
// wording instead of falling back to the first localized entry.
|
|
163
|
-
return pickLocaleKey(manifest.locale ? [manifest.locale, ...localized] : localized, locale, manifest.locale);
|
|
164
|
-
}
|
|
165
|
-
/** The per-locale overrides that apply to `locale`, or null when the
|
|
166
|
-
* manifest has none: those of the locale the content is served under (see
|
|
167
|
-
* {@link resolveBundleLocale}), so text and wording never disagree. That
|
|
168
|
-
* is the entry of the exact tag; for any locale but the manifest's own,
|
|
169
|
-
* else the entry `matchContentLocale` picks: its bare base language (`pt`
|
|
170
|
-
* for `pt-BR`), else a regional variant of the same language, and for
|
|
171
|
-
* Chinese only an entry in the same script. The manifest's own locale is
|
|
172
|
-
* what the shared wording is written in: only an entry naming it exactly
|
|
173
|
-
* rewords it, never a sibling variant (`pt-BR` when the bundle is
|
|
174
|
-
* `pt-PT`). */
|
|
175
|
-
export function pickLocaleOverrides(manifest, locale) {
|
|
176
|
-
const localized = manifest.localized;
|
|
177
|
-
if (!localized || Object.keys(localized).length === 0)
|
|
178
|
-
return null;
|
|
179
|
-
const key = contentLocaleKey(manifest, locale);
|
|
180
|
-
if (key === null)
|
|
181
|
-
return null;
|
|
182
|
-
const keys = Object.keys(localized);
|
|
183
|
-
const exact = keys.find((k) => sameTag(k, key));
|
|
184
|
-
if (exact)
|
|
185
|
-
return localized[exact];
|
|
186
|
-
if (manifest.locale && sameTag(manifest.locale, key))
|
|
187
|
-
return null;
|
|
188
|
-
// Wording in the script of the text served: Simplified labels never
|
|
189
|
-
// reword a Traditional edition.
|
|
190
|
-
const found = matchContentLocale(keys, key);
|
|
191
|
-
return found && sameContentLocale(found, key) ? localized[found] : null;
|
|
192
|
-
}
|
|
193
|
-
/** The name and description of the edition served for `locale`: the
|
|
194
|
-
* manifest's, with that language's `localized[…].name` and
|
|
195
|
-
* `description` over them (#891). An empty localized name keeps the
|
|
196
|
-
* manifest's. Given an index entry rather than a manifest, the edition is
|
|
197
|
-
* picked among the manifest's locale and the localized keys. */
|
|
198
|
-
export function pickBundleMeta(manifest, locale) {
|
|
199
|
-
const own = pickLocaleOverrides(manifest, locale);
|
|
200
|
-
const name = own?.name?.trim() ? own.name : manifest.name;
|
|
201
|
-
const description = own?.description !== undefined && own.description !== '' ? own.description : manifest.description;
|
|
202
|
-
return { name, ...(description ? { description } : {}) };
|
|
203
|
-
}
|
|
204
|
-
/** How the edition served for `locale` opens: the manifest's `view` with
|
|
205
|
-
* that language's `localized[…].view` over it. */
|
|
206
|
-
export function pickBundleView(manifest, locale) {
|
|
207
|
-
const own = pickLocaleOverrides(manifest, locale)?.view;
|
|
208
|
-
if (!own)
|
|
209
|
-
return manifest.view;
|
|
210
|
-
return { ...manifest.view, ...own };
|
|
211
|
-
}
|
|
212
|
-
const count = (v) => (typeof v === 'number' && Number.isFinite(v) && v >= 0 ? Math.floor(v) : undefined);
|
|
213
|
-
/** Heading counters with every level a whole number: a level left out
|
|
214
|
-
* (`{ h1: 3 }`) or ill-typed counts zero. */
|
|
215
|
-
function headingCounters(v) {
|
|
216
|
-
if (!isRecord(v))
|
|
217
|
-
return undefined;
|
|
218
|
-
return { h1: count(v.h1) ?? 0, h2: count(v.h2) ?? 0, h3: count(v.h3) ?? 0, h4: count(v.h4) ?? 0, h5: count(v.h5) ?? 0, h6: count(v.h6) ?? 0 };
|
|
219
|
-
}
|
|
220
|
-
/** A map of counters (`{ figure: { counter, heading } }`), ill-typed
|
|
221
|
-
* entries left out; undefined when none is left. */
|
|
222
|
-
function counterMap(v) {
|
|
223
|
-
if (!isRecord(v))
|
|
224
|
-
return undefined;
|
|
225
|
-
const out = {};
|
|
226
|
-
for (const [key, entry] of Object.entries(v)) {
|
|
227
|
-
const counter = isRecord(entry) ? count(entry.counter) : undefined;
|
|
228
|
-
if (counter !== undefined)
|
|
229
|
-
out[key] = { counter, heading: headingCounters(entry.heading) ?? headingCounters({}) };
|
|
230
|
-
}
|
|
231
|
-
return Object.keys(out).length > 0 ? out : undefined;
|
|
232
|
-
}
|
|
233
|
-
/**
|
|
234
|
-
* Where a book starts ({@link BundleStart}), as a manifest or a caller
|
|
235
|
-
* gives it, in the shape the engine takes as a `continuation`: the fields
|
|
236
|
-
* it knows, each of the right type, the heading counters complete. A field
|
|
237
|
-
* of another type is left out rather than failing the bundle, and so is
|
|
238
|
-
* `bookPageCount`. Undefined when nothing is left: a book that starts at
|
|
239
|
-
* its own beginning.
|
|
240
|
-
*/
|
|
241
|
-
export function bundleStart(value) {
|
|
242
|
-
if (!isRecord(value))
|
|
243
|
-
return undefined;
|
|
244
|
-
const out = {};
|
|
245
|
-
const pageIndexOffset = count(value.pageIndexOffset);
|
|
246
|
-
if (pageIndexOffset !== undefined)
|
|
247
|
-
out.pageIndexOffset = pageIndexOffset;
|
|
248
|
-
if (isRecord(value.pageNumbering)) {
|
|
249
|
-
const { format, startAt } = value.pageNumbering;
|
|
250
|
-
const numbering = {
|
|
251
|
-
...(isNonEmptyString(format) ? { format: format } : {}),
|
|
252
|
-
...(typeof startAt === 'number' && Number.isFinite(startAt) ? { startAt: Math.floor(startAt) } : {}),
|
|
253
|
-
};
|
|
254
|
-
if (Object.keys(numbering).length > 0)
|
|
255
|
-
out.pageNumbering = numbering;
|
|
256
|
-
}
|
|
257
|
-
const headings = headingCounters(value.headings);
|
|
258
|
-
if (headings)
|
|
259
|
-
out.headings = headings;
|
|
260
|
-
const resourceCounters = counterMap(value.resourceCounters);
|
|
261
|
-
if (resourceCounters)
|
|
262
|
-
out.resourceCounters = resourceCounters;
|
|
263
|
-
if (isRecord(value.resourceNumbers)) {
|
|
264
|
-
const numbers = {};
|
|
265
|
-
for (const [id, entry] of Object.entries(value.resourceNumbers)) {
|
|
266
|
-
if (isRecord(entry) && typeof entry.number === 'string' && isNonEmptyString(entry.typeId)) {
|
|
267
|
-
numbers[id] = { number: entry.number, typeId: entry.typeId, heading: headingCounters(entry.heading) ?? headingCounters({}) };
|
|
268
|
-
}
|
|
269
|
-
}
|
|
270
|
-
if (Object.keys(numbers).length > 0)
|
|
271
|
-
out.resourceNumbers = numbers;
|
|
272
|
-
}
|
|
273
|
-
const statementCounters = counterMap(value.statementCounters);
|
|
274
|
-
if (statementCounters)
|
|
275
|
-
out.statementCounters = statementCounters;
|
|
276
|
-
const footnoteNumber = count(value.footnoteNumber);
|
|
277
|
-
if (footnoteNumber !== undefined)
|
|
278
|
-
out.footnoteNumber = footnoteNumber;
|
|
279
|
-
const lineNumber = count(value.lineNumber);
|
|
280
|
-
if (lineNumber !== undefined)
|
|
281
|
-
out.lineNumber = lineNumber;
|
|
282
|
-
if (isRecord(value.part) && typeof value.part.number === 'string' && typeof value.part.title === 'string') {
|
|
283
|
-
const part = { number: value.part.number, title: value.part.title };
|
|
284
|
-
if (isRecord(value.part.palette)) {
|
|
285
|
-
const palette = Object.fromEntries(Object.entries(value.part.palette).filter((entry) => typeof entry[1] === 'string'));
|
|
286
|
-
if (Object.keys(palette).length > 0)
|
|
287
|
-
part.palette = palette;
|
|
288
|
-
}
|
|
289
|
-
out.part = part;
|
|
290
|
-
}
|
|
291
|
-
if (value.afterPartPage === true)
|
|
292
|
-
out.afterPartPage = true;
|
|
293
|
-
return Object.keys(out).length > 0 ? out : undefined;
|
|
294
|
-
}
|
|
295
|
-
/** Where the edition served for `locale` starts: that language's
|
|
296
|
-
* `localized[…].start`, else the manifest's `start`; undefined for a book
|
|
297
|
-
* that starts at its own beginning. */
|
|
298
|
-
export function pickBundleStart(manifest, locale) {
|
|
299
|
-
const own = pickLocaleOverrides(manifest, locale)?.start;
|
|
300
|
-
return bundleStart(own !== undefined ? own : manifest.start);
|
|
301
|
-
}
|
|
302
|
-
/** The locale a bundle actually serves for `locale`: the key of its
|
|
303
|
-
* chapter map when the content is a locale map, the key whose wording it
|
|
304
|
-
* reads when shared chapters carry `localized` wording, else the
|
|
305
|
-
* manifest's own locale, else `locale` itself. */
|
|
306
|
-
export function resolveBundleLocale(manifest, locale) {
|
|
307
|
-
return contentLocaleKey(manifest, locale) ?? manifest.locale ?? locale;
|
|
308
|
-
}
|
|
309
|
-
/** The language a bundle's default configuration is localised to (the
|
|
310
|
-
* names of the built-in resource types: "Figure", "Figura"), read for
|
|
311
|
-
* `locale`. When the manifest names its languages, the one its content is
|
|
312
|
-
* served in ({@link resolveBundleLocale}); when it names none, the
|
|
313
|
-
* document language of its own `config` (`locale`, then
|
|
314
|
-
* `bodyText.hyphenation.locale`), as the engine resolves it; else
|
|
315
|
-
* `locale`. */
|
|
316
|
-
export function resolveBundleConfigLocale(manifest, locale) {
|
|
317
|
-
if (presentTag(manifest.locale) || contentLocaleKey(manifest, locale) !== null)
|
|
318
|
-
return resolveBundleLocale(manifest, locale);
|
|
319
|
-
return presentTag(manifest.config?.locale) ?? presentTag(manifest.config?.bodyText?.hyphenation?.locale) ?? locale;
|
|
320
|
-
}
|
|
321
|
-
/** The chapter files to read for `locale`: a version 1 manifest yields a
|
|
322
|
-
* single untitled chapter. */
|
|
323
|
-
export function pickChapterSpecs(manifest, locale) {
|
|
324
|
-
if (manifest.version === 1)
|
|
325
|
-
return [{ title: '', file: pickMarkdownFile(manifest, locale) }];
|
|
326
|
-
const ch = manifest.chapters;
|
|
327
|
-
return Array.isArray(ch) ? ch : pickByLocale(ch, locale, manifest.locale);
|
|
328
|
-
}
|
|
329
|
-
// ---------------------------------------------------------------------------
|
|
330
|
-
// File names
|
|
331
|
-
/** Lowercase, hyphen-separated slug: diacritics stripped, letters and
|
|
332
|
-
* digits of every script kept (`第一回-甄士隐梦幻识通灵`, #181), runs of
|
|
333
|
-
* anything else collapsed to one hyphen. '' for symbol-only input. */
|
|
334
|
-
export function slugify(input) {
|
|
335
|
-
return input
|
|
336
|
-
.normalize('NFKD')
|
|
337
|
-
.replace(/\p{M}/gu, '')
|
|
338
|
-
.toLowerCase()
|
|
339
|
-
.replace(/[^\p{L}\p{N}]+/gu, '-')
|
|
340
|
-
.replace(/^-+|-+$/g, '');
|
|
341
|
-
}
|
|
342
|
-
/** `candidate`, or `candidate-2`, `-3`, … when `taken` has it; a blank
|
|
343
|
-
* candidate falls back to `fallback`. */
|
|
344
|
-
export function uniqueSlug(candidate, taken, fallback = 'resource') {
|
|
345
|
-
const base = candidate || fallback;
|
|
346
|
-
if (!taken.has(base))
|
|
347
|
-
return base;
|
|
348
|
-
let n = 2;
|
|
349
|
-
while (taken.has(`${base}-${n}`))
|
|
350
|
-
n++;
|
|
351
|
-
return `${base}-${n}`;
|
|
352
|
-
}
|
|
353
|
-
/** `chapters/01-intro.md`: zero-padded ordinal (at least two digits) plus a
|
|
354
|
-
* slug of the title, unique against `taken` (which it extends). */
|
|
355
|
-
export function chapterFileName(index, title, taken, count = 1) {
|
|
356
|
-
const digits = Math.max(2, String(count).length);
|
|
357
|
-
const ordinal = String(index + 1).padStart(digits, '0');
|
|
358
|
-
const name = uniqueSlug(`${ordinal}-${slugify(title) || 'chapter'}`, taken, 'chapter');
|
|
359
|
-
taken.add(name);
|
|
360
|
-
return `chapters/${name}.md`;
|
|
361
|
-
}
|
|
362
|
-
export function fileExtension(file) {
|
|
363
|
-
const base = file.split('/').pop() ?? file;
|
|
364
|
-
const dot = base.lastIndexOf('.');
|
|
365
|
-
return dot === -1 ? '' : base.slice(dot + 1).toLowerCase();
|
|
366
|
-
}
|
|
367
|
-
export function fileBasename(file) {
|
|
368
|
-
return file.split('/').pop() ?? file;
|
|
369
|
-
}
|
|
370
|
-
const MIME_BY_EXT = {
|
|
371
|
-
svg: 'image/svg+xml',
|
|
372
|
-
png: 'image/png',
|
|
373
|
-
jpg: 'image/jpeg',
|
|
374
|
-
jpeg: 'image/jpeg',
|
|
375
|
-
webp: 'image/webp',
|
|
376
|
-
gif: 'image/gif',
|
|
377
|
-
pdf: 'application/pdf',
|
|
378
|
-
ttf: 'font/ttf',
|
|
379
|
-
otf: 'font/otf',
|
|
380
|
-
woff2: 'font/woff2',
|
|
381
|
-
md: 'text/markdown',
|
|
382
|
-
json: 'application/json',
|
|
383
|
-
mp4: 'video/mp4',
|
|
384
|
-
m4v: 'video/mp4',
|
|
385
|
-
webm: 'video/webm',
|
|
386
|
-
ogv: 'video/ogg',
|
|
387
|
-
mov: 'video/quicktime',
|
|
388
|
-
};
|
|
389
|
-
/** Media type of a bundle file, from its extension. */
|
|
390
|
-
export function mimeForFile(file) {
|
|
391
|
-
return MIME_BY_EXT[fileExtension(file)] ?? 'application/octet-stream';
|
|
392
|
-
}
|
|
393
|
-
const BITMAP_FORMAT_BY_EXT = {
|
|
394
|
-
png: 'png',
|
|
395
|
-
jpg: 'jpeg',
|
|
396
|
-
jpeg: 'jpeg',
|
|
397
|
-
webp: 'webp',
|
|
398
|
-
gif: 'gif',
|
|
399
|
-
};
|
|
400
|
-
/** True when `file` is a bitmap the engine can place. */
|
|
401
|
-
export function isBitmapFile(file) {
|
|
402
|
-
return fileExtension(file) in BITMAP_FORMAT_BY_EXT;
|
|
403
|
-
}
|
|
404
|
-
const VIDEO_FORMAT_BY_EXT = {
|
|
405
|
-
mp4: 'mp4',
|
|
406
|
-
m4v: 'mp4',
|
|
407
|
-
webm: 'webm',
|
|
408
|
-
ogv: 'ogv',
|
|
409
|
-
mov: 'mov',
|
|
410
|
-
};
|
|
411
|
-
/** True when `file` is a video a bundle carries (#454). */
|
|
412
|
-
export function isVideoFile(file) {
|
|
413
|
-
return fileExtension(file) in VIDEO_FORMAT_BY_EXT;
|
|
414
|
-
}
|
|
415
|
-
/** The bitmap format of a picture file (`png`, `jpeg`…), or undefined. */
|
|
416
|
-
export function bitmapFormatOf(file) {
|
|
417
|
-
return BITMAP_FORMAT_BY_EXT[fileExtension(file)];
|
|
418
|
-
}
|
|
419
|
-
export function isSvgFile(file) {
|
|
420
|
-
return fileExtension(file) === 'svg';
|
|
421
|
-
}
|
|
422
|
-
export function isPdfFile(file) {
|
|
423
|
-
return fileExtension(file) === 'pdf';
|
|
424
|
-
}
|
|
425
|
-
/** Font format of a file name, or null when it is not a font. */
|
|
426
|
-
export function fontFormatFromFile(file) {
|
|
427
|
-
switch (fileExtension(file)) {
|
|
428
|
-
case 'woff2': return 'woff2';
|
|
429
|
-
case 'woff': return 'woff';
|
|
430
|
-
case 'ttf': return 'ttf';
|
|
431
|
-
case 'otf': return 'otf';
|
|
432
|
-
default: return null;
|
|
433
|
-
}
|
|
434
|
-
}
|
|
435
|
-
const EXT_BY_BITMAP_FORMAT = {
|
|
436
|
-
png: 'png',
|
|
437
|
-
jpeg: 'jpg',
|
|
438
|
-
webp: 'webp',
|
|
439
|
-
gif: 'gif',
|
|
440
|
-
};
|
|
441
|
-
const EXT_BY_IMAGE_MIME = {
|
|
442
|
-
'image/png': 'png',
|
|
443
|
-
'image/jpeg': 'jpg',
|
|
444
|
-
'image/webp': 'webp',
|
|
445
|
-
'image/gif': 'gif',
|
|
446
|
-
'image/svg+xml': 'svg',
|
|
447
|
-
};
|
|
448
|
-
/** File extension to write an image of this media type under, or null when
|
|
449
|
-
* it is not a picture a bundle takes (a cover thumbnail). */
|
|
450
|
-
export function extensionForImageMime(mime) {
|
|
451
|
-
return EXT_BY_IMAGE_MIME[mime.toLowerCase()] ?? null;
|
|
452
|
-
}
|
|
453
|
-
/** File extension to write a resource's bytes under, or null for resources
|
|
454
|
-
* without a file (tables). */
|
|
455
|
-
export function extensionForResource(r) {
|
|
456
|
-
if (r.kind === 'svg' && r.svg)
|
|
457
|
-
return 'svg';
|
|
458
|
-
if (r.kind === 'bitmap' && r.bitmap)
|
|
459
|
-
return EXT_BY_BITMAP_FORMAT[r.bitmap.format] ?? r.bitmap.format;
|
|
460
|
-
return null;
|
|
461
|
-
}
|
|
462
|
-
/** File extension of a self-hosted video's file (`mp4`, `webm`…). */
|
|
463
|
-
export function extensionForVideo(format) {
|
|
464
|
-
const f = (format ?? 'mp4').toLowerCase();
|
|
465
|
-
return f in VIDEO_FORMAT_BY_EXT ? f : 'mp4';
|
|
466
|
-
}
|
|
467
|
-
/** File extension of a bitmap format (`jpeg` → `jpg`). */
|
|
468
|
-
export function extensionForBitmapFormat(format) {
|
|
469
|
-
return EXT_BY_BITMAP_FORMAT[format] ?? format;
|
|
470
|
-
}
|
|
471
|
-
const identity = (file) => file;
|
|
472
|
-
/** The `fallback` of a manifest family when it can stand in for it: a
|
|
473
|
-
* name other than the family's own (#978). */
|
|
474
|
-
function usableFallback(family) {
|
|
475
|
-
const fallback = typeof family.fallback === 'string' ? family.fallback.trim() : '';
|
|
476
|
-
return fallback.length > 0 && fallback.toLowerCase() !== family.name.trim().toLowerCase() ? fallback : undefined;
|
|
477
|
-
}
|
|
478
|
-
/** Turn manifest font families into `config.customFonts` entries plus the
|
|
479
|
-
* list of files to read. `.woff` is not supported by the PDF backend and
|
|
480
|
-
* is skipped with a warning, as is any unrecognised extension. */
|
|
481
|
-
export function fontsToCustomFonts(fonts, fileIdFor = identity) {
|
|
482
|
-
const families = [];
|
|
483
|
-
const files = [];
|
|
484
|
-
const warnings = [];
|
|
485
|
-
for (const family of fonts) {
|
|
486
|
-
const variants = [];
|
|
487
|
-
for (const v of family.variants) {
|
|
488
|
-
const format = fontFormatFromFile(v.file);
|
|
489
|
-
if (!format || format === 'woff') {
|
|
490
|
-
warnings.push(`${family.name}: unsupported font file "${v.file}"`);
|
|
491
|
-
continue;
|
|
492
|
-
}
|
|
493
|
-
const fileId = fileIdFor(v.file);
|
|
494
|
-
const fileName = fileBasename(v.file);
|
|
495
|
-
const style = v.style === 'italic' ? 'italic' : 'normal';
|
|
496
|
-
variants.push({ weight: v.weight, style, fileId, format, fileName });
|
|
497
|
-
files.push({ fileId, fileName, format, file: v.file, family: family.name, weight: v.weight, style });
|
|
498
|
-
}
|
|
499
|
-
const fallback = usableFallback(family);
|
|
500
|
-
if (variants.length > 0 || fallback) {
|
|
501
|
-
families.push({
|
|
502
|
-
name: family.name,
|
|
503
|
-
variants,
|
|
504
|
-
...(family.redistributable === false ? { redistributable: false } : {}),
|
|
505
|
-
...(fallback ? { fallback } : {}),
|
|
506
|
-
});
|
|
507
|
-
}
|
|
508
|
-
else
|
|
509
|
-
warnings.push(`${family.name}: no usable variants`);
|
|
510
|
-
}
|
|
511
|
-
return { families, files, warnings };
|
|
512
|
-
}
|
|
513
|
-
function positive(v) {
|
|
514
|
-
return typeof v === 'number' && Number.isFinite(v) && v > 0;
|
|
515
|
-
}
|
|
516
|
-
/** Build an engine `Resource` from a manifest entry. `size` supplies the
|
|
517
|
-
* intrinsic dimensions when the spec omits them, and a bitmap's file
|
|
518
|
-
* resolution when the spec gives no `fileResolution`. Bitmap/SVG kind is
|
|
519
|
-
* derived from the file extension. */
|
|
520
|
-
export function resourceFromSpec(spec, size, fileIdFor = identity) {
|
|
521
|
-
const now = Date.now();
|
|
522
|
-
const { file, pdfFile, poster, width, height, resolution, fileResolution, inlineFonts, score, ...rest } = spec;
|
|
523
|
-
// A score spec's notation (#1172): kept when it is whole (the codec has
|
|
524
|
-
// read a notation file into it by now).
|
|
525
|
-
const base = {
|
|
526
|
-
...rest,
|
|
527
|
-
...(score?.format && typeof score.source === 'string' ? { score: { ...score, format: score.format, source: score.source } } : {}),
|
|
528
|
-
createdAt: now,
|
|
529
|
-
updatedAt: now,
|
|
530
|
-
};
|
|
531
|
-
if (spec.kind === 'video' || (file && isVideoFile(file))) {
|
|
532
|
-
// A video (#454): its own file (self-hosted) and its poster frame.
|
|
533
|
-
const video = { source: 'file', ...(spec.video ?? {}) };
|
|
534
|
-
delete video.fileId;
|
|
535
|
-
delete video.poster;
|
|
536
|
-
const posterFormat = poster ? BITMAP_FORMAT_BY_EXT[fileExtension(poster)] : undefined;
|
|
537
|
-
const w = width ?? size?.width;
|
|
538
|
-
const h = height ?? size?.height;
|
|
539
|
-
return {
|
|
540
|
-
...base,
|
|
541
|
-
kind: 'video',
|
|
542
|
-
video: {
|
|
543
|
-
...video,
|
|
544
|
-
...(file && isVideoFile(file) ? { fileId: fileIdFor(file), format: VIDEO_FORMAT_BY_EXT[fileExtension(file)] } : {}),
|
|
545
|
-
...(poster && posterFormat ? { poster: { fileId: fileIdFor(poster), format: posterFormat, width: w ?? 0, height: h ?? 0 } } : {}),
|
|
546
|
-
},
|
|
547
|
-
};
|
|
548
|
-
}
|
|
549
|
-
if (!file)
|
|
550
|
-
return base;
|
|
551
|
-
const fileId = fileIdFor(file);
|
|
552
|
-
const w = width ?? size?.width;
|
|
553
|
-
const h = height ?? size?.height;
|
|
554
|
-
if (isSvgFile(file)) {
|
|
555
|
-
const master = pdfFile && isPdfFile(pdfFile) ? { pdfFileId: fileIdFor(pdfFile) } : {};
|
|
556
|
-
const fonts = inlineFonts === false ? { inlineFonts: false } : {};
|
|
557
|
-
return {
|
|
558
|
-
...base,
|
|
559
|
-
kind: 'svg',
|
|
560
|
-
svg: w && h ? { fileId, width: w, height: h, ...master, ...fonts } : { fileId, ...master, ...fonts },
|
|
561
|
-
};
|
|
562
|
-
}
|
|
563
|
-
const format = BITMAP_FORMAT_BY_EXT[fileExtension(file)];
|
|
564
|
-
if (format) {
|
|
565
|
-
return {
|
|
566
|
-
...base,
|
|
567
|
-
kind: 'bitmap',
|
|
568
|
-
bitmap: {
|
|
569
|
-
fileId, format, width: w ?? 0, height: h ?? 0,
|
|
570
|
-
...(positive(resolution) ? { resolution } : {}),
|
|
571
|
-
...(positive(fileResolution) ? { fileResolution } : positive(size?.resolution?.x) ? { fileResolution: size.resolution.x } : {}),
|
|
572
|
-
},
|
|
573
|
-
};
|
|
574
|
-
}
|
|
575
|
-
return base;
|
|
576
|
-
}
|
|
577
|
-
// ---------------------------------------------------------------------------
|
|
578
|
-
// Intrinsic sizes, without a DOM
|
|
579
|
-
function parseSvgLength(value) {
|
|
580
|
-
if (!value)
|
|
581
|
-
return null;
|
|
582
|
-
const trimmed = value.trim();
|
|
583
|
-
if (trimmed.endsWith('%'))
|
|
584
|
-
return null;
|
|
585
|
-
const num = parseFloat(trimmed);
|
|
586
|
-
if (!Number.isFinite(num) || num <= 0)
|
|
587
|
-
return null;
|
|
588
|
-
const unit = trimmed.replace(/^[\d.+-]+/, '').toLowerCase();
|
|
589
|
-
const factor = unit === 'pt' ? 96 / 72 : unit === 'pc' ? 16 : unit === 'in' ? 96 : unit === 'cm' ? 96 / 2.54 : unit === 'mm' ? 96 / 25.4 : 1;
|
|
590
|
-
return num * factor;
|
|
591
|
-
}
|
|
592
|
-
/** `markup` without its `<!-- … -->` comments; an unclosed one is left
|
|
593
|
-
* as it is (as `/<!--[\s\S]*?-->/g` would), read in one pass. */
|
|
594
|
-
function withoutComments(markup) {
|
|
595
|
-
let out = '';
|
|
596
|
-
let at = 0;
|
|
597
|
-
for (;;) {
|
|
598
|
-
const open = markup.indexOf('<!--', at);
|
|
599
|
-
const close = open < 0 ? -1 : markup.indexOf('-->', open + 4);
|
|
600
|
-
if (close < 0)
|
|
601
|
-
return out + markup.slice(at);
|
|
602
|
-
out += markup.slice(at, open);
|
|
603
|
-
at = close + 3;
|
|
604
|
-
}
|
|
605
|
-
}
|
|
606
|
-
const isNameChar = (c) => c !== undefined && /[\w:-]/.test(c);
|
|
607
|
-
/** The quoted attributes of a tag's inside, by name: what a global
|
|
608
|
-
* `/([\w:-]+)\s*=\s*("([^"]*)"|'([^']*)')/` finds, read in one pass. A
|
|
609
|
-
* name is only tried from the start of its run (a shorter one inside it
|
|
610
|
-
* fails the same way), so a long run of name characters with no `=`
|
|
611
|
-
* costs one step per character. */
|
|
612
|
-
function svgAttributes(inside) {
|
|
613
|
-
const attrs = {};
|
|
614
|
-
let i = 0;
|
|
615
|
-
while (i < inside.length) {
|
|
616
|
-
if (!isNameChar(inside[i]) || isNameChar(inside[i - 1])) {
|
|
617
|
-
i++;
|
|
618
|
-
continue;
|
|
619
|
-
}
|
|
620
|
-
let j = i;
|
|
621
|
-
while (isNameChar(inside[j]))
|
|
622
|
-
j++;
|
|
623
|
-
let k = j;
|
|
624
|
-
while (k < inside.length && /\s/.test(inside[k]))
|
|
625
|
-
k++;
|
|
626
|
-
if (inside[k] === '=') {
|
|
627
|
-
k++;
|
|
628
|
-
while (k < inside.length && /\s/.test(inside[k]))
|
|
629
|
-
k++;
|
|
630
|
-
const quote = inside[k];
|
|
631
|
-
const close = quote === '"' || quote === "'" ? inside.indexOf(quote, k + 1) : -1;
|
|
632
|
-
if (close >= 0) {
|
|
633
|
-
attrs[inside.slice(i, j)] = inside.slice(k + 1, close);
|
|
634
|
-
i = close + 1;
|
|
635
|
-
continue;
|
|
636
|
-
}
|
|
637
|
-
}
|
|
638
|
-
i = j;
|
|
639
|
-
}
|
|
640
|
-
return attrs;
|
|
641
|
-
}
|
|
642
|
-
/** An SVG's intrinsic pixel size from its root element: explicit
|
|
643
|
-
* `width`/`height`, else the `viewBox` extent; undefined when neither
|
|
644
|
-
* gives one. Reads the markup textually, so it runs anywhere. */
|
|
645
|
-
export function svgSize(markup) {
|
|
646
|
-
const tag = /<svg\b([^>]*)>/i.exec(withoutComments(markup));
|
|
647
|
-
if (!tag)
|
|
648
|
-
return undefined;
|
|
649
|
-
const attrs = svgAttributes(tag[1]);
|
|
650
|
-
const w = parseSvgLength(attrs.width);
|
|
651
|
-
const h = parseSvgLength(attrs.height);
|
|
652
|
-
if (w && h)
|
|
653
|
-
return { width: w, height: h };
|
|
654
|
-
const viewBox = attrs.viewBox;
|
|
655
|
-
if (viewBox) {
|
|
656
|
-
const parts = viewBox.trim().split(/[\s,]+/).map(Number);
|
|
657
|
-
if (parts.length === 4 && parts.every(Number.isFinite) && parts[2] > 0 && parts[3] > 0) {
|
|
658
|
-
return { width: parts[2], height: parts[3] };
|
|
659
|
-
}
|
|
660
|
-
}
|
|
661
|
-
return undefined;
|
|
662
|
-
}
|
|
663
|
-
/** A bitmap's pixel size read from its header (PNG, JPEG, GIF, WebP), or
|
|
664
|
-
* undefined when the header is not recognised. */
|
|
665
|
-
export function bitmapSize(bytes) {
|
|
666
|
-
const info = bitmapInfo(bytes);
|
|
667
|
-
return info ? { width: info.width, height: info.height } : undefined;
|
|
668
|
-
}
|
|
669
|
-
const INCH_PER_METRE = 0.0254;
|
|
670
|
-
/** ppi to two decimals: 11811 px/m reads as 300. */
|
|
671
|
-
function roundPpi(v) {
|
|
672
|
-
return Math.round(v * 100) / 100;
|
|
673
|
-
}
|
|
674
|
-
/** The resolution of an EXIF block (a TIFF header and IFD0, `t` its first
|
|
675
|
-
* byte): `XResolution` / `YResolution` in `ResolutionUnit` (2 inch, the
|
|
676
|
-
* default; 3 cm). Undefined without them, or with unit 1 (none). */
|
|
677
|
-
function exifResolution(b, t, end) {
|
|
678
|
-
if (t + 8 > end)
|
|
679
|
-
return undefined;
|
|
680
|
-
const view = new DataView(b.buffer, b.byteOffset, b.byteLength);
|
|
681
|
-
const order = String.fromCharCode(b[t], b[t + 1]);
|
|
682
|
-
if (order !== 'II' && order !== 'MM')
|
|
683
|
-
return undefined;
|
|
684
|
-
const le = order === 'II';
|
|
685
|
-
if (view.getUint16(t + 2, le) !== 42)
|
|
686
|
-
return undefined;
|
|
687
|
-
const ifd = t + view.getUint32(t + 4, le);
|
|
688
|
-
if (ifd + 2 > end)
|
|
689
|
-
return undefined;
|
|
690
|
-
const count = view.getUint16(ifd, le);
|
|
691
|
-
let x;
|
|
692
|
-
let y;
|
|
693
|
-
let unit = 2;
|
|
694
|
-
const rational = (entry) => {
|
|
695
|
-
if (view.getUint16(entry + 2, le) !== 5)
|
|
696
|
-
return undefined;
|
|
697
|
-
const at = t + view.getUint32(entry + 8, le);
|
|
698
|
-
if (at + 8 > end)
|
|
699
|
-
return undefined;
|
|
700
|
-
const den = view.getUint32(at + 4, le);
|
|
701
|
-
return den > 0 ? view.getUint32(at, le) / den : undefined;
|
|
702
|
-
};
|
|
703
|
-
for (let k = 0; k < count; k++) {
|
|
704
|
-
const entry = ifd + 2 + k * 12;
|
|
705
|
-
if (entry + 12 > end)
|
|
706
|
-
break;
|
|
707
|
-
const tag = view.getUint16(entry, le);
|
|
708
|
-
if (tag === 0x011a)
|
|
709
|
-
x = rational(entry);
|
|
710
|
-
else if (tag === 0x011b)
|
|
711
|
-
y = rational(entry);
|
|
712
|
-
else if (tag === 0x0128)
|
|
713
|
-
unit = view.getUint16(entry + 8, le);
|
|
714
|
-
}
|
|
715
|
-
if (!x || !y || (unit !== 2 && unit !== 3))
|
|
716
|
-
return undefined;
|
|
717
|
-
const k = unit === 3 ? 2.54 : 1;
|
|
718
|
-
return { x: x * k, y: y * k };
|
|
719
|
-
}
|
|
720
|
-
/** A bitmap's pixel size and, when the file states one, its resolution
|
|
721
|
-
* (#631): PNG `pHYs` in pixels per metre (unit 0, an aspect ratio only,
|
|
722
|
-
* is ignored); JPEG JFIF density (dpi or dots per cm; units 0 ignored) and
|
|
723
|
-
* EXIF `XResolution` / `YResolution`, EXIF winning when both are there
|
|
724
|
-
* (Photoshop writes both and edits the EXIF one); WebP EXIF. GIF carries
|
|
725
|
-
* none. The value is returned as read: 72 or 96 ppi often means "no
|
|
726
|
-
* information" (see `layout.bitmapResolution: 'file'`). Undefined when the
|
|
727
|
-
* header is not recognised. */
|
|
728
|
-
export function bitmapInfo(bytes) {
|
|
729
|
-
const b = bytes instanceof Uint8Array ? bytes : new Uint8Array(bytes);
|
|
730
|
-
const view = new DataView(b.buffer, b.byteOffset, b.byteLength);
|
|
731
|
-
const ascii = (at, len) => String.fromCharCode(...b.subarray(at, at + len));
|
|
732
|
-
const withResolution = (width, height, res, source) => res && source && res.x > 0 && res.y > 0 && Number.isFinite(res.x) && Number.isFinite(res.y)
|
|
733
|
-
? { width, height, resolution: { x: roundPpi(res.x), y: roundPpi(res.y), source } }
|
|
734
|
-
: { width, height };
|
|
735
|
-
if (b.length >= 24 && b[0] === 0x89 && ascii(1, 3) === 'PNG') {
|
|
736
|
-
const width = view.getUint32(16);
|
|
737
|
-
const height = view.getUint32(20);
|
|
738
|
-
// Chunks after the signature; `pHYs` comes before the image data.
|
|
739
|
-
let i = 8;
|
|
740
|
-
while (i + 8 <= b.length) {
|
|
741
|
-
const len = view.getUint32(i);
|
|
742
|
-
const type = ascii(i + 4, 4);
|
|
743
|
-
if (type === 'IDAT' || type === 'IEND')
|
|
744
|
-
break;
|
|
745
|
-
if (type === 'pHYs' && len >= 9 && i + 17 <= b.length) {
|
|
746
|
-
if (b[i + 16] === 1) {
|
|
747
|
-
return withResolution(width, height, { x: view.getUint32(i + 8) * INCH_PER_METRE, y: view.getUint32(i + 12) * INCH_PER_METRE }, 'pHYs');
|
|
748
|
-
}
|
|
749
|
-
break;
|
|
750
|
-
}
|
|
751
|
-
i += 12 + len;
|
|
752
|
-
}
|
|
753
|
-
return { width, height };
|
|
754
|
-
}
|
|
755
|
-
if (b.length >= 10 && ascii(0, 3) === 'GIF') {
|
|
756
|
-
return { width: view.getUint16(6, true), height: view.getUint16(8, true) };
|
|
757
|
-
}
|
|
758
|
-
if (b.length >= 30 && ascii(0, 4) === 'RIFF' && ascii(8, 4) === 'WEBP') {
|
|
759
|
-
const chunk = ascii(12, 4);
|
|
760
|
-
if (chunk === 'VP8X') {
|
|
761
|
-
const w = 1 + (b[24] | (b[25] << 8) | (b[26] << 16));
|
|
762
|
-
const h = 1 + (b[27] | (b[28] << 8) | (b[29] << 16));
|
|
763
|
-
// Flag bit 3: an EXIF chunk follows the image data.
|
|
764
|
-
if (b[20] & 0x08) {
|
|
765
|
-
let i = 12;
|
|
766
|
-
while (i + 8 <= b.length) {
|
|
767
|
-
const size = view.getUint32(i + 4, true);
|
|
768
|
-
if (ascii(i, 4) === 'EXIF') {
|
|
769
|
-
let t = i + 8;
|
|
770
|
-
const end = Math.min(b.length, t + size);
|
|
771
|
-
// Some writers keep JPEG's "Exif\0\0" prefix.
|
|
772
|
-
if (ascii(t, 4) === 'Exif')
|
|
773
|
-
t += 6;
|
|
774
|
-
return withResolution(w, h, exifResolution(b, t, end), 'exif');
|
|
775
|
-
}
|
|
776
|
-
i += 8 + size + (size & 1);
|
|
777
|
-
}
|
|
778
|
-
}
|
|
779
|
-
return { width: w, height: h };
|
|
780
|
-
}
|
|
781
|
-
if (chunk === 'VP8 ')
|
|
782
|
-
return { width: view.getUint16(26, true) & 0x3fff, height: view.getUint16(28, true) & 0x3fff };
|
|
783
|
-
if (chunk === 'VP8L') {
|
|
784
|
-
const bits = view.getUint32(21, true);
|
|
785
|
-
return { width: (bits & 0x3fff) + 1, height: ((bits >> 14) & 0x3fff) + 1 };
|
|
786
|
-
}
|
|
787
|
-
return undefined;
|
|
788
|
-
}
|
|
789
|
-
if (b.length >= 4 && b[0] === 0xff && b[1] === 0xd8) {
|
|
790
|
-
let jfif;
|
|
791
|
-
let exif;
|
|
792
|
-
let i = 2;
|
|
793
|
-
while (i + 9 < b.length) {
|
|
794
|
-
if (b[i] !== 0xff) {
|
|
795
|
-
i++;
|
|
796
|
-
continue;
|
|
797
|
-
}
|
|
798
|
-
const marker = b[i + 1];
|
|
799
|
-
if (marker === 0xff) {
|
|
800
|
-
i++;
|
|
801
|
-
continue;
|
|
802
|
-
}
|
|
803
|
-
// Start-of-frame markers carry the size (not DHT, JPG, DAC).
|
|
804
|
-
if (marker >= 0xc0 && marker <= 0xcf && marker !== 0xc4 && marker !== 0xc8 && marker !== 0xcc) {
|
|
805
|
-
const width = view.getUint16(i + 7);
|
|
806
|
-
const height = view.getUint16(i + 5);
|
|
807
|
-
if (exif)
|
|
808
|
-
return withResolution(width, height, exif, 'exif');
|
|
809
|
-
return withResolution(width, height, jfif, 'jfif');
|
|
810
|
-
}
|
|
811
|
-
if (marker === 0xd8 || (marker >= 0xd0 && marker <= 0xd7) || marker === 0x01) {
|
|
812
|
-
i += 2;
|
|
813
|
-
continue;
|
|
814
|
-
}
|
|
815
|
-
const len = view.getUint16(i + 2);
|
|
816
|
-
const end = Math.min(b.length, i + 2 + len);
|
|
817
|
-
if (marker === 0xe0 && !jfif && i + 16 <= end && ascii(i + 4, 5) === 'JFIF\0') {
|
|
818
|
-
// Units: 1 dots per inch, 2 dots per cm, 0 an aspect ratio only.
|
|
819
|
-
const units = b[i + 11];
|
|
820
|
-
const x = view.getUint16(i + 12);
|
|
821
|
-
const y = view.getUint16(i + 14);
|
|
822
|
-
if ((units === 1 || units === 2) && x > 0 && y > 0)
|
|
823
|
-
jfif = units === 2 ? { x: x * 2.54, y: y * 2.54 } : { x, y };
|
|
824
|
-
}
|
|
825
|
-
else if (marker === 0xe1 && !exif && i + 10 <= end && ascii(i + 4, 6) === 'Exif\0\0') {
|
|
826
|
-
exif = exifResolution(b, i + 10, end);
|
|
827
|
-
}
|
|
828
|
-
i += 2 + len;
|
|
829
|
-
}
|
|
830
|
-
}
|
|
831
|
-
return undefined;
|
|
832
|
-
}
|
|
4
|
+
export { hasValidShowcaseMeta, isBundleManifest } from './manifest/validation.js';
|
|
5
|
+
export { pickMarkdownFile, pickLocaleOverrides, pickBundleMeta, pickBundleView, bundleStart, pickBundleStart, resolveBundleLocale, resolveBundleConfigLocale, pickChapterSpecs } from './manifest/locale.js';
|
|
6
|
+
export { slugify, uniqueSlug, chapterFileName, fileExtension, fileBasename, mimeForFile, isBitmapFile, isVideoFile, bitmapFormatOf, isSvgFile, isPdfFile, fontFormatFromFile, extensionForImageMime, extensionForResource, extensionForVideo, extensionForBitmapFormat } from './manifest/fileNames.js';
|
|
7
|
+
export { fontsToCustomFonts, resourceFromSpec } from './manifest/entries.js';
|
|
8
|
+
export { svgSize, bitmapSize, bitmapInfo } from './manifest/sizes.js';
|
|
833
9
|
//# sourceMappingURL=manifest.js.map
|