@hyperframes/studio 0.8.5 → 0.8.7
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-DcM3fVcp.js → hyperframes-player-bDcU464i.js} +1 -1
- package/dist/assets/index-Ba9zbpT9.css +1 -0
- package/dist/assets/index-CUXnyoIa.js +428 -0
- package/dist/assets/{index-DgJrvYGf.js → index-FkAs3zRu.js} +1 -1
- package/dist/assets/{index-Del6XWZj.js → index-MSOSP1-J.js} +1 -1
- package/dist/index.d.ts +98 -17
- package/dist/index.html +2 -2
- package/dist/index.js +10337 -7200
- package/dist/index.js.map +1 -1
- package/package.json +7 -7
- package/src/App.tsx +22 -23
- package/src/captions/components/CaptionAnimationPanel.tsx +46 -13
- package/src/captions/components/CaptionOverlay.tsx +172 -29
- package/src/captions/components/CaptionOverlayUtils.ts +54 -0
- package/src/captions/components/CaptionPropertyPanel.tsx +49 -23
- package/src/captions/components/CaptionTimeline.tsx +36 -79
- package/src/captions/components/shared.tsx +76 -1
- package/src/captions/hooks/useCaptionSync.ts +72 -13
- package/src/captions/keyboard.test.ts +12 -0
- package/src/captions/keyboard.ts +12 -1
- package/src/captions/store.ts +120 -14
- package/src/components/EditorShell.selectionSync.test.tsx +1 -1
- package/src/components/EditorShell.tsx +13 -1
- package/src/components/StudioRightPanel.tsx +2 -0
- package/src/components/StudioRightPanel.types.ts +1 -0
- package/src/components/editor/AnimationCard.tsx +2 -1
- package/src/components/editor/AnimationCardParts.tsx +6 -3
- package/src/components/editor/ArcPathControls.tsx +10 -4
- package/src/components/editor/BlockParamsPanel.test.tsx +170 -0
- package/src/components/editor/BlockParamsPanel.tsx +153 -11
- package/src/components/editor/BorderRadiusEditor.tsx +3 -22
- package/src/components/editor/FileTree.tsx +41 -12
- package/src/components/editor/FileTreeNodes.tsx +90 -20
- package/src/components/editor/GsapAnimationList.tsx +5 -0
- package/src/components/editor/KeyframeDiamond.tsx +3 -1
- package/src/components/editor/KeyframeEaseList.tsx +3 -2
- package/src/components/editor/KeyframeNavigation.tsx +6 -2
- package/src/components/editor/LayersPanel.tsx +11 -2
- package/src/components/editor/MotionPathNode.tsx +1 -0
- package/src/components/editor/PropertyPanel.test.tsx +7 -6
- package/src/components/editor/PropertyPanel.tsx +13 -5
- package/src/components/editor/PropertyPanelFlat.tsx +2 -0
- package/src/components/editor/SnapToolbar.tsx +20 -4
- package/src/components/editor/TimelineFxPopover.test.tsx +113 -0
- package/src/components/editor/TimelineFxPopover.tsx +138 -0
- package/src/components/editor/Transform3DCube.tsx +22 -1
- package/src/components/editor/manualOffsetDrag.test.ts +49 -0
- package/src/components/editor/manualOffsetDrag.ts +13 -1
- package/src/components/editor/propertyPanel3dTransform.tsx +11 -3
- package/src/components/editor/propertyPanelAudioFxGroup.test.tsx +139 -3
- package/src/components/editor/propertyPanelAudioFxGroup.tsx +4 -0
- package/src/components/editor/propertyPanelColor.tsx +9 -1
- package/src/components/editor/propertyPanelColorGradingControls.tsx +28 -7
- package/src/components/editor/propertyPanelCommitField.tsx +9 -1
- package/src/components/editor/propertyPanelFill.tsx +50 -2
- package/src/components/editor/propertyPanelFlatProps.ts +1 -0
- package/src/components/editor/propertyPanelFont.tsx +45 -9
- package/src/components/editor/propertyPanelFxPresetStyle.ts +18 -0
- package/src/components/editor/propertyPanelFxSection.test.tsx +3 -3
- package/src/components/editor/propertyPanelFxSection.tsx +8 -23
- package/src/components/editor/propertyPanelPrimitives.tsx +9 -12
- package/src/components/editor/propertyPanelStyleSections.tsx +21 -2
- package/src/components/editor/propertyPanelTransformCommit.ts +3 -3
- package/src/components/editor/propertyPanelTypes.ts +2 -0
- package/src/components/editor/useApplyAudioFxPreset.ts +36 -0
- package/src/components/editor/useFxCarve.ts +0 -0
- package/src/components/editor/useFxCarveGrouping.ts +132 -0
- package/src/components/nle/PreviewOverlays.tsx +69 -2
- package/src/components/nle/PreviewPane.tsx +1 -0
- package/src/components/nle/useTimelineEditCallbacks.test.tsx +1 -0
- package/src/components/nle/useTimelineEditCallbacks.ts +27 -0
- package/src/components/panels/SlideshowPanel.tsx +81 -12
- package/src/components/panels/SlideshowSubPanels.tsx +61 -7
- package/src/components/sidebar/AssetCard.test.tsx +2 -2
- package/src/components/sidebar/AssetCard.tsx +94 -46
- package/src/components/sidebar/AssetContextMenu.tsx +196 -42
- package/src/components/sidebar/AssetsTab.tsx +156 -96
- package/src/components/sidebar/AudioRow.tsx +95 -40
- package/src/components/sidebar/BlocksTab.tsx +40 -128
- package/src/components/sidebar/CompositionsTab.tsx +46 -34
- package/src/components/sidebar/LeftSidebar.tsx +87 -75
- package/src/components/sidebar/PromptPreviewModal.tsx +126 -0
- package/src/components/sidebar/assetHelpers.ts +8 -0
- package/src/contexts/TimelineEditContext.tsx +5 -0
- package/src/hooks/timelineAudioGroupVolume.ts +148 -0
- package/src/hooks/timelineEditingHelpers.ts +78 -1
- package/src/hooks/timelineElementFxAttribute.ts +150 -0
- package/src/hooks/timelineTrackVisibility.test.ts +222 -1
- package/src/hooks/timelineTrackVisibility.ts +187 -4
- package/src/hooks/useAppHotkeys.ts +22 -0
- package/src/hooks/useAudioSoloBridge.ts +61 -0
- package/src/hooks/useCaptionDetection.ts +22 -2
- package/src/hooks/useDomEditCommits.test.tsx +24 -0
- package/src/hooks/useEffectiveTimelineDuration.ts +20 -0
- package/src/hooks/useGroupLevel.ts +36 -0
- package/src/hooks/useHydrateActiveCompPathFromUrl.ts +36 -0
- package/src/hooks/useMusicBeatAnalysis.ts +13 -0
- package/src/hooks/useTimelineDeleteOps.ts +170 -0
- package/src/hooks/useTimelineEditing.ts +53 -129
- package/src/player/components/AudioWaveform.tsx +29 -26
- package/src/player/components/BeatStrip.test.tsx +5 -9
- package/src/player/components/BeatStrip.tsx +12 -5
- package/src/player/components/ClipContextMenu.tsx +8 -2
- package/src/player/components/EditModal.tsx +48 -7
- package/src/player/components/KeyframeDiamondContextMenu.tsx +90 -10
- package/src/player/components/LayerDisclosureRow.tsx +12 -13
- package/src/player/components/Player.tsx +43 -8
- package/src/player/components/PlayerControls.tsx +107 -63
- package/src/player/components/ShortcutsPanel.tsx +23 -4
- package/src/player/components/SpeedMenu.tsx +34 -42
- package/src/player/components/Timeline.test.ts +7 -7
- package/src/player/components/Timeline.tsx +7 -10
- package/src/player/components/TimelineFxButton.test.tsx +81 -0
- package/src/player/components/TimelineFxButton.tsx +143 -0
- package/src/player/components/TimelineGroupBusStrip.test.tsx +146 -0
- package/src/player/components/TimelineGroupBusStrip.tsx +103 -0
- package/src/player/components/TimelineGroupHeader.tsx +176 -0
- package/src/player/components/TimelineGroupRow.tsx +146 -0
- package/src/player/components/TimelineLanes.test.tsx +5 -0
- package/src/player/components/TimelineLanes.tsx +39 -33
- package/src/player/components/TimelineOverlays.tsx +34 -0
- package/src/player/components/TimelineSoloButton.tsx +32 -0
- package/src/player/components/TimelineTrackHeader.tsx +74 -98
- package/src/player/components/TimelineTrackPlainHeader.tsx +119 -0
- package/src/player/components/VideoThumbnail.tsx +6 -1
- package/src/player/components/menuKeyboardNav.ts +47 -0
- package/src/player/components/timelineCallbacks.ts +26 -0
- package/src/player/components/timelineKeyboardNavigation.test.ts +8 -0
- package/src/player/components/timelineKeyboardNavigation.ts +147 -30
- package/src/player/components/timelineLaneProps.ts +3 -0
- package/src/player/components/timelineLayout.ts +1 -1
- package/src/player/components/timelineNavigationIdentity.ts +4 -0
- package/src/player/components/useTimelineLaneRowIndexes.ts +38 -0
- package/src/player/components/useTimelineLogicalFocus.ts +9 -0
- package/src/player/components/useTimelineLogicalRows.test.tsx +8 -0
- package/src/player/components/useTimelineLogicalRows.ts +17 -12
- package/src/player/components/useTimelineMultiDragActorWindows.ts +30 -0
- package/src/player/components/useTimelineTrackDerivations.ts +150 -6
- package/src/player/components/useTimelineTrackLayout.ts +61 -4
- package/src/player/hooks/previewMessageRouter.ts +127 -0
- package/src/player/hooks/useExpandedTimelineElements.test.ts +64 -17
- package/src/player/hooks/useExpandedTimelineElements.ts +8 -11
- package/src/player/hooks/useTimelinePlayer.ts +9 -47
- package/src/player/lib/timelineDOM.ts +51 -0
- package/src/player/store/audioSoloSlice.test.ts +113 -0
- package/src/player/store/audioSoloSlice.ts +43 -0
- package/src/player/store/editingModeSlice.ts +45 -0
- package/src/player/store/groupLevels.ts +33 -0
- package/src/player/store/keyframeSlice.ts +26 -0
- package/src/player/store/playerStore.ts +21 -22
- package/src/player/store/timelineElement.ts +10 -0
- package/src/telemetry/events.ts +12 -0
- package/dist/assets/index-Cx_UrhoW.js +0 -428
- package/dist/assets/index-DcF4s1PG.css +0 -1
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
// @vitest-environment happy-dom
|
|
2
|
+
|
|
3
|
+
import { describe, expect, it, vi } from "vitest";
|
|
4
|
+
import { usePlayerStore } from "./playerStore";
|
|
5
|
+
import { isAudibleUnderSolo, isGroupHalfLitUnderSolo } from "./audioSoloSlice";
|
|
6
|
+
import * as studioFileHistory from "../../utils/studioFileHistory";
|
|
7
|
+
|
|
8
|
+
describe("audioSoloSlice", () => {
|
|
9
|
+
it("is exclusive by default, and clicking the only soloed element again clears it", () => {
|
|
10
|
+
usePlayerStore.getState().toggleSolo("a");
|
|
11
|
+
expect(usePlayerStore.getState().soloed).toEqual(new Set(["a"]));
|
|
12
|
+
usePlayerStore.getState().toggleSolo("b");
|
|
13
|
+
expect(usePlayerStore.getState().soloed).toEqual(new Set(["b"]));
|
|
14
|
+
usePlayerStore.getState().toggleSolo("b");
|
|
15
|
+
expect(usePlayerStore.getState().soloed).toEqual(new Set());
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
it("⌘/Ctrl-click adds and removes membership without disturbing the rest", () => {
|
|
19
|
+
usePlayerStore.getState().toggleSolo("a");
|
|
20
|
+
usePlayerStore.getState().toggleSolo("b", { add: true });
|
|
21
|
+
expect(usePlayerStore.getState().soloed).toEqual(new Set(["a", "b"]));
|
|
22
|
+
usePlayerStore.getState().toggleSolo("a", { add: true });
|
|
23
|
+
expect(usePlayerStore.getState().soloed).toEqual(new Set(["b"]));
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
it("clearSolo empties the set", () => {
|
|
27
|
+
usePlayerStore.getState().toggleSolo("a");
|
|
28
|
+
usePlayerStore.getState().clearSolo();
|
|
29
|
+
expect(usePlayerStore.getState().soloed).toEqual(new Set());
|
|
30
|
+
});
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
describe("export-safety: solo never touches an attribute or the save path", () => {
|
|
34
|
+
it("toggling, ⌘-adding, and clearing solo never calls setAttribute/removeAttribute on any element", () => {
|
|
35
|
+
usePlayerStore.getState().clearSolo();
|
|
36
|
+
const setAttributeSpy = vi.spyOn(Element.prototype, "setAttribute");
|
|
37
|
+
const removeAttributeSpy = vi.spyOn(Element.prototype, "removeAttribute");
|
|
38
|
+
|
|
39
|
+
usePlayerStore.getState().toggleSolo("a");
|
|
40
|
+
usePlayerStore.getState().toggleSolo("b", { add: true });
|
|
41
|
+
usePlayerStore.getState().toggleSolo("a", { add: true });
|
|
42
|
+
usePlayerStore.getState().clearSolo();
|
|
43
|
+
|
|
44
|
+
expect(setAttributeSpy).not.toHaveBeenCalled();
|
|
45
|
+
expect(removeAttributeSpy).not.toHaveBeenCalled();
|
|
46
|
+
setAttributeSpy.mockRestore();
|
|
47
|
+
removeAttributeSpy.mockRestore();
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
it("toggling, ⌘-adding, and clearing solo never invokes the project save path (setElementsHidden's own write function)", () => {
|
|
51
|
+
usePlayerStore.getState().clearSolo();
|
|
52
|
+
const saveSpy = vi.spyOn(studioFileHistory, "saveProjectFilesWithHistory");
|
|
53
|
+
|
|
54
|
+
usePlayerStore.getState().toggleSolo("a");
|
|
55
|
+
usePlayerStore.getState().toggleSolo("b", { add: true });
|
|
56
|
+
usePlayerStore.getState().clearSolo();
|
|
57
|
+
|
|
58
|
+
expect(saveSpy).not.toHaveBeenCalled();
|
|
59
|
+
saveSpy.mockRestore();
|
|
60
|
+
});
|
|
61
|
+
});
|
|
62
|
+
|
|
63
|
+
describe("isAudibleUnderSolo — the three-bullet rule", () => {
|
|
64
|
+
it("everything is audible when no solo is active", () => {
|
|
65
|
+
expect(isAudibleUnderSolo(new Set(), "clip-a")).toBe(true);
|
|
66
|
+
expect(isAudibleUnderSolo(new Set(), "clip-a", "group-1")).toBe(true);
|
|
67
|
+
});
|
|
68
|
+
|
|
69
|
+
it("a soloed element is audible", () => {
|
|
70
|
+
expect(isAudibleUnderSolo(new Set(["clip-a"]), "clip-a")).toBe(true);
|
|
71
|
+
});
|
|
72
|
+
|
|
73
|
+
it("a sibling of a soloed element is silent", () => {
|
|
74
|
+
expect(isAudibleUnderSolo(new Set(["clip-a"]), "clip-b")).toBe(false);
|
|
75
|
+
});
|
|
76
|
+
|
|
77
|
+
it("a member of a soloed group is audible (group solo = members solo)", () => {
|
|
78
|
+
expect(isAudibleUnderSolo(new Set(["group-1"]), "clip-a", "group-1")).toBe(true);
|
|
79
|
+
});
|
|
80
|
+
|
|
81
|
+
it("a member of an UNsoloed group, while a sibling group is soloed, is silent", () => {
|
|
82
|
+
expect(isAudibleUnderSolo(new Set(["group-2"]), "clip-a", "group-1")).toBe(false);
|
|
83
|
+
});
|
|
84
|
+
|
|
85
|
+
it("soloing one member of a group does not un-attenuate its siblings in the same group", () => {
|
|
86
|
+
// clip-a is soloed directly; clip-b shares its group but is not itself
|
|
87
|
+
// soloed and the group itself is not soloed — clip-b stays silent.
|
|
88
|
+
expect(isAudibleUnderSolo(new Set(["clip-a"]), "clip-b", "group-1")).toBe(false);
|
|
89
|
+
});
|
|
90
|
+
|
|
91
|
+
it("the group itself, monitored as a bus, is audible only when it or a member is soloed", () => {
|
|
92
|
+
expect(isAudibleUnderSolo(new Set(["clip-a"]), "group-1", null)).toBe(false);
|
|
93
|
+
expect(isAudibleUnderSolo(new Set(["group-1"]), "group-1", null)).toBe(true);
|
|
94
|
+
});
|
|
95
|
+
});
|
|
96
|
+
|
|
97
|
+
describe("isGroupHalfLitUnderSolo", () => {
|
|
98
|
+
it("is false when no solo is active", () => {
|
|
99
|
+
expect(isGroupHalfLitUnderSolo(new Set(), "group-1", ["a", "b"])).toBe(false);
|
|
100
|
+
});
|
|
101
|
+
|
|
102
|
+
it("is false when the group itself is soloed (fully lit, not half)", () => {
|
|
103
|
+
expect(isGroupHalfLitUnderSolo(new Set(["group-1"]), "group-1", ["a", "b"])).toBe(false);
|
|
104
|
+
});
|
|
105
|
+
|
|
106
|
+
it("is true when a member is soloed but the group is not", () => {
|
|
107
|
+
expect(isGroupHalfLitUnderSolo(new Set(["a"]), "group-1", ["a", "b"])).toBe(true);
|
|
108
|
+
});
|
|
109
|
+
|
|
110
|
+
it("is false when an unrelated element is soloed", () => {
|
|
111
|
+
expect(isGroupHalfLitUnderSolo(new Set(["other"]), "group-1", ["a", "b"])).toBe(false);
|
|
112
|
+
});
|
|
113
|
+
});
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* "Hear only this" — session-only monitoring override, never persisted.
|
|
3
|
+
*
|
|
4
|
+
* Holds clip ids and group ids (never track numbers, per the design doc: solo
|
|
5
|
+
* is a per-element/per-group concept, not a row-position one). Exclusive by
|
|
6
|
+
* default (a plain toggle replaces the set); ⌘/Ctrl-click adds/removes one
|
|
7
|
+
* member without disturbing the rest. Never written to any attribute or
|
|
8
|
+
* document — the export-safety guarantee this slice exists to hold.
|
|
9
|
+
*/
|
|
10
|
+
import type { StoreApi } from "zustand";
|
|
11
|
+
import { isAudibleUnderSolo, isGroupHalfLitUnderSolo } from "@hyperframes/core/audio-groups";
|
|
12
|
+
|
|
13
|
+
export { isAudibleUnderSolo, isGroupHalfLitUnderSolo };
|
|
14
|
+
|
|
15
|
+
export interface AudioSoloSlice {
|
|
16
|
+
soloed: ReadonlySet<string>;
|
|
17
|
+
toggleSolo: (id: string, options?: { add?: boolean }) => void;
|
|
18
|
+
clearSolo: () => void;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export function createAudioSoloSlice(
|
|
22
|
+
set: StoreApi<AudioSoloSlice>["setState"],
|
|
23
|
+
get: StoreApi<AudioSoloSlice>["getState"],
|
|
24
|
+
): AudioSoloSlice {
|
|
25
|
+
return {
|
|
26
|
+
soloed: new Set(),
|
|
27
|
+
toggleSolo: (id, options) => {
|
|
28
|
+
const current = get().soloed;
|
|
29
|
+
if (options?.add) {
|
|
30
|
+
const next = new Set(current);
|
|
31
|
+
if (next.has(id)) next.delete(id);
|
|
32
|
+
else next.add(id);
|
|
33
|
+
set({ soloed: next });
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
// Exclusive click: soloing the only-soloed element again clears it;
|
|
37
|
+
// otherwise it replaces the set.
|
|
38
|
+
const isOnlyMember = current.size === 1 && current.has(id);
|
|
39
|
+
set({ soloed: isOnlyMember ? new Set() : new Set([id]) });
|
|
40
|
+
},
|
|
41
|
+
clearSolo: () => set({ soloed: new Set() }),
|
|
42
|
+
};
|
|
43
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The two editing-mode toggles the timeline toolbar owns.
|
|
3
|
+
*
|
|
4
|
+
* A store slice rather than toolbar-local state because both are read far from
|
|
5
|
+
* where they are set: the motion-path arm is consumed by the canvas click
|
|
6
|
+
* handler and published by MotionPathOverlay, and the auto-keyframe flag
|
|
7
|
+
* decides what a drag/resize/rotate does inside the edit commit path.
|
|
8
|
+
*
|
|
9
|
+
* `motionPathArmed` is also cleared by playerStore on selection change — arming
|
|
10
|
+
* survives neither a new element nor a project switch, so those resets stay
|
|
11
|
+
* with the state they clear alongside.
|
|
12
|
+
*/
|
|
13
|
+
import type { StoreApi } from "zustand";
|
|
14
|
+
|
|
15
|
+
export interface EditingModeSlice {
|
|
16
|
+
/** Motion-path "set destination" mode. Armed from the preview toolbar
|
|
17
|
+
* (replaces the old double-click-on-canvas UX); while armed, one canvas
|
|
18
|
+
* click places the new path's destination. */
|
|
19
|
+
motionPathArmed: boolean;
|
|
20
|
+
setMotionPathArmed: (armed: boolean) => void;
|
|
21
|
+
/** Published by MotionPathOverlay so the toolbar shows the button only when
|
|
22
|
+
* the selected element can actually take a path. */
|
|
23
|
+
motionPathCreateAvailable: boolean;
|
|
24
|
+
setMotionPathCreateAvailable: (available: boolean) => void;
|
|
25
|
+
/** Global toggle for the "Add keyframe" diamond in the timeline toolbar
|
|
26
|
+
* (#1808). When false, a manual drag/resize/rotate edit on an element that
|
|
27
|
+
* already has a live tween shifts every keyframe by the edit's delta
|
|
28
|
+
* (preserving the animation's shape) instead of inserting/updating a
|
|
29
|
+
* keyframe at the playhead. */
|
|
30
|
+
autoKeyframeEnabled: boolean;
|
|
31
|
+
setAutoKeyframeEnabled: (enabled: boolean) => void;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export function createEditingModeSlice(
|
|
35
|
+
set: StoreApi<EditingModeSlice>["setState"],
|
|
36
|
+
): EditingModeSlice {
|
|
37
|
+
return {
|
|
38
|
+
motionPathArmed: false,
|
|
39
|
+
setMotionPathArmed: (armed) => set({ motionPathArmed: armed }),
|
|
40
|
+
motionPathCreateAvailable: false,
|
|
41
|
+
setMotionPathCreateAvailable: (available) => set({ motionPathCreateAvailable: available }),
|
|
42
|
+
autoKeyframeEnabled: true,
|
|
43
|
+
setAutoKeyframeEnabled: (enabled) => set({ autoKeyframeEnabled: enabled }),
|
|
44
|
+
};
|
|
45
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
// ponytail: mirrors liveTime.ts's plain pub-sub — same throttle-at-the-edge shape.
|
|
2
|
+
/** A group's live meter reading, or absent when idle/unknown (never zero). */
|
|
3
|
+
export type GroupLevelReading = { level: number; clipped: boolean };
|
|
4
|
+
|
|
5
|
+
type Listener = (levels: ReadonlyMap<string, GroupLevelReading>) => void;
|
|
6
|
+
const listeners = new Set<Listener>();
|
|
7
|
+
let latest: ReadonlyMap<string, GroupLevelReading> = new Map();
|
|
8
|
+
|
|
9
|
+
export const groupLevels = {
|
|
10
|
+
notify: (levels: ReadonlyMap<string, GroupLevelReading>) => {
|
|
11
|
+
latest = levels;
|
|
12
|
+
listeners.forEach((listener) => listener(levels));
|
|
13
|
+
},
|
|
14
|
+
subscribe: (listener: Listener) => {
|
|
15
|
+
listeners.add(listener);
|
|
16
|
+
return () => listeners.delete(listener);
|
|
17
|
+
},
|
|
18
|
+
get: () => latest,
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
/** Turns the runtime's `group-levels` postMessage payload into the map `groupLevels.notify` wants. */
|
|
22
|
+
export function parseGroupLevelsMessage(
|
|
23
|
+
data: unknown,
|
|
24
|
+
): ReadonlyMap<string, GroupLevelReading> | null {
|
|
25
|
+
const levels = (data as { levels?: unknown } | null)?.levels;
|
|
26
|
+
if (!Array.isArray(levels)) return null;
|
|
27
|
+
return new Map(
|
|
28
|
+
(levels as Array<{ groupId: string; level: number; clipped: boolean }>).map((entry) => [
|
|
29
|
+
entry.groupId,
|
|
30
|
+
{ level: entry.level, clipped: entry.clipped },
|
|
31
|
+
]),
|
|
32
|
+
);
|
|
33
|
+
}
|
|
@@ -63,6 +63,14 @@ export interface KeyframeSlice {
|
|
|
63
63
|
/** Union-expand clips (keyframed clips are expanded by default on load). */
|
|
64
64
|
expandClips: (ids: readonly string[]) => void;
|
|
65
65
|
|
|
66
|
+
/** Groups whose member rows the caret has shown (structural, not lanes). */
|
|
67
|
+
expandedGroupIds: Set<string>;
|
|
68
|
+
toggleGroupExpanded: (id: string) => void;
|
|
69
|
+
|
|
70
|
+
/** Rows (clip id or group id) whose automation-lane rows the `∿` button opened. */
|
|
71
|
+
expandedLaneOwnerIds: Set<string>;
|
|
72
|
+
toggleLaneOwnerExpanded: (id: string) => void;
|
|
73
|
+
|
|
66
74
|
/**
|
|
67
75
|
* Project/session/element-scoped request. Its nonce is monotonic across store
|
|
68
76
|
* resets so a stale consumer can never collide with a later request.
|
|
@@ -119,6 +127,24 @@ export function createKeyframeSlice(
|
|
|
119
127
|
return { expandedClipIds: next };
|
|
120
128
|
}),
|
|
121
129
|
|
|
130
|
+
expandedGroupIds: new Set(),
|
|
131
|
+
toggleGroupExpanded: (id) =>
|
|
132
|
+
set((state) => {
|
|
133
|
+
const next = new Set(state.expandedGroupIds);
|
|
134
|
+
if (next.has(id)) next.delete(id);
|
|
135
|
+
else next.add(id);
|
|
136
|
+
return { expandedGroupIds: next };
|
|
137
|
+
}),
|
|
138
|
+
|
|
139
|
+
expandedLaneOwnerIds: new Set(),
|
|
140
|
+
toggleLaneOwnerExpanded: (id) =>
|
|
141
|
+
set((state) => {
|
|
142
|
+
const next = new Set(state.expandedLaneOwnerIds);
|
|
143
|
+
if (next.has(id)) next.delete(id);
|
|
144
|
+
else next.add(id);
|
|
145
|
+
return { expandedLaneOwnerIds: next };
|
|
146
|
+
}),
|
|
147
|
+
|
|
122
148
|
focusedEaseSegment: null,
|
|
123
149
|
focusedEaseRequestNonce: 0,
|
|
124
150
|
setFocusedEaseSegment: (target) =>
|
|
@@ -16,6 +16,8 @@ import {
|
|
|
16
16
|
} from "./automationSelectionSlice";
|
|
17
17
|
import { createTimelineFocusRequest, type TimelineFocusRequest } from "./timelineFocusState";
|
|
18
18
|
import { createThumbnailSlice, type ThumbnailSlice } from "./thumbnailSlice";
|
|
19
|
+
import { createAudioSoloSlice, type AudioSoloSlice } from "./audioSoloSlice";
|
|
20
|
+
import { createEditingModeSlice, type EditingModeSlice } from "./editingModeSlice";
|
|
19
21
|
|
|
20
22
|
export type { KeyframeCacheEntry } from "./keyframeSlice";
|
|
21
23
|
export { liveTime } from "./liveTime";
|
|
@@ -47,7 +49,13 @@ function resolveElementSelection(
|
|
|
47
49
|
};
|
|
48
50
|
}
|
|
49
51
|
|
|
50
|
-
interface PlayerState
|
|
52
|
+
interface PlayerState
|
|
53
|
+
extends
|
|
54
|
+
KeyframeSlice,
|
|
55
|
+
AutomationSelectionSlice,
|
|
56
|
+
ThumbnailSlice,
|
|
57
|
+
AudioSoloSlice,
|
|
58
|
+
EditingModeSlice {
|
|
51
59
|
isPlaying: boolean;
|
|
52
60
|
currentTime: number;
|
|
53
61
|
duration: number;
|
|
@@ -87,20 +95,6 @@ interface PlayerState extends KeyframeSlice, AutomationSelectionSlice, Thumbnail
|
|
|
87
95
|
* (drag, resize, rotate) target this instead of recomputing from playhead. */
|
|
88
96
|
activeKeyframePct: number | null;
|
|
89
97
|
setActiveKeyframePct: (pct: number | null) => void;
|
|
90
|
-
/** Motion-path "set destination" mode. Armed from the preview toolbar (replaces
|
|
91
|
-
* the old double-click-on-canvas UX); while armed, one canvas click places the
|
|
92
|
-
* new path's destination. `available` is published by MotionPathOverlay so the
|
|
93
|
-
* toolbar shows the button only when the selected element can take a path. */
|
|
94
|
-
motionPathArmed: boolean;
|
|
95
|
-
setMotionPathArmed: (armed: boolean) => void;
|
|
96
|
-
motionPathCreateAvailable: boolean;
|
|
97
|
-
setMotionPathCreateAvailable: (available: boolean) => void;
|
|
98
|
-
/** Global toggle for the "Add keyframe" diamond in the timeline toolbar (#1808).
|
|
99
|
-
* When false, a manual drag/resize/rotate edit on an element that already has
|
|
100
|
-
* a live tween shifts every keyframe by the edit's delta (preserving the
|
|
101
|
-
* animation's shape) instead of inserting/updating a keyframe at the playhead. */
|
|
102
|
-
autoKeyframeEnabled: boolean;
|
|
103
|
-
setAutoKeyframeEnabled: (enabled: boolean) => void;
|
|
104
98
|
|
|
105
99
|
/** Multi-select: additional selected elements beyond selectedElementId. */
|
|
106
100
|
selectedElementIds: Set<string>;
|
|
@@ -146,7 +140,14 @@ interface PlayerState extends KeyframeSlice, AutomationSelectionSlice, Thumbnail
|
|
|
146
140
|
updates: Partial<
|
|
147
141
|
Pick<
|
|
148
142
|
TimelineElement,
|
|
149
|
-
|
|
143
|
+
| "start"
|
|
144
|
+
| "duration"
|
|
145
|
+
| "track"
|
|
146
|
+
| "zIndex"
|
|
147
|
+
| "hasExplicitZIndex"
|
|
148
|
+
| "playbackStart"
|
|
149
|
+
| "hidden"
|
|
150
|
+
| "audioGroup"
|
|
150
151
|
>
|
|
151
152
|
>,
|
|
152
153
|
) => void;
|
|
@@ -270,6 +271,8 @@ export function createTimelineResetState() {
|
|
|
270
271
|
// paste through `sel.elementKey === paste.elementKey` to a stale t0.
|
|
271
272
|
automationSelection: null,
|
|
272
273
|
expandedClipIds: new Set<string>(),
|
|
274
|
+
expandedGroupIds: new Set<string>(),
|
|
275
|
+
expandedLaneOwnerIds: new Set<string>(),
|
|
273
276
|
focusedEaseSegment: null,
|
|
274
277
|
selectedElementIds: new Set<string>(),
|
|
275
278
|
requestedSeekTime: null,
|
|
@@ -320,15 +323,11 @@ export const usePlayerStore = create<PlayerState>((set, get) => ({
|
|
|
320
323
|
...createThumbnailSlice(set),
|
|
321
324
|
|
|
322
325
|
...createAutomationSelectionSlice(set),
|
|
326
|
+
...createAudioSoloSlice(set, get),
|
|
327
|
+
...createEditingModeSlice(set),
|
|
323
328
|
|
|
324
329
|
activeKeyframePct: null,
|
|
325
330
|
setActiveKeyframePct: (pct) => set({ activeKeyframePct: pct }),
|
|
326
|
-
motionPathArmed: false,
|
|
327
|
-
setMotionPathArmed: (armed) => set({ motionPathArmed: armed }),
|
|
328
|
-
motionPathCreateAvailable: false,
|
|
329
|
-
setMotionPathCreateAvailable: (available) => set({ motionPathCreateAvailable: available }),
|
|
330
|
-
autoKeyframeEnabled: true,
|
|
331
|
-
setAutoKeyframeEnabled: (enabled) => set({ autoKeyframeEnabled: enabled }),
|
|
332
331
|
|
|
333
332
|
selectedElementIds: new Set<string>(),
|
|
334
333
|
setSelection: (ids, anchor) => set(resolveElementSelection(ids, anchor)),
|
|
@@ -67,6 +67,16 @@ export interface TimelineElement {
|
|
|
67
67
|
hidden?: boolean;
|
|
68
68
|
/** Value of data-timeline-role attribute — used to identify music vs. voiceover. */
|
|
69
69
|
timelineRole?: string;
|
|
70
|
+
/** Verbatim `data-audio-group` — the id of the `<hf-audio-group>` this clip belongs to, when any. */
|
|
71
|
+
audioGroup?: string;
|
|
72
|
+
/** The owning group's `data-label` (falls back to its id) — resolved once per parse. */
|
|
73
|
+
audioGroupLabel?: string;
|
|
74
|
+
/** The owning group's `data-volume` (defaults to 1) — resolved once per parse. */
|
|
75
|
+
audioGroupVolume?: number;
|
|
76
|
+
/** The owning group's `data-hidden` (defaults to false) — resolved once per parse. */
|
|
77
|
+
audioGroupHidden?: boolean;
|
|
78
|
+
/** The owning group's serialized `data-fx-chain`, when set — resolved once per parse. */
|
|
79
|
+
audioGroupFxChain?: string;
|
|
70
80
|
/**
|
|
71
81
|
* Set by useExpandedTimelineElements on an inline-expanded sub-composition
|
|
72
82
|
* child: the absolute master-timeline start of the sub-comp host the child
|
package/src/telemetry/events.ts
CHANGED
|
@@ -186,3 +186,15 @@ export function trackStudioFeedback(
|
|
|
186
186
|
source: "studio",
|
|
187
187
|
});
|
|
188
188
|
}
|
|
189
|
+
|
|
190
|
+
export function trackBlockParamCommit(props: {
|
|
191
|
+
tone: "saved" | "error" | "confirm";
|
|
192
|
+
blockName: string;
|
|
193
|
+
key: string;
|
|
194
|
+
}): void {
|
|
195
|
+
trackEvent("studio_block_param_commit", {
|
|
196
|
+
tone: props.tone,
|
|
197
|
+
block_name: props.blockName,
|
|
198
|
+
param_key: props.key,
|
|
199
|
+
});
|
|
200
|
+
}
|