@dloizides/poster-render 0.13.0 → 0.13.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.13.1
4
+
5
+ - D-SPACE-1 "Space above/below applies per item": a wrapped line keeps `spaceAbove` on its first part and `spaceBelow` on its last, so a wrapped includes item's own lines stay tight.
6
+
3
7
  ## 0.13.0
4
8
 
5
9
  - FLIER-2 "Bullets on/off and line spacing": `FlierDoc.bullets` (default true; false drops the includes bullet dot and its indent), `LineStyle.spaceAbove` / `spaceBelow` (em of the line size, 0-2) added above / below a line, and a footer holding line breaks sets one footer line per text line. Docs without the new fields render pixel-identical (45 snapshots unchanged).
package/dist/index.js CHANGED
@@ -930,7 +930,9 @@ function halves(text2) {
930
930
  }
931
931
  function wrapped(line, wrap) {
932
932
  const parts = wrap ? halves(line.text) : [line.text];
933
- return parts.length === 1 ? [line] : parts.map((text2, i) => i === 0 ? { ...line, text: text2, tail: void 0 } : { ...line, text: text2, tail: void 0, bullet: void 0, hang: line.bullet !== void 0 });
933
+ const last = parts.length - 1;
934
+ const edges = (i) => ({ spaceAbove: i === 0 ? line.spaceAbove : void 0, spaceBelow: i === last ? line.spaceBelow : void 0 });
935
+ return parts.length === 1 ? [line] : parts.map((text2, i) => i === 0 ? { ...line, ...edges(i), text: text2, tail: void 0 } : { ...line, ...edges(i), text: text2, tail: void 0, bullet: void 0, hang: line.bullet !== void 0 });
934
936
  }
935
937
  function scheduleLines(doc, l, row, i) {
936
938
  const r3 = doc.rows;