@hyperframes/studio 0.7.83 → 0.7.85
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-DSRuJMfh.js → hyperframes-player-CXVkvR6C.js} +1 -1
- package/dist/assets/{index-YZR6OfQ5.js → index-BZFIup06.js} +1 -1
- package/dist/assets/{index-BrWVfpCQ.js → index-CVcz5MoC.js} +1 -1
- package/dist/assets/{index-DRtvHA1J.js → index-DloBOPGY.js} +145 -145
- package/dist/index.html +1 -1
- package/dist/index.js +576 -477
- package/dist/index.js.map +1 -1
- package/package.json +7 -7
- package/src/player/components/Timeline.tsx +7 -0
- package/src/player/components/useTimelinePerformanceTelemetry.test.ts +54 -0
- package/src/player/components/useTimelinePerformanceTelemetry.ts +132 -0
- package/src/telemetry/events.test.ts +21 -0
- package/src/telemetry/events.ts +18 -0
package/dist/index.js
CHANGED
|
@@ -32,7 +32,7 @@ import {
|
|
|
32
32
|
import { useCallback as useCallback45 } from "react";
|
|
33
33
|
|
|
34
34
|
// src/components/nle/PreviewPane.tsx
|
|
35
|
-
import { useCallback as useCallback30, useRef as
|
|
35
|
+
import { useCallback as useCallback30, useRef as useRef34, useSyncExternalStore } from "react";
|
|
36
36
|
|
|
37
37
|
// src/player/components/Player.tsx
|
|
38
38
|
import { forwardRef as forwardRef2, useEffect as useEffect3, useRef as useRef2, useState as useState2 } from "react";
|
|
@@ -2076,7 +2076,7 @@ var PlayerControls = memo3(function PlayerControls2({
|
|
|
2076
2076
|
});
|
|
2077
2077
|
|
|
2078
2078
|
// src/player/components/Timeline.tsx
|
|
2079
|
-
import { useRef as
|
|
2079
|
+
import { useRef as useRef24, useMemo as useMemo17, useCallback as useCallback17, useState as useState16, useEffect as useEffect17, memo as memo14 } from "react";
|
|
2080
2080
|
|
|
2081
2081
|
// src/hooks/useMusicBeatAnalysis.ts
|
|
2082
2082
|
import { useEffect as useEffect7, useMemo as useMemo2, useRef as useRef6 } from "react";
|
|
@@ -9656,6 +9656,9 @@ function trackStudioRenderStart(props) {
|
|
|
9656
9656
|
composition: props.composition
|
|
9657
9657
|
});
|
|
9658
9658
|
}
|
|
9659
|
+
function trackStudioTimelinePerformance(props) {
|
|
9660
|
+
trackEvent("studio_timeline_performance", props);
|
|
9661
|
+
}
|
|
9659
9662
|
function getBrowserDoctorSummary() {
|
|
9660
9663
|
try {
|
|
9661
9664
|
const nav = navigator;
|
|
@@ -15194,6 +15197,96 @@ function TimelineRazorGuide({ x }) {
|
|
|
15194
15197
|
);
|
|
15195
15198
|
}
|
|
15196
15199
|
|
|
15200
|
+
// src/player/components/useTimelinePerformanceTelemetry.ts
|
|
15201
|
+
import { useRef as useRef23 } from "react";
|
|
15202
|
+
var SCROLL_IDLE_MS = 400;
|
|
15203
|
+
var MIN_EVENT_INTERVAL_MS = 6e4;
|
|
15204
|
+
function percentile(values, fraction) {
|
|
15205
|
+
if (values.length === 0) return void 0;
|
|
15206
|
+
const sorted = [...values].sort((a, b) => a - b);
|
|
15207
|
+
const index = Math.min(sorted.length - 1, Math.ceil(sorted.length * fraction) - 1);
|
|
15208
|
+
return Number(sorted[Math.max(0, index)].toFixed(2));
|
|
15209
|
+
}
|
|
15210
|
+
function summarizeTimelinePerformance(scroll, context, frameLatencies, frameIntervals) {
|
|
15211
|
+
const latencyP95 = percentile(frameLatencies, 0.95);
|
|
15212
|
+
if (latencyP95 === void 0) return null;
|
|
15213
|
+
const frameIntervalP95 = percentile(frameIntervals, 0.95);
|
|
15214
|
+
return {
|
|
15215
|
+
total_clip_count: context.totalClipCount,
|
|
15216
|
+
mounted_clip_count: scroll.querySelectorAll('[data-clip="true"]').length,
|
|
15217
|
+
total_row_count: context.totalRowCount,
|
|
15218
|
+
timeline_dom_node_count: scroll.querySelectorAll("*").length,
|
|
15219
|
+
viewport_width: scroll.clientWidth,
|
|
15220
|
+
viewport_height: scroll.clientHeight,
|
|
15221
|
+
zoom_mode: context.zoomMode,
|
|
15222
|
+
scroll_sample_count: frameLatencies.length,
|
|
15223
|
+
scroll_frame_latency_p95_ms: latencyP95,
|
|
15224
|
+
scroll_frame_latency_max_ms: Number(Math.max(...frameLatencies).toFixed(2)),
|
|
15225
|
+
...frameIntervalP95 === void 0 ? {} : { frame_interval_p95_ms: frameIntervalP95 }
|
|
15226
|
+
};
|
|
15227
|
+
}
|
|
15228
|
+
function resetMeasurements(state) {
|
|
15229
|
+
state.previousFrameAt = null;
|
|
15230
|
+
state.frameLatencies = [];
|
|
15231
|
+
state.frameIntervals = [];
|
|
15232
|
+
}
|
|
15233
|
+
function useTimelinePerformanceTelemetry(context) {
|
|
15234
|
+
const stateRef = useRef23({
|
|
15235
|
+
frameRequest: 0,
|
|
15236
|
+
idleTimer: null,
|
|
15237
|
+
pendingScrollStartedAt: 0,
|
|
15238
|
+
previousFrameAt: null,
|
|
15239
|
+
frameLatencies: [],
|
|
15240
|
+
frameIntervals: [],
|
|
15241
|
+
lastEmittedAt: Number.NEGATIVE_INFINITY
|
|
15242
|
+
});
|
|
15243
|
+
const recordTimelineScroll = (scroll) => {
|
|
15244
|
+
const state = stateRef.current;
|
|
15245
|
+
const now2 = performance.now();
|
|
15246
|
+
if (state.frameRequest === 0) {
|
|
15247
|
+
state.pendingScrollStartedAt = now2;
|
|
15248
|
+
state.frameRequest = requestAnimationFrame((frameAt) => {
|
|
15249
|
+
state.frameRequest = 0;
|
|
15250
|
+
state.frameLatencies.push(frameAt - state.pendingScrollStartedAt);
|
|
15251
|
+
if (state.previousFrameAt !== null) {
|
|
15252
|
+
state.frameIntervals.push(frameAt - state.previousFrameAt);
|
|
15253
|
+
}
|
|
15254
|
+
state.previousFrameAt = frameAt;
|
|
15255
|
+
});
|
|
15256
|
+
}
|
|
15257
|
+
if (state.idleTimer !== null) clearTimeout(state.idleTimer);
|
|
15258
|
+
state.idleTimer = setTimeout(() => {
|
|
15259
|
+
state.idleTimer = null;
|
|
15260
|
+
if (state.frameRequest !== 0) {
|
|
15261
|
+
cancelAnimationFrame(state.frameRequest);
|
|
15262
|
+
state.frameRequest = 0;
|
|
15263
|
+
resetMeasurements(state);
|
|
15264
|
+
return;
|
|
15265
|
+
}
|
|
15266
|
+
const emittedAt = performance.now();
|
|
15267
|
+
if (emittedAt - state.lastEmittedAt >= MIN_EVENT_INTERVAL_MS) {
|
|
15268
|
+
const sample = summarizeTimelinePerformance(
|
|
15269
|
+
scroll,
|
|
15270
|
+
context,
|
|
15271
|
+
state.frameLatencies,
|
|
15272
|
+
state.frameIntervals
|
|
15273
|
+
);
|
|
15274
|
+
if (sample) {
|
|
15275
|
+
trackStudioTimelinePerformance(sample);
|
|
15276
|
+
state.lastEmittedAt = emittedAt;
|
|
15277
|
+
}
|
|
15278
|
+
}
|
|
15279
|
+
resetMeasurements(state);
|
|
15280
|
+
}, SCROLL_IDLE_MS);
|
|
15281
|
+
};
|
|
15282
|
+
useMountEffect(() => () => {
|
|
15283
|
+
const state = stateRef.current;
|
|
15284
|
+
if (state.frameRequest !== 0) cancelAnimationFrame(state.frameRequest);
|
|
15285
|
+
if (state.idleTimer !== null) clearTimeout(state.idleTimer);
|
|
15286
|
+
});
|
|
15287
|
+
return { recordTimelineScroll };
|
|
15288
|
+
}
|
|
15289
|
+
|
|
15197
15290
|
// src/player/components/Timeline.tsx
|
|
15198
15291
|
import { jsx as jsx41, jsxs as jsxs31 } from "react/jsx-runtime";
|
|
15199
15292
|
var Timeline = memo14(function Timeline2({
|
|
@@ -15274,12 +15367,12 @@ var Timeline = memo14(function Timeline2({
|
|
|
15274
15367
|
const setSelectedElementId = usePlayerStore((s) => s.setSelectedElementId);
|
|
15275
15368
|
const currentTime = usePlayerStore((s) => s.currentTime);
|
|
15276
15369
|
const { zoomMode, manualZoomPercent, setZoomMode, setManualZoomPercent } = useTimelineZoom();
|
|
15277
|
-
const playheadRef =
|
|
15278
|
-
const containerRef =
|
|
15279
|
-
const scrollRef =
|
|
15370
|
+
const playheadRef = useRef24(null);
|
|
15371
|
+
const containerRef = useRef24(null);
|
|
15372
|
+
const scrollRef = useRef24(null);
|
|
15280
15373
|
const activeTool = usePlayerStore((s) => s.activeTool);
|
|
15281
15374
|
const [hoveredClip, setHoveredClip] = useState16(null);
|
|
15282
|
-
const isDragging =
|
|
15375
|
+
const isDragging = useRef24(false);
|
|
15283
15376
|
const [shiftHeld, setShiftHeld] = useState16(false);
|
|
15284
15377
|
useMountEffect(() => {
|
|
15285
15378
|
const key = (e) => e.key === "Shift" && setShiftHeld(e.type === "keydown");
|
|
@@ -15299,7 +15392,7 @@ var Timeline = memo14(function Timeline2({
|
|
|
15299
15392
|
const setContainerRef = useCallback17((el) => {
|
|
15300
15393
|
containerRef.current = el;
|
|
15301
15394
|
}, []);
|
|
15302
|
-
const lastScrollLeftRef =
|
|
15395
|
+
const lastScrollLeftRef = useRef24(0);
|
|
15303
15396
|
const effectiveDuration = useMemo17(() => {
|
|
15304
15397
|
const safeDur = Number.isFinite(duration) ? duration : 0;
|
|
15305
15398
|
if (rawElements.length === 0) return safeDur;
|
|
@@ -15309,12 +15402,12 @@ var Timeline = memo14(function Timeline2({
|
|
|
15309
15402
|
const keyframeCache = usePlayerStore((s) => s.keyframeCache);
|
|
15310
15403
|
useAutoExpandKeyframedClips(gsapAnimations);
|
|
15311
15404
|
const { tracks, trackStyles, trackOrder, trackOrderRef, laneCounts, rowHeights, rowHeightsRef } = useTimelineTrackLayout(expandedElements, gsapAnimations, selectedElementId, selectedElementIds);
|
|
15312
|
-
const expandedElementsRef =
|
|
15405
|
+
const expandedElementsRef = useRef24(expandedElements);
|
|
15313
15406
|
expandedElementsRef.current = expandedElements;
|
|
15314
|
-
const ppsRef =
|
|
15315
|
-
const durationRef =
|
|
15407
|
+
const ppsRef = useRef24(100);
|
|
15408
|
+
const durationRef = useRef24(effectiveDuration);
|
|
15316
15409
|
durationRef.current = effectiveDuration;
|
|
15317
|
-
const fitPpsRef =
|
|
15410
|
+
const fitPpsRef = useRef24(100);
|
|
15318
15411
|
const {
|
|
15319
15412
|
pinZoomBeforeEdit,
|
|
15320
15413
|
setRangeSelectionRef,
|
|
@@ -15394,6 +15487,11 @@ var Timeline = memo14(function Timeline2({
|
|
|
15394
15487
|
onCompositionDrop: pinnedOnCompositionDrop
|
|
15395
15488
|
});
|
|
15396
15489
|
const displayLayout = useTimelineDisplayLayout(draggedClip, trackOrder, rowHeights);
|
|
15490
|
+
const { recordTimelineScroll } = useTimelinePerformanceTelemetry({
|
|
15491
|
+
totalClipCount: expandedElements.length,
|
|
15492
|
+
totalRowCount: displayLayout.displayTrackOrder.length,
|
|
15493
|
+
zoomMode
|
|
15494
|
+
});
|
|
15397
15495
|
const { viewportWidth, showShortcutHint, setScrollRef } = useTimelineScrollViewport(scrollRef, [
|
|
15398
15496
|
timelineReady,
|
|
15399
15497
|
expandedElements.length,
|
|
@@ -15414,7 +15512,7 @@ var Timeline = memo14(function Timeline2({
|
|
|
15414
15512
|
() => expandedElements.find((element) => (element.key ?? element.id) === selectedElementId) ?? null,
|
|
15415
15513
|
[expandedElements, selectedElementId]
|
|
15416
15514
|
);
|
|
15417
|
-
const selectedElementRef =
|
|
15515
|
+
const selectedElementRef = useRef24(selectedElement);
|
|
15418
15516
|
selectedElementRef.current = selectedElement;
|
|
15419
15517
|
const {
|
|
15420
15518
|
pps,
|
|
@@ -15509,7 +15607,7 @@ var Timeline = memo14(function Timeline2({
|
|
|
15509
15607
|
contentOrigin
|
|
15510
15608
|
});
|
|
15511
15609
|
setRangeSelectionRef.current = setRangeSelection;
|
|
15512
|
-
const prevSelectedRef =
|
|
15610
|
+
const prevSelectedRef = useRef24(selectedElementRef.current);
|
|
15513
15611
|
useEffect17(() => {
|
|
15514
15612
|
const prev = prevSelectedRef.current;
|
|
15515
15613
|
const curr = selectedElementRef.current;
|
|
@@ -15573,6 +15671,7 @@ var Timeline = memo14(function Timeline2({
|
|
|
15573
15671
|
className: `${zoomMode === "fit" ? "overflow-x-hidden" : "overflow-x-auto"} overflow-y-auto h-full outline-none`,
|
|
15574
15672
|
onScroll: (e) => {
|
|
15575
15673
|
lastScrollLeftRef.current = e.currentTarget.scrollLeft;
|
|
15674
|
+
recordTimelineScroll(e.currentTarget);
|
|
15576
15675
|
},
|
|
15577
15676
|
onDragOver: handleAssetDragOver,
|
|
15578
15677
|
onDragLeave: () => clearDropPreview(),
|
|
@@ -15694,7 +15793,7 @@ var Timeline = memo14(function Timeline2({
|
|
|
15694
15793
|
});
|
|
15695
15794
|
|
|
15696
15795
|
// src/player/components/VideoThumbnail.tsx
|
|
15697
|
-
import { memo as memo15, useRef as
|
|
15796
|
+
import { memo as memo15, useRef as useRef25, useState as useState17, useCallback as useCallback18, useEffect as useEffect18 } from "react";
|
|
15698
15797
|
|
|
15699
15798
|
// src/player/components/thumbnailUtils.ts
|
|
15700
15799
|
var THUMBNAIL_CLIP_HEIGHT = 66;
|
|
@@ -15727,9 +15826,9 @@ var VideoThumbnail = memo15(function VideoThumbnail2({
|
|
|
15727
15826
|
const [frames, setFrames] = useState17([]);
|
|
15728
15827
|
const [failed2, setFailed] = useState17(false);
|
|
15729
15828
|
const [aspect, setAspect] = useState17(16 / 9);
|
|
15730
|
-
const ioRef =
|
|
15731
|
-
const roRef =
|
|
15732
|
-
const extractingRef =
|
|
15829
|
+
const ioRef = useRef25(null);
|
|
15830
|
+
const roRef = useRef25(null);
|
|
15831
|
+
const extractingRef = useRef25(false);
|
|
15733
15832
|
const setContainerRef = useCallback18((el) => {
|
|
15734
15833
|
ioRef.current?.disconnect();
|
|
15735
15834
|
roRef.current?.disconnect();
|
|
@@ -15880,7 +15979,7 @@ var VideoThumbnail = memo15(function VideoThumbnail2({
|
|
|
15880
15979
|
});
|
|
15881
15980
|
|
|
15882
15981
|
// src/player/components/CompositionThumbnail.tsx
|
|
15883
|
-
import { memo as memo16, useCallback as useCallback19, useState as useState18, useRef as
|
|
15982
|
+
import { memo as memo16, useCallback as useCallback19, useState as useState18, useRef as useRef26 } from "react";
|
|
15884
15983
|
import { jsx as jsx43, jsxs as jsxs33 } from "react/jsx-runtime";
|
|
15885
15984
|
var CLIP_HEIGHT2 = 66;
|
|
15886
15985
|
var THUMBNAIL_URL_VERSION = "v3";
|
|
@@ -15917,7 +16016,7 @@ var CompositionThumbnail = memo16(function CompositionThumbnail2({
|
|
|
15917
16016
|
const [containerWidth, setContainerWidth] = useState18(0);
|
|
15918
16017
|
const [loaded, setLoaded] = useState18(false);
|
|
15919
16018
|
const [aspect, setAspect] = useState18(16 / 9);
|
|
15920
|
-
const roRef =
|
|
16019
|
+
const roRef = useRef26(null);
|
|
15921
16020
|
const setContainerRef = useCallback19((el) => {
|
|
15922
16021
|
roRef.current?.disconnect();
|
|
15923
16022
|
if (!el) return;
|
|
@@ -16000,10 +16099,10 @@ var CompositionThumbnail = memo16(function CompositionThumbnail2({
|
|
|
16000
16099
|
});
|
|
16001
16100
|
|
|
16002
16101
|
// src/player/hooks/useTimelinePlayer.ts
|
|
16003
|
-
import { useRef as
|
|
16102
|
+
import { useRef as useRef28, useCallback as useCallback23, useEffect as useEffect19 } from "react";
|
|
16004
16103
|
|
|
16005
16104
|
// src/player/hooks/usePlaybackKeyboard.ts
|
|
16006
|
-
import { useRef as
|
|
16105
|
+
import { useRef as useRef27, useCallback as useCallback20 } from "react";
|
|
16007
16106
|
|
|
16008
16107
|
// src/captions/store.ts
|
|
16009
16108
|
import { create as create3 } from "zustand";
|
|
@@ -16245,10 +16344,10 @@ function usePlaybackKeyboard({
|
|
|
16245
16344
|
pause,
|
|
16246
16345
|
seek
|
|
16247
16346
|
}) {
|
|
16248
|
-
const pressedKeysRef =
|
|
16249
|
-
const playbackKeyDownRef =
|
|
16347
|
+
const pressedKeysRef = useRef27(/* @__PURE__ */ new Set());
|
|
16348
|
+
const playbackKeyDownRef = useRef27(() => {
|
|
16250
16349
|
});
|
|
16251
|
-
const playbackKeyUpRef =
|
|
16350
|
+
const playbackKeyUpRef = useRef27(() => {
|
|
16252
16351
|
});
|
|
16253
16352
|
const stepFrames = useCallback20(
|
|
16254
16353
|
(deltaFrames) => {
|
|
@@ -16863,18 +16962,18 @@ function timelineElementsChanged(prev, next) {
|
|
|
16863
16962
|
});
|
|
16864
16963
|
}
|
|
16865
16964
|
function useTimelinePlayer() {
|
|
16866
|
-
const iframeRef =
|
|
16867
|
-
const rafRef =
|
|
16868
|
-
const probeIntervalRef =
|
|
16869
|
-
const pendingSeekRef =
|
|
16870
|
-
const isRefreshingRef =
|
|
16871
|
-
const reverseRafRef =
|
|
16872
|
-
const shuttleDirectionRef =
|
|
16873
|
-
const shuttleSpeedIndexRef =
|
|
16874
|
-
const iframeShortcutCleanupRef =
|
|
16875
|
-
const lastTimelineMessageRef =
|
|
16876
|
-
const staticSeekAdapterRef =
|
|
16877
|
-
const staticSeekWarnedRef =
|
|
16965
|
+
const iframeRef = useRef28(null);
|
|
16966
|
+
const rafRef = useRef28(0);
|
|
16967
|
+
const probeIntervalRef = useRef28(void 0);
|
|
16968
|
+
const pendingSeekRef = useRef28(null);
|
|
16969
|
+
const isRefreshingRef = useRef28(false);
|
|
16970
|
+
const reverseRafRef = useRef28(0);
|
|
16971
|
+
const shuttleDirectionRef = useRef28(null);
|
|
16972
|
+
const shuttleSpeedIndexRef = useRef28(0);
|
|
16973
|
+
const iframeShortcutCleanupRef = useRef28(null);
|
|
16974
|
+
const lastTimelineMessageRef = useRef28(0);
|
|
16975
|
+
const staticSeekAdapterRef = useRef28(null);
|
|
16976
|
+
const staticSeekWarnedRef = useRef28(false);
|
|
16878
16977
|
const { setIsPlaying, setCurrentTime, setDuration, setTimelineReady, setElements } = usePlayerStore.getState();
|
|
16879
16978
|
const syncTimelineElements = useCallback23(
|
|
16880
16979
|
(elements, nextDuration) => {
|
|
@@ -17201,7 +17300,7 @@ function useTimelinePlayer() {
|
|
|
17201
17300
|
applyPreviewVariablesToUrl(url);
|
|
17202
17301
|
iframe.src = url.toString();
|
|
17203
17302
|
}, [saveSeekPosition]);
|
|
17204
|
-
const getAdapterRef =
|
|
17303
|
+
const getAdapterRef = useRef28(getAdapter);
|
|
17205
17304
|
getAdapterRef.current = getAdapter;
|
|
17206
17305
|
useMountEffect(() => {
|
|
17207
17306
|
const handleWindowKeyDown = (e) => playbackKeyDownRef.current(e);
|
|
@@ -17309,7 +17408,7 @@ function useTimelinePlayer() {
|
|
|
17309
17408
|
}
|
|
17310
17409
|
|
|
17311
17410
|
// src/components/nle/NLEPreview.tsx
|
|
17312
|
-
import { memo as memo17, useCallback as useCallback24, useEffect as useEffect20, useRef as
|
|
17411
|
+
import { memo as memo17, useCallback as useCallback24, useEffect as useEffect20, useRef as useRef29, useState as useState19 } from "react";
|
|
17313
17412
|
|
|
17314
17413
|
// src/components/nle/previewZoom.ts
|
|
17315
17414
|
var MIN_PREVIEW_ZOOM_PERCENT = 25;
|
|
@@ -17476,21 +17575,21 @@ var NLEPreview = memo17(function NLEPreview2({
|
|
|
17476
17575
|
onCompositionSizeChange
|
|
17477
17576
|
}) {
|
|
17478
17577
|
const activeKey = getPreviewPlayerKey({ projectId, directUrl });
|
|
17479
|
-
const viewportRef =
|
|
17480
|
-
const stageRef =
|
|
17481
|
-
const previewIframeRef =
|
|
17578
|
+
const viewportRef = useRef29(null);
|
|
17579
|
+
const stageRef = useRef29(null);
|
|
17580
|
+
const previewIframeRef = useRef29(null);
|
|
17482
17581
|
useEffect20(() => {
|
|
17483
17582
|
onStageRef?.(stageRef);
|
|
17484
17583
|
}, [onStageRef]);
|
|
17485
17584
|
const [compositionSize, setCompositionSize] = useState19(null);
|
|
17486
17585
|
const [stageSize, setStageSize] = useState19(() => resolvePreviewStageSize(0, 0, null, portrait));
|
|
17487
|
-
const zoomRef =
|
|
17586
|
+
const zoomRef = useRef29(loadInitialZoom());
|
|
17488
17587
|
const [settledZoom, setSettledZoom] = useState19(() => zoomRef.current);
|
|
17489
|
-
const hudRef =
|
|
17490
|
-
const hudTimerRef =
|
|
17491
|
-
const settleTimerRef =
|
|
17492
|
-
const zoomingRef =
|
|
17493
|
-
const dragRef =
|
|
17588
|
+
const hudRef = useRef29(null);
|
|
17589
|
+
const hudTimerRef = useRef29(null);
|
|
17590
|
+
const settleTimerRef = useRef29(null);
|
|
17591
|
+
const zoomingRef = useRef29(false);
|
|
17592
|
+
const dragRef = useRef29(null);
|
|
17494
17593
|
useEffect20(() => {
|
|
17495
17594
|
return () => {
|
|
17496
17595
|
if (settleTimerRef.current) clearTimeout(settleTimerRef.current);
|
|
@@ -17509,7 +17608,7 @@ var NLEPreview = memo17(function NLEPreview2({
|
|
|
17509
17608
|
observer.observe(viewport);
|
|
17510
17609
|
return () => observer.disconnect();
|
|
17511
17610
|
}, [compositionSize, portrait]);
|
|
17512
|
-
const onCompositionSizeChangeRef =
|
|
17611
|
+
const onCompositionSizeChangeRef = useRef29(onCompositionSizeChange);
|
|
17513
17612
|
onCompositionSizeChangeRef.current = onCompositionSizeChange;
|
|
17514
17613
|
const updateCompositionSizeFromPreview = useCallback24(() => {
|
|
17515
17614
|
const next = readPreviewCompositionSize(previewIframeRef.current);
|
|
@@ -17527,7 +17626,7 @@ var NLEPreview = memo17(function NLEPreview2({
|
|
|
17527
17626
|
},
|
|
17528
17627
|
[iframeRef]
|
|
17529
17628
|
);
|
|
17530
|
-
const stageSizeRef =
|
|
17629
|
+
const stageSizeRef = useRef29(stageSize);
|
|
17531
17630
|
stageSizeRef.current = stageSize;
|
|
17532
17631
|
const writeTransform2 = useCallback24((state) => {
|
|
17533
17632
|
const stage = stageRef.current;
|
|
@@ -17869,7 +17968,7 @@ function CompositionBreadcrumb({ stack, onNavigate }) {
|
|
|
17869
17968
|
}
|
|
17870
17969
|
|
|
17871
17970
|
// src/components/nle/usePreviewBlockDrop.ts
|
|
17872
|
-
import { useCallback as useCallback25, useRef as
|
|
17971
|
+
import { useCallback as useCallback25, useRef as useRef30, useState as useState20 } from "react";
|
|
17873
17972
|
function parseBlockPayload(raw) {
|
|
17874
17973
|
try {
|
|
17875
17974
|
const parsed = JSON.parse(raw);
|
|
@@ -17904,7 +18003,7 @@ function usePreviewBlockDrop({
|
|
|
17904
18003
|
onBlockDrop
|
|
17905
18004
|
}) {
|
|
17906
18005
|
const [isDragOver, setIsDragOver] = useState20(false);
|
|
17907
|
-
const dragDepthRef =
|
|
18006
|
+
const dragDepthRef = useRef30(0);
|
|
17908
18007
|
const handleDragEnter = useCallback25(
|
|
17909
18008
|
(e) => {
|
|
17910
18009
|
if (!onBlockDrop) return;
|
|
@@ -17959,12 +18058,12 @@ import {
|
|
|
17959
18058
|
useContext as useContext5,
|
|
17960
18059
|
useState as useState22,
|
|
17961
18060
|
useCallback as useCallback28,
|
|
17962
|
-
useRef as
|
|
18061
|
+
useRef as useRef33,
|
|
17963
18062
|
useEffect as useEffect22
|
|
17964
18063
|
} from "react";
|
|
17965
18064
|
|
|
17966
18065
|
// src/components/nle/useCompositionStack.ts
|
|
17967
|
-
import { useState as useState21, useCallback as useCallback26, useRef as
|
|
18066
|
+
import { useState as useState21, useCallback as useCallback26, useRef as useRef31, useEffect as useEffect21 } from "react";
|
|
17968
18067
|
function useCompositionStack({
|
|
17969
18068
|
projectId,
|
|
17970
18069
|
activeCompositionPath,
|
|
@@ -17977,7 +18076,7 @@ function useCompositionStack({
|
|
|
17977
18076
|
previewUrl: `/api/projects/${projectId}/preview`
|
|
17978
18077
|
}
|
|
17979
18078
|
]);
|
|
17980
|
-
const onCompositionChangeRef =
|
|
18079
|
+
const onCompositionChangeRef = useRef31(onCompositionChange);
|
|
17981
18080
|
onCompositionChangeRef.current = onCompositionChange;
|
|
17982
18081
|
const updateCompositionStack = useCallback26((action) => {
|
|
17983
18082
|
setCompositionStack((prev) => {
|
|
@@ -17987,9 +18086,9 @@ function useCompositionStack({
|
|
|
17987
18086
|
return next;
|
|
17988
18087
|
});
|
|
17989
18088
|
}, []);
|
|
17990
|
-
const masterSeekRef =
|
|
18089
|
+
const masterSeekRef = useRef31(0);
|
|
17991
18090
|
const [compIdToSrc, setCompIdToSrc] = useState21(/* @__PURE__ */ new Map());
|
|
17992
|
-
const compIdToSrcRef =
|
|
18091
|
+
const compIdToSrcRef = useRef31(compIdToSrc);
|
|
17993
18092
|
compIdToSrcRef.current = compIdToSrc;
|
|
17994
18093
|
const handleNavigateComposition = useCallback26(
|
|
17995
18094
|
(index) => {
|
|
@@ -18061,7 +18160,7 @@ function useCompositionStack({
|
|
|
18061
18160
|
}
|
|
18062
18161
|
|
|
18063
18162
|
// src/components/nle/TimelineResizeDivider.tsx
|
|
18064
|
-
import { useCallback as useCallback27, useRef as
|
|
18163
|
+
import { useCallback as useCallback27, useRef as useRef32 } from "react";
|
|
18065
18164
|
import { jsx as jsx46, jsxs as jsxs36 } from "react/jsx-runtime";
|
|
18066
18165
|
var MIN_TIMELINE_H = 100;
|
|
18067
18166
|
var MIN_PREVIEW_H = 120;
|
|
@@ -18072,8 +18171,8 @@ function TimelineResizeDivider({
|
|
|
18072
18171
|
containerRef,
|
|
18073
18172
|
disabled
|
|
18074
18173
|
}) {
|
|
18075
|
-
const isDragging =
|
|
18076
|
-
const timelineHRef =
|
|
18174
|
+
const isDragging = useRef32(false);
|
|
18175
|
+
const timelineHRef = useRef32(timelineH);
|
|
18077
18176
|
timelineHRef.current = timelineH;
|
|
18078
18177
|
const handlePointerDown = useCallback27(
|
|
18079
18178
|
(e) => {
|
|
@@ -18193,7 +18292,7 @@ function NLEProvider({
|
|
|
18193
18292
|
useAssetPreviewStore.getState().clearPreviewAsset();
|
|
18194
18293
|
}, [projectId]);
|
|
18195
18294
|
const [previewCompositionSize, setPreviewCompositionSize] = useState22(null);
|
|
18196
|
-
const prevRefreshKeyRef =
|
|
18295
|
+
const prevRefreshKeyRef = useRef33(refreshKey);
|
|
18197
18296
|
useEffect22(() => {
|
|
18198
18297
|
if (refreshKey === prevRefreshKeyRef.current) return;
|
|
18199
18298
|
prevRefreshKeyRef.current = refreshKey;
|
|
@@ -18244,9 +18343,9 @@ function NLEProvider({
|
|
|
18244
18343
|
},
|
|
18245
18344
|
[compIdToSrc, drillDown, iframeRef_]
|
|
18246
18345
|
);
|
|
18247
|
-
const compIdToSrcRef =
|
|
18346
|
+
const compIdToSrcRef = useRef33(compIdToSrc);
|
|
18248
18347
|
compIdToSrcRef.current = compIdToSrc;
|
|
18249
|
-
const onCompIdToSrcChangeRef =
|
|
18348
|
+
const onCompIdToSrcChangeRef = useRef33(onCompIdToSrcChange);
|
|
18250
18349
|
onCompIdToSrcChangeRef.current = onCompIdToSrcChange;
|
|
18251
18350
|
useEffect22(() => {
|
|
18252
18351
|
const controller = new AbortController();
|
|
@@ -18320,14 +18419,14 @@ function NLEProvider({
|
|
|
18320
18419
|
const persistTimelineH = useCallback28((height) => {
|
|
18321
18420
|
writeStudioUiPreferences({ timelineHeight: Math.round(height) });
|
|
18322
18421
|
}, []);
|
|
18323
|
-
const containerRef =
|
|
18422
|
+
const containerRef = useRef33(null);
|
|
18324
18423
|
useEffect22(() => {
|
|
18325
18424
|
const containerH = containerRef.current?.getBoundingClientRect().height;
|
|
18326
18425
|
if (!containerH) return;
|
|
18327
18426
|
const max = containerH - MIN_PREVIEW_H;
|
|
18328
18427
|
setTimelineH((prev) => prev > max ? Math.max(MIN_TIMELINE_H, max) : prev);
|
|
18329
18428
|
}, []);
|
|
18330
|
-
const hasLoadedOnceRef =
|
|
18429
|
+
const hasLoadedOnceRef = useRef33(false);
|
|
18331
18430
|
const [compositionLoading, setCompositionLoadingRaw] = useState22(true);
|
|
18332
18431
|
const setCompositionLoading = useCallback28((loading) => {
|
|
18333
18432
|
if (!loading) hasLoadedOnceRef.current = true;
|
|
@@ -18338,7 +18437,7 @@ function NLEProvider({
|
|
|
18338
18437
|
useEffect22(() => {
|
|
18339
18438
|
onCompositionLoadingChange?.(compositionLoading);
|
|
18340
18439
|
}, [compositionLoading, onCompositionLoadingChange]);
|
|
18341
|
-
const onIframeRefStable =
|
|
18440
|
+
const onIframeRefStable = useRef33(onIframeRef);
|
|
18342
18441
|
onIframeRefStable.current = onIframeRef;
|
|
18343
18442
|
useEffect22(() => {
|
|
18344
18443
|
onIframeRefStable.current?.(iframeRef.current);
|
|
@@ -18547,7 +18646,7 @@ function PreviewPane({
|
|
|
18547
18646
|
previewCompositionSize,
|
|
18548
18647
|
setPreviewCompositionSize
|
|
18549
18648
|
} = useNLEContext();
|
|
18550
|
-
const stageRefForDrop =
|
|
18649
|
+
const stageRefForDrop = useRef34(null);
|
|
18551
18650
|
const handleStageRef = useCallback30((ref) => {
|
|
18552
18651
|
stageRefForDrop.current = ref.current;
|
|
18553
18652
|
}, []);
|
|
@@ -18563,7 +18662,7 @@ function PreviewPane({
|
|
|
18563
18662
|
stageRef: stageRefForDrop,
|
|
18564
18663
|
onBlockDrop: onPreviewBlockDrop
|
|
18565
18664
|
});
|
|
18566
|
-
const containerRef =
|
|
18665
|
+
const containerRef = useRef34(null);
|
|
18567
18666
|
const fullscreenElement = useSyncExternalStore(subscribeFullscreen, getFullscreenElement);
|
|
18568
18667
|
const isFullscreen = fullscreenElement === containerRef.current && fullscreenElement != null;
|
|
18569
18668
|
const toggleFullscreen = useCallback30(() => {
|
|
@@ -18847,7 +18946,7 @@ function TimelinePane({
|
|
|
18847
18946
|
import { useState as useState35 } from "react";
|
|
18848
18947
|
|
|
18849
18948
|
// src/captions/components/CaptionOverlay.tsx
|
|
18850
|
-
import { memo as memo18, useState as useState23, useCallback as useCallback32, useRef as
|
|
18949
|
+
import { memo as memo18, useState as useState23, useCallback as useCallback32, useRef as useRef35 } from "react";
|
|
18851
18950
|
|
|
18852
18951
|
// src/captions/keyboard.ts
|
|
18853
18952
|
var CAPTION_NUDGE_KEYS = /* @__PURE__ */ new Set(["ArrowUp", "ArrowDown", "ArrowLeft", "ArrowRight"]);
|
|
@@ -19036,10 +19135,10 @@ var CaptionOverlay = memo18(function CaptionOverlay2({ iframeRef }) {
|
|
|
19036
19135
|
const selectSegment = useCaptionStore((s) => s.selectSegment);
|
|
19037
19136
|
const clearSelection = useCaptionStore((s) => s.clearSelection);
|
|
19038
19137
|
const [wordBoxes, setWordBoxes] = useState23([]);
|
|
19039
|
-
const overlayRef =
|
|
19040
|
-
const modelRef =
|
|
19138
|
+
const overlayRef = useRef35(null);
|
|
19139
|
+
const modelRef = useRef35(model);
|
|
19041
19140
|
modelRef.current = model;
|
|
19042
|
-
const interactionRef =
|
|
19141
|
+
const interactionRef = useRef35(null);
|
|
19043
19142
|
useMountEffect(() => {
|
|
19044
19143
|
if (!isEditMode) return;
|
|
19045
19144
|
let prevBoxes = [];
|
|
@@ -19326,10 +19425,10 @@ var CaptionOverlay = memo18(function CaptionOverlay2({ iframeRef }) {
|
|
|
19326
19425
|
});
|
|
19327
19426
|
|
|
19328
19427
|
// src/components/editor/DomEditOverlay.tsx
|
|
19329
|
-
import { memo as memo22, useEffect as useEffect28, useMemo as useMemo18, useRef as
|
|
19428
|
+
import { memo as memo22, useEffect as useEffect28, useMemo as useMemo18, useRef as useRef42, useState as useState30 } from "react";
|
|
19330
19429
|
|
|
19331
19430
|
// src/components/editor/marqueeCommit.ts
|
|
19332
|
-
import { useCallback as useCallback33, useRef as
|
|
19431
|
+
import { useCallback as useCallback33, useRef as useRef36, useState as useState24 } from "react";
|
|
19333
19432
|
|
|
19334
19433
|
// src/utils/studioHelpers.ts
|
|
19335
19434
|
function getTimelineElementLabel(element) {
|
|
@@ -20320,7 +20419,7 @@ async function runMarqueeIntersection(rect, iframe, overlayEl, activeComposition
|
|
|
20320
20419
|
return hits;
|
|
20321
20420
|
}
|
|
20322
20421
|
function useMarqueeGestures(deps) {
|
|
20323
|
-
const marqueeRef =
|
|
20422
|
+
const marqueeRef = useRef36(null);
|
|
20324
20423
|
const [marqueeRect, setMarqueeRect] = useState24(null);
|
|
20325
20424
|
const [candidateRects, setCandidateRects] = useState24([]);
|
|
20326
20425
|
const commitMarquee = useCallback33(
|
|
@@ -20439,12 +20538,12 @@ function MarqueeOverlay({ candidateRects, marqueeRect }) {
|
|
|
20439
20538
|
}
|
|
20440
20539
|
|
|
20441
20540
|
// src/components/editor/useZOrderCrossedFlash.tsx
|
|
20442
|
-
import { useCallback as useCallback34, useEffect as useEffect24, useRef as
|
|
20541
|
+
import { useCallback as useCallback34, useEffect as useEffect24, useRef as useRef37, useState as useState25 } from "react";
|
|
20443
20542
|
import { jsx as jsx53 } from "react/jsx-runtime";
|
|
20444
20543
|
var Z_ORDER_CROSSED_FLASH_MS = 600;
|
|
20445
20544
|
function useZOrderCrossedFlash({ overlayRef, iframeRef }) {
|
|
20446
20545
|
const [zOrderFlashRect, setZOrderFlashRect] = useState25(null);
|
|
20447
|
-
const timeoutRef =
|
|
20546
|
+
const timeoutRef = useRef37(null);
|
|
20448
20547
|
useEffect24(
|
|
20449
20548
|
() => () => {
|
|
20450
20549
|
if (timeoutRef.current) clearTimeout(timeoutRef.current);
|
|
@@ -20567,7 +20666,7 @@ function hasDomEditRotationChanged(initialAngle, nextAngle) {
|
|
|
20567
20666
|
}
|
|
20568
20667
|
|
|
20569
20668
|
// src/components/editor/useDomEditOverlayRects.ts
|
|
20570
|
-
import { useRef as
|
|
20669
|
+
import { useRef as useRef38, useState as useState27 } from "react";
|
|
20571
20670
|
function childRectsEqual(a, b) {
|
|
20572
20671
|
if (a.length !== b.length) return false;
|
|
20573
20672
|
for (let i = 0; i < a.length; i++) {
|
|
@@ -20588,13 +20687,13 @@ function useDomEditOverlayRects({
|
|
|
20588
20687
|
const [hoverRect, setHoverRectState] = useState27(null);
|
|
20589
20688
|
const [groupOverlayItems, setGroupOverlayItemsState] = useState27([]);
|
|
20590
20689
|
const [childRects, setChildRectsState] = useState27([]);
|
|
20591
|
-
const overlayRectRef =
|
|
20592
|
-
const hoverRectRef =
|
|
20593
|
-
const groupOverlayItemsRef =
|
|
20594
|
-
const resolvedElementRef =
|
|
20595
|
-
const resolvedHoverElementRef =
|
|
20596
|
-
const resolvedGroupElementRef =
|
|
20597
|
-
const childRectsRef =
|
|
20690
|
+
const overlayRectRef = useRef38(null);
|
|
20691
|
+
const hoverRectRef = useRef38(null);
|
|
20692
|
+
const groupOverlayItemsRef = useRef38([]);
|
|
20693
|
+
const resolvedElementRef = useRef38(null);
|
|
20694
|
+
const resolvedHoverElementRef = useRef38(null);
|
|
20695
|
+
const resolvedGroupElementRef = useRef38(/* @__PURE__ */ new Map());
|
|
20696
|
+
const childRectsRef = useRef38([]);
|
|
20598
20697
|
const setOverlayRect = (next) => {
|
|
20599
20698
|
if (rectsEqual(overlayRectRef.current, next)) return;
|
|
20600
20699
|
overlayRectRef.current = next;
|
|
@@ -23302,7 +23401,7 @@ function createDomEditOverlayGestureHandlers(opts) {
|
|
|
23302
23401
|
}
|
|
23303
23402
|
|
|
23304
23403
|
// src/components/editor/useDomEditNudge.ts
|
|
23305
|
-
import { useCallback as useCallback36, useEffect as useEffect26, useRef as
|
|
23404
|
+
import { useCallback as useCallback36, useEffect as useEffect26, useRef as useRef39 } from "react";
|
|
23306
23405
|
|
|
23307
23406
|
// src/utils/timelineDiscovery.ts
|
|
23308
23407
|
function isEditableTarget(target) {
|
|
@@ -23368,8 +23467,8 @@ function shouldIgnoreNudgeKey(p, event) {
|
|
|
23368
23467
|
return isEditableTarget(event.target);
|
|
23369
23468
|
}
|
|
23370
23469
|
function useDomEditNudge(params) {
|
|
23371
|
-
const sessionRef =
|
|
23372
|
-
const paramsRef =
|
|
23470
|
+
const sessionRef = useRef39(null);
|
|
23471
|
+
const paramsRef = useRef39(params);
|
|
23373
23472
|
paramsRef.current = params;
|
|
23374
23473
|
const commitSession = () => {
|
|
23375
23474
|
const session = sessionRef.current;
|
|
@@ -23390,7 +23489,7 @@ function useDomEditNudge(params) {
|
|
|
23390
23489
|
}
|
|
23391
23490
|
}).finally(() => endManualOffsetDragMembers(session.members));
|
|
23392
23491
|
};
|
|
23393
|
-
const commitSessionRef =
|
|
23492
|
+
const commitSessionRef = useRef39(commitSession);
|
|
23394
23493
|
commitSessionRef.current = commitSession;
|
|
23395
23494
|
const beginSession = () => {
|
|
23396
23495
|
const p = paramsRef.current;
|
|
@@ -23425,7 +23524,7 @@ function useDomEditNudge(params) {
|
|
|
23425
23524
|
if (session.timer) clearTimeout(session.timer);
|
|
23426
23525
|
session.timer = setTimeout(() => commitSessionRef.current(), CANVAS_NUDGE_COMMIT_DEBOUNCE_MS);
|
|
23427
23526
|
};
|
|
23428
|
-
const handleKeyDownRef =
|
|
23527
|
+
const handleKeyDownRef = useRef39(handleKeyDown);
|
|
23429
23528
|
handleKeyDownRef.current = handleKeyDown;
|
|
23430
23529
|
useMountEffect(() => {
|
|
23431
23530
|
const listener = (event) => handleKeyDownRef.current(event);
|
|
@@ -23448,7 +23547,7 @@ function useDomEditNudge(params) {
|
|
|
23448
23547
|
}
|
|
23449
23548
|
|
|
23450
23549
|
// src/components/editor/SnapGuideOverlay.tsx
|
|
23451
|
-
import { memo as memo19, useRef as
|
|
23550
|
+
import { memo as memo19, useRef as useRef40 } from "react";
|
|
23452
23551
|
import { jsx as jsx55, jsxs as jsxs42 } from "react/jsx-runtime";
|
|
23453
23552
|
var MAX_GUIDES = 6;
|
|
23454
23553
|
var MAX_SPACING_GUIDES = 4;
|
|
@@ -23462,10 +23561,10 @@ var SnapGuideOverlay = memo19(function SnapGuideOverlay2({
|
|
|
23462
23561
|
compositionWidth,
|
|
23463
23562
|
compositionHeight
|
|
23464
23563
|
}) {
|
|
23465
|
-
const guideElsRef =
|
|
23466
|
-
const spacingElsRef =
|
|
23467
|
-
const spacingLabelElsRef =
|
|
23468
|
-
const compositionRectRef =
|
|
23564
|
+
const guideElsRef = useRef40([]);
|
|
23565
|
+
const spacingElsRef = useRef40([]);
|
|
23566
|
+
const spacingLabelElsRef = useRef40([]);
|
|
23567
|
+
const compositionRectRef = useRef40({
|
|
23469
23568
|
left: compositionLeft,
|
|
23470
23569
|
top: compositionTop,
|
|
23471
23570
|
width: compositionWidth,
|
|
@@ -23628,7 +23727,7 @@ var GridOverlay = memo20(function GridOverlay2({
|
|
|
23628
23727
|
});
|
|
23629
23728
|
|
|
23630
23729
|
// src/components/editor/DomEditCropHandles.tsx
|
|
23631
|
-
import { useEffect as useEffect27, useRef as
|
|
23730
|
+
import { useEffect as useEffect27, useRef as useRef41, useState as useState28 } from "react";
|
|
23632
23731
|
import { Fragment as Fragment19, jsx as jsx57, jsxs as jsxs43 } from "react/jsx-runtime";
|
|
23633
23732
|
var EDGE_HIT_THICKNESS = 12;
|
|
23634
23733
|
var EDGE_HIT_LENGTH = 32;
|
|
@@ -23661,7 +23760,7 @@ function DomEditCropHandles({
|
|
|
23661
23760
|
overlayRect,
|
|
23662
23761
|
onStyleCommit
|
|
23663
23762
|
}) {
|
|
23664
|
-
const gestureRef =
|
|
23763
|
+
const gestureRef = useRef41(null);
|
|
23665
23764
|
const [dragging, setDragging] = useState28(false);
|
|
23666
23765
|
const [hotEdge, setHotEdge] = useState28(null);
|
|
23667
23766
|
const cropStateFor = (element) => {
|
|
@@ -23674,9 +23773,9 @@ function DomEditCropHandles({
|
|
|
23674
23773
|
setState(cropStateFor(selection.element));
|
|
23675
23774
|
}
|
|
23676
23775
|
const hasCrop = state.insets.top > 0 || state.insets.right > 0 || state.insets.bottom > 0 || state.insets.left > 0;
|
|
23677
|
-
const liftedRef =
|
|
23678
|
-
const preLiftInlineClipRef =
|
|
23679
|
-
const committedClipRef =
|
|
23776
|
+
const liftedRef = useRef41(false);
|
|
23777
|
+
const preLiftInlineClipRef = useRef41("");
|
|
23778
|
+
const committedClipRef = useRef41(null);
|
|
23680
23779
|
useEffect27(() => {
|
|
23681
23780
|
const el = selection.element;
|
|
23682
23781
|
if (readElementCropInsets(el) === null) return;
|
|
@@ -24539,47 +24638,47 @@ var DomEditOverlay = memo22(function DomEditOverlay2({
|
|
|
24539
24638
|
onDeleteSelection,
|
|
24540
24639
|
onApplyZIndex
|
|
24541
24640
|
}) {
|
|
24542
|
-
const overlayRef =
|
|
24543
|
-
const boxRef =
|
|
24544
|
-
const onMarqueeSelectRef =
|
|
24641
|
+
const overlayRef = useRef42(null);
|
|
24642
|
+
const boxRef = useRef42(null);
|
|
24643
|
+
const onMarqueeSelectRef = useRef42(onMarqueeSelect);
|
|
24545
24644
|
onMarqueeSelectRef.current = onMarqueeSelect;
|
|
24546
24645
|
const selectionShapeStyles = readDomEditSelectionShapeStyles(selection);
|
|
24547
|
-
const gestureRef =
|
|
24548
|
-
const groupGestureRef =
|
|
24549
|
-
const blockedMoveRef =
|
|
24550
|
-
const suppressNextBoxClickRef =
|
|
24551
|
-
const suppressNextBoxMouseDownRef =
|
|
24552
|
-
const suppressNextOverlayMouseDownRef =
|
|
24553
|
-
const snapGuidesRef =
|
|
24554
|
-
const rafPausedRef =
|
|
24555
|
-
const selectionRef =
|
|
24646
|
+
const gestureRef = useRef42(null);
|
|
24647
|
+
const groupGestureRef = useRef42(null);
|
|
24648
|
+
const blockedMoveRef = useRef42(null);
|
|
24649
|
+
const suppressNextBoxClickRef = useRef42(false);
|
|
24650
|
+
const suppressNextBoxMouseDownRef = useRef42(false);
|
|
24651
|
+
const suppressNextOverlayMouseDownRef = useRef42(false);
|
|
24652
|
+
const snapGuidesRef = useRef42(null);
|
|
24653
|
+
const rafPausedRef = useRef42(false);
|
|
24654
|
+
const selectionRef = useRef42(selection);
|
|
24556
24655
|
selectionRef.current = selection;
|
|
24557
24656
|
const { zOrderFlashRect, handleZOrderCrossed } = useZOrderCrossedFlash({ overlayRef, iframeRef });
|
|
24558
|
-
const activeCompositionPathRef =
|
|
24657
|
+
const activeCompositionPathRef = useRef42(activeCompositionPath);
|
|
24559
24658
|
activeCompositionPathRef.current = activeCompositionPath;
|
|
24560
|
-
const groupSelectionsRef =
|
|
24659
|
+
const groupSelectionsRef = useRef42(groupSelections);
|
|
24561
24660
|
groupSelectionsRef.current = groupSelections;
|
|
24562
|
-
const hoverSelectionRef =
|
|
24661
|
+
const hoverSelectionRef = useRef42(hoverSelection);
|
|
24563
24662
|
hoverSelectionRef.current = hoverSelection;
|
|
24564
|
-
const onPathOffsetCommitRef =
|
|
24663
|
+
const onPathOffsetCommitRef = useRef42(onPathOffsetCommit);
|
|
24565
24664
|
onPathOffsetCommitRef.current = onPathOffsetCommit;
|
|
24566
|
-
const onGroupPathOffsetCommitRef =
|
|
24665
|
+
const onGroupPathOffsetCommitRef = useRef42(onGroupPathOffsetCommit);
|
|
24567
24666
|
onGroupPathOffsetCommitRef.current = onGroupPathOffsetCommit;
|
|
24568
|
-
const onBoxSizeCommitRef =
|
|
24667
|
+
const onBoxSizeCommitRef = useRef42(onBoxSizeCommit);
|
|
24569
24668
|
onBoxSizeCommitRef.current = onBoxSizeCommit;
|
|
24570
|
-
const onRotationCommitRef =
|
|
24669
|
+
const onRotationCommitRef = useRef42(onRotationCommit);
|
|
24571
24670
|
onRotationCommitRef.current = onRotationCommit;
|
|
24572
|
-
const onStyleCommitRef =
|
|
24671
|
+
const onStyleCommitRef = useRef42(onStyleCommit);
|
|
24573
24672
|
onStyleCommitRef.current = onStyleCommit;
|
|
24574
|
-
const onBlockedMoveRef =
|
|
24673
|
+
const onBlockedMoveRef = useRef42(onBlockedMove);
|
|
24575
24674
|
onBlockedMoveRef.current = onBlockedMove;
|
|
24576
|
-
const onManualDragStartRef =
|
|
24675
|
+
const onManualDragStartRef = useRef42(onManualDragStart);
|
|
24577
24676
|
onManualDragStartRef.current = onManualDragStart;
|
|
24578
|
-
const onCanvasPointerMoveRef =
|
|
24677
|
+
const onCanvasPointerMoveRef = useRef42(onCanvasPointerMove);
|
|
24579
24678
|
onCanvasPointerMoveRef.current = onCanvasPointerMove;
|
|
24580
|
-
const onCanvasPointerLeaveRef =
|
|
24679
|
+
const onCanvasPointerLeaveRef = useRef42(onCanvasPointerLeave);
|
|
24581
24680
|
onCanvasPointerLeaveRef.current = onCanvasPointerLeave;
|
|
24582
|
-
const onSelectionChangeRef =
|
|
24681
|
+
const onSelectionChangeRef = useRef42(onSelectionChange);
|
|
24583
24682
|
onSelectionChangeRef.current = onSelectionChange;
|
|
24584
24683
|
const {
|
|
24585
24684
|
overlayRect,
|
|
@@ -24600,7 +24699,7 @@ var DomEditOverlay = memo22(function DomEditOverlay2({
|
|
|
24600
24699
|
rafPausedRef
|
|
24601
24700
|
});
|
|
24602
24701
|
const compRect = useDomEditCompositionRect({ iframeRef, overlayRef });
|
|
24603
|
-
const compRectRef =
|
|
24702
|
+
const compRectRef = useRef42(compRect);
|
|
24604
24703
|
compRectRef.current = compRect;
|
|
24605
24704
|
const { hasCropInsets, cropOutlineInsetPx } = useCropOverlay({
|
|
24606
24705
|
selection,
|
|
@@ -24608,12 +24707,12 @@ var DomEditOverlay = memo22(function DomEditOverlay2({
|
|
|
24608
24707
|
});
|
|
24609
24708
|
const boxClipPath = hasCropInsets ? void 0 : selectionShapeStyles.clipPath;
|
|
24610
24709
|
const boxChromeClass = resolveBoxChromeClass(Boolean(cropOutlineInsetPx), boxClipPath);
|
|
24611
|
-
const offCanvasElementsRef =
|
|
24710
|
+
const offCanvasElementsRef = useRef42(/* @__PURE__ */ new Map());
|
|
24612
24711
|
const [offCanvasRects, setOffCanvasRects] = useState30([]);
|
|
24613
|
-
const offCanvasDirtyRef =
|
|
24614
|
-
const offCanvasSigRef =
|
|
24615
|
-
const offCanvasObserverRef =
|
|
24616
|
-
const offCanvasObservedDocRef =
|
|
24712
|
+
const offCanvasDirtyRef = useRef42(true);
|
|
24713
|
+
const offCanvasSigRef = useRef42("");
|
|
24714
|
+
const offCanvasObserverRef = useRef42(null);
|
|
24715
|
+
const offCanvasObservedDocRef = useRef42(null);
|
|
24617
24716
|
useMountEffect(
|
|
24618
24717
|
() => startOffCanvasIndicatorRefresh({
|
|
24619
24718
|
iframeRef,
|
|
@@ -25061,7 +25160,7 @@ function writeKeyframeCache(sourceFile, elementId, data) {
|
|
|
25061
25160
|
}
|
|
25062
25161
|
|
|
25063
25162
|
// src/components/editor/MotionPathOverlay.tsx
|
|
25064
|
-
import { memo as memo23, useEffect as useEffect30, useRef as
|
|
25163
|
+
import { memo as memo23, useEffect as useEffect30, useRef as useRef44, useState as useState32 } from "react";
|
|
25065
25164
|
|
|
25066
25165
|
// src/hooks/gsapRuntimeKeyframes.ts
|
|
25067
25166
|
import { buildArcPath } from "@hyperframes/core/gsap-parser-acorn";
|
|
@@ -26013,7 +26112,7 @@ function commitCreatePath(targetSelector, position, x, y, commit) {
|
|
|
26013
26112
|
}
|
|
26014
26113
|
|
|
26015
26114
|
// src/components/editor/useMotionPathData.ts
|
|
26016
|
-
import { useEffect as useEffect29, useRef as
|
|
26115
|
+
import { useEffect as useEffect29, useRef as useRef43, useState as useState31 } from "react";
|
|
26017
26116
|
function transformTranslate(el) {
|
|
26018
26117
|
const t = el.ownerDocument?.defaultView?.getComputedStyle(el).transform;
|
|
26019
26118
|
if (!t || t === "none") return { x: 0, y: 0 };
|
|
@@ -26079,7 +26178,7 @@ function hasMotionPathPlugin(iframe) {
|
|
|
26079
26178
|
function useMotionPathData(iframeRef, selector) {
|
|
26080
26179
|
const [rect, setRect] = useState31(null);
|
|
26081
26180
|
const [geometry, setGeometry] = useState31(null);
|
|
26082
|
-
const resolvedForRef =
|
|
26181
|
+
const resolvedForRef = useRef43(null);
|
|
26083
26182
|
const geometryResolved = resolvedForRef.current === selector;
|
|
26084
26183
|
const [visibleInPreview, setVisibleInPreview] = useState31(true);
|
|
26085
26184
|
const [home, setHome] = useState31(null);
|
|
@@ -26187,8 +26286,8 @@ var MotionPathOverlay = memo23(function MotionPathOverlay2({
|
|
|
26187
26286
|
const armed = usePlayerStore((s) => s.motionPathArmed);
|
|
26188
26287
|
const setMotionPathArmed = usePlayerStore((s) => s.setMotionPathArmed);
|
|
26189
26288
|
const setMotionPathCreateAvailable = usePlayerStore((s) => s.setMotionPathCreateAvailable);
|
|
26190
|
-
const dragRef =
|
|
26191
|
-
const parkTimerRef =
|
|
26289
|
+
const dragRef = useRef44(null);
|
|
26290
|
+
const parkTimerRef = useRef44(void 0);
|
|
26192
26291
|
const animId = editableAnimationId(selectedGsapAnimations ?? [], geometry?.kind ?? "linear");
|
|
26193
26292
|
useEffect30(() => () => clearTimeout(parkTimerRef.current), [animId]);
|
|
26194
26293
|
const createMode = geometryResolved && !geometry && Boolean(selection?.element) && !isPlaying;
|
|
@@ -26528,7 +26627,7 @@ var MotionPathOverlay = memo23(function MotionPathOverlay2({
|
|
|
26528
26627
|
});
|
|
26529
26628
|
|
|
26530
26629
|
// src/components/editor/SnapToolbar.tsx
|
|
26531
|
-
import { memo as memo24, useCallback as useCallback37, useEffect as useEffect31, useRef as
|
|
26630
|
+
import { memo as memo24, useCallback as useCallback37, useEffect as useEffect31, useRef as useRef45, useState as useState33 } from "react";
|
|
26532
26631
|
import { MagnetStraight, GridFour, Path } from "@phosphor-icons/react";
|
|
26533
26632
|
import { jsx as jsx64, jsxs as jsxs50 } from "react/jsx-runtime";
|
|
26534
26633
|
var SNAP_DEFAULTS = {
|
|
@@ -26552,8 +26651,8 @@ var SnapToolbar = memo24(function SnapToolbar2({ onSnapChange }) {
|
|
|
26552
26651
|
const motionPathCreateAvailable = usePlayerStore((s) => s.motionPathCreateAvailable);
|
|
26553
26652
|
const motionPathArmed = usePlayerStore((s) => s.motionPathArmed);
|
|
26554
26653
|
const setMotionPathArmed = usePlayerStore((s) => s.setMotionPathArmed);
|
|
26555
|
-
const popoverRef =
|
|
26556
|
-
const gridButtonRef =
|
|
26654
|
+
const popoverRef = useRef45(null);
|
|
26655
|
+
const gridButtonRef = useRef45(null);
|
|
26557
26656
|
const updatePrefs = useCallback37(
|
|
26558
26657
|
(patch) => {
|
|
26559
26658
|
setPrefs((prev) => {
|
|
@@ -26738,7 +26837,7 @@ function useCompositionDimensions() {
|
|
|
26738
26837
|
import { useCallback as useCallback39 } from "react";
|
|
26739
26838
|
|
|
26740
26839
|
// src/components/editor/useLayerRevealOverride.ts
|
|
26741
|
-
import { useCallback as useCallback38, useEffect as useEffect32, useRef as
|
|
26840
|
+
import { useCallback as useCallback38, useEffect as useEffect32, useRef as useRef46 } from "react";
|
|
26742
26841
|
var LAYER_REVEAL_LIFT_Z = "2147483000";
|
|
26743
26842
|
var LAYER_REVEAL_PENDING_COMMIT_ATTR = "data-hf-studio-reveal-pending-commit";
|
|
26744
26843
|
var revealCommitSequence = 0;
|
|
@@ -26912,9 +27011,9 @@ function useLayerRevealOverride({
|
|
|
26912
27011
|
isPlaying,
|
|
26913
27012
|
selectedElement
|
|
26914
27013
|
}) {
|
|
26915
|
-
const stateRef =
|
|
26916
|
-
const pendingRevealRef =
|
|
26917
|
-
const currentRef =
|
|
27014
|
+
const stateRef = useRef46(null);
|
|
27015
|
+
const pendingRevealRef = useRef46(null);
|
|
27016
|
+
const currentRef = useRef46({ isPlaying, selectedElement });
|
|
26918
27017
|
currentRef.current = { isPlaying, selectedElement };
|
|
26919
27018
|
const restoreReveal = useCallback38(() => {
|
|
26920
27019
|
const state = stateRef.current;
|
|
@@ -28267,7 +28366,7 @@ function useElementLifecycleOps({
|
|
|
28267
28366
|
}
|
|
28268
28367
|
|
|
28269
28368
|
// src/components/nle/useCanvasZOrderTimelineMirror.ts
|
|
28270
|
-
import { useCallback as useCallback40, useRef as
|
|
28369
|
+
import { useCallback as useCallback40, useRef as useRef47 } from "react";
|
|
28271
28370
|
|
|
28272
28371
|
// src/player/components/timelineZMirror.ts
|
|
28273
28372
|
var keyOf6 = (el) => el.key ?? el.id;
|
|
@@ -28456,7 +28555,7 @@ function useLayerReorderTimelineMirror() {
|
|
|
28456
28555
|
}
|
|
28457
28556
|
function useMirrorLaneMoveCommit() {
|
|
28458
28557
|
const elements = useExpandedTimelineElements();
|
|
28459
|
-
const elementsRef =
|
|
28558
|
+
const elementsRef = useRef47(elements);
|
|
28460
28559
|
elementsRef.current = elements;
|
|
28461
28560
|
const { onMoveElements } = useTimelineEditContextOptional();
|
|
28462
28561
|
return useCallback40(
|
|
@@ -28682,7 +28781,7 @@ function PreviewOverlays({
|
|
|
28682
28781
|
import { useCallback as useCallback42, useMemo as useMemo20 } from "react";
|
|
28683
28782
|
|
|
28684
28783
|
// src/hooks/useGsapTweenCache.ts
|
|
28685
|
-
import { useEffect as useEffect33, useMemo as useMemo19, useRef as
|
|
28784
|
+
import { useEffect as useEffect33, useMemo as useMemo19, useRef as useRef48, useState as useState36, useCallback as useCallback41 } from "react";
|
|
28686
28785
|
|
|
28687
28786
|
// src/hooks/gsapRuntimeReaders.ts
|
|
28688
28787
|
import { classifyPropertyGroup as classifyPropertyGroup3 } from "@hyperframes/core/gsap-parser";
|
|
@@ -29557,8 +29656,8 @@ function useGsapAnimationsForElement(projectId, sourceFile, target, version, ifr
|
|
|
29557
29656
|
const [allAnimations, setAllAnimations] = useState36([]);
|
|
29558
29657
|
const [multipleTimelines, setMultipleTimelines] = useState36(false);
|
|
29559
29658
|
const [unsupportedTimelinePattern, setUnsupportedTimelinePattern] = useState36(false);
|
|
29560
|
-
const lastFetchKeyRef =
|
|
29561
|
-
const retryTimerRef =
|
|
29659
|
+
const lastFetchKeyRef = useRef48("");
|
|
29660
|
+
const retryTimerRef = useRef48(null);
|
|
29562
29661
|
const domClipChildrenKey = usePlayerStore(
|
|
29563
29662
|
(s) => s.domClipChildren.map((c) => `${c.id}<${c.hostId}`).join("|")
|
|
29564
29663
|
);
|
|
@@ -29753,9 +29852,9 @@ function usePopulateKeyframeCacheForFile(projectId, sourceFile, version, iframeR
|
|
|
29753
29852
|
const domClipChildrenKey = usePlayerStore(
|
|
29754
29853
|
(s) => s.domClipChildren.map((c) => `${c.id}<${c.hostId}`).join("|")
|
|
29755
29854
|
);
|
|
29756
|
-
const lastFetchKeyRef =
|
|
29757
|
-
const runtimeScanDoneRef =
|
|
29758
|
-
const astFetchDoneRef =
|
|
29855
|
+
const lastFetchKeyRef = useRef48("");
|
|
29856
|
+
const runtimeScanDoneRef = useRef48("");
|
|
29857
|
+
const astFetchDoneRef = useRef48("");
|
|
29759
29858
|
useEffect33(() => {
|
|
29760
29859
|
const fetchKey = `kf-cache:${projectId}:${sourceFile}:${version}:${elementCount}:${domClipChildrenKey}:${compositionSrcKey}`;
|
|
29761
29860
|
if (fetchKey === lastFetchKeyRef.current) return;
|
|
@@ -30140,7 +30239,7 @@ function useTimelineEditCallbacks({
|
|
|
30140
30239
|
}
|
|
30141
30240
|
|
|
30142
30241
|
// src/captions/components/CaptionTimeline.tsx
|
|
30143
|
-
import { memo as memo25, useCallback as useCallback43, useRef as
|
|
30242
|
+
import { memo as memo25, useCallback as useCallback43, useRef as useRef49 } from "react";
|
|
30144
30243
|
import { jsx as jsx66, jsxs as jsxs52 } from "react/jsx-runtime";
|
|
30145
30244
|
var GROUP_COLORS = [
|
|
30146
30245
|
"#3CE6AC",
|
|
@@ -30163,7 +30262,7 @@ var CaptionTimeline = memo25(function CaptionTimeline2({
|
|
|
30163
30262
|
const selectSegment = useCaptionStore((s) => s.selectSegment);
|
|
30164
30263
|
const updateSegmentTiming = useCaptionStore((s) => s.updateSegmentTiming);
|
|
30165
30264
|
const splitGroup = useCaptionStore((s) => s.splitGroup);
|
|
30166
|
-
const dragRef =
|
|
30265
|
+
const dragRef = useRef49(null);
|
|
30167
30266
|
const handleEdgePointerDown = useCallback43(
|
|
30168
30267
|
(e, segId, edge, originalStart, originalEnd) => {
|
|
30169
30268
|
e.stopPropagation();
|
|
@@ -30285,7 +30384,7 @@ var CaptionTimeline = memo25(function CaptionTimeline2({
|
|
|
30285
30384
|
});
|
|
30286
30385
|
|
|
30287
30386
|
// src/components/StudioFeedbackBar.tsx
|
|
30288
|
-
import { memo as memo26, useState as useState37, useCallback as useCallback44, useRef as
|
|
30387
|
+
import { memo as memo26, useState as useState37, useCallback as useCallback44, useRef as useRef50, useEffect as useEffect34 } from "react";
|
|
30289
30388
|
import { Fragment as Fragment23, jsx as jsx67, jsxs as jsxs53 } from "react/jsx-runtime";
|
|
30290
30389
|
var DEFAULT_FEEDBACK_INTERVAL = 10;
|
|
30291
30390
|
var AUTO_DISMISS_MS = 2e4;
|
|
@@ -30345,8 +30444,8 @@ var StudioFeedbackBar = memo26(function StudioFeedbackBar2() {
|
|
|
30345
30444
|
const [comment, setComment] = useState37("");
|
|
30346
30445
|
const [submitted, setSubmitted] = useState37(false);
|
|
30347
30446
|
const [exiting, setExiting] = useState37(false);
|
|
30348
|
-
const inputRef =
|
|
30349
|
-
const dismissTimerRef =
|
|
30447
|
+
const inputRef = useRef50(null);
|
|
30448
|
+
const dismissTimerRef = useRef50(null);
|
|
30350
30449
|
useEffect34(() => {
|
|
30351
30450
|
incrementSessionCount();
|
|
30352
30451
|
const showTimer = setTimeout(() => {
|
|
@@ -30635,7 +30734,7 @@ function EditorShellBody({
|
|
|
30635
30734
|
}
|
|
30636
30735
|
|
|
30637
30736
|
// src/components/editor/SourceEditor.tsx
|
|
30638
|
-
import { useRef as
|
|
30737
|
+
import { useRef as useRef51, useCallback as useCallback46, useEffect as useEffect35, memo as memo27 } from "react";
|
|
30639
30738
|
import {
|
|
30640
30739
|
EditorView,
|
|
30641
30740
|
keymap,
|
|
@@ -30693,11 +30792,11 @@ var SourceEditor = memo27(function SourceEditor2({
|
|
|
30693
30792
|
readOnly = false,
|
|
30694
30793
|
revealOffset
|
|
30695
30794
|
}) {
|
|
30696
|
-
const editorRef =
|
|
30697
|
-
const containerRef =
|
|
30698
|
-
const onChangeRef =
|
|
30795
|
+
const editorRef = useRef51(null);
|
|
30796
|
+
const containerRef = useRef51(null);
|
|
30797
|
+
const onChangeRef = useRef51(onChange);
|
|
30699
30798
|
onChangeRef.current = onChange;
|
|
30700
|
-
const contentRef =
|
|
30799
|
+
const contentRef = useRef51(content);
|
|
30701
30800
|
contentRef.current = content;
|
|
30702
30801
|
const mountEditor = useCallback46(
|
|
30703
30802
|
(node) => {
|
|
@@ -30765,7 +30864,7 @@ var SourceEditor = memo27(function SourceEditor2({
|
|
|
30765
30864
|
});
|
|
30766
30865
|
|
|
30767
30866
|
// src/components/editor/PropertyPanel.tsx
|
|
30768
|
-
import { memo as memo31, useEffect as useEffect64, useMemo as useMemo32, useRef as
|
|
30867
|
+
import { memo as memo31, useEffect as useEffect64, useMemo as useMemo32, useRef as useRef75, useState as useState74 } from "react";
|
|
30769
30868
|
|
|
30770
30869
|
// src/components/editor/InspectorHeaderActions.tsx
|
|
30771
30870
|
import { Eye as Eye3, EyeSlash as EyeSlash2 } from "@phosphor-icons/react";
|
|
@@ -31546,22 +31645,22 @@ function buildElementInfoText(element, sourceLabel, gsapAnimations, previewIfram
|
|
|
31546
31645
|
}
|
|
31547
31646
|
|
|
31548
31647
|
// src/components/editor/propertyPanelPrimitives.tsx
|
|
31549
|
-
import { useCallback as useCallback49, useEffect as useEffect38, useRef as
|
|
31648
|
+
import { useCallback as useCallback49, useEffect as useEffect38, useRef as useRef54, useState as useState40 } from "react";
|
|
31550
31649
|
|
|
31551
31650
|
// src/components/editor/propertyPanelCommitField.tsx
|
|
31552
|
-
import { useEffect as useEffect37, useRef as
|
|
31651
|
+
import { useEffect as useEffect37, useRef as useRef53, useState as useState39 } from "react";
|
|
31553
31652
|
|
|
31554
31653
|
// src/components/editor/useInspectorGestureTransaction.ts
|
|
31555
|
-
import { useCallback as useCallback48, useEffect as useEffect36, useRef as
|
|
31654
|
+
import { useCallback as useCallback48, useEffect as useEffect36, useRef as useRef52, useState as useState38 } from "react";
|
|
31556
31655
|
function useInspectorGestureTransaction({
|
|
31557
31656
|
sourceValue,
|
|
31558
31657
|
onPreview,
|
|
31559
31658
|
onCommit
|
|
31560
31659
|
}) {
|
|
31561
|
-
const sourceRef =
|
|
31562
|
-
const activeRef =
|
|
31563
|
-
const previewRef =
|
|
31564
|
-
const commitRef =
|
|
31660
|
+
const sourceRef = useRef52(sourceValue);
|
|
31661
|
+
const activeRef = useRef52(null);
|
|
31662
|
+
const previewRef = useRef52(onPreview);
|
|
31663
|
+
const commitRef = useRef52(onCommit);
|
|
31565
31664
|
if (!activeRef.current) sourceRef.current = sourceValue;
|
|
31566
31665
|
previewRef.current = onPreview;
|
|
31567
31666
|
commitRef.current = onCommit;
|
|
@@ -31636,15 +31735,15 @@ function CommitField({
|
|
|
31636
31735
|
onCommit
|
|
31637
31736
|
}) {
|
|
31638
31737
|
const [draft, setDraft] = useState39(value);
|
|
31639
|
-
const valueRef =
|
|
31640
|
-
const draftRef =
|
|
31641
|
-
const inputRef =
|
|
31642
|
-
const focusedRef =
|
|
31643
|
-
const dirtyRef =
|
|
31738
|
+
const valueRef = useRef53(value);
|
|
31739
|
+
const draftRef = useRef53(draft);
|
|
31740
|
+
const inputRef = useRef53(null);
|
|
31741
|
+
const focusedRef = useRef53(false);
|
|
31742
|
+
const dirtyRef = useRef53(false);
|
|
31644
31743
|
valueRef.current = value;
|
|
31645
31744
|
draftRef.current = draft;
|
|
31646
|
-
const gestureActiveRef =
|
|
31647
|
-
const gestureSettleTimerRef =
|
|
31745
|
+
const gestureActiveRef = useRef53(false);
|
|
31746
|
+
const gestureSettleTimerRef = useRef53(null);
|
|
31648
31747
|
const gestureTransaction = useInspectorGestureTransaction({
|
|
31649
31748
|
sourceValue: value,
|
|
31650
31749
|
onPreview: (nextValue) => {
|
|
@@ -31653,7 +31752,7 @@ function CommitField({
|
|
|
31653
31752
|
},
|
|
31654
31753
|
onCommit
|
|
31655
31754
|
});
|
|
31656
|
-
const gestureTransactionRef =
|
|
31755
|
+
const gestureTransactionRef = useRef53(gestureTransaction);
|
|
31657
31756
|
gestureTransactionRef.current = gestureTransaction;
|
|
31658
31757
|
const clearGestureSettleTimer = () => {
|
|
31659
31758
|
if (!gestureSettleTimerRef.current) return;
|
|
@@ -31796,7 +31895,7 @@ function MetricField({
|
|
|
31796
31895
|
onCommit
|
|
31797
31896
|
}) {
|
|
31798
31897
|
const track = useTrackDesignInput();
|
|
31799
|
-
const scrubRef =
|
|
31898
|
+
const scrubRef = useRef54(null);
|
|
31800
31899
|
const commit = useCallback49(
|
|
31801
31900
|
(nextValue) => {
|
|
31802
31901
|
if (nextValue !== value) track("metric", label);
|
|
@@ -31867,9 +31966,9 @@ function SliderControl({
|
|
|
31867
31966
|
}) {
|
|
31868
31967
|
const track = useTrackDesignInput();
|
|
31869
31968
|
const [draft, setDraft] = useState40(value);
|
|
31870
|
-
const commitTimerRef =
|
|
31871
|
-
const interactionChangedRef =
|
|
31872
|
-
const valueRef =
|
|
31969
|
+
const commitTimerRef = useRef54(null);
|
|
31970
|
+
const interactionChangedRef = useRef54(false);
|
|
31971
|
+
const valueRef = useRef54(value);
|
|
31873
31972
|
valueRef.current = value;
|
|
31874
31973
|
useEffect38(() => {
|
|
31875
31974
|
setDraft(value);
|
|
@@ -32464,14 +32563,14 @@ function MediaSection({
|
|
|
32464
32563
|
import { isHfColorGradingActive as isHfColorGradingActive2 } from "@hyperframes/core/color-grading";
|
|
32465
32564
|
|
|
32466
32565
|
// src/components/editor/propertyPanelColorGradingControls.tsx
|
|
32467
|
-
import { useMemo as useMemo22, useRef as
|
|
32566
|
+
import { useMemo as useMemo22, useRef as useRef56, useState as useState43 } from "react";
|
|
32468
32567
|
import {
|
|
32469
32568
|
HF_COLOR_GRADING_PRESETS,
|
|
32470
32569
|
normalizeHfColorGrading
|
|
32471
32570
|
} from "@hyperframes/core/color-grading";
|
|
32472
32571
|
|
|
32473
32572
|
// src/components/editor/propertyPanelColorGradingSlider.tsx
|
|
32474
|
-
import { useCallback as useCallback50, useEffect as useEffect40, useRef as
|
|
32573
|
+
import { useCallback as useCallback50, useEffect as useEffect40, useRef as useRef55, useState as useState42 } from "react";
|
|
32475
32574
|
import { jsx as jsx75, jsxs as jsxs58 } from "react/jsx-runtime";
|
|
32476
32575
|
var SLIDER_THUMB_SIZE = 10;
|
|
32477
32576
|
var SLIDER_THUMB_RADIUS = SLIDER_THUMB_SIZE / 2;
|
|
@@ -32510,9 +32609,9 @@ function ColorGradingSliderControl({
|
|
|
32510
32609
|
const track = useTrackDesignInput();
|
|
32511
32610
|
const [draftState, setDraftState] = useState42(null);
|
|
32512
32611
|
const [inputDraft, setInputDraft] = useState42(null);
|
|
32513
|
-
const commitTimerRef =
|
|
32514
|
-
const interactionChangedRef =
|
|
32515
|
-
const valueRef =
|
|
32612
|
+
const commitTimerRef = useRef55(null);
|
|
32613
|
+
const interactionChangedRef = useRef55(false);
|
|
32614
|
+
const valueRef = useRef55(value);
|
|
32516
32615
|
valueRef.current = value;
|
|
32517
32616
|
useEffect40(
|
|
32518
32617
|
() => () => {
|
|
@@ -32903,7 +33002,7 @@ function ColorGradingControls({
|
|
|
32903
33002
|
onCommitColorGrading
|
|
32904
33003
|
}) {
|
|
32905
33004
|
const track = useTrackDesignInput();
|
|
32906
|
-
const lutInputRef =
|
|
33005
|
+
const lutInputRef = useRef56(null);
|
|
32907
33006
|
const [lutOpen, setLutOpen] = useState43(false);
|
|
32908
33007
|
const [detailSettings, setDetailSettings] = useState43(null);
|
|
32909
33008
|
const lutAssets = useMemo22(
|
|
@@ -33183,7 +33282,7 @@ function ColorGradingControls({
|
|
|
33183
33282
|
}
|
|
33184
33283
|
|
|
33185
33284
|
// src/components/editor/useColorGradingController.ts
|
|
33186
|
-
import { useCallback as useCallback52, useEffect as useEffect42, useMemo as useMemo23, useRef as
|
|
33285
|
+
import { useCallback as useCallback52, useEffect as useEffect42, useMemo as useMemo23, useRef as useRef58, useState as useState45 } from "react";
|
|
33187
33286
|
import {
|
|
33188
33287
|
HF_COLOR_GRADING_ATTR,
|
|
33189
33288
|
hasHfColorGradingAuthoredValues,
|
|
@@ -33256,7 +33355,7 @@ async function runDomEditCommit(config) {
|
|
|
33256
33355
|
}
|
|
33257
33356
|
|
|
33258
33357
|
// src/components/editor/useColorGradingPreviews.ts
|
|
33259
|
-
import { useCallback as useCallback51, useEffect as useEffect41, useRef as
|
|
33358
|
+
import { useCallback as useCallback51, useEffect as useEffect41, useRef as useRef57, useState as useState44 } from "react";
|
|
33260
33359
|
import {
|
|
33261
33360
|
HF_COLOR_GRADING_ACTIVE_EFFECT_KEYS,
|
|
33262
33361
|
HF_COLOR_GRADING_EFFECT_APPLY_DEFAULTS,
|
|
@@ -33330,7 +33429,7 @@ function useColorGradingPreviews({
|
|
|
33330
33429
|
previews: emptyPreviews()
|
|
33331
33430
|
}));
|
|
33332
33431
|
const [request, setRequest] = useState44(null);
|
|
33333
|
-
const animatedRef =
|
|
33432
|
+
const animatedRef = useRef57(null);
|
|
33334
33433
|
if (state.identityKey !== identityKey) {
|
|
33335
33434
|
setState({ identityKey, previews: emptyPreviews() });
|
|
33336
33435
|
setRequest(null);
|
|
@@ -33605,19 +33704,19 @@ function useColorGradingController({
|
|
|
33605
33704
|
[element, projectId]
|
|
33606
33705
|
);
|
|
33607
33706
|
const [mediaMetadata, setMediaMetadata] = useState45(null);
|
|
33608
|
-
const persistTimerRef =
|
|
33609
|
-
const pendingPersistValueRef =
|
|
33610
|
-
const pendingPersistGradingRef =
|
|
33611
|
-
const pendingPersistIdentityRef =
|
|
33612
|
-
const confirmedGradingRef =
|
|
33613
|
-
const gradingVersionRef =
|
|
33614
|
-
const statusTimersRef =
|
|
33615
|
-
const latestGradingRef =
|
|
33616
|
-
const compareEnabledRef =
|
|
33707
|
+
const persistTimerRef = useRef58(null);
|
|
33708
|
+
const pendingPersistValueRef = useRef58(void 0);
|
|
33709
|
+
const pendingPersistGradingRef = useRef58(null);
|
|
33710
|
+
const pendingPersistIdentityRef = useRef58(null);
|
|
33711
|
+
const confirmedGradingRef = useRef58(grading);
|
|
33712
|
+
const gradingVersionRef = useRef58(0);
|
|
33713
|
+
const statusTimersRef = useRef58([]);
|
|
33714
|
+
const latestGradingRef = useRef58(grading);
|
|
33715
|
+
const compareEnabledRef = useRef58(compareEnabled);
|
|
33617
33716
|
latestGradingRef.current = grading;
|
|
33618
33717
|
compareEnabledRef.current = compareEnabled;
|
|
33619
33718
|
const identityKey = selectionIdentityKey2(element);
|
|
33620
|
-
const identityKeyRef =
|
|
33719
|
+
const identityKeyRef = useRef58(identityKey);
|
|
33621
33720
|
if (identityKeyRef.current !== identityKey) {
|
|
33622
33721
|
identityKeyRef.current = identityKey;
|
|
33623
33722
|
const freshGrading = readColorGradingFromElement(element);
|
|
@@ -34115,10 +34214,10 @@ function ColorGradingSection({
|
|
|
34115
34214
|
}
|
|
34116
34215
|
|
|
34117
34216
|
// src/components/editor/propertyPanelSections.tsx
|
|
34118
|
-
import { useEffect as useEffect48, useRef as
|
|
34217
|
+
import { useEffect as useEffect48, useRef as useRef62, useState as useState54 } from "react";
|
|
34119
34218
|
|
|
34120
34219
|
// src/components/editor/propertyPanelColor.tsx
|
|
34121
|
-
import { useCallback as useCallback53, useEffect as useEffect43, useLayoutEffect as useLayoutEffect4, useRef as
|
|
34220
|
+
import { useCallback as useCallback53, useEffect as useEffect43, useLayoutEffect as useLayoutEffect4, useRef as useRef59, useState as useState46 } from "react";
|
|
34122
34221
|
import { createPortal as createPortal6 } from "react-dom";
|
|
34123
34222
|
import { jsx as jsx78, jsxs as jsxs61 } from "react/jsx-runtime";
|
|
34124
34223
|
var COLOR_PICKER_SIZE = { width: 292, height: 386 };
|
|
@@ -34137,7 +34236,7 @@ function ColorSlider({
|
|
|
34137
34236
|
onInteractionEnd,
|
|
34138
34237
|
onInteractionCancel
|
|
34139
34238
|
}) {
|
|
34140
|
-
const trackRef =
|
|
34239
|
+
const trackRef = useRef59(null);
|
|
34141
34240
|
const percent3 = (value - min) / (max - min) * 100;
|
|
34142
34241
|
const previewFromClientX = (clientX) => {
|
|
34143
34242
|
const rect = trackRef.current?.getBoundingClientRect();
|
|
@@ -34235,12 +34334,12 @@ function ColorField({
|
|
|
34235
34334
|
onCommit
|
|
34236
34335
|
}) {
|
|
34237
34336
|
const track = useTrackDesignInput();
|
|
34238
|
-
const buttonRef =
|
|
34239
|
-
const panelRef =
|
|
34337
|
+
const buttonRef = useRef59(null);
|
|
34338
|
+
const panelRef = useRef59(null);
|
|
34240
34339
|
const [open, setOpen] = useState46(false);
|
|
34241
34340
|
const [panelPosition, setPanelPosition] = useState46(null);
|
|
34242
34341
|
const [draftColor, setDraftColor] = useState46(() => colorFromCss(value));
|
|
34243
|
-
const draftColorRef =
|
|
34342
|
+
const draftColorRef = useRef59(draftColor);
|
|
34244
34343
|
draftColorRef.current = draftColor;
|
|
34245
34344
|
const [hexDraft, setHexDraft] = useState46(() => toHexColor(colorFromCss(value)).toUpperCase());
|
|
34246
34345
|
const hsv = rgbToHsv(draftColor);
|
|
@@ -34619,7 +34718,7 @@ function ColorField({
|
|
|
34619
34718
|
}
|
|
34620
34719
|
|
|
34621
34720
|
// src/components/editor/propertyPanelFont.tsx
|
|
34622
|
-
import { useEffect as useEffect44, useMemo as useMemo24, useRef as
|
|
34721
|
+
import { useEffect as useEffect44, useMemo as useMemo24, useRef as useRef60, useState as useState47 } from "react";
|
|
34623
34722
|
|
|
34624
34723
|
// src/components/editor/fontAssets.ts
|
|
34625
34724
|
var FONT_EXT_RE = /\.(eot|otf|ttc|ttf|woff2?)$/i;
|
|
@@ -34733,9 +34832,9 @@ function FontFamilyField({
|
|
|
34733
34832
|
}) {
|
|
34734
34833
|
const track = useTrackDesignInput();
|
|
34735
34834
|
const currentFamily = primaryFontFamily(value);
|
|
34736
|
-
const containerRef =
|
|
34737
|
-
const inputRef =
|
|
34738
|
-
const fontInputRef =
|
|
34835
|
+
const containerRef = useRef60(null);
|
|
34836
|
+
const inputRef = useRef60(null);
|
|
34837
|
+
const fontInputRef = useRef60(null);
|
|
34739
34838
|
const [open, setOpen] = useState47(false);
|
|
34740
34839
|
const [query, setQuery] = useState47("");
|
|
34741
34840
|
const [localFonts, setLocalFonts] = useState47([]);
|
|
@@ -35945,7 +36044,7 @@ function parseColorString(value) {
|
|
|
35945
36044
|
}
|
|
35946
36045
|
|
|
35947
36046
|
// src/components/editor/propertyPanelFill.tsx
|
|
35948
|
-
import { useMemo as useMemo27, useRef as
|
|
36047
|
+
import { useMemo as useMemo27, useRef as useRef61, useState as useState51 } from "react";
|
|
35949
36048
|
import { jsx as jsx84, jsxs as jsxs66 } from "react/jsx-runtime";
|
|
35950
36049
|
function normalizeProjectPath(value) {
|
|
35951
36050
|
const trimmed = value.trim();
|
|
@@ -35987,7 +36086,7 @@ function ImageFillField({
|
|
|
35987
36086
|
onImportAssets
|
|
35988
36087
|
}) {
|
|
35989
36088
|
const track = useTrackDesignInput();
|
|
35990
|
-
const fileInputRef =
|
|
36089
|
+
const fileInputRef = useRef61(null);
|
|
35991
36090
|
const [uploading, setUploading] = useState51(false);
|
|
35992
36091
|
const imageAssets = useMemo27(() => assets.filter((a) => IMAGE_EXT.test(a)), [assets]);
|
|
35993
36092
|
const selectedAsset = useMemo27(
|
|
@@ -36092,7 +36191,7 @@ function GradientField({
|
|
|
36092
36191
|
onCommit
|
|
36093
36192
|
}) {
|
|
36094
36193
|
const track = useTrackDesignInput();
|
|
36095
|
-
const previewRef =
|
|
36194
|
+
const previewRef = useRef61(null);
|
|
36096
36195
|
const parsed = parseGradient(value) ?? buildDefaultGradientModel(fallbackColor);
|
|
36097
36196
|
const commit = (next) => onCommit(serializeGradient(next));
|
|
36098
36197
|
const patch = (partial) => commit({ ...parsed, ...partial });
|
|
@@ -37030,11 +37129,11 @@ function TextAreaField({
|
|
|
37030
37129
|
}) {
|
|
37031
37130
|
const track = useTrackDesignInput();
|
|
37032
37131
|
const [draft, setDraft] = useState54(value);
|
|
37033
|
-
const textareaRef =
|
|
37034
|
-
const commitTimerRef =
|
|
37035
|
-
const interactionChangedRef =
|
|
37036
|
-
const focusedRef =
|
|
37037
|
-
const valueRef =
|
|
37132
|
+
const textareaRef = useRef62(null);
|
|
37133
|
+
const commitTimerRef = useRef62(null);
|
|
37134
|
+
const interactionChangedRef = useRef62(false);
|
|
37135
|
+
const focusedRef = useRef62(false);
|
|
37136
|
+
const valueRef = useRef62(value);
|
|
37038
37137
|
valueRef.current = value;
|
|
37039
37138
|
useEffect48(() => {
|
|
37040
37139
|
if (focusedRef.current) return;
|
|
@@ -37441,7 +37540,7 @@ function TextSection({
|
|
|
37441
37540
|
import { memo as memo30, useState as useState56 } from "react";
|
|
37442
37541
|
|
|
37443
37542
|
// src/components/editor/AnimationCard.tsx
|
|
37444
|
-
import { memo as memo29, useCallback as useCallback56, useEffect as useEffect49, useMemo as useMemo28, useRef as
|
|
37543
|
+
import { memo as memo29, useCallback as useCallback56, useEffect as useEffect49, useMemo as useMemo28, useRef as useRef63, useState as useState55 } from "react";
|
|
37445
37544
|
import { SUPPORTED_EASES, SUPPORTED_PROPS } from "@hyperframes/core/gsap-constants";
|
|
37446
37545
|
|
|
37447
37546
|
// src/components/editor/gsapAnimationHelpers.ts
|
|
@@ -37954,8 +38053,8 @@ var AnimationCard = memo29(function AnimationCard2({
|
|
|
37954
38053
|
const [addingFromProp, setAddingFromProp] = useState55(false);
|
|
37955
38054
|
const [expandedKfPct, setExpandedKfPct] = useState55(null);
|
|
37956
38055
|
const [focusedCollidingAnimationTargets, setFocusedCollidingAnimationTargets] = useState55();
|
|
37957
|
-
const cardRef =
|
|
37958
|
-
const pendingAutoScrollRef =
|
|
38056
|
+
const cardRef = useRef63(null);
|
|
38057
|
+
const pendingAutoScrollRef = useRef63(false);
|
|
37959
38058
|
useEffect49(() => {
|
|
37960
38059
|
if (!focusedSegment) return;
|
|
37961
38060
|
setExpanded(true);
|
|
@@ -38499,7 +38598,7 @@ var GsapAnimationSection = memo30(function GsapAnimationSection2({
|
|
|
38499
38598
|
import { useState as useState58 } from "react";
|
|
38500
38599
|
|
|
38501
38600
|
// src/components/editor/Transform3DCube.tsx
|
|
38502
|
-
import { useEffect as useEffect50, useRef as
|
|
38601
|
+
import { useEffect as useEffect50, useRef as useRef64, useState as useState57 } from "react";
|
|
38503
38602
|
|
|
38504
38603
|
// src/components/editor/transform3dProjection.ts
|
|
38505
38604
|
var DEG = Math.PI / 180;
|
|
@@ -38615,12 +38714,12 @@ function Transform3DCube({
|
|
|
38615
38714
|
}) {
|
|
38616
38715
|
const [draft, setDraft] = useState57(null);
|
|
38617
38716
|
const [depthDraft, setDepthDraft] = useState57(null);
|
|
38618
|
-
const dragRef =
|
|
38717
|
+
const dragRef = useRef64(null);
|
|
38619
38718
|
const shown = draft ?? pose;
|
|
38620
38719
|
const shownZ = depthDraft ?? z;
|
|
38621
|
-
const svgRef =
|
|
38720
|
+
const svgRef = useRef64(null);
|
|
38622
38721
|
const lens = perspective > 0 ? perspective : defaultPerspective;
|
|
38623
|
-
const depthRef =
|
|
38722
|
+
const depthRef = useRef64({ z, onDepthDraft, onDepthCommit, lens });
|
|
38624
38723
|
depthRef.current = { z, onDepthDraft, onDepthCommit, lens };
|
|
38625
38724
|
useEffect50(() => {
|
|
38626
38725
|
const el = svgRef.current;
|
|
@@ -39115,7 +39214,7 @@ function PropertyPanel3dTransform({
|
|
|
39115
39214
|
}
|
|
39116
39215
|
|
|
39117
39216
|
// src/components/editor/PropertyPanelFlat.tsx
|
|
39118
|
-
import { useEffect as useEffect63, useRef as
|
|
39217
|
+
import { useEffect as useEffect63, useRef as useRef74, useState as useState73 } from "react";
|
|
39119
39218
|
|
|
39120
39219
|
// src/components/editor/PropertyPanelFlatHeader.tsx
|
|
39121
39220
|
import { Eye as Eye4, EyeSlash as EyeSlash3 } from "@phosphor-icons/react";
|
|
@@ -39292,7 +39391,7 @@ function PropertyPanelFlatFooter({
|
|
|
39292
39391
|
}
|
|
39293
39392
|
|
|
39294
39393
|
// src/components/editor/propertyPanelFlatPrimitives.tsx
|
|
39295
|
-
import { useEffect as useEffect51, useRef as
|
|
39394
|
+
import { useEffect as useEffect51, useRef as useRef65, useState as useState59 } from "react";
|
|
39296
39395
|
|
|
39297
39396
|
// src/components/editor/propertyPanelValueTier.ts
|
|
39298
39397
|
function resolveValueTier(explicitValue, defaultValue) {
|
|
@@ -39565,18 +39664,18 @@ function FlatSlider({
|
|
|
39565
39664
|
}) {
|
|
39566
39665
|
const track = useTrackDesignInput();
|
|
39567
39666
|
const [draft, setDraft] = useState59(value);
|
|
39568
|
-
const commitTimerRef =
|
|
39569
|
-
const lastCommitAtRef =
|
|
39570
|
-
const pendingRef =
|
|
39571
|
-
const draggingRef =
|
|
39572
|
-
const lastCommittedRef =
|
|
39573
|
-
const onCommitRef =
|
|
39667
|
+
const commitTimerRef = useRef65(null);
|
|
39668
|
+
const lastCommitAtRef = useRef65(0);
|
|
39669
|
+
const pendingRef = useRef65(null);
|
|
39670
|
+
const draggingRef = useRef65(false);
|
|
39671
|
+
const lastCommittedRef = useRef65(value);
|
|
39672
|
+
const onCommitRef = useRef65(onCommit);
|
|
39574
39673
|
onCommitRef.current = onCommit;
|
|
39575
|
-
const latestValueRef =
|
|
39674
|
+
const latestValueRef = useRef65(value);
|
|
39576
39675
|
latestValueRef.current = value;
|
|
39577
|
-
const explicitReleaseRef =
|
|
39578
|
-
const dragStartValueRef =
|
|
39579
|
-
const activePointerIdRef =
|
|
39676
|
+
const explicitReleaseRef = useRef65(false);
|
|
39677
|
+
const dragStartValueRef = useRef65(value);
|
|
39678
|
+
const activePointerIdRef = useRef65(null);
|
|
39580
39679
|
useEffect51(() => {
|
|
39581
39680
|
if (draggingRef.current) return;
|
|
39582
39681
|
setDraft(value);
|
|
@@ -41463,7 +41562,7 @@ function createGsapLivePreview(iframeRef) {
|
|
|
41463
41562
|
}
|
|
41464
41563
|
|
|
41465
41564
|
// src/components/editor/propertyPanelFlatColorGradingSection.tsx
|
|
41466
|
-
import { useEffect as useEffect60, useMemo as useMemo30, useRef as
|
|
41565
|
+
import { useEffect as useEffect60, useMemo as useMemo30, useRef as useRef73, useState as useState69 } from "react";
|
|
41467
41566
|
import {
|
|
41468
41567
|
HF_COLOR_GRADING_GRADE_PRESETS,
|
|
41469
41568
|
normalizeHfColorGrading as normalizeHfColorGrading5,
|
|
@@ -41498,7 +41597,7 @@ function presetPreviewHandlers({
|
|
|
41498
41597
|
import { useState as useState65 } from "react";
|
|
41499
41598
|
|
|
41500
41599
|
// src/components/editor/propertyPanelColorCurveGraph.tsx
|
|
41501
|
-
import { useMemo as useMemo29, useRef as
|
|
41600
|
+
import { useMemo as useMemo29, useRef as useRef66 } from "react";
|
|
41502
41601
|
import {
|
|
41503
41602
|
compileHfColorCurve,
|
|
41504
41603
|
compileHfHueCurve,
|
|
@@ -41685,7 +41784,7 @@ function CurveGraph({
|
|
|
41685
41784
|
onSettle,
|
|
41686
41785
|
onCancel
|
|
41687
41786
|
}) {
|
|
41688
|
-
const pointerRef =
|
|
41787
|
+
const pointerRef = useRef66(null);
|
|
41689
41788
|
const samples = useMemo29(() => samplesFor(points, tab), [points, tab]);
|
|
41690
41789
|
const path = useMemo29(() => curvePath(samples, tab), [samples, tab]);
|
|
41691
41790
|
const selectRelativePoint = (offset) => {
|
|
@@ -41921,7 +42020,7 @@ function formatPointValue(value, tab, axis) {
|
|
|
41921
42020
|
}
|
|
41922
42021
|
|
|
41923
42022
|
// src/components/editor/propertyPanelGradingNumberField.tsx
|
|
41924
|
-
import { useEffect as useEffect55, useRef as
|
|
42023
|
+
import { useEffect as useEffect55, useRef as useRef67, useState as useState64 } from "react";
|
|
41925
42024
|
import { jsx as jsx110, jsxs as jsxs92 } from "react/jsx-runtime";
|
|
41926
42025
|
function GradingNumberField({
|
|
41927
42026
|
label,
|
|
@@ -41940,10 +42039,10 @@ function GradingNumberField({
|
|
|
41940
42039
|
onCancel
|
|
41941
42040
|
}) {
|
|
41942
42041
|
const [draft, setDraft] = useState64(() => formatValue(value));
|
|
41943
|
-
const focusedRef =
|
|
41944
|
-
const cancelBlurRef =
|
|
41945
|
-
const baselineRef =
|
|
41946
|
-
const dirtyRef =
|
|
42042
|
+
const focusedRef = useRef67(false);
|
|
42043
|
+
const cancelBlurRef = useRef67(false);
|
|
42044
|
+
const baselineRef = useRef67(value);
|
|
42045
|
+
const dirtyRef = useRef67(false);
|
|
41947
42046
|
useEffect55(() => {
|
|
41948
42047
|
if (!focusedRef.current) setDraft(formatValue(value));
|
|
41949
42048
|
}, [formatValue, value]);
|
|
@@ -42173,10 +42272,10 @@ function ColorCurves({
|
|
|
42173
42272
|
}
|
|
42174
42273
|
|
|
42175
42274
|
// src/components/editor/propertyPanelColorScopes.tsx
|
|
42176
|
-
import { useEffect as useEffect57, useRef as
|
|
42275
|
+
import { useEffect as useEffect57, useRef as useRef69, useState as useState67 } from "react";
|
|
42177
42276
|
|
|
42178
42277
|
// src/components/editor/useColorGradingScopes.ts
|
|
42179
|
-
import { useEffect as useEffect56, useRef as
|
|
42278
|
+
import { useEffect as useEffect56, useRef as useRef68, useState as useState66 } from "react";
|
|
42180
42279
|
|
|
42181
42280
|
// src/components/editor/colorGradingFrameAnalysis.ts
|
|
42182
42281
|
import {
|
|
@@ -42336,7 +42435,7 @@ function useColorGradingScopes({
|
|
|
42336
42435
|
const [analysis, setAnalysis] = useState66(null);
|
|
42337
42436
|
const [status, setStatus] = useState66("idle");
|
|
42338
42437
|
const [refreshVersion, setRefreshVersion] = useState66(0);
|
|
42339
|
-
const captureRef =
|
|
42438
|
+
const captureRef = useRef68(captureFrame);
|
|
42340
42439
|
captureRef.current = captureFrame;
|
|
42341
42440
|
useEffect56(() => {
|
|
42342
42441
|
if (!open) {
|
|
@@ -42514,7 +42613,7 @@ function PropertyPanelColorScopes({
|
|
|
42514
42613
|
}) {
|
|
42515
42614
|
const [open, setOpen] = useState67(false);
|
|
42516
42615
|
const [mode, setMode] = useState67("waveform");
|
|
42517
|
-
const canvasRef =
|
|
42616
|
+
const canvasRef = useRef69(null);
|
|
42518
42617
|
const { analysis, status, refresh } = useColorGradingScopes({
|
|
42519
42618
|
open,
|
|
42520
42619
|
captureFrame,
|
|
@@ -42584,7 +42683,7 @@ function PropertyPanelColorScopes({
|
|
|
42584
42683
|
}
|
|
42585
42684
|
|
|
42586
42685
|
// src/components/editor/propertyPanelColorSecondary.tsx
|
|
42587
|
-
import { useEffect as useEffect58, useRef as
|
|
42686
|
+
import { useEffect as useEffect58, useRef as useRef70, useState as useState68 } from "react";
|
|
42588
42687
|
import {
|
|
42589
42688
|
getHfColorGradingCapabilities,
|
|
42590
42689
|
normalizeHfColorGrading as normalizeHfColorGrading4
|
|
@@ -42634,7 +42733,7 @@ function PropertyPanelColorSecondary({
|
|
|
42634
42733
|
const [showMatte, setShowMatte] = useState68(false);
|
|
42635
42734
|
const [captureError, setCaptureError] = useState68(null);
|
|
42636
42735
|
const [sampling, setSampling] = useState68(false);
|
|
42637
|
-
const matteCanvasRef =
|
|
42736
|
+
const matteCanvasRef = useRef70(null);
|
|
42638
42737
|
const activeIndex = Math.min(selectedIndex, Math.max(0, secondaries.length - 1));
|
|
42639
42738
|
const selected = secondaries[activeIndex];
|
|
42640
42739
|
useEffect58(() => {
|
|
@@ -43000,7 +43099,7 @@ function PropertyPanelColorSecondary({
|
|
|
43000
43099
|
}
|
|
43001
43100
|
|
|
43002
43101
|
// src/components/editor/propertyPanelColorWheels.tsx
|
|
43003
|
-
import { useRef as
|
|
43102
|
+
import { useRef as useRef71 } from "react";
|
|
43004
43103
|
import {
|
|
43005
43104
|
getHfColorGradingCapabilities as getHfColorGradingCapabilities2
|
|
43006
43105
|
} from "@hyperframes/core/color-grading";
|
|
@@ -43084,7 +43183,7 @@ function TonalWheel({
|
|
|
43084
43183
|
onCancel,
|
|
43085
43184
|
onReset
|
|
43086
43185
|
}) {
|
|
43087
|
-
const pointerIdRef =
|
|
43186
|
+
const pointerIdRef = useRef71(null);
|
|
43088
43187
|
const hueRadians = wheel.hue * Math.PI / 180;
|
|
43089
43188
|
const thumbLeft = 50 + Math.cos(hueRadians) * wheel.amount * 46;
|
|
43090
43189
|
const thumbTop = 50 - Math.sin(hueRadians) * wheel.amount * 46;
|
|
@@ -43303,7 +43402,7 @@ function ColorWheels({
|
|
|
43303
43402
|
}
|
|
43304
43403
|
|
|
43305
43404
|
// src/components/editor/propertyPanelFlatColorGradingAccessory.tsx
|
|
43306
|
-
import { useEffect as useEffect59, useRef as
|
|
43405
|
+
import { useEffect as useEffect59, useRef as useRef72 } from "react";
|
|
43307
43406
|
import { isHfColorGradingActive as isHfColorGradingActive3 } from "@hyperframes/core/color-grading";
|
|
43308
43407
|
import { jsx as jsx115, jsxs as jsxs97 } from "react/jsx-runtime";
|
|
43309
43408
|
var STATUS_DOT_CLASS = {
|
|
@@ -43319,7 +43418,7 @@ function FlatColorGradingAccessory({
|
|
|
43319
43418
|
const track = useTrackDesignInput();
|
|
43320
43419
|
const { grading, compareEnabled, runtimeStatus, commitCompare, resetGrading } = state;
|
|
43321
43420
|
const gradingActive = isHfColorGradingActive3(grading);
|
|
43322
|
-
const releaseRef =
|
|
43421
|
+
const releaseRef = useRef72(null);
|
|
43323
43422
|
useEffect59(
|
|
43324
43423
|
() => () => {
|
|
43325
43424
|
releaseRef.current?.();
|
|
@@ -43481,7 +43580,7 @@ function FlatColorGradingSection({
|
|
|
43481
43580
|
captureGradedFrame
|
|
43482
43581
|
}) {
|
|
43483
43582
|
const track = useTrackDesignInput();
|
|
43484
|
-
const lutInputRef =
|
|
43583
|
+
const lutInputRef = useRef73(null);
|
|
43485
43584
|
const [lutOpen, setLutOpen] = useState69(false);
|
|
43486
43585
|
const [detailSettingsOpen, setDetailSettingsOpen] = useState69(null);
|
|
43487
43586
|
const lutAssets = useMemo30(
|
|
@@ -44930,8 +45029,8 @@ function PropertyPanelFlat({
|
|
|
44930
45029
|
if (focusesThisPanel) setOpenGroupId("motion");
|
|
44931
45030
|
}
|
|
44932
45031
|
const [justToggledIds, setJustToggledIds] = useState73([]);
|
|
44933
|
-
const justToggledTimeoutRef =
|
|
44934
|
-
const panelBodyRef =
|
|
45032
|
+
const justToggledTimeoutRef = useRef74(null);
|
|
45033
|
+
const panelBodyRef = useRef74(null);
|
|
44935
45034
|
useEffect63(() => {
|
|
44936
45035
|
return () => {
|
|
44937
45036
|
if (justToggledTimeoutRef.current) clearTimeout(justToggledTimeoutRef.current);
|
|
@@ -45515,14 +45614,14 @@ var PropertyPanel = memo31(function PropertyPanel2(props) {
|
|
|
45515
45614
|
const styles = element?.computedStyles ?? EMPTY_STYLES;
|
|
45516
45615
|
const { showToast } = useStudioShellContext();
|
|
45517
45616
|
const [clipboardCopied, setClipboardCopied] = useState74(false);
|
|
45518
|
-
const clipboardTimerRef =
|
|
45617
|
+
const clipboardTimerRef = useRef75(void 0);
|
|
45519
45618
|
const storeTime = usePlayerStore((s) => s.currentTime);
|
|
45520
45619
|
const isPlaying = usePlayerStore((s) => s.isPlaying);
|
|
45521
45620
|
const timelineElements = usePlayerStore((s) => s.elements);
|
|
45522
45621
|
const selectedElementId = usePlayerStore((s) => s.selectedElementId);
|
|
45523
45622
|
const selectedElementHidden = isSelectedElementHidden(timelineElements, selectedElementId);
|
|
45524
45623
|
const visibilityToggleLabel = selectedElementHidden ? "Show element" : "Hide element";
|
|
45525
|
-
const liveTimeRef =
|
|
45624
|
+
const liveTimeRef = useRef75(storeTime);
|
|
45526
45625
|
const [, forceRender] = useState74(0);
|
|
45527
45626
|
useEffect64(() => {
|
|
45528
45627
|
if (!isPlaying) return;
|
|
@@ -45937,11 +46036,11 @@ var PropertyPanel = memo31(function PropertyPanel2(props) {
|
|
|
45937
46036
|
});
|
|
45938
46037
|
|
|
45939
46038
|
// src/components/editor/FileTree.tsx
|
|
45940
|
-
import { memo as memo33, useState as useState76, useCallback as useCallback58, useMemo as useMemo34, useRef as
|
|
46039
|
+
import { memo as memo33, useState as useState76, useCallback as useCallback58, useMemo as useMemo34, useRef as useRef77 } from "react";
|
|
45941
46040
|
import { Plus as Plus2, FolderSimplePlus as FolderSimplePlus2 } from "@phosphor-icons/react";
|
|
45942
46041
|
|
|
45943
46042
|
// src/components/editor/FileTreeNodes.tsx
|
|
45944
|
-
import { memo as memo32, useState as useState75, useCallback as useCallback57, useMemo as useMemo33, useRef as
|
|
46043
|
+
import { memo as memo32, useState as useState75, useCallback as useCallback57, useMemo as useMemo33, useRef as useRef76, useEffect as useEffect65 } from "react";
|
|
45945
46044
|
import {
|
|
45946
46045
|
PencilSimple,
|
|
45947
46046
|
Copy,
|
|
@@ -46056,7 +46155,7 @@ function ContextMenu({
|
|
|
46056
46155
|
onDuplicate,
|
|
46057
46156
|
onDelete
|
|
46058
46157
|
}) {
|
|
46059
|
-
const menuRef =
|
|
46158
|
+
const menuRef = useRef76(null);
|
|
46060
46159
|
useEffect65(() => {
|
|
46061
46160
|
const handleClickOutside = (e) => {
|
|
46062
46161
|
if (menuRef.current && !menuRef.current.contains(e.target)) {
|
|
@@ -46185,8 +46284,8 @@ function InlineInput({
|
|
|
46185
46284
|
onCommit,
|
|
46186
46285
|
onCancel
|
|
46187
46286
|
}) {
|
|
46188
|
-
const inputRef =
|
|
46189
|
-
const committedRef =
|
|
46287
|
+
const inputRef = useRef76(null);
|
|
46288
|
+
const committedRef = useRef76(false);
|
|
46190
46289
|
const [value, setValue] = useState75(defaultValue);
|
|
46191
46290
|
useEffect65(() => {
|
|
46192
46291
|
const el = inputRef.current;
|
|
@@ -46249,7 +46348,7 @@ function DeleteConfirm({
|
|
|
46249
46348
|
onConfirm,
|
|
46250
46349
|
onCancel
|
|
46251
46350
|
}) {
|
|
46252
|
-
const ref =
|
|
46351
|
+
const ref = useRef76(null);
|
|
46253
46352
|
useEffect65(() => {
|
|
46254
46353
|
const handleEscape = (e) => {
|
|
46255
46354
|
if (e.key === "Escape") onCancel();
|
|
@@ -46506,7 +46605,7 @@ var FileTree = memo33(function FileTree2({
|
|
|
46506
46605
|
const [inlineInput, setInlineInput] = useState76(null);
|
|
46507
46606
|
const [deleteTarget, setDeleteTarget] = useState76(null);
|
|
46508
46607
|
const [dragOverFolder, setDragOverFolder] = useState76(null);
|
|
46509
|
-
const dragSourceRef =
|
|
46608
|
+
const dragSourceRef = useRef77(null);
|
|
46510
46609
|
const hasFileOps = !!(onCreateFile || onCreateFolder || onDeleteFile || onRenameFile || onDuplicateFile);
|
|
46511
46610
|
const handleContextMenu = useCallback58(
|
|
46512
46611
|
(e, path, isFolder) => {
|
|
@@ -46742,10 +46841,10 @@ var FileTree = memo33(function FileTree2({
|
|
|
46742
46841
|
});
|
|
46743
46842
|
|
|
46744
46843
|
// src/App.tsx
|
|
46745
|
-
import { useState as useState132, useCallback as useCallback144, useRef as
|
|
46844
|
+
import { useState as useState132, useCallback as useCallback144, useRef as useRef135, useMemo as useMemo53, useEffect as useEffect116, useLayoutEffect as useLayoutEffect6 } from "react";
|
|
46746
46845
|
|
|
46747
46846
|
// src/components/renders/useRenderQueue.ts
|
|
46748
|
-
import { useState as useState77, useEffect as useEffect66, useCallback as useCallback59, useRef as
|
|
46847
|
+
import { useState as useState77, useEffect as useEffect66, useCallback as useCallback59, useRef as useRef78, useMemo as useMemo35 } from "react";
|
|
46749
46848
|
function hiddenIdsKey(projectId) {
|
|
46750
46849
|
return `hf-studio-hidden-renders:${projectId}`;
|
|
46751
46850
|
}
|
|
@@ -46768,8 +46867,8 @@ function useRenderQueue(projectId) {
|
|
|
46768
46867
|
const [jobs, setJobs] = useState77([]);
|
|
46769
46868
|
const [loadError, setLoadError] = useState77(null);
|
|
46770
46869
|
const [actionError, setActionError] = useState77(null);
|
|
46771
|
-
const eventSourceRef =
|
|
46772
|
-
const activeJobRef =
|
|
46870
|
+
const eventSourceRef = useRef78(null);
|
|
46871
|
+
const activeJobRef = useRef78(null);
|
|
46773
46872
|
const closeActiveEventSource = useCallback59((jobId) => {
|
|
46774
46873
|
if (jobId && activeJobRef.current !== jobId) return;
|
|
46775
46874
|
eventSourceRef.current?.close();
|
|
@@ -47018,11 +47117,11 @@ function useRenderQueue(projectId) {
|
|
|
47018
47117
|
}
|
|
47019
47118
|
|
|
47020
47119
|
// src/components/LintModal.tsx
|
|
47021
|
-
import { useRef as
|
|
47120
|
+
import { useRef as useRef80, useState as useState78 } from "react";
|
|
47022
47121
|
import { XIcon, WarningIcon, CheckCircleIcon, CaretRightIcon } from "@phosphor-icons/react";
|
|
47023
47122
|
|
|
47024
47123
|
// src/components/ui/useDialogBehavior.ts
|
|
47025
|
-
import { useEffect as useEffect67, useCallback as useCallback60, useRef as
|
|
47124
|
+
import { useEffect as useEffect67, useCallback as useCallback60, useRef as useRef79 } from "react";
|
|
47026
47125
|
var FOCUSABLE = 'button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), summary, [contenteditable="true"], [tabindex]:not([tabindex="-1"])';
|
|
47027
47126
|
function useDialogBehavior({
|
|
47028
47127
|
open,
|
|
@@ -47030,10 +47129,10 @@ function useDialogBehavior({
|
|
|
47030
47129
|
containerRef,
|
|
47031
47130
|
canClose
|
|
47032
47131
|
}) {
|
|
47033
|
-
const restoreRef =
|
|
47034
|
-
const canCloseRef =
|
|
47132
|
+
const restoreRef = useRef79(null);
|
|
47133
|
+
const canCloseRef = useRef79(canClose);
|
|
47035
47134
|
canCloseRef.current = canClose;
|
|
47036
|
-
const onCloseRef =
|
|
47135
|
+
const onCloseRef = useRef79(onClose);
|
|
47037
47136
|
onCloseRef.current = onClose;
|
|
47038
47137
|
const requestClose = useCallback60(() => {
|
|
47039
47138
|
const guard = canCloseRef.current;
|
|
@@ -47094,7 +47193,7 @@ function LintModal({
|
|
|
47094
47193
|
const hasIssues = findings.length > 0;
|
|
47095
47194
|
const [copied, setCopied] = useState78(false);
|
|
47096
47195
|
const [copyFailed, setCopyFailed] = useState78(false);
|
|
47097
|
-
const containerRef =
|
|
47196
|
+
const containerRef = useRef80(null);
|
|
47098
47197
|
const { requestClose } = useDialogBehavior({ open: true, onClose, containerRef });
|
|
47099
47198
|
const handleCopyToAgent = async () => {
|
|
47100
47199
|
const lines = findings.map((f) => {
|
|
@@ -47215,7 +47314,7 @@ ${pathLine}${lines.join("\n\n")}`;
|
|
|
47215
47314
|
}
|
|
47216
47315
|
|
|
47217
47316
|
// src/components/AskAgentModal.tsx
|
|
47218
|
-
import { useState as useState79, useRef as
|
|
47317
|
+
import { useState as useState79, useRef as useRef81 } from "react";
|
|
47219
47318
|
import { jsx as jsx128, jsxs as jsxs108 } from "react/jsx-runtime";
|
|
47220
47319
|
function getAgentModalPositionStyle(anchorPoint) {
|
|
47221
47320
|
if (!anchorPoint || typeof window === "undefined") return void 0;
|
|
@@ -47242,8 +47341,8 @@ function AskAgentModal({
|
|
|
47242
47341
|
onClose
|
|
47243
47342
|
}) {
|
|
47244
47343
|
const [value, setValue] = useState79("");
|
|
47245
|
-
const inputRef =
|
|
47246
|
-
const containerRef =
|
|
47344
|
+
const inputRef = useRef81(null);
|
|
47345
|
+
const containerRef = useRef81(null);
|
|
47247
47346
|
const modalPositionStyle = getAgentModalPositionStyle(anchorPoint);
|
|
47248
47347
|
const { requestClose } = useDialogBehavior({
|
|
47249
47348
|
open: true,
|
|
@@ -47522,7 +47621,7 @@ function SaveQueuePausedBanner({ message, onRetry }) {
|
|
|
47522
47621
|
}
|
|
47523
47622
|
|
|
47524
47623
|
// src/captions/hooks/useCaptionSync.ts
|
|
47525
|
-
import { useCallback as useCallback61, useRef as
|
|
47624
|
+
import { useCallback as useCallback61, useRef as useRef82 } from "react";
|
|
47526
47625
|
function buildOverrides(model) {
|
|
47527
47626
|
const entries = [];
|
|
47528
47627
|
let globalWordIndex = 0;
|
|
@@ -47553,10 +47652,10 @@ function buildOverrides(model) {
|
|
|
47553
47652
|
return entries;
|
|
47554
47653
|
}
|
|
47555
47654
|
function useCaptionSync(projectId) {
|
|
47556
|
-
const projectIdRef =
|
|
47655
|
+
const projectIdRef = useRef82(projectId);
|
|
47557
47656
|
projectIdRef.current = projectId;
|
|
47558
|
-
const debounceRef =
|
|
47559
|
-
const suppressSaveRef =
|
|
47657
|
+
const debounceRef = useRef82(null);
|
|
47658
|
+
const suppressSaveRef = useRef82(false);
|
|
47560
47659
|
const save = useCallback61(() => {
|
|
47561
47660
|
const state = useCaptionStore.getState();
|
|
47562
47661
|
if (!state.model || !state.sourceFilePath || !state.isEditMode) return;
|
|
@@ -47645,7 +47744,7 @@ function useCaptionSync(projectId) {
|
|
|
47645
47744
|
}
|
|
47646
47745
|
|
|
47647
47746
|
// src/hooks/usePersistentEditHistory.ts
|
|
47648
|
-
import { useCallback as useCallback62, useEffect as useEffect68, useMemo as useMemo36, useRef as
|
|
47747
|
+
import { useCallback as useCallback62, useEffect as useEffect68, useMemo as useMemo36, useRef as useRef83, useState as useState80 } from "react";
|
|
47649
47748
|
|
|
47650
47749
|
// src/utils/editHistory.ts
|
|
47651
47750
|
var DEFAULT_MAX_ENTRIES = 100;
|
|
@@ -48005,9 +48104,9 @@ function usePersistentEditHistory(options) {
|
|
|
48005
48104
|
const [state, setState] = useState80(() => createEmptyEditHistory());
|
|
48006
48105
|
const [loaded, setLoaded] = useState80(false);
|
|
48007
48106
|
const projectId = options.projectId;
|
|
48008
|
-
const storeRef =
|
|
48009
|
-
const storeProjectIdRef =
|
|
48010
|
-
const activeProjectIdRef =
|
|
48107
|
+
const storeRef = useRef83(null);
|
|
48108
|
+
const storeProjectIdRef = useRef83(null);
|
|
48109
|
+
const activeProjectIdRef = useRef83(projectId);
|
|
48011
48110
|
activeProjectIdRef.current = projectId;
|
|
48012
48111
|
useEffect68(() => {
|
|
48013
48112
|
let cancelled = false;
|
|
@@ -48092,7 +48191,7 @@ function usePersistentEditHistory(options) {
|
|
|
48092
48191
|
}
|
|
48093
48192
|
|
|
48094
48193
|
// src/hooks/usePanelLayout.ts
|
|
48095
|
-
import { useState as useState81, useCallback as useCallback63, useRef as
|
|
48194
|
+
import { useState as useState81, useCallback as useCallback63, useRef as useRef84 } from "react";
|
|
48096
48195
|
function getInitialRightInspectorPanes(tab) {
|
|
48097
48196
|
if (tab === "layers") return { layers: true, design: false };
|
|
48098
48197
|
return { layers: false, design: true };
|
|
@@ -48118,7 +48217,7 @@ function usePanelLayout(initialState2) {
|
|
|
48118
48217
|
const [initialPanelWidths] = useState81(getInitialPanelWidths);
|
|
48119
48218
|
const [leftWidth, setLeftWidth] = useState81(initialPanelWidths.left);
|
|
48120
48219
|
const [rightWidth, setRightWidth] = useState81(initialPanelWidths.right);
|
|
48121
|
-
const panelWidthsRef =
|
|
48220
|
+
const panelWidthsRef = useRef84(initialPanelWidths);
|
|
48122
48221
|
const [leftCollapsed, setLeftCollapsed] = useState81(
|
|
48123
48222
|
() => readStudioUiPreferences().leftCollapsed ?? false
|
|
48124
48223
|
);
|
|
@@ -48129,7 +48228,7 @@ function usePanelLayout(initialState2) {
|
|
|
48129
48228
|
const [rightInspectorPanes, setRightInspectorPanes] = useState81(
|
|
48130
48229
|
() => getInitialRightInspectorPanes(initialState2?.rightPanelTab)
|
|
48131
48230
|
);
|
|
48132
|
-
const panelDragRef =
|
|
48231
|
+
const panelDragRef = useRef84(null);
|
|
48133
48232
|
const updatePanelWidth = useCallback63((side, width) => {
|
|
48134
48233
|
const next = clampPanelWidth(side, width);
|
|
48135
48234
|
panelWidthsRef.current[side] = next;
|
|
@@ -48223,7 +48322,7 @@ function usePanelLayout(initialState2) {
|
|
|
48223
48322
|
}
|
|
48224
48323
|
|
|
48225
48324
|
// src/hooks/useFileManager.ts
|
|
48226
|
-
import { useState as useState83, useCallback as useCallback66, useMemo as useMemo38, useRef as
|
|
48325
|
+
import { useState as useState83, useCallback as useCallback66, useMemo as useMemo38, useRef as useRef86 } from "react";
|
|
48227
48326
|
|
|
48228
48327
|
// src/utils/studioFileVersion.ts
|
|
48229
48328
|
async function studioFileContentVersion(content) {
|
|
@@ -48302,7 +48401,7 @@ function useFileTree({ projectId, projectIdRef }) {
|
|
|
48302
48401
|
}
|
|
48303
48402
|
|
|
48304
48403
|
// src/hooks/useEditorSave.ts
|
|
48305
|
-
import { useCallback as useCallback65, useRef as
|
|
48404
|
+
import { useCallback as useCallback65, useRef as useRef85 } from "react";
|
|
48306
48405
|
function useEditorSave({
|
|
48307
48406
|
editingPathRef,
|
|
48308
48407
|
projectIdRef,
|
|
@@ -48313,9 +48412,9 @@ function useEditorSave({
|
|
|
48313
48412
|
setRefreshKey,
|
|
48314
48413
|
showToast
|
|
48315
48414
|
}) {
|
|
48316
|
-
const saveRafRef =
|
|
48317
|
-
const refreshRafRef =
|
|
48318
|
-
const lastFailureToastAtRef =
|
|
48415
|
+
const saveRafRef = useRef85(null);
|
|
48416
|
+
const refreshRafRef = useRef85(null);
|
|
48417
|
+
const lastFailureToastAtRef = useRef85(0);
|
|
48319
48418
|
const handleContentChange = useCallback65(
|
|
48320
48419
|
(content) => {
|
|
48321
48420
|
const pid = projectIdRef.current;
|
|
@@ -48380,11 +48479,11 @@ function useFileManager({
|
|
|
48380
48479
|
}) {
|
|
48381
48480
|
const [editingFile, setEditingFile] = useState83(null);
|
|
48382
48481
|
const [revealSourceOffset, setRevealSourceOffset] = useState83(null);
|
|
48383
|
-
const editingPathRef =
|
|
48482
|
+
const editingPathRef = useRef86(editingFile?.path);
|
|
48384
48483
|
editingPathRef.current = editingFile?.path;
|
|
48385
|
-
const projectIdRef =
|
|
48484
|
+
const projectIdRef = useRef86(projectId);
|
|
48386
48485
|
projectIdRef.current = projectId;
|
|
48387
|
-
const importedFontAssetsRef =
|
|
48486
|
+
const importedFontAssetsRef = useRef86([]);
|
|
48388
48487
|
const fileVersionScope = useMemo38(
|
|
48389
48488
|
() => ({ projectId, versions: /* @__PURE__ */ new Map() }),
|
|
48390
48489
|
[projectId]
|
|
@@ -48519,8 +48618,8 @@ function useFileManager({
|
|
|
48519
48618
|
setRefreshKey,
|
|
48520
48619
|
showToast
|
|
48521
48620
|
});
|
|
48522
|
-
const revealRequestIdRef =
|
|
48523
|
-
const revealAbortRef =
|
|
48621
|
+
const revealRequestIdRef = useRef86(0);
|
|
48622
|
+
const revealAbortRef = useRef86(null);
|
|
48524
48623
|
const handleFileSelect = useCallback66(
|
|
48525
48624
|
(path) => {
|
|
48526
48625
|
const pid = projectIdRef.current;
|
|
@@ -48804,7 +48903,7 @@ function useFileManager({
|
|
|
48804
48903
|
}
|
|
48805
48904
|
|
|
48806
48905
|
// src/hooks/usePreviewPersistence.ts
|
|
48807
|
-
import { useCallback as useCallback67, useRef as
|
|
48906
|
+
import { useCallback as useCallback67, useRef as useRef87, useState as useState84 } from "react";
|
|
48808
48907
|
|
|
48809
48908
|
// src/utils/domEditSaveQueue.ts
|
|
48810
48909
|
var DEFAULT_FAILURE_THRESHOLD = 5;
|
|
@@ -49073,11 +49172,11 @@ function usePreviewPersistence({
|
|
|
49073
49172
|
}) {
|
|
49074
49173
|
void _recordEdit;
|
|
49075
49174
|
const [domEditSaveQueuePaused, setDomEditSaveQueuePaused] = useState84(null);
|
|
49076
|
-
const domTextCommitVersionRef =
|
|
49077
|
-
const showToastRef =
|
|
49175
|
+
const domTextCommitVersionRef = useRef87(0);
|
|
49176
|
+
const showToastRef = useRef87(showToast);
|
|
49078
49177
|
showToastRef.current = showToast;
|
|
49079
|
-
const domEditSaveQueueRef =
|
|
49080
|
-
const applyStudioManualEditsToPreviewRef =
|
|
49178
|
+
const domEditSaveQueueRef = useRef87(null);
|
|
49179
|
+
const applyStudioManualEditsToPreviewRef = useRef87(async () => {
|
|
49081
49180
|
});
|
|
49082
49181
|
if (!domEditSaveQueueRef.current) {
|
|
49083
49182
|
domEditSaveQueueRef.current = createDomEditSaveQueue({
|
|
@@ -49097,7 +49196,7 @@ function usePreviewPersistence({
|
|
|
49097
49196
|
}
|
|
49098
49197
|
});
|
|
49099
49198
|
}
|
|
49100
|
-
const projectIdRef =
|
|
49199
|
+
const projectIdRef = useRef87(projectId);
|
|
49101
49200
|
projectIdRef.current = projectId;
|
|
49102
49201
|
const queueDomEditSave = useCallback67((save) => {
|
|
49103
49202
|
return domEditSaveQueueRef.current?.enqueue(save) ?? save();
|
|
@@ -49182,10 +49281,10 @@ function usePreviewPersistence({
|
|
|
49182
49281
|
}
|
|
49183
49282
|
|
|
49184
49283
|
// src/hooks/usePreviewDocumentVersion.ts
|
|
49185
|
-
import { useCallback as useCallback68, useEffect as useEffect70, useRef as
|
|
49284
|
+
import { useCallback as useCallback68, useEffect as useEffect70, useRef as useRef88, useState as useState85 } from "react";
|
|
49186
49285
|
function usePreviewDocumentVersion() {
|
|
49187
49286
|
const [previewDocumentVersion, setPreviewDocumentVersion] = useState85(0);
|
|
49188
|
-
const refreshTimersRef =
|
|
49287
|
+
const refreshTimersRef = useRef88([]);
|
|
49189
49288
|
const refresh = useCallback68(() => {
|
|
49190
49289
|
for (const id of refreshTimersRef.current) clearTimeout(id);
|
|
49191
49290
|
refreshTimersRef.current = [];
|
|
@@ -49205,10 +49304,10 @@ function usePreviewDocumentVersion() {
|
|
|
49205
49304
|
}
|
|
49206
49305
|
|
|
49207
49306
|
// src/hooks/useTimelineEditing.ts
|
|
49208
|
-
import { useCallback as useCallback73, useRef as
|
|
49307
|
+
import { useCallback as useCallback73, useRef as useRef90 } from "react";
|
|
49209
49308
|
|
|
49210
49309
|
// src/hooks/useRazorSplit.ts
|
|
49211
|
-
import { useCallback as useCallback69, useRef as
|
|
49310
|
+
import { useCallback as useCallback69, useRef as useRef89 } from "react";
|
|
49212
49311
|
|
|
49213
49312
|
// src/utils/projectRouting.ts
|
|
49214
49313
|
var PROJECT_HASH_PREFIX = "#project/";
|
|
@@ -49386,7 +49485,7 @@ function useRazorSplit({
|
|
|
49386
49485
|
forceReloadSdkSession,
|
|
49387
49486
|
isRecordingRef
|
|
49388
49487
|
}) {
|
|
49389
|
-
const projectIdRef =
|
|
49488
|
+
const projectIdRef = useRef89(projectId);
|
|
49390
49489
|
projectIdRef.current = projectId;
|
|
49391
49490
|
const synchronize = useCallback69(() => {
|
|
49392
49491
|
let failure;
|
|
@@ -50318,10 +50417,10 @@ function useTimelineEditing({
|
|
|
50318
50417
|
invalidateGsapCache,
|
|
50319
50418
|
handleDomZIndexReorderCommitRef
|
|
50320
50419
|
}) {
|
|
50321
|
-
const projectIdRef =
|
|
50420
|
+
const projectIdRef = useRef90(projectId);
|
|
50322
50421
|
projectIdRef.current = projectId;
|
|
50323
|
-
const editQueueRef =
|
|
50324
|
-
const lastBlockedTimelineToastAtRef =
|
|
50422
|
+
const editQueueRef = useRef90(Promise.resolve());
|
|
50423
|
+
const lastBlockedTimelineToastAtRef = useRef90(0);
|
|
50325
50424
|
const enqueueEdit = useCallback73(
|
|
50326
50425
|
(element, label, buildPatches, coalesceKey) => {
|
|
50327
50426
|
if (isRecordingRef?.current) {
|
|
@@ -50740,7 +50839,7 @@ function persistTimelineMoveEditsAtomically(edits, coalesceKey, operation, deps,
|
|
|
50740
50839
|
import { useCallback as useCallback96 } from "react";
|
|
50741
50840
|
|
|
50742
50841
|
// src/hooks/useAskAgentModal.ts
|
|
50743
|
-
import { useState as useState86, useCallback as useCallback74, useRef as
|
|
50842
|
+
import { useState as useState86, useCallback as useCallback74, useRef as useRef91, useEffect as useEffect71 } from "react";
|
|
50744
50843
|
function useAskAgentModal({
|
|
50745
50844
|
activeCompPath,
|
|
50746
50845
|
projectDir,
|
|
@@ -50756,7 +50855,7 @@ function useAskAgentModal({
|
|
|
50756
50855
|
);
|
|
50757
50856
|
const [copiedAgentPrompt, setCopiedAgentPrompt] = useState86(false);
|
|
50758
50857
|
const [agentModalOpen, setAgentModalOpen] = useState86(false);
|
|
50759
|
-
const copiedAgentTimerRef =
|
|
50858
|
+
const copiedAgentTimerRef = useRef91(null);
|
|
50760
50859
|
const preloadAgentPromptSnippet = useCallback74(
|
|
50761
50860
|
async (selection) => {
|
|
50762
50861
|
const pid = projectIdRef.current;
|
|
@@ -50851,7 +50950,7 @@ function useAskAgentModal({
|
|
|
50851
50950
|
}
|
|
50852
50951
|
|
|
50853
50952
|
// src/hooks/useDomSelection.ts
|
|
50854
|
-
import { useState as useState87, useCallback as useCallback75, useRef as
|
|
50953
|
+
import { useState as useState87, useCallback as useCallback75, useRef as useRef92, useEffect as useEffect73 } from "react";
|
|
50855
50954
|
|
|
50856
50955
|
// src/utils/domEditHelpers.ts
|
|
50857
50956
|
function domEditSelectionsTargetSame(a, b) {
|
|
@@ -50935,14 +51034,14 @@ function useDomSelection({
|
|
|
50935
51034
|
const [domEditGroupSelections, setDomEditGroupSelections] = useState87([]);
|
|
50936
51035
|
const [domEditHoverSelection, setDomEditHoverSelection] = useState87(null);
|
|
50937
51036
|
const [activeGroupElement, setActiveGroupElementState] = useState87(null);
|
|
50938
|
-
const rightPanelTabRef =
|
|
51037
|
+
const rightPanelTabRef = useRef92(rightPanelTab);
|
|
50939
51038
|
rightPanelTabRef.current = rightPanelTab;
|
|
50940
|
-
const domEditSelectionRef =
|
|
50941
|
-
const domEditGroupSelectionsRef =
|
|
50942
|
-
const domEditHoverSelectionRef =
|
|
50943
|
-
const activeGroupElementRef =
|
|
50944
|
-
const compositionIdentityRef =
|
|
50945
|
-
const timelineSelectSeqRef =
|
|
51039
|
+
const domEditSelectionRef = useRef92(domEditSelection);
|
|
51040
|
+
const domEditGroupSelectionsRef = useRef92(domEditGroupSelections);
|
|
51041
|
+
const domEditHoverSelectionRef = useRef92(domEditHoverSelection);
|
|
51042
|
+
const activeGroupElementRef = useRef92(activeGroupElement);
|
|
51043
|
+
const compositionIdentityRef = useRef92({ activeCompPath, projectId });
|
|
51044
|
+
const timelineSelectSeqRef = useRef92(0);
|
|
50946
51045
|
domEditSelectionRef.current = domEditSelection;
|
|
50947
51046
|
domEditGroupSelectionsRef.current = domEditGroupSelections;
|
|
50948
51047
|
domEditHoverSelectionRef.current = domEditHoverSelection;
|
|
@@ -51263,7 +51362,7 @@ function useDomSelection({
|
|
|
51263
51362
|
}
|
|
51264
51363
|
|
|
51265
51364
|
// src/hooks/usePreviewInteraction.ts
|
|
51266
|
-
import { useCallback as useCallback76, useRef as
|
|
51365
|
+
import { useCallback as useCallback76, useRef as useRef93 } from "react";
|
|
51267
51366
|
var CYCLE_RADIUS_PX = 6;
|
|
51268
51367
|
var CYCLE_WINDOW_MS = 600;
|
|
51269
51368
|
var DOUBLE_CLICK_MS = 400;
|
|
@@ -51280,8 +51379,8 @@ function usePreviewInteraction({
|
|
|
51280
51379
|
setActiveGroupElement,
|
|
51281
51380
|
onClickToSource
|
|
51282
51381
|
}) {
|
|
51283
|
-
const cycleRef =
|
|
51284
|
-
const lastDownRef =
|
|
51382
|
+
const cycleRef = useRef93(null);
|
|
51383
|
+
const lastDownRef = useRef93(null);
|
|
51285
51384
|
const pausePreviewPlayback = useCallback76(() => {
|
|
51286
51385
|
const pausedTime = pauseStudioPreviewPlayback(previewIframeRef.current);
|
|
51287
51386
|
const playerStore = usePlayerStore.getState();
|
|
@@ -51439,7 +51538,7 @@ function usePreviewInteraction({
|
|
|
51439
51538
|
}
|
|
51440
51539
|
|
|
51441
51540
|
// src/hooks/useDomEditCommits.ts
|
|
51442
|
-
import { useCallback as useCallback81, useRef as
|
|
51541
|
+
import { useCallback as useCallback81, useRef as useRef96 } from "react";
|
|
51443
51542
|
import { findUnsafeDomPatchValues as findUnsafeDomPatchValues2 } from "@hyperframes/core/studio-api/finite-mutation";
|
|
51444
51543
|
|
|
51445
51544
|
// src/utils/studioFontHelpers.ts
|
|
@@ -51609,7 +51708,7 @@ function useDomEditPositionPatchCommit({
|
|
|
51609
51708
|
}
|
|
51610
51709
|
|
|
51611
51710
|
// src/hooks/useDomEditTextCommits.ts
|
|
51612
|
-
import { useCallback as useCallback79, useRef as
|
|
51711
|
+
import { useCallback as useCallback79, useRef as useRef95 } from "react";
|
|
51613
51712
|
|
|
51614
51713
|
// src/hooks/domEditTextFieldCommitOps.ts
|
|
51615
51714
|
function hasSameKeysInSamePositions(originalFields, nextFields) {
|
|
@@ -51651,7 +51750,7 @@ function buildTextFieldChildOperations(originalFields, nextFields) {
|
|
|
51651
51750
|
}
|
|
51652
51751
|
|
|
51653
51752
|
// src/hooks/useDomEditAttributeCommits.ts
|
|
51654
|
-
import { useCallback as useCallback78, useRef as
|
|
51753
|
+
import { useCallback as useCallback78, useRef as useRef94 } from "react";
|
|
51655
51754
|
function resolveFullAttrName(attr, prefixData) {
|
|
51656
51755
|
return prefixData && !attr.startsWith("data-") ? `data-${attr}` : attr;
|
|
51657
51756
|
}
|
|
@@ -51687,7 +51786,7 @@ function useDomEditAttributeCommits({
|
|
|
51687
51786
|
refreshDomEditSelectionFromPreview,
|
|
51688
51787
|
persistDomEditOperations
|
|
51689
51788
|
}) {
|
|
51690
|
-
const domAttributeCommitVersionRef =
|
|
51789
|
+
const domAttributeCommitVersionRef = useRef94(/* @__PURE__ */ new Map());
|
|
51691
51790
|
const commitDataAttribute = useCallback78(
|
|
51692
51791
|
async (attr, value, options) => {
|
|
51693
51792
|
if (!domEditSelection) return;
|
|
@@ -51951,8 +52050,8 @@ function useDomEditTextCommits({
|
|
|
51951
52050
|
persistDomEditOperations,
|
|
51952
52051
|
resolveImportedFontAsset
|
|
51953
52052
|
}) {
|
|
51954
|
-
const domTextCommitVersionRef =
|
|
51955
|
-
const domStyleCommitVersionRef =
|
|
52053
|
+
const domTextCommitVersionRef = useRef95(0);
|
|
52054
|
+
const domStyleCommitVersionRef = useRef95(/* @__PURE__ */ new Map());
|
|
51956
52055
|
const {
|
|
51957
52056
|
handleDomAttributeCommit,
|
|
51958
52057
|
handleDomAttributeLiveCommit,
|
|
@@ -52769,7 +52868,7 @@ function useDomEditCommits({
|
|
|
52769
52868
|
},
|
|
52770
52869
|
[fileTree, projectId, importedFontAssetsRef]
|
|
52771
52870
|
);
|
|
52772
|
-
const reportedUnresolvableRef =
|
|
52871
|
+
const reportedUnresolvableRef = useRef96(/* @__PURE__ */ new Set());
|
|
52773
52872
|
const persistDomEditOperations = useCallback81(
|
|
52774
52873
|
// fallow-ignore-next-line complexity
|
|
52775
52874
|
async (selection, operations, options) => {
|
|
@@ -53126,7 +53225,7 @@ function useGroupCommits(params) {
|
|
|
53126
53225
|
}
|
|
53127
53226
|
|
|
53128
53227
|
// src/hooks/useGsapScriptCommits.ts
|
|
53129
|
-
import { useCallback as useCallback88, useMemo as useMemo39, useRef as
|
|
53228
|
+
import { useCallback as useCallback88, useMemo as useMemo39, useRef as useRef98 } from "react";
|
|
53130
53229
|
import { findUnsafeMutationValues } from "@hyperframes/core/studio-api/finite-mutation";
|
|
53131
53230
|
|
|
53132
53231
|
// src/hooks/gsapRuntimePatch.ts
|
|
@@ -53908,7 +54007,7 @@ function useGsapKeyframeOps({
|
|
|
53908
54007
|
}
|
|
53909
54008
|
|
|
53910
54009
|
// src/hooks/useGsapPropertyDebounce.ts
|
|
53911
|
-
import { useCallback as useCallback86, useEffect as useEffect74, useRef as
|
|
54010
|
+
import { useCallback as useCallback86, useEffect as useEffect74, useRef as useRef97 } from "react";
|
|
53912
54011
|
import { parseGsapScriptAcorn } from "@hyperframes/core/gsap-parser-acorn";
|
|
53913
54012
|
var DEBOUNCE_MS = 150;
|
|
53914
54013
|
function mergeTweenProperties(sdkSession, animationId, edited, kind) {
|
|
@@ -53924,9 +54023,9 @@ function mergeTweenProperties(sdkSession, animationId, edited, kind) {
|
|
|
53924
54023
|
}
|
|
53925
54024
|
}
|
|
53926
54025
|
function useGsapPropertyDebounce(commitMutationSafely, sdk) {
|
|
53927
|
-
const pendingPropertyEditRef =
|
|
53928
|
-
const debounceTimerRef =
|
|
53929
|
-
const sdkRef =
|
|
54026
|
+
const pendingPropertyEditRef = useRef97(null);
|
|
54027
|
+
const debounceTimerRef = useRef97(null);
|
|
54028
|
+
const sdkRef = useRef97(sdk);
|
|
53930
54029
|
sdkRef.current = sdk;
|
|
53931
54030
|
const flushPendingPropertyEdit = useCallback86(async () => {
|
|
53932
54031
|
const pending = pendingPropertyEditRef.current;
|
|
@@ -54335,9 +54434,9 @@ function applyPreviewSync(iframe, result, options, reloadPreview) {
|
|
|
54335
54434
|
}
|
|
54336
54435
|
function useGsapScriptCommits({ projectIdRef, activeCompPath, previewIframeRef, editHistory, domEditSaveTimestampRef, reloadPreview, onCacheInvalidate, onFileContentChanged, showToast, sdkSession, publishSdkSession, writeProjectFile, forceReloadSdkSession }) {
|
|
54337
54436
|
const activeProjectId = projectIdRef.current;
|
|
54338
|
-
const activeCompPathRef =
|
|
54437
|
+
const activeCompPathRef = useRef98(activeCompPath);
|
|
54339
54438
|
activeCompPathRef.current = activeCompPath;
|
|
54340
|
-
const serializerRef =
|
|
54439
|
+
const serializerRef = useRef98(createKeyedSerializer());
|
|
54341
54440
|
const recordMutationEdit = useCallback88(async (targetPath, result, options) => {
|
|
54342
54441
|
if (result.before == null || result.after == null) return;
|
|
54343
54442
|
await editHistory.recordEdit({
|
|
@@ -54519,10 +54618,10 @@ function useGsapScriptCommits({ projectIdRef, activeCompPath, previewIframeRef,
|
|
|
54519
54618
|
}
|
|
54520
54619
|
|
|
54521
54620
|
// src/hooks/useDomEditWiring.ts
|
|
54522
|
-
import { useCallback as useCallback92, useEffect as useEffect76, useRef as
|
|
54621
|
+
import { useCallback as useCallback92, useEffect as useEffect76, useRef as useRef101 } from "react";
|
|
54523
54622
|
|
|
54524
54623
|
// src/hooks/useDomEditPreviewSync.ts
|
|
54525
|
-
import { useEffect as useEffect75, useRef as
|
|
54624
|
+
import { useEffect as useEffect75, useRef as useRef99 } from "react";
|
|
54526
54625
|
function useDomEditPreviewSync({
|
|
54527
54626
|
previewIframe,
|
|
54528
54627
|
activeCompPath,
|
|
@@ -54588,7 +54687,7 @@ function useDomEditPreviewSync({
|
|
|
54588
54687
|
applyStudioManualEditsToPreviewRef,
|
|
54589
54688
|
gsapCacheVersion
|
|
54590
54689
|
]);
|
|
54591
|
-
const openSourceRef =
|
|
54690
|
+
const openSourceRef = useRef99(openSourceForSelection);
|
|
54592
54691
|
openSourceRef.current = openSourceForSelection;
|
|
54593
54692
|
useEffect75(
|
|
54594
54693
|
// fallow-ignore-next-line complexity
|
|
@@ -54666,7 +54765,7 @@ function useGsapInteractionFailureTelemetry(activeCompPath, showToast) {
|
|
|
54666
54765
|
}
|
|
54667
54766
|
|
|
54668
54767
|
// src/hooks/useGsapSelectionHandlers.ts
|
|
54669
|
-
import { useCallback as useCallback91, useRef as
|
|
54768
|
+
import { useCallback as useCallback91, useRef as useRef100 } from "react";
|
|
54670
54769
|
function useGsapSelectionHandlers({
|
|
54671
54770
|
domEditSelection,
|
|
54672
54771
|
updateGsapProperty,
|
|
@@ -54690,7 +54789,7 @@ function useGsapSelectionHandlers({
|
|
|
54690
54789
|
selectedGsapAnimations,
|
|
54691
54790
|
showToast
|
|
54692
54791
|
}) {
|
|
54693
|
-
const lastSelectionRef =
|
|
54792
|
+
const lastSelectionRef = useRef100(null);
|
|
54694
54793
|
if (domEditSelection) lastSelectionRef.current = domEditSelection;
|
|
54695
54794
|
const resolveWriteSelection = useCallback91(
|
|
54696
54795
|
(selectionOverride) => selectionOverride === void 0 ? domEditSelection ?? lastSelectionRef.current : selectionOverride,
|
|
@@ -55022,7 +55121,7 @@ function useDomEditWiring({
|
|
|
55022
55121
|
const key = matchKey ? matchKey.key ?? matchKey.id : null;
|
|
55023
55122
|
if (key && key !== selectedElementId) setSelectedElementId(key);
|
|
55024
55123
|
}, [domEditSelection?.id]);
|
|
55025
|
-
const prevRefreshKeyRef =
|
|
55124
|
+
const prevRefreshKeyRef = useRef101(refreshKey);
|
|
55026
55125
|
useEffect76(() => {
|
|
55027
55126
|
if (refreshKey !== prevRefreshKeyRef.current) {
|
|
55028
55127
|
prevRefreshKeyRef.current = refreshKey;
|
|
@@ -55931,7 +56030,7 @@ function useGsapAwareEditing({
|
|
|
55931
56030
|
}
|
|
55932
56031
|
|
|
55933
56032
|
// src/hooks/useStudioSelectionPublisher.ts
|
|
55934
|
-
import { useEffect as useEffect77, useRef as
|
|
56033
|
+
import { useEffect as useEffect77, useRef as useRef102 } from "react";
|
|
55935
56034
|
|
|
55936
56035
|
// src/utils/studioSelectionSnapshot.ts
|
|
55937
56036
|
function round34(value) {
|
|
@@ -56021,8 +56120,8 @@ function useStudioSelectionPublisher({
|
|
|
56021
56120
|
previewDocumentVersion,
|
|
56022
56121
|
refreshDomEditSelectionFromPreview
|
|
56023
56122
|
}) {
|
|
56024
|
-
const lastSelectionRefreshKeyRef =
|
|
56025
|
-
const pendingSelectionRefreshKeyRef =
|
|
56123
|
+
const lastSelectionRefreshKeyRef = useRef102(refreshKey);
|
|
56124
|
+
const pendingSelectionRefreshKeyRef = useRef102(null);
|
|
56026
56125
|
useEffect77(() => {
|
|
56027
56126
|
if (!projectId) return;
|
|
56028
56127
|
const selection = domEditSelection?.element.isConnected ? buildStudioSelectionSnapshot({
|
|
@@ -56582,7 +56681,7 @@ function useSdkSelectionSync(session, domEditSelection, domEditGroupSelections)
|
|
|
56582
56681
|
import { useEffect as useEffect80 } from "react";
|
|
56583
56682
|
|
|
56584
56683
|
// src/hooks/useSdkSession.ts
|
|
56585
|
-
import { useState as useState88, useEffect as useEffect79, useCallback as useCallback97, useRef as
|
|
56684
|
+
import { useState as useState88, useEffect as useEffect79, useCallback as useCallback97, useRef as useRef103 } from "react";
|
|
56586
56685
|
import { openComposition as openComposition3 } from "@hyperframes/sdk";
|
|
56587
56686
|
async function readProjectFileOptional(projectId, path) {
|
|
56588
56687
|
if (path.includes("\0") || path.includes("..")) return void 0;
|
|
@@ -56631,15 +56730,15 @@ function disposeSdkSession(session) {
|
|
|
56631
56730
|
}
|
|
56632
56731
|
function useSdkSession(projectId, activeCompPath, domEditSaveTimestampRef) {
|
|
56633
56732
|
const [ownedSession, setOwnedSession] = useState88(null);
|
|
56634
|
-
const ownedSessionRef =
|
|
56635
|
-
const sessionOwnersRef =
|
|
56636
|
-
const generationRef =
|
|
56637
|
-
const projectIdRef =
|
|
56733
|
+
const ownedSessionRef = useRef103(null);
|
|
56734
|
+
const sessionOwnersRef = useRef103(/* @__PURE__ */ new WeakMap());
|
|
56735
|
+
const generationRef = useRef103(0);
|
|
56736
|
+
const projectIdRef = useRef103(projectId);
|
|
56638
56737
|
projectIdRef.current = projectId;
|
|
56639
|
-
const activeCompPathRef =
|
|
56738
|
+
const activeCompPathRef = useRef103(activeCompPath);
|
|
56640
56739
|
activeCompPathRef.current = activeCompPath;
|
|
56641
56740
|
const [reloadToken, setReloadToken] = useState88(0);
|
|
56642
|
-
const reloadTokenRef =
|
|
56741
|
+
const reloadTokenRef = useRef103(reloadToken);
|
|
56643
56742
|
reloadTokenRef.current = reloadToken;
|
|
56644
56743
|
useEffect79(() => {
|
|
56645
56744
|
if (!activeCompPath) return;
|
|
@@ -56761,7 +56860,7 @@ function useStudioSdkSessions(projectId, activeCompPath, domEditSaveTimestampRef
|
|
|
56761
56860
|
}
|
|
56762
56861
|
|
|
56763
56862
|
// src/hooks/useBlockHandlers.ts
|
|
56764
|
-
import { useCallback as useCallback98, useMemo as useMemo40, useRef as
|
|
56863
|
+
import { useCallback as useCallback98, useMemo as useMemo40, useRef as useRef104, useState as useState89 } from "react";
|
|
56765
56864
|
|
|
56766
56865
|
// src/utils/blockInstaller.ts
|
|
56767
56866
|
function getMaxZIndexFromIframe(iframe) {
|
|
@@ -56970,7 +57069,7 @@ function useBlockHandlers({
|
|
|
56970
57069
|
blockCtxDeps.showToast
|
|
56971
57070
|
]
|
|
56972
57071
|
);
|
|
56973
|
-
const installingBlockRef =
|
|
57072
|
+
const installingBlockRef = useRef104(false);
|
|
56974
57073
|
const runBlockInstall = useCallback98(
|
|
56975
57074
|
async (blockName, install) => {
|
|
56976
57075
|
if (installingBlockRef.current) {
|
|
@@ -57081,7 +57180,7 @@ function useBlockHandlers({
|
|
|
57081
57180
|
}
|
|
57082
57181
|
|
|
57083
57182
|
// src/hooks/useAppHotkeys.ts
|
|
57084
|
-
import { useCallback as useCallback99, useEffect as useEffect81, useRef as
|
|
57183
|
+
import { useCallback as useCallback99, useEffect as useEffect81, useRef as useRef105 } from "react";
|
|
57085
57184
|
function iframeContentWindow(iframe) {
|
|
57086
57185
|
try {
|
|
57087
57186
|
return iframe?.contentWindow ?? null;
|
|
@@ -57289,8 +57388,8 @@ function useAppHotkeys({
|
|
|
57289
57388
|
activeCompPath,
|
|
57290
57389
|
forceReloadSdkSession
|
|
57291
57390
|
}) {
|
|
57292
|
-
const previewHotkeyWindowRef =
|
|
57293
|
-
const previewHistoryCleanupRef =
|
|
57391
|
+
const previewHotkeyWindowRef = useRef105(null);
|
|
57392
|
+
const previewHistoryCleanupRef = useRef105(null);
|
|
57294
57393
|
const readHistoryFile = useCallback99(
|
|
57295
57394
|
(path) => path === STUDIO_MOTION_PATH ? readOptionalProjectFile(path) : readProjectFile(path),
|
|
57296
57395
|
[readOptionalProjectFile, readProjectFile]
|
|
@@ -57346,7 +57445,7 @@ function useAppHotkeys({
|
|
|
57346
57445
|
);
|
|
57347
57446
|
const handleUndo = useCallback99(() => applyHistory("undo"), [applyHistory]);
|
|
57348
57447
|
const handleRedo = useCallback99(() => applyHistory("redo"), [applyHistory]);
|
|
57349
|
-
const cbRef =
|
|
57448
|
+
const cbRef = useRef105(null);
|
|
57350
57449
|
cbRef.current = {
|
|
57351
57450
|
handleTimelineElementDelete,
|
|
57352
57451
|
handleTimelineElementSplit,
|
|
@@ -57449,7 +57548,7 @@ function useAppHotkeys({
|
|
|
57449
57548
|
}
|
|
57450
57549
|
|
|
57451
57550
|
// src/hooks/useClipboard.ts
|
|
57452
|
-
import { useCallback as useCallback100, useRef as
|
|
57551
|
+
import { useCallback as useCallback100, useRef as useRef106 } from "react";
|
|
57453
57552
|
|
|
57454
57553
|
// src/utils/clipboardPayload.ts
|
|
57455
57554
|
function insertAsSibling(source, newHtml, selector, selectorIndex) {
|
|
@@ -57556,8 +57655,8 @@ function useClipboard({
|
|
|
57556
57655
|
handleDomEditElementDelete,
|
|
57557
57656
|
previewIframeRef
|
|
57558
57657
|
}) {
|
|
57559
|
-
const clipboardRef =
|
|
57560
|
-
const projectIdRef =
|
|
57658
|
+
const clipboardRef = useRef106(null);
|
|
57659
|
+
const projectIdRef = useRef106(projectId);
|
|
57561
57660
|
projectIdRef.current = projectId;
|
|
57562
57661
|
const handleCopy = useCallback100(() => {
|
|
57563
57662
|
const { selectedElementId, elements } = usePlayerStore.getState();
|
|
@@ -58035,7 +58134,7 @@ import { useCallback as useCallback103 } from "react";
|
|
|
58035
58134
|
import { createElement as createElement4 } from "react";
|
|
58036
58135
|
|
|
58037
58136
|
// src/player/components/AudioWaveform.tsx
|
|
58038
|
-
import { memo as memo34, useRef as
|
|
58137
|
+
import { memo as memo34, useRef as useRef107, useState as useState90, useCallback as useCallback101, useEffect as useEffect83 } from "react";
|
|
58039
58138
|
import { jsx as jsx133, jsxs as jsxs113 } from "react/jsx-runtime";
|
|
58040
58139
|
var BAR_W = 2;
|
|
58041
58140
|
var GAP = 1;
|
|
@@ -58083,9 +58182,9 @@ var AudioWaveform = memo34(function AudioWaveform2({
|
|
|
58083
58182
|
trimStartFraction,
|
|
58084
58183
|
trimEndFraction
|
|
58085
58184
|
}) {
|
|
58086
|
-
const containerRef =
|
|
58087
|
-
const barsRef =
|
|
58088
|
-
const roRef =
|
|
58185
|
+
const containerRef = useRef107(null);
|
|
58186
|
+
const barsRef = useRef107(null);
|
|
58187
|
+
const roRef = useRef107(null);
|
|
58089
58188
|
const cacheKey = waveformUrl ?? audioUrl;
|
|
58090
58189
|
const [peaks, setPeaks] = useState90(peaksCache.get(cacheKey) ?? null);
|
|
58091
58190
|
useEffect83(() => {
|
|
@@ -58177,7 +58276,7 @@ var AudioWaveform = memo34(function AudioWaveform2({
|
|
|
58177
58276
|
});
|
|
58178
58277
|
|
|
58179
58278
|
// src/player/components/ImageThumbnail.tsx
|
|
58180
|
-
import { memo as memo35, useRef as
|
|
58279
|
+
import { memo as memo35, useRef as useRef108, useState as useState91, useCallback as useCallback102, useEffect as useEffect84 } from "react";
|
|
58181
58280
|
import { jsx as jsx134, jsxs as jsxs114 } from "react/jsx-runtime";
|
|
58182
58281
|
var ImageThumbnail = memo35(function ImageThumbnail2({
|
|
58183
58282
|
imageSrc,
|
|
@@ -58188,8 +58287,8 @@ var ImageThumbnail = memo35(function ImageThumbnail2({
|
|
|
58188
58287
|
const [visible, setVisible] = useState91(false);
|
|
58189
58288
|
const [status, setStatus] = useState91("loading");
|
|
58190
58289
|
const [aspect, setAspect] = useState91(16 / 9);
|
|
58191
|
-
const ioRef =
|
|
58192
|
-
const roRef =
|
|
58290
|
+
const ioRef = useRef108(null);
|
|
58291
|
+
const roRef = useRef108(null);
|
|
58193
58292
|
const setContainerRef = useCallback102((el) => {
|
|
58194
58293
|
ioRef.current?.disconnect();
|
|
58195
58294
|
roRef.current?.disconnect();
|
|
@@ -58415,10 +58514,10 @@ function useRenderClipContent({
|
|
|
58415
58514
|
}
|
|
58416
58515
|
|
|
58417
58516
|
// src/hooks/useConsoleErrorCapture.ts
|
|
58418
|
-
import { useCallback as useCallback104, useEffect as useEffect85, useRef as
|
|
58517
|
+
import { useCallback as useCallback104, useEffect as useEffect85, useRef as useRef109, useState as useState92 } from "react";
|
|
58419
58518
|
function useConsoleErrorCapture(previewIframe) {
|
|
58420
58519
|
const [consoleErrors, setConsoleErrors] = useState92(null);
|
|
58421
|
-
const consoleErrorsRef =
|
|
58520
|
+
const consoleErrorsRef = useRef109([]);
|
|
58422
58521
|
const resetErrors = useCallback104(() => {
|
|
58423
58522
|
consoleErrorsRef.current = [];
|
|
58424
58523
|
setConsoleErrors(null);
|
|
@@ -58488,7 +58587,7 @@ function useConsoleErrorCapture(previewIframe) {
|
|
|
58488
58587
|
}
|
|
58489
58588
|
|
|
58490
58589
|
// src/hooks/useFrameCapture.ts
|
|
58491
|
-
import { useState as useState93, useCallback as useCallback105, useRef as
|
|
58590
|
+
import { useState as useState93, useCallback as useCallback105, useRef as useRef110 } from "react";
|
|
58492
58591
|
|
|
58493
58592
|
// src/utils/frameCapture.ts
|
|
58494
58593
|
function normalizeCompositionPath(compositionPath) {
|
|
@@ -58526,7 +58625,7 @@ function useFrameCapture({
|
|
|
58526
58625
|
}) {
|
|
58527
58626
|
const [captureFrameTime, setCaptureFrameTime] = useState93(0);
|
|
58528
58627
|
const [capturing, setCapturing] = useState93(false);
|
|
58529
|
-
const capturingRef =
|
|
58628
|
+
const capturingRef = useRef110(false);
|
|
58530
58629
|
useMountEffect(() => {
|
|
58531
58630
|
setCaptureFrameTime(usePlayerStore.getState().currentTime);
|
|
58532
58631
|
return liveTime.subscribe(setCaptureFrameTime);
|
|
@@ -58611,7 +58710,7 @@ function useFrameCapture({
|
|
|
58611
58710
|
}
|
|
58612
58711
|
|
|
58613
58712
|
// src/hooks/useLintModal.ts
|
|
58614
|
-
import { useState as useState94, useCallback as useCallback106, useEffect as useEffect86, useRef as
|
|
58713
|
+
import { useState as useState94, useCallback as useCallback106, useEffect as useEffect86, useRef as useRef111, useMemo as useMemo41 } from "react";
|
|
58615
58714
|
function parseFinding(f) {
|
|
58616
58715
|
return {
|
|
58617
58716
|
severity: f.severity === "error" ? "error" : "warning",
|
|
@@ -58625,7 +58724,7 @@ function useLintModal(projectId, refreshKey) {
|
|
|
58625
58724
|
const [lintModal, setLintModal] = useState94(null);
|
|
58626
58725
|
const [linting, setLinting] = useState94(false);
|
|
58627
58726
|
const [backgroundFindings, setBackgroundFindings] = useState94([]);
|
|
58628
|
-
const autoLintRanRef =
|
|
58727
|
+
const autoLintRanRef = useRef111(false);
|
|
58629
58728
|
const runLint = useCallback106(
|
|
58630
58729
|
async (opts) => {
|
|
58631
58730
|
if (!projectId) return;
|
|
@@ -58652,7 +58751,7 @@ function useLintModal(projectId, refreshKey) {
|
|
|
58652
58751
|
[projectId]
|
|
58653
58752
|
);
|
|
58654
58753
|
const handleLint = useCallback106(() => runLint(), [runLint]);
|
|
58655
|
-
const prevProjectIdRef =
|
|
58754
|
+
const prevProjectIdRef = useRef111(projectId);
|
|
58656
58755
|
useEffect86(() => {
|
|
58657
58756
|
if (projectId !== prevProjectIdRef.current) {
|
|
58658
58757
|
autoLintRanRef.current = false;
|
|
@@ -58700,14 +58799,14 @@ function useLintModal(projectId, refreshKey) {
|
|
|
58700
58799
|
}
|
|
58701
58800
|
|
|
58702
58801
|
// src/hooks/useToast.ts
|
|
58703
|
-
import { useState as useState95, useCallback as useCallback107, useRef as
|
|
58802
|
+
import { useState as useState95, useCallback as useCallback107, useRef as useRef112 } from "react";
|
|
58704
58803
|
var AUTO_DISMISS_MS2 = 4e3;
|
|
58705
58804
|
var EXIT_MS = 160;
|
|
58706
58805
|
var MAX_TOASTS = 3;
|
|
58707
58806
|
var nextToastId = 1;
|
|
58708
58807
|
function useToast() {
|
|
58709
58808
|
const [toasts, setToasts] = useState95([]);
|
|
58710
|
-
const timersRef =
|
|
58809
|
+
const timersRef = useRef112(/* @__PURE__ */ new Map());
|
|
58711
58810
|
const clearTimer = useCallback107((id) => {
|
|
58712
58811
|
const timer = timersRef.current.get(id);
|
|
58713
58812
|
if (timer) {
|
|
@@ -58783,7 +58882,7 @@ function useCompositionContentLoader({
|
|
|
58783
58882
|
}
|
|
58784
58883
|
|
|
58785
58884
|
// src/hooks/useStudioUrlState.ts
|
|
58786
|
-
import { useCallback as useCallback109, useEffect as useEffect87, useRef as
|
|
58885
|
+
import { useCallback as useCallback109, useEffect as useEffect87, useRef as useRef113, useState as useState96 } from "react";
|
|
58787
58886
|
|
|
58788
58887
|
// src/utils/studioUrlState.ts
|
|
58789
58888
|
var VALID_TABS = ["layers", "design", "renders", "slideshow", "variables"];
|
|
@@ -58908,12 +59007,12 @@ function useStudioUrlState({
|
|
|
58908
59007
|
initialState: initialState2
|
|
58909
59008
|
}) {
|
|
58910
59009
|
const currentTime = usePlayerStore((s) => s.currentTime);
|
|
58911
|
-
const hydratedSeekRef =
|
|
58912
|
-
const hydratedInitialTimeRef =
|
|
58913
|
-
const hydratedSelectionRef =
|
|
59010
|
+
const hydratedSeekRef = useRef113(initialState2.currentTime == null);
|
|
59011
|
+
const hydratedInitialTimeRef = useRef113(initialState2.currentTime == null);
|
|
59012
|
+
const hydratedSelectionRef = useRef113(initialState2.selection == null);
|
|
58914
59013
|
const [selectionHydrated, setSelectionHydrated] = useState96(initialState2.selection == null);
|
|
58915
|
-
const pendingSelectionRef =
|
|
58916
|
-
const stableTimeRef =
|
|
59014
|
+
const pendingSelectionRef = useRef113(initialState2.selection);
|
|
59015
|
+
const stableTimeRef = useRef113(initialState2.currentTime);
|
|
58917
59016
|
const buildUrlState = useCallback109(
|
|
58918
59017
|
() => ({
|
|
58919
59018
|
activeCompPath,
|
|
@@ -59041,7 +59140,7 @@ function useStudioUrlState({
|
|
|
59041
59140
|
}
|
|
59042
59141
|
|
|
59043
59142
|
// src/hooks/useStudioContextValue.ts
|
|
59044
|
-
import { useCallback as useCallback110, useMemo as useMemo42, useRef as
|
|
59143
|
+
import { useCallback as useCallback110, useMemo as useMemo42, useRef as useRef114, useState as useState97 } from "react";
|
|
59045
59144
|
function buildStudioContextValue(input) {
|
|
59046
59145
|
return {
|
|
59047
59146
|
projectId: input.projectId,
|
|
@@ -59097,7 +59196,7 @@ function useInspectorState(rightPanelTab, rightInspectorPanes, rightCollapsed, i
|
|
|
59097
59196
|
}
|
|
59098
59197
|
function useDragOverlay(onImportFiles) {
|
|
59099
59198
|
const [active, setActive] = useState97(false);
|
|
59100
|
-
const counterRef =
|
|
59199
|
+
const counterRef = useRef114(0);
|
|
59101
59200
|
const onDragOver = useCallback110((e) => {
|
|
59102
59201
|
if (!e.dataTransfer.types.includes("Files")) return;
|
|
59103
59202
|
e.preventDefault();
|
|
@@ -59136,7 +59235,7 @@ function useGlobalFileDrop(handleTimelineFileDrop) {
|
|
|
59136
59235
|
}
|
|
59137
59236
|
|
|
59138
59237
|
// src/components/StudioHeader.tsx
|
|
59139
|
-
import { useRef as
|
|
59238
|
+
import { useRef as useRef116 } from "react";
|
|
59140
59239
|
|
|
59141
59240
|
// src/contexts/PanelLayoutContext.tsx
|
|
59142
59241
|
import { createContext as createContext8, useContext as useContext8, useMemo as useMemo43 } from "react";
|
|
@@ -59216,7 +59315,7 @@ import {
|
|
|
59216
59315
|
useContext as useContext9,
|
|
59217
59316
|
useEffect as useEffect88,
|
|
59218
59317
|
useMemo as useMemo44,
|
|
59219
|
-
useRef as
|
|
59318
|
+
useRef as useRef115,
|
|
59220
59319
|
useState as useState98
|
|
59221
59320
|
} from "react";
|
|
59222
59321
|
import { jsx as jsx136 } from "react/jsx-runtime";
|
|
@@ -59244,8 +59343,8 @@ function readHistoryLocation() {
|
|
|
59244
59343
|
}
|
|
59245
59344
|
function useViewModeState() {
|
|
59246
59345
|
const [viewMode, setMode] = useState98(() => readViewModeFromUrl());
|
|
59247
|
-
const guardsRef =
|
|
59248
|
-
const acceptedLocationRef =
|
|
59346
|
+
const guardsRef = useRef115(/* @__PURE__ */ new Set());
|
|
59347
|
+
const acceptedLocationRef = useRef115(readHistoryLocation());
|
|
59249
59348
|
const canSetViewMode = useCallback111((mode) => {
|
|
59250
59349
|
for (const guard of guardsRef.current) {
|
|
59251
59350
|
if (!guard(mode)) return false;
|
|
@@ -59492,7 +59591,7 @@ var VIEW_MODE_OPTIONS = [
|
|
|
59492
59591
|
];
|
|
59493
59592
|
function ViewModeToggle() {
|
|
59494
59593
|
const { viewMode, setViewMode } = useViewMode();
|
|
59495
|
-
const tabRefs =
|
|
59594
|
+
const tabRefs = useRef116([]);
|
|
59496
59595
|
const selectMode = (mode) => {
|
|
59497
59596
|
if (mode === viewMode) return;
|
|
59498
59597
|
if (setViewMode(mode)) trackStudioEvent("view_mode_toggle", { mode });
|
|
@@ -59714,10 +59813,10 @@ function StudioHeader({
|
|
|
59714
59813
|
}
|
|
59715
59814
|
|
|
59716
59815
|
// src/hooks/useGestureCommit.ts
|
|
59717
|
-
import { useState as useState100, useCallback as useCallback113, useRef as
|
|
59816
|
+
import { useState as useState100, useCallback as useCallback113, useRef as useRef118, useEffect as useEffect90 } from "react";
|
|
59718
59817
|
|
|
59719
59818
|
// src/hooks/useGestureRecording.ts
|
|
59720
|
-
import { useCallback as useCallback112, useEffect as useEffect89, useRef as
|
|
59819
|
+
import { useCallback as useCallback112, useEffect as useEffect89, useRef as useRef117, useState as useState99 } from "react";
|
|
59721
59820
|
function readBasePosition(element, iframeEl) {
|
|
59722
59821
|
let baseOpacity = 1;
|
|
59723
59822
|
let baseScale = 1;
|
|
@@ -59836,10 +59935,10 @@ function createRecordingRefs() {
|
|
|
59836
59935
|
function useGestureRecording() {
|
|
59837
59936
|
const [isRecording, setIsRecording] = useState99(false);
|
|
59838
59937
|
const [recordingDuration, setRecordingDuration] = useState99(0);
|
|
59839
|
-
const isRecordingRef =
|
|
59840
|
-
const refs =
|
|
59841
|
-
const samplesRef =
|
|
59842
|
-
const trailRef =
|
|
59938
|
+
const isRecordingRef = useRef117(false);
|
|
59939
|
+
const refs = useRef117(createRecordingRefs());
|
|
59940
|
+
const samplesRef = useRef117(refs.current.samples);
|
|
59941
|
+
const trailRef = useRef117(refs.current.trail);
|
|
59843
59942
|
useEffect89(() => {
|
|
59844
59943
|
const r = refs.current;
|
|
59845
59944
|
return () => {
|
|
@@ -60235,11 +60334,11 @@ function useGestureCommit({
|
|
|
60235
60334
|
}) {
|
|
60236
60335
|
const gestureRecording = useGestureRecording();
|
|
60237
60336
|
const [gestureState, setGestureState] = useState100("idle");
|
|
60238
|
-
const gestureStateRef =
|
|
60239
|
-
const recordingAutoStopRef =
|
|
60240
|
-
const recordingStartTimeRef =
|
|
60241
|
-
const commitInFlightRef =
|
|
60242
|
-
const capturedSelectionRef =
|
|
60337
|
+
const gestureStateRef = useRef118("idle");
|
|
60338
|
+
const recordingAutoStopRef = useRef118(void 0);
|
|
60339
|
+
const recordingStartTimeRef = useRef118(0);
|
|
60340
|
+
const commitInFlightRef = useRef118(false);
|
|
60341
|
+
const capturedSelectionRef = useRef118(null);
|
|
60243
60342
|
useEffect90(() => () => clearInterval(recordingAutoStopRef.current), []);
|
|
60244
60343
|
const stopAndCommitRecording = useCallback113(async () => {
|
|
60245
60344
|
clearInterval(recordingAutoStopRef.current);
|
|
@@ -60580,12 +60679,12 @@ import {
|
|
|
60580
60679
|
useState as useState108,
|
|
60581
60680
|
useCallback as useCallback119,
|
|
60582
60681
|
useImperativeHandle,
|
|
60583
|
-
useRef as
|
|
60682
|
+
useRef as useRef124,
|
|
60584
60683
|
forwardRef as forwardRef3
|
|
60585
60684
|
} from "react";
|
|
60586
60685
|
|
|
60587
60686
|
// src/components/sidebar/CompositionsTab.tsx
|
|
60588
|
-
import { memo as memo37, useCallback as useCallback114, useEffect as useEffect91, useRef as
|
|
60687
|
+
import { memo as memo37, useCallback as useCallback114, useEffect as useEffect91, useRef as useRef119, useState as useState101 } from "react";
|
|
60589
60688
|
import { jsx as jsx139, jsxs as jsxs117 } from "react/jsx-runtime";
|
|
60590
60689
|
var DEFAULT_PREVIEW_STAGE = { width: 1920, height: 1080 };
|
|
60591
60690
|
var CARD_W = 80;
|
|
@@ -60657,10 +60756,10 @@ function CompCard({
|
|
|
60657
60756
|
const [stageSize, setStageSize] = useState101(DEFAULT_PREVIEW_STAGE);
|
|
60658
60757
|
const [livePreviewLoaded, setLivePreviewLoaded] = useState101(false);
|
|
60659
60758
|
const [thumbnailFailed, setThumbnailFailed] = useState101(false);
|
|
60660
|
-
const iframeRef =
|
|
60661
|
-
const hoverTimer =
|
|
60662
|
-
const syncTimer =
|
|
60663
|
-
const draggedRef =
|
|
60759
|
+
const iframeRef = useRef119(null);
|
|
60760
|
+
const hoverTimer = useRef119(null);
|
|
60761
|
+
const syncTimer = useRef119(null);
|
|
60762
|
+
const draggedRef = useRef119(false);
|
|
60664
60763
|
const requestIframePlaybackSync = useCallback114((shouldPlay) => {
|
|
60665
60764
|
if (syncTimer.current) {
|
|
60666
60765
|
clearTimeout(syncTimer.current);
|
|
@@ -60882,7 +60981,7 @@ var CompositionsTab = memo37(function CompositionsTab2({
|
|
|
60882
60981
|
});
|
|
60883
60982
|
|
|
60884
60983
|
// src/components/sidebar/AssetsTab.tsx
|
|
60885
|
-
import { memo as memo38, useState as useState106, useCallback as useCallback117, useRef as
|
|
60984
|
+
import { memo as memo38, useState as useState106, useCallback as useCallback117, useRef as useRef122, useMemo as useMemo47, useEffect as useEffect96 } from "react";
|
|
60886
60985
|
|
|
60887
60986
|
// src/components/sidebar/assetHelpers.ts
|
|
60888
60987
|
function getCategory(path) {
|
|
@@ -60932,7 +61031,7 @@ var CATEGORY_LABELS = {
|
|
|
60932
61031
|
var FILTER_ORDER = ["audio", "images", "video", "fonts"];
|
|
60933
61032
|
|
|
60934
61033
|
// src/components/sidebar/AudioRow.tsx
|
|
60935
|
-
import { useState as useState102, useRef as
|
|
61034
|
+
import { useState as useState102, useRef as useRef120, useEffect as useEffect92, useCallback as useCallback115 } from "react";
|
|
60936
61035
|
|
|
60937
61036
|
// src/components/sidebar/AssetContextMenu.tsx
|
|
60938
61037
|
import { jsx as jsx140, jsxs as jsxs118 } from "react/jsx-runtime";
|
|
@@ -61061,15 +61160,15 @@ function AudioRow({
|
|
|
61061
61160
|
const [contextMenu, setContextMenu] = useState102(null);
|
|
61062
61161
|
const [playing, setPlaying] = useState102(false);
|
|
61063
61162
|
const [bars, setBars] = useState102([]);
|
|
61064
|
-
const audioRef =
|
|
61065
|
-
const actxRef =
|
|
61066
|
-
const analyserRef =
|
|
61067
|
-
const sourceRef =
|
|
61068
|
-
const animRef =
|
|
61163
|
+
const audioRef = useRef120(null);
|
|
61164
|
+
const actxRef = useRef120(null);
|
|
61165
|
+
const analyserRef = useRef120(null);
|
|
61166
|
+
const sourceRef = useRef120(null);
|
|
61167
|
+
const animRef = useRef120(0);
|
|
61069
61168
|
const name = basename2(asset);
|
|
61070
61169
|
const subtype = getAudioSubtype(asset);
|
|
61071
61170
|
const serveUrl = resolveMediaPreviewUrl(asset, projectId);
|
|
61072
|
-
const pointerDownRef =
|
|
61171
|
+
const pointerDownRef = useRef120(null);
|
|
61073
61172
|
const setSelectedElementId = usePlayerStore((s) => s.setSelectedElementId);
|
|
61074
61173
|
const requestClipReveal = usePlayerStore((s) => s.requestClipReveal);
|
|
61075
61174
|
const elements = usePlayerStore((s) => s.elements);
|
|
@@ -61311,7 +61410,7 @@ function GlobalAssetsView({ searchQuery }) {
|
|
|
61311
61410
|
}
|
|
61312
61411
|
|
|
61313
61412
|
// src/components/sidebar/AssetCard.tsx
|
|
61314
|
-
import { useState as useState105, useEffect as useEffect95, useRef as
|
|
61413
|
+
import { useState as useState105, useEffect as useEffect95, useRef as useRef121, useCallback as useCallback116 } from "react";
|
|
61315
61414
|
|
|
61316
61415
|
// src/components/ui/VideoFrameThumbnail.tsx
|
|
61317
61416
|
import { useState as useState104, useEffect as useEffect94 } from "react";
|
|
@@ -61436,7 +61535,7 @@ function AssetCard({
|
|
|
61436
61535
|
const probedDuration = useProbedDuration(serveUrl, !isVideo || duration != null);
|
|
61437
61536
|
const resolvedDuration = duration ?? probedDuration ?? void 0;
|
|
61438
61537
|
const durationLabel = formatDuration(resolvedDuration ?? 0);
|
|
61439
|
-
const pointerDownRef =
|
|
61538
|
+
const pointerDownRef = useRef121(null);
|
|
61440
61539
|
const setSelectedElementId = usePlayerStore((s) => s.setSelectedElementId);
|
|
61441
61540
|
const requestClipReveal = usePlayerStore((s) => s.requestClipReveal);
|
|
61442
61541
|
const elements = usePlayerStore((s) => s.elements);
|
|
@@ -61638,7 +61737,7 @@ var AssetsTab = memo38(function AssetsTab2({
|
|
|
61638
61737
|
onRename,
|
|
61639
61738
|
onAddAssetToTimeline
|
|
61640
61739
|
}) {
|
|
61641
|
-
const fileInputRef =
|
|
61740
|
+
const fileInputRef = useRef122(null);
|
|
61642
61741
|
const [dragOver, setDragOver] = useState106(false);
|
|
61643
61742
|
const [copiedPath, setCopiedPath] = useState106(null);
|
|
61644
61743
|
const [activeFilter, setActiveFilter] = useState106("all");
|
|
@@ -61646,7 +61745,7 @@ var AssetsTab = memo38(function AssetsTab2({
|
|
|
61646
61745
|
const [searchQuery, setSearchQuery] = useState106("");
|
|
61647
61746
|
const [viewMode, setViewMode] = useState106("local");
|
|
61648
61747
|
const [manifest, setManifest] = useState106(/* @__PURE__ */ new Map());
|
|
61649
|
-
const manifest404Ref =
|
|
61748
|
+
const manifest404Ref = useRef122(/* @__PURE__ */ new Set());
|
|
61650
61749
|
const assetsKey = assets.join("|");
|
|
61651
61750
|
useEffect96(() => {
|
|
61652
61751
|
if (manifest404Ref.current.has(projectId)) return;
|
|
@@ -61967,7 +62066,7 @@ var AssetsTab = memo38(function AssetsTab2({
|
|
|
61967
62066
|
});
|
|
61968
62067
|
|
|
61969
62068
|
// src/components/sidebar/BlocksTab.tsx
|
|
61970
|
-
import { memo as memo39, useState as useState107, useCallback as useCallback118, useRef as
|
|
62069
|
+
import { memo as memo39, useState as useState107, useCallback as useCallback118, useRef as useRef123, useEffect as useEffect97 } from "react";
|
|
61971
62070
|
import { createPortal as createPortal7 } from "react-dom";
|
|
61972
62071
|
import { jsx as jsx146, jsxs as jsxs123 } from "react/jsx-runtime";
|
|
61973
62072
|
var BlocksTab = memo39(function BlocksTab2({ onAddBlock, onPreviewBlock }) {
|
|
@@ -62179,7 +62278,7 @@ function BlockCard({
|
|
|
62179
62278
|
}) {
|
|
62180
62279
|
const [hovered, setHovered] = useState107(false);
|
|
62181
62280
|
const [adding, setAdding] = useState107(false);
|
|
62182
|
-
const hoverTimer =
|
|
62281
|
+
const hoverTimer = useRef123(null);
|
|
62183
62282
|
const colors = getCategoryColors(category);
|
|
62184
62283
|
const needsWebGL = tags?.includes("html-in-canvas") || tags?.includes("webgl");
|
|
62185
62284
|
const handleEnter = useCallback118(() => {
|
|
@@ -62357,7 +62456,7 @@ function PromptPreviewModal({
|
|
|
62357
62456
|
}) {
|
|
62358
62457
|
const [value, setValue] = useState107(prompt);
|
|
62359
62458
|
const [copied, setCopied] = useState107(false);
|
|
62360
|
-
const textareaRef =
|
|
62459
|
+
const textareaRef = useRef123(null);
|
|
62361
62460
|
useEffect97(() => {
|
|
62362
62461
|
requestAnimationFrame(() => textareaRef.current?.focus());
|
|
62363
62462
|
}, []);
|
|
@@ -62486,7 +62585,7 @@ var LeftSidebar = memo40(
|
|
|
62486
62585
|
onAddCompositionToTimeline
|
|
62487
62586
|
}, ref) {
|
|
62488
62587
|
const [tab, setTab] = useState108(getPersistedTab);
|
|
62489
|
-
const tabRef =
|
|
62588
|
+
const tabRef = useRef124(tab);
|
|
62490
62589
|
tabRef.current = tab;
|
|
62491
62590
|
const selectTab = useCallback119((t) => {
|
|
62492
62591
|
setTab(t);
|
|
@@ -62954,13 +63053,13 @@ function StudioLeftSidebar({
|
|
|
62954
63053
|
}
|
|
62955
63054
|
|
|
62956
63055
|
// src/components/StudioRightPanel.tsx
|
|
62957
|
-
import { useCallback as useCallback136, useEffect as useEffect104, useRef as
|
|
63056
|
+
import { useCallback as useCallback136, useEffect as useEffect104, useRef as useRef130 } from "react";
|
|
62958
63057
|
|
|
62959
63058
|
// src/components/editor/LayersPanel.tsx
|
|
62960
|
-
import { memo as memo41, useState as useState111, useCallback as useCallback122, useEffect as useEffect98, useRef as
|
|
63059
|
+
import { memo as memo41, useState as useState111, useCallback as useCallback122, useEffect as useEffect98, useRef as useRef126 } from "react";
|
|
62961
63060
|
|
|
62962
63061
|
// src/components/editor/useLayerDrag.ts
|
|
62963
|
-
import { useRef as
|
|
63062
|
+
import { useRef as useRef125, useState as useState110, useCallback as useCallback121 } from "react";
|
|
62964
63063
|
var DRAG_THRESHOLD_PX3 = 4;
|
|
62965
63064
|
function isLayerDraggable(layer) {
|
|
62966
63065
|
if (!(layer.selector || layer.id)) return false;
|
|
@@ -63027,7 +63126,7 @@ function useLayerDrag({
|
|
|
63027
63126
|
onReorder,
|
|
63028
63127
|
onSingleSibling
|
|
63029
63128
|
}) {
|
|
63030
|
-
const dragRef =
|
|
63129
|
+
const dragRef = useRef125(null);
|
|
63031
63130
|
const [dragKey, setDragKey] = useState110(null);
|
|
63032
63131
|
const [insertionLineY, setInsertionLineY] = useState110(null);
|
|
63033
63132
|
const handleRowPointerDown = useCallback121(
|
|
@@ -63232,8 +63331,8 @@ var LayersPanel = memo41(function LayersPanel2() {
|
|
|
63232
63331
|
} = useDomEditContext();
|
|
63233
63332
|
const [layers, setLayers] = useState111([]);
|
|
63234
63333
|
const [collapsed, setCollapsed] = useState111({});
|
|
63235
|
-
const prevDocVersionRef =
|
|
63236
|
-
const scrollContainerRef =
|
|
63334
|
+
const prevDocVersionRef = useRef126(0);
|
|
63335
|
+
const scrollContainerRef = useRef126(null);
|
|
63237
63336
|
const mirrorLayerReorderToTimeline = useLayerReorderTimelineMirror();
|
|
63238
63337
|
const { scheduleReveal } = useLayerRevealOverride({
|
|
63239
63338
|
isPlaying,
|
|
@@ -64125,7 +64224,7 @@ function ParamControl({
|
|
|
64125
64224
|
}
|
|
64126
64225
|
|
|
64127
64226
|
// src/components/renders/RenderQueue.tsx
|
|
64128
|
-
import { memo as memo46, useState as useState115, useRef as
|
|
64227
|
+
import { memo as memo46, useState as useState115, useRef as useRef127, useEffect as useEffect99, useLayoutEffect as useLayoutEffect5, useId as useId6 } from "react";
|
|
64129
64228
|
import { createPortal as createPortal8 } from "react-dom";
|
|
64130
64229
|
import { CANVAS_DIMENSIONS } from "@hyperframes/parsers";
|
|
64131
64230
|
|
|
@@ -64411,8 +64510,8 @@ var FORMAT_PANEL_SIZE = { width: 208, height: 150 };
|
|
|
64411
64510
|
function FormatInfoTooltip({ format }) {
|
|
64412
64511
|
const [open, setOpen] = useState115(false);
|
|
64413
64512
|
const [position, setPosition] = useState115(null);
|
|
64414
|
-
const triggerRef =
|
|
64415
|
-
const timeoutRef =
|
|
64513
|
+
const triggerRef = useRef127(null);
|
|
64514
|
+
const timeoutRef = useRef127(void 0);
|
|
64416
64515
|
const panelId = useId6();
|
|
64417
64516
|
const show = () => {
|
|
64418
64517
|
clearTimeout(timeoutRef.current);
|
|
@@ -64646,7 +64745,7 @@ var RenderQueue = memo46(function RenderQueue2({
|
|
|
64646
64745
|
onDismissActionError,
|
|
64647
64746
|
compositionDimensions
|
|
64648
64747
|
}) {
|
|
64649
|
-
const listRef =
|
|
64748
|
+
const listRef = useRef127(null);
|
|
64650
64749
|
useEffect99(() => {
|
|
64651
64750
|
if (listRef.current) {
|
|
64652
64751
|
listRef.current.scrollTo({ top: listRef.current.scrollHeight, behavior: "smooth" });
|
|
@@ -64755,7 +64854,7 @@ var RenderQueue = memo46(function RenderQueue2({
|
|
|
64755
64854
|
});
|
|
64756
64855
|
|
|
64757
64856
|
// src/components/panels/SlideshowPanel.tsx
|
|
64758
|
-
import { useState as useState117, useEffect as useEffect100, useCallback as useCallback128, useRef as
|
|
64857
|
+
import { useState as useState117, useEffect as useEffect100, useCallback as useCallback128, useRef as useRef128 } from "react";
|
|
64759
64858
|
import { parseSlideshowManifest } from "@hyperframes/core/slideshow";
|
|
64760
64859
|
|
|
64761
64860
|
// src/components/panels/SlideshowSubPanels.tsx
|
|
@@ -65392,8 +65491,8 @@ function SlideshowPanel({ scenes, onPersist, onPersistNotes }) {
|
|
|
65392
65491
|
);
|
|
65393
65492
|
const currentTime = usePlayerStore((s) => s.currentTime);
|
|
65394
65493
|
const { domEditSelection } = useDomEditSelectionContext();
|
|
65395
|
-
const manifestRef =
|
|
65396
|
-
const notesCtrlRef =
|
|
65494
|
+
const manifestRef = useRef128(manifest);
|
|
65495
|
+
const notesCtrlRef = useRef128(makeSlideshowNotesController());
|
|
65397
65496
|
useEffect100(() => {
|
|
65398
65497
|
if (!compHtml) {
|
|
65399
65498
|
notesCtrlRef.current.flush();
|
|
@@ -66998,13 +67097,13 @@ async function applyColorGradingScopeUpdate({
|
|
|
66998
67097
|
}
|
|
66999
67098
|
|
|
67000
67099
|
// src/hooks/useInspectorSplitResize.ts
|
|
67001
|
-
import { useCallback as useCallback135, useRef as
|
|
67100
|
+
import { useCallback as useCallback135, useRef as useRef129, useState as useState122 } from "react";
|
|
67002
67101
|
var MIN_INSPECTOR_SPLIT_PERCENT = 20;
|
|
67003
67102
|
var MAX_INSPECTOR_SPLIT_PERCENT = 75;
|
|
67004
67103
|
function useInspectorSplitResize() {
|
|
67005
67104
|
const [layersPanePercent, setLayersPanePercent] = useState122(40);
|
|
67006
|
-
const splitContainerRef =
|
|
67007
|
-
const splitDragRef =
|
|
67105
|
+
const splitContainerRef = useRef129(null);
|
|
67106
|
+
const splitDragRef = useRef129(null);
|
|
67008
67107
|
const handleInspectorSplitResizeStart = useCallback135(
|
|
67009
67108
|
(event) => {
|
|
67010
67109
|
event.preventDefault();
|
|
@@ -67164,7 +67263,7 @@ function StudioRightPanel({
|
|
|
67164
67263
|
handleInspectorSplitResizeMove,
|
|
67165
67264
|
handleInspectorSplitResizeEnd
|
|
67166
67265
|
} = useInspectorSplitResize();
|
|
67167
|
-
const backgroundRemovalAbortRef =
|
|
67266
|
+
const backgroundRemovalAbortRef = useRef130(null);
|
|
67168
67267
|
useEffect104(
|
|
67169
67268
|
() => () => {
|
|
67170
67269
|
backgroundRemovalAbortRef.current?.abort();
|
|
@@ -67533,7 +67632,7 @@ function StudioRightPanel({
|
|
|
67533
67632
|
}
|
|
67534
67633
|
|
|
67535
67634
|
// src/components/TimelineToolbar.tsx
|
|
67536
|
-
import { useEffect as useEffect106, useRef as
|
|
67635
|
+
import { useEffect as useEffect106, useRef as useRef131 } from "react";
|
|
67537
67636
|
import { Magnet, MagnifyingGlassMinus, MagnifyingGlassPlus } from "@phosphor-icons/react";
|
|
67538
67637
|
|
|
67539
67638
|
// src/hooks/useEnableKeyframes.ts
|
|
@@ -67985,7 +68084,7 @@ function resolveKeyframeToggleState(session, currentTime) {
|
|
|
67985
68084
|
}
|
|
67986
68085
|
function useKeyframeToggle(session) {
|
|
67987
68086
|
const currentTime = usePlayerStore((s) => s.currentTime);
|
|
67988
|
-
const sessionRef =
|
|
68087
|
+
const sessionRef = useRef131(session);
|
|
67989
68088
|
sessionRef.current = session;
|
|
67990
68089
|
const onToggle = useEnableKeyframes(
|
|
67991
68090
|
sessionRef
|
|
@@ -68277,14 +68376,14 @@ import { useState as useState130 } from "react";
|
|
|
68277
68376
|
import { Copy as Copy2, Check as Check2 } from "@phosphor-icons/react";
|
|
68278
68377
|
|
|
68279
68378
|
// src/hooks/useStoryboard.ts
|
|
68280
|
-
import { useCallback as useCallback139, useEffect as useEffect107, useRef as
|
|
68379
|
+
import { useCallback as useCallback139, useEffect as useEffect107, useRef as useRef132, useState as useState123 } from "react";
|
|
68281
68380
|
function useStoryboard(projectId) {
|
|
68282
68381
|
const [data, setData] = useState123(null);
|
|
68283
68382
|
const [loading, setLoading] = useState123(true);
|
|
68284
68383
|
const [error, setError] = useState123(null);
|
|
68285
68384
|
const [reloadKey, setReloadKey] = useState123(0);
|
|
68286
|
-
const hasDataRef =
|
|
68287
|
-
const lastProjectRef =
|
|
68385
|
+
const hasDataRef = useRef132(false);
|
|
68386
|
+
const lastProjectRef = useRef132(null);
|
|
68288
68387
|
const reload = useCallback139(() => setReloadKey((k) => k + 1), []);
|
|
68289
68388
|
useEffect107(() => {
|
|
68290
68389
|
if (!projectId) return;
|
|
@@ -68318,7 +68417,7 @@ function useStoryboard(projectId) {
|
|
|
68318
68417
|
}
|
|
68319
68418
|
|
|
68320
68419
|
// src/hooks/useProjectSignaturePoll.ts
|
|
68321
|
-
import { useEffect as useEffect108, useRef as
|
|
68420
|
+
import { useEffect as useEffect108, useRef as useRef133 } from "react";
|
|
68322
68421
|
var POLL_INTERVAL_MS = 2e3;
|
|
68323
68422
|
async function fetchProjectSignature(projectId) {
|
|
68324
68423
|
try {
|
|
@@ -68331,8 +68430,8 @@ async function fetchProjectSignature(projectId) {
|
|
|
68331
68430
|
}
|
|
68332
68431
|
}
|
|
68333
68432
|
function useProjectSignaturePoll(projectId, currentSignature, onChange) {
|
|
68334
|
-
const signatureRef =
|
|
68335
|
-
const onChangeRef =
|
|
68433
|
+
const signatureRef = useRef133(currentSignature);
|
|
68434
|
+
const onChangeRef = useRef133(onChange);
|
|
68336
68435
|
signatureRef.current = currentSignature;
|
|
68337
68436
|
onChangeRef.current = onChange;
|
|
68338
68437
|
useEffect108(() => {
|
|
@@ -68595,7 +68694,7 @@ function StoryboardScriptPanel({ script }) {
|
|
|
68595
68694
|
}
|
|
68596
68695
|
|
|
68597
68696
|
// src/components/storyboard/StoryboardSourceEditor.tsx
|
|
68598
|
-
import { useCallback as useCallback140, useEffect as useEffect110, useMemo as useMemo50, useRef as
|
|
68697
|
+
import { useCallback as useCallback140, useEffect as useEffect110, useMemo as useMemo50, useRef as useRef134, useState as useState125 } from "react";
|
|
68599
68698
|
import { marked } from "marked";
|
|
68600
68699
|
import DOMPurify from "dompurify";
|
|
68601
68700
|
import { jsx as jsx172, jsxs as jsxs144 } from "react/jsx-runtime";
|
|
@@ -68644,7 +68743,7 @@ function hardenLinks(node) {
|
|
|
68644
68743
|
}
|
|
68645
68744
|
function useMarkdownPreview(source) {
|
|
68646
68745
|
const [debounced, setDebounced] = useState125(source);
|
|
68647
|
-
const primed =
|
|
68746
|
+
const primed = useRef134(false);
|
|
68648
68747
|
useEffect110(() => {
|
|
68649
68748
|
if (!primed.current && source !== "") {
|
|
68650
68749
|
primed.current = true;
|
|
@@ -69882,7 +69981,7 @@ function useTimelineAddAtPlayhead(addAsset, addComposition) {
|
|
|
69882
69981
|
import { jsx as jsx179, jsxs as jsxs150 } from "react/jsx-runtime";
|
|
69883
69982
|
function StudioApp() {
|
|
69884
69983
|
const { projectId, resolving, waitingForServer } = useServerConnection();
|
|
69885
|
-
const initialUrlStateRef =
|
|
69984
|
+
const initialUrlStateRef = useRef135(readStudioUrlStateFromWindow());
|
|
69886
69985
|
const viewModeValue = useViewModeState();
|
|
69887
69986
|
useEffect116(() => {
|
|
69888
69987
|
if (resolving || waitingForServer) return;
|
|
@@ -69900,10 +69999,10 @@ function StudioApp() {
|
|
|
69900
69999
|
const [refreshKey, setRefreshKey] = useState132(0);
|
|
69901
70000
|
const [previewDocumentVersion, refreshPreviewDocumentVersion] = usePreviewDocumentVersion();
|
|
69902
70001
|
const [blockPreview, setBlockPreview] = useState132(null);
|
|
69903
|
-
const previewIframeRef =
|
|
69904
|
-
const activeCompPathRef =
|
|
70002
|
+
const previewIframeRef = useRef135(null);
|
|
70003
|
+
const activeCompPathRef = useRef135(activeCompPath);
|
|
69905
70004
|
activeCompPathRef.current = activeCompPath;
|
|
69906
|
-
const leftSidebarRef =
|
|
70005
|
+
const leftSidebarRef = useRef135(null);
|
|
69907
70006
|
const renderQueue = useRenderQueue(projectId);
|
|
69908
70007
|
const captionEditMode = useCaptionStore((s) => s.isEditMode);
|
|
69909
70008
|
const captionHasSelection = useCaptionStore((s) => s.selectedSegmentIds.size > 0);
|
|
@@ -69923,10 +70022,10 @@ function StudioApp() {
|
|
|
69923
70022
|
rightPanelTab: initialUrlStateRef.current.rightPanelTab
|
|
69924
70023
|
});
|
|
69925
70024
|
const editHistory = usePersistentEditHistory({ projectId });
|
|
69926
|
-
const domEditSaveTimestampRef =
|
|
69927
|
-
const handleDomZIndexReorderCommitRef =
|
|
69928
|
-
const pendingTimelineEditPathRef =
|
|
69929
|
-
const isGestureRecordingRef =
|
|
70025
|
+
const domEditSaveTimestampRef = useRef135(0);
|
|
70026
|
+
const handleDomZIndexReorderCommitRef = useRef135(null);
|
|
70027
|
+
const pendingTimelineEditPathRef = useRef135(/* @__PURE__ */ new Set());
|
|
70028
|
+
const isGestureRecordingRef = useRef135(false);
|
|
69930
70029
|
const reloadPreview = useCallback144(() => setRefreshKey((k) => k + 1), []);
|
|
69931
70030
|
const fileManager = useFileManager({
|
|
69932
70031
|
projectId,
|
|
@@ -69967,7 +70066,7 @@ function StudioApp() {
|
|
|
69967
70066
|
reloadPreview: () => setRefreshKey((k) => k + 1),
|
|
69968
70067
|
pendingTimelineEditPathRef
|
|
69969
70068
|
});
|
|
69970
|
-
const invalidateGsapCacheRef =
|
|
70069
|
+
const invalidateGsapCacheRef = useRef135(() => {
|
|
69971
70070
|
});
|
|
69972
70071
|
const invalidateGsapCache = useCallback144(() => invalidateGsapCacheRef.current(), []);
|
|
69973
70072
|
const timelineEditing = useTimelineEditing({
|
|
@@ -70027,16 +70126,16 @@ function StudioApp() {
|
|
|
70027
70126
|
setRightCollapsed: panelLayout.setRightCollapsed,
|
|
70028
70127
|
setRightPanelTab: panelLayout.setRightPanelTab
|
|
70029
70128
|
});
|
|
70030
|
-
const clearDomSelectionRef =
|
|
70129
|
+
const clearDomSelectionRef = useRef135(() => {
|
|
70031
70130
|
});
|
|
70032
|
-
const domEditSelectionBridgeRef =
|
|
70033
|
-
const handleDomEditElementDeleteRef =
|
|
70131
|
+
const domEditSelectionBridgeRef = useRef135(null);
|
|
70132
|
+
const handleDomEditElementDeleteRef = useRef135(
|
|
70034
70133
|
async () => {
|
|
70035
70134
|
}
|
|
70036
70135
|
);
|
|
70037
70136
|
const domEditDeleteBridge = (s) => handleDomEditElementDeleteRef.current(s);
|
|
70038
|
-
const resetKeyframesRef =
|
|
70039
|
-
const deleteSelectedKeyframesRef =
|
|
70137
|
+
const resetKeyframesRef = useRef135(() => false);
|
|
70138
|
+
const deleteSelectedKeyframesRef = useRef135(() => {
|
|
70040
70139
|
});
|
|
70041
70140
|
const { handleCopy, handlePaste, handleCut } = useClipboard({
|
|
70042
70141
|
projectId,
|
|
@@ -70078,7 +70177,7 @@ function StudioApp() {
|
|
|
70078
70177
|
forceReloadSdkSession: sdkHandle.forceReload,
|
|
70079
70178
|
onToggleRecording: () => handleToggleRecordingRef.current()
|
|
70080
70179
|
});
|
|
70081
|
-
const sidebarTabRef =
|
|
70180
|
+
const sidebarTabRef = useRef135({
|
|
70082
70181
|
select: (t) => leftSidebarRef.current?.selectTab(t),
|
|
70083
70182
|
get: () => leftSidebarRef.current?.getTab() ?? "compositions"
|
|
70084
70183
|
});
|
|
@@ -70166,9 +70265,9 @@ function StudioApp() {
|
|
|
70166
70265
|
resetErrors: resetConsoleErrors
|
|
70167
70266
|
} = useConsoleErrorCapture(previewIframe);
|
|
70168
70267
|
const dragOverlay = useGlobalFileDrop(timelineEditing.handleTimelineFileDrop);
|
|
70169
|
-
const handleToggleRecordingRef =
|
|
70268
|
+
const handleToggleRecordingRef = useRef135(() => {
|
|
70170
70269
|
});
|
|
70171
|
-
const domEditSessionRef =
|
|
70270
|
+
const domEditSessionRef = useRef135(domEditSession);
|
|
70172
70271
|
domEditSessionRef.current = domEditSession;
|
|
70173
70272
|
const { gestureState, gestureRecording, handleToggleRecording } = useGestureCommit({
|
|
70174
70273
|
domEditSessionRef,
|
|
@@ -70178,7 +70277,7 @@ function StudioApp() {
|
|
|
70178
70277
|
});
|
|
70179
70278
|
handleToggleRecordingRef.current = handleToggleRecording;
|
|
70180
70279
|
const recordingToggle = handleToggleRecording;
|
|
70181
|
-
const canvasRectRef =
|
|
70280
|
+
const canvasRectRef = useRef135(null);
|
|
70182
70281
|
useLayoutEffect6(() => {
|
|
70183
70282
|
if (gestureState !== "recording" || !previewIframe) {
|
|
70184
70283
|
canvasRectRef.current = null;
|
|
@@ -70410,11 +70509,11 @@ function StudioApp() {
|
|
|
70410
70509
|
}
|
|
70411
70510
|
|
|
70412
70511
|
// src/hooks/useElementPicker.ts
|
|
70413
|
-
import { useState as useState133, useCallback as useCallback145, useRef as
|
|
70512
|
+
import { useState as useState133, useCallback as useCallback145, useRef as useRef136 } from "react";
|
|
70414
70513
|
function useElementPicker(iframeRef, options) {
|
|
70415
70514
|
const [isPickMode, setIsPickMode] = useState133(false);
|
|
70416
70515
|
const [pickedElement, setPickedElement] = useState133(null);
|
|
70417
|
-
const activeOverrideRef =
|
|
70516
|
+
const activeOverrideRef = useRef136(null);
|
|
70418
70517
|
const getActiveIframe = useCallback145(() => {
|
|
70419
70518
|
return activeOverrideRef.current ?? iframeRef.current;
|
|
70420
70519
|
}, [iframeRef]);
|
|
@@ -70488,7 +70587,7 @@ function useElementPicker(iframeRef, options) {
|
|
|
70488
70587
|
window.addEventListener("message", handleMessage);
|
|
70489
70588
|
return () => window.removeEventListener("message", handleMessage);
|
|
70490
70589
|
});
|
|
70491
|
-
const optionsRef =
|
|
70590
|
+
const optionsRef = useRef136(options);
|
|
70492
70591
|
optionsRef.current = options;
|
|
70493
70592
|
const syncToSource = useCallback145(
|
|
70494
70593
|
(elementId, selector, op) => {
|
|
@@ -70599,7 +70698,7 @@ function useElementPicker(iframeRef, options) {
|
|
|
70599
70698
|
},
|
|
70600
70699
|
[pickedElement, getActiveIframe, syncToSource]
|
|
70601
70700
|
);
|
|
70602
|
-
const activeIframeRef =
|
|
70701
|
+
const activeIframeRef = useRef136(null);
|
|
70603
70702
|
activeIframeRef.current = getActiveIframe();
|
|
70604
70703
|
return {
|
|
70605
70704
|
isPickMode,
|