@koda-sl/baker-cli 0.398.0 → 0.400.0-dev.4f17e202b

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.
Files changed (26) hide show
  1. package/README.md +2 -2
  2. package/dist/{chunk-EEHNRAFA.js → chunk-3ZN2DUBU.js} +4 -4
  3. package/dist/{chunk-ZWMATKNS.js → chunk-5X5LUMVV.js} +2 -2
  4. package/dist/{chunk-LHJ5IXBN.js → chunk-KXJ2FND2.js} +6 -6
  5. package/dist/chunk-KXJ2FND2.js.map +1 -0
  6. package/dist/{chunk-BRIJ4OWT.js → chunk-N72QYDJY.js} +33 -5
  7. package/dist/{chunk-BRIJ4OWT.js.map → chunk-N72QYDJY.js.map} +1 -1
  8. package/dist/{chunk-Q7RQ3H6Y.js → chunk-WQE4SRLY.js} +3 -3
  9. package/dist/{chunk-QP7637HG.js → chunk-X37GPJ54.js} +3 -3
  10. package/dist/cli.js +229 -187
  11. package/dist/cli.js.map +1 -1
  12. package/dist/{client-4P6U75EX.js → client-BPKOHQWA.js} +4 -4
  13. package/dist/engine/index.js +3 -3
  14. package/dist/{env-LJHSZSNA.js → env-B7V77K6K.js} +2 -2
  15. package/dist/{output-HVBFJX4I.js → output-5M2QPMKZ.js} +5 -5
  16. package/dist/{shared-7ZEF4DIX.js → shared-OEQKSDWO.js} +6 -6
  17. package/package.json +1 -1
  18. package/dist/chunk-LHJ5IXBN.js.map +0 -1
  19. /package/dist/{chunk-EEHNRAFA.js.map → chunk-3ZN2DUBU.js.map} +0 -0
  20. /package/dist/{chunk-ZWMATKNS.js.map → chunk-5X5LUMVV.js.map} +0 -0
  21. /package/dist/{chunk-Q7RQ3H6Y.js.map → chunk-WQE4SRLY.js.map} +0 -0
  22. /package/dist/{chunk-QP7637HG.js.map → chunk-X37GPJ54.js.map} +0 -0
  23. /package/dist/{client-4P6U75EX.js.map → client-BPKOHQWA.js.map} +0 -0
  24. /package/dist/{env-LJHSZSNA.js.map → env-B7V77K6K.js.map} +0 -0
  25. /package/dist/{output-HVBFJX4I.js.map → output-5M2QPMKZ.js.map} +0 -0
  26. /package/dist/{shared-7ZEF4DIX.js.map → shared-OEQKSDWO.js.map} +0 -0
@@ -996,7 +996,13 @@ function winningAdNormalizer(record, full) {
996
996
  }
997
997
  return compactWinningAd(record);
998
998
  }
999
- function overlayLines(value, detailed = false) {
999
+ function inImageLine(item, text, detailed) {
1000
+ const card = typeof item.card === "number" ? `card ${item.card} \xB7 ` : "";
1001
+ const role = typeof item.role === "string" && item.role.length > 0 ? `${item.role}: ` : "";
1002
+ const position = detailed && typeof item.position === "string" && item.position.length > 0 ? ` [${item.position}]` : "";
1003
+ return `${card}${role}${text}${position}`;
1004
+ }
1005
+ function overlayLines(value, detailed = false, inImage = false) {
1000
1006
  if (!Array.isArray(value)) {
1001
1007
  return [];
1002
1008
  }
@@ -1006,6 +1012,9 @@ function overlayLines(value, detailed = false) {
1006
1012
  if (!text) {
1007
1013
  return [];
1008
1014
  }
1015
+ if (inImage) {
1016
+ return [inImageLine(item, text, detailed)];
1017
+ }
1009
1018
  const at = round2(item.appears_at_s);
1010
1019
  let line = at !== null ? `${text} @${at}s` : text;
1011
1020
  if (detailed) {
@@ -1018,6 +1027,7 @@ function overlayLines(value, detailed = false) {
1018
1027
  });
1019
1028
  }
1020
1029
  function compactAdContent(record) {
1030
+ const inImage = record.format === "static" || record.format === "carousel";
1021
1031
  return {
1022
1032
  ad_id: record.ad_id ?? null,
1023
1033
  advertiser: record.advertiser ?? null,
@@ -1026,13 +1036,22 @@ function compactAdContent(record) {
1026
1036
  media_url: record.media_url ?? null,
1027
1037
  summary: record.summary ?? null,
1028
1038
  transcript: record.transcript ?? null,
1029
- on_screen_text: overlayLines(record.on_screen_text),
1039
+ on_screen_text: overlayLines(record.on_screen_text, false, inImage),
1040
+ // The container a static reference is built on (comparison_table, before_after_split…).
1041
+ ...inImage ? { format_pattern: asRecord(record.layout).format_pattern ?? null } : {},
1030
1042
  has_captions: typeof record.has_captions === "boolean" ? record.has_captions : null,
1031
1043
  primary_text: record.primary_text ?? null,
1032
1044
  headline: record.headline ?? null,
1033
1045
  cta: record.cta ?? null
1034
1046
  };
1035
1047
  }
1048
+ function filledOnly(value) {
1049
+ return Object.fromEntries(
1050
+ Object.entries(asRecord(value)).filter(
1051
+ ([, v]) => v !== null && v !== void 0 && !(Array.isArray(v) && v.length === 0)
1052
+ )
1053
+ );
1054
+ }
1036
1055
  function fullAdContent(record) {
1037
1056
  const speech = asRecord(record.speech);
1038
1057
  const pacing = asRecord(record.pacing);
@@ -1041,7 +1060,11 @@ function fullAdContent(record) {
1041
1060
  ...compactAdContent(record),
1042
1061
  platform: record.platform ?? null,
1043
1062
  // Re-derive with role/position tags — the lean compact version dropped them.
1044
- on_screen_text: overlayLines(record.on_screen_text, true),
1063
+ on_screen_text: overlayLines(
1064
+ record.on_screen_text,
1065
+ true,
1066
+ record.format === "static" || record.format === "carousel"
1067
+ ),
1045
1068
  winner_score: round2(record.winner_score),
1046
1069
  winner_category: record.winner_category ?? null,
1047
1070
  angle: record.angle ?? null,
@@ -1060,7 +1083,12 @@ function fullAdContent(record) {
1060
1083
  cta_first_shown_at_s: round2(pacing.cta_first_shown_at_s),
1061
1084
  product_first_appears_at_s: round2(pacing.product_first_appears_at_s),
1062
1085
  music_track_title: music.track_title ?? null,
1063
- music_track_artist: music.track_artist ?? null
1086
+ music_track_artist: music.track_artist ?? null,
1087
+ // How it is built, how it persuades, and what it offers, flattened like
1088
+ // speech/pacing above so --output md renders them, and only when present.
1089
+ ...filledOnly(record.layout),
1090
+ ...filledOnly(record.message),
1091
+ ...filledOnly(record.offer)
1064
1092
  };
1065
1093
  }
1066
1094
  function adContentNormalizer(record, full) {
@@ -1311,4 +1339,4 @@ export {
1311
1339
  captureVimeoCookie,
1312
1340
  childEnvWith
1313
1341
  };
1314
- //# sourceMappingURL=chunk-BRIJ4OWT.js.map
1342
+ //# sourceMappingURL=chunk-N72QYDJY.js.map