mirror of
https://github.com/heygen-com/hyperframes.git
synced 2026-09-10 22:20:14 +00:00
Revert "feat: Persist Studio manual edits via manifest (#593)"
This reverts commit d0abe90a82.
This commit is contained in:
@@ -13,30 +13,6 @@ import {
|
||||
shouldIgnorePlaybackShortcutTarget,
|
||||
} from "./useTimelinePlayer";
|
||||
|
||||
function createDocument(markup: string): Document {
|
||||
const window = new Window();
|
||||
Object.assign(window, { SyntaxError });
|
||||
window.document.body.innerHTML = markup;
|
||||
return window.document;
|
||||
}
|
||||
|
||||
function createClip(overrides: Partial<ClipManifestClip>): ClipManifestClip {
|
||||
return {
|
||||
id: null,
|
||||
label: "",
|
||||
start: 0,
|
||||
duration: 4,
|
||||
track: 0,
|
||||
kind: "element",
|
||||
tagName: "div",
|
||||
compositionId: null,
|
||||
parentCompositionId: null,
|
||||
compositionSrc: null,
|
||||
assetUrl: null,
|
||||
...overrides,
|
||||
};
|
||||
}
|
||||
|
||||
function mockTargetMatching(selectorNeedle: string): EventTarget {
|
||||
return {
|
||||
closest: (selector: string) => (selector.includes(selectorNeedle) ? ({} as Element) : null),
|
||||
@@ -57,6 +33,29 @@ function mockKeyboardEvent(
|
||||
};
|
||||
}
|
||||
|
||||
function createDocument(markup: string): Document {
|
||||
const window = new Window();
|
||||
window.document.body.innerHTML = markup;
|
||||
return window.document;
|
||||
}
|
||||
|
||||
function createClip(overrides: Partial<ClipManifestClip>): ClipManifestClip {
|
||||
return {
|
||||
id: null,
|
||||
label: "Element",
|
||||
start: 0,
|
||||
duration: 4,
|
||||
track: 0,
|
||||
kind: "element",
|
||||
tagName: "div",
|
||||
compositionId: null,
|
||||
parentCompositionId: null,
|
||||
compositionSrc: null,
|
||||
assetUrl: null,
|
||||
...overrides,
|
||||
};
|
||||
}
|
||||
|
||||
describe("buildStandaloneRootTimelineElement", () => {
|
||||
it("includes selector and source metadata for standalone composition fallback clips", () => {
|
||||
expect(
|
||||
|
||||
@@ -22,7 +22,7 @@ interface TimelineLike {
|
||||
isActive: () => boolean;
|
||||
}
|
||||
|
||||
export interface ClipManifestClip {
|
||||
interface ClipManifestClip {
|
||||
id: string | null;
|
||||
label: string;
|
||||
start: number;
|
||||
@@ -335,6 +335,7 @@ function buildTimelineElementKey(params: {
|
||||
if (params.selector) return `${scope}:${params.selector}:${params.selectorIndex ?? 0}`;
|
||||
return `${scope}:${params.id}:${params.fallbackIndex}`;
|
||||
}
|
||||
|
||||
function buildTimelineElementIdentity(params: {
|
||||
preferredId?: string | null;
|
||||
label: string;
|
||||
@@ -556,6 +557,7 @@ export function buildStandaloneRootTimelineElement(params: {
|
||||
sourceFile: compositionSrc,
|
||||
};
|
||||
}
|
||||
|
||||
function normalizePreviewViewport(doc: Document, win: Window): void {
|
||||
if (doc.documentElement) {
|
||||
doc.documentElement.style.overflow = "hidden";
|
||||
@@ -1349,9 +1351,6 @@ export function useTimelinePlayer() {
|
||||
setIsPlaying(false);
|
||||
}, [getAdapter, stopRAFLoop, setIsPlaying, stopReverseLoop]);
|
||||
|
||||
const togglePlayRef = useRef(togglePlay);
|
||||
togglePlayRef.current = togglePlay;
|
||||
|
||||
const refreshPlayer = useCallback(() => {
|
||||
const iframe = iframeRef.current;
|
||||
if (!iframe) return;
|
||||
@@ -1460,6 +1459,8 @@ export function useTimelinePlayer() {
|
||||
stopRAFLoop();
|
||||
stopReverseLoop();
|
||||
if (probeIntervalRef.current) clearInterval(probeIntervalRef.current);
|
||||
// Don't reset() on cleanup — preserve timeline elements across iframe refreshes
|
||||
// to prevent blink. New data will replace old when the iframe reloads.
|
||||
};
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user