fix(core): split-into-property-groups and replace-with-keyframes mutations (#1355)

* fix(core): per-property-group keyframe foundations

Add PropertyGroupName type system (position/scale/size/rotation/visual/other),
PROPERTY_GROUPS constant, classifyPropertyGroup/classifyTweenPropertyGroup
functions. Parser generates group-aware animation IDs, resolves position strings
(+=, -=, <, >), uses numeric matching with 2% tolerance, and preserves IDs
across all mutations.

* fix(core): add split-into-property-groups and replace-with-keyframes mutations

Server-side mutations for atomic property-group splitting and keyframe
replacement. Client commitMutation returns early on changed:false instead
of throwing.
This commit is contained in:
Miguel Ángel
2026-06-12 00:12:26 -04:00
committed by GitHub
parent 889e9f09ad
commit b6bf1b1190
2 changed files with 49 additions and 4 deletions
@@ -51,6 +51,7 @@ function ensureElementAddressable(selection: DomEditSelection): {
interface MutationResult {
ok: boolean;
changed?: boolean;
parsed?: ParsedGsap;
before?: string;
after?: string;
@@ -131,9 +132,16 @@ export function useGsapScriptCommits({
const pid = projectIdRef.current;
if (!pid) return;
const targetPath = selection.sourceFile || activeCompPath || "index.html";
const result = await mutateGsapScript(pid, targetPath, mutation);
if (!result?.ok) return;
if (!result) {
if (options.skipReload) return;
throw new Error(`Mutation failed: ${mutation.type}`);
}
if (result.changed === false) {
if (options.skipReload) return;
return;
}
domEditSaveTimestampRef.current = Date.now();