postext 1.24.0 → 1.25.1
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/README.md +8 -5
- package/dist/__tests__/bundle/cjkRulesPin.test.d.ts +2 -0
- package/dist/__tests__/bundle/cjkRulesPin.test.d.ts.map +1 -0
- package/dist/__tests__/bundle/cjkRulesPin.test.js +78 -0
- package/dist/__tests__/bundle/cjkRulesPin.test.js.map +1 -0
- package/dist/__tests__/bundle/contextDefaultsBundle.test.d.ts +2 -0
- package/dist/__tests__/bundle/contextDefaultsBundle.test.d.ts.map +1 -0
- package/dist/__tests__/bundle/contextDefaultsBundle.test.js +104 -0
- package/dist/__tests__/bundle/contextDefaultsBundle.test.js.map +1 -0
- package/dist/__tests__/bundle/designOverflowPin.test.js +4 -2
- package/dist/__tests__/bundle/designOverflowPin.test.js.map +1 -1
- package/dist/__tests__/bundle/flowColumnsPin.test.d.ts +2 -0
- package/dist/__tests__/bundle/flowColumnsPin.test.d.ts.map +1 -0
- package/dist/__tests__/bundle/flowColumnsPin.test.js +40 -0
- package/dist/__tests__/bundle/flowColumnsPin.test.js.map +1 -0
- package/dist/__tests__/bundle/gridBalancingPin.test.d.ts +2 -0
- package/dist/__tests__/bundle/gridBalancingPin.test.d.ts.map +1 -0
- package/dist/__tests__/bundle/gridBalancingPin.test.js +72 -0
- package/dist/__tests__/bundle/gridBalancingPin.test.js.map +1 -0
- package/dist/__tests__/bundle/inlineTableSplitPin.test.d.ts +2 -0
- package/dist/__tests__/bundle/inlineTableSplitPin.test.d.ts.map +1 -0
- package/dist/__tests__/bundle/inlineTableSplitPin.test.js +43 -0
- package/dist/__tests__/bundle/inlineTableSplitPin.test.js.map +1 -0
- package/dist/__tests__/bundle/openerHeadFloatsPin.test.d.ts +2 -0
- package/dist/__tests__/bundle/openerHeadFloatsPin.test.d.ts.map +1 -0
- package/dist/__tests__/bundle/openerHeadFloatsPin.test.js +50 -0
- package/dist/__tests__/bundle/openerHeadFloatsPin.test.js.map +1 -0
- package/dist/__tests__/bundle.test.js +11 -1
- package/dist/__tests__/bundle.test.js.map +1 -1
- package/dist/__tests__/cjk/annotationsRender.test.js +5 -2
- package/dist/__tests__/cjk/annotationsRender.test.js.map +1 -1
- package/dist/__tests__/cjk/circledNumbers.test.d.ts +2 -0
- package/dist/__tests__/cjk/circledNumbers.test.d.ts.map +1 -0
- package/dist/__tests__/cjk/circledNumbers.test.js +83 -0
- package/dist/__tests__/cjk/circledNumbers.test.js.map +1 -0
- package/dist/__tests__/cjk/gridBalancing.test.d.ts +2 -0
- package/dist/__tests__/cjk/gridBalancing.test.d.ts.map +1 -0
- package/dist/__tests__/cjk/gridBalancing.test.js +227 -0
- package/dist/__tests__/cjk/gridBalancing.test.js.map +1 -0
- package/dist/__tests__/cjk/justifyRender.test.js +2 -1
- package/dist/__tests__/cjk/justifyRender.test.js.map +1 -1
- package/dist/__tests__/cjk/titleBreaks.test.d.ts +2 -0
- package/dist/__tests__/cjk/titleBreaks.test.d.ts.map +1 -0
- package/dist/__tests__/cjk/titleBreaks.test.js +76 -0
- package/dist/__tests__/cjk/titleBreaks.test.js.map +1 -0
- package/dist/__tests__/cjk/wordJoiner.test.js +13 -4
- package/dist/__tests__/cjk/wordJoiner.test.js.map +1 -1
- package/dist/__tests__/codeBlocks.test.js +1 -1
- package/dist/__tests__/defaults/stripContextDefaults.test.d.ts +2 -0
- package/dist/__tests__/defaults/stripContextDefaults.test.d.ts.map +1 -0
- package/dist/__tests__/defaults/stripContextDefaults.test.js +265 -0
- package/dist/__tests__/defaults/stripContextDefaults.test.js.map +1 -0
- package/dist/__tests__/design/cjkDesignDash.test.d.ts +2 -0
- package/dist/__tests__/design/cjkDesignDash.test.d.ts.map +1 -0
- package/dist/__tests__/design/cjkDesignDash.test.js +395 -0
- package/dist/__tests__/design/cjkDesignDash.test.js.map +1 -0
- package/dist/__tests__/design/cjkDesignText.test.d.ts +2 -0
- package/dist/__tests__/design/cjkDesignText.test.d.ts.map +1 -0
- package/dist/__tests__/design/cjkDesignText.test.js +130 -0
- package/dist/__tests__/design/cjkDesignText.test.js.map +1 -0
- package/dist/__tests__/design/cjkDesignTextRender.test.d.ts +2 -0
- package/dist/__tests__/design/cjkDesignTextRender.test.d.ts.map +1 -0
- package/dist/__tests__/design/cjkDesignTextRender.test.js +100 -0
- package/dist/__tests__/design/cjkDesignTextRender.test.js.map +1 -0
- package/dist/__tests__/exports.test.js +49 -0
- package/dist/__tests__/exports.test.js.map +1 -1
- package/dist/__tests__/hardBreaks.test.js +1 -1
- package/dist/__tests__/headingInlineMarks.test.js +1 -1
- package/dist/__tests__/headingNumberSpans.test.d.ts +2 -0
- package/dist/__tests__/headingNumberSpans.test.d.ts.map +1 -0
- package/dist/__tests__/headingNumberSpans.test.js +96 -0
- package/dist/__tests__/headingNumberSpans.test.js.map +1 -0
- package/dist/__tests__/mathSizeMigration.test.js +2 -2
- package/dist/__tests__/multipleColumns.test.js +207 -0
- package/dist/__tests__/multipleColumns.test.js.map +1 -1
- package/dist/__tests__/parse/citations.test.js +29 -0
- package/dist/__tests__/parse/citations.test.js.map +1 -1
- package/dist/__tests__/pipeline/calloutInlineResourceGap.test.js +10 -6
- package/dist/__tests__/pipeline/calloutInlineResourceGap.test.js.map +1 -1
- package/dist/__tests__/pipeline/calloutOverflow.test.js +4 -2
- package/dist/__tests__/pipeline/calloutOverflow.test.js.map +1 -1
- package/dist/__tests__/pipeline/calloutSplitMinLinesChild.test.js +1 -1
- package/dist/__tests__/pipeline/calloutTallKeepTogether.test.js +6 -5
- package/dist/__tests__/pipeline/calloutTallKeepTogether.test.js.map +1 -1
- package/dist/__tests__/pipeline/colonListRoom.test.js +1 -1
- package/dist/__tests__/pipeline/compoundBreaks.test.js +1 -1
- package/dist/__tests__/pipeline/dashBreaks.test.js +1 -1
- package/dist/__tests__/pipeline/floatCitingPage.test.d.ts +2 -0
- package/dist/__tests__/pipeline/floatCitingPage.test.d.ts.map +1 -0
- package/dist/__tests__/pipeline/floatCitingPage.test.js +241 -0
- package/dist/__tests__/pipeline/floatCitingPage.test.js.map +1 -0
- package/dist/__tests__/pipeline/floatOverInlineResource.test.js +18 -6
- package/dist/__tests__/pipeline/floatOverInlineResource.test.js.map +1 -1
- package/dist/__tests__/pipeline/floatPlacement.test.js +3 -3
- package/dist/__tests__/pipeline/floatPlacement.test.js.map +1 -1
- package/dist/__tests__/pipeline/flowColumns.test.d.ts +2 -0
- package/dist/__tests__/pipeline/flowColumns.test.d.ts.map +1 -0
- package/dist/__tests__/pipeline/flowColumns.test.js +261 -0
- package/dist/__tests__/pipeline/flowColumns.test.js.map +1 -0
- package/dist/__tests__/pipeline/headingKeepFitEps.test.d.ts +2 -0
- package/dist/__tests__/pipeline/headingKeepFitEps.test.d.ts.map +1 -0
- package/dist/__tests__/pipeline/headingKeepFitEps.test.js +83 -0
- package/dist/__tests__/pipeline/headingKeepFitEps.test.js.map +1 -0
- package/dist/__tests__/pipeline/headingSplitOrphans.test.js +1 -1
- package/dist/__tests__/pipeline/inlineFigureSpace.test.js +1 -1
- package/dist/__tests__/pipeline/inlineTableSplit.test.d.ts +2 -0
- package/dist/__tests__/pipeline/inlineTableSplit.test.d.ts.map +1 -0
- package/dist/__tests__/pipeline/inlineTableSplit.test.js +238 -0
- package/dist/__tests__/pipeline/inlineTableSplit.test.js.map +1 -0
- package/dist/__tests__/pipeline/paragraphContainerTail.test.js +1 -1
- package/dist/__tests__/pipeline/raggedOptimal.test.js +1 -1
- package/dist/__tests__/pipeline/resolvedPaletteCopy.test.js +3 -2
- package/dist/__tests__/pipeline/resolvedPaletteCopy.test.js.map +1 -1
- package/dist/__tests__/pipeline/sideBoxAfterText.test.d.ts +2 -0
- package/dist/__tests__/pipeline/sideBoxAfterText.test.d.ts.map +1 -0
- package/dist/__tests__/pipeline/sideBoxAfterText.test.js +163 -0
- package/dist/__tests__/pipeline/sideBoxAfterText.test.js.map +1 -0
- package/dist/__tests__/prepareFonts.test.d.ts +2 -0
- package/dist/__tests__/prepareFonts.test.d.ts.map +1 -0
- package/dist/__tests__/prepareFonts.test.js +548 -0
- package/dist/__tests__/prepareFonts.test.js.map +1 -0
- package/dist/__tests__/svgFonts.test.d.ts +2 -0
- package/dist/__tests__/svgFonts.test.d.ts.map +1 -0
- package/dist/__tests__/svgFonts.test.js +286 -0
- package/dist/__tests__/svgFonts.test.js.map +1 -0
- package/dist/__tests__/verseLines.test.js +1 -1
- package/dist/__tests__/vertical/measurePaint.test.js +16 -0
- package/dist/__tests__/vertical/measurePaint.test.js.map +1 -1
- package/dist/bundle/adapters.d.ts +31 -7
- package/dist/bundle/adapters.d.ts.map +1 -1
- package/dist/bundle/adapters.js +113 -34
- package/dist/bundle/adapters.js.map +1 -1
- package/dist/bundle/codec.d.ts.map +1 -1
- package/dist/bundle/codec.js +37 -4
- package/dist/bundle/codec.js.map +1 -1
- package/dist/bundle/configVersion.d.ts +127 -10
- package/dist/bundle/configVersion.d.ts.map +1 -1
- package/dist/bundle/configVersion.js +260 -9
- package/dist/bundle/configVersion.js.map +1 -1
- package/dist/bundle/index.d.ts +3 -3
- package/dist/bundle/index.d.ts.map +1 -1
- package/dist/bundle/index.js +2 -2
- package/dist/bundle/index.js.map +1 -1
- package/dist/bundle/manifest.d.ts.map +1 -1
- package/dist/bundle/manifest.js +3 -2
- package/dist/bundle/manifest.js.map +1 -1
- package/dist/bundle/types.d.ts +4 -0
- package/dist/bundle/types.d.ts.map +1 -1
- package/dist/canvas-backend/headerFooter.d.ts.map +1 -1
- package/dist/canvas-backend/headerFooter.js +18 -3
- package/dist/canvas-backend/headerFooter.js.map +1 -1
- package/dist/columnRule.d.ts.map +1 -1
- package/dist/columnRule.js +5 -2
- package/dist/columnRule.js.map +1 -1
- package/dist/configWarnings.js +1 -1
- package/dist/configWarnings.js.map +1 -1
- package/dist/defaults/bodyText.d.ts +2 -1
- package/dist/defaults/bodyText.d.ts.map +1 -1
- package/dist/defaults/bodyText.js +13 -2
- package/dist/defaults/bodyText.js.map +1 -1
- package/dist/defaults/cjk.d.ts +2 -1
- package/dist/defaults/cjk.d.ts.map +1 -1
- package/dist/defaults/cjk.js +17 -1
- package/dist/defaults/cjk.js.map +1 -1
- package/dist/defaults/diagramStyle.d.ts.map +1 -1
- package/dist/defaults/diagramStyle.js +6 -0
- package/dist/defaults/diagramStyle.js.map +1 -1
- package/dist/defaults/headings.d.ts +22 -2
- package/dist/defaults/headings.d.ts.map +1 -1
- package/dist/defaults/headings.js +34 -2
- package/dist/defaults/headings.js.map +1 -1
- package/dist/defaults/index.d.ts +11 -2
- package/dist/defaults/index.d.ts.map +1 -1
- package/dist/defaults/index.js +34 -9
- package/dist/defaults/index.js.map +1 -1
- package/dist/defaults/indexConfig.d.ts +6 -2
- package/dist/defaults/indexConfig.d.ts.map +1 -1
- package/dist/defaults/indexConfig.js +10 -5
- package/dist/defaults/indexConfig.js.map +1 -1
- package/dist/defaults/layout.d.ts +5 -0
- package/dist/defaults/layout.d.ts.map +1 -1
- package/dist/defaults/layout.js +32 -0
- package/dist/defaults/layout.js.map +1 -1
- package/dist/defaults/page.d.ts.map +1 -1
- package/dist/defaults/page.js +8 -2
- package/dist/defaults/page.js.map +1 -1
- package/dist/defaults/tableStyle.d.ts.map +1 -1
- package/dist/defaults/tableStyle.js +6 -0
- package/dist/defaults/tableStyle.js.map +1 -1
- package/dist/design/cjkText.d.ts +34 -0
- package/dist/design/cjkText.d.ts.map +1 -0
- package/dist/design/cjkText.js +88 -0
- package/dist/design/cjkText.js.map +1 -0
- package/dist/design/layout.d.ts.map +1 -1
- package/dist/design/layout.js +103 -5
- package/dist/design/layout.js.map +1 -1
- package/dist/design/richText.d.ts +28 -0
- package/dist/design/richText.d.ts.map +1 -1
- package/dist/design/richText.js +37 -1
- package/dist/design/richText.js.map +1 -1
- package/dist/fonts/buildWithFonts.d.ts +19 -0
- package/dist/fonts/buildWithFonts.d.ts.map +1 -0
- package/dist/fonts/buildWithFonts.js +16 -0
- package/dist/fonts/buildWithFonts.js.map +1 -0
- package/dist/fonts/faces.d.ts +101 -0
- package/dist/fonts/faces.d.ts.map +1 -0
- package/dist/fonts/faces.js +282 -0
- package/dist/fonts/faces.js.map +1 -0
- package/dist/fonts/fontSet.d.ts +37 -0
- package/dist/fonts/fontSet.d.ts.map +1 -0
- package/dist/fonts/fontSet.js +181 -0
- package/dist/fonts/fontSet.js.map +1 -0
- package/dist/fonts/prepare.d.ts +125 -0
- package/dist/fonts/prepare.d.ts.map +1 -0
- package/dist/fonts/prepare.js +380 -0
- package/dist/fonts/prepare.js.map +1 -0
- package/dist/html-backend.d.ts +17 -0
- package/dist/html-backend.d.ts.map +1 -1
- package/dist/html-backend.js +98 -4
- package/dist/html-backend.js.map +1 -1
- package/dist/index.d.ts +25 -5
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +18 -2
- package/dist/index.js.map +1 -1
- package/dist/measure/cache.d.ts.map +1 -1
- package/dist/measure/cache.js +32 -2
- package/dist/measure/cache.js.map +1 -1
- package/dist/measure/canvas.d.ts +15 -0
- package/dist/measure/canvas.d.ts.map +1 -1
- package/dist/measure/canvas.js +68 -4
- package/dist/measure/canvas.js.map +1 -1
- package/dist/measure/cjk.d.ts.map +1 -1
- package/dist/measure/cjk.js +4 -1
- package/dist/measure/cjk.js.map +1 -1
- package/dist/measure/cjkClasses.d.ts +17 -0
- package/dist/measure/cjkClasses.d.ts.map +1 -1
- package/dist/measure/cjkClasses.js +41 -1
- package/dist/measure/cjkClasses.js.map +1 -1
- package/dist/measure/cjkCompose.d.ts.map +1 -1
- package/dist/measure/cjkCompose.js +119 -7
- package/dist/measure/cjkCompose.js.map +1 -1
- package/dist/measure/cjkPunctuation.d.ts +18 -1
- package/dist/measure/cjkPunctuation.d.ts.map +1 -1
- package/dist/measure/cjkPunctuation.js +13 -1
- package/dist/measure/cjkPunctuation.js.map +1 -1
- package/dist/measure/font.d.ts +8 -0
- package/dist/measure/font.d.ts.map +1 -1
- package/dist/measure/font.js +13 -2
- package/dist/measure/font.js.map +1 -1
- package/dist/measure/fontString.d.ts +14 -0
- package/dist/measure/fontString.d.ts.map +1 -0
- package/dist/measure/fontString.js +55 -0
- package/dist/measure/fontString.js.map +1 -0
- package/dist/measure/index.d.ts +4 -1
- package/dist/measure/index.d.ts.map +1 -1
- package/dist/measure/index.js +3 -1
- package/dist/measure/index.js.map +1 -1
- package/dist/measure/types.d.ts +4 -0
- package/dist/measure/types.d.ts.map +1 -1
- package/dist/measure/types.js.map +1 -1
- package/dist/parse/citations.d.ts.map +1 -1
- package/dist/parse/citations.js +7 -3
- package/dist/parse/citations.js.map +1 -1
- package/dist/pipeline/build.d.ts +36 -0
- package/dist/pipeline/build.d.ts.map +1 -1
- package/dist/pipeline/build.js +1065 -193
- package/dist/pipeline/build.js.map +1 -1
- package/dist/pipeline/buildBlockKind.d.ts.map +1 -1
- package/dist/pipeline/buildBlockKind.js +20 -6
- package/dist/pipeline/buildBlockKind.js.map +1 -1
- package/dist/pipeline/buildMeasurement.d.ts +6 -0
- package/dist/pipeline/buildMeasurement.d.ts.map +1 -1
- package/dist/pipeline/buildMeasurement.js +3 -2
- package/dist/pipeline/buildMeasurement.js.map +1 -1
- package/dist/pipeline/calloutLayout.d.ts +59 -0
- package/dist/pipeline/calloutLayout.d.ts.map +1 -1
- package/dist/pipeline/calloutLayout.js +287 -65
- package/dist/pipeline/calloutLayout.js.map +1 -1
- package/dist/pipeline/columnBalancing.d.ts +20 -0
- package/dist/pipeline/columnBalancing.d.ts.map +1 -1
- package/dist/pipeline/columnBalancing.js +22 -4
- package/dist/pipeline/columnBalancing.js.map +1 -1
- package/dist/pipeline/columnsGroup.d.ts +61 -0
- package/dist/pipeline/columnsGroup.d.ts.map +1 -0
- package/dist/pipeline/columnsGroup.js +88 -0
- package/dist/pipeline/columnsGroup.js.map +1 -0
- package/dist/pipeline/config.d.ts +16 -0
- package/dist/pipeline/config.d.ts.map +1 -1
- package/dist/pipeline/config.js +51 -9
- package/dist/pipeline/config.js.map +1 -1
- package/dist/pipeline/contentWarnings.d.ts.map +1 -1
- package/dist/pipeline/contentWarnings.js +28 -0
- package/dist/pipeline/contentWarnings.js.map +1 -1
- package/dist/pipeline/floatPlacement.d.ts +16 -2
- package/dist/pipeline/floatPlacement.d.ts.map +1 -1
- package/dist/pipeline/floatPlacement.js +12 -4
- package/dist/pipeline/floatPlacement.js.map +1 -1
- package/dist/pipeline/floatSlots.d.ts +9 -3
- package/dist/pipeline/floatSlots.d.ts.map +1 -1
- package/dist/pipeline/floatSlots.js +15 -6
- package/dist/pipeline/floatSlots.js.map +1 -1
- package/dist/pipeline/flowColumns.d.ts +41 -0
- package/dist/pipeline/flowColumns.d.ts.map +1 -0
- package/dist/pipeline/flowColumns.js +116 -0
- package/dist/pipeline/flowColumns.js.map +1 -0
- package/dist/pipeline/measureContentBlock.d.ts +13 -1
- package/dist/pipeline/measureContentBlock.d.ts.map +1 -1
- package/dist/pipeline/measureContentBlock.js +20 -5
- package/dist/pipeline/measureContentBlock.js.map +1 -1
- package/dist/pipeline/partPalette.d.ts +3 -0
- package/dist/pipeline/partPalette.d.ts.map +1 -1
- package/dist/pipeline/partPalette.js +5 -0
- package/dist/pipeline/partPalette.js.map +1 -1
- package/dist/pipeline/placement.d.ts +19 -0
- package/dist/pipeline/placement.d.ts.map +1 -1
- package/dist/pipeline/placement.js +5 -2
- package/dist/pipeline/placement.js.map +1 -1
- package/dist/pipeline/resourceLayout.d.ts +26 -0
- package/dist/pipeline/resourceLayout.d.ts.map +1 -1
- package/dist/pipeline/resourceLayout.js +53 -3
- package/dist/pipeline/resourceLayout.js.map +1 -1
- package/dist/pipeline/toc.d.ts.map +1 -1
- package/dist/pipeline/toc.js +6 -1
- package/dist/pipeline/toc.js.map +1 -1
- package/dist/svg/fontRegistry.d.ts +66 -0
- package/dist/svg/fontRegistry.d.ts.map +1 -0
- package/dist/svg/fontRegistry.js +294 -0
- package/dist/svg/fontRegistry.js.map +1 -0
- package/dist/svg/fonts.d.ts +140 -0
- package/dist/svg/fonts.d.ts.map +1 -0
- package/dist/svg/fonts.js +642 -0
- package/dist/svg/fonts.js.map +1 -0
- package/dist/svg/image.d.ts +44 -0
- package/dist/svg/image.d.ts.map +1 -0
- package/dist/svg/image.js +67 -0
- package/dist/svg/image.js.map +1 -0
- package/dist/types.d.ts +145 -8
- package/dist/types.d.ts.map +1 -1
- package/dist/util/stableHash.d.ts +20 -0
- package/dist/util/stableHash.d.ts.map +1 -0
- package/dist/util/stableHash.js +59 -0
- package/dist/util/stableHash.js.map +1 -0
- package/dist/vdt.d.ts +127 -3
- package/dist/vdt.d.ts.map +1 -1
- package/dist/vdt.js.map +1 -1
- package/dist/worker/client.d.ts +8 -0
- package/dist/worker/client.d.ts.map +1 -1
- package/dist/worker/client.js +22 -0
- package/dist/worker/client.js.map +1 -1
- package/dist/worker/fonts.d.ts +1 -13
- package/dist/worker/fonts.d.ts.map +1 -1
- package/dist/worker/fonts.js +3 -61
- package/dist/worker/fonts.js.map +1 -1
- package/dist/worker/layout.worker.js +23 -16
- package/dist/worker/layout.worker.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { PostextConfig } from '../types';
|
|
2
2
|
/**
|
|
3
|
-
* The configuration rules this engine writes:
|
|
4
|
-
*
|
|
3
|
+
* The configuration rules this engine writes: 11 since #632 (10 from
|
|
4
|
+
* postext 1.24, 9 from 1.23, 8 from 1.5). Thirteen rules changed in 1.5 and
|
|
5
5
|
* more since, and a configuration
|
|
6
6
|
* stored under an older
|
|
7
7
|
* number (or none) is read through {@link migrateConfig}:
|
|
@@ -78,6 +78,32 @@ import type { PostextConfig } from '../types';
|
|
|
78
78
|
* - a text element of a heading design or a part page that sets no
|
|
79
79
|
* `overflow` wraps onto more lines (#628), where up to 1.23 it was cut
|
|
80
80
|
* with an ellipsis ({@link pinLegacyDesignOverflow}).
|
|
81
|
+
* - 11, seven rules:
|
|
82
|
+
* - a horizontal page on a character grid (`cjk.grid.enabled`) is not
|
|
83
|
+
* balanced unless `headings.balancing.enabled` says so (#632), where
|
|
84
|
+
* up to 1.24 it was ({@link pinLegacyGridBalancing});
|
|
85
|
+
* - a table placed `here` follows its style's `overflow`
|
|
86
|
+
* (`tableStyle.splitInline`, #634): one that does not fit the room
|
|
87
|
+
* left in its column is cut between rows, where up to 1.24 it moved
|
|
88
|
+
* whole to the next column ({@link pinLegacyInlineTableSplit});
|
|
89
|
+
* - a `:::columns` fence outside a box sets its blocks in sub-columns,
|
|
90
|
+
* and a box that splits may cut inside a group (`layout.flowColumns`,
|
|
91
|
+
* #634), where up to 1.24 such a fence was ignored and a box never cut
|
|
92
|
+
* inside a group ({@link pinLegacyFlowColumns});
|
|
93
|
+
* - a line breaks inside a book title only where two of its characters
|
|
94
|
+
* stand on either side (`cjk.titleMinChars: 2`, #637), where up to
|
|
95
|
+
* 1.24 it could leave one ({@link pinLegacyTitleBreaks});
|
|
96
|
+
* - the circled numbers ①–⑳ and their kin are Chinese characters in CJK
|
|
97
|
+
* text (`cjk.circledNumbers: 'cjk'`, #637), where up to 1.24 they were
|
|
98
|
+
* Western letters ({@link pinLegacyCircledNumbers});
|
|
99
|
+
* - a design text in Chinese or Japanese takes the body's CJK rules
|
|
100
|
+
* (`cjk.composeDesignText`, #637), where up to 1.24 it was wrapped at
|
|
101
|
+
* spaces with every mark at its own advance ({@link
|
|
102
|
+
* pinLegacyDesignText});
|
|
103
|
+
* - under a page-span opener set over several text columns, the head of
|
|
104
|
+
* the opener's own column is a slot for a top float
|
|
105
|
+
* (`layout.floatsUnderOpener`, #639), where up to 1.24 such a float
|
|
106
|
+
* landed from the second column on ({@link pinLegacyOpenerHeadFloats}).
|
|
81
107
|
*
|
|
82
108
|
* A configuration stored without a version was written for postext 1.4 or
|
|
83
109
|
* earlier. One stored under 3 to 7 was written by a 1.5 prerelease, and
|
|
@@ -88,9 +114,11 @@ import type { PostextConfig } from '../types';
|
|
|
88
114
|
* version-8 pins, under 7 the version-8 pins. One stored under 8 was
|
|
89
115
|
* written by postext 1.5 to 1.22 and gets the version-9 pins (which every
|
|
90
116
|
* older one gets too); one stored under 9 was written by postext 1.23 and
|
|
91
|
-
* gets the version-10 pins (which every older one gets too)
|
|
117
|
+
* gets the version-10 pins (which every older one gets too); one stored
|
|
118
|
+
* under 10 was written by postext 1.24 and gets the version-11 pins (which
|
|
119
|
+
* every older one gets too).
|
|
92
120
|
*/
|
|
93
|
-
export declare const CONFIG_VERSION =
|
|
121
|
+
export declare const CONFIG_VERSION = 11;
|
|
94
122
|
/**
|
|
95
123
|
* How much larger postext 1.4 set maths than the size it documents:
|
|
96
124
|
* MathJax gives a formula's box in `ex`, one `ex` of its TeX font is
|
|
@@ -247,6 +275,45 @@ export declare function pinLegacyVerseTightening<T extends Partial<PostextConfig
|
|
|
247
275
|
* same object).
|
|
248
276
|
*/
|
|
249
277
|
export declare function pinLegacyDesignOverflow<T extends Partial<PostextConfig>>(config: T): T;
|
|
278
|
+
/**
|
|
279
|
+
* A configuration written before #632 (postext 1.24 or earlier), pinned to
|
|
280
|
+
* the way 1.24 balanced a horizontal page on a character grid: a config
|
|
281
|
+
* with `cjk.grid.enabled` in horizontal text that does not set
|
|
282
|
+
* `headings.balancing.enabled` gets `true`, where today such a page is
|
|
283
|
+
* not balanced by default. (The levers it runs keep every character in
|
|
284
|
+
* its cell now, which 1.24's loose paragraphs did not.) A vertical one
|
|
285
|
+
* was not balanced then either, and any other configuration is returned
|
|
286
|
+
* as it is (the same object).
|
|
287
|
+
*/
|
|
288
|
+
export declare function pinLegacyGridBalancing<T extends Partial<PostextConfig>>(config: T): T;
|
|
289
|
+
/**
|
|
290
|
+
* A configuration written before #634 (postext 1.24 or earlier), pinned to
|
|
291
|
+
* the way 1.24 placed a table set `here`: `tableStyle.splitInline: false`,
|
|
292
|
+
* so an inline table that does not fit the room left in its column moves
|
|
293
|
+
* whole to the next one, where today it is cut between rows. The named
|
|
294
|
+
* table styles inherit it. A configuration that sets `splitInline` is
|
|
295
|
+
* returned as it is (the same object).
|
|
296
|
+
*/
|
|
297
|
+
export declare function pinLegacyInlineTableSplit<T extends Partial<PostextConfig>>(config: T): T;
|
|
298
|
+
/**
|
|
299
|
+
* A configuration written before #634 (postext 1.24 or earlier), pinned to
|
|
300
|
+
* the way 1.24 read `:::columns`: `layout.flowColumns: false`, so a fence
|
|
301
|
+
* outside a box is ignored (its blocks run at the full measure) and a box
|
|
302
|
+
* that splits never cuts inside a group, where today the one sets its
|
|
303
|
+
* blocks in sub-columns and the other cuts between them. A configuration
|
|
304
|
+
* that sets `flowColumns` is returned as it is (the same object).
|
|
305
|
+
*/
|
|
306
|
+
export declare function pinLegacyFlowColumns<T extends Partial<PostextConfig>>(config: T): T;
|
|
307
|
+
/**
|
|
308
|
+
* A configuration written before #639 (postext 1.24 or earlier), pinned to
|
|
309
|
+
* the slots 1.24 offered under a page-span opener:
|
|
310
|
+
* `layout.floatsUnderOpener: false`, so a float fenced or embedded right
|
|
311
|
+
* after an opener set over several text columns lands from the second
|
|
312
|
+
* column on, where today it takes the head of the opener's own column,
|
|
313
|
+
* under its band. A configuration that sets `floatsUnderOpener` is
|
|
314
|
+
* returned as it is (the same object).
|
|
315
|
+
*/
|
|
316
|
+
export declare function pinLegacyOpenerHeadFloats<T extends Partial<PostextConfig>>(config: T): T;
|
|
250
317
|
/**
|
|
251
318
|
* A configuration written before #620 (postext 1.22 or earlier), pinned to
|
|
252
319
|
* the indents of its paragraph styles: a style that sets both
|
|
@@ -297,6 +364,33 @@ export declare function pinLegacyHeadingMarks<T extends Partial<PostextConfig>>(
|
|
|
297
364
|
* away). A configuration with none is returned as it is (the same object).
|
|
298
365
|
*/
|
|
299
366
|
export declare function pinLegacyDropCapSize<T extends Partial<PostextConfig>>(config: T): T;
|
|
367
|
+
/**
|
|
368
|
+
* A configuration written before #637 (postext 1.24 or earlier), pinned to
|
|
369
|
+
* the way 1.24 broke lines inside a book title: `cjk.titleMinChars: 1`, a
|
|
370
|
+
* line breaking anywhere in a `《…》` or `〈…〉` title the level allows
|
|
371
|
+
* (`《說|文》`), where today two characters of it stand on either side of a
|
|
372
|
+
* break. A configuration that sets `titleMinChars` is returned as it is
|
|
373
|
+
* (the same object).
|
|
374
|
+
*/
|
|
375
|
+
export declare function pinLegacyTitleBreaks<T extends Partial<PostextConfig>>(config: T): T;
|
|
376
|
+
/**
|
|
377
|
+
* A configuration written before #637 (postext 1.24 or earlier), pinned to
|
|
378
|
+
* the way 1.24 set the circled numbers ①–⑳ and their kin in CJK text:
|
|
379
|
+
* `cjk.circledNumbers: 'western'`, as Western letters with the Han–Latin
|
|
380
|
+
* space on both sides and a line free to end on one, where today they are
|
|
381
|
+
* Chinese characters kept off a line end. A configuration that sets
|
|
382
|
+
* `circledNumbers` is returned as it is (the same object).
|
|
383
|
+
*/
|
|
384
|
+
export declare function pinLegacyCircledNumbers<T extends Partial<PostextConfig>>(config: T): T;
|
|
385
|
+
/**
|
|
386
|
+
* A configuration written before #637 (postext 1.24 or earlier), pinned to
|
|
387
|
+
* the way 1.24 set design text in Chinese or Japanese (openers, heading
|
|
388
|
+
* designs, running heads, page designs): `cjk.composeDesignText: false`,
|
|
389
|
+
* wrapped at spaces with every mark at the font's own advance, where
|
|
390
|
+
* today it takes the body's CJK rules. A configuration that sets
|
|
391
|
+
* `composeDesignText` is returned as it is (the same object).
|
|
392
|
+
*/
|
|
393
|
+
export declare function pinLegacyDesignText<T extends Partial<PostextConfig>>(config: T): T;
|
|
300
394
|
export interface MigrateConfigOptions {
|
|
301
395
|
/**
|
|
302
396
|
* The markdown the configuration lays out (a bundle's chapters, a book's),
|
|
@@ -328,7 +422,14 @@ export interface MigrateConfigOptions {
|
|
|
328
422
|
* and text with no ```` ``` ```` or `~~~` fence is not given the 1.22
|
|
329
423
|
* reading of fences (see {@link pinLegacyCodeBlocks}); and text with no
|
|
330
424
|
* poem set line by line is not given the 1.23 turnovers (see {@link
|
|
331
|
-
* pinLegacyVerseTightening})
|
|
425
|
+
* pinLegacyVerseTightening}); and text with no book title is not given
|
|
426
|
+
* the 1.24 title breaks (see {@link pinLegacyTitleBreaks}), text with no
|
|
427
|
+
* circled number not the 1.24 Western circled numbers (see {@link
|
|
428
|
+
* pinLegacyCircledNumbers}), and text with no CJK (in a configuration
|
|
429
|
+
* whose own text holds none) not the 1.24 design text (see {@link
|
|
430
|
+
* pinLegacyDesignText}); and text with no heading (in a configuration
|
|
431
|
+
* that sets a page-span heading) is not given the 1.24 slots under an
|
|
432
|
+
* opener (see {@link pinLegacyOpenerHeadFloats}).
|
|
332
433
|
* That keeps a stored configuration as
|
|
333
434
|
* short as it was. Without it the size is pinned whenever maths is on,
|
|
334
435
|
* and the gaps, the room, the heading marks, the box cut, the dash
|
|
@@ -375,9 +476,20 @@ export interface MigrateConfigOptions {
|
|
|
375
476
|
* pinLegacyCodeBlocks}, unless `options.content` shows none; one older
|
|
376
477
|
* than 10 has its verse turnovers pinned by {@link
|
|
377
478
|
* pinLegacyVerseTightening}, unless `options.content` shows no poem set
|
|
378
|
-
* line by line,
|
|
379
|
-
* that set no `overflow` by {@link pinLegacyDesignOverflow}
|
|
380
|
-
*
|
|
479
|
+
* line by line, the text elements of its heading and part designs
|
|
480
|
+
* that set no `overflow` by {@link pinLegacyDesignOverflow}; one older
|
|
481
|
+
* than 11 has the balancing of a horizontal page on a character grid
|
|
482
|
+
* pinned by {@link pinLegacyGridBalancing}, and its inline tables by {@link
|
|
483
|
+
* pinLegacyInlineTableSplit}, unless `options.content` shows it embeds no
|
|
484
|
+
* resource, its `:::columns` groups by {@link pinLegacyFlowColumns},
|
|
485
|
+
* unless `options.content` shows none, its book titles by {@link pinLegacyTitleBreaks}, unless
|
|
486
|
+
* `options.content` shows none, its circled numbers by {@link
|
|
487
|
+
* pinLegacyCircledNumbers}, unless `options.content` shows none, and its
|
|
488
|
+
* design text by {@link pinLegacyDesignText}, unless neither
|
|
489
|
+
* `options.content` nor the configuration holds CJK text, and the slots
|
|
490
|
+
* under its page-span openers by {@link pinLegacyOpenerHeadFloats}, when
|
|
491
|
+
* it sets a heading level or style with `span: 'page'`, unless
|
|
492
|
+
* `options.content` shows no heading. A current one is returned as it is (the same object).
|
|
381
493
|
* Migrate a stored configuration once and store it again under
|
|
382
494
|
* `CONFIG_VERSION`: the maths pin multiplies a scale, so a configuration
|
|
383
495
|
* read twice under its old number would grow twice.
|
|
@@ -397,9 +509,14 @@ export declare function migrateConfig<T extends Partial<PostextConfig>>(config:
|
|
|
397
509
|
* `:::paragraphs` containers on the `bodyText` in force (the ragged
|
|
398
510
|
* breaking when the merged configuration sets some running text ragged,
|
|
399
511
|
* the container space when it declares a paragraph style), the heading
|
|
400
|
-
* marks and the split under a heading on the `headings` in force,
|
|
512
|
+
* marks and the split under a heading on the `headings` in force, the
|
|
401
513
|
* drop caps and the overflow of heading and part design texts wherever
|
|
402
|
-
* they sit in the merged configuration
|
|
514
|
+
* they sit in the merged configuration, the balancing of a horizontal
|
|
515
|
+
* character grid on the merged `cjk`, `layout` and `headings`, the
|
|
516
|
+
* inline tables on the `tableStyle` in force, the `:::columns` groups and
|
|
517
|
+
* the slots under a page-span opener on the `layout` in force (the slots
|
|
518
|
+
* when the merged configuration sets a page-span heading), and the book
|
|
519
|
+
* titles, the circled numbers and the design text on the `cjk` in force.
|
|
403
520
|
* @internal `readBundle`'s; hosts call {@link migrateConfig}.
|
|
404
521
|
*/
|
|
405
522
|
export declare function migrateBundleConfig(base: PostextConfig, layers: readonly PostextConfig[], configVersion: unknown, options?: MigrateConfigOptions): PostextConfig;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"configVersion.d.ts","sourceRoot":"","sources":["../../src/bundle/configVersion.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"configVersion.d.ts","sourceRoot":"","sources":["../../src/bundle/configVersion.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAA4I,aAAa,EAAoB,MAAM,UAAU,CAAC;AAU1M;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkDG;AACH,wBAAgB,aAAa,CAAC,CAAC,SAAS,OAAO,CAAC,aAAa,CAAC,EAC5D,MAAM,EAAE,CAAC,EACT,aAAa,EAAE,OAAO,EACtB,OAAO,GAAE,oBAAyB,GACjC,CAAC,CA8BH;AAED;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAgB,mBAAmB,CACjC,IAAI,EAAE,aAAa,EACnB,MAAM,EAAE,SAAS,aAAa,EAAE,EAChC,aAAa,EAAE,OAAO,EACtB,OAAO,GAAE,oBAAyB,GACjC,aAAa,CAiCf"}
|
|
@@ -9,9 +9,10 @@ import { DEFAULT_PAGE_CONFIG } from '../defaults/page';
|
|
|
9
9
|
import { dimensionToPx } from '../units';
|
|
10
10
|
import { KNOWN_CONTAINERS } from '../parse/blockParser';
|
|
11
11
|
import { codeFenceOpen } from '../parse/codeFence';
|
|
12
|
+
import { hasCJK } from '../measure/cjk';
|
|
12
13
|
/**
|
|
13
|
-
* The configuration rules this engine writes:
|
|
14
|
-
*
|
|
14
|
+
* The configuration rules this engine writes: 11 since #632 (10 from
|
|
15
|
+
* postext 1.24, 9 from 1.23, 8 from 1.5). Thirteen rules changed in 1.5 and
|
|
15
16
|
* more since, and a configuration
|
|
16
17
|
* stored under an older
|
|
17
18
|
* number (or none) is read through {@link migrateConfig}:
|
|
@@ -88,6 +89,32 @@ import { codeFenceOpen } from '../parse/codeFence';
|
|
|
88
89
|
* - a text element of a heading design or a part page that sets no
|
|
89
90
|
* `overflow` wraps onto more lines (#628), where up to 1.23 it was cut
|
|
90
91
|
* with an ellipsis ({@link pinLegacyDesignOverflow}).
|
|
92
|
+
* - 11, seven rules:
|
|
93
|
+
* - a horizontal page on a character grid (`cjk.grid.enabled`) is not
|
|
94
|
+
* balanced unless `headings.balancing.enabled` says so (#632), where
|
|
95
|
+
* up to 1.24 it was ({@link pinLegacyGridBalancing});
|
|
96
|
+
* - a table placed `here` follows its style's `overflow`
|
|
97
|
+
* (`tableStyle.splitInline`, #634): one that does not fit the room
|
|
98
|
+
* left in its column is cut between rows, where up to 1.24 it moved
|
|
99
|
+
* whole to the next column ({@link pinLegacyInlineTableSplit});
|
|
100
|
+
* - a `:::columns` fence outside a box sets its blocks in sub-columns,
|
|
101
|
+
* and a box that splits may cut inside a group (`layout.flowColumns`,
|
|
102
|
+
* #634), where up to 1.24 such a fence was ignored and a box never cut
|
|
103
|
+
* inside a group ({@link pinLegacyFlowColumns});
|
|
104
|
+
* - a line breaks inside a book title only where two of its characters
|
|
105
|
+
* stand on either side (`cjk.titleMinChars: 2`, #637), where up to
|
|
106
|
+
* 1.24 it could leave one ({@link pinLegacyTitleBreaks});
|
|
107
|
+
* - the circled numbers ①–⑳ and their kin are Chinese characters in CJK
|
|
108
|
+
* text (`cjk.circledNumbers: 'cjk'`, #637), where up to 1.24 they were
|
|
109
|
+
* Western letters ({@link pinLegacyCircledNumbers});
|
|
110
|
+
* - a design text in Chinese or Japanese takes the body's CJK rules
|
|
111
|
+
* (`cjk.composeDesignText`, #637), where up to 1.24 it was wrapped at
|
|
112
|
+
* spaces with every mark at its own advance ({@link
|
|
113
|
+
* pinLegacyDesignText});
|
|
114
|
+
* - under a page-span opener set over several text columns, the head of
|
|
115
|
+
* the opener's own column is a slot for a top float
|
|
116
|
+
* (`layout.floatsUnderOpener`, #639), where up to 1.24 such a float
|
|
117
|
+
* landed from the second column on ({@link pinLegacyOpenerHeadFloats}).
|
|
91
118
|
*
|
|
92
119
|
* A configuration stored without a version was written for postext 1.4 or
|
|
93
120
|
* earlier. One stored under 3 to 7 was written by a 1.5 prerelease, and
|
|
@@ -98,9 +125,11 @@ import { codeFenceOpen } from '../parse/codeFence';
|
|
|
98
125
|
* version-8 pins, under 7 the version-8 pins. One stored under 8 was
|
|
99
126
|
* written by postext 1.5 to 1.22 and gets the version-9 pins (which every
|
|
100
127
|
* older one gets too); one stored under 9 was written by postext 1.23 and
|
|
101
|
-
* gets the version-10 pins (which every older one gets too)
|
|
128
|
+
* gets the version-10 pins (which every older one gets too); one stored
|
|
129
|
+
* under 10 was written by postext 1.24 and gets the version-11 pins (which
|
|
130
|
+
* every older one gets too).
|
|
102
131
|
*/
|
|
103
|
-
export const CONFIG_VERSION =
|
|
132
|
+
export const CONFIG_VERSION = 11;
|
|
104
133
|
/** The rules that merge a partial heading break onto its level's. */
|
|
105
134
|
const HEADING_BREAK_RULES = 3;
|
|
106
135
|
/** The rules that set a formula's em at the documented size. */
|
|
@@ -147,6 +176,22 @@ const VERSE_TIGHTEN_RULES = 10;
|
|
|
147
176
|
/** The rules that wrap a heading or part design text that sets no
|
|
148
177
|
* `overflow`. */
|
|
149
178
|
const DESIGN_OVERFLOW_RULES = 10;
|
|
179
|
+
/** The rules that leave a horizontal page on a character grid unbalanced
|
|
180
|
+
* by default. */
|
|
181
|
+
const GRID_BALANCING_RULES = 11;
|
|
182
|
+
/** The rules that keep two characters of a book title on either side of a
|
|
183
|
+
* line break, set circled numbers as Chinese characters and compose CJK
|
|
184
|
+
* design text (#637). */
|
|
185
|
+
const TITLE_BREAK_RULES = 11;
|
|
186
|
+
const CIRCLED_NUMBER_RULES = 11;
|
|
187
|
+
const DESIGN_TEXT_RULES = 11;
|
|
188
|
+
/** The rules that cut an inline table between rows. */
|
|
189
|
+
const INLINE_TABLE_SPLIT_RULES = 11;
|
|
190
|
+
/** The rules that set `:::columns` in the running text and cut groups. */
|
|
191
|
+
const FLOW_COLUMNS_RULES = 11;
|
|
192
|
+
/** The rules that offer a float the head of a page-span opener's own
|
|
193
|
+
* column. */
|
|
194
|
+
const OPENER_HEAD_FLOAT_RULES = 11;
|
|
150
195
|
/** Up to 1.4 a drop cap with no `fontSize` was as tall as the line boxes it
|
|
151
196
|
* spans divided by this, the share of a letter's size its capitals take. */
|
|
152
197
|
const CAP_HEIGHT = 0.72;
|
|
@@ -573,6 +618,88 @@ export function pinLegacyDesignOverflow(config) {
|
|
|
573
618
|
}
|
|
574
619
|
return out;
|
|
575
620
|
}
|
|
621
|
+
/**
|
|
622
|
+
* A configuration written before #632 (postext 1.24 or earlier), pinned to
|
|
623
|
+
* the way 1.24 balanced a horizontal page on a character grid: a config
|
|
624
|
+
* with `cjk.grid.enabled` in horizontal text that does not set
|
|
625
|
+
* `headings.balancing.enabled` gets `true`, where today such a page is
|
|
626
|
+
* not balanced by default. (The levers it runs keep every character in
|
|
627
|
+
* its cell now, which 1.24's loose paragraphs did not.) A vertical one
|
|
628
|
+
* was not balanced then either, and any other configuration is returned
|
|
629
|
+
* as it is (the same object).
|
|
630
|
+
*/
|
|
631
|
+
export function pinLegacyGridBalancing(config) {
|
|
632
|
+
if (!isRecord(config.cjk) || !isRecord(config.cjk.grid) || config.cjk.grid.enabled !== true)
|
|
633
|
+
return config;
|
|
634
|
+
if (isRecord(config.layout) && config.layout.writingMode === 'vertical-rl')
|
|
635
|
+
return config;
|
|
636
|
+
const headings = isRecord(config.headings) ? config.headings : {};
|
|
637
|
+
const balancing = isRecord(headings.balancing) ? headings.balancing : {};
|
|
638
|
+
if (balancing.enabled !== undefined)
|
|
639
|
+
return config;
|
|
640
|
+
return { ...config, headings: { ...headings, balancing: { ...balancing, enabled: true } } };
|
|
641
|
+
}
|
|
642
|
+
/**
|
|
643
|
+
* A configuration written before #634 (postext 1.24 or earlier), pinned to
|
|
644
|
+
* the way 1.24 placed a table set `here`: `tableStyle.splitInline: false`,
|
|
645
|
+
* so an inline table that does not fit the room left in its column moves
|
|
646
|
+
* whole to the next one, where today it is cut between rows. The named
|
|
647
|
+
* table styles inherit it. A configuration that sets `splitInline` is
|
|
648
|
+
* returned as it is (the same object).
|
|
649
|
+
*/
|
|
650
|
+
export function pinLegacyInlineTableSplit(config) {
|
|
651
|
+
const tableStyle = isRecord(config.tableStyle) ? config.tableStyle : {};
|
|
652
|
+
if (tableStyle.splitInline !== undefined)
|
|
653
|
+
return config;
|
|
654
|
+
return { ...config, tableStyle: { ...tableStyle, splitInline: false } };
|
|
655
|
+
}
|
|
656
|
+
/**
|
|
657
|
+
* A configuration written before #634 (postext 1.24 or earlier), pinned to
|
|
658
|
+
* the way 1.24 read `:::columns`: `layout.flowColumns: false`, so a fence
|
|
659
|
+
* outside a box is ignored (its blocks run at the full measure) and a box
|
|
660
|
+
* that splits never cuts inside a group, where today the one sets its
|
|
661
|
+
* blocks in sub-columns and the other cuts between them. A configuration
|
|
662
|
+
* that sets `flowColumns` is returned as it is (the same object).
|
|
663
|
+
*/
|
|
664
|
+
export function pinLegacyFlowColumns(config) {
|
|
665
|
+
const layout = isRecord(config.layout) ? config.layout : {};
|
|
666
|
+
if (layout.flowColumns !== undefined)
|
|
667
|
+
return config;
|
|
668
|
+
return { ...config, layout: { ...layout, flowColumns: false } };
|
|
669
|
+
}
|
|
670
|
+
/**
|
|
671
|
+
* A configuration written before #639 (postext 1.24 or earlier), pinned to
|
|
672
|
+
* the slots 1.24 offered under a page-span opener:
|
|
673
|
+
* `layout.floatsUnderOpener: false`, so a float fenced or embedded right
|
|
674
|
+
* after an opener set over several text columns lands from the second
|
|
675
|
+
* column on, where today it takes the head of the opener's own column,
|
|
676
|
+
* under its band. A configuration that sets `floatsUnderOpener` is
|
|
677
|
+
* returned as it is (the same object).
|
|
678
|
+
*/
|
|
679
|
+
export function pinLegacyOpenerHeadFloats(config) {
|
|
680
|
+
const layout = isRecord(config.layout) ? config.layout : {};
|
|
681
|
+
if (layout.floatsUnderOpener !== undefined)
|
|
682
|
+
return config;
|
|
683
|
+
return { ...config, layout: { ...layout, floatsUnderOpener: false } };
|
|
684
|
+
}
|
|
685
|
+
/** Whether a configuration sets a page-span heading: a heading level or a
|
|
686
|
+
* heading style with `span: 'page'` (no level spans the page by
|
|
687
|
+
* default). */
|
|
688
|
+
function setsPageSpanHeading(config) {
|
|
689
|
+
const spans = (entries) => Array.isArray(entries) && entries.some((e) => isRecord(e) && e.span === 'page');
|
|
690
|
+
return (isRecord(config.headings) && spans(config.headings.levels)) || spans(config.headingStyles);
|
|
691
|
+
}
|
|
692
|
+
/** A `:::columns` opening fence on a line of its own. */
|
|
693
|
+
const COLUMNS_FENCE_LINE_RE = /^[^\S\n]*:::[^\S\n]*columns[^\S\n]*(?:\{[^}\n]*\})?[^\S\n]*$/m;
|
|
694
|
+
/** Whether markdown may hold a `:::columns` group. Unknown content
|
|
695
|
+
* (undefined) may. */
|
|
696
|
+
function mayHaveColumnGroups(content) {
|
|
697
|
+
if (content === undefined)
|
|
698
|
+
return true;
|
|
699
|
+
if (typeof content === 'string')
|
|
700
|
+
return COLUMNS_FENCE_LINE_RE.test(content);
|
|
701
|
+
return content.some((text) => COLUMNS_FENCE_LINE_RE.test(text));
|
|
702
|
+
}
|
|
576
703
|
/** Whether markdown holds a poem set line by line: a `:::verse` fence
|
|
577
704
|
* naming `layout=lines`, or naming no layout over lines with no
|
|
578
705
|
* hemistich separator, unless the configuration sets such poems as
|
|
@@ -1028,6 +1155,86 @@ function mayHaveMaths(content) {
|
|
|
1028
1155
|
return content.includes('$');
|
|
1029
1156
|
return content.some((text) => text.includes('$'));
|
|
1030
1157
|
}
|
|
1158
|
+
/** The `cjk` of a configuration, `{}` when it has none. */
|
|
1159
|
+
function cjkOf(config) {
|
|
1160
|
+
return isRecord(config.cjk) ? config.cjk : {};
|
|
1161
|
+
}
|
|
1162
|
+
/**
|
|
1163
|
+
* A configuration written before #637 (postext 1.24 or earlier), pinned to
|
|
1164
|
+
* the way 1.24 broke lines inside a book title: `cjk.titleMinChars: 1`, a
|
|
1165
|
+
* line breaking anywhere in a `《…》` or `〈…〉` title the level allows
|
|
1166
|
+
* (`《說|文》`), where today two characters of it stand on either side of a
|
|
1167
|
+
* break. A configuration that sets `titleMinChars` is returned as it is
|
|
1168
|
+
* (the same object).
|
|
1169
|
+
*/
|
|
1170
|
+
export function pinLegacyTitleBreaks(config) {
|
|
1171
|
+
const cjk = cjkOf(config);
|
|
1172
|
+
if (cjk.titleMinChars !== undefined)
|
|
1173
|
+
return config;
|
|
1174
|
+
return { ...config, cjk: { ...cjk, titleMinChars: 1 } };
|
|
1175
|
+
}
|
|
1176
|
+
/**
|
|
1177
|
+
* A configuration written before #637 (postext 1.24 or earlier), pinned to
|
|
1178
|
+
* the way 1.24 set the circled numbers ①–⑳ and their kin in CJK text:
|
|
1179
|
+
* `cjk.circledNumbers: 'western'`, as Western letters with the Han–Latin
|
|
1180
|
+
* space on both sides and a line free to end on one, where today they are
|
|
1181
|
+
* Chinese characters kept off a line end. A configuration that sets
|
|
1182
|
+
* `circledNumbers` is returned as it is (the same object).
|
|
1183
|
+
*/
|
|
1184
|
+
export function pinLegacyCircledNumbers(config) {
|
|
1185
|
+
const cjk = cjkOf(config);
|
|
1186
|
+
if (cjk.circledNumbers !== undefined)
|
|
1187
|
+
return config;
|
|
1188
|
+
return { ...config, cjk: { ...cjk, circledNumbers: 'western' } };
|
|
1189
|
+
}
|
|
1190
|
+
/**
|
|
1191
|
+
* A configuration written before #637 (postext 1.24 or earlier), pinned to
|
|
1192
|
+
* the way 1.24 set design text in Chinese or Japanese (openers, heading
|
|
1193
|
+
* designs, running heads, page designs): `cjk.composeDesignText: false`,
|
|
1194
|
+
* wrapped at spaces with every mark at the font's own advance, where
|
|
1195
|
+
* today it takes the body's CJK rules. A configuration that sets
|
|
1196
|
+
* `composeDesignText` is returned as it is (the same object).
|
|
1197
|
+
*/
|
|
1198
|
+
export function pinLegacyDesignText(config) {
|
|
1199
|
+
const cjk = cjkOf(config);
|
|
1200
|
+
if (cjk.composeDesignText !== undefined)
|
|
1201
|
+
return config;
|
|
1202
|
+
return { ...config, cjk: { ...cjk, composeDesignText: false } };
|
|
1203
|
+
}
|
|
1204
|
+
/** A book title in brackets (《》 〈〉), or a `:book[…]` title. */
|
|
1205
|
+
const BOOK_TITLE_RE = /[《〈︽︿]|:book\[/;
|
|
1206
|
+
/** A circled, parenthesized or full-stop number or letter (①, ⑴, ⒈, ⓐ, ❶,
|
|
1207
|
+
* ➀). */
|
|
1208
|
+
const CIRCLED_RE = /[\u2460-\u24FF\u2776-\u2793]/;
|
|
1209
|
+
/** Whether markdown may set a book title. Unknown content (undefined)
|
|
1210
|
+
* may. */
|
|
1211
|
+
function mayHaveBookTitles(content) {
|
|
1212
|
+
if (content === undefined)
|
|
1213
|
+
return true;
|
|
1214
|
+
if (typeof content === 'string')
|
|
1215
|
+
return BOOK_TITLE_RE.test(content);
|
|
1216
|
+
return content.some((text) => BOOK_TITLE_RE.test(text));
|
|
1217
|
+
}
|
|
1218
|
+
/** Whether markdown may set a circled number. Unknown content (undefined)
|
|
1219
|
+
* may. */
|
|
1220
|
+
function mayHaveCircledNumbers(content) {
|
|
1221
|
+
if (content === undefined)
|
|
1222
|
+
return true;
|
|
1223
|
+
if (typeof content === 'string')
|
|
1224
|
+
return CIRCLED_RE.test(content);
|
|
1225
|
+
return content.some((text) => CIRCLED_RE.test(text));
|
|
1226
|
+
}
|
|
1227
|
+
/** Whether a design text may hold CJK: the markdown it prints from (a
|
|
1228
|
+
* heading, an attribute, a running head) or the configuration's own text
|
|
1229
|
+
* (a literal in a design element, a label). Unknown content (undefined)
|
|
1230
|
+
* may. */
|
|
1231
|
+
function mayHaveCjkDesignText(content, config) {
|
|
1232
|
+
if (content === undefined)
|
|
1233
|
+
return true;
|
|
1234
|
+
if (typeof content === 'string' ? hasCJK(content) : content.some(hasCJK))
|
|
1235
|
+
return true;
|
|
1236
|
+
return hasCJK(JSON.stringify(config));
|
|
1237
|
+
}
|
|
1031
1238
|
/**
|
|
1032
1239
|
* A configuration stored under `configVersion` (see {@link CONFIG_VERSION}),
|
|
1033
1240
|
* in today's terms. One with no version (a number is expected; anything
|
|
@@ -1061,9 +1268,20 @@ function mayHaveMaths(content) {
|
|
|
1061
1268
|
* pinLegacyCodeBlocks}, unless `options.content` shows none; one older
|
|
1062
1269
|
* than 10 has its verse turnovers pinned by {@link
|
|
1063
1270
|
* pinLegacyVerseTightening}, unless `options.content` shows no poem set
|
|
1064
|
-
* line by line,
|
|
1065
|
-
* that set no `overflow` by {@link pinLegacyDesignOverflow}
|
|
1066
|
-
*
|
|
1271
|
+
* line by line, the text elements of its heading and part designs
|
|
1272
|
+
* that set no `overflow` by {@link pinLegacyDesignOverflow}; one older
|
|
1273
|
+
* than 11 has the balancing of a horizontal page on a character grid
|
|
1274
|
+
* pinned by {@link pinLegacyGridBalancing}, and its inline tables by {@link
|
|
1275
|
+
* pinLegacyInlineTableSplit}, unless `options.content` shows it embeds no
|
|
1276
|
+
* resource, its `:::columns` groups by {@link pinLegacyFlowColumns},
|
|
1277
|
+
* unless `options.content` shows none, its book titles by {@link pinLegacyTitleBreaks}, unless
|
|
1278
|
+
* `options.content` shows none, its circled numbers by {@link
|
|
1279
|
+
* pinLegacyCircledNumbers}, unless `options.content` shows none, and its
|
|
1280
|
+
* design text by {@link pinLegacyDesignText}, unless neither
|
|
1281
|
+
* `options.content` nor the configuration holds CJK text, and the slots
|
|
1282
|
+
* under its page-span openers by {@link pinLegacyOpenerHeadFloats}, when
|
|
1283
|
+
* it sets a heading level or style with `span: 'page'`, unless
|
|
1284
|
+
* `options.content` shows no heading. A current one is returned as it is (the same object).
|
|
1067
1285
|
* Migrate a stored configuration once and store it again under
|
|
1068
1286
|
* `CONFIG_VERSION`: the maths pin multiplies a scale, so a configuration
|
|
1069
1287
|
* read twice under its old number would grow twice.
|
|
@@ -1108,6 +1326,20 @@ export function migrateConfig(config, configVersion, options = {}) {
|
|
|
1108
1326
|
out = pinLegacyVerseTightening(out);
|
|
1109
1327
|
if (rules < DESIGN_OVERFLOW_RULES)
|
|
1110
1328
|
out = pinLegacyDesignOverflow(out);
|
|
1329
|
+
if (rules < GRID_BALANCING_RULES)
|
|
1330
|
+
out = pinLegacyGridBalancing(out);
|
|
1331
|
+
if (rules < TITLE_BREAK_RULES && mayHaveBookTitles(content))
|
|
1332
|
+
out = pinLegacyTitleBreaks(out);
|
|
1333
|
+
if (rules < CIRCLED_NUMBER_RULES && mayHaveCircledNumbers(content))
|
|
1334
|
+
out = pinLegacyCircledNumbers(out);
|
|
1335
|
+
if (rules < DESIGN_TEXT_RULES && mayHaveCjkDesignText(content, out))
|
|
1336
|
+
out = pinLegacyDesignText(out);
|
|
1337
|
+
if (rules < INLINE_TABLE_SPLIT_RULES && mayEmbedResources(content))
|
|
1338
|
+
out = pinLegacyInlineTableSplit(out);
|
|
1339
|
+
if (rules < FLOW_COLUMNS_RULES && mayHaveColumnGroups(content))
|
|
1340
|
+
out = pinLegacyFlowColumns(out);
|
|
1341
|
+
if (rules < OPENER_HEAD_FLOAT_RULES && setsPageSpanHeading(out) && mayHaveHeadings(content))
|
|
1342
|
+
out = pinLegacyOpenerHeadFloats(out);
|
|
1111
1343
|
return out;
|
|
1112
1344
|
}
|
|
1113
1345
|
/**
|
|
@@ -1124,9 +1356,14 @@ export function migrateConfig(config, configVersion, options = {}) {
|
|
|
1124
1356
|
* `:::paragraphs` containers on the `bodyText` in force (the ragged
|
|
1125
1357
|
* breaking when the merged configuration sets some running text ragged,
|
|
1126
1358
|
* the container space when it declares a paragraph style), the heading
|
|
1127
|
-
* marks and the split under a heading on the `headings` in force,
|
|
1359
|
+
* marks and the split under a heading on the `headings` in force, the
|
|
1128
1360
|
* drop caps and the overflow of heading and part design texts wherever
|
|
1129
|
-
* they sit in the merged configuration
|
|
1361
|
+
* they sit in the merged configuration, the balancing of a horizontal
|
|
1362
|
+
* character grid on the merged `cjk`, `layout` and `headings`, the
|
|
1363
|
+
* inline tables on the `tableStyle` in force, the `:::columns` groups and
|
|
1364
|
+
* the slots under a page-span opener on the `layout` in force (the slots
|
|
1365
|
+
* when the merged configuration sets a page-span heading), and the book
|
|
1366
|
+
* titles, the circled numbers and the design text on the `cjk` in force.
|
|
1130
1367
|
* @internal `readBundle`'s; hosts call {@link migrateConfig}.
|
|
1131
1368
|
*/
|
|
1132
1369
|
export function migrateBundleConfig(base, layers, configVersion, options = {}) {
|
|
@@ -1172,6 +1409,20 @@ export function migrateBundleConfig(base, layers, configVersion, options = {}) {
|
|
|
1172
1409
|
merged = pinLegacyVerseTightening(merged);
|
|
1173
1410
|
if (rules < DESIGN_OVERFLOW_RULES)
|
|
1174
1411
|
merged = pinLegacyDesignOverflow(merged);
|
|
1412
|
+
if (rules < GRID_BALANCING_RULES)
|
|
1413
|
+
merged = pinLegacyGridBalancing(merged);
|
|
1414
|
+
if (rules < TITLE_BREAK_RULES && mayHaveBookTitles(content))
|
|
1415
|
+
merged = pinLegacyTitleBreaks(merged);
|
|
1416
|
+
if (rules < CIRCLED_NUMBER_RULES && mayHaveCircledNumbers(content))
|
|
1417
|
+
merged = pinLegacyCircledNumbers(merged);
|
|
1418
|
+
if (rules < DESIGN_TEXT_RULES && mayHaveCjkDesignText(content, merged))
|
|
1419
|
+
merged = pinLegacyDesignText(merged);
|
|
1420
|
+
if (rules < INLINE_TABLE_SPLIT_RULES && mayEmbedResources(content))
|
|
1421
|
+
merged = pinLegacyInlineTableSplit(merged);
|
|
1422
|
+
if (rules < FLOW_COLUMNS_RULES && mayHaveColumnGroups(content))
|
|
1423
|
+
merged = pinLegacyFlowColumns(merged);
|
|
1424
|
+
if (rules < OPENER_HEAD_FLOAT_RULES && setsPageSpanHeading(merged) && mayHaveHeadings(content))
|
|
1425
|
+
merged = pinLegacyOpenerHeadFloats(merged);
|
|
1175
1426
|
return merged;
|
|
1176
1427
|
}
|
|
1177
1428
|
//# sourceMappingURL=configVersion.js.map
|