From 0f3b207b234b1ad9c227f3f71e8c9480526efe1b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miguel=20=C3=81ngel?= Date: Wed, 6 May 2026 08:22:55 -0700 Subject: [PATCH] fix: format JSON files, remove unused function, fix capture test mocks --- packages/shader-transitions/src/capture.test.ts | 10 +++++----- packages/shader-transitions/src/capture.ts | 8 -------- registry/blocks/captions-bounce/registry-item.json | 7 ++----- registry/blocks/captions-cinematic/registry-item.json | 7 ++----- registry/blocks/captions-karaoke/registry-item.json | 7 ++----- registry/blocks/captions-minimal/registry-item.json | 7 ++----- registry/blocks/captions-slam/registry-item.json | 7 ++----- registry/blocks/vfx-iphone-device/registry-item.json | 11 ++--------- .../blocks/vfx-liquid-background/registry-item.json | 10 ++-------- registry/blocks/vfx-liquid-glass/registry-item.json | 7 ++----- registry/blocks/vfx-magnetic/registry-item.json | 7 ++----- registry/blocks/vfx-portal/registry-item.json | 7 ++----- registry/blocks/vfx-shatter/registry-item.json | 7 ++----- registry/blocks/vfx-text-cursor/registry-item.json | 10 ++-------- 14 files changed, 29 insertions(+), 83 deletions(-) diff --git a/packages/shader-transitions/src/capture.test.ts b/packages/shader-transitions/src/capture.test.ts index 9f5b8d909..d841dc1f4 100644 --- a/packages/shader-transitions/src/capture.test.ts +++ b/packages/shader-transitions/src/capture.test.ts @@ -12,11 +12,11 @@ describe("isHtmlInCanvasCaptureSupported", () => { expect(isHtmlInCanvasCaptureSupported()).toBe(false); }); - it("requires layoutsubtree, requestPaint, and drawElementImage", () => { + it("returns true when layoutSubtree and drawElementImage are available", () => { vi.stubGlobal("document", { createElement: () => ({ - layoutSubtree: false, - requestPaint: () => undefined, + setAttribute: () => undefined, + layoutSubtree: true, getContext: () => ({ drawElementImage: () => undefined, }), @@ -29,8 +29,8 @@ describe("isHtmlInCanvasCaptureSupported", () => { it("returns false when drawElementImage is missing", () => { vi.stubGlobal("document", { createElement: () => ({ - layoutSubtree: false, - requestPaint: () => undefined, + setAttribute: () => undefined, + layoutSubtree: true, getContext: () => ({}), }), }); diff --git a/packages/shader-transitions/src/capture.ts b/packages/shader-transitions/src/capture.ts index 7f97f9a45..08aa82caf 100644 --- a/packages/shader-transitions/src/capture.ts +++ b/packages/shader-transitions/src/capture.ts @@ -101,14 +101,6 @@ interface CanvasRenderingContext2DWithDrawElement extends CanvasRenderingContext drawElementImage: (element: Element, x: number, y: number, w: number, h: number) => void; } -function hasLayoutSubtreeCanvas(canvas: HTMLCanvasElement): canvas is CanvasWithLayoutSubtree { - const candidate = canvas as HTMLCanvasElement & { - layoutSubtree?: unknown; - requestPaint?: unknown; - }; - return "layoutSubtree" in candidate && typeof candidate.requestPaint === "function"; -} - export function isHtmlInCanvasCaptureSupported(): boolean { if (typeof document === "undefined") return false; const probe = document.createElement("canvas") as HTMLCanvasElement & { diff --git a/registry/blocks/captions-bounce/registry-item.json b/registry/blocks/captions-bounce/registry-item.json index 389cf2eaf..9b5f406b0 100644 --- a/registry/blocks/captions-bounce/registry-item.json +++ b/registry/blocks/captions-bounce/registry-item.json @@ -10,10 +10,7 @@ "height": 1080 }, "duration": 13, - "tags": [ - "captions", - "bounce" - ], + "tags": ["captions", "bounce"], "files": [ { "path": "captions-bounce.html", @@ -21,4 +18,4 @@ "type": "hyperframes:composition" } ] -} \ No newline at end of file +} diff --git a/registry/blocks/captions-cinematic/registry-item.json b/registry/blocks/captions-cinematic/registry-item.json index 0b8d234f4..9c8314015 100644 --- a/registry/blocks/captions-cinematic/registry-item.json +++ b/registry/blocks/captions-cinematic/registry-item.json @@ -10,10 +10,7 @@ "height": 1080 }, "duration": 13, - "tags": [ - "captions", - "cinematic" - ], + "tags": ["captions", "cinematic"], "files": [ { "path": "captions-cinematic.html", @@ -21,4 +18,4 @@ "type": "hyperframes:composition" } ] -} \ No newline at end of file +} diff --git a/registry/blocks/captions-karaoke/registry-item.json b/registry/blocks/captions-karaoke/registry-item.json index 621761bb2..f3a80f5fb 100644 --- a/registry/blocks/captions-karaoke/registry-item.json +++ b/registry/blocks/captions-karaoke/registry-item.json @@ -10,10 +10,7 @@ "height": 1080 }, "duration": 13, - "tags": [ - "captions", - "karaoke" - ], + "tags": ["captions", "karaoke"], "files": [ { "path": "captions-karaoke.html", @@ -21,4 +18,4 @@ "type": "hyperframes:composition" } ] -} \ No newline at end of file +} diff --git a/registry/blocks/captions-minimal/registry-item.json b/registry/blocks/captions-minimal/registry-item.json index f775dfc2f..35e4678ec 100644 --- a/registry/blocks/captions-minimal/registry-item.json +++ b/registry/blocks/captions-minimal/registry-item.json @@ -10,10 +10,7 @@ "height": 1080 }, "duration": 13, - "tags": [ - "captions", - "minimal" - ], + "tags": ["captions", "minimal"], "files": [ { "path": "captions-minimal.html", @@ -21,4 +18,4 @@ "type": "hyperframes:composition" } ] -} \ No newline at end of file +} diff --git a/registry/blocks/captions-slam/registry-item.json b/registry/blocks/captions-slam/registry-item.json index 3434409d3..a35d8581e 100644 --- a/registry/blocks/captions-slam/registry-item.json +++ b/registry/blocks/captions-slam/registry-item.json @@ -10,10 +10,7 @@ "height": 1080 }, "duration": 13, - "tags": [ - "captions", - "slam" - ], + "tags": ["captions", "slam"], "files": [ { "path": "captions-slam.html", @@ -21,4 +18,4 @@ "type": "hyperframes:composition" } ] -} \ No newline at end of file +} diff --git a/registry/blocks/vfx-iphone-device/registry-item.json b/registry/blocks/vfx-iphone-device/registry-item.json index 2fed8401f..83bd59dc6 100644 --- a/registry/blocks/vfx-iphone-device/registry-item.json +++ b/registry/blocks/vfx-iphone-device/registry-item.json @@ -10,14 +10,7 @@ "height": 1080 }, "duration": 15, - "tags": [ - "html-in-canvas", - "3d", - "device", - "iphone", - "macbook", - "gltf" - ], + "tags": ["html-in-canvas", "3d", "device", "iphone", "macbook", "gltf"], "files": [ { "path": "vfx-iphone-device.html", @@ -45,4 +38,4 @@ "type": "asset" } ] -} \ No newline at end of file +} diff --git a/registry/blocks/vfx-liquid-background/registry-item.json b/registry/blocks/vfx-liquid-background/registry-item.json index c26bb1da1..360094f8d 100644 --- a/registry/blocks/vfx-liquid-background/registry-item.json +++ b/registry/blocks/vfx-liquid-background/registry-item.json @@ -10,13 +10,7 @@ "height": 1080 }, "duration": 12, - "tags": [ - "html-in-canvas", - "liquid", - "webgl", - "displacement", - "background" - ], + "tags": ["html-in-canvas", "liquid", "webgl", "displacement", "background"], "files": [ { "path": "vfx-liquid-background.html", @@ -24,4 +18,4 @@ "type": "hyperframes:composition" } ] -} \ No newline at end of file +} diff --git a/registry/blocks/vfx-liquid-glass/registry-item.json b/registry/blocks/vfx-liquid-glass/registry-item.json index 319b7cedd..5e695ebf7 100644 --- a/registry/blocks/vfx-liquid-glass/registry-item.json +++ b/registry/blocks/vfx-liquid-glass/registry-item.json @@ -10,10 +10,7 @@ "height": 1080 }, "duration": 20, - "tags": [ - "html-in-canvas", - "webgl" - ], + "tags": ["html-in-canvas", "webgl"], "files": [ { "path": "vfx-liquid-glass.html", @@ -21,4 +18,4 @@ "type": "hyperframes:composition" } ] -} \ No newline at end of file +} diff --git a/registry/blocks/vfx-magnetic/registry-item.json b/registry/blocks/vfx-magnetic/registry-item.json index 5ba13e1cc..e0f649736 100644 --- a/registry/blocks/vfx-magnetic/registry-item.json +++ b/registry/blocks/vfx-magnetic/registry-item.json @@ -10,10 +10,7 @@ "height": 1080 }, "duration": 15, - "tags": [ - "html-in-canvas", - "webgl" - ], + "tags": ["html-in-canvas", "webgl"], "files": [ { "path": "vfx-magnetic.html", @@ -21,4 +18,4 @@ "type": "hyperframes:composition" } ] -} \ No newline at end of file +} diff --git a/registry/blocks/vfx-portal/registry-item.json b/registry/blocks/vfx-portal/registry-item.json index 5ef89019b..b440c3039 100644 --- a/registry/blocks/vfx-portal/registry-item.json +++ b/registry/blocks/vfx-portal/registry-item.json @@ -10,10 +10,7 @@ "height": 1080 }, "duration": 10, - "tags": [ - "html-in-canvas", - "webgl" - ], + "tags": ["html-in-canvas", "webgl"], "files": [ { "path": "vfx-portal.html", @@ -21,4 +18,4 @@ "type": "hyperframes:composition" } ] -} \ No newline at end of file +} diff --git a/registry/blocks/vfx-shatter/registry-item.json b/registry/blocks/vfx-shatter/registry-item.json index 67cb85695..f74f58501 100644 --- a/registry/blocks/vfx-shatter/registry-item.json +++ b/registry/blocks/vfx-shatter/registry-item.json @@ -10,10 +10,7 @@ "height": 1080 }, "duration": 12, - "tags": [ - "html-in-canvas", - "webgl" - ], + "tags": ["html-in-canvas", "webgl"], "files": [ { "path": "vfx-shatter.html", @@ -21,4 +18,4 @@ "type": "hyperframes:composition" } ] -} \ No newline at end of file +} diff --git a/registry/blocks/vfx-text-cursor/registry-item.json b/registry/blocks/vfx-text-cursor/registry-item.json index 62d94ac48..51c88ea83 100644 --- a/registry/blocks/vfx-text-cursor/registry-item.json +++ b/registry/blocks/vfx-text-cursor/registry-item.json @@ -10,13 +10,7 @@ "height": 1080 }, "duration": 8, - "tags": [ - "html-in-canvas", - "text", - "shader", - "cursor", - "chromatic" - ], + "tags": ["html-in-canvas", "text", "shader", "cursor", "chromatic"], "files": [ { "path": "vfx-text-cursor.html", @@ -24,4 +18,4 @@ "type": "hyperframes:composition" } ] -} \ No newline at end of file +}