@hyperframes/studio 0.8.116 → 0.8.117

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (38) hide show
  1. package/dist/assets/{hyperframes-player-mGYvPVpw.js → hyperframes-player-5fcgSstJ.js} +1 -1
  2. package/dist/assets/{index-DYNaXPVf.js → index-C5qKdpgl.js} +178 -176
  3. package/dist/assets/{index-BWHt0-ir.js → index-XJSawwYe.js} +1 -1
  4. package/dist/assets/{index-Dr3hNpvS.js → index-tg2LXUeu.js} +1 -1
  5. package/dist/index.d.ts +28 -19
  6. package/dist/index.html +1 -1
  7. package/dist/index.js +77 -64
  8. package/dist/index.js.map +1 -1
  9. package/package.json +8 -8
  10. package/src/components/editor/DomEditOverlay.tsx +1 -0
  11. package/src/components/editor/domEditOverlayGestures.ts +1 -0
  12. package/src/components/editor/domEditOverlayStartGesture.ts +2 -2
  13. package/src/components/editor/manualOffsetDrag.ts +3 -3
  14. package/src/components/editor/plainTranslate.ts +5 -3
  15. package/src/components/editor/propertyPanelHelpers.ts +2 -2
  16. package/src/components/editor/propertyPanelTransformCommit.ts +2 -2
  17. package/src/components/editor/rotationDraft.ts +2 -1
  18. package/src/components/editor/useDomEditOverlayGestures.ts +2 -2
  19. package/src/hooks/gsapRuntimeKeyframes.ts +16 -3
  20. package/src/hooks/gsapScriptCommitTypes.ts +1 -1
  21. package/src/hooks/plainRotation.ts +5 -1
  22. package/src/hooks/useDomEditPersist.test.tsx +335 -0
  23. package/src/hooks/useDomGeometryCommit.test.tsx +5 -1
  24. package/src/hooks/useDomGeometryCommit.ts +6 -9
  25. package/src/hooks/useFreezeFrame.test.ts +39 -3
  26. package/src/hooks/useFreezeFrame.ts +4 -1
  27. package/src/hooks/useGsapAwareEditing.test.tsx +25 -0
  28. package/src/hooks/useGsapAwareEditing.ts +12 -8
  29. package/src/hooks/useGsapAwareGroupMove.ts +2 -2
  30. package/src/hooks/useGsapScriptCommits.test.tsx +69 -1
  31. package/src/hooks/useGsapScriptCommits.ts +9 -7
  32. package/src/hooks/usePersistentEditHistory.test.ts +25 -2
  33. package/src/hooks/usePersistentEditHistory.ts +3 -9
  34. package/src/utils/gsapSoftReload.test.ts +39 -0
  35. package/src/utils/gsapSoftReload.ts +7 -11
  36. package/src/utils/gsapUndoRestore.browser.test.ts +91 -44
  37. package/src/utils/softReloadTargets.ts +4 -3
  38. package/src/utils/studioFileHistory.ts +1 -0
@@ -1,8 +1,9 @@
1
1
  // Which elements a GSAP soft reload resets, what their tweens wrote, and which file writes each.
2
2
  import { parseSavedSource } from "./authoredSource";
3
+ import { elementTargets } from "./elementGsap";
3
4
 
4
5
  type TweenLike = {
5
- targets?: () => Element[];
6
+ targets?: () => unknown[];
6
7
  vars?: Record<string, unknown>;
7
8
  getChildren?: (deep: boolean) => TweenLike[];
8
9
  };
@@ -36,7 +37,7 @@ export function authoringFile(el: Element): string | null {
36
37
 
37
38
  function addTweenTargets(tween: TweenLike, targets: Map<Element, Set<string>>): void {
38
39
  const props = tweenedProps(tween.vars);
39
- for (const el of tween.targets?.() ?? []) {
40
+ for (const el of elementTargets(tween)) {
40
41
  const seen = targets.get(el) ?? new Set<string>();
41
42
  for (const prop of props) seen.add(prop);
42
43
  targets.set(el, seen);
@@ -68,7 +69,7 @@ function tweenTargetsIn(timelines: Set<unknown>): Set<Element> {
68
69
  for (const tl of timelines) {
69
70
  try {
70
71
  for (const tween of (tl as TweenLike | undefined)?.getChildren?.(true) ?? []) {
71
- for (const el of tween.targets?.() ?? []) els.add(el);
72
+ for (const el of elementTargets(tween)) els.add(el);
72
73
  }
73
74
  } catch {}
74
75
  }
@@ -9,6 +9,7 @@ export interface RecordEditInput {
9
9
  coalesceKey?: string;
10
10
  coalesceMs?: number;
11
11
  files: Record<string, { before: string; after: string }>;
12
+ created?: string[];
12
13
  }
13
14
 
14
15
  export interface DomEditCommitBaseParams {