@hyperframes/studio 0.7.76 → 0.7.78
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-DsRdxz7A.js → hyperframes-player-uiAAPKvw.js} +1 -1
- package/dist/assets/index-BSZrK0bx.js +428 -0
- package/dist/assets/{index-Du1RoLiB.js → index-CDSTMtUs.js} +1 -1
- package/dist/assets/index-DpkO2Hvw.css +1 -0
- package/dist/assets/{index-BLICKger.js → index-r1tKKlU7.js} +1 -1
- package/dist/index.d.ts +64 -17
- package/dist/index.html +2 -2
- package/dist/index.js +25030 -23214
- package/dist/index.js.map +1 -1
- package/package.json +7 -7
- package/src/App.tsx +16 -17
- package/src/components/EditorShell.tsx +3 -0
- package/src/components/TimelineToolbar.test.tsx +48 -3
- package/src/components/TimelineToolbar.tsx +89 -36
- package/src/components/editor/AnimationCard.test.tsx +18 -75
- package/src/components/editor/AnimationCard.tsx +26 -2
- package/src/components/editor/GsapAddAnimationControl.tsx +68 -0
- package/src/components/editor/GsapAnimationSection.tsx +18 -157
- package/src/components/editor/KeyframeEaseList.tsx +5 -1
- package/src/components/editor/KeyframeNavigation.tsx +46 -14
- package/src/components/editor/KeyframeNavigationDiamond.test.tsx +59 -0
- package/src/components/editor/MotionPathOverlay.tsx +32 -10
- package/src/components/editor/PropertyPanel.tsx +15 -5
- package/src/components/editor/PropertyPanelFlat.tsx +48 -23
- package/src/components/editor/gsapAnimationCallbacks.test.ts +122 -0
- package/src/components/editor/gsapAnimationCallbacks.ts +108 -4
- package/src/components/editor/keyframeRetime.test.ts +25 -22
- package/src/components/editor/keyframeRetime.ts +1 -2
- package/src/components/editor/propertyPanelFlatLayoutSection.tsx +2 -2
- package/src/components/editor/propertyPanelFlatMotionSection.tsx +25 -139
- package/src/components/editor/propertyPanelFlatTextSection.test.tsx +32 -16
- package/src/components/editor/propertyPanelFlatTextSection.tsx +21 -4
- package/src/components/nle/PreviewOverlays.tsx +3 -1
- package/src/components/nle/useTimelineEditCallbacks.test.ts +30 -0
- package/src/components/nle/useTimelineEditCallbacks.test.tsx +693 -0
- package/src/components/nle/useTimelineEditCallbacks.ts +197 -57
- package/src/components/sidebar/CompositionsTab.drag.test.tsx +41 -0
- package/src/components/sidebar/CompositionsTab.tsx +66 -32
- package/src/contexts/TimelineEditContext.tsx +1 -1
- package/src/hooks/deleteSelectedKeyframes.ts +24 -8
- package/src/hooks/gsapDragCommit.ts +2 -2
- package/src/hooks/gsapDragPositionCommit.ts +84 -5
- package/src/hooks/gsapKeyframeCacheHelpers.test.ts +176 -1
- package/src/hooks/gsapKeyframeCacheHelpers.ts +93 -52
- package/src/hooks/gsapRuntimeBridge.test.ts +100 -0
- package/src/hooks/gsapScriptCommitHelpers.ts +3 -2
- package/src/hooks/gsapScriptCommitTypes.ts +2 -0
- package/src/hooks/gsapShared.test.ts +109 -1
- package/src/hooks/gsapShared.ts +142 -17
- package/src/hooks/gsapTweenSynth.test.ts +30 -1
- package/src/hooks/gsapTweenSynth.ts +61 -14
- package/src/hooks/keyframeCacheAstLoad.ts +181 -0
- package/src/hooks/timelineEditingHelpers.test.ts +80 -0
- package/src/hooks/timelineMoveAdapter.ts +9 -2
- package/src/hooks/useDomEditWiring.ts +2 -2
- package/src/hooks/useDomSelection.ts +4 -0
- package/src/hooks/useEnableKeyframes.test.ts +122 -0
- package/src/hooks/useEnableKeyframes.ts +116 -56
- package/src/hooks/useGestureCommit.ts +2 -2
- package/src/hooks/useGsapAnimationFetchFallback.ts +1 -1
- package/src/hooks/useGsapKeyframeOps.test.tsx +92 -13
- package/src/hooks/useGsapKeyframeOps.ts +30 -13
- package/src/hooks/useGsapScriptCommits.test.tsx +21 -0
- package/src/hooks/useGsapScriptCommits.ts +2 -0
- package/src/hooks/useGsapSelectionHandlers.test.tsx +69 -3
- package/src/hooks/useGsapSelectionHandlers.ts +90 -65
- package/src/hooks/useGsapTweenCache.test.ts +16 -0
- package/src/hooks/useGsapTweenCache.ts +64 -178
- package/src/hooks/usePopulateKeyframeCacheForFile.test.tsx +68 -0
- package/src/hooks/useStudioContextValue.test.ts +93 -0
- package/src/hooks/useStudioContextValue.ts +17 -3
- package/src/hooks/useStudioTestHooks.ts +63 -0
- package/src/hooks/useTimelineEditing.test.tsx +187 -22
- package/src/hooks/useTimelineEditing.ts +43 -32
- package/src/hooks/useTimelineEditingTypes.ts +2 -0
- package/src/hooks/useTimelineGroupEditing.ts +106 -82
- package/src/player/components/KeyframeDiamondContextMenu.test.tsx +69 -0
- package/src/player/components/KeyframeDiamondContextMenu.tsx +19 -8
- package/src/player/components/LayerDisclosureRow.tsx +76 -0
- package/src/player/components/Player.test.ts +143 -12
- package/src/player/components/Player.tsx +84 -43
- package/src/player/components/Timeline.test.ts +420 -90
- package/src/player/components/Timeline.tsx +80 -78
- package/src/player/components/TimelineCanvas.tsx +33 -21
- package/src/player/components/TimelineClip.tsx +3 -1
- package/src/player/components/TimelineClipDiamonds.test.tsx +540 -16
- package/src/player/components/TimelineClipDiamonds.tsx +320 -117
- package/src/player/components/TimelineDiamondConnectors.tsx +145 -0
- package/src/player/components/TimelineLanes.tsx +153 -79
- package/src/player/components/TimelineOverlays.tsx +4 -18
- package/src/player/components/TimelinePropertyLanes.test.tsx +450 -0
- package/src/player/components/TimelinePropertyLanes.tsx +191 -0
- package/src/player/components/TimelineRazorInteraction.tsx +60 -0
- package/src/player/components/TimelineRuler.tsx +11 -21
- package/src/player/components/TimelineTrackHeader.test.tsx +346 -0
- package/src/player/components/TimelineTrackHeader.tsx +363 -0
- package/src/player/components/TrackClipCount.tsx +17 -0
- package/src/player/components/timelineCallbacks.ts +21 -6
- package/src/player/components/timelineClipDragPreview.test.ts +50 -3
- package/src/player/components/timelineClipDragPreview.ts +33 -15
- package/src/player/components/timelineCollision.ts +4 -13
- package/src/player/components/timelineDiamondTypes.ts +120 -0
- package/src/player/components/timelineDragDrop.ts +8 -3
- package/src/player/components/timelineEditing.test.ts +19 -27
- package/src/player/components/timelineEditing.ts +7 -8
- package/src/player/components/timelineKeyframeIdentity.test.ts +49 -0
- package/src/player/components/timelineKeyframeIdentity.ts +66 -0
- package/src/player/components/timelineLayout.test.ts +162 -9
- package/src/player/components/timelineLayout.ts +198 -38
- package/src/player/components/timelineMarquee.test.ts +76 -21
- package/src/player/components/timelineMarquee.ts +17 -14
- package/src/player/components/trackHeaderLaneState.ts +121 -0
- package/src/player/components/trackHeaderLaneValues.ts +139 -0
- package/src/player/components/useAutoExpandKeyframedClips.test.tsx +75 -0
- package/src/player/components/useAutoExpandKeyframedClips.ts +50 -0
- package/src/player/components/useTimelineClipDrag.ts +4 -1
- package/src/player/components/useTimelineGeometry.ts +4 -1
- package/src/player/components/useTimelineKeyframeHandlers.test.tsx +108 -0
- package/src/player/components/useTimelineKeyframeHandlers.ts +50 -15
- package/src/player/components/useTimelinePlayhead.ts +21 -12
- package/src/player/components/useTimelineRangeSelection.ts +35 -14
- package/src/player/components/useTimelineTrackLayout.test.ts +53 -0
- package/src/player/components/useTimelineTrackLayout.ts +162 -0
- package/src/player/hooks/useExpandedTimelineElements.test.ts +43 -0
- package/src/player/hooks/useExpandedTimelineElements.ts +21 -12
- package/src/player/lib/timelineElementHelpers.ts +26 -11
- package/src/player/store/keyframeSlice.ts +122 -0
- package/src/player/store/playerStore.test.ts +25 -0
- package/src/player/store/playerStore.ts +7 -43
- package/src/telemetry/events.test.ts +9 -3
- package/src/telemetry/events.ts +16 -7
- package/src/utils/globalTimeCompiler.test.ts +10 -0
- package/src/utils/globalTimeCompiler.ts +3 -3
- package/dist/assets/index-B37rWXo4.css +0 -1
- package/dist/assets/index-BdOfFsR8.js +0 -428
- package/src/player/components/TimelineDragGhost.tsx +0 -59
- package/src/utils/keyframeSelection.test.ts +0 -45
- package/src/utils/keyframeSelection.ts +0 -29
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
import type { ReactNode } from "react";
|
|
2
|
-
import { TimelineClip } from "./TimelineClip";
|
|
3
|
-
import { getTimelineEditCapabilities } from "./timelineEditing";
|
|
4
|
-
import { CLIP_Y, TRACK_H } from "./timelineLayout";
|
|
5
|
-
import type { TimelineTheme } from "./timelineTheme";
|
|
6
|
-
import type { TimelineElement } from "../store/playerStore";
|
|
7
|
-
|
|
8
|
-
interface TimelineDragGhostProps {
|
|
9
|
-
element: TimelineElement;
|
|
10
|
-
position: { left: number; top: number };
|
|
11
|
-
pps: number;
|
|
12
|
-
selectedElementId: string | null;
|
|
13
|
-
hasCustomContent: boolean;
|
|
14
|
-
theme: TimelineTheme;
|
|
15
|
-
children: ReactNode;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
export function TimelineDragGhost({
|
|
19
|
-
element,
|
|
20
|
-
position,
|
|
21
|
-
pps,
|
|
22
|
-
selectedElementId,
|
|
23
|
-
hasCustomContent,
|
|
24
|
-
theme,
|
|
25
|
-
children,
|
|
26
|
-
}: TimelineDragGhostProps) {
|
|
27
|
-
return (
|
|
28
|
-
<div
|
|
29
|
-
className="absolute pointer-events-none"
|
|
30
|
-
style={{
|
|
31
|
-
top: position.top,
|
|
32
|
-
left: position.left,
|
|
33
|
-
width: Math.max(element.duration * pps, 4),
|
|
34
|
-
height: TRACK_H - CLIP_Y * 2,
|
|
35
|
-
zIndex: 40,
|
|
36
|
-
}}
|
|
37
|
-
>
|
|
38
|
-
<TimelineClip
|
|
39
|
-
el={{ ...element, start: 0 }}
|
|
40
|
-
pps={pps}
|
|
41
|
-
clipY={0}
|
|
42
|
-
isSelected={selectedElementId === (element.key ?? element.id)}
|
|
43
|
-
isHovered={false}
|
|
44
|
-
isDragging={true}
|
|
45
|
-
hasCustomContent={hasCustomContent}
|
|
46
|
-
capabilities={getTimelineEditCapabilities(element)}
|
|
47
|
-
theme={theme}
|
|
48
|
-
isComposition={!!element.compositionSrc}
|
|
49
|
-
onHoverStart={() => {}}
|
|
50
|
-
onHoverEnd={() => {}}
|
|
51
|
-
onResizeStart={() => {}}
|
|
52
|
-
onClick={() => {}}
|
|
53
|
-
onDoubleClick={() => {}}
|
|
54
|
-
>
|
|
55
|
-
{children}
|
|
56
|
-
</TimelineClip>
|
|
57
|
-
</div>
|
|
58
|
-
);
|
|
59
|
-
}
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import { describe, it, expect } from "vitest";
|
|
2
|
-
import { selectedKeyframePercentagesForElement } from "./keyframeSelection";
|
|
3
|
-
|
|
4
|
-
describe("selectedKeyframePercentagesForElement", () => {
|
|
5
|
-
it("returns the percentages of keyframes on the active element", () => {
|
|
6
|
-
const selected = new Set(["comp#a:25", "comp#a:75"]);
|
|
7
|
-
expect(selectedKeyframePercentagesForElement(selected, "comp#a")).toEqual([25, 75]);
|
|
8
|
-
});
|
|
9
|
-
|
|
10
|
-
it("drops keyframes that belong to other elements", () => {
|
|
11
|
-
// The bug: a stale shift-selection on `comp#b` would otherwise have its
|
|
12
|
-
// percentages applied to the now-active `comp#a`, deleting the wrong keyframes.
|
|
13
|
-
const selected = new Set(["comp#a:25", "comp#b:50", "comp#b:80"]);
|
|
14
|
-
expect(selectedKeyframePercentagesForElement(selected, "comp#a")).toEqual([25]);
|
|
15
|
-
});
|
|
16
|
-
|
|
17
|
-
it("returns nothing when no key belongs to the active element", () => {
|
|
18
|
-
const selected = new Set(["comp#b:50"]);
|
|
19
|
-
expect(selectedKeyframePercentagesForElement(selected, "comp#a")).toEqual([]);
|
|
20
|
-
});
|
|
21
|
-
|
|
22
|
-
it("returns nothing when there is no active element", () => {
|
|
23
|
-
const selected = new Set(["comp#a:25"]);
|
|
24
|
-
expect(selectedKeyframePercentagesForElement(selected, null)).toEqual([]);
|
|
25
|
-
});
|
|
26
|
-
|
|
27
|
-
it("returns nothing for an empty selection", () => {
|
|
28
|
-
expect(selectedKeyframePercentagesForElement(new Set(), "comp#a")).toEqual([]);
|
|
29
|
-
});
|
|
30
|
-
|
|
31
|
-
it("splits on the final colon so element ids containing ':' still match", () => {
|
|
32
|
-
const selected = new Set(["a:b:40"]);
|
|
33
|
-
expect(selectedKeyframePercentagesForElement(selected, "a:b")).toEqual([40]);
|
|
34
|
-
});
|
|
35
|
-
|
|
36
|
-
it("skips keys without a percentage separator", () => {
|
|
37
|
-
const selected = new Set(["comp#a"]);
|
|
38
|
-
expect(selectedKeyframePercentagesForElement(selected, "comp#a")).toEqual([]);
|
|
39
|
-
});
|
|
40
|
-
|
|
41
|
-
it("skips keys whose percentage is not a finite number", () => {
|
|
42
|
-
const selected = new Set(["comp#a:abc", "comp#a:NaN", "comp#a:30"]);
|
|
43
|
-
expect(selectedKeyframePercentagesForElement(selected, "comp#a")).toEqual([30]);
|
|
44
|
-
});
|
|
45
|
-
});
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Resolves which keyframe percentages a bulk operation should act on.
|
|
3
|
-
*
|
|
4
|
-
* `selectedKeyframes` holds `"<elementId>:<percentage>"` keys and can contain
|
|
5
|
-
* keyframes from more than one element — e.g. a shift-selection made before the
|
|
6
|
-
* active element changed (via a keyframe click, a clip click, the layers panel,
|
|
7
|
-
* or the keyframe context menu). A bulk delete only targets the active
|
|
8
|
-
* element's animation, so keys belonging to other elements must be dropped;
|
|
9
|
-
* otherwise their percentages get applied to the active element and remove
|
|
10
|
-
* keyframes the user never selected on it.
|
|
11
|
-
*
|
|
12
|
-
* The element id is everything before the final `:` so element ids that happen
|
|
13
|
-
* to contain `:` are handled correctly.
|
|
14
|
-
*/
|
|
15
|
-
export function selectedKeyframePercentagesForElement(
|
|
16
|
-
selectedKeyframes: ReadonlySet<string>,
|
|
17
|
-
activeElementId: string | null,
|
|
18
|
-
): number[] {
|
|
19
|
-
if (!activeElementId) return [];
|
|
20
|
-
const percentages: number[] = [];
|
|
21
|
-
for (const key of selectedKeyframes) {
|
|
22
|
-
const separator = key.lastIndexOf(":");
|
|
23
|
-
if (separator < 0) continue;
|
|
24
|
-
if (key.slice(0, separator) !== activeElementId) continue;
|
|
25
|
-
const percentage = Number(key.slice(separator + 1));
|
|
26
|
-
if (Number.isFinite(percentage)) percentages.push(percentage);
|
|
27
|
-
}
|
|
28
|
-
return percentages;
|
|
29
|
-
}
|