@koda-sl/baker-cli 0.267.0-dev.1f1c09c80 → 0.268.0-dev.1f1c09c80
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/cli.js +38 -10
- package/dist/cli.js.map +1 -1
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -32600,13 +32600,33 @@ var VOICE_LANGUAGE_NAME = {
|
|
|
32600
32600
|
"en-us": "english",
|
|
32601
32601
|
"en-gb": "english"
|
|
32602
32602
|
};
|
|
32603
|
+
var SCRIPT_LANGUAGE_MARKERS = [
|
|
32604
|
+
["spanish", /\b(el|la|los|las|un|una|de|del|que|para|con|tu|su|más|ya|pero|porque|cada|hasta|sin)\b/gi],
|
|
32605
|
+
["portuguese", /\b(o|a|os|as|um|uma|de|do|da|que|para|com|seu|sua|mais|já|mas|porque|até|sem)\b/gi],
|
|
32606
|
+
["french", /\b(le|la|les|un|une|de|du|des|que|pour|avec|ton|son|plus|déjà|mais|parce|jusqu|sans)\b/gi],
|
|
32607
|
+
["italian", /\b(il|lo|la|gli|un|una|di|del|che|per|con|tuo|suo|più|già|ma|perché|fino|senza)\b/gi],
|
|
32608
|
+
["german", /\b(der|die|das|ein|eine|und|von|dem|den|für|mit|dein|sein|mehr|schon|aber|weil|ohne)\b/gi],
|
|
32609
|
+
["dutch", /\b(de|het|een|en|van|voor|met|jouw|zijn|meer|maar|omdat|zonder)\b/gi],
|
|
32610
|
+
["polish", /\b(i|w|na|do|jest|nie|to|się|dla|z|już|ale|bez)\b/gi],
|
|
32611
|
+
["english", /\b(the|a|an|of|to|for|with|your|more|already|but|because|until|without)\b/gi]
|
|
32612
|
+
];
|
|
32613
|
+
function detectScriptLanguage(lines) {
|
|
32614
|
+
const text2 = lines.join(" ");
|
|
32615
|
+
if (text2.trim().length < 12) return void 0;
|
|
32616
|
+
let best = null;
|
|
32617
|
+
for (const [name, re2] of SCRIPT_LANGUAGE_MARKERS) {
|
|
32618
|
+
const hits = (text2.match(re2) ?? []).length;
|
|
32619
|
+
if (hits > 0 && (!best || hits > best.hits)) best = { name, hits };
|
|
32620
|
+
}
|
|
32621
|
+
return best?.name;
|
|
32622
|
+
}
|
|
32603
32623
|
function voiceLanguageFor(spec) {
|
|
32604
32624
|
const declared = spec.voice?.language?.trim().toLowerCase();
|
|
32605
|
-
if (declared) return VOICE_LANGUAGE_NAME[declared];
|
|
32625
|
+
if (declared && VOICE_LANGUAGE_NAME[declared]) return VOICE_LANGUAGE_NAME[declared];
|
|
32606
32626
|
const market = spec.market?.trim().toLowerCase();
|
|
32607
|
-
|
|
32608
|
-
|
|
32609
|
-
return
|
|
32627
|
+
const byMarket = market ? Object.entries(MARKET_BY_LANGUAGE).find(([, place]) => place.toLowerCase() === market) : void 0;
|
|
32628
|
+
if (byMarket && VOICE_LANGUAGE_NAME[byMarket[0]]) return VOICE_LANGUAGE_NAME[byMarket[0]];
|
|
32629
|
+
return detectScriptLanguage(spec.beats.map((b) => b.say));
|
|
32610
32630
|
}
|
|
32611
32631
|
function marketFor(spec) {
|
|
32612
32632
|
if (spec.market) return spec.market;
|
|
@@ -32626,8 +32646,10 @@ function endCardWanted(spec) {
|
|
|
32626
32646
|
}
|
|
32627
32647
|
function endCardCta(spec) {
|
|
32628
32648
|
if (!endCardWanted(spec)) return null;
|
|
32629
|
-
const declared = spec.end_card === false ? void 0 : spec.end_card?.cta;
|
|
32630
|
-
|
|
32649
|
+
const declared = spec.end_card === false ? void 0 : spec.end_card?.cta?.trim();
|
|
32650
|
+
if (!declared) return null;
|
|
32651
|
+
const closing = (spec.beats[spec.beats.length - 1]?.say ?? "").trim().toLowerCase();
|
|
32652
|
+
return declared.toLowerCase().replace(/[.!?]$/, "") === closing.replace(/[.!?]$/, "") ? null : declared;
|
|
32631
32653
|
}
|
|
32632
32654
|
function adSpecCastElements(spec, avatar) {
|
|
32633
32655
|
const description = (avatar?.subjectDescription ?? spec.cast?.description)?.trim();
|
|
@@ -32783,14 +32805,20 @@ function adBrandOverlayCss() {
|
|
|
32783
32805
|
" viewBox is wider than it is tall rendered clipped \u2014 the first real ad drew",
|
|
32784
32806
|
" `greenlea`. Constraining the height and letting the width follow keeps any",
|
|
32785
32807
|
" aspect ratio whole, and the max-width stops a very wide mark spanning the frame. */",
|
|
32808
|
+
" /* Legible over ANY picture. A drop shadow alone left a pale mark invisible",
|
|
32809
|
+
" against a bright window or an overcast sky for the first third of an ad;",
|
|
32810
|
+
" a dark, blurred pill behind it reads on both without boxing the mark in. */",
|
|
32786
32811
|
" .brand-mark { position: absolute; top: 90px; left: 56px; height: 64px; width: auto;",
|
|
32787
|
-
" max-width: 420px; object-fit: contain;",
|
|
32788
|
-
"
|
|
32812
|
+
" max-width: 420px; object-fit: contain; padding: 14px 20px; border-radius: 18px;",
|
|
32813
|
+
" background: rgba(0,0,0,0.34); backdrop-filter: blur(6px);",
|
|
32814
|
+
" filter: drop-shadow(0 2px 8px rgba(0,0,0,0.55)); }",
|
|
32789
32815
|
" .endcard { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);",
|
|
32790
32816
|
" display: flex; flex-direction: column; align-items: center; gap: 56px;",
|
|
32791
32817
|
" width: 100%; max-width: 1080px; padding: 0 60px; text-align: center; }",
|
|
32792
|
-
"
|
|
32793
|
-
"
|
|
32818
|
+
" /* Sized to FILL, not merely bounded. Given only max-* constraints an SVG",
|
|
32819
|
+
" renders at its own intrinsic size, and a small viewBox drew a closing mark",
|
|
32820
|
+
" a few dozen pixels tall in the middle of a 1080px frame. */",
|
|
32821
|
+
" .endcard-logo { width: 62%; height: auto; max-height: 460px; object-fit: contain; }",
|
|
32794
32822
|
" /* Capped and wrapping, not sized to its content: measured in a real browser,",
|
|
32795
32823
|
" `GET YOUR FREE QUOTE` renders 948px wide against a 1080px canvas, so the next",
|
|
32796
32824
|
" slightly longer call to action runs off the frame. Two lines beat an edge. */",
|