import type { GsapPercentageKeyframe } from "@hyperframes/core/gsap-parser"; import { EASE_LABELS } from "./gsapAnimationConstants"; import { EaseCurveSection } from "./EaseCurveSection"; // The full GSAP easing vocabulary offered by the "Set all…" bulk control — // every standard family in in/out/inOut, so authors aren't limited to a curated // few. All are valid GSAP runtime eases; the non-cubic families (sine/circ/ // elastic/bounce) approximate in the per-segment curve preview. const APPLY_ALL_EASES = [ "none", "power1.in", "power1.out", "power1.inOut", "power2.in", "power2.out", "power2.inOut", "power3.in", "power3.out", "power3.inOut", "power4.in", "power4.out", "power4.inOut", "sine.in", "sine.out", "sine.inOut", "expo.in", "expo.out", "expo.inOut", "circ.in", "circ.out", "circ.inOut", "back.in", "back.out", "back.inOut", "elastic.in", "elastic.out", "elastic.inOut", "bounce.in", "bounce.out", "bounce.inOut", ] as const; export function KeyframeEaseList({ keyframes, globalEase, expandedPct, onToggle, onEaseCommit, onApplyAll, }: { keyframes: GsapPercentageKeyframe[]; globalEase: string; expandedPct: number | null; onToggle: (pct: number | null) => void; onEaseCommit: (pct: number, ease: string) => void; /** Apply one ease to every segment at once (clears per-segment overrides). */ onApplyAll?: (ease: string) => void; }) { return (

Per-keyframe easing

{onApplyAll && ( )}
{keyframes.map((kf, i) => { if (i === 0) return null; const segEase = kf.ease ?? globalEase; const isExpanded = expandedPct === kf.percentage; const label = `${keyframes[i - 1].percentage}% → ${kf.percentage}%`; const easeLabel = segEase.startsWith("custom(") ? "Custom" : (EASE_LABELS[segEase] ?? segEase); return (
{isExpanded && (
onEaseCommit(kf.percentage, ease)} />
)}
); })}
); }