@softure-ai/marketing-kit 0.1.7 → 0.1.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (129) hide show
  1. package/CHANGELOG.md +23 -0
  2. package/README.md +107 -15
  3. package/dist/cli/main.js +84 -29
  4. package/dist/cli/main.js.map +1 -1
  5. package/dist/cli/og.d.ts +4 -1
  6. package/dist/cli/og.d.ts.map +1 -1
  7. package/dist/cli/og.js +15 -7
  8. package/dist/cli/og.js.map +1 -1
  9. package/dist/cli/options.d.ts +26 -2
  10. package/dist/cli/options.d.ts.map +1 -1
  11. package/dist/cli/options.js +97 -9
  12. package/dist/cli/options.js.map +1 -1
  13. package/dist/cli/voice.d.ts +14 -0
  14. package/dist/cli/voice.d.ts.map +1 -1
  15. package/dist/cli/voice.js +13 -0
  16. package/dist/cli/voice.js.map +1 -1
  17. package/dist/config/actions-schema.d.ts +21 -15
  18. package/dist/config/actions-schema.d.ts.map +1 -1
  19. package/dist/config/actions-schema.js +18 -3
  20. package/dist/config/actions-schema.js.map +1 -1
  21. package/dist/config/config.d.ts +2 -0
  22. package/dist/config/config.d.ts.map +1 -1
  23. package/dist/config/config.js +2 -2
  24. package/dist/config/config.js.map +1 -1
  25. package/dist/config/og-image-names.d.ts +7 -0
  26. package/dist/config/og-image-names.d.ts.map +1 -0
  27. package/dist/config/og-image-names.js +9 -0
  28. package/dist/config/og-image-names.js.map +1 -0
  29. package/dist/config/schema.d.ts +111 -16
  30. package/dist/config/schema.d.ts.map +1 -1
  31. package/dist/config/schema.js +77 -11
  32. package/dist/config/schema.js.map +1 -1
  33. package/dist/film.d.ts +20 -5
  34. package/dist/film.d.ts.map +1 -1
  35. package/dist/film.js.map +1 -1
  36. package/dist/index.d.ts +5 -3
  37. package/dist/index.d.ts.map +1 -1
  38. package/dist/index.js +5 -3
  39. package/dist/index.js.map +1 -1
  40. package/dist/og/index.d.ts +3 -3
  41. package/dist/og/index.d.ts.map +1 -1
  42. package/dist/og/index.js +3 -2
  43. package/dist/og/index.js.map +1 -1
  44. package/dist/og/render.d.ts +13 -0
  45. package/dist/og/render.d.ts.map +1 -1
  46. package/dist/og/render.js +31 -6
  47. package/dist/og/render.js.map +1 -1
  48. package/dist/og/templates/big-number.d.ts +7 -0
  49. package/dist/og/templates/big-number.d.ts.map +1 -0
  50. package/dist/og/templates/big-number.js +41 -0
  51. package/dist/og/templates/big-number.js.map +1 -0
  52. package/dist/og/templates/carousel.d.ts +5 -0
  53. package/dist/og/templates/carousel.d.ts.map +1 -0
  54. package/dist/og/templates/carousel.js +26 -0
  55. package/dist/og/templates/carousel.js.map +1 -0
  56. package/dist/og/templates/context.d.ts +11 -3
  57. package/dist/og/templates/context.d.ts.map +1 -1
  58. package/dist/og/templates/context.js +6 -0
  59. package/dist/og/templates/context.js.map +1 -1
  60. package/dist/og/templates/frame.d.ts +2 -2
  61. package/dist/og/templates/frame.d.ts.map +1 -1
  62. package/dist/og/templates/frame.js +2 -2
  63. package/dist/og/templates/frame.js.map +1 -1
  64. package/dist/og/templates/index.d.ts +8 -3
  65. package/dist/og/templates/index.d.ts.map +1 -1
  66. package/dist/og/templates/index.js +18 -5
  67. package/dist/og/templates/index.js.map +1 -1
  68. package/dist/og/templates/portrait.d.ts +22 -0
  69. package/dist/og/templates/portrait.d.ts.map +1 -0
  70. package/dist/og/templates/portrait.js +75 -0
  71. package/dist/og/templates/portrait.js.map +1 -0
  72. package/dist/og/templates/schemas.d.ts +28 -0
  73. package/dist/og/templates/schemas.d.ts.map +1 -1
  74. package/dist/og/templates/schemas.js +26 -0
  75. package/dist/og/templates/schemas.js.map +1 -1
  76. package/dist/record/actions.d.ts.map +1 -1
  77. package/dist/record/actions.js +6 -1
  78. package/dist/record/actions.js.map +1 -1
  79. package/dist/record/record.d.ts.map +1 -1
  80. package/dist/record/record.js +51 -17
  81. package/dist/record/record.js.map +1 -1
  82. package/dist/record/screen-guard.d.ts +13 -0
  83. package/dist/record/screen-guard.d.ts.map +1 -0
  84. package/dist/record/screen-guard.js +27 -0
  85. package/dist/record/screen-guard.js.map +1 -0
  86. package/dist/screenshot/gates.d.ts +6 -3
  87. package/dist/screenshot/gates.d.ts.map +1 -1
  88. package/dist/screenshot/gates.js +12 -3
  89. package/dist/screenshot/gates.js.map +1 -1
  90. package/dist/screenshot/screenshot.d.ts +17 -0
  91. package/dist/screenshot/screenshot.d.ts.map +1 -1
  92. package/dist/screenshot/screenshot.js +37 -6
  93. package/dist/screenshot/screenshot.js.map +1 -1
  94. package/dist/screenshot/storage-state.d.ts +9 -0
  95. package/dist/screenshot/storage-state.d.ts.map +1 -0
  96. package/dist/screenshot/storage-state.js +25 -0
  97. package/dist/screenshot/storage-state.js.map +1 -0
  98. package/dist/voice/placeholder.d.ts +35 -0
  99. package/dist/voice/placeholder.d.ts.map +1 -0
  100. package/dist/voice/placeholder.js +53 -0
  101. package/dist/voice/placeholder.js.map +1 -0
  102. package/package.json +2 -1
  103. package/schema/marketing.schema.json +392 -43
  104. package/src/cli/main.ts +80 -27
  105. package/src/cli/og.ts +14 -6
  106. package/src/cli/options.ts +109 -10
  107. package/src/cli/voice.ts +20 -0
  108. package/src/config/actions-schema.ts +18 -3
  109. package/src/config/config.ts +4 -3
  110. package/src/config/og-image-names.ts +7 -0
  111. package/src/config/schema.ts +91 -13
  112. package/src/film.ts +15 -5
  113. package/src/index.ts +7 -1
  114. package/src/og/index.ts +16 -2
  115. package/src/og/render.ts +36 -6
  116. package/src/og/templates/big-number.ts +44 -0
  117. package/src/og/templates/carousel.ts +27 -0
  118. package/src/og/templates/context.ts +16 -3
  119. package/src/og/templates/frame.ts +2 -2
  120. package/src/og/templates/index.ts +31 -9
  121. package/src/og/templates/portrait.ts +126 -0
  122. package/src/og/templates/schemas.ts +35 -0
  123. package/src/record/actions.ts +6 -1
  124. package/src/record/record.ts +53 -19
  125. package/src/record/screen-guard.ts +37 -0
  126. package/src/screenshot/gates.ts +13 -3
  127. package/src/screenshot/screenshot.ts +51 -11
  128. package/src/screenshot/storage-state.ts +24 -0
  129. package/src/voice/placeholder.ts +83 -0
