@hyperframes/studio 0.7.0 → 0.7.1

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hyperframes/studio",
3
- "version": "0.7.0",
3
+ "version": "0.7.1",
4
4
  "description": "",
5
5
  "repository": {
6
6
  "type": "git",
@@ -45,9 +45,9 @@
45
45
  "dompurify": "^3.2.4",
46
46
  "marked": "^14.1.4",
47
47
  "mediabunny": "^1.45.3",
48
- "@hyperframes/core": "0.7.0",
49
- "@hyperframes/player": "0.7.0",
50
- "@hyperframes/sdk": "0.7.0"
48
+ "@hyperframes/core": "0.7.1",
49
+ "@hyperframes/player": "0.7.1",
50
+ "@hyperframes/sdk": "0.7.1"
51
51
  },
52
52
  "devDependencies": {
53
53
  "@types/react": "19",
@@ -62,7 +62,7 @@
62
62
  "vite": "^6.4.2",
63
63
  "vitest": "^3.2.4",
64
64
  "zustand": "^5.0.0",
65
- "@hyperframes/producer": "0.7.0"
65
+ "@hyperframes/producer": "0.7.1"
66
66
  },
67
67
  "peerDependencies": {
68
68
  "react": "19",
@@ -254,7 +254,7 @@ export const MotionPathOverlay = memo(function MotionPathOverlay({
254
254
  ref: MotionNodeRef,
255
255
  ) => {
256
256
  if (!interactive) return;
257
- if (e.button !== 0) return; // primary button only — right-click is the context menu
257
+ if (e.button !== 0) return;
258
258
  e.stopPropagation();
259
259
  (e.target as Element).setPointerCapture(e.pointerId);
260
260
  dragRef.current = {
@@ -536,7 +536,6 @@ export function applyStudioRotationDraft(element: HTMLElement, rotation: { angle
536
536
  }
537
537
 
538
538
  /* ── Seek reapply (position + motion) ────────────────────────────── */
539
-
540
539
  function queryStudioElements(doc: Document, attr: string): HTMLElement[] {
541
540
  const ctor = doc.defaultView?.HTMLElement;
542
541
  if (!ctor) return [];
@@ -584,7 +583,6 @@ function reapplyBoxSizes(doc: Document): void {
584
583
  }
585
584
  }
586
585
  }
587
-
588
586
  function reapplyRotations(doc: Document): void {
589
587
  for (const el of queryStudioElements(doc, STUDIO_ROTATION_ATTR)) {
590
588
  const angle = Number.parseFloat(el.style.getPropertyValue(STUDIO_ROTATION_PROP));
@@ -28,6 +28,7 @@ interface UseDomEditPreviewSyncParams {
28
28
  >;
29
29
  openSourceForSelection?: (sourceFile: string, target: PatchTarget) => void;
30
30
  getSidebarTab?: () => SidebarTab;
31
+ gsapCacheVersion?: number;
31
32
  }
32
33
 
33
34
  export function useDomEditPreviewSync({
@@ -43,6 +44,7 @@ export function useDomEditPreviewSync({
43
44
  applyStudioManualEditsToPreviewRef,
44
45
  openSourceForSelection,
45
46
  getSidebarTab,
47
+ gsapCacheVersion,
46
48
  }: UseDomEditPreviewSyncParams): void {
47
49
  // Sync selection from preview document on load / refresh
48
50
  // eslint-disable-next-line no-restricted-syntax
@@ -102,6 +104,7 @@ export function useDomEditPreviewSync({
102
104
  refreshPreviewDocumentVersion,
103
105
  syncPreviewHistoryHotkey,
104
106
  applyStudioManualEditsToPreviewRef,
107
+ gsapCacheVersion,
105
108
  ]);
106
109
 
107
110
  // Auto-reveal source when an element is selected while the Code tab is active.
@@ -242,6 +242,7 @@ export function useDomEditWiring({
242
242
  applyStudioManualEditsToPreviewRef,
243
243
  openSourceForSelection,
244
244
  getSidebarTab,
245
+ gsapCacheVersion,
245
246
  });
246
247
 
247
248
  return {
@@ -137,7 +137,8 @@ export function useGsapAnimationsForElement(
137
137
  const retryTimerRef = useRef<ReturnType<typeof setTimeout> | null>(null);
138
138
 
139
139
  useEffect(() => {
140
- const fetchKey = `${projectId}:${sourceFile}:${version}`;
140
+ const targetKey = target?.id ?? target?.selector ?? "";
141
+ const fetchKey = `${projectId}:${sourceFile}:${version}:${targetKey}`;
141
142
  if (fetchKey === lastFetchKeyRef.current) return;
142
143
  lastFetchKeyRef.current = fetchKey;
143
144
 
@@ -366,9 +367,7 @@ export function usePopulateKeyframeCacheForFile(
366
367
 
367
368
  const sf = sourceFile;
368
369
  fetchParsedAnimations(projectId, sf).then((parsed) => {
369
- if (!parsed) {
370
- return;
371
- }
370
+ if (!parsed) return;
372
371
  const { setKeyframeCache } = usePlayerStore.getState();
373
372
  clearKeyframeCacheForFile(sf);
374
373
  const { elements } = usePlayerStore.getState();
@@ -376,13 +375,9 @@ export function usePopulateKeyframeCacheForFile(
376
375
  for (const anim of parsed.animations) {
377
376
  const id = extractIdFromSelector(anim.targetSelector);
378
377
  if (!id) continue;
379
- if (anim.hasUnresolvedKeyframes) {
380
- continue;
381
- }
378
+ if (anim.hasUnresolvedKeyframes) continue;
382
379
  const kfData = anim.keyframes ?? synthesizeFlatTweenKeyframes(anim);
383
- if (!kfData) {
384
- continue;
385
- }
380
+ if (!kfData) continue;
386
381
  const tweenPos =
387
382
  anim.resolvedStart ?? (typeof anim.position === "number" ? anim.position : 0);
388
383
  const tweenDur = anim.duration ?? 1;