mirror of
https://github.com/heygen-com/hyperframes.git
synced 2026-11-18 07:50:13 +00:00
feat(studio): an element's source-parsed animations are part of Studio's API (#8061)
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
import { describe, expect, it } from "vitest";
|
||||
import type { GsapAnimation } from "@hyperframes/core/gsap-parser";
|
||||
import { getAnimationsForElement } from "./index";
|
||||
|
||||
const tween = (targetSelector: string) => ({ targetSelector }) as GsapAnimation;
|
||||
|
||||
describe("an element's animations from Studio's public API", () => {
|
||||
it("are the parsed tweens that address it by id or selector, read where a sealed preview's host can", () => {
|
||||
const parsed = [tween("#title"), tween(".card, .hero"), tween("#other")];
|
||||
expect(getAnimationsForElement(parsed, { id: "title", selector: null })).toEqual([parsed[0]]);
|
||||
expect(getAnimationsForElement(parsed, { id: null, selector: ".hero" })).toEqual([parsed[1]]);
|
||||
});
|
||||
});
|
||||
@@ -117,6 +117,7 @@ export { ImageThumbnail } from "./player/components/ImageThumbnail";
|
||||
export type { ImageThumbnailProps } from "./player/components/ImageThumbnail";
|
||||
export { useRenderClipContent } from "./hooks/useRenderClipContent";
|
||||
export { useThumbnailStill } from "./hooks/useThumbnailStill";
|
||||
export { fetchParsedAnimations, getAnimationsForElement } from "./hooks/useGsapTweenCache";
|
||||
export type { ThumbnailStill, UseThumbnailStillOptions } from "./hooks/useThumbnailStill";
|
||||
export type { UseRenderClipContentOptions } from "./hooks/useRenderClipContent";
|
||||
export type { ThumbnailPriority } from "./player/lib/thumbnailScheduler";
|
||||
|
||||
Reference in New Issue
Block a user