@alliance-droid/status-feedback-system 1.3.2 → 1.3.3
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.
|
@@ -14,12 +14,25 @@ export async function captureScreenshot() {
|
|
|
14
14
|
height: window.innerHeight,
|
|
15
15
|
windowWidth: window.innerWidth,
|
|
16
16
|
windowHeight: window.innerHeight,
|
|
17
|
+
ignoreElements: (element) => {
|
|
18
|
+
// Skip elements that might have unsupported CSS (oklab, oklch, color-mix)
|
|
19
|
+
const style = window.getComputedStyle(element);
|
|
20
|
+
const hasUnsupportedColor = [
|
|
21
|
+
style.color,
|
|
22
|
+
style.backgroundColor,
|
|
23
|
+
style.borderColor,
|
|
24
|
+
].some(color => color && (color.includes('oklab') || color.includes('oklch') || color.includes('color-mix')));
|
|
25
|
+
return hasUnsupportedColor;
|
|
26
|
+
},
|
|
17
27
|
});
|
|
18
28
|
return canvas.toDataURL('image/png');
|
|
19
29
|
}
|
|
20
30
|
catch (err) {
|
|
21
31
|
console.error('[DevFeedback] Screenshot capture failed:', err);
|
|
22
|
-
|
|
32
|
+
if (err instanceof Error && err.message.includes('oklab')) {
|
|
33
|
+
console.warn('[DevFeedback] Your CSS uses oklab/oklch colors which html2canvas doesn\'t support. Screenshot skipped.');
|
|
34
|
+
}
|
|
35
|
+
// html2canvas failed (unsupported CSS, cross-origin iframe, etc.)
|
|
23
36
|
return null;
|
|
24
37
|
}
|
|
25
38
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@alliance-droid/status-feedback-system",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.3",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Drop-in system status pages and user feedback forms for SvelteKit apps",
|
|
6
6
|
"svelte": "./dist/index.js",
|
|
@@ -24,19 +24,15 @@
|
|
|
24
24
|
"test:watch": "vitest",
|
|
25
25
|
"prepublishOnly": "npm run build"
|
|
26
26
|
},
|
|
27
|
+
"dependencies": {
|
|
28
|
+
"html2canvas": "^1.4.1"
|
|
29
|
+
},
|
|
27
30
|
"peerDependencies": {
|
|
28
31
|
"@alliance-droid/svelte-component-library": ">=1.0.0",
|
|
29
|
-
"html2canvas": "^1.4.1",
|
|
30
32
|
"svelte": "^5.0.0"
|
|
31
33
|
},
|
|
32
|
-
"peerDependenciesMeta": {
|
|
33
|
-
"html2canvas": {
|
|
34
|
-
"optional": true
|
|
35
|
-
}
|
|
36
|
-
},
|
|
37
34
|
"devDependencies": {
|
|
38
35
|
"@alliance-droid/svelte-component-library": "^1.0.5",
|
|
39
|
-
"html2canvas": "^1.4.1",
|
|
40
36
|
"@sveltejs/package": "^2.3.0",
|
|
41
37
|
"@sveltejs/vite-plugin-svelte": "^6.0.0",
|
|
42
38
|
"@testing-library/jest-dom": "^6.9.1",
|