@presentation-md/export 1.28.0 → 1.28.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/dist/layouts.js CHANGED
@@ -789,7 +789,11 @@ function renderSection(slide, ctx, data) {
789
789
  body(slide, ctx, data.lead, { x, y, w, h: 1.0, fontSize: 18 });
790
790
  }
791
791
  }
792
- function renderHeaderBlock(slide, ctx, data) {
792
+ /**
793
+ * Eyebrow, heading and lead at the top of a content slide. Returns the y where
794
+ * the layout body starts. Pass `lead: false` when the layout places the lead itself.
795
+ */
796
+ function renderHeaderBlock(slide, ctx, data, opts = {}) {
793
797
  const x = ctx.margin;
794
798
  const w = ctx.width - ctx.margin * 2;
795
799
  let y = ctx.margin;
@@ -803,6 +807,10 @@ function renderHeaderBlock(slide, ctx, data) {
803
807
  heading(slide, ctx, data.heading, { x, y, w, h: 1.0, fontSize: 30 });
804
808
  y += 1.1;
805
809
  }
810
+ if (opts.lead !== false && typeof data.lead === "string" && data.lead.trim()) {
811
+ body(slide, ctx, data.lead, { x, y, w, h: 0.6, fontSize: 15 });
812
+ y += 0.65;
813
+ }
806
814
  return y;
807
815
  }
808
816
  function renderTwoColumn(slide, ctx, data) {
@@ -1819,7 +1827,7 @@ function renderCustomHtml(slide, ctx, data) {
1819
1827
  const defaultMuted = onHue ? "F0F0F0" : ctx.colors.muted;
1820
1828
  if (!blocks.length) {
1821
1829
  const note = "This slide used custom-html in the HTML deck. Re-create the art in PowerPoint or keep the HTML export for fidelity.";
1822
- slide.addText(data.body || data.lead || note, {
1830
+ slide.addText(data.body || note, {
1823
1831
  x: ctx.margin,
1824
1832
  y,
1825
1833
  w: contentW,
@@ -2059,7 +2067,7 @@ function renderStreakGrid(slide, ctx, data) {
2059
2067
  }
2060
2068
  }
2061
2069
  function renderMetricRing(slide, ctx, data) {
2062
- const top = renderHeaderBlock(slide, ctx, data);
2070
+ const top = renderHeaderBlock(slide, ctx, data, { lead: false });
2063
2071
  const pctRaw = typeof data.pct === "number" ? data.pct : 100;
2064
2072
  const pct = Math.max(0, Math.min(100, pctRaw));
2065
2073
  const value = typeof data.value === "string" ? data.value : `${Math.round(pct)}%`;