mirror of
https://github.com/heygen-com/hyperframes.git
synced 2026-09-05 17:30:50 +00:00
* fix(studio): preserve composition playback continuity * feat(studio): drag compositions into the timeline * fix(studio): collapse expanded composition move aliases * fix(studio): make timeline cuts atomic * fix(studio): group inspector gesture history * test(studio): cover masked text selection * fix(studio): harden composition timeline reliability * fix(studio): satisfy CI source gates * fix(studio): harden composition mutation requests
16 lines
613 B
TypeScript
16 lines
613 B
TypeScript
import { useCallback } from "react";
|
|
import { usePlayerStore } from "../player";
|
|
|
|
type AddAtPlacement = (path: string, placement: { start: number; track: number }) => unknown;
|
|
|
|
export function useTimelineAddAtPlayhead(addAsset: AddAtPlacement, addComposition: AddAtPlacement) {
|
|
const placement = () => ({ start: usePlayerStore.getState().currentTime, track: 0 });
|
|
return {
|
|
addAssetAtPlayhead: useCallback((path: string) => addAsset(path, placement()), [addAsset]),
|
|
addCompositionAtPlayhead: useCallback(
|
|
(path: string) => addComposition(path, placement()),
|
|
[addComposition],
|
|
),
|
|
};
|
|
}
|