@cliangdev/conductor 0.51.0 → 0.52.0
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/assets/claude/agents/conductor-marketing-art-director.md +2 -1
- package/assets/claude/skills/conductor-marketing-create/SKILL.md +12 -2
- package/assets/claude/skills/conductor-marketing-create/references/capabilities.md +9 -2
- package/assets/claude/skills/conductor-marketing-create/references/direct.md +39 -6
- package/assets/claude/skills/conductor-marketing-create/references/platform-specs.md +15 -4
- package/assets/claude/skills/conductor-marketing-create/references/shotlist-template.md +2 -2
- package/assets/claude/skills/conductor-marketing-create/references/slideshow-formats.md +2 -1
- package/assets/claude/skills/conductor-marketing-create/references/team-run.md +3 -3
- package/assets/cli-manifest.json +4 -4
- package/dist/creative/assertions.js +30 -3
- package/dist/creative/frame.js +2 -2
- package/dist/creative/job/media.mjs +2 -2
- package/dist/creative/job/render.mjs +3 -0
- package/dist/creative/placements.js +2 -2
- package/dist/creative/placements.json +3 -3
- package/dist/creative/render.js +20 -8
- package/dist/lib/creative-render.d.ts +14 -1
- package/dist/lib/creative-render.d.ts.map +1 -1
- package/dist/lib/creative-render.js +3 -1
- package/dist/lib/creative-render.js.map +1 -1
- package/dist/lib/safe-zone/check.d.ts +31 -0
- package/dist/lib/safe-zone/check.d.ts.map +1 -0
- package/dist/lib/safe-zone/check.js +267 -0
- package/dist/lib/safe-zone/check.js.map +1 -0
- package/dist/lib/safe-zone/frames.d.ts +35 -0
- package/dist/lib/safe-zone/frames.d.ts.map +1 -0
- package/dist/lib/safe-zone/frames.js +132 -0
- package/dist/lib/safe-zone/frames.js.map +1 -0
- package/dist/lib/safe-zone/ocr.d.ts +42 -0
- package/dist/lib/safe-zone/ocr.d.ts.map +1 -0
- package/dist/lib/safe-zone/ocr.js +139 -0
- package/dist/lib/safe-zone/ocr.js.map +1 -0
- package/dist/lib/safe-zone/overlay.d.ts +59 -0
- package/dist/lib/safe-zone/overlay.d.ts.map +1 -0
- package/dist/lib/safe-zone/overlay.js +283 -0
- package/dist/lib/safe-zone/overlay.js.map +1 -0
- package/dist/lib/safe-zone/zones.d.ts +46 -0
- package/dist/lib/safe-zone/zones.d.ts.map +1 -0
- package/dist/lib/safe-zone/zones.js +84 -0
- package/dist/lib/safe-zone/zones.js.map +1 -0
- package/dist/lib/slideshow/compose.d.ts +2 -0
- package/dist/lib/slideshow/compose.d.ts.map +1 -1
- package/dist/lib/slideshow/compose.js +1 -1
- package/dist/lib/slideshow/compose.js.map +1 -1
- package/dist/lib/slideshow/css.d.ts +2 -0
- package/dist/lib/slideshow/css.d.ts.map +1 -1
- package/dist/lib/slideshow/css.js +9 -5
- package/dist/lib/slideshow/css.js.map +1 -1
- package/dist/lib/slideshow/html.d.ts +12 -3
- package/dist/lib/slideshow/html.d.ts.map +1 -1
- package/dist/lib/slideshow/html.js +16 -10
- package/dist/lib/slideshow/html.js.map +1 -1
- package/dist/lib/slideshow/spec-transport.d.ts.map +1 -1
- package/dist/lib/slideshow/spec-transport.js +4 -2
- package/dist/lib/slideshow/spec-transport.js.map +1 -1
- package/dist/lib/slideshow/spec.d.ts +8 -0
- package/dist/lib/slideshow/spec.d.ts.map +1 -1
- package/dist/lib/slideshow/spec.js +6 -0
- package/dist/lib/slideshow/spec.js.map +1 -1
- package/dist/lib/slideshow-pacing.d.ts +46 -0
- package/dist/lib/slideshow-pacing.d.ts.map +1 -0
- package/dist/lib/slideshow-pacing.js +98 -0
- package/dist/lib/slideshow-pacing.js.map +1 -0
- package/dist/mcp/index.d.ts +437 -6
- package/dist/mcp/index.d.ts.map +1 -1
- package/dist/mcp/index.js +24 -10
- package/dist/mcp/index.js.map +1 -1
- package/dist/mcp/tools/creative-drafts.d.ts +16 -2
- package/dist/mcp/tools/creative-drafts.d.ts.map +1 -1
- package/dist/mcp/tools/creative-drafts.js +237 -31
- package/dist/mcp/tools/creative-drafts.js.map +1 -1
- package/dist/mcp/tools/creatives.d.ts +12 -3
- package/dist/mcp/tools/creatives.d.ts.map +1 -1
- package/dist/mcp/tools/creatives.js +235 -17
- package/dist/mcp/tools/creatives.js.map +1 -1
- package/dist/mcp/tools/safe-zone-pixels.d.ts +165 -0
- package/dist/mcp/tools/safe-zone-pixels.d.ts.map +1 -0
- package/dist/mcp/tools/safe-zone-pixels.js +300 -0
- package/dist/mcp/tools/safe-zone-pixels.js.map +1 -0
- package/dist/mcp/tools/slideshow-render.d.ts.map +1 -1
- package/dist/mcp/tools/slideshow-render.js +3 -1
- package/dist/mcp/tools/slideshow-render.js.map +1 -1
- package/package.json +4 -2
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A small OCR wrapper over tesseract.js. English data ships with the package (@tesseract.js-data/eng,
|
|
3
|
+
* the small integer "best_int" model), so nothing is downloaded at run time. One worker is created on
|
|
4
|
+
* first use and reused. Crops are read as they are and inverted (light-on-dark and dark-on-light).
|
|
5
|
+
*/
|
|
6
|
+
import { spawn } from 'node:child_process';
|
|
7
|
+
import { createRequire } from 'node:module';
|
|
8
|
+
import { tmpdir } from 'node:os';
|
|
9
|
+
import { dirname, join } from 'node:path';
|
|
10
|
+
import { readImageDimensions } from '../image-dimensions.js';
|
|
11
|
+
import { resolveFfmpegPath } from '../media-probe.js';
|
|
12
|
+
const require = createRequire(import.meta.url);
|
|
13
|
+
/** Thrown when the OCR engine cannot load or run. */
|
|
14
|
+
export class OcrUnavailable extends Error {
|
|
15
|
+
/** `engineDown`: the engine itself could not start (so no later image will read either). */
|
|
16
|
+
constructor(reason, engineDown = false) {
|
|
17
|
+
super(reason);
|
|
18
|
+
this.engineDown = engineDown;
|
|
19
|
+
this.name = 'OcrUnavailable';
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
export const MIN_CONFIDENCE = 70;
|
|
23
|
+
export const MIN_WORD_CHARS = 2;
|
|
24
|
+
export const MIN_BOX_HEIGHT_1080 = 16;
|
|
25
|
+
let workerPromise;
|
|
26
|
+
/** The folder with eng.traineddata.gz (the small integer model). */
|
|
27
|
+
function langPath() {
|
|
28
|
+
const pkg = require.resolve('@tesseract.js-data/eng/package.json');
|
|
29
|
+
return join(dirname(pkg), '4.0.0_best_int');
|
|
30
|
+
}
|
|
31
|
+
async function getWorker() {
|
|
32
|
+
workerPromise ?? (workerPromise = (async () => {
|
|
33
|
+
try {
|
|
34
|
+
const { createWorker, PSM } = (await import('tesseract.js'));
|
|
35
|
+
const worker = await createWorker('eng', 1, {
|
|
36
|
+
langPath: langPath(),
|
|
37
|
+
gzip: true,
|
|
38
|
+
cacheMethod: 'none', // never write language data into the user's cwd
|
|
39
|
+
cachePath: join(tmpdir(), 'conductor-tesseract'),
|
|
40
|
+
});
|
|
41
|
+
await worker.setParameters({ tessedit_pageseg_mode: PSM?.SPARSE_TEXT ?? '11', user_defined_dpi: '300' });
|
|
42
|
+
return worker;
|
|
43
|
+
}
|
|
44
|
+
catch (e) {
|
|
45
|
+
throw new OcrUnavailable(`OCR engine failed to load: ${e.message}`, true);
|
|
46
|
+
}
|
|
47
|
+
})());
|
|
48
|
+
workerPromise.catch(() => { workerPromise = undefined; });
|
|
49
|
+
return workerPromise;
|
|
50
|
+
}
|
|
51
|
+
/** Stops the shared worker (tests and shutdown). */
|
|
52
|
+
export async function closeOcr() {
|
|
53
|
+
const p = workerPromise;
|
|
54
|
+
workerPromise = undefined;
|
|
55
|
+
if (p)
|
|
56
|
+
await (await p.catch(() => undefined))?.terminate();
|
|
57
|
+
}
|
|
58
|
+
/** Crops a PNG and inverts its colours with ffmpeg, returning a PNG. */
|
|
59
|
+
async function cropInverted(png, rect) {
|
|
60
|
+
const ffmpeg = await resolveFfmpegPath();
|
|
61
|
+
const filters = [rect ? `crop=${rect.width}:${rect.height}:${rect.left}:${rect.top}` : undefined, 'negate'].filter(Boolean).join(',');
|
|
62
|
+
return new Promise((resolve, reject) => {
|
|
63
|
+
const child = spawn(ffmpeg, ['-v', 'error', '-i', 'pipe:0', '-vf', filters, '-frames:v', '1', '-f', 'image2pipe', '-c:v', 'png', 'pipe:1']);
|
|
64
|
+
const chunks = [];
|
|
65
|
+
child.stdout.on('data', (d) => chunks.push(d));
|
|
66
|
+
child.on('error', reject);
|
|
67
|
+
child.on('close', (code) => (code === 0 ? resolve(Buffer.concat(chunks)) : reject(new Error(`ffmpeg exited ${code}`))));
|
|
68
|
+
child.stdin.on('error', () => { });
|
|
69
|
+
child.stdin.end(png);
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
/** Runs one recognition pass. With `rectangle`, tesseract reports boxes in full-image coordinates. */
|
|
73
|
+
async function readOnce(worker, image, rectangle) {
|
|
74
|
+
const { data } = await worker.recognize(image, rectangle ? { rectangle } : {}, { blocks: true });
|
|
75
|
+
const words = [];
|
|
76
|
+
for (const b of data.blocks ?? [])
|
|
77
|
+
for (const p of b.paragraphs)
|
|
78
|
+
for (const l of p.lines)
|
|
79
|
+
for (const w of l.words)
|
|
80
|
+
words.push({
|
|
81
|
+
text: w.text.trim(),
|
|
82
|
+
confidence: w.confidence,
|
|
83
|
+
box: { x: w.bbox.x0, y: w.bbox.y0, w: w.bbox.x1 - w.bbox.x0, h: w.bbox.y1 - w.bbox.y0 },
|
|
84
|
+
});
|
|
85
|
+
return words;
|
|
86
|
+
}
|
|
87
|
+
/** Drops low-confidence, tiny and non-word results. `imageWidth` scales the 16 px minimum height. */
|
|
88
|
+
export function filterWords(words, imageWidth) {
|
|
89
|
+
const minH = (MIN_BOX_HEIGHT_1080 * imageWidth) / 1080;
|
|
90
|
+
return words.filter((w) => w.confidence >= MIN_CONFIDENCE && (w.text.match(/[\p{L}\p{N}]/gu)?.length ?? 0) >= MIN_WORD_CHARS && w.box.h >= minH);
|
|
91
|
+
}
|
|
92
|
+
function iou(a, b) {
|
|
93
|
+
const w = Math.min(a.x + a.w, b.x + b.w) - Math.max(a.x, b.x);
|
|
94
|
+
const h = Math.min(a.y + a.h, b.y + b.h) - Math.max(a.y, b.y);
|
|
95
|
+
if (w <= 0 || h <= 0)
|
|
96
|
+
return 0;
|
|
97
|
+
const inter = w * h;
|
|
98
|
+
return inter / (a.w * a.h + b.w * b.h - inter);
|
|
99
|
+
}
|
|
100
|
+
/** Merges words found by both passes: overlapping boxes count once, keeping the more confident one. */
|
|
101
|
+
export function dedupeWords(words) {
|
|
102
|
+
const kept = [];
|
|
103
|
+
for (const w of [...words].sort((a, b) => b.confidence - a.confidence))
|
|
104
|
+
if (!kept.some((k) => iou(k.box, w.box) > 0.4))
|
|
105
|
+
kept.push(w);
|
|
106
|
+
return kept.sort((a, b) => a.box.y - b.box.y || a.box.x - b.box.x);
|
|
107
|
+
}
|
|
108
|
+
/** The tesseract engine: as-is and inverted passes, filtered and merged. */
|
|
109
|
+
export function createTesseractEngine() {
|
|
110
|
+
return {
|
|
111
|
+
async recognizeWords(png, rect) {
|
|
112
|
+
const width = readImageDimensions(png)?.width ?? 1080;
|
|
113
|
+
try {
|
|
114
|
+
const worker = await getWorker();
|
|
115
|
+
const plain = await readOnce(worker, png, rect);
|
|
116
|
+
const inverted = (await readOnce(worker, await cropInverted(png, rect))).map((w) => ({
|
|
117
|
+
...w,
|
|
118
|
+
box: { ...w.box, x: w.box.x + (rect?.left ?? 0), y: w.box.y + (rect?.top ?? 0) },
|
|
119
|
+
}));
|
|
120
|
+
return dedupeWords(filterWords([...plain, ...inverted], width));
|
|
121
|
+
}
|
|
122
|
+
catch (e) {
|
|
123
|
+
if (e instanceof OcrUnavailable)
|
|
124
|
+
throw e;
|
|
125
|
+
throw new OcrUnavailable(`OCR failed: ${e.message}`);
|
|
126
|
+
}
|
|
127
|
+
},
|
|
128
|
+
};
|
|
129
|
+
}
|
|
130
|
+
let defaultEngine;
|
|
131
|
+
/** The shared tesseract engine. */
|
|
132
|
+
export function getDefaultEngine() {
|
|
133
|
+
return (defaultEngine ?? (defaultEngine = createTesseractEngine()));
|
|
134
|
+
}
|
|
135
|
+
/** Reads words with the default engine. Boxes are in full-image coordinates. */
|
|
136
|
+
export function recognizeWords(png, rect) {
|
|
137
|
+
return getDefaultEngine().recognizeWords(png, rect);
|
|
138
|
+
}
|
|
139
|
+
//# sourceMappingURL=ocr.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ocr.js","sourceRoot":"","sources":["../../../src/lib/safe-zone/ocr.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAA;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AAC3C,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAA;AAChC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AACzC,OAAO,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAA;AAC5D,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAA;AAErD,MAAM,OAAO,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;AAoB9C,qDAAqD;AACrD,MAAM,OAAO,cAAe,SAAQ,KAAK;IACvC,4FAA4F;IAC5F,YAAY,MAAc,EAAW,aAAa,KAAK;QACrD,KAAK,CAAC,MAAM,CAAC,CAAA;QADsB,eAAU,GAAV,UAAU,CAAQ;QAErD,IAAI,CAAC,IAAI,GAAG,gBAAgB,CAAA;IAC9B,CAAC;CACF;AAED,MAAM,CAAC,MAAM,cAAc,GAAG,EAAE,CAAA;AAChC,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,CAAA;AAC/B,MAAM,CAAC,MAAM,mBAAmB,GAAG,EAAE,CAAA;AASrC,IAAI,aAAmD,CAAA;AAEvD,oEAAoE;AACpE,SAAS,QAAQ;IACf,MAAM,GAAG,GAAG,OAAO,CAAC,OAAO,CAAC,qCAAqC,CAAC,CAAA;IAClE,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE,gBAAgB,CAAC,CAAA;AAC7C,CAAC;AAED,KAAK,UAAU,SAAS;IACtB,aAAa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,CAAC,WAAW,CAAC,CAAC,GAAG,KAAK,EAAE,GAAG,QAAQ,CAAC,EAAE,KAAK,CAAC,CAAC,CAAA;YACjE,CAAC;YAAC,OAAO,CAAC,EAAE,CAAC;gBACX,IAAI,CAAC,YAAY,cAAc;oBAAE,MAAM,CAAC,CAAA;gBACxC,MAAM,IAAI,cAAc,CAAC,eAAgB,CAAW,CAAC,OAAO,EAAE,CAAC,CAAA;YACjE,CAAC;QACH,CAAC;KACF,CAAA;AACH,CAAC;AAED,IAAI,aAAoC,CAAA;AAExC,mCAAmC;AACnC,MAAM,UAAU,gBAAgB;IAC9B,OAAO,CAAC,aAAa,KAAb,aAAa,GAAK,qBAAqB,EAAE,EAAC,CAAA;AACpD,CAAC;AAED,gFAAgF;AAChF,MAAM,UAAU,cAAc,CAAC,GAAW,EAAE,IAAc;IACxD,OAAO,gBAAgB,EAAE,CAAC,cAAc,CAAC,GAAG,EAAE,IAAI,CAAC,CAAA;AACrD,CAAC"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { type BrowserFactory } from '../creative-browser.js';
|
|
2
|
+
export type OverlayPlatform = 'instagram' | 'tiktok';
|
|
3
|
+
export interface OverlayFrame {
|
|
4
|
+
/** Image bytes, or a path to an image file (PNG or JPEG). */
|
|
5
|
+
png: Buffer | string;
|
|
6
|
+
/** Caption drawn under the frame, e.g. "Slide 1", "0.5 s", "Cut at 4.2 s". */
|
|
7
|
+
label: string;
|
|
8
|
+
}
|
|
9
|
+
export interface OverlayOptions {
|
|
10
|
+
browser?: BrowserFactory;
|
|
11
|
+
}
|
|
12
|
+
export declare const OVERLAY_REF: {
|
|
13
|
+
readonly width: 1080;
|
|
14
|
+
readonly height: 1920;
|
|
15
|
+
};
|
|
16
|
+
export declare const OVERLAY_ZONES: {
|
|
17
|
+
readonly top: 290;
|
|
18
|
+
readonly bottom: 1490;
|
|
19
|
+
readonly rightX: 918;
|
|
20
|
+
readonly rightY0: 576;
|
|
21
|
+
readonly rightY1: 1632;
|
|
22
|
+
};
|
|
23
|
+
/**
|
|
24
|
+
* The page for a contact sheet (title bar, frames in rows of up to 6) or, with `single`, one bare frame
|
|
25
|
+
* at 540x960. Pure: images arrive as data URLs.
|
|
26
|
+
*/
|
|
27
|
+
export declare function overlayHtml(frames: Array<{
|
|
28
|
+
dataUrl: string;
|
|
29
|
+
label: string;
|
|
30
|
+
}>, platform: OverlayPlatform, opts?: {
|
|
31
|
+
single?: boolean;
|
|
32
|
+
}): string;
|
|
33
|
+
/**
|
|
34
|
+
* One browser for many renders. `factory` launches lazily on first use (so a run that never draws
|
|
35
|
+
* launches nothing), every later call reuses that browser, and the `close()` of the browsers it hands
|
|
36
|
+
* out does nothing; call `closeAll()` once, in a finally, to really close it.
|
|
37
|
+
*/
|
|
38
|
+
export declare function sharedBrowser(base?: BrowserFactory): {
|
|
39
|
+
factory: BrowserFactory;
|
|
40
|
+
closeAll: () => Promise<void>;
|
|
41
|
+
};
|
|
42
|
+
/** One 540x960 JPEG per frame, with the platform chrome drawn on top. All frames share one page. */
|
|
43
|
+
export declare function renderOverlayFrames(frames: OverlayFrame[], platform: OverlayPlatform, opts?: OverlayOptions): Promise<Buffer[]>;
|
|
44
|
+
/** All frames in one JPEG sheet: a title bar naming the platform, a single row (wrapping after 6). */
|
|
45
|
+
export declare function composeOverlaySheet(frames: OverlayFrame[], platform: OverlayPlatform, opts?: OverlayOptions & {
|
|
46
|
+
maxPerSheet?: number;
|
|
47
|
+
}): Promise<{
|
|
48
|
+
data: Buffer;
|
|
49
|
+
mimeType: 'image/jpeg';
|
|
50
|
+
}>;
|
|
51
|
+
/** Writes `<baseName>-ui-<platform>.jpg` per platform into outDir. */
|
|
52
|
+
export declare function overlaySheetsFor(frames: OverlayFrame[], platforms: OverlayPlatform[], outDir: string, baseName: string, opts?: OverlayOptions & {
|
|
53
|
+
maxPerSheet?: number;
|
|
54
|
+
}): Promise<Array<{
|
|
55
|
+
platform: OverlayPlatform;
|
|
56
|
+
file: string;
|
|
57
|
+
bytes: number;
|
|
58
|
+
}>>;
|
|
59
|
+
//# sourceMappingURL=overlay.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"overlay.d.ts","sourceRoot":"","sources":["../../../src/lib/safe-zone/overlay.ts"],"names":[],"mappings":"AASA,OAAO,EAAsB,KAAK,cAAc,EAAE,MAAM,wBAAwB,CAAA;AAEhF,MAAM,MAAM,eAAe,GAAG,WAAW,GAAG,QAAQ,CAAA;AACpD,MAAM,WAAW,YAAY;IAC3B,6DAA6D;IAC7D,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;IACpB,8EAA8E;IAC9E,KAAK,EAAE,MAAM,CAAA;CACd;AACD,MAAM,WAAW,cAAc;IAC7B,OAAO,CAAC,EAAE,cAAc,CAAA;CACzB;AAGD,eAAO,MAAM,WAAW;;;CAAoD,CAAA;AAC5E,eAAO,MAAM,aAAa;;;;;;CAAkH,CAAA;AA0L5I;;;GAGG;AACH,wBAAgB,WAAW,CACzB,MAAM,EAAE,KAAK,CAAC;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC,EACjD,QAAQ,EAAE,eAAe,EACzB,IAAI,GAAE;IAAE,MAAM,CAAC,EAAE,OAAO,CAAA;CAAO,GAC9B,MAAM,CAkBR;AAsBD;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,IAAI,CAAC,EAAE,cAAc,GAAG;IAAE,OAAO,EAAE,cAAc,CAAC;IAAC,QAAQ,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAA;CAAE,CA4B/G;AAED,oGAAoG;AACpG,wBAAsB,mBAAmB,CACvC,MAAM,EAAE,YAAY,EAAE,EACtB,QAAQ,EAAE,eAAe,EACzB,IAAI,CAAC,EAAE,cAAc,GACpB,OAAO,CAAC,MAAM,EAAE,CAAC,CAWnB;AAED,sGAAsG;AACtG,wBAAsB,mBAAmB,CACvC,MAAM,EAAE,YAAY,EAAE,EACtB,QAAQ,EAAE,eAAe,EACzB,IAAI,CAAC,EAAE,cAAc,GAAG;IAAE,WAAW,CAAC,EAAE,MAAM,CAAA;CAAE,GAC/C,OAAO,CAAC;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,YAAY,CAAA;CAAE,CAAC,CAYnD;AAED,sEAAsE;AACtE,wBAAsB,gBAAgB,CACpC,MAAM,EAAE,YAAY,EAAE,EACtB,SAAS,EAAE,eAAe,EAAE,EAC5B,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,MAAM,EAChB,IAAI,CAAC,EAAE,cAAc,GAAG;IAAE,WAAW,CAAC,EAAE,MAAM,CAAA;CAAE,GAC/C,OAAO,CAAC,KAAK,CAAC;IAAE,QAAQ,EAAE,eAAe,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC,CAAC,CAgB5E"}
|
|
@@ -0,0 +1,283 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Draws approximate Instagram Reels / TikTok chrome (header, action column, caption block) over 9:16
|
|
3
|
+
* frames so the person approving a draft sees what the viewer sees, and composes the result into one
|
|
4
|
+
* contact sheet. Everything is inline SVG/CSS rendered by Playwright; the glyphs are generic, not the
|
|
5
|
+
* apps' real artwork, and every sheet says "(approximate)".
|
|
6
|
+
*/
|
|
7
|
+
import { mkdir, readFile, writeFile } from 'node:fs/promises';
|
|
8
|
+
import { join } from 'node:path';
|
|
9
|
+
import { BOTTOM_EDGE, REF_HEIGHT, REF_WIDTH, RIGHT_EDGE, RIGHT_Y_MAX, RIGHT_Y_MIN, TOP_EDGE } from './zones.js';
|
|
10
|
+
import { findBrowserFactory } from '../creative-browser.js';
|
|
11
|
+
// The zone outlines come from zones.ts, so they are the checker's zones by construction.
|
|
12
|
+
export const OVERLAY_REF = { width: REF_WIDTH, height: REF_HEIGHT };
|
|
13
|
+
export const OVERLAY_ZONES = { top: TOP_EDGE, bottom: BOTTOM_EDGE, rightX: RIGHT_EDGE, rightY0: RIGHT_Y_MIN, rightY1: RIGHT_Y_MAX };
|
|
14
|
+
const FRAME_W = 540;
|
|
15
|
+
const FRAME_H = 960;
|
|
16
|
+
const SHEET_FRAME_W = 320;
|
|
17
|
+
const SHEET_FRAME_H = 569;
|
|
18
|
+
const PER_ROW = 6;
|
|
19
|
+
const PLATFORM_TITLE = {
|
|
20
|
+
instagram: 'Instagram Reels UI (approximate)',
|
|
21
|
+
tiktok: 'TikTok UI (approximate)',
|
|
22
|
+
};
|
|
23
|
+
const esc = (s) => s.replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>').replace(/"/g, '"');
|
|
24
|
+
const pct = (n, of) => `${+((n / of) * 100).toFixed(3)}%`;
|
|
25
|
+
// ---- image helpers ---------------------------------------------------------------------------
|
|
26
|
+
function imageSize(buf) {
|
|
27
|
+
if (buf.length > 24 && buf.readUInt32BE(0) === 0x89504e47) {
|
|
28
|
+
return { width: buf.readUInt32BE(16), height: buf.readUInt32BE(20), mime: 'image/png' };
|
|
29
|
+
}
|
|
30
|
+
if (buf.length > 4 && buf[0] === 0xff && buf[1] === 0xd8) {
|
|
31
|
+
let i = 2;
|
|
32
|
+
while (i + 9 < buf.length) {
|
|
33
|
+
if (buf[i] !== 0xff) {
|
|
34
|
+
i++;
|
|
35
|
+
continue;
|
|
36
|
+
}
|
|
37
|
+
const marker = buf[i + 1];
|
|
38
|
+
if (marker === 0xff) {
|
|
39
|
+
i++;
|
|
40
|
+
continue;
|
|
41
|
+
}
|
|
42
|
+
if (marker >= 0xc0 && marker <= 0xcf && marker !== 0xc4 && marker !== 0xc8 && marker !== 0xcc) {
|
|
43
|
+
return { width: buf.readUInt16BE(i + 7), height: buf.readUInt16BE(i + 5), mime: 'image/jpeg' };
|
|
44
|
+
}
|
|
45
|
+
i += 2 + buf.readUInt16BE(i + 2);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
throw new Error('overlay: frame is not a readable PNG or JPEG image');
|
|
49
|
+
}
|
|
50
|
+
async function loadFrames(frames) {
|
|
51
|
+
const out = [];
|
|
52
|
+
for (const [i, f] of frames.entries()) {
|
|
53
|
+
const buf = typeof f.png === 'string' ? await readFile(f.png) : f.png;
|
|
54
|
+
const { width, height, mime } = imageSize(buf);
|
|
55
|
+
if (Math.abs(width / height - 9 / 16) > 0.01) {
|
|
56
|
+
throw new Error(`overlay: frame ${i + 1} ("${f.label}") is ${width}x${height}; the UI overlay only supports 9:16 frames`);
|
|
57
|
+
}
|
|
58
|
+
out.push({ dataUrl: `data:${mime};base64,${buf.toString('base64')}`, label: f.label });
|
|
59
|
+
}
|
|
60
|
+
return out;
|
|
61
|
+
}
|
|
62
|
+
// ---- chrome ---------------------------------------------------------------------------------
|
|
63
|
+
const W = 'rgba(255,255,255,0.62)';
|
|
64
|
+
const SW = 'stroke="rgba(255,255,255,0.62)" stroke-width="7" stroke-linecap="round" stroke-linejoin="round" fill="none"';
|
|
65
|
+
const FONT = `font-family="-apple-system,Helvetica,Arial,sans-serif"`;
|
|
66
|
+
const text = (x, y, size, s, extra = '') => `<text x="${x}" y="${y}" font-size="${size}" fill="${W}" ${FONT} ${extra}>${esc(s)}</text>`;
|
|
67
|
+
const heart = (cx, cy, s) => `<path transform="translate(${cx - s / 2} ${cy - s / 2}) scale(${s / 24})" d="M12 21 C4 14 2 10 2 7.5 A5 5 0 0 1 12 6 A5 5 0 0 1 22 7.5 C22 10 20 14 12 21 Z" fill="${W}"/>`;
|
|
68
|
+
const bubble = (cx, cy, s) => `<path transform="translate(${cx - s / 2} ${cy - s / 2}) scale(${s / 24})" d="M3 11 A9 8 0 0 1 21 11 A9 8 0 0 1 11 19 L5 21 L7 16.5 A9 8 0 0 1 3 11 Z" fill="${W}"/>`;
|
|
69
|
+
const plane = (cx, cy, s) => `<path transform="translate(${cx - s / 2} ${cy - s / 2}) scale(${s / 24})" d="M2 11 L22 3 L15 21 L11 13 Z" fill="${W}"/>`;
|
|
70
|
+
const dots = (cx, cy) => [-22, 0, 22].map((d) => `<circle cx="${cx}" cy="${cy + d}" r="6" fill="${W}"/>`).join('');
|
|
71
|
+
const bookmark = (cx, cy, s) => `<path transform="translate(${cx - s / 2} ${cy - s / 2}) scale(${s / 24})" d="M5 2 H19 V22 L12 16 L5 22 Z" fill="${W}"/>`;
|
|
72
|
+
const search = (cx, cy) => `<g ${SW}><circle cx="${cx - 6}" cy="${cy - 6}" r="17"/><path d="M${cx + 7} ${cy + 7} L${cx + 22} ${cy + 22}"/></g>`;
|
|
73
|
+
const avatar = (cx, cy, r) => `<circle cx="${cx}" cy="${cy}" r="${r}" fill="rgba(255,255,255,0.35)" stroke="${W}" stroke-width="4"/><circle cx="${cx}" cy="${cy - r * 0.2}" r="${r * 0.34}" fill="${W}"/><path d="M${cx - r * 0.6} ${cy + r * 0.7} A${r * 0.6} ${r * 0.5} 0 0 1 ${cx + r * 0.6} ${cy + r * 0.7} Z" fill="${W}"/>`;
|
|
74
|
+
const bars = (x, y, widths) => widths.map((w, i) => `<rect x="${x}" y="${y + i * 54}" width="${w}" height="20" rx="10" fill="${W}"/>`).join('');
|
|
75
|
+
const scrimTop = (h) => `<rect x="0" y="0" width="1080" height="${h}" fill="url(#st)"/>`;
|
|
76
|
+
function instagramChrome() {
|
|
77
|
+
const cx = 990;
|
|
78
|
+
return [
|
|
79
|
+
scrimTop(300),
|
|
80
|
+
`<rect x="0" y="1380" width="1080" height="540" fill="url(#sb)"/>`,
|
|
81
|
+
// header
|
|
82
|
+
`<g ${SW}><path d="M92 150 L58 184 L92 218 M58 184 H118"/></g>`,
|
|
83
|
+
text(190, 200, 50, 'Reels', 'font-weight="700"'),
|
|
84
|
+
text(360, 200, 50, 'Friends', 'opacity="0.7"'),
|
|
85
|
+
`<g ${SW}><rect x="940" y="156" width="70" height="56" rx="12"/><circle cx="975" cy="184" r="15"/><path d="M955 156 L962 142 H988 L995 156"/></g>`,
|
|
86
|
+
// right column
|
|
87
|
+
heart(cx, 800, 74),
|
|
88
|
+
text(cx, 880, 34, '24.1K', 'text-anchor="middle"'),
|
|
89
|
+
bubble(cx, 990, 70),
|
|
90
|
+
text(cx, 1070, 34, '312', 'text-anchor="middle"'),
|
|
91
|
+
plane(cx, 1180, 70),
|
|
92
|
+
text(cx, 1260, 34, '1,204', 'text-anchor="middle"'),
|
|
93
|
+
dots(cx, 1360),
|
|
94
|
+
`<rect x="${cx - 36}" y="1440" width="72" height="72" rx="16" fill="rgba(255,255,255,0.3)" stroke="${W}" stroke-width="5"/>`,
|
|
95
|
+
// bottom
|
|
96
|
+
avatar(90, 1560, 38),
|
|
97
|
+
text(150, 1556, 40, 'username · Follow', 'font-weight="700"'),
|
|
98
|
+
bars(60, 1620, [760, 520]),
|
|
99
|
+
text(60, 1760, 36, '♪ Original audio'),
|
|
100
|
+
].join('');
|
|
101
|
+
}
|
|
102
|
+
function tiktokChrome() {
|
|
103
|
+
const cx = 990;
|
|
104
|
+
return [
|
|
105
|
+
scrimTop(300),
|
|
106
|
+
`<rect x="0" y="1380" width="1080" height="540" fill="url(#sb)"/>`,
|
|
107
|
+
// header
|
|
108
|
+
text(70, 190, 42, 'LIVE', 'font-weight="700"'),
|
|
109
|
+
`<rect x="52" y="152" width="108" height="52" rx="10" fill="none" stroke="${W}" stroke-width="4"/>`,
|
|
110
|
+
text(400, 190, 46, 'Following', 'opacity="0.7" text-anchor="middle"'),
|
|
111
|
+
text(540, 190, 46, '|', 'opacity="0.5" text-anchor="middle"'),
|
|
112
|
+
text(680, 190, 46, 'For You', 'font-weight="700" text-anchor="middle"'),
|
|
113
|
+
`<rect x="620" y="206" width="120" height="6" rx="3" fill="${W}"/>`,
|
|
114
|
+
search(985, 176),
|
|
115
|
+
// right column
|
|
116
|
+
avatar(cx, 620, 52),
|
|
117
|
+
`<circle cx="${cx}" cy="684" r="22" fill="rgba(240,60,90,0.8)"/><path d="M${cx - 10} 684 H${cx + 10} M${cx} 674 V694" stroke="white" stroke-width="5" stroke-linecap="round"/>`,
|
|
118
|
+
heart(cx, 800, 76),
|
|
119
|
+
text(cx, 880, 34, '98.2K', 'text-anchor="middle"'),
|
|
120
|
+
bubble(cx, 985, 72),
|
|
121
|
+
text(cx, 1065, 34, '1,046', 'text-anchor="middle"'),
|
|
122
|
+
bookmark(cx, 1170, 66),
|
|
123
|
+
text(cx, 1250, 34, '8,311', 'text-anchor="middle"'),
|
|
124
|
+
plane(cx, 1350, 70),
|
|
125
|
+
text(cx, 1430, 34, '2,917', 'text-anchor="middle"'),
|
|
126
|
+
`<circle cx="${cx}" cy="1560" r="52" fill="rgba(30,30,30,0.7)" stroke="${W}" stroke-width="5"/><circle cx="${cx}" cy="1560" r="20" fill="${W}"/>`,
|
|
127
|
+
// bottom
|
|
128
|
+
text(60, 1556, 42, '@username', 'font-weight="700"'),
|
|
129
|
+
bars(60, 1596, [760, 520]),
|
|
130
|
+
text(60, 1760, 36, '♪ original sound - username'),
|
|
131
|
+
].join('');
|
|
132
|
+
}
|
|
133
|
+
function chromeSvg(platform) {
|
|
134
|
+
const body = platform === 'instagram' ? instagramChrome() : tiktokChrome();
|
|
135
|
+
return (`<svg class="chrome" viewBox="0 0 ${OVERLAY_REF.width} ${OVERLAY_REF.height}" xmlns="http://www.w3.org/2000/svg">` +
|
|
136
|
+
`<defs><linearGradient id="st" x1="0" y1="0" x2="0" y2="1"><stop offset="0" stop-color="#000" stop-opacity="0.45"/><stop offset="1" stop-color="#000" stop-opacity="0"/></linearGradient>` +
|
|
137
|
+
`<linearGradient id="sb" x1="0" y1="0" x2="0" y2="1"><stop offset="0" stop-color="#000" stop-opacity="0"/><stop offset="1" stop-color="#000" stop-opacity="0.55"/></linearGradient></defs>` +
|
|
138
|
+
body +
|
|
139
|
+
`</svg>`);
|
|
140
|
+
}
|
|
141
|
+
function zoneDivs() {
|
|
142
|
+
const { top, bottom, rightX, rightY0, rightY1 } = OVERLAY_ZONES;
|
|
143
|
+
const { width: w, height: h } = OVERLAY_REF;
|
|
144
|
+
return (`<div class="zone zone-top" style="left:0;top:0;width:100%;height:${pct(top, h)}"></div>` +
|
|
145
|
+
`<div class="zone zone-bottom" style="left:0;top:${pct(bottom, h)};width:100%;height:${pct(h - bottom, h)}"></div>` +
|
|
146
|
+
`<div class="zone zone-right" style="left:${pct(rightX, w)};top:${pct(rightY0, h)};width:${pct(w - rightX, w)};height:${pct(rightY1 - rightY0, h)}"></div>`);
|
|
147
|
+
}
|
|
148
|
+
function frameHtml(f, platform, w, h) {
|
|
149
|
+
return (`<figure class="fig" style="width:${w}px"><div class="frame" style="width:${w}px;height:${h}px">` +
|
|
150
|
+
`<img src="${f.dataUrl}" alt="">${chromeSvg(platform)}${zoneDivs()}</div>` +
|
|
151
|
+
`<figcaption>${esc(f.label)}</figcaption></figure>`);
|
|
152
|
+
}
|
|
153
|
+
const BASE_CSS = `
|
|
154
|
+
*{box-sizing:border-box;margin:0;padding:0}
|
|
155
|
+
body{background:#14151a;color:#e8e8ec;font-family:-apple-system,Helvetica,Arial,sans-serif}
|
|
156
|
+
.fig{display:flex;flex-direction:column;gap:6px}
|
|
157
|
+
.frame{position:relative;overflow:hidden;background:#000;border-radius:6px}
|
|
158
|
+
.frame img{position:absolute;inset:0;width:100%;height:100%;object-fit:fill}
|
|
159
|
+
.chrome{position:absolute;inset:0;width:100%;height:100%}
|
|
160
|
+
.zone{position:absolute;border:1.5px dashed rgba(255,214,0,0.55);pointer-events:none}
|
|
161
|
+
figcaption{font-size:12px;text-align:center;color:#b8b9c2}
|
|
162
|
+
`;
|
|
163
|
+
/**
|
|
164
|
+
* The page for a contact sheet (title bar, frames in rows of up to 6) or, with `single`, one bare frame
|
|
165
|
+
* at 540x960. Pure: images arrive as data URLs.
|
|
166
|
+
*/
|
|
167
|
+
export function overlayHtml(frames, platform, opts = {}) {
|
|
168
|
+
if (opts.single) {
|
|
169
|
+
const f = frames[0];
|
|
170
|
+
return `<!doctype html><html><head><meta charset="utf-8"><style>${BASE_CSS}
|
|
171
|
+
body{background:#000}.fig{gap:0}figcaption{display:none}</style></head><body>${frameHtml(f, platform, FRAME_W, FRAME_H)}</body></html>`;
|
|
172
|
+
}
|
|
173
|
+
const cols = Math.min(PER_ROW, Math.max(1, frames.length));
|
|
174
|
+
const gap = 16;
|
|
175
|
+
const width = cols * SHEET_FRAME_W + (cols + 1) * gap;
|
|
176
|
+
return (`<!doctype html><html><head><meta charset="utf-8"><style>${BASE_CSS}
|
|
177
|
+
body{width:${width}px;padding:${gap}px}
|
|
178
|
+
h1{font-size:18px;font-weight:600;margin-bottom:12px}
|
|
179
|
+
h1 small{font-weight:400;color:#9a9ba5;margin-left:10px;font-size:13px}
|
|
180
|
+
.grid{display:grid;grid-template-columns:repeat(${cols},${SHEET_FRAME_W}px);gap:${gap}px}
|
|
181
|
+
</style></head><body><h1>${esc(PLATFORM_TITLE[platform])}<small>dashed outline = safe-zone check areas</small></h1>` +
|
|
182
|
+
`<div class="grid">${frames.map((f) => frameHtml(f, platform, SHEET_FRAME_W, SHEET_FRAME_H)).join('')}</div></body></html>`);
|
|
183
|
+
}
|
|
184
|
+
// ---- rendering --------------------------------------------------------------------------------
|
|
185
|
+
async function withPage(opts, viewport, fn) {
|
|
186
|
+
const factory = opts?.browser ?? (await findBrowserFactory());
|
|
187
|
+
const browser = await factory();
|
|
188
|
+
let page;
|
|
189
|
+
try {
|
|
190
|
+
page = await browser.newPage({ deviceScaleFactor: 1, viewport });
|
|
191
|
+
return await fn(page);
|
|
192
|
+
}
|
|
193
|
+
finally {
|
|
194
|
+
// The page is closed explicitly so a shared browser (whose close() is a no-op) does not accumulate pages.
|
|
195
|
+
await page?.close().catch(() => { });
|
|
196
|
+
await browser.close();
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
/**
|
|
200
|
+
* One browser for many renders. `factory` launches lazily on first use (so a run that never draws
|
|
201
|
+
* launches nothing), every later call reuses that browser, and the `close()` of the browsers it hands
|
|
202
|
+
* out does nothing; call `closeAll()` once, in a finally, to really close it.
|
|
203
|
+
*/
|
|
204
|
+
export function sharedBrowser(base) {
|
|
205
|
+
let launching;
|
|
206
|
+
const launch = () => {
|
|
207
|
+
launching ?? (launching = (async () => (base ?? (await findBrowserFactory()))())());
|
|
208
|
+
// A failed launch is not cached: the next call may try again.
|
|
209
|
+
launching.catch(() => {
|
|
210
|
+
launching = undefined;
|
|
211
|
+
});
|
|
212
|
+
return launching;
|
|
213
|
+
};
|
|
214
|
+
const factory = async () => {
|
|
215
|
+
const real = await launch();
|
|
216
|
+
return new Proxy(real, {
|
|
217
|
+
get(target, prop) {
|
|
218
|
+
if (prop === 'close')
|
|
219
|
+
return async () => { };
|
|
220
|
+
const v = Reflect.get(target, prop, target);
|
|
221
|
+
return typeof v === 'function' ? v.bind(target) : v;
|
|
222
|
+
},
|
|
223
|
+
});
|
|
224
|
+
};
|
|
225
|
+
return {
|
|
226
|
+
factory,
|
|
227
|
+
closeAll: async () => {
|
|
228
|
+
const l = launching;
|
|
229
|
+
launching = undefined;
|
|
230
|
+
if (l)
|
|
231
|
+
await (await l.catch(() => undefined))?.close().catch(() => { });
|
|
232
|
+
},
|
|
233
|
+
};
|
|
234
|
+
}
|
|
235
|
+
/** One 540x960 JPEG per frame, with the platform chrome drawn on top. All frames share one page. */
|
|
236
|
+
export async function renderOverlayFrames(frames, platform, opts) {
|
|
237
|
+
const loaded = await loadFrames(frames);
|
|
238
|
+
if (loaded.length === 0)
|
|
239
|
+
return [];
|
|
240
|
+
return withPage(opts, { width: FRAME_W, height: FRAME_H }, async (page) => {
|
|
241
|
+
const out = [];
|
|
242
|
+
for (const f of loaded) {
|
|
243
|
+
await page.setContent(overlayHtml([f], platform, { single: true }), { waitUntil: 'load' });
|
|
244
|
+
out.push(await page.screenshot({ type: 'jpeg', quality: 88, clip: { x: 0, y: 0, width: FRAME_W, height: FRAME_H } }));
|
|
245
|
+
}
|
|
246
|
+
return out;
|
|
247
|
+
});
|
|
248
|
+
}
|
|
249
|
+
/** All frames in one JPEG sheet: a title bar naming the platform, a single row (wrapping after 6). */
|
|
250
|
+
export async function composeOverlaySheet(frames, platform, opts) {
|
|
251
|
+
const max = opts?.maxPerSheet ?? frames.length;
|
|
252
|
+
const loaded = await loadFrames(frames.slice(0, Math.max(1, max)));
|
|
253
|
+
if (loaded.length === 0)
|
|
254
|
+
throw new Error('overlay: no frames to compose');
|
|
255
|
+
const html = overlayHtml(loaded, platform);
|
|
256
|
+
const cols = Math.min(PER_ROW, loaded.length);
|
|
257
|
+
const width = cols * SHEET_FRAME_W + (cols + 1) * 16;
|
|
258
|
+
return withPage(opts, { width, height: 700 }, async (page) => {
|
|
259
|
+
await page.setContent(html, { waitUntil: 'load' });
|
|
260
|
+
const data = await page.screenshot({ type: 'jpeg', quality: 80, fullPage: true });
|
|
261
|
+
return { data, mimeType: 'image/jpeg' };
|
|
262
|
+
});
|
|
263
|
+
}
|
|
264
|
+
/** Writes `<baseName>-ui-<platform>.jpg` per platform into outDir. */
|
|
265
|
+
export async function overlaySheetsFor(frames, platforms, outDir, baseName, opts) {
|
|
266
|
+
await mkdir(outDir, { recursive: true });
|
|
267
|
+
const results = [];
|
|
268
|
+
// One browser for every platform's sheet (unless the caller already shares one).
|
|
269
|
+
const shared = sharedBrowser(opts?.browser);
|
|
270
|
+
try {
|
|
271
|
+
for (const platform of platforms) {
|
|
272
|
+
const { data } = await composeOverlaySheet(frames, platform, { ...opts, browser: shared.factory });
|
|
273
|
+
const file = join(outDir, `${baseName}-ui-${platform}.jpg`);
|
|
274
|
+
await writeFile(file, data);
|
|
275
|
+
results.push({ platform, file, bytes: data.length });
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
finally {
|
|
279
|
+
await shared.closeAll();
|
|
280
|
+
}
|
|
281
|
+
return results;
|
|
282
|
+
}
|
|
283
|
+
//# sourceMappingURL=overlay.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"overlay.js","sourceRoot":"","sources":["../../../src/lib/safe-zone/overlay.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,E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C,CAAC,CAAA;AACJ,CAAC;AAED,sEAAsE;AACtE,MAAM,CAAC,KAAK,UAAU,gBAAgB,CACpC,MAAsB,EACtB,SAA4B,EAC5B,MAAc,EACd,QAAgB,EAChB,IAAgD;IAEhD,MAAM,KAAK,CAAC,MAAM,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAA;IACxC,MAAM,OAAO,GAAsE,EAAE,CAAA;IACrF,iFAAiF;IACjF,MAAM,MAAM,GAAG,aAAa,CAAC,IAAI,EAAE,OAAO,CAAC,CAAA;IAC3C,IAAI,CAAC;QACH,KAAK,MAAM,QAAQ,IAAI,SAAS,EAAE,CAAC;YACjC,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,mBAAmB,CAAC,MAAM,EAAE,QAAQ,EAAE,EAAE,GAAG,IAAI,EAAE,OAAO,EAAE,MAAM,CAAC,OAAO,EAAE,CAAC,CAAA;YAClG,MAAM,IAAI,GAAG,IAAI,CAAC,MAAM,EAAE,GAAG,QAAQ,OAAO,QAAQ,MAAM,CAAC,CAAA;YAC3D,MAAM,SAAS,CAAC,IAAI,EAAE,IAAI,CAAC,CAAA;YAC3B,OAAO,CAAC,IAAI,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,CAAC,MAAM,EAAE,CAAC,CAAA;QACtD,CAAC;IACH,CAAC;YAAS,CAAC;QACT,MAAM,MAAM,CAAC,QAAQ,EAAE,CAAA;IACzB,CAAC;IACD,OAAO,OAAO,CAAA;AAChB,CAAC"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The platform UI zones of a 9:16 video or slide, in one table.
|
|
3
|
+
*
|
|
4
|
+
* Instagram Reels, TikTok and YouTube Shorts draw their own interface over the picture: a header at
|
|
5
|
+
* the top, the caption/username/music row at the bottom and the like/comment/share column on the
|
|
6
|
+
* right. Anything the creative puts there is hidden or crowded. The numbers are for 1080x1920 and are
|
|
7
|
+
* scaled to the real frame size.
|
|
8
|
+
*/
|
|
9
|
+
export interface PixelBox {
|
|
10
|
+
x: number;
|
|
11
|
+
y: number;
|
|
12
|
+
w: number;
|
|
13
|
+
h: number;
|
|
14
|
+
}
|
|
15
|
+
export type ZoneName = 'top' | 'bottom' | 'right';
|
|
16
|
+
export interface SafeZone {
|
|
17
|
+
name: ZoneName;
|
|
18
|
+
/** The zone as a rectangle in the real frame's pixels. */
|
|
19
|
+
rect: PixelBox;
|
|
20
|
+
/** The platform UI that covers the zone. */
|
|
21
|
+
platforms: string[];
|
|
22
|
+
/** The y (top, bottom) or x (right) edge in 1080x1920 terms, for messages. */
|
|
23
|
+
edge1080: number;
|
|
24
|
+
}
|
|
25
|
+
export declare const REF_WIDTH = 1080;
|
|
26
|
+
export declare const REF_HEIGHT = 1920;
|
|
27
|
+
export declare const TOP_EDGE = 290;
|
|
28
|
+
export declare const BOTTOM_EDGE = 1490;
|
|
29
|
+
export declare const RIGHT_EDGE = 918;
|
|
30
|
+
export declare const RIGHT_Y_MIN = 576;
|
|
31
|
+
export declare const RIGHT_Y_MAX = 1632;
|
|
32
|
+
/** A bottom hit needs this share of the box's height inside the zone, so text that just grazes the
|
|
33
|
+
* line (an ascender or descender) is not flagged. Top and right count any overlap. */
|
|
34
|
+
export declare const BOTTOM_MIN_OVERLAP = 0.3;
|
|
35
|
+
/** True when the frame is about 9:16 (portrait), within 2%. */
|
|
36
|
+
export declare function isNineBySixteen(width: number, height: number): boolean;
|
|
37
|
+
/** The three zones scaled to the frame, or [] when the frame is not 9:16. */
|
|
38
|
+
export declare function zonesFor(width: number, height: number): SafeZone[];
|
|
39
|
+
/** True when the box falls in the zone (any overlap, or at least 30% of its height for the bottom). */
|
|
40
|
+
export declare function boxInZone(box: PixelBox, zone: SafeZone): boolean;
|
|
41
|
+
/** The zones the box falls in. */
|
|
42
|
+
export declare function hitZones(box: PixelBox, zones: SafeZone[]): SafeZone[];
|
|
43
|
+
/** Pushes a box outward from the frame centre by `scale` (a zoom-in crops edges and moves content
|
|
44
|
+
* away from the middle, so text near an edge ends up nearer to, or past, the UI zone). */
|
|
45
|
+
export declare function projectBox(box: PixelBox, width: number, height: number, scale: number): PixelBox;
|
|
46
|
+
//# sourceMappingURL=zones.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"zones.d.ts","sourceRoot":"","sources":["../../../src/lib/safe-zone/zones.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,MAAM,WAAW,QAAQ;IACvB,CAAC,EAAE,MAAM,CAAA;IACT,CAAC,EAAE,MAAM,CAAA;IACT,CAAC,EAAE,MAAM,CAAA;IACT,CAAC,EAAE,MAAM,CAAA;CACV;AAED,MAAM,MAAM,QAAQ,GAAG,KAAK,GAAG,QAAQ,GAAG,OAAO,CAAA;AAEjD,MAAM,WAAW,QAAQ;IACvB,IAAI,EAAE,QAAQ,CAAA;IACd,0DAA0D;IAC1D,IAAI,EAAE,QAAQ,CAAA;IACd,4CAA4C;IAC5C,SAAS,EAAE,MAAM,EAAE,CAAA;IACnB,8EAA8E;IAC9E,QAAQ,EAAE,MAAM,CAAA;CACjB;AAED,eAAO,MAAM,SAAS,OAAO,CAAA;AAC7B,eAAO,MAAM,UAAU,OAAO,CAAA;AAC9B,eAAO,MAAM,QAAQ,MAAM,CAAA;AAC3B,eAAO,MAAM,WAAW,OAAO,CAAA;AAC/B,eAAO,MAAM,UAAU,MAAM,CAAA;AAC7B,eAAO,MAAM,WAAW,MAAM,CAAA;AAC9B,eAAO,MAAM,WAAW,OAAO,CAAA;AAE/B;sFACsF;AACtF,eAAO,MAAM,kBAAkB,MAAM,CAAA;AAIrC,+DAA+D;AAC/D,wBAAgB,eAAe,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAGtE;AAED,6EAA6E;AAC7E,wBAAgB,QAAQ,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,QAAQ,EAAE,CAyBlE;A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