@hyperframes/studio 0.9.45 → 0.9.47
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-C7JtYIRD.js → hyperframes-player-DTdMXCCs.js} +1 -1
- package/dist/assets/{index-C7EGuz1n.js → index-CdtV6F8j.js} +121 -121
- package/dist/assets/index-DA5GM2Mj.js +469 -0
- package/dist/assets/pausedVideoDecoder-B4OsoiOL.js +1 -0
- package/dist/{chunk-FQ3VRKMC.js → chunk-5ZHKYODQ.js} +1 -0
- package/dist/index.d.ts +2 -2
- package/dist/index.html +1 -1
- package/dist/index.js +569 -534
- package/dist/{keys-CaWcxUST.d.ts → keys-B163OjLN.d.ts} +1 -0
- package/dist/keys.d.ts +1 -1
- package/dist/keys.js +1 -1
- package/package.json +9 -9
- package/src/captions/hooks/useCaptionSync.test.ts +45 -0
- package/src/captions/hooks/useCaptionSync.ts +8 -3
- package/src/hooks/gsapMutationClient.ts +6 -2
- package/src/hooks/useDomEditCommitsHelpers.test.ts +16 -0
- package/src/hooks/useDomEditCommitsHelpers.ts +3 -1
- package/src/hooks/useElementLifecycleOps.ts +1 -0
- package/src/hooks/useFreezeFrame.test.ts +9 -0
- package/src/hooks/useFreezeFrame.ts +3 -1
- package/src/hooks/useGroupCommits.ts +3 -0
- package/src/hooks/useTimelineDeleteOps.test.tsx +26 -0
- package/src/hooks/useTimelineDeleteOps.ts +3 -1
- package/src/player/components/ShortcutsPanel.test.tsx +75 -0
- package/src/player/components/ShortcutsPanel.tsx +20 -4
- package/src/player/components/studioKeyDefaults.ts +1 -0
- package/src/player/components/studioShortcuts.ts +1 -0
- package/src/player/lib/mediabunnyHevcSps.test.ts +169 -0
- package/src/utils/studioSaveDiagnostics.test.ts +10 -0
- package/src/utils/studioSaveDiagnostics.ts +10 -0
- package/src/utils/timelineCompositionInsert.ts +3 -1
- package/dist/assets/codec-DQ7n-U_9.js +0 -314
- package/dist/assets/index-CByWY7fK.js +0 -150
- package/dist/assets/pausedVideoDecoder-Bnvo9NIs.js +0 -1
package/dist/index.js
CHANGED
|
@@ -129,7 +129,7 @@ import {
|
|
|
129
129
|
formatCombo,
|
|
130
130
|
matchCombo,
|
|
131
131
|
parseCombo
|
|
132
|
-
} from "./chunk-
|
|
132
|
+
} from "./chunk-5ZHKYODQ.js";
|
|
133
133
|
import {
|
|
134
134
|
DOM_EDIT_LAYER_OBSERVER_INIT,
|
|
135
135
|
buildDefaultDomEditTextField,
|
|
@@ -391,7 +391,8 @@ function buildShortcutSections(keys) {
|
|
|
391
391
|
title: "Panels",
|
|
392
392
|
hints: [
|
|
393
393
|
{ key: k("tabCompositions"), label: "Compositions tab" },
|
|
394
|
-
{ key: k("tabAssets"), label: "Assets tab" }
|
|
394
|
+
{ key: k("tabAssets"), label: "Assets tab" },
|
|
395
|
+
{ key: k("shortcuts"), label: "Show / hide this panel" }
|
|
395
396
|
]
|
|
396
397
|
},
|
|
397
398
|
{
|
|
@@ -413,7 +414,7 @@ var DEFAULT_SHORTCUT_SECTIONS = buildShortcutSections(DEFAULT_STUDIO_KEYS);
|
|
|
413
414
|
import { useCallback as useCallback52, useRef as useRef61, useSyncExternalStore as useSyncExternalStore7 } from "react";
|
|
414
415
|
|
|
415
416
|
// src/player/components/PlayerControls.tsx
|
|
416
|
-
import { useRef as useRef4, useEffect as
|
|
417
|
+
import { useRef as useRef4, useEffect as useEffect4, memo as memo5 } from "react";
|
|
417
418
|
import gsap from "gsap";
|
|
418
419
|
import { MorphSVGPlugin } from "gsap/MorphSVGPlugin";
|
|
419
420
|
|
|
@@ -844,7 +845,7 @@ var useCompositionFps = () => useLinkedClipPreferences((s) => s.compositionFps);
|
|
|
844
845
|
var isLinkedSelectionOn = () => useLinkedClipPreferences.getState().linkedSelection;
|
|
845
846
|
|
|
846
847
|
// src/player/components/ShortcutsPanel.tsx
|
|
847
|
-
import { useState, useCallback, useRef, memo } from "react";
|
|
848
|
+
import { useState, useCallback, useEffect, useRef, memo } from "react";
|
|
848
849
|
|
|
849
850
|
// src/components/timelineToolbarStyles.ts
|
|
850
851
|
var flatBtn = "flex h-7 w-7 items-center justify-center rounded-md transition-colors";
|
|
@@ -852,9 +853,55 @@ var flatIdle = `${flatBtn} text-text-2 hover:bg-hover hover:text-text-0 active:b
|
|
|
852
853
|
var flatActive = `${flatBtn} bg-on text-text-0 hover:bg-on-hover active:scale-[0.98]`;
|
|
853
854
|
var flatDisabled = `${flatBtn} text-text-off cursor-not-allowed`;
|
|
854
855
|
|
|
856
|
+
// src/utils/typingTarget.ts
|
|
857
|
+
function isTypingTarget(target) {
|
|
858
|
+
const element = asElement(target);
|
|
859
|
+
if (!element) return false;
|
|
860
|
+
if (element.isContentEditable) return true;
|
|
861
|
+
return element.closest(TYPING_SELECTOR) !== null;
|
|
862
|
+
}
|
|
863
|
+
function ownsPlainKeys(target) {
|
|
864
|
+
return isTypingTarget(target) || asElement(target)?.closest(KEY_OWNING_CONTROLS) != null;
|
|
865
|
+
}
|
|
866
|
+
var KEY_OWNING_CONTROLS = "[role='slider'],video[controls],audio[controls]";
|
|
867
|
+
var TYPING_SELECTOR = [
|
|
868
|
+
"input",
|
|
869
|
+
"textarea",
|
|
870
|
+
"select",
|
|
871
|
+
"[contenteditable]:not([contenteditable='false'])",
|
|
872
|
+
"[role='textbox']",
|
|
873
|
+
"[role='searchbox']",
|
|
874
|
+
"[role='combobox']",
|
|
875
|
+
// A switch is a button in the DOM, but the native checkbox it replaces was an
|
|
876
|
+
// `input` and matched above. Without this row the shared Toggle would let a
|
|
877
|
+
// global shortcut claim Space instead of flipping the control (KTD13).
|
|
878
|
+
"[role='switch']",
|
|
879
|
+
"[role='dialog'][aria-modal='true']",
|
|
880
|
+
".cm-editor"
|
|
881
|
+
].join(",");
|
|
882
|
+
function asElement(target) {
|
|
883
|
+
if (!target || typeof target !== "object") return null;
|
|
884
|
+
const candidate = target;
|
|
885
|
+
return typeof candidate.closest === "function" ? target : null;
|
|
886
|
+
}
|
|
887
|
+
|
|
855
888
|
// src/player/components/ShortcutsPanel.tsx
|
|
856
889
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
857
890
|
var STAY_ABOVE = { side: "none", align: "shift", fallbackAxisSide: "none" };
|
|
891
|
+
function useShortcutsOpen() {
|
|
892
|
+
const [open2, setOpen] = useState(false);
|
|
893
|
+
useEffect(() => {
|
|
894
|
+
const onKeyDown = (e) => {
|
|
895
|
+
if (e.defaultPrevented || e.repeat || isTypingTarget(e.target)) return;
|
|
896
|
+
if (!matchesKey(e, "shortcuts")) return;
|
|
897
|
+
e.preventDefault();
|
|
898
|
+
setOpen((wasOpen) => !wasOpen);
|
|
899
|
+
};
|
|
900
|
+
document.addEventListener("keydown", onKeyDown);
|
|
901
|
+
return () => document.removeEventListener("keydown", onKeyDown);
|
|
902
|
+
}, []);
|
|
903
|
+
return [open2, setOpen];
|
|
904
|
+
}
|
|
858
905
|
var ShortcutsPanel = memo(function ShortcutsPanel2({
|
|
859
906
|
disabled,
|
|
860
907
|
duration,
|
|
@@ -866,7 +913,7 @@ var ShortcutsPanel = memo(function ShortcutsPanel2({
|
|
|
866
913
|
sections: hostSections
|
|
867
914
|
}) {
|
|
868
915
|
const sections = useShortcutSections(hostSections);
|
|
869
|
-
const [showShortcuts, setShowShortcuts] =
|
|
916
|
+
const [showShortcuts, setShowShortcuts] = useShortcutsOpen();
|
|
870
917
|
const [jumpFrame, setJumpFrame] = useState("");
|
|
871
918
|
const compositionFps2 = useCompositionFps();
|
|
872
919
|
const panelBodyRef = useRef(null);
|
|
@@ -891,7 +938,7 @@ var ShortcutsPanel = memo(function ShortcutsPanel2({
|
|
|
891
938
|
},
|
|
892
939
|
[commitJumpFrame]
|
|
893
940
|
);
|
|
894
|
-
return /* @__PURE__ */ jsx(Tooltip, { label: "Shortcuts and tools", children: /* @__PURE__ */ jsx(
|
|
941
|
+
return /* @__PURE__ */ jsx(Tooltip, { label: "Shortcuts and tools", disabled: showShortcuts, children: /* @__PURE__ */ jsx(
|
|
895
942
|
Popover,
|
|
896
943
|
{
|
|
897
944
|
open: showShortcuts,
|
|
@@ -1060,7 +1107,7 @@ function ShortcutsButton({ sections, disabled = false, onSeek }) {
|
|
|
1060
1107
|
import { useState as useState2, useCallback as useCallback3, memo as memo2 } from "react";
|
|
1061
1108
|
|
|
1062
1109
|
// src/hooks/useContextMenuDismiss.ts
|
|
1063
|
-
import { useCallback as useCallback2, useEffect, useRef as useRef2 } from "react";
|
|
1110
|
+
import { useCallback as useCallback2, useEffect as useEffect2, useRef as useRef2 } from "react";
|
|
1064
1111
|
function useContextMenuDismiss(onClose) {
|
|
1065
1112
|
const menuRef = useRef2(null);
|
|
1066
1113
|
const dismiss = useCallback2(
|
|
@@ -1074,7 +1121,7 @@ function useContextMenuDismiss(onClose) {
|
|
|
1074
1121
|
},
|
|
1075
1122
|
[onClose]
|
|
1076
1123
|
);
|
|
1077
|
-
|
|
1124
|
+
useEffect2(() => {
|
|
1078
1125
|
document.addEventListener("pointerdown", dismiss, true);
|
|
1079
1126
|
document.addEventListener("mousedown", dismiss, true);
|
|
1080
1127
|
document.addEventListener("keydown", dismiss);
|
|
@@ -1236,7 +1283,7 @@ var VolumeControl = memo3(function VolumeControl2({
|
|
|
1236
1283
|
});
|
|
1237
1284
|
|
|
1238
1285
|
// src/player/components/PreviewSeekBar.tsx
|
|
1239
|
-
import { memo as memo4, useEffect as
|
|
1286
|
+
import { memo as memo4, useEffect as useEffect3, useRef as useRef3 } from "react";
|
|
1240
1287
|
import { jsx as jsx4 } from "react/jsx-runtime";
|
|
1241
1288
|
var PreviewSeekBar = memo4(function PreviewSeekBar2({
|
|
1242
1289
|
duration,
|
|
@@ -1250,7 +1297,7 @@ var PreviewSeekBar = memo4(function PreviewSeekBar2({
|
|
|
1250
1297
|
settledRef.current = true;
|
|
1251
1298
|
onSeek(event.currentTarget.valueAsNumber, { settled: true });
|
|
1252
1299
|
};
|
|
1253
|
-
|
|
1300
|
+
useEffect3(() => {
|
|
1254
1301
|
const input = inputRef.current;
|
|
1255
1302
|
if (!input) return;
|
|
1256
1303
|
const updateTime = (time) => {
|
|
@@ -1297,7 +1344,7 @@ var PAUSE_BARS_D = "M56 28H67V71H56Z M73 28H84V71H73Z";
|
|
|
1297
1344
|
function PlayPauseMorphIcon({ playing }) {
|
|
1298
1345
|
const pathRef = useRef4(null);
|
|
1299
1346
|
const isFirstRun = useRef4(true);
|
|
1300
|
-
|
|
1347
|
+
useEffect4(() => {
|
|
1301
1348
|
const el = pathRef.current;
|
|
1302
1349
|
if (!el) return;
|
|
1303
1350
|
const target = playing ? PAUSE_BARS_D : PLAY_BLADE_D;
|
|
@@ -1426,7 +1473,7 @@ var PlayerControls = memo5(function PlayerControls2({
|
|
|
1426
1473
|
const durationRef = useRef4(duration);
|
|
1427
1474
|
durationRef.current = duration;
|
|
1428
1475
|
const controlsDisabled = disabled || !timelineReady;
|
|
1429
|
-
|
|
1476
|
+
useEffect4(() => {
|
|
1430
1477
|
if (!timeDisplayRef.current) return;
|
|
1431
1478
|
const t2 = currentTimeRef.current;
|
|
1432
1479
|
timeDisplayRef.current.textContent = timeDisplayMode === "frame" ? formatFrameTime(t2, duration, compositionFps()) : formatTime(t2);
|
|
@@ -1542,7 +1589,7 @@ import {
|
|
|
1542
1589
|
import { useRef as useRef26, useMemo as useMemo24, useCallback as useCallback22, useState as useState15 } from "react";
|
|
1543
1590
|
|
|
1544
1591
|
// src/hooks/useMusicBeatAnalysis.ts
|
|
1545
|
-
import { useEffect as
|
|
1592
|
+
import { useEffect as useEffect5, useMemo as useMemo2, useRef as useRef5 } from "react";
|
|
1546
1593
|
|
|
1547
1594
|
// src/utils/timelineInspector.ts
|
|
1548
1595
|
import { HF_AUDIO_GROUP_TAG } from "@hyperframes/core/audio-groups";
|
|
@@ -2061,7 +2108,7 @@ function useMusicBeatAnalysis() {
|
|
|
2061
2108
|
isFallbackTrack: resolved2?.isFallback ?? false
|
|
2062
2109
|
};
|
|
2063
2110
|
}, [elements]);
|
|
2064
|
-
|
|
2111
|
+
useEffect5(() => {
|
|
2065
2112
|
if (!musicSrc) {
|
|
2066
2113
|
setBeatAnalysis(null);
|
|
2067
2114
|
setBeatEdits(null);
|
|
@@ -2107,7 +2154,7 @@ function useMusicBeatAnalysis() {
|
|
|
2107
2154
|
cancelled = true;
|
|
2108
2155
|
};
|
|
2109
2156
|
}, [musicSrc, isFallbackTrack, setBeatAnalysis, setBeatEdits, resetBeatHistory]);
|
|
2110
|
-
|
|
2157
|
+
useEffect5(() => {
|
|
2111
2158
|
const beatPath = beatFilePathForSrc(musicSrc);
|
|
2112
2159
|
if (!musicSrc || !beatPath || !ioRef.current) {
|
|
2113
2160
|
setBeatPersist(null);
|
|
@@ -2217,7 +2264,7 @@ function getRenderedTimelineElement({
|
|
|
2217
2264
|
}
|
|
2218
2265
|
|
|
2219
2266
|
// src/player/components/useTimelinePlayhead.ts
|
|
2220
|
-
import { useRef as useRef6, useCallback as useCallback4, useEffect as
|
|
2267
|
+
import { useRef as useRef6, useCallback as useCallback4, useEffect as useEffect6, useLayoutEffect } from "react";
|
|
2221
2268
|
|
|
2222
2269
|
// src/player/components/timelineZoomInput.ts
|
|
2223
2270
|
import { useSyncExternalStore as useSyncExternalStore3 } from "react";
|
|
@@ -3608,7 +3655,7 @@ function useTimelinePlayhead({
|
|
|
3608
3655
|
},
|
|
3609
3656
|
[playheadRef, durationRef, ppsRef, contentOrigin]
|
|
3610
3657
|
);
|
|
3611
|
-
|
|
3658
|
+
useEffect6(() => {
|
|
3612
3659
|
syncPlayheadPosition(currentTime);
|
|
3613
3660
|
}, [currentTime, pps, syncPlayheadPosition, timelineReady, elementsLength]);
|
|
3614
3661
|
useLayoutEffect(() => {
|
|
@@ -3616,7 +3663,7 @@ function useTimelinePlayhead({
|
|
|
3616
3663
|
if (!scroll || zoomMode !== "fit") return;
|
|
3617
3664
|
scroll.scrollLeft = 0;
|
|
3618
3665
|
}, [zoomMode, pps, scrollRef]);
|
|
3619
|
-
|
|
3666
|
+
useEffect6(() => {
|
|
3620
3667
|
const scroll = scrollRef.current;
|
|
3621
3668
|
if (!scroll) {
|
|
3622
3669
|
previousZoomModeRef.current = zoomMode;
|
|
@@ -3728,7 +3775,7 @@ function useTimelinePlayhead({
|
|
|
3728
3775
|
},
|
|
3729
3776
|
[scrollRef, durationRef, fitPpsRef, ppsRef]
|
|
3730
3777
|
);
|
|
3731
|
-
|
|
3778
|
+
useEffect6(() => {
|
|
3732
3779
|
const scroll = scrollRef.current;
|
|
3733
3780
|
if (!scroll) return;
|
|
3734
3781
|
scroll.addEventListener("wheel", handlePinchWheel, { passive: false, capture: true });
|
|
@@ -3769,7 +3816,7 @@ function useTimelineZoom() {
|
|
|
3769
3816
|
}
|
|
3770
3817
|
|
|
3771
3818
|
// src/player/components/timelineDragDrop.ts
|
|
3772
|
-
import { useCallback as useCallback5, useEffect as
|
|
3819
|
+
import { useCallback as useCallback5, useEffect as useEffect7, useRef as useRef7, useState as useState4 } from "react";
|
|
3773
3820
|
|
|
3774
3821
|
// src/utils/timelineAssetDrop.ts
|
|
3775
3822
|
import { encodeUrlPath } from "@hyperframes/parsers";
|
|
@@ -4317,14 +4364,14 @@ function useTimelineAssetDrop({
|
|
|
4317
4364
|
sessionEpoch
|
|
4318
4365
|
]
|
|
4319
4366
|
);
|
|
4320
|
-
|
|
4367
|
+
useEffect7(() => {
|
|
4321
4368
|
window.addEventListener("dragend", clearDropPreview);
|
|
4322
4369
|
return () => {
|
|
4323
4370
|
window.removeEventListener("dragend", clearDropPreview);
|
|
4324
4371
|
clearDropPreview();
|
|
4325
4372
|
};
|
|
4326
4373
|
}, [clearDropPreview]);
|
|
4327
|
-
|
|
4374
|
+
useEffect7(() => clearDropPreview(), [clearDropPreview, sessionEpoch]);
|
|
4328
4375
|
return {
|
|
4329
4376
|
isDragOver,
|
|
4330
4377
|
dropPreview: dropPreview2,
|
|
@@ -4336,7 +4383,7 @@ function useTimelineAssetDrop({
|
|
|
4336
4383
|
}
|
|
4337
4384
|
|
|
4338
4385
|
// src/player/components/useTimelineClipDrag.ts
|
|
4339
|
-
import { useRef as useRef13, useState as useState8, useCallback as useCallback8, useMemo as useMemo7, useEffect as
|
|
4386
|
+
import { useRef as useRef13, useState as useState8, useCallback as useCallback8, useMemo as useMemo7, useEffect as useEffect12 } from "react";
|
|
4340
4387
|
|
|
4341
4388
|
// src/player/components/timelineRulerGeometry.ts
|
|
4342
4389
|
function getTimelineMajorTickInterval(duration, pixelsPerSecond, frameRate) {
|
|
@@ -4962,7 +5009,7 @@ function previewGroupResize(session, next, setResizeState) {
|
|
|
4962
5009
|
}
|
|
4963
5010
|
|
|
4964
5011
|
// src/player/components/timelineReadOnly.ts
|
|
4965
|
-
import { createContext as createContext2, useContext as useContext2, useEffect as
|
|
5012
|
+
import { createContext as createContext2, useContext as useContext2, useEffect as useEffect8, useEffectEvent } from "react";
|
|
4966
5013
|
var TimelineReadOnlyContext = createContext2(null);
|
|
4967
5014
|
function useTimelineReadOnlyPress() {
|
|
4968
5015
|
return useContext2(TimelineReadOnlyContext);
|
|
@@ -4982,7 +5029,7 @@ function refuseWhenReadOnly(readOnlyPress, callbacks) {
|
|
|
4982
5029
|
}
|
|
4983
5030
|
function useAbandonEditsOnReadOnly(readOnly, abandon) {
|
|
4984
5031
|
const abandonNow = useEffectEvent(abandon);
|
|
4985
|
-
|
|
5032
|
+
useEffect8(() => {
|
|
4986
5033
|
if (readOnly) abandonNow();
|
|
4987
5034
|
}, [readOnly]);
|
|
4988
5035
|
}
|
|
@@ -5513,7 +5560,7 @@ function synthesizeFlatTweenKeyframes(anim) {
|
|
|
5513
5560
|
}
|
|
5514
5561
|
|
|
5515
5562
|
// src/player/components/TimelineClipDiamonds.tsx
|
|
5516
|
-
import { memo as memo9, useEffect as
|
|
5563
|
+
import { memo as memo9, useEffect as useEffect11, useRef as useRef11, useState as useState7 } from "react";
|
|
5517
5564
|
|
|
5518
5565
|
// src/player/components/BeatStrip.tsx
|
|
5519
5566
|
import { memo as memo6, useSyncExternalStore as useSyncExternalStore4 } from "react";
|
|
@@ -5885,7 +5932,7 @@ function previewClipPct(opts) {
|
|
|
5885
5932
|
}
|
|
5886
5933
|
|
|
5887
5934
|
// src/components/editor/EaseCurveSection.tsx
|
|
5888
|
-
import { useEffect as
|
|
5935
|
+
import { useEffect as useEffect10, useId as useId2, useRef as useRef9, useState as useState6 } from "react";
|
|
5889
5936
|
import { evaluateSpringEase as evaluateSpringEase2, parseSpringBounce as parseSpringBounce3 } from "@hyperframes/core/spring-ease";
|
|
5890
5937
|
import {
|
|
5891
5938
|
evaluateWiggleEase as evaluateWiggleEase2,
|
|
@@ -6427,7 +6474,7 @@ function EaseModeToggle({
|
|
|
6427
6474
|
}
|
|
6428
6475
|
|
|
6429
6476
|
// src/components/editor/EaseParamFields.tsx
|
|
6430
|
-
import { useEffect as
|
|
6477
|
+
import { useEffect as useEffect9, useId, useRef as useRef8, useState as useState5 } from "react";
|
|
6431
6478
|
import { parseSpringBounce as parseSpringBounce2 } from "@hyperframes/core/spring-ease";
|
|
6432
6479
|
import {
|
|
6433
6480
|
parseWiggleEase as parseWiggleEase2
|
|
@@ -6458,7 +6505,7 @@ function EaseBezierField({
|
|
|
6458
6505
|
const inputRef = useRef8(null);
|
|
6459
6506
|
const errorId = useId();
|
|
6460
6507
|
const [error, setError] = useState5(null);
|
|
6461
|
-
|
|
6508
|
+
useEffect9(() => {
|
|
6462
6509
|
if (inputRef.current) inputRef.current.value = text3;
|
|
6463
6510
|
setError(null);
|
|
6464
6511
|
}, [text3]);
|
|
@@ -6531,7 +6578,7 @@ function NumericCommitInput({
|
|
|
6531
6578
|
onCommit
|
|
6532
6579
|
}) {
|
|
6533
6580
|
const [draft, setDraft] = useState5(String(value));
|
|
6534
|
-
|
|
6581
|
+
useEffect9(() => setDraft(String(value)), [value]);
|
|
6535
6582
|
const commit2 = () => {
|
|
6536
6583
|
if (draft.trim() === "") {
|
|
6537
6584
|
setDraft(String(value));
|
|
@@ -6665,7 +6712,7 @@ function EaseTypeDropdown({
|
|
|
6665
6712
|
const triggerRef = useRef9(null);
|
|
6666
6713
|
const menuRef = useRef9(null);
|
|
6667
6714
|
const menuId = useId2();
|
|
6668
|
-
|
|
6715
|
+
useEffect10(() => {
|
|
6669
6716
|
if (!open2) return;
|
|
6670
6717
|
const menu = menuRef.current;
|
|
6671
6718
|
const selected = menu?.querySelector('[role="menuitemradio"][aria-checked="true"]') ?? menu?.querySelector('[role="menuitemradio"]');
|
|
@@ -6847,7 +6894,7 @@ function EaseCurveSection({
|
|
|
6847
6894
|
const [hover, setHover] = useState6(null);
|
|
6848
6895
|
const draggingRef = useRef9(null);
|
|
6849
6896
|
const svgRef = useRef9(null);
|
|
6850
|
-
|
|
6897
|
+
useEffect10(() => {
|
|
6851
6898
|
setDraft(null);
|
|
6852
6899
|
const inFlight = inFlightEasesRef.current;
|
|
6853
6900
|
const landed = inFlight.indexOf(ease);
|
|
@@ -6859,7 +6906,7 @@ function EaseCurveSection({
|
|
|
6859
6906
|
inFlight.splice(0, landed + 1);
|
|
6860
6907
|
if (inFlight.length === 0) setPendingEase(null);
|
|
6861
6908
|
}, [ease]);
|
|
6862
|
-
|
|
6909
|
+
useEffect10(() => {
|
|
6863
6910
|
if (pendingEase === null) return;
|
|
6864
6911
|
const timer = setTimeout(() => {
|
|
6865
6912
|
inFlightEasesRef.current.length = 0;
|
|
@@ -8141,7 +8188,7 @@ var TimelineDiamondLane = memo9(function TimelineDiamondLane2({
|
|
|
8141
8188
|
const readOnlyPress = useTimelineReadOnlyPress();
|
|
8142
8189
|
const pendingRetimes = readPendingTimelineKeyframeRetimes(rootRef.current);
|
|
8143
8190
|
const [preview2, setPreview] = useState7(null);
|
|
8144
|
-
|
|
8191
|
+
useEffect11(() => {
|
|
8145
8192
|
const source = rootRef.current;
|
|
8146
8193
|
if (!source) return;
|
|
8147
8194
|
return subscribeTimelineKeyframeRetimePreview(source, (nextPreview) => {
|
|
@@ -9963,6 +10010,12 @@ function heldFileMessage(body, path) {
|
|
|
9963
10010
|
return null;
|
|
9964
10011
|
}
|
|
9965
10012
|
}
|
|
10013
|
+
async function heldFileWordsOf(response, path) {
|
|
10014
|
+
return heldFileMessage(
|
|
10015
|
+
await response.clone().text().catch(() => ""),
|
|
10016
|
+
path
|
|
10017
|
+
);
|
|
10018
|
+
}
|
|
9966
10019
|
async function createStudioSaveHttpError(response, fallbackMessage, options = {}) {
|
|
9967
10020
|
let body = "";
|
|
9968
10021
|
try {
|
|
@@ -10014,38 +10067,6 @@ async function retryStudioSave(operation, options = {}) {
|
|
|
10014
10067
|
throw new Error("Save retry loop exited unexpectedly");
|
|
10015
10068
|
}
|
|
10016
10069
|
|
|
10017
|
-
// src/utils/typingTarget.ts
|
|
10018
|
-
function isTypingTarget(target) {
|
|
10019
|
-
const element = asElement(target);
|
|
10020
|
-
if (!element) return false;
|
|
10021
|
-
if (element.isContentEditable) return true;
|
|
10022
|
-
return element.closest(TYPING_SELECTOR) !== null;
|
|
10023
|
-
}
|
|
10024
|
-
function ownsPlainKeys(target) {
|
|
10025
|
-
return isTypingTarget(target) || asElement(target)?.closest(KEY_OWNING_CONTROLS) != null;
|
|
10026
|
-
}
|
|
10027
|
-
var KEY_OWNING_CONTROLS = "[role='slider'],video[controls],audio[controls]";
|
|
10028
|
-
var TYPING_SELECTOR = [
|
|
10029
|
-
"input",
|
|
10030
|
-
"textarea",
|
|
10031
|
-
"select",
|
|
10032
|
-
"[contenteditable]:not([contenteditable='false'])",
|
|
10033
|
-
"[role='textbox']",
|
|
10034
|
-
"[role='searchbox']",
|
|
10035
|
-
"[role='combobox']",
|
|
10036
|
-
// A switch is a button in the DOM, but the native checkbox it replaces was an
|
|
10037
|
-
// `input` and matched above. Without this row the shared Toggle would let a
|
|
10038
|
-
// global shortcut claim Space instead of flipping the control (KTD13).
|
|
10039
|
-
"[role='switch']",
|
|
10040
|
-
"[role='dialog'][aria-modal='true']",
|
|
10041
|
-
".cm-editor"
|
|
10042
|
-
].join(",");
|
|
10043
|
-
function asElement(target) {
|
|
10044
|
-
if (!target || typeof target !== "object") return null;
|
|
10045
|
-
const candidate = target;
|
|
10046
|
-
return typeof candidate.closest === "function" ? target : null;
|
|
10047
|
-
}
|
|
10048
|
-
|
|
10049
10070
|
// src/utils/studioPendingEdits.ts
|
|
10050
10071
|
var STUDIO_FLUSH_PENDING_EDITS_EVENT = "hf-studio-flush-pending-edits";
|
|
10051
10072
|
var pendingEdits = /* @__PURE__ */ new Map();
|
|
@@ -11297,7 +11318,7 @@ function useTimelineClipDrag({
|
|
|
11297
11318
|
lifecycleRef
|
|
11298
11319
|
})
|
|
11299
11320
|
);
|
|
11300
|
-
|
|
11321
|
+
useEffect12(() => {
|
|
11301
11322
|
const movePickup = (drag, step, viewport2) => {
|
|
11302
11323
|
const audioTracks = getTimelineElementIndexes(elementsRef.current).audioTracks;
|
|
11303
11324
|
const row = nextKeyboardInsertRow({
|
|
@@ -11361,11 +11382,11 @@ function useTimelineClipDrag({
|
|
|
11361
11382
|
trackOrderRef,
|
|
11362
11383
|
trackInsertLayoutRef
|
|
11363
11384
|
]);
|
|
11364
|
-
|
|
11385
|
+
useEffect12(() => {
|
|
11365
11386
|
cancelGestureRef.current();
|
|
11366
11387
|
}, [sessionEpoch]);
|
|
11367
11388
|
const previousOrderRef = useRef13(trackOrderRef.current);
|
|
11368
|
-
|
|
11389
|
+
useEffect12(() => {
|
|
11369
11390
|
const order = trackOrderRef.current;
|
|
11370
11391
|
const previous = previousOrderRef.current;
|
|
11371
11392
|
previousOrderRef.current = order;
|
|
@@ -11651,7 +11672,7 @@ function useClipContextMenu(onSelectElement, dismissGapMenu, setClipContextMenu)
|
|
|
11651
11672
|
}
|
|
11652
11673
|
|
|
11653
11674
|
// src/player/components/useTimelineRangeSelection.ts
|
|
11654
|
-
import { useRef as useRef14, useState as useState10, useCallback as useCallback12, useEffect as
|
|
11675
|
+
import { useRef as useRef14, useState as useState10, useCallback as useCallback12, useEffect as useEffect13 } from "react";
|
|
11655
11676
|
|
|
11656
11677
|
// src/utils/marqueeGeometry.ts
|
|
11657
11678
|
function rectsOverlap(a, b) {
|
|
@@ -12259,7 +12280,7 @@ function useTimelineRangeSelection({
|
|
|
12259
12280
|
},
|
|
12260
12281
|
[cancelActiveGesture, isGestureSessionCurrent]
|
|
12261
12282
|
);
|
|
12262
|
-
|
|
12283
|
+
useEffect13(() => {
|
|
12263
12284
|
const onBandEscape = (e) => {
|
|
12264
12285
|
if (!matchesKey(e, "cancel") || !(marqueeRef.current || isRangeSelecting.current)) return;
|
|
12265
12286
|
e.preventDefault();
|
|
@@ -12283,12 +12304,12 @@ function useTimelineRangeSelection({
|
|
|
12283
12304
|
return () => listeners5.abort();
|
|
12284
12305
|
}, [cancelActiveGesture, isDragging]);
|
|
12285
12306
|
const previousSessionEpochRef = useRef14(sessionEpoch);
|
|
12286
|
-
|
|
12307
|
+
useEffect13(() => {
|
|
12287
12308
|
if (previousSessionEpochRef.current === sessionEpoch) return;
|
|
12288
12309
|
previousSessionEpochRef.current = sessionEpoch;
|
|
12289
12310
|
cancelActiveGesture(true, false);
|
|
12290
12311
|
}, [cancelActiveGesture, sessionEpoch]);
|
|
12291
|
-
|
|
12312
|
+
useEffect13(
|
|
12292
12313
|
() => () => {
|
|
12293
12314
|
cancelActiveGesture(false, isGestureSessionCurrent());
|
|
12294
12315
|
},
|
|
@@ -12307,14 +12328,14 @@ function useTimelineRangeSelection({
|
|
|
12307
12328
|
}
|
|
12308
12329
|
|
|
12309
12330
|
// src/player/components/usePublishRangeSelection.ts
|
|
12310
|
-
import { useEffect as
|
|
12331
|
+
import { useEffect as useEffect14, useRef as useRef15 } from "react";
|
|
12311
12332
|
function usePublishRangeSelection(rangeSelection, onRangeSelect) {
|
|
12312
12333
|
const onRangeSelectRef = useRef15(onRangeSelect);
|
|
12313
12334
|
const publishedRangeRef = useRef15(null);
|
|
12314
|
-
|
|
12335
|
+
useEffect14(() => {
|
|
12315
12336
|
onRangeSelectRef.current = onRangeSelect;
|
|
12316
12337
|
}, [onRangeSelect]);
|
|
12317
|
-
|
|
12338
|
+
useEffect14(() => {
|
|
12318
12339
|
const range = rangeSelection ? {
|
|
12319
12340
|
t0: Math.min(rangeSelection.start, rangeSelection.end),
|
|
12320
12341
|
t1: Math.max(rangeSelection.start, rangeSelection.end)
|
|
@@ -12326,7 +12347,7 @@ function usePublishRangeSelection(rangeSelection, onRangeSelect) {
|
|
|
12326
12347
|
usePlayerStore.setState({ rangeSelection: range });
|
|
12327
12348
|
onRangeSelectRef.current?.(range);
|
|
12328
12349
|
}, [rangeSelection]);
|
|
12329
|
-
|
|
12350
|
+
useEffect14(
|
|
12330
12351
|
() => () => {
|
|
12331
12352
|
const current2 = usePlayerStore.getState().rangeSelection;
|
|
12332
12353
|
const published = publishedRangeRef.current;
|
|
@@ -12338,7 +12359,7 @@ function usePublishRangeSelection(rangeSelection, onRangeSelect) {
|
|
|
12338
12359
|
}
|
|
12339
12360
|
|
|
12340
12361
|
// src/player/components/useTimelineSelectionLifecycle.ts
|
|
12341
|
-
import { useEffect as
|
|
12362
|
+
import { useEffect as useEffect15, useMemo as useMemo9, useRef as useRef16 } from "react";
|
|
12342
12363
|
function useTimelineSelectionLifecycle(elements, selectedElementId, setShowPopover, clearRangeSelection) {
|
|
12343
12364
|
const selectedElement = useMemo9(
|
|
12344
12365
|
() => elements.find((element) => getTimelineElementIdentity(element) === selectedElementId) ?? null,
|
|
@@ -12347,7 +12368,7 @@ function useTimelineSelectionLifecycle(elements, selectedElementId, setShowPopov
|
|
|
12347
12368
|
const selectedElementRef = useRef16(selectedElement);
|
|
12348
12369
|
selectedElementRef.current = selectedElement;
|
|
12349
12370
|
const previousSelectedRef = useRef16(selectedElementRef.current);
|
|
12350
|
-
|
|
12371
|
+
useEffect15(() => {
|
|
12351
12372
|
const previous = previousSelectedRef.current;
|
|
12352
12373
|
const current2 = selectedElementRef.current;
|
|
12353
12374
|
previousSelectedRef.current = current2;
|
|
@@ -12359,7 +12380,7 @@ function useTimelineSelectionLifecycle(elements, selectedElementId, setShowPopov
|
|
|
12359
12380
|
}
|
|
12360
12381
|
|
|
12361
12382
|
// src/player/components/useTrackGapMenu.ts
|
|
12362
|
-
import { useCallback as useCallback13, useEffect as
|
|
12383
|
+
import { useCallback as useCallback13, useEffect as useEffect16, useMemo as useMemo10, useState as useState11 } from "react";
|
|
12363
12384
|
|
|
12364
12385
|
// src/player/components/timelineGaps.ts
|
|
12365
12386
|
var TRACK_GAP_EPSILON_S = 1e-3;
|
|
@@ -12568,7 +12589,7 @@ function useTrackGapMenu({
|
|
|
12568
12589
|
setHoveredGapAction(null);
|
|
12569
12590
|
setGapContextMenu(null);
|
|
12570
12591
|
}, []);
|
|
12571
|
-
|
|
12592
|
+
useEffect16(() => {
|
|
12572
12593
|
if (gapContextMenu && gapContextMenu.sessionEpoch !== sessionEpoch) dismissGapMenu();
|
|
12573
12594
|
}, [dismissGapMenu, gapContextMenu, sessionEpoch]);
|
|
12574
12595
|
return {
|
|
@@ -13556,7 +13577,7 @@ function useTimelineStackingSync({
|
|
|
13556
13577
|
}
|
|
13557
13578
|
|
|
13558
13579
|
// src/player/components/useTimelineGeometry.ts
|
|
13559
|
-
import { useEffect as
|
|
13580
|
+
import { useEffect as useEffect17, useLayoutEffect as useLayoutEffect2, useRef as useRef19 } from "react";
|
|
13560
13581
|
function useTimelineGeometry({
|
|
13561
13582
|
viewportWidth,
|
|
13562
13583
|
effectiveDuration,
|
|
@@ -13589,7 +13610,7 @@ function useTimelineGeometry({
|
|
|
13589
13610
|
const zoomModeRef = useRef19(zoomMode);
|
|
13590
13611
|
zoomModeRef.current = zoomMode;
|
|
13591
13612
|
fitPpsRef.current = fitPps;
|
|
13592
|
-
|
|
13613
|
+
useEffect17(() => {
|
|
13593
13614
|
if (zoomMode !== "manual" || isDragging.current) return;
|
|
13594
13615
|
const el = scrollRef.current;
|
|
13595
13616
|
if (!el) return;
|
|
@@ -13602,7 +13623,7 @@ function useTimelineGeometry({
|
|
|
13602
13623
|
});
|
|
13603
13624
|
return () => cancelAnimationFrame(raf);
|
|
13604
13625
|
}, [expandedElements, zoomMode]);
|
|
13605
|
-
|
|
13626
|
+
useEffect17(() => {
|
|
13606
13627
|
usePlayerStore.getState().setTimelineScale(pps, fitPps);
|
|
13607
13628
|
}, [pps, fitPps]);
|
|
13608
13629
|
const hasClips = expandedElements.length > 0;
|
|
@@ -13625,7 +13646,7 @@ function useTimelineGeometry({
|
|
|
13625
13646
|
}
|
|
13626
13647
|
|
|
13627
13648
|
// src/player/components/useAutoExpandKeyframedClips.ts
|
|
13628
|
-
import { useEffect as
|
|
13649
|
+
import { useEffect as useEffect18, useRef as useRef20 } from "react";
|
|
13629
13650
|
function freshLaneClips(gsapAnimations, clips) {
|
|
13630
13651
|
for (const key2 of clips) {
|
|
13631
13652
|
if (!gsapAnimations.has(key2)) clips.delete(key2);
|
|
@@ -13641,7 +13662,7 @@ function useAutoExpandKeyframedClips(gsapAnimations) {
|
|
|
13641
13662
|
const expandClips = usePlayerStore((s) => s.expandClips);
|
|
13642
13663
|
const projectId = useStudioShellContextOptional()?.projectId ?? null;
|
|
13643
13664
|
const seen = useRef20({ projectId, source: gsapAnimations, clips: /* @__PURE__ */ new Set() });
|
|
13644
|
-
|
|
13665
|
+
useEffect18(() => {
|
|
13645
13666
|
if (seen.current.projectId !== projectId) {
|
|
13646
13667
|
const sourceChanged = seen.current.source !== gsapAnimations;
|
|
13647
13668
|
seen.current = { projectId, source: gsapAnimations, clips: /* @__PURE__ */ new Set() };
|
|
@@ -13679,7 +13700,7 @@ function useTimelineKeyframeData(showKeyframes) {
|
|
|
13679
13700
|
}
|
|
13680
13701
|
|
|
13681
13702
|
// src/player/components/useTimelineScrollViewport.ts
|
|
13682
|
-
import { useCallback as useCallback17, useEffect as
|
|
13703
|
+
import { useCallback as useCallback17, useEffect as useEffect19, useRef as useRef21, useState as useState12 } from "react";
|
|
13683
13704
|
|
|
13684
13705
|
// src/player/components/timelineRowVirtualizationFlag.ts
|
|
13685
13706
|
var STUDIO_TIMELINE_ROW_VIRTUALIZATION_ENABLED = import.meta.env?.VITE_STUDIO_TIMELINE_ROW_VIRTUALIZATION_ENABLED !== "0";
|
|
@@ -13778,7 +13799,7 @@ function useTimelineScrollViewport(scrollRef, resyncShortcutHintOn) {
|
|
|
13778
13799
|
if (viewportRafRef.current) cancelAnimationFrame(viewportRafRef.current);
|
|
13779
13800
|
if (scrollSettledTimerRef.current) clearTimeout(scrollSettledTimerRef.current);
|
|
13780
13801
|
});
|
|
13781
|
-
|
|
13802
|
+
useEffect19(() => {
|
|
13782
13803
|
syncShortcutHintVisibility();
|
|
13783
13804
|
}, [syncShortcutHintVisibility, ...resyncShortcutHintOn]);
|
|
13784
13805
|
return { viewport: viewport2, showShortcutHint, setScrollRef, syncScrollViewport };
|
|
@@ -14248,7 +14269,7 @@ function useTimelineLaneMoveRefresh() {
|
|
|
14248
14269
|
}
|
|
14249
14270
|
|
|
14250
14271
|
// src/player/components/useTimelineFocusCoordinator.ts
|
|
14251
|
-
import { useEffect as
|
|
14272
|
+
import { useEffect as useEffect20, useLayoutEffect as useLayoutEffect4, useMemo as useMemo20, useRef as useRef24 } from "react";
|
|
14252
14273
|
|
|
14253
14274
|
// src/player/components/timelineRevealScroll.ts
|
|
14254
14275
|
var REVEAL_SCROLL_PADDING_PX = 12;
|
|
@@ -14387,7 +14408,7 @@ function useTimelineFocusCoordinator({
|
|
|
14387
14408
|
useLayoutEffect4(() => {
|
|
14388
14409
|
previousRowsRef.current = logicalRows;
|
|
14389
14410
|
}, [logicalRows]);
|
|
14390
|
-
|
|
14411
|
+
useEffect20(() => {
|
|
14391
14412
|
if (!isCurrentRequest(request2, projectId, sessionEpoch)) return;
|
|
14392
14413
|
if (!resolution) {
|
|
14393
14414
|
const withinBudget = recordRetryAttempt(
|
|
@@ -14530,7 +14551,7 @@ function resolveTimelineFocusIdentity(elements, elementId2) {
|
|
|
14530
14551
|
}
|
|
14531
14552
|
|
|
14532
14553
|
// src/player/components/useTimelineVirtualRows.ts
|
|
14533
|
-
import { useCallback as useCallback20, useEffect as
|
|
14554
|
+
import { useCallback as useCallback20, useEffect as useEffect21, useMemo as useMemo22 } from "react";
|
|
14534
14555
|
import { defaultRangeExtractor, useVirtualizer } from "@tanstack/react-virtual";
|
|
14535
14556
|
function extractTimelineVirtualRowRange(range, pinnedRowIndexes) {
|
|
14536
14557
|
const indexes = new Set(defaultRangeExtractor(range));
|
|
@@ -14593,14 +14614,14 @@ function useTimelineVirtualRows({
|
|
|
14593
14614
|
initialRect: { width: viewport2.clientWidth, height: viewport2.clientHeight },
|
|
14594
14615
|
initialOffset
|
|
14595
14616
|
});
|
|
14596
|
-
|
|
14617
|
+
useEffect21(() => {
|
|
14597
14618
|
if (!enabled || !viewportReady) return;
|
|
14598
14619
|
virtualizer.measure();
|
|
14599
14620
|
scrollRef.current?.dispatchEvent(new Event("scroll"));
|
|
14600
14621
|
}, [enabled, scrollRef, sessionEpoch, viewportReady, virtualizer]);
|
|
14601
14622
|
const focusedRowIndex = focusedRowKey === void 0 ? -1 : rowGeometry.getRowIndex(focusedRowKey);
|
|
14602
14623
|
const focusedRowHeight = focusedRowIndex < 0 ? 0 : rowGeometry.getRowHeight(focusedRowIndex);
|
|
14603
|
-
|
|
14624
|
+
useEffect21(() => {
|
|
14604
14625
|
if (enabled && viewportReady && focusedRowIndex >= 0) {
|
|
14605
14626
|
virtualizer.resizeItem(focusedRowIndex, focusedRowHeight);
|
|
14606
14627
|
}
|
|
@@ -15698,7 +15719,7 @@ import { memo as memo14 } from "react";
|
|
|
15698
15719
|
// src/player/components/TimelineClipFades.tsx
|
|
15699
15720
|
import {
|
|
15700
15721
|
createContext as createContext4,
|
|
15701
|
-
useEffect as
|
|
15722
|
+
useEffect as useEffect22,
|
|
15702
15723
|
useLayoutEffect as useLayoutEffect7,
|
|
15703
15724
|
useMemo as useMemo25,
|
|
15704
15725
|
useRef as useRef29,
|
|
@@ -15959,7 +15980,7 @@ function TimelineClipFades({
|
|
|
15959
15980
|
setDraft({ edge, seconds });
|
|
15960
15981
|
onSetElementAttributeLive?.(el, attrFor(edge), attrText(seconds));
|
|
15961
15982
|
};
|
|
15962
|
-
|
|
15983
|
+
useEffect22(() => {
|
|
15963
15984
|
if (dragging === null) return;
|
|
15964
15985
|
const cancelOnWindowEscape = (e) => {
|
|
15965
15986
|
const g = gesture.current;
|
|
@@ -16181,7 +16202,7 @@ function FadeHandle({
|
|
|
16181
16202
|
}
|
|
16182
16203
|
|
|
16183
16204
|
// src/player/components/AudioWaveform.tsx
|
|
16184
|
-
import { memo as memo11, useCallback as useCallback27, useContext as useContext7, useEffect as
|
|
16205
|
+
import { memo as memo11, useCallback as useCallback27, useContext as useContext7, useEffect as useEffect23, useMemo as useMemo26, useRef as useRef31, useState as useState18 } from "react";
|
|
16185
16206
|
import { fadeGain } from "@hyperframes/core/audio-fade";
|
|
16186
16207
|
|
|
16187
16208
|
// src/hooks/useThumbnailLease.ts
|
|
@@ -16528,7 +16549,7 @@ var nearScreenListeners = /* @__PURE__ */ new Map();
|
|
|
16528
16549
|
var nearScreen = null;
|
|
16529
16550
|
function useNearScreen(element) {
|
|
16530
16551
|
const [near4, setNear] = useState18(() => typeof IntersectionObserver === "undefined");
|
|
16531
|
-
|
|
16552
|
+
useEffect23(() => {
|
|
16532
16553
|
if (!element || typeof IntersectionObserver === "undefined") return;
|
|
16533
16554
|
nearScreen ??= new IntersectionObserver(
|
|
16534
16555
|
(entries) => entries.forEach((entry3) => nearScreenListeners.get(entry3.target)?.(entry3.isIntersecting)),
|
|
@@ -16601,10 +16622,10 @@ var AudioWaveform = memo11(function AudioWaveform2({
|
|
|
16601
16622
|
);
|
|
16602
16623
|
}, [fades, from, muted, peaks, to, trimEndFraction, trimStartFraction]);
|
|
16603
16624
|
const near4 = useNearScreen(root);
|
|
16604
|
-
|
|
16625
|
+
useEffect23(() => {
|
|
16605
16626
|
if (near4) draw();
|
|
16606
16627
|
}, [draw, near4, strip.width, strip.height]);
|
|
16607
|
-
|
|
16628
|
+
useEffect23(() => {
|
|
16608
16629
|
const root2 = document.documentElement;
|
|
16609
16630
|
const observer = new MutationObserver(draw);
|
|
16610
16631
|
observer.observe(root2, {
|
|
@@ -16613,7 +16634,7 @@ var AudioWaveform = memo11(function AudioWaveform2({
|
|
|
16613
16634
|
});
|
|
16614
16635
|
return () => observer.disconnect();
|
|
16615
16636
|
}, [draw]);
|
|
16616
|
-
|
|
16637
|
+
useEffect23(() => {
|
|
16617
16638
|
const clip = root?.closest(".timeline-clip");
|
|
16618
16639
|
if (!(clip instanceof HTMLElement)) return;
|
|
16619
16640
|
if (muted) clip.setAttribute("data-audio-muted", "true");
|
|
@@ -16946,7 +16967,7 @@ function readClipEffects(state) {
|
|
|
16946
16967
|
}
|
|
16947
16968
|
|
|
16948
16969
|
// src/player/components/useClipToolState.ts
|
|
16949
|
-
import { useEffect as
|
|
16970
|
+
import { useEffect as useEffect24, useState as useState19 } from "react";
|
|
16950
16971
|
import { HF_AUDIO_AUTOMATION_ATTR } from "@hyperframes/core/audio-automation";
|
|
16951
16972
|
import { HF_AUDIO_CARVE_ATTR } from "@hyperframes/core/audio-carve";
|
|
16952
16973
|
import { HF_AUDIO_FX_ATTR } from "@hyperframes/core/audio-fx";
|
|
@@ -18010,7 +18031,9 @@ async function rollbackOwnedMutation(projectId, targetPath, expected, restore2)
|
|
|
18010
18031
|
}
|
|
18011
18032
|
);
|
|
18012
18033
|
if (!response.ok) {
|
|
18013
|
-
throw new Error(
|
|
18034
|
+
throw new Error(
|
|
18035
|
+
await heldFileWordsOf(response, targetPath) ?? `Failed to restore ${targetPath}`
|
|
18036
|
+
);
|
|
18014
18037
|
}
|
|
18015
18038
|
const result = await response.json();
|
|
18016
18039
|
if (result.restored === true && result.conflict === false) return "restored";
|
|
@@ -18054,9 +18077,10 @@ async function postOwnedGsapMutation(route, projectId, filePath, body, fallback)
|
|
|
18054
18077
|
cause: error
|
|
18055
18078
|
});
|
|
18056
18079
|
}
|
|
18080
|
+
const held = response.ok ? null : await heldFileWordsOf(response, filePath);
|
|
18057
18081
|
const payload = await response.json().catch(() => null);
|
|
18058
18082
|
if (!response.ok) {
|
|
18059
|
-
throw new GsapPreviewConvergenceError(readMutationError(payload, fallback));
|
|
18083
|
+
throw new GsapPreviewConvergenceError(held ?? readMutationError(payload, fallback));
|
|
18060
18084
|
}
|
|
18061
18085
|
return readMutationStatus(payload);
|
|
18062
18086
|
}
|
|
@@ -18985,7 +19009,7 @@ function useClipToolState(el) {
|
|
|
18985
19009
|
const iframe = useLivePreviewIframe();
|
|
18986
19010
|
const activeCompPath = useStudioShellContextOptional()?.activeCompPath ?? null;
|
|
18987
19011
|
const [state, setState] = useState19(() => toolStateFromElement(el));
|
|
18988
|
-
|
|
19012
|
+
useEffect24(() => {
|
|
18989
19013
|
const node = findTimelineElementInIframe(iframe, el, activeCompPath);
|
|
18990
19014
|
if (!node) {
|
|
18991
19015
|
setState(toolStateFromElement(el));
|
|
@@ -19097,9 +19121,9 @@ import { createPortal } from "react-dom";
|
|
|
19097
19121
|
import { formatSyncOffset } from "@hyperframes/core/media-link";
|
|
19098
19122
|
|
|
19099
19123
|
// src/player/components/menuKeyboardNav.ts
|
|
19100
|
-
import { useEffect as
|
|
19124
|
+
import { useEffect as useEffect25 } from "react";
|
|
19101
19125
|
function useMenuKeyboardNav(menuRef) {
|
|
19102
|
-
|
|
19126
|
+
useEffect25(() => {
|
|
19103
19127
|
const menu = menuRef.current;
|
|
19104
19128
|
if (!menu) return;
|
|
19105
19129
|
const previouslyFocused = document.activeElement;
|
|
@@ -19787,13 +19811,13 @@ function TimelineCompactDiamonds({
|
|
|
19787
19811
|
}
|
|
19788
19812
|
|
|
19789
19813
|
// src/player/components/TimelineAutomationLaneSlot.tsx
|
|
19790
|
-
import { useEffect as
|
|
19814
|
+
import { useEffect as useEffect27, useMemo as useMemo28 } from "react";
|
|
19791
19815
|
import { resolveAutomationRange as resolveAutomationRange3 } from "@hyperframes/core/audio-automation";
|
|
19792
19816
|
|
|
19793
19817
|
// src/player/components/TimelineAutomationLane.tsx
|
|
19794
19818
|
import {
|
|
19795
19819
|
useCallback as useCallback33,
|
|
19796
|
-
useEffect as
|
|
19820
|
+
useEffect as useEffect26,
|
|
19797
19821
|
useMemo as useMemo27,
|
|
19798
19822
|
useRef as useRef36,
|
|
19799
19823
|
useState as useState26
|
|
@@ -21048,7 +21072,7 @@ function TimelineAutomationLane({
|
|
|
21048
21072
|
() => draft ? { target, points: draft.points } : stored,
|
|
21049
21073
|
[draft, target, stored]
|
|
21050
21074
|
);
|
|
21051
|
-
|
|
21075
|
+
useEffect26(() => {
|
|
21052
21076
|
setDraft(null);
|
|
21053
21077
|
}, [target]);
|
|
21054
21078
|
const h = AUTOMATION_LANE_H;
|
|
@@ -21123,7 +21147,7 @@ function TimelineAutomationLane({
|
|
|
21123
21147
|
editing
|
|
21124
21148
|
} = gestures;
|
|
21125
21149
|
const gestureLive = [dragIndex, curveIndex, segmentDragIndex, edgeDrag].some((g) => g !== null);
|
|
21126
|
-
|
|
21150
|
+
useEffect26(() => {
|
|
21127
21151
|
if (draft && draft.basedOn !== automation && !gestureLive) setDraft(null);
|
|
21128
21152
|
}, [automation, draft, gestureLive]);
|
|
21129
21153
|
const removeAt = useCallback33(
|
|
@@ -21373,7 +21397,7 @@ function ClipAutomationLanes({
|
|
|
21373
21397
|
[beatTimes, element.start, element.duration]
|
|
21374
21398
|
);
|
|
21375
21399
|
const bound = lanes.bind(element, isSelected2);
|
|
21376
|
-
|
|
21400
|
+
useEffect27(() => {
|
|
21377
21401
|
const target = bound.selection?.target;
|
|
21378
21402
|
if (target !== void 0 && !bound.lanes.some((lane) => lane.target === target)) {
|
|
21379
21403
|
bound.onRangeClear();
|
|
@@ -21582,7 +21606,7 @@ function useAutomationLanes() {
|
|
|
21582
21606
|
}
|
|
21583
21607
|
|
|
21584
21608
|
// src/hooks/useAutomationSelectionKeyboard.ts
|
|
21585
|
-
import { useEffect as
|
|
21609
|
+
import { useEffect as useEffect28 } from "react";
|
|
21586
21610
|
|
|
21587
21611
|
// src/player/components/automationClipboard.ts
|
|
21588
21612
|
import {
|
|
@@ -21962,7 +21986,7 @@ function handleDelete(e, state, lanes, sel) {
|
|
|
21962
21986
|
function useAutomationSelectionKeyboard({
|
|
21963
21987
|
lanes
|
|
21964
21988
|
}) {
|
|
21965
|
-
|
|
21989
|
+
useEffect28(() => {
|
|
21966
21990
|
const handler = (e) => {
|
|
21967
21991
|
if (isTypingTarget(document.activeElement)) return;
|
|
21968
21992
|
if (e.defaultPrevented) return;
|
|
@@ -22282,7 +22306,7 @@ function carverAgainst(doc, id) {
|
|
|
22282
22306
|
}
|
|
22283
22307
|
|
|
22284
22308
|
// src/player/components/TimelineFxButton.tsx
|
|
22285
|
-
import { useEffect as
|
|
22309
|
+
import { useEffect as useEffect31, useRef as useRef41, useState as useState27 } from "react";
|
|
22286
22310
|
import { createPortal as createPortal3 } from "react-dom";
|
|
22287
22311
|
import {
|
|
22288
22312
|
enabledAudioFxNodes,
|
|
@@ -22290,7 +22314,7 @@ import {
|
|
|
22290
22314
|
} from "@hyperframes/core/audio-fx";
|
|
22291
22315
|
|
|
22292
22316
|
// src/components/editor/TimelineFxPopover.tsx
|
|
22293
|
-
import { useEffect as
|
|
22317
|
+
import { useEffect as useEffect30, useRef as useRef39 } from "react";
|
|
22294
22318
|
import { applyAudioFxPreset as applyAudioFxPreset2, getAudioFxPreset as getAudioFxPreset3 } from "@hyperframes/core/audio-fx-presets";
|
|
22295
22319
|
|
|
22296
22320
|
// src/components/editor/propertyPanelFxPresetMenu.tsx
|
|
@@ -22370,7 +22394,7 @@ function FxPresetMenu({
|
|
|
22370
22394
|
}
|
|
22371
22395
|
|
|
22372
22396
|
// src/components/editor/useFxAudition.ts
|
|
22373
|
-
import { useCallback as useCallback35, useEffect as
|
|
22397
|
+
import { useCallback as useCallback35, useEffect as useEffect29, useRef as useRef38 } from "react";
|
|
22374
22398
|
function useFxAudition(chain, onChainPreview, onAuditionTransport) {
|
|
22375
22399
|
const auditionBase = useRef38(null);
|
|
22376
22400
|
const audition = useCallback35(
|
|
@@ -22397,7 +22421,7 @@ function useFxAudition(chain, onChainPreview, onAuditionTransport) {
|
|
|
22397
22421
|
previewRef.current = onChainPreview;
|
|
22398
22422
|
const transportRef = useRef38(onAuditionTransport);
|
|
22399
22423
|
transportRef.current = onAuditionTransport;
|
|
22400
|
-
|
|
22424
|
+
useEffect29(
|
|
22401
22425
|
() => () => {
|
|
22402
22426
|
if (auditionBase.current) {
|
|
22403
22427
|
transportRef.current?.(false);
|
|
@@ -22459,7 +22483,7 @@ function TimelineFxPopover({
|
|
|
22459
22483
|
onChainPreview,
|
|
22460
22484
|
onAuditionTransport
|
|
22461
22485
|
);
|
|
22462
|
-
|
|
22486
|
+
useEffect30(() => {
|
|
22463
22487
|
const onPointerDown = (event) => {
|
|
22464
22488
|
if (rootRef.current && !rootRef.current.contains(event.target)) onClose();
|
|
22465
22489
|
};
|
|
@@ -22607,7 +22631,7 @@ function GroupNameDialog({
|
|
|
22607
22631
|
}) {
|
|
22608
22632
|
const [label, setLabel] = useState27(defaultLabel ?? "Voiceover");
|
|
22609
22633
|
const inputRef = useRef41(null);
|
|
22610
|
-
|
|
22634
|
+
useEffect31(() => inputRef.current?.select(), []);
|
|
22611
22635
|
if (refusal2) {
|
|
22612
22636
|
return /* @__PURE__ */ jsx50(
|
|
22613
22637
|
"div",
|
|
@@ -23788,7 +23812,7 @@ function TimelineGroupHeader({
|
|
|
23788
23812
|
import { sampleAutomationLane as sampleAutomationLane7 } from "@hyperframes/core/audio-automation";
|
|
23789
23813
|
|
|
23790
23814
|
// src/hooks/useLivePlayheadTime.ts
|
|
23791
|
-
import { useEffect as
|
|
23815
|
+
import { useEffect as useEffect32, useRef as useRef42, useState as useState28 } from "react";
|
|
23792
23816
|
var THROTTLE_MS = 33;
|
|
23793
23817
|
function useLivePlayheadTime() {
|
|
23794
23818
|
const storeTime = usePlayerStore((s) => s.currentTime);
|
|
@@ -23796,7 +23820,7 @@ function useLivePlayheadTime() {
|
|
|
23796
23820
|
const liveRef = useRef42(storeTime);
|
|
23797
23821
|
const [, forceRender] = useState28(0);
|
|
23798
23822
|
if (!isPlaying) liveRef.current = storeTime;
|
|
23799
|
-
|
|
23823
|
+
useEffect32(() => {
|
|
23800
23824
|
if (!isPlaying) return;
|
|
23801
23825
|
let timerId = 0;
|
|
23802
23826
|
const unsubscribe = liveTime.subscribe((t2) => {
|
|
@@ -25050,7 +25074,7 @@ var TimelineCanvas = memo18(function TimelineCanvas2() {
|
|
|
25050
25074
|
});
|
|
25051
25075
|
|
|
25052
25076
|
// src/player/components/AudioGainDialog.tsx
|
|
25053
|
-
import { useEffect as
|
|
25077
|
+
import { useEffect as useEffect33, useMemo as useMemo33, useState as useState29 } from "react";
|
|
25054
25078
|
import { createPortal as createPortal4 } from "react-dom";
|
|
25055
25079
|
import { audioGainToDb as audioGainToDb2 } from "@hyperframes/core/audio-gain";
|
|
25056
25080
|
|
|
@@ -25389,7 +25413,7 @@ var currentGainDb = (el) => {
|
|
|
25389
25413
|
var dbText = (db) => `${db < 0 ? "\u2212" : ""}${Math.abs(db).toFixed(1)} dB`;
|
|
25390
25414
|
function useSourcePeaks(elements, projectId) {
|
|
25391
25415
|
const [peaks, setPeaks] = useState29(null);
|
|
25392
|
-
|
|
25416
|
+
useEffect33(() => {
|
|
25393
25417
|
if (!projectId) return;
|
|
25394
25418
|
let live = true;
|
|
25395
25419
|
void Promise.all(elements.map((el) => measureClipSourcePeak(el, projectId))).then((found) => {
|
|
@@ -25582,7 +25606,7 @@ function TimelineAudioGainOverlay() {
|
|
|
25582
25606
|
}
|
|
25583
25607
|
|
|
25584
25608
|
// src/player/components/TimelineOverlays.tsx
|
|
25585
|
-
import { useEffect as
|
|
25609
|
+
import { useEffect as useEffect35, useMemo as useMemo35 } from "react";
|
|
25586
25610
|
|
|
25587
25611
|
// src/player/components/EditModal.tsx
|
|
25588
25612
|
import { useState as useState30, useCallback as useCallback36, useMemo as useMemo34, useRef as useRef44 } from "react";
|
|
@@ -25941,7 +25965,7 @@ import { memo as memo19, useLayoutEffect as useLayoutEffect9, useState as useSta
|
|
|
25941
25965
|
import { createPortal as createPortal7 } from "react-dom";
|
|
25942
25966
|
|
|
25943
25967
|
// src/player/components/clipMenuToolItems.tsx
|
|
25944
|
-
import { useEffect as
|
|
25968
|
+
import { useEffect as useEffect34, useRef as useRef45, useState as useState32 } from "react";
|
|
25945
25969
|
import { HF_AUDIO_FX_ATTR as HF_AUDIO_FX_ATTR4 } from "@hyperframes/core/audio-fx";
|
|
25946
25970
|
import { HF_COLOR_GRADING_ATTR as HF_COLOR_GRADING_ATTR2 } from "@hyperframes/core/color-grading";
|
|
25947
25971
|
import { Fragment as Fragment19, jsx as jsx67, jsxs as jsxs43 } from "react/jsx-runtime";
|
|
@@ -25978,7 +26002,7 @@ function useHoverPreview(preview2) {
|
|
|
25978
26002
|
previewRef.current?.apply(id);
|
|
25979
26003
|
}, HOVER_PREVIEW_DELAY_MS);
|
|
25980
26004
|
};
|
|
25981
|
-
|
|
26005
|
+
useEffect34(() => end, []);
|
|
25982
26006
|
return { start, end, settle };
|
|
25983
26007
|
}
|
|
25984
26008
|
function focusSibling(menu, step) {
|
|
@@ -27568,7 +27592,7 @@ function TimelineKeyframeMenuOverlay() {
|
|
|
27568
27592
|
selectedElementId,
|
|
27569
27593
|
elements: overlay.elements
|
|
27570
27594
|
}) : null;
|
|
27571
|
-
|
|
27595
|
+
useEffect35(() => {
|
|
27572
27596
|
if (kfContextMenu && !element) setKfContextMenu(null);
|
|
27573
27597
|
}, [element, kfContextMenu, setKfContextMenu]);
|
|
27574
27598
|
if (!kfContextMenu || !element) return null;
|
|
@@ -27636,7 +27660,7 @@ function TimelineClipMenuOverlay() {
|
|
|
27636
27660
|
selectedElementId,
|
|
27637
27661
|
elements: overlay.elements
|
|
27638
27662
|
}) : null;
|
|
27639
|
-
|
|
27663
|
+
useEffect35(() => {
|
|
27640
27664
|
if (clipContextMenu && !element) setClipContextMenu(null);
|
|
27641
27665
|
}, [element, clipContextMenu, setClipContextMenu]);
|
|
27642
27666
|
const { clipMenuItems } = overlay;
|
|
@@ -28882,7 +28906,7 @@ var CompositionThumbnail = memo23(function CompositionThumbnail2({
|
|
|
28882
28906
|
});
|
|
28883
28907
|
|
|
28884
28908
|
// src/player/hooks/useTimelinePlayer.ts
|
|
28885
|
-
import { useRef as useRef50, useCallback as useCallback42, useEffect as
|
|
28909
|
+
import { useRef as useRef50, useCallback as useCallback42, useEffect as useEffect37 } from "react";
|
|
28886
28910
|
|
|
28887
28911
|
// src/player/hooks/usePlaybackKeyboard.ts
|
|
28888
28912
|
import { useRef as useRef46, useCallback as useCallback37 } from "react";
|
|
@@ -32656,21 +32680,21 @@ function createPreviewMessageHandler(deps) {
|
|
|
32656
32680
|
}
|
|
32657
32681
|
|
|
32658
32682
|
// src/player/hooks/usePreviewQualityForwarding.ts
|
|
32659
|
-
import { useEffect as
|
|
32683
|
+
import { useEffect as useEffect36 } from "react";
|
|
32660
32684
|
function usePreviewQualityForwarding(iframeRef) {
|
|
32661
32685
|
const level = usePlayerStore((state) => state.previewQuality);
|
|
32662
32686
|
const retries = usePlayerStore((state) => state.previewCopiesRetry);
|
|
32663
|
-
|
|
32687
|
+
useEffect36(() => {
|
|
32664
32688
|
const frame3 = iframeRef.current;
|
|
32665
32689
|
if (frame3) postRuntimeControlMessage(frame3.contentWindow, "set-preview-quality", { level });
|
|
32666
32690
|
}, [iframeRef, level]);
|
|
32667
32691
|
const factsRequests = usePlayerStore((state) => state.previewFactsRequests);
|
|
32668
|
-
|
|
32692
|
+
useEffect36(() => {
|
|
32669
32693
|
const frame3 = iframeRef.current;
|
|
32670
32694
|
if (frame3 && factsRequests > 0)
|
|
32671
32695
|
postRuntimeControlMessage(frame3.contentWindow, "request-preview-facts");
|
|
32672
32696
|
}, [iframeRef, factsRequests]);
|
|
32673
|
-
|
|
32697
|
+
useEffect36(() => {
|
|
32674
32698
|
const frame3 = iframeRef.current;
|
|
32675
32699
|
if (frame3 && retries > 0)
|
|
32676
32700
|
postRuntimeControlMessage(frame3.contentWindow, "retry-preview-copies");
|
|
@@ -32965,13 +32989,13 @@ function useTimelinePlayer({
|
|
|
32965
32989
|
shuttleSpeedIndexRef
|
|
32966
32990
|
]
|
|
32967
32991
|
);
|
|
32968
|
-
|
|
32992
|
+
useEffect37(
|
|
32969
32993
|
() => usePlayerStore.subscribe((state, prev) => {
|
|
32970
32994
|
if (state.playLocked && !prev.playLocked && state.isPlaying) pause();
|
|
32971
32995
|
}),
|
|
32972
32996
|
[pause]
|
|
32973
32997
|
);
|
|
32974
|
-
|
|
32998
|
+
useEffect37(() => {
|
|
32975
32999
|
return usePlayerStore.subscribe((state, prev) => {
|
|
32976
33000
|
if (state.requestedSeekTime !== null && state.requestedSeekTime !== prev.requestedSeekTime) {
|
|
32977
33001
|
seek(state.requestedSeekTime);
|
|
@@ -32988,7 +33012,7 @@ function useTimelinePlayer({
|
|
|
32988
33012
|
}
|
|
32989
33013
|
});
|
|
32990
33014
|
}, [seek, play, pause]);
|
|
32991
|
-
|
|
33015
|
+
useEffect37(() => subscribePreviewFrame(getAdapter), [getAdapter]);
|
|
32992
33016
|
const { playbackKeyDownRef, playbackKeyUpRef, attachIframeShortcutListeners, togglePlay } = usePlaybackKeyboard({
|
|
32993
33017
|
iframeRef,
|
|
32994
33018
|
shuttleDirectionRef,
|
|
@@ -33135,7 +33159,7 @@ function useTimelinePlayer({
|
|
|
33135
33159
|
cancelPendingLoad();
|
|
33136
33160
|
usePlayerStore.getState().reset();
|
|
33137
33161
|
}, [stopRAFLoop, stopReverseLoop, cancelPendingLoad]);
|
|
33138
|
-
|
|
33162
|
+
useEffect37(() => {
|
|
33139
33163
|
return usePlayerStore.subscribe((state, prev) => {
|
|
33140
33164
|
const playbackRateChanged = state.playbackRate !== prev.playbackRate;
|
|
33141
33165
|
const audioMutedChanged = state.audioMuted !== prev.audioMuted;
|
|
@@ -33170,10 +33194,10 @@ function useTimelinePlayer({
|
|
|
33170
33194
|
import { useCallback as useCallback45, useMemo as useMemo39 } from "react";
|
|
33171
33195
|
|
|
33172
33196
|
// src/components/nle/NLEContext.tsx
|
|
33173
|
-
import { useContext as useContext8, useState as useState37, useCallback as useCallback44, useRef as useRef52, useEffect as
|
|
33197
|
+
import { useContext as useContext8, useState as useState37, useCallback as useCallback44, useRef as useRef52, useEffect as useEffect39 } from "react";
|
|
33174
33198
|
|
|
33175
33199
|
// src/components/nle/useCompositionStack.ts
|
|
33176
|
-
import { useState as useState36, useCallback as useCallback43, useRef as useRef51, useEffect as
|
|
33200
|
+
import { useState as useState36, useCallback as useCallback43, useRef as useRef51, useEffect as useEffect38 } from "react";
|
|
33177
33201
|
function useCompositionStack({
|
|
33178
33202
|
projectId,
|
|
33179
33203
|
activeCompositionPath,
|
|
@@ -33244,7 +33268,7 @@ function useCompositionStack({
|
|
|
33244
33268
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
33245
33269
|
[projectId]
|
|
33246
33270
|
);
|
|
33247
|
-
|
|
33271
|
+
useEffect38(() => {
|
|
33248
33272
|
const master = {
|
|
33249
33273
|
id: "master",
|
|
33250
33274
|
label: "Master",
|
|
@@ -33332,13 +33356,13 @@ function NLEProvider({
|
|
|
33332
33356
|
onShadowPromoted: () => shadowPromotedRef.current(),
|
|
33333
33357
|
onPreviewReloadFailed
|
|
33334
33358
|
});
|
|
33335
|
-
|
|
33359
|
+
useEffect39(() => {
|
|
33336
33360
|
usePlayerStore.getState().beginTimelineSession(projectId);
|
|
33337
33361
|
useAssetPreviewStore.getState().clearPreviewAsset();
|
|
33338
33362
|
}, [projectId]);
|
|
33339
33363
|
const [previewCompositionSize, setPreviewCompositionSize] = useState37(null);
|
|
33340
33364
|
const prevRefreshKeyRef = useRef52(refreshKey);
|
|
33341
|
-
|
|
33365
|
+
useEffect39(() => {
|
|
33342
33366
|
try {
|
|
33343
33367
|
if (refreshKey === prevRefreshKeyRef.current) return;
|
|
33344
33368
|
prevRefreshKeyRef.current = refreshKey;
|
|
@@ -33400,7 +33424,7 @@ function NLEProvider({
|
|
|
33400
33424
|
compIdToSrcRef.current = compIdToSrc;
|
|
33401
33425
|
const onCompIdToSrcChangeRef = useRef52(onCompIdToSrcChange);
|
|
33402
33426
|
onCompIdToSrcChangeRef.current = onCompIdToSrcChange;
|
|
33403
|
-
|
|
33427
|
+
useEffect39(() => {
|
|
33404
33428
|
const controller = new AbortController();
|
|
33405
33429
|
let current2 = true;
|
|
33406
33430
|
const emptyMap = /* @__PURE__ */ new Map();
|
|
@@ -33435,7 +33459,7 @@ function NLEProvider({
|
|
|
33435
33459
|
controller.abort();
|
|
33436
33460
|
};
|
|
33437
33461
|
}, [projectId, setCompIdToSrc]);
|
|
33438
|
-
|
|
33462
|
+
useEffect39(() => {
|
|
33439
33463
|
if (compIdToSrc.size === 0) return;
|
|
33440
33464
|
const patchElements2 = (elements) => {
|
|
33441
33465
|
const map = compIdToSrcRef.current;
|
|
@@ -33474,12 +33498,12 @@ function NLEProvider({
|
|
|
33474
33498
|
}, []);
|
|
33475
33499
|
const timelineDisabled = shouldDisableTimelineWhileCompositionLoading(compositionLoading);
|
|
33476
33500
|
const timelineSessionEpoch = usePlayerStore((state) => state.timelineSessionEpoch);
|
|
33477
|
-
|
|
33501
|
+
useEffect39(() => {
|
|
33478
33502
|
onCompositionLoadingChange?.(compositionLoading);
|
|
33479
33503
|
}, [compositionLoading, onCompositionLoadingChange]);
|
|
33480
33504
|
const onIframeRefStable = useRef52(onIframeRef);
|
|
33481
33505
|
onIframeRefStable.current = onIframeRef;
|
|
33482
|
-
|
|
33506
|
+
useEffect39(() => {
|
|
33483
33507
|
onIframeRefStable.current?.(iframeRef.current);
|
|
33484
33508
|
}, [compositionStack.length, refreshKey, iframeRef]);
|
|
33485
33509
|
const value = {
|
|
@@ -33588,7 +33612,7 @@ function readPreviewCompositionSize(iframe) {
|
|
|
33588
33612
|
import {
|
|
33589
33613
|
memo as memo24,
|
|
33590
33614
|
useCallback as useCallback49,
|
|
33591
|
-
useEffect as
|
|
33615
|
+
useEffect as useEffect41,
|
|
33592
33616
|
useLayoutEffect as useLayoutEffect10,
|
|
33593
33617
|
useRef as useRef56,
|
|
33594
33618
|
useState as useState40
|
|
@@ -33766,7 +33790,7 @@ var usePreviewGuidesStore = create8((set, get) => {
|
|
|
33766
33790
|
});
|
|
33767
33791
|
|
|
33768
33792
|
// src/components/nle/PreviewZoomOverlay.tsx
|
|
33769
|
-
import { useCallback as useCallback46, useEffect as
|
|
33793
|
+
import { useCallback as useCallback46, useEffect as useEffect40, useRef as useRef53, useState as useState38 } from "react";
|
|
33770
33794
|
import { Fragment as Fragment24, jsx as jsx81, jsxs as jsxs55 } from "react/jsx-runtime";
|
|
33771
33795
|
var NAVIGATOR_PX = 112;
|
|
33772
33796
|
function zoomChipLabel(zoomPercent) {
|
|
@@ -33806,7 +33830,7 @@ function usePreviewNavigator(viewportRef, stageSize, zoomRef) {
|
|
|
33806
33830
|
},
|
|
33807
33831
|
[draw, zoomRef]
|
|
33808
33832
|
);
|
|
33809
|
-
|
|
33833
|
+
useEffect40(() => draw(zoomRef.current), [stageSize, draw, zoomRef]);
|
|
33810
33834
|
return { draw, setRegion };
|
|
33811
33835
|
}
|
|
33812
33836
|
function ZoomPercentInput({
|
|
@@ -33867,7 +33891,7 @@ function usePreviewPixelGrid(viewportRef, stageSize, compositionWidth, zoomRef)
|
|
|
33867
33891
|
},
|
|
33868
33892
|
[draw, zoomRef]
|
|
33869
33893
|
);
|
|
33870
|
-
|
|
33894
|
+
useEffect40(() => draw(zoomRef.current), [stageSize, compositionWidth, draw, zoomRef]);
|
|
33871
33895
|
return { draw, setGrid };
|
|
33872
33896
|
}
|
|
33873
33897
|
function usePreviewZoomOverlay(viewportRef, stageSize, zoomRef, compositionWidth) {
|
|
@@ -34190,11 +34214,11 @@ var NLEPreview = memo24(function NLEPreview2({
|
|
|
34190
34214
|
const viewportRef = useRef56(null);
|
|
34191
34215
|
const stageRef = useRef56(null);
|
|
34192
34216
|
const previewIframeRef = useRef56(null);
|
|
34193
|
-
|
|
34217
|
+
useEffect41(() => {
|
|
34194
34218
|
onStageRef?.(stageRef);
|
|
34195
34219
|
}, [onStageRef]);
|
|
34196
34220
|
const previousActiveKeyRef = useRef56(activeKey);
|
|
34197
|
-
|
|
34221
|
+
useEffect41(() => {
|
|
34198
34222
|
if (previousActiveKeyRef.current === activeKey) return;
|
|
34199
34223
|
previousActiveKeyRef.current = activeKey;
|
|
34200
34224
|
resetPreviewSlots();
|
|
@@ -34210,19 +34234,19 @@ var NLEPreview = memo24(function NLEPreview2({
|
|
|
34210
34234
|
const hintHeight = compositionSizeHint?.height;
|
|
34211
34235
|
const zoomRef = useRef56(DEFAULT_PREVIEW_ZOOM);
|
|
34212
34236
|
const [settledZoom, setSettledZoom] = useState40(DEFAULT_PREVIEW_ZOOM);
|
|
34213
|
-
|
|
34237
|
+
useEffect41(() => postFrameDisplayScale(previewIframeRef.current), [settledZoom]);
|
|
34214
34238
|
const hudRef = useRef56(null);
|
|
34215
34239
|
const hudTimerRef = useRef56(null);
|
|
34216
34240
|
const settleTimerRef = useRef56(null);
|
|
34217
34241
|
const zoomingRef = useRef56(false);
|
|
34218
34242
|
const dragRef = useRef56(null);
|
|
34219
|
-
|
|
34243
|
+
useEffect41(() => {
|
|
34220
34244
|
return () => {
|
|
34221
34245
|
if (settleTimerRef.current) clearTimeout(settleTimerRef.current);
|
|
34222
34246
|
if (hudTimerRef.current) clearTimeout(hudTimerRef.current);
|
|
34223
34247
|
};
|
|
34224
34248
|
}, []);
|
|
34225
|
-
|
|
34249
|
+
useEffect41(() => {
|
|
34226
34250
|
const viewport2 = viewportRef.current;
|
|
34227
34251
|
if (!viewport2) return;
|
|
34228
34252
|
const updateStageSize = () => {
|
|
@@ -34251,7 +34275,7 @@ var NLEPreview = memo24(function NLEPreview2({
|
|
|
34251
34275
|
(prev) => prev?.width === next?.width && prev?.height === next?.height ? prev : next
|
|
34252
34276
|
);
|
|
34253
34277
|
}, []);
|
|
34254
|
-
|
|
34278
|
+
useEffect41(() => {
|
|
34255
34279
|
onCompositionSizeChangeRef.current?.(compositionSize);
|
|
34256
34280
|
}, [compositionSize]);
|
|
34257
34281
|
const setPreviewIframeRef = useCallback49(
|
|
@@ -34359,7 +34383,7 @@ var NLEPreview = memo24(function NLEPreview2({
|
|
|
34359
34383
|
writeTransform3(zoomRef.current);
|
|
34360
34384
|
}
|
|
34361
34385
|
}, [writeTransform3]);
|
|
34362
|
-
|
|
34386
|
+
useEffect41(() => {
|
|
34363
34387
|
const live = previewSlots.find((slot) => slot.role === "live");
|
|
34364
34388
|
if (!live || live.gen === liveGenRef.current) return;
|
|
34365
34389
|
const isPromotion = liveGenRef.current !== null;
|
|
@@ -34369,7 +34393,7 @@ var NLEPreview = memo24(function NLEPreview2({
|
|
|
34369
34393
|
updateCompositionSizeFromPreview();
|
|
34370
34394
|
applyInitialZoom();
|
|
34371
34395
|
}, [previewSlots, iframeRef, updateCompositionSizeFromPreview, applyInitialZoom]);
|
|
34372
|
-
|
|
34396
|
+
useEffect41(() => {
|
|
34373
34397
|
const viewport2 = viewportRef.current;
|
|
34374
34398
|
if (!viewport2) return;
|
|
34375
34399
|
const handleWheel = (event) => {
|
|
@@ -34415,7 +34439,7 @@ var NLEPreview = memo24(function NLEPreview2({
|
|
|
34415
34439
|
document.addEventListener("wheel", handleWheel, { passive: false, capture: true });
|
|
34416
34440
|
return () => document.removeEventListener("wheel", handleWheel, { capture: true });
|
|
34417
34441
|
}, [applyZoom, applyPan]);
|
|
34418
|
-
|
|
34442
|
+
useEffect41(() => {
|
|
34419
34443
|
const isInsideViewport = (clientX, clientY) => {
|
|
34420
34444
|
const viewport2 = viewportRef.current;
|
|
34421
34445
|
if (!viewport2) return null;
|
|
@@ -34774,7 +34798,7 @@ function usePreviewBlockDrop({
|
|
|
34774
34798
|
}
|
|
34775
34799
|
|
|
34776
34800
|
// src/components/nle/AssetPreviewOverlay.tsx
|
|
34777
|
-
import { useEffect as
|
|
34801
|
+
import { useEffect as useEffect42, useCallback as useCallback51 } from "react";
|
|
34778
34802
|
|
|
34779
34803
|
// src/utils/assetPreviewDismiss.ts
|
|
34780
34804
|
var TIME_EPSILON_S = 1e-6;
|
|
@@ -34853,12 +34877,12 @@ function AssetPreviewOverlay() {
|
|
|
34853
34877
|
},
|
|
34854
34878
|
[clearPreviewAsset]
|
|
34855
34879
|
);
|
|
34856
|
-
|
|
34880
|
+
useEffect42(() => {
|
|
34857
34881
|
if (!previewAsset) return;
|
|
34858
34882
|
window.addEventListener("keydown", handleKeyDown);
|
|
34859
34883
|
return () => window.removeEventListener("keydown", handleKeyDown);
|
|
34860
34884
|
}, [previewAsset, handleKeyDown]);
|
|
34861
|
-
|
|
34885
|
+
useEffect42(() => {
|
|
34862
34886
|
if (!previewAsset) return;
|
|
34863
34887
|
const opened = usePlayerStore.getState();
|
|
34864
34888
|
const openedTime = opened.currentTime;
|
|
@@ -35131,11 +35155,11 @@ import {
|
|
|
35131
35155
|
import { createContext as createContext6, useContext as useContext10, useRef as useRef59, useState as useState43 } from "react";
|
|
35132
35156
|
|
|
35133
35157
|
// src/components/editor/usePreviewCompositionRect.ts
|
|
35134
|
-
import { useEffect as
|
|
35158
|
+
import { useEffect as useEffect43, useRef as useRef58 } from "react";
|
|
35135
35159
|
function usePreviewCompositionRect(overlayRef, iframe) {
|
|
35136
35160
|
const iframeRef = useRef58(iframe);
|
|
35137
35161
|
iframeRef.current = iframe;
|
|
35138
|
-
|
|
35162
|
+
useEffect43(() => {
|
|
35139
35163
|
requestOverlayFrames();
|
|
35140
35164
|
}, [iframe]);
|
|
35141
35165
|
return useDomEditCompositionRect({ iframeRef, overlayRef });
|
|
@@ -35425,17 +35449,17 @@ function PreviewPane({
|
|
|
35425
35449
|
}
|
|
35426
35450
|
|
|
35427
35451
|
// src/components/storyboard/PreviewStage.tsx
|
|
35428
|
-
import { useCallback as useCallback55, useEffect as
|
|
35452
|
+
import { useCallback as useCallback55, useEffect as useEffect48, useRef as useRef64, useState as useState48 } from "react";
|
|
35429
35453
|
|
|
35430
35454
|
// src/components/storyboard/StoryboardBoardView.tsx
|
|
35431
|
-
import { useCallback as useCallback54, useEffect as
|
|
35455
|
+
import { useCallback as useCallback54, useEffect as useEffect47, useState as useState47 } from "react";
|
|
35432
35456
|
|
|
35433
35457
|
// src/components/OpenInDesktopButton.tsx
|
|
35434
|
-
import { useCallback as useCallback53, useEffect as
|
|
35458
|
+
import { useCallback as useCallback53, useEffect as useEffect45, useRef as useRef62, useState as useState45 } from "react";
|
|
35435
35459
|
|
|
35436
35460
|
// src/components/DesktopGuideCard.tsx
|
|
35437
35461
|
import { ArrowSquareOut, Check as Check2, Copy } from "@phosphor-icons/react";
|
|
35438
|
-
import { useEffect as
|
|
35462
|
+
import { useEffect as useEffect44, useState as useState44 } from "react";
|
|
35439
35463
|
|
|
35440
35464
|
// src/components/FrameyGlyph.tsx
|
|
35441
35465
|
import { jsx as jsx90, jsxs as jsxs61 } from "react/jsx-runtime";
|
|
@@ -35590,7 +35614,7 @@ function Spinner() {
|
|
|
35590
35614
|
}
|
|
35591
35615
|
function FolderPath({ dir }) {
|
|
35592
35616
|
const [copied, setCopied] = useState44(false);
|
|
35593
|
-
|
|
35617
|
+
useEffect44(() => {
|
|
35594
35618
|
if (!copied) return;
|
|
35595
35619
|
const timer = setTimeout(() => setCopied(false), 1500);
|
|
35596
35620
|
return () => clearTimeout(timer);
|
|
@@ -35769,7 +35793,7 @@ async function readRoute(placement) {
|
|
|
35769
35793
|
}
|
|
35770
35794
|
function useDesktopRoute(placement) {
|
|
35771
35795
|
const [route, setRoute] = useState45(null);
|
|
35772
|
-
|
|
35796
|
+
useEffect45(() => {
|
|
35773
35797
|
let live = true;
|
|
35774
35798
|
readRoute(placement).then((answered) => {
|
|
35775
35799
|
if (!live || !answered) return;
|
|
@@ -35790,7 +35814,7 @@ function useImpression(anchor2, route) {
|
|
|
35790
35814
|
const shown3 = route !== null;
|
|
35791
35815
|
const routeRef = useRef62(route);
|
|
35792
35816
|
routeRef.current = route;
|
|
35793
|
-
|
|
35817
|
+
useEffect45(() => {
|
|
35794
35818
|
const el = anchor2.current;
|
|
35795
35819
|
if (!shown3 || !el) return;
|
|
35796
35820
|
const record2 = () => {
|
|
@@ -35811,7 +35835,7 @@ function useImpression(anchor2, route) {
|
|
|
35811
35835
|
}, [anchor2, shown3]);
|
|
35812
35836
|
}
|
|
35813
35837
|
function useGaze(anchor2, eye) {
|
|
35814
|
-
|
|
35838
|
+
useEffect45(() => {
|
|
35815
35839
|
let frame3 = 0;
|
|
35816
35840
|
const look = (event) => {
|
|
35817
35841
|
cancelAnimationFrame(frame3);
|
|
@@ -35832,7 +35856,7 @@ function useGaze(anchor2, eye) {
|
|
|
35832
35856
|
}, [anchor2, eye]);
|
|
35833
35857
|
}
|
|
35834
35858
|
function useInstallWatch(watching, placement, onAnswer) {
|
|
35835
|
-
|
|
35859
|
+
useEffect45(() => {
|
|
35836
35860
|
if (!watching) return;
|
|
35837
35861
|
let live = true;
|
|
35838
35862
|
const ask = () => readRoute(placement).then((answered) => live && answered && onAnswer(answered)).catch(() => {
|
|
@@ -35869,7 +35893,7 @@ function useGuide(route, setRoute, placement) {
|
|
|
35869
35893
|
[setRoute]
|
|
35870
35894
|
);
|
|
35871
35895
|
useInstallWatch(cardOpen && route !== null && !installed2, placement, onAnswer);
|
|
35872
|
-
|
|
35896
|
+
useEffect45(() => {
|
|
35873
35897
|
if (!downloaded || installed2) return;
|
|
35874
35898
|
setSlow(false);
|
|
35875
35899
|
const timer = setTimeout(() => setSlow(true), SLOW_MS);
|
|
@@ -36126,7 +36150,7 @@ function groupByAct(frames) {
|
|
|
36126
36150
|
}
|
|
36127
36151
|
|
|
36128
36152
|
// src/components/storyboard/useStoryboardBoard.ts
|
|
36129
|
-
import { useEffect as
|
|
36153
|
+
import { useEffect as useEffect46, useRef as useRef63, useState as useState46 } from "react";
|
|
36130
36154
|
import { encodeUrlPath as encodeUrlPath3 } from "@hyperframes/parsers";
|
|
36131
36155
|
|
|
36132
36156
|
// src/hooks/fileChangeFanout.ts
|
|
@@ -36157,7 +36181,7 @@ function useStoryboardBoard(projectId) {
|
|
|
36157
36181
|
const [appeared, setAppeared] = useState46(false);
|
|
36158
36182
|
const firstListing = useRef63(null);
|
|
36159
36183
|
if (loaded && firstListing.current === null) firstListing.current = path !== null;
|
|
36160
|
-
|
|
36184
|
+
useEffect46(() => {
|
|
36161
36185
|
if (path && firstListing.current === false) setAppeared(true);
|
|
36162
36186
|
if (!path) setAppeared(false);
|
|
36163
36187
|
}, [path]);
|
|
@@ -36166,7 +36190,7 @@ function useStoryboardBoard(projectId) {
|
|
|
36166
36190
|
const stillsRef = useRef63(/* @__PURE__ */ new Set());
|
|
36167
36191
|
const refreshRef = useRef63(files?.refreshFileTree);
|
|
36168
36192
|
refreshRef.current = files?.refreshFileTree;
|
|
36169
|
-
|
|
36193
|
+
useEffect46(() => {
|
|
36170
36194
|
return onExternalFileChange((payload) => {
|
|
36171
36195
|
const change = changeOf(payload);
|
|
36172
36196
|
if (!change || change.projectId && change.projectId !== projectId) return;
|
|
@@ -36175,7 +36199,7 @@ function useStoryboardBoard(projectId) {
|
|
|
36175
36199
|
if (isBoardName(change.path)) void refreshRef.current?.();
|
|
36176
36200
|
});
|
|
36177
36201
|
}, [projectId]);
|
|
36178
|
-
|
|
36202
|
+
useEffect46(() => {
|
|
36179
36203
|
if (!path) return;
|
|
36180
36204
|
let live = true;
|
|
36181
36205
|
setRead((prev) => prev.state === "read" ? prev : { state: "loading" });
|
|
@@ -36251,7 +36275,7 @@ function FramesBody({
|
|
|
36251
36275
|
onShowInPreview
|
|
36252
36276
|
}) {
|
|
36253
36277
|
const [open2, setOpen] = useState47(null);
|
|
36254
|
-
|
|
36278
|
+
useEffect47(() => {
|
|
36255
36279
|
if (open2 !== null && open2 >= frames.length) setOpen(frames.length ? frames.length - 1 : null);
|
|
36256
36280
|
}, [frames.length, open2]);
|
|
36257
36281
|
const frame3 = open2 === null ? void 0 : frames[open2];
|
|
@@ -36374,7 +36398,7 @@ function OpenFrame({
|
|
|
36374
36398
|
},
|
|
36375
36399
|
[index2, onStep, onClose]
|
|
36376
36400
|
);
|
|
36377
|
-
|
|
36401
|
+
useEffect47(() => {
|
|
36378
36402
|
window.addEventListener("keydown", onKey, true);
|
|
36379
36403
|
return () => window.removeEventListener("keydown", onKey, true);
|
|
36380
36404
|
}, [onKey]);
|
|
@@ -36453,21 +36477,21 @@ function PreviewStage({ projectId, children }) {
|
|
|
36453
36477
|
});
|
|
36454
36478
|
setTab(next);
|
|
36455
36479
|
}, []);
|
|
36456
|
-
|
|
36480
|
+
useEffect48(() => {
|
|
36457
36481
|
if (board.appeared) show("storyboard", "shown_on_write");
|
|
36458
36482
|
}, [board.appeared, show]);
|
|
36459
|
-
|
|
36483
|
+
useEffect48(() => {
|
|
36460
36484
|
if (tab !== "storyboard" || usePlayerStore.getState().playLocked) return;
|
|
36461
36485
|
usePlayerStore.getState().setPlayLocked(true);
|
|
36462
36486
|
return () => usePlayerStore.getState().setPlayLocked(false);
|
|
36463
36487
|
}, [tab]);
|
|
36464
|
-
|
|
36488
|
+
useEffect48(() => {
|
|
36465
36489
|
if (tab === "storyboard") {
|
|
36466
36490
|
shownRevision.current = board.revision;
|
|
36467
36491
|
setDotted(false);
|
|
36468
36492
|
} else if (board.revision !== shownRevision.current) setDotted(true);
|
|
36469
36493
|
}, [tab, board.revision]);
|
|
36470
|
-
|
|
36494
|
+
useEffect48(() => {
|
|
36471
36495
|
if (!board.path) setTab("preview");
|
|
36472
36496
|
}, [board.path]);
|
|
36473
36497
|
const path = board.path;
|
|
@@ -36505,7 +36529,7 @@ function PreviewStage({ projectId, children }) {
|
|
|
36505
36529
|
import {
|
|
36506
36530
|
memo as memo26,
|
|
36507
36531
|
useCallback as useCallback56,
|
|
36508
|
-
useEffect as
|
|
36532
|
+
useEffect as useEffect49,
|
|
36509
36533
|
useMemo as useMemo42,
|
|
36510
36534
|
useRef as useRef65
|
|
36511
36535
|
} from "react";
|
|
@@ -36686,7 +36710,7 @@ function useMeterLoop(strips2, bars, iframeRef, clip) {
|
|
|
36686
36710
|
const previewIframeRef = iframeRef ?? shell?.previewIframeRef;
|
|
36687
36711
|
const stripsRef = useRef65(strips2);
|
|
36688
36712
|
stripsRef.current = strips2;
|
|
36689
|
-
|
|
36713
|
+
useEffect49(() => {
|
|
36690
36714
|
let raf = 0;
|
|
36691
36715
|
let active = null;
|
|
36692
36716
|
let last = performance.now();
|
|
@@ -36873,7 +36897,7 @@ function MeterStrip({
|
|
|
36873
36897
|
useRef65(null),
|
|
36874
36898
|
useRef65(null)
|
|
36875
36899
|
];
|
|
36876
|
-
|
|
36900
|
+
useEffect49(() => {
|
|
36877
36901
|
register(strip.id, [
|
|
36878
36902
|
{ mask: refs[0].current, peak: refs[1].current },
|
|
36879
36903
|
{ mask: refs[2].current, peak: refs[3].current }
|
|
@@ -37064,7 +37088,7 @@ function TimelinePane({
|
|
|
37064
37088
|
import { useCallback as useCallback70 } from "react";
|
|
37065
37089
|
|
|
37066
37090
|
// src/captions/components/CaptionOverlay.tsx
|
|
37067
|
-
import { memo as memo27, useEffect as
|
|
37091
|
+
import { memo as memo27, useEffect as useEffect50, useState as useState49, useCallback as useCallback57, useRef as useRef66 } from "react";
|
|
37068
37092
|
|
|
37069
37093
|
// src/captions/keyboard.ts
|
|
37070
37094
|
function resolveCaptionNudge(event, target) {
|
|
@@ -37293,7 +37317,7 @@ var CaptionOverlay = memo27(function CaptionOverlay2({ iframeRef }) {
|
|
|
37293
37317
|
modelRef.current = model;
|
|
37294
37318
|
const cancelDragRef = useRef66(null);
|
|
37295
37319
|
const interactionRef = useRef66(null);
|
|
37296
|
-
|
|
37320
|
+
useEffect50(() => {
|
|
37297
37321
|
if (!isEditMode) return;
|
|
37298
37322
|
const unregisterIframe = registerCaptionIframe(iframeRef);
|
|
37299
37323
|
let prevBoxes = [];
|
|
@@ -37690,7 +37714,7 @@ var CaptionOverlay = memo27(function CaptionOverlay2({ iframeRef }) {
|
|
|
37690
37714
|
});
|
|
37691
37715
|
|
|
37692
37716
|
// src/components/editor/DomEditOverlay.tsx
|
|
37693
|
-
import { memo as memo30, useEffect as
|
|
37717
|
+
import { memo as memo30, useEffect as useEffect62, useMemo as useMemo43, useRef as useRef77 } from "react";
|
|
37694
37718
|
|
|
37695
37719
|
// src/utils/previewFeatureUsage.ts
|
|
37696
37720
|
function trackPreviewFeatureUsed(feature, method) {
|
|
@@ -37705,7 +37729,7 @@ function trackPreviewEditResult(feature, method, result) {
|
|
|
37705
37729
|
}
|
|
37706
37730
|
|
|
37707
37731
|
// src/components/editor/marqueeCommit.ts
|
|
37708
|
-
import { useCallback as useCallback58, useEffect as
|
|
37732
|
+
import { useCallback as useCallback58, useEffect as useEffect51, useRef as useRef67, useState as useState50 } from "react";
|
|
37709
37733
|
|
|
37710
37734
|
// src/utils/studioPreviewHelpers.ts
|
|
37711
37735
|
import {
|
|
@@ -39438,7 +39462,7 @@ function useMarqueeGestures(deps) {
|
|
|
39438
39462
|
releaseCapture(marqueeRef.current);
|
|
39439
39463
|
reset();
|
|
39440
39464
|
}, [reset]);
|
|
39441
|
-
|
|
39465
|
+
useEffect51(() => {
|
|
39442
39466
|
const cancelBandBeforeHostEscape = (e) => {
|
|
39443
39467
|
if (!matchesKey(e, "cancel") || !marqueeRef.current) return;
|
|
39444
39468
|
e.preventDefault();
|
|
@@ -39583,13 +39607,13 @@ function MarqueeOverlay({ candidateRects, marqueeRect }) {
|
|
|
39583
39607
|
}
|
|
39584
39608
|
|
|
39585
39609
|
// src/components/editor/useZOrderCrossedFlash.tsx
|
|
39586
|
-
import { useCallback as useCallback59, useEffect as
|
|
39610
|
+
import { useCallback as useCallback59, useEffect as useEffect52, useRef as useRef68, useState as useState51 } from "react";
|
|
39587
39611
|
import { jsx as jsx100 } from "react/jsx-runtime";
|
|
39588
39612
|
var Z_ORDER_CROSSED_FLASH_MS = 600;
|
|
39589
39613
|
function useZOrderCrossedFlash({ overlayRef, iframeRef }) {
|
|
39590
39614
|
const [zOrderFlashRect, setZOrderFlashRect] = useState51(null);
|
|
39591
39615
|
const timeoutRef = useRef68(null);
|
|
39592
|
-
|
|
39616
|
+
useEffect52(
|
|
39593
39617
|
() => () => {
|
|
39594
39618
|
if (timeoutRef.current) clearTimeout(timeoutRef.current);
|
|
39595
39619
|
},
|
|
@@ -39627,7 +39651,7 @@ function ZOrderCrossedFlash({ rect }) {
|
|
|
39627
39651
|
}
|
|
39628
39652
|
|
|
39629
39653
|
// src/components/editor/useCanvasContextMenuState.ts
|
|
39630
|
-
import { useCallback as useCallback60, useEffect as
|
|
39654
|
+
import { useCallback as useCallback60, useEffect as useEffect53, useState as useState52 } from "react";
|
|
39631
39655
|
function useCanvasContextMenuState({
|
|
39632
39656
|
selection,
|
|
39633
39657
|
selectionRef,
|
|
@@ -39637,7 +39661,7 @@ function useCanvasContextMenuState({
|
|
|
39637
39661
|
}) {
|
|
39638
39662
|
const [contextMenu, setContextMenu] = useState52(null);
|
|
39639
39663
|
const closeContextMenu = useCallback60(() => setContextMenu(null), []);
|
|
39640
|
-
|
|
39664
|
+
useEffect53(() => {
|
|
39641
39665
|
if (!contextMenu) return;
|
|
39642
39666
|
if (!selection || selection.element !== contextMenu.sel.element) {
|
|
39643
39667
|
setContextMenu(null);
|
|
@@ -42932,7 +42956,7 @@ function createDomEditOverlayGestureHandlers(opts) {
|
|
|
42932
42956
|
}
|
|
42933
42957
|
|
|
42934
42958
|
// src/components/editor/useDomEditNudge.ts
|
|
42935
|
-
import { useCallback as useCallback61, useEffect as
|
|
42959
|
+
import { useCallback as useCallback61, useEffect as useEffect54, useRef as useRef70 } from "react";
|
|
42936
42960
|
function selectionIdentityKey(selection) {
|
|
42937
42961
|
if (!selection) return "";
|
|
42938
42962
|
return [
|
|
@@ -43000,7 +43024,7 @@ function useDomEditNudge(params) {
|
|
|
43000
43024
|
};
|
|
43001
43025
|
const commitSessionRef = useRef70(commitSession);
|
|
43002
43026
|
commitSessionRef.current = commitSession;
|
|
43003
|
-
|
|
43027
|
+
useEffect54(() => {
|
|
43004
43028
|
if (params.allowCanvasMovement || !sessionRef.current) return;
|
|
43005
43029
|
const session = sessionRef.current;
|
|
43006
43030
|
sessionRef.current = null;
|
|
@@ -43061,8 +43085,8 @@ function useDomEditNudge(params) {
|
|
|
43061
43085
|
});
|
|
43062
43086
|
const selectionKey = selectionIdentityKey(params.selection);
|
|
43063
43087
|
const groupSelectionsKey = groupSelectionsIdentityKey(params.groupSelections);
|
|
43064
|
-
|
|
43065
|
-
|
|
43088
|
+
useEffect54(() => () => void commitSessionRef.current(), [selectionKey, groupSelectionsKey]);
|
|
43089
|
+
useEffect54(() => {
|
|
43066
43090
|
const targets = params.groupSelections.length > 1 ? params.groupSelections : params.selection ? [params.selection] : [];
|
|
43067
43091
|
if (!params.allowCanvasMovement || !canCanvasNudgeTargets(targets)) return;
|
|
43068
43092
|
return acquireCanvasNudgeKeys();
|
|
@@ -43212,7 +43236,7 @@ var SnapGuideOverlay = memo28(function SnapGuideOverlay2({
|
|
|
43212
43236
|
});
|
|
43213
43237
|
|
|
43214
43238
|
// src/components/editor/DomEditCropHandles.tsx
|
|
43215
|
-
import { useEffect as
|
|
43239
|
+
import { useEffect as useEffect56, useRef as useRef72, useState as useState54 } from "react";
|
|
43216
43240
|
|
|
43217
43241
|
// src/components/editor/cropResize.ts
|
|
43218
43242
|
var boxOf = (element) => ({
|
|
@@ -43300,7 +43324,7 @@ async function writeSizeWithCrop(selection, properties, mutation, commit2, write
|
|
|
43300
43324
|
}
|
|
43301
43325
|
|
|
43302
43326
|
// src/components/editor/CropPresetBar.tsx
|
|
43303
|
-
import { useEffect as
|
|
43327
|
+
import { useEffect as useEffect55 } from "react";
|
|
43304
43328
|
|
|
43305
43329
|
// src/components/editor/cropPresets.ts
|
|
43306
43330
|
var CROP_ASPECT_PRESETS = [
|
|
@@ -43331,7 +43355,7 @@ function CropPresetBar({
|
|
|
43331
43355
|
onApply,
|
|
43332
43356
|
onDone
|
|
43333
43357
|
}) {
|
|
43334
|
-
|
|
43358
|
+
useEffect55(() => {
|
|
43335
43359
|
const onKeyDown = (event) => {
|
|
43336
43360
|
if (event.key === "Escape") onDone();
|
|
43337
43361
|
};
|
|
@@ -43439,7 +43463,7 @@ function DomEditCropHandles({
|
|
|
43439
43463
|
const committed = readCropFollowingResize(selection.element) ?? NO_CROP;
|
|
43440
43464
|
const insets = dragging ? state.insets : committed;
|
|
43441
43465
|
const hasCrop2 = hasCropInsets(insets);
|
|
43442
|
-
|
|
43466
|
+
useEffect56(() => {
|
|
43443
43467
|
const el = selection.element;
|
|
43444
43468
|
if (readElementCropInsets(el) === null) return;
|
|
43445
43469
|
liftElementCrop(el);
|
|
@@ -44123,10 +44147,10 @@ var CanvasContextMenu = memo29(function CanvasContextMenu2({
|
|
|
44123
44147
|
});
|
|
44124
44148
|
|
|
44125
44149
|
// src/components/editor/useInlineTextEditing.tsx
|
|
44126
|
-
import { useEffect as
|
|
44150
|
+
import { useEffect as useEffect60, useRef as useRef74 } from "react";
|
|
44127
44151
|
|
|
44128
44152
|
// src/components/editor/InlineTextCaret.tsx
|
|
44129
|
-
import { useEffect as
|
|
44153
|
+
import { useEffect as useEffect57, useState as useState55 } from "react";
|
|
44130
44154
|
import { createPortal as createPortal10 } from "react-dom";
|
|
44131
44155
|
import { jsx as jsx108 } from "react/jsx-runtime";
|
|
44132
44156
|
var CARET_PX = 2;
|
|
@@ -44136,7 +44160,7 @@ function InlineTextCaret({
|
|
|
44136
44160
|
}) {
|
|
44137
44161
|
const [placement, setPlacement] = useState55(null);
|
|
44138
44162
|
const element = session?.element ?? null;
|
|
44139
|
-
|
|
44163
|
+
useEffect57(() => {
|
|
44140
44164
|
if (!element || !iframe) {
|
|
44141
44165
|
setPlacement(null);
|
|
44142
44166
|
return;
|
|
@@ -44287,7 +44311,7 @@ function neighbours({ startContainer: at, startOffset: offset }) {
|
|
|
44287
44311
|
}
|
|
44288
44312
|
|
|
44289
44313
|
// src/components/editor/InlineTextToolbar.tsx
|
|
44290
|
-
import { useCallback as useCallback62, useEffect as
|
|
44314
|
+
import { useCallback as useCallback62, useEffect as useEffect58, useState as useState56 } from "react";
|
|
44291
44315
|
import { createPortal as createPortal11 } from "react-dom";
|
|
44292
44316
|
|
|
44293
44317
|
// src/components/editor/inlineTextStyleRange.ts
|
|
@@ -44677,7 +44701,7 @@ function InlineTextToolbar({
|
|
|
44677
44701
|
const refresh2 = useCallback62(() => {
|
|
44678
44702
|
setPlacement(session && iframe ? placeOverSelection(session.element, iframe) : null);
|
|
44679
44703
|
}, [session, iframe]);
|
|
44680
|
-
|
|
44704
|
+
useEffect58(() => {
|
|
44681
44705
|
const doc = session?.element.ownerDocument;
|
|
44682
44706
|
if (!doc) {
|
|
44683
44707
|
setPlacement(null);
|
|
@@ -44855,7 +44879,7 @@ function isBold(weight) {
|
|
|
44855
44879
|
}
|
|
44856
44880
|
|
|
44857
44881
|
// src/hooks/useInlineTextEdit.ts
|
|
44858
|
-
import { useCallback as useCallback63, useEffect as
|
|
44882
|
+
import { useCallback as useCallback63, useEffect as useEffect59, useRef as useRef73, useState as useState57 } from "react";
|
|
44859
44883
|
import { sanitizeRichTextChildren } from "@hyperframes/core/rich-text-sanitize";
|
|
44860
44884
|
var EDITABLE = "true";
|
|
44861
44885
|
var EDITING_OUTLINE = "2px solid #3CE6AC";
|
|
@@ -44941,10 +44965,10 @@ function useInlineTextEdit({
|
|
|
44941
44965
|
if (open2.element.isConnected) open2.element.innerHTML = open2.original;
|
|
44942
44966
|
teardown();
|
|
44943
44967
|
}, [teardown]);
|
|
44944
|
-
|
|
44968
|
+
useEffect59(() => {
|
|
44945
44969
|
if (readOnly && openRef.current) cancel();
|
|
44946
44970
|
}, [cancel, readOnly]);
|
|
44947
|
-
|
|
44971
|
+
useEffect59(() => {
|
|
44948
44972
|
const element = session?.element;
|
|
44949
44973
|
if (!element) return;
|
|
44950
44974
|
const onKeyDown = (event) => {
|
|
@@ -44986,7 +45010,7 @@ function useInlineTextEdit({
|
|
|
44986
45010
|
}, [session, commit2]);
|
|
44987
45011
|
const commitRef = useRef73(commit2);
|
|
44988
45012
|
commitRef.current = commit2;
|
|
44989
|
-
|
|
45013
|
+
useEffect59(() => () => commitRef.current(), []);
|
|
44990
45014
|
return { session, start, commit: commit2, cancel };
|
|
44991
45015
|
}
|
|
44992
45016
|
function placeCaret(element, at) {
|
|
@@ -45087,7 +45111,7 @@ function useInlineTextEditing(selectionRef, { enterFromWindow = false } = {}) {
|
|
|
45087
45111
|
};
|
|
45088
45112
|
const handleKeyDownRef = useRef74(handleKeyDown);
|
|
45089
45113
|
handleKeyDownRef.current = handleKeyDown;
|
|
45090
|
-
|
|
45114
|
+
useEffect60(() => {
|
|
45091
45115
|
if (!enterFromWindow) return;
|
|
45092
45116
|
const onKeyDown = (event) => {
|
|
45093
45117
|
const { body, documentElement } = window.document;
|
|
@@ -45131,7 +45155,7 @@ function useInlineTextEditing(selectionRef, { enterFromWindow = false } = {}) {
|
|
|
45131
45155
|
}
|
|
45132
45156
|
|
|
45133
45157
|
// src/components/editor/useOffCanvasIndicators.ts
|
|
45134
|
-
import { useEffect as
|
|
45158
|
+
import { useEffect as useEffect61, useRef as useRef75, useState as useState58 } from "react";
|
|
45135
45159
|
|
|
45136
45160
|
// src/components/editor/offCanvasIndicatorGeometry.ts
|
|
45137
45161
|
function rounded(value) {
|
|
@@ -45307,7 +45331,7 @@ function useOffCanvasIndicators({
|
|
|
45307
45331
|
setRects: setOffCanvasRects
|
|
45308
45332
|
})
|
|
45309
45333
|
);
|
|
45310
|
-
|
|
45334
|
+
useEffect61(() => {
|
|
45311
45335
|
offCanvasDirtyRef.current = true;
|
|
45312
45336
|
}, [activeCompositionPath]);
|
|
45313
45337
|
return { offCanvasRects, offCanvasElementsRef };
|
|
@@ -45535,7 +45559,7 @@ var DomEditOverlay = memo30(function DomEditOverlay2({
|
|
|
45535
45559
|
const inlineText = useInlineTextEditing(selectionRef, { enterFromWindow: hostInput });
|
|
45536
45560
|
const onTextEditingChangeRef = useRef77(onTextEditingChange);
|
|
45537
45561
|
onTextEditingChangeRef.current = onTextEditingChange;
|
|
45538
|
-
|
|
45562
|
+
useEffect62(() => {
|
|
45539
45563
|
if (!inlineText.editing) return;
|
|
45540
45564
|
onTextEditingChangeRef.current?.(true);
|
|
45541
45565
|
return () => onTextEditingChangeRef.current?.(false);
|
|
@@ -45627,7 +45651,7 @@ var DomEditOverlay = memo30(function DomEditOverlay2({
|
|
|
45627
45651
|
onCanvasMouseDown,
|
|
45628
45652
|
snapGuidesRef
|
|
45629
45653
|
});
|
|
45630
|
-
|
|
45654
|
+
useEffect62(() => {
|
|
45631
45655
|
if (readOnly) gestures.clearPointerState(selectionRef, true);
|
|
45632
45656
|
}, [gestures, readOnly, selectionRef]);
|
|
45633
45657
|
const cancelGestureRef = useRef77((_dropQueued) => {
|
|
@@ -45869,7 +45893,7 @@ import { useCallback as useCallback67, useMemo as useMemo44 } from "react";
|
|
|
45869
45893
|
import { useCallback as useCallback65 } from "react";
|
|
45870
45894
|
|
|
45871
45895
|
// src/components/editor/useLayerRevealOverride.ts
|
|
45872
|
-
import { useCallback as useCallback64, useEffect as
|
|
45896
|
+
import { useCallback as useCallback64, useEffect as useEffect63, useRef as useRef78 } from "react";
|
|
45873
45897
|
import { revealClip } from "@hyperframes/core/runtime/clip-reveal";
|
|
45874
45898
|
var LAYER_REVEAL_LIFT_Z = "2147483000";
|
|
45875
45899
|
var LAYER_REVEAL_PENDING_COMMIT_ATTR = "data-hf-studio-reveal-pending-commit";
|
|
@@ -46102,13 +46126,13 @@ function useLayerRevealOverride({
|
|
|
46102
46126
|
},
|
|
46103
46127
|
[cancelScheduledReveal, reveal2]
|
|
46104
46128
|
);
|
|
46105
|
-
|
|
46129
|
+
useEffect63(() => {
|
|
46106
46130
|
const pending2 = pendingRevealRef.current;
|
|
46107
46131
|
if (isPlaying || pending2 && pending2.element !== selectedElement) cancelScheduledReveal();
|
|
46108
46132
|
const base2 = stateRef.current?.base;
|
|
46109
46133
|
if (isPlaying || base2 && selectedElement !== base2) restoreReveal();
|
|
46110
46134
|
}, [cancelScheduledReveal, isPlaying, restoreReveal, selectedElement]);
|
|
46111
|
-
|
|
46135
|
+
useEffect63(
|
|
46112
46136
|
() => () => {
|
|
46113
46137
|
cancelScheduledReveal();
|
|
46114
46138
|
restoreReveal();
|
|
@@ -47331,7 +47355,8 @@ function useElementLifecycleOps({
|
|
|
47331
47355
|
if (!removeResponse.ok) {
|
|
47332
47356
|
throw await createStudioSaveHttpError(
|
|
47333
47357
|
removeResponse,
|
|
47334
|
-
`Failed to delete element from ${targetPath}
|
|
47358
|
+
`Failed to delete element from ${targetPath}`,
|
|
47359
|
+
{ path: targetPath }
|
|
47335
47360
|
);
|
|
47336
47361
|
}
|
|
47337
47362
|
const removeData = await removeResponse.json();
|
|
@@ -47875,7 +47900,7 @@ function ConnectedDomEditOverlay({
|
|
|
47875
47900
|
|
|
47876
47901
|
// src/components/editor/TopologyLens.tsx
|
|
47877
47902
|
import {
|
|
47878
|
-
useEffect as
|
|
47903
|
+
useEffect as useEffect64,
|
|
47879
47904
|
useLayoutEffect as useLayoutEffect11,
|
|
47880
47905
|
useReducer,
|
|
47881
47906
|
useRef as useRef80,
|
|
@@ -48694,8 +48719,8 @@ function useTopologyLensState() {
|
|
|
48694
48719
|
lifecycle,
|
|
48695
48720
|
(initialLifecycle) => reduceTopologyLens({ phase: "hidden" }, { type: "lifecycle", value: initialLifecycle })
|
|
48696
48721
|
);
|
|
48697
|
-
|
|
48698
|
-
|
|
48722
|
+
useEffect64(() => dispatch({ type: "lifecycle", value: lifecycle }), [lifecycle]);
|
|
48723
|
+
useEffect64(() => {
|
|
48699
48724
|
if (state.phase === "hidden") return;
|
|
48700
48725
|
const delay2 = state.phase === "acquiring" ? ACQUISITION_MS : state.phase === "sealing" ? SEAL_MS : state.terminal ? TERMINAL_RETRACT_MS : null;
|
|
48701
48726
|
if (delay2 === null) return;
|
|
@@ -48741,13 +48766,13 @@ function TopologyLens({ iframeRef, activeCompositionPath }) {
|
|
|
48741
48766
|
setMeasured(geometry2 ? { callId, geometry: geometry2 } : null);
|
|
48742
48767
|
}, [activeCompositionPath, callId, handle, iframeRef, phase]);
|
|
48743
48768
|
const livePreviewIframe = useLivePreviewIframe();
|
|
48744
|
-
|
|
48769
|
+
useEffect64(() => {
|
|
48745
48770
|
const iframe = iframeRef.current;
|
|
48746
48771
|
if (!iframe || !callId) return;
|
|
48747
48772
|
const dismiss = () => studioEditLifecycle.dismiss(callId);
|
|
48748
48773
|
return onPreviewContentReplaced(iframe, dismiss);
|
|
48749
48774
|
}, [callId, iframeRef, livePreviewIframe]);
|
|
48750
|
-
|
|
48775
|
+
useEffect64(() => {
|
|
48751
48776
|
if (pendingUnmountDismissRef.current !== null) {
|
|
48752
48777
|
window.clearTimeout(pendingUnmountDismissRef.current);
|
|
48753
48778
|
pendingUnmountDismissRef.current = null;
|
|
@@ -49005,7 +49030,7 @@ function writeKeyframeCache(sourceFile, elementId2, data) {
|
|
|
49005
49030
|
}
|
|
49006
49031
|
|
|
49007
49032
|
// src/components/editor/MotionPathOverlay.tsx
|
|
49008
|
-
import { memo as memo31, useEffect as
|
|
49033
|
+
import { memo as memo31, useEffect as useEffect66, useRef as useRef82, useState as useState61 } from "react";
|
|
49009
49034
|
|
|
49010
49035
|
// src/hooks/useGsapInteractionFailureTelemetry.ts
|
|
49011
49036
|
import { useCallback as useCallback68 } from "react";
|
|
@@ -50418,7 +50443,7 @@ function elementHome(el) {
|
|
|
50418
50443
|
}
|
|
50419
50444
|
|
|
50420
50445
|
// src/components/editor/useMotionPathData.ts
|
|
50421
|
-
import { useEffect as
|
|
50446
|
+
import { useEffect as useEffect65, useRef as useRef81, useState as useState60 } from "react";
|
|
50422
50447
|
import { isHtmlElement as isHtmlElement7 } from "@hyperframes/core/runtime/dom-realm";
|
|
50423
50448
|
function transformWDivisor(el) {
|
|
50424
50449
|
const t2 = el.ownerDocument?.defaultView?.getComputedStyle(el).transform;
|
|
@@ -50449,7 +50474,7 @@ function useMotionPathData(iframeRef, selector) {
|
|
|
50449
50474
|
const [pScale, setPScale] = useState60(1);
|
|
50450
50475
|
const armed = usePlayerStore((s) => s.motionPathArmed);
|
|
50451
50476
|
const drawn = geometry !== null || armed;
|
|
50452
|
-
|
|
50477
|
+
useEffect65(() => {
|
|
50453
50478
|
if (!selector) {
|
|
50454
50479
|
setRect(null);
|
|
50455
50480
|
setHome(null);
|
|
@@ -50490,7 +50515,7 @@ function useMotionPathData(iframeRef, selector) {
|
|
|
50490
50515
|
};
|
|
50491
50516
|
return subscribeOverlayFrame(tick);
|
|
50492
50517
|
}, [selector, iframeRef, drawn]);
|
|
50493
|
-
|
|
50518
|
+
useEffect65(() => {
|
|
50494
50519
|
if (!selector) {
|
|
50495
50520
|
setGeometry(null);
|
|
50496
50521
|
return;
|
|
@@ -50566,20 +50591,20 @@ var MotionPathOverlay = memo31(function MotionPathOverlay2({
|
|
|
50566
50591
|
geometry?.kind ?? "linear",
|
|
50567
50592
|
selection
|
|
50568
50593
|
);
|
|
50569
|
-
|
|
50594
|
+
useEffect66(() => () => clearTimeout(parkTimerRef.current), [animId]);
|
|
50570
50595
|
const createMode = geometryResolved && !geometry && Boolean(selection?.element) && !isPlaying;
|
|
50571
50596
|
const createSelector = createMode ? selectorFor(selection) : null;
|
|
50572
50597
|
const compW = compositionSize?.width ?? null;
|
|
50573
50598
|
const livePreviewIframe = useLivePreviewIframe();
|
|
50574
50599
|
const canCreate = createMode && !!createSelector && hasMotionPathPlugin(livePreviewIframe);
|
|
50575
|
-
|
|
50600
|
+
useEffect66(() => {
|
|
50576
50601
|
setMotionPathCreateAvailable(Boolean(canCreate));
|
|
50577
50602
|
return () => setMotionPathCreateAvailable(false);
|
|
50578
50603
|
}, [canCreate, setMotionPathCreateAvailable]);
|
|
50579
|
-
|
|
50604
|
+
useEffect66(() => {
|
|
50580
50605
|
if (armed && !canCreate) setMotionPathArmed(false);
|
|
50581
50606
|
}, [armed, canCreate, setMotionPathArmed]);
|
|
50582
|
-
|
|
50607
|
+
useEffect66(() => {
|
|
50583
50608
|
if (!armed || !createSelector || !compW) return;
|
|
50584
50609
|
const surface = iframeRef.current?.ownerDocument?.querySelector(
|
|
50585
50610
|
"[data-preview-pan-surface]"
|
|
@@ -50881,7 +50906,7 @@ var MotionPathOverlay = memo31(function MotionPathOverlay2({
|
|
|
50881
50906
|
});
|
|
50882
50907
|
|
|
50883
50908
|
// src/components/editor/SnapToolbar.tsx
|
|
50884
|
-
import { memo as memo32, useCallback as useCallback69, useEffect as
|
|
50909
|
+
import { memo as memo32, useCallback as useCallback69, useEffect as useEffect67, useRef as useRef83, useState as useState62 } from "react";
|
|
50885
50910
|
import { MagnetStraight, GridFour, Path, Ruler, FrameCorners } from "@phosphor-icons/react";
|
|
50886
50911
|
import { jsx as jsx117, jsxs as jsxs82 } from "react/jsx-runtime";
|
|
50887
50912
|
var SnapToolbar = memo32(function SnapToolbar2() {
|
|
@@ -50903,7 +50928,7 @@ var SnapToolbar = memo32(function SnapToolbar2() {
|
|
|
50903
50928
|
if (previous !== null && previous !== currentGridSpacing.current)
|
|
50904
50929
|
trackPreviewFeatureUsed("grid_spacing", "field");
|
|
50905
50930
|
}, []);
|
|
50906
|
-
|
|
50931
|
+
useEffect67(() => settleGridSpacing, [settleGridSpacing]);
|
|
50907
50932
|
const updatePrefs = useCallback69(
|
|
50908
50933
|
(patch) => {
|
|
50909
50934
|
actions.setSnapPrefs(patch);
|
|
@@ -50918,7 +50943,7 @@ var SnapToolbar = memo32(function SnapToolbar2() {
|
|
|
50918
50943
|
updatePrefs({ gridVisible: !prefs.gridVisible });
|
|
50919
50944
|
trackPreviewFeatureUsed("grid", "button");
|
|
50920
50945
|
}, [prefs.gridVisible, updatePrefs]);
|
|
50921
|
-
|
|
50946
|
+
useEffect67(() => {
|
|
50922
50947
|
const handleKeyDown = (e) => {
|
|
50923
50948
|
if (e.defaultPrevented) return;
|
|
50924
50949
|
if (ownsPlainKeys(e.target)) return;
|
|
@@ -50937,7 +50962,7 @@ var SnapToolbar = memo32(function SnapToolbar2() {
|
|
|
50937
50962
|
document.addEventListener("keydown", handleKeyDown);
|
|
50938
50963
|
return () => document.removeEventListener("keydown", handleKeyDown);
|
|
50939
50964
|
}, [prefs.gridVisible, prefs.snapEnabled, updatePrefs]);
|
|
50940
|
-
|
|
50965
|
+
useEffect67(() => {
|
|
50941
50966
|
if (!gridPopoverOpen) return;
|
|
50942
50967
|
const handleClickOutside = (e) => {
|
|
50943
50968
|
const target = e.target;
|
|
@@ -51128,7 +51153,7 @@ var GridOverlay = memo33(function GridOverlay2() {
|
|
|
51128
51153
|
});
|
|
51129
51154
|
|
|
51130
51155
|
// src/hooks/useCompositionDimensions.ts
|
|
51131
|
-
import { useEffect as
|
|
51156
|
+
import { useEffect as useEffect68, useState as useState63 } from "react";
|
|
51132
51157
|
function readCompositionSizeMessage(data) {
|
|
51133
51158
|
if (!isStageSizeMessage(data)) return null;
|
|
51134
51159
|
const message = data;
|
|
@@ -51156,7 +51181,7 @@ function useCompositionDimensions(iframeRef) {
|
|
|
51156
51181
|
null
|
|
51157
51182
|
);
|
|
51158
51183
|
const livePreviewIframe = useLivePreviewIframe();
|
|
51159
|
-
|
|
51184
|
+
useEffect68(() => {
|
|
51160
51185
|
const dimensions = readPreviewCompositionSize(livePreviewIframe);
|
|
51161
51186
|
if (!dimensions) return;
|
|
51162
51187
|
setCompositionDimensions(
|
|
@@ -51317,7 +51342,7 @@ function PreviewOverlays({
|
|
|
51317
51342
|
import { useCallback as useCallback72, useMemo as useMemo46 } from "react";
|
|
51318
51343
|
|
|
51319
51344
|
// src/hooks/useGsapTweenCache.ts
|
|
51320
|
-
import { useEffect as
|
|
51345
|
+
import { useEffect as useEffect69, useMemo as useMemo45, useRef as useRef84, useState as useState64, useCallback as useCallback71 } from "react";
|
|
51321
51346
|
|
|
51322
51347
|
// src/hooks/gsapRuntimeBridge.ts
|
|
51323
51348
|
import { isXYPositionWrite, PROPERTY_GROUPS } from "@hyperframes/parsers/gsap-constants";
|
|
@@ -51948,7 +51973,7 @@ function useGsapAnimationsForElement(projectId, sourceFile, target, version, ifr
|
|
|
51948
51973
|
const domClipChildrenKey = usePlayerStore(
|
|
51949
51974
|
(s) => s.domClipChildren.map((c) => `${c.id}<${c.hostId}`).join("|")
|
|
51950
51975
|
);
|
|
51951
|
-
|
|
51976
|
+
useEffect69(() => {
|
|
51952
51977
|
const targetKey = target?.id ?? target?.selector ?? "";
|
|
51953
51978
|
const fetchKey = `${projectId}:${sourceFile}:${version}:${targetKey}`;
|
|
51954
51979
|
if (fetchKey === lastFetchKeyRef.current) return;
|
|
@@ -52040,7 +52065,7 @@ function useGsapAnimationsForElement(projectId, sourceFile, target, version, ifr
|
|
|
52040
52065
|
return result;
|
|
52041
52066
|
}, [rawAnimations, allAnimations, iframeRef, targetId]);
|
|
52042
52067
|
const elementId2 = target?.id ?? null;
|
|
52043
|
-
|
|
52068
|
+
useEffect69(() => {
|
|
52044
52069
|
if (!elementId2) return;
|
|
52045
52070
|
const sourceAnimations = animations.filter(
|
|
52046
52071
|
(animation2) => !isStaticPositionHold(animation2) && (animation2.keyframes || synthesizeFlatTweenKeyframes(animation2))
|
|
@@ -52108,7 +52133,7 @@ function usePopulateKeyframeCacheForFile(projectId, sourceFile, version, iframeR
|
|
|
52108
52133
|
files: /* @__PURE__ */ new Set()
|
|
52109
52134
|
});
|
|
52110
52135
|
const runtimeScanDoneRef = useRef84("");
|
|
52111
|
-
|
|
52136
|
+
useEffect69(() => {
|
|
52112
52137
|
const dataKey = `kf-cache:${projectId}:${version}:${elementCount}:${domClipChildrenKey}:${compositionSrcKey}`;
|
|
52113
52138
|
if (!projectId) return;
|
|
52114
52139
|
const files = Array.from(
|
|
@@ -52128,7 +52153,7 @@ function usePopulateKeyframeCacheForFile(projectId, sourceFile, version, iframeR
|
|
|
52128
52153
|
});
|
|
52129
52154
|
}
|
|
52130
52155
|
}, [projectId, sourceFile, version, elementCount, domClipChildrenKey, compositionSrcKey]);
|
|
52131
|
-
|
|
52156
|
+
useEffect69(() => {
|
|
52132
52157
|
if (!projectId) return;
|
|
52133
52158
|
const sf = sourceFile;
|
|
52134
52159
|
let attempts = 0;
|
|
@@ -52634,7 +52659,7 @@ var CaptionTimeline = memo34(function CaptionTimeline2({
|
|
|
52634
52659
|
});
|
|
52635
52660
|
|
|
52636
52661
|
// src/hooks/useTimelineSelectionPreviewSync.ts
|
|
52637
|
-
import { useEffect as
|
|
52662
|
+
import { useEffect as useEffect70, useMemo as useMemo47, useRef as useRef85 } from "react";
|
|
52638
52663
|
var MAX_UNRESOLVED_SYNC_RETRIES = 3;
|
|
52639
52664
|
function orderSelectedIds(ids, anchor2) {
|
|
52640
52665
|
const ordered = [...ids];
|
|
@@ -52693,7 +52718,7 @@ function useTimelineSelectionPreviewSync({
|
|
|
52693
52718
|
const unresolvedAttemptsRef = useRef85({ id: "", count: 0 });
|
|
52694
52719
|
domEditSelectionRef.current = domEditSelection;
|
|
52695
52720
|
domEditGroupSelectionsRef.current = domEditGroupSelections;
|
|
52696
|
-
|
|
52721
|
+
useEffect70(() => {
|
|
52697
52722
|
const previousSelectedKey = lastSyncedSelectedKeyRef.current;
|
|
52698
52723
|
lastSyncedSelectedKeyRef.current = selectedKey;
|
|
52699
52724
|
const currentDomEditSelection = domEditSelectionRef.current;
|
|
@@ -52775,10 +52800,10 @@ function useTimelineSelectionPreviewSync({
|
|
|
52775
52800
|
}
|
|
52776
52801
|
|
|
52777
52802
|
// src/webmcp/StudioAgentTools.tsx
|
|
52778
|
-
import { useCallback as useCallback74, useEffect as
|
|
52803
|
+
import { useCallback as useCallback74, useEffect as useEffect72, useMemo as useMemo48 } from "react";
|
|
52779
52804
|
|
|
52780
52805
|
// src/webmcp/useStudioAgentTools.ts
|
|
52781
|
-
import { useEffect as
|
|
52806
|
+
import { useEffect as useEffect71, useRef as useRef86 } from "react";
|
|
52782
52807
|
|
|
52783
52808
|
// src/webmcp/types.ts
|
|
52784
52809
|
function isModelContext(value) {
|
|
@@ -54008,7 +54033,7 @@ function readNumberInput(input, key2) {
|
|
|
54008
54033
|
function useStudioAgentTools(deps) {
|
|
54009
54034
|
const depsRef = useRef86(deps);
|
|
54010
54035
|
depsRef.current = deps;
|
|
54011
|
-
|
|
54036
|
+
useEffect71(() => {
|
|
54012
54037
|
if (readStudioUiPreferences().agentToolsEnabled === false) {
|
|
54013
54038
|
log2("skipped", { why: "disabled by preference" });
|
|
54014
54039
|
return;
|
|
@@ -54072,7 +54097,7 @@ function StudioAgentTools() {
|
|
|
54072
54097
|
handleGsapDeleteAnimation,
|
|
54073
54098
|
getGsapAnimationsForSelection
|
|
54074
54099
|
} = useDomEditActionsContext();
|
|
54075
|
-
|
|
54100
|
+
useEffect72(() => {
|
|
54076
54101
|
studioEditLifecycle.activateProject(projectId);
|
|
54077
54102
|
return () => studioEditLifecycle.reset();
|
|
54078
54103
|
}, [projectId]);
|
|
@@ -54193,7 +54218,7 @@ import {
|
|
|
54193
54218
|
createContext as createContext7,
|
|
54194
54219
|
useCallback as useCallback77,
|
|
54195
54220
|
useContext as useContext11,
|
|
54196
|
-
useEffect as
|
|
54221
|
+
useEffect as useEffect73,
|
|
54197
54222
|
useRef as useRef87,
|
|
54198
54223
|
useState as useState65
|
|
54199
54224
|
} from "react";
|
|
@@ -54752,7 +54777,7 @@ function Root({
|
|
|
54752
54777
|
}, []);
|
|
54753
54778
|
const disposeRef = useRef87(() => {
|
|
54754
54779
|
});
|
|
54755
|
-
|
|
54780
|
+
useEffect73(() => () => disposeRef.current(), []);
|
|
54756
54781
|
const onReady = useCallback77(
|
|
54757
54782
|
({ api }) => {
|
|
54758
54783
|
disposeRef.current();
|
|
@@ -54830,7 +54855,7 @@ function Panel({ id, title, children }) {
|
|
|
54830
54855
|
const controller = useDockLayoutStore((state) => state.controller);
|
|
54831
54856
|
const open2 = useDockLayoutStore((state) => state.openPanels.has(id));
|
|
54832
54857
|
const label = title ?? PANEL_DEFINITIONS[id].title;
|
|
54833
|
-
|
|
54858
|
+
useEffect73(() => {
|
|
54834
54859
|
if (open2) controller?.setTitle(id, label);
|
|
54835
54860
|
}, [controller, id, label, open2]);
|
|
54836
54861
|
const definition = PANEL_DEFINITIONS[id];
|
|
@@ -54844,7 +54869,7 @@ function WindowMenu() {
|
|
|
54844
54869
|
const resetLayout = useDockLayoutStore((state) => state.resetLayout);
|
|
54845
54870
|
const [open2, setOpen] = useState65(false);
|
|
54846
54871
|
const rootRef = useRef87(null);
|
|
54847
|
-
|
|
54872
|
+
useEffect73(() => {
|
|
54848
54873
|
if (!open2) return;
|
|
54849
54874
|
const close = (event) => {
|
|
54850
54875
|
if (!rootRef.current?.contains(event.target)) setOpen(false);
|
|
@@ -55362,7 +55387,7 @@ function AudibleVideoClipContent({
|
|
|
55362
55387
|
}
|
|
55363
55388
|
|
|
55364
55389
|
// src/player/components/ClipPeakMarks.tsx
|
|
55365
|
-
import { useContext as useContext12, useEffect as
|
|
55390
|
+
import { useContext as useContext12, useEffect as useEffect74, useState as useState66 } from "react";
|
|
55366
55391
|
import { jsx as jsx128, jsxs as jsxs91 } from "react/jsx-runtime";
|
|
55367
55392
|
var dbText2 = (db) => `${db < 0 ? "\u2212" : "+"}${Math.abs(db).toFixed(1)} dBFS`;
|
|
55368
55393
|
function ClipPeakMarks({
|
|
@@ -55372,7 +55397,7 @@ function ClipPeakMarks({
|
|
|
55372
55397
|
children
|
|
55373
55398
|
}) {
|
|
55374
55399
|
const [map, setMap] = useState66(null);
|
|
55375
|
-
|
|
55400
|
+
useEffect74(() => {
|
|
55376
55401
|
if (!peaksUrl) return;
|
|
55377
55402
|
let live = true;
|
|
55378
55403
|
void loadPeakMap(peaksUrl).then((loaded) => {
|
|
@@ -55385,7 +55410,7 @@ function ClipPeakMarks({
|
|
|
55385
55410
|
const { runs, peakDbfs } = map ? clipPeakRuns(map, sourceWindow, gain) : { runs: [], peakDbfs: null };
|
|
55386
55411
|
const detail = runs.length > 0 && peakDbfs !== null ? `Peaks ${dbText2(peakDbfs)} at this volume; export lowers the whole mix` : null;
|
|
55387
55412
|
const setDetail = useContext12(ClipPeakDescriptionContext);
|
|
55388
|
-
|
|
55413
|
+
useEffect74(() => {
|
|
55389
55414
|
setDetail?.(detail);
|
|
55390
55415
|
return () => setDetail?.(null);
|
|
55391
55416
|
}, [detail, setDetail]);
|
|
@@ -55620,7 +55645,7 @@ function useThumbnailStill(url, projectId, { sessionEpoch = 0, priority = "visib
|
|
|
55620
55645
|
}
|
|
55621
55646
|
|
|
55622
55647
|
// src/components/editor/SourceEditor.tsx
|
|
55623
|
-
import { useRef as useRef88, useCallback as useCallback80, useEffect as
|
|
55648
|
+
import { useRef as useRef88, useCallback as useCallback80, useEffect as useEffect75, memo as memo37 } from "react";
|
|
55624
55649
|
import {
|
|
55625
55650
|
EditorView as EditorView2,
|
|
55626
55651
|
keymap,
|
|
@@ -55817,7 +55842,7 @@ var SourceEditor = memo37(function SourceEditor2({
|
|
|
55817
55842
|
},
|
|
55818
55843
|
[filePath, language, readOnly]
|
|
55819
55844
|
);
|
|
55820
|
-
|
|
55845
|
+
useEffect75(() => {
|
|
55821
55846
|
const view = editorRef.current;
|
|
55822
55847
|
if (!view) return;
|
|
55823
55848
|
const current2 = view.state.doc.toString();
|
|
@@ -55828,7 +55853,7 @@ var SourceEditor = memo37(function SourceEditor2({
|
|
|
55828
55853
|
annotations: [ExternalSync.of(true)]
|
|
55829
55854
|
});
|
|
55830
55855
|
}, [content]);
|
|
55831
|
-
|
|
55856
|
+
useEffect75(() => {
|
|
55832
55857
|
const view = editorRef.current;
|
|
55833
55858
|
if (!view || revealOffset == null || revealOffset < 0) return;
|
|
55834
55859
|
const docLen = view.state.doc.length;
|
|
@@ -56504,13 +56529,13 @@ function buildElementInfoText(element, sourceLabel, gsapAnimations, previewIfram
|
|
|
56504
56529
|
}
|
|
56505
56530
|
|
|
56506
56531
|
// src/components/editor/propertyPanelPrimitives.tsx
|
|
56507
|
-
import { useCallback as useCallback83, useEffect as
|
|
56532
|
+
import { useCallback as useCallback83, useEffect as useEffect78, useRef as useRef91, useState as useState69 } from "react";
|
|
56508
56533
|
|
|
56509
56534
|
// src/components/editor/propertyPanelCommitField.tsx
|
|
56510
|
-
import { useEffect as
|
|
56535
|
+
import { useEffect as useEffect77, useRef as useRef90, useState as useState68 } from "react";
|
|
56511
56536
|
|
|
56512
56537
|
// src/components/editor/useInspectorGestureTransaction.ts
|
|
56513
|
-
import { useCallback as useCallback82, useEffect as
|
|
56538
|
+
import { useCallback as useCallback82, useEffect as useEffect76, useRef as useRef89, useState as useState67 } from "react";
|
|
56514
56539
|
function isPromiseCommit(result) {
|
|
56515
56540
|
return Boolean(result && typeof result.then === "function");
|
|
56516
56541
|
}
|
|
@@ -56602,7 +56627,7 @@ function useInspectorGestureTransaction({
|
|
|
56602
56627
|
previewRef.current(active.before);
|
|
56603
56628
|
}
|
|
56604
56629
|
}, []);
|
|
56605
|
-
|
|
56630
|
+
useEffect76(() => cancel, [cancel]);
|
|
56606
56631
|
return { begin, preview: preview2, settle, cancel, activeRef };
|
|
56607
56632
|
}
|
|
56608
56633
|
function useInspectorGestureDraft({
|
|
@@ -56622,7 +56647,7 @@ function useInspectorGestureDraft({
|
|
|
56622
56647
|
return onCommit(next);
|
|
56623
56648
|
}
|
|
56624
56649
|
});
|
|
56625
|
-
|
|
56650
|
+
useEffect76(() => {
|
|
56626
56651
|
if (!transaction.activeRef.current) setDraft(sourceValue);
|
|
56627
56652
|
}, [sourceValue, transaction.activeRef]);
|
|
56628
56653
|
return { draft, setDraft, transaction };
|
|
@@ -56762,11 +56787,11 @@ function CommitField({
|
|
|
56762
56787
|
}
|
|
56763
56788
|
previewNumericKeyStep(event);
|
|
56764
56789
|
};
|
|
56765
|
-
|
|
56790
|
+
useEffect77(() => {
|
|
56766
56791
|
if (focusedRef.current && dirtyRef.current) return;
|
|
56767
56792
|
setDraft(value);
|
|
56768
56793
|
}, [value]);
|
|
56769
|
-
|
|
56794
|
+
useEffect77(() => {
|
|
56770
56795
|
const el = inputRef.current;
|
|
56771
56796
|
if (!el) return;
|
|
56772
56797
|
const handler = (event) => {
|
|
@@ -56917,10 +56942,10 @@ function SliderControl({
|
|
|
56917
56942
|
const interactionChangedRef = useRef91(false);
|
|
56918
56943
|
const valueRef = useRef91(value);
|
|
56919
56944
|
valueRef.current = value;
|
|
56920
|
-
|
|
56945
|
+
useEffect78(() => {
|
|
56921
56946
|
setDraft(value);
|
|
56922
56947
|
}, [value]);
|
|
56923
|
-
|
|
56948
|
+
useEffect78(
|
|
56924
56949
|
() => () => {
|
|
56925
56950
|
if (commitTimerRef.current) clearTimeout(commitTimerRef.current);
|
|
56926
56951
|
},
|
|
@@ -57158,7 +57183,7 @@ function createTransformCommitHandlers({
|
|
|
57158
57183
|
import { resolveEditingSections } from "@hyperframes/core/editing";
|
|
57159
57184
|
|
|
57160
57185
|
// src/components/editor/propertyPanelMediaSection.tsx
|
|
57161
|
-
import { useEffect as
|
|
57186
|
+
import { useEffect as useEffect79, useState as useState70 } from "react";
|
|
57162
57187
|
import {
|
|
57163
57188
|
AUDIO_GAIN_FADER_MAX as AUDIO_GAIN_FADER_MAX2,
|
|
57164
57189
|
AUDIO_GAIN_FADER_MIN as AUDIO_GAIN_FADER_MIN2,
|
|
@@ -57268,7 +57293,7 @@ function MediaSection({
|
|
|
57268
57293
|
const absoluteSrc = projectDir && projectSrc ? `${projectDir}/${projectSrc}` : srcAttr;
|
|
57269
57294
|
const canRemoveBackground = Boolean(onRemoveBackground && isVisualMedia && projectSrc);
|
|
57270
57295
|
const panelTitle = isImage ? "Image" : isVideo ? "Video" : "Audio";
|
|
57271
|
-
|
|
57296
|
+
useEffect79(() => {
|
|
57272
57297
|
setRemoveProgress(null);
|
|
57273
57298
|
setCreatePlate(false);
|
|
57274
57299
|
}, [srcAttr]);
|
|
@@ -57563,7 +57588,7 @@ import {
|
|
|
57563
57588
|
} from "@hyperframes/core/color-grading";
|
|
57564
57589
|
|
|
57565
57590
|
// src/components/editor/propertyPanelColorGradingSlider.tsx
|
|
57566
|
-
import { useCallback as useCallback84, useEffect as
|
|
57591
|
+
import { useCallback as useCallback84, useEffect as useEffect80, useRef as useRef92, useState as useState71 } from "react";
|
|
57567
57592
|
import { jsx as jsx135, jsxs as jsxs95 } from "react/jsx-runtime";
|
|
57568
57593
|
var SLIDER_THUMB_SIZE = 10;
|
|
57569
57594
|
var SLIDER_THUMB_RADIUS = SLIDER_THUMB_SIZE / 2;
|
|
@@ -57606,7 +57631,7 @@ function ColorGradingSliderControl({
|
|
|
57606
57631
|
const interactionChangedRef = useRef92(false);
|
|
57607
57632
|
const valueRef = useRef92(value);
|
|
57608
57633
|
valueRef.current = value;
|
|
57609
|
-
|
|
57634
|
+
useEffect80(
|
|
57610
57635
|
() => () => {
|
|
57611
57636
|
if (commitTimerRef.current) clearTimeout(commitTimerRef.current);
|
|
57612
57637
|
},
|
|
@@ -58280,7 +58305,7 @@ function ColorGradingControls({
|
|
|
58280
58305
|
}
|
|
58281
58306
|
|
|
58282
58307
|
// src/components/editor/useColorGradingController.ts
|
|
58283
|
-
import { useCallback as useCallback86, useEffect as
|
|
58308
|
+
import { useCallback as useCallback86, useEffect as useEffect82, useMemo as useMemo53, useRef as useRef95, useState as useState74 } from "react";
|
|
58284
58309
|
import {
|
|
58285
58310
|
HF_COLOR_GRADING_ATTR as HF_COLOR_GRADING_ATTR3,
|
|
58286
58311
|
hasHfColorGradingAuthoredValues,
|
|
@@ -58290,7 +58315,7 @@ import {
|
|
|
58290
58315
|
} from "@hyperframes/core/color-grading";
|
|
58291
58316
|
|
|
58292
58317
|
// src/components/editor/useColorGradingPreviews.ts
|
|
58293
|
-
import { useCallback as useCallback85, useEffect as
|
|
58318
|
+
import { useCallback as useCallback85, useEffect as useEffect81, useRef as useRef94, useState as useState73 } from "react";
|
|
58294
58319
|
import {
|
|
58295
58320
|
HF_COLOR_GRADING_ACTIVE_EFFECT_KEYS,
|
|
58296
58321
|
HF_COLOR_GRADING_EFFECT_APPLY_DEFAULTS,
|
|
@@ -58371,7 +58396,7 @@ function useColorGradingPreviews({
|
|
|
58371
58396
|
}
|
|
58372
58397
|
const previews = state.identityKey === identityKey ? state.previews : emptyPreviews();
|
|
58373
58398
|
const livePreviewIframe = useLivePreviewIframe();
|
|
58374
|
-
|
|
58399
|
+
useEffect81(() => {
|
|
58375
58400
|
if (!request2) return;
|
|
58376
58401
|
const { kind } = request2;
|
|
58377
58402
|
const iframe = previewIframeRef?.current;
|
|
@@ -58518,7 +58543,7 @@ function useColorGradingPreviews({
|
|
|
58518
58543
|
},
|
|
58519
58544
|
[gradingRef, postColorGrading, previewIframeRef, stopAnimatedPreview, target]
|
|
58520
58545
|
);
|
|
58521
|
-
|
|
58546
|
+
useEffect81(() => stopAnimatedPreview, [identityKey, stopAnimatedPreview]);
|
|
58522
58547
|
const requestPreviews = useCallback85(
|
|
58523
58548
|
(kind, effects) => {
|
|
58524
58549
|
setRequest((current2) => ({
|
|
@@ -58674,7 +58699,7 @@ function useColorGradingController({
|
|
|
58674
58699
|
setRuntimeStatus({ state: "pending", message: "Waiting for runtime" });
|
|
58675
58700
|
setMediaMetadata(null);
|
|
58676
58701
|
}
|
|
58677
|
-
|
|
58702
|
+
useEffect82(() => {
|
|
58678
58703
|
return () => {
|
|
58679
58704
|
for (const timer of statusTimersRef.current) clearTimeout(timer);
|
|
58680
58705
|
statusTimersRef.current = [];
|
|
@@ -58702,7 +58727,7 @@ function useColorGradingController({
|
|
|
58702
58727
|
const refreshRuntimeStatus = useCallback86(() => {
|
|
58703
58728
|
setRuntimeStatus(readRuntimeColorGradingStatus(previewIframeRef?.current, target));
|
|
58704
58729
|
}, [previewIframeRef, target]);
|
|
58705
|
-
|
|
58730
|
+
useEffect82(() => {
|
|
58706
58731
|
setMediaMetadata(null);
|
|
58707
58732
|
if (!selectedAssetPath) return;
|
|
58708
58733
|
const cacheKey = mediaMetadataUrl(projectId, selectedAssetPath);
|
|
@@ -58738,7 +58763,7 @@ function useColorGradingController({
|
|
|
58738
58763
|
(delay2) => window.setTimeout(refreshRuntimeStatus, delay2)
|
|
58739
58764
|
);
|
|
58740
58765
|
}, [clearStatusTimers, refreshRuntimeStatus]);
|
|
58741
|
-
|
|
58766
|
+
useEffect82(() => {
|
|
58742
58767
|
refreshRuntimeStatus();
|
|
58743
58768
|
}, [refreshRuntimeStatus]);
|
|
58744
58769
|
const persistColorGradingValue = useCallback86(
|
|
@@ -58786,8 +58811,8 @@ function useColorGradingController({
|
|
|
58786
58811
|
onSetAttributeLive
|
|
58787
58812
|
);
|
|
58788
58813
|
}, [onSetAttributeLive, persistColorGradingValue]);
|
|
58789
|
-
|
|
58790
|
-
|
|
58814
|
+
useEffect82(() => addStudioPendingEditFlushListener(flushPendingPersist), [flushPendingPersist]);
|
|
58815
|
+
useEffect82(() => {
|
|
58791
58816
|
return () => {
|
|
58792
58817
|
clearStatusTimers();
|
|
58793
58818
|
void flushPendingPersist();
|
|
@@ -58824,7 +58849,7 @@ function useColorGradingController({
|
|
|
58824
58849
|
[previewIframeRef, target]
|
|
58825
58850
|
);
|
|
58826
58851
|
const livePreviewIframe = useLivePreviewIframe();
|
|
58827
|
-
|
|
58852
|
+
useEffect82(() => {
|
|
58828
58853
|
const iframe = previewIframeRef?.current;
|
|
58829
58854
|
if (!iframe) return;
|
|
58830
58855
|
const refreshAndReplay = () => {
|
|
@@ -58856,7 +58881,7 @@ function useColorGradingController({
|
|
|
58856
58881
|
scheduleRuntimeStatusRefresh,
|
|
58857
58882
|
livePreviewIframe
|
|
58858
58883
|
]);
|
|
58859
|
-
|
|
58884
|
+
useEffect82(
|
|
58860
58885
|
() => () => {
|
|
58861
58886
|
postCompare(false);
|
|
58862
58887
|
},
|
|
@@ -59160,10 +59185,10 @@ function ColorGradingSection({
|
|
|
59160
59185
|
}
|
|
59161
59186
|
|
|
59162
59187
|
// src/components/editor/propertyPanelSections.tsx
|
|
59163
|
-
import { useEffect as
|
|
59188
|
+
import { useEffect as useEffect88, useRef as useRef100, useState as useState83 } from "react";
|
|
59164
59189
|
|
|
59165
59190
|
// src/components/editor/propertyPanelColor.tsx
|
|
59166
|
-
import { useCallback as useCallback87, useEffect as
|
|
59191
|
+
import { useCallback as useCallback87, useEffect as useEffect83, useLayoutEffect as useLayoutEffect12, useRef as useRef96, useState as useState75 } from "react";
|
|
59167
59192
|
import { createPortal as createPortal13 } from "react-dom";
|
|
59168
59193
|
import { jsx as jsx138, jsxs as jsxs98 } from "react/jsx-runtime";
|
|
59169
59194
|
var COLOR_PICKER_SIZE = { width: 292, height: 386 };
|
|
@@ -59342,7 +59367,7 @@ function ColorField({
|
|
|
59342
59367
|
if (resolved2) persistColorValue(resolved2.value);
|
|
59343
59368
|
}
|
|
59344
59369
|
});
|
|
59345
|
-
|
|
59370
|
+
useEffect83(() => {
|
|
59346
59371
|
const nextColor = colorFromCss(value);
|
|
59347
59372
|
setDraftColor(nextColor);
|
|
59348
59373
|
setHexDraft(toHexColor(nextColor).toUpperCase());
|
|
@@ -59373,7 +59398,7 @@ function ColorField({
|
|
|
59373
59398
|
window.removeEventListener("scroll", handlePositionInvalidated, true);
|
|
59374
59399
|
};
|
|
59375
59400
|
}, [open2, updatePanelPosition]);
|
|
59376
|
-
|
|
59401
|
+
useEffect83(() => {
|
|
59377
59402
|
if (!open2) return;
|
|
59378
59403
|
panelRef.current?.focus();
|
|
59379
59404
|
const restoreTarget = buttonRef.current;
|
|
@@ -59670,7 +59695,7 @@ function ColorField({
|
|
|
59670
59695
|
}
|
|
59671
59696
|
|
|
59672
59697
|
// src/components/editor/propertyPanelFont.tsx
|
|
59673
|
-
import { useEffect as
|
|
59698
|
+
import { useEffect as useEffect84, useMemo as useMemo54, useRef as useRef97, useState as useState76, useSyncExternalStore as useSyncExternalStore11 } from "react";
|
|
59674
59699
|
|
|
59675
59700
|
// src/components/editor/fontAssets.ts
|
|
59676
59701
|
var FONT_EXT_RE = /\.(eot|otf|ttc|ttf|woff2?)$/i;
|
|
@@ -59846,7 +59871,7 @@ function FontFamilyField({
|
|
|
59846
59871
|
if (nextValue !== value) track2("select", "Font family");
|
|
59847
59872
|
onCommit(nextValue);
|
|
59848
59873
|
};
|
|
59849
|
-
|
|
59874
|
+
useEffect84(() => {
|
|
59850
59875
|
if (!open2) return;
|
|
59851
59876
|
const handlePointerDown = (event) => {
|
|
59852
59877
|
const target = event.target;
|
|
@@ -59856,14 +59881,14 @@ function FontFamilyField({
|
|
|
59856
59881
|
document.addEventListener("pointerdown", handlePointerDown);
|
|
59857
59882
|
return () => document.removeEventListener("pointerdown", handlePointerDown);
|
|
59858
59883
|
}, [open2]);
|
|
59859
|
-
|
|
59884
|
+
useEffect84(() => {
|
|
59860
59885
|
if (!open2) return;
|
|
59861
59886
|
requestAnimationFrame(() => inputRef.current?.focus());
|
|
59862
59887
|
}, [open2]);
|
|
59863
|
-
|
|
59888
|
+
useEffect84(() => {
|
|
59864
59889
|
if (open2) loadFontLists();
|
|
59865
59890
|
}, [open2]);
|
|
59866
|
-
|
|
59891
|
+
useEffect84(() => {
|
|
59867
59892
|
if (lists.googleKeys.has(currentFamily.toLowerCase())) {
|
|
59868
59893
|
loadGoogleFontStylesheet(currentFamily);
|
|
59869
59894
|
}
|
|
@@ -60171,7 +60196,7 @@ function FontFamilyField({
|
|
|
60171
60196
|
}
|
|
60172
60197
|
|
|
60173
60198
|
// src/components/editor/PromotableControl.tsx
|
|
60174
|
-
import { useEffect as
|
|
60199
|
+
import { useEffect as useEffect86 } from "react";
|
|
60175
60200
|
|
|
60176
60201
|
// src/components/panels/VariablesBindElement.tsx
|
|
60177
60202
|
import { useMemo as useMemo55, useState as useState78 } from "react";
|
|
@@ -60572,7 +60597,7 @@ function uniqueId(base2, existing) {
|
|
|
60572
60597
|
}
|
|
60573
60598
|
|
|
60574
60599
|
// src/contexts/VariablePromoteContext.tsx
|
|
60575
|
-
import { useContext as useContext14, useEffect as
|
|
60600
|
+
import { useContext as useContext14, useEffect as useEffect85, useMemo as useMemo56, useState as useState79 } from "react";
|
|
60576
60601
|
import { jsx as jsx142 } from "react/jsx-runtime";
|
|
60577
60602
|
var VariablePromoteContext = createStableContext(
|
|
60578
60603
|
"VariablePromoteContext",
|
|
@@ -60591,7 +60616,7 @@ function VariablePromoteProvider({
|
|
|
60591
60616
|
children
|
|
60592
60617
|
}) {
|
|
60593
60618
|
const [revision, setRevision] = useState79(0);
|
|
60594
|
-
|
|
60619
|
+
useEffect85(() => {
|
|
60595
60620
|
if (!session) return;
|
|
60596
60621
|
return session.on("change", () => setRevision((r) => r + 1));
|
|
60597
60622
|
}, [session]);
|
|
@@ -60653,7 +60678,7 @@ function PromotableControl({
|
|
|
60653
60678
|
}) {
|
|
60654
60679
|
const promote = useVariablePromoteChannel(channel);
|
|
60655
60680
|
const danglingId = enabled && promote && promote.boundId != null && promote.declaration == null ? promote.boundId : null;
|
|
60656
|
-
|
|
60681
|
+
useEffect86(() => {
|
|
60657
60682
|
if (danglingId != null) {
|
|
60658
60683
|
console.warn(
|
|
60659
60684
|
`[hyperframes] Control is bound to variable "${danglingId}", but no such declaration exists. The element still carries the binding on disk. Re-declare the variable or unbind the element.`
|
|
@@ -60703,7 +60728,7 @@ function PromotableControl({
|
|
|
60703
60728
|
}
|
|
60704
60729
|
|
|
60705
60730
|
// src/components/editor/propertyPanelStyleSections.tsx
|
|
60706
|
-
import { useEffect as
|
|
60731
|
+
import { useEffect as useEffect87, useRef as useRef99, useState as useState82 } from "react";
|
|
60707
60732
|
|
|
60708
60733
|
// src/components/editor/gradientValue.ts
|
|
60709
60734
|
var RADIAL_SIZE_KEYWORDS = [
|
|
@@ -61742,10 +61767,10 @@ function StyleSections({
|
|
|
61742
61767
|
const lastGradientRef = useRef99(
|
|
61743
61768
|
backgroundImage.includes("gradient") ? backgroundImage : null
|
|
61744
61769
|
);
|
|
61745
|
-
|
|
61770
|
+
useEffect87(() => {
|
|
61746
61771
|
lastGradientRef.current = null;
|
|
61747
61772
|
}, [element.id, element.selector]);
|
|
61748
|
-
|
|
61773
|
+
useEffect87(() => {
|
|
61749
61774
|
setPreferredFillMode(fillMode);
|
|
61750
61775
|
if (backgroundImage.includes("gradient")) {
|
|
61751
61776
|
lastGradientRef.current = backgroundImage;
|
|
@@ -62202,17 +62227,17 @@ function TextAreaField({
|
|
|
62202
62227
|
const focusedRef = useRef100(false);
|
|
62203
62228
|
const valueRef = useRef100(value);
|
|
62204
62229
|
valueRef.current = value;
|
|
62205
|
-
|
|
62230
|
+
useEffect88(() => {
|
|
62206
62231
|
if (focusedRef.current) return;
|
|
62207
62232
|
setDraft(value);
|
|
62208
62233
|
}, [value]);
|
|
62209
|
-
|
|
62234
|
+
useEffect88(
|
|
62210
62235
|
() => () => {
|
|
62211
62236
|
if (commitTimerRef.current) clearTimeout(commitTimerRef.current);
|
|
62212
62237
|
},
|
|
62213
62238
|
[]
|
|
62214
62239
|
);
|
|
62215
|
-
|
|
62240
|
+
useEffect88(() => {
|
|
62216
62241
|
if (!autoFocus) return;
|
|
62217
62242
|
textareaRef.current?.focus();
|
|
62218
62243
|
}, [autoFocus]);
|
|
@@ -62509,7 +62534,7 @@ function TextSection({
|
|
|
62509
62534
|
const [activeTextFieldKey, setActiveTextFieldKey] = useState83(
|
|
62510
62535
|
element.textFields[0]?.key ?? null
|
|
62511
62536
|
);
|
|
62512
|
-
|
|
62537
|
+
useEffect88(() => {
|
|
62513
62538
|
const nextFields = element.textFields;
|
|
62514
62539
|
setActiveTextFieldKey((current2) => {
|
|
62515
62540
|
if (current2 && nextFields.some((field) => field.key === current2)) return current2;
|
|
@@ -62611,7 +62636,7 @@ import { useCallback as useCallback91, useState as useState85 } from "react";
|
|
|
62611
62636
|
import { useShallow } from "zustand/react/shallow";
|
|
62612
62637
|
|
|
62613
62638
|
// src/components/editor/AnimationCard.tsx
|
|
62614
|
-
import { memo as memo39, useCallback as useCallback90, useEffect as
|
|
62639
|
+
import { memo as memo39, useCallback as useCallback90, useEffect as useEffect89, useMemo as useMemo58, useRef as useRef101, useState as useState84 } from "react";
|
|
62615
62640
|
import { SUPPORTED_EASES, SUPPORTED_PROPS } from "@hyperframes/core/gsap-constants";
|
|
62616
62641
|
|
|
62617
62642
|
// src/components/editor/gsapAnimationHelpers.ts
|
|
@@ -63158,7 +63183,7 @@ var AnimationCard = memo39(function AnimationCard2({
|
|
|
63158
63183
|
const [focusedCollidingAnimationTargets, setFocusedCollidingAnimationTargets] = useState84();
|
|
63159
63184
|
const cardRef = useRef101(null);
|
|
63160
63185
|
const pendingAutoScrollRef = useRef101(false);
|
|
63161
|
-
|
|
63186
|
+
useEffect89(() => {
|
|
63162
63187
|
if (!focusedSegment) return;
|
|
63163
63188
|
setExpanded(true);
|
|
63164
63189
|
pendingAutoScrollRef.current = true;
|
|
@@ -63166,7 +63191,7 @@ var AnimationCard = memo39(function AnimationCard2({
|
|
|
63166
63191
|
setFocusedCollidingAnimationTargets(focusedSegment.collidingAnimationTargets);
|
|
63167
63192
|
onFocusSegmentConsumed?.();
|
|
63168
63193
|
}, [focusedSegment, onFocusSegmentConsumed]);
|
|
63169
|
-
|
|
63194
|
+
useEffect89(() => {
|
|
63170
63195
|
if (!pendingAutoScrollRef.current || expandedKfPct === null) return;
|
|
63171
63196
|
const segment = cardRef.current?.querySelector(
|
|
63172
63197
|
`[data-ease-segment-pct="${expandedKfPct}"]`
|
|
@@ -63746,7 +63771,7 @@ var GsapAnimationSection = memo40(function GsapAnimationSection2({
|
|
|
63746
63771
|
import { useState as useState87 } from "react";
|
|
63747
63772
|
|
|
63748
63773
|
// src/components/editor/Transform3DCube.tsx
|
|
63749
|
-
import { useEffect as
|
|
63774
|
+
import { useEffect as useEffect90, useRef as useRef102, useState as useState86 } from "react";
|
|
63750
63775
|
|
|
63751
63776
|
// src/components/editor/transform3dProjection.ts
|
|
63752
63777
|
var DEG = Math.PI / 180;
|
|
@@ -63869,7 +63894,7 @@ function Transform3DCube({
|
|
|
63869
63894
|
const lens = perspective > 0 ? perspective : defaultPerspective;
|
|
63870
63895
|
const depthRef = useRef102({ z, onDepthDraft, onDepthCommit, lens });
|
|
63871
63896
|
depthRef.current = { z, onDepthDraft, onDepthCommit, lens };
|
|
63872
|
-
|
|
63897
|
+
useEffect90(() => {
|
|
63873
63898
|
const el = svgRef.current;
|
|
63874
63899
|
if (!el) return;
|
|
63875
63900
|
let pending2 = null;
|
|
@@ -64390,7 +64415,7 @@ function PropertyPanel3dTransform({
|
|
|
64390
64415
|
}
|
|
64391
64416
|
|
|
64392
64417
|
// src/components/editor/PropertyPanelFlat.tsx
|
|
64393
|
-
import { useEffect as
|
|
64418
|
+
import { useEffect as useEffect110, useMemo as useMemo65, useRef as useRef118, useState as useState109 } from "react";
|
|
64394
64419
|
import { useShallow as useShallow2 } from "zustand/react/shallow";
|
|
64395
64420
|
|
|
64396
64421
|
// src/components/editor/audioFxSummary.ts
|
|
@@ -64624,10 +64649,10 @@ function PropertyPanelFlatFooter({
|
|
|
64624
64649
|
}
|
|
64625
64650
|
|
|
64626
64651
|
// src/components/editor/propertyPanelFlatPrimitives.tsx
|
|
64627
|
-
import { useEffect as
|
|
64652
|
+
import { useEffect as useEffect92, useRef as useRef104, useState as useState89 } from "react";
|
|
64628
64653
|
|
|
64629
64654
|
// src/components/editor/propertyPanelFlatSliderReadout.tsx
|
|
64630
|
-
import { useEffect as
|
|
64655
|
+
import { useEffect as useEffect91, useRef as useRef103, useState as useState88 } from "react";
|
|
64631
64656
|
import { jsx as jsx161 } from "react/jsx-runtime";
|
|
64632
64657
|
function FlatSliderReadout({
|
|
64633
64658
|
label,
|
|
@@ -64642,7 +64667,7 @@ function FlatSliderReadout({
|
|
|
64642
64667
|
const [invalid, setInvalid] = useState88(false);
|
|
64643
64668
|
const inputRef = useRef103(null);
|
|
64644
64669
|
const editable = Boolean(onCommitText) && !disabled;
|
|
64645
|
-
|
|
64670
|
+
useEffect91(() => {
|
|
64646
64671
|
if (!editing) return;
|
|
64647
64672
|
inputRef.current?.focus();
|
|
64648
64673
|
inputRef.current?.select();
|
|
@@ -64998,12 +65023,12 @@ function FlatSlider({
|
|
|
64998
65023
|
const explicitReleaseRef = useRef104(false);
|
|
64999
65024
|
const dragStartValueRef = useRef104(value);
|
|
65000
65025
|
const activePointerIdRef = useRef104(null);
|
|
65001
|
-
|
|
65026
|
+
useEffect92(() => {
|
|
65002
65027
|
if (draggingRef.current) return;
|
|
65003
65028
|
setDraft(value);
|
|
65004
65029
|
lastCommittedRef.current = value;
|
|
65005
65030
|
}, [value]);
|
|
65006
|
-
|
|
65031
|
+
useEffect92(
|
|
65007
65032
|
() => () => {
|
|
65008
65033
|
if (commitTimerRef.current) {
|
|
65009
65034
|
clearTimeout(commitTimerRef.current);
|
|
@@ -65208,7 +65233,7 @@ function isSelectionHidden(fromTimeline, element) {
|
|
|
65208
65233
|
}
|
|
65209
65234
|
|
|
65210
65235
|
// src/components/editor/propertyPanelFlatTextSection.tsx
|
|
65211
|
-
import { useEffect as
|
|
65236
|
+
import { useEffect as useEffect93, useState as useState90 } from "react";
|
|
65212
65237
|
import { Fragment as Fragment42, jsx as jsx165, jsxs as jsxs122 } from "react/jsx-runtime";
|
|
65213
65238
|
var ALIGN_OPTIONS = [
|
|
65214
65239
|
{ key: "left", label: "left", node: "L" },
|
|
@@ -65421,7 +65446,7 @@ function FlatTextSection({
|
|
|
65421
65446
|
element.textFields[0]?.key ?? null
|
|
65422
65447
|
);
|
|
65423
65448
|
const [autoFocusFieldKey, setAutoFocusFieldKey] = useState90(null);
|
|
65424
|
-
|
|
65449
|
+
useEffect93(() => {
|
|
65425
65450
|
const nextFields = element.textFields;
|
|
65426
65451
|
setActiveFieldKey((current2) => {
|
|
65427
65452
|
if (current2 && nextFields.some((field) => field.key === current2)) return current2;
|
|
@@ -65573,7 +65598,7 @@ function FlatTextLayerList({
|
|
|
65573
65598
|
}
|
|
65574
65599
|
|
|
65575
65600
|
// src/components/editor/propertyPanelFlatStyleSections.tsx
|
|
65576
|
-
import { useEffect as
|
|
65601
|
+
import { useEffect as useEffect94, useState as useState91 } from "react";
|
|
65577
65602
|
|
|
65578
65603
|
// src/components/editor/propertyPanelFlatStyleHelpers.ts
|
|
65579
65604
|
var STROKE_STYLE_OPTIONS = [
|
|
@@ -65699,7 +65724,7 @@ function FlatFillFields({
|
|
|
65699
65724
|
}
|
|
65700
65725
|
const [preferredFillMode, setPreferredFillMode] = useState91(fillMode);
|
|
65701
65726
|
const imageUrl = extractBackgroundImageUrl(backgroundImage);
|
|
65702
|
-
|
|
65727
|
+
useEffect94(() => {
|
|
65703
65728
|
setPreferredFillMode(fillMode);
|
|
65704
65729
|
}, [fillMode, element.id, element.selector, backgroundImage]);
|
|
65705
65730
|
const handleFillModeChange = (nextMode) => {
|
|
@@ -66613,7 +66638,7 @@ import {
|
|
|
66613
66638
|
} from "@hyperframes/core/audio-automation";
|
|
66614
66639
|
|
|
66615
66640
|
// src/components/editor/propertyPanelFxSection.tsx
|
|
66616
|
-
import { useCallback as useCallback94, useEffect as
|
|
66641
|
+
import { useCallback as useCallback94, useEffect as useEffect97, useMemo as useMemo60, useRef as useRef106, useState as useState95 } from "react";
|
|
66617
66642
|
|
|
66618
66643
|
// src/components/editor/audioFxRevealTarget.ts
|
|
66619
66644
|
import { parseAutomationTarget as parseAutomationTarget2 } from "@hyperframes/core/audio-automation";
|
|
@@ -66693,7 +66718,7 @@ import { DEFAULT_CARVE as DEFAULT_CARVE2 } from "@hyperframes/core/audio-carve";
|
|
|
66693
66718
|
import { fxAutomationTarget as fxAutomationTarget3 } from "@hyperframes/core/audio-automation";
|
|
66694
66719
|
|
|
66695
66720
|
// src/components/editor/propertyPanelFxControls.tsx
|
|
66696
|
-
import { useCallback as useCallback92, useEffect as
|
|
66721
|
+
import { useCallback as useCallback92, useEffect as useEffect95, useRef as useRef105, useState as useState92 } from "react";
|
|
66697
66722
|
import { jsx as jsx171, jsxs as jsxs128 } from "react/jsx-runtime";
|
|
66698
66723
|
function toSlider(p, value) {
|
|
66699
66724
|
if (p.scale !== "log" || p.min <= 0) return value;
|
|
@@ -66746,10 +66771,10 @@ function FxParamRow({
|
|
|
66746
66771
|
const [pending2, setPending] = useState92(null);
|
|
66747
66772
|
const [typing, setTyping] = useState92(null);
|
|
66748
66773
|
const edited = useRef105(false);
|
|
66749
|
-
|
|
66774
|
+
useEffect95(() => {
|
|
66750
66775
|
if (!dragging) setLocal(value);
|
|
66751
66776
|
}, [value, dragging]);
|
|
66752
|
-
|
|
66777
|
+
useEffect95(() => {
|
|
66753
66778
|
setPending(null);
|
|
66754
66779
|
}, [value]);
|
|
66755
66780
|
const handleNumber = useCallback92(
|
|
@@ -67413,7 +67438,7 @@ function CarveAnalysis({
|
|
|
67413
67438
|
}
|
|
67414
67439
|
|
|
67415
67440
|
// src/components/editor/propertyPanelFxEqModule.tsx
|
|
67416
|
-
import { useCallback as useCallback93, useEffect as
|
|
67441
|
+
import { useCallback as useCallback93, useEffect as useEffect96, useState as useState93 } from "react";
|
|
67417
67442
|
import {
|
|
67418
67443
|
audioEqSummary,
|
|
67419
67444
|
HF_AUDIO_EQ_RANGE_DB
|
|
@@ -67435,7 +67460,7 @@ function Fader2({
|
|
|
67435
67460
|
}) {
|
|
67436
67461
|
const [local, setLocal] = useState93(band.gain);
|
|
67437
67462
|
const [dragging, setDragging] = useState93(false);
|
|
67438
|
-
|
|
67463
|
+
useEffect96(() => {
|
|
67439
67464
|
if (!dragging) setLocal(band.gain);
|
|
67440
67465
|
}, [band.gain, dragging]);
|
|
67441
67466
|
const value = dragging ? local : band.gain;
|
|
@@ -68729,7 +68754,7 @@ function FxSection({
|
|
|
68729
68754
|
}
|
|
68730
68755
|
setPendingReveal(where && revealTarget ? { nonce: revealNonce, target: revealTarget } : null);
|
|
68731
68756
|
}
|
|
68732
|
-
|
|
68757
|
+
useEffect97(() => {
|
|
68733
68758
|
const target = pendingReveal?.target;
|
|
68734
68759
|
if (target && scrollRevealedRowIntoView(rootRef.current, target, chain)) {
|
|
68735
68760
|
setPendingReveal(null);
|
|
@@ -68926,7 +68951,7 @@ function FxSection({
|
|
|
68926
68951
|
}
|
|
68927
68952
|
|
|
68928
68953
|
// src/components/editor/useFxChainObserved.ts
|
|
68929
|
-
import { useEffect as
|
|
68954
|
+
import { useEffect as useEffect98, useRef as useRef107 } from "react";
|
|
68930
68955
|
import { classifyAudioName as classifyAudioName3 } from "@hyperframes/core/audio-carve";
|
|
68931
68956
|
function useFxChainObserved(element, chain, carve, automation, onSetAttributeQuietRaw) {
|
|
68932
68957
|
const lastShape = useRef107(null);
|
|
@@ -68935,7 +68960,7 @@ function useFxChainObserved(element, chain, carve, automation, onSetAttributeQui
|
|
|
68935
68960
|
panelEdits.current += 1;
|
|
68936
68961
|
return onSetAttributeQuietRaw(attr2, value);
|
|
68937
68962
|
};
|
|
68938
|
-
|
|
68963
|
+
useEffect98(() => {
|
|
68939
68964
|
const shape = JSON.stringify([
|
|
68940
68965
|
chain.nodes.map((n) => `${n.type}:${n.fromPreset ?? ""}:${n.fromCarve ? 1 : 0}`),
|
|
68941
68966
|
carve?.enabled ?? false,
|
|
@@ -68963,7 +68988,7 @@ function useFxChainObserved(element, chain, carve, automation, onSetAttributeQui
|
|
|
68963
68988
|
}
|
|
68964
68989
|
|
|
68965
68990
|
// src/components/editor/useFxCarve.ts
|
|
68966
|
-
import { useEffect as
|
|
68991
|
+
import { useEffect as useEffect99, useRef as useRef108 } from "react";
|
|
68967
68992
|
import {
|
|
68968
68993
|
HF_AUDIO_FX_ATTR as HF_AUDIO_FX_ATTR9,
|
|
68969
68994
|
serializeAudioFxChain as serializeAudioFxChain6
|
|
@@ -69074,13 +69099,13 @@ function useFxCarve(element, chain, carve, automation, onSetAttributeQuiet, writ
|
|
|
69074
69099
|
setAnalysing(false);
|
|
69075
69100
|
}
|
|
69076
69101
|
};
|
|
69077
|
-
|
|
69102
|
+
useEffect99(() => {
|
|
69078
69103
|
if (carvedAgainstBy || !carve?.enabled) return;
|
|
69079
69104
|
if (survivingSources.length === carve.sources.length) return;
|
|
69080
69105
|
void setCarve({ ...carve, sources: survivingSources });
|
|
69081
69106
|
}, [carve, carvedAgainstBy, survivingSources.join(" ")]);
|
|
69082
69107
|
const candidateIds = autoSourceIds.join("\0");
|
|
69083
|
-
|
|
69108
|
+
useEffect99(() => {
|
|
69084
69109
|
if (carvedAgainstBy || !autoBed || autoSourceIds.length <= 1) return;
|
|
69085
69110
|
if (autoCarveInFlight.current) return;
|
|
69086
69111
|
const all = autoSourceIds;
|
|
@@ -69090,7 +69115,7 @@ function useFxCarve(element, chain, carve, automation, onSetAttributeQuiet, writ
|
|
|
69090
69115
|
}
|
|
69091
69116
|
if (carve.enabled && carve.sources.length === 0) setCarveAuto({ ...carve, sources: all });
|
|
69092
69117
|
}, [carve, carvedAgainstBy, autoBed, candidateIds]);
|
|
69093
|
-
|
|
69118
|
+
useEffect99(() => {
|
|
69094
69119
|
if (carvedAgainstBy || !autoBed || autoSourceIds.length !== 1) return;
|
|
69095
69120
|
if (autoCarveInFlight.current) return;
|
|
69096
69121
|
const only = autoSourceIds[0];
|
|
@@ -69474,14 +69499,14 @@ function useVolumeAutomation(element, currentTime, onSetAttributeQuiet, linkedSp
|
|
|
69474
69499
|
}
|
|
69475
69500
|
|
|
69476
69501
|
// src/components/editor/useAudioFxRevealSection.ts
|
|
69477
|
-
import { useEffect as
|
|
69502
|
+
import { useEffect as useEffect100, useState as useState98 } from "react";
|
|
69478
69503
|
function useAudioFxRevealSection(input) {
|
|
69479
69504
|
const revealedAudioFxTarget = usePlayerStore((s) => s.revealedAudioFxTarget);
|
|
69480
69505
|
const timelineProjectId = usePlayerStore((s) => s.timelineProjectId);
|
|
69481
69506
|
const timelineSessionEpoch = usePlayerStore((s) => s.timelineSessionEpoch);
|
|
69482
69507
|
const clearRevealedAudioFxTarget = usePlayerStore((s) => s.clearRevealedAudioFxTarget);
|
|
69483
69508
|
const [consumed, setConsumed] = useState98(null);
|
|
69484
|
-
|
|
69509
|
+
useEffect100(() => {
|
|
69485
69510
|
if (consumed === null) return;
|
|
69486
69511
|
return () => clearRevealedAudioFxTarget(consumed);
|
|
69487
69512
|
}, [consumed, clearRevealedAudioFxTarget]);
|
|
@@ -69496,7 +69521,7 @@ function useAudioFxRevealSection(input) {
|
|
|
69496
69521
|
}
|
|
69497
69522
|
|
|
69498
69523
|
// src/components/editor/propertyPanelFlatMediaSection.tsx
|
|
69499
|
-
import { useEffect as
|
|
69524
|
+
import { useEffect as useEffect101, useState as useState99 } from "react";
|
|
69500
69525
|
|
|
69501
69526
|
// src/components/editor/propertyPanelFlatToggle.tsx
|
|
69502
69527
|
import { jsx as jsx183, jsxs as jsxs138 } from "react/jsx-runtime";
|
|
@@ -69659,7 +69684,7 @@ function FlatMediaSection({
|
|
|
69659
69684
|
const projectSrc = srcAttr && !/^(?:https?:|data:|blob:)/i.test(srcAttr) ? authoredSrcPath(srcAttr.startsWith("./") ? srcAttr.slice(2) : srcAttr) : "";
|
|
69660
69685
|
const absoluteSrc = projectDir && projectSrc ? `${projectDir}/${projectSrc}` : srcAttr;
|
|
69661
69686
|
const canRemoveBackground = Boolean(onRemoveBackground && isVisualMedia && projectSrc);
|
|
69662
|
-
|
|
69687
|
+
useEffect101(() => {
|
|
69663
69688
|
setRemoveProgress(null);
|
|
69664
69689
|
setCreatePlate(false);
|
|
69665
69690
|
}, [srcAttr]);
|
|
@@ -69987,7 +70012,7 @@ function createGsapLivePreview(iframeRef) {
|
|
|
69987
70012
|
}
|
|
69988
70013
|
|
|
69989
70014
|
// src/components/editor/propertyPanelFlatColorGradingSection.tsx
|
|
69990
|
-
import { useEffect as
|
|
70015
|
+
import { useEffect as useEffect107, useMemo as useMemo63, useRef as useRef117, useState as useState105 } from "react";
|
|
69991
70016
|
import {
|
|
69992
70017
|
HF_COLOR_GRADING_GRADE_PRESETS,
|
|
69993
70018
|
normalizeHfColorGrading as normalizeHfColorGrading6,
|
|
@@ -70445,7 +70470,7 @@ function formatPointValue(value, tab, axis) {
|
|
|
70445
70470
|
}
|
|
70446
70471
|
|
|
70447
70472
|
// src/components/editor/propertyPanelGradingNumberField.tsx
|
|
70448
|
-
import { useEffect as
|
|
70473
|
+
import { useEffect as useEffect102, useRef as useRef111, useState as useState100 } from "react";
|
|
70449
70474
|
import { jsx as jsx186, jsxs as jsxs141 } from "react/jsx-runtime";
|
|
70450
70475
|
function GradingNumberField({
|
|
70451
70476
|
label,
|
|
@@ -70468,7 +70493,7 @@ function GradingNumberField({
|
|
|
70468
70493
|
const cancelBlurRef = useRef111(false);
|
|
70469
70494
|
const baselineRef = useRef111(value);
|
|
70470
70495
|
const dirtyRef = useRef111(false);
|
|
70471
|
-
|
|
70496
|
+
useEffect102(() => {
|
|
70472
70497
|
if (!focusedRef.current) setDraft(formatValue2(value));
|
|
70473
70498
|
}, [formatValue2, value]);
|
|
70474
70499
|
const settle = () => {
|
|
@@ -70697,10 +70722,10 @@ function ColorCurves({
|
|
|
70697
70722
|
}
|
|
70698
70723
|
|
|
70699
70724
|
// src/components/editor/propertyPanelColorScopes.tsx
|
|
70700
|
-
import { useEffect as
|
|
70725
|
+
import { useEffect as useEffect104, useRef as useRef113, useState as useState103 } from "react";
|
|
70701
70726
|
|
|
70702
70727
|
// src/components/editor/useColorGradingScopes.ts
|
|
70703
|
-
import { useEffect as
|
|
70728
|
+
import { useEffect as useEffect103, useRef as useRef112, useState as useState102 } from "react";
|
|
70704
70729
|
|
|
70705
70730
|
// src/components/editor/colorGradingFrameAnalysis.ts
|
|
70706
70731
|
import {
|
|
@@ -70862,7 +70887,7 @@ function useColorGradingScopes({
|
|
|
70862
70887
|
const [refreshVersion, setRefreshVersion] = useState102(0);
|
|
70863
70888
|
const captureRef = useRef112(captureFrame);
|
|
70864
70889
|
captureRef.current = captureFrame;
|
|
70865
|
-
|
|
70890
|
+
useEffect103(() => {
|
|
70866
70891
|
if (!open2) {
|
|
70867
70892
|
setAnalysis(null);
|
|
70868
70893
|
setStatus("idle");
|
|
@@ -71044,7 +71069,7 @@ function PropertyPanelColorScopes({
|
|
|
71044
71069
|
captureFrame,
|
|
71045
71070
|
refreshKey
|
|
71046
71071
|
});
|
|
71047
|
-
|
|
71072
|
+
useEffect104(() => {
|
|
71048
71073
|
const canvas = canvasRef.current;
|
|
71049
71074
|
if (!canvas) return;
|
|
71050
71075
|
if (analysis) {
|
|
@@ -71108,7 +71133,7 @@ function PropertyPanelColorScopes({
|
|
|
71108
71133
|
}
|
|
71109
71134
|
|
|
71110
71135
|
// src/components/editor/propertyPanelColorSecondary.tsx
|
|
71111
|
-
import { useEffect as
|
|
71136
|
+
import { useEffect as useEffect105, useRef as useRef114, useState as useState104 } from "react";
|
|
71112
71137
|
import {
|
|
71113
71138
|
getHfColorGradingCapabilities,
|
|
71114
71139
|
normalizeHfColorGrading as normalizeHfColorGrading5
|
|
@@ -71161,7 +71186,7 @@ function PropertyPanelColorSecondary({
|
|
|
71161
71186
|
const matteCanvasRef = useRef114(null);
|
|
71162
71187
|
const activeIndex = Math.min(selectedIndex, Math.max(0, secondaries.length - 1));
|
|
71163
71188
|
const selected = secondaries[activeIndex];
|
|
71164
|
-
|
|
71189
|
+
useEffect105(() => {
|
|
71165
71190
|
const canvas = matteCanvasRef.current;
|
|
71166
71191
|
if (!showMatte || !canvas || !sampleFrame || !samplePixels || !selected) return;
|
|
71167
71192
|
const context = canvas.getContext("2d");
|
|
@@ -71827,7 +71852,7 @@ function ColorWheels({
|
|
|
71827
71852
|
}
|
|
71828
71853
|
|
|
71829
71854
|
// src/components/editor/propertyPanelFlatColorGradingAccessory.tsx
|
|
71830
|
-
import { useEffect as
|
|
71855
|
+
import { useEffect as useEffect106, useRef as useRef116 } from "react";
|
|
71831
71856
|
import { isHfColorGradingActive as isHfColorGradingActive3 } from "@hyperframes/core/color-grading";
|
|
71832
71857
|
import { jsx as jsx191, jsxs as jsxs146 } from "react/jsx-runtime";
|
|
71833
71858
|
var STATUS_DOT_CLASS = {
|
|
@@ -71844,7 +71869,7 @@ function FlatColorGradingAccessory({
|
|
|
71844
71869
|
const { grading, compareEnabled, runtimeStatus, commitCompare, resetGrading } = state;
|
|
71845
71870
|
const gradingActive = isHfColorGradingActive3(grading);
|
|
71846
71871
|
const releaseRef = useRef116(null);
|
|
71847
|
-
|
|
71872
|
+
useEffect106(
|
|
71848
71873
|
() => () => {
|
|
71849
71874
|
releaseRef.current?.();
|
|
71850
71875
|
releaseRef.current = null;
|
|
@@ -72027,7 +72052,7 @@ function FlatColorGradingSection({
|
|
|
72027
72052
|
);
|
|
72028
72053
|
const actions = createColorGradingActions(grading, onCommitColorGrading);
|
|
72029
72054
|
const scopesRefreshKey = useMemo63(() => serializeHfColorGrading2(grading), [grading]);
|
|
72030
|
-
|
|
72055
|
+
useEffect107(() => {
|
|
72031
72056
|
if (presetPreviews.status === "idle") onRequestPresetPreviews();
|
|
72032
72057
|
}, [onRequestPresetPreviews, presetPreviews.status]);
|
|
72033
72058
|
const resolvePreset = (presetId) => {
|
|
@@ -72038,7 +72063,7 @@ function FlatColorGradingSection({
|
|
|
72038
72063
|
palette: grading.palette
|
|
72039
72064
|
} : grading;
|
|
72040
72065
|
};
|
|
72041
|
-
|
|
72066
|
+
useEffect107(() => () => onPreviewColorGrading(null), [onPreviewColorGrading]);
|
|
72042
72067
|
const renderDetailSlider = (key2) => {
|
|
72043
72068
|
const spec = detailByKey(key2);
|
|
72044
72069
|
const value = grading.details[key2];
|
|
@@ -72386,7 +72411,7 @@ function FlatColorGradingSection({
|
|
|
72386
72411
|
}
|
|
72387
72412
|
|
|
72388
72413
|
// src/components/editor/propertyPanelFlatEffectsSection.tsx
|
|
72389
|
-
import { useEffect as
|
|
72414
|
+
import { useEffect as useEffect108, useState as useState106 } from "react";
|
|
72390
72415
|
import {
|
|
72391
72416
|
HF_COLOR_GRADING_EFFECT_APPLY_DEFAULTS as HF_COLOR_GRADING_EFFECT_APPLY_DEFAULTS3,
|
|
72392
72417
|
HF_COLOR_GRADING_EFFECT_PRESETS,
|
|
@@ -72768,7 +72793,7 @@ function FlatEffectsSection({
|
|
|
72768
72793
|
activeEffects[0]?.key ?? null
|
|
72769
72794
|
);
|
|
72770
72795
|
const selectedEffect = activeEffects.find((effect) => effect.key === selectedKey) ?? activeEffects[0] ?? null;
|
|
72771
|
-
|
|
72796
|
+
useEffect108(() => {
|
|
72772
72797
|
if (!catalogOpen) return;
|
|
72773
72798
|
const group = EFFECT_GROUPS.find((candidate) => candidate.label === catalogGroup);
|
|
72774
72799
|
if (!group) return;
|
|
@@ -72789,7 +72814,7 @@ function FlatEffectsSection({
|
|
|
72789
72814
|
previews.images,
|
|
72790
72815
|
previews.status
|
|
72791
72816
|
]);
|
|
72792
|
-
|
|
72817
|
+
useEffect108(() => () => onPreviewColorGrading(null), [onPreviewColorGrading]);
|
|
72793
72818
|
const commitEffects = (effects) => {
|
|
72794
72819
|
onCommitColorGrading({
|
|
72795
72820
|
...grading,
|
|
@@ -73156,7 +73181,7 @@ function FlatEffectsSection({
|
|
|
73156
73181
|
import { useState as useState108 } from "react";
|
|
73157
73182
|
|
|
73158
73183
|
// src/hooks/useBlockCatalog.ts
|
|
73159
|
-
import { useState as useState107, useEffect as
|
|
73184
|
+
import { useState as useState107, useEffect as useEffect109, useMemo as useMemo64 } from "react";
|
|
73160
73185
|
|
|
73161
73186
|
// src/utils/blockCategories.ts
|
|
73162
73187
|
import {
|
|
@@ -73236,7 +73261,7 @@ function useBlockCatalog() {
|
|
|
73236
73261
|
const [error, setError] = useState107(null);
|
|
73237
73262
|
const [search, setSearch] = useState107("");
|
|
73238
73263
|
const [category, setCategory] = useState107(null);
|
|
73239
|
-
|
|
73264
|
+
useEffect109(() => {
|
|
73240
73265
|
if (catalogCache) return;
|
|
73241
73266
|
let cancelled = false;
|
|
73242
73267
|
(async () => {
|
|
@@ -73517,7 +73542,7 @@ function PropertyPanelFlat({
|
|
|
73517
73542
|
const [justToggledIds, setJustToggledIds] = useState109([]);
|
|
73518
73543
|
const justToggledTimeoutRef = useRef118(null);
|
|
73519
73544
|
const panelBodyRef = useRef118(null);
|
|
73520
|
-
|
|
73545
|
+
useEffect110(() => {
|
|
73521
73546
|
return () => {
|
|
73522
73547
|
if (justToggledTimeoutRef.current) clearTimeout(justToggledTimeoutRef.current);
|
|
73523
73548
|
};
|
|
@@ -74533,7 +74558,7 @@ import { memo as memo43, useState as useState112, useCallback as useCallback96,
|
|
|
74533
74558
|
import { Plus as Plus2, FolderSimplePlus as FolderSimplePlus2 } from "@phosphor-icons/react";
|
|
74534
74559
|
|
|
74535
74560
|
// src/components/editor/FileTreeNodes.tsx
|
|
74536
|
-
import { memo as memo42, useState as useState111, useCallback as useCallback95, useMemo as useMemo67, useRef as useRef120, useEffect as
|
|
74561
|
+
import { memo as memo42, useState as useState111, useCallback as useCallback95, useMemo as useMemo67, useRef as useRef120, useEffect as useEffect111 } from "react";
|
|
74537
74562
|
import {
|
|
74538
74563
|
PencilSimple,
|
|
74539
74564
|
Copy as Copy2,
|
|
@@ -74670,7 +74695,7 @@ function ContextMenu2({
|
|
|
74670
74695
|
}) {
|
|
74671
74696
|
const menuRef = useRef120(null);
|
|
74672
74697
|
const restoreFocusRef = useRef120(null);
|
|
74673
|
-
|
|
74698
|
+
useEffect111(() => {
|
|
74674
74699
|
restoreFocusRef.current = document.activeElement instanceof HTMLElement ? document.activeElement : null;
|
|
74675
74700
|
const firstItem = menuRef.current?.querySelector("button");
|
|
74676
74701
|
if (firstItem instanceof HTMLElement) firstItem.focus();
|
|
@@ -74836,7 +74861,7 @@ function InlineInput({
|
|
|
74836
74861
|
if (name.includes("..")) return "Name can't contain ..";
|
|
74837
74862
|
return null;
|
|
74838
74863
|
};
|
|
74839
|
-
|
|
74864
|
+
useEffect111(() => {
|
|
74840
74865
|
const el = inputRef.current;
|
|
74841
74866
|
if (!el) return;
|
|
74842
74867
|
el.focus();
|
|
@@ -74913,7 +74938,7 @@ function DeleteConfirm({
|
|
|
74913
74938
|
onCancel
|
|
74914
74939
|
}) {
|
|
74915
74940
|
const ref = useRef120(null);
|
|
74916
|
-
|
|
74941
|
+
useEffect111(() => {
|
|
74917
74942
|
const handleEscape = (e) => {
|
|
74918
74943
|
if (e.key === "Escape") onCancel();
|
|
74919
74944
|
};
|
|
@@ -75510,11 +75535,11 @@ function useToolbarSession(session) {
|
|
|
75510
75535
|
}
|
|
75511
75536
|
|
|
75512
75537
|
// src/hooks/useRightPanelIntents.ts
|
|
75513
|
-
import { useCallback as useCallback97, useEffect as
|
|
75538
|
+
import { useCallback as useCallback97, useEffect as useEffect112, useRef as useRef123 } from "react";
|
|
75514
75539
|
function useSlideshowDockPanel(isSlideshowComposition) {
|
|
75515
75540
|
const controller = useDockLayoutStore((state) => state.controller);
|
|
75516
75541
|
const wasSlideshow = useRef123(false);
|
|
75517
|
-
|
|
75542
|
+
useEffect112(() => {
|
|
75518
75543
|
if (!controller) return;
|
|
75519
75544
|
const inDock = useDockLayoutStore.getState().openPanels.has("slideshow");
|
|
75520
75545
|
if (isSlideshowComposition && !inDock) controller.open("slideshow");
|
|
@@ -75527,7 +75552,7 @@ function useBlockParamsDismissal({
|
|
|
75527
75552
|
onDismiss
|
|
75528
75553
|
}) {
|
|
75529
75554
|
const designVisible = useDockLayoutStore((state) => state.visiblePanels.has("design"));
|
|
75530
|
-
|
|
75555
|
+
useEffect112(() => {
|
|
75531
75556
|
if (hasBlockParams && !designVisible) onDismiss();
|
|
75532
75557
|
}, [hasBlockParams, designVisible, onDismiss]);
|
|
75533
75558
|
}
|
|
@@ -75545,7 +75570,7 @@ function useCaptionDesignFocus(captionEditMode) {
|
|
|
75545
75570
|
const rightShown = useDockLayoutStore(
|
|
75546
75571
|
(state) => visiblePanelInZone("right", state.lastActive, state.visiblePanels) !== null
|
|
75547
75572
|
);
|
|
75548
|
-
|
|
75573
|
+
useEffect112(() => {
|
|
75549
75574
|
if (captionEditMode && rightShown && !designVisible) {
|
|
75550
75575
|
useDockLayoutStore.getState().activatePanel("design");
|
|
75551
75576
|
}
|
|
@@ -75558,7 +75583,7 @@ function useRightPanelIntent() {
|
|
|
75558
75583
|
}
|
|
75559
75584
|
|
|
75560
75585
|
// src/components/renders/useRenderQueue.ts
|
|
75561
|
-
import { useState as useState114, useEffect as
|
|
75586
|
+
import { useState as useState114, useEffect as useEffect114, useCallback as useCallback99, useRef as useRef125, useMemo as useMemo70 } from "react";
|
|
75562
75587
|
|
|
75563
75588
|
// src/components/renders/serverError.ts
|
|
75564
75589
|
async function readServerError(res) {
|
|
@@ -75576,7 +75601,7 @@ async function readServerError(res) {
|
|
|
75576
75601
|
}
|
|
75577
75602
|
|
|
75578
75603
|
// src/components/renders/useFfmpegStatus.ts
|
|
75579
|
-
import { useCallback as useCallback98, useEffect as
|
|
75604
|
+
import { useCallback as useCallback98, useEffect as useEffect113, useRef as useRef124, useState as useState113 } from "react";
|
|
75580
75605
|
function ffmpegInstallMessage(status) {
|
|
75581
75606
|
const title = status?.title ?? "FFmpeg not found";
|
|
75582
75607
|
const remedy = status?.command ?? status?.hint;
|
|
@@ -75608,7 +75633,7 @@ function useFfmpegStatus() {
|
|
|
75608
75633
|
const [status, setStatus] = useState113(cached4);
|
|
75609
75634
|
const [checking, setChecking] = useState113(cached4 === null);
|
|
75610
75635
|
const mounted = useRef124(true);
|
|
75611
|
-
|
|
75636
|
+
useEffect113(() => {
|
|
75612
75637
|
mounted.current = true;
|
|
75613
75638
|
return () => {
|
|
75614
75639
|
mounted.current = false;
|
|
@@ -75622,7 +75647,7 @@ function useFfmpegStatus() {
|
|
|
75622
75647
|
setStatus(next);
|
|
75623
75648
|
setChecking(false);
|
|
75624
75649
|
}, []);
|
|
75625
|
-
|
|
75650
|
+
useEffect113(() => {
|
|
75626
75651
|
if (cached4 !== null) return;
|
|
75627
75652
|
void run();
|
|
75628
75653
|
}, [run]);
|
|
@@ -75850,7 +75875,7 @@ function useRenderQueue(projectId, activeCompPathRef) {
|
|
|
75850
75875
|
setLoadError("Couldn't load render history. Is the studio server running?");
|
|
75851
75876
|
}
|
|
75852
75877
|
}, [projectId]);
|
|
75853
|
-
|
|
75878
|
+
useEffect114(() => {
|
|
75854
75879
|
loadRenders();
|
|
75855
75880
|
}, [loadRenders]);
|
|
75856
75881
|
const startRender = useCallback99(
|
|
@@ -76056,7 +76081,7 @@ function useRenderQueue(projectId, activeCompPathRef) {
|
|
|
76056
76081
|
});
|
|
76057
76082
|
}, [projectId]);
|
|
76058
76083
|
const dismissActionError = useCallback99(() => setActionError(null), []);
|
|
76059
|
-
|
|
76084
|
+
useEffect114(() => {
|
|
76060
76085
|
for (const job of jobs) {
|
|
76061
76086
|
if (job.status === "rendering" || job.status === "cancelled") continue;
|
|
76062
76087
|
const settings = sessionJobs.current.get(job.id);
|
|
@@ -76081,7 +76106,7 @@ function useRenderQueue(projectId, activeCompPathRef) {
|
|
|
76081
76106
|
});
|
|
76082
76107
|
}
|
|
76083
76108
|
}, [jobs]);
|
|
76084
|
-
|
|
76109
|
+
useEffect114(() => {
|
|
76085
76110
|
return () => {
|
|
76086
76111
|
eventSourceRef.current?.close();
|
|
76087
76112
|
eventSourceRef.current = null;
|
|
@@ -76134,7 +76159,7 @@ import { useRef as useRef127, useState as useState115 } from "react";
|
|
|
76134
76159
|
import { XIcon, WarningIcon, CheckCircleIcon, CaretRightIcon } from "@phosphor-icons/react";
|
|
76135
76160
|
|
|
76136
76161
|
// src/components/ui/useDialogBehavior.ts
|
|
76137
|
-
import { useEffect as
|
|
76162
|
+
import { useEffect as useEffect115, useCallback as useCallback100, useRef as useRef126 } from "react";
|
|
76138
76163
|
var FOCUSABLE = 'button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), summary, [contenteditable="true"], [tabindex]:not([tabindex="-1"])';
|
|
76139
76164
|
function useDialogBehavior({
|
|
76140
76165
|
open: open2,
|
|
@@ -76152,7 +76177,7 @@ function useDialogBehavior({
|
|
|
76152
76177
|
if (guard && !guard()) return;
|
|
76153
76178
|
onCloseRef.current();
|
|
76154
76179
|
}, []);
|
|
76155
|
-
|
|
76180
|
+
useEffect115(() => {
|
|
76156
76181
|
if (!open2) return;
|
|
76157
76182
|
const previouslyFocused = document.activeElement;
|
|
76158
76183
|
restoreRef.current = previouslyFocused instanceof HTMLElement ? previouslyFocused : null;
|
|
@@ -76519,7 +76544,7 @@ function StudioToast({ message, tone, onDismiss }) {
|
|
|
76519
76544
|
}
|
|
76520
76545
|
|
|
76521
76546
|
// src/components/feedback/StudioFeedbackCard.tsx
|
|
76522
|
-
import { memo as memo44, useState as useState118, useCallback as useCallback102, useRef as useRef130, useEffect as
|
|
76547
|
+
import { memo as memo44, useState as useState118, useCallback as useCallback102, useRef as useRef130, useEffect as useEffect116 } from "react";
|
|
76523
76548
|
|
|
76524
76549
|
// src/components/feedback/projectProvenance.ts
|
|
76525
76550
|
var CONFIG_FILE = "hyperframes.json";
|
|
@@ -76639,7 +76664,7 @@ var StudioFeedbackCard = memo44(function StudioFeedbackCard2() {
|
|
|
76639
76664
|
},
|
|
76640
76665
|
[clearTimer]
|
|
76641
76666
|
);
|
|
76642
|
-
|
|
76667
|
+
useEffect116(
|
|
76643
76668
|
() => subscribeToFeedbackRequests((next) => {
|
|
76644
76669
|
setRequest(next);
|
|
76645
76670
|
setRating(null);
|
|
@@ -76651,12 +76676,12 @@ var StudioFeedbackCard = memo44(function StudioFeedbackCard2() {
|
|
|
76651
76676
|
}),
|
|
76652
76677
|
[]
|
|
76653
76678
|
);
|
|
76654
|
-
|
|
76679
|
+
useEffect116(() => {
|
|
76655
76680
|
if (!request2 || step === "thanks" || rating !== null || comment !== "") return;
|
|
76656
76681
|
timerRef.current = setTimeout(() => close("timeout"), AUTO_DISMISS_MS2);
|
|
76657
76682
|
return clearTimer;
|
|
76658
76683
|
}, [request2, step, rating, comment, close, clearTimer]);
|
|
76659
|
-
|
|
76684
|
+
useEffect116(() => {
|
|
76660
76685
|
if (step === "comment") inputRef.current?.focus();
|
|
76661
76686
|
}, [step]);
|
|
76662
76687
|
const submit = useCallback102(
|
|
@@ -77158,11 +77183,11 @@ function ExternalFileConflictBanner({
|
|
|
77158
77183
|
}
|
|
77159
77184
|
|
|
77160
77185
|
// src/components/ProjectUnreachableBanner.tsx
|
|
77161
|
-
import { useEffect as
|
|
77186
|
+
import { useEffect as useEffect117, useState as useState120 } from "react";
|
|
77162
77187
|
import { Fragment as Fragment57, jsx as jsx210, jsxs as jsxs163 } from "react/jsx-runtime";
|
|
77163
77188
|
function ProjectUnreachableBanner({ projectId }) {
|
|
77164
77189
|
const [served, setServed] = useState120(null);
|
|
77165
|
-
|
|
77190
|
+
useEffect117(() => {
|
|
77166
77191
|
let cancelled = false;
|
|
77167
77192
|
studioApiFetch("/api/projects").then((res) => res.ok ? res.json() : { projects: [] }).then((data) => {
|
|
77168
77193
|
if (!cancelled) setServed(data.projects ?? []);
|
|
@@ -77274,6 +77299,7 @@ function useCaptionSync(projectId) {
|
|
|
77274
77299
|
}
|
|
77275
77300
|
const seqAtSave = editSeqRef.current;
|
|
77276
77301
|
const overrides = buildOverrides(state.model);
|
|
77302
|
+
let held = null;
|
|
77277
77303
|
studioApiFetch(
|
|
77278
77304
|
buildProjectApiPath(pid, `/files/${encodeURIComponent("caption-overrides.json")}`),
|
|
77279
77305
|
{
|
|
@@ -77281,14 +77307,17 @@ function useCaptionSync(projectId) {
|
|
|
77281
77307
|
headers: { "Content-Type": "text/plain", ...studioWriteHeaders() },
|
|
77282
77308
|
body: JSON.stringify(overrides, null, 2)
|
|
77283
77309
|
}
|
|
77284
|
-
).then((res) => {
|
|
77285
|
-
if (!res.ok)
|
|
77310
|
+
).then(async (res) => {
|
|
77311
|
+
if (!res.ok) {
|
|
77312
|
+
held = await heldFileWordsOf(res, "caption-overrides.json");
|
|
77313
|
+
throw new Error(`HTTP ${res.status}`);
|
|
77314
|
+
}
|
|
77286
77315
|
if (editSeqRef.current === seqAtSave) pendingRef.current = false;
|
|
77287
77316
|
const s = useCaptionStore.getState();
|
|
77288
77317
|
if (s.syncError) s.setSyncError(null);
|
|
77289
77318
|
}).catch((error) => {
|
|
77290
77319
|
trackEvent("studio_caption_autosave_failed", { error: String(error) });
|
|
77291
|
-
useCaptionStore.getState().setSyncError("Caption changes couldn't be saved");
|
|
77320
|
+
useCaptionStore.getState().setSyncError(held ?? "Caption changes couldn't be saved");
|
|
77292
77321
|
});
|
|
77293
77322
|
}, []);
|
|
77294
77323
|
useMountEffect(() => {
|
|
@@ -77390,7 +77419,7 @@ function useCaptionSync(projectId) {
|
|
|
77390
77419
|
}
|
|
77391
77420
|
|
|
77392
77421
|
// src/hooks/usePersistentEditHistory.ts
|
|
77393
|
-
import { useCallback as useCallback104, useEffect as
|
|
77422
|
+
import { useCallback as useCallback104, useEffect as useEffect118, useMemo as useMemo71, useRef as useRef133, useState as useState121 } from "react";
|
|
77394
77423
|
var EMPTY3 = { entries: [], back: null, forward: null };
|
|
77395
77424
|
var OWN_ENTRIES_KEPT = 100;
|
|
77396
77425
|
function createOwnHistory() {
|
|
@@ -77538,14 +77567,14 @@ function usePersistentEditHistory({ projectId }) {
|
|
|
77538
77567
|
setView(next);
|
|
77539
77568
|
own.offered(seen, next);
|
|
77540
77569
|
}, [projectId, own]);
|
|
77541
|
-
|
|
77570
|
+
useEffect118(() => {
|
|
77542
77571
|
setView(EMPTY3);
|
|
77543
77572
|
setLoaded(false);
|
|
77544
77573
|
heldClaimRef.current = null;
|
|
77545
77574
|
own.clear();
|
|
77546
77575
|
void refresh2().finally(() => setLoaded(true));
|
|
77547
77576
|
}, [refresh2, own]);
|
|
77548
|
-
|
|
77577
|
+
useEffect118(() => {
|
|
77549
77578
|
setStudioPendingEditClaimClock(own.claimCount);
|
|
77550
77579
|
return () => setStudioPendingEditClaimClock(null);
|
|
77551
77580
|
}, [own]);
|
|
@@ -77656,7 +77685,7 @@ function usePersistentEditHistory({ projectId }) {
|
|
|
77656
77685
|
}
|
|
77657
77686
|
|
|
77658
77687
|
// src/hooks/usePanelLayout.ts
|
|
77659
|
-
import { useCallback as useCallback105, useEffect as
|
|
77688
|
+
import { useCallback as useCallback105, useEffect as useEffect119, useRef as useRef134 } from "react";
|
|
77660
77689
|
function panelForTab(tab) {
|
|
77661
77690
|
return tab === "block-params" ? "design" : tab;
|
|
77662
77691
|
}
|
|
@@ -77668,7 +77697,7 @@ function usePanelLayout(initialState2) {
|
|
|
77668
77697
|
const lastActive = useDockLayoutStore((state) => state.lastActive);
|
|
77669
77698
|
const visiblePanels = useDockLayoutStore((state) => state.visiblePanels);
|
|
77670
77699
|
const initialRef = useRef134(initialState2);
|
|
77671
|
-
|
|
77700
|
+
useEffect119(() => {
|
|
77672
77701
|
if (!controller) return;
|
|
77673
77702
|
const { rightCollapsed: rightCollapsed2, rightPanelTab: rightPanelTab2 } = initialRef.current ?? {};
|
|
77674
77703
|
initialRef.current = void 0;
|
|
@@ -77715,7 +77744,7 @@ function usePanelLayout(initialState2) {
|
|
|
77715
77744
|
import { useState as useState123, useCallback as useCallback109, useRef as useRef137 } from "react";
|
|
77716
77745
|
|
|
77717
77746
|
// src/hooks/useFileTree.ts
|
|
77718
|
-
import { useState as useState122, useCallback as useCallback106, useEffect as
|
|
77747
|
+
import { useState as useState122, useCallback as useCallback106, useEffect as useEffect120, useMemo as useMemo72, useRef as useRef135 } from "react";
|
|
77719
77748
|
|
|
77720
77749
|
// src/utils/rejectionTelemetry.ts
|
|
77721
77750
|
function errorProps(value) {
|
|
@@ -77748,7 +77777,7 @@ function useFileTree({ projectId, projectIdRef }) {
|
|
|
77748
77777
|
const compositionPaths = current2?.compositionPaths ?? EMPTY_FILE_LIST;
|
|
77749
77778
|
const projectDir = current2?.projectDir ?? null;
|
|
77750
77779
|
const fileTreeLoaded = current2?.loaded ?? false;
|
|
77751
|
-
|
|
77780
|
+
useEffect120(() => {
|
|
77752
77781
|
if (!projectId) return;
|
|
77753
77782
|
let cancelled = false;
|
|
77754
77783
|
setFetched({ projectId, loaded: false, fileTree: [], compositionPaths: [], projectDir: null });
|
|
@@ -78962,7 +78991,7 @@ function usePreviewPersistence({
|
|
|
78962
78991
|
}
|
|
78963
78992
|
|
|
78964
78993
|
// src/hooks/usePreviewDocumentVersion.ts
|
|
78965
|
-
import { useCallback as useCallback111, useEffect as
|
|
78994
|
+
import { useCallback as useCallback111, useEffect as useEffect121, useRef as useRef139, useState as useState125 } from "react";
|
|
78966
78995
|
function usePreviewDocumentVersion() {
|
|
78967
78996
|
const [previewDocumentVersion, setPreviewDocumentVersion] = useState125(0);
|
|
78968
78997
|
const refreshTimersRef = useRef139([]);
|
|
@@ -78975,7 +79004,7 @@ function usePreviewDocumentVersion() {
|
|
|
78975
79004
|
window.setTimeout(() => setPreviewDocumentVersion((v) => v + 1), 300)
|
|
78976
79005
|
);
|
|
78977
79006
|
}, []);
|
|
78978
|
-
|
|
79007
|
+
useEffect121(
|
|
78979
79008
|
() => () => {
|
|
78980
79009
|
for (const id of refreshTimersRef.current) clearTimeout(id);
|
|
78981
79010
|
},
|
|
@@ -79155,9 +79184,10 @@ async function requestFreezeFrame(input) {
|
|
|
79155
79184
|
})
|
|
79156
79185
|
}
|
|
79157
79186
|
);
|
|
79187
|
+
const held = response.ok ? null : await heldFileWordsOf(response, input.path);
|
|
79158
79188
|
const body = await response.json().catch(() => null);
|
|
79159
79189
|
if (!response.ok || !isFreezeFrameResponse(body)) {
|
|
79160
|
-
throw new Error(errorOf(body) ?? `Freeze frame failed (${response.status})`);
|
|
79190
|
+
throw new Error(held ?? errorOf(body) ?? `Freeze frame failed (${response.status})`);
|
|
79161
79191
|
}
|
|
79162
79192
|
return body;
|
|
79163
79193
|
}
|
|
@@ -79429,7 +79459,9 @@ async function insertTimelineComposition(input) {
|
|
|
79429
79459
|
}
|
|
79430
79460
|
);
|
|
79431
79461
|
if (!response.ok) {
|
|
79432
|
-
throw await createStudioSaveHttpError(response, "Failed to add composition to timeline"
|
|
79462
|
+
throw await createStudioSaveHttpError(response, "Failed to add composition to timeline", {
|
|
79463
|
+
path: input.targetPath
|
|
79464
|
+
});
|
|
79433
79465
|
}
|
|
79434
79466
|
return await response.json();
|
|
79435
79467
|
}
|
|
@@ -80361,7 +80393,7 @@ function useTimelineDeleteOps({
|
|
|
80361
80393
|
);
|
|
80362
80394
|
if (!removeResponse.ok) {
|
|
80363
80395
|
throw new Error(
|
|
80364
|
-
`Failed to delete ${countOf(sameFile.length, "clip")} from ${targetPath}`
|
|
80396
|
+
await heldFileWordsOf(removeResponse, targetPath) ?? `Failed to delete ${countOf(sameFile.length, "clip")} from ${targetPath}`
|
|
80365
80397
|
);
|
|
80366
80398
|
}
|
|
80367
80399
|
const removeData = await removeResponse.json();
|
|
@@ -82044,7 +82076,7 @@ function useTimelineMoveEditsHandler(handleTimelineGroupMove) {
|
|
|
82044
82076
|
import { useCallback as useCallback153 } from "react";
|
|
82045
82077
|
|
|
82046
82078
|
// src/hooks/useAskAgentModal.ts
|
|
82047
|
-
import { useState as useState127, useCallback as useCallback129, useRef as useRef148, useEffect as
|
|
82079
|
+
import { useState as useState127, useCallback as useCallback129, useRef as useRef148, useEffect as useEffect122 } from "react";
|
|
82048
82080
|
function useAskAgentModal({
|
|
82049
82081
|
activeCompPath,
|
|
82050
82082
|
projectDir,
|
|
@@ -82126,13 +82158,13 @@ function useAskAgentModal({
|
|
|
82126
82158
|
showToast
|
|
82127
82159
|
]
|
|
82128
82160
|
);
|
|
82129
|
-
|
|
82161
|
+
useEffect122(() => {
|
|
82130
82162
|
setAgentPromptTagSnippet(void 0);
|
|
82131
82163
|
setAgentPromptSelectionContext(void 0);
|
|
82132
82164
|
setAgentModalAnchorPoint(null);
|
|
82133
82165
|
setCopiedAgentPrompt(false);
|
|
82134
82166
|
}, [domEditSelection]);
|
|
82135
|
-
|
|
82167
|
+
useEffect122(
|
|
82136
82168
|
() => () => {
|
|
82137
82169
|
if (copiedAgentTimerRef.current) clearTimeout(copiedAgentTimerRef.current);
|
|
82138
82170
|
},
|
|
@@ -82156,7 +82188,7 @@ function useAskAgentModal({
|
|
|
82156
82188
|
}
|
|
82157
82189
|
|
|
82158
82190
|
// src/hooks/useDomSelection.ts
|
|
82159
|
-
import { useState as useState128, useCallback as useCallback130, useRef as useRef149, useEffect as
|
|
82191
|
+
import { useState as useState128, useCallback as useCallback130, useRef as useRef149, useEffect as useEffect124 } from "react";
|
|
82160
82192
|
|
|
82161
82193
|
// src/utils/domEditHelpers.ts
|
|
82162
82194
|
function domEditSelectionsTargetSame(a, b) {
|
|
@@ -82206,7 +82238,7 @@ function holdScenesOf(iframe, element) {
|
|
|
82206
82238
|
}
|
|
82207
82239
|
|
|
82208
82240
|
// src/hooks/useStudioTestHooks.ts
|
|
82209
|
-
import { useEffect as
|
|
82241
|
+
import { useEffect as useEffect123 } from "react";
|
|
82210
82242
|
|
|
82211
82243
|
// src/player/lib/timelinePerformanceDiagnostics.ts
|
|
82212
82244
|
function readNonNegativeNumber(value) {
|
|
@@ -82289,7 +82321,7 @@ function useStudioTestHooks({
|
|
|
82289
82321
|
buildDomSelectionFromTarget,
|
|
82290
82322
|
applyDomSelection
|
|
82291
82323
|
}) {
|
|
82292
|
-
|
|
82324
|
+
useEffect123(() => {
|
|
82293
82325
|
if (!STUDIO_TEST_HOOKS_ENABLED || typeof window === "undefined") return;
|
|
82294
82326
|
const api = {
|
|
82295
82327
|
runtimeMode: STUDIO_RUNTIME_MODE,
|
|
@@ -82679,13 +82711,13 @@ function useDomSelection({
|
|
|
82679
82711
|
},
|
|
82680
82712
|
[activeCompPath, announceTimelineSelection2, buildDomSelectionFromTarget, previewIframeRef]
|
|
82681
82713
|
);
|
|
82682
|
-
|
|
82714
|
+
useEffect124(() => {
|
|
82683
82715
|
refreshDomEditGroupSelectionsFromPreviewRef.current = refreshDomEditGroupSelectionsFromPreview;
|
|
82684
82716
|
}, [refreshDomEditGroupSelectionsFromPreview]);
|
|
82685
|
-
|
|
82717
|
+
useEffect124(() => {
|
|
82686
82718
|
updateDomEditHoverSelection(null);
|
|
82687
82719
|
}, [activeCompPath, projectId, previewIframe, refreshKey, updateDomEditHoverSelection]);
|
|
82688
|
-
|
|
82720
|
+
useEffect124(() => {
|
|
82689
82721
|
const previous = compositionIdentityRef.current;
|
|
82690
82722
|
if (previous.activeCompPath === activeCompPath && previous.projectId === projectId) return;
|
|
82691
82723
|
compositionIdentityRef.current = { activeCompPath, projectId };
|
|
@@ -82693,7 +82725,7 @@ function useDomSelection({
|
|
|
82693
82725
|
setActiveGroupElementState(null);
|
|
82694
82726
|
applyDomSelection(null, { revealPanel: false });
|
|
82695
82727
|
}, [activeCompPath, projectId, applyDomSelection]);
|
|
82696
|
-
|
|
82728
|
+
useEffect124(() => {
|
|
82697
82729
|
if (!domEditHoverSelection) return;
|
|
82698
82730
|
const shouldClear = captionEditMode || domEditSelectionsTargetSame(domEditHoverSelection, domEditSelection) || domEditSelectionInGroup(domEditGroupSelections, domEditHoverSelection) || !selectionElementLive(domEditHoverSelection);
|
|
82699
82731
|
if (shouldClear) updateDomEditHoverSelection(null);
|
|
@@ -82704,7 +82736,7 @@ function useDomSelection({
|
|
|
82704
82736
|
domEditGroupSelections,
|
|
82705
82737
|
updateDomEditHoverSelection
|
|
82706
82738
|
]);
|
|
82707
|
-
|
|
82739
|
+
useEffect124(() => {
|
|
82708
82740
|
if (!captionEditMode) return;
|
|
82709
82741
|
applyDomSelection(null, { revealPanel: false });
|
|
82710
82742
|
}, [applyDomSelection, captionEditMode]);
|
|
@@ -83176,7 +83208,8 @@ async function postPatchElement(projectId, targetPath, body, showToast) {
|
|
|
83176
83208
|
}
|
|
83177
83209
|
);
|
|
83178
83210
|
if (!response.ok) {
|
|
83179
|
-
|
|
83211
|
+
const held = await heldFileWordsOf(response, targetPath);
|
|
83212
|
+
showToast(held ?? formatPatchRejectionMessage(await readErrorResponseBody(response)), "error");
|
|
83180
83213
|
throw await createStudioSaveHttpError(response, `Failed to patch ${targetPath}`, {
|
|
83181
83214
|
alreadyToasted: true
|
|
83182
83215
|
});
|
|
@@ -84776,6 +84809,8 @@ async function commitStructuralMutation(pid, targetPath, route, body, label, dep
|
|
|
84776
84809
|
}
|
|
84777
84810
|
);
|
|
84778
84811
|
if (!mutateResponse.ok) {
|
|
84812
|
+
const held = await heldFileWordsOf(mutateResponse, targetPath);
|
|
84813
|
+
if (held) throw new Error(held);
|
|
84779
84814
|
const errBody = await mutateResponse.json().catch(() => null);
|
|
84780
84815
|
throw new Error(errBody?.error ?? `Failed to ${label.toLowerCase()} in ${targetPath}`);
|
|
84781
84816
|
}
|
|
@@ -85679,7 +85714,7 @@ function useGsapKeyframeOps({
|
|
|
85679
85714
|
}
|
|
85680
85715
|
|
|
85681
85716
|
// src/hooks/useGsapPropertyDebounce.ts
|
|
85682
|
-
import { useCallback as useCallback142, useEffect as
|
|
85717
|
+
import { useCallback as useCallback142, useEffect as useEffect125, useRef as useRef154 } from "react";
|
|
85683
85718
|
import { parseGsapScriptAcorn as parseGsapScriptAcorn2 } from "@hyperframes/core/gsap-parser-acorn";
|
|
85684
85719
|
var DEBOUNCE_MS = 150;
|
|
85685
85720
|
function mergeTweenProperties(sdkSession, animationId, edited, kind) {
|
|
@@ -85749,7 +85784,7 @@ function useGsapPropertyDebounce(commitMutationSafely, sdk) {
|
|
|
85749
85784
|
},
|
|
85750
85785
|
[flushPendingPropertyEdit]
|
|
85751
85786
|
);
|
|
85752
|
-
|
|
85787
|
+
useEffect125(() => {
|
|
85753
85788
|
return () => {
|
|
85754
85789
|
if (debounceTimerRef.current) clearTimeout(debounceTimerRef.current);
|
|
85755
85790
|
void flushPendingPropertyEdit();
|
|
@@ -86317,10 +86352,10 @@ function useGsapScriptCommits({ projectIdRef, activeCompPath, previewIframeRef,
|
|
|
86317
86352
|
}
|
|
86318
86353
|
|
|
86319
86354
|
// src/hooks/useDomEditWiring.ts
|
|
86320
|
-
import { useCallback as useCallback147, useEffect as
|
|
86355
|
+
import { useCallback as useCallback147, useEffect as useEffect127, useRef as useRef158 } from "react";
|
|
86321
86356
|
|
|
86322
86357
|
// src/hooks/useDomEditPreviewSync.ts
|
|
86323
|
-
import { useEffect as
|
|
86358
|
+
import { useEffect as useEffect126, useRef as useRef156 } from "react";
|
|
86324
86359
|
function useDomEditPreviewSync({
|
|
86325
86360
|
previewIframe,
|
|
86326
86361
|
captionEditMode,
|
|
@@ -86333,7 +86368,7 @@ function useDomEditPreviewSync({
|
|
|
86333
86368
|
openSourceForSelection,
|
|
86334
86369
|
gsapCacheVersion
|
|
86335
86370
|
}) {
|
|
86336
|
-
|
|
86371
|
+
useEffect126(() => {
|
|
86337
86372
|
if (!previewIframe) return;
|
|
86338
86373
|
const syncSelectionFromDocument = async () => {
|
|
86339
86374
|
if (captionEditMode) return;
|
|
@@ -86372,7 +86407,7 @@ function useDomEditPreviewSync({
|
|
|
86372
86407
|
]);
|
|
86373
86408
|
const openSourceRef = useRef156(openSourceForSelection);
|
|
86374
86409
|
openSourceRef.current = openSourceForSelection;
|
|
86375
|
-
|
|
86410
|
+
useEffect126(
|
|
86376
86411
|
// fallow-ignore-next-line complexity
|
|
86377
86412
|
() => {
|
|
86378
86413
|
if (!domEditSelection || !openSourceRef.current) return;
|
|
@@ -86788,7 +86823,7 @@ function useDomEditWiring(params) {
|
|
|
86788
86823
|
},
|
|
86789
86824
|
[openSourceForSelection]
|
|
86790
86825
|
);
|
|
86791
|
-
|
|
86826
|
+
useEffect127(() => {
|
|
86792
86827
|
if (!domEditSelection?.id) return;
|
|
86793
86828
|
const { selectedElementId, elements, setSelectedElementId } = usePlayerStore.getState();
|
|
86794
86829
|
const matchKey = elements.find(
|
|
@@ -86798,7 +86833,7 @@ function useDomEditWiring(params) {
|
|
|
86798
86833
|
if (key2 && key2 !== selectedElementId) setSelectedElementId(key2);
|
|
86799
86834
|
}, [domEditSelection?.id]);
|
|
86800
86835
|
const prevRefreshKeyRef = useRef158(refreshKey);
|
|
86801
|
-
|
|
86836
|
+
useEffect127(() => {
|
|
86802
86837
|
if (refreshKey !== prevRefreshKeyRef.current) {
|
|
86803
86838
|
prevRefreshKeyRef.current = refreshKey;
|
|
86804
86839
|
bumpGsapCache();
|
|
@@ -88412,7 +88447,7 @@ function useGsapAwareEditing({
|
|
|
88412
88447
|
}
|
|
88413
88448
|
|
|
88414
88449
|
// src/hooks/useStudioSelectionPublisher.ts
|
|
88415
|
-
import { useEffect as
|
|
88450
|
+
import { useEffect as useEffect128, useRef as useRef159 } from "react";
|
|
88416
88451
|
|
|
88417
88452
|
// src/utils/studioSelectionSnapshot.ts
|
|
88418
88453
|
function round34(value) {
|
|
@@ -88505,7 +88540,7 @@ function useStudioSelectionPublisher({
|
|
|
88505
88540
|
}) {
|
|
88506
88541
|
const lastSelectionRefreshKeyRef = useRef159(refreshKey);
|
|
88507
88542
|
const pendingSelectionRefreshKeyRef = useRef159(null);
|
|
88508
|
-
|
|
88543
|
+
useEffect128(() => {
|
|
88509
88544
|
if (!projectId) return;
|
|
88510
88545
|
const selection = domEditSelection && selectionElementLive(domEditSelection) ? buildStudioSelectionSnapshot({
|
|
88511
88546
|
projectId,
|
|
@@ -88516,13 +88551,13 @@ function useStudioSelectionPublisher({
|
|
|
88516
88551
|
void putSelection(projectId, selection, controller.signal).catch(reportSelectionPublishError);
|
|
88517
88552
|
return () => controller.abort();
|
|
88518
88553
|
}, [domEditSelection, projectId]);
|
|
88519
|
-
|
|
88554
|
+
useEffect128(() => {
|
|
88520
88555
|
if (!projectId) return;
|
|
88521
88556
|
return () => {
|
|
88522
88557
|
void putSelection(projectId, null).catch(reportSelectionPublishError);
|
|
88523
88558
|
};
|
|
88524
88559
|
}, [projectId]);
|
|
88525
|
-
|
|
88560
|
+
useEffect128(() => {
|
|
88526
88561
|
if (lastSelectionRefreshKeyRef.current === refreshKey) return;
|
|
88527
88562
|
lastSelectionRefreshKeyRef.current = refreshKey;
|
|
88528
88563
|
pendingSelectionRefreshKeyRef.current = domEditSelectionRef.current ? refreshKey : null;
|
|
@@ -88531,7 +88566,7 @@ function useStudioSelectionPublisher({
|
|
|
88531
88566
|
void putSelection(projectId, null, controller.signal).catch(reportSelectionPublishError);
|
|
88532
88567
|
return () => controller.abort();
|
|
88533
88568
|
}, [domEditSelectionRef, projectId, refreshKey]);
|
|
88534
|
-
|
|
88569
|
+
useEffect128(() => {
|
|
88535
88570
|
if (pendingSelectionRefreshKeyRef.current === null) return;
|
|
88536
88571
|
pendingSelectionRefreshKeyRef.current = null;
|
|
88537
88572
|
const selection = domEditSelectionRef.current;
|
|
@@ -88604,7 +88639,7 @@ function useKeyframeEaseCommits({
|
|
|
88604
88639
|
}
|
|
88605
88640
|
|
|
88606
88641
|
// src/hooks/useCommitPreflightCapabilities.ts
|
|
88607
|
-
import { useEffect as
|
|
88642
|
+
import { useEffect as useEffect129, useMemo as useMemo75, useRef as useRef160, useState as useState129 } from "react";
|
|
88608
88643
|
function runCommitPreflights(selection, fileAnimations, iframe, group) {
|
|
88609
88644
|
const target = { id: selection.id ?? null, selector: selection.selector ?? null };
|
|
88610
88645
|
const animations = getAnimationsForElement(fileAnimations, target, selection.element);
|
|
@@ -88666,7 +88701,7 @@ function useCommitPreflightCapabilities({
|
|
|
88666
88701
|
}) {
|
|
88667
88702
|
const parsesRef = useRef160(/* @__PURE__ */ new Map());
|
|
88668
88703
|
const [parseTick, setParseTick] = useState129(0);
|
|
88669
|
-
|
|
88704
|
+
useEffect129(() => {
|
|
88670
88705
|
if (!enabled || !projectId) return;
|
|
88671
88706
|
const targets = selection ? [selection, ...groupSelections] : groupSelections;
|
|
88672
88707
|
for (const file of new Set(targets.map(gsapSourceFileForSelection))) {
|
|
@@ -88723,13 +88758,13 @@ function timelineElementsForDelete(members, elements) {
|
|
|
88723
88758
|
}
|
|
88724
88759
|
|
|
88725
88760
|
// src/hooks/useLivePreviewIframe.ts
|
|
88726
|
-
import { useEffect as
|
|
88761
|
+
import { useEffect as useEffect130, useRef as useRef161, useState as useState130 } from "react";
|
|
88727
88762
|
function useLivePreviewIframe2(host) {
|
|
88728
88763
|
const [promoted, setPromoted] = useState130();
|
|
88729
88764
|
const live = host && promoted?.host === host ? promoted.live : host;
|
|
88730
88765
|
const liveRef = useRef161(live);
|
|
88731
88766
|
liveRef.current = live;
|
|
88732
|
-
|
|
88767
|
+
useEffect130(() => {
|
|
88733
88768
|
if (!host) return;
|
|
88734
88769
|
return onPreviewPromoted(host.ownerDocument, ({ retired, live: next }) => {
|
|
88735
88770
|
if (retired === liveRef.current) setPromoted({ host, live: next });
|
|
@@ -89275,23 +89310,23 @@ function useDomEditSession({
|
|
|
89275
89310
|
}
|
|
89276
89311
|
|
|
89277
89312
|
// src/hooks/useSdkSelectionSync.ts
|
|
89278
|
-
import { useEffect as
|
|
89313
|
+
import { useEffect as useEffect131 } from "react";
|
|
89279
89314
|
function toHfIds(group, primary) {
|
|
89280
89315
|
const source = group.length > 0 ? group : primary ? [primary] : [];
|
|
89281
89316
|
return source.flatMap((s) => s.hfId ? [s.hfId] : []);
|
|
89282
89317
|
}
|
|
89283
89318
|
function useSdkSelectionSync(session, domEditSelection, domEditGroupSelections) {
|
|
89284
|
-
|
|
89319
|
+
useEffect131(() => {
|
|
89285
89320
|
if (!session) return;
|
|
89286
89321
|
session.setSelection(toHfIds(domEditGroupSelections, domEditSelection));
|
|
89287
89322
|
}, [session, domEditSelection, domEditGroupSelections]);
|
|
89288
89323
|
}
|
|
89289
89324
|
|
|
89290
89325
|
// src/hooks/useStudioSdkSessions.ts
|
|
89291
|
-
import { useEffect as
|
|
89326
|
+
import { useEffect as useEffect133 } from "react";
|
|
89292
89327
|
|
|
89293
89328
|
// src/hooks/useSdkSession.ts
|
|
89294
|
-
import { useState as useState131, useEffect as
|
|
89329
|
+
import { useState as useState131, useEffect as useEffect132, useCallback as useCallback154, useRef as useRef162 } from "react";
|
|
89295
89330
|
import { openComposition as openComposition3 } from "@hyperframes/sdk";
|
|
89296
89331
|
|
|
89297
89332
|
// src/hooks/externalFileReloadBus.ts
|
|
@@ -89415,7 +89450,7 @@ function useSdkSession(projectId, activeCompPath, fileTree = [], fileTreeLoaded
|
|
|
89415
89450
|
const [unreachableProject, setUnreachableProject] = useState131(null);
|
|
89416
89451
|
const [compositionMissing, setCompositionMissing] = useState131(false);
|
|
89417
89452
|
const refreshedAbsentPathsRef = useRef162(/* @__PURE__ */ new Set());
|
|
89418
|
-
|
|
89453
|
+
useEffect132(() => {
|
|
89419
89454
|
refreshedAbsentPathsRef.current.clear();
|
|
89420
89455
|
}, [projectId]);
|
|
89421
89456
|
function handleReadFailure(read2, forProjectId, forPath) {
|
|
@@ -89428,7 +89463,7 @@ function useSdkSession(projectId, activeCompPath, fileTree = [], fileTreeLoaded
|
|
|
89428
89463
|
refreshedAbsentPathsRef.current.add(key2);
|
|
89429
89464
|
onAbsentRead?.(forPath);
|
|
89430
89465
|
}
|
|
89431
|
-
|
|
89466
|
+
useEffect132(
|
|
89432
89467
|
() => addExternalFileReloadListener((changedPath) => {
|
|
89433
89468
|
if (changedPath === "." || changedPath === activeCompPathRef.current) {
|
|
89434
89469
|
setReloadToken((token) => token + 1);
|
|
@@ -89436,7 +89471,7 @@ function useSdkSession(projectId, activeCompPath, fileTree = [], fileTreeLoaded
|
|
|
89436
89471
|
}),
|
|
89437
89472
|
[]
|
|
89438
89473
|
);
|
|
89439
|
-
|
|
89474
|
+
useEffect132(() => {
|
|
89440
89475
|
const generation = ++generationRef.current;
|
|
89441
89476
|
let cancelled = false;
|
|
89442
89477
|
const previous = ownedSessionRef.current;
|
|
@@ -89544,7 +89579,7 @@ function useStudioSdkSessions(projectId, activeCompPath, masterCompPath, fileTre
|
|
|
89544
89579
|
refreshFileTree
|
|
89545
89580
|
);
|
|
89546
89581
|
const editFlowSdkSession = activeCompPath ? sdkHandle.session : null;
|
|
89547
|
-
|
|
89582
|
+
useEffect133(() => {
|
|
89548
89583
|
usePreviewVariablesStore.getState().setValues(null);
|
|
89549
89584
|
}, [projectId, activeCompPath]);
|
|
89550
89585
|
return { sdkHandle: useStableHandlers(sdkHandle, projectId), editFlowSdkSession };
|
|
@@ -89652,7 +89687,7 @@ async function deleteExternalConflictSnapshot(projectId, filePath) {
|
|
|
89652
89687
|
}
|
|
89653
89688
|
|
|
89654
89689
|
// src/hooks/useExternalFileChangeCoordinator.ts
|
|
89655
|
-
import { useCallback as useCallback155, useEffect as
|
|
89690
|
+
import { useCallback as useCallback155, useEffect as useEffect134, useRef as useRef163, useState as useState132 } from "react";
|
|
89656
89691
|
function testHotAdapter() {
|
|
89657
89692
|
const value = globalThis.__HF_STUDIO_HOT_TEST_ADAPTER__;
|
|
89658
89693
|
if (!value || typeof value !== "object") return null;
|
|
@@ -89723,22 +89758,22 @@ function useExternalFileChangeCoordinator({
|
|
|
89723
89758
|
blockedRef.current = current2;
|
|
89724
89759
|
setBlockedState(current2);
|
|
89725
89760
|
}, []);
|
|
89726
|
-
|
|
89761
|
+
useEffect134(() => {
|
|
89727
89762
|
mountedRef.current = true;
|
|
89728
89763
|
return () => {
|
|
89729
89764
|
mountedRef.current = false;
|
|
89730
89765
|
generationRef.current += 1;
|
|
89731
89766
|
};
|
|
89732
89767
|
}, []);
|
|
89733
|
-
|
|
89768
|
+
useEffect134(() => {
|
|
89734
89769
|
pendingPayloadRef.current = null;
|
|
89735
89770
|
}, [projectId]);
|
|
89736
|
-
|
|
89771
|
+
useEffect134(() => {
|
|
89737
89772
|
generationRef.current += 1;
|
|
89738
89773
|
setBlocked(null);
|
|
89739
89774
|
lastEventIdentityRef.current = null;
|
|
89740
89775
|
}, [projectId, activeCompPath, setBlocked]);
|
|
89741
|
-
|
|
89776
|
+
useEffect134(() => {
|
|
89742
89777
|
if (!projectId || !recoveryFilePath || !loadConflictSnapshot) return;
|
|
89743
89778
|
const generation = ++generationRef.current;
|
|
89744
89779
|
let cancelled = false;
|
|
@@ -89963,7 +89998,7 @@ function useExternalFileChangeCoordinator({
|
|
|
89963
89998
|
);
|
|
89964
89999
|
const processChangeRef = useRef163(processChange);
|
|
89965
90000
|
processChangeRef.current = processChange;
|
|
89966
|
-
|
|
90001
|
+
useEffect134(() => {
|
|
89967
90002
|
const handler = (delivery) => {
|
|
89968
90003
|
const payload = decodeFileChange(delivery);
|
|
89969
90004
|
announceExternalFileChange(payload);
|
|
@@ -90462,7 +90497,7 @@ function useBlockHandlers({
|
|
|
90462
90497
|
}
|
|
90463
90498
|
|
|
90464
90499
|
// src/hooks/useAppHotkeys.ts
|
|
90465
|
-
import { useCallback as useCallback159, useEffect as
|
|
90500
|
+
import { useCallback as useCallback159, useEffect as useEffect135, useRef as useRef165 } from "react";
|
|
90466
90501
|
|
|
90467
90502
|
// src/hooks/appHotkeysDispatch.ts
|
|
90468
90503
|
function handleUndoRedoKey(event, onUndo, onRedo) {
|
|
@@ -90883,7 +90918,7 @@ function useAppHotkeys({
|
|
|
90883
90918
|
if (dispatchModifierKey(event, key2, cb)) return;
|
|
90884
90919
|
dispatchPlainKey(event, key2, cb);
|
|
90885
90920
|
}, []);
|
|
90886
|
-
|
|
90921
|
+
useEffect135(() => {
|
|
90887
90922
|
window.addEventListener("keydown", handleAppKeyDown, true);
|
|
90888
90923
|
return () => window.removeEventListener("keydown", handleAppKeyDown, true);
|
|
90889
90924
|
}, [handleAppKeyDown]);
|
|
@@ -90899,7 +90934,7 @@ function useAppHotkeys({
|
|
|
90899
90934
|
},
|
|
90900
90935
|
[handleAppKeyDown]
|
|
90901
90936
|
);
|
|
90902
|
-
|
|
90937
|
+
useEffect135(
|
|
90903
90938
|
() => () => {
|
|
90904
90939
|
previewHistoryCleanupRef.current?.();
|
|
90905
90940
|
previewHistoryCleanupRef.current = null;
|
|
@@ -91426,7 +91461,7 @@ function useClipboard({
|
|
|
91426
91461
|
}
|
|
91427
91462
|
|
|
91428
91463
|
// src/hooks/useCaptionDetection.ts
|
|
91429
|
-
import { useEffect as
|
|
91464
|
+
import { useEffect as useEffect136, useRef as useRef167 } from "react";
|
|
91430
91465
|
|
|
91431
91466
|
// src/captions/parser.ts
|
|
91432
91467
|
import {
|
|
@@ -91722,7 +91757,7 @@ function useCaptionDetection({
|
|
|
91722
91757
|
}) {
|
|
91723
91758
|
const livePreviewIframe = useLivePreviewIframe();
|
|
91724
91759
|
const prevCompPathRef = useRef167(activeCompPath);
|
|
91725
|
-
|
|
91760
|
+
useEffect136(() => {
|
|
91726
91761
|
if (prevCompPathRef.current !== activeCompPath) {
|
|
91727
91762
|
prevCompPathRef.current = activeCompPath;
|
|
91728
91763
|
const store = useCaptionStore.getState();
|
|
@@ -91732,7 +91767,7 @@ function useCaptionDetection({
|
|
|
91732
91767
|
}
|
|
91733
91768
|
}
|
|
91734
91769
|
}, [activeCompPath]);
|
|
91735
|
-
|
|
91770
|
+
useEffect136(() => {
|
|
91736
91771
|
if (!projectId) return;
|
|
91737
91772
|
let activating = false;
|
|
91738
91773
|
const tryActivateCaptions = () => {
|
|
@@ -91814,7 +91849,7 @@ function useCaptionDetection({
|
|
|
91814
91849
|
window.removeEventListener("message", handleMessage);
|
|
91815
91850
|
};
|
|
91816
91851
|
}, [activeCompPath, projectId, compIdToSrc, captionSync, previewIframeRef, livePreviewIframe]);
|
|
91817
|
-
|
|
91852
|
+
useEffect136(() => {
|
|
91818
91853
|
if (captionEditMode) {
|
|
91819
91854
|
setRightCollapsed(!captionHasSelection);
|
|
91820
91855
|
}
|
|
@@ -91822,7 +91857,7 @@ function useCaptionDetection({
|
|
|
91822
91857
|
}
|
|
91823
91858
|
|
|
91824
91859
|
// src/hooks/useConsoleErrorCapture.ts
|
|
91825
|
-
import { useCallback as useCallback161, useEffect as
|
|
91860
|
+
import { useCallback as useCallback161, useEffect as useEffect137, useRef as useRef168, useState as useState134 } from "react";
|
|
91826
91861
|
import { STUDIO_PREVIEW_ERRORS } from "@hyperframes/core/studio-preview-mark";
|
|
91827
91862
|
function useConsoleErrorCapture(previewIframe) {
|
|
91828
91863
|
const [consoleErrors, setConsoleErrors] = useState134(null);
|
|
@@ -91831,7 +91866,7 @@ function useConsoleErrorCapture(previewIframe) {
|
|
|
91831
91866
|
consoleErrorsRef.current = [];
|
|
91832
91867
|
setConsoleErrors(null);
|
|
91833
91868
|
}, []);
|
|
91834
|
-
|
|
91869
|
+
useEffect137(() => {
|
|
91835
91870
|
resetErrors();
|
|
91836
91871
|
if (!previewIframe) return;
|
|
91837
91872
|
let patchedWin = null;
|
|
@@ -92002,7 +92037,7 @@ function useFrameCapture({
|
|
|
92002
92037
|
}
|
|
92003
92038
|
|
|
92004
92039
|
// src/hooks/useLintModal.ts
|
|
92005
|
-
import { useState as useState136, useCallback as useCallback163, useEffect as
|
|
92040
|
+
import { useState as useState136, useCallback as useCallback163, useEffect as useEffect138, useRef as useRef170, useMemo as useMemo79 } from "react";
|
|
92006
92041
|
function parseFinding(f) {
|
|
92007
92042
|
return {
|
|
92008
92043
|
severity: f.severity === "error" ? "error" : "warning",
|
|
@@ -92045,7 +92080,7 @@ function useLintModal(projectId, refreshKey) {
|
|
|
92045
92080
|
}
|
|
92046
92081
|
}, [projectId]);
|
|
92047
92082
|
const prevProjectIdRef = useRef170(projectId);
|
|
92048
|
-
|
|
92083
|
+
useEffect138(() => {
|
|
92049
92084
|
if (projectId !== prevProjectIdRef.current) {
|
|
92050
92085
|
autoLintRanRef.current = false;
|
|
92051
92086
|
prevProjectIdRef.current = projectId;
|
|
@@ -92054,7 +92089,7 @@ function useLintModal(projectId, refreshKey) {
|
|
|
92054
92089
|
autoLintRanRef.current = true;
|
|
92055
92090
|
void runBackgroundLint();
|
|
92056
92091
|
}, [projectId, runBackgroundLint]);
|
|
92057
|
-
|
|
92092
|
+
useEffect138(() => {
|
|
92058
92093
|
if (!projectId || !refreshKey) return;
|
|
92059
92094
|
const timer = setTimeout(() => void runBackgroundLint(), 1e3);
|
|
92060
92095
|
return () => clearTimeout(timer);
|
|
@@ -92080,7 +92115,7 @@ function useLintModal(projectId, refreshKey) {
|
|
|
92080
92115
|
const badgeFindings = lintModal ?? backgroundFindings;
|
|
92081
92116
|
const lintFindingCount = badgeFindings.length;
|
|
92082
92117
|
const hasLintError = badgeFindings.some((f) => f.severity === "error");
|
|
92083
|
-
|
|
92118
|
+
useEffect138(() => {
|
|
92084
92119
|
usePlayerStore.getState().setLintFindingsByElement(findingsByElement);
|
|
92085
92120
|
}, [findingsByElement]);
|
|
92086
92121
|
return {
|
|
@@ -92097,7 +92132,7 @@ function useLintModal(projectId, refreshKey) {
|
|
|
92097
92132
|
}
|
|
92098
92133
|
|
|
92099
92134
|
// src/hooks/useStudioUrlState.ts
|
|
92100
|
-
import { useCallback as useCallback164, useEffect as
|
|
92135
|
+
import { useCallback as useCallback164, useEffect as useEffect139, useRef as useRef171, useState as useState137 } from "react";
|
|
92101
92136
|
|
|
92102
92137
|
// src/utils/studioUrlState.ts
|
|
92103
92138
|
var VALID_TABS = [
|
|
@@ -92408,7 +92443,7 @@ function useStudioUrlState({
|
|
|
92408
92443
|
previewIframeRef
|
|
92409
92444
|
]
|
|
92410
92445
|
);
|
|
92411
|
-
|
|
92446
|
+
useEffect139(() => {
|
|
92412
92447
|
if (!projectId || hydratedSeekRef.current || compositionLoading) return;
|
|
92413
92448
|
const nextTime = duration > 0 ? clampNumber(initialState2.currentTime ?? 0, 0, duration) : Math.max(0, initialState2.currentTime ?? 0);
|
|
92414
92449
|
usePlayerStore.getState().requestSeek(nextTime);
|
|
@@ -92416,7 +92451,7 @@ function useStudioUrlState({
|
|
|
92416
92451
|
hydratedSeekRef.current = true;
|
|
92417
92452
|
}, [projectId, compositionLoading, duration, initialState2.currentTime]);
|
|
92418
92453
|
const selectionHydrationTime = selectionHydrated ? 0 : currentTime;
|
|
92419
|
-
|
|
92454
|
+
useEffect139(() => {
|
|
92420
92455
|
if (!projectId || hydratedSelectionRef.current || compositionLoading) return;
|
|
92421
92456
|
if (!hydratedSeekRef.current) return;
|
|
92422
92457
|
const targetTime = initialState2.currentTime;
|
|
@@ -92443,7 +92478,7 @@ function useStudioUrlState({
|
|
|
92443
92478
|
projectId,
|
|
92444
92479
|
refreshKey
|
|
92445
92480
|
]);
|
|
92446
|
-
|
|
92481
|
+
useEffect139(() => {
|
|
92447
92482
|
if (hydratedInitialTimeRef.current) return;
|
|
92448
92483
|
const targetTime = stableTimeRef.current;
|
|
92449
92484
|
if (targetTime == null) {
|
|
@@ -92453,7 +92488,7 @@ function useStudioUrlState({
|
|
|
92453
92488
|
if (Math.abs(currentTime - targetTime) > 0.05) return;
|
|
92454
92489
|
hydratedInitialTimeRef.current = true;
|
|
92455
92490
|
}, [currentTime]);
|
|
92456
|
-
|
|
92491
|
+
useEffect139(() => {
|
|
92457
92492
|
if (!activeCompPathHydrated) return;
|
|
92458
92493
|
if (!hydratedSeekRef.current) return;
|
|
92459
92494
|
if (!hydratedInitialTimeRef.current) return;
|
|
@@ -92464,12 +92499,12 @@ function useStudioUrlState({
|
|
|
92464
92499
|
}, 200);
|
|
92465
92500
|
return () => window.clearTimeout(handle);
|
|
92466
92501
|
}, [activeCompPathHydrated, buildUrlState, currentTime, duration, isPlaying, projectId]);
|
|
92467
|
-
|
|
92502
|
+
useEffect139(() => {
|
|
92468
92503
|
if (!activeCompPathHydrated) return;
|
|
92469
92504
|
if (!projectId) return;
|
|
92470
92505
|
replaceHash(buildStudioHash(projectId, buildUrlState()));
|
|
92471
92506
|
}, [activeCompPathHydrated, buildUrlState, projectId]);
|
|
92472
|
-
|
|
92507
|
+
useEffect139(() => {
|
|
92473
92508
|
if (!projectId) return;
|
|
92474
92509
|
const onHashChange = () => {
|
|
92475
92510
|
if (parseProjectIdFromHash(window.location.hash) !== projectId) return;
|
|
@@ -93573,11 +93608,11 @@ var StudioHeader = memo46(function StudioHeader2({
|
|
|
93573
93608
|
});
|
|
93574
93609
|
|
|
93575
93610
|
// src/hooks/useGestureCommit.ts
|
|
93576
|
-
import { useState as useState141, useCallback as useCallback167, useRef as useRef174, useEffect as
|
|
93611
|
+
import { useState as useState141, useCallback as useCallback167, useRef as useRef174, useEffect as useEffect141 } from "react";
|
|
93577
93612
|
|
|
93578
93613
|
// src/hooks/useGestureRecording.ts
|
|
93579
93614
|
import { revealClip as revealClip2 } from "@hyperframes/core/runtime/clip-reveal";
|
|
93580
|
-
import { useCallback as useCallback166, useEffect as
|
|
93615
|
+
import { useCallback as useCallback166, useEffect as useEffect140, useRef as useRef173, useState as useState140 } from "react";
|
|
93581
93616
|
function readBasePosition(element, iframeEl) {
|
|
93582
93617
|
let baseOpacity = 1;
|
|
93583
93618
|
let baseScale = 1;
|
|
@@ -93729,7 +93764,7 @@ function useGestureRecording() {
|
|
|
93729
93764
|
const refs = useRef173(createRecordingRefs());
|
|
93730
93765
|
const samplesRef = useRef173(refs.current.samples);
|
|
93731
93766
|
const trailRef = useRef173(refs.current.trail);
|
|
93732
|
-
|
|
93767
|
+
useEffect140(() => {
|
|
93733
93768
|
const r = refs.current;
|
|
93734
93769
|
return () => {
|
|
93735
93770
|
isRecordingRef.current = false;
|
|
@@ -94120,7 +94155,7 @@ function useGestureCommit({
|
|
|
94120
94155
|
const commitInFlightRef = useRef174(false);
|
|
94121
94156
|
const capturedSelectionRef = useRef174(null);
|
|
94122
94157
|
const capturedAnimationsRef = useRef174([]);
|
|
94123
|
-
|
|
94158
|
+
useEffect141(() => () => clearInterval(recordingAutoStopRef.current), []);
|
|
94124
94159
|
const cancelRecording = useCallback167(() => {
|
|
94125
94160
|
clearInterval(recordingAutoStopRef.current);
|
|
94126
94161
|
gestureRecording.stopRecording();
|
|
@@ -94130,7 +94165,7 @@ function useGestureCommit({
|
|
|
94130
94165
|
capturedSelectionRef.current = null;
|
|
94131
94166
|
setGestureState("idle");
|
|
94132
94167
|
}, [gestureRecording, isGestureRecordingRef]);
|
|
94133
|
-
|
|
94168
|
+
useEffect141(() => {
|
|
94134
94169
|
if (readOnlyPreview && gestureStateRef.current === "recording") cancelRecording();
|
|
94135
94170
|
}, [cancelRecording, readOnlyPreview]);
|
|
94136
94171
|
const stopAndCommitRecording = useCallback167(async () => {
|
|
@@ -94536,7 +94571,7 @@ import { useMemo as useMemo90 } from "react";
|
|
|
94536
94571
|
import { memo as memo51, useCallback as useCallback174 } from "react";
|
|
94537
94572
|
|
|
94538
94573
|
// src/components/MediaPreview.tsx
|
|
94539
|
-
import { useEffect as
|
|
94574
|
+
import { useEffect as useEffect142, useState as useState142 } from "react";
|
|
94540
94575
|
import { encodeUrlPath as encodeUrlPath8 } from "@hyperframes/parsers";
|
|
94541
94576
|
import { jsx as jsx221, jsxs as jsxs172 } from "react/jsx-runtime";
|
|
94542
94577
|
function MediaErrorPanel({ name, filePath }) {
|
|
@@ -94571,7 +94606,7 @@ function MediaPreview({ projectId, filePath }) {
|
|
|
94571
94606
|
source: serveUrl,
|
|
94572
94607
|
failed: false
|
|
94573
94608
|
});
|
|
94574
|
-
|
|
94609
|
+
useEffect142(() => {
|
|
94575
94610
|
setFailure({ source: serveUrl, failed: false });
|
|
94576
94611
|
}, [serveUrl]);
|
|
94577
94612
|
const failed2 = failure2.source === serveUrl && failure2.failed;
|
|
@@ -94659,7 +94694,7 @@ function MediaPreview({ projectId, filePath }) {
|
|
|
94659
94694
|
}
|
|
94660
94695
|
|
|
94661
94696
|
// src/components/sidebar/AssetsTab.tsx
|
|
94662
|
-
import { memo as memo48, useState as useState148, useCallback as useCallback171, useRef as useRef179, useMemo as useMemo85, useEffect as
|
|
94697
|
+
import { memo as memo48, useState as useState148, useCallback as useCallback171, useRef as useRef179, useMemo as useMemo85, useEffect as useEffect148 } from "react";
|
|
94663
94698
|
|
|
94664
94699
|
// src/components/ui/SearchInput.tsx
|
|
94665
94700
|
import { jsx as jsx222, jsxs as jsxs173 } from "react/jsx-runtime";
|
|
@@ -94770,11 +94805,11 @@ var CATEGORY_LABELS = {
|
|
|
94770
94805
|
var FILTER_ORDER = ["audio", "images", "video", "fonts"];
|
|
94771
94806
|
|
|
94772
94807
|
// src/components/sidebar/AudioRow.tsx
|
|
94773
|
-
import { useState as useState144, useRef as useRef177, useEffect as
|
|
94808
|
+
import { useState as useState144, useRef as useRef177, useEffect as useEffect144, useCallback as useCallback169 } from "react";
|
|
94774
94809
|
import { classifyWebAudioMediaRoute } from "@hyperframes/core/runtime/web-audio-route";
|
|
94775
94810
|
|
|
94776
94811
|
// src/components/sidebar/AssetContextMenu.tsx
|
|
94777
|
-
import { useCallback as useCallback168, useEffect as
|
|
94812
|
+
import { useCallback as useCallback168, useEffect as useEffect143, useLayoutEffect as useLayoutEffect14, useRef as useRef176, useState as useState143 } from "react";
|
|
94778
94813
|
import { Fragment as Fragment61, jsx as jsx223, jsxs as jsxs174 } from "react/jsx-runtime";
|
|
94779
94814
|
function isValidAssetName(name) {
|
|
94780
94815
|
return name.length > 0 && !/[/\\]/.test(name) && !name.includes("..");
|
|
@@ -94804,7 +94839,7 @@ function ContextMenu3({
|
|
|
94804
94839
|
y: Math.min(y, window.innerHeight - rect.height - margin)
|
|
94805
94840
|
});
|
|
94806
94841
|
}, [x, y, mode]);
|
|
94807
|
-
|
|
94842
|
+
useEffect143(() => {
|
|
94808
94843
|
const onKeyDown = (e) => {
|
|
94809
94844
|
if (e.key === "Escape") {
|
|
94810
94845
|
e.stopPropagation();
|
|
@@ -94829,7 +94864,7 @@ function ContextMenu3({
|
|
|
94829
94864
|
document.addEventListener("keydown", onKeyDown, true);
|
|
94830
94865
|
return () => document.removeEventListener("keydown", onKeyDown, true);
|
|
94831
94866
|
}, [mode, onClose]);
|
|
94832
|
-
|
|
94867
|
+
useEffect143(() => {
|
|
94833
94868
|
if (mode === "menu") {
|
|
94834
94869
|
menuRef.current?.querySelector('[role="menuitem"]')?.focus();
|
|
94835
94870
|
}
|
|
@@ -95096,7 +95131,7 @@ function AudioRow({
|
|
|
95096
95131
|
},
|
|
95097
95132
|
[activateRow]
|
|
95098
95133
|
);
|
|
95099
|
-
|
|
95134
|
+
useEffect144(() => {
|
|
95100
95135
|
return () => {
|
|
95101
95136
|
cancelAnimationFrame(animRef.current);
|
|
95102
95137
|
audioRef.current?.pause();
|
|
@@ -95104,7 +95139,7 @@ function AudioRow({
|
|
|
95104
95139
|
if (stopCurrentPreview === stopPlayback) stopCurrentPreview = null;
|
|
95105
95140
|
};
|
|
95106
95141
|
}, [stopPlayback]);
|
|
95107
|
-
|
|
95142
|
+
useEffect144(() => {
|
|
95108
95143
|
if (playing) {
|
|
95109
95144
|
const barCount = 24;
|
|
95110
95145
|
const loop = () => {
|
|
@@ -95271,7 +95306,7 @@ function AudioRow({
|
|
|
95271
95306
|
}
|
|
95272
95307
|
|
|
95273
95308
|
// src/components/sidebar/GlobalAssetsView.tsx
|
|
95274
|
-
import { useEffect as
|
|
95309
|
+
import { useEffect as useEffect145, useMemo as useMemo84, useState as useState145 } from "react";
|
|
95275
95310
|
import { jsx as jsx225, jsxs as jsxs176 } from "react/jsx-runtime";
|
|
95276
95311
|
function globalAssetRows(records, query = "") {
|
|
95277
95312
|
const q = query.trim().toLowerCase();
|
|
@@ -95287,7 +95322,7 @@ function globalAssetRows(records, query = "") {
|
|
|
95287
95322
|
}
|
|
95288
95323
|
function GlobalAssetsView({ searchQuery }) {
|
|
95289
95324
|
const [records, setRecords] = useState145(null);
|
|
95290
|
-
|
|
95325
|
+
useEffect145(() => {
|
|
95291
95326
|
let cancelled = false;
|
|
95292
95327
|
studioApiFetch("/api/assets/global").then((r) => r.ok ? r.json() : { assets: [] }).then((d) => {
|
|
95293
95328
|
if (!cancelled) setRecords(Array.isArray(d.assets) ? d.assets : []);
|
|
@@ -95330,10 +95365,10 @@ function GlobalAssetsView({ searchQuery }) {
|
|
|
95330
95365
|
}
|
|
95331
95366
|
|
|
95332
95367
|
// src/components/sidebar/AssetCard.tsx
|
|
95333
|
-
import { useState as useState147, useEffect as
|
|
95368
|
+
import { useState as useState147, useEffect as useEffect147, useRef as useRef178, useCallback as useCallback170 } from "react";
|
|
95334
95369
|
|
|
95335
95370
|
// src/components/ui/VideoFrameThumbnail.tsx
|
|
95336
|
-
import { useState as useState146, useEffect as
|
|
95371
|
+
import { useState as useState146, useEffect as useEffect146 } from "react";
|
|
95337
95372
|
import { jsx as jsx226 } from "react/jsx-runtime";
|
|
95338
95373
|
function VideoFrameThumbnail({
|
|
95339
95374
|
src,
|
|
@@ -95341,7 +95376,7 @@ function VideoFrameThumbnail({
|
|
|
95341
95376
|
}) {
|
|
95342
95377
|
const [frame3, setFrame] = useState146(null);
|
|
95343
95378
|
const [failed2, setFailed] = useState146(false);
|
|
95344
|
-
|
|
95379
|
+
useEffect146(() => {
|
|
95345
95380
|
setFailed(false);
|
|
95346
95381
|
const video = document.createElement("video");
|
|
95347
95382
|
video.crossOrigin = "anonymous";
|
|
@@ -95408,7 +95443,7 @@ function openAssetContextMenu(e, setContextMenu) {
|
|
|
95408
95443
|
}
|
|
95409
95444
|
function useProbedDuration(src, skip) {
|
|
95410
95445
|
const [duration, setDuration] = useState147(void 0);
|
|
95411
|
-
|
|
95446
|
+
useEffect147(() => {
|
|
95412
95447
|
if (skip) return;
|
|
95413
95448
|
let cancelled = false;
|
|
95414
95449
|
let retryTimer;
|
|
@@ -95807,7 +95842,7 @@ var AssetsTab = memo48(function AssetsTab2({
|
|
|
95807
95842
|
const [manifest, setManifest] = useState148(/* @__PURE__ */ new Map());
|
|
95808
95843
|
const manifest404Ref = useRef179(/* @__PURE__ */ new Set());
|
|
95809
95844
|
const assetsKey = assets.join("|");
|
|
95810
|
-
|
|
95845
|
+
useEffect148(() => {
|
|
95811
95846
|
if (manifest404Ref.current.has(projectId)) return;
|
|
95812
95847
|
let cancelled = false;
|
|
95813
95848
|
studioApiFetch(buildProjectApiPath(projectId, `/preview/.media/manifest.jsonl`)).then((r) => {
|
|
@@ -96064,11 +96099,11 @@ var AssetsTab = memo48(function AssetsTab2({
|
|
|
96064
96099
|
});
|
|
96065
96100
|
|
|
96066
96101
|
// src/components/sidebar/BlocksTab.tsx
|
|
96067
|
-
import { memo as memo49, useState as useState150, useCallback as useCallback173, useRef as useRef181, useEffect as
|
|
96102
|
+
import { memo as memo49, useState as useState150, useCallback as useCallback173, useRef as useRef181, useEffect as useEffect150 } from "react";
|
|
96068
96103
|
import { createPortal as createPortal14 } from "react-dom";
|
|
96069
96104
|
|
|
96070
96105
|
// src/components/sidebar/PromptPreviewModal.tsx
|
|
96071
|
-
import { useState as useState149, useCallback as useCallback172, useEffect as
|
|
96106
|
+
import { useState as useState149, useCallback as useCallback172, useEffect as useEffect149, useRef as useRef180 } from "react";
|
|
96072
96107
|
import { jsx as jsx229, jsxs as jsxs179 } from "react/jsx-runtime";
|
|
96073
96108
|
function PromptPreviewModal({
|
|
96074
96109
|
title,
|
|
@@ -96088,7 +96123,7 @@ function PromptPreviewModal({
|
|
|
96088
96123
|
containerRef,
|
|
96089
96124
|
canClose: () => valueRef.current === prompt
|
|
96090
96125
|
});
|
|
96091
|
-
|
|
96126
|
+
useEffect149(() => {
|
|
96092
96127
|
requestAnimationFrame(() => {
|
|
96093
96128
|
setEntered(true);
|
|
96094
96129
|
textareaRef.current?.focus();
|
|
@@ -96395,7 +96430,7 @@ function BlockCard({
|
|
|
96395
96430
|
setHovered(false);
|
|
96396
96431
|
onPreview?.(null);
|
|
96397
96432
|
}, [onPreview]);
|
|
96398
|
-
|
|
96433
|
+
useEffect150(() => {
|
|
96399
96434
|
return () => {
|
|
96400
96435
|
if (hoverTimer.current) clearTimeout(hoverTimer.current);
|
|
96401
96436
|
};
|
|
@@ -96556,7 +96591,7 @@ function BlockCard({
|
|
|
96556
96591
|
}
|
|
96557
96592
|
|
|
96558
96593
|
// src/components/sidebar/CompositionsTab.tsx
|
|
96559
|
-
import { memo as memo50, useEffect as
|
|
96594
|
+
import { memo as memo50, useEffect as useEffect151, useLayoutEffect as useLayoutEffect15, useMemo as useMemo86, useRef as useRef182, useState as useState151 } from "react";
|
|
96560
96595
|
import { jsx as jsx231, jsxs as jsxs181 } from "react/jsx-runtime";
|
|
96561
96596
|
var DEFAULT_PREVIEW_STAGE = { width: 1920, height: 1080 };
|
|
96562
96597
|
var CARD_W = 80;
|
|
@@ -96578,7 +96613,7 @@ function framePreviewUrl(projectId, comp, frameToken) {
|
|
|
96578
96613
|
}
|
|
96579
96614
|
function useFreshFrameToken(projectId, wanted) {
|
|
96580
96615
|
const [known, setKnown] = useState151(void 0);
|
|
96581
|
-
|
|
96616
|
+
useEffect151(() => {
|
|
96582
96617
|
if (!wanted) return setKnown(void 0);
|
|
96583
96618
|
let live = true;
|
|
96584
96619
|
void studioApiFetch(buildProjectApiPath(projectId, "/frame-token")).then((res) => res.ok ? res.json() : null).then(
|
|
@@ -96632,7 +96667,7 @@ function useLastFrame(request2, snapshot3) {
|
|
|
96632
96667
|
function useNearViewport() {
|
|
96633
96668
|
const [element, setElement] = useState151(null);
|
|
96634
96669
|
const [near4, setNear] = useState151(false);
|
|
96635
|
-
|
|
96670
|
+
useEffect151(() => {
|
|
96636
96671
|
if (!element || near4) return;
|
|
96637
96672
|
if (typeof IntersectionObserver === "undefined") return setNear(true);
|
|
96638
96673
|
const observer = new IntersectionObserver(
|
|
@@ -96697,10 +96732,10 @@ function CompCard({
|
|
|
96697
96732
|
});
|
|
96698
96733
|
const thumbnailOffsetX = (CARD_W - stageSize.width * previewScale) / 2;
|
|
96699
96734
|
const thumbnailOffsetY = (CARD_H - stageSize.height * previewScale) / 2;
|
|
96700
|
-
|
|
96735
|
+
useEffect151(() => {
|
|
96701
96736
|
if (livePreviewLoaded) postFrameDisplayScale(iframeRef.current);
|
|
96702
96737
|
}, [livePreviewLoaded, previewScale]);
|
|
96703
|
-
|
|
96738
|
+
useEffect151(() => {
|
|
96704
96739
|
if (!hovered) return;
|
|
96705
96740
|
const onRuntimeMessage = (event) => {
|
|
96706
96741
|
const frame3 = iframeRef.current;
|
|
@@ -96720,7 +96755,7 @@ function CompCard({
|
|
|
96720
96755
|
window.addEventListener("message", onRuntimeMessage);
|
|
96721
96756
|
return () => window.removeEventListener("message", onRuntimeMessage);
|
|
96722
96757
|
}, [hovered]);
|
|
96723
|
-
|
|
96758
|
+
useEffect151(() => {
|
|
96724
96759
|
return () => {
|
|
96725
96760
|
if (hoverTimer.current) clearTimeout(hoverTimer.current);
|
|
96726
96761
|
};
|
|
@@ -97186,7 +97221,7 @@ function CodeBody({
|
|
|
97186
97221
|
import { memo as memo62, useCallback as useCallback192 } from "react";
|
|
97187
97222
|
|
|
97188
97223
|
// src/components/editor/LayersPanel.tsx
|
|
97189
|
-
import { memo as memo52, useState as useState153, useCallback as useCallback176, useEffect as
|
|
97224
|
+
import { memo as memo52, useState as useState153, useCallback as useCallback176, useEffect as useEffect152, useRef as useRef184 } from "react";
|
|
97190
97225
|
|
|
97191
97226
|
// src/components/editor/layerKind.ts
|
|
97192
97227
|
import { isCompositionHost, layerKindOf } from "@hyperframes/core/runtime/editing-port";
|
|
@@ -97508,11 +97543,11 @@ var LayersPanel = memo52(function LayersPanel2({ host }) {
|
|
|
97508
97543
|
);
|
|
97509
97544
|
setLayers(sortLayersByZIndex(items));
|
|
97510
97545
|
}, [previewIframeRef, activeCompPath, isMasterView, activeGroupElement, setActiveGroupElement]);
|
|
97511
|
-
|
|
97546
|
+
useEffect152(() => {
|
|
97512
97547
|
opaqueRead.current = null;
|
|
97513
97548
|
collectLayers();
|
|
97514
97549
|
}, [collectLayers, refreshKey, zEditVersion, livePreviewIframe]);
|
|
97515
|
-
|
|
97550
|
+
useEffect152(() => {
|
|
97516
97551
|
const iframe = previewIframeRef.current;
|
|
97517
97552
|
if (!iframe) return;
|
|
97518
97553
|
const handleLoad = () => {
|
|
@@ -97521,13 +97556,13 @@ var LayersPanel = memo52(function LayersPanel2({ host }) {
|
|
|
97521
97556
|
};
|
|
97522
97557
|
return onPreviewContentReplaced(iframe, handleLoad);
|
|
97523
97558
|
}, [previewIframeRef, livePreviewIframe, collectLayers]);
|
|
97524
|
-
|
|
97559
|
+
useEffect152(() => {
|
|
97525
97560
|
if (!compositionLoading) {
|
|
97526
97561
|
const timer = setTimeout(collectLayers, 100);
|
|
97527
97562
|
return () => clearTimeout(timer);
|
|
97528
97563
|
}
|
|
97529
97564
|
}, [compositionLoading, collectLayers]);
|
|
97530
|
-
|
|
97565
|
+
useEffect152(() => {
|
|
97531
97566
|
const throttle = createRafThrottle(collectLayers, 100);
|
|
97532
97567
|
const unsubscribe = liveTime.subscribe(throttle.invoke);
|
|
97533
97568
|
return () => {
|
|
@@ -97826,7 +97861,7 @@ import { memo as memo54, useCallback as useCallback178, useState as useState155
|
|
|
97826
97861
|
import { memo as memo53, useCallback as useCallback177 } from "react";
|
|
97827
97862
|
|
|
97828
97863
|
// src/captions/components/shared.tsx
|
|
97829
|
-
import { useEffect as
|
|
97864
|
+
import { useEffect as useEffect153, useRef as useRef185, useState as useState154 } from "react";
|
|
97830
97865
|
import { jsx as jsx236, jsxs as jsxs185 } from "react/jsx-runtime";
|
|
97831
97866
|
var inputCls = "w-full bg-neutral-900 border border-neutral-800 rounded-sm px-1.5 py-0.5 text-2xs text-neutral-200 font-mono outline-hidden focus:border-studio-accent disabled:opacity-40 disabled:cursor-not-allowed";
|
|
97832
97867
|
function Section2({ label, children }) {
|
|
@@ -97853,7 +97888,7 @@ function NumberField2({
|
|
|
97853
97888
|
}) {
|
|
97854
97889
|
const [draft, setDraft] = useState154(null);
|
|
97855
97890
|
const focusedRef = useRef185(false);
|
|
97856
|
-
|
|
97891
|
+
useEffect153(() => {
|
|
97857
97892
|
if (!focusedRef.current) setDraft(null);
|
|
97858
97893
|
}, [value]);
|
|
97859
97894
|
const display2 = draft !== null ? draft : mixed ? "" : String(value ?? 0);
|
|
@@ -98345,7 +98380,7 @@ var CaptionPropertyPanel = memo54(function CaptionPropertyPanel2({
|
|
|
98345
98380
|
});
|
|
98346
98381
|
|
|
98347
98382
|
// src/components/editor/BlockParamsPanel.tsx
|
|
98348
|
-
import { memo as memo55, useCallback as useCallback179, useEffect as
|
|
98383
|
+
import { memo as memo55, useCallback as useCallback179, useEffect as useEffect154, useRef as useRef186, useState as useState156 } from "react";
|
|
98349
98384
|
import { jsx as jsx239, jsxs as jsxs188 } from "react/jsx-runtime";
|
|
98350
98385
|
var BlockParamsPanel = memo55(function BlockParamsPanel2({
|
|
98351
98386
|
blockName,
|
|
@@ -98447,7 +98482,7 @@ var BlockParamsPanel = memo55(function BlockParamsPanel2({
|
|
|
98447
98482
|
}
|
|
98448
98483
|
commitTimersRef.current.clear();
|
|
98449
98484
|
};
|
|
98450
|
-
|
|
98485
|
+
useEffect154(() => () => flushRef.current(), []);
|
|
98451
98486
|
return /* @__PURE__ */ jsxs188("div", { className: "flex flex-col h-full", children: [
|
|
98452
98487
|
/* @__PURE__ */ jsxs188("div", { className: "flex items-center justify-between px-3 py-2 border-b border-neutral-800", children: [
|
|
98453
98488
|
/* @__PURE__ */ jsx239("div", { className: "text-[11px] font-semibold text-neutral-200 truncate", children: blockTitle }),
|
|
@@ -98579,7 +98614,7 @@ function ParamControl({
|
|
|
98579
98614
|
import { memo as memo59 } from "react";
|
|
98580
98615
|
|
|
98581
98616
|
// src/components/renders/RenderQueue.tsx
|
|
98582
|
-
import { memo as memo58, useState as useState159, useRef as useRef188, useEffect as
|
|
98617
|
+
import { memo as memo58, useState as useState159, useRef as useRef188, useEffect as useEffect156, useLayoutEffect as useLayoutEffect16, useId as useId4 } from "react";
|
|
98583
98618
|
import { createPortal as createPortal15 } from "react-dom";
|
|
98584
98619
|
import { CANVAS_DIMENSIONS } from "@hyperframes/parsers";
|
|
98585
98620
|
|
|
@@ -98860,7 +98895,7 @@ var RenderQueueItem = memo56(function RenderQueueItem2({
|
|
|
98860
98895
|
});
|
|
98861
98896
|
|
|
98862
98897
|
// src/components/renders/FfmpegRequiredNotice.tsx
|
|
98863
|
-
import { memo as memo57, useEffect as
|
|
98898
|
+
import { memo as memo57, useEffect as useEffect155, useRef as useRef187, useState as useState158 } from "react";
|
|
98864
98899
|
import { jsx as jsx243, jsxs as jsxs193 } from "react/jsx-runtime";
|
|
98865
98900
|
var DOWNLOAD_URL = "https://ffmpeg.org/download.html";
|
|
98866
98901
|
var CUE_MS = 1600;
|
|
@@ -98874,16 +98909,16 @@ var FfmpegRequiredNotice = memo57(function FfmpegRequiredNotice2({
|
|
|
98874
98909
|
const [recheckFailed, setRecheckFailed] = useState158(false);
|
|
98875
98910
|
const wasChecking = useRef187(false);
|
|
98876
98911
|
const cueTimer = useRef187(void 0);
|
|
98877
|
-
|
|
98912
|
+
useEffect155(() => {
|
|
98878
98913
|
if (wasChecking.current && !checking) setRecheckFailed(true);
|
|
98879
98914
|
wasChecking.current = checking;
|
|
98880
98915
|
}, [checking]);
|
|
98881
|
-
|
|
98916
|
+
useEffect155(() => {
|
|
98882
98917
|
if (!recheckFailed) return;
|
|
98883
98918
|
cueTimer.current = setTimeout(() => setRecheckFailed(false), CUE_MS);
|
|
98884
98919
|
return () => clearTimeout(cueTimer.current);
|
|
98885
98920
|
}, [recheckFailed]);
|
|
98886
|
-
|
|
98921
|
+
useEffect155(() => () => clearTimeout(cueTimer.current), []);
|
|
98887
98922
|
const copy = async (command) => {
|
|
98888
98923
|
const ok = await copyTextToClipboard(command);
|
|
98889
98924
|
if (!ok) return;
|
|
@@ -99068,7 +99103,7 @@ function FormatInfoTooltip({ format }) {
|
|
|
99068
99103
|
const hide = () => {
|
|
99069
99104
|
timeoutRef.current = setTimeout(() => setOpen(false), 120);
|
|
99070
99105
|
};
|
|
99071
|
-
|
|
99106
|
+
useEffect156(() => () => clearTimeout(timeoutRef.current), []);
|
|
99072
99107
|
useLayoutEffect16(() => {
|
|
99073
99108
|
if (!open2) return;
|
|
99074
99109
|
const el = triggerRef.current;
|
|
@@ -99082,7 +99117,7 @@ function FormatInfoTooltip({ format }) {
|
|
|
99082
99117
|
)
|
|
99083
99118
|
);
|
|
99084
99119
|
}, [open2]);
|
|
99085
|
-
|
|
99120
|
+
useEffect156(() => {
|
|
99086
99121
|
if (!open2) return;
|
|
99087
99122
|
const onKeyDown = (e) => {
|
|
99088
99123
|
if (e.key === "Escape") setOpen(false);
|
|
@@ -99333,7 +99368,7 @@ var RenderQueue = memo58(function RenderQueue2({
|
|
|
99333
99368
|
onRecheckFfmpeg
|
|
99334
99369
|
}) {
|
|
99335
99370
|
const listRef = useRef188(null);
|
|
99336
|
-
|
|
99371
|
+
useEffect156(() => {
|
|
99337
99372
|
if (listRef.current) {
|
|
99338
99373
|
listRef.current.scrollTo({ top: listRef.current.scrollHeight, behavior: "smooth" });
|
|
99339
99374
|
}
|
|
@@ -99489,7 +99524,7 @@ var RenderQueuePanel = memo59(function RenderQueuePanel2() {
|
|
|
99489
99524
|
});
|
|
99490
99525
|
|
|
99491
99526
|
// src/components/panels/SlideshowPanel.tsx
|
|
99492
|
-
import { useState as useState161, useEffect as
|
|
99527
|
+
import { useState as useState161, useEffect as useEffect157, useCallback as useCallback182, useRef as useRef189 } from "react";
|
|
99493
99528
|
import { parseSlideshowManifest } from "@hyperframes/core/slideshow";
|
|
99494
99529
|
|
|
99495
99530
|
// src/components/panels/SlideshowSubPanels.tsx
|
|
@@ -100185,7 +100220,7 @@ function SlideshowPanel({ scenes, onPersist, onPersistNotes }) {
|
|
|
100185
100220
|
const { domEditSelection } = useDomEditSelectionContext();
|
|
100186
100221
|
const manifestRef = useRef189(manifest);
|
|
100187
100222
|
const notesCtrlRef = useRef189(makeSlideshowNotesController());
|
|
100188
|
-
|
|
100223
|
+
useEffect157(() => {
|
|
100189
100224
|
if (!compHtml) {
|
|
100190
100225
|
notesCtrlRef.current.flush();
|
|
100191
100226
|
setManifest({ slides: [] });
|
|
@@ -100247,7 +100282,7 @@ function SlideshowPanel({ scenes, onPersist, onPersistNotes }) {
|
|
|
100247
100282
|
},
|
|
100248
100283
|
[onPersistNotes]
|
|
100249
100284
|
);
|
|
100250
|
-
|
|
100285
|
+
useEffect157(() => {
|
|
100251
100286
|
const ctrl = notesCtrlRef.current;
|
|
100252
100287
|
return () => {
|
|
100253
100288
|
ctrl.flush();
|
|
@@ -100506,7 +100541,7 @@ function SlideshowPanel({ scenes, onPersist, onPersistNotes }) {
|
|
|
100506
100541
|
}
|
|
100507
100542
|
|
|
100508
100543
|
// src/components/panels/VariablesPanel.tsx
|
|
100509
|
-
import { memo as memo60, useCallback as useCallback186, useEffect as
|
|
100544
|
+
import { memo as memo60, useCallback as useCallback186, useEffect as useEffect159, useMemo as useMemo87, useState as useState165 } from "react";
|
|
100510
100545
|
|
|
100511
100546
|
// src/hooks/useVariablesPersist.ts
|
|
100512
100547
|
import { useCallback as useCallback183 } from "react";
|
|
@@ -100557,7 +100592,7 @@ function useVariablesPersist({
|
|
|
100557
100592
|
import { useCallback as useCallback185, useState as useState164 } from "react";
|
|
100558
100593
|
|
|
100559
100594
|
// src/hooks/useProjectCompositionVariables.ts
|
|
100560
|
-
import { useCallback as useCallback184, useEffect as
|
|
100595
|
+
import { useCallback as useCallback184, useEffect as useEffect158, useState as useState162 } from "react";
|
|
100561
100596
|
import { openComposition as openComposition4 } from "@hyperframes/sdk";
|
|
100562
100597
|
async function readGroup(path, readProjectFile) {
|
|
100563
100598
|
let content;
|
|
@@ -100581,7 +100616,7 @@ async function readGroup(path, readProjectFile) {
|
|
|
100581
100616
|
}
|
|
100582
100617
|
function useProjectCompositionVariables(compositionPaths, excludePath, readProjectFile, refreshKey) {
|
|
100583
100618
|
const [groups, setGroups] = useState162([]);
|
|
100584
|
-
|
|
100619
|
+
useEffect158(() => {
|
|
100585
100620
|
let cancelled = false;
|
|
100586
100621
|
const htmlFiles = compositionPaths.filter((p) => p !== excludePath);
|
|
100587
100622
|
void (async () => {
|
|
@@ -101204,7 +101239,7 @@ var VariablesPanel = memo60(function VariablesPanel2({
|
|
|
101204
101239
|
const previewValues = usePreviewVariablesStore((s) => s.values);
|
|
101205
101240
|
const setPreviewValues = usePreviewVariablesStore((s) => s.setValues);
|
|
101206
101241
|
const [revision, setRevision] = useState165(0);
|
|
101207
|
-
|
|
101242
|
+
useEffect159(() => {
|
|
101208
101243
|
if (!sdkSession) return;
|
|
101209
101244
|
return sdkSession.on("change", () => setRevision((r) => r + 1));
|
|
101210
101245
|
}, [sdkSession]);
|
|
@@ -101459,7 +101494,7 @@ var VariablesPanel = memo60(function VariablesPanel2({
|
|
|
101459
101494
|
});
|
|
101460
101495
|
|
|
101461
101496
|
// src/components/panels/MotionBlurPanel.tsx
|
|
101462
|
-
import { memo as memo61, useCallback as useCallback187, useEffect as
|
|
101497
|
+
import { memo as memo61, useCallback as useCallback187, useEffect as useEffect160, useMemo as useMemo88, useReducer as useReducer2, useRef as useRef190, useState as useState166 } from "react";
|
|
101463
101498
|
|
|
101464
101499
|
// src/components/panels/motionBlurPanelModel.ts
|
|
101465
101500
|
import {
|
|
@@ -101529,7 +101564,7 @@ var NothingToChange = class extends Error {
|
|
|
101529
101564
|
function useLivePreviewAttributes(previewIframeRef, refreshKey) {
|
|
101530
101565
|
const [live, setLive] = useState166(null);
|
|
101531
101566
|
const holdUntil = useRef190(0);
|
|
101532
|
-
|
|
101567
|
+
useEffect160(() => {
|
|
101533
101568
|
const read2 = () => {
|
|
101534
101569
|
const found = readPreviewRootAttributes(previewIframeRef.current);
|
|
101535
101570
|
if (found && Date.now() >= holdUntil.current) {
|
|
@@ -101557,7 +101592,7 @@ var MotionBlurPanel = memo61(function MotionBlurPanel2({
|
|
|
101557
101592
|
const { readProjectFile, writeProjectFile, compositions } = useFileManagerContext();
|
|
101558
101593
|
const [, rerender] = useReducer2((n) => n + 1, 0);
|
|
101559
101594
|
const [live, hold] = useLivePreviewAttributes(previewIframeRef, refreshKey);
|
|
101560
|
-
|
|
101595
|
+
useEffect160(() => sdkSession?.on("change", rerender), [sdkSession]);
|
|
101561
101596
|
const root = sdkSession ? findCompositionRoot(sdkSession.getRootElements()) : null;
|
|
101562
101597
|
const attributes = live ?? root?.attributes ?? null;
|
|
101563
101598
|
const settings = useMemo88(() => attributes ? settingsOf(attributes) : null, [attributes]);
|
|
@@ -101785,7 +101820,7 @@ function DesignPanelPromoteProvider({
|
|
|
101785
101820
|
}
|
|
101786
101821
|
|
|
101787
101822
|
// src/hooks/useRemoveBackground.ts
|
|
101788
|
-
import { useCallback as useCallback190, useEffect as
|
|
101823
|
+
import { useCallback as useCallback190, useEffect as useEffect161, useRef as useRef191 } from "react";
|
|
101789
101824
|
|
|
101790
101825
|
// src/components/studioMediaJobs.ts
|
|
101791
101826
|
var MEDIA_JOB_RECONNECT_TIMEOUT_MS = 15e3;
|
|
@@ -101892,7 +101927,7 @@ function waitForMediaJob(jobId, onProgress, signal) {
|
|
|
101892
101927
|
// src/hooks/useRemoveBackground.ts
|
|
101893
101928
|
function useRemoveBackground(projectId, refreshFileTree, showToast) {
|
|
101894
101929
|
const abortRef = useRef191(null);
|
|
101895
|
-
|
|
101930
|
+
useEffect161(
|
|
101896
101931
|
() => () => {
|
|
101897
101932
|
abortRef.current?.abort();
|
|
101898
101933
|
},
|
|
@@ -102358,7 +102393,7 @@ function useStudioSidePanels(left, right, projectId) {
|
|
|
102358
102393
|
}
|
|
102359
102394
|
|
|
102360
102395
|
// src/components/TimelineToolbar.tsx
|
|
102361
|
-
import { memo as memo63, useEffect as
|
|
102396
|
+
import { memo as memo63, useEffect as useEffect163, useRef as useRef192 } from "react";
|
|
102362
102397
|
import {
|
|
102363
102398
|
ArrowsOutLineHorizontal,
|
|
102364
102399
|
FrameCorners as FrameCorners2,
|
|
@@ -102369,7 +102404,7 @@ import {
|
|
|
102369
102404
|
} from "@phosphor-icons/react";
|
|
102370
102405
|
|
|
102371
102406
|
// src/hooks/useKeyframeKeyboard.ts
|
|
102372
|
-
import { useEffect as
|
|
102407
|
+
import { useEffect as useEffect162, useCallback as useCallback193 } from "react";
|
|
102373
102408
|
function useKeyframeKeyboard({ enabled, onAddKeyframe }) {
|
|
102374
102409
|
const handler = useCallback193(
|
|
102375
102410
|
(e) => {
|
|
@@ -102382,7 +102417,7 @@ function useKeyframeKeyboard({ enabled, onAddKeyframe }) {
|
|
|
102382
102417
|
},
|
|
102383
102418
|
[enabled, onAddKeyframe]
|
|
102384
102419
|
);
|
|
102385
|
-
|
|
102420
|
+
useEffect162(() => {
|
|
102386
102421
|
if (!enabled) return;
|
|
102387
102422
|
window.addEventListener("keydown", handler, { capture: true });
|
|
102388
102423
|
return () => window.removeEventListener("keydown", handler, { capture: true });
|
|
@@ -102737,10 +102772,10 @@ var TimelineToolbar = memo63(function TimelineToolbar2({
|
|
|
102737
102772
|
enabled: showKeyframes && Boolean(onToggleKeyframe),
|
|
102738
102773
|
onAddKeyframe: onToggleKeyframe
|
|
102739
102774
|
});
|
|
102740
|
-
|
|
102775
|
+
useEffect163(() => {
|
|
102741
102776
|
if (!showKeyframes) setAutoKeyframeEnabled(false);
|
|
102742
102777
|
}, [showKeyframes, setAutoKeyframeEnabled]);
|
|
102743
|
-
|
|
102778
|
+
useEffect163(() => {
|
|
102744
102779
|
const onKeyDown = (e) => {
|
|
102745
102780
|
if (!matchesKey(e, "timelineSnap")) return;
|
|
102746
102781
|
if (isTypingTarget(e.target)) return;
|
|
@@ -103043,7 +103078,7 @@ function StudioSplash({ waiting }) {
|
|
|
103043
103078
|
}
|
|
103044
103079
|
|
|
103045
103080
|
// src/hooks/useServerConnection.ts
|
|
103046
|
-
import { useEffect as
|
|
103081
|
+
import { useEffect as useEffect164, useState as useState168 } from "react";
|
|
103047
103082
|
async function resolveHashProject(id) {
|
|
103048
103083
|
try {
|
|
103049
103084
|
const res = await studioApiFetch(`/api/projects/${encodeURIComponent(id)}`);
|
|
@@ -103117,7 +103152,7 @@ function useServerConnection() {
|
|
|
103117
103152
|
if (retryTimer !== null) clearTimeout(retryTimer);
|
|
103118
103153
|
};
|
|
103119
103154
|
});
|
|
103120
|
-
|
|
103155
|
+
useEffect164(() => {
|
|
103121
103156
|
const onHashChange = () => {
|
|
103122
103157
|
const next = parseProjectIdFromHash(window.location.hash);
|
|
103123
103158
|
if (!next || next === projectId) return;
|
|
@@ -103143,9 +103178,9 @@ function useServerConnection() {
|
|
|
103143
103178
|
}
|
|
103144
103179
|
|
|
103145
103180
|
// src/hooks/useStudioSessionStart.ts
|
|
103146
|
-
import { useEffect as
|
|
103181
|
+
import { useEffect as useEffect165 } from "react";
|
|
103147
103182
|
function useStudioSessionStart(projectId, resolving, waitingForServer) {
|
|
103148
|
-
|
|
103183
|
+
useEffect165(() => {
|
|
103149
103184
|
if (resolving || waitingForServer || hasFiredSessionStart()) return;
|
|
103150
103185
|
markSessionStartFired();
|
|
103151
103186
|
trackStudioSessionStart({ has_project: projectId != null });
|
|
@@ -103172,7 +103207,7 @@ function useTimelineAddAtPlayhead(addAsset, addComposition, projectId) {
|
|
|
103172
103207
|
import { useState as useState169 } from "react";
|
|
103173
103208
|
|
|
103174
103209
|
// src/hooks/useHydrateActiveCompPathFromUrl.ts
|
|
103175
|
-
import { useEffect as
|
|
103210
|
+
import { useEffect as useEffect166 } from "react";
|
|
103176
103211
|
function useHydrateActiveCompPathFromUrl({
|
|
103177
103212
|
hydrated,
|
|
103178
103213
|
fileTreeLoaded,
|
|
@@ -103181,7 +103216,7 @@ function useHydrateActiveCompPathFromUrl({
|
|
|
103181
103216
|
setActiveCompPath,
|
|
103182
103217
|
setHydrated
|
|
103183
103218
|
}) {
|
|
103184
|
-
|
|
103219
|
+
useEffect166(() => {
|
|
103185
103220
|
if (hydrated) return;
|
|
103186
103221
|
if (!fileTreeLoaded) return;
|
|
103187
103222
|
const nextCompPath = normalizeStudioCompositionPath(
|
|
@@ -103194,7 +103229,7 @@ function useHydrateActiveCompPathFromUrl({
|
|
|
103194
103229
|
}
|
|
103195
103230
|
|
|
103196
103231
|
// src/hooks/useAutoOpenRootComposition.ts
|
|
103197
|
-
import { useEffect as
|
|
103232
|
+
import { useEffect as useEffect167, useRef as useRef193 } from "react";
|
|
103198
103233
|
function useAutoOpenRootComposition({
|
|
103199
103234
|
projectId,
|
|
103200
103235
|
activeCompPath,
|
|
@@ -103203,7 +103238,7 @@ function useAutoOpenRootComposition({
|
|
|
103203
103238
|
onSelectComposition
|
|
103204
103239
|
}) {
|
|
103205
103240
|
const settledForProjectRef = useRef193(void 0);
|
|
103206
|
-
|
|
103241
|
+
useEffect167(() => {
|
|
103207
103242
|
if (settledForProjectRef.current === projectId) return;
|
|
103208
103243
|
if (!activeCompPathHydrated) return;
|
|
103209
103244
|
if (activeCompPath !== null) {
|
|
@@ -103824,7 +103859,7 @@ function StudioApp({ readOnlyPreview = false, readOnlyPreviewReason } = {}) {
|
|
|
103824
103859
|
}
|
|
103825
103860
|
|
|
103826
103861
|
// src/hooks/useElementPicker.ts
|
|
103827
|
-
import { useState as useState171, useCallback as useCallback198, useEffect as
|
|
103862
|
+
import { useState as useState171, useCallback as useCallback198, useEffect as useEffect168, useRef as useRef196 } from "react";
|
|
103828
103863
|
|
|
103829
103864
|
// src/hooks/elementPickerStyles.ts
|
|
103830
103865
|
var PICKED_STYLE_PROPERTIES = [
|
|
@@ -104026,7 +104061,7 @@ function useActivePickerIframe(iframeRef, isPickModeRef, clearHover) {
|
|
|
104026
104061
|
[clearHover, iframeRef, isPickModeRef]
|
|
104027
104062
|
);
|
|
104028
104063
|
const renderedActiveIframe = getActiveIframe();
|
|
104029
|
-
|
|
104064
|
+
useEffect168(() => {
|
|
104030
104065
|
const previous = lastRenderedActiveIframeRef.current;
|
|
104031
104066
|
if (previous !== renderedActiveIframe) {
|
|
104032
104067
|
clearHover();
|
|
@@ -104093,7 +104128,7 @@ function useElementPickerSession(iframeRef) {
|
|
|
104093
104128
|
setPickedElement(filled);
|
|
104094
104129
|
});
|
|
104095
104130
|
}, []);
|
|
104096
|
-
|
|
104131
|
+
useEffect168(() => {
|
|
104097
104132
|
if (!isPickMode) return;
|
|
104098
104133
|
const handleKeyDown = (event) => {
|
|
104099
104134
|
if (event.key !== "Escape" || event.defaultPrevented || event.isComposing || elementOwnsEscape(event.target))
|