@@ -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":"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"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@softure-ai/marketing-kit",
3
- "version": "0.1.7",
3
+ "version": "0.1.9",
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",
@@ -15,6 +15,7 @@
15
15
  },
16
16
  "files": [
17
17
  "dist",
18
+ "CHANGELOG.md",
18
19
  "src",
19
20
  "schema",
20
21
  "!src/**/*.test.ts",
@@ -482,6 +482,28 @@
482
482
  "description": "The paid voiceover cache (<key>.mp3 and <key>.json), relative to the folder of marketing.json; commit it.",
483
483
  "type": "string",
484
484
  "minLength": 1
485
+ },
486
+ "placeholder": {
487
+ "description": "The free placeholder voiceover of --placeholder (a quiet tone, words at a fixed pace), to record and render a film before paying for its voiceover.",
488
+ "default": {},
489
+ "type": "object",
490
+ "properties": {
491
+ "wordsPerSecond": {
492
+ "default": 2.5,
493
+ "description": "Words per second of the placeholder voiceover (0.5-6, default 2.5); match the real voice to rehearse the film's length.",
494
+ "type": "number",
495
+ "minimum": 0.5,
496
+ "maximum": 6
497
+ },
498
+ "sentencePauseSeconds": {
499
+ "default": 0.5,
500
+ "description": "Silence after every sentence of the placeholder voiceover but the last (0-3 s, default 0.5).",
501
+ "type": "number",
502
+ "minimum": 0,
503
+ "maximum": 3
504
+ }
505
+ },
506
+ "additionalProperties": false
485
507
  }
