postext 1.47.0 → 1.48.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/designOverflowPin.test.js +1 -1
- package/dist/__tests__/bundle/gridBreakRulesPin.test.js +2 -2
- package/dist/__tests__/bundle/shapingLanguagePin.test.js +3 -3
- package/dist/__tests__/bundle/taskBoxPin.test.js +1 -1
- package/dist/__tests__/bundle.test.js +1 -1
- package/dist/__tests__/codeBlocks.test.js +1 -1
- package/dist/__tests__/composed/cardShapes.test.d.ts +2 -0
- package/dist/__tests__/composed/cardShapes.test.d.ts.map +1 -0
- package/dist/__tests__/composed/cardShapes.test.js +82 -0
- package/dist/__tests__/composed/cardShapes.test.js.map +1 -0
- package/dist/__tests__/composed/connectors.test.d.ts +2 -0
- package/dist/__tests__/composed/connectors.test.d.ts.map +1 -0
- package/dist/__tests__/composed/connectors.test.js +349 -0
- package/dist/__tests__/composed/connectors.test.js.map +1 -0
- package/dist/__tests__/composed/decorationSidePoints.test.d.ts +2 -0
- package/dist/__tests__/composed/decorationSidePoints.test.d.ts.map +1 -0
- package/dist/__tests__/composed/decorationSidePoints.test.js +164 -0
- package/dist/__tests__/composed/decorationSidePoints.test.js.map +1 -0
- package/dist/__tests__/composed/fit.test.js +2 -1
- package/dist/__tests__/composed/fit.test.js.map +1 -1
- package/dist/__tests__/composed/fixtures/connectors.d.ts +33 -0
- package/dist/__tests__/composed/fixtures/connectors.d.ts.map +1 -0
- package/dist/__tests__/composed/fixtures/connectors.js +142 -0
- package/dist/__tests__/composed/fixtures/connectors.js.map +1 -0
- package/dist/__tests__/composed/fixtures/grid.d.ts +32 -0
- package/dist/__tests__/composed/fixtures/grid.d.ts.map +1 -0
- package/dist/__tests__/composed/fixtures/grid.js +53 -0
- package/dist/__tests__/composed/fixtures/grid.js.map +1 -0
- package/dist/__tests__/composed/fixtures/legendMap.d.ts +24 -0
- package/dist/__tests__/composed/fixtures/legendMap.d.ts.map +1 -0
- package/dist/__tests__/composed/fixtures/legendMap.js +117 -0
- package/dist/__tests__/composed/fixtures/legendMap.js.map +1 -0
- package/dist/__tests__/composed/fixtures/mapParts.d.ts +58 -0
- package/dist/__tests__/composed/fixtures/mapParts.d.ts.map +1 -0
- package/dist/__tests__/composed/fixtures/mapParts.js +192 -0
- package/dist/__tests__/composed/fixtures/mapParts.js.map +1 -0
- package/dist/__tests__/composed/fixtures/modules.d.ts +55 -0
- package/dist/__tests__/composed/fixtures/modules.d.ts.map +1 -0
- package/dist/__tests__/composed/fixtures/modules.js +123 -0
- package/dist/__tests__/composed/fixtures/modules.js.map +1 -0
- package/dist/__tests__/composed/grid.test.d.ts +2 -0
- package/dist/__tests__/composed/grid.test.d.ts.map +1 -0
- package/dist/__tests__/composed/grid.test.js +357 -0
- package/dist/__tests__/composed/grid.test.js.map +1 -0
- package/dist/__tests__/composed/groups.test.js +6 -3
- package/dist/__tests__/composed/groups.test.js.map +1 -1
- package/dist/__tests__/composed/labelLegend.test.d.ts +2 -0
- package/dist/__tests__/composed/labelLegend.test.d.ts.map +1 -0
- package/dist/__tests__/composed/labelLegend.test.js +268 -0
- package/dist/__tests__/composed/labelLegend.test.js.map +1 -0
- package/dist/__tests__/composed/labelsChecks.test.js.map +1 -1
- package/dist/__tests__/composed/leaders.test.d.ts +2 -0
- package/dist/__tests__/composed/leaders.test.d.ts.map +1 -0
- package/dist/__tests__/composed/leaders.test.js +372 -0
- package/dist/__tests__/composed/leaders.test.js.map +1 -0
- package/dist/__tests__/composed/modules.test.d.ts +2 -0
- package/dist/__tests__/composed/modules.test.d.ts.map +1 -0
- package/dist/__tests__/composed/modules.test.js +352 -0
- package/dist/__tests__/composed/modules.test.js.map +1 -0
- package/dist/__tests__/composed/overConnectors.test.d.ts +2 -0
- package/dist/__tests__/composed/overConnectors.test.d.ts.map +1 -0
- package/dist/__tests__/composed/overConnectors.test.js +232 -0
- package/dist/__tests__/composed/overConnectors.test.js.map +1 -0
- package/dist/__tests__/composed/overlap.test.d.ts +2 -0
- package/dist/__tests__/composed/overlap.test.d.ts.map +1 -0
- package/dist/__tests__/composed/overlap.test.js +339 -0
- package/dist/__tests__/composed/overlap.test.js.map +1 -0
- package/dist/__tests__/composedTemplates.test.js +1 -1
- package/dist/__tests__/design/boxShape.test.d.ts +2 -0
- package/dist/__tests__/design/boxShape.test.d.ts.map +1 -0
- package/dist/__tests__/design/boxShape.test.js +126 -0
- package/dist/__tests__/design/boxShape.test.js.map +1 -0
- package/dist/__tests__/design/boxShapePaint.test.d.ts +2 -0
- package/dist/__tests__/design/boxShapePaint.test.d.ts.map +1 -0
- package/dist/__tests__/design/boxShapePaint.test.js +130 -0
- package/dist/__tests__/design/boxShapePaint.test.js.map +1 -0
- package/dist/__tests__/design/openerBottomAnchor.test.js.map +1 -1
- package/dist/__tests__/design/pathBlock.test.d.ts +2 -0
- package/dist/__tests__/design/pathBlock.test.d.ts.map +1 -0
- package/dist/__tests__/design/pathBlock.test.js +194 -0
- package/dist/__tests__/design/pathBlock.test.js.map +1 -0
- package/dist/__tests__/design/pathElement.test.d.ts +2 -0
- package/dist/__tests__/design/pathElement.test.d.ts.map +1 -0
- package/dist/__tests__/design/pathElement.test.js +257 -0
- package/dist/__tests__/design/pathElement.test.js.map +1 -0
- package/dist/__tests__/design/svgPath.test.d.ts +2 -0
- package/dist/__tests__/design/svgPath.test.d.ts.map +1 -0
- package/dist/__tests__/design/svgPath.test.js +144 -0
- package/dist/__tests__/design/svgPath.test.js.map +1 -0
- package/dist/__tests__/exports.test.js +52 -0
- package/dist/__tests__/exports.test.js.map +1 -1
- package/dist/__tests__/hardBreaks.test.js +1 -1
- package/dist/__tests__/headingInlineMarks.test.js +1 -1
- package/dist/__tests__/labelGlyphPaint.test.d.ts +2 -0
- package/dist/__tests__/labelGlyphPaint.test.d.ts.map +1 -0
- package/dist/__tests__/labelGlyphPaint.test.js +86 -0
- package/dist/__tests__/labelGlyphPaint.test.js.map +1 -0
- package/dist/__tests__/mathSizeMigration.test.js +2 -2
- package/dist/__tests__/migrate/labelsOnPictures.test.js +1 -1
- package/dist/__tests__/migrate/labelsOnPictures.test.js.map +1 -1
- package/dist/__tests__/parse/containers.test.js +1 -1
- package/dist/__tests__/parse/containers.test.js.map +1 -1
- package/dist/__tests__/pipeline/calloutInlineResourceGap.test.js +1 -1
- package/dist/__tests__/pipeline/calloutLabelGlyph.test.d.ts +2 -0
- package/dist/__tests__/pipeline/calloutLabelGlyph.test.d.ts.map +1 -0
- package/dist/__tests__/pipeline/calloutLabelGlyph.test.js +198 -0
- package/dist/__tests__/pipeline/calloutLabelGlyph.test.js.map +1 -0
- package/dist/__tests__/pipeline/calloutShapes.test.d.ts +2 -0
- package/dist/__tests__/pipeline/calloutShapes.test.d.ts.map +1 -0
- package/dist/__tests__/pipeline/calloutShapes.test.js +159 -0
- package/dist/__tests__/pipeline/calloutShapes.test.js.map +1 -0
- package/dist/__tests__/pipeline/calloutSplitMinLinesChild.test.js +1 -1
- package/dist/__tests__/pipeline/colonListRoom.test.js +1 -1
- package/dist/__tests__/pipeline/compoundBreaks.test.js +1 -1
- package/dist/__tests__/pipeline/dashBreaks.test.js +1 -1
- package/dist/__tests__/pipeline/headingSplitOrphans.test.js +1 -1
- package/dist/__tests__/pipeline/inlineFigureSpace.test.js +1 -1
- package/dist/__tests__/pipeline/paragraphContainerTail.test.js +1 -1
- package/dist/__tests__/pipeline/raggedOptimal.test.js +1 -1
- package/dist/__tests__/verseLines.test.js +1 -1
- package/dist/bundle/configVersion.d.ts +12 -3
- package/dist/bundle/configVersion.d.ts.map +1 -1
- package/dist/bundle/configVersion.js +16 -5
- package/dist/bundle/configVersion.js.map +1 -1
- package/dist/canvas-backend/blockRender.js +3 -3
- package/dist/canvas-backend/blockRender.js.map +1 -1
- package/dist/canvas-backend/composed.d.ts +4 -2
- package/dist/canvas-backend/composed.d.ts.map +1 -1
- package/dist/canvas-backend/composed.js +12 -7
- package/dist/canvas-backend/composed.js.map +1 -1
- package/dist/canvas-backend/headerFooter.d.ts +17 -1
- package/dist/canvas-backend/headerFooter.d.ts.map +1 -1
- package/dist/canvas-backend/headerFooter.js +64 -1
- package/dist/canvas-backend/headerFooter.js.map +1 -1
- package/dist/canvas-backend/index.d.ts.map +1 -1
- package/dist/canvas-backend/index.js +7 -1
- 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 +17 -6
- package/dist/canvas-backend/renderResourceBlock.js.map +1 -1
- package/dist/canvas-backend/swatch.d.ts +20 -1
- package/dist/canvas-backend/swatch.d.ts.map +1 -1
- package/dist/canvas-backend/swatch.js +51 -1
- package/dist/canvas-backend/swatch.js.map +1 -1
- package/dist/comics/layoutPage.d.ts.map +1 -1
- package/dist/comics/layoutPage.js +6 -1
- package/dist/comics/layoutPage.js.map +1 -1
- package/dist/composed/continuation.d.ts +10 -2
- package/dist/composed/continuation.d.ts.map +1 -1
- package/dist/composed/continuation.js +10 -2
- package/dist/composed/continuation.js.map +1 -1
- package/dist/composed/document.d.ts +45 -1
- package/dist/composed/document.d.ts.map +1 -1
- package/dist/composed/document.js +76 -17
- package/dist/composed/document.js.map +1 -1
- package/dist/composed/labelText.d.ts +6 -2
- package/dist/composed/labelText.d.ts.map +1 -1
- package/dist/composed/labelText.js +19 -3
- package/dist/composed/labelText.js.map +1 -1
- package/dist/composed/labels.d.ts +57 -3
- package/dist/composed/labels.d.ts.map +1 -1
- package/dist/composed/labels.js +261 -12
- package/dist/composed/labels.js.map +1 -1
- package/dist/composed/modules.d.ts +30 -0
- package/dist/composed/modules.d.ts.map +1 -0
- package/dist/composed/modules.js +194 -0
- package/dist/composed/modules.js.map +1 -0
- package/dist/composed/overlap.d.ts +52 -0
- package/dist/composed/overlap.d.ts.map +1 -0
- package/dist/composed/overlap.js +611 -0
- package/dist/composed/overlap.js.map +1 -0
- package/dist/composed/paint.d.ts +28 -5
- package/dist/composed/paint.d.ts.map +1 -1
- package/dist/composed/paint.js +26 -5
- package/dist/composed/paint.js.map +1 -1
- package/dist/composed/reflowLog.d.ts +6 -1
- package/dist/composed/reflowLog.d.ts.map +1 -1
- package/dist/composed/reflowLog.js +43 -0
- package/dist/composed/reflowLog.js.map +1 -1
- package/dist/composed/repeat.d.ts +66 -0
- package/dist/composed/repeat.d.ts.map +1 -0
- package/dist/composed/repeat.js +217 -0
- package/dist/composed/repeat.js.map +1 -0
- package/dist/composed/slotChecks.d.ts +1 -1
- package/dist/composed/slotChecks.d.ts.map +1 -1
- package/dist/composed/slotChecks.js +114 -8
- package/dist/composed/slotChecks.js.map +1 -1
- package/dist/composed/sourceMap.d.ts.map +1 -1
- package/dist/composed/sourceMap.js +16 -4
- package/dist/composed/sourceMap.js.map +1 -1
- package/dist/composed/spread.d.ts.map +1 -1
- package/dist/composed/spread.js +6 -2
- package/dist/composed/spread.js.map +1 -1
- package/dist/composed/templates.d.ts +22 -2
- package/dist/composed/templates.d.ts.map +1 -1
- package/dist/composed/templates.js +159 -9
- package/dist/composed/templates.js.map +1 -1
- package/dist/composed/types.d.ts +140 -7
- package/dist/composed/types.d.ts.map +1 -1
- package/dist/composed/validate.d.ts +1 -1
- package/dist/composed/validate.d.ts.map +1 -1
- package/dist/composed/validate.js +101 -4
- package/dist/composed/validate.js.map +1 -1
- package/dist/composed/wrap.d.ts.map +1 -1
- package/dist/composed/wrap.js +95 -17
- package/dist/composed/wrap.js.map +1 -1
- package/dist/configWarnings.d.ts +7 -1
- package/dist/configWarnings.d.ts.map +1 -1
- package/dist/configWarnings.js +275 -4
- package/dist/configWarnings.js.map +1 -1
- package/dist/contrast.d.ts.map +1 -1
- package/dist/contrast.js +8 -0
- package/dist/contrast.js.map +1 -1
- package/dist/defaults/calloutStyles.d.ts +10 -1
- package/dist/defaults/calloutStyles.d.ts.map +1 -1
- package/dist/defaults/calloutStyles.js +46 -7
- package/dist/defaults/calloutStyles.js.map +1 -1
- package/dist/defaults/headerFooter.d.ts.map +1 -1
- package/dist/defaults/headerFooter.js +38 -0
- package/dist/defaults/headerFooter.js.map +1 -1
- package/dist/design/boxShape.d.ts +101 -0
- package/dist/design/boxShape.d.ts.map +1 -0
- package/dist/design/boxShape.js +398 -0
- package/dist/design/boxShape.js.map +1 -0
- package/dist/design/connector.d.ts +75 -0
- package/dist/design/connector.d.ts.map +1 -0
- package/dist/design/connector.js +325 -0
- package/dist/design/connector.js.map +1 -0
- package/dist/design/layout.d.ts +56 -3
- package/dist/design/layout.d.ts.map +1 -1
- package/dist/design/layout.js +214 -12
- package/dist/design/layout.js.map +1 -1
- package/dist/design/logicalEdges.d.ts +7 -0
- package/dist/design/logicalEdges.d.ts.map +1 -1
- package/dist/design/logicalEdges.js +28 -0
- package/dist/design/logicalEdges.js.map +1 -1
- package/dist/design/pathBlock.d.ts +69 -0
- package/dist/design/pathBlock.d.ts.map +1 -0
- package/dist/design/pathBlock.js +286 -0
- package/dist/design/pathBlock.js.map +1 -0
- package/dist/design/svgPath.d.ts +48 -0
- package/dist/design/svgPath.d.ts.map +1 -0
- package/dist/design/svgPath.js +402 -0
- package/dist/design/svgPath.js.map +1 -0
- package/dist/fonts/usage.d.ts +5 -0
- package/dist/fonts/usage.d.ts.map +1 -1
- package/dist/fonts/usage.js +36 -3
- package/dist/fonts/usage.js.map +1 -1
- package/dist/html-backend.d.ts.map +1 -1
- package/dist/html-backend.js +127 -22
- package/dist/html-backend.js.map +1 -1
- package/dist/index.d.ts +19 -9
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +13 -5
- package/dist/index.js.map +1 -1
- package/dist/measure/cache.js +1 -1
- package/dist/measure/cache.js.map +1 -1
- package/dist/measure/inlineIcon.d.ts +34 -0
- package/dist/measure/inlineIcon.d.ts.map +1 -0
- package/dist/measure/inlineIcon.js +89 -0
- package/dist/measure/inlineIcon.js.map +1 -0
- package/dist/measure/rich.d.ts +2 -1
- package/dist/measure/rich.d.ts.map +1 -1
- package/dist/measure/rich.js +6 -0
- package/dist/measure/rich.js.map +1 -1
- package/dist/migrate/pageDesign.d.ts.map +1 -1
- package/dist/migrate/pageDesign.js +4 -2
- package/dist/migrate/pageDesign.js.map +1 -1
- package/dist/migrate/textToMarkdown.js +2 -0
- package/dist/migrate/textToMarkdown.js.map +1 -1
- package/dist/parse/blockParser.d.ts.map +1 -1
- package/dist/parse/blockParser.js +171 -20
- 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/inlineFormatting.d.ts +11 -3
- package/dist/parse/inlineFormatting.d.ts.map +1 -1
- package/dist/parse/inlineFormatting.js +63 -5
- package/dist/parse/inlineFormatting.js.map +1 -1
- package/dist/parse/inlineSnippet.d.ts +2 -1
- package/dist/parse/inlineSnippet.d.ts.map +1 -1
- package/dist/parse/inlineSnippet.js +3 -2
- package/dist/parse/inlineSnippet.js.map +1 -1
- package/dist/parse/sourceMapping.d.ts.map +1 -1
- package/dist/parse/sourceMapping.js +8 -1
- package/dist/parse/sourceMapping.js.map +1 -1
- package/dist/parse/types.d.ts +71 -1
- package/dist/parse/types.d.ts.map +1 -1
- package/dist/pipeline/build.d.ts.map +1 -1
- package/dist/pipeline/build.js +23 -11
- package/dist/pipeline/build.js.map +1 -1
- package/dist/pipeline/buildMeasurement.d.ts.map +1 -1
- package/dist/pipeline/buildMeasurement.js +23 -11
- package/dist/pipeline/buildMeasurement.js.map +1 -1
- package/dist/pipeline/calloutLayout.d.ts.map +1 -1
- package/dist/pipeline/calloutLayout.js +142 -32
- package/dist/pipeline/calloutLayout.js.map +1 -1
- package/dist/pipeline/composedLayout.d.ts +1 -33
- package/dist/pipeline/composedLayout.d.ts.map +1 -1
- package/dist/pipeline/composedLayout.js +526 -36
- package/dist/pipeline/composedLayout.js.map +1 -1
- package/dist/pipeline/contentWarnings.d.ts.map +1 -1
- package/dist/pipeline/contentWarnings.js +46 -1
- package/dist/pipeline/contentWarnings.js.map +1 -1
- package/dist/pipeline/continuation.d.ts.map +1 -1
- package/dist/pipeline/continuation.js +3 -2
- package/dist/pipeline/continuation.js.map +1 -1
- package/dist/pipeline/headerFooter.d.ts +19 -1
- package/dist/pipeline/headerFooter.d.ts.map +1 -1
- package/dist/pipeline/headerFooter.js +145 -5
- package/dist/pipeline/headerFooter.js.map +1 -1
- package/dist/pipeline/partPalette.d.ts.map +1 -1
- package/dist/pipeline/partPalette.js +40 -1
- package/dist/pipeline/partPalette.js.map +1 -1
- package/dist/pipeline/resourceLayout.d.ts +1 -1
- package/dist/pipeline/resourceLayout.d.ts.map +1 -1
- package/dist/pipeline/resourceLayout.js +44 -15
- package/dist/pipeline/resourceLayout.js.map +1 -1
- package/dist/preflight.d.ts.map +1 -1
- package/dist/preflight.js +36 -1
- package/dist/preflight.js.map +1 -1
- package/dist/types.d.ts +305 -22
- package/dist/types.d.ts.map +1 -1
- package/dist/vdt.d.ts +384 -11
- package/dist/vdt.d.ts.map +1 -1
- package/dist/vdt.js.map +1 -1
- package/package.json +1 -1
- package/dist/composed/round2Types.d.ts +0 -185
- package/dist/composed/round2Types.d.ts.map +0 -1
- package/dist/composed/round2Types.js +0 -2
- package/dist/composed/round2Types.js.map +0 -1
package/dist/html-backend.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { footnoteRuleSegments } from './columnRule';
|
|
2
|
+
import { markerSvgData, pathSvgData } from './design/pathBlock';
|
|
2
3
|
import { leaderRuleGeometry, lineTextAlign, tableCellFillRects, tableFrameOutline } from './vdt';
|
|
3
4
|
import { dimensionToPx } from './units';
|
|
4
5
|
import { documentInkHex, isSingleInkSvgUrl, singleInkColorMatrix } from './svg/singleInk';
|
|
@@ -22,12 +23,13 @@ import { fontFamilyOf } from './measure/vertical';
|
|
|
22
23
|
import { lineHighlightsHtml, lineMarksHtml, rubyHtml, verticalLineMarksHtml, warichuHtml, sideMarkerHtml, RT_OPEN, RUBY_OPEN, rubyGroupOf, kuntenHtml, verticalKuntenTateHtml } from './htmlAnnotations';
|
|
23
24
|
import { playMarkTriangle, qrModuleRuns } from './pipeline/videoOverlay';
|
|
24
25
|
import { isHlsMimeType, mediaFragment, videoElementAttributes, videoEmbedAllow } from './video/url';
|
|
26
|
+
import { iconLineDash, inlineIconBox } from './measure/inlineIcon';
|
|
25
27
|
import { textDots } from './textDots';
|
|
26
28
|
import { renderComicHtml } from './htmlComic';
|
|
27
29
|
import { comicBlockOnSheet, pageComics } from './comics/transform';
|
|
28
30
|
import { altWithLabels } from './composed/labelText';
|
|
29
|
-
import { figureLabelMatrix, undrawnLabels, unmirrorLabelLayout } from './composed/labels';
|
|
30
|
-
import { comicFramePaintOrder, composedFrameBlockIds, composedPaintOrder, composedReadingOrder, composedSheetClip, composedSheetClipOnSheet, frameClips, frameContentRect, frameMatrix } from './composed/paint';
|
|
31
|
+
import { figureLabelLeaderPaths, figureLabelMatrix, undrawnLabels, unmirrorLabelLayout } from './composed/labels';
|
|
32
|
+
import { comicFramePaintOrder, composedFrameBlockIds, composedPaintOrder, composedReadingOrder, composedSheetClip, composedSheetClipOnSheet, decorationOver, decorationUnder, frameClips, frameContentRect, frameMatrix } from './composed/paint';
|
|
31
33
|
import { taskBoxSvgBody, taskBoxText } from './taskBox';
|
|
32
34
|
/**
|
|
33
35
|
* Declarations of every box of CJK text measured with no punctuation
|
|
@@ -1347,7 +1349,7 @@ end = '') {
|
|
|
1347
1349
|
continue;
|
|
1348
1350
|
}
|
|
1349
1351
|
if (seg.kind === 'swatch') {
|
|
1350
|
-
parts.push(
|
|
1352
|
+
parts.push(renderSwatchSegment(seg.swatch, x, line.baseline - line.bbox.y, seg.width, block.color));
|
|
1351
1353
|
x += seg.width;
|
|
1352
1354
|
continue;
|
|
1353
1355
|
}
|
|
@@ -1496,7 +1498,7 @@ function renderComposedSegments(line, block, targets, rootDir = 'ltr', end = '')
|
|
|
1496
1498
|
continue;
|
|
1497
1499
|
}
|
|
1498
1500
|
if (seg.kind === 'swatch') {
|
|
1499
|
-
parts.push(
|
|
1501
|
+
parts.push(renderSwatchSegment(seg.swatch, x, line.baseline - line.bbox.y, seg.width, block.color));
|
|
1500
1502
|
x += seg.width;
|
|
1501
1503
|
continue;
|
|
1502
1504
|
}
|
|
@@ -1592,6 +1594,44 @@ function renderSwatch(x, baselineOffset, side, fill, ink) {
|
|
|
1592
1594
|
`width:${side.toFixed(3)}px;height:${side.toFixed(3)}px;box-sizing:border-box;` +
|
|
1593
1595
|
`border:${stroke.toFixed(2)}px solid ${ink};${fill ? `background:${fill};` : ''}"></span>`);
|
|
1594
1596
|
}
|
|
1597
|
+
/** A `'swatch'` segment: its inline symbol when it carries one (#1058),
|
|
1598
|
+
* else the colour swatch. */
|
|
1599
|
+
function renderSwatchSegment(swatch, x, baselineOffset, width, ink, paint) {
|
|
1600
|
+
return swatch?.icon ? renderInlineIconHtml(swatch.icon, x, baselineOffset, ink, paint) : renderSwatch(x, baselineOffset, width, swatch?.color, ink);
|
|
1601
|
+
}
|
|
1602
|
+
/**
|
|
1603
|
+
* An inline symbol (`:icon[alt]{…}`, #1058) on its line, its box standing
|
|
1604
|
+
* on the baseline (`baselineOffset` from the line top): a picture as an
|
|
1605
|
+
* `<img>` (a tinted one as the colour through the picture's mask), a glyph
|
|
1606
|
+
* and a line sample as a small SVG, so the glyph's baseline and the
|
|
1607
|
+
* stroke's dashes land where the canvas paints them. Named by its
|
|
1608
|
+
* alternative text (`role="img"`), hidden when it has none.
|
|
1609
|
+
*/
|
|
1610
|
+
function renderInlineIconHtml(icon, x, baselineOffset, ink, paint) {
|
|
1611
|
+
const box = inlineIconBox(icon, x, baselineOffset);
|
|
1612
|
+
const n = (v) => String(+v.toFixed(3));
|
|
1613
|
+
const name = icon.alt ? `role="img" aria-label="${esc(icon.alt)}"` : 'aria-hidden="true"';
|
|
1614
|
+
const pos = `position:absolute;left:${n(box.x)}px;top:${n(box.y)}px;width:${n(box.width)}px;height:${n(box.height)}px;`;
|
|
1615
|
+
const color = icon.color ?? ink;
|
|
1616
|
+
if (icon.kind === 'glyph' && icon.glyph && icon.fontString) {
|
|
1617
|
+
return `<svg ${name} style="${pos}overflow:visible;" width="${n(box.width)}" height="${n(box.height)}"><text x="0" y="${n(box.height)}" fill="${esc(color)}" style="font:${esc(quoteFontString(icon.fontString))};">${esc(icon.glyph)}</text></svg>`;
|
|
1618
|
+
}
|
|
1619
|
+
if (icon.kind === 'line') {
|
|
1620
|
+
const dash = iconLineDash(icon);
|
|
1621
|
+
const y = n(box.height / 2);
|
|
1622
|
+
return `<svg ${name} style="${pos}overflow:visible;" width="${n(box.width)}" height="${n(box.height)}"><line x1="0" y1="${y}" x2="${n(box.width)}" y2="${y}" stroke="${esc(color)}" stroke-width="${n(icon.strokePx ?? 1)}"${dash ? ` stroke-dasharray="${dash.map(n).join(' ')}"` : ''}${icon.line === 'dotted' ? ' stroke-linecap="round"' : ''}/></svg>`;
|
|
1623
|
+
}
|
|
1624
|
+
const url = icon.fileId ? imageUrl(paint, icon.fileId, icon.resourceId) : undefined;
|
|
1625
|
+
if (!url) {
|
|
1626
|
+
const stroke = Math.max(0.5, box.height * 0.06);
|
|
1627
|
+
return `<span ${name} style="${pos}box-sizing:border-box;border:${stroke.toFixed(2)}px solid ${ink};"></span>`;
|
|
1628
|
+
}
|
|
1629
|
+
if (icon.color) {
|
|
1630
|
+
const mask = `url("${esc(url)}") center / 100% 100% no-repeat`;
|
|
1631
|
+
return `<span ${name} style="${pos}background:${esc(icon.color)};-webkit-mask:${mask};mask:${mask};"></span>`;
|
|
1632
|
+
}
|
|
1633
|
+
return `<img src="${esc(url)}" alt="${esc(icon.alt)}"${icon.alt ? '' : ' aria-hidden="true"'} style="${pos}"/>`;
|
|
1634
|
+
}
|
|
1595
1635
|
/** Inline chip (`:chip[…]`): the box — fill, outline, radius — as one
|
|
1596
1636
|
* decorative span (`x` is the segment's left edge; the box starts after its
|
|
1597
1637
|
* gap margin), then the text runs as ordinary text spans on the line's
|
|
@@ -2025,7 +2065,7 @@ function renderVerticalLine(line, block, v, targets, next) {
|
|
|
2025
2065
|
continue;
|
|
2026
2066
|
}
|
|
2027
2067
|
if (seg.kind === 'swatch') {
|
|
2028
|
-
sideways.push(
|
|
2068
|
+
sideways.push(renderSwatchSegment(seg.swatch, x, line.baseline - line.bbox.y, seg.width, block.color));
|
|
2029
2069
|
x += seg.width;
|
|
2030
2070
|
continue;
|
|
2031
2071
|
}
|
|
@@ -2204,7 +2244,9 @@ rootDir = 'ltr',
|
|
|
2204
2244
|
/** The language the document's root declares. */
|
|
2205
2245
|
rootLang,
|
|
2206
2246
|
/** What a copy puts after the line (see {@link lineEndText}). */
|
|
2207
|
-
end = ''
|
|
2247
|
+
end = '',
|
|
2248
|
+
/** The render's options: the pictures of inline symbols (#1058). */
|
|
2249
|
+
paint) {
|
|
2208
2250
|
const baseFont = quoteFontString(fonts.normal);
|
|
2209
2251
|
const parts = [];
|
|
2210
2252
|
const lineDecl = lineCjkDecl(line);
|
|
@@ -2257,7 +2299,7 @@ end = '') {
|
|
|
2257
2299
|
continue;
|
|
2258
2300
|
}
|
|
2259
2301
|
if (seg.kind === 'swatch') {
|
|
2260
|
-
parts.push(
|
|
2302
|
+
parts.push(renderSwatchSegment(seg.swatch, x, line.baseline - line.bbox.y, seg.width, color, paint));
|
|
2261
2303
|
x += seg.width;
|
|
2262
2304
|
continue;
|
|
2263
2305
|
}
|
|
@@ -2528,7 +2570,7 @@ function renderResourceTable(rb, bx, by, options) {
|
|
|
2528
2570
|
const fonts = cell.isHeader ? headerFonts : bodyFonts;
|
|
2529
2571
|
const color = cell.isHeader ? t.headerColor : t.color;
|
|
2530
2572
|
cell.lines.forEach((line, i) => {
|
|
2531
|
-
parts.push(renderResourceLine(line, fonts, color, rb.linkColor, color, options.linkTargets, options.dir, options.rootLang, lineEndText(line, cell.lines[i + 1])));
|
|
2573
|
+
parts.push(renderResourceLine(line, fonts, color, rb.linkColor, color, options.linkTargets, options.dir, options.rootLang, lineEndText(line, cell.lines[i + 1]), options));
|
|
2532
2574
|
});
|
|
2533
2575
|
}
|
|
2534
2576
|
return parts.join('');
|
|
@@ -2542,7 +2584,9 @@ function renderResourceTable(rb, bx, by, options) {
|
|
|
2542
2584
|
*/
|
|
2543
2585
|
function renderFigureLabelsHtml(rb, bx, by, options) {
|
|
2544
2586
|
const n2 = (v) => String(+v.toFixed(4));
|
|
2545
|
-
|
|
2587
|
+
// Their leaders first (#1057), under every label: vector lines hidden
|
|
2588
|
+
// from assistive technology, as design paths are.
|
|
2589
|
+
const parts = figureLabelLeaderPaths(rb, bx, by).map(renderDesignPathBlock);
|
|
2546
2590
|
for (const label of rb.labels ?? []) {
|
|
2547
2591
|
let layout = label.layout;
|
|
2548
2592
|
if (!layout)
|
|
@@ -2560,8 +2604,13 @@ function renderFigureLabelsHtml(rb, bx, by, options) {
|
|
|
2560
2604
|
: '';
|
|
2561
2605
|
const inner = [];
|
|
2562
2606
|
if (layout.background) {
|
|
2563
|
-
const
|
|
2564
|
-
|
|
2607
|
+
const plate = layout.background;
|
|
2608
|
+
const r = plate.rect;
|
|
2609
|
+
// A plate's outline and corners (#1058), the outline inside the box.
|
|
2610
|
+
const look = (plate.color ? `background:${plate.color};` : '')
|
|
2611
|
+
+ (plate.border ? `box-sizing:border-box;border:${n2(plate.border.widthPx)}px solid ${plate.border.color};` : '')
|
|
2612
|
+
+ (plate.radiusPx ? `border-radius:${n2(plate.radiusPx)}px;` : '');
|
|
2613
|
+
inner.push(`<div aria-hidden="true" style="position:absolute;left:${n2(r.x)}px;top:${n2(r.y)}px;width:${n2(r.width)}px;height:${n2(r.height)}px;${look}"></div>`);
|
|
2565
2614
|
}
|
|
2566
2615
|
if (layout.vertical) {
|
|
2567
2616
|
// A vertical label (#902): its frame is turned a quarter turn by the
|
|
@@ -2577,7 +2626,7 @@ function renderFigureLabelsHtml(rb, bx, by, options) {
|
|
|
2577
2626
|
}
|
|
2578
2627
|
else {
|
|
2579
2628
|
layout.lines.forEach((line, i) => {
|
|
2580
|
-
inner.push(renderResourceLine(line, fonts, layout.color, rb.linkColor, layout.color, options.linkTargets, options.dir, options.rootLang, lineEndText(line, layout.lines[i + 1]) || (i + 1 < layout.lines.length ? ' ' : '')));
|
|
2629
|
+
inner.push(renderResourceLine(line, fonts, layout.color, rb.linkColor, layout.color, options.linkTargets, options.dir, options.rootLang, lineEndText(line, layout.lines[i + 1]) || (i + 1 < layout.lines.length ? ' ' : ''), options));
|
|
2581
2630
|
});
|
|
2582
2631
|
}
|
|
2583
2632
|
const dir = layout.direction === 'rtl' ? ' dir="rtl"' : '';
|
|
@@ -2646,7 +2695,7 @@ function renderResourceBlockHtml(block, paint) {
|
|
|
2646
2695
|
boldItalic: rb.captionBoldItalicFontString,
|
|
2647
2696
|
};
|
|
2648
2697
|
rb.captionLines.forEach((line, i) => {
|
|
2649
|
-
parts.push(renderResourceLine(line, captionFonts, rb.captionColor, rb.linkColor, rb.captionLabelColor, options.linkTargets, options.dir, options.rootLang, lineEndText(line, rb.captionLines[i + 1])));
|
|
2698
|
+
parts.push(renderResourceLine(line, captionFonts, rb.captionColor, rb.linkColor, rb.captionLabelColor, options.linkTargets, options.dir, options.rootLang, lineEndText(line, rb.captionLines[i + 1]), options));
|
|
2650
2699
|
});
|
|
2651
2700
|
const noteFonts = {
|
|
2652
2701
|
normal: rb.noteFontString,
|
|
@@ -2656,7 +2705,7 @@ function renderResourceBlockHtml(block, paint) {
|
|
|
2656
2705
|
};
|
|
2657
2706
|
const noteLines = [...rb.noteLines, ...(rb.continuesLines ?? [])];
|
|
2658
2707
|
noteLines.forEach((line, i) => {
|
|
2659
|
-
parts.push(renderResourceLine(line, noteFonts, rb.noteColor, rb.linkColor, rb.noteColor, options.linkTargets, options.dir, options.rootLang, lineEndText(line, noteLines[i + 1])));
|
|
2708
|
+
parts.push(renderResourceLine(line, noteFonts, rb.noteColor, rb.linkColor, rb.noteColor, options.linkTargets, options.dir, options.rootLang, lineEndText(line, noteLines[i + 1]), options));
|
|
2660
2709
|
});
|
|
2661
2710
|
if (!rot)
|
|
2662
2711
|
return anchor + parts.join('');
|
|
@@ -2677,12 +2726,27 @@ function boxStyleDecls(style) {
|
|
|
2677
2726
|
? `border:${style.borderWidthPx}px solid ${style.borderColor};box-sizing:border-box;`
|
|
2678
2727
|
: '';
|
|
2679
2728
|
const radius = style.borderRadiusPx > 0 ? `border-radius:${style.borderRadiusPx}px;` : '';
|
|
2680
|
-
|
|
2729
|
+
if (!style.borderRadiiPx && !style.borderSides)
|
|
2730
|
+
return `${bg}${border}${radius}`;
|
|
2731
|
+
// Corners of their own and a border per side (#1059), as CSS draws them.
|
|
2732
|
+
const radii = style.borderRadiiPx
|
|
2733
|
+
? `border-radius:${style.borderRadiiPx.map((r) => `${Math.max(0, r)}px`).join(' ')};`
|
|
2734
|
+
: radius;
|
|
2735
|
+
const sides = style.borderSides;
|
|
2736
|
+
if (!sides)
|
|
2737
|
+
return `${bg}${border}${radii}`;
|
|
2738
|
+
const each = ['top', 'right', 'bottom', 'left']
|
|
2739
|
+
.map((side) => {
|
|
2740
|
+
const b = sides[side];
|
|
2741
|
+
return b && b.widthPx > 0 ? `border-${side}:${b.widthPx}px solid ${b.color};` : '';
|
|
2742
|
+
})
|
|
2743
|
+
.join('');
|
|
2744
|
+
return `${bg}${each ? `${each}box-sizing:border-box;` : ''}${radii}`;
|
|
2681
2745
|
}
|
|
2682
2746
|
function renderBoxAt(bbox, style) {
|
|
2683
2747
|
if (bbox.width <= 0 || bbox.height <= 0)
|
|
2684
2748
|
return '';
|
|
2685
|
-
if (!style.backgroundColor && !style.borderColor)
|
|
2749
|
+
if (!style.backgroundColor && !style.borderColor && !style.borderSides)
|
|
2686
2750
|
return '';
|
|
2687
2751
|
return (`<div aria-hidden="true" style="` +
|
|
2688
2752
|
`position:absolute;` +
|
|
@@ -2874,6 +2938,38 @@ function renderDesignRuleBlock(block) {
|
|
|
2874
2938
|
`background:${block.color};` +
|
|
2875
2939
|
`"></div>`);
|
|
2876
2940
|
}
|
|
2941
|
+
/** A vector shape (DESIGN §12.1, #1055): an inline `<svg>` placed on its
|
|
2942
|
+
* box like a rule, its outline and markers drawn in the box's own
|
|
2943
|
+
* coordinates (ink past the box, a mitre, still shows). Decoration:
|
|
2944
|
+
* hidden from assistive technology. */
|
|
2945
|
+
function renderDesignPathBlock(block) {
|
|
2946
|
+
const { x, y, width, height } = block.bbox;
|
|
2947
|
+
const parts = [];
|
|
2948
|
+
const stroke = block.stroke && block.stroke.widthPx > 0 ? block.stroke : undefined;
|
|
2949
|
+
if ((block.fill || stroke) && block.subpaths.length > 0) {
|
|
2950
|
+
const attrs = [`d="${pathSvgData(block.subpaths, x, y)}"`, `fill="${block.fill ? esc(block.fill) : 'none'}"`];
|
|
2951
|
+
if (block.fill && block.fillRule === 'evenodd')
|
|
2952
|
+
attrs.push('fill-rule="evenodd"');
|
|
2953
|
+
if (stroke) {
|
|
2954
|
+
attrs.push(`stroke="${esc(stroke.color)}"`, `stroke-width="${stroke.widthPx}"`);
|
|
2955
|
+
if (stroke.dash && stroke.dash.length > 0)
|
|
2956
|
+
attrs.push(`stroke-dasharray="${stroke.dash.join(' ')}"`);
|
|
2957
|
+
if (stroke.cap && stroke.cap !== 'butt')
|
|
2958
|
+
attrs.push(`stroke-linecap="${stroke.cap}"`);
|
|
2959
|
+
if (stroke.join && stroke.join !== 'miter')
|
|
2960
|
+
attrs.push(`stroke-linejoin="${stroke.join}"`);
|
|
2961
|
+
}
|
|
2962
|
+
parts.push(`<path ${attrs.join(' ')}/>`);
|
|
2963
|
+
}
|
|
2964
|
+
for (const m of block.markers ?? [])
|
|
2965
|
+
parts.push(`<path d="${markerSvgData(m, x, y)}" fill="${esc(m.color)}"/>`);
|
|
2966
|
+
if (parts.length === 0)
|
|
2967
|
+
return '';
|
|
2968
|
+
return (`<svg aria-hidden="true" focusable="false" width="${width}" height="${height}" ` +
|
|
2969
|
+
`style="position:absolute;left:${x}px;top:${y}px;width:${width}px;height:${height}px;overflow:visible;">` +
|
|
2970
|
+
parts.join('') +
|
|
2971
|
+
`</svg>`);
|
|
2972
|
+
}
|
|
2877
2973
|
function renderDesignBoxBlock(block) {
|
|
2878
2974
|
const html = renderBoxAt(block.bbox, block.box);
|
|
2879
2975
|
// A callout stripe on a rounded frame: clipped to the frame's outline.
|
|
@@ -2935,6 +3031,8 @@ function renderDesignBlock(block, options) {
|
|
|
2935
3031
|
return renderDesignRuleBlock(block);
|
|
2936
3032
|
if (block.kind === 'image')
|
|
2937
3033
|
return renderDesignImageBlock(block, options);
|
|
3034
|
+
if (block.kind === 'path')
|
|
3035
|
+
return renderDesignPathBlock(block);
|
|
2938
3036
|
return renderDesignBoxBlock(block);
|
|
2939
3037
|
}
|
|
2940
3038
|
function renderDesignSlot(slot, options) {
|
|
@@ -3131,7 +3229,13 @@ verticalRegion, verticalDigits) {
|
|
|
3131
3229
|
const [l, t, r, b] = [sheetOnSheet.x, sheetOnSheet.y, sheetOnSheet.x + sheetOnSheet.width, sheetOnSheet.y + sheetOnSheet.height].map(frameNum);
|
|
3132
3230
|
return `<div class="pt-sheet-clip" style="position:absolute;left:0;top:0;width:0;height:0;overflow:visible;clip-path:polygon(${l}px ${t}px,${r}px ${t}px,${r}px ${b}px,${l}px ${b}px);">${html}</div>`;
|
|
3133
3231
|
};
|
|
3134
|
-
const
|
|
3232
|
+
const decorationOptions = composedFlow ? { ...options, vertical: undefined } : options;
|
|
3233
|
+
const underSlot = decorationUnder(page.composed?.decoration);
|
|
3234
|
+
const composedDecorationHtml = underSlot ? decorationClipped(renderDesignSlot(underSlot, decorationOptions)) : '';
|
|
3235
|
+
// Connectors painted over every frame (#1076): their own box, last in
|
|
3236
|
+
// the paint order; through a flow frame, on the sheet after the rest.
|
|
3237
|
+
const overSlot = decorationOver(page.composed?.decoration);
|
|
3238
|
+
const composedOverHtml = overSlot ? decorationClipped(renderDesignSlot(overSlot, decorationOptions)) : '';
|
|
3135
3239
|
const composedParts = [];
|
|
3136
3240
|
/** The frames' boxes and the decoration: what a patcher of blocks must
|
|
3137
3241
|
* also compare (`decorationHtml`). */
|
|
@@ -3140,9 +3244,10 @@ verticalRegion, verticalDigits) {
|
|
|
3140
3244
|
const paint = composedPaintOrder(page);
|
|
3141
3245
|
for (const item of composedReadingOrder(paint)) {
|
|
3142
3246
|
const z = paint.indexOf(item) + 1;
|
|
3143
|
-
if (item.kind === 'decoration') {
|
|
3144
|
-
|
|
3145
|
-
|
|
3247
|
+
if (item.kind === 'decoration' || item.kind === 'over') {
|
|
3248
|
+
const html = item.kind === 'over' ? composedOverHtml : composedDecorationHtml;
|
|
3249
|
+
if (!composedFlow && html)
|
|
3250
|
+
composedParts.push(`<div class="pt-frame-decoration${item.kind === 'over' ? ' pt-frame-decoration-over' : ''}" style="position:absolute;left:0;top:0;width:0;height:0;z-index:${z};">${html}</div>`);
|
|
3146
3251
|
continue;
|
|
3147
3252
|
}
|
|
3148
3253
|
if (item.blocks.length === 0)
|
|
@@ -3201,8 +3306,8 @@ verticalRegion, verticalDigits) {
|
|
|
3201
3306
|
// flow frame), under the running heads, as the canvas paints them.
|
|
3202
3307
|
const comicHtml = page.comic ? comicMarkup(page.comic) : '';
|
|
3203
3308
|
const sheetComicsHtml = comicHtml + (plainFlow ? '' : comics.filter((c) => c !== page.comic).map(comicMarkup).join(''));
|
|
3204
|
-
const sheetComposedHtml = composedFlow ? composedDecorationHtml : '';
|
|
3205
|
-
const decorationHtml = defsHtml + gridHtml + openerHtml + footnoteRulesHtml + sheetComicsHtml + composedShape.join('') + composedDecorationHtml + slotParts.join('');
|
|
3309
|
+
const sheetComposedHtml = composedFlow ? composedDecorationHtml + composedOverHtml : '';
|
|
3310
|
+
const decorationHtml = defsHtml + gridHtml + openerHtml + footnoteRulesHtml + sheetComicsHtml + composedShape.join('') + composedDecorationHtml + composedOverHtml + slotParts.join('');
|
|
3206
3311
|
// A vertical page's flow: one box turned a quarter turn clockwise, its
|
|
3207
3312
|
// text lines turned back and set vertically (see `renderVerticalLine`).
|
|
3208
3313
|
const anchorsHtml = (options.anchors ?? [])
|