@softure-ai/marketing-kit 0.1.7 → 0.1.8
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/README.md +79 -11
- package/dist/cli/main.js +84 -29
- package/dist/cli/main.js.map +1 -1
- package/dist/cli/og.d.ts +4 -1
- package/dist/cli/og.d.ts.map +1 -1
- package/dist/cli/og.js +15 -7
- package/dist/cli/og.js.map +1 -1
- package/dist/cli/options.d.ts +26 -2
- package/dist/cli/options.d.ts.map +1 -1
- package/dist/cli/options.js +97 -9
- package/dist/cli/options.js.map +1 -1
- package/dist/cli/voice.d.ts +14 -0
- package/dist/cli/voice.d.ts.map +1 -1
- package/dist/cli/voice.js +13 -0
- package/dist/cli/voice.js.map +1 -1
- package/dist/config/actions-schema.d.ts +14 -14
- package/dist/config/config.d.ts +2 -0
- package/dist/config/config.d.ts.map +1 -1
- package/dist/config/config.js +1 -1
- package/dist/config/config.js.map +1 -1
- package/dist/config/og-image-names.d.ts +7 -0
- package/dist/config/og-image-names.d.ts.map +1 -0
- package/dist/config/og-image-names.js +9 -0
- package/dist/config/og-image-names.js.map +1 -0
- package/dist/config/schema.d.ts +103 -15
- package/dist/config/schema.d.ts.map +1 -1
- package/dist/config/schema.js +64 -7
- package/dist/config/schema.js.map +1 -1
- package/dist/index.d.ts +5 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -3
- package/dist/index.js.map +1 -1
- package/dist/og/index.d.ts +3 -3
- package/dist/og/index.d.ts.map +1 -1
- package/dist/og/index.js +3 -2
- package/dist/og/index.js.map +1 -1
- package/dist/og/render.d.ts +13 -0
- package/dist/og/render.d.ts.map +1 -1
- package/dist/og/render.js +31 -6
- package/dist/og/render.js.map +1 -1
- package/dist/og/templates/big-number.d.ts +7 -0
- package/dist/og/templates/big-number.d.ts.map +1 -0
- package/dist/og/templates/big-number.js +41 -0
- package/dist/og/templates/big-number.js.map +1 -0
- package/dist/og/templates/carousel.d.ts +5 -0
- package/dist/og/templates/carousel.d.ts.map +1 -0
- package/dist/og/templates/carousel.js +26 -0
- package/dist/og/templates/carousel.js.map +1 -0
- package/dist/og/templates/context.d.ts +11 -3
- package/dist/og/templates/context.d.ts.map +1 -1
- package/dist/og/templates/context.js +6 -0
- package/dist/og/templates/context.js.map +1 -1
- package/dist/og/templates/frame.d.ts +2 -2
- package/dist/og/templates/frame.d.ts.map +1 -1
- package/dist/og/templates/frame.js +2 -2
- package/dist/og/templates/frame.js.map +1 -1
- package/dist/og/templates/index.d.ts +8 -3
- package/dist/og/templates/index.d.ts.map +1 -1
- package/dist/og/templates/index.js +18 -5
- package/dist/og/templates/index.js.map +1 -1
- package/dist/og/templates/portrait.d.ts +22 -0
- package/dist/og/templates/portrait.d.ts.map +1 -0
- package/dist/og/templates/portrait.js +75 -0
- package/dist/og/templates/portrait.js.map +1 -0
- package/dist/og/templates/schemas.d.ts +28 -0
- package/dist/og/templates/schemas.d.ts.map +1 -1
- package/dist/og/templates/schemas.js +26 -0
- package/dist/og/templates/schemas.js.map +1 -1
- package/dist/screenshot/gates.d.ts +6 -3
- package/dist/screenshot/gates.d.ts.map +1 -1
- package/dist/screenshot/gates.js +12 -3
- package/dist/screenshot/gates.js.map +1 -1
- package/dist/screenshot/screenshot.d.ts +17 -0
- package/dist/screenshot/screenshot.d.ts.map +1 -1
- package/dist/screenshot/screenshot.js +37 -6
- package/dist/screenshot/screenshot.js.map +1 -1
- package/dist/screenshot/storage-state.d.ts +9 -0
- package/dist/screenshot/storage-state.d.ts.map +1 -0
- package/dist/screenshot/storage-state.js +25 -0
- package/dist/screenshot/storage-state.js.map +1 -0
- package/dist/voice/placeholder.d.ts +35 -0
- package/dist/voice/placeholder.d.ts.map +1 -0
- package/dist/voice/placeholder.js +53 -0
- package/dist/voice/placeholder.js.map +1 -0
- package/package.json +1 -1
- package/schema/marketing.schema.json +343 -37
- package/src/cli/main.ts +80 -27
- package/src/cli/og.ts +14 -6
- package/src/cli/options.ts +109 -10
- package/src/cli/voice.ts +20 -0
- package/src/config/config.ts +3 -2
- package/src/config/og-image-names.ts +7 -0
- package/src/config/schema.ts +72 -8
- package/src/index.ts +7 -1
- package/src/og/index.ts +16 -2
- package/src/og/render.ts +36 -6
- package/src/og/templates/big-number.ts +44 -0
- package/src/og/templates/carousel.ts +27 -0
- package/src/og/templates/context.ts +16 -3
- package/src/og/templates/frame.ts +2 -2
- package/src/og/templates/index.ts +31 -9
- package/src/og/templates/portrait.ts +126 -0
- package/src/og/templates/schemas.ts +35 -0
- package/src/screenshot/gates.ts +13 -3
- package/src/screenshot/screenshot.ts +51 -11
- package/src/screenshot/storage-state.ts +24 -0
- package/src/voice/placeholder.ts +83 -0
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { h } from "../element.js";
|
|
2
|
+
import { px, text } from "./frame.js";
|
|
3
|
+
/** Sizes in this file are written for the 1080×1350 post (`PORTRAIT_BASE`). */
|
|
4
|
+
const PADDING = 80;
|
|
5
|
+
/**
|
|
6
|
+
* The portrait post: the logo and name on top (the counter opposite), the content filling the middle, and the call
|
|
7
|
+
* to action and source line pinned to the bottom, so a tall frame spreads the post instead of adding empty bands.
|
|
8
|
+
*/
|
|
9
|
+
export function portraitFrame(context, frame) {
|
|
10
|
+
const { palette } = context;
|
|
11
|
+
const logoSize = px(context, 64);
|
|
12
|
+
const hasFooter = frame.cta !== undefined || frame.source !== undefined;
|
|
13
|
+
return h("div", {
|
|
14
|
+
style: {
|
|
15
|
+
display: "flex",
|
|
16
|
+
flexDirection: "column",
|
|
17
|
+
width: "100%",
|
|
18
|
+
height: "100%",
|
|
19
|
+
padding: px(context, PADDING),
|
|
20
|
+
backgroundColor: palette.background,
|
|
21
|
+
color: palette.foreground,
|
|
22
|
+
},
|
|
23
|
+
}, h("div", { style: { display: "flex", alignItems: "center", justifyContent: "space-between" } }, h("div", { style: { display: "flex", alignItems: "center", gap: px(context, 20) } }, context.brand.logo === null ? null : h("img", { src: context.brand.logo, width: logoSize, height: logoSize, style: { width: logoSize, height: logoSize } }), h("div", { style: { ...text(context, context.fonts.body, 32, 600), wordBreak: "break-word", color: palette.muted } }, context.brand.name)), frame.counter === null ? null : h("div", { style: { ...text(context, context.fonts.body, 32, 600), wordBreak: "break-word", color: palette.muted } }, frame.counter)), h("div", { style: { display: "flex", flexDirection: "column", flexGrow: 1, justifyContent: "center", marginTop: px(context, 32), marginBottom: px(context, 32) } }, ...frame.content), hasFooter
|
|
24
|
+
? h("div", { style: { display: "flex", flexDirection: "column", alignItems: "flex-start", gap: px(context, 28) } }, frame.cta === undefined
|
|
25
|
+
? null
|
|
26
|
+
: h("div", {
|
|
27
|
+
style: {
|
|
28
|
+
...text(context, context.fonts.body, 34, 600),
|
|
29
|
+
wordBreak: "break-word",
|
|
30
|
+
maxWidth: "100%",
|
|
31
|
+
padding: `${px(context, 18)}px ${px(context, 36)}px`,
|
|
32
|
+
borderRadius: px(context, 999),
|
|
33
|
+
backgroundColor: palette.cta,
|
|
34
|
+
color: palette.onCta,
|
|
35
|
+
},
|
|
36
|
+
}, frame.cta), frame.source === undefined ? null : h("div", { style: { ...text(context, context.fonts.body, 24, 400), wordBreak: "break-word", lineHeight: 1.3, color: palette.muted } }, frame.source))
|
|
37
|
+
: null);
|
|
38
|
+
}
|
|
39
|
+
export function portraitEyebrow(context, value) {
|
|
40
|
+
if (value === undefined)
|
|
41
|
+
return null;
|
|
42
|
+
return h("div", { style: { ...text(context, context.fonts.body, 34, 600), wordBreak: "break-word", color: context.palette.accent, marginBottom: px(context, 24) } }, value);
|
|
43
|
+
}
|
|
44
|
+
/** The portrait headline size: shorter headlines get bigger type. */
|
|
45
|
+
export function portraitHeadlineSize(headline) {
|
|
46
|
+
if (headline.length <= 30)
|
|
47
|
+
return 84;
|
|
48
|
+
if (headline.length <= 60)
|
|
49
|
+
return 70;
|
|
50
|
+
return 60;
|
|
51
|
+
}
|
|
52
|
+
export function portraitHeadline(context, value) {
|
|
53
|
+
return h("div", { style: { ...text(context, context.fonts.heading, portraitHeadlineSize(value), 700), wordBreak: "break-word", lineHeight: 1.12, color: context.palette.foreground } }, value);
|
|
54
|
+
}
|
|
55
|
+
/** Up to two figures in boxes side by side: the value large, the label under it. */
|
|
56
|
+
export function portraitTiles(context, entries) {
|
|
57
|
+
if (entries.length === 0)
|
|
58
|
+
return null;
|
|
59
|
+
const { palette } = context;
|
|
60
|
+
const gap = px(context, 20);
|
|
61
|
+
// Two per row: half of the content width (the frame's padding off both sides) minus half the gap.
|
|
62
|
+
const tileWidth = Math.floor((context.width - 2 * px(context, PADDING) - gap) / 2);
|
|
63
|
+
return h("div", { style: { display: "flex", flexWrap: "wrap", gap, marginTop: px(context, 40) } }, ...entries.map((tile) => h("div", {
|
|
64
|
+
style: {
|
|
65
|
+
display: "flex",
|
|
66
|
+
flexDirection: "column",
|
|
67
|
+
width: tileWidth,
|
|
68
|
+
padding: `${px(context, 22)}px ${px(context, 28)}px`,
|
|
69
|
+
borderRadius: px(context, 24),
|
|
70
|
+
border: `${px(context, 2)}px solid ${palette.border}`,
|
|
71
|
+
backgroundColor: palette.surface,
|
|
72
|
+
},
|
|
73
|
+
}, h("div", { style: { ...text(context, context.fonts.heading, 44, 700), wordBreak: "break-word", color: palette.foreground } }, tile.value), h("div", { style: { ...text(context, context.fonts.body, 28, 400), wordBreak: "break-word", color: palette.muted, marginTop: px(context, 6) } }, tile.label))));
|
|
74
|
+
}
|
|
75
|
+
//# sourceMappingURL=portrait.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"portrait.js","sourceRoot":"","sources":["../../../src/og/templates/portrait.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAA6B,MAAM,eAAe,CAAC;AAE7D,OAAO,EAAE,EAAE,EAAE,IAAI,EAAa,MAAM,YAAY,CAAC;AAEjD,+EAA+E;AAE/E,MAAM,OAAO,GAAG,EAAE,CAAC;AAUnB;;;GAGG;AACH,MAAM,UAAU,aAAa,CAAC,OAA0B,EAAE,KAAoB;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AAS;YAChB,OAAO,EAAE,GAAG,EAAE,CAAC,OAAO,EAAE,EAAE,CAAC,MAAM,EAAE,CAAC,OAAO,EAAE,EAAE,CAAC,IAAI;YACpD,YAAY,EAAE,EAAE,CAAC,OAAO,EAAE,EAAE,CAAC;YAC7B,MAAM,EAAE,GAAG,EAAE,CAAC,OAAO,EAAE,CAAC,CAAC,YAAY,OAAO,CAAC,MAAM,EAAE;YACrD,eAAe,EAAE,OAAO,CAAC,OAAO;SACjC;KACF,EACD,CAAC,CAAC,KAAK,EAAE,EAAE,KAAK,EAAE,EAAE,GAAG,IAAI,CAAC,OAAO,EAAE,OAAO,CAAC,KAAK,CAAC,OAAO,EAAE,EAAE,EAAE,GAAG,CAAC,EAAE,SAAS,EAAE,YAAY,EAAE,KAAK,EAAE,OAAO,CAAC,UAAU,EAAE,EAAE,EAAE,IAAI,CAAC,KAAK,CAAC,EACzI,CAAC,CAAC,KAAK,EAAE,EAAE,KAAK,EAAE,EAAE,GAAG,IAAI,CAAC,OAAO,EAAE,OAAO,CAAC,KAAK,CAAC,IAAI,EAAE,EAAE,EAAE,GAAG,CAAC,EAAE,SAAS,EAAE,YAAY,EAAE,KAAK,EAAE,OAAO,CAAC,KAAK,EAAE,SAAS,EAAE,EAAE,CAAC,OAAO,EAAE,CAAC,CAAC,EAAE,EAAE,EAAE,IAAI,CAAC,KAAK,CAAC,CAC7J,CACF,CACF,CAAC;AACJ,CAAC"}
|
|
@@ -34,4 +34,32 @@ export declare const headlineChartDataSchema: z.ZodObject<{
|
|
|
34
34
|
}, z.core.$strict>;
|
|
35
35
|
export type HeadlineCtaData = z.output<typeof headlineCtaDataSchema>;
|
|
36
36
|
export type HeadlineChartData = z.output<typeof headlineChartDataSchema>;
|
|
37
|
+
export declare const bigNumberDataSchema: z.ZodObject<{
|
|
38
|
+
eyebrow: z.ZodOptional<z.ZodString>;
|
|
39
|
+
number: z.ZodString;
|
|
40
|
+
caption: z.ZodString;
|
|
41
|
+
tiles: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
42
|
+
label: z.ZodString;
|
|
43
|
+
value: z.ZodString;
|
|
44
|
+
}, z.core.$strict>>>;
|
|
45
|
+
cta: z.ZodOptional<z.ZodString>;
|
|
46
|
+
source: z.ZodOptional<z.ZodString>;
|
|
47
|
+
}, z.core.$strict>;
|
|
48
|
+
export declare const carouselDataSchema: z.ZodObject<{
|
|
49
|
+
slides: z.ZodArray<z.ZodObject<{
|
|
50
|
+
eyebrow: z.ZodOptional<z.ZodString>;
|
|
51
|
+
headline: z.ZodString;
|
|
52
|
+
body: z.ZodOptional<z.ZodString>;
|
|
53
|
+
tiles: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
54
|
+
label: z.ZodString;
|
|
55
|
+
value: z.ZodString;
|
|
56
|
+
}, z.core.$strict>>>;
|
|
57
|
+
cta: z.ZodOptional<z.ZodString>;
|
|
58
|
+
source: z.ZodOptional<z.ZodString>;
|
|
59
|
+
}, z.core.$strict>>;
|
|
60
|
+
counter: z.ZodDefault<z.ZodBoolean>;
|
|
61
|
+
}, z.core.$strict>;
|
|
62
|
+
export type BigNumberData = z.output<typeof bigNumberDataSchema>;
|
|
63
|
+
export type CarouselData = z.output<typeof carouselDataSchema>;
|
|
64
|
+
export type CarouselSlide = CarouselData["slides"][number];
|
|
37
65
|
//# sourceMappingURL=schemas.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../../../src/og/templates/schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAqBxB,eAAO,MAAM,WAAW,mDAAoD,CAAC;AAE7E,MAAM,MAAM,SAAS,GAAG,CAAC,OAAO,WAAW,CAAC,CAAC,MAAM,CAAC,CAAC;AAKrD,eAAO,MAAM,qBAAqB;;;;;;;;kBAKhC,CAAC;AAEH,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;kBA0BlC,CAAC;AAEH,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,qBAAqB,CAAC,CAAC;AACrE,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,uBAAuB,CAAC,CAAC"}
|
|
1
|
+
{"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../../../src/og/templates/schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAqBxB,eAAO,MAAM,WAAW,mDAAoD,CAAC;AAE7E,MAAM,MAAM,SAAS,GAAG,CAAC,OAAO,WAAW,CAAC,CAAC,MAAM,CAAC,CAAC;AAKrD,eAAO,MAAM,qBAAqB;;;;;;;;kBAKhC,CAAC;AAEH,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;kBA0BlC,CAAC;AAEH,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,qBAAqB,CAAC,CAAC;AACrE,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,uBAAuB,CAAC,CAAC;AAUzE,eAAO,MAAM,mBAAmB;;;;;;;;;;kBAO9B,CAAC;AAWH,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;kBAG7B,CAAC;AAEH,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,mBAAmB,CAAC,CAAC;AACjE,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAC/D,MAAM,MAAM,aAAa,GAAG,YAAY,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,CAAC"}
|
|
@@ -47,4 +47,30 @@ export const headlineChartDataSchema = z.strictObject({
|
|
|
47
47
|
.describe("A chart the app computed: paths in the coordinates of viewBox."),
|
|
48
48
|
tiles: z.array(tileSchema).max(3, "at most three tiles fit").default([]).describe("Up to three label and value tiles."),
|
|
49
49
|
});
|
|
50
|
+
/*
|
|
51
|
+
* The portrait templates are written for a 1080×1350 post and scale by the limiting side, so their limits hold at
|
|
52
|
+
* every size: copy at the limits stays inside the frame (tests/og/portrait-fit.test.ts renders it and checks).
|
|
53
|
+
*/
|
|
54
|
+
const source = line(80).optional().describe('Where the figures come from, drawn small at the bottom, e.g. "Source: ZUS, 2026"; at most 80 characters.');
|
|
55
|
+
const portraitCta = line(32).optional().describe("A call to action, drawn as a pill in the cta colours at the bottom; at most 32 characters.");
|
|
56
|
+
export const bigNumberDataSchema = z.strictObject({
|
|
57
|
+
eyebrow,
|
|
58
|
+
number: line(12).describe('The figure that fills the post, unit included, e.g. "898 PLN"; at most 12 characters. Shorter numbers get bigger type.'),
|
|
59
|
+
caption: line(90).describe("The sentence that says what the number is, under it; at most 90 characters."),
|
|
60
|
+
tiles: z.array(tileSchema).max(2, "at most two tiles fit").default([]).describe("Up to two label and value tiles under the caption, e.g. a second figure."),
|
|
61
|
+
cta: portraitCta,
|
|
62
|
+
source,
|
|
63
|
+
});
|
|
64
|
+
const slideSchema = z.strictObject({
|
|
65
|
+
eyebrow,
|
|
66
|
+
headline: line(90).describe("The slide's headline, at most 90 characters."),
|
|
67
|
+
body: line(200).optional().describe("A paragraph under the headline, at most 200 characters."),
|
|
68
|
+
tiles: z.array(tileSchema).max(2, "at most two tiles fit").default([]).describe("Up to two label and value tiles side by side."),
|
|
69
|
+
cta: portraitCta,
|
|
70
|
+
source,
|
|
71
|
+
});
|
|
72
|
+
export const carouselDataSchema = z.strictObject({
|
|
73
|
+
slides: z.array(slideSchema).min(2, "a carousel needs at least two slides").max(10, "at most ten slides").describe("The slides in order, two to ten; each renders to its own file <id>-<n>.png."),
|
|
74
|
+
counter: z.boolean().default(true).describe('Draws "n/N" in the top corner of every slide.'),
|
|
75
|
+
});
|
|
50
76
|
//# sourceMappingURL=schemas.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schemas.js","sourceRoot":"","sources":["../../../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,OAAO,CAAC,EAAE,CAAC,CAAC,QAAQ,CAAC,+CAA+C,CAAC;IAChI,GAAG,EAAE,WAAW;IAChB,MAAM;CACP,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,CAAC,YAAY,CAAC;IAC/C,MAAM,EAAE,CAAC,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC,GAAG,CAAC,CAAC,EAAE,sCAAsC,CAAC,CAAC,GAAG,CAAC,EAAE,EAAE,oBAAoB,CAAC,CAAC,QAAQ,CAAC,6EAA6E,CAAC;IACjM,OAAO,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,+CAA+C,CAAC;CAC7F,CAAC,CAAC"}
|
|
@@ -1,14 +1,17 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* The quality gates a screenshot passes before it is kept (FIRE's screenshot script): the page
|
|
3
|
-
* answered below HTTP 400, it
|
|
4
|
-
* blank page, an error page
|
|
3
|
+
* answered below HTTP 400, it reached the requested scroll offset, it shows the expected phrase, and
|
|
4
|
+
* the file is not suspiciously small. A blank page, an error page, a half-loaded one or a frame of
|
|
5
|
+
* the wrong place fails at least one of them.
|
|
5
6
|
*/
|
|
6
|
-
export declare const SCREENSHOT_GATES: readonly ["load", "status", "phrase", "size"];
|
|
7
|
+
export declare const SCREENSHOT_GATES: readonly ["load", "status", "scroll", "phrase", "size"];
|
|
7
8
|
export type ScreenshotGate = (typeof SCREENSHOT_GATES)[number];
|
|
8
9
|
/** The first status the gate refuses. */
|
|
9
10
|
export declare const MIN_FAILING_STATUS = 400;
|
|
10
11
|
/** Null when the status passes; otherwise why it does not. `null` status: the navigation had no response. */
|
|
11
12
|
export declare function findStatusFailure(status: number | null, url: string): string | null;
|
|
13
|
+
/** Null when the page scrolled to the offset; otherwise why the frame would show another place. */
|
|
14
|
+
export declare function findScrollFailure(reached: number, wanted: number): string | null;
|
|
12
15
|
/** Null when the file is large enough; otherwise why it is refused. */
|
|
13
16
|
export declare function findSizeFailure(bytes: number, minBytes: number): string | null;
|
|
14
17
|
//# sourceMappingURL=gates.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gates.d.ts","sourceRoot":"","sources":["../../src/screenshot/gates.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"gates.d.ts","sourceRoot":"","sources":["../../src/screenshot/gates.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,eAAO,MAAM,gBAAgB,yDAA0D,CAAC;AAExF,MAAM,MAAM,cAAc,GAAG,CAAC,OAAO,gBAAgB,CAAC,CAAC,MAAM,CAAC,CAAC;AAE/D,yCAAyC;AACzC,eAAO,MAAM,kBAAkB,MAAM,CAAC;AAEtC,6GAA6G;AAC7G,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAInF;AAKD,mGAAmG;AACnG,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAGhF;AAED,uEAAuE;AACvE,wBAAgB,eAAe,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAG9E"}
|
package/dist/screenshot/gates.js
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* The quality gates a screenshot passes before it is kept (FIRE's screenshot script): the page
|
|
3
|
-
* answered below HTTP 400, it
|
|
4
|
-
* blank page, an error page
|
|
3
|
+
* answered below HTTP 400, it reached the requested scroll offset, it shows the expected phrase, and
|
|
4
|
+
* the file is not suspiciously small. A blank page, an error page, a half-loaded one or a frame of
|
|
5
|
+
* the wrong place fails at least one of them.
|
|
5
6
|
*/
|
|
6
|
-
export const SCREENSHOT_GATES = ["load", "status", "phrase", "size"];
|
|
7
|
+
export const SCREENSHOT_GATES = ["load", "status", "scroll", "phrase", "size"];
|
|
7
8
|
/** The first status the gate refuses. */
|
|
8
9
|
export const MIN_FAILING_STATUS = 400;
|
|
9
10
|
/** Null when the status passes; otherwise why it does not. `null` status: the navigation had no response. */
|
|
@@ -14,6 +15,14 @@ export function findStatusFailure(status, url) {
|
|
|
14
15
|
return `HTTP ${status} from ${url}`;
|
|
15
16
|
return null;
|
|
16
17
|
}
|
|
18
|
+
/** Browsers report fractional offsets on scaled screens; half a pixel short still counts as there. */
|
|
19
|
+
const SCROLL_TOLERANCE_PX = 1;
|
|
20
|
+
/** Null when the page scrolled to the offset; otherwise why the frame would show another place. */
|
|
21
|
+
export function findScrollFailure(reached, wanted) {
|
|
22
|
+
if (reached >= wanted - SCROLL_TOLERANCE_PX)
|
|
23
|
+
return null;
|
|
24
|
+
return `the page scrolls only to ${Math.round(reached)} px, short of scrollTo ${wanted}`;
|
|
25
|
+
}
|
|
17
26
|
/** Null when the file is large enough; otherwise why it is refused. */
|
|
18
27
|
export function findSizeFailure(bytes, minBytes) {
|
|
19
28
|
if (bytes >= minBytes)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gates.js","sourceRoot":"","sources":["../../src/screenshot/gates.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"gates.js","sourceRoot":"","sources":["../../src/screenshot/gates.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,CAAU,CAAC;AAIxF,yCAAyC;AACzC,MAAM,CAAC,MAAM,kBAAkB,GAAG,GAAG,CAAC;AAEtC,6GAA6G;AAC7G,MAAM,UAAU,iBAAiB,CAAC,MAAqB,EAAE,GAAW;IAClE,IAAI,MAAM,KAAK,IAAI;QAAE,OAAO,yBAAyB,GAAG,EAAE,CAAC;IAC3D,IAAI,MAAM,IAAI,kBAAkB;QAAE,OAAO,QAAQ,MAAM,SAAS,GAAG,EAAE,CAAC;IACtE,OAAO,IAAI,CAAC;AACd,CAAC;AAED,sGAAsG;AACtG,MAAM,mBAAmB,GAAG,CAAC,CAAC;AAE9B,mGAAmG;AACnG,MAAM,UAAU,iBAAiB,CAAC,OAAe,EAAE,MAAc;IAC/D,IAAI,OAAO,IAAI,MAAM,GAAG,mBAAmB;QAAE,OAAO,IAAI,CAAC;IACzD,OAAO,4BAA4B,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,0BAA0B,MAAM,EAAE,CAAC;AAC3F,CAAC;AAED,uEAAuE;AACvE,MAAM,UAAU,eAAe,CAAC,KAAa,EAAE,QAAgB;IAC7D,IAAI,KAAK,IAAI,QAAQ;QAAE,OAAO,IAAI,CAAC;IACnC,OAAO,gBAAgB,KAAK,0BAA0B,QAAQ,oCAAoC,CAAC;AACrG,CAAC"}
|
|
@@ -47,4 +47,21 @@ export type ScreenshotResult = {
|
|
|
47
47
|
export declare function getScreenshotFile(outDir: string, name: string): string;
|
|
48
48
|
/** Takes every shot of every entry in order; one failing shot does not stop the others. */
|
|
49
49
|
export declare function takeScreenshots(options: TakeScreenshotsOptions): Promise<ScreenshotResult[]>;
|
|
50
|
+
export interface TakePageScreenshotOptions {
|
|
51
|
+
/** The shot's settings; its `path` is ignored, `url` is the page. */
|
|
52
|
+
entry: ScreenshotEntry;
|
|
53
|
+
/** The page to capture, any http(s) address. */
|
|
54
|
+
url: string;
|
|
55
|
+
/** The PNG to write; removed first, so a refused shot leaves no older file behind. */
|
|
56
|
+
file: string;
|
|
57
|
+
/** The scheme the browser prefers; `browser.colorScheme` when absent. */
|
|
58
|
+
scheme?: ColorTheme;
|
|
59
|
+
browser: ScreenshotBrowser;
|
|
60
|
+
executablePath?: string;
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* One page anywhere (`shots --page`): a competitor's page, production, a page of another app. The same browser
|
|
64
|
+
* settings and gates as an entry, one file at the given path, and no app is started.
|
|
65
|
+
*/
|
|
66
|
+
export declare function takePageScreenshot(options: TakePageScreenshotOptions): Promise<ScreenshotResult>;
|
|
50
67
|
//# sourceMappingURL=screenshot.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"screenshot.d.ts","sourceRoot":"","sources":["../../src/screenshot/screenshot.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAGzD,OAAO,
|
|
1
|
+
{"version":3,"file":"screenshot.d.ts","sourceRoot":"","sources":["../../src/screenshot/screenshot.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAGzD,OAAO,EAAyD,KAAK,cAAc,EAAE,MAAM,YAAY,CAAC;AAExG;;;;;;GAMG;AAEH,MAAM,MAAM,eAAe,GAAG,aAAa,CAAC,aAAa,CAAC,CAAC,MAAM,CAAC,CAAC;AAEnE,yEAAyE;AACzE,MAAM,WAAW,iBAAiB;IAChC,qDAAqD;IACrD,WAAW,EAAE,UAAU,CAAC;IACxB,4BAA4B;IAC5B,MAAM,EAAE,MAAM,CAAC;IACf,uCAAuC;IACvC,QAAQ,EAAE,MAAM,CAAC;IACjB,4EAA4E;IAC5E,aAAa,EAAE,MAAM,EAAE,CAAC;CACzB;AAED,MAAM,WAAW,sBAAsB;IACrC,OAAO,EAAE,eAAe,EAAE,CAAC;IAC3B,kEAAkE;IAClE,OAAO,EAAE,MAAM,CAAC;IAChB,uDAAuD;IACvD,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,iBAAiB,CAAC;IAC3B,kFAAkF;IAClF,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED,yFAAyF;AACzF,MAAM,MAAM,gBAAgB,GACxB;IAAE,EAAE,EAAE,IAAI,CAAC;IAAC,EAAE,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,GACnE;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,EAAE,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,cAAc,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAAC;AAUnF,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAEtE;AAoID,2FAA2F;AAC3F,wBAAsB,eAAe,CAAC,OAAO,EAAE,sBAAsB,GAAG,OAAO,CAAC,gBAAgB,EAAE,CAAC,CAiBlG;AAED,MAAM,WAAW,yBAAyB;IACxC,qEAAqE;IACrE,KAAK,EAAE,eAAe,CAAC;IACvB,gDAAgD;IAChD,GAAG,EAAE,MAAM,CAAC;IACZ,sFAAsF;IACtF,IAAI,EAAE,MAAM,CAAC;IACb,yEAAyE;IACzE,MAAM,CAAC,EAAE,UAAU,CAAC;IACpB,OAAO,EAAE,iBAAiB,CAAC;IAC3B,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED;;;GAGG;AACH,wBAAsB,kBAAkB,CAAC,OAAO,EAAE,yBAAyB,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAWtG"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { mkdirSync, rmSync, statSync } from "node:fs";
|
|
2
|
-
import { join } from "node:path";
|
|
2
|
+
import { basename, dirname, extname, join } from "node:path";
|
|
3
3
|
import { chromium, errors } from "playwright";
|
|
4
4
|
import { getScreenshotNames, getScreenshotShots } from "../config/screenshot-names.js";
|
|
5
5
|
import { containsPhrase } from "../film.js";
|
|
6
|
-
import { findSizeFailure, findStatusFailure } from "./gates.js";
|
|
6
|
+
import { findScrollFailure, findSizeFailure, findStatusFailure } from "./gates.js";
|
|
7
7
|
const NAVIGATION_TIMEOUT_MS = 30_000;
|
|
8
8
|
/** How long client-side rendering gets to show the expected phrase after the page loaded. */
|
|
9
9
|
const PHRASE_TIMEOUT_MS = 5000;
|
|
@@ -72,6 +72,17 @@ async function captureLoadedPage(page, target) {
|
|
|
72
72
|
await page.evaluate(() => document.fonts.ready);
|
|
73
73
|
if (entry.full)
|
|
74
74
|
await scrollThroughPage(page);
|
|
75
|
+
if (entry.scrollTo !== undefined) {
|
|
76
|
+
const reached = await page.evaluate((top) => {
|
|
77
|
+
window.scrollTo(0, top);
|
|
78
|
+
return window.scrollY;
|
|
79
|
+
}, entry.scrollTo);
|
|
80
|
+
const scrollFailure = findScrollFailure(reached, entry.scrollTo);
|
|
81
|
+
if (scrollFailure !== null)
|
|
82
|
+
return { ok: false, id: entry.id, name, gate: "scroll", message: scrollFailure };
|
|
83
|
+
}
|
|
84
|
+
if (entry.waitMs > 0)
|
|
85
|
+
await page.waitForTimeout(entry.waitMs);
|
|
75
86
|
if (!(await waitForPhrase(page, entry.expect))) {
|
|
76
87
|
return { ok: false, id: entry.id, name, gate: "phrase", message: `${url} does not show "${entry.expect}"` };
|
|
77
88
|
}
|
|
@@ -90,14 +101,17 @@ function removeEntryFiles(outDir, entry) {
|
|
|
90
101
|
rmSync(getScreenshotFile(outDir, name), { force: true });
|
|
91
102
|
}
|
|
92
103
|
async function takeShot(options) {
|
|
93
|
-
const { browser, settings,
|
|
104
|
+
const { browser, settings, target, scheme } = options;
|
|
105
|
+
const { entry } = target;
|
|
94
106
|
const context = await browser.newContext({
|
|
95
107
|
viewport: { width: entry.width, height: entry.height },
|
|
96
108
|
deviceScaleFactor: entry.scale,
|
|
97
|
-
colorScheme:
|
|
109
|
+
colorScheme: scheme,
|
|
98
110
|
locale: settings.locale,
|
|
99
111
|
timezoneId: settings.timezone,
|
|
100
112
|
reducedMotion: entry.motion,
|
|
113
|
+
// Resolved to an absolute path by the caller (the CLI resolves it against the folder of marketing.json).
|
|
114
|
+
...(entry.storageState === undefined ? {} : { storageState: entry.storageState }),
|
|
101
115
|
});
|
|
102
116
|
try {
|
|
103
117
|
const page = await context.newPage();
|
|
@@ -114,7 +128,6 @@ async function takeShot(options) {
|
|
|
114
128
|
}
|
|
115
129
|
});
|
|
116
130
|
}, css);
|
|
117
|
-
const target = { entry, name: shot.name, url: new URL(entry.path, options.baseUrl).href, file: getScreenshotFile(options.outDir, shot.name) };
|
|
118
131
|
return await takeOne(page, target);
|
|
119
132
|
}
|
|
120
133
|
finally {
|
|
@@ -131,7 +144,8 @@ export async function takeScreenshots(options) {
|
|
|
131
144
|
for (const entry of entries) {
|
|
132
145
|
removeEntryFiles(outDir, entry);
|
|
133
146
|
for (const shot of getScreenshotShots(entry, settings.colorScheme)) {
|
|
134
|
-
|
|
147
|
+
const target = { entry, name: shot.name, url: new URL(entry.path, baseUrl).href, file: getScreenshotFile(outDir, shot.name) };
|
|
148
|
+
results.push(await takeShot({ browser, settings, target, scheme: shot.scheme }));
|
|
135
149
|
}
|
|
136
150
|
}
|
|
137
151
|
}
|
|
@@ -140,4 +154,21 @@ export async function takeScreenshots(options) {
|
|
|
140
154
|
}
|
|
141
155
|
return results;
|
|
142
156
|
}
|
|
157
|
+
/**
|
|
158
|
+
* One page anywhere (`shots --page`): a competitor's page, production, a page of another app. The same browser
|
|
159
|
+
* settings and gates as an entry, one file at the given path, and no app is started.
|
|
160
|
+
*/
|
|
161
|
+
export async function takePageScreenshot(options) {
|
|
162
|
+
const { entry, url, file, browser: settings } = options;
|
|
163
|
+
rmSync(file, { force: true });
|
|
164
|
+
mkdirSync(dirname(file), { recursive: true });
|
|
165
|
+
const browser = await chromium.launch(options.executablePath === undefined ? {} : { executablePath: options.executablePath });
|
|
166
|
+
try {
|
|
167
|
+
const target = { entry, name: basename(file, extname(file)), url, file };
|
|
168
|
+
return await takeShot({ browser, settings, target, scheme: options.scheme ?? settings.colorScheme });
|
|
169
|
+
}
|
|
170
|
+
finally {
|
|
171
|
+
await browser.close();
|
|
172
|
+
}
|
|
173
|
+
}
|
|
143
174
|
//# sourceMappingURL=screenshot.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"screenshot.js","sourceRoot":"","sources":["../../src/screenshot/screenshot.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AACtD,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"screenshot.js","sourceRoot":"","sources":["../../src/screenshot/screenshot.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AACtD,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAE7D,OAAO,EAAE,QAAQ,EAAE,MAAM,EAA2B,MAAM,YAAY,CAAC;AAIvE,OAAO,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AACvF,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAC5C,OAAO,EAAE,iBAAiB,EAAE,eAAe,EAAE,iBAAiB,EAAuB,MAAM,YAAY,CAAC;AAwCxG,MAAM,qBAAqB,GAAG,MAAM,CAAC;AACrC,6FAA6F;AAC7F,MAAM,iBAAiB,GAAG,IAAI,CAAC;AAC/B,MAAM,cAAc,GAAG,GAAG,CAAC;AAC3B,0FAA0F;AAC1F,MAAM,gBAAgB,GAAG,GAAG,CAAC;AAC7B,MAAM,eAAe,GAAG,GAAG,CAAC;AAE5B,MAAM,UAAU,iBAAiB,CAAC,MAAc,EAAE,IAAY;IAC5D,OAAO,IAAI,CAAC,MAAM,EAAE,GAAG,IAAI,MAAM,CAAC,CAAC;AACrC,CAAC;AAED,2GAA2G;AAC3G,KAAK,UAAU,iBAAiB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,CAAC;IACD,OAAO,OAAO,CAAC;AACjB,CAAC;AAeD;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,kBAAkB,CAAC,OAAkC;IACzE,MAAM,EAAE,KAAK,EAAE,GAAG,EAAE,IAAI,EAAE,OAAO,EAAE,QAAQ,EAAE,GAAG,OAAO,CAAC;IACxD,MAAM,CAAC,IAAI,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;IAC9B,SAAS,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IAC9C,MAAM,OAAO,GAAG,MAAM,QAAQ,CAAC,MAAM,CAAC,OAAO,CAAC,cAAc,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,cAAc,EAAE,OAAO,CAAC,cAAc,EAAE,CAAC,CAAC;IAC9H,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,EAAE,KAAK,EAAE,IAAI,EAAE,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC,EAAE,GAAG,EAAE,IAAI,EAAE,CAAC;QACzE,OAAO,MAAM,QAAQ,CAAC,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,MAAM,IAAI,QAAQ,CAAC,WAAW,EAAE,CAAC,CAAC;IACvG,CAAC;YAAS,CAAC;QACT,MAAM,OAAO,CAAC,KAAK,EAAE,CAAC;IACxB,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A Playwright storage state (`{ cookies, origins }`) restores a signed-in session for a screenshot. Checked before
|
|
3
|
+
* the browser starts, so a missing or broken file is reported by name instead of as a browser error halfway through
|
|
4
|
+
* the run. The file holds session cookies: its contents are never printed.
|
|
5
|
+
*/
|
|
6
|
+
export declare const STORAGE_STATE_HINT = "create it with your app's login script (context.storageState({ path })) or npx playwright codegen --save-storage=<file> <url>";
|
|
7
|
+
/** Null when the file looks like a storage state; otherwise what is wrong with it, without its contents. */
|
|
8
|
+
export declare function findStorageStateProblem(path: string): string | null;
|
|
9
|
+
//# sourceMappingURL=storage-state.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"storage-state.d.ts","sourceRoot":"","sources":["../../src/screenshot/storage-state.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AAEH,eAAO,MAAM,kBAAkB,kIAAkI,CAAC;AAElK,4GAA4G;AAC5G,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAYnE"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { existsSync, readFileSync } from "node:fs";
|
|
2
|
+
/**
|
|
3
|
+
* A Playwright storage state (`{ cookies, origins }`) restores a signed-in session for a screenshot. Checked before
|
|
4
|
+
* the browser starts, so a missing or broken file is reported by name instead of as a browser error halfway through
|
|
5
|
+
* the run. The file holds session cookies: its contents are never printed.
|
|
6
|
+
*/
|
|
7
|
+
export const STORAGE_STATE_HINT = "create it with your app's login script (context.storageState({ path })) or npx playwright codegen --save-storage=<file> <url>";
|
|
8
|
+
/** Null when the file looks like a storage state; otherwise what is wrong with it, without its contents. */
|
|
9
|
+
export function findStorageStateProblem(path) {
|
|
10
|
+
if (!existsSync(path))
|
|
11
|
+
return `the storage state ${path} does not exist; ${STORAGE_STATE_HINT}`;
|
|
12
|
+
let data;
|
|
13
|
+
try {
|
|
14
|
+
data = JSON.parse(readFileSync(path, "utf8"));
|
|
15
|
+
}
|
|
16
|
+
catch {
|
|
17
|
+
// The parse error would quote the file, which holds a session; the path is enough to find it.
|
|
18
|
+
return `the storage state ${path} is not JSON; ${STORAGE_STATE_HINT}`;
|
|
19
|
+
}
|
|
20
|
+
const isStorageState = typeof data === "object" && data !== null && Array.isArray(data.cookies);
|
|
21
|
+
if (!isStorageState)
|
|
22
|
+
return `the storage state ${path} has no "cookies" list, so it is not a Playwright storage state; ${STORAGE_STATE_HINT}`;
|
|
23
|
+
return null;
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=storage-state.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"storage-state.js","sourceRoot":"","sources":["../../src/screenshot/storage-state.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAEnD;;;;GAIG;AAEH,MAAM,CAAC,MAAM,kBAAkB,GAAG,+HAA+H,CAAC;AAElK,4GAA4G;AAC5G,MAAM,UAAU,uBAAuB,CAAC,IAAY;IAClD,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC;QAAE,OAAO,qBAAqB,IAAI,oBAAoB,kBAAkB,EAAE,CAAC;IAChG,IAAI,IAAa,CAAC;IAClB,IAAI,CAAC;QACH,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC,CAAC;IAChD,CAAC;IAAC,MAAM,CAAC;QACP,8FAA8F;QAC9F,OAAO,qBAAqB,IAAI,iBAAiB,kBAAkB,EAAE,CAAC;IACxE,CAAC;IACD,MAAM,cAAc,GAAG,OAAO,IAAI,KAAK,QAAQ,IAAI,IAAI,KAAK,IAAI,IAAI,KAAK,CAAC,OAAO,CAAE,IAA8B,CAAC,OAAO,CAAC,CAAC;IAC3H,IAAI,CAAC,cAAc;QAAE,OAAO,qBAAqB,IAAI,oEAAoE,kBAAkB,EAAE,CAAC;IAC9I,OAAO,IAAI,CAAC;AACd,CAAC"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { Voiceover } from "./cache.js";
|
|
2
|
+
import type { TimedWord } from "./voiceover.js";
|
|
3
|
+
/**
|
|
4
|
+
* A free stand-in for the paid voiceover, so a film can be recorded and rendered end to end before anyone pays
|
|
5
|
+
* (`all`/`record`/`render --placeholder`): every word at a fixed pace, a pause between sentences, and a quiet tone as
|
|
6
|
+
* the audio. It lives in the film's build folder under its own key, never in `voice.cacheDir`: a placeholder in the
|
|
7
|
+
* cache would be a cache hit for the real key, so the paid recording would never be made.
|
|
8
|
+
*/
|
|
9
|
+
export interface PlaceholderPace {
|
|
10
|
+
/** Words spoken per second (`voice.placeholder.wordsPerSecond`). */
|
|
11
|
+
wordsPerSecond: number;
|
|
12
|
+
/** Silence after every sentence but the last (`voice.placeholder.sentencePauseSeconds`). */
|
|
13
|
+
sentencePauseSeconds: number;
|
|
14
|
+
}
|
|
15
|
+
/** The key a recording made on the placeholder carries in its log, so it never renders with the real voiceover. */
|
|
16
|
+
export declare const PLACEHOLDER_KEY_PREFIX = "placeholder-";
|
|
17
|
+
export declare function getPlaceholderKey(voiceoverKey: string): string;
|
|
18
|
+
export declare function isPlaceholderKey(key: string | undefined): boolean;
|
|
19
|
+
/** The words of the script, evenly paced, with a pause after every sentence; the shape the provider returns. */
|
|
20
|
+
export declare function makePlaceholderWords(sentences: {
|
|
21
|
+
text: string;
|
|
22
|
+
}[], pace: PlaceholderPace): TimedWord[];
|
|
23
|
+
/** How long the placeholder's audio lasts: past the last word by the tail. */
|
|
24
|
+
export declare function getPlaceholderSeconds(words: TimedWord[]): number;
|
|
25
|
+
export interface WritePlaceholderOptions {
|
|
26
|
+
/** The folder of the placeholder's files: `<output.buildDir>/<video>/placeholder/`. */
|
|
27
|
+
dir: string;
|
|
28
|
+
sentences: {
|
|
29
|
+
text: string;
|
|
30
|
+
}[];
|
|
31
|
+
pace: PlaceholderPace;
|
|
32
|
+
}
|
|
33
|
+
/** Writes `voiceover.json` (the words) and `voiceover.mp3` (a quiet tone as long as them); needs ffmpeg in PATH. */
|
|
34
|
+
export declare function writePlaceholderVoiceover(options: WritePlaceholderOptions): Voiceover;
|
|
35
|
+
//# sourceMappingURL=placeholder.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"placeholder.d.ts","sourceRoot":"","sources":["../../src/voice/placeholder.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAC5C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAEhD;;;;;GAKG;AAEH,MAAM,WAAW,eAAe;IAC9B,oEAAoE;IACpE,cAAc,EAAE,MAAM,CAAC;IACvB,4FAA4F;IAC5F,oBAAoB,EAAE,MAAM,CAAC;CAC9B;AAED,mHAAmH;AACnH,eAAO,MAAM,sBAAsB,iBAAiB,CAAC;AAYrD,wBAAgB,iBAAiB,CAAC,YAAY,EAAE,MAAM,GAAG,MAAM,CAE9D;AAED,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,GAAG,OAAO,CAEjE;AAED,gHAAgH;AAChH,wBAAgB,oBAAoB,CAAC,SAAS,EAAE;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,EAAE,EAAE,IAAI,EAAE,eAAe,GAAG,SAAS,EAAE,CAYtG;AAED,8EAA8E;AAC9E,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,SAAS,EAAE,GAAG,MAAM,CAEhE;AAED,MAAM,WAAW,uBAAuB;IACtC,uFAAuF;IACvF,GAAG,EAAE,MAAM,CAAC;IACZ,SAAS,EAAE;QAAE,IAAI,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IAC9B,IAAI,EAAE,eAAe,CAAC;CACvB;AAED,oHAAoH;AACpH,wBAAgB,yBAAyB,CAAC,OAAO,EAAE,uBAAuB,GAAG,SAAS,CAYrF"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { spawnSync } from "node:child_process";
|
|
2
|
+
import { mkdirSync, writeFileSync } from "node:fs";
|
|
3
|
+
import { join } from "node:path";
|
|
4
|
+
/** The key a recording made on the placeholder carries in its log, so it never renders with the real voiceover. */
|
|
5
|
+
export const PLACEHOLDER_KEY_PREFIX = "placeholder-";
|
|
6
|
+
/** Silence before the first word and after the last, so the tone does not start or end on a word. */
|
|
7
|
+
const LEAD_SECONDS = 0.1;
|
|
8
|
+
const TAIL_SECONDS = 0.5;
|
|
9
|
+
/** A word ends a little before the next starts, as in a real recording's timings. */
|
|
10
|
+
const WORD_GAP_SECONDS = 0.05;
|
|
11
|
+
const TONE_HZ = 220;
|
|
12
|
+
const TONE_VOLUME = 0.05;
|
|
13
|
+
const round = (value) => Math.round(value * 1000) / 1000;
|
|
14
|
+
export function getPlaceholderKey(voiceoverKey) {
|
|
15
|
+
return `${PLACEHOLDER_KEY_PREFIX}${voiceoverKey}`;
|
|
16
|
+
}
|
|
17
|
+
export function isPlaceholderKey(key) {
|
|
18
|
+
return key?.startsWith(PLACEHOLDER_KEY_PREFIX) ?? false;
|
|
19
|
+
}
|
|
20
|
+
/** The words of the script, evenly paced, with a pause after every sentence; the shape the provider returns. */
|
|
21
|
+
export function makePlaceholderWords(sentences, pace) {
|
|
22
|
+
const wordSeconds = 1 / pace.wordsPerSecond;
|
|
23
|
+
const words = [];
|
|
24
|
+
let time = LEAD_SECONDS;
|
|
25
|
+
sentences.forEach((sentence, index) => {
|
|
26
|
+
for (const text of sentence.text.trim().split(/\s+/).filter((word) => word.length > 0)) {
|
|
27
|
+
words.push({ text, start: round(time), end: round(time + wordSeconds - WORD_GAP_SECONDS) });
|
|
28
|
+
time += wordSeconds;
|
|
29
|
+
}
|
|
30
|
+
if (index < sentences.length - 1)
|
|
31
|
+
time += pace.sentencePauseSeconds;
|
|
32
|
+
});
|
|
33
|
+
return words;
|
|
34
|
+
}
|
|
35
|
+
/** How long the placeholder's audio lasts: past the last word by the tail. */
|
|
36
|
+
export function getPlaceholderSeconds(words) {
|
|
37
|
+
return round((words.at(-1)?.end ?? 0) + TAIL_SECONDS);
|
|
38
|
+
}
|
|
39
|
+
/** Writes `voiceover.json` (the words) and `voiceover.mp3` (a quiet tone as long as them); needs ffmpeg in PATH. */
|
|
40
|
+
export function writePlaceholderVoiceover(options) {
|
|
41
|
+
const words = makePlaceholderWords(options.sentences, options.pace);
|
|
42
|
+
mkdirSync(options.dir, { recursive: true });
|
|
43
|
+
const audio = join(options.dir, "voiceover.mp3");
|
|
44
|
+
const seconds = getPlaceholderSeconds(words);
|
|
45
|
+
const tone = ["-v", "error", "-y", "-f", "lavfi", "-i", `sine=frequency=${TONE_HZ}:duration=${seconds}`, "-filter:a", `volume=${TONE_VOLUME}`];
|
|
46
|
+
const result = spawnSync("ffmpeg", [...tone, "-c:a", "libmp3lame", "-q:a", "6", audio], { encoding: "utf8" });
|
|
47
|
+
if (result.status !== 0) {
|
|
48
|
+
throw new Error(`ffmpeg could not write the placeholder voiceover ${audio}: ${result.error?.message ?? result.stderr.trim()}`);
|
|
49
|
+
}
|
|
50
|
+
writeFileSync(join(options.dir, "voiceover.json"), `${JSON.stringify(words, null, 1)}\n`);
|
|
51
|
+
return { audio, words };
|
|
52
|
+
}
|
|
53
|
+
//# sourceMappingURL=placeholder.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"placeholder.js","sourceRoot":"","sources":["../../src/voice/placeholder.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACnD,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAmBjC,mHAAmH;AACnH,MAAM,CAAC,MAAM,sBAAsB,GAAG,cAAc,CAAC;AAErD,qGAAqG;AACrG,MAAM,YAAY,GAAG,GAAG,CAAC;AACzB,MAAM,YAAY,GAAG,GAAG,CAAC;AACzB,qFAAqF;AACrF,MAAM,gBAAgB,GAAG,IAAI,CAAC;AAC9B,MAAM,OAAO,GAAG,GAAG,CAAC;AACpB,MAAM,WAAW,GAAG,IAAI,CAAC;AAEzB,MAAM,KAAK,GAAG,CAAC,KAAa,EAAU,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,GAAG,IAAI,CAAC,GAAG,IAAI,CAAC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
|
{
|
|
2
2
|
"name": "@softure-ai/marketing-kit",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.8",
|
|
4
4
|
"description": "SOFTURE AI marketing kit: a CLI that turns a project's real app into a vertical film (cached voiceover, frame-by-frame recording, HTML composition, hyperframes render) plus per-platform post copy and OG images.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|