@wallets-e2e/walkthrough 0.0.0-stage → 0.1.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.
@@ -0,0 +1 @@
1
+ {"version":3,"file":"walkthrough.js","sourceRoot":"","sources":["../src/walkthrough.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACnD,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAE3C,OAAO,EAAE,aAAa,EAAE,YAAY,EAAyB,MAAM,YAAY,CAAC;AAChF,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,aAAa,EAAgC,MAAM,eAAe,CAAC;AA6DxG,MAAM,cAAc,GAAG,EAAE,KAAK,EAAE,EAAE,EAAE,GAAG,EAAE,EAAE,EAAE,YAAY,EAAE,EAAE,EAAE,CAAC;AAEhE;;;;;;;;;;;GAWG;AACH,MAAM,OAAO,WAAW;IACb,IAAI,CAAO;IACX,SAAS,CAAS;IAClB,KAAK,CAAmB;IAChB,IAAI,CAAoC;IACxC,KAAK,CAAS;IACd,OAAO,CAAS;IAChB,SAAS,CAAS;IAClB,MAAM,GAAqC,EAAE,CAAC;IAC9C,QAAQ,GAAc,EAAE,CAAC;IAClC,GAAG,GAA6E,IAAI,CAAC;IACrF,MAAM,GAAG,IAAI,CAAC;IACd,OAAO,GAAG,KAAK,CAAC;IAChB,OAAO,GAAG,KAAK,CAAC;IAExB,YAAY,IAAU,EAAE,OAA2B;QACjD,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,SAAS,GAAG,OAAO,CAAC,SAAS,CAAC;QACnC,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC;QACnD,IAAI,CAAC,KAAK,GAAG,EAAE,GAAG,aAAa,EAAE,GAAG,OAAO,CAAC,KAAK,EAAE,C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,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;YAC5B,UAAU,CAAC,GAAG,EAAE,CAAC,EAAE,CAAC,MAAM,EAAE,EAAE,GAAG,CAAC,CAAC;YACnC,OAAO,IAAI,CAAC;QACd,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,KAAK,CAAC,CAAC;QACtB,IAAI,KAAK;YAAE,MAAM,IAAI,CAAC,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC;IACjD,CAAC;CACF;AAED,wFAAwF;AACxF,MAAM,CAAC,KAAK,UAAU,iBAAiB,CAAC,IAAU,EAAE,OAA2B;IAC7E,MAAM,WAAW,GAAG,IAAI,WAAW,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;IACnD,MAAM,WAAW,CAAC,KAAK,EAAE,CAAC;IAC1B,OAAO,WAAW,CAAC;AACrB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,55 @@
1
1
  {
2
2
  "name": "@wallets-e2e/walkthrough",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
3
+ "version": "0.1.0",
4
+ "type": "module",
5
+ "description": "Captioned demo videos of a dapp driven by real wallet extensions: animated cursor, captions, title cards, every wallet prompt shown on screen, encoded to mp4 with subtitles and chapters.",
6
+ "keywords": [
7
+ "playwright",
8
+ "wallet",
9
+ "e2e",
10
+ "demo",
11
+ "walkthrough",
12
+ "video",
13
+ "web3",
14
+ "browser-extension"
15
+ ],
16
+ "license": "MIT",
17
+ "repository": {
18
+ "type": "git",
19
+ "url": "git+https://github.com/yehia67/e2e-wallets.git",
20
+ "directory": "packages/walkthrough"
21
+ },
22
+ "bugs": {
23
+ "url": "https://github.com/yehia67/e2e-wallets/issues"
24
+ },
25
+ "homepage": "https://github.com/yehia67/e2e-wallets#readme",
26
+ "main": "./dist/index.js",
27
+ "types": "./dist/index.d.ts",
28
+ "exports": {
29
+ ".": {
30
+ "types": "./dist/index.d.ts",
31
+ "default": "./dist/index.js"
32
+ }
33
+ },
34
+ "bin": {
35
+ "wallets-e2e-walkthrough": "./dist/cli.js"
36
+ },
37
+ "files": [
38
+ "dist",
39
+ "src",
40
+ "!src/**/*.test.ts"
41
+ ],
42
+ "peerDependencies": {
43
+ "@playwright/test": "^1.47.0"
44
+ },
45
+ "devDependencies": {
46
+ "@playwright/test": "^1.47.0",
47
+ "@types/node": "^22.7.5",
48
+ "typescript": "^5.6.3"
49
+ },
50
+ "scripts": {
51
+ "build": "tsc -p tsconfig.build.json",
52
+ "typecheck": "tsc --noEmit -p tsconfig.json",
53
+ "test": "node --test"
54
+ }
6
55
  }
@@ -0,0 +1,58 @@
1
+ // No runtime imports: `node --test` runs this file straight from source.
2
+
3
+ export interface CliArgs {
4
+ command: 'encode' | 'help';
5
+ runDir?: string;
6
+ root: string;
7
+ out?: string;
8
+ name?: string;
9
+ title?: string;
10
+ description?: string;
11
+ madeWith?: string;
12
+ }
13
+
14
+ export const USAGE = `wallets-e2e-walkthrough encode [run-dir] --out <dir> [options]
15
+
16
+ Encodes a recorded walkthrough into an mp4 with captions, subtitles and chapters.
17
+
18
+ run-dir The run to encode. Default: the newest run-* folder under --root.
19
+ --root <dir> Where runs are recorded. Default: demo-output
20
+ --out <dir> Where the video goes. Required.
21
+ --name <file.mp4> The video's file name. Default: walkthrough.mp4
22
+ --title <text> The README's title.
23
+ --description <text> What the video shows, for the README.
24
+ --made-with <text> How the video was made, for the README.
25
+
26
+ Needs ffmpeg and ffprobe on PATH.`;
27
+
28
+ const FLAGS: Record<string, keyof Omit<CliArgs, 'command' | 'runDir'>> = {
29
+ '--root': 'root',
30
+ '--out': 'out',
31
+ '--name': 'name',
32
+ '--title': 'title',
33
+ '--description': 'description',
34
+ '--made-with': 'madeWith',
35
+ };
36
+
37
+ /** Parses the command line; throws with a message for the user on anything it does not know. */
38
+ export function parseArgs(argv: readonly string[]): CliArgs {
39
+ const args: CliArgs = { command: 'encode', root: 'demo-output' };
40
+ const rest = [...argv];
41
+ if (rest[0] === 'encode') rest.shift();
42
+ for (let i = 0; i < rest.length; i++) {
43
+ const arg = rest[i];
44
+ if (arg === '--help' || arg === '-h' || arg === 'help') return { ...args, command: 'help' };
45
+ const key = FLAGS[arg];
46
+ if (key) {
47
+ const value = rest[++i];
48
+ if (value === undefined || value.startsWith('--')) throw new Error(`${arg} needs a value.`);
49
+ args[key] = value;
50
+ continue;
51
+ }
52
+ if (arg.startsWith('--')) throw new Error(`Unknown option ${arg}.`);
53
+ if (args.runDir !== undefined) throw new Error(`Only one run directory can be encoded; got "${args.runDir}" and "${arg}".`);
54
+ args.runDir = arg;
55
+ }
56
+ if (!args.out) throw new Error('--out <dir> is required.');
57
+ return args;
58
+ }
package/src/cli.ts ADDED
@@ -0,0 +1,27 @@
1
+ #!/usr/bin/env node
2
+ import { resolve } from 'node:path';
3
+ import { parseArgs, USAGE } from './cli-args.js';
4
+ import { encodeWalkthrough, newestRun } from './encode.js';
5
+
6
+ try {
7
+ const args = parseArgs(process.argv.slice(2));
8
+ if (args.command === 'help') {
9
+ console.log(USAGE);
10
+ } else {
11
+ const runDir = args.runDir ? resolve(args.runDir) : newestRun(resolve(args.root));
12
+ if (!runDir) throw new Error(`No run-* folder under ${resolve(args.root)}: record a walkthrough first.`);
13
+ const result = encodeWalkthrough({
14
+ runDir,
15
+ outDir: resolve(args.out as string),
16
+ fileName: args.name,
17
+ title: args.title,
18
+ description: args.description,
19
+ madeWith: args.madeWith,
20
+ });
21
+ console.log(JSON.stringify({ out: result.outDir, video: result.video, seconds: result.seconds, captions: result.captions, chapters: result.chapters.length }));
22
+ }
23
+ } catch (error) {
24
+ console.error(`[wallets-e2e/walkthrough] ${error instanceof Error ? error.message : String(error)}`);
25
+ console.error(`\n${USAGE}`);
26
+ process.exit(1);
27
+ }
package/src/encode.ts ADDED
@@ -0,0 +1,116 @@
1
+ import { execFileSync } from 'node:child_process';
2
+ import { existsSync, mkdirSync, readdirSync, readFileSync, writeFileSync } from 'node:fs';
3
+ import { join, resolve } from 'node:path';
4
+ import { buildCues, chapterMarks, shortStamp, toSrt, toVtt, type Chapter, type ChapterMark } from './timeline.js';
5
+
6
+ export interface EncodeOptions {
7
+ /** The run to encode: the folder `Walkthrough.stop()` wrote (it holds `frames/`). */
8
+ runDir: string;
9
+ /** Where the video and its sidecar files go. Created when missing. */
10
+ outDir: string;
11
+ /** The video's file name. Default `walkthrough.mp4`. */
12
+ fileName?: string;
13
+ /** The README's title. Default "Captioned walkthrough". */
14
+ title?: string;
15
+ /** A paragraph for the README: what the video shows. */
16
+ description?: string;
17
+ /** A closing line for the README: how the video was made. */
18
+ madeWith?: string;
19
+ /** The video's size. Default 1920×1080. */
20
+ size?: { width: number; height: number };
21
+ /** Frames per second. Default 30. */
22
+ fps?: number;
23
+ /** x264 quality, lower is better. Default 18. */
24
+ crf?: number;
25
+ /** The ffmpeg and ffprobe executables. Default: the ones on PATH. */
26
+ ffmpeg?: string;
27
+ ffprobe?: string;
28
+ }
29
+
30
+ export interface EncodeResult {
31
+ outDir: string;
32
+ video: string;
33
+ seconds: number;
34
+ captions: number;
35
+ chapters: ChapterMark[];
36
+ }
37
+
38
+ /** The newest `run-*` folder under `root`, or null. */
39
+ export function newestRun(root: string): string | null {
40
+ if (!existsSync(root)) return null;
41
+ const runs = readdirSync(root).filter((name) => name.startsWith('run-')).sort();
42
+ const newest = runs.at(-1);
43
+ return newest ? join(root, newest) : null;
44
+ }
45
+
46
+ /** The README written next to the video. */
47
+ export function readme(options: { title: string; fileName: string; seconds: number; date: string; description?: string; madeWith?: string; marks: readonly ChapterMark[] }): string {
48
+ const { title, fileName, seconds, date, description, madeWith, marks } = options;
49
+ return [
50
+ `# ${title}`,
51
+ '',
52
+ `Recorded ${date}. Length ${shortStamp(seconds)}.`,
53
+ ...(description ? ['', description] : []),
54
+ '',
55
+ '| File | What |',
56
+ '|---|---|',
57
+ `| \`${fileName}\` | The video, captions burnt in |`,
58
+ '| `captions.vtt`, `captions.srt` | The captions as a sidecar track |',
59
+ '| `chapters.txt` | Chapter list (paste into a video description) |',
60
+ '',
61
+ '## Chapters',
62
+ '',
63
+ ...marks.map((mark) => `- ${shortStamp(mark.at)} ${mark.label}`),
64
+ ...(madeWith ? ['', madeWith] : []),
65
+ '',
66
+ ].join('\n');
67
+ }
68
+
69
+ /**
70
+ * Encodes a recorded run into a shareable folder: an H.264 mp4 that plays in browsers and slide
71
+ * decks (captions are part of the picture), the same captions as WebVTT and SubRip, a chapter list
72
+ * and a README. Needs `ffmpeg` and `ffprobe`.
73
+ */
74
+ export function encodeWalkthrough(options: EncodeOptions): EncodeResult {
75
+ const runDir = resolve(options.runDir);
76
+ const outDir = resolve(options.outDir);
77
+ const fileName = options.fileName ?? 'walkthrough.mp4';
78
+ const { width, height } = options.size ?? { width: 1920, height: 1080 };
79
+ const frames = join(runDir, 'frames');
80
+ const concat = join(frames, 'frames.ffconcat');
81
+ const chaptersFile = join(frames, 'chapters.json');
82
+ if (!existsSync(concat)) throw new Error(`${concat} is missing: the walkthrough did not finish recording.`);
83
+ const chapters = (existsSync(chaptersFile) ? JSON.parse(readFileSync(chaptersFile, 'utf8')) : []) as Chapter[];
84
+
85
+ mkdirSync(outDir, { recursive: true });
86
+ const video = join(outDir, fileName);
87
+ try {
88
+ execFileSync(options.ffmpeg ?? 'ffmpeg', [
89
+ '-y', '-loglevel', 'error',
90
+ '-f', 'concat', '-safe', '0', '-i', concat,
91
+ '-vf', `scale=${width}:${height}:flags=lanczos,fps=${options.fps ?? 30},format=yuv420p`,
92
+ '-c:v', 'libx264', '-preset', 'slow', '-crf', String(options.crf ?? 18), '-movflags', '+faststart',
93
+ video,
94
+ ], { stdio: ['ignore', 'inherit', 'inherit'] });
95
+ } catch (error) {
96
+ if ((error as NodeJS.ErrnoException).code === 'ENOENT') throw new Error('ffmpeg was not found. Install FFmpeg (with libx264) and run again.');
97
+ throw error;
98
+ }
99
+ const seconds = Number(execFileSync(options.ffprobe ?? 'ffprobe', ['-v', 'error', '-show_entries', 'format=duration', '-of', 'csv=p=0', video]).toString().trim());
100
+
101
+ const cues = buildCues(chapters, seconds);
102
+ const marks = chapterMarks(cues);
103
+ writeFileSync(join(outDir, 'captions.vtt'), toVtt(cues));
104
+ writeFileSync(join(outDir, 'captions.srt'), toSrt(cues));
105
+ writeFileSync(join(outDir, 'chapters.txt'), `${marks.map((mark) => `${shortStamp(mark.at)} ${mark.label}`).join('\n')}\n`);
106
+ writeFileSync(join(outDir, 'README.md'), readme({
107
+ title: options.title ?? 'Captioned walkthrough',
108
+ fileName,
109
+ seconds,
110
+ date: new Date().toISOString().slice(0, 10),
111
+ description: options.description,
112
+ madeWith: options.madeWith,
113
+ marks,
114
+ }));
115
+ return { outDir, video, seconds: Math.round(seconds), captions: cues.length, chapters: marks };
116
+ }
package/src/index.ts ADDED
@@ -0,0 +1,12 @@
1
+ export {
2
+ createWalkthrough,
3
+ Walkthrough,
4
+ type CardOptions,
5
+ type PromptHook,
6
+ type WalkthroughOptions,
7
+ type WalkthroughRun,
8
+ type WalletPromptOptions,
9
+ } from './walkthrough.js';
10
+ export { DEFAULT_THEME, type WalkthroughTheme } from './theme.js';
11
+ export { encodeWalkthrough, newestRun, type EncodeOptions, type EncodeResult } from './encode.js';
12
+ export { buildCues, chapterMarks, type Chapter, type ChapterMark, type Cue } from './timeline.js';
package/src/theme.ts ADDED
@@ -0,0 +1,75 @@
1
+ // No runtime imports: `node --test` runs this file straight from source.
2
+
3
+ /** The look of everything the walkthrough draws over the page. Every field has a default. */
4
+ export interface WalkthroughTheme {
5
+ /** Dark background of captions and title cards. */
6
+ ink: string;
7
+ /** A second dark tone, the centre of a title card's gradient. */
8
+ inkSoft: string;
9
+ /** Text on the dark background. */
10
+ paper: string;
11
+ /** Secondary text on a title card. */
12
+ muted: string;
13
+ /** The step chip, a title card's kicker, the caption's edge. */
14
+ accent: string;
15
+ /** Click ripples and the numbers of a title card's list. */
16
+ highlight: string;
17
+ /** Captions and body text. */
18
+ fontBody: string;
19
+ /** The title of a title card. */
20
+ fontTitle: string;
21
+ /** Step chips, kickers and numbers. */
22
+ fontMono: string;
23
+ }
24
+
25
+ export const DEFAULT_THEME: WalkthroughTheme = {
26
+ ink: '#14141f',
27
+ inkSoft: '#26263a',
28
+ paper: '#f7f7fa',
29
+ muted: '#cfd0dc',
30
+ accent: '#6ea8fe',
31
+ highlight: '#ff7a33',
32
+ fontBody: 'Inter, system-ui, sans-serif',
33
+ fontTitle: 'Georgia, "Times New Roman", serif',
34
+ fontMono: 'ui-monospace, "SF Mono", Menlo, monospace',
35
+ };
36
+
37
+ /** A value safe to put inside a CSS declaration: nothing that could close it or open another rule. */
38
+ export function cssValue(value: string): string {
39
+ return value.replace(/[;{}<>\\]/g, '');
40
+ }
41
+
42
+ /** The stylesheet of the cursor, the ripples, the caption and the title card. Element ids are `wt-…`. */
43
+ export function overlayStyle(theme: WalkthroughTheme): string {
44
+ const t = Object.fromEntries(Object.entries(theme).map(([key, value]) => [key, cssValue(value)])) as unknown as WalkthroughTheme;
45
+ return `
46
+ #wt-cursor{position:fixed;left:0;top:0;width:24px;height:24px;z-index:2147483647;pointer-events:none;
47
+ transition:transform .7s cubic-bezier(.45,.05,.25,1);filter:drop-shadow(0 2px 3px rgba(0,0,0,.35))}
48
+ .wt-ripple{position:fixed;width:36px;height:36px;margin:-18px 0 0 -18px;border-radius:50%;
49
+ border:3px solid ${t.highlight};z-index:2147483646;pointer-events:none;animation:wt-ripple .6s ease-out forwards}
50
+ @keyframes wt-ripple{from{transform:scale(.3);opacity:1}to{transform:scale(1.7);opacity:0}}
51
+ #wt-caption{position:fixed;left:50%;bottom:30px;transform:translate(-50%,12px);opacity:0;z-index:2147483640;
52
+ max-width:1180px;width:max-content;pointer-events:none;background:${t.ink};color:${t.paper};
53
+ border-radius:4px;border-left:4px solid ${t.accent};padding:14px 26px;font:500 19px/1.45 ${t.fontBody};
54
+ box-shadow:0 12px 32px rgba(0,0,0,.3);transition:opacity .35s,transform .35s;display:flex;gap:16px;align-items:center}
55
+ #wt-caption.show{opacity:.97;transform:translate(-50%,0)}
56
+ #wt-caption b{background:${t.accent};color:${t.ink};border-radius:2px;padding:3px 10px;font:600 13px/1.4 ${t.fontMono};
57
+ letter-spacing:.06em;text-transform:uppercase;white-space:nowrap}
58
+ #wt-card{position:fixed;inset:0;z-index:2147483645;display:flex;flex-direction:column;align-items:center;justify-content:center;
59
+ text-align:center;background:radial-gradient(1200px 600px at 50% 30%,${t.inkSoft},${t.ink});color:${t.paper};
60
+ font-family:${t.fontBody};opacity:0;transition:opacity .5s}
61
+ #wt-card.show{opacity:1}
62
+ #wt-card .k{font:600 14px ${t.fontMono};letter-spacing:.24em;text-transform:uppercase;color:${t.accent};margin-bottom:20px}
63
+ #wt-card h1{font:600 54px/1.15 ${t.fontTitle};margin:0 0 18px;max-width:1100px}
64
+ #wt-card p{font-size:22px;color:${t.muted};margin:0;max-width:940px;line-height:1.5}
65
+ #wt-card ol{margin:30px 0 0;padding:0;list-style:none;font-size:20px;color:${t.paper};text-align:left}
66
+ #wt-card li{margin:9px 0}#wt-card li span{color:${t.highlight};font-family:${t.fontMono};margin-right:12px}
67
+ #wt-wallet{position:fixed;z-index:2147483644;border-radius:10px;overflow:hidden;background:#fff;
68
+ box-shadow:0 24px 60px rgba(0,0,0,.45),0 0 0 1px rgba(0,0,0,.14);
69
+ opacity:0;transform:translateY(-10px) scale(.98);transition:opacity .3s,transform .3s;pointer-events:none}
70
+ #wt-wallet.show{opacity:1;transform:none}
71
+ #wt-wallet header{display:flex;align-items:center;gap:8px;height:30px;padding:0 12px;background:${t.ink};
72
+ font:600 12px ${t.fontBody};color:${t.paper}}
73
+ #wt-wallet header i{width:10px;height:10px;border-radius:50%;display:inline-block}
74
+ #wt-wallet img{display:block;width:100%;height:auto}`;
75
+ }
@@ -0,0 +1,135 @@
1
+ // No runtime imports: `node --test` runs this file straight from source.
2
+
3
+ /** One screencast frame: when it was captured, and whether recording had just been resumed. */
4
+ export interface FrameMark {
5
+ at: number;
6
+ gapBefore: boolean;
7
+ }
8
+
9
+ /** A caption or a title card, as noted while recording (`wall`) and as placed in the video (`at`, seconds). */
10
+ export interface Chapter {
11
+ wall: number;
12
+ at: number;
13
+ step: string | null;
14
+ text: string;
15
+ kind: 'caption' | 'card';
16
+ }
17
+
18
+ /** The longest a still frame is held: a page that does not repaint is one frame, however long it lasted. */
19
+ export const MAX_STILL_SECONDS = 12;
20
+ /** How long the cut over a pause lasts: a chain wait of minutes becomes this. */
21
+ export const PAUSE_SECONDS = 0.4;
22
+
23
+ /**
24
+ * How long each frame is shown. A frame lasts until the next one, capped; the frame before a pause
25
+ * lasts only `PAUSE_SECONDS`, which is how a long confirmation wait is shortened in the video.
26
+ */
27
+ export function frameDurations(frames: readonly FrameMark[], end: number): number[] {
28
+ return frames.map((frame, index) => {
29
+ const next = frames[index + 1];
30
+ const raw = ((next ? next.at : end) - frame.at) / 1000;
31
+ const capped = next?.gapBefore ? Math.min(raw, PAUSE_SECONDS) : Math.min(raw, MAX_STILL_SECONDS);
32
+ return Math.max(capped, 0.02);
33
+ });
34
+ }
35
+
36
+ /**
37
+ * The video time of each chapter: the frames shown before its wall-clock instant, plus how far into
38
+ * the current frame it falls. A chapter noted before the first frame lands at 0.
39
+ */
40
+ export function placeChapters(chapters: readonly Chapter[], frames: readonly FrameMark[], durations: readonly number[]): Chapter[] {
41
+ let clock = 0;
42
+ const starts = durations.map((duration) => {
43
+ const start = clock;
44
+ clock += duration;
45
+ return start;
46
+ });
47
+ return chapters.map((chapter) => {
48
+ if (frames.length === 0) return { ...chapter, at: 0 };
49
+ let index = -1;
50
+ for (let i = frames.length - 1; i >= 0; i--) {
51
+ if (frames[i].at <= chapter.wall) {
52
+ index = i;
53
+ break;
54
+ }
55
+ }
56
+ if (index < 0) return { ...chapter, at: 0 };
57
+ const into = Math.min((chapter.wall - frames[index].at) / 1000, durations[index]);
58
+ return { ...chapter, at: Number(Math.max(0, starts[index] + into).toFixed(2)) };
59
+ });
60
+ }
61
+
62
+ /** The ffmpeg concat list for the frames: each file with its duration, the last one repeated as ffmpeg requires. */
63
+ export function concatList(files: readonly string[], durations: readonly number[]): string {
64
+ const lines = files.flatMap((file, index) => [`file '${file}'`, `duration ${durations[index].toFixed(3)}`]);
65
+ const last = files.at(-1);
66
+ if (last) lines.push(`file '${last}'`);
67
+ return `ffconcat version 1.0\n${lines.join('\n')}\n`;
68
+ }
69
+
70
+ /** A subtitle cue. */
71
+ export interface Cue {
72
+ start: number;
73
+ end: number;
74
+ text: string;
75
+ step: string | null;
76
+ kind: 'caption' | 'card';
77
+ }
78
+
79
+ /** Each chapter as a subtitle cue that lasts until the next one, at least one second, never past the video's end. */
80
+ export function buildCues(chapters: readonly Chapter[], seconds: number): Cue[] {
81
+ return chapters.map((chapter, index) => {
82
+ const start = Math.max(0, chapter.at);
83
+ const end = Math.min(chapters[index + 1]?.at ?? seconds, seconds);
84
+ return {
85
+ start,
86
+ end: Math.max(end, start + 1),
87
+ text: chapter.step && chapter.kind === 'caption' ? `[${chapter.step}] ${chapter.text}` : chapter.text,
88
+ step: chapter.step,
89
+ kind: chapter.kind,
90
+ };
91
+ });
92
+ }
93
+
94
+ /** `HH:MM:SS.mmm` for WebVTT (`separator` "."), `HH:MM:SS,mmm` for SubRip (","). */
95
+ export function stamp(seconds: number, separator: '.' | ','): string {
96
+ const totalMs = Math.round(seconds * 1000);
97
+ const ms = totalMs % 1000;
98
+ const s = Math.floor(totalMs / 1000) % 60;
99
+ const m = Math.floor(totalMs / 60_000) % 60;
100
+ const h = Math.floor(totalMs / 3_600_000);
101
+ const pad = (value: number, width = 2) => String(value).padStart(width, '0');
102
+ return `${pad(h)}:${pad(m)}:${pad(s)}${separator}${pad(ms, 3)}`;
103
+ }
104
+
105
+ /** `M:SS`, as a video description lists chapters. */
106
+ export function shortStamp(seconds: number): string {
107
+ return `${Math.floor(seconds / 60)}:${String(Math.floor(seconds % 60)).padStart(2, '0')}`;
108
+ }
109
+
110
+ export function toVtt(cues: readonly Cue[]): string {
111
+ return `WEBVTT\n\n${cues.map((cue) => `${stamp(cue.start, '.')} --> ${stamp(cue.end, '.')}\n${cue.text}\n`).join('\n')}`;
112
+ }
113
+
114
+ export function toSrt(cues: readonly Cue[]): string {
115
+ return cues.map((cue, index) => `${index + 1}\n${stamp(cue.start, ',')} --> ${stamp(cue.end, ',')}\n${cue.text}\n`).join('\n');
116
+ }
117
+
118
+ /** A chapter of the video: where it starts and what it is called. */
119
+ export interface ChapterMark {
120
+ at: number;
121
+ label: string;
122
+ }
123
+
124
+ /** A chapter starts at each title card and at the first caption of each new step. The first one starts at 0. */
125
+ export function chapterMarks(cues: readonly Cue[]): ChapterMark[] {
126
+ const marks: (ChapterMark & { key: string })[] = [];
127
+ for (const cue of cues) {
128
+ const key = cue.kind === 'card' ? `card:${cue.text}` : `step:${cue.step ?? ''}`;
129
+ if (marks.at(-1)?.key === key) continue;
130
+ const label = cue.kind === 'card' ? (cue.step ? `${cue.step}: ${cue.text}` : cue.text) : (cue.step ?? cue.text);
131
+ marks.push({ at: cue.start, label, key });
132
+ }
133
+ if (marks.length > 0) marks[0].at = 0;
134
+ return marks.map(({ at, label }) => ({ at, label }));
135
+ }