tuffgal 0.1.0-alpha.7 → 0.1.0-alpha.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/CHANGELOG.md
CHANGED
|
@@ -6,6 +6,12 @@ this project uses [Pride Versioning](https://pridever.org) → `PROUD.DEFAULT.SH
|
|
|
6
6
|
|
|
7
7
|
## [Unreleased]
|
|
8
8
|
|
|
9
|
+
## [0.1.0-alpha.8] — 2026-06-20
|
|
10
|
+
|
|
11
|
+
### Fixed
|
|
12
|
+
|
|
13
|
+
- Reset page scroll to origin before each full-page capture, so `position: sticky` and `fixed` elements no longer render shifted by `scrollY`
|
|
14
|
+
|
|
9
15
|
## [0.1.0-alpha.7] — 2026-06-20
|
|
10
16
|
|
|
11
17
|
### Added
|
|
@@ -111,7 +117,8 @@ styling or interactivity.
|
|
|
111
117
|
Initial public alpha. Tuffgal extracted from [Linklater](https://github.com/nschneble/linklater)'s
|
|
112
118
|
in-tree visual testing workspace.
|
|
113
119
|
|
|
114
|
-
[Unreleased]: https://github.com/nschneble/tuffgal/compare/v0.1.0-alpha.
|
|
120
|
+
[Unreleased]: https://github.com/nschneble/tuffgal/compare/v0.1.0-alpha.8...HEAD
|
|
121
|
+
[0.1.0-alpha.8]: https://github.com/nschneble/tuffgal/releases/tag/v0.1.0-alpha.8
|
|
115
122
|
[0.1.0-alpha.7]: https://github.com/nschneble/tuffgal/releases/tag/v0.1.0-alpha.7
|
|
116
123
|
[0.1.0-alpha.6]: https://github.com/nschneble/tuffgal/releases/tag/v0.1.0-alpha.6
|
|
117
124
|
[0.1.0-alpha.5]: https://github.com/nschneble/tuffgal/releases/tag/v0.1.0-alpha.5
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"capture.d.ts","sourceRoot":"","sources":["../../src/screenshots/capture.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAEhD;;;;;GAKG;AACH,wBAAsB,WAAW,CAC/B,IAAI,EAAE,IAAI,EACV,KAAK,GAAE,OAAO,EAAO,GACpB,OAAO,CAAC,MAAM,CAAC,
|
|
1
|
+
{"version":3,"file":"capture.d.ts","sourceRoot":"","sources":["../../src/screenshots/capture.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAEhD;;;;;GAKG;AACH,wBAAsB,WAAW,CAC/B,IAAI,EAAE,IAAI,EACV,KAAK,GAAE,OAAO,EAAO,GACpB,OAAO,CAAC,MAAM,CAAC,CAqBjB"}
|
|
@@ -5,6 +5,18 @@
|
|
|
5
5
|
* image is encoded — use them to neutralise randomised or time-based regions.
|
|
6
6
|
*/
|
|
7
7
|
export async function capturePage(page, masks = []) {
|
|
8
|
+
// A `fullPage` screenshot composites the whole document, but it does so at
|
|
9
|
+
// the page's current scroll offset. `position: sticky` / `fixed` elements
|
|
10
|
+
// resolve their offset against that scroll position, so a page captured
|
|
11
|
+
// mid-scroll renders its sticky chrome (sidebars, headers) shifted down by
|
|
12
|
+
// `scrollY` — the same UI produces a different image purely because an
|
|
13
|
+
// earlier step left the viewport scrolled. Resetting to the origin first
|
|
14
|
+
// pins those elements to their static-baseline position so the capture is
|
|
15
|
+
// deterministic. `instant` defeats any `scroll-behavior: smooth` the page
|
|
16
|
+
// sets, which would otherwise animate and reintroduce a timing race.
|
|
17
|
+
// String form so the snippet runs in the page (DOM) context without
|
|
18
|
+
// pulling the DOM lib into this Node-side module's type environment.
|
|
19
|
+
await page.evaluate(`window.scrollTo({ top: 0, left: 0, behavior: 'instant' })`);
|
|
8
20
|
return page.screenshot({
|
|
9
21
|
fullPage: true,
|
|
10
22
|
animations: 'disabled',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"capture.js","sourceRoot":"","sources":["../../src/screenshots/capture.ts"],"names":[],"mappings":"AAEA;;;;;GAKG;AACH,MAAM,CAAC,KAAK,UAAU,WAAW,CAC/B,IAAU,EACV,QAAmB,EAAE;IAErB,OAAO,IAAI,CAAC,UAAU,CAAC;QACrB,QAAQ,EAAE,IAAI;QACd,UAAU,EAAE,UAAU;QACtB,KAAK,EAAE,MAAM;QACb,IAAI,EAAE,KAAK;KACZ,CAAC,CAAC;AACL,CAAC"}
|
|
1
|
+
{"version":3,"file":"capture.js","sourceRoot":"","sources":["../../src/screenshots/capture.ts"],"names":[],"mappings":"AAEA;;;;;GAKG;AACH,MAAM,CAAC,KAAK,UAAU,WAAW,CAC/B,IAAU,EACV,QAAmB,EAAE;IAErB,2EAA2E;IAC3E,0EAA0E;IAC1E,wEAAwE;IACxE,2EAA2E;IAC3E,uEAAuE;IACvE,yEAAyE;IACzE,0EAA0E;IAC1E,0EAA0E;IAC1E,qEAAqE;IACrE,oEAAoE;IACpE,qEAAqE;IACrE,MAAM,IAAI,CAAC,QAAQ,CACjB,2DAA2D,CAC5D,CAAC;IACF,OAAO,IAAI,CAAC,UAAU,CAAC;QACrB,QAAQ,EAAE,IAAI;QACd,UAAU,EAAE,UAAU;QACtB,KAAK,EAAE,MAAM;QACb,IAAI,EAAE,KAAK;KACZ,CAAC,CAAC;AACL,CAAC"}
|