@presentation-md/export 1.23.32 → 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/layouts.js CHANGED
@@ -623,44 +623,90 @@ function renderHero(slide, ctx, data) {
623
623
  ? "solid"
624
624
  : "outline";
625
625
  const glyph = action.icon ? iconMarkerGlyph(action.icon) : "";
626
- const label = glyph ? `${glyph} ${action.label}` : action.label;
627
- const btnW = Math.min(3.8, Math.max(2.2, label.length * 0.13 + 1.2));
626
+ const hasIcon = Boolean(glyph);
627
+ const btnW = Math.min(3.9, Math.max(2.2, action.label.length * 0.13 + 1.2 + (hasIcon ? 0.45 : 0)));
628
628
  if (bx + btnW > x + w && i > 0) {
629
629
  bx = x;
630
630
  y += btnH + gap;
631
631
  }
632
632
  const isOutline = style === "outline" || style === "ghost";
633
- slide.addText(label, {
634
- shape: ctx.shapeRoundRect,
633
+ const by = y + 0.1;
634
+ const fillColor = isOutline
635
+ ? inverted
636
+ ? "C8FF00"
637
+ : ctx.colors.bg
638
+ : inverted
639
+ ? "0A0A0A"
640
+ : ctx.colors.accent;
641
+ const textColor = isOutline
642
+ ? inverted
643
+ ? "0A0A0A"
644
+ : ctx.colors.text
645
+ : inverted
646
+ ? "C8FF00"
647
+ : ctx.colors.bg;
648
+ // Native pill shell (editable shape) + optional icon well — beats text-only glyph prefix.
649
+ slide.addShape(ctx.shapeRoundRect, {
635
650
  x: bx,
636
- y: y + 0.1,
651
+ y: by,
637
652
  w: btnW,
638
653
  h: btnH,
639
- fill: {
640
- color: isOutline
641
- ? inverted
642
- ? "C8FF00"
643
- : ctx.colors.bg
644
- : inverted
645
- ? "0A0A0A"
646
- : ctx.colors.accent,
647
- },
648
- color: isOutline
654
+ fill: { color: fillColor },
655
+ line: isOutline
656
+ ? { color: inverted ? "0A0A0A" : ctx.colors.text, width: 1.5 }
657
+ : { color: fillColor, width: 0 },
658
+ rectRadius: 0.25,
659
+ });
660
+ if (hasIcon) {
661
+ const chip = 0.34;
662
+ const chipX = bx + 0.1;
663
+ const chipY = by + (btnH - chip) / 2;
664
+ const chipFill = isOutline
649
665
  ? inverted
650
666
  ? "0A0A0A"
651
- : ctx.colors.text
667
+ : ctx.colors.accent
652
668
  : inverted
653
669
  ? "C8FF00"
654
- : ctx.colors.bg,
670
+ : ctx.colors.bg;
671
+ const chipInk = isOutline
672
+ ? inverted
673
+ ? "C8FF00"
674
+ : ctx.colors.bg
675
+ : inverted
676
+ ? "0A0A0A"
677
+ : ctx.colors.accent;
678
+ slide.addShape(ctx.shapeOval, {
679
+ x: chipX,
680
+ y: chipY,
681
+ w: chip,
682
+ h: chip,
683
+ fill: { color: chipFill },
684
+ line: { color: chipFill, width: 0 },
685
+ });
686
+ slide.addText(glyph, {
687
+ x: chipX,
688
+ y: chipY,
689
+ w: chip,
690
+ h: chip,
691
+ fontFace: ctx.fonts.body,
692
+ fontSize: 11,
693
+ bold: true,
694
+ color: chipInk,
695
+ align: "center",
696
+ valign: "middle",
697
+ });
698
+ }
699
+ slide.addText(action.label, {
700
+ x: bx + (hasIcon ? 0.5 : 0.12),
701
+ y: by,
702
+ w: btnW - (hasIcon ? 0.58 : 0.24),
703
+ h: btnH,
655
704
  fontFace: ctx.fonts.body,
656
705
  fontSize: 15,
657
706
  bold: true,
658
- align: "center",
707
+ color: textColor,
708
+ align: hasIcon ? "left" : "center",
659
709
  valign: "middle",
660
- rectRadius: 0.25,
661
- line: isOutline
662
- ? { color: inverted ? "0A0A0A" : ctx.colors.text, width: 1.5 }
663
- : undefined,
664
710
  ...(action.href ? { hyperlink: { url: action.href } } : {}),
665
711
  });
666
712
  bx += btnW + gap;
@@ -844,6 +890,10 @@ function iconMarkerGlyph(icon) {
844
890
  [/linkedin/, "in"],
845
891
  [/play|demo/, "▶"],
846
892
  [/download|arrow-down/, "↓"],
893
+ [/calendar|schedule|book/, "▦"],
894
+ [/envelope|email|mail/, "✉"],
895
+ [/book-open|book|docs|read/, "☰"],
896
+ [/print/, "⎙"],
847
897
  ];
848
898
  for (const [re, glyph] of map) {
849
899
  if (re.test(raw))
@@ -2746,6 +2796,16 @@ function paintSlideChrome(slide, ctx, data) {
2746
2796
  title: ctx.title,
2747
2797
  marquee: ctx.marquee,
2748
2798
  });
2799
+ // Top butter rule (HTML border-top on ::before).
2800
+ slide.addShape(ctx.shapeRoundRect, {
2801
+ x: 0,
2802
+ y: ctx.height - 0.58,
2803
+ w: ctx.width,
2804
+ h: 0.045,
2805
+ fill: { color: ctx.colors.text },
2806
+ line: { color: ctx.colors.text, width: 0 },
2807
+ rectRadius: 0,
2808
+ });
2749
2809
  slide.addShape(ctx.shapeRoundRect, {
2750
2810
  x: 0,
2751
2811
  y: ctx.height - 0.55,
@@ -2761,25 +2821,36 @@ function paintSlideChrome(slide, ctx, data) {
2761
2821
  w: ctx.width - 0.3,
2762
2822
  h: 0.45,
2763
2823
  fontFace: ctx.fonts.heading,
2764
- fontSize: 12,
2824
+ fontSize: 13,
2765
2825
  bold: true,
2766
2826
  color: ctx.colors.text,
2767
2827
  align: "left",
2768
2828
  valign: "middle",
2829
+ charSpacing: 2,
2769
2830
  });
2770
2831
  }
2771
2832
  }
2772
2833
  if (theme === "aurora-glass") {
2773
- // Dual aurora washes + glass frame (aurora-glass).
2834
+ // Dual aurora washes + glass frame + specular rim (aurora-glass).
2774
2835
  slide.addShape(ctx.shapeRoundRect, {
2775
2836
  x: 0.08,
2776
2837
  y: 0.08,
2777
2838
  w: ctx.width - 0.16,
2778
2839
  h: ctx.height - 0.16,
2779
2840
  fill: { color: ctx.colors.bg, transparency: 100 },
2780
- line: { color: "FFFFFF", width: 0.9 },
2841
+ line: { color: "FFFFFF", width: 1.05 },
2781
2842
  rectRadius: 0.14,
2782
2843
  });
2844
+ // Inner frosted rim (backdrop-filter stand-in).
2845
+ slide.addShape(ctx.shapeRoundRect, {
2846
+ x: 0.18,
2847
+ y: 0.18,
2848
+ w: ctx.width - 0.36,
2849
+ h: ctx.height - 0.36,
2850
+ fill: { color: "FFFFFF", transparency: 94 },
2851
+ line: { color: "FFFFFF", width: 0.55 },
2852
+ rectRadius: 0.12,
2853
+ });
2783
2854
  slide.addShape(ctx.shapeOval, {
2784
2855
  x: ctx.width * 0.55,
2785
2856
  y: -ctx.height * 0.25,
@@ -2804,18 +2875,47 @@ function paintSlideChrome(slide, ctx, data) {
2804
2875
  fill: { color: ctx.colors.accent, transparency: 72 },
2805
2876
  line: { color: ctx.colors.accent, width: 0 },
2806
2877
  });
2878
+ // Specular top hairline + soft floor shadow (inset white / drop shadow).
2879
+ slide.addShape(ctx.shapeRoundRect, {
2880
+ x: 0.22,
2881
+ y: 0.14,
2882
+ w: ctx.width - 0.44,
2883
+ h: 0.025,
2884
+ fill: { color: "FFFFFF", transparency: 62 },
2885
+ line: { color: "FFFFFF", width: 0 },
2886
+ rectRadius: 0,
2887
+ });
2888
+ slide.addShape(ctx.shapeRoundRect, {
2889
+ x: 0.4,
2890
+ y: ctx.height - 0.16,
2891
+ w: ctx.width - 0.8,
2892
+ h: 0.07,
2893
+ fill: { color: "000000", transparency: 78 },
2894
+ line: { color: "000000", width: 0 },
2895
+ rectRadius: 0.04,
2896
+ });
2807
2897
  }
2808
2898
  if (theme === "glassmorphism") {
2809
- // Soft mist blob + cyan orb + glass frame (glass-mist).
2899
+ // Soft mist blob + cyan orb + glass frame + specular (glass-mist).
2810
2900
  slide.addShape(ctx.shapeRoundRect, {
2811
2901
  x: 0.1,
2812
2902
  y: 0.1,
2813
2903
  w: ctx.width - 0.2,
2814
2904
  h: ctx.height - 0.2,
2815
2905
  fill: { color: ctx.colors.bg, transparency: 100 },
2816
- line: { color: ctx.colors.accent, width: 1 },
2906
+ line: { color: ctx.colors.accent, width: 1.1 },
2817
2907
  rectRadius: 0.16,
2818
2908
  });
2909
+ // Frosted inner plate (card-level glass stand-in on the slide chrome).
2910
+ slide.addShape(ctx.shapeRoundRect, {
2911
+ x: 0.22,
2912
+ y: 0.22,
2913
+ w: ctx.width - 0.44,
2914
+ h: ctx.height - 0.44,
2915
+ fill: { color: "FFFFFF", transparency: 88 },
2916
+ line: { color: "FFFFFF", width: 0.7 },
2917
+ rectRadius: 0.14,
2918
+ });
2819
2919
  slide.addShape(ctx.shapeOval, {
2820
2920
  x: -ctx.width * 0.1,
2821
2921
  y: -ctx.height * 0.2,
@@ -2832,6 +2932,24 @@ function paintSlideChrome(slide, ctx, data) {
2832
2932
  fill: { color: ctx.colors.accent2, transparency: 64 },
2833
2933
  line: { color: ctx.colors.accent2, width: 0 },
2834
2934
  });
2935
+ slide.addShape(ctx.shapeRoundRect, {
2936
+ x: 0.28,
2937
+ y: 0.16,
2938
+ w: ctx.width - 0.56,
2939
+ h: 0.022,
2940
+ fill: { color: "FFFFFF", transparency: 35 },
2941
+ line: { color: "FFFFFF", width: 0 },
2942
+ rectRadius: 0,
2943
+ });
2944
+ slide.addShape(ctx.shapeRoundRect, {
2945
+ x: 0.45,
2946
+ y: ctx.height - 0.18,
2947
+ w: ctx.width - 0.9,
2948
+ h: 0.06,
2949
+ fill: { color: "0F1333", transparency: 88 },
2950
+ line: { color: "0F1333", width: 0 },
2951
+ rectRadius: 0.03,
2952
+ });
2835
2953
  }
2836
2954
  if (theme === "luxury-minimalist") {
2837
2955
  // Quiet luxe border on content; gold hairline on heroes (quiet-luxe).
@@ -4092,24 +4210,24 @@ function paintSlideChrome(slide, ctx, data) {
4092
4210
  }
4093
4211
  if (theme === "cobalt-grid") {
4094
4212
  // Blueprint-ish cobalt grid + outer frame + diagonal corner hatch (cobalt-grid-paper).
4095
- for (let i = 1; i < 18; i++) {
4213
+ for (let i = 1; i < 22; i++) {
4096
4214
  slide.addShape(ctx.shapeRoundRect, {
4097
- x: (ctx.width / 18) * i,
4215
+ x: (ctx.width / 22) * i,
4098
4216
  y: 0,
4099
- w: 0.012,
4217
+ w: 0.011,
4100
4218
  h: ctx.height,
4101
- fill: { color: ctx.colors.accent, transparency: 78 },
4219
+ fill: { color: ctx.colors.accent, transparency: 76 },
4102
4220
  line: { color: ctx.colors.accent, width: 0 },
4103
4221
  rectRadius: 0,
4104
4222
  });
4105
4223
  }
4106
- for (let i = 1; i < 11; i++) {
4224
+ for (let i = 1; i < 13; i++) {
4107
4225
  slide.addShape(ctx.shapeRoundRect, {
4108
4226
  x: 0,
4109
- y: (ctx.height / 11) * i,
4227
+ y: (ctx.height / 13) * i,
4110
4228
  w: ctx.width,
4111
- h: 0.012,
4112
- fill: { color: ctx.colors.accent, transparency: 78 },
4229
+ h: 0.011,
4230
+ fill: { color: ctx.colors.accent, transparency: 76 },
4113
4231
  line: { color: ctx.colors.accent, width: 0 },
4114
4232
  rectRadius: 0,
4115
4233
  });
@@ -4124,14 +4242,14 @@ function paintSlideChrome(slide, ctx, data) {
4124
4242
  line: { color: ctx.colors.accent, width: 0 },
4125
4243
  rectRadius: 0,
4126
4244
  });
4127
- for (let i = 0; i < 7; i++) {
4128
- const t = i / 6;
4245
+ for (let i = 0; i < 9; i++) {
4246
+ const t = i / 8;
4129
4247
  slide.addShape(ctx.shapeRoundRect, {
4130
- x: ctx.width * (0.58 + t * 0.38),
4131
- y: ctx.height * (0.95 - t * 0.42),
4132
- w: 0.9,
4133
- h: 0.018,
4134
- fill: { color: ctx.colors.accent, transparency: 48 },
4248
+ x: ctx.width * (0.56 + t * 0.4),
4249
+ y: ctx.height * (0.96 - t * 0.44),
4250
+ w: 0.95,
4251
+ h: 0.016,
4252
+ fill: { color: ctx.colors.accent, transparency: 44 },
4135
4253
  line: { color: ctx.colors.accent, width: 0 },
4136
4254
  rectRadius: 0,
4137
4255
  });
@@ -4143,7 +4261,26 @@ function paintSlideChrome(slide, ctx, data) {
4143
4261
  w: ctx.width - 0.16,
4144
4262
  h: ctx.height - 0.16,
4145
4263
  fill: { color: ctx.colors.bg, transparency: 100 },
4146
- line: { color: ctx.colors.accent, width: 1.1 },
4264
+ line: { color: ctx.colors.accent, width: 1.25 },
4265
+ rectRadius: 0,
4266
+ });
4267
+ // Top-left L registration marks (paper grid craft).
4268
+ slide.addShape(ctx.shapeRoundRect, {
4269
+ x: 0.18,
4270
+ y: 0.18,
4271
+ w: 0.55,
4272
+ h: 0.03,
4273
+ fill: { color: ctx.colors.accent, transparency: 35 },
4274
+ line: { color: ctx.colors.accent, width: 0 },
4275
+ rectRadius: 0,
4276
+ });
4277
+ slide.addShape(ctx.shapeRoundRect, {
4278
+ x: 0.18,
4279
+ y: 0.18,
4280
+ w: 0.03,
4281
+ h: 0.55,
4282
+ fill: { color: ctx.colors.accent, transparency: 35 },
4283
+ line: { color: ctx.colors.accent, width: 0 },
4147
4284
  rectRadius: 0,
4148
4285
  });
4149
4286
  }