@presentation-md/export 1.20.2 → 1.20.4

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 };
@@ -178,11 +174,129 @@ function cardStroke(ctx, opts = {}) {
178
174
  : ctx.colors.text;
179
175
  return { color, width: opts.hero || opts.highlighted ? 1.35 : 1.15 };
180
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
+ }
207
+ // claude warm-paper cards: quiet paper border hairline
208
+ if (ctx.themeName === "claude") {
209
+ return { color: ctx.colors.border, width: opts.hero || opts.highlighted ? 1.35 : 1.15 };
210
+ }
211
+ // default-tech neon-glow cards: violet accent rim
212
+ if (ctx.themeName === "default-tech") {
213
+ return { color: ctx.colors.accent, width: opts.hero || opts.highlighted ? 1.5 : 1.25 };
214
+ }
215
+ // corporate clean-light cards: navy-blue accent hairline
216
+ if (ctx.themeName === "corporate") {
217
+ return { color: ctx.colors.accent, width: opts.hero || opts.highlighted ? 1.35 : 1.15 };
218
+ }
219
+ // playful soft-bento cards: coral accent rim (plump)
220
+ if (ctx.themeName === "playful") {
221
+ return { color: ctx.colors.accent, width: opts.hero || opts.highlighted ? 1.35 : 1.15 };
222
+ }
223
+ // data-editorial data-rule cards: ink hairline
224
+ if (ctx.themeName === "data-editorial") {
225
+ return { color: ctx.colors.text, width: opts.hero || opts.highlighted ? 1.35 : 1.15 };
226
+ }
227
+ // developer-dark / fintech-clean / scandinavian peers
228
+ if (ctx.themeName === "developer-dark") {
229
+ return { color: ctx.colors.border, width: opts.hero || opts.highlighted ? 1.35 : 1.15 };
230
+ }
231
+ if (ctx.themeName === "fintech-clean") {
232
+ return { color: ctx.colors.accent, width: opts.hero || opts.highlighted ? 1.35 : 1.15 };
233
+ }
234
+ if (ctx.themeName === "scandinavian") {
235
+ return { color: ctx.colors.text, width: opts.hero || opts.highlighted ? 1.25 : 1.1 };
236
+ }
237
+ // pastel-dreamy soft plum hairline (plump radius stays in cardRadius)
238
+ if (ctx.themeName === "pastel-dreamy") {
239
+ return { color: ctx.colors.text, width: opts.hero || opts.highlighted ? 1.15 : 1 };
240
+ }
241
+ // scatterbrain sticky notes: ink hairline on yellow
242
+ if (ctx.themeName === "scatterbrain") {
243
+ return { color: ctx.colors.text, width: opts.hero || opts.highlighted ? 1.15 : 1 };
244
+ }
245
+ // split-pastel soft white cards: quiet ink hairline (HTML border:none → soft rim)
246
+ if (ctx.themeName === "split-pastel") {
247
+ return { color: ctx.colors.text, width: opts.hero || opts.highlighted ? 1.1 : 0.9 };
248
+ }
249
+ // risograph-zine riso-print cards: hard ink (near-square)
250
+ if (ctx.themeName === "risograph-zine") {
251
+ return { color: ctx.colors.text, width: opts.hero || opts.highlighted ? 2.25 : 2 };
252
+ }
181
253
  if (opts.hero || opts.highlighted) {
182
254
  return { color: ctx.colors.accent, width: opts.highlighted ? 1.75 : 1.5 };
183
255
  }
184
256
  return { color: ctx.colors.border, width: 1 };
185
257
  }
