@koda-sl/baker-cli 0.483.0-dev.6a297fc5c → 0.484.0-dev.31cacb0d1
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/{brief-MNWFEJ3L.js → brief-4WIMY6AT.js} +8 -8
- package/dist/{canvas-TTV7QZZT.js → canvas-YV374OWM.js} +13 -13
- package/dist/{catalog-43BSTAT6.js → catalog-KZNB2YJS.js} +3 -3
- package/dist/{check-545MAB4E.js → check-M2SBGDW6.js} +5 -5
- package/dist/{chunk-RMNKCVRB.js → chunk-2GT76KEX.js} +14 -4
- package/dist/chunk-2GT76KEX.js.map +1 -0
- package/dist/{chunk-TY4BDVLG.js → chunk-3VCHJN2B.js} +6 -3
- package/dist/chunk-3VCHJN2B.js.map +1 -0
- package/dist/{chunk-C7MENOP5.js → chunk-4C55EB4J.js} +6 -6
- package/dist/{chunk-PNVEV3XP.js → chunk-5VJK7NMF.js} +24 -13
- package/dist/chunk-5VJK7NMF.js.map +1 -0
- package/dist/{chunk-3ZHOBEQD.js → chunk-7RPJTHHD.js} +2 -2
- package/dist/{chunk-YU2XIIL3.js → chunk-AQZO3LKT.js} +5 -5
- package/dist/{chunk-ROX7LQRR.js → chunk-C7WPAUIJ.js} +2 -2
- package/dist/{chunk-ZJ6HUCRK.js → chunk-CN4YK7IU.js} +2 -2
- package/dist/{chunk-XF5R2FQT.js → chunk-DBJ3GK5X.js} +13 -13
- package/dist/{chunk-TGIL4L4L.js → chunk-ERYVGW6A.js} +4 -4
- package/dist/{chunk-GJWMPTUE.js → chunk-ET6GJ6OS.js} +2 -2
- package/dist/{chunk-KXSXZAC2.js → chunk-GYJQV3IX.js} +2 -2
- package/dist/{chunk-XFJNCZXA.js → chunk-I5XXOMMR.js} +4 -4
- package/dist/{chunk-REMR5FHD.js → chunk-LHUIYOSF.js} +2 -2
- package/dist/{chunk-QKABEX3F.js → chunk-MP5IMGKF.js} +2 -2
- package/dist/{chunk-GM46ZEYP.js → chunk-O5SMBTBG.js} +3 -3
- package/dist/{chunk-WHSTZRUY.js → chunk-P5ENZXC2.js} +2 -2
- package/dist/{chunk-2WTD5Y34.js → chunk-PPRHZAHX.js} +3 -3
- package/dist/{chunk-UTLIQBRY.js → chunk-SKQCKPBL.js} +3 -3
- package/dist/{chunk-QTLZXIF3.js → chunk-TFJW5CXD.js} +4 -2
- package/dist/chunk-TFJW5CXD.js.map +1 -0
- package/dist/{chunk-U63S2JWI.js → chunk-WY5H3XYC.js} +2 -2
- package/dist/{chunk-64HQDJ2E.js → chunk-YGDJGSJQ.js} +2 -2
- package/dist/{chunk-HNEYIWXW.js → chunk-YSB26POP.js} +29 -11
- package/dist/chunk-YSB26POP.js.map +1 -0
- package/dist/{chunk-TBHRRQZD.js → chunk-ZC6FKVRD.js} +5 -5
- package/dist/{chunk-DDES6J6A.js → chunk-ZTHXYQTZ.js} +4 -4
- package/dist/cli.js +3 -3
- package/dist/{creatives-ZOK7PZSG.js → creatives-4MIF42HZ.js} +10 -10
- package/dist/{critique-OCVV6N3U.js → critique-2RT2HVZY.js} +8 -8
- package/dist/engine/index.d.ts +1 -0
- package/dist/engine/index.js +2 -2
- package/dist/{feedback-GAGIKZ6B.js → feedback-EHBCJT3T.js} +11 -11
- package/dist/{feedback-record-ZORDBRV2.js → feedback-record-5ZCV6YV2.js} +12 -12
- package/dist/{fit-DGCYW7LN.js → fit-XYUZEL5W.js} +5 -5
- package/dist/{ideas-NBQPCC5C.js → ideas-WYNF7WWA.js} +5 -5
- package/dist/{learn-6HVDSTTJ.js → learn-KYO2MAKF.js} +4 -4
- package/dist/{make-EWHS4EHQ.js → make-4RNN3G5H.js} +31 -23
- package/dist/make-4RNN3G5H.js.map +1 -0
- package/dist/{rerun-ETH2NEEX.js → rerun-SBDJBDG7.js} +16 -16
- package/dist/{rules-KEHQEXEU.js → rules-SNLFT4U7.js} +5 -5
- package/dist/{rules-add-IDBWO6XV.js → rules-add-XH6CAHHI.js} +4 -4
- package/dist/{run-FFASB4YB.js → run-7QB7Z3ZK.js} +16 -16
- package/dist/{scaffold-ad-EKCXHZPT.js → scaffold-ad-XL5TJT3Q.js} +13 -13
- package/dist/{scaffold-static-ad-MWKTXATN.js → scaffold-static-ad-OXUYUIHB.js} +20 -20
- package/dist/{scaffold-video-BYPPH352.js → scaffold-video-O5IYM5UG.js} +12 -12
- package/dist/{select-CPFKK57J.js → select-FUVRFVI6.js} +10 -10
- package/dist/{set-prompt-TJ3UTNYS.js → set-prompt-B2OGYEUM.js} +9 -9
- package/dist/{stale-KILEXX57.js → stale-F7POC6G7.js} +9 -9
- package/dist/{sync-definition-DGSAZGQZ.js → sync-definition-WBCK3PQ3.js} +12 -12
- package/dist/{translate-C5LZ6KVN.js → translate-E64XLMG6.js} +13 -13
- package/dist/{validate-KPJLIGYY.js → validate-HB74PHZQ.js} +12 -12
- package/dist/{viewer-check-2GI26EKA.js → viewer-check-EUDPWB3W.js} +6 -6
- package/dist/{winning-ads-6SXA4HGB.js → winning-ads-MET3ZAL7.js} +2 -2
- package/package.json +1 -1
- package/dist/chunk-HNEYIWXW.js.map +0 -1
- package/dist/chunk-PNVEV3XP.js.map +0 -1
- package/dist/chunk-QTLZXIF3.js.map +0 -1
- package/dist/chunk-RMNKCVRB.js.map +0 -1
- package/dist/chunk-TY4BDVLG.js.map +0 -1
- package/dist/make-EWHS4EHQ.js.map +0 -1
- /package/dist/{brief-MNWFEJ3L.js.map → brief-4WIMY6AT.js.map} +0 -0
- /package/dist/{canvas-TTV7QZZT.js.map → canvas-YV374OWM.js.map} +0 -0
- /package/dist/{catalog-43BSTAT6.js.map → catalog-KZNB2YJS.js.map} +0 -0
- /package/dist/{check-545MAB4E.js.map → check-M2SBGDW6.js.map} +0 -0
- /package/dist/{chunk-C7MENOP5.js.map → chunk-4C55EB4J.js.map} +0 -0
- /package/dist/{chunk-3ZHOBEQD.js.map → chunk-7RPJTHHD.js.map} +0 -0
- /package/dist/{chunk-YU2XIIL3.js.map → chunk-AQZO3LKT.js.map} +0 -0
- /package/dist/{chunk-ROX7LQRR.js.map → chunk-C7WPAUIJ.js.map} +0 -0
- /package/dist/{chunk-ZJ6HUCRK.js.map → chunk-CN4YK7IU.js.map} +0 -0
- /package/dist/{chunk-XF5R2FQT.js.map → chunk-DBJ3GK5X.js.map} +0 -0
- /package/dist/{chunk-TGIL4L4L.js.map → chunk-ERYVGW6A.js.map} +0 -0
- /package/dist/{chunk-GJWMPTUE.js.map → chunk-ET6GJ6OS.js.map} +0 -0
- /package/dist/{chunk-KXSXZAC2.js.map → chunk-GYJQV3IX.js.map} +0 -0
- /package/dist/{chunk-XFJNCZXA.js.map → chunk-I5XXOMMR.js.map} +0 -0
- /package/dist/{chunk-REMR5FHD.js.map → chunk-LHUIYOSF.js.map} +0 -0
- /package/dist/{chunk-QKABEX3F.js.map → chunk-MP5IMGKF.js.map} +0 -0
- /package/dist/{chunk-GM46ZEYP.js.map → chunk-O5SMBTBG.js.map} +0 -0
- /package/dist/{chunk-WHSTZRUY.js.map → chunk-P5ENZXC2.js.map} +0 -0
- /package/dist/{chunk-2WTD5Y34.js.map → chunk-PPRHZAHX.js.map} +0 -0
- /package/dist/{chunk-UTLIQBRY.js.map → chunk-SKQCKPBL.js.map} +0 -0
- /package/dist/{chunk-U63S2JWI.js.map → chunk-WY5H3XYC.js.map} +0 -0
- /package/dist/{chunk-64HQDJ2E.js.map → chunk-YGDJGSJQ.js.map} +0 -0
- /package/dist/{chunk-TBHRRQZD.js.map → chunk-ZC6FKVRD.js.map} +0 -0
- /package/dist/{chunk-DDES6J6A.js.map → chunk-ZTHXYQTZ.js.map} +0 -0
- /package/dist/{creatives-ZOK7PZSG.js.map → creatives-4MIF42HZ.js.map} +0 -0
- /package/dist/{critique-OCVV6N3U.js.map → critique-2RT2HVZY.js.map} +0 -0
- /package/dist/{feedback-GAGIKZ6B.js.map → feedback-EHBCJT3T.js.map} +0 -0
- /package/dist/{feedback-record-ZORDBRV2.js.map → feedback-record-5ZCV6YV2.js.map} +0 -0
- /package/dist/{fit-DGCYW7LN.js.map → fit-XYUZEL5W.js.map} +0 -0
- /package/dist/{ideas-NBQPCC5C.js.map → ideas-WYNF7WWA.js.map} +0 -0
- /package/dist/{learn-6HVDSTTJ.js.map → learn-KYO2MAKF.js.map} +0 -0
- /package/dist/{rerun-ETH2NEEX.js.map → rerun-SBDJBDG7.js.map} +0 -0
- /package/dist/{rules-KEHQEXEU.js.map → rules-SNLFT4U7.js.map} +0 -0
- /package/dist/{rules-add-IDBWO6XV.js.map → rules-add-XH6CAHHI.js.map} +0 -0
- /package/dist/{run-FFASB4YB.js.map → run-7QB7Z3ZK.js.map} +0 -0
- /package/dist/{scaffold-ad-EKCXHZPT.js.map → scaffold-ad-XL5TJT3Q.js.map} +0 -0
- /package/dist/{scaffold-static-ad-MWKTXATN.js.map → scaffold-static-ad-OXUYUIHB.js.map} +0 -0
- /package/dist/{scaffold-video-BYPPH352.js.map → scaffold-video-O5IYM5UG.js.map} +0 -0
- /package/dist/{select-CPFKK57J.js.map → select-FUVRFVI6.js.map} +0 -0
- /package/dist/{set-prompt-TJ3UTNYS.js.map → set-prompt-B2OGYEUM.js.map} +0 -0
- /package/dist/{stale-KILEXX57.js.map → stale-F7POC6G7.js.map} +0 -0
- /package/dist/{sync-definition-DGSAZGQZ.js.map → sync-definition-WBCK3PQ3.js.map} +0 -0
- /package/dist/{translate-C5LZ6KVN.js.map → translate-E64XLMG6.js.map} +0 -0
- /package/dist/{validate-KPJLIGYY.js.map → validate-HB74PHZQ.js.map} +0 -0
- /package/dist/{viewer-check-2GI26EKA.js.map → viewer-check-EUDPWB3W.js.map} +0 -0
- /package/dist/{winning-ads-6SXA4HGB.js.map → winning-ads-MET3ZAL7.js.map} +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
parseRefExpr
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-TFJW5CXD.js";
|
|
4
4
|
import {
|
|
5
5
|
collectAssetRefLikes,
|
|
6
6
|
isPersistedAssetRef
|
|
@@ -164,4 +164,4 @@ export {
|
|
|
164
164
|
buildInitialRunRecord,
|
|
165
165
|
buildFailedRunRecord
|
|
166
166
|
};
|
|
167
|
-
//# sourceMappingURL=chunk-
|
|
167
|
+
//# sourceMappingURL=chunk-WY5H3XYC.js.map
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
RULE_STRENGTHS,
|
|
5
5
|
declaredRules,
|
|
6
6
|
readLearnedRules
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-3VCHJN2B.js";
|
|
8
8
|
import {
|
|
9
9
|
readWorkspaceBrandDoc
|
|
10
10
|
} from "./chunk-RGX7AQ2K.js";
|
|
@@ -341,4 +341,4 @@ export {
|
|
|
341
341
|
workspaceOfCreative,
|
|
342
342
|
avoidOf
|
|
343
343
|
};
|
|
344
|
-
//# sourceMappingURL=chunk-
|
|
344
|
+
//# sourceMappingURL=chunk-YGDJGSJQ.js.map
|
|
@@ -47,7 +47,7 @@ import {
|
|
|
47
47
|
usesTextColour,
|
|
48
48
|
validateCanvas,
|
|
49
49
|
validateCanvasDeep
|
|
50
|
-
} from "./chunk-
|
|
50
|
+
} from "./chunk-TFJW5CXD.js";
|
|
51
51
|
import {
|
|
52
52
|
FRAME_CUT,
|
|
53
53
|
bandViolations,
|
|
@@ -3542,6 +3542,7 @@ function moveBand(g, move) {
|
|
|
3542
3542
|
import sharp3 from "sharp";
|
|
3543
3543
|
var FIT_HEADROOM = 0.01;
|
|
3544
3544
|
var MIN_FIT_SCALE = 0.85;
|
|
3545
|
+
var MIN_FLAT_FIT_SCALE = 0.65;
|
|
3545
3546
|
function boxesToPlace(boxes, format, opts = {}) {
|
|
3546
3547
|
if (!opts.copy) return [...boxes];
|
|
3547
3548
|
const placements = blockingPlacements(opts.placements);
|
|
@@ -3552,9 +3553,16 @@ function boxesToPlace(boxes, format, opts = {}) {
|
|
|
3552
3553
|
const buttons = new Set(opts.copy.filter(isButtonLine).flatMap((line) => boxesOfLine(line, read)));
|
|
3553
3554
|
return shownBoxes(read, opts.copy, (box) => !past2(box)).filter((shown) => !shown.supporting || cut(shown.box)).map((shown) => buttons.has(shown.box) ? buttonShape(shown.box) : shown.box);
|
|
3554
3555
|
}
|
|
3556
|
+
function targetArea(format, placements) {
|
|
3557
|
+
const area2 = blockingArea(format, placements);
|
|
3558
|
+
const covered = area2.covered;
|
|
3559
|
+
if (!covered) return area2;
|
|
3560
|
+
return { ...area2, top: covered.top, bottom: covered.bottom, ...covered.rail ? { rail: covered.rail } : {} };
|
|
3561
|
+
}
|
|
3555
3562
|
function planSafeFit(boxes, format, opts = {}) {
|
|
3556
|
-
const area2 =
|
|
3557
|
-
|
|
3563
|
+
const area2 = targetArea(format, opts.placements);
|
|
3564
|
+
const violations = bandViolations(boxes, format, { placements: blockingPlacements(opts.placements) });
|
|
3565
|
+
if (!violations.some((v) => v.covered || v.clearance <= FRAME_CUT)) return null;
|
|
3558
3566
|
const rail = area2.rail && boxes.some((b) => b.y1 > (area2.rail?.from ?? 1)) ? area2.rail.width : 0;
|
|
3559
3567
|
const union = {
|
|
3560
3568
|
x0: Math.min(...boxes.map((b) => b.x0)),
|
|
@@ -3608,7 +3616,7 @@ var PLAIN_DEPTH = 0.03;
|
|
|
3608
3616
|
var PLAIN_DEPTH_STEP = 36;
|
|
3609
3617
|
var PLAIN_JUMP = 60;
|
|
3610
3618
|
var PLAIN_JUMPS = 2;
|
|
3611
|
-
function
|
|
3619
|
+
function edgeBorders(img, side) {
|
|
3612
3620
|
const along = side === "top" || side === "bottom" ? img.width : img.height;
|
|
3613
3621
|
const across2 = side === "top" || side === "bottom" ? img.height : img.width;
|
|
3614
3622
|
const depth = Math.max(1, Math.round(PLAIN_DEPTH * across2));
|
|
@@ -3625,10 +3633,20 @@ function plainEdge(img, side) {
|
|
|
3625
3633
|
};
|
|
3626
3634
|
let jumps = 0;
|
|
3627
3635
|
for (let i = 0; i < along; i++) {
|
|
3628
|
-
for (let d = 1; d <= depth; d++) if (step(at2(i, 0), at2(i, d)) > PLAIN_DEPTH_STEP) return
|
|
3636
|
+
for (let d = 1; d <= depth; d++) if (step(at2(i, 0), at2(i, d)) > PLAIN_DEPTH_STEP) return null;
|
|
3629
3637
|
if (i > 0 && step(at2(i - 1, 0), at2(i, 0)) > PLAIN_JUMP) jumps++;
|
|
3630
3638
|
}
|
|
3631
|
-
return jumps
|
|
3639
|
+
return jumps;
|
|
3640
|
+
}
|
|
3641
|
+
function plainEdge(img, side) {
|
|
3642
|
+
const borders = edgeBorders(img, side);
|
|
3643
|
+
return borders !== null && borders <= PLAIN_JUMPS;
|
|
3644
|
+
}
|
|
3645
|
+
async function minFitScale(image) {
|
|
3646
|
+
const { data, info } = await sharp3(image).removeAlpha().raw().toBuffer({ resolveWithObject: true });
|
|
3647
|
+
const raw = { data, width: info.width, height: info.height, channels: info.channels };
|
|
3648
|
+
const flat = ["top", "bottom", "left", "right"].every((side) => edgeBorders(raw, side) === 0);
|
|
3649
|
+
return flat ? MIN_FLAT_FIT_SCALE : MIN_FIT_SCALE;
|
|
3632
3650
|
}
|
|
3633
3651
|
async function fitPicture(image, fit) {
|
|
3634
3652
|
const { width = 0, height = 0 } = await sharp3(image).metadata();
|
|
@@ -7392,8 +7410,8 @@ var staticSafeFitNode = defineNode({
|
|
|
7392
7410
|
version: "1.0.0",
|
|
7393
7411
|
category: "image",
|
|
7394
7412
|
location: "local",
|
|
7395
|
-
summary: "Bring a finished static ad's words and logo inside the band its placement leaves clear (the Stories header, the Reels footer) without rendering again: reads where every line and the logo sit, then shrinks the picture a little (to 85%
|
|
7396
|
-
when_to_use: "Scaffolded by `baker canvas scaffold-static-ad` after every 9:16 size (`safe_<size>`, role `static_safe_fit`). Free, besides one box-reader call (about $0.005, carried on the run record's review spend). A layout too tall or wide for the band at
|
|
7413
|
+
summary: "Bring a finished static ad's words and logo inside the band its placement leaves clear (the Stories header, the Reels footer) without rendering again: reads where every line and the logo sit, then shrinks the picture a little (to 85%, or 65% on one flat ground) and shifts it, carrying its plain edge into the uncovered margin. Outputs the same pixel size; `fit` is the scale and position used, or null with `reason` when the picture is passed on unchanged.",
|
|
7414
|
+
when_to_use: "Scaffolded by `baker canvas scaffold-static-ad` after every 9:16 size (`safe_<size>`, role `static_safe_fit`). Free, besides one box-reader call (about $0.005, carried on the run record's review spend). A layout too tall or wide for the band at that scale, or whose edge is busy (cards, leaves, a scene that would smear), is passed on unchanged: the review still names what Reels or Stories covers, and the layout itself has to change (shorter copy, fewer lines).",
|
|
7397
7415
|
inputs: z20.object({ image: ImageRef }).strict(),
|
|
7398
7416
|
// `placements` are the ones the canvas's sizes were planned with (the ad set's), so the band
|
|
7399
7417
|
// the fit clears is the one the review holds the size to.
|
|
@@ -7423,9 +7441,9 @@ var staticSafeFitNode = defineNode({
|
|
|
7423
7441
|
...placements,
|
|
7424
7442
|
...params.copy ? { copy: params.copy } : {}
|
|
7425
7443
|
});
|
|
7426
|
-
const fit = planSafeFit(boxes, params.format, placements);
|
|
7444
|
+
const fit = planSafeFit(boxes, params.format, { ...placements, minScale: await minFitScale(bytes) });
|
|
7427
7445
|
if (!fit) {
|
|
7428
|
-
const outside =
|
|
7446
|
+
const outside = planSafeFit(boxes, params.format, { ...placements, minScale: 0 }) !== null;
|
|
7429
7447
|
return {
|
|
7430
7448
|
image: inputs.image,
|
|
7431
7449
|
fit: null,
|
|
@@ -8893,4 +8911,4 @@ export {
|
|
|
8893
8911
|
defaultRegistry,
|
|
8894
8912
|
createEngineFromEnv
|
|
8895
8913
|
};
|
|
8896
|
-
//# sourceMappingURL=chunk-
|
|
8914
|
+
//# sourceMappingURL=chunk-YSB26POP.js.map
|