postext 1.4.1 → 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
package/dist/bundle/book.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { PostextConfig, Resource } from '../types';
|
|
1
|
+
import type { DocumentMetadata, PostextConfig, Resource } from '../types';
|
|
2
2
|
import type { VDTDocument } from '../vdt';
|
|
3
3
|
import type { BuildDocumentOptions } from '../pipeline';
|
|
4
4
|
import type { MeasurementCache } from '../measure';
|
|
@@ -9,6 +9,11 @@ export interface BuildBundleOptions extends BuildDocumentOptions {
|
|
|
9
9
|
/** Measurement cache shared by every chapter; one is created when
|
|
10
10
|
* omitted. */
|
|
11
11
|
cache?: MeasurementCache;
|
|
12
|
+
/** Book metadata (`{title}`, `{author}`, the PDF title…) handed to every
|
|
13
|
+
* chapter. The first chapter's front matter is the book's and wins over
|
|
14
|
+
* these values; a front-matter block at the top of a later chapter is
|
|
15
|
+
* ignored, as in the Sandbox. */
|
|
16
|
+
metadata?: DocumentMetadata;
|
|
12
17
|
/** Called after each chapter is laid out (the last round's, when the
|
|
13
18
|
* contents take several). */
|
|
14
19
|
onChapter?: (index: number, doc: VDTDocument) => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"book.d.ts","sourceRoot":"","sources":["../../src/bundle/book.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"book.d.ts","sourceRoot":"","sources":["../../src/bundle/book.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,gBAAgB,EAAoC,aAAa,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AAC5G,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAC;AAE1C,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAExD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAGnD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAE7C,MAAM,WAAW,kBAAmB,SAAQ,oBAAoB;IAC9D,iEAAiE;IACjE,MAAM,CAAC,EAAE,aAAa,CAAC;IACvB;mBACe;IACf,KAAK,CAAC,EAAE,gBAAgB,CAAC;IACzB;;;sCAGkC;IAClC,QAAQ,CAAC,EAAE,gBAAgB,CAAC;IAC5B;kCAC8B;IAC9B,SAAS,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,WAAW,KAAK,IAAI,CAAC;CACvD;AA2CD;;uCAEuC;AACvC,wBAAgB,WAAW,CACzB,MAAM,EAAE;IAAE,QAAQ,EAAE,SAAS,IAAI,CAAC,aAAa,EAAE,UAAU,CAAC,EAAE,CAAC;IAAC,MAAM,EAAE,aAAa,CAAC;IAAC,SAAS,EAAE,SAAS,QAAQ,EAAE,CAAA;CAAE,EACvH,OAAO,GAAE,kBAAuB,GAC/B,WAAW,EAAE,CAwEf"}
|
package/dist/bundle/book.js
CHANGED
|
@@ -1,52 +1,124 @@
|
|
|
1
1
|
// Lay a bundle's book out chapter by chapter, the way the Sandbox does:
|
|
2
2
|
// each chapter continues the one before it (heading and resource counters,
|
|
3
|
-
// the open part, page parity and page numbering),
|
|
4
|
-
//
|
|
3
|
+
// the open part, page parity and page numbering), every chapter reads the
|
|
4
|
+
// book's metadata (the first chapter's front matter), a chapter printing
|
|
5
|
+
// the contents (`:::toc`) receives the whole book's outline, and
|
|
6
|
+
// `{bookTotalPages}` counts the whole book.
|
|
5
7
|
import { buildDocument, continuationAfter, contentOutline, outlineFromDoc, outlineKey } from '../pipeline';
|
|
6
8
|
import { createMeasurementCache } from '../measure';
|
|
9
|
+
import { extractFrontmatter } from '../frontmatter';
|
|
10
|
+
import { configUsesPlaceholder } from '../design/placeholders';
|
|
7
11
|
/** How many times the book is laid out at most while the contents' page
|
|
8
12
|
* numbers settle. */
|
|
9
13
|
const MAX_ROUNDS = 3;
|
|
14
|
+
const FRONTMATTER_OPEN_RE = /^---[ \t]*(?:\r?\n|$)/;
|
|
15
|
+
/** `markdown` with a leading front-matter block blanked out — every
|
|
16
|
+
* character but the line breaks turned into a space, so source offsets
|
|
17
|
+
* stay as they were and the engine parses no metadata from it. The block
|
|
18
|
+
* is found by its lines alone, never parsed (the Sandbox's rule, which
|
|
19
|
+
* mirrors gray-matter's): the first line is exactly `---`, and the block
|
|
20
|
+
* closes at the next line that is exactly `---`. */
|
|
21
|
+
function blankFrontmatter(markdown) {
|
|
22
|
+
const open = FRONTMATTER_OPEN_RE.exec(markdown);
|
|
23
|
+
if (!open || (open[0].length >= markdown.length && !open[0].endsWith('\n')))
|
|
24
|
+
return markdown;
|
|
25
|
+
let pos = open[0].length;
|
|
26
|
+
while (pos <= markdown.length) {
|
|
27
|
+
const nl = markdown.indexOf('\n', pos);
|
|
28
|
+
const lineEnd = nl === -1 ? markdown.length : nl;
|
|
29
|
+
if (markdown.slice(pos, lineEnd).replace(/\r$/, '') === '---') {
|
|
30
|
+
const end = nl === -1 ? markdown.length : nl + 1;
|
|
31
|
+
return markdown.slice(0, end).replace(/[^\n\r]/g, ' ') + markdown.slice(end);
|
|
32
|
+
}
|
|
33
|
+
if (nl === -1)
|
|
34
|
+
break;
|
|
35
|
+
pos = nl + 1;
|
|
36
|
+
}
|
|
37
|
+
return markdown;
|
|
38
|
+
}
|
|
39
|
+
/** The label and book index of the first page of `doc` holding a block —
|
|
40
|
+
* past the parity blanks before its opener; undefined for a document
|
|
41
|
+
* with no content. */
|
|
42
|
+
function firstContentPage(doc) {
|
|
43
|
+
let first;
|
|
44
|
+
for (const b of doc.blocks) {
|
|
45
|
+
if (b.pageIndex >= 0 && (first === undefined || b.pageIndex < first))
|
|
46
|
+
first = b.pageIndex;
|
|
47
|
+
}
|
|
48
|
+
const page = first !== undefined ? doc.pages[first] : undefined;
|
|
49
|
+
return page ? { pageLabel: page.pageLabel, pageIndex: (doc.pageIndexOffset ?? 0) + page.index } : undefined;
|
|
50
|
+
}
|
|
10
51
|
/** Lay out every chapter of `bundle`, in order; returns one `VDTDocument`
|
|
11
52
|
* per chapter. Hand the array to `renderToPdf` for the whole book, or
|
|
12
53
|
* paint `docs[i]` for one chapter. */
|
|
13
54
|
export function buildBundle(bundle, options = {}) {
|
|
14
|
-
const { config: configOverride, cache: sharedCache, onChapter, ...buildOptions } = options;
|
|
55
|
+
const { config: configOverride, cache: sharedCache, onChapter, metadata: givenMetadata, ...buildOptions } = options;
|
|
15
56
|
const config = configOverride ?? bundle.config;
|
|
16
57
|
const resources = [...bundle.resources];
|
|
17
58
|
const cache = sharedCache ?? createMeasurementCache();
|
|
18
59
|
const chapters = bundle.chapters;
|
|
19
|
-
|
|
60
|
+
// The book's metadata: the first chapter's front matter over the given
|
|
61
|
+
// values. Later chapters' front matter is not the book's.
|
|
62
|
+
const first = chapters[0];
|
|
63
|
+
const metadata = { ...(givenMetadata ?? {}), ...(first ? extractFrontmatter(first.markdown).metadata : {}) };
|
|
64
|
+
const sources = chapters.map((c, index) => (index === 0 ? c.markdown : blankFrontmatter(c.markdown)));
|
|
65
|
+
const hasToc = sources.map((markdown) => contentOutline({ markdown }, config).hasToc);
|
|
20
66
|
const anyToc = hasToc.some(Boolean);
|
|
67
|
+
// `{bookTotalPages}` needs the page count of the whole book, known once
|
|
68
|
+
// every chapter is laid out: the book goes round once more with it. It
|
|
69
|
+
// never moves a page break, so one more round settles it.
|
|
70
|
+
const usesBookTotal = configUsesPlaceholder(config, 'bookTotalPages');
|
|
21
71
|
let outline;
|
|
72
|
+
let bookPageCount;
|
|
22
73
|
let docs = [];
|
|
23
|
-
for (let round = 0
|
|
74
|
+
for (let round = 0;; round++) {
|
|
24
75
|
docs = [];
|
|
25
76
|
const continuations = [];
|
|
26
77
|
let counters;
|
|
27
78
|
let physical = 0;
|
|
28
79
|
let next;
|
|
29
|
-
|
|
80
|
+
const total = bookPageCount !== undefined ? { bookPageCount } : {};
|
|
81
|
+
sources.forEach((markdown, index) => {
|
|
30
82
|
const continuation = index === 0
|
|
31
|
-
? undefined
|
|
32
|
-
: { ...counters, pageIndexOffset: physical, ...(next ? { pageNumbering: next } : {}) };
|
|
33
|
-
const doc = buildDocument({ markdown
|
|
83
|
+
? (bookPageCount !== undefined ? total : undefined)
|
|
84
|
+
: { ...counters, pageIndexOffset: physical, ...(next ? { pageNumbering: next } : {}), ...total };
|
|
85
|
+
const doc = buildDocument({ markdown, metadata, resources, ...(continuation ? { continuation } : {}), ...(hasToc[index] && outline ? { outline } : {}) }, config, cache, buildOptions);
|
|
34
86
|
docs.push(doc);
|
|
35
87
|
continuations.push(continuation);
|
|
36
88
|
const last = doc.pages[doc.pages.length - 1];
|
|
37
89
|
physical += doc.pages.length;
|
|
38
90
|
if (last)
|
|
39
91
|
next = { startAt: last.pageNumberValue + 1, format: last.pageNumberFormat };
|
|
40
|
-
counters = continuationAfter({ markdown
|
|
92
|
+
counters = continuationAfter({ markdown, resources }, config, counters);
|
|
41
93
|
});
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
94
|
+
// Another round for the contents while their page labels move (at
|
|
95
|
+
// most MAX_ROUNDS layouts), and for the book's page count while the
|
|
96
|
+
// one printed is not the one laid out (at most one more).
|
|
97
|
+
let outlineMoved = false;
|
|
98
|
+
if (anyToc) {
|
|
99
|
+
const bookOutline = sources.flatMap((markdown, index) => {
|
|
100
|
+
const entries = outlineFromDoc(docs[index], contentOutline({ markdown }, config, continuations[index]).outline);
|
|
101
|
+
// A part that reached no page of its chapter — set without a
|
|
102
|
+
// divider page (`parts.page: false`) by a fence closing the
|
|
103
|
+
// chapter — starts with the next chapter's content, as its running
|
|
104
|
+
// heads do.
|
|
105
|
+
if (!entries.some((e) => e.kind === 'part' && e.pageIndex === undefined))
|
|
106
|
+
return entries;
|
|
107
|
+
const next = docs.slice(index + 1).map(firstContentPage).find((p) => p !== undefined);
|
|
108
|
+
return next ? entries.map((e) => (e.kind === 'part' && e.pageIndex === undefined ? { ...e, ...next } : e)) : entries;
|
|
109
|
+
});
|
|
110
|
+
outlineMoved = !outline || outlineKey(outline) !== outlineKey(bookOutline);
|
|
111
|
+
// The first round laid the contents out from its own chapter alone:
|
|
112
|
+
// always lay the book out once more with the whole outline.
|
|
113
|
+
if (outlineMoved)
|
|
114
|
+
outline = bookOutline;
|
|
115
|
+
}
|
|
116
|
+
const totalMoved = usesBookTotal && bookPageCount !== physical;
|
|
117
|
+
if (usesBookTotal)
|
|
118
|
+
bookPageCount = physical;
|
|
119
|
+
const again = (outlineMoved && round + 1 < MAX_ROUNDS) || (totalMoved && round + 1 < MAX_ROUNDS + 1);
|
|
120
|
+
if (!again)
|
|
46
121
|
break;
|
|
47
|
-
outline = bookOutline;
|
|
48
|
-
// The first round laid the contents out from its own chapter alone:
|
|
49
|
-
// always lay the book out once more with the whole outline.
|
|
50
122
|
}
|
|
51
123
|
if (onChapter)
|
|
52
124
|
docs.forEach((doc, index) => onChapter(index, doc));
|
package/dist/bundle/book.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"book.js","sourceRoot":"","sources":["../../src/bundle/book.ts"],"names":[],"mappings":"AAAA,wEAAwE;AACxE,2EAA2E;AAC3E,yEAAyE;AACzE,
|
|
1
|
+
{"version":3,"file":"book.js","sourceRoot":"","sources":["../../src/bundle/book.ts"],"names":[],"mappings":"AAAA,wEAAwE;AACxE,2EAA2E;AAC3E,0EAA0E;AAC1E,yEAAyE;AACzE,iEAAiE;AACjE,4CAA4C;AAI5C,OAAO,EAAE,aAAa,EAAE,iBAAiB,EAAE,cAAc,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,aAA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C,CAAC,CAAC;YACH,YAAY,GAAG,CAAC,OAAO,IAAI,UAAU,CAAC,OAAO,CAAC,KAAK,UAAU,CAAC,WAAW,CAAC,CAAC;YAC3E,oEAAoE;YACpE,4DAA4D;YAC5D,IAAI,YAAY;gBAAE,OAAO,GAAG,WAAW,CAAC;QAC1C,CAAC;QACD,MAAM,UAAU,GAAG,aAAa,IAAI,aAAa,KAAK,QAAQ,CAAC;QAC/D,IAAI,aAAa;YAAE,aAAa,GAAG,QAAQ,CAAC;QAC5C,MAAM,KAAK,GAAG,CAAC,YAAY,IAAI,KAAK,GAAG,CAAC,GAAG,UAAU,CAAC,IAAI,CAAC,UAAU,IAAI,KAAK,GAAG,CAAC,GAAG,UAAU,GAAG,CAAC,CAAC,CAAC;QACrG,IAAI,CAAC,KAAK;YAAE,MAAM;IACpB,CAAC;IACD,IAAI,SAAS;QAAE,IAAI,CAAC,OAAO,CAAC,CAAC,GAAG,EAAE,KAAK,EAAE,EAAE,CAAC,SAAS,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC,CAAC;IACnE,OAAO,IAAI,CAAC;AACd,CAAC"}
|
package/dist/bundle/codec.d.ts
CHANGED
|
@@ -11,7 +11,34 @@ export interface ReadBundleOptions {
|
|
|
11
11
|
/** How loaded files are named (`fileId`). Defaults to their path. */
|
|
12
12
|
ids?: BundleIdScheme;
|
|
13
13
|
/** Configuration under the manifest's `config`. Defaults to
|
|
14
|
-
* `bundleBaseConfig(
|
|
14
|
+
* `bundleBaseConfig()` in the language of the bundle
|
|
15
|
+
* (`resolveBundleConfigLocale(manifest, locale)`: the locale it serves,
|
|
16
|
+
* or the language its `config` names when the manifest names none), so
|
|
17
|
+
* a bundle in one language gets resource types in that language,
|
|
18
|
+
* whatever `locale` asks for. A host that passes its own base should
|
|
19
|
+
* localise it to the same language. It is taken in today's terms, with
|
|
20
|
+
* one exception: under a manifest older than `CONFIG_VERSION` whose
|
|
21
|
+
* chapters set maths, a base `math` that neither the manifest nor the
|
|
22
|
+
* locale replaces is pinned with the bundle's (`fontSizeScale` ×
|
|
23
|
+
* `LEGACY_MATH_SIZE`, see `pinLegacyMathSize`), since 1.4 set the
|
|
24
|
+
* bundle's formulas at that size; so is a base `layout`'s inline gap
|
|
25
|
+
* (`pinLegacyInlineGap`) when the chapters embed a resource, and its
|
|
26
|
+
* gap in boxes (`pinLegacyBoxResourceGap`) when they embed one inside a
|
|
27
|
+
* `:::callout`; a base `bodyText`'s colon-list room
|
|
28
|
+
* (`pinLegacyColonListRoom`) when they introduce a list with a colon; a
|
|
29
|
+
* base `headings`' inline marks (`pinLegacyHeadingMarks`) when a heading
|
|
30
|
+
* of theirs carries one; a base `layout`'s box cut
|
|
31
|
+
* (`pinLegacyBoxChildCut`) when they hold a `:::callout`; a base
|
|
32
|
+
* `bodyText`'s dash breaks (`pinLegacyDashBreaks`) when they set a dash
|
|
33
|
+
* closed between words, its compound breaks (`pinLegacyHyphenBreaks`)
|
|
34
|
+
* when they set a hyphen between two letters, and its ragged breaking
|
|
35
|
+
* (`pinLegacyRaggedBreaking`) when the configuration sets some running
|
|
36
|
+
* text ragged; a base `headings`' split under a heading
|
|
37
|
+
* (`pinLegacyHeadingSplit`) when they have a heading; a base
|
|
38
|
+
* `bodyText`'s space under `:::paragraphs` containers
|
|
39
|
+
* (`pinLegacyParagraphContainerSpacing`) when they hold one and the
|
|
40
|
+
* configuration declares a paragraph style; and the size of every drop
|
|
41
|
+
* cap in the base that names none (`pinLegacyDropCapSize`). */
|
|
15
42
|
baseConfig?: PostextConfig;
|
|
16
43
|
/** Intrinsic size of an SVG whose spec omits it. Defaults to `svgSize`. */
|
|
17
44
|
measureSvg?: (markup: string) => BundleImageSize | undefined;
|
|
@@ -28,7 +55,22 @@ export interface ReadBundleResult {
|
|
|
28
55
|
locale: string;
|
|
29
56
|
chapters: BundleChapter[];
|
|
30
57
|
/** Base config + manifest `config` + the locale's overrides, with the
|
|
31
|
-
* bundle's font families appended to `customFonts`.
|
|
58
|
+
* bundle's font families appended to `customFonts`. A manifest stored
|
|
59
|
+
* under older rules than `CONFIG_VERSION` (none: postext 1.4 or earlier)
|
|
60
|
+
* is read in today's terms (see `migrateConfig`): its heading breaks,
|
|
61
|
+
* its maths size when its chapters set maths, the space around its
|
|
62
|
+
* inline resources when they embed one (inside a box too, when a box
|
|
63
|
+
* embeds one), its headings' inline marks when a heading carries one,
|
|
64
|
+
* the size of its drop caps, the room kept for a list under a colon line
|
|
65
|
+
* when its chapters introduce one so, the lines a box cut leaves of a
|
|
66
|
+
* paragraph or list item when they hold a box, the line breaks after a
|
|
67
|
+
* closed dash when they set one, the line breaks at a compound's hyphen
|
|
68
|
+
* when they set one, the line-by-line breaking of its ragged text when
|
|
69
|
+
* it has some, the split of a paragraph under a heading when they have
|
|
70
|
+
* a heading, and the space under its `:::paragraphs` containers when
|
|
71
|
+
* they hold one, are the ones 1.4 laid out. The layout
|
|
72
|
+
* fixes of postext 1.5 that no pin holds back apply to it as to any
|
|
73
|
+
* book. */
|
|
32
74
|
config: PostextConfig;
|
|
33
75
|
resources: Resource[];
|
|
34
76
|
/** Resource payloads (pictures and PDF print masters). */
|
|
@@ -36,7 +78,20 @@ export interface ReadBundleResult {
|
|
|
36
78
|
fonts: BundleFontFile[];
|
|
37
79
|
}
|
|
38
80
|
/** Read a manifest plus its files. Throws on an invalid manifest or a
|
|
39
|
-
* missing chapter, picture or font file.
|
|
81
|
+
* missing chapter, picture or font file. The configuration of a manifest
|
|
82
|
+
* written by postext 1.4 or earlier (no `configVersion`) keeps the heading
|
|
83
|
+
* breaks, the maths size, the space around inline resources in the text
|
|
84
|
+
* and inside boxes, the heading marks, the drop-cap sizes, the room under
|
|
85
|
+
* a colon line that introduces a list, the lines a box cut leaves of a
|
|
86
|
+
* paragraph or list item, the breaks at dashes and at compounds'
|
|
87
|
+
* hyphens, the breaking of ragged text, the split under a heading and the
|
|
88
|
+
* space under `:::paragraphs` containers it laid out then (see
|
|
89
|
+
* `pinLegacyHeadingBreaks`, `pinLegacyMathSize`, `pinLegacyInlineGap`,
|
|
90
|
+
* `pinLegacyBoxResourceGap`, `pinLegacyHeadingMarks`,
|
|
91
|
+
* `pinLegacyDropCapSize`, `pinLegacyColonListRoom`, `pinLegacyBoxChildCut`,
|
|
92
|
+
* `pinLegacyDashBreaks`, `pinLegacyHyphenBreaks`,
|
|
93
|
+
* `pinLegacyRaggedBreaking`, `pinLegacyHeadingSplit` and
|
|
94
|
+
* `pinLegacyParagraphContainerSpacing`). */
|
|
40
95
|
export declare function readBundle(manifest: unknown, readFile: BundleFileReader, options?: ReadBundleOptions): Promise<ReadBundleResult>;
|
|
41
96
|
export interface BundleMeta {
|
|
42
97
|
id: string;
|
|
@@ -44,6 +99,27 @@ export interface BundleMeta {
|
|
|
44
99
|
description?: string;
|
|
45
100
|
locale?: string;
|
|
46
101
|
}
|
|
102
|
+
/** What another locale of a bilingual bundle brings on top of the shared
|
|
103
|
+
* content (see {@link BundleContent.localized}). */
|
|
104
|
+
export interface BundleLocaleContent {
|
|
105
|
+
/** The locale's own chapters, in book order. Absent: it reads the
|
|
106
|
+
* shared (primary) chapters. */
|
|
107
|
+
chapters?: readonly {
|
|
108
|
+
title: string;
|
|
109
|
+
markdown: string;
|
|
110
|
+
}[];
|
|
111
|
+
/** Top-level configuration keys for the locale, each replacing the
|
|
112
|
+
* shared key wholesale when read; a key equal to the shared one is not
|
|
113
|
+
* written. Fonts are shared: the families of `customFonts` join the
|
|
114
|
+
* bundle's. */
|
|
115
|
+
config?: PostextConfig;
|
|
116
|
+
/** The locale's wording and artwork of the shared resources, merged by
|
|
117
|
+
* id: `caption`, `note`, `altText`, `table`, and a picture of its own
|
|
118
|
+
* (`bitmap.fileId` / `svg.fileId`, `svg.pdfFileId`) when the artwork
|
|
119
|
+
* carries words. Other fields are shared; an id that is not among the
|
|
120
|
+
* resources is left out with a warning. */
|
|
121
|
+
resources?: readonly (Pick<Resource, 'id'> & Partial<Resource>)[];
|
|
122
|
+
}
|
|
47
123
|
export interface BundleContent {
|
|
48
124
|
chapters: readonly {
|
|
49
125
|
title: string;
|
|
@@ -58,6 +134,12 @@ export interface BundleContent {
|
|
|
58
134
|
fileId: string;
|
|
59
135
|
mime: string;
|
|
60
136
|
};
|
|
137
|
+
/** Other locales of a bilingual bundle, by locale tag (`es`, `pt-BR`);
|
|
138
|
+
* `chapters`, `config` and `resources` are then the primary locale's
|
|
139
|
+
* (`BundleMeta.locale`, required). Written as the manifest's `locales`,
|
|
140
|
+
* a locale → chapters map (when any locale has chapters of its own) and
|
|
141
|
+
* `localized`. */
|
|
142
|
+
localized?: Record<string, BundleLocaleContent>;
|
|
61
143
|
}
|
|
62
144
|
export interface PlannedFile {
|
|
63
145
|
/** Path inside the bundle (`resources/x.png`, `fonts/y.ttf`). */
|
|
@@ -66,6 +148,8 @@ export interface PlannedFile {
|
|
|
66
148
|
kind: 'blob' | 'font';
|
|
67
149
|
/** Resource id (blob) or family name (font), for warnings. */
|
|
68
150
|
owner: string;
|
|
151
|
+
/** Set on a picture only one locale reads (its own artwork). */
|
|
152
|
+
locale?: string;
|
|
69
153
|
}
|
|
70
154
|
export interface BundlePlan {
|
|
71
155
|
manifest: BundleManifestV2;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"codec.d.ts","sourceRoot":"","sources":["../../src/bundle/codec.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"codec.d.ts","sourceRoot":"","sources":["../../src/bundle/codec.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AAuBxD,OAAO,KAAK,EACV,UAAU,EACV,iBAAiB,EACjB,aAAa,EAEb,gBAAgB,EAEhB,cAAc,EACd,cAAc,EACd,eAAe,EAEf,cAAc,EACd,gBAAgB,EAEjB,MAAM,SAAS,CAAC;AAEjB;;qDAEqD;AACrD,wBA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MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IACnD,QAAQ,EAAE,MAAM,EAAE,CAAC;CACpB;AAYD;oCACoC;AACpC,eAAO,MAAM,uBAAuB,kCAAmC,CAAC;AAExE;;6EAE6E;AAC7E,wBAAgB,UAAU,CAAC,IAAI,EAAE,UAAU,EAAE,OAAO,EAAE,aAAa,GAAG,UAAU,CA2L/E;AA+BD,MAAM,WAAW,iBAAiB;IAChC,QAAQ,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,OAAO,CAAC,WAAW,GAAG,UAAU,GAAG,IAAI,GAAG,SAAS,CAAC,CAAC;IACnF,QAAQ,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,OAAO,CAAC,WAAW,GAAG,UAAU,GAAG,IAAI,GAAG,SAAS,CAAC,CAAC;CACpF;AAED,MAAM,WAAW,mBAAmB;IAClC,wEAAwE;IACxE,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;IAClC,QAAQ,EAAE,gBAAgB,CAAC;IAC3B,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,sEAAsE;IACtE,OAAO,EAAE,MAAM,EAAE,CAAC;CACnB;AAMD;;;2CAG2C;AAC3C,wBAAsB,kBAAkB,CAAC,IAAI,EAAE,UAAU,EAAE,OAAO,EAAE,iBAAiB,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAoEnH"}
|
package/dist/bundle/codec.js
CHANGED
|
@@ -4,7 +4,8 @@
|
|
|
4
4
|
// resources and file payloads; `planBundle` / `resolveBundleFiles` do the
|
|
5
5
|
// reverse. Nothing here touches storage.
|
|
6
6
|
import { cloneDefaultColorPalette, defaultResourceTypes, stripConfigDefaults } from '../defaults';
|
|
7
|
-
import { bitmapSize, chapterFileName, extensionForImageMime, extensionForResource, fontsToCustomFonts, isBitmapFile, isBundleManifest, isPdfFile, isSvgFile, mimeForFile, pickChapterSpecs, pickLocaleOverrides, resolveBundleLocale, resourceFromSpec, slugify, svgSize, uniqueSlug, } from './manifest';
|
|
7
|
+
import { bitmapSize, chapterFileName, extensionForImageMime, extensionForResource, fontsToCustomFonts, isBitmapFile, isBundleManifest, isPdfFile, isSvgFile, mimeForFile, pickChapterSpecs, pickLocaleOverrides, resolveBundleConfigLocale, resolveBundleLocale, resourceFromSpec, slugify, svgSize, uniqueSlug, } from './manifest';
|
|
8
|
+
import { CONFIG_VERSION, migrateBundleConfig } from './configVersion';
|
|
8
9
|
/** The configuration a bundle's own `config` is laid over: the default
|
|
9
10
|
* colour palette plus the built-in resource types localised to `locale`
|
|
10
11
|
* (what the Sandbox starts every document from). */
|
|
@@ -13,11 +14,28 @@ export function bundleBaseConfig(locale = 'en') {
|
|
|
13
14
|
}
|
|
14
15
|
const identityIds = { blob: (f) => f, font: (f) => f };
|
|
15
16
|
/** Read a manifest plus its files. Throws on an invalid manifest or a
|
|
16
|
-
* missing chapter, picture or font file.
|
|
17
|
+
* missing chapter, picture or font file. The configuration of a manifest
|
|
18
|
+
* written by postext 1.4 or earlier (no `configVersion`) keeps the heading
|
|
19
|
+
* breaks, the maths size, the space around inline resources in the text
|
|
20
|
+
* and inside boxes, the heading marks, the drop-cap sizes, the room under
|
|
21
|
+
* a colon line that introduces a list, the lines a box cut leaves of a
|
|
22
|
+
* paragraph or list item, the breaks at dashes and at compounds'
|
|
23
|
+
* hyphens, the breaking of ragged text, the split under a heading and the
|
|
24
|
+
* space under `:::paragraphs` containers it laid out then (see
|
|
25
|
+
* `pinLegacyHeadingBreaks`, `pinLegacyMathSize`, `pinLegacyInlineGap`,
|
|
26
|
+
* `pinLegacyBoxResourceGap`, `pinLegacyHeadingMarks`,
|
|
27
|
+
* `pinLegacyDropCapSize`, `pinLegacyColonListRoom`, `pinLegacyBoxChildCut`,
|
|
28
|
+
* `pinLegacyDashBreaks`, `pinLegacyHyphenBreaks`,
|
|
29
|
+
* `pinLegacyRaggedBreaking`, `pinLegacyHeadingSplit` and
|
|
30
|
+
* `pinLegacyParagraphContainerSpacing`). */
|
|
17
31
|
export async function readBundle(manifest, readFile, options = {}) {
|
|
18
32
|
if (!isBundleManifest(manifest))
|
|
19
33
|
throw new Error('Invalid bundle manifest (preset.json)');
|
|
20
34
|
const locale = options.locale ?? manifest.locale ?? 'en';
|
|
35
|
+
// The language the content comes in: a single-language bundle serves its
|
|
36
|
+
// own whatever the reader asks for, so its default resource types
|
|
37
|
+
// ("Figura", "Tabla") follow that, not the reader's locale (EF-150).
|
|
38
|
+
const served = resolveBundleLocale(manifest, locale);
|
|
21
39
|
const ids = options.ids ?? identityIds;
|
|
22
40
|
const onWarning = options.onWarning;
|
|
23
41
|
const measureSvg = options.measureSvg ?? svgSize;
|
|
@@ -83,10 +101,16 @@ export async function readBundle(manifest, readFile, options = {}) {
|
|
|
83
101
|
for (const w of fontSet.warnings)
|
|
84
102
|
onWarning?.(w);
|
|
85
103
|
const fonts = await Promise.all(fontSet.files.map(async (f) => ({ ...f, bytes: await readFile(f.file) })));
|
|
86
|
-
|
|
104
|
+
// A manifest written for older rules (postext 1.4 or earlier has no
|
|
105
|
+
// `configVersion`) is read with the heading breaks, the maths size and
|
|
106
|
+
// the inline gap it laid out then. The reader's own base configuration
|
|
107
|
+
// keeps its heading breaks, but its `math` and `layout`, when no layer
|
|
108
|
+
// replaces them, are the ones 1.4 set the book with, so they are pinned
|
|
109
|
+
// with the rest.
|
|
110
|
+
const baseConfig = migrateBundleConfig(options.baseConfig ?? bundleBaseConfig(resolveBundleConfigLocale(manifest, locale)), [manifest.config ?? {}, overrides?.config ?? {}], manifest.configVersion, { content: chapters.map((c) => c.markdown) });
|
|
87
111
|
const customFonts = [...(manifest.config?.customFonts ?? []), ...fontSet.families];
|
|
88
112
|
const config = customFonts.length > 0 ? { ...baseConfig, customFonts } : baseConfig;
|
|
89
|
-
return { manifest, locale:
|
|
113
|
+
return { manifest, locale: served, chapters, config, resources, blobs, fonts };
|
|
90
114
|
}
|
|
91
115
|
/** A resource minus the fields that only make sense in storage. */
|
|
92
116
|
function omitStorageFields(r) {
|
|
@@ -108,6 +132,19 @@ export function planBundle(meta, content) {
|
|
|
108
132
|
const files = [];
|
|
109
133
|
const takenResourceNames = new Set();
|
|
110
134
|
const takenFontNames = new Set();
|
|
135
|
+
const localized = content.localized && Object.keys(content.localized).length > 0 ? content.localized : undefined;
|
|
136
|
+
if (localized) {
|
|
137
|
+
if (!meta.locale)
|
|
138
|
+
throw new Error('planBundle: `localized` needs `locale`, the language of the shared content');
|
|
139
|
+
for (const key of Object.keys(localized)) {
|
|
140
|
+
if (key.trim().length === 0 || key.toLowerCase() === meta.locale.toLowerCase()) {
|
|
141
|
+
throw new Error(`planBundle: \`localized\` names the primary locale "${key}" again`);
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
// File name (slug) of each resource with a payload, for the pictures a
|
|
146
|
+
// locale brings of its own.
|
|
147
|
+
const resourceNames = new Map();
|
|
111
148
|
const resources = [];
|
|
112
149
|
for (const r of content.resources) {
|
|
113
150
|
const { bitmap, svg } = r;
|
|
@@ -120,6 +157,7 @@ export function planBundle(meta, content) {
|
|
|
120
157
|
}
|
|
121
158
|
const name = uniqueSlug(slugify(r.id), takenResourceNames, 'resource');
|
|
122
159
|
takenResourceNames.add(name);
|
|
160
|
+
resourceNames.set(r.id, name);
|
|
123
161
|
const path = `resources/${name}.${ext}`;
|
|
124
162
|
files.push({ path, fileId, kind: 'blob', owner: r.id });
|
|
125
163
|
let pdfFile;
|
|
@@ -137,8 +175,17 @@ export function planBundle(meta, content) {
|
|
|
137
175
|
...(height ? { height } : {}),
|
|
138
176
|
});
|
|
139
177
|
}
|
|
178
|
+
// Fonts are shared by every locale: a family only a locale's config
|
|
179
|
+
// names joins the primary ones.
|
|
180
|
+
const families = [...(content.config.customFonts ?? [])];
|
|
181
|
+
for (const entry of Object.values(localized ?? {})) {
|
|
182
|
+
for (const family of entry.config?.customFonts ?? []) {
|
|
183
|
+
if (!families.some((f) => f.name === family.name))
|
|
184
|
+
families.push(family);
|
|
185
|
+
}
|
|
186
|
+
}
|
|
140
187
|
const fonts = [];
|
|
141
|
-
for (const family of
|
|
188
|
+
for (const family of families) {
|
|
142
189
|
// A family the document may set but not pass on: its files stay behind
|
|
143
190
|
// and no `fonts[]` entry names it, so the bundle opens with the
|
|
144
191
|
// reader's own fallback for that family.
|
|
@@ -169,29 +216,135 @@ export function planBundle(meta, content) {
|
|
|
169
216
|
}
|
|
170
217
|
const configWithoutFonts = { ...stripConfigDefaults(content.config) };
|
|
171
218
|
delete configWithoutFonts.customFonts;
|
|
172
|
-
|
|
173
|
-
|
|
219
|
+
// Chapter files: `chapters/01-intro.md`, or one folder per locale when
|
|
220
|
+
// any locale has chapters of its own (`chapters/es/01-intro.md`).
|
|
174
221
|
const chapterFiles = [];
|
|
175
|
-
|
|
176
|
-
const
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
222
|
+
const writeChapters = (chapters, folder) => {
|
|
223
|
+
const taken = new Set();
|
|
224
|
+
return chapters.map((c, i) => {
|
|
225
|
+
const name = chapterFileName(i, c.title, taken, chapters.length);
|
|
226
|
+
const path = folder ? name.replace(/^chapters\//, `chapters/${folder}/`) : name;
|
|
227
|
+
chapterFiles.push({ path, markdown: c.markdown });
|
|
228
|
+
return { title: c.title, file: path };
|
|
229
|
+
});
|
|
230
|
+
};
|
|
231
|
+
const perLocale = localized !== undefined && Object.values(localized).some((l) => l.chapters && l.chapters.length > 0);
|
|
232
|
+
let chapterSpecs;
|
|
233
|
+
if (localized && perLocale && meta.locale) {
|
|
234
|
+
const primary = writeChapters(content.chapters, localeFolder(meta.locale));
|
|
235
|
+
const map = { [meta.locale]: primary };
|
|
236
|
+
for (const [locale, entry] of Object.entries(localized)) {
|
|
237
|
+
map[locale] = entry.chapters && entry.chapters.length > 0 ? writeChapters(entry.chapters, localeFolder(locale)) : primary;
|
|
238
|
+
}
|
|
239
|
+
chapterSpecs = map;
|
|
240
|
+
}
|
|
241
|
+
else {
|
|
242
|
+
chapterSpecs = writeChapters(content.chapters);
|
|
243
|
+
}
|
|
244
|
+
// Per locale, what differs from the shared content: configuration keys,
|
|
245
|
+
// and the wording and artwork of resources.
|
|
246
|
+
const localizedSpecs = {};
|
|
247
|
+
const byId = new Map(content.resources.map((r) => [r.id, r]));
|
|
248
|
+
for (const [locale, entry] of Object.entries(localized ?? {})) {
|
|
249
|
+
const overrides = {};
|
|
250
|
+
if (entry.config) {
|
|
251
|
+
const config = localizedConfig(entry.config, configWithoutFonts);
|
|
252
|
+
if (Object.keys(config).length > 0)
|
|
253
|
+
overrides.config = config;
|
|
254
|
+
}
|
|
255
|
+
const wording = [];
|
|
256
|
+
for (const r of entry.resources ?? []) {
|
|
257
|
+
const base = byId.get(r.id);
|
|
258
|
+
if (!base) {
|
|
259
|
+
warnings.push(`${r.id}: not among the resources, its ${locale} wording left out`);
|
|
260
|
+
continue;
|
|
261
|
+
}
|
|
262
|
+
const spec = { id: r.id };
|
|
263
|
+
for (const key of LOCALIZABLE_RESOURCE_FIELDS) {
|
|
264
|
+
const value = r[key];
|
|
265
|
+
if (value !== undefined && !sameJson(value, base[key]))
|
|
266
|
+
spec[key] = value;
|
|
267
|
+
}
|
|
268
|
+
// Artwork of its own (a picture with words in it), written in the
|
|
269
|
+
// locale's folder under the shared file's name.
|
|
270
|
+
const merged = { ...base, ...r };
|
|
271
|
+
const ext = extensionForResource(merged);
|
|
272
|
+
const fileId = r.bitmap?.fileId ?? r.svg?.fileId;
|
|
273
|
+
const pdfFileId = r.svg?.pdfFileId;
|
|
274
|
+
const ownFile = !!ext && !!fileId && fileId !== (base.bitmap?.fileId ?? base.svg?.fileId);
|
|
275
|
+
const ownMaster = !!pdfFileId && pdfFileId !== base.svg?.pdfFileId && merged.kind === 'svg';
|
|
276
|
+
let name = resourceNames.get(r.id);
|
|
277
|
+
if ((ownFile || ownMaster) && name === undefined) {
|
|
278
|
+
name = uniqueSlug(slugify(r.id), takenResourceNames, 'resource');
|
|
279
|
+
takenResourceNames.add(name);
|
|
280
|
+
resourceNames.set(r.id, name);
|
|
281
|
+
}
|
|
282
|
+
if (ownFile) {
|
|
283
|
+
spec.file = `resources/${localeFolder(locale)}/${name}.${ext}`;
|
|
284
|
+
files.push({ path: spec.file, fileId: fileId, kind: 'blob', owner: r.id, locale });
|
|
285
|
+
const width = r.bitmap?.width ?? r.svg?.width;
|
|
286
|
+
const height = r.bitmap?.height ?? r.svg?.height;
|
|
287
|
+
if (width)
|
|
288
|
+
spec.width = width;
|
|
289
|
+
if (height)
|
|
290
|
+
spec.height = height;
|
|
291
|
+
}
|
|
292
|
+
if (ownMaster) {
|
|
293
|
+
spec.pdfFile = `resources/${localeFolder(locale)}/${name}.pdf`;
|
|
294
|
+
files.push({ path: spec.pdfFile, fileId: pdfFileId, kind: 'blob', owner: r.id, locale });
|
|
295
|
+
}
|
|
296
|
+
if (Object.keys(spec).length > 1)
|
|
297
|
+
wording.push(spec);
|
|
298
|
+
}
|
|
299
|
+
if (wording.length > 0)
|
|
300
|
+
overrides.resources = wording;
|
|
301
|
+
localizedSpecs[locale] = overrides;
|
|
302
|
+
}
|
|
180
303
|
const manifest = {
|
|
181
304
|
version: 2,
|
|
305
|
+
configVersion: CONFIG_VERSION,
|
|
182
306
|
id: meta.id,
|
|
183
307
|
name: meta.name,
|
|
184
308
|
...(meta.description ? { description: meta.description } : {}),
|
|
185
309
|
...(meta.locale ? { locale: meta.locale } : {}),
|
|
310
|
+
...(localized && meta.locale ? { locales: [meta.locale, ...Object.keys(localized)] } : {}),
|
|
186
311
|
...(thumbnailPath ? { thumbnail: thumbnailPath } : {}),
|
|
187
312
|
...(content.canvasScope === 'book' ? { view: { canvasScope: 'book' } } : {}),
|
|
188
313
|
chapters: chapterSpecs,
|
|
189
314
|
config: configWithoutFonts,
|
|
190
315
|
...(resources.length > 0 ? { resources } : {}),
|
|
191
316
|
...(fonts.length > 0 ? { fonts } : {}),
|
|
317
|
+
...(localized ? { localized: localizedSpecs } : {}),
|
|
192
318
|
};
|
|
193
319
|
return { manifest, files, chapterFiles, warnings };
|
|
194
320
|
}
|
|
321
|
+
/** Resource fields a locale may word differently. */
|
|
322
|
+
const LOCALIZABLE_RESOURCE_FIELDS = ['caption', 'note', 'altText', 'table'];
|
|
323
|
+
/** Folder a locale's own files are written in (`chapters/es/…`). */
|
|
324
|
+
function localeFolder(locale) {
|
|
325
|
+
return slugify(locale) || 'locale';
|
|
326
|
+
}
|
|
327
|
+
function sameJson(a, b) {
|
|
328
|
+
return JSON.stringify(a) === JSON.stringify(b);
|
|
329
|
+
}
|
|
330
|
+
/** The top-level keys of a locale's configuration that differ from the
|
|
331
|
+
* shared (stripped) configuration, each stripped of its defaults. A key
|
|
332
|
+
* whose value is all defaults while the shared one is not is written as
|
|
333
|
+
* given (`layout: {}`), so that it still replaces the shared key. */
|
|
334
|
+
function localizedConfig(own, shared) {
|
|
335
|
+
const stripped = stripConfigDefaults(own);
|
|
336
|
+
const raw = own;
|
|
337
|
+
const base = shared;
|
|
338
|
+
const out = {};
|
|
339
|
+
for (const key of Object.keys(raw)) {
|
|
340
|
+
if (key === 'customFonts' || raw[key] === undefined)
|
|
341
|
+
continue;
|
|
342
|
+
if (sameJson(stripped[key], base[key]))
|
|
343
|
+
continue;
|
|
344
|
+
out[key] = stripped[key] ?? raw[key];
|
|
345
|
+
}
|
|
346
|
+
return out;
|
|
347
|
+
}
|
|
195
348
|
function toBytes(data) {
|
|
196
349
|
return data instanceof Uint8Array ? data : new Uint8Array(data);
|
|
197
350
|
}
|
|
@@ -209,7 +362,7 @@ export async function resolveBundleFiles(plan, sources) {
|
|
|
209
362
|
: await Promise.resolve(sources.readFont(f.fileId)).catch(() => null);
|
|
210
363
|
if (!bytes) {
|
|
211
364
|
missingPaths.add(f.path);
|
|
212
|
-
warnings.push(`${f.owner}: missing file, skipped`);
|
|
365
|
+
warnings.push(f.locale ? `${f.owner}: missing ${f.locale} file, the shared one is used` : `${f.owner}: missing file, skipped`);
|
|
213
366
|
return;
|
|
214
367
|
}
|
|
215
368
|
files[f.path] = toBytes(bytes);
|
|
@@ -235,6 +388,33 @@ export async function resolveBundleFiles(plan, sources) {
|
|
|
235
388
|
delete manifest.resources;
|
|
236
389
|
if (!fonts || fonts.length === 0)
|
|
237
390
|
delete manifest.fonts;
|
|
391
|
+
// A locale whose own artwork is missing reads the shared picture.
|
|
392
|
+
if (manifest.localized) {
|
|
393
|
+
const localized = {};
|
|
394
|
+
for (const [locale, overrides] of Object.entries(manifest.localized)) {
|
|
395
|
+
const wording = overrides.resources
|
|
396
|
+
?.map((r) => {
|
|
397
|
+
const spec = { ...r };
|
|
398
|
+
if (spec.file && missingPaths.has(spec.file)) {
|
|
399
|
+
delete spec.file;
|
|
400
|
+
delete spec.width;
|
|
401
|
+
delete spec.height;
|
|
402
|
+
delete spec.pdfFile;
|
|
403
|
+
}
|
|
404
|
+
if (spec.pdfFile && missingPaths.has(spec.pdfFile))
|
|
405
|
+
delete spec.pdfFile;
|
|
406
|
+
return spec;
|
|
407
|
+
})
|
|
408
|
+
.filter((r) => Object.keys(r).length > 1);
|
|
409
|
+
const next = { ...overrides };
|
|
410
|
+
if (wording && wording.length > 0)
|
|
411
|
+
next.resources = wording;
|
|
412
|
+
else
|
|
413
|
+
delete next.resources;
|
|
414
|
+
localized[locale] = next;
|
|
415
|
+
}
|
|
416
|
+
manifest = { ...manifest, localized };
|
|
417
|
+
}
|
|
238
418
|
}
|
|
239
419
|
const enc = new TextEncoder();
|
|
240
420
|
files['preset.json'] = enc.encode(JSON.stringify(manifest, null, 2));
|