@presentation-md/export 1.20.1 → 1.20.3

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
@@ -68,10 +68,6 @@ function cardStroke(ctx, opts = {}) {
68
68
  if (ctx.themeName === "mat") {
69
69
  return { color: "1E2820", width: opts.hero || opts.highlighted ? 1.5 : 1.25 };
70
70
  }
71
- // biennale-yellow-sun cards: indigo hairline
72
- if (ctx.themeName === "biennale-yellow") {
73
- return { color: ctx.colors.text, width: opts.hero || opts.highlighted ? 1.35 : 1.1 };
74
- }
75
71
  // hard-bento (genz-bento) cards: 2.5px ink
76
72
  if (ctx.themeName === "genz-bento") {
77
73
  return { color: ctx.colors.text, width: opts.hero || opts.highlighted ? 2.75 : 2.5 };
@@ -148,6 +144,10 @@ function cardStroke(ctx, opts = {}) {
148
144
  if (ctx.themeName === "brutalist-mono") {
149
145
  return { color: ctx.colors.text, width: opts.hero || opts.highlighted ? 2.25 : 2 };
150
146
  }
147
+ // deco-fan (art-deco): gold hairline, square
148
+ if (ctx.themeName === "art-deco") {
149
+ return { color: ctx.colors.accent, width: opts.hero || opts.highlighted ? 1.5 : 1.25 };
150
+ }
151
151
  // emerald-editorial / pink-script / vellum / broadsheet / editorial-forest /
152
152
  // soft-editorial / paper-ink / pin-and-paper / monochrome / notebook-tabs
153
153
  if (ctx.themeName === "emerald-editorial") {
@@ -174,11 +174,83 @@ function cardStroke(ctx, opts = {}) {
174
174
  : ctx.colors.text;
175
175
  return { color, width: opts.hero || opts.highlighted ? 1.35 : 1.15 };
176
176
  }
177
+ // long-table-supper cards: dashed rust rim (HTML 1.5px dashed)
178
+ if (ctx.themeName === "long-table") {
179
+ return {
180
+ color: ctx.colors.accent,
181
+ width: opts.hero || opts.highlighted ? 1.5 : 1.35,
182
+ dashType: "dash",
183
+ };
184
+ }
185
+ // quiet-luxe / biennale-yellow-sun: top-rule cards (no full box stroke)
186
+ if (ctx.themeName === "luxury-minimalist" || ctx.themeName === "biennale-yellow") {
187
+ return {
188
+ color: ctx.themeName === "luxury-minimalist" ? ctx.colors.accent : ctx.colors.text,
189
+ width: opts.hero || opts.highlighted ? 1.5 : 1.25,
190
+ topRule: true,
191
+ };
192
+ }
193
+ // signal-briefing cards: quiet border hairline (theme geometry radius)
194
+ if (ctx.themeName === "signal") {
195
+ return { color: ctx.colors.border, width: opts.hero || opts.highlighted ? 1.25 : 1.1 };
196
+ }
197
+ // blue-professional-clean / pastel-geometry-pills / ft broadsheet-rule peers
198
+ if (ctx.themeName === "blue-professional") {
199
+ return { color: ctx.colors.accent, width: opts.hero || opts.highlighted ? 1.35 : 1.15 };
200
+ }
201
+ if (ctx.themeName === "pastel-geometry") {
202
+ return { color: ctx.colors.text, width: opts.hero || opts.highlighted ? 1.15 : 1 };
203
+ }
204
+ if (ctx.themeName === "ft-editorial") {
205
+ return { color: ctx.colors.text, width: opts.hero || opts.highlighted ? 1.35 : 1.15 };
206
+ }
177
207
  if (opts.hero || opts.highlighted) {
178
208
  return { color: ctx.colors.accent, width: opts.highlighted ? 1.75 : 1.5 };
179
209
  }
180
210
  return { color: ctx.colors.border, width: 1 };
181
211
  }
212
+ /** Draw a filled card shell with theme-native stroke (incl. dashed / top-rule). */
213
+ function drawCardFace(slide, ctx, x, y, w, h, fill, opts = {}) {
214
+ const stroke = cardStroke(ctx, opts);
215
+ const radius = cardRadius(ctx);
216
+ if (stroke.topRule) {
217
+ slide.addShape(ctx.shapeRoundRect, {
218
+ x,
219
+ y,
220
+ w,
221
+ h,
222
+ fill: { color: fill },
223
+ line: { color: fill, width: 0 },
224
+ rectRadius: radius,
225
+ });
226
+ const ruleH = opts.hero || opts.highlighted ? 0.028 : 0.02;
227
+ slide.addShape(ctx.shapeRoundRect, {
228
+ x: x + 0.04,
229
+ y,
230
+ w: Math.max(0.2, w - 0.08),
231
+ h: ruleH,
232
+ fill: { color: stroke.color },
233
+ line: { color: stroke.color, width: 0 },
234
+ rectRadius: 0,
235
+ });
236
+ return;
237
+ }
238
+ const line = {
239
+ color: stroke.color,
240
+ width: stroke.width,
241
+ };
242
+ if (stroke.dashType)
243
+ line.dashType = stroke.dashType;
244
+ slide.addShape(ctx.shapeRoundRect, {
245
+ x,
246
+ y,
247
+ w,
248
+ h,
249
+ fill: { color: fill },
250
+ line,
251
+ rectRadius: radius,
252
+ });
253
+ }
182
254
  function cardRadius(ctx) {
183
255
  // candy-blob cards: border-radius 22px ≈ 0.23"
184
256
  if (ctx.themeName === "candy-pop")
@@ -231,15 +303,24 @@ function cardRadius(ctx) {
231
303
  ctx.themeName === "editorial-serif" ||
232
304
  ctx.themeName === "crt-terminal" ||
233
305
  ctx.themeName === "brutalist-mono" ||
306
+ ctx.themeName === "art-deco" ||
234
307
  ctx.themeName === "emerald-editorial" ||
235
308
  ctx.themeName === "pink-script" ||
236
309
  ctx.themeName === "vellum" ||
237
310
  ctx.themeName === "broadsheet" ||
238
311
  ctx.themeName === "editorial-forest" ||
239
312
  ctx.themeName === "monochrome" ||
240
- ctx.themeName === "paper-ink") {
313
+ ctx.themeName === "paper-ink" ||
314
+ ctx.themeName === "luxury-minimalist" ||
315
+ ctx.themeName === "ft-editorial") {
241
316
  return 0;
242
317
  }
318
+ // signal-briefing cards: theme geometry 2px ≈ 0.02"
319
+ if (ctx.themeName === "signal")
320
+ return 0.02;
321
+ // blue-professional-clean cards: border-radius 12px ≈ 0.125"
322
+ if (ctx.themeName === "blue-professional")
323
+ return 0.125;
243
324
  // hard-bento (genz-bento) cards: border-radius 14px ≈ 0.15"
244
325
  if (ctx.themeName === "genz-bento")
245
326
  return 0.15;
@@ -578,15 +659,7 @@ function renderTwoColumn(slide, ctx, data) {
578
659
  addImageOrPlaceholder(slide, ctx, data, mediaX, imgY, mediaW, imgH);
579
660
  }
580
661
  else if (data.aside) {
581
- slide.addShape(ctx.shapeRoundRect, {
582
- x: mediaX,
583
- y: imgY,
584
- w: mediaW,
585
- h: imgH,
586
- fill: { color: ctx.colors.cardBg },
587
- line: cardStroke(ctx, { hero: true }),
588
- rectRadius: cardRadius(ctx),
589
- });
662
+ drawCardFace(slide, ctx, mediaX, imgY, mediaW, imgH, ctx.colors.cardBg, { hero: true });
590
663
  slide.addText(data.aside, {
591
664
  x: mediaX + 0.3,
592
665
  y: imgY + 0.4,
@@ -743,16 +816,7 @@ function drawFeatureCard(slide, ctx, card, x, y, w, h, opts = {}) {
743
816
  const fill = hero ? ctx.colors.emphasisFill : ctx.colors.cardBg;
744
817
  const ink = hero ? ctx.colors.emphasisText : ctx.colors.cardText;
745
818
  const bodyInk = hero ? ctx.colors.emphasisText : ctx.colors.cardMuted;
746
- const stroke = cardStroke(ctx, { hero });
747
- slide.addShape(ctx.shapeRoundRect, {
748
- x,
749
- y,
750
- w,
751
- h,
752
- fill: { color: fill },
753
- line: stroke,
754
- rectRadius: cardRadius(ctx),
755
- });
819
+ drawCardFace(slide, ctx, x, y, w, h, fill, { hero });
756
820
  drawIconMarker(slide, ctx, card.icon, x + 0.2, y + 0.2, hero ? 0.42 : 0.34);
757
821
  const pad = 0.2;
758
822
  const titleY = y + (hero ? 0.75 : 0.6);
@@ -1278,15 +1342,7 @@ function renderComparison(slide, ctx, data) {
1278
1342
  const fill = highlighted ? ctx.colors.emphasisFill : ctx.colors.cardBg;
1279
1343
  const ink = highlighted ? ctx.colors.emphasisText : ctx.colors.cardText;
1280
1344
  const bodyInk = highlighted ? ctx.colors.emphasisText : ctx.colors.cardMuted;
1281
- slide.addShape(ctx.shapeRoundRect, {
1282
- x,
1283
- y: boxY,
1284
- w: colW,
1285
- h: boxH,
1286
- fill: { color: fill },
1287
- line: cardStroke(ctx, { highlighted }),
1288
- rectRadius: cardRadius(ctx),
1289
- });
1345
+ drawCardFace(slide, ctx, x, boxY, colW, boxH, fill, { highlighted });
1290
1346
  let innerY = boxY + 0.25;
1291
1347
  if (label) {
1292
1348
  slide.addText(label.toUpperCase(), {
@@ -1704,15 +1760,7 @@ function renderLogoWall(slide, ctx, data) {
1704
1760
  const row = Math.floor(i / cols);
1705
1761
  const x = ctx.margin + col * (cellW + gap);
1706
1762
  const y = top + 0.1 + row * (cellH + gap);
1707
- slide.addShape(ctx.shapeRoundRect, {
1708
- x,
1709
- y,
1710
- w: cellW,
1711
- h: cellH,
1712
- fill: { color: ctx.colors.cardBg },
1713
- line: cardStroke(ctx),
1714
- rectRadius: cardRadius(ctx),
1715
- });
1763
+ drawCardFace(slide, ctx, x, y, cellW, cellH, ctx.colors.cardBg);
1716
1764
  const img = typeof card.image === "string" ? card.image.trim() : "";
1717
1765
  if (img && (/^data:image\//i.test(img) || /^https?:\/\//i.test(img))) {
1718
1766
  try {
@@ -3297,33 +3345,42 @@ function paintSlideChrome(slide, ctx, data) {
3297
3345
  });
3298
3346
  }
3299
3347
  if (theme === "art-deco") {
3300
- // Gold frame + hairline; centered deco ring on heroes (deco-fan).
3348
+ // Gold frame + always-on top hairline (deco-fan ::before); centered deco
3349
+ // ring on heroes (::after is hero-gated). Cards get gold hairlines via cardStroke.
3301
3350
  slide.addShape(ctx.shapeRoundRect, {
3302
3351
  x: 0.1,
3303
3352
  y: 0.1,
3304
3353
  w: ctx.width - 0.2,
3305
3354
  h: ctx.height - 0.2,
3306
3355
  fill: { color: ctx.colors.bg, transparency: 100 },
3307
- line: { color: ctx.colors.accent, width: 1.15 },
3356
+ line: { color: ctx.colors.accent, width: 1.35 },
3308
3357
  rectRadius: 0,
3309
3358
  });
3310
3359
  slide.addShape(ctx.shapeRoundRect, {
3311
- x: ctx.margin,
3312
- y: 0.55,
3313
- w: ctx.width - ctx.margin * 2,
3314
- h: 0.02,
3315
- fill: { color: ctx.colors.accent, transparency: isHero ? 0 : 35 },
3360
+ x: ctx.margin + 0.15,
3361
+ y: 0.52,
3362
+ w: ctx.width - ctx.margin * 2 - 0.3,
3363
+ h: 0.025,
3364
+ fill: { color: ctx.colors.accent, transparency: isHero ? 0 : 20 },
3316
3365
  line: { color: ctx.colors.accent, width: 0 },
3317
3366
  rectRadius: 0,
3318
3367
  });
3319
3368
  if (isHero) {
3320
3369
  slide.addShape(ctx.shapeOval, {
3321
- x: ctx.width / 2 - 0.35,
3322
- y: 0.38,
3323
- w: 0.7,
3324
- h: 0.7,
3370
+ x: ctx.width / 2 - 0.38,
3371
+ y: 0.35,
3372
+ w: 0.76,
3373
+ h: 0.76,
3325
3374
  fill: { color: ctx.colors.bg, transparency: 100 },
3326
- line: { color: ctx.colors.accent, width: 1.75 },
3375
+ line: { color: ctx.colors.accent, width: 1.85 },
3376
+ });
3377
+ slide.addShape(ctx.shapeOval, {
3378
+ x: ctx.width / 2 - 0.22,
3379
+ y: 0.51,
3380
+ w: 0.44,
3381
+ h: 0.44,
3382
+ fill: { color: ctx.colors.bg, transparency: 100 },
3383
+ line: { color: ctx.colors.accent, width: 0.9 },
3327
3384
  });
3328
3385
  }
3329
3386
  }