@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.
- package/dist/assets/{hyperframes-player-mGYvPVpw.js → hyperframes-player-5fcgSstJ.js} +1 -1
- package/dist/assets/{index-DYNaXPVf.js → index-C5qKdpgl.js} +178 -176
- package/dist/assets/{index-BWHt0-ir.js → index-XJSawwYe.js} +1 -1
- package/dist/assets/{index-Dr3hNpvS.js → index-tg2LXUeu.js} +1 -1
- package/dist/index.d.ts +28 -19
- package/dist/index.html +1 -1
- package/dist/index.js +77 -64
- package/dist/index.js.map +1 -1
- package/package.json +8 -8
- package/src/components/editor/DomEditOverlay.tsx +1 -0
- package/src/components/editor/domEditOverlayGestures.ts +1 -0
- package/src/components/editor/domEditOverlayStartGesture.ts +2 -2
- package/src/components/editor/manualOffsetDrag.ts +3 -3
- package/src/components/editor/plainTranslate.ts +5 -3
- package/src/components/editor/propertyPanelHelpers.ts +2 -2
- package/src/components/editor/propertyPanelTransformCommit.ts +2 -2
- package/src/components/editor/rotationDraft.ts +2 -1
- package/src/components/editor/useDomEditOverlayGestures.ts +2 -2
- package/src/hooks/gsapRuntimeKeyframes.ts +16 -3
- package/src/hooks/gsapScriptCommitTypes.ts +1 -1
- package/src/hooks/plainRotation.ts +5 -1
- package/src/hooks/useDomEditPersist.test.tsx +335 -0
- package/src/hooks/useDomGeometryCommit.test.tsx +5 -1
- package/src/hooks/useDomGeometryCommit.ts +6 -9
- package/src/hooks/useFreezeFrame.test.ts +39 -3
- package/src/hooks/useFreezeFrame.ts +4 -1
- package/src/hooks/useGsapAwareEditing.test.tsx +25 -0
- package/src/hooks/useGsapAwareEditing.ts +12 -8
- package/src/hooks/useGsapAwareGroupMove.ts +2 -2
- package/src/hooks/useGsapScriptCommits.test.tsx +69 -1
- package/src/hooks/useGsapScriptCommits.ts +9 -7
- package/src/hooks/usePersistentEditHistory.test.ts +25 -2
- package/src/hooks/usePersistentEditHistory.ts +3 -9
- package/src/utils/gsapSoftReload.test.ts +39 -0
- package/src/utils/gsapSoftReload.ts +7 -11
- package/src/utils/gsapUndoRestore.browser.test.ts +91 -44
- package/src/utils/softReloadTargets.ts +4 -3
- 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?: () =>
|
|
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
|
|
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
|
|
72
|
+
for (const el of elementTargets(tween)) els.add(el);
|
|
72
73
|
}
|
|
73
74
|
} catch {}
|
|
74
75
|
}
|