( parsed: ParsedDocument, animationId: string, percentage: number, value: Record<string, unknown>, )
| 1283 | } |
| 1284 | |
| 1285 | function handleAddGsapKeyframe( |
| 1286 | parsed: ParsedDocument, |
| 1287 | animationId: string, |
| 1288 | percentage: number, |
| 1289 | value: Record<string, unknown>, |
| 1290 | ): MutationResult { |
| 1291 | const script = getGsapScript(parsed.document); |
| 1292 | if (!script) throw new Error("No GSAP script block found in the composition."); |
| 1293 | const props = value as Record<string, number | string>; |
| 1294 | const newScript = addKeyframeToScript( |
| 1295 | script, |
| 1296 | animationId, |
| 1297 | percentage, |
| 1298 | props, |
| 1299 | undefined, |
| 1300 | deriveKeyframeBackfillDefaults(props), |
| 1301 | ); |
| 1302 | if (newScript === script) return EMPTY; |
| 1303 | setGsapScript(parsed.document, newScript); |
| 1304 | return gsapScriptChange(script, newScript); |
| 1305 | } |
| 1306 | |
| 1307 | function handleRemoveGsapKeyframeByPercentage( |
| 1308 | parsed: ParsedDocument, |
no test coverage detected