mirror of
https://github.com/heygen-com/hyperframes.git
synced 2026-09-03 04:38:33 +00:00
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:
@@ -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();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user