postext 1.4.2 → 1.5.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 +76 -202
- package/dist/__tests__/breakOpportunities.test.d.ts +2 -0
- package/dist/__tests__/breakOpportunities.test.d.ts.map +1 -0
- package/dist/__tests__/breakOpportunities.test.js +204 -0
- package/dist/__tests__/breakOpportunities.test.js.map +1 -0
- package/dist/__tests__/bundle.test.js +405 -1
- package/dist/__tests__/bundle.test.js.map +1 -1
- package/dist/__tests__/bundleLocaleAndBytes.test.d.ts +2 -0
- package/dist/__tests__/bundleLocaleAndBytes.test.d.ts.map +1 -0
- package/dist/__tests__/bundleLocaleAndBytes.test.js +177 -0
- package/dist/__tests__/bundleLocaleAndBytes.test.js.map +1 -0
- package/dist/__tests__/colorAlpha.test.d.ts +2 -0
- package/dist/__tests__/colorAlpha.test.d.ts.map +1 -0
- package/dist/__tests__/colorAlpha.test.js +87 -0
- package/dist/__tests__/colorAlpha.test.js.map +1 -0
- package/dist/__tests__/columnBalancing.test.js +88 -0
- package/dist/__tests__/columnBalancing.test.js.map +1 -1
- package/dist/__tests__/columnClip.test.js +20 -0
- package/dist/__tests__/columnClip.test.js.map +1 -1
- package/dist/__tests__/columnRuleBands.test.d.ts +2 -0
- package/dist/__tests__/columnRuleBands.test.d.ts.map +1 -0
- package/dist/__tests__/columnRuleBands.test.js +146 -0
- package/dist/__tests__/columnRuleBands.test.js.map +1 -0
- package/dist/__tests__/contentWarnings.test.d.ts +2 -0
- package/dist/__tests__/contentWarnings.test.d.ts.map +1 -0
- package/dist/__tests__/contentWarnings.test.js +226 -0
- package/dist/__tests__/contentWarnings.test.js.map +1 -0
- package/dist/__tests__/continuation.test.js +2 -1
- package/dist/__tests__/continuation.test.js.map +1 -1
- package/dist/__tests__/createLayout.test.js +18 -1
- package/dist/__tests__/createLayout.test.js.map +1 -1
- package/dist/__tests__/cropMarks.test.d.ts +2 -0
- package/dist/__tests__/cropMarks.test.d.ts.map +1 -0
- package/dist/__tests__/cropMarks.test.js +138 -0
- package/dist/__tests__/cropMarks.test.js.map +1 -0
- package/dist/__tests__/defaults/calloutStyles.test.js +30 -0
- package/dist/__tests__/defaults/calloutStyles.test.js.map +1 -1
- package/dist/__tests__/defaults/headingsBreakBefore.test.d.ts +2 -0
- package/dist/__tests__/defaults/headingsBreakBefore.test.d.ts.map +1 -0
- package/dist/__tests__/defaults/headingsBreakBefore.test.js +78 -0
- package/dist/__tests__/defaults/headingsBreakBefore.test.js.map +1 -0
- package/dist/__tests__/defaults/paragraphStyles.test.js +22 -0
- package/dist/__tests__/defaults/paragraphStyles.test.js.map +1 -1
- package/dist/__tests__/design/bleedClip.test.d.ts +2 -0
- package/dist/__tests__/design/bleedClip.test.d.ts.map +1 -0
- package/dist/__tests__/design/bleedClip.test.js +91 -0
- package/dist/__tests__/design/bleedClip.test.js.map +1 -0
- package/dist/__tests__/design/boxBorderInside.test.d.ts +2 -0
- package/dist/__tests__/design/boxBorderInside.test.d.ts.map +1 -0
- package/dist/__tests__/design/boxBorderInside.test.js +102 -0
- package/dist/__tests__/design/boxBorderInside.test.js.map +1 -0
- package/dist/__tests__/design/designLineHeight.test.d.ts +2 -0
- package/dist/__tests__/design/designLineHeight.test.d.ts.map +1 -0
- package/dist/__tests__/design/designLineHeight.test.js +108 -0
- package/dist/__tests__/design/designLineHeight.test.js.map +1 -0
- package/dist/__tests__/design/designText.test.d.ts +2 -0
- package/dist/__tests__/design/designText.test.d.ts.map +1 -0
- package/dist/__tests__/design/designText.test.js +331 -0
- package/dist/__tests__/design/designText.test.js.map +1 -0
- package/dist/__tests__/design/designTextJustify.test.d.ts +2 -0
- package/dist/__tests__/design/designTextJustify.test.d.ts.map +1 -0
- package/dist/__tests__/design/designTextJustify.test.js +119 -0
- package/dist/__tests__/design/designTextJustify.test.js.map +1 -0
- package/dist/__tests__/design/designTextNegativeTracking.test.d.ts +2 -0
- package/dist/__tests__/design/designTextNegativeTracking.test.d.ts.map +1 -0
- package/dist/__tests__/design/designTextNegativeTracking.test.js +95 -0
- package/dist/__tests__/design/designTextNegativeTracking.test.js.map +1 -0
- package/dist/__tests__/design/designTextRender.test.d.ts +2 -0
- package/dist/__tests__/design/designTextRender.test.d.ts.map +1 -0
- package/dist/__tests__/design/designTextRender.test.js +106 -0
- package/dist/__tests__/design/designTextRender.test.js.map +1 -0
- package/dist/__tests__/design/dropCap.test.d.ts +2 -0
- package/dist/__tests__/design/dropCap.test.d.ts.map +1 -0
- package/dist/__tests__/design/dropCap.test.js +205 -0
- package/dist/__tests__/design/dropCap.test.js.map +1 -0
- package/dist/__tests__/design/ellipsis.test.d.ts +2 -0
- package/dist/__tests__/design/ellipsis.test.d.ts.map +1 -0
- package/dist/__tests__/design/ellipsis.test.js +113 -0
- package/dist/__tests__/design/ellipsis.test.js.map +1 -0
- package/dist/__tests__/design/headingDesignClip.test.d.ts +2 -0
- package/dist/__tests__/design/headingDesignClip.test.d.ts.map +1 -0
- package/dist/__tests__/design/headingDesignClip.test.js +60 -0
- package/dist/__tests__/design/headingDesignClip.test.js.map +1 -0
- package/dist/__tests__/design/headingDesignSideChannel.test.d.ts +2 -0
- package/dist/__tests__/design/headingDesignSideChannel.test.d.ts.map +1 -0
- package/dist/__tests__/design/headingDesignSideChannel.test.js +187 -0
- package/dist/__tests__/design/headingDesignSideChannel.test.js.map +1 -0
- package/dist/__tests__/design/inColumnTitleBreak.test.d.ts +2 -0
- package/dist/__tests__/design/inColumnTitleBreak.test.d.ts.map +1 -0
- package/dist/__tests__/design/inColumnTitleBreak.test.js +60 -0
- package/dist/__tests__/design/inColumnTitleBreak.test.js.map +1 -0
- package/dist/__tests__/design/openerBottomAnchor.test.d.ts +2 -0
- package/dist/__tests__/design/openerBottomAnchor.test.d.ts.map +1 -0
- package/dist/__tests__/design/openerBottomAnchor.test.js +106 -0
- package/dist/__tests__/design/openerBottomAnchor.test.js.map +1 -0
- package/dist/__tests__/design/openerChapterNumber.test.d.ts +2 -0
- package/dist/__tests__/design/openerChapterNumber.test.d.ts.map +1 -0
- package/dist/__tests__/design/openerChapterNumber.test.js +163 -0
- package/dist/__tests__/design/openerChapterNumber.test.js.map +1 -0
- package/dist/__tests__/design/openerImageReserve.test.d.ts +2 -0
- package/dist/__tests__/design/openerImageReserve.test.d.ts.map +1 -0
- package/dist/__tests__/design/openerImageReserve.test.js +83 -0
- package/dist/__tests__/design/openerImageReserve.test.js.map +1 -0
- package/dist/__tests__/design/openerReserve.test.d.ts +2 -0
- package/dist/__tests__/design/openerReserve.test.d.ts.map +1 -0
- package/dist/__tests__/design/openerReserve.test.js +147 -0
- package/dist/__tests__/design/openerReserve.test.js.map +1 -0
- package/dist/__tests__/design/ruleDefaults.test.d.ts +2 -0
- package/dist/__tests__/design/ruleDefaults.test.d.ts.map +1 -0
- package/dist/__tests__/design/ruleDefaults.test.js +59 -0
- package/dist/__tests__/design/ruleDefaults.test.js.map +1 -0
- package/dist/__tests__/design/runningHeads.test.js +4 -2
- package/dist/__tests__/design/runningHeads.test.js.map +1 -1
- package/dist/__tests__/design/titleTextWrapped.test.d.ts +2 -0
- package/dist/__tests__/design/titleTextWrapped.test.d.ts.map +1 -0
- package/dist/__tests__/design/titleTextWrapped.test.js +258 -0
- package/dist/__tests__/design/titleTextWrapped.test.js.map +1 -0
- package/dist/__tests__/design/trackingAlignment.test.d.ts +2 -0
- package/dist/__tests__/design/trackingAlignment.test.d.ts.map +1 -0
- package/dist/__tests__/design/trackingAlignment.test.js +101 -0
- package/dist/__tests__/design/trackingAlignment.test.js.map +1 -0
- package/dist/__tests__/design/verticalAlignOverflow.test.d.ts +2 -0
- package/dist/__tests__/design/verticalAlignOverflow.test.d.ts.map +1 -0
- package/dist/__tests__/design/verticalAlignOverflow.test.js +68 -0
- package/dist/__tests__/design/verticalAlignOverflow.test.js.map +1 -0
- package/dist/__tests__/exports.test.js +24 -0
- package/dist/__tests__/exports.test.js.map +1 -1
- package/dist/__tests__/fontStack.test.d.ts +2 -0
- package/dist/__tests__/fontStack.test.d.ts.map +1 -0
- package/dist/__tests__/fontStack.test.js +100 -0
- package/dist/__tests__/fontStack.test.js.map +1 -0
- package/dist/__tests__/frontmatterValues.test.d.ts +2 -0
- package/dist/__tests__/frontmatterValues.test.d.ts.map +1 -0
- package/dist/__tests__/frontmatterValues.test.js +119 -0
- package/dist/__tests__/frontmatterValues.test.js.map +1 -0
- package/dist/__tests__/gradedRunt.test.d.ts +2 -0
- package/dist/__tests__/gradedRunt.test.d.ts.map +1 -0
- package/dist/__tests__/gradedRunt.test.js +66 -0
- package/dist/__tests__/gradedRunt.test.js.map +1 -0
- package/dist/__tests__/headingAlign.test.d.ts +2 -0
- package/dist/__tests__/headingAlign.test.d.ts.map +1 -0
- package/dist/__tests__/headingAlign.test.js +92 -0
- package/dist/__tests__/headingAlign.test.js.map +1 -0
- package/dist/__tests__/headingInlineMarks.test.d.ts +2 -0
- package/dist/__tests__/headingInlineMarks.test.d.ts.map +1 -0
- package/dist/__tests__/headingInlineMarks.test.js +126 -0
- package/dist/__tests__/headingInlineMarks.test.js.map +1 -0
- package/dist/__tests__/headingLetterSpacing.test.d.ts +2 -0
- package/dist/__tests__/headingLetterSpacing.test.d.ts.map +1 -0
- package/dist/__tests__/headingLetterSpacing.test.js +135 -0
- package/dist/__tests__/headingLetterSpacing.test.js.map +1 -0
- package/dist/__tests__/headingNumberPlaceholders.test.d.ts +2 -0
- package/dist/__tests__/headingNumberPlaceholders.test.d.ts.map +1 -0
- package/dist/__tests__/headingNumberPlaceholders.test.js +104 -0
- package/dist/__tests__/headingNumberPlaceholders.test.js.map +1 -0
- package/dist/__tests__/headingNumberingStyles.test.d.ts +2 -0
- package/dist/__tests__/headingNumberingStyles.test.d.ts.map +1 -0
- package/dist/__tests__/headingNumberingStyles.test.js +151 -0
- package/dist/__tests__/headingNumberingStyles.test.js.map +1 -0
- package/dist/__tests__/headingSourceTitle.test.d.ts +2 -0
- package/dist/__tests__/headingSourceTitle.test.d.ts.map +1 -0
- package/dist/__tests__/headingSourceTitle.test.js +35 -0
- package/dist/__tests__/headingSourceTitle.test.js.map +1 -0
- package/dist/__tests__/headingStyleBreakAfterPagebreak.test.d.ts +2 -0
- package/dist/__tests__/headingStyleBreakAfterPagebreak.test.d.ts.map +1 -0
- package/dist/__tests__/headingStyleBreakAfterPagebreak.test.js +52 -0
- package/dist/__tests__/headingStyleBreakAfterPagebreak.test.js.map +1 -0
- package/dist/__tests__/hiddenHeadings.test.d.ts +2 -0
- package/dist/__tests__/hiddenHeadings.test.d.ts.map +1 -0
- package/dist/__tests__/hiddenHeadings.test.js +137 -0
- package/dist/__tests__/hiddenHeadings.test.js.map +1 -0
- package/dist/__tests__/htmlHostReset.test.d.ts +2 -0
- package/dist/__tests__/htmlHostReset.test.d.ts.map +1 -0
- package/dist/__tests__/htmlHostReset.test.js +63 -0
- package/dist/__tests__/htmlHostReset.test.js.map +1 -0
- package/dist/__tests__/hyphenationLocale.test.d.ts +2 -0
- package/dist/__tests__/hyphenationLocale.test.d.ts.map +1 -0
- package/dist/__tests__/hyphenationLocale.test.js +143 -0
- package/dist/__tests__/hyphenationLocale.test.js.map +1 -0
- package/dist/__tests__/justifyTracking.test.d.ts +2 -0
- package/dist/__tests__/justifyTracking.test.d.ts.map +1 -0
- package/dist/__tests__/justifyTracking.test.js +217 -0
- package/dist/__tests__/justifyTracking.test.js.map +1 -0
- package/dist/__tests__/layoutWorkerClient.test.d.ts +2 -0
- package/dist/__tests__/layoutWorkerClient.test.d.ts.map +1 -0
- package/dist/__tests__/layoutWorkerClient.test.js +140 -0
- package/dist/__tests__/layoutWorkerClient.test.js.map +1 -0
- package/dist/__tests__/links.test.d.ts +2 -0
- package/dist/__tests__/links.test.d.ts.map +1 -0
- package/dist/__tests__/links.test.js +227 -0
- package/dist/__tests__/links.test.js.map +1 -0
- package/dist/__tests__/localisedStrings.test.d.ts +2 -0
- package/dist/__tests__/localisedStrings.test.d.ts.map +1 -0
- package/dist/__tests__/localisedStrings.test.js +118 -0
- package/dist/__tests__/localisedStrings.test.js.map +1 -0
- package/dist/__tests__/looseLines.test.d.ts +2 -0
- package/dist/__tests__/looseLines.test.d.ts.map +1 -0
- package/dist/__tests__/looseLines.test.js +72 -0
- package/dist/__tests__/looseLines.test.js.map +1 -0
- package/dist/__tests__/mainEntryReact.test.d.ts +2 -0
- package/dist/__tests__/mainEntryReact.test.d.ts.map +1 -0
- package/dist/__tests__/mainEntryReact.test.js +13 -0
- package/dist/__tests__/mainEntryReact.test.js.map +1 -0
- package/dist/__tests__/mathBundle.test.d.ts +2 -0
- package/dist/__tests__/mathBundle.test.d.ts.map +1 -0
- package/dist/__tests__/mathBundle.test.js +80 -0
- package/dist/__tests__/mathBundle.test.js.map +1 -0
- package/dist/__tests__/mathEngine.test.d.ts +2 -0
- package/dist/__tests__/mathEngine.test.d.ts.map +1 -0
- package/dist/__tests__/mathEngine.test.js +69 -0
- package/dist/__tests__/mathEngine.test.js.map +1 -0
- package/dist/__tests__/mathEngineInit.test.d.ts +2 -0
- package/dist/__tests__/mathEngineInit.test.d.ts.map +1 -0
- package/dist/__tests__/mathEngineInit.test.js +33 -0
- package/dist/__tests__/mathEngineInit.test.js.map +1 -0
- package/dist/__tests__/mathSize.test.d.ts +2 -0
- package/dist/__tests__/mathSize.test.d.ts.map +1 -0
- package/dist/__tests__/mathSize.test.js +168 -0
- package/dist/__tests__/mathSize.test.js.map +1 -0
- package/dist/__tests__/mathSizeMigration.test.d.ts +2 -0
- package/dist/__tests__/mathSizeMigration.test.d.ts.map +1 -0
- package/dist/__tests__/mathSizeMigration.test.js +188 -0
- package/dist/__tests__/mathSizeMigration.test.js.map +1 -0
- package/dist/__tests__/measureCache.test.js +148 -4
- package/dist/__tests__/measureCache.test.js.map +1 -1
- package/dist/__tests__/measureCacheKeepBreaks.test.d.ts +2 -0
- package/dist/__tests__/measureCacheKeepBreaks.test.d.ts.map +1 -0
- package/dist/__tests__/measureCacheKeepBreaks.test.js +59 -0
- package/dist/__tests__/measureCacheKeepBreaks.test.js.map +1 -0
- package/dist/__tests__/noBreakSpaces.test.d.ts +2 -0
- package/dist/__tests__/noBreakSpaces.test.d.ts.map +1 -0
- package/dist/__tests__/noBreakSpaces.test.js +208 -0
- package/dist/__tests__/noBreakSpaces.test.js.map +1 -0
- package/dist/__tests__/numberFormats.test.d.ts +2 -0
- package/dist/__tests__/numberFormats.test.d.ts.map +1 -0
- package/dist/__tests__/numberFormats.test.js +142 -0
- package/dist/__tests__/numberFormats.test.js.map +1 -0
- package/dist/__tests__/paletteEverywhere.test.d.ts +2 -0
- package/dist/__tests__/paletteEverywhere.test.d.ts.map +1 -0
- package/dist/__tests__/paletteEverywhere.test.js +228 -0
- package/dist/__tests__/paletteEverywhere.test.js.map +1 -0
- package/dist/__tests__/paragraphStyleIndent.test.d.ts +2 -0
- package/dist/__tests__/paragraphStyleIndent.test.d.ts.map +1 -0
- package/dist/__tests__/paragraphStyleIndent.test.js +91 -0
- package/dist/__tests__/paragraphStyleIndent.test.js.map +1 -0
- package/dist/__tests__/parse/attrQuoting.test.d.ts +2 -0
- package/dist/__tests__/parse/attrQuoting.test.d.ts.map +1 -0
- package/dist/__tests__/parse/attrQuoting.test.js +87 -0
- package/dist/__tests__/parse/attrQuoting.test.js.map +1 -0
- package/dist/__tests__/parse/codeSpans.test.d.ts +2 -0
- package/dist/__tests__/parse/codeSpans.test.d.ts.map +1 -0
- package/dist/__tests__/parse/codeSpans.test.js +31 -0
- package/dist/__tests__/parse/codeSpans.test.js.map +1 -0
- package/dist/__tests__/parse/intrawordUnderscore.test.d.ts +2 -0
- package/dist/__tests__/parse/intrawordUnderscore.test.d.ts.map +1 -0
- package/dist/__tests__/parse/intrawordUnderscore.test.js +69 -0
- package/dist/__tests__/parse/intrawordUnderscore.test.js.map +1 -0
- package/dist/__tests__/parse/scripts.test.js +4 -1
- package/dist/__tests__/parse/scripts.test.js.map +1 -1
- package/dist/__tests__/parts.test.js +103 -0
- package/dist/__tests__/parts.test.js.map +1 -1
- package/dist/__tests__/pipeline/balancingRecord.test.d.ts +2 -0
- package/dist/__tests__/pipeline/balancingRecord.test.d.ts.map +1 -0
- package/dist/__tests__/pipeline/balancingRecord.test.js +176 -0
- package/dist/__tests__/pipeline/balancingRecord.test.js.map +1 -0
- package/dist/__tests__/pipeline/blockquoteStyle.test.d.ts +2 -0
- package/dist/__tests__/pipeline/blockquoteStyle.test.d.ts.map +1 -0
- package/dist/__tests__/pipeline/blockquoteStyle.test.js +99 -0
- package/dist/__tests__/pipeline/blockquoteStyle.test.js.map +1 -0
- package/dist/__tests__/pipeline/calloutContinuation.test.d.ts +2 -0
- package/dist/__tests__/pipeline/calloutContinuation.test.d.ts.map +1 -0
- package/dist/__tests__/pipeline/calloutContinuation.test.js +133 -0
- package/dist/__tests__/pipeline/calloutContinuation.test.js.map +1 -0
- package/dist/__tests__/pipeline/calloutContinuationInset.test.d.ts +2 -0
- package/dist/__tests__/pipeline/calloutContinuationInset.test.d.ts.map +1 -0
- package/dist/__tests__/pipeline/calloutContinuationInset.test.js +116 -0
- package/dist/__tests__/pipeline/calloutContinuationInset.test.js.map +1 -0
- package/dist/__tests__/pipeline/calloutCornerWideIcon.test.d.ts +2 -0
- package/dist/__tests__/pipeline/calloutCornerWideIcon.test.d.ts.map +1 -0
- package/dist/__tests__/pipeline/calloutCornerWideIcon.test.js +69 -0
- package/dist/__tests__/pipeline/calloutCornerWideIcon.test.js.map +1 -0
- package/dist/__tests__/pipeline/calloutFloatMargins.test.d.ts +2 -0
- package/dist/__tests__/pipeline/calloutFloatMargins.test.d.ts.map +1 -0
- package/dist/__tests__/pipeline/calloutFloatMargins.test.js +104 -0
- package/dist/__tests__/pipeline/calloutFloatMargins.test.js.map +1 -0
- package/dist/__tests__/pipeline/calloutInlineResourceGap.test.d.ts +2 -0
- package/dist/__tests__/pipeline/calloutInlineResourceGap.test.d.ts.map +1 -0
- package/dist/__tests__/pipeline/calloutInlineResourceGap.test.js +148 -0
- package/dist/__tests__/pipeline/calloutInlineResourceGap.test.js.map +1 -0
- package/dist/__tests__/pipeline/calloutListColor.test.d.ts +2 -0
- package/dist/__tests__/pipeline/calloutListColor.test.d.ts.map +1 -0
- package/dist/__tests__/pipeline/calloutListColor.test.js +86 -0
- package/dist/__tests__/pipeline/calloutListColor.test.js.map +1 -0
- package/dist/__tests__/pipeline/calloutRaggedLines.test.d.ts +2 -0
- package/dist/__tests__/pipeline/calloutRaggedLines.test.d.ts.map +1 -0
- package/dist/__tests__/pipeline/calloutRaggedLines.test.js +65 -0
- package/dist/__tests__/pipeline/calloutRaggedLines.test.js.map +1 -0
- package/dist/__tests__/pipeline/calloutRuntTracking.test.d.ts +2 -0
- package/dist/__tests__/pipeline/calloutRuntTracking.test.d.ts.map +1 -0
- package/dist/__tests__/pipeline/calloutRuntTracking.test.js +84 -0
- package/dist/__tests__/pipeline/calloutRuntTracking.test.js.map +1 -0
- package/dist/__tests__/pipeline/calloutSplitMinLinesChild.test.d.ts +2 -0
- package/dist/__tests__/pipeline/calloutSplitMinLinesChild.test.d.ts.map +1 -0
- package/dist/__tests__/pipeline/calloutSplitMinLinesChild.test.js +187 -0
- package/dist/__tests__/pipeline/calloutSplitMinLinesChild.test.js.map +1 -0
- package/dist/__tests__/pipeline/calloutStripeRadius.test.d.ts +2 -0
- package/dist/__tests__/pipeline/calloutStripeRadius.test.d.ts.map +1 -0
- package/dist/__tests__/pipeline/calloutStripeRadius.test.js +127 -0
- package/dist/__tests__/pipeline/calloutStripeRadius.test.js.map +1 -0
- package/dist/__tests__/pipeline/calloutTitleLineHeight.test.d.ts +2 -0
- package/dist/__tests__/pipeline/calloutTitleLineHeight.test.d.ts.map +1 -0
- package/dist/__tests__/pipeline/calloutTitleLineHeight.test.js +81 -0
- package/dist/__tests__/pipeline/calloutTitleLineHeight.test.js.map +1 -0
- package/dist/__tests__/pipeline/calloutTypography.test.d.ts +2 -0
- package/dist/__tests__/pipeline/calloutTypography.test.d.ts.map +1 -0
- package/dist/__tests__/pipeline/calloutTypography.test.js +97 -0
- package/dist/__tests__/pipeline/calloutTypography.test.js.map +1 -0
- package/dist/__tests__/pipeline/capUnderHeadFloats.test.d.ts +2 -0
- package/dist/__tests__/pipeline/capUnderHeadFloats.test.d.ts.map +1 -0
- package/dist/__tests__/pipeline/capUnderHeadFloats.test.js +68 -0
- package/dist/__tests__/pipeline/capUnderHeadFloats.test.js.map +1 -0
- package/dist/__tests__/pipeline/captionAlign.test.d.ts +2 -0
- package/dist/__tests__/pipeline/captionAlign.test.d.ts.map +1 -0
- package/dist/__tests__/pipeline/captionAlign.test.js +99 -0
- package/dist/__tests__/pipeline/captionAlign.test.js.map +1 -0
- package/dist/__tests__/pipeline/chipPalette.test.d.ts +2 -0
- package/dist/__tests__/pipeline/chipPalette.test.d.ts.map +1 -0
- package/dist/__tests__/pipeline/chipPalette.test.js +80 -0
- package/dist/__tests__/pipeline/chipPalette.test.js.map +1 -0
- package/dist/__tests__/pipeline/chipVerticalPadding.test.d.ts +2 -0
- package/dist/__tests__/pipeline/chipVerticalPadding.test.d.ts.map +1 -0
- package/dist/__tests__/pipeline/chipVerticalPadding.test.js +66 -0
- package/dist/__tests__/pipeline/chipVerticalPadding.test.js.map +1 -0
- package/dist/__tests__/pipeline/chips.test.js +32 -0
- package/dist/__tests__/pipeline/chips.test.js.map +1 -1
- package/dist/__tests__/pipeline/closingBoxLever.test.d.ts +2 -0
- package/dist/__tests__/pipeline/closingBoxLever.test.d.ts.map +1 -0
- package/dist/__tests__/pipeline/closingBoxLever.test.js +68 -0
- package/dist/__tests__/pipeline/closingBoxLever.test.js.map +1 -0
- package/dist/__tests__/pipeline/closingBoxOrder.test.d.ts +2 -0
- package/dist/__tests__/pipeline/closingBoxOrder.test.d.ts.map +1 -0
- package/dist/__tests__/pipeline/closingBoxOrder.test.js +87 -0
- package/dist/__tests__/pipeline/closingBoxOrder.test.js.map +1 -0
- package/dist/__tests__/pipeline/closingPageAfterFloat.test.d.ts +2 -0
- package/dist/__tests__/pipeline/closingPageAfterFloat.test.d.ts.map +1 -0
- package/dist/__tests__/pipeline/closingPageAfterFloat.test.js +159 -0
- package/dist/__tests__/pipeline/closingPageAfterFloat.test.js.map +1 -0
- package/dist/__tests__/pipeline/closingPageAfterFloatPage.test.d.ts +2 -0
- package/dist/__tests__/pipeline/closingPageAfterFloatPage.test.d.ts.map +1 -0
- package/dist/__tests__/pipeline/closingPageAfterFloatPage.test.js +90 -0
- package/dist/__tests__/pipeline/closingPageAfterFloatPage.test.js.map +1 -0
- package/dist/__tests__/pipeline/colonBalancing.test.js +19 -15
- package/dist/__tests__/pipeline/colonBalancing.test.js.map +1 -1
- package/dist/__tests__/pipeline/colonListRoom.test.d.ts +2 -0
- package/dist/__tests__/pipeline/colonListRoom.test.d.ts.map +1 -0
- package/dist/__tests__/pipeline/colonListRoom.test.js +127 -0
- package/dist/__tests__/pipeline/colonListRoom.test.js.map +1 -0
- package/dist/__tests__/pipeline/columnWidthRebreak.test.d.ts +2 -0
- package/dist/__tests__/pipeline/columnWidthRebreak.test.d.ts.map +1 -0
- package/dist/__tests__/pipeline/columnWidthRebreak.test.js +124 -0
- package/dist/__tests__/pipeline/columnWidthRebreak.test.js.map +1 -0
- package/dist/__tests__/pipeline/compoundBreaks.test.d.ts +2 -0
- package/dist/__tests__/pipeline/compoundBreaks.test.d.ts.map +1 -0
- package/dist/__tests__/pipeline/compoundBreaks.test.js +368 -0
- package/dist/__tests__/pipeline/compoundBreaks.test.js.map +1 -0
- package/dist/__tests__/pipeline/continuationUnderFloat.test.d.ts +2 -0
- package/dist/__tests__/pipeline/continuationUnderFloat.test.d.ts.map +1 -0
- package/dist/__tests__/pipeline/continuationUnderFloat.test.js +64 -0
- package/dist/__tests__/pipeline/continuationUnderFloat.test.js.map +1 -0
- package/dist/__tests__/pipeline/crossChapterRef.test.d.ts +2 -0
- package/dist/__tests__/pipeline/crossChapterRef.test.d.ts.map +1 -0
- package/dist/__tests__/pipeline/crossChapterRef.test.js +124 -0
- package/dist/__tests__/pipeline/crossChapterRef.test.js.map +1 -0
- package/dist/__tests__/pipeline/dashBreaks.test.d.ts +2 -0
- package/dist/__tests__/pipeline/dashBreaks.test.d.ts.map +1 -0
- package/dist/__tests__/pipeline/dashBreaks.test.js +358 -0
- package/dist/__tests__/pipeline/dashBreaks.test.js.map +1 -0
- package/dist/__tests__/pipeline/defaultOpenerPaint.test.d.ts +2 -0
- package/dist/__tests__/pipeline/defaultOpenerPaint.test.d.ts.map +1 -0
- package/dist/__tests__/pipeline/defaultOpenerPaint.test.js +128 -0
- package/dist/__tests__/pipeline/defaultOpenerPaint.test.js.map +1 -0
- package/dist/__tests__/pipeline/displayMathFlow.test.d.ts +2 -0
- package/dist/__tests__/pipeline/displayMathFlow.test.d.ts.map +1 -0
- package/dist/__tests__/pipeline/displayMathFlow.test.js +156 -0
- package/dist/__tests__/pipeline/displayMathFlow.test.js.map +1 -0
- package/dist/__tests__/pipeline/emptyResourceTemplate.test.d.ts +2 -0
- package/dist/__tests__/pipeline/emptyResourceTemplate.test.d.ts.map +1 -0
- package/dist/__tests__/pipeline/emptyResourceTemplate.test.js +66 -0
- package/dist/__tests__/pipeline/emptyResourceTemplate.test.js.map +1 -0
- package/dist/__tests__/pipeline/figureBodyAlign.test.d.ts +2 -0
- package/dist/__tests__/pipeline/figureBodyAlign.test.d.ts.map +1 -0
- package/dist/__tests__/pipeline/figureBodyAlign.test.js +92 -0
- package/dist/__tests__/pipeline/figureBodyAlign.test.js.map +1 -0
- package/dist/__tests__/pipeline/floatAfterCitingLine.test.d.ts +2 -0
- package/dist/__tests__/pipeline/floatAfterCitingLine.test.d.ts.map +1 -0
- package/dist/__tests__/pipeline/floatAfterCitingLine.test.js +217 -0
- package/dist/__tests__/pipeline/floatAfterCitingLine.test.js.map +1 -0
- package/dist/__tests__/pipeline/floatFirstSlot.test.js +15 -0
- package/dist/__tests__/pipeline/floatFirstSlot.test.js.map +1 -1
- package/dist/__tests__/pipeline/floatOverInlineResource.test.d.ts +2 -0
- package/dist/__tests__/pipeline/floatOverInlineResource.test.d.ts.map +1 -0
- package/dist/__tests__/pipeline/floatOverInlineResource.test.js +75 -0
- package/dist/__tests__/pipeline/floatOverInlineResource.test.js.map +1 -0
- package/dist/__tests__/pipeline/floatPlacementRules.test.d.ts +2 -0
- package/dist/__tests__/pipeline/floatPlacementRules.test.d.ts.map +1 -0
- package/dist/__tests__/pipeline/floatPlacementRules.test.js +177 -0
- package/dist/__tests__/pipeline/floatPlacementRules.test.js.map +1 -0
- package/dist/__tests__/pipeline/floatSlots.test.js +35 -1
- package/dist/__tests__/pipeline/floatSlots.test.js.map +1 -1
- package/dist/__tests__/pipeline/hardHyphenBreaks.test.d.ts +2 -0
- package/dist/__tests__/pipeline/hardHyphenBreaks.test.d.ts.map +1 -0
- package/dist/__tests__/pipeline/hardHyphenBreaks.test.js +165 -0
- package/dist/__tests__/pipeline/hardHyphenBreaks.test.js.map +1 -0
- package/dist/__tests__/pipeline/headingDesignCuts.test.d.ts +2 -0
- package/dist/__tests__/pipeline/headingDesignCuts.test.d.ts.map +1 -0
- package/dist/__tests__/pipeline/headingDesignCuts.test.js +96 -0
- package/dist/__tests__/pipeline/headingDesignCuts.test.js.map +1 -0
- package/dist/__tests__/pipeline/headingSnapPerLevel.test.d.ts +2 -0
- package/dist/__tests__/pipeline/headingSnapPerLevel.test.d.ts.map +1 -0
- package/dist/__tests__/pipeline/headingSnapPerLevel.test.js +97 -0
- package/dist/__tests__/pipeline/headingSnapPerLevel.test.js.map +1 -0
- package/dist/__tests__/pipeline/headingSplitOrphans.test.d.ts +2 -0
- package/dist/__tests__/pipeline/headingSplitOrphans.test.d.ts.map +1 -0
- package/dist/__tests__/pipeline/headingSplitOrphans.test.js +134 -0
- package/dist/__tests__/pipeline/headingSplitOrphans.test.js.map +1 -0
- package/dist/__tests__/pipeline/hyphenAcrossColumns.test.d.ts +2 -0
- package/dist/__tests__/pipeline/hyphenAcrossColumns.test.d.ts.map +1 -0
- package/dist/__tests__/pipeline/hyphenAcrossColumns.test.js +232 -0
- package/dist/__tests__/pipeline/hyphenAcrossColumns.test.js.map +1 -0
- package/dist/__tests__/pipeline/indentAfterOutOfFlow.test.d.ts +2 -0
- package/dist/__tests__/pipeline/indentAfterOutOfFlow.test.d.ts.map +1 -0
- package/dist/__tests__/pipeline/indentAfterOutOfFlow.test.js +93 -0
- package/dist/__tests__/pipeline/indentAfterOutOfFlow.test.js.map +1 -0
- package/dist/__tests__/pipeline/inlineFigureSpace.test.d.ts +2 -0
- package/dist/__tests__/pipeline/inlineFigureSpace.test.d.ts.map +1 -0
- package/dist/__tests__/pipeline/inlineFigureSpace.test.js +195 -0
- package/dist/__tests__/pipeline/inlineFigureSpace.test.js.map +1 -0
- package/dist/__tests__/pipeline/lineSourceEdges.test.d.ts +2 -0
- package/dist/__tests__/pipeline/lineSourceEdges.test.d.ts.map +1 -0
- package/dist/__tests__/pipeline/lineSourceEdges.test.js +143 -0
- package/dist/__tests__/pipeline/lineSourceEdges.test.js.map +1 -0
- package/dist/__tests__/pipeline/lineSourceRanges.test.d.ts +2 -0
- package/dist/__tests__/pipeline/lineSourceRanges.test.d.ts.map +1 -0
- package/dist/__tests__/pipeline/lineSourceRanges.test.js +96 -0
- package/dist/__tests__/pipeline/lineSourceRanges.test.js.map +1 -0
- package/dist/__tests__/pipeline/listTopSnap.test.d.ts +2 -0
- package/dist/__tests__/pipeline/listTopSnap.test.d.ts.map +1 -0
- package/dist/__tests__/pipeline/listTopSnap.test.js +90 -0
- package/dist/__tests__/pipeline/listTopSnap.test.js.map +1 -0
- package/dist/__tests__/pipeline/looseParagraphLimit.test.d.ts +2 -0
- package/dist/__tests__/pipeline/looseParagraphLimit.test.d.ts.map +1 -0
- package/dist/__tests__/pipeline/looseParagraphLimit.test.js +63 -0
- package/dist/__tests__/pipeline/looseParagraphLimit.test.js.map +1 -0
- package/dist/__tests__/pipeline/nestedListSpacing.test.d.ts +2 -0
- package/dist/__tests__/pipeline/nestedListSpacing.test.d.ts.map +1 -0
- package/dist/__tests__/pipeline/nestedListSpacing.test.js +62 -0
- package/dist/__tests__/pipeline/nestedListSpacing.test.js.map +1 -0
- package/dist/__tests__/pipeline/openerColumnStarts.test.d.ts +2 -0
- package/dist/__tests__/pipeline/openerColumnStarts.test.d.ts.map +1 -0
- package/dist/__tests__/pipeline/openerColumnStarts.test.js +189 -0
- package/dist/__tests__/pipeline/openerColumnStarts.test.js.map +1 -0
- package/dist/__tests__/pipeline/openerFillsPage.test.d.ts +2 -0
- package/dist/__tests__/pipeline/openerFillsPage.test.d.ts.map +1 -0
- package/dist/__tests__/pipeline/openerFillsPage.test.js +133 -0
- package/dist/__tests__/pipeline/openerFillsPage.test.js.map +1 -0
- package/dist/__tests__/pipeline/openerTallerThanColumn.test.d.ts +2 -0
- package/dist/__tests__/pipeline/openerTallerThanColumn.test.d.ts.map +1 -0
- package/dist/__tests__/pipeline/openerTallerThanColumn.test.js +139 -0
- package/dist/__tests__/pipeline/openerTallerThanColumn.test.js.map +1 -0
- package/dist/__tests__/pipeline/orderedNumberWidth.test.d.ts +2 -0
- package/dist/__tests__/pipeline/orderedNumberWidth.test.d.ts.map +1 -0
- package/dist/__tests__/pipeline/orderedNumberWidth.test.js +69 -0
- package/dist/__tests__/pipeline/orderedNumberWidth.test.js.map +1 -0
- package/dist/__tests__/pipeline/pageSpanHeadingWidth.test.d.ts +2 -0
- package/dist/__tests__/pipeline/pageSpanHeadingWidth.test.d.ts.map +1 -0
- package/dist/__tests__/pipeline/pageSpanHeadingWidth.test.js +74 -0
- package/dist/__tests__/pipeline/pageSpanHeadingWidth.test.js.map +1 -0
- package/dist/__tests__/pipeline/paragraphContainerTail.test.d.ts +2 -0
- package/dist/__tests__/pipeline/paragraphContainerTail.test.d.ts.map +1 -0
- package/dist/__tests__/pipeline/paragraphContainerTail.test.js +218 -0
- package/dist/__tests__/pipeline/paragraphContainerTail.test.js.map +1 -0
- package/dist/__tests__/pipeline/paragraphStyleFaces.test.d.ts +2 -0
- package/dist/__tests__/pipeline/paragraphStyleFaces.test.d.ts.map +1 -0
- package/dist/__tests__/pipeline/paragraphStyleFaces.test.js +121 -0
- package/dist/__tests__/pipeline/paragraphStyleFaces.test.js.map +1 -0
- package/dist/__tests__/pipeline/paragraphStyles.test.js +85 -0
- package/dist/__tests__/pipeline/paragraphStyles.test.js.map +1 -1
- package/dist/__tests__/pipeline/raggedOptimal.test.d.ts +2 -0
- package/dist/__tests__/pipeline/raggedOptimal.test.d.ts.map +1 -0
- package/dist/__tests__/pipeline/raggedOptimal.test.js +231 -0
- package/dist/__tests__/pipeline/raggedOptimal.test.js.map +1 -0
- package/dist/__tests__/pipeline/resolvedPaletteCopy.test.d.ts +2 -0
- package/dist/__tests__/pipeline/resolvedPaletteCopy.test.d.ts.map +1 -0
- package/dist/__tests__/pipeline/resolvedPaletteCopy.test.js +68 -0
- package/dist/__tests__/pipeline/resolvedPaletteCopy.test.js.map +1 -0
- package/dist/__tests__/pipeline/resourceNumberingRules.test.d.ts +2 -0
- package/dist/__tests__/pipeline/resourceNumberingRules.test.d.ts.map +1 -0
- package/dist/__tests__/pipeline/resourceNumberingRules.test.js +103 -0
- package/dist/__tests__/pipeline/resourceNumberingRules.test.js.map +1 -0
- package/dist/__tests__/pipeline/sectionPageOwnership.test.d.ts +2 -0
- package/dist/__tests__/pipeline/sectionPageOwnership.test.d.ts.map +1 -0
- package/dist/__tests__/pipeline/sectionPageOwnership.test.js +89 -0
- package/dist/__tests__/pipeline/sectionPageOwnership.test.js.map +1 -0
- package/dist/__tests__/pipeline/sectionPaletteSharedBase.test.d.ts +2 -0
- package/dist/__tests__/pipeline/sectionPaletteSharedBase.test.d.ts.map +1 -0
- package/dist/__tests__/pipeline/sectionPaletteSharedBase.test.js +278 -0
- package/dist/__tests__/pipeline/sectionPaletteSharedBase.test.js.map +1 -0
- package/dist/__tests__/pipeline/sectionPaletteTables.test.d.ts +2 -0
- package/dist/__tests__/pipeline/sectionPaletteTables.test.d.ts.map +1 -0
- package/dist/__tests__/pipeline/sectionPaletteTables.test.js +104 -0
- package/dist/__tests__/pipeline/sectionPaletteTables.test.js.map +1 -0
- package/dist/__tests__/pipeline/sideBoxAtColumnEnd.test.d.ts +2 -0
- package/dist/__tests__/pipeline/sideBoxAtColumnEnd.test.d.ts.map +1 -0
- package/dist/__tests__/pipeline/sideBoxAtColumnEnd.test.js +176 -0
- package/dist/__tests__/pipeline/sideBoxAtColumnEnd.test.js.map +1 -0
- package/dist/__tests__/pipeline/sideColumnPercent.test.d.ts +2 -0
- package/dist/__tests__/pipeline/sideColumnPercent.test.d.ts.map +1 -0
- package/dist/__tests__/pipeline/sideColumnPercent.test.js +114 -0
- package/dist/__tests__/pipeline/sideColumnPercent.test.js.map +1 -0
- package/dist/__tests__/pipeline/snippetDollarEscape.test.d.ts +2 -0
- package/dist/__tests__/pipeline/snippetDollarEscape.test.d.ts.map +1 -0
- package/dist/__tests__/pipeline/snippetDollarEscape.test.js +112 -0
- package/dist/__tests__/pipeline/snippetDollarEscape.test.js.map +1 -0
- package/dist/__tests__/pipeline/snippetLineBreaks.test.d.ts +2 -0
- package/dist/__tests__/pipeline/snippetLineBreaks.test.d.ts.map +1 -0
- package/dist/__tests__/pipeline/snippetLineBreaks.test.js +178 -0
- package/dist/__tests__/pipeline/snippetLineBreaks.test.js.map +1 -0
- package/dist/__tests__/pipeline/spanCutUnderColumnFloat.test.d.ts +2 -0
- package/dist/__tests__/pipeline/spanCutUnderColumnFloat.test.d.ts.map +1 -0
- package/dist/__tests__/pipeline/spanCutUnderColumnFloat.test.js +90 -0
- package/dist/__tests__/pipeline/spanCutUnderColumnFloat.test.js.map +1 -0
- package/dist/__tests__/pipeline/splitBoxCappedBand.test.d.ts +2 -0
- package/dist/__tests__/pipeline/splitBoxCappedBand.test.d.ts.map +1 -0
- package/dist/__tests__/pipeline/splitBoxCappedBand.test.js +64 -0
- package/dist/__tests__/pipeline/splitBoxCappedBand.test.js.map +1 -0
- package/dist/__tests__/pipeline/tableCellNoBreakSpaces.test.d.ts +2 -0
- package/dist/__tests__/pipeline/tableCellNoBreakSpaces.test.d.ts.map +1 -0
- package/dist/__tests__/pipeline/tableCellNoBreakSpaces.test.js +97 -0
- package/dist/__tests__/pipeline/tableCellNoBreakSpaces.test.js.map +1 -0
- package/dist/__tests__/pipeline/tableHeaderTracking.test.d.ts +2 -0
- package/dist/__tests__/pipeline/tableHeaderTracking.test.d.ts.map +1 -0
- package/dist/__tests__/pipeline/tableHeaderTracking.test.js +139 -0
- package/dist/__tests__/pipeline/tableHeaderTracking.test.js.map +1 -0
- package/dist/__tests__/pipeline/tableSplitTextRoom.test.d.ts +2 -0
- package/dist/__tests__/pipeline/tableSplitTextRoom.test.d.ts.map +1 -0
- package/dist/__tests__/pipeline/tableSplitTextRoom.test.js +90 -0
- package/dist/__tests__/pipeline/tableSplitTextRoom.test.js.map +1 -0
- package/dist/__tests__/pipeline/tableStyles.test.js +94 -1
- package/dist/__tests__/pipeline/tableStyles.test.js.map +1 -1
- package/dist/__tests__/pipeline/tallParagraphShortColumn.test.d.ts +2 -0
- package/dist/__tests__/pipeline/tallParagraphShortColumn.test.d.ts.map +1 -0
- package/dist/__tests__/pipeline/tallParagraphShortColumn.test.js +79 -0
- package/dist/__tests__/pipeline/tallParagraphShortColumn.test.js.map +1 -0
- package/dist/__tests__/pipeline/textFaces.test.d.ts +2 -0
- package/dist/__tests__/pipeline/textFaces.test.d.ts.map +1 -0
- package/dist/__tests__/pipeline/textFaces.test.js +258 -0
- package/dist/__tests__/pipeline/textFaces.test.js.map +1 -0
- package/dist/__tests__/pipeline/trailingBand.test.js +29 -0
- package/dist/__tests__/pipeline/trailingBand.test.js.map +1 -1
- package/dist/__tests__/pipeline/trailingCapHeading.test.d.ts +2 -0
- package/dist/__tests__/pipeline/trailingCapHeading.test.d.ts.map +1 -0
- package/dist/__tests__/pipeline/trailingCapHeading.test.js +69 -0
- package/dist/__tests__/pipeline/trailingCapHeading.test.js.map +1 -0
- package/dist/__tests__/pipeline/trailingCapOverflow.test.d.ts +2 -0
- package/dist/__tests__/pipeline/trailingCapOverflow.test.d.ts.map +1 -0
- package/dist/__tests__/pipeline/trailingCapOverflow.test.js +116 -0
- package/dist/__tests__/pipeline/trailingCapOverflow.test.js.map +1 -0
- package/dist/__tests__/placeholders.test.js +100 -2
- package/dist/__tests__/placeholders.test.js.map +1 -1
- package/dist/__tests__/punctuationGlue.test.d.ts +2 -0
- package/dist/__tests__/punctuationGlue.test.d.ts.map +1 -0
- package/dist/__tests__/punctuationGlue.test.js +165 -0
- package/dist/__tests__/punctuationGlue.test.js.map +1 -0
- package/dist/__tests__/raggedHyphenation.test.d.ts +2 -0
- package/dist/__tests__/raggedHyphenation.test.d.ts.map +1 -0
- package/dist/__tests__/raggedHyphenation.test.js +184 -0
- package/dist/__tests__/raggedHyphenation.test.js.map +1 -0
- package/dist/__tests__/renderWarnings.test.d.ts +2 -0
- package/dist/__tests__/renderWarnings.test.d.ts.map +1 -0
- package/dist/__tests__/renderWarnings.test.js +72 -0
- package/dist/__tests__/renderWarnings.test.js.map +1 -0
- package/dist/__tests__/resolvedLocale.test.d.ts +2 -0
- package/dist/__tests__/resolvedLocale.test.d.ts.map +1 -0
- package/dist/__tests__/resolvedLocale.test.js +51 -0
- package/dist/__tests__/resolvedLocale.test.js.map +1 -0
- package/dist/__tests__/runningChapter.test.d.ts +2 -0
- package/dist/__tests__/runningChapter.test.d.ts.map +1 -0
- package/dist/__tests__/runningChapter.test.js +161 -0
- package/dist/__tests__/runningChapter.test.js.map +1 -0
- package/dist/__tests__/runtFixStretchLimit.test.d.ts +2 -0
- package/dist/__tests__/runtFixStretchLimit.test.d.ts.map +1 -0
- package/dist/__tests__/runtFixStretchLimit.test.js +145 -0
- package/dist/__tests__/runtFixStretchLimit.test.js.map +1 -0
- package/dist/__tests__/scriptStacking.test.d.ts +2 -0
- package/dist/__tests__/scriptStacking.test.d.ts.map +1 -0
- package/dist/__tests__/scriptStacking.test.js +331 -0
- package/dist/__tests__/scriptStacking.test.js.map +1 -0
- package/dist/__tests__/sectionPaletteFlow.test.d.ts +2 -0
- package/dist/__tests__/sectionPaletteFlow.test.d.ts.map +1 -0
- package/dist/__tests__/sectionPaletteFlow.test.js +51 -0
- package/dist/__tests__/sectionPaletteFlow.test.js.map +1 -0
- package/dist/__tests__/singleInk.test.js +64 -2
- package/dist/__tests__/singleInk.test.js.map +1 -1
- package/dist/__tests__/singleInkRender.test.d.ts +2 -0
- package/dist/__tests__/singleInkRender.test.d.ts.map +1 -0
- package/dist/__tests__/singleInkRender.test.js +396 -0
- package/dist/__tests__/singleInkRender.test.js.map +1 -0
- package/dist/__tests__/spaceDirective.test.js +75 -0
- package/dist/__tests__/spaceDirective.test.js.map +1 -1
- package/dist/__tests__/table/model.test.js +124 -1
- package/dist/__tests__/table/model.test.js.map +1 -1
- package/dist/__tests__/tableFillSeams.test.d.ts +2 -0
- package/dist/__tests__/tableFillSeams.test.d.ts.map +1 -0
- package/dist/__tests__/tableFillSeams.test.js +180 -0
- package/dist/__tests__/tableFillSeams.test.js.map +1 -0
- package/dist/__tests__/toc.test.js +23 -2
- package/dist/__tests__/toc.test.js.map +1 -1
- package/dist/__tests__/tocLeaderKerning.test.d.ts +2 -0
- package/dist/__tests__/tocLeaderKerning.test.d.ts.map +1 -0
- package/dist/__tests__/tocLeaderKerning.test.js +83 -0
- package/dist/__tests__/tocLeaderKerning.test.js.map +1 -0
- package/dist/__tests__/tocNumberBaseline.test.d.ts +2 -0
- package/dist/__tests__/tocNumberBaseline.test.d.ts.map +1 -0
- package/dist/__tests__/tocNumberBaseline.test.js +90 -0
- package/dist/__tests__/tocNumberBaseline.test.js.map +1 -0
- package/dist/__tests__/tocPartsHeight.test.d.ts +2 -0
- package/dist/__tests__/tocPartsHeight.test.d.ts.map +1 -0
- package/dist/__tests__/tocPartsHeight.test.js +41 -0
- package/dist/__tests__/tocPartsHeight.test.js.map +1 -0
- package/dist/__tests__/trackedLineAlign.test.d.ts +2 -0
- package/dist/__tests__/trackedLineAlign.test.d.ts.map +1 -0
- package/dist/__tests__/trackedLineAlign.test.js +96 -0
- package/dist/__tests__/trackedLineAlign.test.js.map +1 -0
- package/dist/bundle/adapters.d.ts +10 -3
- package/dist/bundle/adapters.d.ts.map +1 -1
- package/dist/bundle/adapters.js +13 -5
- package/dist/bundle/adapters.js.map +1 -1
- package/dist/bundle/api.d.ts +32 -0
- package/dist/bundle/api.d.ts.map +1 -1
- package/dist/bundle/api.js +18 -3
- package/dist/bundle/api.js.map +1 -1
- package/dist/bundle/book.d.ts +6 -1
- package/dist/bundle/book.d.ts.map +1 -1
- package/dist/bundle/book.js +89 -17
- package/dist/bundle/book.js.map +1 -1
- package/dist/bundle/codec.d.ts +87 -3
- package/dist/bundle/codec.d.ts.map +1 -1
- package/dist/bundle/codec.js +193 -13
- package/dist/bundle/codec.js.map +1 -1
- package/dist/bundle/configVersion.d.ts +295 -0
- package/dist/bundle/configVersion.d.ts.map +1 -0
- package/dist/bundle/configVersion.js +788 -0
- package/dist/bundle/configVersion.js.map +1 -0
- package/dist/bundle/index.d.ts +6 -4
- package/dist/bundle/index.d.ts.map +1 -1
- package/dist/bundle/index.js +2 -1
- package/dist/bundle/index.js.map +1 -1
- package/dist/bundle/manifest.d.ts +19 -5
- package/dist/bundle/manifest.d.ts.map +1 -1
- package/dist/bundle/manifest.js +53 -21
- package/dist/bundle/manifest.js.map +1 -1
- package/dist/bundle/types.d.ts +19 -0
- package/dist/bundle/types.d.ts.map +1 -1
- package/dist/bundle/zip.d.ts +14 -1
- package/dist/bundle/zip.d.ts.map +1 -1
- package/dist/bundle/zip.js +13 -2
- package/dist/bundle/zip.js.map +1 -1
- package/dist/canvas-backend/blockRender.d.ts +3 -1
- package/dist/canvas-backend/blockRender.d.ts.map +1 -1
- package/dist/canvas-backend/blockRender.js +27 -17
- package/dist/canvas-backend/blockRender.js.map +1 -1
- package/dist/canvas-backend/decorations.d.ts.map +1 -1
- package/dist/canvas-backend/decorations.js +6 -36
- package/dist/canvas-backend/decorations.js.map +1 -1
- package/dist/canvas-backend/headerFooter.d.ts +3 -1
- package/dist/canvas-backend/headerFooter.d.ts.map +1 -1
- package/dist/canvas-backend/headerFooter.js +85 -22
- package/dist/canvas-backend/headerFooter.js.map +1 -1
- package/dist/canvas-backend/index.d.ts +17 -3
- package/dist/canvas-backend/index.d.ts.map +1 -1
- package/dist/canvas-backend/index.js +75 -14
- package/dist/canvas-backend/index.js.map +1 -1
- package/dist/canvas-backend/renderResourceBlock.d.ts +45 -5
- package/dist/canvas-backend/renderResourceBlock.d.ts.map +1 -1
- package/dist/canvas-backend/renderResourceBlock.js +133 -22
- package/dist/canvas-backend/renderResourceBlock.js.map +1 -1
- package/dist/columnClip.d.ts +13 -2
- package/dist/columnClip.d.ts.map +1 -1
- package/dist/columnClip.js +37 -4
- package/dist/columnClip.js.map +1 -1
- package/dist/columnRule.d.ts +7 -2
- package/dist/columnRule.d.ts.map +1 -1
- package/dist/columnRule.js +27 -2
- package/dist/columnRule.js.map +1 -1
- package/dist/configWarnings.d.ts +26 -0
- package/dist/configWarnings.d.ts.map +1 -0
- package/dist/configWarnings.js +223 -0
- package/dist/configWarnings.js.map +1 -0
- package/dist/createLayout.d.ts +16 -1
- package/dist/createLayout.d.ts.map +1 -1
- package/dist/createLayout.js +25 -22
- package/dist/createLayout.js.map +1 -1
- package/dist/cropMarks.d.ts +28 -0
- package/dist/cropMarks.d.ts.map +1 -0
- package/dist/cropMarks.js +40 -0
- package/dist/cropMarks.js.map +1 -0
- package/dist/defaults/bodyText.d.ts +12 -2
- package/dist/defaults/bodyText.d.ts.map +1 -1
- package/dist/defaults/bodyText.js +132 -7
- package/dist/defaults/bodyText.js.map +1 -1
- package/dist/defaults/calloutStyles.d.ts +13 -2
- package/dist/defaults/calloutStyles.d.ts.map +1 -1
- package/dist/defaults/calloutStyles.js +64 -4
- package/dist/defaults/calloutStyles.js.map +1 -1
- package/dist/defaults/chipStyles.d.ts +4 -3
- package/dist/defaults/chipStyles.d.ts.map +1 -1
- package/dist/defaults/chipStyles.js +11 -3
- package/dist/defaults/chipStyles.js.map +1 -1
- package/dist/defaults/headerFooter.d.ts +11 -1
- package/dist/defaults/headerFooter.d.ts.map +1 -1
- package/dist/defaults/headerFooter.js +52 -4
- package/dist/defaults/headerFooter.js.map +1 -1
- package/dist/defaults/headingStyles.d.ts +7 -3
- package/dist/defaults/headingStyles.d.ts.map +1 -1
- package/dist/defaults/headingStyles.js +34 -6
- package/dist/defaults/headingStyles.js.map +1 -1
- package/dist/defaults/headings.d.ts +10 -2
- package/dist/defaults/headings.d.ts.map +1 -1
- package/dist/defaults/headings.js +79 -16
- package/dist/defaults/headings.js.map +1 -1
- package/dist/defaults/index.d.ts +1 -1
- package/dist/defaults/index.d.ts.map +1 -1
- package/dist/defaults/index.js +1 -1
- package/dist/defaults/index.js.map +1 -1
- package/dist/defaults/layout.d.ts.map +1 -1
- package/dist/defaults/layout.js +27 -0
- package/dist/defaults/layout.js.map +1 -1
- package/dist/defaults/lists-shared.d.ts +2 -0
- package/dist/defaults/lists-shared.d.ts.map +1 -1
- package/dist/defaults/lists-shared.js +2 -0
- package/dist/defaults/lists-shared.js.map +1 -1
- package/dist/defaults/math.d.ts.map +1 -1
- package/dist/defaults/math.js +12 -0
- package/dist/defaults/math.js.map +1 -1
- package/dist/defaults/orderedLists.d.ts +7 -1
- package/dist/defaults/orderedLists.d.ts.map +1 -1
- package/dist/defaults/orderedLists.js +30 -4
- package/dist/defaults/orderedLists.js.map +1 -1
- package/dist/defaults/page.d.ts.map +1 -1
- package/dist/defaults/page.js +7 -2
- package/dist/defaults/page.js.map +1 -1
- package/dist/defaults/paragraphStyles.d.ts +2 -1
- package/dist/defaults/paragraphStyles.d.ts.map +1 -1
- package/dist/defaults/paragraphStyles.js +26 -1
- package/dist/defaults/paragraphStyles.js.map +1 -1
- package/dist/defaults/resourceTypes.d.ts +5 -1
- package/dist/defaults/resourceTypes.d.ts.map +1 -1
- package/dist/defaults/resourceTypes.js +37 -6
- package/dist/defaults/resourceTypes.js.map +1 -1
- package/dist/defaults/shared.d.ts +10 -0
- package/dist/defaults/shared.d.ts.map +1 -1
- package/dist/defaults/shared.js +79 -0
- package/dist/defaults/shared.js.map +1 -1
- package/dist/defaults/tableStyle.d.ts +1 -1
- package/dist/defaults/tableStyle.d.ts.map +1 -1
- package/dist/defaults/tableStyle.js +40 -6
- package/dist/defaults/tableStyle.js.map +1 -1
- package/dist/defaults/toc.d.ts +2 -1
- package/dist/defaults/toc.d.ts.map +1 -1
- package/dist/defaults/toc.js +2 -1
- package/dist/defaults/toc.js.map +1 -1
- package/dist/defaults/unorderedLists.d.ts +1 -0
- package/dist/defaults/unorderedLists.d.ts.map +1 -1
- package/dist/defaults/unorderedLists.js +7 -1
- package/dist/defaults/unorderedLists.js.map +1 -1
- package/dist/design/layout.d.ts +41 -3
- package/dist/design/layout.d.ts.map +1 -1
- package/dist/design/layout.js +322 -90
- package/dist/design/layout.js.map +1 -1
- package/dist/design/placeholders.d.ts +39 -4
- package/dist/design/placeholders.d.ts.map +1 -1
- package/dist/design/placeholders.js +61 -11
- package/dist/design/placeholders.js.map +1 -1
- package/dist/design/richText.d.ts +110 -0
- package/dist/design/richText.d.ts.map +1 -0
- package/dist/design/richText.js +458 -0
- package/dist/design/richText.js.map +1 -0
- package/dist/frontmatter.d.ts +14 -0
- package/dist/frontmatter.d.ts.map +1 -1
- package/dist/frontmatter.js +61 -0
- package/dist/frontmatter.js.map +1 -1
- package/dist/html-backend.d.ts +60 -2
- package/dist/html-backend.d.ts.map +1 -1
- package/dist/html-backend.js +317 -62
- package/dist/html-backend.js.map +1 -1
- package/dist/hyphenate.d.ts +30 -4
- package/dist/hyphenate.d.ts.map +1 -1
- package/dist/hyphenate.js +71 -5
- package/dist/hyphenate.js.map +1 -1
- package/dist/index.d.ts +28 -19
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +17 -11
- package/dist/index.js.map +1 -1
- package/dist/knuthPlass/breakpoints.d.ts +21 -0
- package/dist/knuthPlass/breakpoints.d.ts.map +1 -1
- package/dist/knuthPlass/breakpoints.js +205 -14
- package/dist/knuthPlass/breakpoints.js.map +1 -1
- package/dist/knuthPlass/constants.d.ts +15 -0
- package/dist/knuthPlass/constants.d.ts.map +1 -1
- package/dist/knuthPlass/constants.js +15 -0
- package/dist/knuthPlass/constants.js.map +1 -1
- package/dist/knuthPlass/pretextAdapter.d.ts +23 -2
- package/dist/knuthPlass/pretextAdapter.d.ts.map +1 -1
- package/dist/knuthPlass/pretextAdapter.js +95 -9
- package/dist/knuthPlass/pretextAdapter.js.map +1 -1
- package/dist/knuthPlass/richAdapter.d.ts +26 -2
- package/dist/knuthPlass/richAdapter.d.ts.map +1 -1
- package/dist/knuthPlass/richAdapter.js +79 -18
- package/dist/knuthPlass/richAdapter.js.map +1 -1
- package/dist/knuthPlass/tracking.d.ts +24 -0
- package/dist/knuthPlass/tracking.d.ts.map +1 -0
- package/dist/knuthPlass/tracking.js +77 -0
- package/dist/knuthPlass/tracking.js.map +1 -0
- package/dist/knuthPlass/types.d.ts +66 -4
- package/dist/knuthPlass/types.d.ts.map +1 -1
- package/dist/lineInk.d.ts +12 -0
- package/dist/lineInk.d.ts.map +1 -0
- package/dist/lineInk.js +20 -0
- package/dist/lineInk.js.map +1 -0
- package/dist/locale.d.ts +26 -0
- package/dist/locale.d.ts.map +1 -0
- package/dist/locale.js +63 -0
- package/dist/locale.js.map +1 -0
- package/dist/looseLines.d.ts +44 -0
- package/dist/looseLines.d.ts.map +1 -0
- package/dist/looseLines.js +46 -0
- package/dist/looseLines.js.map +1 -0
- package/dist/math/THIRD_PARTY_LICENSES.txt +221 -0
- package/dist/math/engine.d.ts +24 -0
- package/dist/math/engine.d.ts.map +1 -1
- package/dist/math/engine.js +252 -83
- package/dist/math/engine.js.map +1 -1
- package/dist/math/index.d.ts +1 -1
- package/dist/math/index.d.ts.map +1 -1
- package/dist/math/index.js +1 -1
- package/dist/math/index.js.map +1 -1
- package/dist/math/mathjax.d.ts +20 -0
- package/dist/math/mathjax.d.ts.map +1 -0
- package/dist/math/mathjax.js +29 -0
- package/dist/measure/breakRules.d.ts +50 -0
- package/dist/measure/breakRules.d.ts.map +1 -0
- package/dist/measure/breakRules.js +116 -0
- package/dist/measure/breakRules.js.map +1 -0
- package/dist/measure/cache.d.ts.map +1 -1
- package/dist/measure/cache.js +26 -5
- package/dist/measure/cache.js.map +1 -1
- package/dist/measure/cjk.d.ts +19 -0
- package/dist/measure/cjk.d.ts.map +1 -0
- package/dist/measure/cjk.js +70 -0
- package/dist/measure/cjk.js.map +1 -0
- package/dist/measure/font.d.ts +21 -5
- package/dist/measure/font.d.ts.map +1 -1
- package/dist/measure/font.js +61 -4
- package/dist/measure/font.js.map +1 -1
- package/dist/measure/index.d.ts +16 -2
- package/dist/measure/index.d.ts.map +1 -1
- package/dist/measure/index.js +61 -1
- package/dist/measure/index.js.map +1 -1
- package/dist/measure/links.d.ts +15 -0
- package/dist/measure/links.d.ts.map +1 -0
- package/dist/measure/links.js +115 -0
- package/dist/measure/links.js.map +1 -0
- package/dist/measure/plain.d.ts +10 -2
- package/dist/measure/plain.d.ts.map +1 -1
- package/dist/measure/plain.js +175 -25
- package/dist/measure/plain.js.map +1 -1
- package/dist/measure/rich.d.ts +86 -6
- package/dist/measure/rich.d.ts.map +1 -1
- package/dist/measure/rich.js +808 -131
- package/dist/measure/rich.js.map +1 -1
- package/dist/measure/spaces.d.ts +34 -0
- package/dist/measure/spaces.d.ts.map +1 -0
- package/dist/measure/spaces.js +42 -0
- package/dist/measure/spaces.js.map +1 -0
- package/dist/measure/types.d.ts +99 -0
- package/dist/measure/types.d.ts.map +1 -1
- package/dist/measure/types.js +19 -0
- package/dist/measure/types.js.map +1 -1
- package/dist/numberWords.d.ts +22 -0
- package/dist/numberWords.d.ts.map +1 -0
- package/dist/numberWords.js +155 -0
- package/dist/numberWords.js.map +1 -0
- package/dist/numbering.d.ts +52 -3
- package/dist/numbering.d.ts.map +1 -1
- package/dist/numbering.js +116 -16
- package/dist/numbering.js.map +1 -1
- package/dist/parse/blockParser.d.ts.map +1 -1
- package/dist/parse/blockParser.js +54 -7
- package/dist/parse/blockParser.js.map +1 -1
- package/dist/parse/index.d.ts +1 -1
- package/dist/parse/index.d.ts.map +1 -1
- package/dist/parse/index.js.map +1 -1
- package/dist/parse/injectSpans.d.ts +3 -1
- package/dist/parse/injectSpans.d.ts.map +1 -1
- package/dist/parse/injectSpans.js +8 -4
- package/dist/parse/injectSpans.js.map +1 -1
- package/dist/parse/inlineFormatting.d.ts +50 -2
- package/dist/parse/inlineFormatting.d.ts.map +1 -1
- package/dist/parse/inlineFormatting.js +441 -26
- package/dist/parse/inlineFormatting.js.map +1 -1
- package/dist/parse/inlineSnippet.d.ts +12 -3
- package/dist/parse/inlineSnippet.d.ts.map +1 -1
- package/dist/parse/inlineSnippet.js +10 -3
- package/dist/parse/inlineSnippet.js.map +1 -1
- package/dist/parse/links.d.ts +9 -0
- package/dist/parse/links.d.ts.map +1 -0
- package/dist/parse/links.js +23 -0
- package/dist/parse/links.js.map +1 -0
- package/dist/parse/sourceMapping.d.ts.map +1 -1
- package/dist/parse/sourceMapping.js +68 -7
- package/dist/parse/sourceMapping.js.map +1 -1
- package/dist/parse/types.d.ts +32 -0
- package/dist/parse/types.d.ts.map +1 -1
- package/dist/pipeline/bandCaps.d.ts +26 -5
- package/dist/pipeline/bandCaps.d.ts.map +1 -1
- package/dist/pipeline/bandCaps.js +47 -20
- package/dist/pipeline/bandCaps.js.map +1 -1
- package/dist/pipeline/build.d.ts.map +1 -1
- package/dist/pipeline/build.js +1417 -172
- package/dist/pipeline/build.js.map +1 -1
- package/dist/pipeline/buildBlockKind.d.ts +4 -0
- package/dist/pipeline/buildBlockKind.d.ts.map +1 -1
- package/dist/pipeline/buildBlockKind.js +38 -7
- package/dist/pipeline/buildBlockKind.js.map +1 -1
- package/dist/pipeline/buildHelpers.d.ts +5 -2
- package/dist/pipeline/buildHelpers.d.ts.map +1 -1
- package/dist/pipeline/buildHelpers.js +101 -25
- package/dist/pipeline/buildHelpers.js.map +1 -1
- package/dist/pipeline/buildMeasurement.d.ts.map +1 -1
- package/dist/pipeline/buildMeasurement.js +6 -2
- package/dist/pipeline/buildMeasurement.js.map +1 -1
- package/dist/pipeline/calloutLayout.d.ts +34 -7
- package/dist/pipeline/calloutLayout.d.ts.map +1 -1
- package/dist/pipeline/calloutLayout.js +331 -44
- package/dist/pipeline/calloutLayout.js.map +1 -1
- package/dist/pipeline/chips.d.ts.map +1 -1
- package/dist/pipeline/chips.js +3 -0
- package/dist/pipeline/chips.js.map +1 -1
- package/dist/pipeline/columnBalancing.d.ts +26 -6
- package/dist/pipeline/columnBalancing.d.ts.map +1 -1
- package/dist/pipeline/columnBalancing.js +82 -21
- package/dist/pipeline/columnBalancing.js.map +1 -1
- package/dist/pipeline/config.d.ts +18 -0
- package/dist/pipeline/config.d.ts.map +1 -1
- package/dist/pipeline/config.js +44 -7
- package/dist/pipeline/config.js.map +1 -1
- package/dist/pipeline/contentWarnings.d.ts +50 -0
- package/dist/pipeline/contentWarnings.d.ts.map +1 -0
- package/dist/pipeline/contentWarnings.js +363 -0
- package/dist/pipeline/contentWarnings.js.map +1 -0
- package/dist/pipeline/continuation.d.ts.map +1 -1
- package/dist/pipeline/continuation.js +25 -5
- package/dist/pipeline/continuation.js.map +1 -1
- package/dist/pipeline/floatPlacement.d.ts +16 -7
- package/dist/pipeline/floatPlacement.d.ts.map +1 -1
- package/dist/pipeline/floatPlacement.js +22 -5
- package/dist/pipeline/floatPlacement.js.map +1 -1
- package/dist/pipeline/floatSlots.d.ts +30 -4
- package/dist/pipeline/floatSlots.d.ts.map +1 -1
- package/dist/pipeline/floatSlots.js +42 -7
- package/dist/pipeline/floatSlots.js.map +1 -1
- package/dist/pipeline/headerFooter.d.ts +125 -11
- package/dist/pipeline/headerFooter.d.ts.map +1 -1
- package/dist/pipeline/headerFooter.js +444 -69
- package/dist/pipeline/headerFooter.js.map +1 -1
- package/dist/pipeline/headingDesignCuts.d.ts +40 -0
- package/dist/pipeline/headingDesignCuts.d.ts.map +1 -0
- package/dist/pipeline/headingDesignCuts.js +72 -0
- package/dist/pipeline/headingDesignCuts.js.map +1 -0
- package/dist/pipeline/headingStyles.d.ts +12 -0
- package/dist/pipeline/headingStyles.d.ts.map +1 -1
- package/dist/pipeline/headingStyles.js +45 -1
- package/dist/pipeline/headingStyles.js.map +1 -1
- package/dist/pipeline/lists.d.ts +33 -1
- package/dist/pipeline/lists.d.ts.map +1 -1
- package/dist/pipeline/lists.js +53 -2
- package/dist/pipeline/lists.js.map +1 -1
- package/dist/pipeline/measureContentBlock.d.ts +25 -1
- package/dist/pipeline/measureContentBlock.d.ts.map +1 -1
- package/dist/pipeline/measureContentBlock.js +137 -17
- package/dist/pipeline/measureContentBlock.js.map +1 -1
- package/dist/pipeline/outline.d.ts +10 -5
- package/dist/pipeline/outline.d.ts.map +1 -1
- package/dist/pipeline/outline.js +38 -14
- package/dist/pipeline/outline.js.map +1 -1
- package/dist/pipeline/paragraphContainers.d.ts +13 -4
- package/dist/pipeline/paragraphContainers.d.ts.map +1 -1
- package/dist/pipeline/paragraphContainers.js +4 -3
- package/dist/pipeline/paragraphContainers.js.map +1 -1
- package/dist/pipeline/partPalette.d.ts +49 -3
- package/dist/pipeline/partPalette.d.ts.map +1 -1
- package/dist/pipeline/partPalette.js +414 -46
- package/dist/pipeline/partPalette.js.map +1 -1
- package/dist/pipeline/parts.d.ts +5 -1
- package/dist/pipeline/parts.d.ts.map +1 -1
- package/dist/pipeline/parts.js +16 -0
- package/dist/pipeline/parts.js.map +1 -1
- package/dist/pipeline/placeholders.d.ts +152 -3
- package/dist/pipeline/placeholders.d.ts.map +1 -1
- package/dist/pipeline/placeholders.js +259 -33
- package/dist/pipeline/placeholders.js.map +1 -1
- package/dist/pipeline/placement.d.ts +6 -1
- package/dist/pipeline/placement.d.ts.map +1 -1
- package/dist/pipeline/placement.js +13 -2
- package/dist/pipeline/placement.js.map +1 -1
- package/dist/pipeline/raggedLines.d.ts +5 -0
- package/dist/pipeline/raggedLines.d.ts.map +1 -1
- package/dist/pipeline/raggedLines.js +24 -3
- package/dist/pipeline/raggedLines.js.map +1 -1
- package/dist/pipeline/resourceLayout.d.ts +6 -4
- package/dist/pipeline/resourceLayout.d.ts.map +1 -1
- package/dist/pipeline/resourceLayout.js +137 -36
- package/dist/pipeline/resourceLayout.js.map +1 -1
- package/dist/pipeline/resourceNumbering.d.ts.map +1 -1
- package/dist/pipeline/resourceNumbering.js +5 -15
- package/dist/pipeline/resourceNumbering.js.map +1 -1
- package/dist/pipeline/styles.d.ts +38 -5
- package/dist/pipeline/styles.d.ts.map +1 -1
- package/dist/pipeline/styles.js +99 -46
- package/dist/pipeline/styles.js.map +1 -1
- package/dist/pipeline/toc.d.ts.map +1 -1
- package/dist/pipeline/toc.js +41 -5
- package/dist/pipeline/toc.js.map +1 -1
- package/dist/react/createLayout.d.ts +20 -0
- package/dist/react/createLayout.d.ts.map +1 -0
- package/dist/react/createLayout.js +50 -0
- package/dist/react/createLayout.js.map +1 -0
- package/dist/react/index.d.ts +3 -0
- package/dist/react/index.d.ts.map +1 -0
- package/dist/react/index.js +4 -0
- package/dist/react/index.js.map +1 -0
- package/dist/svg/singleInk.d.ts +46 -1
- package/dist/svg/singleInk.d.ts.map +1 -1
- package/dist/svg/singleInk.js +180 -10
- package/dist/svg/singleInk.js.map +1 -1
- package/dist/table/model.d.ts +36 -1
- package/dist/table/model.d.ts.map +1 -1
- package/dist/table/model.js +163 -20
- package/dist/table/model.js.map +1 -1
- package/dist/types.d.ts +979 -68
- package/dist/types.d.ts.map +1 -1
- package/dist/vdt.d.ts +439 -13
- package/dist/vdt.d.ts.map +1 -1
- package/dist/vdt.js +91 -0
- package/dist/vdt.js.map +1 -1
- package/dist/worker/client.d.ts +15 -1
- package/dist/worker/client.d.ts.map +1 -1
- package/dist/worker/client.js +52 -3
- package/dist/worker/client.js.map +1 -1
- package/dist/worker/entryUrl.d.ts +15 -0
- package/dist/worker/entryUrl.d.ts.map +1 -0
- package/dist/worker/entryUrl.js +33 -0
- package/dist/worker/entryUrl.js.map +1 -0
- package/dist/worker/fonts.d.ts +18 -0
- package/dist/worker/fonts.d.ts.map +1 -0
- package/dist/worker/fonts.js +53 -0
- package/dist/worker/fonts.js.map +1 -0
- package/dist/worker/layout.worker.js +41 -6
- package/dist/worker/layout.worker.js.map +1 -1
- package/dist/worker/protocol.d.ts +4 -0
- package/dist/worker/protocol.d.ts.map +1 -1
- package/package.json +12 -5
|
@@ -0,0 +1,788 @@
|
|
|
1
|
+
// Which rules a stored configuration was written for, and how one written
|
|
2
|
+
// for older rules is read in today's terms. A `.postext` manifest carries
|
|
3
|
+
// the number as `configVersion` (every writer since postext 1.5 sets it);
|
|
4
|
+
// the Sandbox numbers its stored projects the same way.
|
|
5
|
+
import { DEFAULT_MATH_CONFIG } from '../defaults/math';
|
|
6
|
+
import { dimensionsEqual } from '../defaults/shared';
|
|
7
|
+
import { DEFAULT_TEXT_ELEMENT, resolveDesignLineHeight } from '../defaults/headerFooter';
|
|
8
|
+
import { DEFAULT_PAGE_CONFIG } from '../defaults/page';
|
|
9
|
+
import { dimensionToPx } from '../units';
|
|
10
|
+
import { KNOWN_CONTAINERS } from '../parse/blockParser';
|
|
11
|
+
/**
|
|
12
|
+
* The configuration rules this engine writes: 8 since postext 1.5. Thirteen
|
|
13
|
+
* rules changed in that release, and a configuration stored under an older
|
|
14
|
+
* number (or none) is read through {@link migrateConfig}:
|
|
15
|
+
* - 3: a heading level's `breakBefore` (and a heading style's) merges field
|
|
16
|
+
* by field onto the level's default — H1's being `always-odd`
|
|
17
|
+
* ({@link pinLegacyHeadingBreaks});
|
|
18
|
+
* - 4: one em of a formula is the surrounding text's size ×
|
|
19
|
+
* `math.fontSizeScale`, where up to 1.4 formulas came out
|
|
20
|
+
* {@link LEGACY_MATH_SIZE}× larger ({@link pinLegacyMathSize});
|
|
21
|
+
* - 5: an inline resource keeps the float gap below it as well as above
|
|
22
|
+
* (`layout.inlineResourceGap: 'around'`), where up to 1.4 the text after
|
|
23
|
+
* it resumed at the next grid line ({@link pinLegacyInlineGap});
|
|
24
|
+
* - 6, five rules:
|
|
25
|
+
* - a heading reads its inline marks (`headings.inlineMarks: true`),
|
|
26
|
+
* where up to 1.4 it printed them as plain text ({@link
|
|
27
|
+
* pinLegacyHeadingMarks});
|
|
28
|
+
* - a design text's drop cap that names no size is set at the size that
|
|
29
|
+
* brings its top level with the first line's capitals, where up to 1.4
|
|
30
|
+
* it was as tall as all the line boxes it spans ({@link
|
|
31
|
+
* pinLegacyDropCapSize});
|
|
32
|
+
* - `bodyText.keepColonWithList` leaves room under the colon line for
|
|
33
|
+
* the list's first item to start by its orphan and widow rules
|
|
34
|
+
* (`bodyText.colonListRoom: 'item'`), where up to 1.4 one line was
|
|
35
|
+
* enough ({@link pinLegacyColonListRoom});
|
|
36
|
+
* - an inline resource inside a box keeps the float gap too
|
|
37
|
+
* (`layout.inlineResourceGapInBoxes`), where up to 1.4 it sat right
|
|
38
|
+
* against the text around it ({@link pinLegacyBoxResourceGap});
|
|
39
|
+
* - a box that splits inside a paragraph or list item leaves at least two
|
|
40
|
+
* lines of it on each side (`layout.boxChildSplitMinLines: 2`), where
|
|
41
|
+
* up to 1.4 a cut could leave one ({@link pinLegacyBoxChildCut});
|
|
42
|
+
* - 7, two rules:
|
|
43
|
+
* - a line may end after an em or en dash set closed between words
|
|
44
|
+
* (`bodyText.breakAfterDashes`), where up to 1.4 Knuth–Plass never
|
|
45
|
+
* broke there ({@link pinLegacyDashBreaks});
|
|
46
|
+
* - ragged running text is broken with Knuth–Plass too
|
|
47
|
+
* (`bodyText.optimalRagged`), where up to 1.4 it was set line by line
|
|
48
|
+
* ({@link pinLegacyRaggedBreaking});
|
|
49
|
+
* - 8, three rules:
|
|
50
|
+
* - a paragraph kept with the heading above it at a column's foot
|
|
51
|
+
* splits by the orphan rule too (`headings.keepWithNextSplit:
|
|
52
|
+
* 'rules'`), where up to 1.4 it kept as many lines as fit under the
|
|
53
|
+
* heading ({@link pinLegacyHeadingSplit});
|
|
54
|
+
* - the space under a `:::paragraphs` container merges with the next
|
|
55
|
+
* block's own and is at least the paragraph spacing of the text around
|
|
56
|
+
* it (`bodyText.paragraphContainerSpacing: 'collapse'`), where up to
|
|
57
|
+
* 1.4 the style's space was baked into the grid snap and the next
|
|
58
|
+
* block's space above added under it ({@link
|
|
59
|
+
* pinLegacyParagraphContainerSpacing});
|
|
60
|
+
* - Knuth–Plass may end a line after the hyphen of a compound in every
|
|
61
|
+
* paragraph (`bodyText.breakAfterHyphens`), where up to 1.4 a justified
|
|
62
|
+
* paragraph with no inline formatting never broke there ({@link
|
|
63
|
+
* pinLegacyHyphenBreaks}).
|
|
64
|
+
*
|
|
65
|
+
* A configuration stored without a version was written for postext 1.4 or
|
|
66
|
+
* earlier. One stored under 3 to 7 was written by a 1.5 prerelease, and
|
|
67
|
+
* gets the pins of the rules after its number: under 3 the maths,
|
|
68
|
+
* inline-gap, version-6, version-7 and version-8 pins, under 4 the
|
|
69
|
+
* inline-gap, version-6, version-7 and version-8 pins, under 5 the
|
|
70
|
+
* version-6, version-7 and version-8 pins, under 6 the version-7 and
|
|
71
|
+
* version-8 pins, under 7 the version-8 pins.
|
|
72
|
+
*/
|
|
73
|
+
export const CONFIG_VERSION = 8;
|
|
74
|
+
/** The rules that merge a partial heading break onto its level's. */
|
|
75
|
+
const HEADING_BREAK_RULES = 3;
|
|
76
|
+
/** The rules that set a formula's em at the documented size. */
|
|
77
|
+
const MATH_SIZE_RULES = 4;
|
|
78
|
+
/** The rules that keep the float gap under an inline resource. */
|
|
79
|
+
const INLINE_GAP_RULES = 5;
|
|
80
|
+
/** The rules that read a heading's inline marks, and size a drop cap to
|
|
81
|
+
* the first line's capitals. */
|
|
82
|
+
const HEADING_MARKS_RULES = 6;
|
|
83
|
+
const DROP_CAP_SIZE_RULES = 6;
|
|
84
|
+
/** The rules that leave room for a list's first item under its colon line. */
|
|
85
|
+
const COLON_LIST_ROOM_RULES = 6;
|
|
86
|
+
/** The rules that keep the gap around an inline resource inside a box. */
|
|
87
|
+
const BOX_GAP_RULES = 6;
|
|
88
|
+
/** The rules that keep two lines of a paragraph or list item on each side
|
|
89
|
+
* of a box cut. */
|
|
90
|
+
const BOX_CHILD_CUT_RULES = 6;
|
|
91
|
+
/** The rules that let a line end after a closed dash. */
|
|
92
|
+
const DASH_BREAK_RULES = 7;
|
|
93
|
+
/** The rules that break ragged running text with Knuth–Plass. */
|
|
94
|
+
const RAGGED_BREAKING_RULES = 7;
|
|
95
|
+
/** The rules that keep the orphan minimum when a paragraph splits under a
|
|
96
|
+
* heading. */
|
|
97
|
+
const HEADING_SPLIT_RULES = 8;
|
|
98
|
+
/** The rules that merge the space under a `:::paragraphs` container with
|
|
99
|
+
* the next block's. */
|
|
100
|
+
const PARAGRAPH_CONTAINER_RULES = 8;
|
|
101
|
+
/** The rules that let Knuth–Plass break after a compound's hyphen in every
|
|
102
|
+
* paragraph. */
|
|
103
|
+
const HYPHEN_BREAK_RULES = 8;
|
|
104
|
+
/** Up to 1.4 a drop cap with no `fontSize` was as tall as the line boxes it
|
|
105
|
+
* spans divided by this, the share of a letter's size its capitals take. */
|
|
106
|
+
const CAP_HEIGHT = 0.72;
|
|
107
|
+
/**
|
|
108
|
+
* How much larger postext 1.4 set maths than the size it documents:
|
|
109
|
+
* MathJax gives a formula's box in `ex`, one `ex` of its TeX font is
|
|
110
|
+
* 0.442 em (the font's `x_height`), and 1.4 took it as half an em. So
|
|
111
|
+
* 0.5 ÷ 0.442 ≈ 1.1312; a configuration whose `math.fontSizeScale` is
|
|
112
|
+
* multiplied by it sets every formula at the size 1.4 did.
|
|
113
|
+
*/
|
|
114
|
+
export const LEGACY_MATH_SIZE = 0.5 / 0.442;
|
|
115
|
+
function isRecord(v) {
|
|
116
|
+
return typeof v === 'object' && v !== null && !Array.isArray(v);
|
|
117
|
+
}
|
|
118
|
+
/** A stored `configVersion`: a finite number, anything else counting as
|
|
119
|
+
* none (written by postext 1.4 or earlier). */
|
|
120
|
+
function rulesOf(configVersion) {
|
|
121
|
+
return typeof configVersion === 'number' && Number.isFinite(configVersion) ? configVersion : 0;
|
|
122
|
+
}
|
|
123
|
+
/** A partial `breakBefore` as postext 1.4 resolved it where the default
|
|
124
|
+
* it filled from was the no-break one, written out in full; undefined
|
|
125
|
+
* when it already says all it lays out. */
|
|
126
|
+
function pinnedBreak(raw) {
|
|
127
|
+
const enabled = raw?.enabled ?? false;
|
|
128
|
+
if (raw?.enabled !== undefined && (!enabled || raw.parity !== undefined))
|
|
129
|
+
return undefined;
|
|
130
|
+
return { ...raw, enabled, ...(enabled && raw?.parity === undefined ? { parity: 'any' } : {}) };
|
|
131
|
+
}
|
|
132
|
+
/**
|
|
133
|
+
* A configuration written for postext 1.4 or earlier, pinned to the heading
|
|
134
|
+
* breaks it laid out then. Up to 1.4 a `headings` object turned the H1 page
|
|
135
|
+
* break off unless it set `levels[0].breakBefore.enabled` (and stripping the
|
|
136
|
+
* defaults dropped an H1 `enabled: false`, so saved and exported
|
|
137
|
+
* configurations never carried one), a partial H1 break took its missing
|
|
138
|
+
* field from the no-break default, and a heading style's `breakBefore`
|
|
139
|
+
* replaced its level's with the same fill. The engine now merges each onto
|
|
140
|
+
* the level's break — H1's being `always-odd` — so those breaks are written
|
|
141
|
+
* out: `enabled: false` on H1, or `parity: 'any'` beside an `enabled: true`.
|
|
142
|
+
* A configuration with no `headings` object, or one that spells every break
|
|
143
|
+
* out in full, is returned as it is (the same object).
|
|
144
|
+
*/
|
|
145
|
+
export function pinLegacyHeadingBreaks(config) {
|
|
146
|
+
let out = config;
|
|
147
|
+
const headings = config.headings;
|
|
148
|
+
if (isRecord(headings)) {
|
|
149
|
+
const levels = Array.isArray(headings.levels) ? headings.levels : [];
|
|
150
|
+
const i = levels.findIndex((l) => isRecord(l) && l.level === 1);
|
|
151
|
+
const pin = pinnedBreak(i >= 0 && isRecord(levels[i].breakBefore) ? levels[i].breakBefore : undefined);
|
|
152
|
+
if (pin) {
|
|
153
|
+
const nextLevels = i >= 0
|
|
154
|
+
? levels.map((l, k) => (k === i ? { ...l, breakBefore: pin } : l))
|
|
155
|
+
: [...levels, { level: 1, breakBefore: pin }];
|
|
156
|
+
out = { ...out, headings: { ...headings, levels: nextLevels } };
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
if (Array.isArray(config.headingStyles)) {
|
|
160
|
+
let changed = false;
|
|
161
|
+
const styles = config.headingStyles.map((style) => {
|
|
162
|
+
if (!isRecord(style) || !isRecord(style.breakBefore))
|
|
163
|
+
return style;
|
|
164
|
+
const pin = pinnedBreak(style.breakBefore);
|
|
165
|
+
if (!pin)
|
|
166
|
+
return style;
|
|
167
|
+
changed = true;
|
|
168
|
+
return { ...style, breakBefore: pin };
|
|
169
|
+
});
|
|
170
|
+
if (changed)
|
|
171
|
+
out = { ...out, headingStyles: styles };
|
|
172
|
+
}
|
|
173
|
+
return out;
|
|
174
|
+
}
|
|
175
|
+
function isDimension(v) {
|
|
176
|
+
return isRecord(v) && typeof v.value === 'number' && typeof v.unit === 'string';
|
|
177
|
+
}
|
|
178
|
+
/**
|
|
179
|
+
* A configuration written before postext 1.5, pinned to the maths size it
|
|
180
|
+
* laid out then: `math.fontSizeScale` (1 when unset) × {@link
|
|
181
|
+
* LEGACY_MATH_SIZE}. A display formula's margins in `em` or `rem` are
|
|
182
|
+
* lengths of the formula's own size, so they are divided by the same
|
|
183
|
+
* factor and keep the space 1.4 left around the formula. A value that
|
|
184
|
+
* lands on its default is left out (a scale of 0.884 becomes the default
|
|
185
|
+
* 1), and a configuration with maths switched off (`math.enabled: false`,
|
|
186
|
+
* whose formulas are set as their TeX source at the body size) is
|
|
187
|
+
* returned as it is (the same object).
|
|
188
|
+
*/
|
|
189
|
+
export function pinLegacyMathSize(config) {
|
|
190
|
+
const math = isRecord(config.math) ? config.math : {};
|
|
191
|
+
if (math.enabled === false)
|
|
192
|
+
return config;
|
|
193
|
+
const next = { ...math };
|
|
194
|
+
const scale = typeof math.fontSizeScale === 'number' && Number.isFinite(math.fontSizeScale)
|
|
195
|
+
? math.fontSizeScale
|
|
196
|
+
: DEFAULT_MATH_CONFIG.fontSizeScale;
|
|
197
|
+
const pinnedScale = scale * LEGACY_MATH_SIZE;
|
|
198
|
+
if (pinnedScale === DEFAULT_MATH_CONFIG.fontSizeScale)
|
|
199
|
+
delete next.fontSizeScale;
|
|
200
|
+
else
|
|
201
|
+
next.fontSizeScale = pinnedScale;
|
|
202
|
+
for (const key of ['marginTop', 'marginBottom']) {
|
|
203
|
+
const margin = isDimension(math[key]) ? math[key] : DEFAULT_MATH_CONFIG[key];
|
|
204
|
+
if (margin.unit !== 'em' && margin.unit !== 'rem')
|
|
205
|
+
continue;
|
|
206
|
+
const pinned = { ...margin, value: margin.value / LEGACY_MATH_SIZE };
|
|
207
|
+
if (dimensionsEqual(pinned, DEFAULT_MATH_CONFIG[key]))
|
|
208
|
+
delete next[key];
|
|
209
|
+
else
|
|
210
|
+
next[key] = pinned;
|
|
211
|
+
}
|
|
212
|
+
return { ...config, math: next };
|
|
213
|
+
}
|
|
214
|
+
/**
|
|
215
|
+
* A configuration written before postext 1.5, pinned to the space it left
|
|
216
|
+
* under an inline resource: `layout.inlineResourceGap: 'above'`, where 1.4
|
|
217
|
+
* kept the float gap above the resource only and set the text after it at
|
|
218
|
+
* the next grid line. A configuration that names a gap already is returned
|
|
219
|
+
* as it is (the same object).
|
|
220
|
+
*/
|
|
221
|
+
export function pinLegacyInlineGap(config) {
|
|
222
|
+
const layout = isRecord(config.layout) ? config.layout : {};
|
|
223
|
+
if (layout.inlineResourceGap !== undefined)
|
|
224
|
+
return config;
|
|
225
|
+
return { ...config, layout: { ...layout, inlineResourceGap: 'above' } };
|
|
226
|
+
}
|
|
227
|
+
/**
|
|
228
|
+
* A configuration written before postext 1.5, pinned to the room it left
|
|
229
|
+
* for a list under the colon line that introduces it:
|
|
230
|
+
* `bodyText.colonListRoom: 'line'`, where 1.4 took one line of room as
|
|
231
|
+
* enough and a first item the orphan and widow rules keep whole went on
|
|
232
|
+
* to the next column without the colon line. A configuration that names a
|
|
233
|
+
* room already, or turns `keepColonWithList` off, is returned as it is
|
|
234
|
+
* (the same object).
|
|
235
|
+
*/
|
|
236
|
+
export function pinLegacyColonListRoom(config) {
|
|
237
|
+
const bodyText = isRecord(config.bodyText) ? config.bodyText : {};
|
|
238
|
+
if (bodyText.colonListRoom !== undefined || bodyText.keepColonWithList === false)
|
|
239
|
+
return config;
|
|
240
|
+
return { ...config, bodyText: { ...bodyText, colonListRoom: 'line' } };
|
|
241
|
+
}
|
|
242
|
+
/** A paragraph line ending in a colon (emphasis markers may close after
|
|
243
|
+
* it) with a list item next, blank lines between them allowed: the lead-in
|
|
244
|
+
* `keepColonWithList` keeps with its list. */
|
|
245
|
+
const COLON_LIST_RE = /:[*_]*[^\S\n]*\n(?:[^\S\n]*\n)*[^\S\n]*(?:[-*+]|\d+[.)])[^\S\n]/;
|
|
246
|
+
/**
|
|
247
|
+
* A configuration written before postext 1.5, pinned to the space it left
|
|
248
|
+
* around an inline resource inside a box: `layout.inlineResourceGapInBoxes:
|
|
249
|
+
* false`, where 1.4 set the resource right under the text before it and
|
|
250
|
+
* the text after it right under the resource. A configuration that already
|
|
251
|
+
* says whether boxes keep the gap is returned as it is (the same object).
|
|
252
|
+
*/
|
|
253
|
+
export function pinLegacyBoxResourceGap(config) {
|
|
254
|
+
const layout = isRecord(config.layout) ? config.layout : {};
|
|
255
|
+
if (layout.inlineResourceGapInBoxes !== undefined)
|
|
256
|
+
return config;
|
|
257
|
+
return { ...config, layout: { ...layout, inlineResourceGapInBoxes: false } };
|
|
258
|
+
}
|
|
259
|
+
/**
|
|
260
|
+
* A configuration written before postext 1.5, pinned to the cuts it made in
|
|
261
|
+
* a box that splits: `layout.boxChildSplitMinLines: 1`, where 1.4 cut
|
|
262
|
+
* inside a paragraph or list item wherever each side of the box held its
|
|
263
|
+
* `splitMinLines` lines in all, even when that left one line of the
|
|
264
|
+
* paragraph or item on a side. A configuration that names the setting
|
|
265
|
+
* already is returned as it is (the same object).
|
|
266
|
+
*/
|
|
267
|
+
export function pinLegacyBoxChildCut(config) {
|
|
268
|
+
const layout = isRecord(config.layout) ? config.layout : {};
|
|
269
|
+
if (layout.boxChildSplitMinLines !== undefined)
|
|
270
|
+
return config;
|
|
271
|
+
return { ...config, layout: { ...layout, boxChildSplitMinLines: 1 } };
|
|
272
|
+
}
|
|
273
|
+
/**
|
|
274
|
+
* A configuration written before postext 1.5, pinned to the line breaks it
|
|
275
|
+
* made at a dash: `bodyText.breakAfterDashes: false`, where 1.4's
|
|
276
|
+
* Knuth–Plass never ended a line after an em or en dash set closed between
|
|
277
|
+
* words ("say—that’s"), and its line-by-line breaker for formatted text
|
|
278
|
+
* only between two letters. A configuration that names the setting already
|
|
279
|
+
* is returned as it is (the same object).
|
|
280
|
+
*/
|
|
281
|
+
export function pinLegacyDashBreaks(config) {
|
|
282
|
+
const bodyText = isRecord(config.bodyText) ? config.bodyText : {};
|
|
283
|
+
if (bodyText.breakAfterDashes !== undefined)
|
|
284
|
+
return config;
|
|
285
|
+
return { ...config, bodyText: { ...bodyText, breakAfterDashes: false } };
|
|
286
|
+
}
|
|
287
|
+
/**
|
|
288
|
+
* A configuration written before postext 1.5, pinned to the way it broke
|
|
289
|
+
* ragged text: `bodyText.optimalRagged: false`, where 1.4 set every ragged
|
|
290
|
+
* paragraph line by line, filling each line before the next, whatever
|
|
291
|
+
* `optimalLineBreaking` said. A configuration that names the setting
|
|
292
|
+
* already, that sets no running text ragged (the body, a paragraph style,
|
|
293
|
+
* a box body, the body of a part or of a section style, in the
|
|
294
|
+
* configuration or in its HTML viewer's overrides), or that turns
|
|
295
|
+
* `optimalLineBreaking` off (the setting then changes nothing) is returned
|
|
296
|
+
* as it is (the same object).
|
|
297
|
+
*/
|
|
298
|
+
export function pinLegacyRaggedBreaking(config) {
|
|
299
|
+
const bodyText = isRecord(config.bodyText) ? config.bodyText : {};
|
|
300
|
+
if (bodyText.optimalRagged !== undefined || bodyText.optimalLineBreaking === false)
|
|
301
|
+
return config;
|
|
302
|
+
if (!setsRaggedText(config))
|
|
303
|
+
return config;
|
|
304
|
+
return { ...config, bodyText: { ...bodyText, optimalRagged: false } };
|
|
305
|
+
}
|
|
306
|
+
/**
|
|
307
|
+
* A configuration written before postext 1.5, pinned to the way it split a
|
|
308
|
+
* paragraph kept with the heading above it at a column's foot:
|
|
309
|
+
* `headings.keepWithNextSplit: 'fill'`, where 1.4 kept as many lines as fit
|
|
310
|
+
* under the heading (at least `bodyText.widowMinLines`) however few went on
|
|
311
|
+
* to the next column. A configuration that names the setting already, that
|
|
312
|
+
* turns `headings.keepWithNext` off, or that turns `bodyText.avoidOrphans`
|
|
313
|
+
* off (the setting then changes nothing) is returned as it is (the same
|
|
314
|
+
* object).
|
|
315
|
+
*/
|
|
316
|
+
export function pinLegacyHeadingSplit(config) {
|
|
317
|
+
const headings = isRecord(config.headings) ? config.headings : {};
|
|
318
|
+
if (headings.keepWithNextSplit !== undefined || headings.keepWithNext === false)
|
|
319
|
+
return config;
|
|
320
|
+
if (isRecord(config.bodyText) && config.bodyText.avoidOrphans === false)
|
|
321
|
+
return config;
|
|
322
|
+
return { ...config, headings: { ...headings, keepWithNextSplit: 'fill' } };
|
|
323
|
+
}
|
|
324
|
+
/**
|
|
325
|
+
* A configuration written before postext 1.5, pinned to the space it left
|
|
326
|
+
* under a `:::paragraphs` container: `bodyText.paragraphContainerSpacing:
|
|
327
|
+
* 'add'`, where 1.4 set the style's space (the larger of `spaceBetween` and
|
|
328
|
+
* `marginBottom`) under the last paragraph before the grid snap, added the
|
|
329
|
+
* next block's own space above (a heading's `marginTop`, the next
|
|
330
|
+
* container's) under it, and left the paragraph spacing of the text around
|
|
331
|
+
* the container out. A configuration that names the setting already, or
|
|
332
|
+
* declares no paragraph style (in the configuration or in its HTML
|
|
333
|
+
* viewer's overrides; a container naming no style is set as body text), is
|
|
334
|
+
* returned as it is (the same object).
|
|
335
|
+
*/
|
|
336
|
+
export function pinLegacyParagraphContainerSpacing(config) {
|
|
337
|
+
const bodyText = isRecord(config.bodyText) ? config.bodyText : {};
|
|
338
|
+
if (bodyText.paragraphContainerSpacing !== undefined)
|
|
339
|
+
return config;
|
|
340
|
+
if (!declaresParagraphStyles(config))
|
|
341
|
+
return config;
|
|
342
|
+
return { ...config, bodyText: { ...bodyText, paragraphContainerSpacing: 'add' } };
|
|
343
|
+
}
|
|
344
|
+
/** Whether `config` (or the screen overrides of its HTML viewer) declares
|
|
345
|
+
* a paragraph style, which is all a `:::paragraphs` container is laid out
|
|
346
|
+
* with. */
|
|
347
|
+
function declaresParagraphStyles(config) {
|
|
348
|
+
const has = (c) => Array.isArray(c.paragraphStyles) && c.paragraphStyles.length > 0;
|
|
349
|
+
if (has(config))
|
|
350
|
+
return true;
|
|
351
|
+
const viewer = config.htmlViewer;
|
|
352
|
+
return isRecord(viewer) && isRecord(viewer.overrides) && has(viewer.overrides);
|
|
353
|
+
}
|
|
354
|
+
/** A `:::paragraphs` opening fence on a line of its own, as the block
|
|
355
|
+
* parser reads one (the line trimmed). */
|
|
356
|
+
const PARAGRAPHS_FENCE_LINE_RE = /^[^\S\n]*:::[^\S\n]*paragraphs[^\S\n]*(?:\{[^}\n]*\})?[^\S\n]*$/m;
|
|
357
|
+
/** Whether markdown may hold a `:::paragraphs` container. Unknown content
|
|
358
|
+
* (undefined) may. */
|
|
359
|
+
function mayHaveParagraphContainers(content) {
|
|
360
|
+
if (content === undefined)
|
|
361
|
+
return true;
|
|
362
|
+
if (typeof content === 'string')
|
|
363
|
+
return PARAGRAPHS_FENCE_LINE_RE.test(content);
|
|
364
|
+
return content.some((text) => PARAGRAPHS_FENCE_LINE_RE.test(text));
|
|
365
|
+
}
|
|
366
|
+
/**
|
|
367
|
+
* A configuration written before postext 1.5, pinned to the line breaks it
|
|
368
|
+
* made at the hyphen of a compound: `bodyText.breakAfterHyphens: false`,
|
|
369
|
+
* where 1.4's Knuth–Plass ended a justified line after a hyphen between two
|
|
370
|
+
* letters ("well-" | "known") only in a paragraph with inline formatting.
|
|
371
|
+
* A configuration that names the setting already, or turns
|
|
372
|
+
* `optimalLineBreaking` off (the setting then changes nothing), is returned
|
|
373
|
+
* as it is (the same object).
|
|
374
|
+
*/
|
|
375
|
+
export function pinLegacyHyphenBreaks(config) {
|
|
376
|
+
const bodyText = isRecord(config.bodyText) ? config.bodyText : {};
|
|
377
|
+
if (bodyText.breakAfterHyphens !== undefined || bodyText.optimalLineBreaking === false)
|
|
378
|
+
return config;
|
|
379
|
+
return { ...config, bodyText: { ...bodyText, breakAfterHyphens: false } };
|
|
380
|
+
}
|
|
381
|
+
/** A compound a line may end in: a hyphen between two letters. The
|
|
382
|
+
* Markdown is read raw; only a paragraph with no inline mark is broken
|
|
383
|
+
* differently, and there the compound is written as it prints. */
|
|
384
|
+
const COMPOUND_RE = /\p{L}-\p{L}/u;
|
|
385
|
+
/** Whether markdown may set a compound. Unknown content (undefined) may. */
|
|
386
|
+
function mayHaveCompounds(content) {
|
|
387
|
+
if (content === undefined)
|
|
388
|
+
return true;
|
|
389
|
+
if (typeof content === 'string')
|
|
390
|
+
return COMPOUND_RE.test(content);
|
|
391
|
+
return content.some((text) => COMPOUND_RE.test(text));
|
|
392
|
+
}
|
|
393
|
+
/** Whether a `textAlign` value sets text ragged (anything but `'justify'`;
|
|
394
|
+
* an unset one follows the body). */
|
|
395
|
+
function isRaggedAlign(value) {
|
|
396
|
+
return typeof value === 'string' && value !== 'justify';
|
|
397
|
+
}
|
|
398
|
+
/** Whether `config` (or the screen overrides of its HTML viewer) sets some
|
|
399
|
+
* running text ragged: the body text (and so its blockquotes and lists), a
|
|
400
|
+
* paragraph style, a box body, the body of a part or the body of a
|
|
401
|
+
* section style (`headingStyles[].bodyStyle`). Headings do not count: they
|
|
402
|
+
* are not broken with Knuth–Plass when ragged. */
|
|
403
|
+
function setsRaggedText(config) {
|
|
404
|
+
const raggedBody = (st) => isRecord(st) && isRecord(st.bodyStyle) && isRaggedAlign(st.bodyStyle.textAlign);
|
|
405
|
+
const check = (c) => {
|
|
406
|
+
if (isRecord(c.bodyText) && isRaggedAlign(c.bodyText.textAlign))
|
|
407
|
+
return true;
|
|
408
|
+
if (Array.isArray(c.paragraphStyles) && c.paragraphStyles.some((st) => isRecord(st) && isRaggedAlign(st.textAlign)))
|
|
409
|
+
return true;
|
|
410
|
+
if (Array.isArray(c.calloutStyles) && c.calloutStyles.some((st) => isRecord(st) && isRecord(st.body) && isRaggedAlign(st.body.textAlign)))
|
|
411
|
+
return true;
|
|
412
|
+
if (Array.isArray(c.headingStyles) && c.headingStyles.some(raggedBody))
|
|
413
|
+
return true;
|
|
414
|
+
return raggedBody(c.parts);
|
|
415
|
+
};
|
|
416
|
+
if (check(config))
|
|
417
|
+
return true;
|
|
418
|
+
const viewer = config.htmlViewer;
|
|
419
|
+
return isRecord(viewer) && isRecord(viewer.overrides) && check(viewer.overrides);
|
|
420
|
+
}
|
|
421
|
+
/** A dash a line may end after (see `breaksAfterDash` in
|
|
422
|
+
* `measure/breakRules.ts`): an em or en dash set closed, a letter, a digit
|
|
423
|
+
* or closing punctuation before it, and a letter or a digit after it. A
|
|
424
|
+
* quotation mark before the dash counts only when something that may close
|
|
425
|
+
* a word stands before it (`"no"—and`, `„nein“—und`, `« non »—et`), not
|
|
426
|
+
* after a space (`said "—Hola`), where no rule breaks. The Markdown is read
|
|
427
|
+
* raw, so the inline marks that may touch the dash or the quote count on
|
|
428
|
+
* either side (`**riddles.**—I`, `*riddles*—and`, `*no*"—and`, a code
|
|
429
|
+
* span, a `:ref[…]`, an escape). An en dash between two digits, and a
|
|
430
|
+
* bracket or quote after the dash, which never break, are let through: the
|
|
431
|
+
* check only has to be safe. */
|
|
432
|
+
const CLOSED_DASH_RE = /(?:[\p{L}\p{N}.,;:!?)\]}…*_`~^\\]|[\p{L}\p{N}.,;:!?)\]}…*_`~^\\\u00A0\u202F]["'»”’“«])[\u2013\u2014][\p{L}\p{N}([{¿¡«“‘„"'*_`~^:\\<]/u;
|
|
433
|
+
/** Whether markdown may set a dash a line can now end after. Unknown
|
|
434
|
+
* content (undefined) may. */
|
|
435
|
+
function mayHaveClosedDashes(content) {
|
|
436
|
+
if (content === undefined)
|
|
437
|
+
return true;
|
|
438
|
+
if (typeof content === 'string')
|
|
439
|
+
return CLOSED_DASH_RE.test(content);
|
|
440
|
+
return content.some((text) => CLOSED_DASH_RE.test(text));
|
|
441
|
+
}
|
|
442
|
+
/**
|
|
443
|
+
* A configuration written before postext 1.5, pinned to the headings it
|
|
444
|
+
* laid out then: `headings.inlineMarks: false`, where 1.4 printed the text
|
|
445
|
+
* of a heading's `*italic*`, `**bold**` and other marks in the heading's
|
|
446
|
+
* plain style. A configuration that names the setting already is returned
|
|
447
|
+
* as it is (the same object).
|
|
448
|
+
*/
|
|
449
|
+
export function pinLegacyHeadingMarks(config) {
|
|
450
|
+
const headings = isRecord(config.headings) ? config.headings : {};
|
|
451
|
+
if (headings.inlineMarks !== undefined)
|
|
452
|
+
return config;
|
|
453
|
+
return { ...config, headings: { ...headings, inlineMarks: false } };
|
|
454
|
+
}
|
|
455
|
+
/** The double next to `v`, one step towards `+∞` (`dir` 1) or `−∞`. */
|
|
456
|
+
function nextDouble(v, dir) {
|
|
457
|
+
if (v === 0)
|
|
458
|
+
return dir * Number.MIN_VALUE;
|
|
459
|
+
const view = new DataView(new ArrayBuffer(8));
|
|
460
|
+
view.setFloat64(0, v);
|
|
461
|
+
view.setBigInt64(0, view.getBigInt64(0) + ((v > 0) === (dir > 0) ? 1n : -1n));
|
|
462
|
+
return view.getFloat64(0);
|
|
463
|
+
}
|
|
464
|
+
/** A length in `unit` that `dimensionToPx` reads back as `px` at `dpi`
|
|
465
|
+
* (em against `basePx`): the plain conversion, or one of the doubles next
|
|
466
|
+
* to it when rounding leaves that a hair off. Most sizes read back
|
|
467
|
+
* exactly; for some unit, dpi and leading combinations no double does, and
|
|
468
|
+
* the plain conversion is kept, a rounding step or two (1e-14 px) away. */
|
|
469
|
+
function lengthOf(px, unit, dpi, basePx) {
|
|
470
|
+
const toPx = (value) => dimensionToPx({ value, unit }, dpi, basePx);
|
|
471
|
+
const first = px / toPx(1);
|
|
472
|
+
let up = first;
|
|
473
|
+
let down = first;
|
|
474
|
+
for (let step = 0; step < 16; step++) {
|
|
475
|
+
if (toPx(up) === px)
|
|
476
|
+
return { value: up, unit };
|
|
477
|
+
if (toPx(down) === px)
|
|
478
|
+
return { value: down, unit };
|
|
479
|
+
up = nextDouble(up, 1);
|
|
480
|
+
down = nextDouble(down, -1);
|
|
481
|
+
}
|
|
482
|
+
return { value: first, unit };
|
|
483
|
+
}
|
|
484
|
+
/** The size postext 1.4 set the drop cap of the design text `el` at, when
|
|
485
|
+
* the cap names none, `dpi` being the document's: the line boxes it spans
|
|
486
|
+
* over {@link CAP_HEIGHT}, worked out as 1.4 did and written in the unit of
|
|
487
|
+
* the element's leading (a length) or of its font size (a multiplier of
|
|
488
|
+
* it). Undefined when that cannot be written out. */
|
|
489
|
+
function legacyDropCapSize(el, dropCap, dpi) {
|
|
490
|
+
const lines = Math.max(1, Math.round(Number(dropCap.lines ?? 2)));
|
|
491
|
+
if (!Number.isFinite(lines))
|
|
492
|
+
return undefined;
|
|
493
|
+
const fontSize = isDimension(el.fontSize) ? el.fontSize : DEFAULT_TEXT_ELEMENT.fontSize;
|
|
494
|
+
// A design text's size is a length; one in em has nothing to read against.
|
|
495
|
+
if (fontSize.unit === 'em' || fontSize.unit === 'rem')
|
|
496
|
+
return undefined;
|
|
497
|
+
const fontSizePx = dimensionToPx(fontSize, dpi);
|
|
498
|
+
const leading = resolveDesignLineHeight(el.lineHeight, fontSize);
|
|
499
|
+
const lineHeightPx = leading.lineHeightLength ? dimensionToPx(leading.lineHeightLength, dpi) : fontSizePx * leading.lineHeight;
|
|
500
|
+
const capPx = (lines * lineHeightPx) / CAP_HEIGHT;
|
|
501
|
+
if (!Number.isFinite(capPx) || capPx <= 0)
|
|
502
|
+
return undefined;
|
|
503
|
+
return lengthOf(capPx, leading.lineHeightLength?.unit ?? fontSize.unit, dpi, fontSizePx);
|
|
504
|
+
}
|
|
505
|
+
/** `value` with every design text in it — a `kind: 'text'` object whose
|
|
506
|
+
* `dropCap` names no `fontSize` — given its 1.4 size, wherever it sits;
|
|
507
|
+
* the same object where nothing changed. */
|
|
508
|
+
function pinDropCaps(value, dpi) {
|
|
509
|
+
if (Array.isArray(value)) {
|
|
510
|
+
let changed = false;
|
|
511
|
+
const next = value.map((v) => {
|
|
512
|
+
const out = pinDropCaps(v, dpi);
|
|
513
|
+
if (out !== v)
|
|
514
|
+
changed = true;
|
|
515
|
+
return out;
|
|
516
|
+
});
|
|
517
|
+
return changed ? next : value;
|
|
518
|
+
}
|
|
519
|
+
if (!isRecord(value))
|
|
520
|
+
return value;
|
|
521
|
+
let out = value;
|
|
522
|
+
for (const [key, v] of Object.entries(value)) {
|
|
523
|
+
const next = pinDropCaps(v, dpi);
|
|
524
|
+
if (next === v)
|
|
525
|
+
continue;
|
|
526
|
+
if (out === value)
|
|
527
|
+
out = { ...value };
|
|
528
|
+
out[key] = next;
|
|
529
|
+
}
|
|
530
|
+
const dropCap = out.dropCap;
|
|
531
|
+
if (out.kind === 'text' && isRecord(dropCap) && dropCap.fontSize === undefined) {
|
|
532
|
+
const size = legacyDropCapSize(out, dropCap, dpi);
|
|
533
|
+
if (size)
|
|
534
|
+
out = { ...out, dropCap: { ...dropCap, fontSize: size } };
|
|
535
|
+
}
|
|
536
|
+
return out;
|
|
537
|
+
}
|
|
538
|
+
/**
|
|
539
|
+
* A configuration written before postext 1.5, pinned to the drop caps it
|
|
540
|
+
* laid out then. Up to 1.4 a design text's `dropCap` that named no
|
|
541
|
+
* `fontSize` was as tall as the line boxes it spans over 0.72 (the share of
|
|
542
|
+
* the size its capitals take), so its top stood above the capitals of the
|
|
543
|
+
* first line; today's default brings the two level. Every such drop cap,
|
|
544
|
+
* in whatever design it sits (running heads, heading designs and styles,
|
|
545
|
+
* part pages, the contents' part rows), gets that size written out: in the
|
|
546
|
+
* unit of the element's leading when that is a length, else in the unit of
|
|
547
|
+
* its font size, at the size 1.4 set at the document's `page.dpi` (to the
|
|
548
|
+
* last digit in most cases, and never more than a rounding step or two
|
|
549
|
+
* away). A configuration with none is returned as it is (the same object).
|
|
550
|
+
*/
|
|
551
|
+
export function pinLegacyDropCapSize(config) {
|
|
552
|
+
const dpi = isRecord(config.page) && typeof config.page.dpi === 'number' && config.page.dpi > 0
|
|
553
|
+
? config.page.dpi
|
|
554
|
+
: DEFAULT_PAGE_CONFIG.dpi;
|
|
555
|
+
return pinDropCaps(config, dpi);
|
|
556
|
+
}
|
|
557
|
+
/** A heading line of markdown, its title in group 1. The block parser
|
|
558
|
+
* trims a line before it reads a heading, so any indent will do. */
|
|
559
|
+
const HEADING_LINE_RE = /^[^\S\n]*#{1,6}[^\S\n]+(.*)$/gm;
|
|
560
|
+
/** A mark a heading's title may carry: `*`, `_`, `^`, `~`, `:smallcaps[`
|
|
561
|
+
* or the `](` of a link. */
|
|
562
|
+
const HEADING_MARK_RE = /[*_^~]|:smallcaps\[|\]\(/;
|
|
563
|
+
/** The trailing `{…}` attributes of a heading line. */
|
|
564
|
+
const HEADING_ATTRS_TAIL_RE = /\s*\{[^{}]*\}\s*$/;
|
|
565
|
+
/** Whether markdown may hold a heading whose title carries an inline mark
|
|
566
|
+
* (its attributes left out). Unknown content (undefined) may. */
|
|
567
|
+
function mayHaveHeadingMarks(content) {
|
|
568
|
+
if (content === undefined)
|
|
569
|
+
return true;
|
|
570
|
+
const test = (text) => {
|
|
571
|
+
for (const m of text.matchAll(HEADING_LINE_RE)) {
|
|
572
|
+
if (HEADING_MARK_RE.test(m[1].replace(HEADING_ATTRS_TAIL_RE, '')))
|
|
573
|
+
return true;
|
|
574
|
+
}
|
|
575
|
+
return false;
|
|
576
|
+
};
|
|
577
|
+
return typeof content === 'string' ? test(content) : content.some(test);
|
|
578
|
+
}
|
|
579
|
+
/** Whether markdown may hold a heading, which is all a paragraph keeps
|
|
580
|
+
* with. Unknown content (undefined) may. */
|
|
581
|
+
function mayHaveHeadings(content) {
|
|
582
|
+
if (content === undefined)
|
|
583
|
+
return true;
|
|
584
|
+
const test = (text) => new RegExp(HEADING_LINE_RE.source, 'm').test(text);
|
|
585
|
+
return typeof content === 'string' ? test(content) : content.some(test);
|
|
586
|
+
}
|
|
587
|
+
/** A `::resource{id="…"}` embed alone on its line, as the block parser
|
|
588
|
+
* reads one (the line trimmed): a mention in running text or in a code
|
|
589
|
+
* span embeds nothing. */
|
|
590
|
+
const RESOURCE_EMBED_LINE_RE = /^[^\S\n]*::resource[^\S\n]*\{id="[^"\n]+"\}[^\S\n]*$/m;
|
|
591
|
+
/** The same, for one line. */
|
|
592
|
+
const RESOURCE_EMBED_RE = /^[^\S\n]*::resource[^\S\n]*\{id="[^"\n]+"\}[^\S\n]*$/;
|
|
593
|
+
/** A container's opening fence (`:::callout{…}`) and its bare closing
|
|
594
|
+
* fence, as the block parser reads them (the line trimmed). */
|
|
595
|
+
const FENCE_OPEN_RE = /^:::\s*([a-z][a-z0-9-]*)\s*(?:\{[^}]*\})?\s*$/;
|
|
596
|
+
const FENCE_CLOSE_RE = /^:::\s*$/;
|
|
597
|
+
/** A `:::callout` opening fence on a line of its own, as the block parser
|
|
598
|
+
* reads one (the line trimmed). */
|
|
599
|
+
const CALLOUT_FENCE_LINE_RE = /^[^\S\n]*:::[^\S\n]*callout[^\S\n]*(?:\{[^}\n]*\})?[^\S\n]*$/m;
|
|
600
|
+
/** Whether markdown may hold a box, which is all that splits by the box
|
|
601
|
+
* cut rules. Unknown content (undefined) may. */
|
|
602
|
+
function mayHaveBoxes(content) {
|
|
603
|
+
if (content === undefined)
|
|
604
|
+
return true;
|
|
605
|
+
if (typeof content === 'string')
|
|
606
|
+
return CALLOUT_FENCE_LINE_RE.test(content);
|
|
607
|
+
return content.some((text) => CALLOUT_FENCE_LINE_RE.test(text));
|
|
608
|
+
}
|
|
609
|
+
/** Whether markdown embeds a resource inside a box: a `::resource` line
|
|
610
|
+
* while a `:::callout` fence is open. */
|
|
611
|
+
function embedsResourceInBox(text) {
|
|
612
|
+
if (!RESOURCE_EMBED_LINE_RE.test(text))
|
|
613
|
+
return false;
|
|
614
|
+
const open = [];
|
|
615
|
+
let boxes = 0;
|
|
616
|
+
for (const raw of text.split('\n')) {
|
|
617
|
+
const line = raw.trim();
|
|
618
|
+
const fence = FENCE_OPEN_RE.exec(line);
|
|
619
|
+
if (fence && KNOWN_CONTAINERS.has(fence[1])) {
|
|
620
|
+
const box = fence[1] === 'callout';
|
|
621
|
+
open.push(box);
|
|
622
|
+
if (box)
|
|
623
|
+
boxes++;
|
|
624
|
+
}
|
|
625
|
+
else if (open.length > 0 && FENCE_CLOSE_RE.test(line)) {
|
|
626
|
+
if (open.pop())
|
|
627
|
+
boxes--;
|
|
628
|
+
}
|
|
629
|
+
else if (boxes > 0 && RESOURCE_EMBED_RE.test(line)) {
|
|
630
|
+
return true;
|
|
631
|
+
}
|
|
632
|
+
}
|
|
633
|
+
return false;
|
|
634
|
+
}
|
|
635
|
+
/** `MigrateConfigOptions.content` as a string or an array. Both checks
|
|
636
|
+
* below read it, and an iterator (a generator, a Map's `values()`) can be
|
|
637
|
+
* walked only once, so the migrations take its texts into an array first. */
|
|
638
|
+
function readContent(content) {
|
|
639
|
+
return content === undefined || typeof content === 'string' ? content : [...content];
|
|
640
|
+
}
|
|
641
|
+
/** Whether markdown may embed a resource inline: only a `::resource`
|
|
642
|
+
* directive on a line of its own does. Unknown content (undefined) may. */
|
|
643
|
+
function mayEmbedResources(content) {
|
|
644
|
+
if (content === undefined)
|
|
645
|
+
return true;
|
|
646
|
+
if (typeof content === 'string')
|
|
647
|
+
return RESOURCE_EMBED_LINE_RE.test(content);
|
|
648
|
+
return content.some((text) => RESOURCE_EMBED_LINE_RE.test(text));
|
|
649
|
+
}
|
|
650
|
+
/** Whether markdown may embed a resource inside a box. Unknown content
|
|
651
|
+
* (undefined) may. */
|
|
652
|
+
function mayEmbedResourcesInBoxes(content) {
|
|
653
|
+
if (content === undefined)
|
|
654
|
+
return true;
|
|
655
|
+
if (typeof content === 'string')
|
|
656
|
+
return embedsResourceInBox(content);
|
|
657
|
+
return content.some(embedsResourceInBox);
|
|
658
|
+
}
|
|
659
|
+
/** Whether markdown may introduce a list with a colon. Unknown content
|
|
660
|
+
* (undefined) may. */
|
|
661
|
+
function mayLeadListWithColon(content) {
|
|
662
|
+
if (content === undefined)
|
|
663
|
+
return true;
|
|
664
|
+
if (typeof content === 'string')
|
|
665
|
+
return COLON_LIST_RE.test(content);
|
|
666
|
+
return content.some((text) => COLON_LIST_RE.test(text));
|
|
667
|
+
}
|
|
668
|
+
/** Whether markdown sets maths: a formula is written between `$` signs.
|
|
669
|
+
* Unknown content (undefined) may. */
|
|
670
|
+
function mayHaveMaths(content) {
|
|
671
|
+
if (content === undefined)
|
|
672
|
+
return true;
|
|
673
|
+
if (typeof content === 'string')
|
|
674
|
+
return content.includes('$');
|
|
675
|
+
return content.some((text) => text.includes('$'));
|
|
676
|
+
}
|
|
677
|
+
/**
|
|
678
|
+
* A configuration stored under `configVersion` (see {@link CONFIG_VERSION}),
|
|
679
|
+
* in today's terms. One with no version (a number is expected; anything
|
|
680
|
+
* else counts as none) or one older than 3 has its heading breaks pinned by
|
|
681
|
+
* {@link pinLegacyHeadingBreaks}; one older than 4 has its maths size
|
|
682
|
+
* pinned by {@link pinLegacyMathSize}, unless `options.content` shows it
|
|
683
|
+
* sets no maths; one older than 5 has its inline gap pinned by {@link
|
|
684
|
+
* pinLegacyInlineGap}, unless `options.content` shows it embeds no
|
|
685
|
+
* resource; one older than 6 has its heading marks pinned by {@link
|
|
686
|
+
* pinLegacyHeadingMarks}, unless `options.content` shows no heading
|
|
687
|
+
* carries one, its drop caps by {@link pinLegacyDropCapSize}, its
|
|
688
|
+
* colon-list room by {@link pinLegacyColonListRoom}, unless
|
|
689
|
+
* `options.content` shows no list introduced by a colon, and its box gap
|
|
690
|
+
* by {@link pinLegacyBoxResourceGap}, unless `options.content` shows it
|
|
691
|
+
* embeds no resource inside a box, and its box cut by {@link
|
|
692
|
+
* pinLegacyBoxChildCut}, unless `options.content` shows it holds no box;
|
|
693
|
+
* one older than 7 has its dash breaks pinned by {@link
|
|
694
|
+
* pinLegacyDashBreaks}, unless `options.content` shows no closed dash, and
|
|
695
|
+
* its ragged breaking by {@link pinLegacyRaggedBreaking}, when it sets some
|
|
696
|
+
* running text ragged; one older than 8 has its split under a heading
|
|
697
|
+
* pinned by {@link pinLegacyHeadingSplit}, unless `options.content` shows
|
|
698
|
+
* no heading, the space under its `:::paragraphs` containers by {@link
|
|
699
|
+
* pinLegacyParagraphContainerSpacing}, when it declares a paragraph style,
|
|
700
|
+
* unless `options.content` shows no such container, and its compound
|
|
701
|
+
* breaks by {@link pinLegacyHyphenBreaks}, unless `options.content` shows
|
|
702
|
+
* no compound. A current one is returned as it is (the same object).
|
|
703
|
+
* Migrate a stored configuration once and store it again under
|
|
704
|
+
* `CONFIG_VERSION`: the maths pin multiplies a scale, so a configuration
|
|
705
|
+
* read twice under its old number would grow twice.
|
|
706
|
+
*/
|
|
707
|
+
export function migrateConfig(config, configVersion, options = {}) {
|
|
708
|
+
const rules = rulesOf(configVersion);
|
|
709
|
+
let out = rules < HEADING_BREAK_RULES ? pinLegacyHeadingBreaks(config) : config;
|
|
710
|
+
const content = rules < CONFIG_VERSION ? readContent(options.content) : undefined;
|
|
711
|
+
if (rules < MATH_SIZE_RULES && mayHaveMaths(content))
|
|
712
|
+
out = pinLegacyMathSize(out);
|
|
713
|
+
if (rules < INLINE_GAP_RULES && mayEmbedResources(content))
|
|
714
|
+
out = pinLegacyInlineGap(out);
|
|
715
|
+
if (rules < HEADING_MARKS_RULES && mayHaveHeadingMarks(content))
|
|
716
|
+
out = pinLegacyHeadingMarks(out);
|
|
717
|
+
if (rules < DROP_CAP_SIZE_RULES)
|
|
718
|
+
out = pinLegacyDropCapSize(out);
|
|
719
|
+
if (rules < COLON_LIST_ROOM_RULES && mayLeadListWithColon(content))
|
|
720
|
+
out = pinLegacyColonListRoom(out);
|
|
721
|
+
if (rules < BOX_GAP_RULES && mayEmbedResourcesInBoxes(content))
|
|
722
|
+
out = pinLegacyBoxResourceGap(out);
|
|
723
|
+
if (rules < BOX_CHILD_CUT_RULES && mayHaveBoxes(content))
|
|
724
|
+
out = pinLegacyBoxChildCut(out);
|
|
725
|
+
if (rules < DASH_BREAK_RULES && mayHaveClosedDashes(content))
|
|
726
|
+
out = pinLegacyDashBreaks(out);
|
|
727
|
+
if (rules < RAGGED_BREAKING_RULES)
|
|
728
|
+
out = pinLegacyRaggedBreaking(out);
|
|
729
|
+
if (rules < HEADING_SPLIT_RULES && mayHaveHeadings(content))
|
|
730
|
+
out = pinLegacyHeadingSplit(out);
|
|
731
|
+
if (rules < PARAGRAPH_CONTAINER_RULES && mayHaveParagraphContainers(content))
|
|
732
|
+
out = pinLegacyParagraphContainerSpacing(out);
|
|
733
|
+
if (rules < HYPHEN_BREAK_RULES && mayHaveCompounds(content))
|
|
734
|
+
out = pinLegacyHyphenBreaks(out);
|
|
735
|
+
return out;
|
|
736
|
+
}
|
|
737
|
+
/**
|
|
738
|
+
* A bundle's configuration in today's terms: `base` (the reader's own)
|
|
739
|
+
* under the manifest's `config` and the locale's overrides, both stored
|
|
740
|
+
* under `configVersion`. Top-level keys replace one another wholesale, so
|
|
741
|
+
* the heading breaks are pinned layer by layer (the base's are taken as
|
|
742
|
+
* they are) and the maths size once, on the `math` the layers leave in
|
|
743
|
+
* force — the size 1.4 set this bundle's formulas at, whichever layer
|
|
744
|
+
* named it, the base included when neither the manifest nor the locale
|
|
745
|
+
* names one. The inline gap, the box gap and the box cut are pinned the
|
|
746
|
+
* same way, on the `layout` in force, the colon-list room, the dash
|
|
747
|
+
* breaks, the compound breaks, the ragged breaking and the space under
|
|
748
|
+
* `:::paragraphs` containers on the `bodyText` in force (the ragged
|
|
749
|
+
* breaking when the merged configuration sets some running text ragged,
|
|
750
|
+
* the container space when it declares a paragraph style), the heading
|
|
751
|
+
* marks and the split under a heading on the `headings` in force, and the
|
|
752
|
+
* drop caps wherever they sit in the merged configuration.
|
|
753
|
+
* @internal `readBundle`'s; hosts call {@link migrateConfig}.
|
|
754
|
+
*/
|
|
755
|
+
export function migrateBundleConfig(base, layers, configVersion, options = {}) {
|
|
756
|
+
const rules = rulesOf(configVersion);
|
|
757
|
+
let merged = { ...base };
|
|
758
|
+
for (const layer of layers) {
|
|
759
|
+
Object.assign(merged, rules < HEADING_BREAK_RULES ? pinLegacyHeadingBreaks(layer) : layer);
|
|
760
|
+
}
|
|
761
|
+
const content = rules < CONFIG_VERSION ? readContent(options.content) : undefined;
|
|
762
|
+
if (rules < MATH_SIZE_RULES && mayHaveMaths(content))
|
|
763
|
+
merged = pinLegacyMathSize(merged);
|
|
764
|
+
if (rules < INLINE_GAP_RULES && mayEmbedResources(content))
|
|
765
|
+
merged = pinLegacyInlineGap(merged);
|
|
766
|
+
if (rules < HEADING_MARKS_RULES && mayHaveHeadingMarks(content))
|
|
767
|
+
merged = pinLegacyHeadingMarks(merged);
|
|
768
|
+
if (rules < DROP_CAP_SIZE_RULES)
|
|
769
|
+
merged = pinLegacyDropCapSize(merged);
|
|
770
|
+
if (rules < COLON_LIST_ROOM_RULES && mayLeadListWithColon(content))
|
|
771
|
+
merged = pinLegacyColonListRoom(merged);
|
|
772
|
+
if (rules < BOX_GAP_RULES && mayEmbedResourcesInBoxes(content))
|
|
773
|
+
merged = pinLegacyBoxResourceGap(merged);
|
|
774
|
+
if (rules < BOX_CHILD_CUT_RULES && mayHaveBoxes(content))
|
|
775
|
+
merged = pinLegacyBoxChildCut(merged);
|
|
776
|
+
if (rules < DASH_BREAK_RULES && mayHaveClosedDashes(content))
|
|
777
|
+
merged = pinLegacyDashBreaks(merged);
|
|
778
|
+
if (rules < RAGGED_BREAKING_RULES)
|
|
779
|
+
merged = pinLegacyRaggedBreaking(merged);
|
|
780
|
+
if (rules < HEADING_SPLIT_RULES && mayHaveHeadings(content))
|
|
781
|
+
merged = pinLegacyHeadingSplit(merged);
|
|
782
|
+
if (rules < PARAGRAPH_CONTAINER_RULES && mayHaveParagraphContainers(content))
|
|
783
|
+
merged = pinLegacyParagraphContainerSpacing(merged);
|
|
784
|
+
if (rules < HYPHEN_BREAK_RULES && mayHaveCompounds(content))
|
|
785
|
+
merged = pinLegacyHyphenBreaks(merged);
|
|
786
|
+
return merged;
|
|
787
|
+
}
|
|
788
|
+
//# sourceMappingURL=configVersion.js.map
|