screenci 0.0.68 → 0.0.70
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 +45 -122
- package/dist/cli.d.ts +3 -18
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +117 -158
- package/dist/cli.js.map +1 -1
- package/dist/docs/manifest.d.ts +66 -35
- package/dist/docs/manifest.d.ts.map +1 -1
- package/dist/docs/manifest.js +22 -11
- package/dist/docs/manifest.js.map +1 -1
- package/dist/docs/video-sources/cli.screenci.d.ts +2 -0
- package/dist/docs/video-sources/cli.screenci.d.ts.map +1 -0
- package/dist/docs/video-sources/{cli.video.js → cli.screenci.js} +1 -1
- package/dist/docs/video-sources/cli.screenci.js.map +1 -0
- package/dist/docs/video-sources/installation.screenci.d.ts +2 -0
- package/dist/docs/video-sources/installation.screenci.d.ts.map +1 -0
- package/dist/docs/video-sources/{installation.video.js → installation.screenci.js} +1 -1
- package/dist/docs/video-sources/installation.screenci.js.map +1 -0
- package/dist/docs/video-sources/landing.screenci.d.ts +2 -0
- package/dist/docs/video-sources/landing.screenci.d.ts.map +1 -0
- package/dist/docs/video-sources/{landing.video.js → landing.screenci.js} +1 -1
- package/dist/docs/video-sources/landing.screenci.js.map +1 -0
- package/dist/docs/video-sources/locator-highlight-animated.screenci.d.ts +2 -0
- package/dist/docs/video-sources/locator-highlight-animated.screenci.d.ts.map +1 -0
- package/dist/docs/video-sources/locator-highlight-animated.screenci.js +53 -0
- package/dist/docs/video-sources/locator-highlight-animated.screenci.js.map +1 -0
- package/dist/docs/video-sources/locator-highlight-still.screenci.d.ts +2 -0
- package/dist/docs/video-sources/locator-highlight-still.screenci.d.ts.map +1 -0
- package/dist/docs/video-sources/locator-highlight-still.screenci.js +24 -0
- package/dist/docs/video-sources/locator-highlight-still.screenci.js.map +1 -0
- package/dist/docs/video-sources/product-pitch.screenci.d.ts +2 -0
- package/dist/docs/video-sources/product-pitch.screenci.d.ts.map +1 -0
- package/dist/docs/video-sources/product-pitch.screenci.js +136 -0
- package/dist/docs/video-sources/product-pitch.screenci.js.map +1 -0
- package/dist/docs/video-sources/public-urls.screenci.d.ts +2 -0
- package/dist/docs/video-sources/public-urls.screenci.d.ts.map +1 -0
- package/dist/docs/video-sources/public-urls.screenci.js +34 -0
- package/dist/docs/video-sources/public-urls.screenci.js.map +1 -0
- package/dist/docs/video-sources/studio.screenci.d.ts +2 -0
- package/dist/docs/video-sources/studio.screenci.d.ts.map +1 -0
- package/dist/docs/video-sources/studio.screenci.js +57 -0
- package/dist/docs/video-sources/studio.screenci.js.map +1 -0
- package/dist/docs/videos.d.ts +36 -15
- package/dist/docs/videos.d.ts.map +1 -1
- package/dist/docs/videos.js +27 -2
- package/dist/docs/videos.js.map +1 -1
- package/dist/e2e/htmlRasterizer.e2e.d.ts +2 -0
- package/dist/e2e/htmlRasterizer.e2e.d.ts.map +1 -0
- package/dist/e2e/htmlRasterizer.e2e.js +107 -0
- package/dist/e2e/htmlRasterizer.e2e.js.map +1 -0
- package/dist/e2e/screenshot.e2e.d.ts +2 -0
- package/dist/e2e/screenshot.e2e.d.ts.map +1 -0
- package/dist/e2e/screenshot.e2e.js +73 -0
- package/dist/e2e/screenshot.e2e.js.map +1 -0
- package/dist/index.d.ts +10 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -2
- package/dist/index.js.map +1 -1
- package/dist/src/asset.d.ts +245 -53
- package/dist/src/asset.d.ts.map +1 -1
- package/dist/src/asset.js +718 -77
- package/dist/src/asset.js.map +1 -1
- package/dist/src/audio.d.ts +127 -0
- package/dist/src/audio.d.ts.map +1 -0
- package/dist/src/audio.js +207 -0
- package/dist/src/audio.js.map +1 -0
- package/dist/src/config.d.ts.map +1 -1
- package/dist/src/config.js +9 -3
- package/dist/src/config.js.map +1 -1
- package/dist/src/contextOptions.d.ts +48 -0
- package/dist/src/contextOptions.d.ts.map +1 -0
- package/dist/src/contextOptions.js +71 -0
- package/dist/src/contextOptions.js.map +1 -0
- package/dist/src/crop.d.ts +93 -0
- package/dist/src/crop.d.ts.map +1 -0
- package/dist/src/crop.js +133 -0
- package/dist/src/crop.js.map +1 -0
- package/dist/src/cue.d.ts +17 -4
- package/dist/src/cue.d.ts.map +1 -1
- package/dist/src/cue.js +31 -3
- package/dist/src/cue.js.map +1 -1
- package/dist/src/defaults.d.ts +13 -1
- package/dist/src/defaults.d.ts.map +1 -1
- package/dist/src/defaults.js +13 -0
- package/dist/src/defaults.js.map +1 -1
- package/dist/src/dimensions.d.ts +6 -0
- package/dist/src/dimensions.d.ts.map +1 -1
- package/dist/src/dimensions.js +15 -0
- package/dist/src/dimensions.js.map +1 -1
- package/dist/src/events.d.ts +283 -13
- package/dist/src/events.d.ts.map +1 -1
- package/dist/src/events.js +134 -5
- package/dist/src/events.js.map +1 -1
- package/dist/src/htmlRasterizer.d.ts +153 -0
- package/dist/src/htmlRasterizer.d.ts.map +1 -0
- package/dist/src/htmlRasterizer.js +386 -0
- package/dist/src/htmlRasterizer.js.map +1 -0
- package/dist/src/init.d.ts +17 -0
- package/dist/src/init.d.ts.map +1 -1
- package/dist/src/init.js +131 -11
- package/dist/src/init.js.map +1 -1
- package/dist/src/linkSession.d.ts +36 -0
- package/dist/src/linkSession.d.ts.map +1 -0
- package/dist/src/linkSession.js +122 -0
- package/dist/src/linkSession.js.map +1 -0
- package/dist/src/overlayFlush.d.ts +18 -0
- package/dist/src/overlayFlush.d.ts.map +1 -0
- package/dist/src/overlayFlush.js +56 -0
- package/dist/src/overlayFlush.js.map +1 -0
- package/dist/src/overlayRect.d.ts +69 -0
- package/dist/src/overlayRect.d.ts.map +1 -0
- package/dist/src/overlayRect.js +55 -0
- package/dist/src/overlayRect.js.map +1 -0
- package/dist/src/performance.d.ts +1 -3
- package/dist/src/performance.d.ts.map +1 -1
- package/dist/src/performance.js +0 -12
- package/dist/src/performance.js.map +1 -1
- package/dist/src/recording.d.ts +3 -2
- package/dist/src/recording.d.ts.map +1 -1
- package/dist/src/recordingData.d.ts +22 -2
- package/dist/src/recordingData.d.ts.map +1 -1
- package/dist/src/runtimeContext.d.ts +57 -1
- package/dist/src/runtimeContext.d.ts.map +1 -1
- package/dist/src/runtimeContext.js +40 -0
- package/dist/src/runtimeContext.js.map +1 -1
- package/dist/src/screenshot.d.ts +105 -0
- package/dist/src/screenshot.d.ts.map +1 -0
- package/dist/src/screenshot.js +188 -0
- package/dist/src/screenshot.js.map +1 -0
- package/dist/src/stillCapture.d.ts +68 -0
- package/dist/src/stillCapture.d.ts.map +1 -0
- package/dist/src/stillCapture.js +119 -0
- package/dist/src/stillCapture.js.map +1 -0
- package/dist/src/studio.d.ts +8 -11
- package/dist/src/studio.d.ts.map +1 -1
- package/dist/src/studio.js +2 -25
- package/dist/src/studio.js.map +1 -1
- package/dist/src/types.d.ts +125 -15
- package/dist/src/types.d.ts.map +1 -1
- package/dist/src/types.js.map +1 -1
- package/dist/src/video.d.ts +54 -1
- package/dist/src/video.d.ts.map +1 -1
- package/dist/src/video.js +190 -42
- package/dist/src/video.js.map +1 -1
- package/dist/src/voices.d.ts +22 -9
- package/dist/src/voices.d.ts.map +1 -1
- package/dist/src/voices.js +6 -24
- package/dist/src/voices.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +16 -2
- package/skills/screenci/SKILL.md +37 -15
- package/skills/screenci/references/init.md +3 -1
- package/skills/screenci/references/record.md +8 -3
- package/dist/docs/video-sources/cli.video.d.ts +0 -2
- package/dist/docs/video-sources/cli.video.d.ts.map +0 -1
- package/dist/docs/video-sources/cli.video.js.map +0 -1
- package/dist/docs/video-sources/installation.video.d.ts +0 -2
- package/dist/docs/video-sources/installation.video.d.ts.map +0 -1
- package/dist/docs/video-sources/installation.video.js.map +0 -1
- package/dist/docs/video-sources/landing.video.d.ts +0 -2
- package/dist/docs/video-sources/landing.video.d.ts.map +0 -1
- package/dist/docs/video-sources/landing.video.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"videos.d.ts","sourceRoot":"","sources":["../../docs/videos.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,
|
|
1
|
+
{"version":3,"file":"videos.d.ts","sourceRoot":"","sources":["../../docs/videos.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,MAAM,MAAM,YAAY,GAAG,OAAO,GAAG,YAAY,CAAA;AAEjD,KAAK,cAAc,GAAG;IACpB,UAAU,EAAE,MAAM,CAAA;IAClB,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,6BAA6B;IAC7B,IAAI,CAAC,EAAE,YAAY,CAAA;IACnB,gDAAgD;IAChD,GAAG,CAAC,EAAE,MAAM,CAAA;CACb,CAAA;AAED,MAAM,MAAM,iBAAiB,GAAG,cAAc,GAAG;IAC/C,QAAQ,EAAE,MAAM,CAAA;CACjB,CAAA;AAED,MAAM,MAAM,mBAAmB,GAAG,cAAc,CAAA;AAEhD,MAAM,MAAM,QAAQ,GAAG,iBAAiB,GAAG,mBAAmB,CAAA;AAE9D,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;CAqCe,CAAA;AAE7C,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,QAAQ,GAAG,IAAI,CAEzD;AAED,wBAAgB,WAAW,CAAC,KAAK,EAAE,QAAQ,GAAG,KAAK,IAAI,iBAAiB,CAEvE"}
|
package/dist/docs/videos.js
CHANGED
|
@@ -1,12 +1,37 @@
|
|
|
1
1
|
export const docsVideoRegistry = {
|
|
2
2
|
'docs/installation': {
|
|
3
3
|
publicId: 'kh7ccy03njvxjm0daef5g50zv587hrbd',
|
|
4
|
-
sourcePath: 'screenci/docs/video-sources/installation.
|
|
4
|
+
sourcePath: 'screenci/docs/video-sources/installation.screenci.ts',
|
|
5
5
|
showSource: false,
|
|
6
6
|
},
|
|
7
7
|
'docs/reference/cli': {
|
|
8
8
|
publicId: 'kh778mvzqw1t504wts9wqyaa2187dfc0',
|
|
9
|
-
sourcePath: 'screenci/docs/video-sources/cli.
|
|
9
|
+
sourcePath: 'screenci/docs/video-sources/cli.screenci.ts',
|
|
10
|
+
},
|
|
11
|
+
// Recorded locally via apps/demo-saas/videos/pitch-embed.screenci.ts, then
|
|
12
|
+
// published with `screenci make-public`.
|
|
13
|
+
'docs/guides/public-urls-and-embeds': {
|
|
14
|
+
publicId: 'kh7aj5s49s6wgfb86jgd0zht59890f17',
|
|
15
|
+
sourcePath: 'screenci/docs/video-sources/public-urls.screenci.ts',
|
|
16
|
+
showSource: false,
|
|
17
|
+
},
|
|
18
|
+
// Add a publicId after publishing. The Studio video needs a logged-in app
|
|
19
|
+
// session (SCREENCI_APP_STORAGE_STATE) to record against app.screenci.com.
|
|
20
|
+
'docs/guides/studio': {
|
|
21
|
+
sourcePath: 'screenci/docs/video-sources/studio.screenci.ts',
|
|
22
|
+
showSource: false,
|
|
23
|
+
},
|
|
24
|
+
// The animated locator-highlight overlay in the Overlays guide. Add a
|
|
25
|
+
// publicId after publishing the source.
|
|
26
|
+
'docs/guides/assets-and-overlays': {
|
|
27
|
+
sourcePath: 'screenci/docs/video-sources/locator-highlight-animated.screenci.ts',
|
|
28
|
+
},
|
|
29
|
+
// The locator-highlight still in the Screenshots guide. Published as a
|
|
30
|
+
// screenshot recording; add a publicId after publishing the source.
|
|
31
|
+
'docs/guides/screenshots': {
|
|
32
|
+
kind: 'screenshot',
|
|
33
|
+
alt: 'A marketing-site link highlighted by a pink ring with margin around it, framed as a branded still',
|
|
34
|
+
sourcePath: 'screenci/docs/video-sources/locator-highlight-still.screenci.ts',
|
|
10
35
|
},
|
|
11
36
|
};
|
|
12
37
|
export function getDocVideo(slug) {
|
package/dist/docs/videos.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"videos.js","sourceRoot":"","sources":["../../docs/videos.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"videos.js","sourceRoot":"","sources":["../../docs/videos.ts"],"names":[],"mappings":"AAyBA,MAAM,CAAC,MAAM,iBAAiB,GAAG;IAC/B,mBAAmB,EAAE;QACnB,QAAQ,EAAE,kCAAkC;QAC5C,UAAU,EAAE,sDAAsD;QAClE,UAAU,EAAE,KAAK;KAClB;IACD,oBAAoB,EAAE;QACpB,QAAQ,EAAE,kCAAkC;QAC5C,UAAU,EAAE,6CAA6C;KAC1D;IACD,2EAA2E;IAC3E,yCAAyC;IACzC,oCAAoC,EAAE;QACpC,QAAQ,EAAE,kCAAkC;QAC5C,UAAU,EAAE,qDAAqD;QACjE,UAAU,EAAE,KAAK;KAClB;IACD,0EAA0E;IAC1E,2EAA2E;IAC3E,oBAAoB,EAAE;QACpB,UAAU,EAAE,gDAAgD;QAC5D,UAAU,EAAE,KAAK;KAClB;IACD,sEAAsE;IACtE,wCAAwC;IACxC,iCAAiC,EAAE;QACjC,UAAU,EACR,oEAAoE;KACvE;IACD,uEAAuE;IACvE,oEAAoE;IACpE,yBAAyB,EAAE;QACzB,IAAI,EAAE,YAAY;QAClB,GAAG,EAAE,mGAAmG;QACxG,UAAU,EACR,iEAAiE;KACpE;CAC0C,CAAA;AAE7C,MAAM,UAAU,WAAW,CAAC,IAAY;IACtC,OAAO,iBAAiB,CAAC,IAAsC,CAAC,IAAI,IAAI,CAAA;AAC1E,CAAC;AAED,MAAM,UAAU,WAAW,CAAC,KAAe;IACzC,OAAO,UAAU,IAAI,KAAK,CAAA;AAC5B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"htmlRasterizer.e2e.d.ts","sourceRoot":"","sources":["../../e2e/htmlRasterizer.e2e.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import { test, expect } from '@playwright/test';
|
|
2
|
+
import { mkdtemp, rm, readFile } from 'fs/promises';
|
|
3
|
+
import { tmpdir } from 'os';
|
|
4
|
+
import { join } from 'path';
|
|
5
|
+
import { spawnSync } from 'child_process';
|
|
6
|
+
import ffmpegStatic from 'ffmpeg-static';
|
|
7
|
+
import { rasterizeAnimatedHtmlOverlay, rasterizeHtmlOverlay, } from '../src/htmlRasterizer.js';
|
|
8
|
+
import { createScreenCIRuntimeContext, runWithScreenCIRuntimeContext, } from '../src/runtimeContext.js';
|
|
9
|
+
const PNG_SIGNATURE = Buffer.from([
|
|
10
|
+
0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a,
|
|
11
|
+
]);
|
|
12
|
+
test('rasterizes HTML to a transparent PNG sized to its content', async ({ page, }) => {
|
|
13
|
+
const dir = await mkdtemp(join(tmpdir(), 'screenci-html-e2e-'));
|
|
14
|
+
try {
|
|
15
|
+
const result = await runWithScreenCIRuntimeContext(createScreenCIRuntimeContext({ page, recordingDir: dir }), () => rasterizeHtmlOverlay({
|
|
16
|
+
name: 'badge',
|
|
17
|
+
html: '<div style="width:200px;height:80px;background:#f00">hi</div>',
|
|
18
|
+
}));
|
|
19
|
+
// boundingBox is reported in CSS pixels (the underlying PNG is rendered at
|
|
20
|
+
// the device scale factor for crispness).
|
|
21
|
+
expect(result.width).toBe(200);
|
|
22
|
+
expect(result.height).toBe(80);
|
|
23
|
+
const buffer = await readFile(result.path);
|
|
24
|
+
expect(buffer.subarray(0, 8)).toEqual(PNG_SIGNATURE);
|
|
25
|
+
expect(buffer.length).toBeGreaterThan(0);
|
|
26
|
+
}
|
|
27
|
+
finally {
|
|
28
|
+
await rm(dir, { recursive: true, force: true });
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
test('does not require a fixed viewport: content larger than the default viewport still renders', async ({ page, }) => {
|
|
32
|
+
const dir = await mkdtemp(join(tmpdir(), 'screenci-html-e2e-'));
|
|
33
|
+
try {
|
|
34
|
+
const result = await runWithScreenCIRuntimeContext(createScreenCIRuntimeContext({ page, recordingDir: dir }), () => rasterizeHtmlOverlay({
|
|
35
|
+
name: 'wide',
|
|
36
|
+
html: '<div style="width:640px;height:120px;background:#0a0"></div>',
|
|
37
|
+
}));
|
|
38
|
+
expect(result.width).toBe(640);
|
|
39
|
+
expect(result.height).toBe(120);
|
|
40
|
+
}
|
|
41
|
+
finally {
|
|
42
|
+
await rm(dir, { recursive: true, force: true });
|
|
43
|
+
}
|
|
44
|
+
});
|
|
45
|
+
test('rasterizes an animated overlay to a two-stream transparent clip', async ({ page, }) => {
|
|
46
|
+
const dir = await mkdtemp(join(tmpdir(), 'screenci-anim-e2e-'));
|
|
47
|
+
try {
|
|
48
|
+
const result = await runWithScreenCIRuntimeContext(createScreenCIRuntimeContext({ page, recordingDir: dir }), () => rasterizeAnimatedHtmlOverlay({
|
|
49
|
+
name: 'intro',
|
|
50
|
+
html: '<div style="width:200px;height:80px;background:#f00;' +
|
|
51
|
+
'animation:fade 1s linear">hi' +
|
|
52
|
+
'<style>@keyframes fade{from{opacity:0}to{opacity:1}}</style></div>',
|
|
53
|
+
durationMs: 500,
|
|
54
|
+
fps: 30,
|
|
55
|
+
}));
|
|
56
|
+
expect(result.width).toBe(200);
|
|
57
|
+
expect(result.height).toBe(80);
|
|
58
|
+
expect(result.durationMs).toBe(500);
|
|
59
|
+
expect(result.path.endsWith('.mp4')).toBe(true);
|
|
60
|
+
const buffer = await readFile(result.path);
|
|
61
|
+
expect(buffer.length).toBeGreaterThan(0);
|
|
62
|
+
// The clip must carry two video streams: color + alpha matte.
|
|
63
|
+
const ffmpegPath = ffmpegStatic;
|
|
64
|
+
const probe = spawnSync(ffmpegPath, ['-hide_banner', '-i', result.path], {
|
|
65
|
+
encoding: 'utf8',
|
|
66
|
+
});
|
|
67
|
+
const info = `${probe.stdout ?? ''}${probe.stderr ?? ''}`;
|
|
68
|
+
const videoStreams = (info.match(/Stream #0:\d+.*Video:/g) ?? []).length;
|
|
69
|
+
expect(videoStreams).toBe(2);
|
|
70
|
+
}
|
|
71
|
+
finally {
|
|
72
|
+
await rm(dir, { recursive: true, force: true });
|
|
73
|
+
}
|
|
74
|
+
});
|
|
75
|
+
test('applies injected css so overlays can be styled with className', async ({ page, }) => {
|
|
76
|
+
const dir = await mkdtemp(join(tmpdir(), 'screenci-css-e2e-'));
|
|
77
|
+
try {
|
|
78
|
+
const result = await runWithScreenCIRuntimeContext(createScreenCIRuntimeContext({ page, recordingDir: dir }), () => rasterizeHtmlOverlay({
|
|
79
|
+
name: 'card',
|
|
80
|
+
html: '<div class="box"></div>',
|
|
81
|
+
css: '.box{width:120px;height:60px;background:#f00}',
|
|
82
|
+
}));
|
|
83
|
+
// Without injected CSS the bare <div> would collapse; the className sizes it.
|
|
84
|
+
expect(result.width).toBe(120);
|
|
85
|
+
expect(result.height).toBe(60);
|
|
86
|
+
}
|
|
87
|
+
finally {
|
|
88
|
+
await rm(dir, { recursive: true, force: true });
|
|
89
|
+
}
|
|
90
|
+
});
|
|
91
|
+
test('capturePadding grows the captured box around the content', async ({ page, }) => {
|
|
92
|
+
const dir = await mkdtemp(join(tmpdir(), 'screenci-pad-e2e-'));
|
|
93
|
+
try {
|
|
94
|
+
const result = await runWithScreenCIRuntimeContext(createScreenCIRuntimeContext({ page, recordingDir: dir }), () => rasterizeHtmlOverlay({
|
|
95
|
+
name: 'padded',
|
|
96
|
+
html: '<div style="width:200px;height:80px;background:#0a0"></div>',
|
|
97
|
+
capturePadding: 40,
|
|
98
|
+
}));
|
|
99
|
+
// 40px of transparent padding on every side: 200+80 x 80+80.
|
|
100
|
+
expect(result.width).toBe(280);
|
|
101
|
+
expect(result.height).toBe(160);
|
|
102
|
+
}
|
|
103
|
+
finally {
|
|
104
|
+
await rm(dir, { recursive: true, force: true });
|
|
105
|
+
}
|
|
106
|
+
});
|
|
107
|
+
//# sourceMappingURL=htmlRasterizer.e2e.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"htmlRasterizer.e2e.js","sourceRoot":"","sources":["../../e2e/htmlRasterizer.e2e.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;AAC/C,OAAO,EAAE,OAAO,EAAE,EAAE,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,EAAE,GAAG,EAAE,CAAC,EACzD,GAAG,EAAE,CACH,oBAAoB,CAAC;YACnB,IAAI,EAAE,QAAQ;YACd,IAAI,EAAE,6DAA6D;YACnE,cAAc,EAAE,EAAE;SACnB,CAAC,CACL,CAAA;QAED,6DAA6D;QAC7D,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;QAC9B,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;IACjC,CAAC;YAAS,CAAC;QACT,MAAM,EAAE,CAAC,GAAG,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAA;IACjD,CAAC;AACH,CAAC,CAAC,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"screenshot.e2e.d.ts","sourceRoot":"","sources":["../../e2e/screenshot.e2e.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { test, expect } from '@playwright/test';
|
|
2
|
+
import { resolveCrop } from '../src/crop.js';
|
|
3
|
+
import { buildScreenCIContextOptions } from '../src/contextOptions.js';
|
|
4
|
+
test.describe('resolveCrop', () => {
|
|
5
|
+
test('resolves a pixel rect for a locator', async ({ page }) => {
|
|
6
|
+
await page.setViewportSize({ width: 1000, height: 800 });
|
|
7
|
+
await page.setContent('<div id="card" style="position:absolute;left:100px;top:80px;width:300px;height:200px;background:#333"></div>');
|
|
8
|
+
const recorded = await resolveCrop(page.locator('#card'), page);
|
|
9
|
+
expect(recorded.source).toBe('locator');
|
|
10
|
+
expect(recorded.box.x).toBeCloseTo(100, 3);
|
|
11
|
+
expect(recorded.box.y).toBeCloseTo(80, 3);
|
|
12
|
+
expect(recorded.box.width).toBeCloseTo(300, 3);
|
|
13
|
+
expect(recorded.box.height).toBeCloseTo(200, 3);
|
|
14
|
+
expect(recorded.padding).toEqual({ top: 0, right: 0, bottom: 0, left: 0 });
|
|
15
|
+
});
|
|
16
|
+
test('resolves an explicit pixel region', async ({ page }) => {
|
|
17
|
+
await page.setViewportSize({ width: 1000, height: 800 });
|
|
18
|
+
const recorded = await resolveCrop({ x: 100, y: 160, width: 800, height: 480 }, page);
|
|
19
|
+
expect(recorded.source).toBe('region');
|
|
20
|
+
expect(recorded.box.x).toBeCloseTo(100, 3);
|
|
21
|
+
expect(recorded.box.y).toBeCloseTo(160, 3);
|
|
22
|
+
expect(recorded.box.width).toBeCloseTo(800, 3);
|
|
23
|
+
expect(recorded.box.height).toBeCloseTo(480, 3);
|
|
24
|
+
});
|
|
25
|
+
test('keeps a locator box locked and records padding separately', async ({ page, }) => {
|
|
26
|
+
await page.setViewportSize({ width: 1000, height: 1000 });
|
|
27
|
+
await page.setContent('<div id="card" style="position:absolute;left:400px;top:400px;width:200px;height:200px"></div>');
|
|
28
|
+
const recorded = await resolveCrop(page.locator('#card'), page, {
|
|
29
|
+
padding: 20,
|
|
30
|
+
});
|
|
31
|
+
// The element box is unchanged; the renderer applies the padding later.
|
|
32
|
+
expect(recorded.box.x).toBeCloseTo(400, 3);
|
|
33
|
+
expect(recorded.box.y).toBeCloseTo(400, 3);
|
|
34
|
+
expect(recorded.box.width).toBeCloseTo(200, 3);
|
|
35
|
+
expect(recorded.box.height).toBeCloseTo(200, 3);
|
|
36
|
+
expect(recorded.padding).toEqual({
|
|
37
|
+
top: 20,
|
|
38
|
+
right: 20,
|
|
39
|
+
bottom: 20,
|
|
40
|
+
left: 20,
|
|
41
|
+
});
|
|
42
|
+
});
|
|
43
|
+
test('rejects a negative region', async ({ page }) => {
|
|
44
|
+
await page.setViewportSize({ width: 1000, height: 800 });
|
|
45
|
+
await expect(resolveCrop({ x: -1, y: 0, width: 500, height: 500 }, page)).rejects.toThrow(/crop/);
|
|
46
|
+
});
|
|
47
|
+
});
|
|
48
|
+
test.describe('context option forwarding', () => {
|
|
49
|
+
test('forwards colorScheme: dark to the created context', async ({ browser, }) => {
|
|
50
|
+
const context = await browser.newContext(buildScreenCIContextOptions({
|
|
51
|
+
dimensions: { width: 800, height: 600 },
|
|
52
|
+
forwarded: { colorScheme: 'dark' },
|
|
53
|
+
applyLocaleDefault: false,
|
|
54
|
+
}));
|
|
55
|
+
const page = await context.newPage();
|
|
56
|
+
const prefersDark = await page.evaluate(() => window.matchMedia('(prefers-color-scheme: dark)').matches);
|
|
57
|
+
expect(prefersDark).toBe(true);
|
|
58
|
+
await context.close();
|
|
59
|
+
});
|
|
60
|
+
test('captures at the requested deviceScaleFactor', async ({ browser }) => {
|
|
61
|
+
const context = await browser.newContext(buildScreenCIContextOptions({
|
|
62
|
+
dimensions: { width: 400, height: 300 },
|
|
63
|
+
forwarded: {},
|
|
64
|
+
applyLocaleDefault: false,
|
|
65
|
+
deviceScaleFactor: 2,
|
|
66
|
+
}));
|
|
67
|
+
const page = await context.newPage();
|
|
68
|
+
const dpr = await page.evaluate(() => window.devicePixelRatio);
|
|
69
|
+
expect(dpr).toBe(2);
|
|
70
|
+
await context.close();
|
|
71
|
+
});
|
|
72
|
+
});
|
|
73
|
+
//# sourceMappingURL=screenshot.e2e.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"screenshot.e2e.js","sourceRoot":"","sources":["../../e2e/screenshot.e2e.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;AAC/C,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAA;AAC5C,OAAO,EAAE,2BAA2B,EAAE,MAAM,0BAA0B,CAAA;AAEtE,IAAI,CAAC,QAAQ,CAAC,aAAa,EAAE,GAAG,EAAE;IAChC,IAAI,CAAC,qCAAqC,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE;QAC7D,MAAM,IAAI,CAAC,eAAe,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,CAAC,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AU,CAAC,8BAA8B,CAAC,CAAC,OAAO,CAChE,CAAA;QACD,MAAM,CAAC,WAAW,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;QAC9B,MAAM,OAAO,CAAC,KAAK,EAAE,CAAA;IACvB,CAAC,CAAC,CAAA;IAEF,IAAI,CAAC,6CAA6C,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE;QACxE,MAAM,OAAO,GAAG,MAAM,OAAO,CAAC,UAAU,CACtC,2BAA2B,CAAC;YAC1B,UAAU,EAAE,EAAE,KAAK,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE;YACvC,SAAS,EAAE,EAAE;YACb,kBAAkB,EAAE,KAAK;YACzB,iBAAiB,EAAE,CAAC;SACrB,CAAC,CACH,CAAA;QACD,MAAM,IAAI,GAAG,MAAM,OAAO,CAAC,OAAO,EAAE,CAAA;QACpC,MAAM,GAAG,GAAG,MAAM,IAAI,CAAC,QAAQ,CAAC,GAAG,EAAE,CAAC,MAAM,CAAC,gBAAgB,CAAC,CAAA;QAC9D,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;QACnB,MAAM,OAAO,CAAC,KAAK,EAAE,CAAA;IACvB,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,19 +1,25 @@
|
|
|
1
|
-
export type { AspectRatio, FPS, Quality, RecordUploadPolicy, RecordOptions, RenderOptions, ScreenCIConfig, ExtendedScreenCIConfig, AutoZoomOptions, Easing, } from './src/types.js';
|
|
1
|
+
export type { AspectRatio, FPS, Quality, RecordUploadPolicy, RecordOptions, RenderOptions, ScreenshotOutputFormat, ScreenshotRenderOptions, ScreenCIConfig, ExtendedScreenCIConfig, AutoZoomOptions, Easing, VideoEncoderPreset, } from './src/types.js';
|
|
2
2
|
export { voices, modelTypes } from './src/voices.js';
|
|
3
3
|
export type { VoiceKey, ModelVoiceKey, ElevenLabsVoiceKey, CustomVoiceRef, ModelType, } from './src/voices.js';
|
|
4
4
|
export { defineConfig } from './src/config.js';
|
|
5
5
|
export { video } from './src/video.js';
|
|
6
|
+
export { screenshot } from './src/screenshot.js';
|
|
7
|
+
export type { CropTarget, CropRegion, CropOptions, ScreenshotCrop, ScreenshotCropRecord, ResolvedCropPadding, } from './src/crop.js';
|
|
6
8
|
export type { ScreenCIPage, ScreenCILocator } from './src/types.js';
|
|
7
9
|
export { createNarration, createStudioNarration } from './src/cue.js';
|
|
8
10
|
export type { NarrationCue, Cues, TopLevelVoiceConfig } from './src/cue.js';
|
|
9
|
-
export {
|
|
11
|
+
export { isStudioRenderOptions } from './src/studio.js';
|
|
10
12
|
export type { StudioRenderOptionsSentinel } from './src/studio.js';
|
|
11
13
|
export { hide } from './src/hide.js';
|
|
12
14
|
export { speed } from './src/speed.js';
|
|
13
15
|
export { time } from './src/time.js';
|
|
14
16
|
export { autoZoom } from './src/autoZoom.js';
|
|
15
17
|
export { zoomTo, resetZoom } from './src/manualZoom.js';
|
|
16
|
-
export {
|
|
17
|
-
export type {
|
|
18
|
+
export { createOverlays, createStudioOverlays, setOverlayCss, MAX_AUDIO_LEVEL, } from './src/asset.js';
|
|
19
|
+
export type { OverlayController, OverlayConfig, OverlayConfigFactory, OverlayInput, OverlayInputOrFactory, Overlays, OverlayControllerFor, ReactElementLike, OverlayPlacement, } from './src/asset.js';
|
|
20
|
+
export { overlayRect } from './src/overlayRect.js';
|
|
21
|
+
export type { OverlayRect, OverlayRectOptions } from './src/overlayRect.js';
|
|
22
|
+
export { createAudio, createStudioAudio } from './src/audio.js';
|
|
23
|
+
export type { AudioController, AudioConfig, AudioInput, AudioTracks, } from './src/audio.js';
|
|
18
24
|
export type { ZoomTarget, ZoomTargetPoint } from './src/manualZoom.js';
|
|
19
25
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AACA,YAAY,EACV,WAAW,EACX,GAAG,EACH,OAAO,EACP,kBAAkB,EAClB,aAAa,EACb,aAAa,EACb,cAAc,EACd,sBAAsB,EACtB,eAAe,EACf,MAAM,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AACA,YAAY,EACV,WAAW,EACX,GAAG,EACH,OAAO,EACP,kBAAkB,EAClB,aAAa,EACb,aAAa,EACb,sBAAsB,EACtB,uBAAuB,EACvB,cAAc,EACd,sBAAsB,EACtB,eAAe,EACf,MAAM,EACN,kBAAkB,GACnB,MAAM,gBAAgB,CAAA;AAGvB,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AACpD,YAAY,EACV,QAAQ,EACR,aAAa,EACb,kBAAkB,EAClB,cAAc,EACd,SAAS,GACV,MAAM,iBAAiB,CAAA;AAGxB,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAA;AAG9C,OAAO,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAA;AACtC,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAA;AAChD,YAAY,EACV,UAAU,EACV,UAAU,EACV,WAAW,EACX,cAAc,EACd,oBAAoB,EACpB,mBAAmB,GACpB,MAAM,eAAe,CAAA;AACtB,YAAY,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAA;AACnE,OAAO,EAAE,eAAe,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAA;AACrE,YAAY,EAAE,YAAY,EAAE,IAAI,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAA;AAC3E,OAAO,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAA;AACvD,YAAY,EAAE,2BAA2B,EAAE,MAAM,iBAAiB,CAAA;AAClE,OAAO,EAAE,IAAI,EAAE,MAAM,eAAe,CAAA;AACpC,OAAO,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAA;AACtC,OAAO,EAAE,IAAI,EAAE,MAAM,eAAe,CAAA;AACpC,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAC5C,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAA;AACvD,OAAO,EACL,cAAc,EACd,oBAAoB,EACpB,aAAa,EACb,eAAe,GAChB,MAAM,gBAAgB,CAAA;AACvB,YAAY,EACV,iBAAiB,EACjB,aAAa,EACb,oBAAoB,EACpB,YAAY,EACZ,qBAAqB,EACrB,QAAQ,EACR,oBAAoB,EACpB,gBAAgB,EAChB,gBAAgB,GACjB,MAAM,gBAAgB,CAAA;AACvB,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAA;AAClD,YAAY,EAAE,WAAW,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAA;AAC3E,OAAO,EAAE,WAAW,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAA;AAC/D,YAAY,EACV,eAAe,EACf,WAAW,EACX,UAAU,EACV,WAAW,GACZ,MAAM,gBAAgB,CAAA;AACvB,YAAY,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAA"}
|
package/dist/index.js
CHANGED
|
@@ -4,12 +4,15 @@ export { voices, modelTypes } from './src/voices.js';
|
|
|
4
4
|
export { defineConfig } from './src/config.js';
|
|
5
5
|
// Re-export video fixture and narration cue
|
|
6
6
|
export { video } from './src/video.js';
|
|
7
|
+
export { screenshot } from './src/screenshot.js';
|
|
7
8
|
export { createNarration, createStudioNarration } from './src/cue.js';
|
|
8
|
-
export {
|
|
9
|
+
export { isStudioRenderOptions } from './src/studio.js';
|
|
9
10
|
export { hide } from './src/hide.js';
|
|
10
11
|
export { speed } from './src/speed.js';
|
|
11
12
|
export { time } from './src/time.js';
|
|
12
13
|
export { autoZoom } from './src/autoZoom.js';
|
|
13
14
|
export { zoomTo, resetZoom } from './src/manualZoom.js';
|
|
14
|
-
export {
|
|
15
|
+
export { createOverlays, createStudioOverlays, setOverlayCss, MAX_AUDIO_LEVEL, } from './src/asset.js';
|
|
16
|
+
export { overlayRect } from './src/overlayRect.js';
|
|
17
|
+
export { createAudio, createStudioAudio } from './src/audio.js';
|
|
15
18
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAiBA,mBAAmB;AACnB,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AASpD,4BAA4B;AAC5B,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAA;AAE9C,4CAA4C;AAC5C,OAAO,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAA;AACtC,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAA;AAUhD,OAAO,EAAE,eAAe,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAA;AAErE,OAAO,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAA;AAEvD,OAAO,EAAE,IAAI,EAAE,MAAM,eAAe,CAAA;AACpC,OAAO,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAA;AACtC,OAAO,EAAE,IAAI,EAAE,MAAM,eAAe,CAAA;AACpC,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAC5C,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAA;AACvD,OAAO,EACL,cAAc,EACd,oBAAoB,EACpB,aAAa,EACb,eAAe,GAChB,MAAM,gBAAgB,CAAA;AAYvB,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAA;AAElD,OAAO,EAAE,WAAW,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAA"}
|