MCPcopy Create free account
hub / github.com/heygen-com/hyperframes / applyArcPathOp

Function applyArcPathOp

packages/sdk/src/engine/mutate.ts:197–224  ·  view source on GitHub ↗
(parsed: ParsedDocument, op: EditOp)

Source from the content-addressed store, hash-verified

195}
196
197function 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
226function applyGsapWithKeyframesOp(parsed: ParsedDocument, op: EditOp): MutationResult | undefined {
227 switch (op.type) {

Callers 1

applyGsapOpFunction · 0.85

Calls 6

getGsapScriptFunction · 0.85
handleArcPathScriptFunction · 0.85
setArcPathInScriptFunction · 0.50
updateArcSegmentInScriptFunction · 0.50
removeArcPathFromScriptFunction · 0.50
unrollDynamicAnimationsFunction · 0.50

Tested by

no test coverage detected