@a11y-oracle/visual-engine 1.0.0 → 1.1.1
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"screenshot.d.ts","sourceRoot":"","sources":["../../src/lib/screenshot.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAE7D,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AAC5D,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"screenshot.d.ts","sourceRoot":"","sources":["../../src/lib/screenshot.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAE7D,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AAC5D,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAC;AA6GxD;;;;;;GAMG;AACH,wBAAsB,gBAAgB,CACpC,GAAG,EAAE,cAAc,EACnB,QAAQ,EAAE,MAAM,GACf,OAAO,CAAC,qBAAqB,GAAG,IAAI,CAAC,CAOvC;AAED;;;;;;;GAOG;AACH,wBAAsB,gBAAgB,CACpC,GAAG,EAAE,cAAc,EACnB,QAAQ,EAAE,MAAM,GACf,OAAO,CAAC,OAAO,CAAC,CAOlB;AAED;;;;;;;;;;;GAWG;AACH,wBAAsB,wBAAwB,CAC5C,GAAG,EAAE,cAAc,EACnB,QAAQ,EAAE,MAAM,GACf,OAAO,CAAC;IAAE,SAAS,EAAE,UAAU,CAAC;IAAC,SAAS,EAAE,QAAQ,GAAG,IAAI,CAAA;CAAE,GAAG,IAAI,CAAC,CA4CvE"}
|
package/dist/lib/screenshot.js
CHANGED
|
@@ -52,6 +52,9 @@ function getCaptureInfoAndHideScript(selector) {
|
|
|
52
52
|
(() => {
|
|
53
53
|
const el = document.querySelector(${JSON.stringify(selector)});
|
|
54
54
|
if (!el) return null;
|
|
55
|
+
// Scroll element into viewport so Page.captureScreenshot can capture it.
|
|
56
|
+
// Without this, off-screen elements produce white screenshots.
|
|
57
|
+
el.scrollIntoView({ behavior: 'instant', block: 'center', inline: 'nearest' });
|
|
55
58
|
const cs = window.getComputedStyle(el);
|
|
56
59
|
const color = cs.color || '';
|
|
57
60
|
const rect = el.getBoundingClientRect();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@a11y-oracle/visual-engine",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.1.1",
|
|
4
4
|
"description": "Visual pixel analysis engine for color contrast resolution using CDP screenshot capture and luminance analysis",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "a11y-oracle",
|
|
@@ -43,8 +43,8 @@
|
|
|
43
43
|
"!**/*.tsbuildinfo"
|
|
44
44
|
],
|
|
45
45
|
"dependencies": {
|
|
46
|
-
"@a11y-oracle/cdp-types": "1.
|
|
47
|
-
"@a11y-oracle/focus-analyzer": "1.
|
|
46
|
+
"@a11y-oracle/cdp-types": "1.1.1",
|
|
47
|
+
"@a11y-oracle/focus-analyzer": "1.1.1",
|
|
48
48
|
"fast-png": "^8.0.0",
|
|
49
49
|
"tslib": "^2.3.0"
|
|
50
50
|
}
|