486
508
  },
487
509
  "required": [
@@ -950,13 +972,45 @@
950
972
  ],
951
973
  "additionalProperties": false
952
974
  },
975
+ {
976
+ "type": "object",
977
+ "properties": {
978
+ "do": {
979
+ "type": "string",
980
+ "const": "press",
981
+ "description": "Presses a key on the focused element, e.g. Backspace, Enter or ControlOrMeta+A."
982
+ },
983
+ "key": {
984
+ "type": "string",
985
+ "pattern": "^\\S+$",
986
+ "description": "A Playwright key name; modifiers joined with +, ControlOrMeta for the platform's shortcut key."
987
+ },
988
+ "times": {
989
+ "description": "How many times the key is pressed (1-50, default 1).",
990
+ "type": "integer",
991
+ "minimum": 1,
992
+ "maximum": 50
993
+ },
994
+ "perKey": {
995
+ "description": "Seconds held after each press (0-10, default 0.13).",
996
+ "type": "number",
997
+ "minimum": 0,
998
+ "maximum": 10
999
+ }
1000
+ },
1001
+ "required": [
1002
+ "do",
1003
+ "key"
1004
+ ],
1005
+ "additionalProperties": false
1006
+ },
953
1007
  {
954
1008
  "type": "object",
955
1009
  "properties": {
956
1010
  "do": {
957
1011
  "type": "string",
958
1012
  "const": "fill",
959
- "description": "Taps input[name=<input>], moves the camera onto it and types the value."
1013
+ "description": "Taps input[name=<input>], moves the camera onto it, deletes a value already there and types the value."
960
1014
  },
961
1015
  "input": {
962
1016
  "type": "string",
@@ -966,6 +1020,10 @@
966
1020
  "value": {
967
1021
  "type": "string",
968
1022
  "description": "The text typed into the input."
1023
+ },
1024
+ "clear": {
1025
+ "description": "Select and delete a value already in the input before typing, on screen (default true); false types after it.",
1026
+ "type": "boolean"
969
1027
  }
970
1028
  },
971
1029
  "required": [
@@ -2323,7 +2381,7 @@
2323
2381
  "do": {
2324
2382
  "type": "string",
2325
2383
  "const": "checkScreen",
2326
- "description": "Runs the screen guard now: every screenGuard phrase must be on screen."
2384
+ "description": "Runs the screen guard now: the video's screenGuard phrases and the current sentence's must be on screen."
2327
2385
  }
2328
2386
  },
2329
2387
  "required": [
@@ -2333,6 +2391,14 @@
2333
2391
  }
2334
2392
  ]
2335
2393
  }
