postext 1.22.3 → 1.24.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/dist/__tests__/bundle/bitmapInfo.test.d.ts +2 -0
- package/dist/__tests__/bundle/bitmapInfo.test.d.ts.map +1 -0
- package/dist/__tests__/bundle/bitmapInfo.test.js +78 -0
- package/dist/__tests__/bundle/bitmapInfo.test.js.map +1 -0
- package/dist/__tests__/bundle/designOverflowPin.test.d.ts +2 -0
- package/dist/__tests__/bundle/designOverflowPin.test.d.ts.map +1 -0
- package/dist/__tests__/bundle/designOverflowPin.test.js +87 -0
- package/dist/__tests__/bundle/designOverflowPin.test.js.map +1 -0
- package/dist/__tests__/bundle.test.js +1 -1
- package/dist/__tests__/bundle.test.js.map +1 -1
- package/dist/__tests__/codeBlocks.test.d.ts +2 -0
- package/dist/__tests__/codeBlocks.test.d.ts.map +1 -0
- package/dist/__tests__/codeBlocks.test.js +550 -0
- package/dist/__tests__/codeBlocks.test.js.map +1 -0
- package/dist/__tests__/design/designTextOverflow.test.d.ts +2 -0
- package/dist/__tests__/design/designTextOverflow.test.d.ts.map +1 -0
- package/dist/__tests__/design/designTextOverflow.test.js +102 -0
- package/dist/__tests__/design/designTextOverflow.test.js.map +1 -0
- package/dist/__tests__/exports.test.js +30 -0
- package/dist/__tests__/exports.test.js.map +1 -1
- package/dist/__tests__/frontmatterInvalid.test.d.ts +2 -0
- package/dist/__tests__/frontmatterInvalid.test.d.ts.map +1 -0
- package/dist/__tests__/frontmatterInvalid.test.js +101 -0
- package/dist/__tests__/frontmatterInvalid.test.js.map +1 -0
- package/dist/__tests__/hardBreaks.test.d.ts +2 -0
- package/dist/__tests__/hardBreaks.test.d.ts.map +1 -0
- package/dist/__tests__/hardBreaks.test.js +226 -0
- package/dist/__tests__/hardBreaks.test.js.map +1 -0
- package/dist/__tests__/headingFirstLineIndent.test.d.ts +2 -0
- package/dist/__tests__/headingFirstLineIndent.test.d.ts.map +1 -0
- package/dist/__tests__/headingFirstLineIndent.test.js +185 -0
- package/dist/__tests__/headingFirstLineIndent.test.js.map +1 -0
- package/dist/__tests__/headingInlineMarks.test.js +1 -1
- package/dist/__tests__/headingInlineMarks.test.js.map +1 -1
- package/dist/__tests__/headingLetterSpacing.test.js +1 -1
- package/dist/__tests__/headingLetterSpacing.test.js.map +1 -1
- package/dist/__tests__/lineNumbers.test.d.ts +2 -0
- package/dist/__tests__/lineNumbers.test.d.ts.map +1 -0
- package/dist/__tests__/lineNumbers.test.js +304 -0
- package/dist/__tests__/lineNumbers.test.js.map +1 -0
- package/dist/__tests__/mathSizeMigration.test.js +2 -2
- package/dist/__tests__/mathSizeMigration.test.js.map +1 -1
- package/dist/__tests__/paragraphDropCap.test.d.ts +2 -0
- package/dist/__tests__/paragraphDropCap.test.d.ts.map +1 -0
- package/dist/__tests__/paragraphDropCap.test.js +442 -0
- package/dist/__tests__/paragraphDropCap.test.js.map +1 -0
- package/dist/__tests__/paragraphStyleIndent.test.js +26 -2
- package/dist/__tests__/paragraphStyleIndent.test.js.map +1 -1
- package/dist/__tests__/pipeline/bitmapResolution.test.d.ts +2 -0
- package/dist/__tests__/pipeline/bitmapResolution.test.d.ts.map +1 -0
- package/dist/__tests__/pipeline/bitmapResolution.test.js +139 -0
- package/dist/__tests__/pipeline/bitmapResolution.test.js.map +1 -0
- package/dist/__tests__/pipeline/calloutInlineResourceGap.test.js +1 -1
- package/dist/__tests__/pipeline/calloutInlineResourceGap.test.js.map +1 -1
- package/dist/__tests__/pipeline/calloutSplitMinLinesChild.test.js +1 -1
- package/dist/__tests__/pipeline/calloutSplitMinLinesChild.test.js.map +1 -1
- package/dist/__tests__/pipeline/colonListRoom.test.js +1 -1
- package/dist/__tests__/pipeline/colonListRoom.test.js.map +1 -1
- package/dist/__tests__/pipeline/compoundBreaks.test.js +1 -1
- package/dist/__tests__/pipeline/compoundBreaks.test.js.map +1 -1
- package/dist/__tests__/pipeline/dashBreaks.test.js +1 -1
- package/dist/__tests__/pipeline/dashBreaks.test.js.map +1 -1
- package/dist/__tests__/pipeline/designTextTruncated.test.d.ts +2 -0
- package/dist/__tests__/pipeline/designTextTruncated.test.d.ts.map +1 -0
- package/dist/__tests__/pipeline/designTextTruncated.test.js +116 -0
- package/dist/__tests__/pipeline/designTextTruncated.test.js.map +1 -0
- package/dist/__tests__/pipeline/floatPlacement.test.js +3 -3
- package/dist/__tests__/pipeline/floatPlacement.test.js.map +1 -1
- package/dist/__tests__/pipeline/floatShrink.test.d.ts +2 -0
- package/dist/__tests__/pipeline/floatShrink.test.d.ts.map +1 -0
- package/dist/__tests__/pipeline/floatShrink.test.js +298 -0
- package/dist/__tests__/pipeline/floatShrink.test.js.map +1 -0
- package/dist/__tests__/pipeline/headingSplitOrphans.test.js +1 -1
- package/dist/__tests__/pipeline/headingSplitOrphans.test.js.map +1 -1
- package/dist/__tests__/pipeline/inlineFigureSpace.test.js +1 -1
- package/dist/__tests__/pipeline/inlineFigureSpace.test.js.map +1 -1
- package/dist/__tests__/pipeline/paragraphContainerTail.test.js +1 -1
- package/dist/__tests__/pipeline/paragraphContainerTail.test.js.map +1 -1
- package/dist/__tests__/pipeline/paragraphStyleFaces.test.js +7 -1
- package/dist/__tests__/pipeline/paragraphStyleFaces.test.js.map +1 -1
- package/dist/__tests__/pipeline/raggedOptimal.test.js +1 -1
- package/dist/__tests__/pipeline/raggedOptimal.test.js.map +1 -1
- package/dist/__tests__/pipeline/textWrap.test.d.ts +2 -0
- package/dist/__tests__/pipeline/textWrap.test.d.ts.map +1 -0
- package/dist/__tests__/pipeline/textWrap.test.js +453 -0
- package/dist/__tests__/pipeline/textWrap.test.js.map +1 -0
- package/dist/__tests__/preflight.test.js +30 -1
- package/dist/__tests__/preflight.test.js.map +1 -1
- package/dist/__tests__/presets/showcaseDesignOverflow.test.d.ts +2 -0
- package/dist/__tests__/presets/showcaseDesignOverflow.test.d.ts.map +1 -0
- package/dist/__tests__/presets/showcaseDesignOverflow.test.js +58 -0
- package/dist/__tests__/presets/showcaseDesignOverflow.test.js.map +1 -0
- package/dist/__tests__/tabStops.test.d.ts +2 -0
- package/dist/__tests__/tabStops.test.d.ts.map +1 -0
- package/dist/__tests__/tabStops.test.js +394 -0
- package/dist/__tests__/tabStops.test.js.map +1 -0
- package/dist/__tests__/table/booktabs.test.d.ts +2 -0
- package/dist/__tests__/table/booktabs.test.d.ts.map +1 -0
- package/dist/__tests__/table/booktabs.test.js +290 -0
- package/dist/__tests__/table/booktabs.test.js.map +1 -0
- package/dist/__tests__/textWrapMeasure.test.d.ts +2 -0
- package/dist/__tests__/textWrapMeasure.test.d.ts.map +1 -0
- package/dist/__tests__/textWrapMeasure.test.js +162 -0
- package/dist/__tests__/textWrapMeasure.test.js.map +1 -0
- package/dist/__tests__/verseLines.test.d.ts +2 -0
- package/dist/__tests__/verseLines.test.d.ts.map +1 -0
- package/dist/__tests__/verseLines.test.js +505 -0
- package/dist/__tests__/verseLines.test.js.map +1 -0
- package/dist/bitmapResolution.d.ts +42 -0
- package/dist/bitmapResolution.d.ts.map +1 -0
- package/dist/bitmapResolution.js +82 -0
- package/dist/bitmapResolution.js.map +1 -0
- package/dist/bundle/codec.d.ts +9 -2
- package/dist/bundle/codec.d.ts.map +1 -1
- package/dist/bundle/codec.js +24 -2
- package/dist/bundle/codec.js.map +1 -1
- package/dist/bundle/configVersion.d.ts +119 -8
- package/dist/bundle/configVersion.d.ts.map +1 -1
- package/dist/bundle/configVersion.js +395 -6
- package/dist/bundle/configVersion.js.map +1 -1
- package/dist/bundle/index.d.ts +3 -3
- package/dist/bundle/index.d.ts.map +1 -1
- package/dist/bundle/index.js +2 -2
- package/dist/bundle/index.js.map +1 -1
- package/dist/bundle/manifest.d.ts +12 -2
- package/dist/bundle/manifest.d.ts.map +1 -1
- package/dist/bundle/manifest.js +132 -6
- package/dist/bundle/manifest.js.map +1 -1
- package/dist/bundle/types.d.ts +28 -2
- package/dist/bundle/types.d.ts.map +1 -1
- package/dist/canvas-backend/blockRender.d.ts.map +1 -1
- package/dist/canvas-backend/blockRender.js +45 -9
- package/dist/canvas-backend/blockRender.js.map +1 -1
- package/dist/canvas-backend/index.d.ts.map +1 -1
- package/dist/canvas-backend/index.js +3 -0
- package/dist/canvas-backend/index.js.map +1 -1
- package/dist/canvas-backend/renderResourceBlock.d.ts.map +1 -1
- package/dist/canvas-backend/renderResourceBlock.js +15 -1
- package/dist/canvas-backend/renderResourceBlock.js.map +1 -1
- package/dist/cjkMarks.js +1 -1
- package/dist/cjkMarks.js.map +1 -1
- package/dist/code/highlight.d.ts +34 -0
- package/dist/code/highlight.d.ts.map +1 -0
- package/dist/code/highlight.js +406 -0
- package/dist/code/highlight.js.map +1 -0
- package/dist/configWarnings.d.ts.map +1 -1
- package/dist/configWarnings.js +220 -4
- package/dist/configWarnings.js.map +1 -1
- package/dist/defaults/bodyText.d.ts.map +1 -1
- package/dist/defaults/bodyText.js +25 -0
- package/dist/defaults/bodyText.js.map +1 -1
- package/dist/defaults/calloutStyles.d.ts.map +1 -1
- package/dist/defaults/calloutStyles.js +7 -0
- package/dist/defaults/calloutStyles.js.map +1 -1
- package/dist/defaults/codeStyle.d.ts +29 -0
- package/dist/defaults/codeStyle.d.ts.map +1 -0
- package/dist/defaults/codeStyle.js +284 -0
- package/dist/defaults/codeStyle.js.map +1 -0
- package/dist/defaults/dropCap.d.ts +49 -0
- package/dist/defaults/dropCap.d.ts.map +1 -0
- package/dist/defaults/dropCap.js +66 -0
- package/dist/defaults/dropCap.js.map +1 -0
- package/dist/defaults/headerFooter.d.ts +21 -6
- package/dist/defaults/headerFooter.d.ts.map +1 -1
- package/dist/defaults/headerFooter.js +37 -14
- package/dist/defaults/headerFooter.js.map +1 -1
- package/dist/defaults/headings.d.ts +5 -4
- package/dist/defaults/headings.d.ts.map +1 -1
- package/dist/defaults/headings.js +26 -4
- package/dist/defaults/headings.js.map +1 -1
- package/dist/defaults/index.d.ts +4 -1
- package/dist/defaults/index.d.ts.map +1 -1
- package/dist/defaults/index.js +20 -1
- package/dist/defaults/index.js.map +1 -1
- package/dist/defaults/layout.d.ts +30 -1
- package/dist/defaults/layout.d.ts.map +1 -1
- package/dist/defaults/layout.js +105 -1
- package/dist/defaults/layout.js.map +1 -1
- package/dist/defaults/lineNumbers.d.ts +19 -0
- package/dist/defaults/lineNumbers.d.ts.map +1 -0
- package/dist/defaults/lineNumbers.js +101 -0
- package/dist/defaults/lineNumbers.js.map +1 -0
- package/dist/defaults/paragraphStyles.d.ts.map +1 -1
- package/dist/defaults/paragraphStyles.js +20 -0
- package/dist/defaults/paragraphStyles.js.map +1 -1
- package/dist/defaults/parts.js +4 -4
- package/dist/defaults/parts.js.map +1 -1
- package/dist/defaults/tabStops.d.ts +29 -0
- package/dist/defaults/tabStops.d.ts.map +1 -0
- package/dist/defaults/tabStops.js +94 -0
- package/dist/defaults/tabStops.js.map +1 -0
- package/dist/defaults/tableStyle.d.ts.map +1 -1
- package/dist/defaults/tableStyle.js +44 -0
- package/dist/defaults/tableStyle.js.map +1 -1
- package/dist/defaults/toc.js +2 -2
- package/dist/defaults/verse.d.ts +11 -0
- package/dist/defaults/verse.d.ts.map +1 -0
- package/dist/defaults/verse.js +57 -0
- package/dist/defaults/verse.js.map +1 -0
- package/dist/design/layout.d.ts +15 -1
- package/dist/design/layout.d.ts.map +1 -1
- package/dist/design/layout.js +28 -4
- package/dist/design/layout.js.map +1 -1
- package/dist/fonts/usage.d.ts +7 -0
- package/dist/fonts/usage.d.ts.map +1 -1
- package/dist/fonts/usage.js +71 -0
- package/dist/fonts/usage.js.map +1 -1
- package/dist/frontmatter.d.ts +20 -0
- package/dist/frontmatter.d.ts.map +1 -1
- package/dist/frontmatter.js +69 -3
- package/dist/frontmatter.js.map +1 -1
- package/dist/html-backend.d.ts.map +1 -1
- package/dist/html-backend.js +107 -15
- package/dist/html-backend.js.map +1 -1
- package/dist/index.d.ts +18 -10
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +9 -4
- package/dist/index.js.map +1 -1
- package/dist/measure/bidiLines.d.ts +4 -3
- package/dist/measure/bidiLines.d.ts.map +1 -1
- package/dist/measure/bidiLines.js +14 -9
- package/dist/measure/bidiLines.js.map +1 -1
- package/dist/measure/cache.js +2 -2
- package/dist/measure/cache.js.map +1 -1
- package/dist/measure/cjkCompose.d.ts.map +1 -1
- package/dist/measure/cjkCompose.js +10 -6
- package/dist/measure/cjkCompose.js.map +1 -1
- package/dist/measure/hardBreaks.d.ts +46 -0
- package/dist/measure/hardBreaks.d.ts.map +1 -0
- package/dist/measure/hardBreaks.js +228 -0
- package/dist/measure/hardBreaks.js.map +1 -0
- package/dist/measure/index.d.ts +4 -3
- package/dist/measure/index.d.ts.map +1 -1
- package/dist/measure/index.js +5 -4
- package/dist/measure/index.js.map +1 -1
- package/dist/measure/leader.d.ts +20 -0
- package/dist/measure/leader.d.ts.map +1 -0
- package/dist/measure/leader.js +46 -0
- package/dist/measure/leader.js.map +1 -0
- package/dist/measure/links.js +1 -1
- package/dist/measure/links.js.map +1 -1
- package/dist/measure/plain.d.ts.map +1 -1
- package/dist/measure/plain.js +23 -26
- package/dist/measure/plain.js.map +1 -1
- package/dist/measure/rich.d.ts +19 -0
- package/dist/measure/rich.d.ts.map +1 -1
- package/dist/measure/rich.js +215 -39
- package/dist/measure/rich.js.map +1 -1
- package/dist/measure/tabs.d.ts +103 -0
- package/dist/measure/tabs.d.ts.map +1 -0
- package/dist/measure/tabs.js +123 -0
- package/dist/measure/tabs.js.map +1 -0
- package/dist/measure/types.d.ts +72 -2
- package/dist/measure/types.d.ts.map +1 -1
- package/dist/measure/types.js +87 -3
- package/dist/measure/types.js.map +1 -1
- package/dist/parse/blockParser.d.ts +13 -6
- package/dist/parse/blockParser.d.ts.map +1 -1
- package/dist/parse/blockParser.js +457 -87
- package/dist/parse/blockParser.js.map +1 -1
- package/dist/parse/codeFence.d.ts +18 -0
- package/dist/parse/codeFence.d.ts.map +1 -0
- package/dist/parse/codeFence.js +52 -0
- package/dist/parse/codeFence.js.map +1 -0
- 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/indexMarks.d.ts +3 -1
- package/dist/parse/indexMarks.d.ts.map +1 -1
- package/dist/parse/indexMarks.js +22 -2
- package/dist/parse/indexMarks.js.map +1 -1
- package/dist/parse/inlineFormatting.d.ts +50 -0
- package/dist/parse/inlineFormatting.d.ts.map +1 -1
- package/dist/parse/inlineFormatting.js +94 -0
- package/dist/parse/inlineFormatting.js.map +1 -1
- package/dist/parse/sourceMapping.d.ts.map +1 -1
- package/dist/parse/sourceMapping.js +65 -1
- package/dist/parse/sourceMapping.js.map +1 -1
- package/dist/parse/types.d.ts +144 -9
- package/dist/parse/types.d.ts.map +1 -1
- package/dist/pipeline/build.d.ts.map +1 -1
- package/dist/pipeline/build.js +629 -47
- package/dist/pipeline/build.js.map +1 -1
- package/dist/pipeline/buildBlockKind.d.ts +5 -0
- package/dist/pipeline/buildBlockKind.d.ts.map +1 -1
- package/dist/pipeline/buildBlockKind.js +74 -2
- package/dist/pipeline/buildBlockKind.js.map +1 -1
- package/dist/pipeline/buildHelpers.d.ts +3 -0
- package/dist/pipeline/buildHelpers.d.ts.map +1 -1
- package/dist/pipeline/buildHelpers.js +7 -2
- package/dist/pipeline/buildHelpers.js.map +1 -1
- package/dist/pipeline/buildMeasurement.js +1 -1
- package/dist/pipeline/buildMeasurement.js.map +1 -1
- package/dist/pipeline/calloutLayout.d.ts.map +1 -1
- package/dist/pipeline/calloutLayout.js +33 -2
- package/dist/pipeline/calloutLayout.js.map +1 -1
- package/dist/pipeline/chips.d.ts.map +1 -1
- package/dist/pipeline/chips.js +4 -0
- package/dist/pipeline/chips.js.map +1 -1
- package/dist/pipeline/codeBlocks.d.ts +38 -0
- package/dist/pipeline/codeBlocks.d.ts.map +1 -0
- package/dist/pipeline/codeBlocks.js +146 -0
- package/dist/pipeline/codeBlocks.js.map +1 -0
- package/dist/pipeline/codeInline.d.ts +22 -0
- package/dist/pipeline/codeInline.d.ts.map +1 -0
- package/dist/pipeline/codeInline.js +93 -0
- package/dist/pipeline/codeInline.js.map +1 -0
- package/dist/pipeline/codeLines.d.ts +91 -0
- package/dist/pipeline/codeLines.d.ts.map +1 -0
- package/dist/pipeline/codeLines.js +399 -0
- package/dist/pipeline/codeLines.js.map +1 -0
- package/dist/pipeline/columnBalancing.d.ts.map +1 -1
- package/dist/pipeline/columnBalancing.js +5 -0
- package/dist/pipeline/columnBalancing.js.map +1 -1
- package/dist/pipeline/config.d.ts.map +1 -1
- package/dist/pipeline/config.js +8 -1
- package/dist/pipeline/config.js.map +1 -1
- package/dist/pipeline/contentWarnings.d.ts +25 -0
- package/dist/pipeline/contentWarnings.d.ts.map +1 -1
- package/dist/pipeline/contentWarnings.js +173 -19
- package/dist/pipeline/contentWarnings.js.map +1 -1
- package/dist/pipeline/continuation.d.ts.map +1 -1
- package/dist/pipeline/continuation.js +9 -2
- package/dist/pipeline/continuation.js.map +1 -1
- package/dist/pipeline/dropCap.d.ts +128 -0
- package/dist/pipeline/dropCap.d.ts.map +1 -0
- package/dist/pipeline/dropCap.js +412 -0
- package/dist/pipeline/dropCap.js.map +1 -0
- package/dist/pipeline/floatPlacement.d.ts +34 -4
- package/dist/pipeline/floatPlacement.d.ts.map +1 -1
- package/dist/pipeline/floatPlacement.js +35 -5
- package/dist/pipeline/floatPlacement.js.map +1 -1
- package/dist/pipeline/floatSlots.d.ts +7 -0
- package/dist/pipeline/floatSlots.d.ts.map +1 -1
- package/dist/pipeline/floatSlots.js.map +1 -1
- package/dist/pipeline/hardBreaks.d.ts +19 -0
- package/dist/pipeline/hardBreaks.d.ts.map +1 -0
- package/dist/pipeline/hardBreaks.js +36 -0
- package/dist/pipeline/hardBreaks.js.map +1 -0
- package/dist/pipeline/headerFooter.d.ts +4 -1
- package/dist/pipeline/headerFooter.d.ts.map +1 -1
- package/dist/pipeline/headerFooter.js +23 -6
- package/dist/pipeline/headerFooter.js.map +1 -1
- package/dist/pipeline/lineNumbers.d.ts +37 -0
- package/dist/pipeline/lineNumbers.d.ts.map +1 -0
- package/dist/pipeline/lineNumbers.js +441 -0
- package/dist/pipeline/lineNumbers.js.map +1 -0
- package/dist/pipeline/measureContentBlock.d.ts +38 -5
- package/dist/pipeline/measureContentBlock.d.ts.map +1 -1
- package/dist/pipeline/measureContentBlock.js +284 -69
- package/dist/pipeline/measureContentBlock.js.map +1 -1
- package/dist/pipeline/partPalette.d.ts +1 -1
- package/dist/pipeline/partPalette.d.ts.map +1 -1
- package/dist/pipeline/partPalette.js +24 -2
- package/dist/pipeline/partPalette.js.map +1 -1
- package/dist/pipeline/placement.d.ts.map +1 -1
- package/dist/pipeline/placement.js +7 -0
- package/dist/pipeline/placement.js.map +1 -1
- package/dist/pipeline/resourceLayout.d.ts +15 -0
- package/dist/pipeline/resourceLayout.d.ts.map +1 -1
- package/dist/pipeline/resourceLayout.js +95 -15
- package/dist/pipeline/resourceLayout.js.map +1 -1
- package/dist/pipeline/styles.d.ts +18 -2
- package/dist/pipeline/styles.d.ts.map +1 -1
- package/dist/pipeline/styles.js +23 -8
- package/dist/pipeline/styles.js.map +1 -1
- package/dist/pipeline/tabs.d.ts +35 -0
- package/dist/pipeline/tabs.d.ts.map +1 -0
- package/dist/pipeline/tabs.js +99 -0
- package/dist/pipeline/tabs.js.map +1 -0
- package/dist/pipeline/textWrap.d.ts +94 -0
- package/dist/pipeline/textWrap.d.ts.map +1 -0
- package/dist/pipeline/textWrap.js +188 -0
- package/dist/pipeline/textWrap.js.map +1 -0
- package/dist/pipeline/toc.d.ts.map +1 -1
- package/dist/pipeline/toc.js +3 -38
- package/dist/pipeline/toc.js.map +1 -1
- package/dist/pipeline/verseLines.d.ts +98 -0
- package/dist/pipeline/verseLines.d.ts.map +1 -0
- package/dist/pipeline/verseLines.js +293 -0
- package/dist/pipeline/verseLines.js.map +1 -0
- package/dist/preflight.d.ts +46 -1
- package/dist/preflight.d.ts.map +1 -1
- package/dist/preflight.js +43 -7
- package/dist/preflight.js.map +1 -1
- package/dist/table/booktabs.d.ts +37 -0
- package/dist/table/booktabs.d.ts.map +1 -0
- package/dist/table/booktabs.js +82 -0
- package/dist/table/booktabs.js.map +1 -0
- package/dist/types.d.ts +787 -12
- package/dist/types.d.ts.map +1 -1
- package/dist/vdt.d.ts +367 -9
- package/dist/vdt.d.ts.map +1 -1
- package/dist/vdt.js +9 -2
- package/dist/vdt.js.map +1 -1
- package/dist/word/docxRead.d.ts.map +1 -1
- package/dist/word/docxRead.js +15 -0
- package/dist/word/docxRead.js.map +1 -1
- package/dist/word/index.d.ts +1 -1
- package/dist/word/index.d.ts.map +1 -1
- package/dist/word/index.js +1 -1
- package/dist/word/index.js.map +1 -1
- package/dist/word/inline.d.ts +6 -1
- package/dist/word/inline.d.ts.map +1 -1
- package/dist/word/inline.js +35 -1
- package/dist/word/inline.js.map +1 -1
- package/dist/word/model.d.ts +14 -0
- package/dist/word/model.d.ts.map +1 -1
- package/dist/word/model.js.map +1 -1
- package/dist/word/template.d.ts +12 -3
- package/dist/word/template.d.ts.map +1 -1
- package/dist/word/template.js +13 -3
- package/dist/word/template.js.map +1 -1
- package/dist/word/toDocx.d.ts.map +1 -1
- package/dist/word/toDocx.js +52 -8
- package/dist/word/toDocx.js.map +1 -1
- package/dist/word/toMarkdown.d.ts +15 -1
- package/dist/word/toMarkdown.d.ts.map +1 -1
- package/dist/word/toMarkdown.js +133 -7
- package/dist/word/toMarkdown.js.map +1 -1
- package/dist/word/word.test.js +124 -2
- package/dist/word/word.test.js.map +1 -1
- package/dist/worker/fonts.d.ts +2 -1
- package/dist/worker/fonts.d.ts.map +1 -1
- package/dist/worker/fonts.js +6 -2
- package/dist/worker/fonts.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tabs.js","sourceRoot":"","sources":["../../src/measure/tabs.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA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AAK,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,WAAW,CAAC,IAAI,CAAC,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC;AAC/G,CAAC;AAED;;kCAEkC;AAClC,MAAM,UAAU,kBAAkB,CAAC,MAA0B;IAC3D,IAAI,CAAC,MAAM;QAAE,OAAO,GAAG,CAAC;IACxB,IAAI,CAAC;QACH,MAAM,KAAK,GAAG,IAAI,IAAI,CAAC,YAAY,CAAC,MAAM,EAAE,EAAE,eAAe,EAAE,MAAM,EAA8B,CAAC,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC;QACxH,OAAO,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,SAAS,CAAC,EAAE,KAAK,IAAI,GAAG,CAAC;IAC/D,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,GAAG,CAAC;IACb,CAAC;AACH,CAAC"}
|
package/dist/measure/types.d.ts
CHANGED
|
@@ -20,9 +20,55 @@ export interface LineWidthStep {
|
|
|
20
20
|
/** The measure of line `lineIndex` (before its indent): the width of the
|
|
21
21
|
* last step at or before it, else `maxWidthPx`. */
|
|
22
22
|
export declare function lineMeasure(maxWidthPx: number, steps: readonly LineWidthStep[] | undefined, lineIndex: number): number;
|
|
23
|
+
/** Lines of a paragraph set short on either side (see
|
|
24
|
+
* `MeasureBlockOptions.lineInsets`): the lines beside a picture that
|
|
25
|
+
* text wraps round (#627). The sides are the measurer's: `start` is the
|
|
26
|
+
* side the lines are set from (the flow's left; the indent's side), `end`
|
|
27
|
+
* the other. A paragraph set against its frame's direction keeps them
|
|
28
|
+
* where they are when its lines are mirrored (`mirrorLineSpans`). */
|
|
29
|
+
export interface LineInsetStep {
|
|
30
|
+
/** First line (0-based) set short. */
|
|
31
|
+
fromLine: number;
|
|
32
|
+
/** Last line (0-based, inclusive) set short; unset, every later line. */
|
|
33
|
+
toLine?: number;
|
|
34
|
+
/** Room taken off the start side (px), before the line's own indent. */
|
|
35
|
+
startInsetPx: number;
|
|
36
|
+
/** Room taken off the end side (px). */
|
|
37
|
+
endInsetPx: number;
|
|
38
|
+
}
|
|
39
|
+
/** The insets of line `li` (0-based): the sum of the steps that cover it. */
|
|
40
|
+
export declare function lineInsetsAt(steps: readonly LineInsetStep[] | undefined, li: number): {
|
|
41
|
+
start: number;
|
|
42
|
+
end: number;
|
|
43
|
+
};
|
|
44
|
+
/** The largest inset (both sides together) any line takes. */
|
|
45
|
+
export declare function maxLineInset(steps: readonly LineInsetStep[] | undefined): number;
|
|
46
|
+
/** Where line `li` starts, from the measure's start (px): its indent
|
|
47
|
+
* (`lineIndentAt`) past its start inset (`lineInsets`). */
|
|
48
|
+
export declare function lineStartAt(options: MeasureBlockOptions | undefined, li: number): number;
|
|
49
|
+
/** The room line `li` breaks to (px): its measure (`lineMeasure`) less
|
|
50
|
+
* its insets and its indent. */
|
|
51
|
+
export declare function lineWidthAt(maxWidthPx: number, options: MeasureBlockOptions | undefined, li: number): number;
|
|
52
|
+
/** {@link lineWidthAt} as a function of the line, its values kept as they
|
|
53
|
+
* are computed: Knuth–Plass asks for the width of the same lines over and
|
|
54
|
+
* over. One per measurement (the options do not change in it). */
|
|
55
|
+
export declare function lineWidthFunction(maxWidthPx: number, options: MeasureBlockOptions | undefined): (li: number) => number;
|
|
56
|
+
/** Give each line set short beside a picture (`lineInsets`, #627) its
|
|
57
|
+
* span (`VDTLine.measure`, flagged `wrap`): from its start (`bbox.x`, its
|
|
58
|
+
* inset and indent) to its measure less its end inset. Renderers justify
|
|
59
|
+
* and align the line in it. Lines with no inset are left as they are. */
|
|
60
|
+
export declare function markInsetLines(lines: VDTLine[], maxWidthPx: number, options: MeasureBlockOptions | undefined): void;
|
|
23
61
|
/** The line from which the measure stops changing: after the first line
|
|
24
|
-
* (its indent)
|
|
25
|
-
|
|
62
|
+
* (its indent), after the last step, after the last entry of an indent
|
|
63
|
+
* table (`lineIndentsPx`: the lines a drop cap shortens, #623) and after
|
|
64
|
+
* the last line set short beside a picture (`lineInsets`, #627). */
|
|
65
|
+
export declare function uniformMeasureFrom(steps: readonly LineWidthStep[] | undefined, indents?: readonly number[], insets?: readonly LineInsetStep[]): number;
|
|
66
|
+
/** The indent of line `li` (0-based) the options ask for: its entry in
|
|
67
|
+
* `lineIndentsPx`, else the first-line indent on line 0 (or, hanging, on
|
|
68
|
+
* every line but line 0). Never negative. */
|
|
69
|
+
export declare function lineIndentAt(options: MeasureBlockOptions | undefined, li: number): number;
|
|
70
|
+
/** The largest indent any line of the block takes (see {@link lineIndentAt}). */
|
|
71
|
+
export declare function maxLineIndent(options: MeasureBlockOptions | undefined): number;
|
|
26
72
|
export interface MeasuredBlock {
|
|
27
73
|
lines: VDTLine[];
|
|
28
74
|
totalHeight: number;
|
|
@@ -42,12 +88,29 @@ export interface MeasurementCache {
|
|
|
42
88
|
export interface MeasureBlockOptions {
|
|
43
89
|
textAlign?: TextAlign;
|
|
44
90
|
hyphenate?: boolean;
|
|
91
|
+
/** The first line's indent (px); with {@link hangingIndent}, the indent
|
|
92
|
+
* of every line but the first instead. A negative value counts as 0.
|
|
93
|
+
* {@link lineIndentsPx} takes the place of both when set. */
|
|
45
94
|
firstLineIndentPx?: number;
|
|
46
95
|
hangingIndent?: boolean;
|
|
96
|
+
/** The indent of each line (px, from the measure's start) in line
|
|
97
|
+
* order, from line 0; the last entry holds for every line after it.
|
|
98
|
+
* `[first, rest]` pairs a first-line indent with a hanging one (a
|
|
99
|
+
* paragraph style that sets both, a turnover of verse, #620); a longer
|
|
100
|
+
* table indents the first lines each its own way. Takes the place of
|
|
101
|
+
* {@link firstLineIndentPx} and {@link hangingIndent} when set; see
|
|
102
|
+
* {@link lineIndentAt}. Joins the cache key only when set. */
|
|
103
|
+
lineIndentsPx?: readonly number[];
|
|
47
104
|
/** The label column of a numbered bibliography entry (#290), in px from
|
|
48
105
|
* the line's start: the spans' `labelTab` spaces are widened so the
|
|
49
106
|
* entry's text starts there. */
|
|
50
107
|
labelColumnPx?: number;
|
|
108
|
+
/** The paragraph's tab stops (#622, `measure/tabs.ts`): where its tabs
|
|
109
|
+
* (`InlineSpan.tab`) send the text after them. A paragraph that holds a
|
|
110
|
+
* tab is set line by line, whatever {@link optimal} says. Unset: a tab
|
|
111
|
+
* without a stop of its own (`:tab{at=…}`) is a word space. Joins the
|
|
112
|
+
* cache key only when set. */
|
|
113
|
+
tabs?: import('./tabs').TabSettings;
|
|
51
114
|
/** Use Knuth-Plass optimal line breaking instead of greedy. */
|
|
52
115
|
optimal?: boolean;
|
|
53
116
|
/** Max space stretch ratio (for K-P glue model). Default 1.5. */
|
|
@@ -85,6 +148,13 @@ export interface MeasureBlockOptions {
|
|
|
85
148
|
* already placed kept by `keepBreaks`. Every breaker honours it. Such a
|
|
86
149
|
* measurement is never cached. */
|
|
87
150
|
restWidths?: readonly LineWidthStep[];
|
|
151
|
+
/** Lines set short on either side (#627, see {@link LineInsetStep}): the
|
|
152
|
+
* lines of a paragraph beside a picture that text wraps round. A line
|
|
153
|
+
* starts past its start inset (its indent after it) and breaks to its
|
|
154
|
+
* measure less both insets; `VDTLine.bbox.x` and `VDTLine.measure`
|
|
155
|
+
* carry them. Every breaker honours it. Such a measurement is never
|
|
156
|
+
* cached. */
|
|
157
|
+
lineInsets?: readonly LineInsetStep[];
|
|
88
158
|
/** Knuth-Plass looseness: re-break the paragraph with this many lines more
|
|
89
159
|
* (column balancing's "run a paragraph long" lever) or fewer — negative —
|
|
90
160
|
* when a feasible sequence of that length exists. Ignored on the greedy
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/measure/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAC;AACtC,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AACr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|
@@ -8,14 +8,98 @@ export function lineMeasure(maxWidthPx, steps, lineIndex) {
|
|
|
8
8
|
width = s.maxWidthPx;
|
|
9
9
|
return width;
|
|
10
10
|
}
|
|
11
|
+
/** The insets of line `li` (0-based): the sum of the steps that cover it. */
|
|
12
|
+
export function lineInsetsAt(steps, li) {
|
|
13
|
+
let start = 0;
|
|
14
|
+
let end = 0;
|
|
15
|
+
if (steps) {
|
|
16
|
+
for (const s of steps) {
|
|
17
|
+
if (s.fromLine > li || (s.toLine !== undefined && s.toLine < li))
|
|
18
|
+
continue;
|
|
19
|
+
start += Math.max(0, s.startInsetPx);
|
|
20
|
+
end += Math.max(0, s.endInsetPx);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
return { start, end };
|
|
24
|
+
}
|
|
25
|
+
/** The largest inset (both sides together) any line takes. */
|
|
26
|
+
export function maxLineInset(steps) {
|
|
27
|
+
if (!steps || steps.length === 0)
|
|
28
|
+
return 0;
|
|
29
|
+
let max = 0;
|
|
30
|
+
for (const s of steps) {
|
|
31
|
+
const at = lineInsetsAt(steps, s.fromLine);
|
|
32
|
+
max = Math.max(max, at.start + at.end);
|
|
33
|
+
}
|
|
34
|
+
return max;
|
|
35
|
+
}
|
|
36
|
+
/** Where line `li` starts, from the measure's start (px): its indent
|
|
37
|
+
* (`lineIndentAt`) past its start inset (`lineInsets`). */
|
|
38
|
+
export function lineStartAt(options, li) {
|
|
39
|
+
const inset = options?.lineInsets ? lineInsetsAt(options.lineInsets, li).start : 0;
|
|
40
|
+
return inset + lineIndentAt(options, li);
|
|
41
|
+
}
|
|
42
|
+
/** The room line `li` breaks to (px): its measure (`lineMeasure`) less
|
|
43
|
+
* its insets and its indent. */
|
|
44
|
+
export function lineWidthAt(maxWidthPx, options, li) {
|
|
45
|
+
const end = options?.lineInsets ? lineInsetsAt(options.lineInsets, li).end : 0;
|
|
46
|
+
return lineMeasure(maxWidthPx, options?.restWidths, li) - end - lineStartAt(options, li);
|
|
47
|
+
}
|
|
48
|
+
/** {@link lineWidthAt} as a function of the line, its values kept as they
|
|
49
|
+
* are computed: Knuth–Plass asks for the width of the same lines over and
|
|
50
|
+
* over. One per measurement (the options do not change in it). */
|
|
51
|
+
export function lineWidthFunction(maxWidthPx, options) {
|
|
52
|
+
const known = [];
|
|
53
|
+
return (li) => known[li] ?? (known[li] = lineWidthAt(maxWidthPx, options, li));
|
|
54
|
+
}
|
|
55
|
+
/** Give each line set short beside a picture (`lineInsets`, #627) its
|
|
56
|
+
* span (`VDTLine.measure`, flagged `wrap`): from its start (`bbox.x`, its
|
|
57
|
+
* inset and indent) to its measure less its end inset. Renderers justify
|
|
58
|
+
* and align the line in it. Lines with no inset are left as they are. */
|
|
59
|
+
export function markInsetLines(lines, maxWidthPx, options) {
|
|
60
|
+
const steps = options?.lineInsets;
|
|
61
|
+
if (!steps || steps.length === 0)
|
|
62
|
+
return;
|
|
63
|
+
lines.forEach((line, li) => {
|
|
64
|
+
const { start, end } = lineInsetsAt(steps, li);
|
|
65
|
+
if (!(start > 0) && !(end > 0))
|
|
66
|
+
return;
|
|
67
|
+
const width = Math.max(0, lineMeasure(maxWidthPx, options.restWidths, li) - end - line.bbox.x);
|
|
68
|
+
line.measure = { x: line.bbox.x, width, wrap: true };
|
|
69
|
+
});
|
|
70
|
+
}
|
|
11
71
|
/** The line from which the measure stops changing: after the first line
|
|
12
|
-
* (its indent)
|
|
13
|
-
|
|
14
|
-
|
|
72
|
+
* (its indent), after the last step, after the last entry of an indent
|
|
73
|
+
* table (`lineIndentsPx`: the lines a drop cap shortens, #623) and after
|
|
74
|
+
* the last line set short beside a picture (`lineInsets`, #627). */
|
|
75
|
+
export function uniformMeasureFrom(steps, indents, insets) {
|
|
76
|
+
let from = Math.max(1, (indents?.length ?? 0) - 1);
|
|
15
77
|
if (steps)
|
|
16
78
|
for (const s of steps)
|
|
17
79
|
from = Math.max(from, s.fromLine);
|
|
80
|
+
if (insets)
|
|
81
|
+
for (const s of insets)
|
|
82
|
+
from = Math.max(from, s.toLine !== undefined ? s.toLine + 1 : s.fromLine);
|
|
18
83
|
return from;
|
|
19
84
|
}
|
|
85
|
+
/** The indent of line `li` (0-based) the options ask for: its entry in
|
|
86
|
+
* `lineIndentsPx`, else the first-line indent on line 0 (or, hanging, on
|
|
87
|
+
* every line but line 0). Never negative. */
|
|
88
|
+
export function lineIndentAt(options, li) {
|
|
89
|
+
const table = options?.lineIndentsPx;
|
|
90
|
+
if (table && table.length > 0)
|
|
91
|
+
return Math.max(0, table[Math.min(li, table.length - 1)]);
|
|
92
|
+
const indent = options?.firstLineIndentPx ?? 0;
|
|
93
|
+
if (!(indent > 0))
|
|
94
|
+
return 0;
|
|
95
|
+
return options?.hangingIndent ? (li === 0 ? 0 : indent) : (li === 0 ? indent : 0);
|
|
96
|
+
}
|
|
97
|
+
/** The largest indent any line of the block takes (see {@link lineIndentAt}). */
|
|
98
|
+
export function maxLineIndent(options) {
|
|
99
|
+
const table = options?.lineIndentsPx;
|
|
100
|
+
if (table && table.length > 0)
|
|
101
|
+
return Math.max(0, ...table);
|
|
102
|
+
return Math.max(0, options?.firstLineIndentPx ?? 0);
|
|
103
|
+
}
|
|
20
104
|
export const SOFT_HYPHEN = '\u00AD';
|
|
21
105
|
//# sourceMappingURL=types.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/measure/types.ts"],"names":[],"mappings":"AAsBA;oDACoD;AACpD,MAAM,UAAU,WAAW,CAAC,UAAkB,EAAE,KAA2C,EAAE,SAAiB;IAC5G,IAAI,KAAK,GAAG,UAAU,CAAC;IACvB,IAAI,KAAK;QAAE,KAAK,MAAM,CAAC,IAAI,KAAK;YAAE,IAAI,CAAC,CAAC,QAAQ,IAAI,SAAS;gBAAE,KAAK,GAAG,CAAC,CAAC,UAAU,CAAC;IACpF,OAAO,KAAK,CAAC;AACf,CAAC;AAED;
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/measure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markdown.
|
|
6
6
|
*/
|
|
7
|
-
import type { ContainerName, ContentBlock, DirectiveName, ParseIssue } from './types';
|
|
7
|
+
import type { CodeBlockInfo, ContainerName, ContentBlock, DirectiveName, ParseIssue, ParseOptions } from './types';
|
|
8
8
|
export { parseDirectiveAttrs, spaceDirectiveLines, MAX_SPACE_LINES } from './attrs';
|
|
9
|
+
export { codeFenceOpen } from './codeFence';
|
|
9
10
|
/** Set of directive names recognized today. Unknown names fall through to
|
|
10
11
|
* paragraph-parsing and downstream warnings flag them. */
|
|
11
12
|
export declare const KNOWN_DIRECTIVES: ReadonlySet<DirectiveName>;
|
|
12
13
|
/** Set of fenced-container names recognized today. A `:::name` line whose
|
|
13
14
|
* name is a known container opens a block that runs until a bare `:::`. */
|
|
14
15
|
export declare const KNOWN_CONTAINERS: ReadonlySet<ContainerName>;
|
|
16
|
+
/** A fence's info string read (#624): the first word is the language
|
|
17
|
+
* (lower-cased); a `{…}` block after it, or `key=value` pairs, are
|
|
18
|
+
* attributes in the directive grammar; anything else after the language
|
|
19
|
+
* is the title (```` ```console Terminal ````). */
|
|
20
|
+
export declare function readCodeInfo(info: string): Pick<CodeBlockInfo, 'lang' | 'attrs' | 'title'>;
|
|
15
21
|
/** @internal Number of inputs the parse memo keeps (tests). */
|
|
16
22
|
export declare const PARSE_MEMO_CAPACITY = 8;
|
|
17
23
|
/**
|
|
@@ -20,20 +26,21 @@ export declare const PARSE_MEMO_CAPACITY = 8;
|
|
|
20
26
|
* This avoids reparsing a document on each keystroke when upstream
|
|
21
27
|
* recomputes only because a sibling state changed.
|
|
22
28
|
*/
|
|
23
|
-
export declare function parseMarkdownMemo(markdown: string): ContentBlock[];
|
|
24
|
-
export declare function parseMarkdownWithIssuesMemo(markdown: string): {
|
|
29
|
+
export declare function parseMarkdownMemo(markdown: string, options?: ParseOptions): ContentBlock[];
|
|
30
|
+
export declare function parseMarkdownWithIssuesMemo(markdown: string, options?: ParseOptions): {
|
|
25
31
|
blocks: ContentBlock[];
|
|
26
32
|
issues: ParseIssue[];
|
|
27
33
|
};
|
|
28
|
-
export declare function parseMarkdown(markdown: string): ContentBlock[];
|
|
34
|
+
export declare function parseMarkdown(markdown: string, options?: ParseOptions): ContentBlock[];
|
|
29
35
|
/**
|
|
30
36
|
* Merge consecutive blockquote lines into a single block, and consecutive
|
|
31
37
|
* non-blank, non-special lines into paragraphs. Index marks (`:index…`)
|
|
32
38
|
* are taken out first and attached to the blocks holding them
|
|
33
39
|
* (`ContentBlock.indexMarks`); every source offset still points into
|
|
34
|
-
* `markdown`.
|
|
40
|
+
* `markdown`. `options` picks how code is read (#624): fences on, indented
|
|
41
|
+
* code off by default.
|
|
35
42
|
*/
|
|
36
|
-
export declare function parseMarkdownWithIssues(markdown: string): {
|
|
43
|
+
export declare function parseMarkdownWithIssues(markdown: string, options?: ParseOptions): {
|
|
37
44
|
blocks: ContentBlock[];
|
|
38
45
|
issues: ParseIssue[];
|
|
39
46
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"blockParser.d.ts","sourceRoot":"","sources":["../../src/parse/blockParser.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,YAAY,EAAkB,aAAa,EAAY,UAAU,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"blockParser.d.ts","sourceRoot":"","sources":["../../src/parse/blockParser.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,aAAa,EAAE,YAAY,EAAkB,aAAa,EAAY,UAAU,EAAE,YAAY,EAA8B,MAAM,SAAS,CAAC;AAczK,OAAO,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AACpF,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAW5C;2DAC2D;AAC3D,eAAO,MAAM,gBAAgB,EAAE,WAAW,CAAC,aAAa,CAAuI,CAAC;AA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