postext 1.4.2 → 1.5.0
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 +399 -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 +219 -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 +12 -2
- 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 +362 -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,50 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Whether a line may end after the em or en dash `dash`, set closed between
|
|
3
|
+
* `prev` and `next` (the characters around it; undefined at the edge of the
|
|
4
|
+
* text, or where a space stands): "say—that’s", "riddles.—I", "Hamburg–Berlin".
|
|
5
|
+
* `beforePrev` is the character before `prev`, read the same way.
|
|
6
|
+
* The dash is the Unicode line-breaking class B2 (em) or BA (en), both of
|
|
7
|
+
* which allow a break after them. Never after a dash that opens an aside or a
|
|
8
|
+
* line of dialogue: a space before it ("—dijo"), or a space and a quotation
|
|
9
|
+
* mark (`said "—Hola`, German `sagte »—Ich`). A straight quote, `»`, `”` or
|
|
10
|
+
* `’` before the dash may open a quote as well as close one, so it counts as
|
|
11
|
+
* closing only after a letter, a digit or closing punctuation ("\"no\"—and",
|
|
12
|
+
* "boys'—and", "«no»—y"), and `»` also after a no-break space (French
|
|
13
|
+
* "« non »—et"). `“` and `«`, which German and Danish close with, count as
|
|
14
|
+
* closing only after a letter, a digit, `.`, `!`, `?` or `…` ("„nein“—und",
|
|
15
|
+
* "»nej«—og"). Never before punctuation ("él—,"), a quotation mark
|
|
16
|
+
* or a bracket ("thinking—\" and", "says—“no”", "says—(no)"), inside a run of
|
|
17
|
+
* dashes ("——"), or inside a range of numbers set with an en dash
|
|
18
|
+
* ("1914–1918"). A quote after a dash may close the speech as well as open
|
|
19
|
+
* one, and UAX #14 allows no break before it; pretext, which sets plain text
|
|
20
|
+
* line by line, keeps a dash with the quote or bracket after it, so both
|
|
21
|
+
* breakers agree.
|
|
22
|
+
*/
|
|
23
|
+
export declare function breaksAfterDash(prev: string | undefined, dash: string, next: string | undefined, beforePrev?: string): boolean;
|
|
24
|
+
/** Whether `ch` is an em or an en dash. */
|
|
25
|
+
export declare function isDash(ch: string | undefined): boolean;
|
|
26
|
+
/** Whether `text` holds a compound (see {@link COMPOUND_RE}). A soft hyphen
|
|
27
|
+
* next to the hyphen hides it, as it hides it from the breakers. */
|
|
28
|
+
export declare function hasCompound(text: string): boolean;
|
|
29
|
+
/**
|
|
30
|
+
* Whether a line may end after a hyphen the text carries, between `prev`
|
|
31
|
+
* and `next` (the characters around it): between two letters only
|
|
32
|
+
* ("meta-analyses", "UNE-EN"), never in "-5", "1-2" or "pre-(war)". The
|
|
33
|
+
* line then ends on that hyphen and nothing is added.
|
|
34
|
+
*/
|
|
35
|
+
export declare function breaksAfterHardHyphen(prev: string | undefined, next: string | undefined): boolean;
|
|
36
|
+
/**
|
|
37
|
+
* How far a ragged line may fall short of its measure at the cost a
|
|
38
|
+
* justified line pays at its word-spacing limit, in ems of the text: the
|
|
39
|
+
* right-hand "glue" of a ragged setting in Knuth and Plass's model (TeX's
|
|
40
|
+
* `\rightskip` of `0pt plus 3em`). A shorter line costs less, a line short by
|
|
41
|
+
* more than this is priced like one stretched past the limit.
|
|
42
|
+
*/
|
|
43
|
+
export declare const RAGGED_STRETCH_EM = 3;
|
|
44
|
+
/** The size of a CSS font string, in px (the `16px` of `italic 16px Serif`);
|
|
45
|
+
* 16 when it names none. */
|
|
46
|
+
export declare function fontSizePxOf(font: string): number;
|
|
47
|
+
/** The stretch a ragged line of `font` gets in the Knuth–Plass model (see
|
|
48
|
+
* {@link RAGGED_STRETCH_EM}). */
|
|
49
|
+
export declare function raggedStretchPx(font: string): number;
|
|
50
|
+
//# sourceMappingURL=breakRules.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"breakRules.d.ts","sourceRoot":"","sources":["../../src/measure/breakRules.ts"],"names":[],"mappings":"AAyCA;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,eAAe,CAC7B,IAAI,EAAE,MAAM,GAAG,SAAS,EACxB,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,GAAG,SAAS,EACxB,UAAU,CAAC,EAAE,MAAM,GAClB,OAAO,CAOT;AAED,2CAA2C;AAC3C,wBAAgB,MAAM,CAAC,EAAE,EAAE,MAAM,GAAG,SAAS,GAAG,OAAO,CAEtD;AAQD;qEACqE;AACrE,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAEjD;AAED;;;;;GAKG;AACH,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,EAAE,IAAI,EAAE,MAAM,GAAG,SAAS,GAAG,OAAO,CAEjG;AAED;;;;;;GAMG;AACH,eAAO,MAAM,iBAAiB,IAAI,CAAC;AAEnC;6BAC6B;AAC7B,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAIjD;AAED;kCACkC;AAClC,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAEpD"}
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
// Break opportunities and costs shared by the plain and the rich line
|
|
2
|
+
// breakers.
|
|
3
|
+
const EM_DASH = '—';
|
|
4
|
+
const EN_DASH = '–';
|
|
5
|
+
/** What may stand right before a closed dash a line breaks after: a letter,
|
|
6
|
+
* a digit, or punctuation that closes ("riddles.—I", "so,—and", "(1914)—the"). */
|
|
7
|
+
const BEFORE_DASH_RE = /[\p{L}\p{N}.,;:!?)\]}»”’"'“«…]/u;
|
|
8
|
+
/** The marks of {@link BEFORE_DASH_RE} that may open a quote as well as
|
|
9
|
+
* close one: a straight quote, `»` (German opens with it), `”` (Swedish and
|
|
10
|
+
* Finnish open with it), `’`, and `“` and `«`, which German and Danish
|
|
11
|
+
* close with („nein“, »nej«) and English and Spanish open with. */
|
|
12
|
+
const QUOTE_BEFORE_DASH_RE = /["'»”’“«]/u;
|
|
13
|
+
/** What must stand before such a quote for it to close a word: a letter, a
|
|
14
|
+
* digit or closing punctuation ("no"—and, “no.”—and, boys'—and). */
|
|
15
|
+
const BEFORE_CLOSING_QUOTE_RE = /[\p{L}\p{N}.,;:!?)\]}…]/u;
|
|
16
|
+
/** What must stand before `“` or `«` for it to close a word: a letter, a
|
|
17
|
+
* digit, or a stop that ends the quoted words („nein“—und, „Nein!“—und,
|
|
18
|
+
* »nej«—og). A comma, colon or bracket before them is taken for the start
|
|
19
|
+
* of a quote. */
|
|
20
|
+
const BEFORE_CLOSING_OPENER_RE = /[\p{L}\p{N}.!?…]/u;
|
|
21
|
+
/** French sets a no-break space inside its guillemets: `»` after one closes
|
|
22
|
+
* a quote (`« non »—et`). */
|
|
23
|
+
const NO_BREAK_SPACE_RE = /[\u00A0\u202F]/u;
|
|
24
|
+
/** What may follow a dash a line breaks after: a letter or a digit. Not a
|
|
25
|
+
* quotation mark, which after a dash often closes the speech the dash broke
|
|
26
|
+
* off (`thinking—" and`, German `dachte—“ sagte`), nor an opening bracket
|
|
27
|
+
* or `¿`, which pretext keeps with the dash in plain text. */
|
|
28
|
+
const AFTER_DASH_RE = /[\p{L}\p{N}]/u;
|
|
29
|
+
const DIGIT_RE = /\p{N}/u;
|
|
30
|
+
/** Whether the quotation mark `quote`, with `before` standing right before
|
|
31
|
+
* it, closes a word (see {@link QUOTE_BEFORE_DASH_RE}). */
|
|
32
|
+
function closesQuote(quote, before) {
|
|
33
|
+
if (before === undefined)
|
|
34
|
+
return false;
|
|
35
|
+
if (quote === '“' || quote === '«')
|
|
36
|
+
return BEFORE_CLOSING_OPENER_RE.test(before);
|
|
37
|
+
return BEFORE_CLOSING_QUOTE_RE.test(before) || (quote === '»' && NO_BREAK_SPACE_RE.test(before));
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Whether a line may end after the em or en dash `dash`, set closed between
|
|
41
|
+
* `prev` and `next` (the characters around it; undefined at the edge of the
|
|
42
|
+
* text, or where a space stands): "say—that’s", "riddles.—I", "Hamburg–Berlin".
|
|
43
|
+
* `beforePrev` is the character before `prev`, read the same way.
|
|
44
|
+
* The dash is the Unicode line-breaking class B2 (em) or BA (en), both of
|
|
45
|
+
* which allow a break after them. Never after a dash that opens an aside or a
|
|
46
|
+
* line of dialogue: a space before it ("—dijo"), or a space and a quotation
|
|
47
|
+
* mark (`said "—Hola`, German `sagte »—Ich`). A straight quote, `»`, `”` or
|
|
48
|
+
* `’` before the dash may open a quote as well as close one, so it counts as
|
|
49
|
+
* closing only after a letter, a digit or closing punctuation ("\"no\"—and",
|
|
50
|
+
* "boys'—and", "«no»—y"), and `»` also after a no-break space (French
|
|
51
|
+
* "« non »—et"). `“` and `«`, which German and Danish close with, count as
|
|
52
|
+
* closing only after a letter, a digit, `.`, `!`, `?` or `…` ("„nein“—und",
|
|
53
|
+
* "»nej«—og"). Never before punctuation ("él—,"), a quotation mark
|
|
54
|
+
* or a bracket ("thinking—\" and", "says—“no”", "says—(no)"), inside a run of
|
|
55
|
+
* dashes ("——"), or inside a range of numbers set with an en dash
|
|
56
|
+
* ("1914–1918"). A quote after a dash may close the speech as well as open
|
|
57
|
+
* one, and UAX #14 allows no break before it; pretext, which sets plain text
|
|
58
|
+
* line by line, keeps a dash with the quote or bracket after it, so both
|
|
59
|
+
* breakers agree.
|
|
60
|
+
*/
|
|
61
|
+
export function breaksAfterDash(prev, dash, next, beforePrev) {
|
|
62
|
+
if (dash !== EM_DASH && dash !== EN_DASH)
|
|
63
|
+
return false;
|
|
64
|
+
if (prev === undefined || next === undefined)
|
|
65
|
+
return false;
|
|
66
|
+
if (!BEFORE_DASH_RE.test(prev) || !AFTER_DASH_RE.test(next))
|
|
67
|
+
return false;
|
|
68
|
+
if (QUOTE_BEFORE_DASH_RE.test(prev) && !closesQuote(prev, beforePrev))
|
|
69
|
+
return false;
|
|
70
|
+
if (dash === EN_DASH && DIGIT_RE.test(prev) && DIGIT_RE.test(next))
|
|
71
|
+
return false;
|
|
72
|
+
return true;
|
|
73
|
+
}
|
|
74
|
+
/** Whether `ch` is an em or an en dash. */
|
|
75
|
+
export function isDash(ch) {
|
|
76
|
+
return ch === EM_DASH || ch === EN_DASH;
|
|
77
|
+
}
|
|
78
|
+
const LETTER_RE = /\p{L}/u;
|
|
79
|
+
/** A compound: a hyphen between two letters ("after-dinner", "vencer-se"),
|
|
80
|
+
* where {@link breaksAfterHardHyphen} lets a line end. */
|
|
81
|
+
const COMPOUND_RE = /\p{L}-\p{L}/u;
|
|
82
|
+
/** Whether `text` holds a compound (see {@link COMPOUND_RE}). A soft hyphen
|
|
83
|
+
* next to the hyphen hides it, as it hides it from the breakers. */
|
|
84
|
+
export function hasCompound(text) {
|
|
85
|
+
return text.includes('-') && COMPOUND_RE.test(text);
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* Whether a line may end after a hyphen the text carries, between `prev`
|
|
89
|
+
* and `next` (the characters around it): between two letters only
|
|
90
|
+
* ("meta-analyses", "UNE-EN"), never in "-5", "1-2" or "pre-(war)". The
|
|
91
|
+
* line then ends on that hyphen and nothing is added.
|
|
92
|
+
*/
|
|
93
|
+
export function breaksAfterHardHyphen(prev, next) {
|
|
94
|
+
return prev !== undefined && next !== undefined && LETTER_RE.test(prev) && LETTER_RE.test(next);
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* How far a ragged line may fall short of its measure at the cost a
|
|
98
|
+
* justified line pays at its word-spacing limit, in ems of the text: the
|
|
99
|
+
* right-hand "glue" of a ragged setting in Knuth and Plass's model (TeX's
|
|
100
|
+
* `\rightskip` of `0pt plus 3em`). A shorter line costs less, a line short by
|
|
101
|
+
* more than this is priced like one stretched past the limit.
|
|
102
|
+
*/
|
|
103
|
+
export const RAGGED_STRETCH_EM = 3;
|
|
104
|
+
/** The size of a CSS font string, in px (the `16px` of `italic 16px Serif`);
|
|
105
|
+
* 16 when it names none. */
|
|
106
|
+
export function fontSizePxOf(font) {
|
|
107
|
+
const m = /(\d*\.?\d+)px/.exec(font);
|
|
108
|
+
const size = m ? Number(m[1]) : 16;
|
|
109
|
+
return Number.isFinite(size) && size > 0 ? size : 16;
|
|
110
|
+
}
|
|
111
|
+
/** The stretch a ragged line of `font` gets in the Knuth–Plass model (see
|
|
112
|
+
* {@link RAGGED_STRETCH_EM}). */
|
|
113
|
+
export function raggedStretchPx(font) {
|
|
114
|
+
return RAGGED_STRETCH_EM * fontSizePxOf(font);
|
|
115
|
+
}
|
|
116
|
+
//# sourceMappingURL=breakRules.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"breakRules.js","sourceRoot":"","sources":["../../src/measure/breakRules.ts"],"names":[],"mappings":"AAAA,sEAAsE;AACtE,YAAY;AAEZ,MAAM,OAAO,GAAG,GAAG,CAAC;AACpB,MAAM,OAAO,GAAG,GAAG,CAAC;AAEpB;mFACmF;AACnF,MAAM,cAAc,GAAG,iCAAiC,CAAC;AACzD;;;oEAGoE;AACpE,MAAM,oBAAoB,GAAG,YAAY,CAAC;AAC1C;qEACqE;AACrE,MAAM,uBAAuB,GAAG,0BAA0B,CAAC;AAC3D;;;kBAGkB;AAClB,MAAM,wBAAwB,GAAG,mBAAmB,CAAC;AACrD;8BAC8B;AAC9B,MAAM,iBAAiB,GAAG,iBAAiB,CAAC;AAE5C;;;+DAG+D;AAC/D,MAAM,aAAa,GAAG,eAAe,CAAC;AACtC,MAAM,QAAQ,GAAG,QAAQ,CAAC;AAE1B;4DAC4D;AAC5D,SAAS,WAAW,CAAC,KAAa,EAAE,MAA0B;IAC5D,IAAI,MAAM,KAAK,SAAS;QAAE,OAAO,KAAK,CAAC;IACvC,IAAI,KAAK,KAAK,GAAG,IAAI,KAAK,KAAK,GAAG;QAAE,OAAO,wBAAwB,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IACjF,OAAO,uBAAuB,CAAC,IAAI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AAC,IAAwB,EAAE,IAAwB;IACtF,OAAO,IAAI,KAAK,SAAS,IAAI,IAAI,KAAK,SAAS,IAAI,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAClG,CAAC;AAED;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,CAAC;AAEnC;6BAC6B;AAC7B,MAAM,UAAU,YAAY,CAAC,IAAY;IACvC,MAAM,CAAC,GAAG,eAAe,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACrC,MAAM,IAAI,GAAG,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;IACnC,OAAO,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,IAAI,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC;AACvD,CAAC;AAED;kCACkC;AAClC,MAAM,UAAU,eAAe,CAAC,IAAY;IAC1C,OAAO,iBAAiB,GAAG,YAAY,CAAC,IAAI,CAAC,CAAC;AAChD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cache.d.ts","sourceRoot":"","sources":["../../src/measure/cache.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAC3C,OAAO,KAAK,EAAE,aAAa,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"cache.d.ts","sourceRoot":"","sources":["../../src/measure/cache.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAC3C,OAAO,KAAK,EAAE,aAAa,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAkEpF,wBAAgB,kBAAkB,CAChC,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,EACZ,UAAU,EAAE,MAAM,EAClB,YAAY,EAAE,MAAM,EACpB,OAAO,EAAE,mBAAmB,GAAG,SAAS,EACxC,KAAK,EAAE,gBAAgB,GACtB,aAAa,CAOf;AAED,wBAAgB,sBAAsB,CACpC,KAAK,EAAE,UAAU,EAAE,EACnB,UAAU,EAAE,MAAM,EAClB,QAAQ,EAAE,MAAM,EAChB,UAAU,EAAE,MAAM,EAClB,cAAc,EAAE,MAAM,EACtB,UAAU,EAAE,MAAM,EAClB,YAAY,EAAE,MAAM,EACpB,OAAO,EAAE,mBAAmB,GAAG,SAAS,EACxC,KAAK,EAAE,gBAAgB,GACtB,aAAa,CAOf"}
|
package/dist/measure/cache.js
CHANGED
|
@@ -1,26 +1,47 @@
|
|
|
1
1
|
import { measureBlock } from './plain';
|
|
2
2
|
import { measureRichBlock } from './rich';
|
|
3
|
+
import { getHyphenationLocale } from '../hyphenate';
|
|
4
|
+
/** Options that change a block's lines, joined into its cache key. The
|
|
5
|
+
* active hyphenation dictionary is one: soft hyphens (and the syllables an
|
|
6
|
+
* overlong word is divided at) depend on it. */
|
|
7
|
+
function optionsKey(options) {
|
|
8
|
+
return `${options?.textAlign ?? ''}\x00${options?.hyphenate ?? ''}\x00${options?.firstLineIndentPx ?? ''}\x00${options?.hangingIndent ?? ''}\x00${options?.optimal ?? ''}\x00${options?.maxStretchRatio ?? ''}\x00${options?.minShrinkRatio ?? ''}\x00${options?.runtPenalty ?? ''}\x00${options?.runtMinCharacters ?? ''}\x00${options?.looseness ?? ''}\x00${options?.letterSpacingPx ?? ''}\x00${options?.hyphenationZonePx ?? ''}\x00${getHyphenationLocale()}${options?.justifyTrackingPx ? `\x00${options.justifyTrackingPx}` : ''}${options?.runtGraded ? '\x00rg' : ''}${options?.avoidHyphenAtLines?.length ? `\x00ah${options.avoidHyphenAtLines.join(',')}` : ''}`;
|
|
9
|
+
}
|
|
3
10
|
function buildPlainCacheKey(text, font, maxWidthPx, lineHeightPx, options) {
|
|
4
|
-
return `${text}\x00${font}\x00${maxWidthPx}\x00${lineHeightPx}\x00${options
|
|
11
|
+
return `${text}\x00${font}\x00${maxWidthPx}\x00${lineHeightPx}\x00${optionsKey(options)}`;
|
|
5
12
|
}
|
|
6
13
|
/** A chip is one placeholder char in the span text: its words and resolved
|
|
7
14
|
* box decide its measure, so they join the key. */
|
|
8
15
|
function chipCacheKey(chip) {
|
|
9
|
-
const words = chip.spans.map((s) => `${s.text}~${s.bold}~${s.italic}~${s.script ?? ''}`).join('~');
|
|
16
|
+
const words = chip.spans.map((s) => `${s.text}~${s.bold}~${s.italic}~${s.script ?? ''}${s.smallCaps ? '~sc' : ''}`).join('~');
|
|
10
17
|
return `|chip:${words}|${chip.box ? JSON.stringify(chip.box) : ''}`;
|
|
11
18
|
}
|
|
19
|
+
/** A formula is one placeholder char in the span text too: its TeX decides
|
|
20
|
+
* what is painted, and its render's size (which follows the maths font
|
|
21
|
+
* scale, or is a placeholder's before the engine is ready) its measure. */
|
|
22
|
+
function mathCacheKey(span) {
|
|
23
|
+
const render = span.mathRender;
|
|
24
|
+
return `|m:${span.math.tex}${render ? `|${render.widthPx}x${render.heightPx}` : ''}`;
|
|
25
|
+
}
|
|
12
26
|
function buildRichCacheKey(spans, fonts, maxWidthPx, lineHeightPx, options) {
|
|
13
|
-
|
|
14
|
-
|
|
27
|
+
// Script and small-caps marks change the measure of the same text, and a
|
|
28
|
+
// formula or a swatch colour what a placeholder paints: they join the key
|
|
29
|
+
// only when set, so the common keys are unchanged.
|
|
30
|
+
const spanKey = spans.map((s) => `${s.text}|${s.bold}|${s.italic}|${s.ref?.resourceId ?? ''}${s.chip ? chipCacheKey(s.chip) : ''}${s.math ? mathCacheKey(s) : ''}${s.swatch ? `|sw:${s.swatch.color}` : ''}${s.script ? `|${s.script}` : ''}${s.smallCaps ? '|sc' : ''}`).join('\x01');
|
|
31
|
+
return `R\x00${spanKey}\x00${fonts[0]}\x00${fonts[1]}\x00${fonts[2]}\x00${fonts[3]}\x00${maxWidthPx}\x00${lineHeightPx}\x00${optionsKey(options)}`;
|
|
15
32
|
}
|
|
33
|
+
/** A cached result must read exactly like a fresh measure: the block's own
|
|
34
|
+
* fields (`totalHeight`, `lastLineRunt`, whatever it gains) are carried
|
|
35
|
+
* whole, and only the lines — which the pipeline shifts and stamps — are
|
|
36
|
+
* copied. */
|
|
16
37
|
function cloneMeasuredBlock(block) {
|
|
17
38
|
return {
|
|
39
|
+
...block,
|
|
18
40
|
lines: block.lines.map((l) => ({
|
|
19
41
|
...l,
|
|
20
42
|
bbox: { ...l.bbox },
|
|
21
43
|
segments: l.segments ? l.segments.map((s) => ({ ...s })) : undefined,
|
|
22
44
|
})),
|
|
23
|
-
totalHeight: block.totalHeight,
|
|
24
45
|
};
|
|
25
46
|
}
|
|
26
47
|
export function cachedMeasureBlock(text, font, maxWidthPx, lineHeightPx, options, cache) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cache.js","sourceRoot":"","sources":["../../src/measure/cache.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,gBAAgB,EAAE,MAAM,QAAQ,CAAC;
|
|
1
|
+
{"version":3,"file":"cache.js","sourceRoot":"","sources":["../../src/measure/cache.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,gBAAgB,EAAE,MAAM,QAAQ,CAAC;AAC1C,OAAO,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AAEpD;;iDAEiD;AACjD,SAAS,UAAU,CAAC,OAAwC;IAC1D,OAAO,GAAG,OAAO,EAAE,SAAS,IAAI,EAAE,OAAO,OAAO,EAAE,SAAS,IAAI,EAAE,OAAO,OAAO,EAAE,iBAAiB,IAAI,EAAE,OAAO,OAAO,EAAE,aAAa,IAAI,EAAE,OAAO,OAAO,EA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AAM,CAAC,CAAC;IAC/B,OAAO,kBAAkB,CAAC,MAAM,CAAC,CAAC;AACpC,CAAC;AAED,MAAM,UAAU,sBAAsB,CACpC,KAAmB,EACnB,UAAkB,EAClB,QAAgB,EAChB,UAAkB,EAClB,cAAsB,EACtB,UAAkB,EAClB,YAAoB,EACpB,OAAwC,EACxC,KAAuB;IAEvB,MAAM,GAAG,GAAG,iBAAiB,CAAC,KAAK,EAAE,CAAC,UAAU,EAAE,QAAQ,EAAE,UAAU,EAAE,cAAc,CAAC,EAAE,UAAU,EAAE,YAAY,EAAE,OAAO,CAAC,CAAC;IAC5H,MAAM,MAAM,GAAG,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IACtC,IAAI,MAAM;QAAE,OAAO,kBAAkB,CAAC,MAAM,CAAC,CAAC;IAC9C,MAAM,MAAM,GAAG,gBAAgB,CAAC,KAAK,EAAE,UAAU,EAAE,QAAQ,EAAE,UAAU,EAAE,cAAc,EAAE,UAAU,EAAE,YAAY,EAAE,OAAO,CAAC,CAAC;IAC5H,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC;IAC/B,OAAO,kBAAkB,CAAC,MAAM,CAAC,CAAC;AACpC,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/** Whether the text holds any CJK character. */
|
|
2
|
+
export declare function hasCJK(text: string): boolean;
|
|
3
|
+
/** Whether the text holds words set without spaces between them (see
|
|
4
|
+
* {@link CJK_RUN_RE}), which only a first-fit breaker can divide: optimal
|
|
5
|
+
* line breaking breaks at spaces and hyphenation points. */
|
|
6
|
+
export declare function hasCJKRun(text: string): boolean;
|
|
7
|
+
/**
|
|
8
|
+
* Where a line may break inside a run of text with no spaces, as pretext's
|
|
9
|
+
* own breaker finds it: between two characters when either is CJK. Pretext's
|
|
10
|
+
* segments carry its kinsoku rules, so no line starts with closing
|
|
11
|
+
* punctuation (。、」ー…) and none ends with an opening bracket (「(…).
|
|
12
|
+
* Offsets into `text`, ascending; none when the run holds no CJK.
|
|
13
|
+
*/
|
|
14
|
+
export declare function cjkBreakIndices(text: string, font: string): number[];
|
|
15
|
+
/** Whether a line may break where two runs meet with no space between them
|
|
16
|
+
* (`**日本**語`): only between ideographs, under the same kinsoku rules as
|
|
17
|
+
* inside a run. */
|
|
18
|
+
export declare function cjkJoinBreaks(left: string, right: string, font: string): boolean;
|
|
19
|
+
//# sourceMappingURL=cjk.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cjk.d.ts","sourceRoot":"","sources":["../../src/measure/cjk.ts"],"names":[],"mappings":"AAUA,gDAAgD;AAChD,wBAAgB,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAE5C;AAUD;;6DAE6D;AAC7D,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAE/C;AAED;;;;;;GAMG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,CAYpE;AAED;;oBAEoB;AACpB,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAKhF"}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { prepareWithSegments } from '@chenglou/pretext';
|
|
2
|
+
/**
|
|
3
|
+
* Chinese, Japanese and Korean: scripts set without spaces between words.
|
|
4
|
+
* The ranges pretext's line breaker treats as breakable between characters
|
|
5
|
+
* (CJK punctuation and fullwidth forms included), so the plain and the rich
|
|
6
|
+
* breaker agree on where such text may break.
|
|
7
|
+
*/
|
|
8
|
+
const CJK_RE = /[\u3000-\u30FF\u3130-\u318F\u3400-\u4DBF\u4E00-\u9FFF\uAC00-\uD7AF\uF900-\uFAFF\uFF00-\uFFEF\u{20000}-\u{2A6DF}\u{2A700}-\u{2EE5D}\u{2F800}-\u{2FA1F}\u{30000}-\u{33479}]/u;
|
|
9
|
+
/** Whether the text holds any CJK character. */
|
|
10
|
+
export function hasCJK(text) {
|
|
11
|
+
return CJK_RE.test(text);
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Words set without spaces: two ideographs, kana or hangul syllables in a
|
|
15
|
+
* row (the iteration marks 々 〆 〇 count as ideographs). CJK punctuation,
|
|
16
|
+
* brackets (〈 「), the middle dot ・ alone and fullwidth signs (% +) do
|
|
17
|
+
* not: quoted in Latin text they need no break between characters.
|
|
18
|
+
*/
|
|
19
|
+
const CJK_RUN_RE = /[\u3005-\u3007\u3040-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3400-\u4DBF\u4E00-\u9FFF\uAC00-\uD7AF\uF900-\uFAFF\uFF66-\uFF9F\u{20000}-\u{2A6DF}\u{2A700}-\u{2EE5D}\u{2F800}-\u{2FA1F}\u{30000}-\u{33479}]{2}/u;
|
|
20
|
+
/** Whether the text holds words set without spaces between them (see
|
|
21
|
+
* {@link CJK_RUN_RE}), which only a first-fit breaker can divide: optimal
|
|
22
|
+
* line breaking breaks at spaces and hyphenation points. */
|
|
23
|
+
export function hasCJKRun(text) {
|
|
24
|
+
return CJK_RUN_RE.test(text);
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Where a line may break inside a run of text with no spaces, as pretext's
|
|
28
|
+
* own breaker finds it: between two characters when either is CJK. Pretext's
|
|
29
|
+
* segments carry its kinsoku rules, so no line starts with closing
|
|
30
|
+
* punctuation (。、」ー…) and none ends with an opening bracket (「(…).
|
|
31
|
+
* Offsets into `text`, ascending; none when the run holds no CJK.
|
|
32
|
+
*/
|
|
33
|
+
export function cjkBreakIndices(text, font) {
|
|
34
|
+
if (!CJK_RE.test(text))
|
|
35
|
+
return [];
|
|
36
|
+
const segments = prepareWithSegments(text, font).segments;
|
|
37
|
+
if (segments.join('') !== text)
|
|
38
|
+
return [];
|
|
39
|
+
const out = [];
|
|
40
|
+
let at = 0;
|
|
41
|
+
for (let k = 0; k < segments.length; k++) {
|
|
42
|
+
const seg = segments[k];
|
|
43
|
+
if (k > 0 && at > 0 && (CJK_RE.test(lastChar(segments[k - 1])) || CJK_RE.test(firstChar(seg))))
|
|
44
|
+
out.push(at);
|
|
45
|
+
at += seg.length;
|
|
46
|
+
}
|
|
47
|
+
return out;
|
|
48
|
+
}
|
|
49
|
+
/** Whether a line may break where two runs meet with no space between them
|
|
50
|
+
* (`**日本**語`): only between ideographs, under the same kinsoku rules as
|
|
51
|
+
* inside a run. */
|
|
52
|
+
export function cjkJoinBreaks(left, right, font) {
|
|
53
|
+
const a = lastChar(left);
|
|
54
|
+
const b = firstChar(right);
|
|
55
|
+
if (a === '' || b === '')
|
|
56
|
+
return false;
|
|
57
|
+
return cjkBreakIndices(a + b, font).length > 0;
|
|
58
|
+
}
|
|
59
|
+
function firstChar(text) {
|
|
60
|
+
const cp = text.codePointAt(0);
|
|
61
|
+
return cp === undefined ? '' : String.fromCodePoint(cp);
|
|
62
|
+
}
|
|
63
|
+
function lastChar(text) {
|
|
64
|
+
if (text.length === 0)
|
|
65
|
+
return '';
|
|
66
|
+
const low = text.charCodeAt(text.length - 1);
|
|
67
|
+
const start = low >= 0xdc00 && low <= 0xdfff && text.length > 1 ? text.length - 2 : text.length - 1;
|
|
68
|
+
return text.slice(start);
|
|
69
|
+
}
|
|
70
|
+
//# sourceMappingURL=cjk.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cjk.js","sourceRoot":"","sources":["../../src/measure/cjk.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAExD;;;;;GAKG;AACH,MAAM,MAAM,GAAG,4KAA4K,CAAC;AAE5L,gDAAgD;AAChD,MAAM,UAAU,MAAM,CAAC,IAAY;IACjC,OAAO,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC3B,CAAC;AAED;;;;;GAKG;AACH,M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AC;IAC3B,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE;QAAE,OAAO,KAAK,CAAC;IACvC,OAAO,eAAe,CAAC,CAAC,GAAG,CAAC,EAAE,IAAI,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC;AACjD,CAAC;AAED,SAAS,SAAS,CAAC,IAAY;IAC7B,MAAM,EAAE,GAAG,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC;IAC/B,OAAO,EAAE,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,aAAa,CAAC,EAAE,CAAC,CAAC;AAC1D,CAAC;AAED,SAAS,QAAQ,CAAC,IAAY;IAC5B,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,EAAE,CAAC;IACjC,MAAM,GAAG,GAAG,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;IAC7C,MAAM,KAAK,GAAG,GAAG,IAAI,MAAM,IAAI,GAAG,IAAI,MAAM,IAAI,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC;IACpG,OAAO,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;AAC3B,CAAC"}
|
package/dist/measure/font.d.ts
CHANGED
|
@@ -1,24 +1,40 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { LocaleTag } from '../types';
|
|
2
2
|
import type { MeasurementCache } from './types';
|
|
3
3
|
/**
|
|
4
4
|
* Build a CSS font shorthand string for canvas / pretext.
|
|
5
5
|
* Example: "75px EB Garamond"
|
|
6
6
|
*/
|
|
7
7
|
export declare function buildFontString(fontFamily: string, fontSizePx: number, weight?: string, style?: string): string;
|
|
8
|
+
/** Whether a `fontFamily` value is a CSS font stack (`'EB Garamond',
|
|
9
|
+
* Georgia, serif`) rather than one family: it has a comma outside quotes. */
|
|
10
|
+
export declare function isFontStack(fontFamily: string): boolean;
|
|
11
|
+
/**
|
|
12
|
+
* The one family a `fontFamily` value sets text in. A `fontFamily` names a
|
|
13
|
+
* single family: canvas, HTML and PDF must measure and paint the same face,
|
|
14
|
+
* and the PDF embeds a font per family, with no fallback chain. A CSS font
|
|
15
|
+
* stack is therefore cut to its first family (`'EB Garamond', serif` →
|
|
16
|
+
* `EB Garamond`) instead of being read as one family whose name has a
|
|
17
|
+
* comma in it — which matched no face and measured with a fallback font.
|
|
18
|
+
* Any other value comes back unchanged (a comma inside quotes is part of
|
|
19
|
+
* the name).
|
|
20
|
+
*/
|
|
21
|
+
export declare function primaryFontFamily(fontFamily: string): string;
|
|
8
22
|
/**
|
|
9
23
|
* A family name the CSS font shorthand would not take bare — a word that
|
|
10
24
|
* starts with a digit ("Optima 105", "DIN Pro 120"), a character outside
|
|
11
25
|
* letters, digits, spaces, hyphens and underscores — goes in double quotes;
|
|
12
26
|
* canvas silently ignores the whole shorthand otherwise. Plain names stay
|
|
13
27
|
* bare (the existing font-string cache keys), and a name already quoted is
|
|
14
|
-
* left alone.
|
|
28
|
+
* left alone. A font stack sets in its first family (see
|
|
29
|
+
* {@link primaryFontFamily}).
|
|
15
30
|
*/
|
|
16
31
|
export declare function quoteFamily(fontFamily: string): string;
|
|
17
32
|
/**
|
|
18
|
-
* Initializes the hyphenator for a given locale
|
|
19
|
-
* Must be called before measureBlock is used with
|
|
33
|
+
* Initializes the hyphenator for a given locale (any BCP 47 tag; see
|
|
34
|
+
* `matchHyphenationLocale`). Must be called before measureBlock is used with
|
|
35
|
+
* hyphenation.
|
|
20
36
|
*/
|
|
21
|
-
export declare function initHyphenator(locale:
|
|
37
|
+
export declare function initHyphenator(locale: LocaleTag): void;
|
|
22
38
|
/**
|
|
23
39
|
* Clear pretext's internal measurement caches and the engine's own
|
|
24
40
|
* text-width cache. Call this after fonts finish loading (or are removed)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"font.d.ts","sourceRoot":"","sources":["../../src/measure/font.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"font.d.ts","sourceRoot":"","sources":["../../src/measure/font.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAG1C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAEhD;;;GAGG;AACH,wBAAgB,eAAe,CAC7B,UAAU,EAAE,MAAM,EAClB,UAAU,EAAE,MAAM,EAClB,MAAM,GAAE,MAAiB,EACzB,KAAK,GAAE,MAAiB,GACvB,MAAM,CAOR;AAgCD;8EAC8E;AAC9E,wBAAgB,WAAW,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAEvD;AAED;;;;;;;;;GASG;AACH,wBAAgB,iBAAiB,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CAG5D;AAED;;;;;;;;GAQG;AACH,wBAAgB,WAAW,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CAKtD;AAED;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,MAAM,EAAE,SAAS,GAAG,IAAI,CAEtD;AAED;;;;GAIG;AACH,wBAAgB,qBAAqB,IAAI,IAAI,CAG5C;AAED,wBAAgB,sBAAsB,IAAI,gBAAgB,CAEzD"}
|
package/dist/measure/font.js
CHANGED
|
@@ -15,16 +15,72 @@ export function buildFontString(fontFamily, fontSizePx, weight = 'normal', style
|
|
|
15
15
|
parts.push(quoteFamily(fontFamily));
|
|
16
16
|
return parts.join(' ');
|
|
17
17
|
}
|
|
18
|
+
/** The families of a CSS font stack, split at the commas outside quotes,
|
|
19
|
+
* trimmed and unquoted, empty entries dropped — or `undefined` when the
|
|
20
|
+
* value has no comma outside quotes (it names one family). */
|
|
21
|
+
function stackFamilies(fontFamily) {
|
|
22
|
+
const out = [];
|
|
23
|
+
let quote;
|
|
24
|
+
let start = 0;
|
|
25
|
+
let split = false;
|
|
26
|
+
const push = (end) => {
|
|
27
|
+
let f = fontFamily.slice(start, end).trim();
|
|
28
|
+
if (f.length >= 2 && /^["']/.test(f) && f.endsWith(f[0]))
|
|
29
|
+
f = f.slice(1, -1).trim();
|
|
30
|
+
if (f.length > 0)
|
|
31
|
+
out.push(f);
|
|
32
|
+
};
|
|
33
|
+
for (let i = 0; i < fontFamily.length; i++) {
|
|
34
|
+
const c = fontFamily[i];
|
|
35
|
+
if (quote) {
|
|
36
|
+
if (c === quote)
|
|
37
|
+
quote = undefined;
|
|
38
|
+
}
|
|
39
|
+
else if (c === '"' || c === "'") {
|
|
40
|
+
quote = c;
|
|
41
|
+
}
|
|
42
|
+
else if (c === ',') {
|
|
43
|
+
push(i);
|
|
44
|
+
start = i + 1;
|
|
45
|
+
split = true;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
if (!split)
|
|
49
|
+
return undefined;
|
|
50
|
+
push(fontFamily.length);
|
|
51
|
+
return out;
|
|
52
|
+
}
|
|
53
|
+
/** Whether a `fontFamily` value is a CSS font stack (`'EB Garamond',
|
|
54
|
+
* Georgia, serif`) rather than one family: it has a comma outside quotes. */
|
|
55
|
+
export function isFontStack(fontFamily) {
|
|
56
|
+
return fontFamily.includes(',') && (stackFamilies(fontFamily)?.length ?? 0) > 0;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* The one family a `fontFamily` value sets text in. A `fontFamily` names a
|
|
60
|
+
* single family: canvas, HTML and PDF must measure and paint the same face,
|
|
61
|
+
* and the PDF embeds a font per family, with no fallback chain. A CSS font
|
|
62
|
+
* stack is therefore cut to its first family (`'EB Garamond', serif` →
|
|
63
|
+
* `EB Garamond`) instead of being read as one family whose name has a
|
|
64
|
+
* comma in it — which matched no face and measured with a fallback font.
|
|
65
|
+
* Any other value comes back unchanged (a comma inside quotes is part of
|
|
66
|
+
* the name).
|
|
67
|
+
*/
|
|
68
|
+
export function primaryFontFamily(fontFamily) {
|
|
69
|
+
if (!fontFamily.includes(','))
|
|
70
|
+
return fontFamily;
|
|
71
|
+
return stackFamilies(fontFamily)?.[0] ?? fontFamily;
|
|
72
|
+
}
|
|
18
73
|
/**
|
|
19
74
|
* A family name the CSS font shorthand would not take bare — a word that
|
|
20
75
|
* starts with a digit ("Optima 105", "DIN Pro 120"), a character outside
|
|
21
76
|
* letters, digits, spaces, hyphens and underscores — goes in double quotes;
|
|
22
77
|
* canvas silently ignores the whole shorthand otherwise. Plain names stay
|
|
23
78
|
* bare (the existing font-string cache keys), and a name already quoted is
|
|
24
|
-
* left alone.
|
|
79
|
+
* left alone. A font stack sets in its first family (see
|
|
80
|
+
* {@link primaryFontFamily}).
|
|
25
81
|
*/
|
|
26
82
|
export function quoteFamily(fontFamily) {
|
|
27
|
-
const f = fontFamily.trim();
|
|
83
|
+
const f = primaryFontFamily(fontFamily).trim();
|
|
28
84
|
if (/^["'].*["']$/.test(f))
|
|
29
85
|
return f;
|
|
30
86
|
if (/(^|\s)\d/.test(f) || /[^\w\s-]/.test(f))
|
|
@@ -32,8 +88,9 @@ export function quoteFamily(fontFamily) {
|
|
|
32
88
|
return f;
|
|
33
89
|
}
|
|
34
90
|
/**
|
|
35
|
-
* Initializes the hyphenator for a given locale
|
|
36
|
-
* Must be called before measureBlock is used with
|
|
91
|
+
* Initializes the hyphenator for a given locale (any BCP 47 tag; see
|
|
92
|
+
* `matchHyphenationLocale`). Must be called before measureBlock is used with
|
|
93
|
+
* hyphenation.
|
|
37
94
|
*/
|
|
38
95
|
export function initHyphenator(locale) {
|
|
39
96
|
setHyphenationLocale(locale);
|
package/dist/measure/font.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"font.js","sourceRoot":"","sources":["../../src/measure/font.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAE/C,OAAO,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AACp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,EAAE,OAAO,EAAE,IAAI,GAAG,EAAE,EAAE,CAAC;AAChC,CAAC"}
|
package/dist/measure/index.d.ts
CHANGED
|
@@ -1,7 +1,21 @@
|
|
|
1
|
-
|
|
1
|
+
import type { InlineSpan } from '../parse';
|
|
2
|
+
import type { MeasuredBlock, MeasurementCache, MeasureBlockOptions } from './types';
|
|
3
|
+
export type { BreakTrace, LineWidthStep, MeasuredBlock, MeasurementCache, MeasureBlockOptions } from './types';
|
|
2
4
|
export { buildFontString, initHyphenator, clearMeasurementCache, createMeasurementCache } from './font';
|
|
3
5
|
export { measureGlyphWidth, measureTextWidth } from './canvas';
|
|
4
6
|
export { measureBlock } from './plain';
|
|
5
7
|
export { measureRichBlock } from './rich';
|
|
6
|
-
|
|
8
|
+
/** {@link measureBlock} through `cache`: the same text, font, width,
|
|
9
|
+
* leading and options measured before come back from it (a copy). A
|
|
10
|
+
* measurement with `options.keepBreaks` or `options.restWidths` is never
|
|
11
|
+
* cached, since its lines follow the breaks it keeps or the measures it
|
|
12
|
+
* was given: it is measured afresh and leaves the cache as it was. One
|
|
13
|
+
* with `breakAfterDashes`, `optimalRagged`, `breakAfterHyphens`,
|
|
14
|
+
* `hyphenateCompounds: false` or `repeatHyphen` is kept apart from the
|
|
15
|
+
* others, one set per combination of them. */
|
|
16
|
+
export declare function cachedMeasureBlock(text: string, font: string, maxWidthPx: number, lineHeightPx: number, options: MeasureBlockOptions | undefined, cache: MeasurementCache): MeasuredBlock;
|
|
17
|
+
/** {@link measureRichBlock} through `cache`, as {@link cachedMeasureBlock}
|
|
18
|
+
* does it: a measurement with `options.keepBreaks` or
|
|
19
|
+
* `options.restWidths` is never cached. */
|
|
20
|
+
export declare function cachedMeasureRichBlock(spans: InlineSpan[], normalFont: string, boldFont: string, italicFont: string, boldItalicFont: string, maxWidthPx: number, lineHeightPx: number, options: MeasureBlockOptions | undefined, cache: MeasurementCache): MeasuredBlock;
|
|
7
21
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/measure/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,aAAa,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/measure/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAC3C,OAAO,KAAK,EAAE,aAAa,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAMpF,YAAY,EAAE,UAAU,EAAE,aAAa,EAAE,aAAa,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAC/G,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,qBAAqB,EAAE,sBAAsB,EAAE,MAAM,QAAQ,CAAC;AACxG,OAAO,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAC/D,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,gBAAgB,EAAE,MAAM,QAAQ,CAAC;AAwC1C;;;;;;;+CAO+C;AAC/C,wBAAgB,kBAAkB,CAChC,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,EACZ,UAAU,EAAE,MAAM,EAClB,YAAY,EAAE,MAAM,EACpB,OAAO,EAAE,mBAAmB,GAAG,SAAS,EACxC,KAAK,EAAE,gBAAgB,GACtB,aAAa,CAIf;AAED;;4CAE4C;AAC5C,wBAAgB,sBAAsB,CACpC,KAAK,EAAE,UAAU,EAAE,EACnB,UAAU,EAAE,MAAM,EAClB,QAAQ,EAAE,MAAM,EAChB,UAAU,EAAE,MAAM,EAClB,cAAc,EAAE,MAAM,EACtB,UAAU,EAAE,MAAM,EAClB,YAAY,EAAE,MAAM,EACpB,OAAO,EAAE,mBAAmB,GAAG,SAAS,EACxC,KAAK,EAAE,gBAAgB,GACtB,aAAa,CAIf"}
|
package/dist/measure/index.js
CHANGED
|
@@ -1,6 +1,66 @@
|
|
|
1
|
+
import { measureBlock } from './plain';
|
|
2
|
+
import { measureRichBlock } from './rich';
|
|
3
|
+
import { cachedMeasureBlock as cachedPlainBlock, cachedMeasureRichBlock as cachedRichBlock } from './cache';
|
|
4
|
+
import { hasCompound } from './breakRules';
|
|
1
5
|
export { buildFontString, initHyphenator, clearMeasurementCache, createMeasurementCache } from './font';
|
|
2
6
|
export { measureGlyphWidth, measureTextWidth } from './canvas';
|
|
3
7
|
export { measureBlock } from './plain';
|
|
4
8
|
export { measureRichBlock } from './rich';
|
|
5
|
-
|
|
9
|
+
/** The caches that hold measurements made with the line-breaking options
|
|
10
|
+
* added after postext 1.4 (`breakAfterDashes`, `optimalRagged`,
|
|
11
|
+
* `breakAfterHyphens`, `hyphenateCompounds: false`, `repeatHyphen`), per
|
|
12
|
+
* cache and per combination of them. `measure/cache.ts` keys a block on
|
|
13
|
+
* the options it knew; a block measured with one of these goes to a cache
|
|
14
|
+
* of its own, so each combination keeps its own lines and the keys of the
|
|
15
|
+
* others are unchanged. A worker that drops its cache for a fresh one
|
|
16
|
+
* drops these with it. */
|
|
17
|
+
const optionVariants = new WeakMap();
|
|
18
|
+
const DASH_RE = /[\u2013\u2014]/;
|
|
19
|
+
/** The cache for a measurement of `text` with `options`. An option that
|
|
20
|
+
* cannot change these lines (no dash or compound in the text, justified or
|
|
21
|
+
* first-fit text, hyphenation off) leaves it in the shared one. */
|
|
22
|
+
function cacheFor(cache, options, text) {
|
|
23
|
+
const dashes = options?.breakAfterDashes === true && DASH_RE.test(text);
|
|
24
|
+
const ragged = options?.optimalRagged === true && options.optimal === true && (options.textAlign ?? 'left') !== 'justify';
|
|
25
|
+
const compound = (options?.breakAfterHyphens === true || options?.repeatHyphen === true
|
|
26
|
+
|| (options?.hyphenateCompounds === false && options.hyphenate === true)) && hasCompound(text);
|
|
27
|
+
const hyphens = compound && options?.breakAfterHyphens === true;
|
|
28
|
+
const whole = compound && options?.hyphenateCompounds === false && options.hyphenate === true;
|
|
29
|
+
const repeat = compound && options?.repeatHyphen === true;
|
|
30
|
+
const variant = `${dashes ? 'd' : ''}${ragged ? 'r' : ''}${hyphens ? 'h' : ''}${whole ? 'w' : ''}${repeat ? 'p' : ''}`;
|
|
31
|
+
if (variant === '')
|
|
32
|
+
return cache;
|
|
33
|
+
let byVariant = optionVariants.get(cache);
|
|
34
|
+
if (!byVariant) {
|
|
35
|
+
byVariant = new Map();
|
|
36
|
+
optionVariants.set(cache, byVariant);
|
|
37
|
+
}
|
|
38
|
+
let own = byVariant.get(variant);
|
|
39
|
+
if (!own) {
|
|
40
|
+
own = { _blocks: new Map() };
|
|
41
|
+
byVariant.set(variant, own);
|
|
42
|
+
}
|
|
43
|
+
return own;
|
|
44
|
+
}
|
|
45
|
+
/** {@link measureBlock} through `cache`: the same text, font, width,
|
|
46
|
+
* leading and options measured before come back from it (a copy). A
|
|
47
|
+
* measurement with `options.keepBreaks` or `options.restWidths` is never
|
|
48
|
+
* cached, since its lines follow the breaks it keeps or the measures it
|
|
49
|
+
* was given: it is measured afresh and leaves the cache as it was. One
|
|
50
|
+
* with `breakAfterDashes`, `optimalRagged`, `breakAfterHyphens`,
|
|
51
|
+
* `hyphenateCompounds: false` or `repeatHyphen` is kept apart from the
|
|
52
|
+
* others, one set per combination of them. */
|
|
53
|
+
export function cachedMeasureBlock(text, font, maxWidthPx, lineHeightPx, options, cache) {
|
|
54
|
+
return options?.keepBreaks || options?.restWidths
|
|
55
|
+
? measureBlock(text, font, maxWidthPx, lineHeightPx, options)
|
|
56
|
+
: cachedPlainBlock(text, font, maxWidthPx, lineHeightPx, options, cacheFor(cache, options, text));
|
|
57
|
+
}
|
|
58
|
+
/** {@link measureRichBlock} through `cache`, as {@link cachedMeasureBlock}
|
|
59
|
+
* does it: a measurement with `options.keepBreaks` or
|
|
60
|
+
* `options.restWidths` is never cached. */
|
|
61
|
+
export function cachedMeasureRichBlock(spans, normalFont, boldFont, italicFont, boldItalicFont, maxWidthPx, lineHeightPx, options, cache) {
|
|
62
|
+
return options?.keepBreaks || options?.restWidths
|
|
63
|
+
? measureRichBlock(spans, normalFont, boldFont, italicFont, boldItalicFont, maxWidthPx, lineHeightPx, options)
|
|
64
|
+
: cachedRichBlock(spans, normalFont, boldFont, italicFont, boldItalicFont, maxWidthPx, lineHeightPx, options, cacheFor(cache, options, spans.map((s) => s.text).join('')));
|
|
65
|
+
}
|
|
6
66
|
//# sourceMappingURL=index.js.map
|