ntvframes 0.8.22 → 0.8.24
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/cli.js +1 -1
- package/dist/fontLocalizeCli.js +1 -1
- package/dist/studio/assets/{hyperframes-player-6CsXgdw8.js → hyperframes-player-ChWvPzgu.js} +1 -1
- package/dist/studio/assets/{index-SzGOj1TJ.js → index-B07a8pjC.js} +159 -159
- package/dist/studio/assets/{index-B4VGx85r.js → index-BiNNlz4K.js} +1 -1
- package/dist/studio/assets/{index-CGb2uB17.js → index-CctkHqCM.js} +1 -1
- package/dist/studio/index.html +1 -1
- package/dist/studio/index.js +376 -383
- package/dist/studio/index.js.map +1 -1
- package/package.json +1 -1
package/dist/studio/index.js
CHANGED
|
@@ -61438,7 +61438,7 @@ var FileTree = memo34(function FileTree2({
|
|
|
61438
61438
|
});
|
|
61439
61439
|
|
|
61440
61440
|
// src/App.tsx
|
|
61441
|
-
import { useState as useState157, useCallback as useCallback177, useRef as
|
|
61441
|
+
import { useState as useState157, useCallback as useCallback177, useRef as useRef172, useMemo as useMemo77, useLayoutEffect as useLayoutEffect10 } from "react";
|
|
61442
61442
|
|
|
61443
61443
|
// src/components/renders/useRenderQueue.ts
|
|
61444
61444
|
import { useState as useState94, useEffect as useEffect87, useCallback as useCallback80, useRef as useRef103, useMemo as useMemo56 } from "react";
|
|
@@ -62337,7 +62337,7 @@ function AskAgentModal({
|
|
|
62337
62337
|
}
|
|
62338
62338
|
|
|
62339
62339
|
// src/components/AgentRevisionQueue.tsx
|
|
62340
|
-
import { useState as useState97 } from "react";
|
|
62340
|
+
import { useEffect as useEffect89, useRef as useRef107, useState as useState97 } from "react";
|
|
62341
62341
|
import { Fragment as Fragment46, jsx as jsx161, jsxs as jsxs133 } from "react/jsx-runtime";
|
|
62342
62342
|
function formatRevisionTime(value) {
|
|
62343
62343
|
const date = new Date(value);
|
|
@@ -62353,7 +62353,14 @@ function AgentRevisionQueue({
|
|
|
62353
62353
|
const [open, setOpen] = useState97(false);
|
|
62354
62354
|
const [submitting, setSubmitting] = useState97(false);
|
|
62355
62355
|
const [submitState, setSubmitState] = useState97("idle");
|
|
62356
|
+
const reloadedSubmissionRef = useRef107(null);
|
|
62356
62357
|
const sessionActive = submission?.status === "queued" || submission?.status === "running";
|
|
62358
|
+
useEffect89(() => {
|
|
62359
|
+
if (submission?.status === "completed" && submission.submissionId !== reloadedSubmissionRef.current) {
|
|
62360
|
+
reloadedSubmissionRef.current = submission.submissionId;
|
|
62361
|
+
window.location.reload();
|
|
62362
|
+
}
|
|
62363
|
+
}, [submission]);
|
|
62357
62364
|
if (!revisions.length && !submission) return null;
|
|
62358
62365
|
const submitBatch = async () => {
|
|
62359
62366
|
setSubmitting(true);
|
|
@@ -62572,7 +62579,7 @@ function StudioToast({ message, tone, leaving, onDismiss }) {
|
|
|
62572
62579
|
}
|
|
62573
62580
|
|
|
62574
62581
|
// src/components/feedback/StudioFeedbackCard.tsx
|
|
62575
|
-
import { memo as memo35, useState as useState98, useCallback as useCallback82, useRef as
|
|
62582
|
+
import { memo as memo35, useState as useState98, useCallback as useCallback82, useRef as useRef108, useEffect as useEffect90 } from "react";
|
|
62576
62583
|
|
|
62577
62584
|
// src/components/feedback/projectProvenance.ts
|
|
62578
62585
|
var CONFIG_FILES = ["ntvframes.json", "hyperframes.json"];
|
|
@@ -62655,9 +62662,9 @@ var StudioFeedbackCard = memo35(function StudioFeedbackCard2() {
|
|
|
62655
62662
|
const [comment, setComment] = useState98("");
|
|
62656
62663
|
const [hint, setHint] = useState98(null);
|
|
62657
62664
|
const [exiting, setExiting] = useState98(false);
|
|
62658
|
-
const inputRef =
|
|
62659
|
-
const timerRef =
|
|
62660
|
-
const stateRef =
|
|
62665
|
+
const inputRef = useRef108(null);
|
|
62666
|
+
const timerRef = useRef108(null);
|
|
62667
|
+
const stateRef = useRef108({ request, rating, step });
|
|
62661
62668
|
stateRef.current = { request, rating, step };
|
|
62662
62669
|
const clearTimer = useCallback82(() => {
|
|
62663
62670
|
if (timerRef.current) {
|
|
@@ -62692,7 +62699,7 @@ var StudioFeedbackCard = memo35(function StudioFeedbackCard2() {
|
|
|
62692
62699
|
},
|
|
62693
62700
|
[clearTimer]
|
|
62694
62701
|
);
|
|
62695
|
-
|
|
62702
|
+
useEffect90(
|
|
62696
62703
|
() => subscribeToFeedbackRequests((next) => {
|
|
62697
62704
|
setRequest(next);
|
|
62698
62705
|
setRating(null);
|
|
@@ -62704,12 +62711,12 @@ var StudioFeedbackCard = memo35(function StudioFeedbackCard2() {
|
|
|
62704
62711
|
}),
|
|
62705
62712
|
[]
|
|
62706
62713
|
);
|
|
62707
|
-
|
|
62714
|
+
useEffect90(() => {
|
|
62708
62715
|
if (!request || step === "thanks" || rating !== null || comment !== "") return;
|
|
62709
62716
|
timerRef.current = setTimeout(() => close("timeout"), AUTO_DISMISS_MS);
|
|
62710
62717
|
return clearTimer;
|
|
62711
62718
|
}, [request, step, rating, comment, close, clearTimer]);
|
|
62712
|
-
|
|
62719
|
+
useEffect90(() => {
|
|
62713
62720
|
if (step === "comment") inputRef.current?.focus();
|
|
62714
62721
|
}, [step]);
|
|
62715
62722
|
const submit = useCallback82(
|
|
@@ -63012,7 +63019,7 @@ function SaveQueuePausedBanner({ message, onRetry }) {
|
|
|
63012
63019
|
}
|
|
63013
63020
|
|
|
63014
63021
|
// src/components/ExternalFileConflictBanner.tsx
|
|
63015
|
-
import { useRef as
|
|
63022
|
+
import { useRef as useRef109, useState as useState99 } from "react";
|
|
63016
63023
|
import { Fragment as Fragment49, jsx as jsx167, jsxs as jsxs139 } from "react/jsx-runtime";
|
|
63017
63024
|
function errorMessage(error) {
|
|
63018
63025
|
return error instanceof Error ? error.message : String(error);
|
|
@@ -63029,7 +63036,7 @@ function ConflictReview({
|
|
|
63029
63036
|
conflict,
|
|
63030
63037
|
onClose
|
|
63031
63038
|
}) {
|
|
63032
|
-
const containerRef =
|
|
63039
|
+
const containerRef = useRef109(null);
|
|
63033
63040
|
useDialogBehavior({ open: true, onClose, containerRef });
|
|
63034
63041
|
const external = conflict.error.currentContent ?? "(The server did not return file contents.)";
|
|
63035
63042
|
const studio = conflict.error.attemptedContent;
|
|
@@ -63106,7 +63113,7 @@ function FailedDraftReview({
|
|
|
63106
63113
|
content,
|
|
63107
63114
|
onClose
|
|
63108
63115
|
}) {
|
|
63109
|
-
const containerRef =
|
|
63116
|
+
const containerRef = useRef109(null);
|
|
63110
63117
|
useDialogBehavior({ open: true, onClose, containerRef });
|
|
63111
63118
|
return /* @__PURE__ */ jsx167(
|
|
63112
63119
|
"div",
|
|
@@ -63242,7 +63249,7 @@ function ExternalFileConflictBanner({
|
|
|
63242
63249
|
}
|
|
63243
63250
|
|
|
63244
63251
|
// src/captions/hooks/useCaptionSync.ts
|
|
63245
|
-
import { useCallback as useCallback83, useRef as
|
|
63252
|
+
import { useCallback as useCallback83, useRef as useRef110 } from "react";
|
|
63246
63253
|
function buildOverrides(model) {
|
|
63247
63254
|
const entries = [];
|
|
63248
63255
|
let globalWordIndex = 0;
|
|
@@ -63273,12 +63280,12 @@ function buildOverrides(model) {
|
|
|
63273
63280
|
return entries;
|
|
63274
63281
|
}
|
|
63275
63282
|
function useCaptionSync(projectId) {
|
|
63276
|
-
const projectIdRef =
|
|
63283
|
+
const projectIdRef = useRef110(projectId);
|
|
63277
63284
|
projectIdRef.current = projectId;
|
|
63278
|
-
const debounceRef =
|
|
63279
|
-
const suppressSaveRef =
|
|
63280
|
-
const pendingRef =
|
|
63281
|
-
const editSeqRef =
|
|
63285
|
+
const debounceRef = useRef110(null);
|
|
63286
|
+
const suppressSaveRef = useRef110(false);
|
|
63287
|
+
const pendingRef = useRef110(false);
|
|
63288
|
+
const editSeqRef = useRef110(0);
|
|
63282
63289
|
const save = useCallback83(() => {
|
|
63283
63290
|
const state = useCaptionStore.getState();
|
|
63284
63291
|
if (!state.model || !state.sourceFilePath) {
|
|
@@ -63405,7 +63412,7 @@ function useCaptionSync(projectId) {
|
|
|
63405
63412
|
}
|
|
63406
63413
|
|
|
63407
63414
|
// src/hooks/usePersistentEditHistory.ts
|
|
63408
|
-
import { useCallback as useCallback84, useEffect as
|
|
63415
|
+
import { useCallback as useCallback84, useEffect as useEffect91, useMemo as useMemo57, useRef as useRef111, useState as useState100 } from "react";
|
|
63409
63416
|
|
|
63410
63417
|
// src/utils/editHistory.ts
|
|
63411
63418
|
var DEFAULT_MAX_ENTRIES = 100;
|
|
@@ -63765,11 +63772,11 @@ function usePersistentEditHistory(options) {
|
|
|
63765
63772
|
const [state, setState] = useState100(() => createEmptyEditHistory());
|
|
63766
63773
|
const [loaded, setLoaded] = useState100(false);
|
|
63767
63774
|
const projectId = options.projectId;
|
|
63768
|
-
const storeRef =
|
|
63769
|
-
const storeProjectIdRef =
|
|
63770
|
-
const activeProjectIdRef =
|
|
63775
|
+
const storeRef = useRef111(null);
|
|
63776
|
+
const storeProjectIdRef = useRef111(null);
|
|
63777
|
+
const activeProjectIdRef = useRef111(projectId);
|
|
63771
63778
|
activeProjectIdRef.current = projectId;
|
|
63772
|
-
|
|
63779
|
+
useEffect91(() => {
|
|
63773
63780
|
let cancelled = false;
|
|
63774
63781
|
const emptyState = createEmptyEditHistory();
|
|
63775
63782
|
storeRef.current = null;
|
|
@@ -63852,7 +63859,7 @@ function usePersistentEditHistory(options) {
|
|
|
63852
63859
|
}
|
|
63853
63860
|
|
|
63854
63861
|
// src/hooks/usePanelLayout.ts
|
|
63855
|
-
import { useState as useState101, useCallback as useCallback85, useRef as
|
|
63862
|
+
import { useState as useState101, useCallback as useCallback85, useRef as useRef112, useEffect as useEffect92 } from "react";
|
|
63856
63863
|
var NO_OVERRIDE = { left: false, right: false };
|
|
63857
63864
|
function getInitialRightInspectorPanes(tab) {
|
|
63858
63865
|
if (tab === "layers") return { layers: true, design: false };
|
|
@@ -63879,15 +63886,15 @@ function usePanelLayout(initialState2) {
|
|
|
63879
63886
|
const [rightPanelTab, setRightPanelTab] = useState101(
|
|
63880
63887
|
initialState2?.rightPanelTab ?? "design"
|
|
63881
63888
|
);
|
|
63882
|
-
const rightPanelTabRef =
|
|
63889
|
+
const rightPanelTabRef = useRef112(rightPanelTab);
|
|
63883
63890
|
rightPanelTabRef.current = rightPanelTab;
|
|
63884
63891
|
const [rightInspectorPanes, setRightInspectorPanes] = useState101(
|
|
63885
63892
|
() => getInitialRightInspectorPanes(initialState2?.rightPanelTab)
|
|
63886
63893
|
);
|
|
63887
|
-
const rightInspectorPanesRef =
|
|
63894
|
+
const rightInspectorPanesRef = useRef112(rightInspectorPanes);
|
|
63888
63895
|
rightInspectorPanesRef.current = rightInspectorPanes;
|
|
63889
63896
|
const [autoCollapseOverride, setAutoCollapseOverride] = useState101(NO_OVERRIDE);
|
|
63890
|
-
|
|
63897
|
+
useEffect92(() => {
|
|
63891
63898
|
if (typeof window === "undefined") return;
|
|
63892
63899
|
const handleResize = () => {
|
|
63893
63900
|
const width = window.innerWidth;
|
|
@@ -63902,10 +63909,10 @@ function usePanelLayout(initialState2) {
|
|
|
63902
63909
|
const fitted = fitPanelWidths(viewportWidth, preferredWidths, autoCollapseOverride);
|
|
63903
63910
|
const leftCollapsedByWidth = fitted.autoCollapseLeft;
|
|
63904
63911
|
const rightCollapsedByWidth = fitted.autoCollapseRight;
|
|
63905
|
-
const fittedRef =
|
|
63912
|
+
const fittedRef = useRef112(fitted);
|
|
63906
63913
|
fittedRef.current = fitted;
|
|
63907
|
-
const panelDragRef =
|
|
63908
|
-
const preferredRef =
|
|
63914
|
+
const panelDragRef = useRef112(null);
|
|
63915
|
+
const preferredRef = useRef112(preferredWidths);
|
|
63909
63916
|
const setPreferred = useCallback85((side, width) => {
|
|
63910
63917
|
const next = Math.max(0, Math.round(width));
|
|
63911
63918
|
preferredRef.current = { ...preferredRef.current, [side]: next };
|
|
@@ -63933,7 +63940,7 @@ function usePanelLayout(initialState2) {
|
|
|
63933
63940
|
},
|
|
63934
63941
|
[commitPanelWidth]
|
|
63935
63942
|
);
|
|
63936
|
-
const effectiveLeftCollapsedRef =
|
|
63943
|
+
const effectiveLeftCollapsedRef = useRef112(false);
|
|
63937
63944
|
effectiveLeftCollapsedRef.current = leftCollapsed || leftCollapsedByWidth;
|
|
63938
63945
|
const toggleLeftSidebar = useCallback85(() => {
|
|
63939
63946
|
const next = !effectiveLeftCollapsedRef.current;
|
|
@@ -64026,16 +64033,16 @@ function usePanelLayout(initialState2) {
|
|
|
64026
64033
|
}
|
|
64027
64034
|
|
|
64028
64035
|
// src/hooks/useFileManager.ts
|
|
64029
|
-
import { useState as useState103, useCallback as useCallback88, useMemo as useMemo59, useRef as
|
|
64036
|
+
import { useState as useState103, useCallback as useCallback88, useMemo as useMemo59, useRef as useRef114 } from "react";
|
|
64030
64037
|
|
|
64031
64038
|
// src/hooks/useFileTree.ts
|
|
64032
|
-
import { useState as useState102, useCallback as useCallback86, useEffect as
|
|
64039
|
+
import { useState as useState102, useCallback as useCallback86, useEffect as useEffect93, useMemo as useMemo58 } from "react";
|
|
64033
64040
|
function useFileTree({ projectId, projectIdRef }) {
|
|
64034
64041
|
const [projectDir, setProjectDir] = useState102(null);
|
|
64035
64042
|
const [fileTree, setFileTree] = useState102([]);
|
|
64036
64043
|
const [compositionPaths, setCompositionPaths] = useState102([]);
|
|
64037
64044
|
const [fileTreeLoaded, setFileTreeLoaded] = useState102(false);
|
|
64038
|
-
|
|
64045
|
+
useEffect93(() => {
|
|
64039
64046
|
if (!projectId) {
|
|
64040
64047
|
setFileTreeLoaded(false);
|
|
64041
64048
|
return;
|
|
@@ -64090,7 +64097,7 @@ function useFileTree({ projectId, projectIdRef }) {
|
|
|
64090
64097
|
}
|
|
64091
64098
|
|
|
64092
64099
|
// src/hooks/useEditorSave.ts
|
|
64093
|
-
import { useCallback as useCallback87, useRef as
|
|
64100
|
+
import { useCallback as useCallback87, useRef as useRef113 } from "react";
|
|
64094
64101
|
var FAILURE_BURST_MS = 5e3;
|
|
64095
64102
|
function useEditorSave({
|
|
64096
64103
|
editingPathRef,
|
|
@@ -64102,13 +64109,13 @@ function useEditorSave({
|
|
|
64102
64109
|
setRefreshKey,
|
|
64103
64110
|
showToast
|
|
64104
64111
|
}) {
|
|
64105
|
-
const saveRafRef =
|
|
64106
|
-
const refreshRafRef =
|
|
64107
|
-
const lastFailureToastAtRef =
|
|
64108
|
-
const lastFailureReportRef =
|
|
64109
|
-
const pendingCandidateRef =
|
|
64110
|
-
const inFlightRef =
|
|
64111
|
-
const inFlightCandidateRef =
|
|
64112
|
+
const saveRafRef = useRef113(null);
|
|
64113
|
+
const refreshRafRef = useRef113(null);
|
|
64114
|
+
const lastFailureToastAtRef = useRef113(null);
|
|
64115
|
+
const lastFailureReportRef = useRef113(null);
|
|
64116
|
+
const pendingCandidateRef = useRef113(null);
|
|
64117
|
+
const inFlightRef = useRef113(null);
|
|
64118
|
+
const inFlightCandidateRef = useRef113(null);
|
|
64112
64119
|
const reportFailure = useCallback87(
|
|
64113
64120
|
(path, error) => {
|
|
64114
64121
|
const now2 = Date.now();
|
|
@@ -64227,11 +64234,11 @@ function useFileManager({
|
|
|
64227
64234
|
}) {
|
|
64228
64235
|
const [editingFile, setEditingFile] = useState103(null);
|
|
64229
64236
|
const [revealSourceOffset, setRevealSourceOffset] = useState103(null);
|
|
64230
|
-
const editingPathRef =
|
|
64237
|
+
const editingPathRef = useRef114(editingFile?.path);
|
|
64231
64238
|
editingPathRef.current = editingFile?.path;
|
|
64232
|
-
const projectIdRef =
|
|
64239
|
+
const projectIdRef = useRef114(projectId);
|
|
64233
64240
|
projectIdRef.current = projectId;
|
|
64234
|
-
const importedFontAssetsRef =
|
|
64241
|
+
const importedFontAssetsRef = useRef114([]);
|
|
64235
64242
|
const fileVersionScope = useMemo59(
|
|
64236
64243
|
() => ({ projectId, versions: /* @__PURE__ */ new Map() }),
|
|
64237
64244
|
[projectId]
|
|
@@ -64382,8 +64389,8 @@ function useFileManager({
|
|
|
64382
64389
|
},
|
|
64383
64390
|
[fileVersions, updateEditingFileContent, writeProjectFile]
|
|
64384
64391
|
);
|
|
64385
|
-
const revealRequestIdRef =
|
|
64386
|
-
const revealAbortRef =
|
|
64392
|
+
const revealRequestIdRef = useRef114(0);
|
|
64393
|
+
const revealAbortRef = useRef114(null);
|
|
64387
64394
|
const handleFileSelect = useCallback88(
|
|
64388
64395
|
(path) => {
|
|
64389
64396
|
const pid = projectIdRef.current;
|
|
@@ -64671,7 +64678,7 @@ function useFileManager({
|
|
|
64671
64678
|
}
|
|
64672
64679
|
|
|
64673
64680
|
// src/hooks/usePreviewPersistence.ts
|
|
64674
|
-
import { useCallback as useCallback89, useRef as
|
|
64681
|
+
import { useCallback as useCallback89, useRef as useRef115, useState as useState104 } from "react";
|
|
64675
64682
|
|
|
64676
64683
|
// src/utils/gsapUndoRestore.ts
|
|
64677
64684
|
function elementIdentityKey(el) {
|
|
@@ -64907,11 +64914,11 @@ function usePreviewPersistence({
|
|
|
64907
64914
|
}) {
|
|
64908
64915
|
void _recordEdit;
|
|
64909
64916
|
const [domEditSaveQueuePaused, setDomEditSaveQueuePaused] = useState104(null);
|
|
64910
|
-
const domTextCommitVersionRef =
|
|
64911
|
-
const showToastRef =
|
|
64917
|
+
const domTextCommitVersionRef = useRef115(0);
|
|
64918
|
+
const showToastRef = useRef115(showToast);
|
|
64912
64919
|
showToastRef.current = showToast;
|
|
64913
|
-
const domEditSaveQueueRef =
|
|
64914
|
-
const applyStudioManualEditsToPreviewRef =
|
|
64920
|
+
const domEditSaveQueueRef = useRef115(null);
|
|
64921
|
+
const applyStudioManualEditsToPreviewRef = useRef115(async () => {
|
|
64915
64922
|
});
|
|
64916
64923
|
if (!domEditSaveQueueRef.current) {
|
|
64917
64924
|
domEditSaveQueueRef.current = createDomEditSaveQueue({
|
|
@@ -65004,10 +65011,10 @@ function usePreviewPersistence({
|
|
|
65004
65011
|
}
|
|
65005
65012
|
|
|
65006
65013
|
// src/hooks/usePreviewDocumentVersion.ts
|
|
65007
|
-
import { useCallback as useCallback90, useEffect as
|
|
65014
|
+
import { useCallback as useCallback90, useEffect as useEffect94, useRef as useRef116, useState as useState105 } from "react";
|
|
65008
65015
|
function usePreviewDocumentVersion() {
|
|
65009
65016
|
const [previewDocumentVersion, setPreviewDocumentVersion] = useState105(0);
|
|
65010
|
-
const refreshTimersRef =
|
|
65017
|
+
const refreshTimersRef = useRef116([]);
|
|
65011
65018
|
const refresh = useCallback90(() => {
|
|
65012
65019
|
for (const id of refreshTimersRef.current) clearTimeout(id);
|
|
65013
65020
|
refreshTimersRef.current = [];
|
|
@@ -65017,7 +65024,7 @@ function usePreviewDocumentVersion() {
|
|
|
65017
65024
|
window.setTimeout(() => setPreviewDocumentVersion((v) => v + 1), 300)
|
|
65018
65025
|
);
|
|
65019
65026
|
}, []);
|
|
65020
|
-
|
|
65027
|
+
useEffect94(
|
|
65021
65028
|
() => () => {
|
|
65022
65029
|
for (const id of refreshTimersRef.current) clearTimeout(id);
|
|
65023
65030
|
},
|
|
@@ -65027,10 +65034,10 @@ function usePreviewDocumentVersion() {
|
|
|
65027
65034
|
}
|
|
65028
65035
|
|
|
65029
65036
|
// src/hooks/useTimelineEditing.ts
|
|
65030
|
-
import { useCallback as useCallback100, useRef as
|
|
65037
|
+
import { useCallback as useCallback100, useRef as useRef119 } from "react";
|
|
65031
65038
|
|
|
65032
65039
|
// src/hooks/useRazorSplit.ts
|
|
65033
|
-
import { useCallback as useCallback91, useRef as
|
|
65040
|
+
import { useCallback as useCallback91, useRef as useRef117 } from "react";
|
|
65034
65041
|
|
|
65035
65042
|
// src/utils/razorSplitTransaction.ts
|
|
65036
65043
|
function targetIdentity(path, target) {
|
|
@@ -65163,7 +65170,7 @@ function useRazorSplit({
|
|
|
65163
65170
|
forceReloadSdkSession,
|
|
65164
65171
|
isRecordingRef
|
|
65165
65172
|
}) {
|
|
65166
|
-
const projectIdRef =
|
|
65173
|
+
const projectIdRef = useRef117(projectId);
|
|
65167
65174
|
projectIdRef.current = projectId;
|
|
65168
65175
|
const synchronize = useCallback91(() => {
|
|
65169
65176
|
let failure;
|
|
@@ -66641,10 +66648,10 @@ function useTimelineGroupEditing({
|
|
|
66641
66648
|
}
|
|
66642
66649
|
|
|
66643
66650
|
// src/hooks/useBlockedTimelineEditToast.ts
|
|
66644
|
-
import { useCallback as useCallback99, useRef as
|
|
66651
|
+
import { useCallback as useCallback99, useRef as useRef118 } from "react";
|
|
66645
66652
|
var BLOCKED_TOAST_INTERVAL_MS = 1500;
|
|
66646
66653
|
function useBlockedTimelineEditToast(showToast) {
|
|
66647
|
-
const lastAtRef =
|
|
66654
|
+
const lastAtRef = useRef118(0);
|
|
66648
66655
|
return useCallback99(
|
|
66649
66656
|
(_element) => {
|
|
66650
66657
|
const now2 = Date.now();
|
|
@@ -66677,9 +66684,9 @@ function useTimelineEditing({
|
|
|
66677
66684
|
invalidateGsapCache,
|
|
66678
66685
|
handleDomZIndexReorderCommitRef
|
|
66679
66686
|
}) {
|
|
66680
|
-
const projectIdRef =
|
|
66687
|
+
const projectIdRef = useRef119(projectId);
|
|
66681
66688
|
projectIdRef.current = projectId;
|
|
66682
|
-
const editQueueRef =
|
|
66689
|
+
const editQueueRef = useRef119(Promise.resolve());
|
|
66683
66690
|
const enqueueEdit = useCallback100(
|
|
66684
66691
|
(element, label, buildPatches, coalesceKey) => {
|
|
66685
66692
|
if (isRecordingRef?.current) {
|
|
@@ -67064,10 +67071,10 @@ function persistTimelineMoveEditsAtomically(edits, coalesceKey, operation, deps,
|
|
|
67064
67071
|
import { useCallback as useCallback124 } from "react";
|
|
67065
67072
|
|
|
67066
67073
|
// src/hooks/useAskAgentModal.ts
|
|
67067
|
-
import { useState as useState107, useCallback as useCallback102, useEffect as
|
|
67074
|
+
import { useState as useState107, useCallback as useCallback102, useEffect as useEffect96 } from "react";
|
|
67068
67075
|
|
|
67069
67076
|
// src/hooks/useAgentRevisionQueue.ts
|
|
67070
|
-
import { useCallback as useCallback101, useEffect as
|
|
67077
|
+
import { useCallback as useCallback101, useEffect as useEffect95, useRef as useRef120, useState as useState106 } from "react";
|
|
67071
67078
|
var MAX_REVISIONS = 20;
|
|
67072
67079
|
var STORAGE_PREFIX2 = "hyperframes-studio:agent-revisions:";
|
|
67073
67080
|
var SUBMISSION_STORAGE_PREFIX = "hyperframes-studio:agent-revision-submission:";
|
|
@@ -67119,15 +67126,15 @@ function useAgentRevisionQueue(projectId) {
|
|
|
67119
67126
|
const [submission, setSubmission] = useState106(
|
|
67120
67127
|
() => readSubmission(submissionKey)
|
|
67121
67128
|
);
|
|
67122
|
-
const activeKeyRef =
|
|
67123
|
-
const activeSubmissionKeyRef =
|
|
67124
|
-
|
|
67129
|
+
const activeKeyRef = useRef120(key2);
|
|
67130
|
+
const activeSubmissionKeyRef = useRef120(submissionKey);
|
|
67131
|
+
useEffect95(() => {
|
|
67125
67132
|
activeKeyRef.current = key2;
|
|
67126
67133
|
setRevisions(readQueue(key2));
|
|
67127
67134
|
activeSubmissionKeyRef.current = submissionKey;
|
|
67128
67135
|
setSubmission(readSubmission(submissionKey));
|
|
67129
67136
|
}, [key2, submissionKey]);
|
|
67130
|
-
|
|
67137
|
+
useEffect95(() => {
|
|
67131
67138
|
if (activeKeyRef.current !== key2) return;
|
|
67132
67139
|
const storage = safeLocalStorage();
|
|
67133
67140
|
if (!storage || !key2) return;
|
|
@@ -67137,7 +67144,7 @@ function useAgentRevisionQueue(projectId) {
|
|
|
67137
67144
|
} catch {
|
|
67138
67145
|
}
|
|
67139
67146
|
}, [key2, revisions]);
|
|
67140
|
-
|
|
67147
|
+
useEffect95(() => {
|
|
67141
67148
|
if (activeSubmissionKeyRef.current !== submissionKey) return;
|
|
67142
67149
|
const storage = safeLocalStorage();
|
|
67143
67150
|
if (!storage || !submissionKey) return;
|
|
@@ -67150,7 +67157,7 @@ function useAgentRevisionQueue(projectId) {
|
|
|
67150
67157
|
} catch {
|
|
67151
67158
|
}
|
|
67152
67159
|
}, [submissionKey, submission]);
|
|
67153
|
-
|
|
67160
|
+
useEffect95(() => {
|
|
67154
67161
|
const submissionId = submission?.submissionId;
|
|
67155
67162
|
if (!submissionId || submission?.status === "completed" || submission?.status === "failed") {
|
|
67156
67163
|
return;
|
|
@@ -67303,7 +67310,7 @@ function useAskAgentModal({
|
|
|
67303
67310
|
showToast
|
|
67304
67311
|
]
|
|
67305
67312
|
);
|
|
67306
|
-
|
|
67313
|
+
useEffect96(() => {
|
|
67307
67314
|
setAgentPromptTagSnippet(void 0);
|
|
67308
67315
|
setAgentPromptSelectionContext(void 0);
|
|
67309
67316
|
setAgentModalAnchorPoint(null);
|
|
@@ -67327,7 +67334,7 @@ function useAskAgentModal({
|
|
|
67327
67334
|
}
|
|
67328
67335
|
|
|
67329
67336
|
// src/hooks/useDomSelection.ts
|
|
67330
|
-
import { useState as useState108, useCallback as useCallback103, useRef as
|
|
67337
|
+
import { useState as useState108, useCallback as useCallback103, useRef as useRef122, useEffect as useEffect98 } from "react";
|
|
67331
67338
|
|
|
67332
67339
|
// src/utils/domEditHelpers.ts
|
|
67333
67340
|
function domEditSelectionsTargetSame(a, b) {
|
|
@@ -67360,7 +67367,7 @@ function seedDomEditGroupWithSelection(group, selection) {
|
|
|
67360
67367
|
}
|
|
67361
67368
|
|
|
67362
67369
|
// src/hooks/useStudioTestHooks.ts
|
|
67363
|
-
import { useEffect as
|
|
67370
|
+
import { useEffect as useEffect97 } from "react";
|
|
67364
67371
|
|
|
67365
67372
|
// src/player/lib/timelinePerformanceDiagnostics.ts
|
|
67366
67373
|
function readNonNegativeNumber(value) {
|
|
@@ -67443,7 +67450,7 @@ function useStudioTestHooks({
|
|
|
67443
67450
|
buildDomSelectionFromTarget,
|
|
67444
67451
|
applyDomSelection
|
|
67445
67452
|
}) {
|
|
67446
|
-
|
|
67453
|
+
useEffect97(() => {
|
|
67447
67454
|
if (!STUDIO_TEST_HOOKS_ENABLED || typeof window === "undefined") return;
|
|
67448
67455
|
const api = {
|
|
67449
67456
|
runtimeMode: STUDIO_RUNTIME_MODE,
|
|
@@ -67554,14 +67561,14 @@ function useDomSelection({
|
|
|
67554
67561
|
const [domEditGroupSelections, setDomEditGroupSelections] = useState108([]);
|
|
67555
67562
|
const [domEditHoverSelection, setDomEditHoverSelection] = useState108(null);
|
|
67556
67563
|
const [activeGroupElement, setActiveGroupElementState] = useState108(null);
|
|
67557
|
-
const rightPanelTabRef =
|
|
67564
|
+
const rightPanelTabRef = useRef122(rightPanelTab);
|
|
67558
67565
|
rightPanelTabRef.current = rightPanelTab;
|
|
67559
|
-
const domEditSelectionRef =
|
|
67560
|
-
const domEditGroupSelectionsRef =
|
|
67561
|
-
const domEditHoverSelectionRef =
|
|
67562
|
-
const activeGroupElementRef =
|
|
67563
|
-
const compositionIdentityRef =
|
|
67564
|
-
const timelineSelectSeqRef =
|
|
67566
|
+
const domEditSelectionRef = useRef122(domEditSelection);
|
|
67567
|
+
const domEditGroupSelectionsRef = useRef122(domEditGroupSelections);
|
|
67568
|
+
const domEditHoverSelectionRef = useRef122(domEditHoverSelection);
|
|
67569
|
+
const activeGroupElementRef = useRef122(activeGroupElement);
|
|
67570
|
+
const compositionIdentityRef = useRef122({ activeCompPath, projectId });
|
|
67571
|
+
const timelineSelectSeqRef = useRef122(0);
|
|
67565
67572
|
domEditSelectionRef.current = domEditSelection;
|
|
67566
67573
|
domEditGroupSelectionsRef.current = domEditGroupSelections;
|
|
67567
67574
|
domEditHoverSelectionRef.current = domEditHoverSelection;
|
|
@@ -67755,7 +67762,7 @@ function useDomSelection({
|
|
|
67755
67762
|
},
|
|
67756
67763
|
[applyDomSelection, buildDomSelectionForTimelineElement]
|
|
67757
67764
|
);
|
|
67758
|
-
const refreshDomEditGroupSelectionsFromPreviewRef =
|
|
67765
|
+
const refreshDomEditGroupSelectionsFromPreviewRef = useRef122(async () => {
|
|
67759
67766
|
});
|
|
67760
67767
|
const refreshDomEditSelectionFromPreview = useCallback103(
|
|
67761
67768
|
// fallow-ignore-next-line complexity
|
|
@@ -67821,13 +67828,13 @@ function useDomSelection({
|
|
|
67821
67828
|
},
|
|
67822
67829
|
[activeCompPath, announceTimelineSelection2, buildDomSelectionFromTarget, previewIframeRef]
|
|
67823
67830
|
);
|
|
67824
|
-
|
|
67831
|
+
useEffect98(() => {
|
|
67825
67832
|
refreshDomEditGroupSelectionsFromPreviewRef.current = refreshDomEditGroupSelectionsFromPreview;
|
|
67826
67833
|
}, [refreshDomEditGroupSelectionsFromPreview]);
|
|
67827
|
-
|
|
67834
|
+
useEffect98(() => {
|
|
67828
67835
|
updateDomEditHoverSelection(null);
|
|
67829
67836
|
}, [activeCompPath, projectId, previewIframe, refreshKey, updateDomEditHoverSelection]);
|
|
67830
|
-
|
|
67837
|
+
useEffect98(() => {
|
|
67831
67838
|
const previous = compositionIdentityRef.current;
|
|
67832
67839
|
if (previous.activeCompPath === activeCompPath && previous.projectId === projectId) return;
|
|
67833
67840
|
compositionIdentityRef.current = { activeCompPath, projectId };
|
|
@@ -67835,7 +67842,7 @@ function useDomSelection({
|
|
|
67835
67842
|
setActiveGroupElementState(null);
|
|
67836
67843
|
applyDomSelection(null, { revealPanel: false });
|
|
67837
67844
|
}, [activeCompPath, projectId, applyDomSelection]);
|
|
67838
|
-
|
|
67845
|
+
useEffect98(() => {
|
|
67839
67846
|
if (!domEditHoverSelection) return;
|
|
67840
67847
|
const shouldClear = captionEditMode || domEditSelectionsTargetSame(domEditHoverSelection, domEditSelection) || domEditSelectionInGroup(domEditGroupSelections, domEditHoverSelection) || !domEditHoverSelection.element.isConnected;
|
|
67841
67848
|
if (shouldClear) updateDomEditHoverSelection(null);
|
|
@@ -67846,7 +67853,7 @@ function useDomSelection({
|
|
|
67846
67853
|
domEditGroupSelections,
|
|
67847
67854
|
updateDomEditHoverSelection
|
|
67848
67855
|
]);
|
|
67849
|
-
|
|
67856
|
+
useEffect98(() => {
|
|
67850
67857
|
if (!captionEditMode) return;
|
|
67851
67858
|
applyDomSelection(null, { revealPanel: false });
|
|
67852
67859
|
}, [applyDomSelection, captionEditMode]);
|
|
@@ -67913,7 +67920,7 @@ function useDomSelection({
|
|
|
67913
67920
|
}
|
|
67914
67921
|
|
|
67915
67922
|
// src/hooks/usePreviewInteraction.ts
|
|
67916
|
-
import { useCallback as useCallback104, useRef as
|
|
67923
|
+
import { useCallback as useCallback104, useRef as useRef123 } from "react";
|
|
67917
67924
|
var CYCLE_RADIUS_PX = 6;
|
|
67918
67925
|
var CYCLE_WINDOW_MS = 600;
|
|
67919
67926
|
var DOUBLE_CLICK_MS = 400;
|
|
@@ -67930,8 +67937,8 @@ function usePreviewInteraction({
|
|
|
67930
67937
|
setActiveGroupElement,
|
|
67931
67938
|
onClickToSource
|
|
67932
67939
|
}) {
|
|
67933
|
-
const cycleRef =
|
|
67934
|
-
const lastDownRef =
|
|
67940
|
+
const cycleRef = useRef123(null);
|
|
67941
|
+
const lastDownRef = useRef123(null);
|
|
67935
67942
|
const pausePreviewPlayback = useCallback104(() => {
|
|
67936
67943
|
const pausedTime = pauseStudioPreviewPlayback(previewIframeRef.current);
|
|
67937
67944
|
const playerStore = usePlayerStore.getState();
|
|
@@ -68089,7 +68096,7 @@ function usePreviewInteraction({
|
|
|
68089
68096
|
}
|
|
68090
68097
|
|
|
68091
68098
|
// src/hooks/useDomEditCommits.ts
|
|
68092
|
-
import { useCallback as useCallback109, useRef as
|
|
68099
|
+
import { useCallback as useCallback109, useRef as useRef126 } from "react";
|
|
68093
68100
|
import { findUnsafeDomPatchValues as findUnsafeDomPatchValues2 } from "@hyperframes/core/studio-api/finite-mutation";
|
|
68094
68101
|
|
|
68095
68102
|
// src/utils/studioFontHelpers.ts
|
|
@@ -68253,7 +68260,7 @@ function useDomEditPositionPatchCommit({
|
|
|
68253
68260
|
}
|
|
68254
68261
|
|
|
68255
68262
|
// src/hooks/useDomEditTextCommits.ts
|
|
68256
|
-
import { useCallback as useCallback107, useRef as
|
|
68263
|
+
import { useCallback as useCallback107, useRef as useRef125 } from "react";
|
|
68257
68264
|
|
|
68258
68265
|
// src/hooks/domEditTextFieldCommitOps.ts
|
|
68259
68266
|
function hasSameKeysInSamePositions(originalFields, nextFields) {
|
|
@@ -68295,7 +68302,7 @@ function buildTextFieldChildOperations(originalFields, nextFields) {
|
|
|
68295
68302
|
}
|
|
68296
68303
|
|
|
68297
68304
|
// src/hooks/useDomEditAttributeCommits.ts
|
|
68298
|
-
import { useCallback as useCallback106, useRef as
|
|
68305
|
+
import { useCallback as useCallback106, useRef as useRef124 } from "react";
|
|
68299
68306
|
import { HF_AUDIO_GROUP_ATTR as HF_AUDIO_GROUP_ATTR5, HF_AUDIO_GROUP_TAG as HF_AUDIO_GROUP_TAG8 } from "@hyperframes/core/audio-groups";
|
|
68300
68307
|
function resolveFullAttrName(attr, prefixData) {
|
|
68301
68308
|
return prefixData && !attr.startsWith("data-") ? `data-${attr}` : attr;
|
|
@@ -68335,7 +68342,7 @@ function useDomEditAttributeCommits({
|
|
|
68335
68342
|
refreshDomEditSelectionFromPreview,
|
|
68336
68343
|
persistDomEditOperations
|
|
68337
68344
|
}) {
|
|
68338
|
-
const domAttributeCommitVersionRef =
|
|
68345
|
+
const domAttributeCommitVersionRef = useRef124(/* @__PURE__ */ new Map());
|
|
68339
68346
|
const commitDataAttribute = useCallback106(
|
|
68340
68347
|
async (attr, value, options) => {
|
|
68341
68348
|
if (!domEditSelection) return;
|
|
@@ -68630,8 +68637,8 @@ function useDomEditTextCommits({
|
|
|
68630
68637
|
persistDomEditOperations,
|
|
68631
68638
|
resolveImportedFontAsset
|
|
68632
68639
|
}) {
|
|
68633
|
-
const domTextCommitVersionRef =
|
|
68634
|
-
const domStyleCommitVersionRef =
|
|
68640
|
+
const domTextCommitVersionRef = useRef125(0);
|
|
68641
|
+
const domStyleCommitVersionRef = useRef125(/* @__PURE__ */ new Map());
|
|
68635
68642
|
const {
|
|
68636
68643
|
handleDomAttributeCommit,
|
|
68637
68644
|
handleDomAttributeLiveCommit,
|
|
@@ -69524,7 +69531,7 @@ function useDomEditCommits({
|
|
|
69524
69531
|
},
|
|
69525
69532
|
[fileTree, projectId, importedFontAssetsRef]
|
|
69526
69533
|
);
|
|
69527
|
-
const reportedUnresolvableRef =
|
|
69534
|
+
const reportedUnresolvableRef = useRef126(/* @__PURE__ */ new Set());
|
|
69528
69535
|
const persistDomEditOperations = useCallback109(
|
|
69529
69536
|
// fallow-ignore-next-line complexity
|
|
69530
69537
|
async (selection, operations, options) => {
|
|
@@ -69886,7 +69893,7 @@ function useGroupCommits(params) {
|
|
|
69886
69893
|
}
|
|
69887
69894
|
|
|
69888
69895
|
// src/hooks/useGsapScriptCommits.ts
|
|
69889
|
-
import { useCallback as useCallback116, useMemo as useMemo60, useRef as
|
|
69896
|
+
import { useCallback as useCallback116, useMemo as useMemo60, useRef as useRef128 } from "react";
|
|
69890
69897
|
import { findUnsafeMutationValues } from "@hyperframes/core/studio-api/finite-mutation";
|
|
69891
69898
|
|
|
69892
69899
|
// src/hooks/gsapRuntimePatch.ts
|
|
@@ -70681,7 +70688,7 @@ function useGsapKeyframeOps({
|
|
|
70681
70688
|
}
|
|
70682
70689
|
|
|
70683
70690
|
// src/hooks/useGsapPropertyDebounce.ts
|
|
70684
|
-
import { useCallback as useCallback114, useEffect as
|
|
70691
|
+
import { useCallback as useCallback114, useEffect as useEffect99, useRef as useRef127 } from "react";
|
|
70685
70692
|
import { parseGsapScriptAcorn } from "@hyperframes/core/gsap-parser-acorn";
|
|
70686
70693
|
var DEBOUNCE_MS = 150;
|
|
70687
70694
|
function mergeTweenProperties(sdkSession, animationId, edited, kind) {
|
|
@@ -70697,9 +70704,9 @@ function mergeTweenProperties(sdkSession, animationId, edited, kind) {
|
|
|
70697
70704
|
}
|
|
70698
70705
|
}
|
|
70699
70706
|
function useGsapPropertyDebounce(commitMutationSafely, sdk) {
|
|
70700
|
-
const pendingPropertyEditRef =
|
|
70701
|
-
const debounceTimerRef =
|
|
70702
|
-
const sdkRef =
|
|
70707
|
+
const pendingPropertyEditRef = useRef127(null);
|
|
70708
|
+
const debounceTimerRef = useRef127(null);
|
|
70709
|
+
const sdkRef = useRef127(sdk);
|
|
70703
70710
|
sdkRef.current = sdk;
|
|
70704
70711
|
const flushPendingPropertyEdit = useCallback114(async () => {
|
|
70705
70712
|
const pending2 = pendingPropertyEditRef.current;
|
|
@@ -70751,7 +70758,7 @@ function useGsapPropertyDebounce(commitMutationSafely, sdk) {
|
|
|
70751
70758
|
},
|
|
70752
70759
|
[flushPendingPropertyEdit]
|
|
70753
70760
|
);
|
|
70754
|
-
|
|
70761
|
+
useEffect99(() => {
|
|
70755
70762
|
return () => {
|
|
70756
70763
|
if (debounceTimerRef.current) clearTimeout(debounceTimerRef.current);
|
|
70757
70764
|
void flushPendingPropertyEdit();
|
|
@@ -71130,9 +71137,9 @@ function instantPatchesFor(options) {
|
|
|
71130
71137
|
}
|
|
71131
71138
|
function useGsapScriptCommits({ projectIdRef, activeCompPath, previewIframeRef, editHistory, domEditSaveTimestampRef, reloadPreview, onCacheInvalidate, onFileContentChanged, showToast, sdkSession, publishSdkSession, writeProjectFile, forceReloadSdkSession }) {
|
|
71132
71139
|
const activeProjectId = projectIdRef.current;
|
|
71133
|
-
const activeCompPathRef =
|
|
71140
|
+
const activeCompPathRef = useRef128(activeCompPath);
|
|
71134
71141
|
activeCompPathRef.current = activeCompPath;
|
|
71135
|
-
const serializerRef =
|
|
71142
|
+
const serializerRef = useRef128(createKeyedSerializer());
|
|
71136
71143
|
const recordMutationEdit = useCallback116(async (targetPath, result, options) => {
|
|
71137
71144
|
if (result.before == null || result.after == null) return;
|
|
71138
71145
|
await editHistory.recordEdit({
|
|
@@ -71316,10 +71323,10 @@ function useGsapScriptCommits({ projectIdRef, activeCompPath, previewIframeRef,
|
|
|
71316
71323
|
}
|
|
71317
71324
|
|
|
71318
71325
|
// src/hooks/useDomEditWiring.ts
|
|
71319
|
-
import { useCallback as useCallback120, useEffect as
|
|
71326
|
+
import { useCallback as useCallback120, useEffect as useEffect101, useRef as useRef131 } from "react";
|
|
71320
71327
|
|
|
71321
71328
|
// src/hooks/useDomEditPreviewSync.ts
|
|
71322
|
-
import { useEffect as
|
|
71329
|
+
import { useEffect as useEffect100, useRef as useRef129 } from "react";
|
|
71323
71330
|
function useDomEditPreviewSync({
|
|
71324
71331
|
previewIframe,
|
|
71325
71332
|
activeCompPath,
|
|
@@ -71337,7 +71344,7 @@ function useDomEditPreviewSync({
|
|
|
71337
71344
|
getSidebarTab,
|
|
71338
71345
|
gsapCacheVersion
|
|
71339
71346
|
}) {
|
|
71340
|
-
|
|
71347
|
+
useEffect100(() => {
|
|
71341
71348
|
if (!previewIframe) return;
|
|
71342
71349
|
const syncSelectionFromDocument = async () => {
|
|
71343
71350
|
if (captionEditMode) return;
|
|
@@ -71398,9 +71405,9 @@ function useDomEditPreviewSync({
|
|
|
71398
71405
|
applyStudioManualEditsToPreviewRef,
|
|
71399
71406
|
gsapCacheVersion
|
|
71400
71407
|
]);
|
|
71401
|
-
const openSourceRef =
|
|
71408
|
+
const openSourceRef = useRef129(openSourceForSelection);
|
|
71402
71409
|
openSourceRef.current = openSourceForSelection;
|
|
71403
|
-
|
|
71410
|
+
useEffect100(
|
|
71404
71411
|
// fallow-ignore-next-line complexity
|
|
71405
71412
|
() => {
|
|
71406
71413
|
if (!domEditSelection || !openSourceRef.current || !getSidebarTab) return;
|
|
@@ -71493,7 +71500,7 @@ function useGsapInteractionFailureTelemetry(activeCompPath, showToast) {
|
|
|
71493
71500
|
}
|
|
71494
71501
|
|
|
71495
71502
|
// src/hooks/useGsapSelectionHandlers.ts
|
|
71496
|
-
import { useCallback as useCallback119, useRef as
|
|
71503
|
+
import { useCallback as useCallback119, useRef as useRef130 } from "react";
|
|
71497
71504
|
function useGsapSelectionHandlers({
|
|
71498
71505
|
domEditSelection,
|
|
71499
71506
|
updateGsapProperty,
|
|
@@ -71517,7 +71524,7 @@ function useGsapSelectionHandlers({
|
|
|
71517
71524
|
selectedGsapAnimations,
|
|
71518
71525
|
showToast
|
|
71519
71526
|
}) {
|
|
71520
|
-
const lastSelectionRef =
|
|
71527
|
+
const lastSelectionRef = useRef130(null);
|
|
71521
71528
|
if (domEditSelection) lastSelectionRef.current = domEditSelection;
|
|
71522
71529
|
const resolveWriteSelection = useCallback119(
|
|
71523
71530
|
(selectionOverride) => selectionOverride === void 0 ? domEditSelection ?? lastSelectionRef.current : selectionOverride,
|
|
@@ -71842,7 +71849,7 @@ function useDomEditWiring({
|
|
|
71842
71849
|
},
|
|
71843
71850
|
[openSourceForSelection, selectSidebarTab]
|
|
71844
71851
|
);
|
|
71845
|
-
|
|
71852
|
+
useEffect101(() => {
|
|
71846
71853
|
if (!domEditSelection?.id) return;
|
|
71847
71854
|
const { selectedElementId, elements, setSelectedElementId } = usePlayerStore.getState();
|
|
71848
71855
|
const matchKey = elements.find(
|
|
@@ -71851,8 +71858,8 @@ function useDomEditWiring({
|
|
|
71851
71858
|
const key2 = matchKey ? matchKey.key ?? matchKey.id : null;
|
|
71852
71859
|
if (key2 && key2 !== selectedElementId) setSelectedElementId(key2);
|
|
71853
71860
|
}, [domEditSelection?.id]);
|
|
71854
|
-
const prevRefreshKeyRef =
|
|
71855
|
-
|
|
71861
|
+
const prevRefreshKeyRef = useRef131(refreshKey);
|
|
71862
|
+
useEffect101(() => {
|
|
71856
71863
|
if (refreshKey !== prevRefreshKeyRef.current) {
|
|
71857
71864
|
prevRefreshKeyRef.current = refreshKey;
|
|
71858
71865
|
bumpGsapCache();
|
|
@@ -72938,7 +72945,7 @@ function useGsapAwareEditing({
|
|
|
72938
72945
|
}
|
|
72939
72946
|
|
|
72940
72947
|
// src/hooks/useStudioSelectionPublisher.ts
|
|
72941
|
-
import { useEffect as
|
|
72948
|
+
import { useEffect as useEffect102, useRef as useRef132 } from "react";
|
|
72942
72949
|
|
|
72943
72950
|
// src/utils/studioSelectionSnapshot.ts
|
|
72944
72951
|
function round34(value) {
|
|
@@ -73029,9 +73036,9 @@ function useStudioSelectionPublisher({
|
|
|
73029
73036
|
previewDocumentVersion,
|
|
73030
73037
|
refreshDomEditSelectionFromPreview
|
|
73031
73038
|
}) {
|
|
73032
|
-
const lastSelectionRefreshKeyRef =
|
|
73033
|
-
const pendingSelectionRefreshKeyRef =
|
|
73034
|
-
|
|
73039
|
+
const lastSelectionRefreshKeyRef = useRef132(refreshKey);
|
|
73040
|
+
const pendingSelectionRefreshKeyRef = useRef132(null);
|
|
73041
|
+
useEffect102(() => {
|
|
73035
73042
|
if (!projectId) return;
|
|
73036
73043
|
const selection = domEditSelection?.element.isConnected ? buildStudioSelectionSnapshot({
|
|
73037
73044
|
projectId,
|
|
@@ -73042,13 +73049,13 @@ function useStudioSelectionPublisher({
|
|
|
73042
73049
|
void putSelection(projectId, selection, controller.signal).catch(reportSelectionPublishError);
|
|
73043
73050
|
return () => controller.abort();
|
|
73044
73051
|
}, [domEditSelection, projectId]);
|
|
73045
|
-
|
|
73052
|
+
useEffect102(() => {
|
|
73046
73053
|
if (!projectId) return;
|
|
73047
73054
|
return () => {
|
|
73048
73055
|
void putSelection(projectId, null).catch(reportSelectionPublishError);
|
|
73049
73056
|
};
|
|
73050
73057
|
}, [projectId]);
|
|
73051
|
-
|
|
73058
|
+
useEffect102(() => {
|
|
73052
73059
|
if (lastSelectionRefreshKeyRef.current === refreshKey) return;
|
|
73053
73060
|
lastSelectionRefreshKeyRef.current = refreshKey;
|
|
73054
73061
|
pendingSelectionRefreshKeyRef.current = domEditSelectionRef.current ? refreshKey : null;
|
|
@@ -73057,7 +73064,7 @@ function useStudioSelectionPublisher({
|
|
|
73057
73064
|
void putSelection(projectId, null, controller.signal).catch(reportSelectionPublishError);
|
|
73058
73065
|
return () => controller.abort();
|
|
73059
73066
|
}, [domEditSelectionRef, projectId, refreshKey]);
|
|
73060
|
-
|
|
73067
|
+
useEffect102(() => {
|
|
73061
73068
|
if (pendingSelectionRefreshKeyRef.current === null) return;
|
|
73062
73069
|
pendingSelectionRefreshKeyRef.current = null;
|
|
73063
73070
|
const selection = domEditSelectionRef.current;
|
|
@@ -73619,23 +73626,23 @@ function useDomEditSession({
|
|
|
73619
73626
|
}
|
|
73620
73627
|
|
|
73621
73628
|
// src/hooks/useSdkSelectionSync.ts
|
|
73622
|
-
import { useEffect as
|
|
73629
|
+
import { useEffect as useEffect103 } from "react";
|
|
73623
73630
|
function toHfIds(group, primary) {
|
|
73624
73631
|
const source = group.length > 0 ? group : primary ? [primary] : [];
|
|
73625
73632
|
return source.flatMap((s) => s.hfId ? [s.hfId] : []);
|
|
73626
73633
|
}
|
|
73627
73634
|
function useSdkSelectionSync(session, domEditSelection, domEditGroupSelections) {
|
|
73628
|
-
|
|
73635
|
+
useEffect103(() => {
|
|
73629
73636
|
if (!session) return;
|
|
73630
73637
|
session.setSelection(toHfIds(domEditGroupSelections, domEditSelection));
|
|
73631
73638
|
}, [session, domEditSelection, domEditGroupSelections]);
|
|
73632
73639
|
}
|
|
73633
73640
|
|
|
73634
73641
|
// src/hooks/useStudioSdkSessions.ts
|
|
73635
|
-
import { useEffect as
|
|
73642
|
+
import { useEffect as useEffect105 } from "react";
|
|
73636
73643
|
|
|
73637
73644
|
// src/hooks/useSdkSession.ts
|
|
73638
|
-
import { useState as useState109, useEffect as
|
|
73645
|
+
import { useState as useState109, useEffect as useEffect104, useCallback as useCallback125, useRef as useRef133 } from "react";
|
|
73639
73646
|
import { openComposition as openComposition3 } from "@hyperframes/sdk";
|
|
73640
73647
|
|
|
73641
73648
|
// src/hooks/externalFileReloadBus.ts
|
|
@@ -73644,14 +73651,6 @@ function addExternalFileReloadListener(listener2) {
|
|
|
73644
73651
|
listeners.add(listener2);
|
|
73645
73652
|
return () => listeners.delete(listener2);
|
|
73646
73653
|
}
|
|
73647
|
-
function notifyExternalFileReload(path) {
|
|
73648
|
-
for (const listener2 of listeners) {
|
|
73649
|
-
try {
|
|
73650
|
-
listener2(path);
|
|
73651
|
-
} catch {
|
|
73652
|
-
}
|
|
73653
|
-
}
|
|
73654
|
-
}
|
|
73655
73654
|
|
|
73656
73655
|
// src/hooks/useSdkSession.ts
|
|
73657
73656
|
async function readProjectFileOptional(projectId, path) {
|
|
@@ -73685,23 +73684,23 @@ function disposeSdkSession(session) {
|
|
|
73685
73684
|
}
|
|
73686
73685
|
function useSdkSession(projectId, activeCompPath) {
|
|
73687
73686
|
const [ownedSession, setOwnedSession] = useState109(null);
|
|
73688
|
-
const ownedSessionRef =
|
|
73689
|
-
const sessionOwnersRef =
|
|
73690
|
-
const generationRef =
|
|
73691
|
-
const projectIdRef =
|
|
73687
|
+
const ownedSessionRef = useRef133(null);
|
|
73688
|
+
const sessionOwnersRef = useRef133(/* @__PURE__ */ new WeakMap());
|
|
73689
|
+
const generationRef = useRef133(0);
|
|
73690
|
+
const projectIdRef = useRef133(projectId);
|
|
73692
73691
|
projectIdRef.current = projectId;
|
|
73693
|
-
const activeCompPathRef =
|
|
73692
|
+
const activeCompPathRef = useRef133(activeCompPath);
|
|
73694
73693
|
activeCompPathRef.current = activeCompPath;
|
|
73695
73694
|
const [reloadToken, setReloadToken] = useState109(0);
|
|
73696
|
-
const reloadTokenRef =
|
|
73695
|
+
const reloadTokenRef = useRef133(reloadToken);
|
|
73697
73696
|
reloadTokenRef.current = reloadToken;
|
|
73698
|
-
|
|
73697
|
+
useEffect104(
|
|
73699
73698
|
() => addExternalFileReloadListener((changedPath) => {
|
|
73700
73699
|
if (changedPath === activeCompPathRef.current) setReloadToken((token) => token + 1);
|
|
73701
73700
|
}),
|
|
73702
73701
|
[]
|
|
73703
73702
|
);
|
|
73704
|
-
|
|
73703
|
+
useEffect104(() => {
|
|
73705
73704
|
const generation = ++generationRef.current;
|
|
73706
73705
|
let cancelled = false;
|
|
73707
73706
|
const previous = ownedSessionRef.current;
|
|
@@ -73785,7 +73784,7 @@ function useSdkSession(projectId, activeCompPath) {
|
|
|
73785
73784
|
function useStudioSdkSessions(projectId, activeCompPath, masterCompPath) {
|
|
73786
73785
|
const sdkHandle = useSdkSession(projectId, activeCompPath ?? masterCompPath);
|
|
73787
73786
|
const editFlowSdkSession = activeCompPath ? sdkHandle.session : null;
|
|
73788
|
-
|
|
73787
|
+
useEffect105(() => {
|
|
73789
73788
|
usePreviewVariablesStore.getState().setValues(null);
|
|
73790
73789
|
}, [projectId, activeCompPath]);
|
|
73791
73790
|
return { sdkHandle, editFlowSdkSession };
|
|
@@ -73893,7 +73892,7 @@ async function deleteExternalConflictSnapshot(projectId, filePath) {
|
|
|
73893
73892
|
}
|
|
73894
73893
|
|
|
73895
73894
|
// src/hooks/useExternalFileChangeCoordinator.ts
|
|
73896
|
-
import { useCallback as useCallback126, useEffect as
|
|
73895
|
+
import { useCallback as useCallback126, useEffect as useEffect106, useRef as useRef134, useState as useState110 } from "react";
|
|
73897
73896
|
function testHotAdapter() {
|
|
73898
73897
|
const value = globalThis.__HF_STUDIO_HOT_TEST_ADAPTER__;
|
|
73899
73898
|
if (!value || typeof value !== "object") return null;
|
|
@@ -73932,8 +73931,7 @@ function useExternalFileChangeCoordinator({
|
|
|
73932
73931
|
drainPendingChanges,
|
|
73933
73932
|
getPendingCandidate,
|
|
73934
73933
|
discardPendingChanges,
|
|
73935
|
-
|
|
73936
|
-
reloadSdkSession,
|
|
73934
|
+
reloadPage,
|
|
73937
73935
|
persistConflictSnapshot,
|
|
73938
73936
|
persistFailureSnapshot,
|
|
73939
73937
|
loadConflictSnapshot,
|
|
@@ -73944,25 +73942,25 @@ function useExternalFileChangeCoordinator({
|
|
|
73944
73942
|
resetSaveQueues
|
|
73945
73943
|
}) {
|
|
73946
73944
|
const [blocked, setBlocked] = useState110(null);
|
|
73947
|
-
const generationRef =
|
|
73948
|
-
const mountedRef =
|
|
73949
|
-
const lastEventIdentityRef =
|
|
73950
|
-
const blockedRef =
|
|
73951
|
-
const snapshotWriteTailRef =
|
|
73945
|
+
const generationRef = useRef134(0);
|
|
73946
|
+
const mountedRef = useRef134(true);
|
|
73947
|
+
const lastEventIdentityRef = useRef134(null);
|
|
73948
|
+
const blockedRef = useRef134(blocked);
|
|
73949
|
+
const snapshotWriteTailRef = useRef134(Promise.resolve());
|
|
73952
73950
|
blockedRef.current = blocked;
|
|
73953
|
-
|
|
73951
|
+
useEffect106(() => {
|
|
73954
73952
|
mountedRef.current = true;
|
|
73955
73953
|
return () => {
|
|
73956
73954
|
mountedRef.current = false;
|
|
73957
73955
|
generationRef.current += 1;
|
|
73958
73956
|
};
|
|
73959
73957
|
}, []);
|
|
73960
|
-
|
|
73958
|
+
useEffect106(() => {
|
|
73961
73959
|
generationRef.current += 1;
|
|
73962
73960
|
setBlocked(null);
|
|
73963
73961
|
lastEventIdentityRef.current = null;
|
|
73964
73962
|
}, [projectId, activeCompPath]);
|
|
73965
|
-
|
|
73963
|
+
useEffect106(() => {
|
|
73966
73964
|
if (!projectId || !recoveryFilePath || !loadConflictSnapshot) return;
|
|
73967
73965
|
const generation = ++generationRef.current;
|
|
73968
73966
|
let cancelled = false;
|
|
@@ -74003,10 +74001,9 @@ function useExternalFileChangeCoordinator({
|
|
|
74003
74001
|
const reloadAcceptedGeneration = useCallback126(
|
|
74004
74002
|
(path) => {
|
|
74005
74003
|
logReload("reload", { path, by: "external-change coordinator" });
|
|
74006
|
-
|
|
74007
|
-
reloadSdkSession(path);
|
|
74004
|
+
(reloadPage ?? (() => window.location.reload()))();
|
|
74008
74005
|
},
|
|
74009
|
-
[
|
|
74006
|
+
[reloadPage]
|
|
74010
74007
|
);
|
|
74011
74008
|
const persistSnapshotInOrder = useCallback126(async (write) => {
|
|
74012
74009
|
const next = snapshotWriteTailRef.current.catch(() => void 0).then(write);
|
|
@@ -74125,7 +74122,7 @@ function useExternalFileChangeCoordinator({
|
|
|
74125
74122
|
reloadAcceptedGeneration
|
|
74126
74123
|
]
|
|
74127
74124
|
);
|
|
74128
|
-
|
|
74125
|
+
useEffect106(() => {
|
|
74129
74126
|
const handler = (payload) => processChange(payload);
|
|
74130
74127
|
const adapter = testHotAdapter();
|
|
74131
74128
|
if (adapter) {
|
|
@@ -74235,8 +74232,7 @@ function useStudioExternalFileChanges({
|
|
|
74235
74232
|
masterCompPath,
|
|
74236
74233
|
fileManager,
|
|
74237
74234
|
previewPersistence,
|
|
74238
|
-
pendingTimelineEditPathRef
|
|
74239
|
-
reloadPreview
|
|
74235
|
+
pendingTimelineEditPathRef
|
|
74240
74236
|
}) {
|
|
74241
74237
|
const { flushPendingSourceSave, discardPendingSourceSave } = fileManager;
|
|
74242
74238
|
const { drainPendingDomEditSaves, resetDomEditSaveQueueBreaker } = previewPersistence;
|
|
@@ -74257,8 +74253,6 @@ function useStudioExternalFileChanges({
|
|
|
74257
74253
|
drainPendingChanges,
|
|
74258
74254
|
getPendingCandidate: fileManager.getPendingSourceCandidate,
|
|
74259
74255
|
discardPendingChanges,
|
|
74260
|
-
reloadPreview,
|
|
74261
|
-
reloadSdkSession: notifyExternalFileReload,
|
|
74262
74256
|
persistConflictSnapshot: persistExternalConflictSnapshot,
|
|
74263
74257
|
persistFailureSnapshot: persistExternalFailureSnapshot,
|
|
74264
74258
|
loadConflictSnapshot: loadExternalConflictSnapshot,
|
|
@@ -74271,7 +74265,7 @@ function useStudioExternalFileChanges({
|
|
|
74271
74265
|
}
|
|
74272
74266
|
|
|
74273
74267
|
// src/hooks/useBlockHandlers.ts
|
|
74274
|
-
import { useCallback as useCallback128, useMemo as useMemo61, useRef as
|
|
74268
|
+
import { useCallback as useCallback128, useMemo as useMemo61, useRef as useRef135, useState as useState111 } from "react";
|
|
74275
74269
|
|
|
74276
74270
|
// src/utils/blockInstaller.ts
|
|
74277
74271
|
function getMaxZIndexFromIframe(iframe) {
|
|
@@ -74480,7 +74474,7 @@ function useBlockHandlers({
|
|
|
74480
74474
|
blockCtxDeps.showToast
|
|
74481
74475
|
]
|
|
74482
74476
|
);
|
|
74483
|
-
const installingBlockRef =
|
|
74477
|
+
const installingBlockRef = useRef135(false);
|
|
74484
74478
|
const runBlockInstall = useCallback128(
|
|
74485
74479
|
async (blockName, install) => {
|
|
74486
74480
|
if (installingBlockRef.current) {
|
|
@@ -74591,7 +74585,7 @@ function useBlockHandlers({
|
|
|
74591
74585
|
}
|
|
74592
74586
|
|
|
74593
74587
|
// src/hooks/useAppHotkeys.ts
|
|
74594
|
-
import { useCallback as useCallback129, useEffect as
|
|
74588
|
+
import { useCallback as useCallback129, useEffect as useEffect107, useRef as useRef136 } from "react";
|
|
74595
74589
|
function iframeContentWindow(iframe) {
|
|
74596
74590
|
try {
|
|
74597
74591
|
return iframe?.contentWindow ?? null;
|
|
@@ -74799,7 +74793,7 @@ function useAppHotkeys({
|
|
|
74799
74793
|
activeCompPath,
|
|
74800
74794
|
forceReloadSdkSession
|
|
74801
74795
|
}) {
|
|
74802
|
-
const previewHistoryCleanupRef =
|
|
74796
|
+
const previewHistoryCleanupRef = useRef136(null);
|
|
74803
74797
|
const readHistoryFile = useCallback129(
|
|
74804
74798
|
(path) => path === STUDIO_MOTION_PATH ? readOptionalProjectFile(path) : readProjectFile(path),
|
|
74805
74799
|
[readOptionalProjectFile, readProjectFile]
|
|
@@ -74864,7 +74858,7 @@ function useAppHotkeys({
|
|
|
74864
74858
|
);
|
|
74865
74859
|
const handleUndo = useCallback129(() => applyHistory("undo"), [applyHistory]);
|
|
74866
74860
|
const handleRedo = useCallback129(() => applyHistory("redo"), [applyHistory]);
|
|
74867
|
-
const cbRef =
|
|
74861
|
+
const cbRef = useRef136(null);
|
|
74868
74862
|
cbRef.current = {
|
|
74869
74863
|
handleTimelineElementsDelete,
|
|
74870
74864
|
handleTimelineElementSplit,
|
|
@@ -74892,7 +74886,7 @@ function useAppHotkeys({
|
|
|
74892
74886
|
}
|
|
74893
74887
|
if (!isTypingTarget(event.target)) dispatchPlainKey(event, key2, cb);
|
|
74894
74888
|
}, []);
|
|
74895
|
-
|
|
74889
|
+
useEffect107(() => {
|
|
74896
74890
|
window.addEventListener("keydown", handleAppKeyDown, true);
|
|
74897
74891
|
return () => window.removeEventListener("keydown", handleAppKeyDown, true);
|
|
74898
74892
|
}, [handleAppKeyDown]);
|
|
@@ -74929,7 +74923,7 @@ function useAppHotkeys({
|
|
|
74929
74923
|
},
|
|
74930
74924
|
[handleAppKeyDown, handleHistoryHotkey]
|
|
74931
74925
|
);
|
|
74932
|
-
|
|
74926
|
+
useEffect107(
|
|
74933
74927
|
() => () => {
|
|
74934
74928
|
previewHistoryCleanupRef.current?.();
|
|
74935
74929
|
previewHistoryCleanupRef.current = null;
|
|
@@ -74944,7 +74938,7 @@ function useAppHotkeys({
|
|
|
74944
74938
|
}
|
|
74945
74939
|
|
|
74946
74940
|
// src/hooks/useClipboard.ts
|
|
74947
|
-
import { useCallback as useCallback130, useRef as
|
|
74941
|
+
import { useCallback as useCallback130, useRef as useRef137 } from "react";
|
|
74948
74942
|
|
|
74949
74943
|
// src/utils/clipboardPayload.ts
|
|
74950
74944
|
function insertAsSibling(source, newHtml, selector, selectorIndex) {
|
|
@@ -75051,8 +75045,8 @@ function useClipboard({
|
|
|
75051
75045
|
handleDomEditElementDelete,
|
|
75052
75046
|
previewIframeRef
|
|
75053
75047
|
}) {
|
|
75054
|
-
const clipboardRef =
|
|
75055
|
-
const projectIdRef =
|
|
75048
|
+
const clipboardRef = useRef137(null);
|
|
75049
|
+
const projectIdRef = useRef137(projectId);
|
|
75056
75050
|
projectIdRef.current = projectId;
|
|
75057
75051
|
const handleCopy2 = useCallback130(() => {
|
|
75058
75052
|
const { selectedElementId, elements } = usePlayerStore.getState();
|
|
@@ -75186,7 +75180,7 @@ function useClipboard({
|
|
|
75186
75180
|
}
|
|
75187
75181
|
|
|
75188
75182
|
// src/hooks/useCaptionDetection.ts
|
|
75189
|
-
import { useEffect as
|
|
75183
|
+
import { useEffect as useEffect108, useRef as useRef138 } from "react";
|
|
75190
75184
|
|
|
75191
75185
|
// src/captions/types.ts
|
|
75192
75186
|
var DEFAULT_STYLE = {
|
|
@@ -75438,8 +75432,8 @@ function useCaptionDetection({
|
|
|
75438
75432
|
captionSync,
|
|
75439
75433
|
setRightCollapsed
|
|
75440
75434
|
}) {
|
|
75441
|
-
const prevCompPathRef =
|
|
75442
|
-
|
|
75435
|
+
const prevCompPathRef = useRef138(activeCompPath);
|
|
75436
|
+
useEffect108(() => {
|
|
75443
75437
|
if (prevCompPathRef.current !== activeCompPath) {
|
|
75444
75438
|
prevCompPathRef.current = activeCompPath;
|
|
75445
75439
|
const store = useCaptionStore.getState();
|
|
@@ -75449,7 +75443,7 @@ function useCaptionDetection({
|
|
|
75449
75443
|
}
|
|
75450
75444
|
}
|
|
75451
75445
|
}, [activeCompPath]);
|
|
75452
|
-
|
|
75446
|
+
useEffect108(() => {
|
|
75453
75447
|
if (!projectId) return;
|
|
75454
75448
|
let activating = false;
|
|
75455
75449
|
const tryActivateCaptions = () => {
|
|
@@ -75530,7 +75524,7 @@ function useCaptionDetection({
|
|
|
75530
75524
|
window.removeEventListener("message", handleMessage);
|
|
75531
75525
|
};
|
|
75532
75526
|
}, [activeCompPath, projectId, compIdToSrc, captionSync, previewIframeRef]);
|
|
75533
|
-
|
|
75527
|
+
useEffect108(() => {
|
|
75534
75528
|
if (captionEditMode) {
|
|
75535
75529
|
setRightCollapsed(!captionHasSelection);
|
|
75536
75530
|
}
|
|
@@ -75542,7 +75536,7 @@ import { useCallback as useCallback133 } from "react";
|
|
|
75542
75536
|
import { createElement as createElement3 } from "react";
|
|
75543
75537
|
|
|
75544
75538
|
// src/player/components/AudioWaveform.tsx
|
|
75545
|
-
import { memo as memo36, useCallback as useCallback131, useMemo as useMemo62, useRef as
|
|
75539
|
+
import { memo as memo36, useCallback as useCallback131, useMemo as useMemo62, useRef as useRef139 } from "react";
|
|
75546
75540
|
import { jsx as jsx168, jsxs as jsxs140 } from "react/jsx-runtime";
|
|
75547
75541
|
var BAR_WIDTH = 2;
|
|
75548
75542
|
var BAR_STEP = 3;
|
|
@@ -75599,8 +75593,8 @@ var AudioWaveform = memo36(function AudioWaveform2({
|
|
|
75599
75593
|
sessionEpoch,
|
|
75600
75594
|
priority
|
|
75601
75595
|
}) {
|
|
75602
|
-
const canvasRef =
|
|
75603
|
-
const observerRef =
|
|
75596
|
+
const canvasRef = useRef139(null);
|
|
75597
|
+
const observerRef = useRef139(null);
|
|
75604
75598
|
const cacheKey = waveformUrl ?? audioUrl;
|
|
75605
75599
|
const request = useMemo62(
|
|
75606
75600
|
() => ({
|
|
@@ -75711,7 +75705,7 @@ var AudioWaveform = memo36(function AudioWaveform2({
|
|
|
75711
75705
|
});
|
|
75712
75706
|
|
|
75713
75707
|
// src/player/components/ImageThumbnail.tsx
|
|
75714
|
-
import { memo as memo37, useCallback as useCallback132, useMemo as useMemo63, useRef as
|
|
75708
|
+
import { memo as memo37, useCallback as useCallback132, useMemo as useMemo63, useRef as useRef140, useState as useState112 } from "react";
|
|
75715
75709
|
import { jsx as jsx169, jsxs as jsxs141 } from "react/jsx-runtime";
|
|
75716
75710
|
var ImageThumbnail = memo37(function ImageThumbnail2({
|
|
75717
75711
|
imageSrc,
|
|
@@ -75723,7 +75717,7 @@ var ImageThumbnail = memo37(function ImageThumbnail2({
|
|
|
75723
75717
|
rich = false
|
|
75724
75718
|
}) {
|
|
75725
75719
|
const [containerWidth, setContainerWidth] = useState112(0);
|
|
75726
|
-
const observerRef =
|
|
75720
|
+
const observerRef = useRef140(null);
|
|
75727
75721
|
const request = useMemo63(
|
|
75728
75722
|
() => ({
|
|
75729
75723
|
key: createThumbnailKey({ kind: "image", source: imageSrc, rich: Number(rich) }),
|
|
@@ -75967,15 +75961,15 @@ function useRenderClipContent({
|
|
|
75967
75961
|
}
|
|
75968
75962
|
|
|
75969
75963
|
// src/hooks/useConsoleErrorCapture.ts
|
|
75970
|
-
import { useCallback as useCallback134, useEffect as
|
|
75964
|
+
import { useCallback as useCallback134, useEffect as useEffect109, useRef as useRef141, useState as useState113 } from "react";
|
|
75971
75965
|
function useConsoleErrorCapture(previewIframe) {
|
|
75972
75966
|
const [consoleErrors, setConsoleErrors] = useState113(null);
|
|
75973
|
-
const consoleErrorsRef =
|
|
75967
|
+
const consoleErrorsRef = useRef141([]);
|
|
75974
75968
|
const resetErrors = useCallback134(() => {
|
|
75975
75969
|
consoleErrorsRef.current = [];
|
|
75976
75970
|
setConsoleErrors(null);
|
|
75977
75971
|
}, []);
|
|
75978
|
-
|
|
75972
|
+
useEffect109(() => {
|
|
75979
75973
|
if (!previewIframe) return;
|
|
75980
75974
|
let patchedWin = null;
|
|
75981
75975
|
let origConsoleError = null;
|
|
@@ -76040,7 +76034,7 @@ function useConsoleErrorCapture(previewIframe) {
|
|
|
76040
76034
|
}
|
|
76041
76035
|
|
|
76042
76036
|
// src/hooks/useFrameCapture.ts
|
|
76043
|
-
import { useState as useState114, useCallback as useCallback135, useRef as
|
|
76037
|
+
import { useState as useState114, useCallback as useCallback135, useRef as useRef142 } from "react";
|
|
76044
76038
|
function useFrameCapture({
|
|
76045
76039
|
projectId,
|
|
76046
76040
|
activeCompPath,
|
|
@@ -76049,7 +76043,7 @@ function useFrameCapture({
|
|
|
76049
76043
|
}) {
|
|
76050
76044
|
const [captureFrameTime, setCaptureFrameTime] = useState114(0);
|
|
76051
76045
|
const [capturing, setCapturing] = useState114(false);
|
|
76052
|
-
const capturingRef =
|
|
76046
|
+
const capturingRef = useRef142(false);
|
|
76053
76047
|
useMountEffect(() => {
|
|
76054
76048
|
setCaptureFrameTime(usePlayerStore.getState().currentTime);
|
|
76055
76049
|
return liveTime.subscribe(setCaptureFrameTime);
|
|
@@ -76134,7 +76128,7 @@ function useFrameCapture({
|
|
|
76134
76128
|
}
|
|
76135
76129
|
|
|
76136
76130
|
// src/hooks/useLintModal.ts
|
|
76137
|
-
import { useState as useState115, useCallback as useCallback136, useEffect as
|
|
76131
|
+
import { useState as useState115, useCallback as useCallback136, useEffect as useEffect110, useRef as useRef143, useMemo as useMemo64 } from "react";
|
|
76138
76132
|
function parseFinding(f) {
|
|
76139
76133
|
return {
|
|
76140
76134
|
severity: f.severity === "error" ? "error" : "warning",
|
|
@@ -76148,7 +76142,7 @@ function useLintModal(projectId, refreshKey) {
|
|
|
76148
76142
|
const [lintModal, setLintModal] = useState115(null);
|
|
76149
76143
|
const [linting, setLinting] = useState115(false);
|
|
76150
76144
|
const [backgroundFindings, setBackgroundFindings] = useState115([]);
|
|
76151
|
-
const autoLintRanRef =
|
|
76145
|
+
const autoLintRanRef = useRef143(false);
|
|
76152
76146
|
const runLint = useCallback136(
|
|
76153
76147
|
async (opts) => {
|
|
76154
76148
|
if (!projectId) return;
|
|
@@ -76175,8 +76169,8 @@ function useLintModal(projectId, refreshKey) {
|
|
|
76175
76169
|
[projectId]
|
|
76176
76170
|
);
|
|
76177
76171
|
const handleLint = useCallback136(() => runLint(), [runLint]);
|
|
76178
|
-
const prevProjectIdRef =
|
|
76179
|
-
|
|
76172
|
+
const prevProjectIdRef = useRef143(projectId);
|
|
76173
|
+
useEffect110(() => {
|
|
76180
76174
|
if (projectId !== prevProjectIdRef.current) {
|
|
76181
76175
|
autoLintRanRef.current = false;
|
|
76182
76176
|
prevProjectIdRef.current = projectId;
|
|
@@ -76185,7 +76179,7 @@ function useLintModal(projectId, refreshKey) {
|
|
|
76185
76179
|
autoLintRanRef.current = true;
|
|
76186
76180
|
void runLint({ background: true });
|
|
76187
76181
|
}, [projectId, runLint]);
|
|
76188
|
-
|
|
76182
|
+
useEffect110(() => {
|
|
76189
76183
|
if (!projectId || !refreshKey) return;
|
|
76190
76184
|
const timer = setTimeout(() => void runLint({ background: true }), 1e3);
|
|
76191
76185
|
return () => clearTimeout(timer);
|
|
@@ -76208,7 +76202,7 @@ function useLintModal(projectId, refreshKey) {
|
|
|
76208
76202
|
);
|
|
76209
76203
|
const findingsByElement = useMemo64(() => groupFindings((f) => f.elementId), [groupFindings]);
|
|
76210
76204
|
const findingsByFile = useMemo64(() => groupFindings((f) => f.file), [groupFindings]);
|
|
76211
|
-
|
|
76205
|
+
useEffect110(() => {
|
|
76212
76206
|
usePlayerStore.getState().setLintFindingsByElement(findingsByElement);
|
|
76213
76207
|
}, [findingsByElement]);
|
|
76214
76208
|
return {
|
|
@@ -76223,14 +76217,14 @@ function useLintModal(projectId, refreshKey) {
|
|
|
76223
76217
|
}
|
|
76224
76218
|
|
|
76225
76219
|
// src/hooks/useToast.ts
|
|
76226
|
-
import { useState as useState116, useCallback as useCallback137, useRef as
|
|
76220
|
+
import { useState as useState116, useCallback as useCallback137, useRef as useRef144 } from "react";
|
|
76227
76221
|
var AUTO_DISMISS_MS2 = 4e3;
|
|
76228
76222
|
var EXIT_MS2 = 160;
|
|
76229
76223
|
var MAX_TOASTS = 3;
|
|
76230
76224
|
var nextToastId = 1;
|
|
76231
76225
|
function useToast() {
|
|
76232
76226
|
const [toasts, setToasts] = useState116([]);
|
|
76233
|
-
const timersRef =
|
|
76227
|
+
const timersRef = useRef144(/* @__PURE__ */ new Map());
|
|
76234
76228
|
const clearTimer = useCallback137((id) => {
|
|
76235
76229
|
const timer = timersRef.current.get(id);
|
|
76236
76230
|
if (timer) {
|
|
@@ -76306,7 +76300,7 @@ function useCompositionContentLoader({
|
|
|
76306
76300
|
}
|
|
76307
76301
|
|
|
76308
76302
|
// src/hooks/useStudioUrlState.ts
|
|
76309
|
-
import { useCallback as useCallback139, useEffect as
|
|
76303
|
+
import { useCallback as useCallback139, useEffect as useEffect111, useRef as useRef145, useState as useState117 } from "react";
|
|
76310
76304
|
|
|
76311
76305
|
// src/utils/studioUrlState.ts
|
|
76312
76306
|
var VALID_TABS = ["layers", "design", "renders", "slideshow", "variables"];
|
|
@@ -76535,13 +76529,13 @@ function useStudioUrlState({
|
|
|
76535
76529
|
initialState: initialState2
|
|
76536
76530
|
}) {
|
|
76537
76531
|
const currentTime = usePlayerStore((s) => s.currentTime);
|
|
76538
|
-
const hydratedSeekRef =
|
|
76539
|
-
const hydratedInitialTimeRef =
|
|
76540
|
-
const hydratedSelectionRef =
|
|
76532
|
+
const hydratedSeekRef = useRef145(initialState2.currentTime == null);
|
|
76533
|
+
const hydratedInitialTimeRef = useRef145(initialState2.currentTime == null);
|
|
76534
|
+
const hydratedSelectionRef = useRef145(initialState2.selection == null);
|
|
76541
76535
|
const [selectionHydrated, setSelectionHydrated] = useState117(initialState2.selection == null);
|
|
76542
|
-
const pendingSelectionRef =
|
|
76543
|
-
const stableTimeRef =
|
|
76544
|
-
const selectionApplySeqRef =
|
|
76536
|
+
const pendingSelectionRef = useRef145(initialState2.selection);
|
|
76537
|
+
const stableTimeRef = useRef145(initialState2.currentTime);
|
|
76538
|
+
const selectionApplySeqRef = useRef145(0);
|
|
76545
76539
|
const buildUrlState = useCallback139(
|
|
76546
76540
|
() => ({
|
|
76547
76541
|
activeCompPath,
|
|
@@ -76607,7 +76601,7 @@ function useStudioUrlState({
|
|
|
76607
76601
|
previewIframeRef
|
|
76608
76602
|
]
|
|
76609
76603
|
);
|
|
76610
|
-
|
|
76604
|
+
useEffect111(() => {
|
|
76611
76605
|
if (!projectId || hydratedSeekRef.current || compositionLoading) return;
|
|
76612
76606
|
const nextTime = duration > 0 ? clampNumber(initialState2.currentTime ?? 0, 0, duration) : Math.max(0, initialState2.currentTime ?? 0);
|
|
76613
76607
|
usePlayerStore.getState().requestSeek(nextTime);
|
|
@@ -76615,7 +76609,7 @@ function useStudioUrlState({
|
|
|
76615
76609
|
hydratedSeekRef.current = true;
|
|
76616
76610
|
}, [projectId, compositionLoading, duration, initialState2.currentTime]);
|
|
76617
76611
|
const selectionHydrationTime = selectionHydrated ? 0 : currentTime;
|
|
76618
|
-
|
|
76612
|
+
useEffect111(() => {
|
|
76619
76613
|
if (!projectId || hydratedSelectionRef.current || compositionLoading) return;
|
|
76620
76614
|
if (!hydratedSeekRef.current) return;
|
|
76621
76615
|
const targetTime = initialState2.currentTime;
|
|
@@ -76642,7 +76636,7 @@ function useStudioUrlState({
|
|
|
76642
76636
|
projectId,
|
|
76643
76637
|
refreshKey
|
|
76644
76638
|
]);
|
|
76645
|
-
|
|
76639
|
+
useEffect111(() => {
|
|
76646
76640
|
if (hydratedInitialTimeRef.current) return;
|
|
76647
76641
|
const targetTime = stableTimeRef.current;
|
|
76648
76642
|
if (targetTime == null) {
|
|
@@ -76652,7 +76646,7 @@ function useStudioUrlState({
|
|
|
76652
76646
|
if (Math.abs(currentTime - targetTime) > 0.05) return;
|
|
76653
76647
|
hydratedInitialTimeRef.current = true;
|
|
76654
76648
|
}, [currentTime]);
|
|
76655
|
-
|
|
76649
|
+
useEffect111(() => {
|
|
76656
76650
|
if (!activeCompPathHydrated) return;
|
|
76657
76651
|
if (!hydratedSeekRef.current) return;
|
|
76658
76652
|
if (!hydratedInitialTimeRef.current) return;
|
|
@@ -76663,12 +76657,12 @@ function useStudioUrlState({
|
|
|
76663
76657
|
}, 200);
|
|
76664
76658
|
return () => window.clearTimeout(handle);
|
|
76665
76659
|
}, [activeCompPathHydrated, buildUrlState, currentTime, duration, isPlaying, projectId]);
|
|
76666
|
-
|
|
76660
|
+
useEffect111(() => {
|
|
76667
76661
|
if (!activeCompPathHydrated) return;
|
|
76668
76662
|
if (!projectId) return;
|
|
76669
76663
|
replaceHash(buildStudioHash(projectId, buildUrlState()));
|
|
76670
76664
|
}, [activeCompPathHydrated, buildUrlState, projectId]);
|
|
76671
|
-
|
|
76665
|
+
useEffect111(() => {
|
|
76672
76666
|
if (!projectId) return;
|
|
76673
76667
|
const onHashChange = () => {
|
|
76674
76668
|
if (parseProjectIdFromHash(window.location.hash) !== projectId) return;
|
|
@@ -76698,7 +76692,7 @@ function useEffectiveTimelineDuration(timelineDuration2, timelineElements) {
|
|
|
76698
76692
|
}
|
|
76699
76693
|
|
|
76700
76694
|
// src/hooks/useStudioContextValue.ts
|
|
76701
|
-
import { useCallback as useCallback140, useMemo as useMemo66, useRef as
|
|
76695
|
+
import { useCallback as useCallback140, useMemo as useMemo66, useRef as useRef146, useState as useState118 } from "react";
|
|
76702
76696
|
function buildStudioContextValue(input) {
|
|
76703
76697
|
return {
|
|
76704
76698
|
projectId: input.projectId,
|
|
@@ -76757,7 +76751,7 @@ function useInspectorState(rightPanelTab, rightInspectorPanes, rightCollapsed, i
|
|
|
76757
76751
|
}
|
|
76758
76752
|
function useDragOverlay(onImportFiles) {
|
|
76759
76753
|
const [active, setActive] = useState118(false);
|
|
76760
|
-
const counterRef =
|
|
76754
|
+
const counterRef = useRef146(0);
|
|
76761
76755
|
const onDragOver = useCallback140((e) => {
|
|
76762
76756
|
if (!e.dataTransfer.types.includes("Files")) return;
|
|
76763
76757
|
e.preventDefault();
|
|
@@ -76796,7 +76790,7 @@ function useGlobalFileDrop(handleTimelineFileDrop) {
|
|
|
76796
76790
|
}
|
|
76797
76791
|
|
|
76798
76792
|
// src/components/StudioHeader.tsx
|
|
76799
|
-
import { useRef as
|
|
76793
|
+
import { useRef as useRef148 } from "react";
|
|
76800
76794
|
|
|
76801
76795
|
// src/contexts/PanelLayoutContext.tsx
|
|
76802
76796
|
import { useContext as useContext8, useMemo as useMemo67 } from "react";
|
|
@@ -76876,9 +76870,9 @@ function PanelLayoutProvider({
|
|
|
76876
76870
|
import {
|
|
76877
76871
|
useCallback as useCallback141,
|
|
76878
76872
|
useContext as useContext9,
|
|
76879
|
-
useEffect as
|
|
76873
|
+
useEffect as useEffect112,
|
|
76880
76874
|
useMemo as useMemo68,
|
|
76881
|
-
useRef as
|
|
76875
|
+
useRef as useRef147,
|
|
76882
76876
|
useState as useState119
|
|
76883
76877
|
} from "react";
|
|
76884
76878
|
import { jsx as jsx171 } from "react/jsx-runtime";
|
|
@@ -76906,15 +76900,15 @@ function readHistoryLocation() {
|
|
|
76906
76900
|
}
|
|
76907
76901
|
function useViewModeState() {
|
|
76908
76902
|
const [viewMode, setMode] = useState119(() => readViewModeFromUrl());
|
|
76909
|
-
const guardsRef =
|
|
76910
|
-
const acceptedLocationRef =
|
|
76903
|
+
const guardsRef = useRef147(/* @__PURE__ */ new Set());
|
|
76904
|
+
const acceptedLocationRef = useRef147(readHistoryLocation());
|
|
76911
76905
|
const canSetViewMode = useCallback141((mode) => {
|
|
76912
76906
|
for (const guard3 of guardsRef.current) {
|
|
76913
76907
|
if (!guard3(mode)) return false;
|
|
76914
76908
|
}
|
|
76915
76909
|
return true;
|
|
76916
76910
|
}, []);
|
|
76917
|
-
|
|
76911
|
+
useEffect112(() => {
|
|
76918
76912
|
const onPopState = () => {
|
|
76919
76913
|
const mode = readViewModeFromUrl();
|
|
76920
76914
|
if (mode !== viewMode && !canSetViewMode(mode)) {
|
|
@@ -76972,7 +76966,7 @@ var VIEW_MODE_OPTIONS = [
|
|
|
76972
76966
|
];
|
|
76973
76967
|
function ViewModeToggle() {
|
|
76974
76968
|
const { viewMode, setViewMode } = useViewMode();
|
|
76975
|
-
const tabRefs =
|
|
76969
|
+
const tabRefs = useRef148([]);
|
|
76976
76970
|
const selectMode = (mode) => {
|
|
76977
76971
|
if (mode === viewMode) return;
|
|
76978
76972
|
if (setViewMode(mode)) trackStudioEvent("view_mode_toggle", { mode });
|
|
@@ -77199,10 +77193,10 @@ function StudioHeader({
|
|
|
77199
77193
|
}
|
|
77200
77194
|
|
|
77201
77195
|
// src/hooks/useGestureCommit.ts
|
|
77202
|
-
import { useState as useState121, useCallback as useCallback143, useRef as
|
|
77196
|
+
import { useState as useState121, useCallback as useCallback143, useRef as useRef150, useEffect as useEffect114 } from "react";
|
|
77203
77197
|
|
|
77204
77198
|
// src/hooks/useGestureRecording.ts
|
|
77205
|
-
import { useCallback as useCallback142, useEffect as
|
|
77199
|
+
import { useCallback as useCallback142, useEffect as useEffect113, useRef as useRef149, useState as useState120 } from "react";
|
|
77206
77200
|
function readBasePosition(element, iframeEl) {
|
|
77207
77201
|
let baseOpacity = 1;
|
|
77208
77202
|
let baseScale = 1;
|
|
@@ -77347,11 +77341,11 @@ function releaseRuntimePreview(r) {
|
|
|
77347
77341
|
function useGestureRecording() {
|
|
77348
77342
|
const [isRecording, setIsRecording] = useState120(false);
|
|
77349
77343
|
const [recordingDuration, setRecordingDuration] = useState120(0);
|
|
77350
|
-
const isRecordingRef =
|
|
77351
|
-
const refs =
|
|
77352
|
-
const samplesRef =
|
|
77353
|
-
const trailRef =
|
|
77354
|
-
|
|
77344
|
+
const isRecordingRef = useRef149(false);
|
|
77345
|
+
const refs = useRef149(createRecordingRefs());
|
|
77346
|
+
const samplesRef = useRef149(refs.current.samples);
|
|
77347
|
+
const trailRef = useRef149(refs.current.trail);
|
|
77348
|
+
useEffect113(() => {
|
|
77355
77349
|
const r = refs.current;
|
|
77356
77350
|
return () => {
|
|
77357
77351
|
isRecordingRef.current = false;
|
|
@@ -77729,12 +77723,12 @@ function useGestureCommit({
|
|
|
77729
77723
|
}) {
|
|
77730
77724
|
const gestureRecording = useGestureRecording();
|
|
77731
77725
|
const [gestureState, setGestureState] = useState121("idle");
|
|
77732
|
-
const gestureStateRef =
|
|
77733
|
-
const recordingAutoStopRef =
|
|
77734
|
-
const recordingStartTimeRef =
|
|
77735
|
-
const commitInFlightRef =
|
|
77736
|
-
const capturedSelectionRef =
|
|
77737
|
-
|
|
77726
|
+
const gestureStateRef = useRef150("idle");
|
|
77727
|
+
const recordingAutoStopRef = useRef150(void 0);
|
|
77728
|
+
const recordingStartTimeRef = useRef150(0);
|
|
77729
|
+
const commitInFlightRef = useRef150(false);
|
|
77730
|
+
const capturedSelectionRef = useRef150(null);
|
|
77731
|
+
useEffect114(() => () => clearInterval(recordingAutoStopRef.current), []);
|
|
77738
77732
|
const stopAndCommitRecording = useCallback143(async () => {
|
|
77739
77733
|
clearInterval(recordingAutoStopRef.current);
|
|
77740
77734
|
if (commitInFlightRef.current) {
|
|
@@ -78074,12 +78068,12 @@ import {
|
|
|
78074
78068
|
useState as useState131,
|
|
78075
78069
|
useCallback as useCallback151,
|
|
78076
78070
|
useImperativeHandle,
|
|
78077
|
-
useRef as
|
|
78071
|
+
useRef as useRef158,
|
|
78078
78072
|
forwardRef as forwardRef3
|
|
78079
78073
|
} from "react";
|
|
78080
78074
|
|
|
78081
78075
|
// src/components/sidebar/CompositionsTab.tsx
|
|
78082
|
-
import { memo as memo39, useCallback as useCallback144, useEffect as
|
|
78076
|
+
import { memo as memo39, useCallback as useCallback144, useEffect as useEffect115, useRef as useRef151, useState as useState122 } from "react";
|
|
78083
78077
|
import { jsx as jsx174, jsxs as jsxs144 } from "react/jsx-runtime";
|
|
78084
78078
|
var DEFAULT_PREVIEW_STAGE = { width: 1920, height: 1080 };
|
|
78085
78079
|
var CARD_W = 80;
|
|
@@ -78151,10 +78145,10 @@ function CompCard({
|
|
|
78151
78145
|
const [stageSize, setStageSize] = useState122(DEFAULT_PREVIEW_STAGE);
|
|
78152
78146
|
const [livePreviewLoaded, setLivePreviewLoaded] = useState122(false);
|
|
78153
78147
|
const [thumbnailFailed, setThumbnailFailed] = useState122(false);
|
|
78154
|
-
const iframeRef =
|
|
78155
|
-
const hoverTimer =
|
|
78156
|
-
const syncTimer =
|
|
78157
|
-
const draggedRef =
|
|
78148
|
+
const iframeRef = useRef151(null);
|
|
78149
|
+
const hoverTimer = useRef151(null);
|
|
78150
|
+
const syncTimer = useRef151(null);
|
|
78151
|
+
const draggedRef = useRef151(false);
|
|
78158
78152
|
const requestIframePlaybackSync = useCallback144((shouldPlay) => {
|
|
78159
78153
|
if (syncTimer.current) {
|
|
78160
78154
|
clearTimeout(syncTimer.current);
|
|
@@ -78197,10 +78191,10 @@ function CompCard({
|
|
|
78197
78191
|
});
|
|
78198
78192
|
const thumbnailOffsetX = (CARD_W - stageSize.width * previewScale) / 2;
|
|
78199
78193
|
const thumbnailOffsetY = (CARD_H - stageSize.height * previewScale) / 2;
|
|
78200
|
-
|
|
78194
|
+
useEffect115(() => {
|
|
78201
78195
|
if (hovered) requestIframePlaybackSync(true);
|
|
78202
78196
|
}, [hovered, requestIframePlaybackSync]);
|
|
78203
|
-
|
|
78197
|
+
useEffect115(() => {
|
|
78204
78198
|
return () => {
|
|
78205
78199
|
if (hoverTimer.current) clearTimeout(hoverTimer.current);
|
|
78206
78200
|
if (syncTimer.current) clearTimeout(syncTimer.current);
|
|
@@ -78385,7 +78379,7 @@ var CompositionsTab = memo39(function CompositionsTab2({
|
|
|
78385
78379
|
});
|
|
78386
78380
|
|
|
78387
78381
|
// src/components/sidebar/AssetsTab.tsx
|
|
78388
|
-
import { memo as memo40, useState as useState128, useCallback as useCallback148, useRef as
|
|
78382
|
+
import { memo as memo40, useState as useState128, useCallback as useCallback148, useRef as useRef155, useMemo as useMemo71, useEffect as useEffect121 } from "react";
|
|
78389
78383
|
|
|
78390
78384
|
// src/components/ui/SearchInput.tsx
|
|
78391
78385
|
import { jsx as jsx175, jsxs as jsxs145 } from "react/jsx-runtime";
|
|
@@ -78496,11 +78490,11 @@ var CATEGORY_LABELS = {
|
|
|
78496
78490
|
var FILTER_ORDER = ["audio", "images", "video", "fonts"];
|
|
78497
78491
|
|
|
78498
78492
|
// src/components/sidebar/AudioRow.tsx
|
|
78499
|
-
import { useState as useState124, useRef as
|
|
78493
|
+
import { useState as useState124, useRef as useRef153, useEffect as useEffect117, useCallback as useCallback146 } from "react";
|
|
78500
78494
|
import { classifyWebAudioMediaRoute } from "@hyperframes/core/runtime/web-audio-route";
|
|
78501
78495
|
|
|
78502
78496
|
// src/components/sidebar/AssetContextMenu.tsx
|
|
78503
|
-
import { useCallback as useCallback145, useEffect as
|
|
78497
|
+
import { useCallback as useCallback145, useEffect as useEffect116, useLayoutEffect as useLayoutEffect8, useRef as useRef152, useState as useState123 } from "react";
|
|
78504
78498
|
import { Fragment as Fragment51, jsx as jsx176, jsxs as jsxs146 } from "react/jsx-runtime";
|
|
78505
78499
|
function isValidAssetName(name) {
|
|
78506
78500
|
return name.length > 0 && !/[/\\]/.test(name) && !name.includes("..");
|
|
@@ -78515,7 +78509,7 @@ function ContextMenu2({
|
|
|
78515
78509
|
onRename,
|
|
78516
78510
|
onAddAtPlayhead
|
|
78517
78511
|
}) {
|
|
78518
|
-
const menuRef =
|
|
78512
|
+
const menuRef = useRef152(null);
|
|
78519
78513
|
const [pos, setPos] = useState123({ x, y });
|
|
78520
78514
|
const [mode, setMode] = useState123("menu");
|
|
78521
78515
|
const [renameDraft, setRenameDraft] = useState123(() => filename(asset));
|
|
@@ -78530,7 +78524,7 @@ function ContextMenu2({
|
|
|
78530
78524
|
y: Math.min(y, window.innerHeight - rect.height - margin)
|
|
78531
78525
|
});
|
|
78532
78526
|
}, [x, y, mode]);
|
|
78533
|
-
|
|
78527
|
+
useEffect116(() => {
|
|
78534
78528
|
const onKeyDown = (e) => {
|
|
78535
78529
|
if (e.key === "Escape") {
|
|
78536
78530
|
e.stopPropagation();
|
|
@@ -78555,7 +78549,7 @@ function ContextMenu2({
|
|
|
78555
78549
|
document.addEventListener("keydown", onKeyDown, true);
|
|
78556
78550
|
return () => document.removeEventListener("keydown", onKeyDown, true);
|
|
78557
78551
|
}, [mode, onClose]);
|
|
78558
|
-
|
|
78552
|
+
useEffect116(() => {
|
|
78559
78553
|
if (mode === "menu") {
|
|
78560
78554
|
menuRef.current?.querySelector('[role="menuitem"]')?.focus();
|
|
78561
78555
|
}
|
|
@@ -78766,11 +78760,11 @@ function AudioRow({
|
|
|
78766
78760
|
const [contextMenu, setContextMenu] = useState124(null);
|
|
78767
78761
|
const [playing, setPlaying] = useState124(false);
|
|
78768
78762
|
const [bars, setBars] = useState124([]);
|
|
78769
|
-
const audioRef =
|
|
78770
|
-
const actxRef =
|
|
78771
|
-
const analyserRef =
|
|
78772
|
-
const sourceRef =
|
|
78773
|
-
const animRef =
|
|
78763
|
+
const audioRef = useRef153(null);
|
|
78764
|
+
const actxRef = useRef153(null);
|
|
78765
|
+
const analyserRef = useRef153(null);
|
|
78766
|
+
const sourceRef = useRef153(null);
|
|
78767
|
+
const animRef = useRef153(0);
|
|
78774
78768
|
const name = basename2(asset);
|
|
78775
78769
|
const subtype = getAudioSubtype(asset);
|
|
78776
78770
|
const serveUrl = resolveMediaPreviewUrl(asset, projectId);
|
|
@@ -78781,7 +78775,7 @@ function AudioRow({
|
|
|
78781
78775
|
setPlaying(false);
|
|
78782
78776
|
cancelAnimationFrame(animRef.current);
|
|
78783
78777
|
}, []);
|
|
78784
|
-
const pointerDownRef =
|
|
78778
|
+
const pointerDownRef = useRef153(null);
|
|
78785
78779
|
const setSelectedElementId = usePlayerStore((s) => s.setSelectedElementId);
|
|
78786
78780
|
const requestTimelineFocus = usePlayerStore((s) => s.requestTimelineFocus);
|
|
78787
78781
|
const elements = usePlayerStore((s) => s.elements);
|
|
@@ -78822,7 +78816,7 @@ function AudioRow({
|
|
|
78822
78816
|
},
|
|
78823
78817
|
[activateRow]
|
|
78824
78818
|
);
|
|
78825
|
-
|
|
78819
|
+
useEffect117(() => {
|
|
78826
78820
|
return () => {
|
|
78827
78821
|
cancelAnimationFrame(animRef.current);
|
|
78828
78822
|
audioRef.current?.pause();
|
|
@@ -78830,7 +78824,7 @@ function AudioRow({
|
|
|
78830
78824
|
if (stopCurrentPreview === stopPlayback) stopCurrentPreview = null;
|
|
78831
78825
|
};
|
|
78832
78826
|
}, [stopPlayback]);
|
|
78833
|
-
|
|
78827
|
+
useEffect117(() => {
|
|
78834
78828
|
if (playing) {
|
|
78835
78829
|
const barCount = 24;
|
|
78836
78830
|
const loop = () => {
|
|
@@ -78997,7 +78991,7 @@ function AudioRow({
|
|
|
78997
78991
|
}
|
|
78998
78992
|
|
|
78999
78993
|
// src/components/sidebar/GlobalAssetsView.tsx
|
|
79000
|
-
import { useEffect as
|
|
78994
|
+
import { useEffect as useEffect118, useMemo as useMemo70, useState as useState125 } from "react";
|
|
79001
78995
|
import { jsx as jsx178, jsxs as jsxs148 } from "react/jsx-runtime";
|
|
79002
78996
|
function globalAssetRows(records, query = "") {
|
|
79003
78997
|
const q = query.trim().toLowerCase();
|
|
@@ -79013,7 +79007,7 @@ function globalAssetRows(records, query = "") {
|
|
|
79013
79007
|
}
|
|
79014
79008
|
function GlobalAssetsView({ searchQuery }) {
|
|
79015
79009
|
const [records, setRecords] = useState125(null);
|
|
79016
|
-
|
|
79010
|
+
useEffect118(() => {
|
|
79017
79011
|
let cancelled = false;
|
|
79018
79012
|
fetch("/api/assets/global").then((r) => r.ok ? r.json() : { assets: [] }).then((d) => {
|
|
79019
79013
|
if (!cancelled) setRecords(Array.isArray(d.assets) ? d.assets : []);
|
|
@@ -79056,10 +79050,10 @@ function GlobalAssetsView({ searchQuery }) {
|
|
|
79056
79050
|
}
|
|
79057
79051
|
|
|
79058
79052
|
// src/components/sidebar/AssetCard.tsx
|
|
79059
|
-
import { useState as useState127, useEffect as
|
|
79053
|
+
import { useState as useState127, useEffect as useEffect120, useRef as useRef154, useCallback as useCallback147 } from "react";
|
|
79060
79054
|
|
|
79061
79055
|
// src/components/ui/VideoFrameThumbnail.tsx
|
|
79062
|
-
import { useState as useState126, useEffect as
|
|
79056
|
+
import { useState as useState126, useEffect as useEffect119 } from "react";
|
|
79063
79057
|
import { jsx as jsx179 } from "react/jsx-runtime";
|
|
79064
79058
|
function VideoFrameThumbnail({
|
|
79065
79059
|
src,
|
|
@@ -79067,7 +79061,7 @@ function VideoFrameThumbnail({
|
|
|
79067
79061
|
}) {
|
|
79068
79062
|
const [frame, setFrame] = useState126(null);
|
|
79069
79063
|
const [failed2, setFailed] = useState126(false);
|
|
79070
|
-
|
|
79064
|
+
useEffect119(() => {
|
|
79071
79065
|
setFailed(false);
|
|
79072
79066
|
const video = document.createElement("video");
|
|
79073
79067
|
video.crossOrigin = "anonymous";
|
|
@@ -79131,7 +79125,7 @@ function openAssetContextMenu(e, setContextMenu) {
|
|
|
79131
79125
|
}
|
|
79132
79126
|
function useProbedDuration(src, skip) {
|
|
79133
79127
|
const [duration, setDuration] = useState127(void 0);
|
|
79134
|
-
|
|
79128
|
+
useEffect120(() => {
|
|
79135
79129
|
if (skip) return;
|
|
79136
79130
|
let cancelled = false;
|
|
79137
79131
|
let retryTimer;
|
|
@@ -79194,7 +79188,7 @@ function AssetCard({
|
|
|
79194
79188
|
const probedDuration = useProbedDuration(serveUrl, !isVideo || duration != null);
|
|
79195
79189
|
const resolvedDuration = duration ?? probedDuration ?? void 0;
|
|
79196
79190
|
const durationLabel = formatDuration(resolvedDuration ?? 0);
|
|
79197
|
-
const pointerDownRef =
|
|
79191
|
+
const pointerDownRef = useRef154(null);
|
|
79198
79192
|
const setSelectedElementId = usePlayerStore((s) => s.setSelectedElementId);
|
|
79199
79193
|
const requestTimelineFocus = usePlayerStore((s) => s.requestTimelineFocus);
|
|
79200
79194
|
const elements = usePlayerStore((s) => s.elements);
|
|
@@ -79519,7 +79513,7 @@ var AssetsTab = memo40(function AssetsTab2({
|
|
|
79519
79513
|
onRename,
|
|
79520
79514
|
onAddAssetToTimeline
|
|
79521
79515
|
}) {
|
|
79522
|
-
const fileInputRef =
|
|
79516
|
+
const fileInputRef = useRef155(null);
|
|
79523
79517
|
const [dragOver, setDragOver] = useState128(false);
|
|
79524
79518
|
const [copyFeedback, setCopyFeedback] = useState128(null);
|
|
79525
79519
|
const [importing, setImporting] = useState128(false);
|
|
@@ -79528,9 +79522,9 @@ var AssetsTab = memo40(function AssetsTab2({
|
|
|
79528
79522
|
const [searchQuery, setSearchQuery] = useState128("");
|
|
79529
79523
|
const [viewMode, setViewMode] = useState128("local");
|
|
79530
79524
|
const [manifest, setManifest] = useState128(/* @__PURE__ */ new Map());
|
|
79531
|
-
const manifest404Ref =
|
|
79525
|
+
const manifest404Ref = useRef155(/* @__PURE__ */ new Set());
|
|
79532
79526
|
const assetsKey = assets.join("|");
|
|
79533
|
-
|
|
79527
|
+
useEffect121(() => {
|
|
79534
79528
|
if (manifest404Ref.current.has(projectId)) return;
|
|
79535
79529
|
let cancelled = false;
|
|
79536
79530
|
fetch(`/api/projects/${projectId}/preview/.media/manifest.jsonl`).then((r) => {
|
|
@@ -79787,11 +79781,11 @@ var AssetsTab = memo40(function AssetsTab2({
|
|
|
79787
79781
|
});
|
|
79788
79782
|
|
|
79789
79783
|
// src/components/sidebar/BlocksTab.tsx
|
|
79790
|
-
import { memo as memo41, useState as useState130, useCallback as useCallback150, useRef as
|
|
79784
|
+
import { memo as memo41, useState as useState130, useCallback as useCallback150, useRef as useRef157, useEffect as useEffect123 } from "react";
|
|
79791
79785
|
import { createPortal as createPortal9 } from "react-dom";
|
|
79792
79786
|
|
|
79793
79787
|
// src/components/sidebar/PromptPreviewModal.tsx
|
|
79794
|
-
import { useState as useState129, useCallback as useCallback149, useEffect as
|
|
79788
|
+
import { useState as useState129, useCallback as useCallback149, useEffect as useEffect122, useRef as useRef156 } from "react";
|
|
79795
79789
|
import { jsx as jsx182, jsxs as jsxs151 } from "react/jsx-runtime";
|
|
79796
79790
|
function PromptPreviewModal({
|
|
79797
79791
|
title,
|
|
@@ -79801,9 +79795,9 @@ function PromptPreviewModal({
|
|
|
79801
79795
|
const [value, setValue] = useState129(prompt);
|
|
79802
79796
|
const [copyState, setCopyState] = useState129("idle");
|
|
79803
79797
|
const [entered, setEntered] = useState129(false);
|
|
79804
|
-
const containerRef =
|
|
79805
|
-
const textareaRef =
|
|
79806
|
-
const valueRef =
|
|
79798
|
+
const containerRef = useRef156(null);
|
|
79799
|
+
const textareaRef = useRef156(null);
|
|
79800
|
+
const valueRef = useRef156(value);
|
|
79807
79801
|
valueRef.current = value;
|
|
79808
79802
|
const { requestClose } = useDialogBehavior({
|
|
79809
79803
|
open: true,
|
|
@@ -79811,7 +79805,7 @@ function PromptPreviewModal({
|
|
|
79811
79805
|
containerRef,
|
|
79812
79806
|
canClose: () => valueRef.current === prompt
|
|
79813
79807
|
});
|
|
79814
|
-
|
|
79808
|
+
useEffect122(() => {
|
|
79815
79809
|
requestAnimationFrame(() => {
|
|
79816
79810
|
setEntered(true);
|
|
79817
79811
|
textareaRef.current?.focus();
|
|
@@ -80100,7 +80094,7 @@ function BlockCard({
|
|
|
80100
80094
|
}) {
|
|
80101
80095
|
const [hovered, setHovered] = useState130(false);
|
|
80102
80096
|
const [addState, setAddState] = useState130("idle");
|
|
80103
|
-
const hoverTimer =
|
|
80097
|
+
const hoverTimer = useRef157(null);
|
|
80104
80098
|
const colors = getCategoryColors(category);
|
|
80105
80099
|
const needsWebGL = tags?.includes("html-in-canvas") || tags?.includes("webgl");
|
|
80106
80100
|
const handleEnter = useCallback150(() => {
|
|
@@ -80117,7 +80111,7 @@ function BlockCard({
|
|
|
80117
80111
|
setHovered(false);
|
|
80118
80112
|
onPreview?.(null);
|
|
80119
80113
|
}, [onPreview]);
|
|
80120
|
-
|
|
80114
|
+
useEffect123(() => {
|
|
80121
80115
|
return () => {
|
|
80122
80116
|
if (hoverTimer.current) clearTimeout(hoverTimer.current);
|
|
80123
80117
|
};
|
|
@@ -80330,9 +80324,9 @@ var LeftSidebar = memo42(
|
|
|
80330
80324
|
onAddCompositionToTimeline
|
|
80331
80325
|
}, ref) {
|
|
80332
80326
|
const [tab, setTab] = useState131(getPersistedTab);
|
|
80333
|
-
const tabRef =
|
|
80327
|
+
const tabRef = useRef158(tab);
|
|
80334
80328
|
tabRef.current = tab;
|
|
80335
|
-
const tablistRef =
|
|
80329
|
+
const tablistRef = useRef158(null);
|
|
80336
80330
|
const selectTab = useCallback151((t) => {
|
|
80337
80331
|
setTab(t);
|
|
80338
80332
|
try {
|
|
@@ -80828,10 +80822,10 @@ function StudioLeftSidebar({
|
|
|
80828
80822
|
import { useCallback as useCallback169 } from "react";
|
|
80829
80823
|
|
|
80830
80824
|
// src/components/editor/LayersPanel.tsx
|
|
80831
|
-
import { memo as memo43, useState as useState134, useCallback as useCallback154, useEffect as
|
|
80825
|
+
import { memo as memo43, useState as useState134, useCallback as useCallback154, useEffect as useEffect124, useRef as useRef160 } from "react";
|
|
80832
80826
|
|
|
80833
80827
|
// src/components/editor/useLayerDrag.ts
|
|
80834
|
-
import { useRef as
|
|
80828
|
+
import { useRef as useRef159, useState as useState133, useCallback as useCallback153 } from "react";
|
|
80835
80829
|
var DRAG_THRESHOLD_PX3 = 4;
|
|
80836
80830
|
function isLayerDraggable(layer) {
|
|
80837
80831
|
if (!(layer.selector || layer.id)) return false;
|
|
@@ -80898,7 +80892,7 @@ function useLayerDrag({
|
|
|
80898
80892
|
onReorder,
|
|
80899
80893
|
onSingleSibling
|
|
80900
80894
|
}) {
|
|
80901
|
-
const dragRef =
|
|
80895
|
+
const dragRef = useRef159(null);
|
|
80902
80896
|
const [dragKey, setDragKey] = useState133(null);
|
|
80903
80897
|
const [insertionLineY, setInsertionLineY] = useState133(null);
|
|
80904
80898
|
const handleRowPointerDown = useCallback153(
|
|
@@ -81104,8 +81098,8 @@ var LayersPanel = memo43(function LayersPanel2() {
|
|
|
81104
81098
|
} = useDomEditContext();
|
|
81105
81099
|
const [layers, setLayers] = useState134([]);
|
|
81106
81100
|
const [collapsed, setCollapsed] = useState134({});
|
|
81107
|
-
const prevDocVersionRef =
|
|
81108
|
-
const scrollContainerRef =
|
|
81101
|
+
const prevDocVersionRef = useRef160(0);
|
|
81102
|
+
const scrollContainerRef = useRef160(null);
|
|
81109
81103
|
const mirrorLayerReorderToTimeline = useLayerReorderTimelineMirror();
|
|
81110
81104
|
const { scheduleReveal } = useLayerRevealOverride({
|
|
81111
81105
|
isPlaying,
|
|
@@ -81134,10 +81128,10 @@ var LayersPanel = memo43(function LayersPanel2() {
|
|
|
81134
81128
|
);
|
|
81135
81129
|
setLayers(sortLayersByZIndex(items));
|
|
81136
81130
|
}, [previewIframeRef, activeCompPath, isMasterView, activeGroupElement, setActiveGroupElement]);
|
|
81137
|
-
|
|
81131
|
+
useEffect124(() => {
|
|
81138
81132
|
collectLayers();
|
|
81139
81133
|
}, [collectLayers, refreshKey, zEditVersion]);
|
|
81140
|
-
|
|
81134
|
+
useEffect124(() => {
|
|
81141
81135
|
const iframe = previewIframeRef.current;
|
|
81142
81136
|
if (!iframe) return;
|
|
81143
81137
|
const handleLoad = () => {
|
|
@@ -81147,13 +81141,13 @@ var LayersPanel = memo43(function LayersPanel2() {
|
|
|
81147
81141
|
iframe.addEventListener("load", handleLoad);
|
|
81148
81142
|
return () => iframe.removeEventListener("load", handleLoad);
|
|
81149
81143
|
}, [previewIframeRef, collectLayers]);
|
|
81150
|
-
|
|
81144
|
+
useEffect124(() => {
|
|
81151
81145
|
if (!compositionLoading) {
|
|
81152
81146
|
const timer = setTimeout(collectLayers, 100);
|
|
81153
81147
|
return () => clearTimeout(timer);
|
|
81154
81148
|
}
|
|
81155
81149
|
}, [compositionLoading, collectLayers]);
|
|
81156
|
-
|
|
81150
|
+
useEffect124(() => {
|
|
81157
81151
|
const throttle = createRafThrottle(collectLayers, 100);
|
|
81158
81152
|
const unsubscribe = liveTime.subscribe(throttle.invoke);
|
|
81159
81153
|
return () => {
|
|
@@ -81447,7 +81441,7 @@ import { memo as memo45, useCallback as useCallback156, useState as useState136
|
|
|
81447
81441
|
import { memo as memo44, useCallback as useCallback155 } from "react";
|
|
81448
81442
|
|
|
81449
81443
|
// src/captions/components/shared.tsx
|
|
81450
|
-
import { useEffect as
|
|
81444
|
+
import { useEffect as useEffect125, useRef as useRef161, useState as useState135 } from "react";
|
|
81451
81445
|
import { jsx as jsx188, jsxs as jsxs157 } from "react/jsx-runtime";
|
|
81452
81446
|
var inputCls = "w-full bg-neutral-900 border border-neutral-800 rounded px-1.5 py-0.5 text-2xs text-neutral-200 font-mono outline-none focus:border-studio-accent disabled:opacity-40 disabled:cursor-not-allowed";
|
|
81453
81447
|
function Section2({ label, children }) {
|
|
@@ -81473,8 +81467,8 @@ function NumberField({
|
|
|
81473
81467
|
onCommit
|
|
81474
81468
|
}) {
|
|
81475
81469
|
const [draft, setDraft] = useState135(null);
|
|
81476
|
-
const focusedRef =
|
|
81477
|
-
|
|
81470
|
+
const focusedRef = useRef161(false);
|
|
81471
|
+
useEffect125(() => {
|
|
81478
81472
|
if (!focusedRef.current) setDraft(null);
|
|
81479
81473
|
}, [value]);
|
|
81480
81474
|
const display2 = draft !== null ? draft : mixed ? "" : String(value ?? 0);
|
|
@@ -81966,7 +81960,7 @@ var CaptionPropertyPanel = memo45(function CaptionPropertyPanel2({
|
|
|
81966
81960
|
});
|
|
81967
81961
|
|
|
81968
81962
|
// src/components/editor/BlockParamsPanel.tsx
|
|
81969
|
-
import { memo as memo46, useCallback as useCallback157, useEffect as
|
|
81963
|
+
import { memo as memo46, useCallback as useCallback157, useEffect as useEffect126, useRef as useRef162, useState as useState137 } from "react";
|
|
81970
81964
|
import { jsx as jsx191, jsxs as jsxs160 } from "react/jsx-runtime";
|
|
81971
81965
|
var BlockParamsPanel = memo46(function BlockParamsPanel2({
|
|
81972
81966
|
blockName,
|
|
@@ -81984,11 +81978,11 @@ var BlockParamsPanel = memo46(function BlockParamsPanel2({
|
|
|
81984
81978
|
}
|
|
81985
81979
|
return initial;
|
|
81986
81980
|
});
|
|
81987
|
-
const appliedRef =
|
|
81981
|
+
const appliedRef = useRef162(
|
|
81988
81982
|
Object.fromEntries(params.map((p) => [p.key, p.default]))
|
|
81989
81983
|
);
|
|
81990
81984
|
const [commitState, setCommitState] = useState137({ tone: "idle" });
|
|
81991
|
-
const commitTimersRef =
|
|
81985
|
+
const commitTimersRef = useRef162(/* @__PURE__ */ new Map());
|
|
81992
81986
|
const commitParamNow = useCallback157(
|
|
81993
81987
|
async (key2, nextValue) => {
|
|
81994
81988
|
if (!fileManager) return;
|
|
@@ -82030,7 +82024,7 @@ var BlockParamsPanel = memo46(function BlockParamsPanel2({
|
|
|
82030
82024
|
},
|
|
82031
82025
|
[fileManager, compositionPath, setRefreshKey, blockName]
|
|
82032
82026
|
);
|
|
82033
|
-
const commitChainRef =
|
|
82027
|
+
const commitChainRef = useRef162(Promise.resolve());
|
|
82034
82028
|
const commitParam = useCallback157(
|
|
82035
82029
|
(key2, nextValue) => {
|
|
82036
82030
|
const run = commitChainRef.current.then(() => commitParamNow(key2, nextValue));
|
|
@@ -82055,7 +82049,7 @@ var BlockParamsPanel = memo46(function BlockParamsPanel2({
|
|
|
82055
82049
|
},
|
|
82056
82050
|
[commitParam]
|
|
82057
82051
|
);
|
|
82058
|
-
const flushRef =
|
|
82052
|
+
const flushRef = useRef162(() => {
|
|
82059
82053
|
});
|
|
82060
82054
|
flushRef.current = () => {
|
|
82061
82055
|
for (const [key2, timer] of commitTimersRef.current) {
|
|
@@ -82065,7 +82059,7 @@ var BlockParamsPanel = memo46(function BlockParamsPanel2({
|
|
|
82065
82059
|
}
|
|
82066
82060
|
commitTimersRef.current.clear();
|
|
82067
82061
|
};
|
|
82068
|
-
|
|
82062
|
+
useEffect126(() => () => flushRef.current(), []);
|
|
82069
82063
|
return /* @__PURE__ */ jsxs160("div", { className: "flex flex-col h-full", children: [
|
|
82070
82064
|
/* @__PURE__ */ jsxs160("div", { className: "flex items-center justify-between px-3 py-2 border-b border-neutral-800", children: [
|
|
82071
82065
|
/* @__PURE__ */ jsx191("div", { className: "text-[11px] font-semibold text-neutral-200 truncate", children: blockTitle }),
|
|
@@ -82197,7 +82191,7 @@ function ParamControl({
|
|
|
82197
82191
|
import { memo as memo50 } from "react";
|
|
82198
82192
|
|
|
82199
82193
|
// src/components/renders/RenderQueue.tsx
|
|
82200
|
-
import { memo as memo49, useState as useState140, useRef as
|
|
82194
|
+
import { memo as memo49, useState as useState140, useRef as useRef164, useEffect as useEffect128, useLayoutEffect as useLayoutEffect9, useId as useId6 } from "react";
|
|
82201
82195
|
import { createPortal as createPortal10 } from "react-dom";
|
|
82202
82196
|
import { CANVAS_DIMENSIONS } from "@hyperframes/parsers";
|
|
82203
82197
|
|
|
@@ -82428,7 +82422,7 @@ var RenderQueueItem = memo47(function RenderQueueItem2({
|
|
|
82428
82422
|
});
|
|
82429
82423
|
|
|
82430
82424
|
// src/components/renders/FfmpegRequiredNotice.tsx
|
|
82431
|
-
import { memo as memo48, useEffect as
|
|
82425
|
+
import { memo as memo48, useEffect as useEffect127, useRef as useRef163, useState as useState139 } from "react";
|
|
82432
82426
|
import { jsx as jsx193, jsxs as jsxs162 } from "react/jsx-runtime";
|
|
82433
82427
|
var DOWNLOAD_URL = "https://ffmpeg.org/download.html";
|
|
82434
82428
|
var CUE_MS = 1600;
|
|
@@ -82440,18 +82434,18 @@ var FfmpegRequiredNotice = memo48(function FfmpegRequiredNotice2({
|
|
|
82440
82434
|
}) {
|
|
82441
82435
|
const [copied, setCopied] = useState139(false);
|
|
82442
82436
|
const [recheckFailed, setRecheckFailed] = useState139(false);
|
|
82443
|
-
const wasChecking =
|
|
82444
|
-
const cueTimer =
|
|
82445
|
-
|
|
82437
|
+
const wasChecking = useRef163(false);
|
|
82438
|
+
const cueTimer = useRef163(void 0);
|
|
82439
|
+
useEffect127(() => {
|
|
82446
82440
|
if (wasChecking.current && !checking) setRecheckFailed(true);
|
|
82447
82441
|
wasChecking.current = checking;
|
|
82448
82442
|
}, [checking]);
|
|
82449
|
-
|
|
82443
|
+
useEffect127(() => {
|
|
82450
82444
|
if (!recheckFailed) return;
|
|
82451
82445
|
cueTimer.current = setTimeout(() => setRecheckFailed(false), CUE_MS);
|
|
82452
82446
|
return () => clearTimeout(cueTimer.current);
|
|
82453
82447
|
}, [recheckFailed]);
|
|
82454
|
-
|
|
82448
|
+
useEffect127(() => () => clearTimeout(cueTimer.current), []);
|
|
82455
82449
|
const copy = async (command) => {
|
|
82456
82450
|
const ok = await copyTextToClipboard(command);
|
|
82457
82451
|
if (!ok) return;
|
|
@@ -82571,8 +82565,8 @@ var FORMAT_PANEL_SIZE = { width: 208, height: 150 };
|
|
|
82571
82565
|
function FormatInfoTooltip({ format }) {
|
|
82572
82566
|
const [open, setOpen] = useState140(false);
|
|
82573
82567
|
const [position, setPosition] = useState140(null);
|
|
82574
|
-
const triggerRef =
|
|
82575
|
-
const timeoutRef =
|
|
82568
|
+
const triggerRef = useRef164(null);
|
|
82569
|
+
const timeoutRef = useRef164(void 0);
|
|
82576
82570
|
const panelId = useId6();
|
|
82577
82571
|
const show = () => {
|
|
82578
82572
|
clearTimeout(timeoutRef.current);
|
|
@@ -82581,7 +82575,7 @@ function FormatInfoTooltip({ format }) {
|
|
|
82581
82575
|
const hide = () => {
|
|
82582
82576
|
timeoutRef.current = setTimeout(() => setOpen(false), 120);
|
|
82583
82577
|
};
|
|
82584
|
-
|
|
82578
|
+
useEffect128(() => () => clearTimeout(timeoutRef.current), []);
|
|
82585
82579
|
useLayoutEffect9(() => {
|
|
82586
82580
|
if (!open) return;
|
|
82587
82581
|
const el = triggerRef.current;
|
|
@@ -82595,7 +82589,7 @@ function FormatInfoTooltip({ format }) {
|
|
|
82595
82589
|
)
|
|
82596
82590
|
);
|
|
82597
82591
|
}, [open]);
|
|
82598
|
-
|
|
82592
|
+
useEffect128(() => {
|
|
82599
82593
|
if (!open) return;
|
|
82600
82594
|
const onKeyDown = (e) => {
|
|
82601
82595
|
if (e.key === "Escape") setOpen(false);
|
|
@@ -82823,8 +82817,8 @@ var RenderQueue = memo49(function RenderQueue2({
|
|
|
82823
82817
|
ffmpegChecking,
|
|
82824
82818
|
onRecheckFfmpeg
|
|
82825
82819
|
}) {
|
|
82826
|
-
const listRef =
|
|
82827
|
-
|
|
82820
|
+
const listRef = useRef164(null);
|
|
82821
|
+
useEffect128(() => {
|
|
82828
82822
|
if (listRef.current) {
|
|
82829
82823
|
listRef.current.scrollTo({ top: listRef.current.scrollHeight, behavior: "smooth" });
|
|
82830
82824
|
}
|
|
@@ -82972,7 +82966,7 @@ var RenderQueuePanel = memo50(function RenderQueuePanel2() {
|
|
|
82972
82966
|
});
|
|
82973
82967
|
|
|
82974
82968
|
// src/components/panels/SlideshowPanel.tsx
|
|
82975
|
-
import { useState as useState142, useEffect as
|
|
82969
|
+
import { useState as useState142, useEffect as useEffect129, useCallback as useCallback160, useRef as useRef165 } from "react";
|
|
82976
82970
|
import { parseSlideshowManifest } from "@hyperframes/core/slideshow";
|
|
82977
82971
|
|
|
82978
82972
|
// src/components/panels/SlideshowSubPanels.tsx
|
|
@@ -83651,13 +83645,13 @@ function SlideshowPanel({ scenes, onPersist, onPersistNotes }) {
|
|
|
83651
83645
|
);
|
|
83652
83646
|
const [persistError, setPersistError] = useState142(false);
|
|
83653
83647
|
const [retrying, setRetrying] = useState142(false);
|
|
83654
|
-
const undoStackRef =
|
|
83648
|
+
const undoStackRef = useRef165([]);
|
|
83655
83649
|
const [undoDepth, setUndoDepth] = useState142(0);
|
|
83656
83650
|
const currentTime = usePlayerStore((s) => s.currentTime);
|
|
83657
83651
|
const { domEditSelection } = useDomEditSelectionContext();
|
|
83658
|
-
const manifestRef =
|
|
83659
|
-
const notesCtrlRef =
|
|
83660
|
-
|
|
83652
|
+
const manifestRef = useRef165(manifest);
|
|
83653
|
+
const notesCtrlRef = useRef165(makeSlideshowNotesController());
|
|
83654
|
+
useEffect129(() => {
|
|
83661
83655
|
if (!compHtml) {
|
|
83662
83656
|
notesCtrlRef.current.flush();
|
|
83663
83657
|
setManifest({ slides: [] });
|
|
@@ -83719,7 +83713,7 @@ function SlideshowPanel({ scenes, onPersist, onPersistNotes }) {
|
|
|
83719
83713
|
},
|
|
83720
83714
|
[onPersistNotes]
|
|
83721
83715
|
);
|
|
83722
|
-
|
|
83716
|
+
useEffect129(() => {
|
|
83723
83717
|
const ctrl = notesCtrlRef.current;
|
|
83724
83718
|
return () => {
|
|
83725
83719
|
ctrl.flush();
|
|
@@ -83981,7 +83975,7 @@ function SlideshowPanel({ scenes, onPersist, onPersistNotes }) {
|
|
|
83981
83975
|
}
|
|
83982
83976
|
|
|
83983
83977
|
// src/components/panels/VariablesPanel.tsx
|
|
83984
|
-
import { memo as memo51, useCallback as useCallback164, useEffect as
|
|
83978
|
+
import { memo as memo51, useCallback as useCallback164, useEffect as useEffect131, useMemo as useMemo72, useState as useState146 } from "react";
|
|
83985
83979
|
|
|
83986
83980
|
// src/hooks/useVariablesPersist.ts
|
|
83987
83981
|
import { useCallback as useCallback161 } from "react";
|
|
@@ -84035,7 +84029,7 @@ function useVariablesPersist({
|
|
|
84035
84029
|
import { useCallback as useCallback163, useState as useState145 } from "react";
|
|
84036
84030
|
|
|
84037
84031
|
// src/hooks/useProjectCompositionVariables.ts
|
|
84038
|
-
import { useCallback as useCallback162, useEffect as
|
|
84032
|
+
import { useCallback as useCallback162, useEffect as useEffect130, useState as useState143 } from "react";
|
|
84039
84033
|
import { openComposition as openComposition4 } from "@hyperframes/sdk";
|
|
84040
84034
|
async function readGroup(path, readProjectFile) {
|
|
84041
84035
|
let content;
|
|
@@ -84059,7 +84053,7 @@ async function readGroup(path, readProjectFile) {
|
|
|
84059
84053
|
}
|
|
84060
84054
|
function useProjectCompositionVariables(fileTree, excludePath, readProjectFile, refreshKey) {
|
|
84061
84055
|
const [groups, setGroups] = useState143([]);
|
|
84062
|
-
|
|
84056
|
+
useEffect130(() => {
|
|
84063
84057
|
let cancelled = false;
|
|
84064
84058
|
const htmlFiles = fileTree.filter((p) => p.endsWith(".html") && p !== excludePath);
|
|
84065
84059
|
void (async () => {
|
|
@@ -84669,7 +84663,7 @@ var VariablesPanel = memo51(function VariablesPanel2({
|
|
|
84669
84663
|
const previewValues = usePreviewVariablesStore((s) => s.values);
|
|
84670
84664
|
const setPreviewValues = usePreviewVariablesStore((s) => s.setValues);
|
|
84671
84665
|
const [revision, setRevision] = useState146(0);
|
|
84672
|
-
|
|
84666
|
+
useEffect131(() => {
|
|
84673
84667
|
if (!sdkSession) return;
|
|
84674
84668
|
return sdkSession.on("change", () => setRevision((r) => r + 1));
|
|
84675
84669
|
}, [sdkSession]);
|
|
@@ -85039,7 +85033,7 @@ function useSlideshowPersist({
|
|
|
85039
85033
|
}
|
|
85040
85034
|
|
|
85041
85035
|
// src/hooks/useSlideshowTabState.ts
|
|
85042
|
-
import { useEffect as
|
|
85036
|
+
import { useEffect as useEffect132, useMemo as useMemo73 } from "react";
|
|
85043
85037
|
import { SLIDESHOW_ISLAND_TYPE as SLIDESHOW_ISLAND_TYPE2, slideshowIslandRegex as slideshowIslandRegex2 } from "@hyperframes/core/slideshow";
|
|
85044
85038
|
function useSlideshowTabState(params) {
|
|
85045
85039
|
const { editingFileContent, previewIframeRef, refreshKey, rightPanelTab, setRightPanelTab } = params;
|
|
@@ -85060,7 +85054,7 @@ function useSlideshowTabState(params) {
|
|
|
85060
85054
|
return [];
|
|
85061
85055
|
}
|
|
85062
85056
|
}, [previewIframeRef, rightPanelTab, refreshKey]);
|
|
85063
|
-
|
|
85057
|
+
useEffect132(() => {
|
|
85064
85058
|
if (rightPanelTab === "slideshow" && !isSlideshowComposition) {
|
|
85065
85059
|
setRightPanelTab("renders");
|
|
85066
85060
|
}
|
|
@@ -85331,13 +85325,13 @@ async function applyColorGradingScopeUpdate({
|
|
|
85331
85325
|
}
|
|
85332
85326
|
|
|
85333
85327
|
// src/hooks/useInspectorSplitResize.ts
|
|
85334
|
-
import { useCallback as useCallback167, useRef as
|
|
85328
|
+
import { useCallback as useCallback167, useRef as useRef166, useState as useState147 } from "react";
|
|
85335
85329
|
var MIN_INSPECTOR_SPLIT_PERCENT = 20;
|
|
85336
85330
|
var MAX_INSPECTOR_SPLIT_PERCENT = 75;
|
|
85337
85331
|
function useInspectorSplitResize() {
|
|
85338
85332
|
const [layersPanePercent, setLayersPanePercent] = useState147(40);
|
|
85339
|
-
const splitContainerRef =
|
|
85340
|
-
const splitDragRef =
|
|
85333
|
+
const splitContainerRef = useRef166(null);
|
|
85334
|
+
const splitDragRef = useRef166(null);
|
|
85341
85335
|
const handleInspectorSplitResizeStart = useCallback167(
|
|
85342
85336
|
(event) => {
|
|
85343
85337
|
event.preventDefault();
|
|
@@ -85374,10 +85368,10 @@ function useInspectorSplitResize() {
|
|
|
85374
85368
|
}
|
|
85375
85369
|
|
|
85376
85370
|
// src/hooks/useRemoveBackground.ts
|
|
85377
|
-
import { useCallback as useCallback168, useEffect as
|
|
85371
|
+
import { useCallback as useCallback168, useEffect as useEffect133, useRef as useRef167 } from "react";
|
|
85378
85372
|
function useRemoveBackground(projectId, refreshFileTree, showToast) {
|
|
85379
|
-
const abortRef =
|
|
85380
|
-
|
|
85373
|
+
const abortRef = useRef167(null);
|
|
85374
|
+
useEffect133(
|
|
85381
85375
|
() => () => {
|
|
85382
85376
|
abortRef.current?.abort();
|
|
85383
85377
|
},
|
|
@@ -85854,7 +85848,7 @@ function StudioRightPanel({
|
|
|
85854
85848
|
}
|
|
85855
85849
|
|
|
85856
85850
|
// src/components/TimelineToolbar.tsx
|
|
85857
|
-
import { useEffect as
|
|
85851
|
+
import { useEffect as useEffect135, useRef as useRef168 } from "react";
|
|
85858
85852
|
import { Image as Image2, Magnet, MagnifyingGlassMinus, MagnifyingGlassPlus } from "@phosphor-icons/react";
|
|
85859
85853
|
|
|
85860
85854
|
// src/hooks/useEnableKeyframes.ts
|
|
@@ -86193,7 +86187,7 @@ function useEnableKeyframes(sessionRef) {
|
|
|
86193
86187
|
}
|
|
86194
86188
|
|
|
86195
86189
|
// src/hooks/useKeyframeKeyboard.ts
|
|
86196
|
-
import { useEffect as
|
|
86190
|
+
import { useEffect as useEffect134, useCallback as useCallback171 } from "react";
|
|
86197
86191
|
function isTextInput2(el) {
|
|
86198
86192
|
if (!el) return false;
|
|
86199
86193
|
const tag = el.tagName;
|
|
@@ -86261,7 +86255,7 @@ function useKeyframeKeyboard({
|
|
|
86261
86255
|
onNudgeKeyframe
|
|
86262
86256
|
]
|
|
86263
86257
|
);
|
|
86264
|
-
|
|
86258
|
+
useEffect134(() => {
|
|
86265
86259
|
if (!enabled) return;
|
|
86266
86260
|
window.addEventListener("keydown", handler, { capture: true });
|
|
86267
86261
|
return () => window.removeEventListener("keydown", handler, { capture: true });
|
|
@@ -86311,7 +86305,7 @@ function useKeyframeToggle(session) {
|
|
|
86311
86305
|
const currentTime = usePlayerStore((s) => s.currentTime);
|
|
86312
86306
|
const selectedElementId = usePlayerStore((s) => s.selectedElementId);
|
|
86313
86307
|
const elements = usePlayerStore((s) => s.elements);
|
|
86314
|
-
const sessionRef =
|
|
86308
|
+
const sessionRef = useRef168(session);
|
|
86315
86309
|
sessionRef.current = session;
|
|
86316
86310
|
const onToggle = useEnableKeyframes(
|
|
86317
86311
|
sessionRef
|
|
@@ -86356,7 +86350,7 @@ function TimelineToolbar({ domEditSession, onSplitElement }) {
|
|
|
86356
86350
|
enabled: Boolean(onToggleKeyframe),
|
|
86357
86351
|
onAddKeyframe: onToggleKeyframe
|
|
86358
86352
|
});
|
|
86359
|
-
|
|
86353
|
+
useEffect135(() => {
|
|
86360
86354
|
const onKeyDown = (e) => {
|
|
86361
86355
|
if (e.key !== "n" && e.key !== "N") return;
|
|
86362
86356
|
if (e.metaKey || e.ctrlKey || e.altKey) return;
|
|
@@ -86634,16 +86628,16 @@ import { useState as useState155 } from "react";
|
|
|
86634
86628
|
import { Copy as Copy2, Check as Check2 } from "@phosphor-icons/react";
|
|
86635
86629
|
|
|
86636
86630
|
// src/hooks/useStoryboard.ts
|
|
86637
|
-
import { useCallback as useCallback172, useEffect as
|
|
86631
|
+
import { useCallback as useCallback172, useEffect as useEffect136, useRef as useRef169, useState as useState148 } from "react";
|
|
86638
86632
|
function useStoryboard(projectId) {
|
|
86639
86633
|
const [data, setData] = useState148(null);
|
|
86640
86634
|
const [loading, setLoading] = useState148(true);
|
|
86641
86635
|
const [error, setError] = useState148(null);
|
|
86642
86636
|
const [reloadKey, setReloadKey] = useState148(0);
|
|
86643
|
-
const hasDataRef =
|
|
86644
|
-
const lastProjectRef =
|
|
86637
|
+
const hasDataRef = useRef169(false);
|
|
86638
|
+
const lastProjectRef = useRef169(null);
|
|
86645
86639
|
const reload = useCallback172(() => setReloadKey((k) => k + 1), []);
|
|
86646
|
-
|
|
86640
|
+
useEffect136(() => {
|
|
86647
86641
|
if (!projectId) return;
|
|
86648
86642
|
let cancelled = false;
|
|
86649
86643
|
if (lastProjectRef.current !== projectId) {
|
|
@@ -86675,7 +86669,7 @@ function useStoryboard(projectId) {
|
|
|
86675
86669
|
}
|
|
86676
86670
|
|
|
86677
86671
|
// src/hooks/useProjectSignaturePoll.ts
|
|
86678
|
-
import { useEffect as
|
|
86672
|
+
import { useEffect as useEffect137, useRef as useRef170 } from "react";
|
|
86679
86673
|
var POLL_INTERVAL_MS = 2e3;
|
|
86680
86674
|
async function fetchProjectSignature(projectId) {
|
|
86681
86675
|
try {
|
|
@@ -86688,11 +86682,11 @@ async function fetchProjectSignature(projectId) {
|
|
|
86688
86682
|
}
|
|
86689
86683
|
}
|
|
86690
86684
|
function useProjectSignaturePoll(projectId, currentSignature, onChange) {
|
|
86691
|
-
const signatureRef =
|
|
86692
|
-
const onChangeRef =
|
|
86685
|
+
const signatureRef = useRef170(currentSignature);
|
|
86686
|
+
const onChangeRef = useRef170(onChange);
|
|
86693
86687
|
signatureRef.current = currentSignature;
|
|
86694
86688
|
onChangeRef.current = onChange;
|
|
86695
|
-
|
|
86689
|
+
useEffect137(() => {
|
|
86696
86690
|
if (!projectId) return;
|
|
86697
86691
|
let disposed = false;
|
|
86698
86692
|
let inFlight = false;
|
|
@@ -86719,7 +86713,7 @@ function useProjectSignaturePoll(projectId, currentSignature, onChange) {
|
|
|
86719
86713
|
}
|
|
86720
86714
|
|
|
86721
86715
|
// src/components/storyboard/StoryboardLoaded.tsx
|
|
86722
|
-
import { useEffect as
|
|
86716
|
+
import { useEffect as useEffect143, useMemo as useMemo76, useState as useState154 } from "react";
|
|
86723
86717
|
|
|
86724
86718
|
// src/components/storyboard/StoryboardDirection.tsx
|
|
86725
86719
|
import { jsx as jsx206, jsxs as jsxs171 } from "react/jsx-runtime";
|
|
@@ -86742,7 +86736,7 @@ function StoryboardDirection({ globals, frameCount }) {
|
|
|
86742
86736
|
}
|
|
86743
86737
|
|
|
86744
86738
|
// src/components/storyboard/FramePoster.tsx
|
|
86745
|
-
import { useEffect as
|
|
86739
|
+
import { useEffect as useEffect138, useState as useState149 } from "react";
|
|
86746
86740
|
import { jsx as jsx207 } from "react/jsx-runtime";
|
|
86747
86741
|
function FramePoster({
|
|
86748
86742
|
projectId,
|
|
@@ -86753,7 +86747,7 @@ function FramePoster({
|
|
|
86753
86747
|
posterVersion
|
|
86754
86748
|
}) {
|
|
86755
86749
|
const [failed2, setFailed] = useState149(false);
|
|
86756
|
-
|
|
86750
|
+
useEffect138(() => setFailed(false), [src, seconds, posterVersion, surface]);
|
|
86757
86751
|
if (failed2) {
|
|
86758
86752
|
return /* @__PURE__ */ jsx207("div", { className: "flex h-full w-full items-center justify-center text-[11px] text-neutral-600", children: "Preview unavailable" });
|
|
86759
86753
|
}
|
|
@@ -86956,7 +86950,7 @@ function StoryboardScriptPanel({ script }) {
|
|
|
86956
86950
|
}
|
|
86957
86951
|
|
|
86958
86952
|
// src/components/storyboard/StoryboardSourceEditor.tsx
|
|
86959
|
-
import { useCallback as useCallback173, useEffect as
|
|
86953
|
+
import { useCallback as useCallback173, useEffect as useEffect139, useMemo as useMemo74, useRef as useRef171, useState as useState150 } from "react";
|
|
86960
86954
|
import { marked } from "marked";
|
|
86961
86955
|
import DOMPurify from "dompurify";
|
|
86962
86956
|
import { jsx as jsx211, jsxs as jsxs174 } from "react/jsx-runtime";
|
|
@@ -86968,7 +86962,7 @@ function useEditableFile(path, onSaved) {
|
|
|
86968
86962
|
const [loading, setLoading] = useState150(true);
|
|
86969
86963
|
const [saving, setSaving] = useState150(false);
|
|
86970
86964
|
const [error, setError] = useState150(null);
|
|
86971
|
-
|
|
86965
|
+
useEffect139(() => {
|
|
86972
86966
|
if (!path) return;
|
|
86973
86967
|
let cancelled = false;
|
|
86974
86968
|
setLoading(true);
|
|
@@ -87005,8 +86999,8 @@ function hardenLinks(node) {
|
|
|
87005
86999
|
}
|
|
87006
87000
|
function useMarkdownPreview(source) {
|
|
87007
87001
|
const [debounced, setDebounced] = useState150(source);
|
|
87008
|
-
const primed =
|
|
87009
|
-
|
|
87002
|
+
const primed = useRef171(false);
|
|
87003
|
+
useEffect139(() => {
|
|
87010
87004
|
if (!primed.current && source !== "") {
|
|
87011
87005
|
primed.current = true;
|
|
87012
87006
|
setDebounced(source);
|
|
@@ -87038,8 +87032,8 @@ function StoryboardSourceEditor({
|
|
|
87038
87032
|
const activePath = files.some((f) => f.path === selected) ? selected : files[0]?.path ?? "";
|
|
87039
87033
|
const file = useEditableFile(activePath, onSaved);
|
|
87040
87034
|
const previewHtml = useMarkdownPreview(file.content);
|
|
87041
|
-
|
|
87042
|
-
|
|
87035
|
+
useEffect139(() => onDirtyChange?.(file.dirty), [onDirtyChange, file.dirty]);
|
|
87036
|
+
useEffect139(() => {
|
|
87043
87037
|
if (!file.dirty) return;
|
|
87044
87038
|
const onBeforeUnload = (event) => {
|
|
87045
87039
|
event.preventDefault();
|
|
@@ -87111,11 +87105,11 @@ function StoryboardSourceEditor({
|
|
|
87111
87105
|
}
|
|
87112
87106
|
|
|
87113
87107
|
// src/components/storyboard/StoryboardFrameFocus.tsx
|
|
87114
|
-
import { useCallback as useCallback174, useEffect as
|
|
87108
|
+
import { useCallback as useCallback174, useEffect as useEffect141, useState as useState152 } from "react";
|
|
87115
87109
|
import { setFrameVoiceover } from "@hyperframes/core/storyboard";
|
|
87116
87110
|
|
|
87117
87111
|
// src/components/storyboard/AgentChatMessageButton.tsx
|
|
87118
|
-
import { useEffect as
|
|
87112
|
+
import { useEffect as useEffect140, useState as useState151 } from "react";
|
|
87119
87113
|
import { jsx as jsx212 } from "react/jsx-runtime";
|
|
87120
87114
|
var APPLY_STORYBOARD_FEEDBACK_MESSAGE = "Read the storyboard feedback I saved in .hyperframes/frame-comments.json and revise the frames.";
|
|
87121
87115
|
function AgentChatMessageButton({
|
|
@@ -87124,7 +87118,7 @@ function AgentChatMessageButton({
|
|
|
87124
87118
|
onCopied
|
|
87125
87119
|
}) {
|
|
87126
87120
|
const [copyState, setCopyState] = useState151("idle");
|
|
87127
|
-
|
|
87121
|
+
useEffect140(() => {
|
|
87128
87122
|
if (copyState !== "copied") return;
|
|
87129
87123
|
const timeout = window.setTimeout(() => setCopyState("again"), 3e3);
|
|
87130
87124
|
return () => window.clearTimeout(timeout);
|
|
@@ -87197,7 +87191,7 @@ function StoryboardFrameFocus({
|
|
|
87197
87191
|
const saved = await applyEdit((src) => setFrameVoiceover(src, frame.index, draft));
|
|
87198
87192
|
if (saved) setSavedVoiceover(draft);
|
|
87199
87193
|
}, [applyEdit, frame.index, draft]);
|
|
87200
|
-
|
|
87194
|
+
useEffect141(() => {
|
|
87201
87195
|
if (!dirty) return;
|
|
87202
87196
|
const onBeforeUnload = (e) => {
|
|
87203
87197
|
e.preventDefault();
|
|
@@ -87209,14 +87203,14 @@ function StoryboardFrameFocus({
|
|
|
87209
87203
|
() => !dirty || window.confirm("Discard unsaved voiceover changes?"),
|
|
87210
87204
|
[dirty]
|
|
87211
87205
|
);
|
|
87212
|
-
|
|
87206
|
+
useEffect141(() => registerViewModeGuard(confirmLeave), [confirmLeave, registerViewModeGuard]);
|
|
87213
87207
|
const handleBack = () => {
|
|
87214
87208
|
if (confirmLeave()) onBack();
|
|
87215
87209
|
};
|
|
87216
87210
|
const handleNavigate = (delta) => {
|
|
87217
87211
|
if (confirmLeave()) onNavigate(delta);
|
|
87218
87212
|
};
|
|
87219
|
-
|
|
87213
|
+
useEffect141(() => {
|
|
87220
87214
|
const onKey = (e) => {
|
|
87221
87215
|
if (isTypingTarget(document.activeElement)) return;
|
|
87222
87216
|
if (e.key === "Escape") handleBack();
|
|
@@ -87687,7 +87681,7 @@ function progressLabel(summary) {
|
|
|
87687
87681
|
}
|
|
87688
87682
|
|
|
87689
87683
|
// src/components/storyboard/useFrameComments.ts
|
|
87690
|
-
import { useCallback as useCallback175, useEffect as
|
|
87684
|
+
import { useCallback as useCallback175, useEffect as useEffect142, useMemo as useMemo75, useState as useState153 } from "react";
|
|
87691
87685
|
|
|
87692
87686
|
// src/components/storyboard/frameComments.ts
|
|
87693
87687
|
var FRAME_COMMENTS_PATH = ".hyperframes/frame-comments.json";
|
|
@@ -87760,7 +87754,7 @@ function useFrameComments(frames) {
|
|
|
87760
87754
|
} catch {
|
|
87761
87755
|
}
|
|
87762
87756
|
}, [readOptionalProjectFile]);
|
|
87763
|
-
|
|
87757
|
+
useEffect142(() => {
|
|
87764
87758
|
void refreshPending();
|
|
87765
87759
|
const onFocus = () => void refreshPending();
|
|
87766
87760
|
window.addEventListener("focus", onFocus);
|
|
@@ -87821,10 +87815,10 @@ function StoryboardLoaded({
|
|
|
87821
87815
|
const [feedbackMessageCopied, setFeedbackMessageCopied] = useState154(false);
|
|
87822
87816
|
const comments = useFrameComments(data.frames);
|
|
87823
87817
|
const { refreshPending } = comments;
|
|
87824
|
-
|
|
87818
|
+
useEffect143(() => {
|
|
87825
87819
|
void refreshPending();
|
|
87826
87820
|
}, [data.signature, refreshPending]);
|
|
87827
|
-
|
|
87821
|
+
useEffect143(() => {
|
|
87828
87822
|
if (comments.draftCount > 0) setFeedbackMessageCopied(false);
|
|
87829
87823
|
}, [comments.draftCount]);
|
|
87830
87824
|
const saveFeedbackAndCopyMessage = async () => {
|
|
@@ -88173,7 +88167,7 @@ function StudioSplash({ waiting }) {
|
|
|
88173
88167
|
}
|
|
88174
88168
|
|
|
88175
88169
|
// src/hooks/useServerConnection.ts
|
|
88176
|
-
import { useEffect as
|
|
88170
|
+
import { useEffect as useEffect144, useState as useState156 } from "react";
|
|
88177
88171
|
function useServerConnection() {
|
|
88178
88172
|
const [projectId, setProjectId] = useState156(null);
|
|
88179
88173
|
const [resolving, setResolving] = useState156(true);
|
|
@@ -88214,7 +88208,7 @@ function useServerConnection() {
|
|
|
88214
88208
|
if (retryTimer !== null) clearTimeout(retryTimer);
|
|
88215
88209
|
};
|
|
88216
88210
|
});
|
|
88217
|
-
|
|
88211
|
+
useEffect144(() => {
|
|
88218
88212
|
const onHashChange = () => {
|
|
88219
88213
|
const next = parseProjectIdFromHash(window.location.hash);
|
|
88220
88214
|
if (next && next !== projectId) setProjectId(next);
|
|
@@ -88226,9 +88220,9 @@ function useServerConnection() {
|
|
|
88226
88220
|
}
|
|
88227
88221
|
|
|
88228
88222
|
// src/hooks/useStudioSessionStart.ts
|
|
88229
|
-
import { useEffect as
|
|
88223
|
+
import { useEffect as useEffect145 } from "react";
|
|
88230
88224
|
function useStudioSessionStart(projectId, resolving, waitingForServer) {
|
|
88231
|
-
|
|
88225
|
+
useEffect145(() => {
|
|
88232
88226
|
if (resolving || waitingForServer || hasFiredSessionStart()) return;
|
|
88233
88227
|
markSessionStartFired();
|
|
88234
88228
|
trackStudioSessionStart({ has_project: projectId != null });
|
|
@@ -88249,7 +88243,7 @@ function useTimelineAddAtPlayhead(addAsset, addComposition) {
|
|
|
88249
88243
|
}
|
|
88250
88244
|
|
|
88251
88245
|
// src/hooks/useHydrateActiveCompPathFromUrl.ts
|
|
88252
|
-
import { useEffect as
|
|
88246
|
+
import { useEffect as useEffect146 } from "react";
|
|
88253
88247
|
function useHydrateActiveCompPathFromUrl({
|
|
88254
88248
|
hydrated,
|
|
88255
88249
|
fileTreeLoaded,
|
|
@@ -88258,7 +88252,7 @@ function useHydrateActiveCompPathFromUrl({
|
|
|
88258
88252
|
setActiveCompPath,
|
|
88259
88253
|
setHydrated
|
|
88260
88254
|
}) {
|
|
88261
|
-
|
|
88255
|
+
useEffect146(() => {
|
|
88262
88256
|
if (hydrated) return;
|
|
88263
88257
|
if (!fileTreeLoaded) return;
|
|
88264
88258
|
const nextCompPath = normalizeStudioCompositionPath(
|
|
@@ -88275,7 +88269,7 @@ import { jsx as jsx218, jsxs as jsxs180 } from "react/jsx-runtime";
|
|
|
88275
88269
|
var getTimelineSelectionSet = () => usePlayerStore.getState().selectedElementIds;
|
|
88276
88270
|
function StudioApp() {
|
|
88277
88271
|
const { projectId, resolving, waitingForServer } = useServerConnection();
|
|
88278
|
-
const initialUrlStateRef =
|
|
88272
|
+
const initialUrlStateRef = useRef172(readStudioUrlStateFromWindow());
|
|
88279
88273
|
const viewModeValue = useViewModeState();
|
|
88280
88274
|
useStudioSessionStart(projectId, resolving, waitingForServer);
|
|
88281
88275
|
const [activeCompPath, setActiveCompPath] = useState157(null);
|
|
@@ -88288,10 +88282,10 @@ function StudioApp() {
|
|
|
88288
88282
|
const [refreshKey, setRefreshKey] = useState157(0);
|
|
88289
88283
|
const [previewDocumentVersion, refreshPreviewDocumentVersion] = usePreviewDocumentVersion();
|
|
88290
88284
|
const [blockPreview, setBlockPreview] = useState157(null);
|
|
88291
|
-
const previewIframeRef =
|
|
88292
|
-
const activeCompPathRef =
|
|
88285
|
+
const previewIframeRef = useRef172(null);
|
|
88286
|
+
const activeCompPathRef = useRef172(activeCompPath);
|
|
88293
88287
|
activeCompPathRef.current = activeCompPath;
|
|
88294
|
-
const leftSidebarRef =
|
|
88288
|
+
const leftSidebarRef = useRef172(null);
|
|
88295
88289
|
const renderQueue = useRenderQueue(projectId, activeCompPathRef);
|
|
88296
88290
|
const captionEditMode = useCaptionStore((s) => s.isEditMode);
|
|
88297
88291
|
const captionHasSelection = useCaptionStore((s) => s.selectedSegmentIds.size > 0);
|
|
@@ -88311,10 +88305,10 @@ function StudioApp() {
|
|
|
88311
88305
|
rightPanelTab: initialUrlStateRef.current.rightPanelTab
|
|
88312
88306
|
});
|
|
88313
88307
|
const editHistory = usePersistentEditHistory({ projectId });
|
|
88314
|
-
const domEditSaveTimestampRef =
|
|
88315
|
-
const handleDomZIndexReorderCommitRef =
|
|
88316
|
-
const pendingTimelineEditPathRef =
|
|
88317
|
-
const isGestureRecordingRef =
|
|
88308
|
+
const domEditSaveTimestampRef = useRef172(0);
|
|
88309
|
+
const handleDomZIndexReorderCommitRef = useRef172(null);
|
|
88310
|
+
const pendingTimelineEditPathRef = useRef172(/* @__PURE__ */ new Set());
|
|
88311
|
+
const isGestureRecordingRef = useRef172(false);
|
|
88318
88312
|
const reloadPreview = useCallback177(() => setRefreshKey((k) => k + 1), []);
|
|
88319
88313
|
const fileManager = useFileManager({
|
|
88320
88314
|
projectId,
|
|
@@ -88355,10 +88349,9 @@ function StudioApp() {
|
|
|
88355
88349
|
masterCompPath,
|
|
88356
88350
|
fileManager,
|
|
88357
88351
|
previewPersistence,
|
|
88358
|
-
pendingTimelineEditPathRef
|
|
88359
|
-
reloadPreview
|
|
88352
|
+
pendingTimelineEditPathRef
|
|
88360
88353
|
});
|
|
88361
|
-
const invalidateGsapCacheRef =
|
|
88354
|
+
const invalidateGsapCacheRef = useRef172(() => {
|
|
88362
88355
|
});
|
|
88363
88356
|
const invalidateGsapCache = useCallback177(() => invalidateGsapCacheRef.current(), []);
|
|
88364
88357
|
const timelineEditing = useTimelineEditing({
|
|
@@ -88418,14 +88411,14 @@ function StudioApp() {
|
|
|
88418
88411
|
setRightCollapsed: panelLayout.setRightCollapsed,
|
|
88419
88412
|
setRightPanelTab: panelLayout.setRightPanelTab
|
|
88420
88413
|
});
|
|
88421
|
-
const clearDomSelectionRef =
|
|
88414
|
+
const clearDomSelectionRef = useRef172(() => {
|
|
88422
88415
|
});
|
|
88423
|
-
const domEditSelectionBridgeRef =
|
|
88424
|
-
const handleDomEditElementDeleteRef =
|
|
88416
|
+
const domEditSelectionBridgeRef = useRef172(null);
|
|
88417
|
+
const handleDomEditElementDeleteRef = useRef172(async () => {
|
|
88425
88418
|
});
|
|
88426
88419
|
const domEditDeleteBridge = (s, o) => handleDomEditElementDeleteRef.current(s, o);
|
|
88427
|
-
const resetKeyframesRef =
|
|
88428
|
-
const deleteSelectedKeyframesRef =
|
|
88420
|
+
const resetKeyframesRef = useRef172(() => false);
|
|
88421
|
+
const deleteSelectedKeyframesRef = useRef172(() => {
|
|
88429
88422
|
});
|
|
88430
88423
|
const { handleCopy: handleCopy2, handlePaste: handlePaste2, handleCut } = useClipboard({
|
|
88431
88424
|
projectId,
|
|
@@ -88467,7 +88460,7 @@ function StudioApp() {
|
|
|
88467
88460
|
forceReloadSdkSession: sdkHandle.forceReload,
|
|
88468
88461
|
onToggleRecording: () => handleToggleRecordingRef.current()
|
|
88469
88462
|
});
|
|
88470
|
-
const sidebarTabRef =
|
|
88463
|
+
const sidebarTabRef = useRef172({
|
|
88471
88464
|
select: (t) => leftSidebarRef.current?.selectTab(t),
|
|
88472
88465
|
get: () => leftSidebarRef.current?.getTab() ?? "compositions"
|
|
88473
88466
|
});
|
|
@@ -88557,9 +88550,9 @@ function StudioApp() {
|
|
|
88557
88550
|
resetErrors: resetConsoleErrors
|
|
88558
88551
|
} = useConsoleErrorCapture(previewIframe);
|
|
88559
88552
|
const dragOverlay = useGlobalFileDrop(timelineEditing.handleTimelineFileDrop);
|
|
88560
|
-
const handleToggleRecordingRef =
|
|
88553
|
+
const handleToggleRecordingRef = useRef172(() => {
|
|
88561
88554
|
});
|
|
88562
|
-
const domEditSessionRef =
|
|
88555
|
+
const domEditSessionRef = useRef172(domEditSession);
|
|
88563
88556
|
domEditSessionRef.current = domEditSession;
|
|
88564
88557
|
const { gestureState, gestureRecording, handleToggleRecording } = useGestureCommit({
|
|
88565
88558
|
domEditSessionRef,
|
|
@@ -88568,7 +88561,7 @@ function StudioApp() {
|
|
|
88568
88561
|
isGestureRecordingRef
|
|
88569
88562
|
});
|
|
88570
88563
|
handleToggleRecordingRef.current = handleToggleRecording;
|
|
88571
|
-
const canvasRectRef =
|
|
88564
|
+
const canvasRectRef = useRef172(null);
|
|
88572
88565
|
useLayoutEffect10(() => {
|
|
88573
88566
|
if (gestureState !== "recording" || !previewIframe) {
|
|
88574
88567
|
canvasRectRef.current = null;
|
|
@@ -88809,11 +88802,11 @@ function StudioApp() {
|
|
|
88809
88802
|
}
|
|
88810
88803
|
|
|
88811
88804
|
// src/hooks/useElementPicker.ts
|
|
88812
|
-
import { useState as useState158, useCallback as useCallback178, useRef as
|
|
88805
|
+
import { useState as useState158, useCallback as useCallback178, useRef as useRef173 } from "react";
|
|
88813
88806
|
function useElementPicker(iframeRef, options) {
|
|
88814
88807
|
const [isPickMode, setIsPickMode] = useState158(false);
|
|
88815
88808
|
const [pickedElement, setPickedElement] = useState158(null);
|
|
88816
|
-
const activeOverrideRef =
|
|
88809
|
+
const activeOverrideRef = useRef173(null);
|
|
88817
88810
|
const getActiveIframe = useCallback178(() => {
|
|
88818
88811
|
return activeOverrideRef.current ?? iframeRef.current;
|
|
88819
88812
|
}, [iframeRef]);
|
|
@@ -88887,7 +88880,7 @@ function useElementPicker(iframeRef, options) {
|
|
|
88887
88880
|
window.addEventListener("message", handleMessage);
|
|
88888
88881
|
return () => window.removeEventListener("message", handleMessage);
|
|
88889
88882
|
});
|
|
88890
|
-
const optionsRef =
|
|
88883
|
+
const optionsRef = useRef173(options);
|
|
88891
88884
|
optionsRef.current = options;
|
|
88892
88885
|
const syncToSource = useCallback178(
|
|
88893
88886
|
(elementId2, selector, op) => {
|
|
@@ -88998,7 +88991,7 @@ function useElementPicker(iframeRef, options) {
|
|
|
88998
88991
|
},
|
|
88999
88992
|
[pickedElement, getActiveIframe, syncToSource]
|
|
89000
88993
|
);
|
|
89001
|
-
const activeIframeRef =
|
|
88994
|
+
const activeIframeRef = useRef173(null);
|
|
89002
88995
|
activeIframeRef.current = getActiveIframe();
|
|
89003
88996
|
return {
|
|
89004
88997
|
isPickMode,
|