mirror of
https://github.com/heygen-com/hyperframes.git
synced 2026-09-10 22:20:14 +00:00
feat(studio): route GSAP keyframe add through SDK (§3.5 PR2) (#1470)
Co-authored-by: Miguel Ángel <miguel07alm@protonmail.com>
This commit is contained in:
co-authored by
Miguel Ángel
parent
592f7c775d
commit
7ca4490328
@@ -189,6 +189,28 @@ export async function sdkGsapTweenPersist(
|
||||
}
|
||||
}
|
||||
|
||||
export async function sdkGsapKeyframePersist(
|
||||
targetPath: string,
|
||||
animationId: string,
|
||||
position: number,
|
||||
value: Record<string, unknown>,
|
||||
sdkSession: Composition | null | undefined,
|
||||
deps: CutoverDeps,
|
||||
options?: CutoverOptions,
|
||||
): Promise<boolean> {
|
||||
if (!sdkSession) return false;
|
||||
try {
|
||||
const before = sdkSession.serialize();
|
||||
sdkSession.dispatch({ type: "addGsapKeyframe", animationId, position, value });
|
||||
await persistSdkSerialize(sdkSession, targetPath, before, deps, options);
|
||||
trackStudioEvent("sdk_cutover_success", { opCount: 1 });
|
||||
return true;
|
||||
} catch (err) {
|
||||
trackStudioEvent("sdk_cutover_fallback", { error: String(err) });
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
export async function sdkDeletePersist(
|
||||
hfId: string,
|
||||
originalContent: string,
|
||||
|
||||
Reference in New Issue
Block a user