postext 1.63.3 → 1.63.4
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/design/richText.js
CHANGED
|
@@ -4,702 +4,8 @@
|
|
|
4
4
|
// laid out as runs, each in its own font. The plain path in `layout.ts`
|
|
5
5
|
// measures whole strings; here every width is the sum of per-run widths,
|
|
6
6
|
// exactly as the renderers paint the runs one after another.
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
import { chipToken, scriptMetrics, stackedScriptPairs } from '../measure/rich.js';
|
|
12
|
-
import { resolveChipSpans } from '../pipeline/text/chips.js';
|
|
13
|
-
import { graphemeCount } from '../measure/graphemes.js';
|
|
14
|
-
import { getHyphenationRulesKey, hyphenateByDictionary, hyphenateText } from '../hyphenation/hyphenate.js';
|
|
15
|
-
import { endsInsideGeminate } from '../measure/geminate.js';
|
|
16
|
-
import { NO_BREAK_SPACES, isBreakingSpace } from '../measure/spaces.js';
|
|
17
|
-
import { hasJoiningScript } from '../writing/bidi.js';
|
|
18
|
-
/**
|
|
19
|
-
* A chip keeps at least its style's `gap` to a neighbour across a run of
|
|
20
|
-
* spaces, as in a paragraph (`measure/rich.ts`, `applyChipGaps`): a
|
|
21
|
-
* narrower run is topped up by a margin inside the chip's own advance, and
|
|
22
|
-
* between two chips the shortfall is shared. A chip at either end of the
|
|
23
|
-
* text has no margin on that side; one that opens or closes a line loses
|
|
24
|
-
* it there (`RichMeasurer.line`).
|
|
25
|
-
*/
|
|
26
|
-
function applyDesignChipGaps(text, styleAt, styles, letterSpacingPx) {
|
|
27
|
-
const isChip = (i) => i >= 0 && i < text.length && styles[styleAt[i]].chip !== undefined;
|
|
28
|
-
const add = (i, side, px) => {
|
|
29
|
-
const st = styles[styleAt[i]];
|
|
30
|
-
st.chip = { ...st.chip, [side]: st.chip[side] + px };
|
|
31
|
-
st.chipWidth = (st.chipWidth ?? 0) + px;
|
|
32
|
-
};
|
|
33
|
-
let i = 0;
|
|
34
|
-
while (i < text.length) {
|
|
35
|
-
if (!/\s/.test(text[i]) || text[i] === '\n') {
|
|
36
|
-
i++;
|
|
37
|
-
continue;
|
|
38
|
-
}
|
|
39
|
-
let j = i;
|
|
40
|
-
while (j < text.length && /\s/.test(text[j]) && text[j] !== '\n')
|
|
41
|
-
j++;
|
|
42
|
-
const left = i > 0 && text[i - 1] !== '\n' && isChip(i - 1) ? i - 1 : -1;
|
|
43
|
-
const right = j < text.length && text[j] !== '\n' && isChip(j) ? j : -1;
|
|
44
|
-
// Spaces at an end of the text, or with no chip beside them: nothing.
|
|
45
|
-
if (i > 0 && j < text.length && (left >= 0 || right >= 0)) {
|
|
46
|
-
const font = styles[styleAt[i]].font;
|
|
47
|
-
const run = text.slice(i, j);
|
|
48
|
-
const width = Math.max(0, flowTextWidth(run, font) + letterSpacingPx * graphemeCount(run));
|
|
49
|
-
const gapOf = (k) => (k >= 0 ? styles[styleAt[k]].chipGap ?? 0 : 0);
|
|
50
|
-
const shortfall = Math.max(gapOf(left), gapOf(right)) - width;
|
|
51
|
-
if (shortfall > 0) {
|
|
52
|
-
const share = left >= 0 && right >= 0 ? shortfall / 2 : shortfall;
|
|
53
|
-
if (left >= 0)
|
|
54
|
-
add(left, 'marginRight', share);
|
|
55
|
-
if (right >= 0)
|
|
56
|
-
add(right, 'marginLeft', share);
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
i = j;
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
const fontFor = (spec, weight, italic) => buildFontString(spec.family, spec.sizePx, weight === 400 ? 'normal' : String(weight), italic ? 'italic' : 'normal');
|
|
63
|
-
/** The fonts the runs of a design text with inline marks take: the
|
|
64
|
-
* element's, bold (700, or the element's weight when heavier), italic
|
|
65
|
-
* (the element's slant flipped) and both, as {@link parseRichDesignText}
|
|
66
|
-
* picks them. */
|
|
67
|
-
export function richFontSet(spec) {
|
|
68
|
-
const heavy = Math.max(700, spec.weight);
|
|
69
|
-
return {
|
|
70
|
-
normal: fontFor(spec, spec.weight, spec.italic),
|
|
71
|
-
bold: fontFor(spec, heavy, spec.italic),
|
|
72
|
-
italic: fontFor(spec, spec.weight, !spec.italic),
|
|
73
|
-
boldItalic: fontFor(spec, heavy, !spec.italic),
|
|
74
|
-
};
|
|
75
|
-
}
|
|
76
|
-
/** Read `text` for inline marks. Bold runs take weight 700 (the element's
|
|
77
|
-
* own weight when it is heavier); italic runs flip the element's slant;
|
|
78
|
-
* scripts use the body text's script size and shift. In vertical text
|
|
79
|
-
* (`measuringVertically`) a run the author set with `:tcy`, `:upright` or
|
|
80
|
-
* `:sideways` stands as the body sets it; horizontal text ignores the
|
|
81
|
-
* marks. */
|
|
82
|
-
export function parseRichDesignText(text, spec, chips) {
|
|
83
|
-
const styles = [{ font: fontFor(spec, spec.weight, spec.italic) }];
|
|
84
|
-
const keys = new Map([['0|0|', 0]]);
|
|
85
|
-
let out = '';
|
|
86
|
-
const styleAt = [];
|
|
87
|
-
let hasMarks = false;
|
|
88
|
-
const vertical = measuringVertically();
|
|
89
|
-
const styleFor = (span) => {
|
|
90
|
-
const key = `${span.bold ? 1 : 0}|${span.italic ? 1 : 0}|${span.script ?? ''}`;
|
|
91
|
-
let idx = keys.get(key);
|
|
92
|
-
if (idx === undefined) {
|
|
93
|
-
const base = fontFor(spec, span.bold ? Math.max(700, spec.weight) : spec.weight, span.italic ? !spec.italic : spec.italic);
|
|
94
|
-
const style = { font: base, ...(span.bold ? { bold: true } : {}), ...(span.italic ? { italic: true } : {}) };
|
|
95
|
-
if (span.script) {
|
|
96
|
-
const m = scriptMetrics(base, span.script);
|
|
97
|
-
style.font = m.font;
|
|
98
|
-
style.shift = m.baselineShift;
|
|
99
|
-
style.script = span.script;
|
|
100
|
-
if (span.script === 'sub')
|
|
101
|
-
style.stackedShift = scriptMetrics(base, 'sub', true).baselineShift;
|
|
102
|
-
}
|
|
103
|
-
idx = styles.length;
|
|
104
|
-
styles.push(style);
|
|
105
|
-
keys.set(key, idx);
|
|
106
|
-
}
|
|
107
|
-
return idx;
|
|
108
|
-
};
|
|
109
|
-
const spans = richDesignInlineSpans(text, chips, spec.sizePx);
|
|
110
|
-
const fonts = chips ? richFontSet(spec) : undefined;
|
|
111
|
-
for (let si = 0; si < spans.length; si++) {
|
|
112
|
-
const span = spans[si];
|
|
113
|
-
let idx = styleFor(span);
|
|
114
|
-
if (span.chip && fonts && chips) {
|
|
115
|
-
// A chip is a style of its own: one character, as wide as its box,
|
|
116
|
-
// set in the element's faces (the chip style's family and size over
|
|
117
|
-
// them).
|
|
118
|
-
const token = chipToken(span, fonts.normal, fonts.bold, fonts.italic, fonts.boldItalic, chips.letterSpacingPx);
|
|
119
|
-
const chipIdx = styles.length;
|
|
120
|
-
styles.push({ font: styles[idx].font, base: idx, chip: token.chip, chipWidth: token.width, chipSpan: span, chipGap: token.chipGap ?? 0 });
|
|
121
|
-
hasMarks = true;
|
|
122
|
-
out += span.text;
|
|
123
|
-
for (let i = 0; i < span.text.length; i++)
|
|
124
|
-
styleAt.push(chipIdx);
|
|
125
|
-
continue;
|
|
126
|
-
}
|
|
127
|
-
const orient = vertical ? (span.combineUpright ? 'tcy' : span.orientation) : undefined;
|
|
128
|
-
if (orient && span.text.length > 0) {
|
|
129
|
-
// An oriented run: the style of its font with the orientation, one
|
|
130
|
-
// per `:tcy` span (two cells never merge), shared by the others.
|
|
131
|
-
const key = `${orient === 'tcy' ? `tcy${si}` : orient}|${idx}`;
|
|
132
|
-
let oriented = keys.get(key);
|
|
133
|
-
if (oriented === undefined) {
|
|
134
|
-
oriented = styles.length;
|
|
135
|
-
styles.push({ ...styles[idx], orient, base: idx });
|
|
136
|
-
keys.set(key, oriented);
|
|
137
|
-
}
|
|
138
|
-
idx = oriented;
|
|
139
|
-
}
|
|
140
|
-
if (idx !== 0)
|
|
141
|
-
hasMarks = true;
|
|
142
|
-
out += span.text;
|
|
143
|
-
for (let i = 0; i < span.text.length; i++)
|
|
144
|
-
styleAt.push(idx);
|
|
145
|
-
}
|
|
146
|
-
if (chips)
|
|
147
|
-
applyDesignChipGaps(out, styleAt, styles, chips.letterSpacingPx);
|
|
148
|
-
return { text: out, styleAt, styles, hasMarks };
|
|
149
|
-
}
|
|
150
|
-
/** The inline spans of a design text read for inline marks: with `chips`,
|
|
151
|
-
* each `:chip[…]` is a chip span with its box resolved at `sizePx`
|
|
152
|
-
* (#1162); without, it is text as written. */
|
|
153
|
-
function richDesignInlineSpans(text, chips, sizePx) {
|
|
154
|
-
if (!chips || !text.includes(':chip['))
|
|
155
|
-
return parseInlineFormatting(text);
|
|
156
|
-
const { cleaned, chips: metas } = extractInlineChips(text, 0);
|
|
157
|
-
const spans = parseInlineFormatting(cleaned);
|
|
158
|
-
return metas.length > 0 ? resolveChipSpans(injectChipSpans(spans, metas), { styles: chips.styles, dpi: chips.dpi }, sizePx) : spans;
|
|
159
|
-
}
|
|
160
|
-
/** The plain text of `text` read for inline marks: the markers dropped,
|
|
161
|
-
* as `parseRichDesignText` sets it (a chip one placeholder character,
|
|
162
|
-
* when the text reads chips). */
|
|
163
|
-
export function plainDesignText(text, chips = false) {
|
|
164
|
-
if (chips && text.includes(':chip[')) {
|
|
165
|
-
const { cleaned, chips: metas } = extractInlineChips(text, 0);
|
|
166
|
-
return injectChipSpans(parseInlineFormatting(cleaned), metas).map((span) => span.text).join('');
|
|
167
|
-
}
|
|
168
|
-
return parseInlineFormatting(text).map((span) => span.text).join('');
|
|
169
|
-
}
|
|
170
|
-
/** The spans of `[a, b)` of a rich design text, one per change of style,
|
|
171
|
-
* for the CJK composer (`design/cjkText.ts`): bold, italic, script and
|
|
172
|
-
* orientation as the parser read them. */
|
|
173
|
-
export function richDesignSpans(rt, a, b) {
|
|
174
|
-
const out = [];
|
|
175
|
-
let i = a;
|
|
176
|
-
while (i < b) {
|
|
177
|
-
const idx = rt.styleAt[i];
|
|
178
|
-
let j = i + 1;
|
|
179
|
-
while (j < b && rt.styleAt[j] === idx)
|
|
180
|
-
j++;
|
|
181
|
-
const st = rt.styles[idx];
|
|
182
|
-
if (st.chipSpan) {
|
|
183
|
-
// A chip, as the body's composer sets it.
|
|
184
|
-
out.push(st.chipSpan);
|
|
185
|
-
i = j;
|
|
186
|
-
continue;
|
|
187
|
-
}
|
|
188
|
-
out.push({
|
|
189
|
-
text: rt.text.slice(i, j),
|
|
190
|
-
bold: st.bold === true,
|
|
191
|
-
italic: st.italic === true,
|
|
192
|
-
...(st.script ? { script: st.script } : {}),
|
|
193
|
-
...(st.orient === 'tcy' ? { combineUpright: true } : st.orient ? { orientation: st.orient } : {}),
|
|
194
|
-
});
|
|
195
|
-
i = j;
|
|
196
|
-
}
|
|
197
|
-
return out;
|
|
198
|
-
}
|
|
199
|
-
/** `pieces` with the empty ones dropped and adjacent ones of one style
|
|
200
|
-
* merged, as the runs of a line are. */
|
|
201
|
-
function merge(pieces) {
|
|
202
|
-
const merged = [];
|
|
203
|
-
for (const p of pieces) {
|
|
204
|
-
if (p.text.length === 0)
|
|
205
|
-
continue;
|
|
206
|
-
const last = merged[merged.length - 1];
|
|
207
|
-
if (last && last.style === p.style)
|
|
208
|
-
last.text += p.text;
|
|
209
|
-
else
|
|
210
|
-
merged.push({ ...p });
|
|
211
|
-
}
|
|
212
|
-
return merged;
|
|
213
|
-
}
|
|
214
|
-
/** Measuring and run building over one rich text. */
|
|
215
|
-
export class RichMeasurer {
|
|
216
|
-
rt;
|
|
217
|
-
letterSpacingPx;
|
|
218
|
-
flow;
|
|
219
|
-
constructor(rt, letterSpacingPx,
|
|
220
|
-
/** How a run's text is measured, untracked, when not as any text of
|
|
221
|
-
* the flow: in the direction its pieces are painted in, in a document
|
|
222
|
-
* shaped in its own language (#770, `design/bidiText.ts`). */
|
|
223
|
-
flow) {
|
|
224
|
-
this.rt = rt;
|
|
225
|
-
this.letterSpacingPx = letterSpacingPx;
|
|
226
|
-
this.flow = flow;
|
|
227
|
-
}
|
|
228
|
-
widthOf(text, style) {
|
|
229
|
-
const s = this.rt.styles[style];
|
|
230
|
-
// A chip advances as far as its box.
|
|
231
|
-
if (s.chipWidth !== undefined)
|
|
232
|
-
return s.chipWidth;
|
|
233
|
-
// An oriented run, as the body measures it: one cell (tate-chu-yoko),
|
|
234
|
-
// a cell per character (upright), its horizontal width (sideways); the
|
|
235
|
-
// tracking follows a cell once.
|
|
236
|
-
if (s.orient === 'tcy')
|
|
237
|
-
return fontEm(s.font) + this.letterSpacingPx;
|
|
238
|
-
const n = graphemeCount(text);
|
|
239
|
-
if (s.orient === 'upright')
|
|
240
|
-
return (fontEm(s.font) + this.letterSpacingPx) * n;
|
|
241
|
-
if (s.orient === 'sideways')
|
|
242
|
-
return Math.max(0, measureTextWidth(text, s.font) + this.letterSpacingPx * n);
|
|
243
|
-
return Math.max(0, (this.flow ? this.flow(text, s.font) : flowTextWidth(text, s.font)) + this.letterSpacingPx * n);
|
|
244
|
-
}
|
|
245
|
-
/** Whether `[k, k + 1)` lies inside a run the author oriented (a line
|
|
246
|
-
* never breaks inside one, even at a space). */
|
|
247
|
-
insideOriented(k) {
|
|
248
|
-
const style = this.rt.styleAt[k];
|
|
249
|
-
if (style === undefined || this.rt.styles[style].orient === undefined)
|
|
250
|
-
return false;
|
|
251
|
-
return this.rt.styleAt[k - 1] === style && this.rt.styleAt[k + 1] === style;
|
|
252
|
-
}
|
|
253
|
-
/** The pieces of `[a, b)`, one per change of style. */
|
|
254
|
-
pieces(a, b) {
|
|
255
|
-
const out = [];
|
|
256
|
-
let i = a;
|
|
257
|
-
while (i < b) {
|
|
258
|
-
const style = this.rt.styleAt[i];
|
|
259
|
-
let j = i + 1;
|
|
260
|
-
while (j < b && this.rt.styleAt[j] === style)
|
|
261
|
-
j++;
|
|
262
|
-
out.push({ text: this.rt.text.slice(i, j), style });
|
|
263
|
-
i = j;
|
|
264
|
-
}
|
|
265
|
-
return out;
|
|
266
|
-
}
|
|
267
|
-
/** Width of `[a, b)` plus any extra pieces, as the runs will paint it: a
|
|
268
|
-
* subscript and a superscript that touch advance as far as the wider. */
|
|
269
|
-
measure(a, b, ...extra) {
|
|
270
|
-
// Pieces as they come (a hyphen or an ellipsis measured apart), as
|
|
271
|
-
// before; only the stacked pairs change the sum.
|
|
272
|
-
const pieces = [...this.pieces(a, b), ...extra].filter((p) => p.text.length > 0);
|
|
273
|
-
const widths = pieces.map((p) => this.widthOf(p.text, p.style));
|
|
274
|
-
for (const i of stackedScriptPairs(pieces.map((p) => this.rt.styles[p.style].script))) {
|
|
275
|
-
widths[i + 1] = Math.max(widths[i], widths[i + 1]);
|
|
276
|
-
widths[i] = 0;
|
|
277
|
-
}
|
|
278
|
-
let w = 0;
|
|
279
|
-
for (const x of widths)
|
|
280
|
-
w += x;
|
|
281
|
-
return w;
|
|
282
|
-
}
|
|
283
|
-
/** Character ranges `[start, end)` of `[a, b)` a line never ends inside:
|
|
284
|
-
* the subscripts and superscripts set over each other, and in vertical
|
|
285
|
-
* text the runs the author oriented (a `:tcy` cell, an `:upright` or
|
|
286
|
-
* `:sideways` run). */
|
|
287
|
-
stackedRanges(a, b) {
|
|
288
|
-
const pieces = this.pieces(a, b);
|
|
289
|
-
const starts = [];
|
|
290
|
-
let k = a;
|
|
291
|
-
for (const p of pieces) {
|
|
292
|
-
starts.push(k);
|
|
293
|
-
k += p.text.length;
|
|
294
|
-
}
|
|
295
|
-
const ranges = stackedScriptPairs(pieces.map((p) => this.rt.styles[p.style].script))
|
|
296
|
-
.map((i) => [starts[i], starts[i + 1] + pieces[i + 1].text.length]);
|
|
297
|
-
pieces.forEach((p, i) => {
|
|
298
|
-
if (this.rt.styles[p.style].orient !== undefined && p.text.length > 1)
|
|
299
|
-
ranges.push([starts[i], starts[i] + p.text.length]);
|
|
300
|
-
});
|
|
301
|
-
return ranges;
|
|
302
|
-
}
|
|
303
|
-
/** Style of the character at `i` (clamped to the text), for a hyphen or
|
|
304
|
-
* an ellipsis set beside it: an oriented run's without its orientation. */
|
|
305
|
-
styleNear(i) {
|
|
306
|
-
if (this.rt.styleAt.length === 0)
|
|
307
|
-
return 0;
|
|
308
|
-
const style = this.rt.styleAt[Math.max(0, Math.min(i, this.rt.styleAt.length - 1))];
|
|
309
|
-
return this.rt.styles[style].base ?? style;
|
|
310
|
-
}
|
|
311
|
-
/** A line from its pieces: adjacent pieces of one style merge into a run. */
|
|
312
|
-
line(pieces) {
|
|
313
|
-
const merged = merge(pieces);
|
|
314
|
-
let text = '';
|
|
315
|
-
let width = 0;
|
|
316
|
-
const runs = merged.map((p) => {
|
|
317
|
-
const style = this.rt.styles[p.style];
|
|
318
|
-
const w = this.widthOf(p.text, p.style);
|
|
319
|
-
text += p.text;
|
|
320
|
-
const run = style.shift !== undefined
|
|
321
|
-
? { text: p.text, fontString: style.font, width: w, baselineShift: style.shift }
|
|
322
|
-
: { text: p.text, fontString: style.font, width: w };
|
|
323
|
-
if (style.orient === 'tcy')
|
|
324
|
-
run.tcy = true;
|
|
325
|
-
else if (style.orient)
|
|
326
|
-
run.orientation = style.orient;
|
|
327
|
-
if (style.chip)
|
|
328
|
-
run.chip = style.chip;
|
|
329
|
-
return run;
|
|
330
|
-
});
|
|
331
|
-
// A subscript and a superscript that touch are set one over the other
|
|
332
|
-
// (EF-80), as in the body.
|
|
333
|
-
for (const i of stackedScriptPairs(merged.map((p) => this.rt.styles[p.style].script))) {
|
|
334
|
-
const first = runs[i];
|
|
335
|
-
const second = runs[i + 1];
|
|
336
|
-
const subIdx = this.rt.styles[merged[i].style].script === 'sub' ? i : i + 1;
|
|
337
|
-
const sub = runs[subIdx];
|
|
338
|
-
sub.baselineShift = this.rt.styles[merged[subIdx].style].stackedShift ?? sub.baselineShift;
|
|
339
|
-
second.width = Math.max(first.width, second.width);
|
|
340
|
-
first.width = 0;
|
|
341
|
-
first.stacked = true;
|
|
342
|
-
}
|
|
343
|
-
// A chip opening or closing the line sits flush with it: no gap
|
|
344
|
-
// margin on that side (as `trimChipLineEdges` does in a paragraph).
|
|
345
|
-
// Wrapping measured it with the margin, so the line still fits.
|
|
346
|
-
const edge = (k, side) => {
|
|
347
|
-
const run = runs[k];
|
|
348
|
-
const m = run?.chip?.[side] ?? 0;
|
|
349
|
-
if (!run || m <= 0)
|
|
350
|
-
return;
|
|
351
|
-
runs[k] = { ...run, width: run.width - m, chip: { ...run.chip, [side]: 0 } };
|
|
352
|
-
};
|
|
353
|
-
edge(0, 'marginLeft');
|
|
354
|
-
edge(runs.length - 1, 'marginRight');
|
|
355
|
-
for (const r of runs)
|
|
356
|
-
width += r.width;
|
|
357
|
-
return { text, width, runs };
|
|
358
|
-
}
|
|
359
|
-
rangeLine(a, b, hyphen = false) {
|
|
360
|
-
// The hyphen of a break inside an `l·l` takes the middle dot's place.
|
|
361
|
-
const pieces = this.pieces(a, hyphen && endsInsideGeminate(this.rt.text.slice(a, b)) ? b - 1 : b);
|
|
362
|
-
if (hyphen)
|
|
363
|
-
pieces.push({ text: '-', style: this.styleNear(b - 1) });
|
|
364
|
-
return this.line(pieces);
|
|
365
|
-
}
|
|
366
|
-
}
|
|
367
|
-
const SOFT_HYPHEN = '';
|
|
368
|
-
/** Where the text of a line ending at the syllable break `k` stops: before
|
|
369
|
-
* the middle dot of an `l·l`, whose place the hyphen takes. */
|
|
370
|
-
function hyphenEnd(text, k) {
|
|
371
|
-
return endsInsideGeminate(text.slice(Math.max(0, k - 2), k)) ? k - 1 : k;
|
|
372
|
-
}
|
|
373
|
-
/** A space the line may break at: a no-break space glues (EF-66). */
|
|
374
|
-
const isSpace = isBreakingSpace;
|
|
375
|
-
/** Where to cut a word `[a, b)` that does not fit `maxWidth`: at the last
|
|
376
|
-
* no-break space that leaves a head that fits (the next line opens after
|
|
377
|
-
* it, `next`), else at the last syllable break whose head (with its
|
|
378
|
-
* hyphen) fits, else at the last character that fits (at least one). A
|
|
379
|
-
* subscript and a superscript set over each other are never parted, as in
|
|
380
|
-
* the body (EF-80): the cut falls before the pair, or after it when the
|
|
381
|
-
* pair opens the word. */
|
|
382
|
-
function breakWord(m, a, b, maxWidth, hyphenate) {
|
|
383
|
-
const text = m.rt.text;
|
|
384
|
-
const pairs = m.stackedRanges(a, b);
|
|
385
|
-
const pairAround = (k) => pairs.find(([s, e]) => k > s && k < e);
|
|
386
|
-
for (let k = b - 2; k > a; k--) {
|
|
387
|
-
if (!NO_BREAK_SPACES.includes(text[k]) || NO_BREAK_SPACES.includes(text[k - 1]) || pairAround(k))
|
|
388
|
-
continue;
|
|
389
|
-
if (m.measure(a, k) <= maxWidth)
|
|
390
|
-
return { end: k, hyphen: false, next: k + 1 };
|
|
391
|
-
}
|
|
392
|
-
// A word of a joining script (Arabic) is never cut: it runs past the
|
|
393
|
-
// line, whole.
|
|
394
|
-
if (hasJoiningScript(text.slice(a, b)))
|
|
395
|
-
return { end: b, hyphen: false };
|
|
396
|
-
if (hyphenate) {
|
|
397
|
-
const word = m.rt.text.slice(a, b);
|
|
398
|
-
// A word the document's rules keep whole is divided at the dictionary's
|
|
399
|
-
// syllables when no point of its own fits (#699).
|
|
400
|
-
for (const divide of getHyphenationRulesKey() === '' ? [hyphenateText] : [hyphenateText, hyphenateByDictionary]) {
|
|
401
|
-
const hy = divide(word);
|
|
402
|
-
if (!hy.includes(SOFT_HYPHEN) || hy.replaceAll(SOFT_HYPHEN, '') !== word)
|
|
403
|
-
continue;
|
|
404
|
-
let best = -1;
|
|
405
|
-
let k = 0;
|
|
406
|
-
for (const part of hy.split(SOFT_HYPHEN).slice(0, -1)) {
|
|
407
|
-
k += part.length;
|
|
408
|
-
if (m.measure(a, hyphenEnd(text, a + k), { text: '-', style: m.styleNear(a + k - 1) }) > maxWidth)
|
|
409
|
-
break;
|
|
410
|
-
if (!pairAround(a + k))
|
|
411
|
-
best = k;
|
|
412
|
-
}
|
|
413
|
-
if (best > 0)
|
|
414
|
-
return { end: a + best, hyphen: true, divided: 'syllable' };
|
|
415
|
-
}
|
|
416
|
-
}
|
|
417
|
-
let lo = 1;
|
|
418
|
-
let hi = b - a;
|
|
419
|
-
while (lo < hi) {
|
|
420
|
-
const mid = Math.ceil((lo + hi) / 2);
|
|
421
|
-
if (m.measure(a, a + mid) <= maxWidth)
|
|
422
|
-
lo = mid;
|
|
423
|
-
else
|
|
424
|
-
hi = mid - 1;
|
|
425
|
-
}
|
|
426
|
-
const pair = pairAround(a + lo);
|
|
427
|
-
if (pair)
|
|
428
|
-
return { end: pair[0] > a ? pair[0] : pair[1], hyphen: false, divided: 'character' };
|
|
429
|
-
return { end: a + lo, hyphen: false, divided: 'character' };
|
|
430
|
-
}
|
|
431
|
-
/** How many characters of the word `[a, b)` the line opened at `lineStart`
|
|
432
|
-
* can take up to a syllable break, with a hyphen, within `maxWidth`: the
|
|
433
|
-
* longest such head, or 0. A subscript and a superscript set over each
|
|
434
|
-
* other are never parted. */
|
|
435
|
-
function syllableFill(m, lineStart, a, b, maxWidth) {
|
|
436
|
-
const word = m.rt.text.slice(a, b);
|
|
437
|
-
if (hasJoiningScript(word))
|
|
438
|
-
return 0;
|
|
439
|
-
const hy = hyphenateText(word);
|
|
440
|
-
if (!hy.includes(SOFT_HYPHEN) || hy.replaceAll(SOFT_HYPHEN, '') !== word)
|
|
441
|
-
return 0;
|
|
442
|
-
const pairs = m.stackedRanges(a, b);
|
|
443
|
-
let best = 0;
|
|
444
|
-
let k = 0;
|
|
445
|
-
for (const part of hy.split(SOFT_HYPHEN).slice(0, -1)) {
|
|
446
|
-
k += part.length;
|
|
447
|
-
if (m.measure(lineStart, hyphenEnd(m.rt.text, a + k), { text: '-', style: m.styleNear(a + k - 1) }) > maxWidth)
|
|
448
|
-
break;
|
|
449
|
-
if (!pairs.some(([s, e]) => a + k > s && a + k < e))
|
|
450
|
-
best = k;
|
|
451
|
-
}
|
|
452
|
-
return best;
|
|
453
|
-
}
|
|
454
|
-
/** Greedy word wrap of one paragraph `[start, end)` (no newline inside),
|
|
455
|
-
* line `i` being `widthFor(i)` wide. Leading spaces of the paragraph are
|
|
456
|
-
* kept, trailing spaces of every line dropped; a word wider than a line
|
|
457
|
-
* breaks by syllable (with `hyphenate`) or by character. */
|
|
458
|
-
export function wrapRich(m, start, end, widthFor, hyphenate,
|
|
459
|
-
/** A justified text that hyphenates (EF-109): a word that does not fit
|
|
460
|
-
* the rest of a line is cut at its last syllable break that does. */
|
|
461
|
-
fill = false) {
|
|
462
|
-
const text = m.rt.text;
|
|
463
|
-
const out = [];
|
|
464
|
-
let lineStart = -1; // -1: the line holds nothing yet
|
|
465
|
-
let lineEnd = start;
|
|
466
|
-
let maxW = Math.max(1, widthFor(0));
|
|
467
|
-
const trimmedEnd = (a, b) => {
|
|
468
|
-
while (b > a && isSpace(text[b - 1]))
|
|
469
|
-
b--;
|
|
470
|
-
return b;
|
|
471
|
-
};
|
|
472
|
-
const flush = (a, b, hyphen = false, divided) => {
|
|
473
|
-
const line = m.rangeLine(a, hyphen ? b : trimmedEnd(a, b), hyphen);
|
|
474
|
-
out.push(divided ? { ...line, wordDivided: divided } : line);
|
|
475
|
-
maxW = Math.max(1, widthFor(out.length));
|
|
476
|
-
};
|
|
477
|
-
// A space inside a run the author oriented is not a place to break.
|
|
478
|
-
const breakingSpace = (k) => isSpace(text[k]) && !m.insideOriented(k);
|
|
479
|
-
let i = start;
|
|
480
|
-
while (i < end) {
|
|
481
|
-
let j = i + 1;
|
|
482
|
-
const space = breakingSpace(i);
|
|
483
|
-
while (j < end && breakingSpace(j) === space)
|
|
484
|
-
j++;
|
|
485
|
-
if (space) {
|
|
486
|
-
// A space never breaks a line by itself: the next word decides.
|
|
487
|
-
if (lineStart >= 0 || out.length === 0) {
|
|
488
|
-
if (lineStart < 0)
|
|
489
|
-
lineStart = i;
|
|
490
|
-
lineEnd = j;
|
|
491
|
-
}
|
|
492
|
-
i = j;
|
|
493
|
-
continue;
|
|
494
|
-
}
|
|
495
|
-
if (lineStart >= 0 && m.measure(lineStart, j) > maxW && trimmedEnd(lineStart, lineEnd) > lineStart) {
|
|
496
|
-
const head = fill && hyphenate ? syllableFill(m, lineStart, i, j, maxW) : 0;
|
|
497
|
-
if (head > 0) {
|
|
498
|
-
// The line takes the word's head and a hyphen; its tail opens the
|
|
499
|
-
// next line.
|
|
500
|
-
flush(lineStart, i + head, true);
|
|
501
|
-
lineStart = -1;
|
|
502
|
-
i += head;
|
|
503
|
-
continue;
|
|
504
|
-
}
|
|
505
|
-
flush(lineStart, lineEnd);
|
|
506
|
-
lineStart = -1;
|
|
507
|
-
}
|
|
508
|
-
else if (lineStart >= 0 && m.measure(lineStart, j) > maxW) {
|
|
509
|
-
// Only leading spaces on the line: drop them.
|
|
510
|
-
lineStart = -1;
|
|
511
|
-
}
|
|
512
|
-
if (lineStart >= 0) {
|
|
513
|
-
lineEnd = j;
|
|
514
|
-
i = j;
|
|
515
|
-
continue;
|
|
516
|
-
}
|
|
517
|
-
// The word opens a line; cut it while it is wider than the line.
|
|
518
|
-
let a = i;
|
|
519
|
-
while (m.measure(a, j) > maxW) {
|
|
520
|
-
const cut = breakWord(m, a, j, maxW, hyphenate);
|
|
521
|
-
if (cut.end >= j)
|
|
522
|
-
break;
|
|
523
|
-
flush(a, cut.end, cut.hyphen, cut.divided);
|
|
524
|
-
a = cut.next ?? cut.end;
|
|
525
|
-
}
|
|
526
|
-
lineStart = a;
|
|
527
|
-
lineEnd = j;
|
|
528
|
-
i = j;
|
|
529
|
-
}
|
|
530
|
-
if (lineStart >= 0)
|
|
531
|
-
flush(lineStart, lineEnd);
|
|
532
|
-
else if (out.length === 0)
|
|
533
|
-
out.push(m.line([]));
|
|
534
|
-
return out;
|
|
535
|
-
}
|
|
536
|
-
// ---------------------------------------------------------------------------
|
|
537
|
-
// Truncation with an ellipsis — where the cut falls (shared with the plain
|
|
538
|
-
// path in `layout.ts`)
|
|
539
|
-
// ---------------------------------------------------------------------------
|
|
540
|
-
/** Characters a head cut before an ellipsis drops at its end: spaces,
|
|
541
|
-
* separators, dashes and opening brackets / quotes ("Rivers, …" →
|
|
542
|
-
* "Rivers…", "Part one — …" → "Part one…"). */
|
|
543
|
-
const DROP_BEFORE_ELLIPSIS = /[\s,;:\-‐‑–—/([{«‹“‘„¿¡]/u;
|
|
544
|
-
/** Characters a tail cut after an ellipsis drops at its start: spaces,
|
|
545
|
-
* separators, dashes, sentence ends and closing brackets / quotes. */
|
|
546
|
-
const DROP_AFTER_ELLIPSIS = /[\s,;:.!?…\-‐‑–—/)\]}»›”’]/u;
|
|
547
|
-
/** Where a word may end inside a run of letters: after a hyphen, a dash or
|
|
548
|
-
* a slash. Not after U+2011 NON-BREAKING HYPHEN, which glues its
|
|
549
|
-
* neighbours like a no-break space ("MS\u2011DOS" is one word). */
|
|
550
|
-
const JOINS_WORDS = /[\-\u2010\u2013\u2014/]/u;
|
|
551
|
-
// No-break spaces glue their neighbours ("225 000", "37 °C"): never a place
|
|
552
|
-
// to cut. `isBreakingSpace` (measure/spaces) already leaves them out (EF-66).
|
|
553
|
-
/** Whether `i` is a word boundary of `text[from, to)`: an end of the range,
|
|
554
|
-
* a (breaking) space on either side, or just after a hyphen, dash or
|
|
555
|
-
* slash. */
|
|
556
|
-
function isWordBoundary(text, i, from, to) {
|
|
557
|
-
if (i <= from || i >= to)
|
|
558
|
-
return true;
|
|
559
|
-
const before = text[i - 1];
|
|
560
|
-
return isBreakingSpace(before) || isBreakingSpace(text[i]) || JOINS_WORDS.test(before);
|
|
561
|
-
}
|
|
562
|
-
/** Whether a cut at `i` falls inside a word of `text[from, to)` written in
|
|
563
|
-
* a joining script (Arabic): such a word is never cut, whatever is lost
|
|
564
|
-
* (its letters would lose their joins and read as another word). */
|
|
565
|
-
function insideJoiningWord(text, i, from, to) {
|
|
566
|
-
if (isWordBoundary(text, i, from, to))
|
|
567
|
-
return false;
|
|
568
|
-
let a = i;
|
|
569
|
-
while (a > from && !isWordBoundary(text, a, from, to))
|
|
570
|
-
a--;
|
|
571
|
-
let b = i;
|
|
572
|
-
while (b < to && !isWordBoundary(text, b, from, to))
|
|
573
|
-
b++;
|
|
574
|
-
return hasJoiningScript(text.slice(a, b));
|
|
575
|
-
}
|
|
576
|
-
/** The end of a head cut at `cut` once the spaces and joining punctuation
|
|
577
|
-
* before the ellipsis are dropped. */
|
|
578
|
-
function trimHead(text, from, cut) {
|
|
579
|
-
while (cut > from && DROP_BEFORE_ELLIPSIS.test(text[cut - 1]))
|
|
580
|
-
cut--;
|
|
581
|
-
return cut;
|
|
582
|
-
}
|
|
583
|
-
/** The start of a tail cut at `cut` once the spaces and punctuation after
|
|
584
|
-
* the ellipsis are dropped. */
|
|
585
|
-
function trimTail(text, to, cut) {
|
|
586
|
-
while (cut < to && DROP_AFTER_ELLIPSIS.test(text[cut]))
|
|
587
|
-
cut++;
|
|
588
|
-
return cut;
|
|
589
|
-
}
|
|
590
|
-
/** Where an `ellipsis-end` truncation of `text[from, to)` ends, given `fit`
|
|
591
|
-
* — the end of the longest head that fits beside the ellipsis. The cut
|
|
592
|
-
* moves back to the last word boundary, and the spaces and joining
|
|
593
|
-
* punctuation before the ellipsis are dropped — unless what is left keeps
|
|
594
|
-
* less than half of what fits (a single long word, a URL): then the word
|
|
595
|
-
* is cut where it must, except a word of a joining script (Arabic), which
|
|
596
|
-
* goes whole. Never past `fit`, so the head still fits. */
|
|
597
|
-
export function ellipsisEndCut(text, from, to, fit) {
|
|
598
|
-
if (!isWordBoundary(text, fit, from, to)) {
|
|
599
|
-
let b = fit - 1;
|
|
600
|
-
while (b > from && !isWordBoundary(text, b, from, to))
|
|
601
|
-
b--;
|
|
602
|
-
// An Arabic word is dropped whole rather than cut, even when that
|
|
603
|
-
// leaves only the ellipsis.
|
|
604
|
-
if (insideJoiningWord(text, fit, from, to))
|
|
605
|
-
return trimHead(text, from, b);
|
|
606
|
-
if (b > from) {
|
|
607
|
-
const head = trimHead(text, from, b);
|
|
608
|
-
// The guard counts what is kept, after the trim.
|
|
609
|
-
if (head - from >= (fit - from) / 2)
|
|
610
|
-
return head;
|
|
611
|
-
}
|
|
612
|
-
}
|
|
613
|
-
return trimHead(text, from, fit);
|
|
614
|
-
}
|
|
615
|
-
/** Where an `ellipsis-start` truncation of `text[from, to)` starts, given
|
|
616
|
-
* `fit` — the start of the longest tail that fits beside the ellipsis: the
|
|
617
|
-
* mirror of `ellipsisEndCut`. Never before `fit`. */
|
|
618
|
-
export function ellipsisStartCut(text, from, to, fit) {
|
|
619
|
-
if (!isWordBoundary(text, fit, from, to)) {
|
|
620
|
-
let b = fit + 1;
|
|
621
|
-
while (b < to && !isWordBoundary(text, b, from, to))
|
|
622
|
-
b++;
|
|
623
|
-
if (insideJoiningWord(text, fit, from, to))
|
|
624
|
-
return trimTail(text, to, b);
|
|
625
|
-
if (b < to) {
|
|
626
|
-
const tail = trimTail(text, to, b);
|
|
627
|
-
if (to - tail >= (to - fit) / 2)
|
|
628
|
-
return tail;
|
|
629
|
-
}
|
|
630
|
-
}
|
|
631
|
-
return trimTail(text, to, fit);
|
|
632
|
-
}
|
|
633
|
-
/** An `ellipsis-middle` truncation keeping `text[from, from + left)` and
|
|
634
|
-
* `text[to - right, to)`, with the spaces that would touch the ellipsis
|
|
635
|
-
* dropped, and neither side ending inside an Arabic word. */
|
|
636
|
-
export function ellipsisMiddleCut(text, from, to, left, right) {
|
|
637
|
-
// Neither side ends inside an Arabic word.
|
|
638
|
-
while (left > 0 && insideJoiningWord(text, from + left, from, to))
|
|
639
|
-
left--;
|
|
640
|
-
while (right > 0 && insideJoiningWord(text, to - right, from, to))
|
|
641
|
-
right--;
|
|
642
|
-
while (left > 0 && isSpace(text[from + left - 1]))
|
|
643
|
-
left--;
|
|
644
|
-
while (right > 0 && isSpace(text[to - right]))
|
|
645
|
-
right--;
|
|
646
|
-
return { left, right };
|
|
647
|
-
}
|
|
648
|
-
/** One explicit line `[s, e)` set on a single line: whole, clipped by the
|
|
649
|
-
* renderer, or truncated with an ellipsis at `mode` (the cut placed by
|
|
650
|
-
* `ellipsisEndCut` / `ellipsisStartCut` / `ellipsisMiddleCut`). */
|
|
651
|
-
export function singleRichLine(m, s, e, maxWidth, overflow) {
|
|
652
|
-
if (overflow === 'clip' || m.measure(s, e) <= maxWidth)
|
|
653
|
-
return m.rangeLine(s, e);
|
|
654
|
-
const text = m.rt.text;
|
|
655
|
-
const ell = (style) => ({ text: '…', style });
|
|
656
|
-
const len = e - s;
|
|
657
|
-
if (overflow === 'ellipsis-start') {
|
|
658
|
-
// The ellipsis takes the style of the character after it.
|
|
659
|
-
const fitsFrom = (a) => m.measure(a, e, ell(m.styleNear(a))) <= maxWidth;
|
|
660
|
-
let a = s;
|
|
661
|
-
while (a <= e && !fitsFrom(a))
|
|
662
|
-
a++;
|
|
663
|
-
if (a > e)
|
|
664
|
-
return m.line([]);
|
|
665
|
-
a = ellipsisStartCut(text, s, e, a);
|
|
666
|
-
// A tail moved on to a word boundary puts the ellipsis beside another
|
|
667
|
-
// character, whose style may be wider: measure again.
|
|
668
|
-
while (a < e && !fitsFrom(a))
|
|
669
|
-
a = ellipsisStartCut(text, s, e, a + 1);
|
|
670
|
-
return m.line([ell(m.styleNear(a)), ...m.pieces(a, e)]);
|
|
671
|
-
}
|
|
672
|
-
if (overflow === 'ellipsis-middle') {
|
|
673
|
-
let left = 0;
|
|
674
|
-
let right = 0;
|
|
675
|
-
const fits = (l, r) => m.measure(s, s + l, ell(m.styleNear(s + l - 1)), ...m.pieces(e - r, e)) <= maxWidth;
|
|
676
|
-
if (!fits(0, 0))
|
|
677
|
-
return m.line([]);
|
|
678
|
-
while (left + right < len) {
|
|
679
|
-
if (!fits(left + 1, right))
|
|
680
|
-
break;
|
|
681
|
-
left++;
|
|
682
|
-
if (left + right >= len)
|
|
683
|
-
break;
|
|
684
|
-
if (!fits(left, right + 1))
|
|
685
|
-
break;
|
|
686
|
-
right++;
|
|
687
|
-
}
|
|
688
|
-
({ left, right } = ellipsisMiddleCut(text, s, e, left, right));
|
|
689
|
-
return m.line([...m.pieces(s, s + left), ell(m.styleNear(s + left - 1)), ...m.pieces(e - right, e)]);
|
|
690
|
-
}
|
|
691
|
-
// ellipsis-end: the ellipsis takes the style of the character before it,
|
|
692
|
-
// so a head moved back to a word boundary is measured again in case that
|
|
693
|
-
// style is wider.
|
|
694
|
-
const fitsTo = (b) => m.measure(s, b, ell(m.styleNear(b - 1))) <= maxWidth;
|
|
695
|
-
let b = e;
|
|
696
|
-
while (b >= s && !fitsTo(b))
|
|
697
|
-
b--;
|
|
698
|
-
if (b < s)
|
|
699
|
-
return m.line([]);
|
|
700
|
-
let cut = ellipsisEndCut(text, s, e, b);
|
|
701
|
-
while (cut > s && !fitsTo(cut))
|
|
702
|
-
cut = ellipsisEndCut(text, s, e, cut - 1);
|
|
703
|
-
return m.line([...m.pieces(s, cut), ell(m.styleNear(cut - 1))]);
|
|
704
|
-
}
|
|
7
|
+
export { richFontSet, parseRichDesignText, plainDesignText, richDesignSpans } from './richText/parse.js';
|
|
8
|
+
export { RichMeasurer } from './richText/measure.js';
|
|
9
|
+
export { wrapRich } from './richText/wrap.js';
|
|
10
|
+
export { ellipsisEndCut, ellipsisStartCut, ellipsisMiddleCut, singleRichLine } from './richText/ellipsis.js';
|
|
705
11
|
//# sourceMappingURL=richText.js.map
|