258
+ /** Draw a filled card shell with theme-native stroke (incl. dashed / top-rule). */
259
+ function drawCardFace(slide, ctx, x, y, w, h, fill, opts = {}) {
260
+ const stroke = cardStroke(ctx, opts);
261
+ const radius = cardRadius(ctx);
262
+ if (stroke.topRule) {
263
+ slide.addShape(ctx.shapeRoundRect, {
264
+ x,
265
+ y,
266
+ w,
267
+ h,
268
+ fill: { color: fill },
269
+ line: { color: fill, width: 0 },
270
+ rectRadius: radius,
271
+ });
272
+ const ruleH = opts.hero || opts.highlighted ? 0.028 : 0.02;
273
+ slide.addShape(ctx.shapeRoundRect, {
274
+ x: x + 0.04,
275
+ y,
276
+ w: Math.max(0.2, w - 0.08),
277
+ h: ruleH,
278
+ fill: { color: stroke.color },
279
+ line: { color: stroke.color, width: 0 },
280
+ rectRadius: 0,
281
+ });
282
+ return;
283
+ }
284
+ const line = {
285
+ color: stroke.color,
286
+ width: stroke.width,
287
+ };
288
+ if (stroke.dashType)
289
+ line.dashType = stroke.dashType;
290
+ slide.addShape(ctx.shapeRoundRect, {
291
+ x,
292
+ y,
293
+ w,
294
+ h,
295
+ fill: { color: fill },
296
+ line,
297
+ rectRadius: radius,
298
+ });
299
+ }
186
300
  function cardRadius(ctx) {
187
301
  // candy-blob cards: border-radius 22px ≈ 0.23"
188
302
  if (ctx.themeName === "candy-pop")
@@ -242,9 +356,17 @@ function cardRadius(ctx) {
242
356
  ctx.themeName === "broadsheet" ||
243
357
  ctx.themeName === "editorial-forest" ||
244
358
  ctx.themeName === "monochrome" ||
245
- ctx.themeName === "paper-ink") {
359
+ ctx.themeName === "paper-ink" ||
360
+ ctx.themeName === "luxury-minimalist" ||
361
+ ctx.themeName === "ft-editorial") {
246
362
  return 0;
247
363
  }
364
+ // signal-briefing cards: theme geometry 2px ≈ 0.02"
365
+ if (ctx.themeName === "signal")
366
+ return 0.02;
367
+ // blue-professional-clean / fintech-soft cards: border-radius 12px ≈ 0.125"
368
+ if (ctx.themeName === "blue-professional" || ctx.themeName === "fintech-clean")
369
+ return 0.125;
248
370
  // hard-bento (genz-bento) cards: border-radius 14px ≈ 0.15"
249
371
  if (ctx.themeName === "genz-bento")
250
372
  return 0.15;
@@ -269,12 +391,36 @@ function cardRadius(ctx) {
269
391
  // vintage-editorial-geo cards: border-radius 4px ≈ 0.04"
270
392
  if (ctx.themeName === "vintage-editorial")
271
393
  return 0.04;
272
- // scatterbrain-cork cards: border-radius 2px ≈ 0.02"
273
- if (ctx.themeName === "scatterbrain")
394
+ // scatterbrain-cork / risograph-zine cards: border-radius 2px ≈ 0.02"
395
+ if (ctx.themeName === "scatterbrain" || ctx.themeName === "risograph-zine")
274
396
  return 0.02;
275
397
  // sakura-chroma-cassette cards: border-radius 4px ≈ 0.04"
276
398
  if (ctx.themeName === "sakura-chroma")
277
399
  return 0.04;
400
+ // claude warm-paper cards: geometry 12px * 0.85 ≈ 0.1"
401
+ if (ctx.themeName === "claude")
402
+ return 0.1;
403
+ // default-tech neon-glow cards: geometry 18px * 0.85 ≈ 0.16"
404
+ if (ctx.themeName === "default-tech")
405
+ return 0.16;
406
+ // corporate clean-light cards: geometry 8px * 0.85 ≈ 0.07"
407
+ if (ctx.themeName === "corporate")
408
+ return 0.07;
409
+ // playful soft-bento cards: border-radius 20px ≈ 0.21"
410
+ if (ctx.themeName === "playful")
411
+ return 0.21;
412
+ // data-editorial data-rule cards: geometry 4px ≈ 0.04"
413
+ if (ctx.themeName === "data-editorial")
414
+ return 0.04;
415
+ // developer-dark title-bar cards: geometry 8px ≈ 0.08"
416
+ if (ctx.themeName === "developer-dark")
417
+ return 0.08;
418
+ // scandinavian hygge cards: geometry 16px * 0.85 ≈ 0.14"
419
+ if (ctx.themeName === "scandinavian")
420
+ return 0.14;
421
+ // split-pastel soft white cards: border-radius 18px ≈ 0.19"
422
+ if (ctx.themeName === "split-pastel")
423
+ return 0.19;
278
424
  return 0.06;
279
425
  }
280
426
  /**
@@ -583,15 +729,7 @@ function renderTwoColumn(slide, ctx, data) {
583
729
  addImageOrPlaceholder(slide, ctx, data, mediaX, imgY, mediaW, imgH);
584
730
  }
585
731
  else if (data.aside) {
586
- slide.addShape(ctx.shapeRoundRect, {
587
- x: mediaX,
588
- y: imgY,
589
- w: mediaW,
590
- h: imgH,
591
- fill: { color: ctx.colors.cardBg },
592
- line: cardStroke(ctx, { hero: true }),
593
- rectRadius: cardRadius(ctx),
594
- });
732
+ drawCardFace(slide, ctx, mediaX, imgY, mediaW, imgH, ctx.colors.cardBg, { hero: true });
595
733
  slide.addText(data.aside, {
596
734
  x: mediaX + 0.3,
597
735
  y: imgY + 0.4,
@@ -748,16 +886,7 @@ function drawFeatureCard(slide, ctx, card, x, y, w, h, opts = {}) {
748
886
  const fill = hero ? ctx.colors.emphasisFill : ctx.colors.cardBg;
749
887
  const ink = hero ? ctx.colors.emphasisText : ctx.colors.cardText;
750
888
  const bodyInk = hero ? ctx.colors.emphasisText : ctx.colors.cardMuted;
751
- const stroke = cardStroke(ctx, { hero });
752
- slide.addShape(ctx.shapeRoundRect, {
753
- x,
754
- y,
755
- w,
756
- h,
757
- fill: { color: fill },
758
- line: stroke,
759
- rectRadius: cardRadius(ctx),
760
- });
889
+ drawCardFace(slide, ctx, x, y, w, h, fill, { hero });
761
890
  drawIconMarker(slide, ctx, card.icon, x + 0.2, y + 0.2, hero ? 0.42 : 0.34);
762
891
  const pad = 0.2;
763
892
  const titleY = y + (hero ? 0.75 : 0.6);
@@ -1283,15 +1412,7 @@ function renderComparison(slide, ctx, data) {
1283
1412
  const fill = highlighted ? ctx.colors.emphasisFill : ctx.colors.cardBg;
1284
1413
  const ink = highlighted ? ctx.colors.emphasisText : ctx.colors.cardText;
1285
1414
  const bodyInk = highlighted ? ctx.colors.emphasisText : ctx.colors.cardMuted;
1286
- slide.addShape(ctx.shapeRoundRect, {
1287
- x,
1288
- y: boxY,
1289
- w: colW,
1290
- h: boxH,
1291
- fill: { color: fill },
1292
- line: cardStroke(ctx, { highlighted }),
1293
- rectRadius: cardRadius(ctx),
1294
- });
1415
+ drawCardFace(slide, ctx, x, boxY, colW, boxH, fill, { highlighted });
1295
1416
  let innerY = boxY + 0.25;
1296
1417
  if (label) {
1297
1418
  slide.addText(label.toUpperCase(), {
@@ -1709,15 +1830,7 @@ function renderLogoWall(slide, ctx, data) {
1709
1830
  const row = Math.floor(i / cols);
1710
1831
  const x = ctx.margin + col * (cellW + gap);
1711
1832
  const y = top + 0.1 + row * (cellH + gap);
1712
- slide.addShape(ctx.shapeRoundRect, {
1713
- x,
1714
- y,
1715
- w: cellW,
1716
- h: cellH,
1717
- fill: { color: ctx.colors.cardBg },
1718
- line: cardStroke(ctx),
1719
- rectRadius: cardRadius(ctx),
1720
- });
1833
+ drawCardFace(slide, ctx, x, y, cellW, cellH, ctx.colors.cardBg);
1721
1834
  const img = typeof card.image === "string" ? card.image.trim() : "";
1722
1835
  if (img && (/^data:image\//i.test(img) || /^https?:\/\//i.test(img))) {
1723
1836
  try {
@@ -2279,7 +2392,7 @@ function paintSlideChrome(slide, ctx, data) {
2279
2392
  });
2280
2393
  }
2281
2394
  if (theme === "default-tech") {
2282
- // Neon-glow corner bloom + secondary cyan wash (HTML blur → soft ovals).
2395
+ // Neon-glow corner bloom + secondary cyan wash + quiet neon inset frame.
2283
2396
  const glowT = isHero ? 55 : 72;
2284
2397
  slide.addShape(ctx.shapeOval, {
2285
2398
  x: ctx.width - 4.2,
@@ -2297,6 +2410,15 @@ function paintSlideChrome(slide, ctx, data) {
2297
2410
  fill: { color: ctx.colors.accent2, transparency: isHero ? 68 : 80 },
2298
2411
  line: { color: ctx.colors.accent2, width: 0 },
2299
2412
  });
2413
+ slide.addShape(ctx.shapeRoundRect, {
2414
+ x: 0.28,
2415
+ y: 0.28,
2416
+ w: ctx.width - 0.56,
2417
+ h: ctx.height - 0.56,
2418
+ fill: { color: ctx.colors.bg, transparency: 100 },
2419
+ line: { color: ctx.colors.accent, width: isHero ? 1.25 : 1 },
2420
+ rectRadius: 0.14,
2421
+ });
2300
2422
  }
2301
2423
  if (theme === "kinetic-wrapped") {
2302
2424
  const tone = typeof data.tone === "string" ? data.tone : undefined;
@@ -5832,7 +5954,7 @@ function paintSlideChrome(slide, ctx, data) {
5832
5954
  });
5833
5955
  }
5834
5956
  if (theme === "playful") {
5835
- // Soft accent blot + rounded candy square + second cloud (soft-bento).
5957
+ // Soft accent blot + rounded candy square + second cloud + plump soft frame.
5836
5958
  slide.addShape(ctx.shapeOval, {
5837
5959
  x: ctx.width * 0.75,
5838
5960
  y: -ctx.height * 0.05,
@@ -5858,9 +5980,18 @@ function paintSlideChrome(slide, ctx, data) {
5858
5980
  line: { color: ctx.colors.accent, width: 0 },
5859
5981
  rectRadius: 0.28,
5860
5982
  });
5983
+ slide.addShape(ctx.shapeRoundRect, {
5984
+ x: 0.22,
5985
+ y: 0.22,
5986
+ w: ctx.width - 0.44,
5987
+ h: ctx.height - 0.44,
5988
+ fill: { color: ctx.colors.bg, transparency: 100 },
5989
+ line: { color: ctx.colors.border, width: 1.1 },
5990
+ rectRadius: 0.2,
5991
+ });
5861
5992
  }
5862
5993
  if (theme === "corporate") {
5863
- // Clean accent stub + soft top wash (clean-light).
5994
+ // Clean accent stub + soft top wash + quiet navy hairline frame (clean-light).
5864
5995
  slide.addShape(ctx.shapeRoundRect, {
5865
5996
  x: 0,
5866
5997
  y: 0,
@@ -5879,6 +6010,15 @@ function paintSlideChrome(slide, ctx, data) {
5879
6010
  line: { color: ctx.colors.accent, width: 0 },
5880
6011
  rectRadius: 0.045,
5881
6012
  });
6013
+ slide.addShape(ctx.shapeRoundRect, {
6014
+ x: 0.28,
6015
+ y: 0.28,
6016
+ w: ctx.width - 0.56,
6017
+ h: ctx.height - 0.56,
6018
+ fill: { color: ctx.colors.bg, transparency: 100 },
6019
+ line: { color: ctx.colors.border, width: 1 },
6020
+ rectRadius: 0.06,
6021
+ });
5882
6022
  }
5883
6023
  }
5884
6024
  export function renderSlide(slide, ctx, data) {