(parsed: ParsedDocument, op: EditOp)
| 195 | } |
| 196 | |
| 197 | function applyArcPathOp(parsed: ParsedDocument, op: EditOp): MutationResult | undefined { |
| 198 | const s = getGsapScript(parsed.document) ?? ""; |
| 199 | switch (op.type) { |
| 200 | case "setArcPath": { |
| 201 | const cfg = { |
| 202 | ...op.config, |
| 203 | segments: op.config.segments.map((seg) => ({ ...seg, curviness: seg.curviness ?? 1 })), |
| 204 | }; |
| 205 | return handleArcPathScript(parsed, s, setArcPathInScript(s, op.animationId, cfg)); |
| 206 | } |
| 207 | case "updateArcSegment": |
| 208 | return handleArcPathScript( |
| 209 | parsed, |
| 210 | s, |
| 211 | updateArcSegmentInScript(s, op.animationId, op.segmentIndex, op.update), |
| 212 | ); |
| 213 | case "removeArcPath": |
| 214 | return handleArcPathScript(parsed, s, removeArcPathFromScript(s, op.animationId)); |
| 215 | case "unrollDynamicAnimations": |
| 216 | return handleArcPathScript( |
| 217 | parsed, |
| 218 | s, |
| 219 | unrollDynamicAnimations(s, op.animationId, op.elements), |
| 220 | ); |
| 221 | default: |
| 222 | return undefined; |
| 223 | } |
| 224 | } |
| 225 | |
| 226 | function applyGsapWithKeyframesOp(parsed: ParsedDocument, op: EditOp): MutationResult | undefined { |
| 227 | switch (op.type) { |
no test coverage detected