功能增加

This commit is contained in:
andy committed 2026-09-11 15:33:18 +08:00
1 parent b340fc7ad7
commit f1993eb388
69 files changed
+2243 -162

No files matched your search

@@ -36,7 +36,25 @@ describe("Seedream workspace layout contract", () => {
expect(viewport).toMatch(/--seedream-canvas-height\s*:\s*clamp\(280px,\s*38vh,\s*460px\)/);
expect(viewport).toMatch(/height\s*:\s*var\(--seedream-canvas-height\)/);
expect(viewport).toMatch(/flex\s*:\s*0\s+0\s+auto/);
expect(image).toMatch(/max-height\s*:\s*calc\(var\(--seedream-canvas-height\)\s*-\s*22px\)/);
expect(image).toMatch(/width\s*:\s*100%/);
expect(image).toMatch(/height\s*:\s*100%/);
expect(workspaceSource).toContain("fitCanvasImage");
expect(workspaceSource).toContain("width: fittedImage.width, height: fittedImage.height");
});
it("uses the same editor in native fullscreen and keeps panning inside a clipped viewport", () => {
expect(workspaceSource).toContain("workspaceRef.current.requestFullscreen()");
expect(workspaceSource).not.toContain("createPortal");
expect(cssRule(".seedream-workspace:fullscreen")).toMatch(/overflow\s*:\s*hidden/);
expect(cssRule(".seedream-workspace:fullscreen .seedream-canvas-viewport")).toMatch(/flex\s*:\s*1\s+1\s+auto/);
expect(workspaceSource).toContain('addEventListener("wheel", handleWheel, { passive: false })');
expect(workspaceSource).toContain('removeEventListener("wheel", handleWheel)');
});
it("measures cached images that finish loading before hydration", () => {
expect(workspaceSource).toContain("image?.complete && image.naturalWidth > 0");
expect(workspaceSource).toContain("ref={imageRef}");
expect(workspaceSource).toContain("key: sourceKey, width: image.naturalWidth, height: image.naturalHeight");
});
it("does not render the redundant source picker for single-image layer decomposition", () => {