tuffgal 0.1.0-alpha.13 → 0.1.0-alpha.14
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
|
@@ -8,6 +8,12 @@ this project uses [Pride Versioning](https://pridever.org) → `PROUD.DEFAULT.SH
|
|
|
8
8
|
|
|
9
9
|
_Nothing just yet_
|
|
10
10
|
|
|
11
|
+
## [0.1.0-alpha.14] — 2026-07-04
|
|
12
|
+
|
|
13
|
+
### Fixed
|
|
14
|
+
|
|
15
|
+
A `viewport` capture no longer resets the page's scroll offset before shooting.
|
|
16
|
+
|
|
11
17
|
## [0.1.0-alpha.13] — 2026-06-30
|
|
12
18
|
|
|
13
19
|
### Changed
|
|
@@ -187,7 +193,8 @@ styling or interactivity.
|
|
|
187
193
|
Initial public alpha. Tuffgal extracted from [Linklater](https://github.com/nschneble/linklater)'s
|
|
188
194
|
in-tree visual testing workspace.
|
|
189
195
|
|
|
190
|
-
[Unreleased]: https://github.com/nschneble/tuffgal/compare/v0.1.0-alpha.
|
|
196
|
+
[Unreleased]: https://github.com/nschneble/tuffgal/compare/v0.1.0-alpha.14...HEAD
|
|
197
|
+
[0.1.0-alpha.14]: https://github.com/nschneble/tuffgal/releases/tag/v0.1.0-alpha.14
|
|
191
198
|
[0.1.0-alpha.13]: https://github.com/nschneble/tuffgal/releases/tag/v0.1.0-alpha.13
|
|
192
199
|
[0.1.0-alpha.12]: https://github.com/nschneble/tuffgal/releases/tag/v0.1.0-alpha.12
|
|
193
200
|
[0.1.0-alpha.11]: https://github.com/nschneble/tuffgal/releases/tag/v0.1.0-alpha.11
|
|
@@ -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;AAChD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAEhD;;;;;;;;;GASG;AACH,wBAAsB,WAAW,CAC/B,IAAI,EAAE,IAAI,EACV,KAAK,GAAE,OAAO,EAAO,EACrB,IAAI,GAAE,WAAwB,GAC7B,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;AAChD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAEhD;;;;;;;;;GASG;AACH,wBAAsB,WAAW,CAC/B,IAAI,EAAE,IAAI,EACV,KAAK,GAAE,OAAO,EAAO,EACrB,IAAI,GAAE,WAAwB,GAC7B,OAAO,CAAC,MAAM,CAAC,CA8BjB"}
|
|
@@ -9,19 +9,27 @@
|
|
|
9
9
|
* composites the entire scrollable document however tall.
|
|
10
10
|
*/
|
|
11
11
|
export async function capturePage(page, masks = [], mode = 'viewport') {
|
|
12
|
-
//
|
|
13
|
-
// `position: sticky` / `fixed`
|
|
14
|
-
//
|
|
15
|
-
//
|
|
16
|
-
//
|
|
17
|
-
//
|
|
18
|
-
//
|
|
19
|
-
//
|
|
20
|
-
//
|
|
21
|
-
//
|
|
22
|
-
//
|
|
23
|
-
//
|
|
24
|
-
|
|
12
|
+
// `fullPage` composites the whole scrollable document into one image. When
|
|
13
|
+
// the document is captured at a non-zero offset, `position: sticky` / `fixed`
|
|
14
|
+
// chrome (sidebars, headers) resolves against that scroll position and lands
|
|
15
|
+
// shifted down by `scrollY` in the stitch — the same UI produces a different
|
|
16
|
+
// image purely because an earlier step left the viewport scrolled. Resetting
|
|
17
|
+
// to the origin first pins those elements to their static-baseline position
|
|
18
|
+
// so the capture is deterministic. `instant` defeats any `scroll-behavior:
|
|
19
|
+
// smooth` the page sets, which would otherwise animate and reintroduce a
|
|
20
|
+
// timing race.
|
|
21
|
+
//
|
|
22
|
+
// A `viewport` shot captures exactly the box the flow scrolled to, so it must
|
|
23
|
+
// NOT reset — a story that scrolls to a below-the-fold section (a Settings
|
|
24
|
+
// panel, a success banner) would otherwise capture the top of the page
|
|
25
|
+
// instead of the region it navigated to. The flow lands at a deterministic
|
|
26
|
+
// offset, so the viewport shot is deterministic without any reset.
|
|
27
|
+
//
|
|
28
|
+
// String form so the snippet runs in the page (DOM) context without pulling
|
|
29
|
+
// the DOM lib into this Node-side module's type environment.
|
|
30
|
+
if (mode === 'fullPage') {
|
|
31
|
+
await page.evaluate(`window.scrollTo({ top: 0, left: 0, behavior: 'instant' })`);
|
|
32
|
+
}
|
|
25
33
|
return page.screenshot({
|
|
26
34
|
fullPage: mode === 'fullPage',
|
|
27
35
|
animations: 'disabled',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"capture.js","sourceRoot":"","sources":["../../src/screenshots/capture.ts"],"names":[],"mappings":"AAGA;;;;;;;;;GASG;AACH,MAAM,CAAC,KAAK,UAAU,WAAW,CAC/B,IAAU,EACV,QAAmB,EAAE,EACrB,OAAoB,UAAU;IAE9B,
|
|
1
|
+
{"version":3,"file":"capture.js","sourceRoot":"","sources":["../../src/screenshots/capture.ts"],"names":[],"mappings":"AAGA;;;;;;;;;GASG;AACH,MAAM,CAAC,KAAK,UAAU,WAAW,CAC/B,IAAU,EACV,QAAmB,EAAE,EACrB,OAAoB,UAAU;IAE9B,2EAA2E;IAC3E,8EAA8E;IAC9E,6EAA6E;IAC7E,6EAA6E;IAC7E,6EAA6E;IAC7E,4EAA4E;IAC5E,2EAA2E;IAC3E,yEAAyE;IACzE,eAAe;IACf,EAAE;IACF,8EAA8E;IAC9E,2EAA2E;IAC3E,uEAAuE;IACvE,2EAA2E;IAC3E,mEAAmE;IACnE,EAAE;IACF,4EAA4E;IAC5E,6DAA6D;IAC7D,IAAI,IAAI,KAAK,UAAU,EAAE,CAAC;QACxB,MAAM,IAAI,CAAC,QAAQ,CACjB,2DAA2D,CAC5D,CAAC;IACJ,CAAC;IACD,OAAO,IAAI,CAAC,UAAU,CAAC;QACrB,QAAQ,EAAE,IAAI,KAAK,UAAU;QAC7B,UAAU,EAAE,UAAU;QACtB,KAAK,EAAE,MAAM;QACb,IAAI,EAAE,KAAK;KACZ,CAAC,CAAC;AACL,CAAC"}
|