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
|
@@ -1,20 +1,10 @@
|
|
|
1
1
|
import type { InlineSpan } from '../../parse/index.js';
|
|
2
|
-
import type {
|
|
3
|
-
import type {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
* `blankForParity` pages belong to the upcoming chapter (they exist
|
|
9
|
-
* solely to push it onto the right parity). `blankForForce` pages
|
|
10
|
-
* belong to the *previous* chapter (they are the mandatory separator
|
|
11
|
-
* of the `always-*` modes) — the walker stops when it hits one. */
|
|
12
|
-
export interface ChapterTitlePageInfo {
|
|
13
|
-
blankForParity?: boolean;
|
|
14
|
-
blankForForce?: boolean;
|
|
15
|
-
/** Set on a part-divider page. */
|
|
16
|
-
partInfo?: unknown;
|
|
17
|
-
}
|
|
2
|
+
import type { DocumentMetadata, DigitSystem } from '../../types.js';
|
|
3
|
+
import type { VDTPage, VDTBlock } from '../../vdt.js';
|
|
4
|
+
export { computeChapterTitles, computeChapterNumbers, computeChapterNumbersByBlock, chapterNumberCounter, computeChapterAttrs, computeChapterTitlesAtTop, computeChapterNumbersAtTop, computePartValues } from './placeholders/chapterValues.js';
|
|
5
|
+
export type { ChapterTitlePageInfo, ChapterNumberSource, PartPageInfo } from './placeholders/chapterValues.js';
|
|
6
|
+
export { lineJoin, blockLinesText, plainTitleText } from './placeholders/lineText.js';
|
|
7
|
+
export type { JoinedLine, BlockLinesTextOptions } from './placeholders/lineText.js';
|
|
18
8
|
export interface PlaceholderContext {
|
|
19
9
|
page: VDTPage;
|
|
20
10
|
allPages: VDTPage[];
|
|
@@ -129,169 +119,6 @@ export declare function computePageMarks(blocks: readonly VDTBlock[], totalPages
|
|
|
129
119
|
styleId: string;
|
|
130
120
|
text: string;
|
|
131
121
|
} | undefined): PageMarks;
|
|
132
|
-
/**
|
|
133
|
-
* Precompute chapter titles (most recent H1 text) for each page index by
|
|
134
|
-
* walking blocks once. Returns an array where `result[pageIndex]` is the plain
|
|
135
|
-
* text of the most recent H1 encountered at or before that page. When no H1
|
|
136
|
-
* has appeared yet, the entry is an empty string.
|
|
137
|
-
*
|
|
138
|
-
* When `pages` is supplied, blank parity-padding pages immediately
|
|
139
|
-
* preceding a new H1 are retroactively attributed to the *upcoming*
|
|
140
|
-
* chapter — the blank left-hand page that exists only to push the next
|
|
141
|
-
* chapter onto a right-hand page should display the new chapter's title
|
|
142
|
-
* in its header, not the previous chapter's.
|
|
143
|
-
*/
|
|
144
|
-
export declare function computeChapterTitles(blocks: VDTBlock[], totalPages: number, pages?: ChapterTitlePageInfo[]): string[];
|
|
145
|
-
/**
|
|
146
|
-
* Precompute chapter numbers (most recent H1 `numberPrefix`) per page. Mirrors
|
|
147
|
-
* `computeChapterTitles` but tracks the numeric prefix (e.g. `"1"`, `"2"`) so
|
|
148
|
-
* `{chapterNumber}` in heading-context slots resolves to the current chapter.
|
|
149
|
-
*/
|
|
150
|
-
export declare function computeChapterNumbers(blocks: VDTBlock[], totalPages: number, pages?: ChapterTitlePageInfo[], ordinalOffset?: number,
|
|
151
|
-
/** Chapters that print no number at all (a heading style whose
|
|
152
|
-
* `numberingTemplate` is `''`): they count, but show no ordinal. */
|
|
153
|
-
numberless?: (block: VDTBlock) => boolean,
|
|
154
|
-
/** The document's digit system, for the chapter ordinal. */
|
|
155
|
-
digits?: DigitSystem): string[];
|
|
156
|
-
/**
|
|
157
|
-
* `{chapterNumber}` at each placed block: the value of the last level-1
|
|
158
|
-
* heading at or before it in document order ('' before the first), by the
|
|
159
|
-
* same counter as `computeChapterNumbers`. A heading design reads its own
|
|
160
|
-
* block's value — where two chapters meet on a page, the page value is the
|
|
161
|
-
* later one's, which is right for the running heads but not for the first
|
|
162
|
-
* chapter's heading, nor for a lower heading that comes before the later
|
|
163
|
-
* chapter. The document's build measures an opener with this same value
|
|
164
|
-
* (over the content blocks), so measure and paint agree.
|
|
165
|
-
*/
|
|
166
|
-
export declare function computeChapterNumbersByBlock(blocks: readonly VDTBlock[], ordinalOffset?: number, numberless?: (block: VDTBlock) => boolean, digits?: DigitSystem): Map<VDTBlock, string>;
|
|
167
|
-
/** The fields of a level-1 heading `{chapterNumber}` reads. */
|
|
168
|
-
export interface ChapterNumberSource {
|
|
169
|
-
/** A heading style with `numbered: false`. */
|
|
170
|
-
unnumbered?: boolean;
|
|
171
|
-
/** The heading's content block index: blocks of one heading split
|
|
172
|
-
* across columns share it and count once. */
|
|
173
|
-
contentIndex?: number;
|
|
174
|
-
/** The heading's own counter value (a `startAt` attribute restarts it). */
|
|
175
|
-
headingNumber?: number;
|
|
176
|
-
/** The formatted number the level's (or style's) template prints. */
|
|
177
|
-
numberPrefix?: string;
|
|
178
|
-
}
|
|
179
|
-
/** What `{chapterNumber}` prints for each level-1 heading, fed in document
|
|
180
|
-
* order: the heading's number prefix, else — without a numbering
|
|
181
|
-
* template — the chapter ordinal, continuing past the `ordinalOffset`
|
|
182
|
-
* chapters laid out before this document. An unnumbered chapter advances
|
|
183
|
-
* nothing and shows nothing; a `numberless` one counts but shows nothing.
|
|
184
|
-
* One rule for the running heads (`computeChapterNumbers`, over the placed
|
|
185
|
-
* blocks) and for measuring an opener design before it is painted (over
|
|
186
|
-
* the content blocks), so both read the same value. The ordinal is
|
|
187
|
-
* written in the document's `digits`; a prefix already is. */
|
|
188
|
-
export declare function chapterNumberCounter<B extends ChapterNumberSource>(ordinalOffset?: number, numberless?: (block: B) => boolean, digits?: DigitSystem): (block: B) => string;
|
|
189
|
-
/**
|
|
190
|
-
* Precompute the heading attributes (`# Title {key="value"}`) of the most
|
|
191
|
-
* recent H1 per page. Backs `{attr.<key>}` in header/footer slots; pages
|
|
192
|
-
* before the first H1 get an empty record.
|
|
193
|
-
*/
|
|
194
|
-
export declare function computeChapterAttrs(blocks: VDTBlock[], totalPages: number, pages?: ChapterTitlePageInfo[]): Record<string, string>[];
|
|
195
|
-
/**
|
|
196
|
-
* `{chapterTitleAtTop}`: per page, the title of the chapter in force at the
|
|
197
|
-
* top of the page, the chapter whose text opens it. That is the chapter a
|
|
198
|
-
* level-1 heading opens when the heading is the first block placed on the
|
|
199
|
-
* page, and otherwise the chapter the page runs on from, even when a new
|
|
200
|
-
* one starts lower down the page. `computeChapterTitles` gives the later
|
|
201
|
-
* one on such a page. A blank parity page goes with the page after it, as
|
|
202
|
-
* there, so it names the chapter in force at that page's top; a
|
|
203
|
-
* `blankForForce` page goes with the page before it.
|
|
204
|
-
*/
|
|
205
|
-
export declare function computeChapterTitlesAtTop(blocks: VDTBlock[], totalPages: number, pages?: ChapterTitlePageInfo[]): string[];
|
|
206
|
-
/** `{chapterNumberAtTop}`: the number of the chapter in force at the top
|
|
207
|
-
* of each page (see {@link computeChapterTitlesAtTop}), by the counter of
|
|
208
|
-
* `computeChapterNumbers`. */
|
|
209
|
-
export declare function computeChapterNumbersAtTop(blocks: VDTBlock[], totalPages: number, pages?: ChapterTitlePageInfo[], ordinalOffset?: number, numberless?: (block: VDTBlock) => boolean, digits?: DigitSystem): string[];
|
|
210
|
-
/** The page fields `computePartValues` reads. */
|
|
211
|
-
export interface PartPageInfo extends ChapterTitlePageInfo {
|
|
212
|
-
partInfo?: {
|
|
213
|
-
number: string;
|
|
214
|
-
title: string;
|
|
215
|
-
palette?: Record<string, string>;
|
|
216
|
-
};
|
|
217
|
-
}
|
|
218
|
-
/** Per page, the part in effect: the most recent part page on or before it
|
|
219
|
-
* (blank parity pages right before a part page already belong to it), or
|
|
220
|
-
* `start` — the part the preceding chapters left open — before any. Each
|
|
221
|
-
* part brings its own palette overrides (`{}` when the fence sets none),
|
|
222
|
-
* which also tint every blank leaf right before its divider. */
|
|
223
|
-
export declare function computePartValues(pages: readonly PartPageInfo[], start?: {
|
|
224
|
-
number: string;
|
|
225
|
-
title: string;
|
|
226
|
-
palette?: Record<string, string>;
|
|
227
|
-
}): {
|
|
228
|
-
partTitleByPageIndex: string[];
|
|
229
|
-
partNumberByPageIndex: string[];
|
|
230
|
-
partPaletteByPageIndex: Record<string, string>[];
|
|
231
|
-
};
|
|
232
|
-
/** The fields of a laid-out line that say how it joins the next one. */
|
|
233
|
-
export interface JoinedLine {
|
|
234
|
-
hyphenated?: boolean;
|
|
235
|
-
hardHyphen?: boolean;
|
|
236
|
-
plainStart?: number;
|
|
237
|
-
plainEnd?: number;
|
|
238
|
-
/** The line opens with the hyphen repeated from the line before
|
|
239
|
-
* (`bodyText.repeatHyphen`), which is not part of the text. */
|
|
240
|
-
repeatedHyphen?: boolean;
|
|
241
|
-
}
|
|
242
|
-
/** How a wrapped line joins the line after it when a block's lines are
|
|
243
|
-
* read back as one text (a running head's `{chapterTitle}`, a design's
|
|
244
|
-
* `{titleText}`). Returns how many characters to drop from the end of
|
|
245
|
-
* the line (the hyphen a break added) and what goes between the two
|
|
246
|
-
* lines.
|
|
247
|
-
*
|
|
248
|
-
* A hyphenated line continues its word: the break's own hyphen (a
|
|
249
|
-
* dictionary syllable, an author's soft hyphen, a word cut for being
|
|
250
|
-
* wider than the line) is dropped, and the hyphen of a line broken after
|
|
251
|
-
* the text's own (`hardHyphen`, "well-" | "known") stays. A line that
|
|
252
|
-
* ends where the next one starts in the block's plain text (`plainEnd` =
|
|
253
|
-
* `plainStart`) broke inside a run without adding anything (after a hard
|
|
254
|
-
* hyphen or a dash, or in a word cut for width, when the first-fit
|
|
255
|
-
* breaker of a heading without formatting set it) and joins with nothing.
|
|
256
|
-
* A hyphenated line that ends without a hyphen, where the next line
|
|
257
|
-
* starts one character further on in the plain text, parted a group
|
|
258
|
-
* glued by a no-break space that was wider than the line ("Cap\u00edtulo" |
|
|
259
|
-
* "XVIII"): the break took the no-break space, which comes back as
|
|
260
|
-
* U+00A0, so the group stays glued. Every other break took a space,
|
|
261
|
-
* which comes back once, and so does a space the line itself ends with
|
|
262
|
-
* (`spaceAtEnd`: the caller trimmed it from `text`); the last line is
|
|
263
|
-
* followed by nothing. */
|
|
264
|
-
export declare function lineJoin(text: string, line: JoinedLine, next: JoinedLine | undefined, spaceAtEnd?: boolean): {
|
|
265
|
-
drop: number;
|
|
266
|
-
separator: '' | ' ' | '\u00A0';
|
|
267
|
-
};
|
|
268
|
-
/** How {@link blockLinesText} reads a block. */
|
|
269
|
-
export interface BlockLinesTextOptions {
|
|
270
|
-
/** A heading's forced breaks (`\\`, `VDTBlock.titleBreaks`) as plain
|
|
271
|
-
* text reads them (`plainTitleBreak`): nothing where a Chinese
|
|
272
|
-
* character meets a digit or Latin text, where the lines hold the space
|
|
273
|
-
* the page sets as the Han–Latin space. The PDF bookmarks and document
|
|
274
|
-
* title read a heading this way (#221). */
|
|
275
|
-
plainTitleBreaks?: boolean;
|
|
276
|
-
}
|
|
277
|
-
/** A block's lines read back as the text they were broken from, the way
|
|
278
|
-
* the paragraph read before wrapping (see {@link lineJoin}): wrapped lines
|
|
279
|
-
* keep their trailing space token and hyphenated lines end with the break
|
|
280
|
-
* mark. A line of Chinese broken between two characters joins the next
|
|
281
|
-
* with nothing, and one broken at an ideographic space (U+3000, the space
|
|
282
|
-
* of a couplet title or of `numberSeparator: ' '`) gets it back, whichever
|
|
283
|
-
* of the two lines holds it. Whitespace inside the lines is kept as it is;
|
|
284
|
-
* the ends are trimmed. `\u2028` is the title-break placeholder. The
|
|
285
|
-
* running heads read a heading this way, and so do the PDF bookmarks and
|
|
286
|
-
* document title (with `options.plainTitleBreaks`). */
|
|
287
|
-
export declare function blockLinesText(block: VDTBlock, options?: BlockLinesTextOptions): string;
|
|
288
|
-
/** A title written with forced breaks (`\\`, as in a part's `title`
|
|
289
|
-
* attribute) as plain text reads it: each break as `plainTitleBreak` reads
|
|
290
|
-
* it, nothing where a Chinese character meets a digit or Latin text, the
|
|
291
|
-
* ideographic space between two Chinese characters, a space between Latin
|
|
292
|
-
* words. The PDF bookmarks of the parts read their titles this way, as
|
|
293
|
-
* those of the headings read theirs (#221). */
|
|
294
|
-
export declare function plainTitleText(title: string): string;
|
|
295
122
|
/**
|
|
296
123
|
* Resolve placeholder templates. Grammar:
|
|
297
124
|
* - `{name}` with name matching `[a-zA-Z][a-zA-Z0-9]*` is a placeholder;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"placeholders.d.ts","sourceRoot":"","sources":["../../../src/pipeline/pages/placeholders.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"placeholders.d.ts","sourceRoot":"","sources":["../../../src/pipeline/pages/placeholders.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,KAAK,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAGpE,OAAO,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAGtD,OAAO,EAAE,oBAAoB,EAAE,qBAAqB,EAAE,4BAA4B,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,yBAAyB,EAAE,0BAA0B,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAC;AACjP,YAAY,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAC/G,OAAO,EAAE,QAAQ,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AACtF,YAAY,EAAE,UAAU,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AAEpF,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,OAAO,CAAC;IACd,QAAQ,EAAE,OAAO,EAAE,CAAC;IACpB,QAAQ,EAAE,gBAAgB,CAAC;IAC3B,4EAA4E;IAC5E,uBAAuB,EAAE,MAAM,EAAE,CAAC;IAClC;;;4BAGwB;IACxB,4BAA4B,CAAC,EAAE,MAAM,EAAE,CAAC;IACxC,6BAA6B,CAAC,EAAE,MAAM,EAAE,CAAC;IACzC;;iDAE6C;IAC7C,uBAAuB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,CAAC;IACnD;iFAC6E;IAC7E,oBAAoB,CAAC,EAAE,MAAM,EAAE,CAAC;IAChC,qBAAqB,CAAC,EAAE,MAAM,EAAE,CAAC;IACjC,sBAAsB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,CAAC;IAClD;0DACsD;IACtD,wBAAwB,CAAC,EAAE,MAAM,EAAE,CAAC;IACpC;gEAC4D;IAC5D,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB;;iBAEa;IACb,QAAQ,CAAC,EAAE,WAAW,CAAC;IACvB;;uEAEmE;IACnE,QAAQ,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,SAAS,GAAG,SAAS,CAAC;IAClD;;;0BAGsB;IACtB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,oBAAoB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAC/C;AAED,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,mBAAmB,EAAE,MAAM,EAAE,CAAC;IAC9B,eAAe,EAAE,MAAM,EAAE,CAAC;CAC3B;AAED,uDAAuD;AACvD,MAAM,WAAW,yBAAyB;IACxC;4EACwE;IACxE,SAAS,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,CAAC;CACvC;AAqBD;;iEAEiE;AACjE,eAAO,MAAM,mBAAmB,QAA4D,CAAC;AAE7F;;wCAEwC;AACxC,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAIxE;AAED,wEAAwE;AACxE,eAAO,MAAM,uBAAuB,UAAU,CAAC;AAE/C,mEAAmE;AACnE,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAInE;AAED;;;0CAG0C;AAC1C,wBAAgB,wBAAwB,CAAC,IAAI,EAAE,MAAM,GAAG;IAAE,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,SAAS,CAKrF;AAED;;6EAE6E;AAC7E,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG;IAAE,KAAK,EAAE,OAAO,GAAG,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE,GAAG,SAAS,CASlG;AAED;;;4CAG4C;AAC5C,MAAM,WAAW,SAAS;IACxB,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,IAAI,EAAE,MAAM,EAAE,CAAC;CAChB;AAED;mEACmE;AACnE,MAAM,MAAM,UAAU,GAAG;IAAE,KAAK,EAAE,MAAM,CAAA;CAAE,GAAG;IAAE,OAAO,EAAE,MAAM,CAAA;CAAE,CAAC;AAEjE;0BAC0B;AAC1B,wBAAgB,YAAY,CAAC,GAAG,EAAE,MAAM,GAAG,UAAU,CAGpD;AAED;;;oCAGoC;AACpC,wBAAgB,eAAe,CAAC,KAAK,EAAE,SAAS,UAAU,EAAE,GAAG,MAAM,CAWpE;AAED;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAC9B,MAAM,EAAE,SAAS,QAAQ,EAAE,EAC3B,UAAU,EAAE,MAAM,EAClB,MAAM,EAAE,UAAU,EAClB,aAAa,CAAC,EAAE,CAAC,YAAY,EAAE,MAAM,KAAK;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,GAAG,SAAS,GACtF,SAAS,CA8BX;AAED;;;;;;;GAOG;AACH,wBAAgB,mBAAmB,CACjC,QAAQ,EAAE,MAAM,EAChB,GAAG,EAAE,kBAAkB,EACvB,OAAO,CAAC,EAAE,yBAAyB,GAClC,iBAAiB,CAoEnB;AAmCD;;;GAGG;AACH,wBAAgB,uBAAuB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,EAAE,CAkBlE;AAED;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAqB1D;AAED,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAExD;AAED,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAE3D"}
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { collapseBreakingSpaces, collapseTitleSpaces } from '../../measure/spaces.js';
|
|
1
|
+
import { collapseBreakingSpaces } from '../../measure/spaces.js';
|
|
3
2
|
import { metadataText } from '../../parse/frontmatter.js';
|
|
4
3
|
import { withDigits } from '../../numerals/arabicNumerals.js';
|
|
4
|
+
import { plainTextOfBlock } from './placeholders/lineText.js';
|
|
5
|
+
export { computeChapterTitles, computeChapterNumbers, computeChapterNumbersByBlock, chapterNumberCounter, computeChapterAttrs, computeChapterTitlesAtTop, computeChapterNumbersAtTop, computePartValues } from './placeholders/chapterValues.js';
|
|
6
|
+
export { lineJoin, blockLinesText, plainTitleText } from './placeholders/lineText.js';
|
|
5
7
|
const PLACEHOLDER_NAMES = new Set([
|
|
6
8
|
'pageNumber',
|
|
7
9
|
'totalPages',
|
|
@@ -140,402 +142,6 @@ export function computePageMarks(blocks, totalPages, source, paragraphMark) {
|
|
|
140
142
|
}
|
|
141
143
|
return { first, last };
|
|
142
144
|
}
|
|
143
|
-
/**
|
|
144
|
-
* Precompute chapter titles (most recent H1 text) for each page index by
|
|
145
|
-
* walking blocks once. Returns an array where `result[pageIndex]` is the plain
|
|
146
|
-
* text of the most recent H1 encountered at or before that page. When no H1
|
|
147
|
-
* has appeared yet, the entry is an empty string.
|
|
148
|
-
*
|
|
149
|
-
* When `pages` is supplied, blank parity-padding pages immediately
|
|
150
|
-
* preceding a new H1 are retroactively attributed to the *upcoming*
|
|
151
|
-
* chapter — the blank left-hand page that exists only to push the next
|
|
152
|
-
* chapter onto a right-hand page should display the new chapter's title
|
|
153
|
-
* in its header, not the previous chapter's.
|
|
154
|
-
*/
|
|
155
|
-
export function computeChapterTitles(blocks, totalPages, pages) {
|
|
156
|
-
return computeChapterValues(blocks, totalPages, pages, plainTextOfBlock, '');
|
|
157
|
-
}
|
|
158
|
-
/**
|
|
159
|
-
* Precompute chapter numbers (most recent H1 `numberPrefix`) per page. Mirrors
|
|
160
|
-
* `computeChapterTitles` but tracks the numeric prefix (e.g. `"1"`, `"2"`) so
|
|
161
|
-
* `{chapterNumber}` in heading-context slots resolves to the current chapter.
|
|
162
|
-
*/
|
|
163
|
-
export function computeChapterNumbers(blocks, totalPages, pages, ordinalOffset = 0,
|
|
164
|
-
/** Chapters that print no number at all (a heading style whose
|
|
165
|
-
* `numberingTemplate` is `''`): they count, but show no ordinal. */
|
|
166
|
-
numberless,
|
|
167
|
-
/** The document's digit system, for the chapter ordinal. */
|
|
168
|
-
digits) {
|
|
169
|
-
return computeChapterValues(blocks, totalPages, pages, chapterNumberCounter(ordinalOffset, numberless, digits), '');
|
|
170
|
-
}
|
|
171
|
-
/**
|
|
172
|
-
* `{chapterNumber}` at each placed block: the value of the last level-1
|
|
173
|
-
* heading at or before it in document order ('' before the first), by the
|
|
174
|
-
* same counter as `computeChapterNumbers`. A heading design reads its own
|
|
175
|
-
* block's value — where two chapters meet on a page, the page value is the
|
|
176
|
-
* later one's, which is right for the running heads but not for the first
|
|
177
|
-
* chapter's heading, nor for a lower heading that comes before the later
|
|
178
|
-
* chapter. The document's build measures an opener with this same value
|
|
179
|
-
* (over the content blocks), so measure and paint agree.
|
|
180
|
-
*/
|
|
181
|
-
export function computeChapterNumbersByBlock(blocks, ordinalOffset = 0, numberless, digits) {
|
|
182
|
-
const next = chapterNumberCounter(ordinalOffset, numberless, digits);
|
|
183
|
-
const out = new Map();
|
|
184
|
-
let current = '';
|
|
185
|
-
for (const b of blocks) {
|
|
186
|
-
// Same walk as `computeChapterValues`: unplaced blocks do not count.
|
|
187
|
-
if (b.pageIndex < 0)
|
|
188
|
-
continue;
|
|
189
|
-
if (b.headingLevel === 1) {
|
|
190
|
-
const value = next(b);
|
|
191
|
-
// A plate (`runningChapter: false`) reads its own value; the blocks
|
|
192
|
-
// after it stay in the chapter it interrupts.
|
|
193
|
-
if (b.notRunningChapter) {
|
|
194
|
-
out.set(b, value);
|
|
195
|
-
continue;
|
|
196
|
-
}
|
|
197
|
-
current = value;
|
|
198
|
-
}
|
|
199
|
-
out.set(b, current);
|
|
200
|
-
}
|
|
201
|
-
return out;
|
|
202
|
-
}
|
|
203
|
-
/** What `{chapterNumber}` prints for each level-1 heading, fed in document
|
|
204
|
-
* order: the heading's number prefix, else — without a numbering
|
|
205
|
-
* template — the chapter ordinal, continuing past the `ordinalOffset`
|
|
206
|
-
* chapters laid out before this document. An unnumbered chapter advances
|
|
207
|
-
* nothing and shows nothing; a `numberless` one counts but shows nothing.
|
|
208
|
-
* One rule for the running heads (`computeChapterNumbers`, over the placed
|
|
209
|
-
* blocks) and for measuring an opener design before it is painted (over
|
|
210
|
-
* the content blocks), so both read the same value. The ordinal is
|
|
211
|
-
* written in the document's `digits`; a prefix already is. */
|
|
212
|
-
export function chapterNumberCounter(ordinalOffset = 0, numberless, digits) {
|
|
213
|
-
let ordinal = ordinalOffset;
|
|
214
|
-
let lastContentIndex;
|
|
215
|
-
return (b) => {
|
|
216
|
-
// An unnumbered chapter (a heading style with `numbered: false`)
|
|
217
|
-
// advances nothing and shows no number.
|
|
218
|
-
if (b.unnumbered) {
|
|
219
|
-
lastContentIndex = b.contentIndex;
|
|
220
|
-
return '';
|
|
221
|
-
}
|
|
222
|
-
// A heading split across columns yields several blocks with the same
|
|
223
|
-
// content index; count the chapter once. The heading's own counter
|
|
224
|
-
// wins (a `startAt` attribute restarts it).
|
|
225
|
-
if (b.contentIndex === undefined || b.contentIndex !== lastContentIndex)
|
|
226
|
-
ordinal = b.headingNumber ?? ordinal + 1;
|
|
227
|
-
lastContentIndex = b.contentIndex;
|
|
228
|
-
const prefix = b.numberPrefix?.trim() ?? '';
|
|
229
|
-
return prefix.length > 0 ? prefix : numberless?.(b) ? '' : withDigits(String(ordinal), digits);
|
|
230
|
-
};
|
|
231
|
-
}
|
|
232
|
-
/**
|
|
233
|
-
* Precompute the heading attributes (`# Title {key="value"}`) of the most
|
|
234
|
-
* recent H1 per page. Backs `{attr.<key>}` in header/footer slots; pages
|
|
235
|
-
* before the first H1 get an empty record.
|
|
236
|
-
*/
|
|
237
|
-
export function computeChapterAttrs(blocks, totalPages, pages) {
|
|
238
|
-
return computeChapterValues(blocks, totalPages, pages, (b) => b.attrs ?? {}, {});
|
|
239
|
-
}
|
|
240
|
-
/**
|
|
241
|
-
* `{chapterTitleAtTop}`: per page, the title of the chapter in force at the
|
|
242
|
-
* top of the page, the chapter whose text opens it. That is the chapter a
|
|
243
|
-
* level-1 heading opens when the heading is the first block placed on the
|
|
244
|
-
* page, and otherwise the chapter the page runs on from, even when a new
|
|
245
|
-
* one starts lower down the page. `computeChapterTitles` gives the later
|
|
246
|
-
* one on such a page. A blank parity page goes with the page after it, as
|
|
247
|
-
* there, so it names the chapter in force at that page's top; a
|
|
248
|
-
* `blankForForce` page goes with the page before it.
|
|
249
|
-
*/
|
|
250
|
-
export function computeChapterTitlesAtTop(blocks, totalPages, pages) {
|
|
251
|
-
return computeChapterValues(blocks, totalPages, pages, plainTextOfBlock, '', true);
|
|
252
|
-
}
|
|
253
|
-
/** `{chapterNumberAtTop}`: the number of the chapter in force at the top
|
|
254
|
-
* of each page (see {@link computeChapterTitlesAtTop}), by the counter of
|
|
255
|
-
* `computeChapterNumbers`. */
|
|
256
|
-
export function computeChapterNumbersAtTop(blocks, totalPages, pages, ordinalOffset = 0, numberless, digits) {
|
|
257
|
-
return computeChapterValues(blocks, totalPages, pages, chapterNumberCounter(ordinalOffset, numberless, digits), '', true);
|
|
258
|
-
}
|
|
259
|
-
/** Shared walker behind `computeChapterTitles` / `computeChapterNumbers` /
|
|
260
|
-
* `computeChapterAttrs`: tracks the most recent H1's extracted value per
|
|
261
|
-
* page, starting from `empty` before the first H1. With `atTop`, a page
|
|
262
|
-
* takes the value in force at its top instead: a level-1 heading changes
|
|
263
|
-
* its page's value, and claims the blank parity pages before it, only
|
|
264
|
-
* when it is the first block placed there. A
|
|
265
|
-
* level-1 heading marked `notRunningChapter` (a plate) changes nothing;
|
|
266
|
-
* `extract` still sees it, so a counter counts it. */
|
|
267
|
-
function computeChapterValues(blocks, totalPages, pages, extract, empty, atTop = false) {
|
|
268
|
-
const out = new Array(totalPages).fill(empty);
|
|
269
|
-
const byPage = new Map();
|
|
270
|
-
let current = empty;
|
|
271
|
-
// Walk blocks in page/column order. The VDT `doc.blocks` array is already
|
|
272
|
-
// insertion-ordered by placement, so pages are in increasing index.
|
|
273
|
-
let lastPageIndex = -1;
|
|
274
|
-
// Track H1 page-indices so we can reassign any parity-padding pages
|
|
275
|
-
// that precede them.
|
|
276
|
-
const h1PageIndices = [];
|
|
277
|
-
for (const b of blocks) {
|
|
278
|
-
if (b.pageIndex < 0)
|
|
279
|
-
continue;
|
|
280
|
-
const opensPage = b.pageIndex > lastPageIndex;
|
|
281
|
-
while (lastPageIndex < b.pageIndex) {
|
|
282
|
-
lastPageIndex++;
|
|
283
|
-
byPage.set(lastPageIndex, current);
|
|
284
|
-
}
|
|
285
|
-
if (b.headingLevel === 1) {
|
|
286
|
-
const value = extract(b);
|
|
287
|
-
if (b.notRunningChapter)
|
|
288
|
-
continue;
|
|
289
|
-
current = value;
|
|
290
|
-
// At the top, a chapter that starts lower down a page claims neither
|
|
291
|
-
// that page nor the blank pages before it: they go with the chapter
|
|
292
|
-
// the page opens in.
|
|
293
|
-
if (atTop && !opensPage)
|
|
294
|
-
continue;
|
|
295
|
-
byPage.set(b.pageIndex, current);
|
|
296
|
-
h1PageIndices.push({ pageIndex: b.pageIndex, value: current });
|
|
297
|
-
}
|
|
298
|
-
}
|
|
299
|
-
// Fill any trailing pages (past the last block) with current value.
|
|
300
|
-
for (let p = 0; p < totalPages; p++) {
|
|
301
|
-
if (byPage.has(p)) {
|
|
302
|
-
out[p] = byPage.get(p);
|
|
303
|
-
}
|
|
304
|
-
else if (p > 0) {
|
|
305
|
-
out[p] = out[p - 1];
|
|
306
|
-
}
|
|
307
|
-
}
|
|
308
|
-
// Reassign parity-padding pages preceding each H1 to the upcoming
|
|
309
|
-
// chapter's value. The blank page was inserted solely to push the
|
|
310
|
-
// chapter onto the correct parity — conceptually it belongs to the
|
|
311
|
-
// chapter it precedes. `blankForForce` pages (the mandatory leading
|
|
312
|
-
// separator of `always-*` modes) stop the walk: they belong to the
|
|
313
|
-
// previous chapter.
|
|
314
|
-
if (pages) {
|
|
315
|
-
for (const { pageIndex, value } of h1PageIndices) {
|
|
316
|
-
for (let p = pageIndex - 1; p >= 0; p--) {
|
|
317
|
-
const info = pages[p];
|
|
318
|
-
if (!info)
|
|
319
|
-
break;
|
|
320
|
-
if (info.blankForForce)
|
|
321
|
-
break;
|
|
322
|
-
if (!info.blankForParity)
|
|
323
|
-
break;
|
|
324
|
-
out[p] = value;
|
|
325
|
-
}
|
|
326
|
-
}
|
|
327
|
-
}
|
|
328
|
-
return out;
|
|
329
|
-
}
|
|
330
|
-
/** Per page, the part in effect: the most recent part page on or before it
|
|
331
|
-
* (blank parity pages right before a part page already belong to it), or
|
|
332
|
-
* `start` — the part the preceding chapters left open — before any. Each
|
|
333
|
-
* part brings its own palette overrides (`{}` when the fence sets none),
|
|
334
|
-
* which also tint every blank leaf right before its divider. */
|
|
335
|
-
export function computePartValues(pages, start) {
|
|
336
|
-
const partTitleByPageIndex = new Array(pages.length).fill('');
|
|
337
|
-
const partNumberByPageIndex = new Array(pages.length).fill('');
|
|
338
|
-
const partPaletteByPageIndex = new Array(pages.length).fill({});
|
|
339
|
-
let title = start ? replaceTitleBreaks(start.title, ' ') : '';
|
|
340
|
-
let number = start?.number ?? '';
|
|
341
|
-
let palette = start?.palette ?? {};
|
|
342
|
-
for (let p = 0; p < pages.length; p++) {
|
|
343
|
-
const info = pages[p].partInfo;
|
|
344
|
-
if (info) {
|
|
345
|
-
title = replaceTitleBreaks(info.title, ' ');
|
|
346
|
-
number = info.number;
|
|
347
|
-
palette = info.palette ?? {};
|
|
348
|
-
for (let q = p - 1; q >= 0; q--) {
|
|
349
|
-
const prev = pages[q];
|
|
350
|
-
if (prev.blankForForce || !prev.blankForParity)
|
|
351
|
-
break;
|
|
352
|
-
partTitleByPageIndex[q] = title;
|
|
353
|
-
partNumberByPageIndex[q] = number;
|
|
354
|
-
}
|
|
355
|
-
// Colour reaches further back than titles: every blank leaf right
|
|
356
|
-
// before the divider — an `always-odd` leaf too, which belongs to the
|
|
357
|
-
// previous chapter's running heads — faces the part and wears its
|
|
358
|
-
// palette (a verso tinted in the part's colour opens it as a spread).
|
|
359
|
-
for (let q = p - 1; q >= 0; q--) {
|
|
360
|
-
const prev = pages[q];
|
|
361
|
-
if (!prev.blankForForce && !prev.blankForParity)
|
|
362
|
-
break;
|
|
363
|
-
partPaletteByPageIndex[q] = palette;
|
|
364
|
-
}
|
|
365
|
-
}
|
|
366
|
-
partTitleByPageIndex[p] = title;
|
|
367
|
-
partNumberByPageIndex[p] = number;
|
|
368
|
-
partPaletteByPageIndex[p] = palette;
|
|
369
|
-
}
|
|
370
|
-
return { partTitleByPageIndex, partNumberByPageIndex, partPaletteByPageIndex };
|
|
371
|
-
}
|
|
372
|
-
/** How a wrapped line joins the line after it when a block's lines are
|
|
373
|
-
* read back as one text (a running head's `{chapterTitle}`, a design's
|
|
374
|
-
* `{titleText}`). Returns how many characters to drop from the end of
|
|
375
|
-
* the line (the hyphen a break added) and what goes between the two
|
|
376
|
-
* lines.
|
|
377
|
-
*
|
|
378
|
-
* A hyphenated line continues its word: the break's own hyphen (a
|
|
379
|
-
* dictionary syllable, an author's soft hyphen, a word cut for being
|
|
380
|
-
* wider than the line) is dropped, and the hyphen of a line broken after
|
|
381
|
-
* the text's own (`hardHyphen`, "well-" | "known") stays. A line that
|
|
382
|
-
* ends where the next one starts in the block's plain text (`plainEnd` =
|
|
383
|
-
* `plainStart`) broke inside a run without adding anything (after a hard
|
|
384
|
-
* hyphen or a dash, or in a word cut for width, when the first-fit
|
|
385
|
-
* breaker of a heading without formatting set it) and joins with nothing.
|
|
386
|
-
* A hyphenated line that ends without a hyphen, where the next line
|
|
387
|
-
* starts one character further on in the plain text, parted a group
|
|
388
|
-
* glued by a no-break space that was wider than the line ("Cap\u00edtulo" |
|
|
389
|
-
* "XVIII"): the break took the no-break space, which comes back as
|
|
390
|
-
* U+00A0, so the group stays glued. Every other break took a space,
|
|
391
|
-
* which comes back once, and so does a space the line itself ends with
|
|
392
|
-
* (`spaceAtEnd`: the caller trimmed it from `text`); the last line is
|
|
393
|
-
* followed by nothing. */
|
|
394
|
-
export function lineJoin(text, line, next, spaceAtEnd = false) {
|
|
395
|
-
if (line.hardHyphen)
|
|
396
|
-
return { drop: 0, separator: '' };
|
|
397
|
-
if (line.hyphenated) {
|
|
398
|
-
if (/[-\u2010\u2011]$/.test(text))
|
|
399
|
-
return { drop: 1, separator: '' };
|
|
400
|
-
const tookOne = next?.plainStart !== undefined && line.plainEnd !== undefined && next.plainStart > line.plainEnd;
|
|
401
|
-
return { drop: 0, separator: tookOne ? '\u00A0' : '' };
|
|
402
|
-
}
|
|
403
|
-
if (next === undefined)
|
|
404
|
-
return { drop: 0, separator: '' };
|
|
405
|
-
if (!spaceAtEnd && line.plainEnd !== undefined && next.plainStart === line.plainEnd)
|
|
406
|
-
return { drop: 0, separator: '' };
|
|
407
|
-
return { drop: 0, separator: ' ' };
|
|
408
|
-
}
|
|
409
|
-
/** Breaking whitespace at either end of a line: a no-break space a line
|
|
410
|
-
* opens or ends on belongs to the text (the glue of a group the line
|
|
411
|
-
* parted), so it stays. */
|
|
412
|
-
const BREAKING_EDGES_RE = /^[^\S\u00A0\u2007\u202F\uFEFF]+|[^\S\u00A0\u2007\u202F\uFEFF]+$/g;
|
|
413
|
-
/** A block's lines read back as the text they were broken from, the way
|
|
414
|
-
* the paragraph read before wrapping (see {@link lineJoin}): wrapped lines
|
|
415
|
-
* keep their trailing space token and hyphenated lines end with the break
|
|
416
|
-
* mark. A line of Chinese broken between two characters joins the next
|
|
417
|
-
* with nothing, and one broken at an ideographic space (U+3000, the space
|
|
418
|
-
* of a couplet title or of `numberSeparator: ' '`) gets it back, whichever
|
|
419
|
-
* of the two lines holds it. Whitespace inside the lines is kept as it is;
|
|
420
|
-
* the ends are trimmed. `\u2028` is the title-break placeholder. The
|
|
421
|
-
* running heads read a heading this way, and so do the PDF bookmarks and
|
|
422
|
-
* document title (with `options.plainTitleBreaks`). */
|
|
423
|
-
export function blockLinesText(block, options) {
|
|
424
|
-
const plain = options?.plainTitleBreaks === true && (block.titleBreaks?.length ?? 0) > 0;
|
|
425
|
-
const lines = block.lines.map((line) => {
|
|
426
|
-
// The hyphen repeated from the line before (`repeatHyphen`) is not text.
|
|
427
|
-
const cut = line.repeatedHyphen && line.text.startsWith('-') ? 1 : 0;
|
|
428
|
-
const own = line.text.slice(cut);
|
|
429
|
-
const raw = flattenTitleBreaks(own);
|
|
430
|
-
const t = raw.replace(BREAKING_EDGES_RE, '');
|
|
431
|
-
// Which characters of `t` the layout inserted (`VDTLineSegment.inserted`:
|
|
432
|
-
// the 《》 of a book title), for `plainBreaksOf`.
|
|
433
|
-
const lead = plain ? BREAKING_HEAD_RE.exec(raw)[0].length : 0;
|
|
434
|
-
const ins = plain ? insertedMask(line, cut)?.slice(lead, lead + t.length) : undefined;
|
|
435
|
-
return { raw, t, ins };
|
|
436
|
-
});
|
|
437
|
-
let text = '';
|
|
438
|
-
const inserted = [];
|
|
439
|
-
block.lines.forEach((line, i) => {
|
|
440
|
-
const { raw, t, ins } = lines[i];
|
|
441
|
-
if (t.length === 0)
|
|
442
|
-
return;
|
|
443
|
-
const next = block.lines[i + 1];
|
|
444
|
-
const { drop, separator } = lineJoin(t, line, next, /[ \t]$/.test(raw));
|
|
445
|
-
let sep = separator;
|
|
446
|
-
if (next !== undefined && !line.hyphenated && !line.hardHyphen) {
|
|
447
|
-
const after = lines[i + 1];
|
|
448
|
-
const broken = BREAKING_TAIL_RE.exec(raw)[0] + BREAKING_HEAD_RE.exec(after.raw)[0];
|
|
449
|
-
if (broken.includes('\u3000'))
|
|
450
|
-
sep = '\u3000';
|
|
451
|
-
// Two Chinese characters with no space between them on either line
|
|
452
|
-
// were never apart, whatever the offsets say.
|
|
453
|
-
else if (broken.length === 0 && joinsWide(charBefore(t, t.length), charFrom(after.t, 0)))
|
|
454
|
-
sep = '';
|
|
455
|
-
}
|
|
456
|
-
const piece = t.slice(0, t.length - drop) + (next === undefined ? '' : sep);
|
|
457
|
-
text += piece;
|
|
458
|
-
if (plain)
|
|
459
|
-
for (let k = 0; k < piece.length; k++)
|
|
460
|
-
inserted.push(ins?.[k] === true);
|
|
461
|
-
});
|
|
462
|
-
const read = plain ? plainBreaksOf(text, block, inserted) : text;
|
|
463
|
-
// A heading's chips (#1100) are boxes of the page, not words of its
|
|
464
|
-
// title: the running heads and the bookmarks read the title without them.
|
|
465
|
-
return (block.type === 'heading' && read.includes(CHIP_PLACEHOLDER) ? withoutChips(read) : read).trim();
|
|
466
|
-
}
|
|
467
|
-
/** For each UTF-16 unit of `line.text` from `from` on, whether the layout
|
|
468
|
-
* inserted it (a segment with `inserted`); undefined when the segments do
|
|
469
|
-
* not spell the line's text. */
|
|
470
|
-
function insertedMask(line, from) {
|
|
471
|
-
const segs = line.segments;
|
|
472
|
-
if (!segs || !segs.some((s) => s.inserted))
|
|
473
|
-
return undefined;
|
|
474
|
-
const mask = [];
|
|
475
|
-
let spelled = '';
|
|
476
|
-
for (const s of segs) {
|
|
477
|
-
spelled += s.text;
|
|
478
|
-
for (let k = 0; k < s.text.length; k++)
|
|
479
|
-
mask.push(s.inserted === true);
|
|
480
|
-
}
|
|
481
|
-
return spelled === line.text ? mask.slice(from) : undefined;
|
|
482
|
-
}
|
|
483
|
-
/** `text`, a heading's lines read back, with each forced break the lines
|
|
484
|
-
* set as a space read as plain text (see `plainTitleBreak`). The title
|
|
485
|
-
* ends the text, so a break's index in the title (`titleBreaks`, the
|
|
486
|
-
* number prefix excluded) counts back from the end of `text`, past the
|
|
487
|
-
* characters the layout inserted (`inserted`, one flag per unit of
|
|
488
|
-
* `text`: the 《》 of a book title are no characters of the title); a
|
|
489
|
-
* break whose place does not hold a space is left alone. */
|
|
490
|
-
function plainBreaksOf(text, block, inserted) {
|
|
491
|
-
const breaks = block.titleBreaks;
|
|
492
|
-
const length = block.titleLength;
|
|
493
|
-
if (!breaks || breaks.length === 0 || length === undefined)
|
|
494
|
-
return text;
|
|
495
|
-
// Where each character of the title's own text sits in `text`.
|
|
496
|
-
const own = [];
|
|
497
|
-
for (let k = 0; k < text.length; k++)
|
|
498
|
-
if (!inserted[k])
|
|
499
|
-
own.push(k);
|
|
500
|
-
if (own.length < length)
|
|
501
|
-
return text;
|
|
502
|
-
const start = own.length - length;
|
|
503
|
-
let out = text;
|
|
504
|
-
// The last break first, so the places of the others hold.
|
|
505
|
-
for (const i of [...breaks].sort((a, b) => b - a)) {
|
|
506
|
-
const at = own[start + i];
|
|
507
|
-
if (out[at] !== ' ')
|
|
508
|
-
continue;
|
|
509
|
-
if (plainTitleBreak(charBefore(out, at), charFrom(out, at + 1)) === '')
|
|
510
|
-
out = out.slice(0, at) + out.slice(at + 1);
|
|
511
|
-
}
|
|
512
|
-
return out;
|
|
513
|
-
}
|
|
514
|
-
/** A title written with forced breaks (`\\`, as in a part's `title`
|
|
515
|
-
* attribute) as plain text reads it: each break as `plainTitleBreak` reads
|
|
516
|
-
* it, nothing where a Chinese character meets a digit or Latin text, the
|
|
517
|
-
* ideographic space between two Chinese characters, a space between Latin
|
|
518
|
-
* words. The PDF bookmarks of the parts read their titles this way, as
|
|
519
|
-
* those of the headings read theirs (#221). */
|
|
520
|
-
export function plainTitleText(title) {
|
|
521
|
-
return plainTitleBreaks(replaceTitleBreaks(title, BREAK_PLACEHOLDER));
|
|
522
|
-
}
|
|
523
|
-
/** The breaking whitespace a line ends / starts with. */
|
|
524
|
-
const BREAKING_TAIL_RE = /[^\S\u00A0\u2007\u202F\uFEFF]*$/;
|
|
525
|
-
const BREAKING_HEAD_RE = /^[^\S\u00A0\u2007\u202F\uFEFF]*/;
|
|
526
|
-
function plainTextOfBlock(block) {
|
|
527
|
-
// No-break spaces stay, so the running head never breaks at one, and so
|
|
528
|
-
// does the ideographic space of a Chinese title.
|
|
529
|
-
const text = collapseTitleSpaces(blockLinesText(block)).trim();
|
|
530
|
-
// Strip any numbering prefix that was prepended during build, as the
|
|
531
|
-
// trimmed lines read it: a template that opens with ideographic spaces
|
|
532
|
-
// (`' {2:一}、'`, a GB/T 9704 head's two-cell indent) lost them to the
|
|
533
|
-
// trim.
|
|
534
|
-
const prefix = block.numberPrefix?.trim();
|
|
535
|
-
if (prefix && text.startsWith(prefix))
|
|
536
|
-
return text.slice(prefix.length).trimStart();
|
|
537
|
-
return text;
|
|
538
|
-
}
|
|
539
145
|
/**
|
|
540
146
|
* Resolve placeholder templates. Grammar:
|
|
541
147
|
* - `{name}` with name matching `[a-zA-Z][a-zA-Z0-9]*` is a placeholder;
|