2394
+ },
2395
+ "screenGuard": {
2396
+ "description": "Phrases this sentence says that the screen must show while it is spoken: checked at a checkScreen inside the sentence, or when the sentence ends. Not on the first sentence.",
2397
+ "minItems": 1,
2398
+ "type": "array",
2399
+ "items": {
2400
+ "type": "string"
2401
+ }
2336
2402
  }
2337
2403
  },
2338
2404
  "required": [
@@ -2406,12 +2472,12 @@
2406
2472
  "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
2407
2473
  },
2408
2474
  "screenGuard": {
2409
- "minItems": 1,
2475
+ "default": [],
2476
+ "description": "Phrases the voiceover says that the screen must show at every checkScreen; a missing one stops the recording. May be left out when the sentences carry their own screenGuard.",
2410
2477
  "type": "array",
2411
2478
  "items": {
2412
2479
  "type": "string"
2413
- },
2414
- "description": "Phrases the voiceover says that the screen must show; a missing one stops the recording."
2480
+ }
2415
2481
  },
2416
2482
  "endCard": {
2417
2483
  "type": "object",
@@ -2452,7 +2518,6 @@
2452
2518
  "persona",
2453
2519
  "beats",
2454
2520
  "hook",
2455
- "screenGuard",
2456
2521
  "endCard"
2457
2522
  ],
2458
2523
  "additionalProperties": false
@@ -2644,6 +2709,24 @@
2644
2709
  "dark"
2645
2710
  ]
2646
2711
  }
2712
+ },
2713
+ "scrollTo": {
2714
+ "description": "Capture one viewport frame scrolled to this many CSS pixels from the top (e.g. to check scroll-driven motion, with motion: \"no-preference\"); refused when the page cannot scroll that far. Not with full.",
2715
+ "type": "integer",
2716
+ "minimum": 0,
2717
+ "maximum": 9007199254740991
2718
+ },
2719
+ "waitMs": {
2720
+ "default": 0,
2721
+ "description": "Milliseconds to wait after the page loaded (and scrolled) before the phrase gate reads it, for animations to settle (0-60000, default 0).",
2722
+ "type": "integer",
2723
+ "minimum": 0,
2724
+ "maximum": 60000
2725
+ },
2726
+ "storageState": {
2727
+ "description": "A Playwright storage state (cookies and localStorage as JSON), relative to the folder of marketing.json, to capture a signed-in screen. It holds a session: keep it out of git.",
2728
+ "type": "string",
2729
+ "minLength": 1
2647
2730
  }
2648
2731
  },
2649
2732
  "required": [
@@ -2657,7 +2740,6 @@
2657
2740
  }
2658
2741
  },
