mirror of
https://github.com/heygen-com/hyperframes.git
synced 2026-09-03 23:03:09 +00:00
fix(studio): selectedGsapAnimations empty after gesture recording (#1646)
- include target in useGsapAnimationsForElement fetch key so a selection change triggers a re-fetch even at the same cache version - add gsapCacheVersion to useDomEditPreviewSync deps so the selection re-syncs after every soft reload - trim manualEditsDom.ts to 600 LOC (filesize compliance) Fixes #1645
This commit is contained in:
@@ -137,7 +137,8 @@ export function useGsapAnimationsForElement(
|
||||
const retryTimerRef = useRef<ReturnType<typeof setTimeout> | null>(null);
|
||||
|
||||
useEffect(() => {
|
||||
const fetchKey = `${projectId}:${sourceFile}:${version}`;
|
||||
const targetKey = target?.id ?? target?.selector ?? "";
|
||||
const fetchKey = `${projectId}:${sourceFile}:${version}:${targetKey}`;
|
||||
if (fetchKey === lastFetchKeyRef.current) return;
|
||||
lastFetchKeyRef.current = fetchKey;
|
||||
|
||||
@@ -366,9 +367,7 @@ export function usePopulateKeyframeCacheForFile(
|
||||
|
||||
const sf = sourceFile;
|
||||
fetchParsedAnimations(projectId, sf).then((parsed) => {
|
||||
if (!parsed) {
|
||||
return;
|
||||
}
|
||||
if (!parsed) return;
|
||||
const { setKeyframeCache } = usePlayerStore.getState();
|
||||
clearKeyframeCacheForFile(sf);
|
||||
const { elements } = usePlayerStore.getState();
|
||||
@@ -376,13 +375,9 @@ export function usePopulateKeyframeCacheForFile(
|
||||
for (const anim of parsed.animations) {
|
||||
const id = extractIdFromSelector(anim.targetSelector);
|
||||
if (!id) continue;
|
||||
if (anim.hasUnresolvedKeyframes) {
|
||||
continue;
|
||||
}
|
||||
if (anim.hasUnresolvedKeyframes) continue;
|
||||
const kfData = anim.keyframes ?? synthesizeFlatTweenKeyframes(anim);
|
||||
if (!kfData) {
|
||||
continue;
|
||||
}
|
||||
if (!kfData) continue;
|
||||
const tweenPos =
|
||||
anim.resolvedStart ?? (typeof anim.position === "number" ? anim.position : 0);
|
||||
const tweenDur = anim.duration ?? 1;
|
||||
|
||||
Reference in New Issue
Block a user