@hyperframes/studio 0.8.219 → 0.8.220
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-B83GGznX.js → hyperframes-player-CC1Ue2mg.js} +1 -1
- package/dist/assets/{index-B9gVTopE.js → index-BgjuGqZk.js} +6 -6
- package/dist/assets/{index-Ca_tSAqR.js → index-hc5Ru1gB.js} +1 -1
- package/dist/index.html +1 -1
- package/dist/index.js +6 -8
- package/package.json +8 -8
- package/src/hooks/useRenderClipContent.test.ts +29 -0
- package/src/hooks/useRenderClipContent.ts +3 -6
- package/src/player/components/audioClipLink.ts +3 -4
package/dist/index.html
CHANGED
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
document.documentElement.dataset.theme = "paper";
|
|
15
15
|
}
|
|
16
16
|
</script>
|
|
17
|
-
<script type="module" crossorigin src="/assets/index-
|
|
17
|
+
<script type="module" crossorigin src="/assets/index-BgjuGqZk.js"></script>
|
|
18
18
|
<link rel="stylesheet" crossorigin href="/assets/index-RUPGNyct.css">
|
|
19
19
|
</head>
|
|
20
20
|
<body>
|
package/dist/index.js
CHANGED
|
@@ -4570,7 +4570,7 @@ function isLinked(element) {
|
|
|
4570
4570
|
function sharesLinkGroup(a, b) {
|
|
4571
4571
|
return isLinked(a) && a.link === b.link && sameCompositionScope(a, b);
|
|
4572
4572
|
}
|
|
4573
|
-
function audioPillFlags(audio
|
|
4573
|
+
function audioPillFlags(audio) {
|
|
4574
4574
|
return { muted: audio.hidden === true || audio.audioGroupHidden === true };
|
|
4575
4575
|
}
|
|
4576
4576
|
function linkedMembersOf(element, elements, linked = true) {
|
|
@@ -53618,7 +53618,7 @@ function trimFractions(el) {
|
|
|
53618
53618
|
const end = Math.max(start, Math.min(1, (mediaStart + el.duration * rate) / sourceDur));
|
|
53619
53619
|
return { start, end };
|
|
53620
53620
|
}
|
|
53621
|
-
function renderAudioClip(el, pid, sessionEpoch, labelColor, context,
|
|
53621
|
+
function renderAudioClip(el, pid, sessionEpoch, labelColor, context, labelInset) {
|
|
53622
53622
|
const audioUrl = resolveMediaPreviewUrl(
|
|
53623
53623
|
authoredSrcPath(el.src ?? ""),
|
|
53624
53624
|
pid,
|
|
@@ -53639,7 +53639,7 @@ function renderAudioClip(el, pid, sessionEpoch, labelColor, context, elements, l
|
|
|
53639
53639
|
sessionEpoch,
|
|
53640
53640
|
priority: context.priority,
|
|
53641
53641
|
labelInset,
|
|
53642
|
-
...audioPillFlags(el
|
|
53642
|
+
...audioPillFlags(el)
|
|
53643
53643
|
});
|
|
53644
53644
|
return createElement(
|
|
53645
53645
|
ClipPeakMarks,
|
|
@@ -53665,14 +53665,13 @@ function useRenderClipContent({
|
|
|
53665
53665
|
const effectiveMode = effectiveThumbnailMode(thumbnailMode);
|
|
53666
53666
|
const sessionEpoch = usePlayerStore((s) => s.timelineSessionEpoch);
|
|
53667
53667
|
const thumbnailRevisions = usePlayerStore((s) => s.thumbnailRevisions);
|
|
53668
|
-
const elements = usePlayerStore((s) => s.elements);
|
|
53669
53668
|
return useCallback75(
|
|
53670
53669
|
// Pre-existing clip-content dispatcher; reduced by extracting renderAudioClip.
|
|
53671
53670
|
// fallow-ignore-next-line complexity
|
|
53672
53671
|
(el, style, context = { priority: "visible", rich: false }) => {
|
|
53673
53672
|
const pid = projectIdRef.current;
|
|
53674
53673
|
if (!pid) return null;
|
|
53675
|
-
const waveform = (labelInset) => renderAudioClip(el, pid, sessionEpoch, style.label, context,
|
|
53674
|
+
const waveform = (labelInset) => renderAudioClip(el, pid, sessionEpoch, style.label, context, labelInset);
|
|
53676
53675
|
if (effectiveMode === "hidden") {
|
|
53677
53676
|
return rendersWaveform(el) ? waveform() : withSoundStrip(el, null, waveform);
|
|
53678
53677
|
}
|
|
@@ -53699,7 +53698,7 @@ function useRenderClipContent({
|
|
|
53699
53698
|
});
|
|
53700
53699
|
}
|
|
53701
53700
|
if (rendersWaveform(el)) {
|
|
53702
|
-
return renderAudioClip(el, pid, sessionEpoch, style.label, context
|
|
53701
|
+
return renderAudioClip(el, pid, sessionEpoch, style.label, context);
|
|
53703
53702
|
}
|
|
53704
53703
|
if (el.text) return createElement(TextClipContent, { text: el.text });
|
|
53705
53704
|
if (activePreviewUrl && el.duration > 0) {
|
|
@@ -53777,8 +53776,7 @@ function useRenderClipContent({
|
|
|
53777
53776
|
effectiveTimelineDuration,
|
|
53778
53777
|
effectiveMode,
|
|
53779
53778
|
sessionEpoch,
|
|
53780
|
-
thumbnailRevisions
|
|
53781
|
-
elements
|
|
53779
|
+
thumbnailRevisions
|
|
53782
53780
|
]
|
|
53783
53781
|
);
|
|
53784
53782
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hyperframes/studio",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.220",
|
|
4
4
|
"description": "",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -60,12 +60,12 @@
|
|
|
60
60
|
"dockview-react": "8.3.1",
|
|
61
61
|
"gsap": "^3.13.0",
|
|
62
62
|
"mediabunny": "^1.45.3",
|
|
63
|
-
"@hyperframes/
|
|
64
|
-
"@hyperframes/player": "0.8.
|
|
65
|
-
"@hyperframes/shader-transitions": "0.8.
|
|
66
|
-
"@hyperframes/
|
|
67
|
-
"@hyperframes/
|
|
68
|
-
"@hyperframes/
|
|
63
|
+
"@hyperframes/core": "0.8.220",
|
|
64
|
+
"@hyperframes/player": "0.8.220",
|
|
65
|
+
"@hyperframes/shader-transitions": "0.8.220",
|
|
66
|
+
"@hyperframes/studio-server": "0.8.220",
|
|
67
|
+
"@hyperframes/parsers": "0.8.220",
|
|
68
|
+
"@hyperframes/sdk": "0.8.220"
|
|
69
69
|
},
|
|
70
70
|
"devDependencies": {
|
|
71
71
|
"@tailwindcss/vite": "^4.3.3",
|
|
@@ -82,7 +82,7 @@
|
|
|
82
82
|
"vite": "^6.4.2",
|
|
83
83
|
"vitest": "^4.1.11",
|
|
84
84
|
"zustand": "^5.0.0",
|
|
85
|
-
"@hyperframes/producer": "0.8.
|
|
85
|
+
"@hyperframes/producer": "0.8.220"
|
|
86
86
|
},
|
|
87
87
|
"peerDependencies": {
|
|
88
88
|
"react": "19",
|
|
@@ -105,6 +105,35 @@ describe("useRenderClipContent", () => {
|
|
|
105
105
|
return unwrapPeakMarks(content);
|
|
106
106
|
}
|
|
107
107
|
|
|
108
|
+
it("keeps one renderer while the timeline's elements change, so no clip redraws for it", () => {
|
|
109
|
+
const projectIdRef = { current: "my-project" };
|
|
110
|
+
const compIdToSrc = new Map<string, string>();
|
|
111
|
+
const renderers: unknown[] = [];
|
|
112
|
+
function Harness() {
|
|
113
|
+
renderers.push(
|
|
114
|
+
useRenderClipContent({
|
|
115
|
+
projectIdRef,
|
|
116
|
+
compIdToSrc,
|
|
117
|
+
activePreviewUrl: null,
|
|
118
|
+
effectiveTimelineDuration: 12,
|
|
119
|
+
}),
|
|
120
|
+
);
|
|
121
|
+
return null;
|
|
122
|
+
}
|
|
123
|
+
const host = document.createElement("div");
|
|
124
|
+
document.body.append(host);
|
|
125
|
+
const root = createRoot(host);
|
|
126
|
+
act(() => root.render(React.createElement(Harness)));
|
|
127
|
+
act(() =>
|
|
128
|
+
usePlayerStore.setState({
|
|
129
|
+
elements: [{ id: "a", tag: "audio", start: 0, duration: 1, track: 1 }],
|
|
130
|
+
}),
|
|
131
|
+
);
|
|
132
|
+
act(() => root.unmount());
|
|
133
|
+
|
|
134
|
+
expect(new Set(renderers).size).toBe(1);
|
|
135
|
+
});
|
|
136
|
+
|
|
108
137
|
function renderRaw(el: TimelineElement): ReactNode {
|
|
109
138
|
const host = document.createElement("div");
|
|
110
139
|
document.body.append(host);
|
|
@@ -68,7 +68,6 @@ function renderAudioClip(
|
|
|
68
68
|
sessionEpoch: number,
|
|
69
69
|
labelColor: string,
|
|
70
70
|
context: TimelineClipRenderContext,
|
|
71
|
-
elements: readonly TimelineElement[],
|
|
72
71
|
labelInset?: number,
|
|
73
72
|
): ReactNode {
|
|
74
73
|
const audioUrl = resolveMediaPreviewUrl(
|
|
@@ -96,7 +95,7 @@ function renderAudioClip(
|
|
|
96
95
|
sessionEpoch,
|
|
97
96
|
priority: context.priority,
|
|
98
97
|
labelInset,
|
|
99
|
-
...audioPillFlags(el
|
|
98
|
+
...audioPillFlags(el),
|
|
100
99
|
});
|
|
101
100
|
return createElement(
|
|
102
101
|
ClipPeakMarks,
|
|
@@ -136,7 +135,6 @@ export function useRenderClipContent({
|
|
|
136
135
|
const effectiveMode = effectiveThumbnailMode(thumbnailMode);
|
|
137
136
|
const sessionEpoch = usePlayerStore((s) => s.timelineSessionEpoch);
|
|
138
137
|
const thumbnailRevisions = usePlayerStore((s) => s.thumbnailRevisions);
|
|
139
|
-
const elements = usePlayerStore((s) => s.elements);
|
|
140
138
|
return useCallback(
|
|
141
139
|
// Pre-existing clip-content dispatcher; reduced by extracting renderAudioClip.
|
|
142
140
|
// fallow-ignore-next-line complexity
|
|
@@ -151,7 +149,7 @@ export function useRenderClipContent({
|
|
|
151
149
|
// Thumbnail generation disabled (perf) -> plain clip bars. Audio still shows
|
|
152
150
|
// its waveform (cheap, not a frame thumbnail). Toggle: timeline toolbar.
|
|
153
151
|
const waveform = (labelInset?: number) =>
|
|
154
|
-
renderAudioClip(el, pid, sessionEpoch, style.label, context,
|
|
152
|
+
renderAudioClip(el, pid, sessionEpoch, style.label, context, labelInset);
|
|
155
153
|
if (effectiveMode === "hidden") {
|
|
156
154
|
return rendersWaveform(el) ? waveform() : withSoundStrip(el, null, waveform);
|
|
157
155
|
}
|
|
@@ -190,7 +188,7 @@ export function useRenderClipContent({
|
|
|
190
188
|
// activePreviewUrl thumbnail branch; audio rows need waveform data, not a
|
|
191
189
|
// captured frame from the currently drilled composition preview.
|
|
192
190
|
if (rendersWaveform(el)) {
|
|
193
|
-
return renderAudioClip(el, pid, sessionEpoch, style.label, context
|
|
191
|
+
return renderAudioClip(el, pid, sessionEpoch, style.label, context);
|
|
194
192
|
}
|
|
195
193
|
|
|
196
194
|
if (el.text) return createElement(TextClipContent, { text: el.text });
|
|
@@ -282,7 +280,6 @@ export function useRenderClipContent({
|
|
|
282
280
|
effectiveMode,
|
|
283
281
|
sessionEpoch,
|
|
284
282
|
thumbnailRevisions,
|
|
285
|
-
elements,
|
|
286
283
|
],
|
|
287
284
|
);
|
|
288
285
|
}
|
|
@@ -34,10 +34,9 @@ export function sharesLinkGroup(
|
|
|
34
34
|
return isLinked(a) && a.link === b.link && sameCompositionScope(a, b);
|
|
35
35
|
}
|
|
36
36
|
|
|
37
|
-
export function audioPillFlags(
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
): { muted: boolean } {
|
|
37
|
+
export function audioPillFlags(audio: Pick<TimelineElement, "hidden" | "audioGroupHidden">): {
|
|
38
|
+
muted: boolean;
|
|
39
|
+
} {
|
|
41
40
|
return { muted: audio.hidden === true || audio.audioGroupHidden === true };
|
|
42
41
|
}
|
|
43
42
|
|