2659
2742
  "ogImages": {
2660
- "default": [],
2661
2743
  "description": "Open Graph images rendered by softure-marketing og.",
2662
2744
  "type": "array",
2663
2745
  "items": {
@@ -2668,30 +2750,39 @@
2668
2750
  "id": {
2669
2751
  "type": "string",
2670
2752
  "pattern": "^[a-z0-9]+(-[a-z0-9]+)*$",
2671
- "description": "The image's id: the file <output.dir>/og/<id>.png."
2753
+ "description": "The image's id: the file <output.dir>/og/<id>.png (a carousel writes <id>-1.png, <id>-2.png and so on)."
2672
2754
  },
2673
2755
  "size": {
2674
- "default": [
2675
- 1200,
2676
- 630
2677
- ],
2678
- "description": "The image size in pixels, [width, height].",
2679
- "type": "array",
2680
- "prefixItems": [
2756
+ "description": "The image size: \"landscape\" (1200×630), \"portrait\" (1080×1350), \"square\" (1080×1080), \"story\" (1080×1920) or [width, height] in pixels; \"landscape\" by default.",
2757
+ "anyOf": [
2681
2758
  {
2682
- "type": "integer",
2683
- "minimum": 1,
2684
- "maximum": 4000
2759
+ "type": "array",
2760
+ "prefixItems": [
2761
+ {
2762
+ "type": "integer",
2763
+ "minimum": 1,
2764
+ "maximum": 4000
2765
+ },
2766
+ {
2767
+ "type": "integer",
2768
+ "minimum": 1,
2769
+ "maximum": 4000
2770
+ }
2771
+ ],
2772
+ "items": false,
2773
+ "minItems": 2,
2774
+ "maxItems": 2
2685
2775
  },
2686
2776
  {
2687
- "type": "integer",
2688
- "minimum": 1,
2689
- "maximum": 4000
2777
+ "type": "string",
2778
+ "enum": [
2779
+ "landscape",
2780
+ "portrait",
2781
+ "square",
2782
+ "story"
2783
+ ]
2690
2784
  }
2691
- ],
2692
- "items": false,
2693
- "minItems": 2,
2694
- "maxItems": 2
2785
+ ]
2695
2786
  },
2696
2787
  "template": {
2697
2788
  "type": "string",
@@ -2763,30 +2854,39 @@
2763
2854
  "id": {
2764
2855
  "type": "string",
2765
2856
  "pattern": "^[a-z0-9]+(-[a-z0-9]+)*$",
2766
- "description": "The image's id: the file <output.dir>/og/<id>.png."
2857
+ "description": "The image's id: the file <output.dir>/og/<id>.png (a carousel writes <id>-1.png, <id>-2.png and so on)."
2767
2858
  },
2768
2859
  "size": {
2769
- "default": [
2770
- 1200,
2771
- 630
2772
- ],
2773
- "description": "The image size in pixels, [width, height].",
2774
- "type": "array",
2775
- "prefixItems": [
2860
+ "description": "The image size: \"landscape\" (1200×630), \"portrait\" (1080×1350), \"square\" (1080×1080), \"story\" (1080×1920) or [width, height] in pixels; \"landscape\" by default.",
2861
+ "anyOf": [
2776
2862
  {
2777
- "type": "integer",
2778
- "minimum": 1,
2779
- "maximum": 4000
2863
+ "type": "array",
2864
+ "prefixItems": [
2865
+ {
2866
+ "type": "integer",
2867
+ "minimum": 1,
2868
+ "maximum": 4000
2869
+ },
2870
+ {
2871
+ "type": "integer",
2872
+ "minimum": 1,
2873
+ "maximum": 4000
2874
+ }
2875
+ ],
2876
+ "items": false,
2877
+ "minItems": 2,
2878
+ "maxItems": 2
2780
2879
  },
2781
2880
  {
2782
- "type": "integer",
2783
- "minimum": 1,
2784
- "maximum": 4000
2881
+ "type": "string",
2882
+ "enum": [
2883
+ "landscape",
2884
+ "portrait",
2885
+ "square",
2886
+ "story"
2887
+ ]
2785
2888
  }
2786
- ],
2787
- "items": false,
2788
- "minItems": 2,
2789
- "maxItems": 2
2889
+ ]
2790
2890
  },
2791
2891
  "template": {
2792
2892
  "type": "string",
@@ -2918,6 +3018,255 @@
2918
3018
  "data"
2919
3019
  ],
2920
3020
  "additionalProperties": false
3021
+ },
3022
+ {
3023
+ "type": "object",
3024
+ "properties": {
3025
+ "id": {
3026
+ "type": "string",
3027
+ "pattern": "^[a-z0-9]+(-[a-z0-9]+)*$",
3028
+ "description": "The image's id: the file <output.dir>/og/<id>.png (a carousel writes <id>-1.png, <id>-2.png and so on)."
3029
+ },
3030
+ "size": {
3031
+ "description": "The image size: \"landscape\" (1200×630), \"portrait\" (1080×1350), \"square\" (1080×1080), \"story\" (1080×1920) or [width, height] in pixels; \"portrait\" by default.",
3032
+ "anyOf": [
3033
+ {
3034
+ "type": "array",
3035
+ "prefixItems": [
3036
+ {
3037
+ "type": "integer",
3038
+ "minimum": 1,
3039
+ "maximum": 4000
3040
+ },
3041
+ {
3042
+ "type": "integer",
3043
+ "minimum": 1,
3044
+ "maximum": 4000
3045
+ }
3046
+ ],
3047
+ "items": false,
3048
+ "minItems": 2,
3049
+ "maxItems": 2
3050
+ },
3051
+ {
3052
+ "type": "string",
3053
+ "enum": [
3054
+ "landscape",
3055
+ "portrait",
3056
+ "square",
3057
+ "story"
3058
+ ]
3059
+ }
3060
+ ]
3061
+ },
3062
+ "template": {
3063
+ "type": "string",
3064
+ "const": "big-number",
3065
+ "description": "A portrait post whose number fills the frame, with the sentence that explains it, tiles, a call to action and a source line."
3066
+ },
3067
+ "data": {
3068
+ "type": "object",
3069
+ "properties": {
3070
+ "eyebrow": {
3071
+ "description": "A short line above the headline, at most 40 characters.",
3072
+ "type": "string",
3073
+ "maxLength": 40
3074
+ },
3075
+ "number": {
3076
+ "type": "string",
3077
+ "maxLength": 12,
3078
+ "description": "The figure that fills the post, unit included, e.g. \"898 PLN\"; at most 12 characters. Shorter numbers get bigger type."
3079
+ },
3080
+ "caption": {
3081
+ "type": "string",
3082
+ "maxLength": 90,
3083
+ "description": "The sentence that says what the number is, under it; at most 90 characters."
3084
+ },
3085
+ "tiles": {
3086
+ "default": [],
3087
+ "description": "Up to two label and value tiles under the caption, e.g. a second figure.",
3088
+ "maxItems": 2,
3089
+ "type": "array",
3090
+ "items": {
3091
+ "type": "object",
3092
+ "properties": {
3093
+ "label": {
3094
+ "type": "string",
3095
+ "maxLength": 24,
3096
+ "description": "The tile's caption, at most 24 characters."
3097
+ },
3098
+ "value": {
3099
+ "type": "string",
3100
+ "maxLength": 16,
3101
+ "description": "The tile's value, at most 16 characters."
3102
+ }
3103
+ },
3104
+ "required": [
3105
+ "label",
3106
+ "value"
3107
+ ],
3108
+ "additionalProperties": false
3109
+ }
3110
+ },
3111
+ "cta": {
3112
+ "description": "A call to action, drawn as a pill in the cta colours at the bottom; at most 32 characters.",
3113
+ "type": "string",
3114
+ "maxLength": 32
3115
+ },
3116
+ "source": {
3117
+ "description": "Where the figures come from, drawn small at the bottom, e.g. \"Source: ZUS, 2026\"; at most 80 characters.",
3118
+ "type": "string",
3119
+ "maxLength": 80
3120
+ }
3121
+ },
3122
+ "required": [
3123
+ "number",
3124
+ "caption"
3125
+ ],
3126
+ "additionalProperties": false,
3127
+ "description": "The big-number template's input."
3128
+ }
3129
+ },
3130
+ "required": [
3131
+ "id",
3132
+ "template",
3133
+ "data"
3134
+ ],
3135
+ "additionalProperties": false
3136
+ },
3137
+ {
3138
+ "type": "object",
3139
+ "properties": {
3140
+ "id": {
3141
+ "type": "string",
3142
+ "pattern": "^[a-z0-9]+(-[a-z0-9]+)*$",
3143
+ "description": "The image's id: the file <output.dir>/og/<id>.png (a carousel writes <id>-1.png, <id>-2.png and so on)."
3144
+ },
3145
+ "size": {
3146
+ "description": "The image size: \"landscape\" (1200×630), \"portrait\" (1080×1350), \"square\" (1080×1080), \"story\" (1080×1920) or [width, height] in pixels; \"portrait\" by default.",
3147
+ "anyOf": [
3148
+ {
3149
+ "type": "array",
3150
+ "prefixItems": [
3151
+ {
3152
+ "type": "integer",
3153
+ "minimum": 1,
3154
+ "maximum": 4000
3155
+ },
3156
+ {
3157
+ "type": "integer",
3158
+ "minimum": 1,
3159
+ "maximum": 4000
3160
+ }
3161
+ ],
3162
+ "items": false,
3163
+ "minItems": 2,
3164
+ "maxItems": 2
3165
+ },
3166
+ {
3167
+ "type": "string",
3168
+ "enum": [
3169
+ "landscape",
3170
+ "portrait",
3171
+ "square",
3172
+ "story"
3173
+ ]
3174
+ }
3175
+ ]
3176
+ },
3177
+ "template": {
3178
+ "type": "string",
3179
+ "const": "carousel",
3180
+ "description": "A numbered run of portrait slides sharing one look; each slide is its own file <id>-<n>.png."
3181
+ },
3182
+ "data": {
3183
+ "type": "object",
3184
+ "properties": {
3185
+ "slides": {
3186
+ "minItems": 2,
3187
+ "maxItems": 10,
3188
+ "type": "array",
3189
+ "items": {
3190
+ "type": "object",
3191
+ "properties": {
3192
+ "eyebrow": {
3193
+ "description": "A short line above the headline, at most 40 characters.",
3194
+ "type": "string",
3195
+ "maxLength": 40
3196
+ },
3197
+ "headline": {
3198
+ "type": "string",
3199
+ "maxLength": 90,
3200
+ "description": "The slide's headline, at most 90 characters."
3201
+ },
3202
+ "body": {
3203
+ "description": "A paragraph under the headline, at most 200 characters.",
3204
+ "type": "string",
3205
+ "maxLength": 200
3206
+ },
3207
+ "tiles": {
3208
+ "default": [],
3209
+ "description": "Up to two label and value tiles side by side.",
3210
+ "maxItems": 2,
3211
+ "type": "array",
3212
+ "items": {
3213
+ "type": "object",
3214
+ "properties": {
3215
+ "label": {
3216
+ "type": "string",
3217
+ "maxLength": 24,
3218
+ "description": "The tile's caption, at most 24 characters."
3219
+ },
3220
+ "value": {
3221
+ "type": "string",
3222
+ "maxLength": 16,
3223
+ "description": "The tile's value, at most 16 characters."
3224
+ }
3225
+ },
3226
+ "required": [
3227
+ "label",
3228
+ "value"
3229
+ ],
3230
+ "additionalProperties": false
3231
+ }
3232
+ },
3233
+ "cta": {
3234
+ "description": "A call to action, drawn as a pill in the cta colours at the bottom; at most 32 characters.",
3235
+ "type": "string",
3236
+ "maxLength": 32
3237
+ },
3238
+ "source": {
3239
+ "description": "Where the figures come from, drawn small at the bottom, e.g. \"Source: ZUS, 2026\"; at most 80 characters.",
3240
+ "type": "string",
3241
+ "maxLength": 80
3242
+ }
3243
+ },
3244
+ "required": [
3245
+ "headline"
3246
+ ],
3247
+ "additionalProperties": false
3248
+ },
3249
+ "description": "The slides in order, two to ten; each renders to its own file <id>-<n>.png."
3250
+ },
3251
+ "counter": {
3252
+ "default": true,
3253
+ "description": "Draws \"n/N\" in the top corner of every slide.",
3254
+ "type": "boolean"
3255
+ }
3256
+ },
3257
+ "required": [
3258
+ "slides"
3259
+ ],
3260
+ "additionalProperties": false,
3261
+ "description": "The carousel template's input."
3262
+ }
3263
+ },
3264
+ "required": [
3265
+ "id",
3266
+ "template",
3267
+ "data"
3268
+ ],
3269
+ "additionalProperties": false
2921
3270
  }
2922
3271
  ]
2923
3272
  }