Skip to content

Write HTML. Render video. Built for agents.

fix: format JSON files, remove unused function, fix capture test mocks

Miguel Ángel0f3b207b234b
diff --git a/packages/shader-transitions/src/capture.test.ts b/packages/shader-transitions/src/capture.test.ts
index 9f5b8d9095..d841dc1f4a 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 7f97f9a45d..08aa82caff 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 389cf2eaf6..9b5f406b0a 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 0b8d234f49..9c8314015e 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 621761bb2f..f3a80f5fb1 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 f775dfc2fc..35e4678ec9 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 3434409d30..a35d8581e0 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 2fed8401f5..83bd59dc67 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 c26bb1da1c..360094f8dc 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 319b7cedda..5e695ebf7b 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 5ba13e1cc9..e0f649736f 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 5ef89019ba..b440c30395 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 67cb856951..f74f585015 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 62d94ac488..51c88ea83b 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
+}