@hyperframes/studio 0.9.30 → 0.9.32
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/{codec-B1UWDNJp.js → codec-Bz1jsLs8.js} +1 -1
- package/dist/assets/{hyperframes-player-DQd2VPm2.js → hyperframes-player-cdH5Sz_t.js} +1 -1
- package/dist/assets/{index-gkyTLE7n.js → index-D1l7izdf.js} +176 -176
- package/dist/assets/{index-B7CtVv8e.js → index-DFRbcd5J.js} +1 -1
- package/dist/assets/{pausedVideoDecoder-Bfv1WSlz.js → pausedVideoDecoder-CgV8YB6S.js} +1 -1
- package/dist/{chunk-J3VJE463.js → chunk-52AJB4PN.js} +4 -1
- package/dist/{chunk-LRTUWOR4.js → chunk-YKBN653R.js} +1 -1
- package/dist/index.html +1 -1
- package/dist/index.js +179 -204
- package/dist/player.js +2 -2
- package/dist/ui.js +1 -1
- package/package.json +8 -8
- package/src/components/sidebar/CompositionsTab.hoverPreview.test.tsx +100 -0
- package/src/components/sidebar/CompositionsTab.test.ts +2 -24
- package/src/components/sidebar/CompositionsTab.tsx +35 -100
- package/src/components/ui/Input.tsx +4 -1
- package/src/components/ui/valueControls.test.tsx +85 -0
- package/src/hooks/timelineAudioGroupCreate.ts +2 -1
- package/src/hooks/useGestureCommit.ts +2 -1
- package/src/hooks/useRazorSplit.ts +5 -1
- package/src/hooks/useTimelineDeleteOps.test.tsx +28 -0
- package/src/hooks/useTimelineDeleteOps.ts +4 -1
- package/src/utils/countOf.test.ts +10 -0
- package/src/utils/countOf.ts +3 -0
- package/src/webmcp/polyfill.transport.test.ts +59 -0
- package/src/webmcp/polyfill.ts +15 -0
package/dist/index.js
CHANGED
|
@@ -74,7 +74,7 @@ import {
|
|
|
74
74
|
whileScriptWrites,
|
|
75
75
|
writeStudioUiPreferences,
|
|
76
76
|
zoomToSelectedClips
|
|
77
|
-
} from "./chunk-
|
|
77
|
+
} from "./chunk-YKBN653R.js";
|
|
78
78
|
import {
|
|
79
79
|
Button,
|
|
80
80
|
ContextMenu,
|
|
@@ -106,7 +106,7 @@ import {
|
|
|
106
106
|
fieldBase,
|
|
107
107
|
fieldText,
|
|
108
108
|
popupSurface
|
|
109
|
-
} from "./chunk-
|
|
109
|
+
} from "./chunk-52AJB4PN.js";
|
|
110
110
|
import {
|
|
111
111
|
DOM_EDIT_LAYER_OBSERVER_INIT,
|
|
112
112
|
buildDefaultDomEditTextField,
|
|
@@ -52016,8 +52016,17 @@ function getModelContext(doc = document) {
|
|
|
52016
52016
|
// src/webmcp/polyfill.ts
|
|
52017
52017
|
var log = makeStudioDebugLogger("webmcp");
|
|
52018
52018
|
var pending = null;
|
|
52019
|
+
function ownPageOnly() {
|
|
52020
|
+
return {
|
|
52021
|
+
transport: {
|
|
52022
|
+
tabServer: { allowedOrigins: [window.location.origin] },
|
|
52023
|
+
iframeServer: false
|
|
52024
|
+
}
|
|
52025
|
+
};
|
|
52026
|
+
}
|
|
52019
52027
|
async function importPolyfill() {
|
|
52020
52028
|
try {
|
|
52029
|
+
window.__webModelContextOptions = ownPageOnly();
|
|
52021
52030
|
await import("@mcp-b/global");
|
|
52022
52031
|
const modelContext = getModelContext();
|
|
52023
52032
|
if (!modelContext) {
|
|
@@ -74670,7 +74679,7 @@ var FileTree = memo43(function FileTree2({
|
|
|
74670
74679
|
});
|
|
74671
74680
|
|
|
74672
74681
|
// src/App.tsx
|
|
74673
|
-
import { useState as useState168, useCallback as
|
|
74682
|
+
import { useState as useState168, useCallback as useCallback197, useRef as useRef194, useMemo as useMemo91 } from "react";
|
|
74674
74683
|
|
|
74675
74684
|
// src/hooks/useStableHandlers.ts
|
|
74676
74685
|
import { useRef as useRef122 } from "react";
|
|
@@ -78394,6 +78403,11 @@ function useFreezeFrame(options) {
|
|
|
78394
78403
|
}, []);
|
|
78395
78404
|
}
|
|
78396
78405
|
|
|
78406
|
+
// src/utils/countOf.ts
|
|
78407
|
+
function countOf(n, word) {
|
|
78408
|
+
return `${n} ${n === 1 ? word : `${word}s`}`;
|
|
78409
|
+
}
|
|
78410
|
+
|
|
78397
78411
|
// src/hooks/useRazorSplit.ts
|
|
78398
78412
|
function useRazorSplit({
|
|
78399
78413
|
projectId,
|
|
@@ -78502,7 +78516,10 @@ function useRazorSplit({
|
|
|
78502
78516
|
const result = await runCut(splittable, splitTime, "all");
|
|
78503
78517
|
if (!result) return;
|
|
78504
78518
|
if (result.syncFailed) return;
|
|
78505
|
-
showToast(
|
|
78519
|
+
showToast(
|
|
78520
|
+
`Split ${countOf(result.splitCount, "clip")} at ${splitTime.toFixed(2)}s`,
|
|
78521
|
+
"info"
|
|
78522
|
+
);
|
|
78506
78523
|
} catch (error) {
|
|
78507
78524
|
const message = error instanceof Error ? error.message : "Failed to split clips";
|
|
78508
78525
|
showToast(message, "error");
|
|
@@ -79553,7 +79570,9 @@ function useTimelineDeleteOps({
|
|
|
79553
79570
|
}
|
|
79554
79571
|
);
|
|
79555
79572
|
if (!removeResponse.ok) {
|
|
79556
|
-
throw new Error(
|
|
79573
|
+
throw new Error(
|
|
79574
|
+
`Failed to delete ${countOf(sameFile.length, "clip")} from ${targetPath}`
|
|
79575
|
+
);
|
|
79557
79576
|
}
|
|
79558
79577
|
const removeData = await removeResponse.json();
|
|
79559
79578
|
const removedContent = typeof removeData.content === "string" ? removeData.content : originalContent;
|
|
@@ -80229,7 +80248,7 @@ async function createAudioGroupAndAssignMembers({
|
|
|
80229
80248
|
pendingTimelineEditPathRef
|
|
80230
80249
|
}) {
|
|
80231
80250
|
if (elements.length < 2) {
|
|
80232
|
-
throw new Error(`Cannot group ${elements.length
|
|
80251
|
+
throw new Error(`Cannot group ${countOf(elements.length, "clip")}: a group needs at least two`);
|
|
80233
80252
|
}
|
|
80234
80253
|
if (!GROUP_ID_PATTERN.test(groupId)) {
|
|
80235
80254
|
throw new Error(`Invalid audio group id ${JSON.stringify(groupId)}`);
|
|
@@ -92852,7 +92871,7 @@ function useGestureCommit({
|
|
|
92852
92871
|
}
|
|
92853
92872
|
trackPreviewEditResult("gesture_recording", recordingMethodRef.current, outcome.finish());
|
|
92854
92873
|
}
|
|
92855
|
-
showToast(`Recorded ${sortedPcts.length}
|
|
92874
|
+
showToast(`Recorded ${countOf(sortedPcts.length, "keyframe")}`, "info");
|
|
92856
92875
|
} catch (err) {
|
|
92857
92876
|
console.error("[GR:error]", err);
|
|
92858
92877
|
showToast(`Gesture commit failed: ${err}`, "error");
|
|
@@ -93074,7 +93093,7 @@ function useGestureTrailOverlay({
|
|
|
93074
93093
|
import { useMemo as useMemo90 } from "react";
|
|
93075
93094
|
|
|
93076
93095
|
// src/components/StudioLeftPanels.tsx
|
|
93077
|
-
import { memo as memo51, useCallback as
|
|
93096
|
+
import { memo as memo51, useCallback as useCallback174 } from "react";
|
|
93078
93097
|
|
|
93079
93098
|
// src/components/MediaPreview.tsx
|
|
93080
93099
|
import { useEffect as useEffect141, useState as useState140 } from "react";
|
|
@@ -95097,12 +95116,12 @@ function BlockCard({
|
|
|
95097
95116
|
}
|
|
95098
95117
|
|
|
95099
95118
|
// src/components/sidebar/CompositionsTab.tsx
|
|
95100
|
-
import { memo as memo50,
|
|
95119
|
+
import { memo as memo50, useEffect as useEffect150, useLayoutEffect as useLayoutEffect15, useMemo as useMemo86, useRef as useRef181, useState as useState149 } from "react";
|
|
95101
95120
|
import { jsx as jsx228, jsxs as jsxs178 } from "react/jsx-runtime";
|
|
95102
95121
|
var DEFAULT_PREVIEW_STAGE = { width: 1920, height: 1080 };
|
|
95103
95122
|
var CARD_W = 80;
|
|
95104
95123
|
var CARD_H = 45;
|
|
95105
|
-
var
|
|
95124
|
+
var OPAQUE_ORIGIN_SCRIPTS_ONLY_SANDBOX = "allow-scripts";
|
|
95106
95125
|
function resolveCompositionPreviewScale(input) {
|
|
95107
95126
|
const safeStageWidth = Number.isFinite(input.stageWidth) && input.stageWidth > 0 ? input.stageWidth : DEFAULT_PREVIEW_STAGE.width;
|
|
95108
95127
|
const safeStageHeight = Number.isFinite(input.stageHeight) && input.stageHeight > 0 ? input.stageHeight : DEFAULT_PREVIEW_STAGE.height;
|
|
@@ -95122,43 +95141,22 @@ function compositionCardThumbnailUrl(projectId, comp, contentRevision) {
|
|
|
95122
95141
|
contentRevision
|
|
95123
95142
|
});
|
|
95124
95143
|
}
|
|
95125
|
-
function
|
|
95126
|
-
|
|
95127
|
-
const parsed = Number.parseFloat(value);
|
|
95128
|
-
return Number.isFinite(parsed) && parsed > 0 ? parsed : null;
|
|
95144
|
+
function positiveDimension(value, fallback) {
|
|
95145
|
+
return typeof value === "number" && Number.isFinite(value) && value > 0 ? value : fallback;
|
|
95129
95146
|
}
|
|
95130
|
-
function
|
|
95131
|
-
|
|
95132
|
-
|
|
95133
|
-
|
|
95134
|
-
|
|
95135
|
-
|
|
95136
|
-
|
|
95137
|
-
}
|
|
95138
|
-
}
|
|
95139
|
-
try {
|
|
95140
|
-
const doc = iframe?.contentDocument;
|
|
95141
|
-
const root = doc?.querySelector("[data-composition-id]") ?? doc?.documentElement ?? null;
|
|
95142
|
-
return parsePositiveNumber(root?.getAttribute("data-composition-duration") ?? null) ?? parsePositiveNumber(root?.getAttribute("data-duration") ?? null);
|
|
95143
|
-
} catch {
|
|
95144
|
-
return null;
|
|
95145
|
-
}
|
|
95147
|
+
function stageSizeFromRuntimeTimelineMessage(data) {
|
|
95148
|
+
if (typeof data !== "object" || data === null) return null;
|
|
95149
|
+
const message = data;
|
|
95150
|
+
if (message.source !== "hf-preview" || message.type !== "timeline") return null;
|
|
95151
|
+
return {
|
|
95152
|
+
width: positiveDimension(message.compositionWidth, DEFAULT_PREVIEW_STAGE.width),
|
|
95153
|
+
height: positiveDimension(message.compositionHeight, DEFAULT_PREVIEW_STAGE.height)
|
|
95154
|
+
};
|
|
95146
95155
|
}
|
|
95147
|
-
function
|
|
95148
|
-
|
|
95149
|
-
|
|
95150
|
-
|
|
95151
|
-
if (shouldPlay) {
|
|
95152
|
-
setPreviewMediaMuted(iframe, true);
|
|
95153
|
-
player.play?.();
|
|
95154
|
-
return true;
|
|
95155
|
-
}
|
|
95156
|
-
player.pause?.();
|
|
95157
|
-
player.seek?.(resolveThumbnailSeekTime(resolveIframeDuration(iframe)));
|
|
95158
|
-
return true;
|
|
95159
|
-
} catch {
|
|
95160
|
-
return false;
|
|
95161
|
-
}
|
|
95156
|
+
function muteThenPlayOverRuntimeBridge(iframe) {
|
|
95157
|
+
if (!iframe) return;
|
|
95158
|
+
setPreviewMediaMuted(iframe, true);
|
|
95159
|
+
postRuntimeControlMessage(iframe.contentWindow, "play");
|
|
95162
95160
|
}
|
|
95163
95161
|
var imageUrlOf = (snapshot3) => snapshot3.status === "ready" && snapshot3.value.kind === "image" ? snapshot3.value.url : null;
|
|
95164
95162
|
function useLastFrame(request2, snapshot3) {
|
|
@@ -95206,19 +95204,7 @@ function CompCard({
|
|
|
95206
95204
|
const [livePreviewLoaded, setLivePreviewLoaded] = useState149(false);
|
|
95207
95205
|
const iframeRef = useRef181(null);
|
|
95208
95206
|
const hoverTimer = useRef181(null);
|
|
95209
|
-
const syncTimer = useRef181(null);
|
|
95210
95207
|
const draggedRef = useRef181(false);
|
|
95211
|
-
const requestIframePlaybackSync = useCallback174((shouldPlay) => {
|
|
95212
|
-
if (syncTimer.current) {
|
|
95213
|
-
clearTimeout(syncTimer.current);
|
|
95214
|
-
syncTimer.current = null;
|
|
95215
|
-
}
|
|
95216
|
-
const sync = (remainingAttempts) => {
|
|
95217
|
-
if (syncIframePlayback(iframeRef.current, shouldPlay) || remainingAttempts <= 0) return;
|
|
95218
|
-
syncTimer.current = setTimeout(() => sync(remainingAttempts - 1), 100);
|
|
95219
|
-
};
|
|
95220
|
-
sync(THUMBNAIL_PLAYBACK_SYNC_ATTEMPTS);
|
|
95221
|
-
}, []);
|
|
95222
95208
|
const handleEnter = () => {
|
|
95223
95209
|
hoverTimer.current = setTimeout(() => setHovered(true), 300);
|
|
95224
95210
|
};
|
|
@@ -95227,10 +95213,6 @@ function CompCard({
|
|
|
95227
95213
|
clearTimeout(hoverTimer.current);
|
|
95228
95214
|
hoverTimer.current = null;
|
|
95229
95215
|
}
|
|
95230
|
-
if (syncTimer.current) {
|
|
95231
|
-
clearTimeout(syncTimer.current);
|
|
95232
|
-
syncTimer.current = null;
|
|
95233
|
-
}
|
|
95234
95216
|
setHovered(false);
|
|
95235
95217
|
setLivePreviewLoaded(false);
|
|
95236
95218
|
};
|
|
@@ -95257,27 +95239,32 @@ function CompCard({
|
|
|
95257
95239
|
});
|
|
95258
95240
|
const thumbnailOffsetX = (CARD_W - stageSize.width * previewScale) / 2;
|
|
95259
95241
|
const thumbnailOffsetY = (CARD_H - stageSize.height * previewScale) / 2;
|
|
95260
|
-
useEffect150(() => {
|
|
95261
|
-
if (hovered) requestIframePlaybackSync(true);
|
|
95262
|
-
}, [hovered, requestIframePlaybackSync]);
|
|
95263
95242
|
useEffect150(() => {
|
|
95264
95243
|
if (livePreviewLoaded) postFrameDisplayScale(iframeRef.current);
|
|
95265
95244
|
}, [livePreviewLoaded, previewScale]);
|
|
95266
95245
|
useEffect150(() => {
|
|
95267
95246
|
if (!hovered) return;
|
|
95268
|
-
const
|
|
95247
|
+
const onRuntimeMessage = (event) => {
|
|
95269
95248
|
const frame3 = iframeRef.current;
|
|
95270
|
-
if (frame3
|
|
95249
|
+
if (!frame3 || event.source !== frame3.contentWindow) return;
|
|
95250
|
+
const runtimeControlListenerInstalled = event.data?.source === "hf-preview" && event.data.type === "ready";
|
|
95251
|
+
if (runtimeControlListenerInstalled) {
|
|
95271
95252
|
postFrameDisplayScale(frame3);
|
|
95253
|
+
muteThenPlayOverRuntimeBridge(frame3);
|
|
95254
|
+
return;
|
|
95272
95255
|
}
|
|
95256
|
+
const stage = stageSizeFromRuntimeTimelineMessage(event.data);
|
|
95257
|
+
if (!stage) return;
|
|
95258
|
+
setStageSize(
|
|
95259
|
+
(current2) => current2.width === stage.width && current2.height === stage.height ? current2 : stage
|
|
95260
|
+
);
|
|
95273
95261
|
};
|
|
95274
|
-
window.addEventListener("message",
|
|
95275
|
-
return () => window.removeEventListener("message",
|
|
95262
|
+
window.addEventListener("message", onRuntimeMessage);
|
|
95263
|
+
return () => window.removeEventListener("message", onRuntimeMessage);
|
|
95276
95264
|
}, [hovered]);
|
|
95277
95265
|
useEffect150(() => {
|
|
95278
95266
|
return () => {
|
|
95279
95267
|
if (hoverTimer.current) clearTimeout(hoverTimer.current);
|
|
95280
|
-
if (syncTimer.current) clearTimeout(syncTimer.current);
|
|
95281
95268
|
};
|
|
95282
95269
|
}, []);
|
|
95283
95270
|
return /* @__PURE__ */ jsxs178(
|
|
@@ -95333,7 +95320,7 @@ function CompCard({
|
|
|
95333
95320
|
{
|
|
95334
95321
|
ref: iframeRef,
|
|
95335
95322
|
src: previewUrl,
|
|
95336
|
-
sandbox:
|
|
95323
|
+
sandbox: OPAQUE_ORIGIN_SCRIPTS_ONLY_SANDBOX,
|
|
95337
95324
|
className: "absolute border-none pointer-events-none",
|
|
95338
95325
|
style: {
|
|
95339
95326
|
transformOrigin: "0 0",
|
|
@@ -95343,19 +95330,7 @@ function CompCard({
|
|
|
95343
95330
|
top: thumbnailOffsetY,
|
|
95344
95331
|
transform: `scale(${previewScale})`
|
|
95345
95332
|
},
|
|
95346
|
-
onLoad: (
|
|
95347
|
-
try {
|
|
95348
|
-
const iframe = e.currentTarget;
|
|
95349
|
-
const root = iframe.contentDocument?.querySelector("[data-composition-id]");
|
|
95350
|
-
const width = Number(root?.getAttribute("data-width")) || DEFAULT_PREVIEW_STAGE.width;
|
|
95351
|
-
const height = Number(root?.getAttribute("data-height")) || DEFAULT_PREVIEW_STAGE.height;
|
|
95352
|
-
setStageSize({ width, height });
|
|
95353
|
-
setLivePreviewLoaded(true);
|
|
95354
|
-
requestIframePlaybackSync(true);
|
|
95355
|
-
} catch {
|
|
95356
|
-
setStageSize(DEFAULT_PREVIEW_STAGE);
|
|
95357
|
-
}
|
|
95358
|
-
},
|
|
95333
|
+
onLoad: () => setLivePreviewLoaded(true),
|
|
95359
95334
|
title: `${name} preview`,
|
|
95360
95335
|
tabIndex: -1
|
|
95361
95336
|
}
|
|
@@ -95640,7 +95615,7 @@ var StudioLeftPanels = memo51(function StudioLeftPanels2({
|
|
|
95640
95615
|
handleImportFiles,
|
|
95641
95616
|
handleContentChange
|
|
95642
95617
|
} = useFileManagerContext();
|
|
95643
|
-
const handleRenderComposition =
|
|
95618
|
+
const handleRenderComposition = useCallback174(
|
|
95644
95619
|
async (comp) => {
|
|
95645
95620
|
if (renderQueue.ffmpegMissing) {
|
|
95646
95621
|
useDockLayoutStore.getState().activatePanel("renders");
|
|
@@ -95750,10 +95725,10 @@ function CodeBody({
|
|
|
95750
95725
|
}
|
|
95751
95726
|
|
|
95752
95727
|
// src/components/StudioRightPanels.tsx
|
|
95753
|
-
import { memo as memo62, useCallback as
|
|
95728
|
+
import { memo as memo62, useCallback as useCallback192 } from "react";
|
|
95754
95729
|
|
|
95755
95730
|
// src/components/editor/LayersPanel.tsx
|
|
95756
|
-
import { memo as memo52, useState as useState151, useCallback as
|
|
95731
|
+
import { memo as memo52, useState as useState151, useCallback as useCallback176, useEffect as useEffect151, useRef as useRef183 } from "react";
|
|
95757
95732
|
|
|
95758
95733
|
// src/components/editor/layerKind.ts
|
|
95759
95734
|
function isCompositionHost(el) {
|
|
@@ -95771,7 +95746,7 @@ function layerKindOf(el, hasChildren) {
|
|
|
95771
95746
|
}
|
|
95772
95747
|
|
|
95773
95748
|
// src/components/editor/useLayerDrag.ts
|
|
95774
|
-
import { useRef as useRef182, useState as useState150, useCallback as
|
|
95749
|
+
import { useRef as useRef182, useState as useState150, useCallback as useCallback175 } from "react";
|
|
95775
95750
|
var DRAG_THRESHOLD_PX4 = 4;
|
|
95776
95751
|
function isLayerDraggable(layer) {
|
|
95777
95752
|
if (!(layer.selector || layer.id)) return false;
|
|
@@ -95841,7 +95816,7 @@ function useLayerDrag({
|
|
|
95841
95816
|
const dragRef = useRef182(null);
|
|
95842
95817
|
const [dragKey, setDragKey] = useState150(null);
|
|
95843
95818
|
const [insertionLineY, setInsertionLineY] = useState150(null);
|
|
95844
|
-
const handleRowPointerDown =
|
|
95819
|
+
const handleRowPointerDown = useCallback175(
|
|
95845
95820
|
(layerIndex, e) => {
|
|
95846
95821
|
if (e.button !== 0) return;
|
|
95847
95822
|
const layer = visibleLayers[layerIndex];
|
|
@@ -95868,7 +95843,7 @@ function useLayerDrag({
|
|
|
95868
95843
|
},
|
|
95869
95844
|
[visibleLayers, scrollContainerRef, onSingleSibling]
|
|
95870
95845
|
);
|
|
95871
|
-
const handleContainerPointerMove =
|
|
95846
|
+
const handleContainerPointerMove = useCallback175(
|
|
95872
95847
|
(e) => {
|
|
95873
95848
|
const drag = dragRef.current;
|
|
95874
95849
|
if (!drag) return;
|
|
@@ -95894,7 +95869,7 @@ function useLayerDrag({
|
|
|
95894
95869
|
},
|
|
95895
95870
|
[visibleLayers, scrollContainerRef]
|
|
95896
95871
|
);
|
|
95897
|
-
const handleContainerPointerUp =
|
|
95872
|
+
const handleContainerPointerUp = useCallback175(() => {
|
|
95898
95873
|
const drag = dragRef.current;
|
|
95899
95874
|
dragRef.current = null;
|
|
95900
95875
|
setDragKey(null);
|
|
@@ -96050,7 +96025,7 @@ var LayersPanel = memo52(function LayersPanel2({ host }) {
|
|
|
96050
96025
|
});
|
|
96051
96026
|
const isMasterView = !activeCompPath || activeCompPath === "index.html";
|
|
96052
96027
|
const livePreviewIframe = useLivePreviewIframe();
|
|
96053
|
-
const collectLayers =
|
|
96028
|
+
const collectLayers = useCallback176(() => {
|
|
96054
96029
|
const iframe = previewIframeRef.current;
|
|
96055
96030
|
if (!iframe) return;
|
|
96056
96031
|
let doc = null;
|
|
@@ -96098,7 +96073,7 @@ var LayersPanel = memo52(function LayersPanel2({ host }) {
|
|
|
96098
96073
|
throttle.cancel();
|
|
96099
96074
|
};
|
|
96100
96075
|
}, [collectLayers]);
|
|
96101
|
-
const resolveSelection =
|
|
96076
|
+
const resolveSelection = useCallback176(
|
|
96102
96077
|
(layer) => {
|
|
96103
96078
|
const doc = previewIframeRef.current?.contentDocument;
|
|
96104
96079
|
const el = liveLayerElement(layer, doc, activeCompPath);
|
|
@@ -96111,7 +96086,7 @@ var LayersPanel = memo52(function LayersPanel2({ host }) {
|
|
|
96111
96086
|
},
|
|
96112
96087
|
[activeCompPath, isMasterView, previewIframeRef, activeGroupElement]
|
|
96113
96088
|
);
|
|
96114
|
-
const seekToLayer =
|
|
96089
|
+
const seekToLayer = useCallback176(
|
|
96115
96090
|
async (layer) => {
|
|
96116
96091
|
const selection = await resolveSelection(layer);
|
|
96117
96092
|
if (!selection) return;
|
|
@@ -96140,7 +96115,7 @@ var LayersPanel = memo52(function LayersPanel2({ host }) {
|
|
|
96140
96115
|
},
|
|
96141
96116
|
[currentTime, resolveSelection, timelineElements]
|
|
96142
96117
|
);
|
|
96143
|
-
const handleSelectLayer =
|
|
96118
|
+
const handleSelectLayer = useCallback176(
|
|
96144
96119
|
async (layer) => {
|
|
96145
96120
|
const selection = await resolveSelection(layer);
|
|
96146
96121
|
if (!selection) return;
|
|
@@ -96150,7 +96125,7 @@ var LayersPanel = memo52(function LayersPanel2({ host }) {
|
|
|
96150
96125
|
},
|
|
96151
96126
|
[resolveSelection, applyDomSelection, seekToLayer, scheduleReveal]
|
|
96152
96127
|
);
|
|
96153
|
-
const handleLayerDoubleClick =
|
|
96128
|
+
const handleLayerDoubleClick = useCallback176(
|
|
96154
96129
|
async (layer) => {
|
|
96155
96130
|
const selection = await resolveSelection(layer);
|
|
96156
96131
|
if (selection?.element.hasAttribute("data-hf-group")) {
|
|
@@ -96161,7 +96136,7 @@ var LayersPanel = memo52(function LayersPanel2({ host }) {
|
|
|
96161
96136
|
},
|
|
96162
96137
|
[resolveSelection, setActiveGroupElement, handleSelectLayer]
|
|
96163
96138
|
);
|
|
96164
|
-
const handleLayerHover =
|
|
96139
|
+
const handleLayerHover = useCallback176(
|
|
96165
96140
|
async (layer) => {
|
|
96166
96141
|
if (!layer) {
|
|
96167
96142
|
updateDomEditHoverSelection(null);
|
|
@@ -96172,11 +96147,11 @@ var LayersPanel = memo52(function LayersPanel2({ host }) {
|
|
|
96172
96147
|
},
|
|
96173
96148
|
[resolveSelection, updateDomEditHoverSelection]
|
|
96174
96149
|
);
|
|
96175
|
-
const toggleCollapse =
|
|
96150
|
+
const toggleCollapse = useCallback176((key2, e) => {
|
|
96176
96151
|
e.stopPropagation();
|
|
96177
96152
|
setCollapsed((prev) => ({ ...prev, [key2]: !prev[key2] }));
|
|
96178
96153
|
}, []);
|
|
96179
|
-
const handleReorder =
|
|
96154
|
+
const handleReorder = useCallback176(
|
|
96180
96155
|
(event) => {
|
|
96181
96156
|
const { siblingLayers, fromIndex, toIndex } = event;
|
|
96182
96157
|
const reordered = [...siblingLayers];
|
|
@@ -96239,7 +96214,7 @@ var LayersPanel = memo52(function LayersPanel2({ host }) {
|
|
|
96239
96214
|
);
|
|
96240
96215
|
const selectedKey = domEditSelection ? getDomEditLayerKey(domEditSelection) : null;
|
|
96241
96216
|
const visibleLayers = getVisibleLayers(layers, collapsed);
|
|
96242
|
-
const handleSingleSibling =
|
|
96217
|
+
const handleSingleSibling = useCallback176(() => {
|
|
96243
96218
|
showToast("Only one layer at this level", "info");
|
|
96244
96219
|
}, [showToast]);
|
|
96245
96220
|
const {
|
|
@@ -96377,10 +96352,10 @@ var LayersPanel = memo52(function LayersPanel2({ host }) {
|
|
|
96377
96352
|
});
|
|
96378
96353
|
|
|
96379
96354
|
// src/captions/components/CaptionPropertyPanel.tsx
|
|
96380
|
-
import { memo as memo54, useCallback as
|
|
96355
|
+
import { memo as memo54, useCallback as useCallback178, useState as useState153 } from "react";
|
|
96381
96356
|
|
|
96382
96357
|
// src/captions/components/CaptionAnimationPanel.tsx
|
|
96383
|
-
import { memo as memo53, useCallback as
|
|
96358
|
+
import { memo as memo53, useCallback as useCallback177 } from "react";
|
|
96384
96359
|
|
|
96385
96360
|
// src/captions/components/shared.tsx
|
|
96386
96361
|
import { useEffect as useEffect152, useRef as useRef184, useState as useState152 } from "react";
|
|
@@ -96605,25 +96580,25 @@ var CaptionAnimationPanel = memo53(function CaptionAnimationPanel2() {
|
|
|
96605
96580
|
}
|
|
96606
96581
|
const group = resolvedGroupId ? model?.groups.get(resolvedGroupId) : void 0;
|
|
96607
96582
|
const animation2 = group?.animation;
|
|
96608
|
-
const handleEntranceChange =
|
|
96583
|
+
const handleEntranceChange = useCallback177(
|
|
96609
96584
|
(update) => {
|
|
96610
96585
|
if (resolvedGroupId) updateGroupAnimation(resolvedGroupId, "entrance", update);
|
|
96611
96586
|
},
|
|
96612
96587
|
[resolvedGroupId, updateGroupAnimation]
|
|
96613
96588
|
);
|
|
96614
|
-
const handleHighlightChange =
|
|
96589
|
+
const handleHighlightChange = useCallback177(
|
|
96615
96590
|
(update) => {
|
|
96616
96591
|
if (resolvedGroupId) updateGroupAnimation(resolvedGroupId, "highlight", update);
|
|
96617
96592
|
},
|
|
96618
96593
|
[resolvedGroupId, updateGroupAnimation]
|
|
96619
96594
|
);
|
|
96620
|
-
const handleExitChange =
|
|
96595
|
+
const handleExitChange = useCallback177(
|
|
96621
96596
|
(update) => {
|
|
96622
96597
|
if (resolvedGroupId) updateGroupAnimation(resolvedGroupId, "exit", update);
|
|
96623
96598
|
},
|
|
96624
96599
|
[resolvedGroupId, updateGroupAnimation]
|
|
96625
96600
|
);
|
|
96626
|
-
const handleApplyToAll =
|
|
96601
|
+
const handleApplyToAll = useCallback177(() => {
|
|
96627
96602
|
if (animation2) applyAnimationToAll(animation2);
|
|
96628
96603
|
}, [animation2, applyAnimationToAll]);
|
|
96629
96604
|
if (!group || !resolvedGroupId || !animation2) {
|
|
@@ -96723,7 +96698,7 @@ var CaptionPropertyPanel = memo54(function CaptionPropertyPanel2({
|
|
|
96723
96698
|
...groupStyle,
|
|
96724
96699
|
...segmentOverrides
|
|
96725
96700
|
};
|
|
96726
|
-
const applyToIframeDom =
|
|
96701
|
+
const applyToIframeDom = useCallback178(
|
|
96727
96702
|
(updates) => {
|
|
96728
96703
|
const iframe = iframeRef.current;
|
|
96729
96704
|
if (!iframe || !model) return;
|
|
@@ -96797,7 +96772,7 @@ var CaptionPropertyPanel = memo54(function CaptionPropertyPanel2({
|
|
|
96797
96772
|
},
|
|
96798
96773
|
[iframeRef, model, selectedSegmentIds]
|
|
96799
96774
|
);
|
|
96800
|
-
const handleStyleChange =
|
|
96775
|
+
const handleStyleChange = useCallback178(
|
|
96801
96776
|
(updates) => {
|
|
96802
96777
|
if (selectedGroupId) {
|
|
96803
96778
|
updateGroupStyle(selectedGroupId, updates);
|
|
@@ -96902,7 +96877,7 @@ var CaptionPropertyPanel = memo54(function CaptionPropertyPanel2({
|
|
|
96902
96877
|
});
|
|
96903
96878
|
|
|
96904
96879
|
// src/components/editor/BlockParamsPanel.tsx
|
|
96905
|
-
import { memo as memo55, useCallback as
|
|
96880
|
+
import { memo as memo55, useCallback as useCallback179, useEffect as useEffect153, useRef as useRef185, useState as useState154 } from "react";
|
|
96906
96881
|
import { jsx as jsx236, jsxs as jsxs185 } from "react/jsx-runtime";
|
|
96907
96882
|
var BlockParamsPanel = memo55(function BlockParamsPanel2({
|
|
96908
96883
|
blockName,
|
|
@@ -96925,7 +96900,7 @@ var BlockParamsPanel = memo55(function BlockParamsPanel2({
|
|
|
96925
96900
|
);
|
|
96926
96901
|
const [commitState, setCommitState] = useState154({ tone: "idle" });
|
|
96927
96902
|
const commitTimersRef = useRef185(/* @__PURE__ */ new Map());
|
|
96928
|
-
const commitParamNow =
|
|
96903
|
+
const commitParamNow = useCallback179(
|
|
96929
96904
|
async (key2, nextValue) => {
|
|
96930
96905
|
if (!fileManager) return;
|
|
96931
96906
|
const previous = appliedRef.current[key2];
|
|
@@ -96970,7 +96945,7 @@ var BlockParamsPanel = memo55(function BlockParamsPanel2({
|
|
|
96970
96945
|
},
|
|
96971
96946
|
[fileManager, compositionPath, setRefreshKey, blockName]
|
|
96972
96947
|
);
|
|
96973
|
-
const commitParam =
|
|
96948
|
+
const commitParam = useCallback179(
|
|
96974
96949
|
(key2, nextValue) => fileManager ? serializeStudioFileMutation(
|
|
96975
96950
|
fileManager.writeProjectFile,
|
|
96976
96951
|
compositionPath,
|
|
@@ -96978,7 +96953,7 @@ var BlockParamsPanel = memo55(function BlockParamsPanel2({
|
|
|
96978
96953
|
) : Promise.resolve(),
|
|
96979
96954
|
[commitParamNow, compositionPath, fileManager]
|
|
96980
96955
|
);
|
|
96981
|
-
const handleChange =
|
|
96956
|
+
const handleChange = useCallback179(
|
|
96982
96957
|
(key2, value) => {
|
|
96983
96958
|
setValues((prev) => ({ ...prev, [key2]: value }));
|
|
96984
96959
|
const timers = commitTimersRef.current;
|
|
@@ -97158,7 +97133,7 @@ function RenderDurationNote({
|
|
|
97158
97133
|
}
|
|
97159
97134
|
|
|
97160
97135
|
// src/components/renders/RenderQueueItem.tsx
|
|
97161
|
-
import { memo as memo56, useCallback as
|
|
97136
|
+
import { memo as memo56, useCallback as useCallback180, useState as useState155 } from "react";
|
|
97162
97137
|
|
|
97163
97138
|
// src/components/renders/RenderQueueInfo.tsx
|
|
97164
97139
|
import { jsx as jsx237, jsxs as jsxs187 } from "react/jsx-runtime";
|
|
@@ -97262,10 +97237,10 @@ var RenderQueueItem = memo56(function RenderQueueItem2({
|
|
|
97262
97237
|
const [videoReady, setVideoReady] = useState155(false);
|
|
97263
97238
|
const [confirmingDelete, setConfirmingDelete] = useState155(false);
|
|
97264
97239
|
const fileSrc = buildProjectApiPath(projectId, `/renders/file/${job.filename}`);
|
|
97265
|
-
const handleOpen =
|
|
97240
|
+
const handleOpen = useCallback180(() => {
|
|
97266
97241
|
window.open(fileSrc, "_blank");
|
|
97267
97242
|
}, [fileSrc]);
|
|
97268
|
-
const handleDownload =
|
|
97243
|
+
const handleDownload = useCallback180(
|
|
97269
97244
|
(e) => {
|
|
97270
97245
|
e.stopPropagation();
|
|
97271
97246
|
const a = document.createElement("a");
|
|
@@ -98046,11 +98021,11 @@ var RenderQueuePanel = memo59(function RenderQueuePanel2() {
|
|
|
98046
98021
|
});
|
|
98047
98022
|
|
|
98048
98023
|
// src/components/panels/SlideshowPanel.tsx
|
|
98049
|
-
import { useState as useState159, useEffect as useEffect156, useCallback as
|
|
98024
|
+
import { useState as useState159, useEffect as useEffect156, useCallback as useCallback182, useRef as useRef188 } from "react";
|
|
98050
98025
|
import { parseSlideshowManifest } from "@hyperframes/core/slideshow";
|
|
98051
98026
|
|
|
98052
98027
|
// src/components/panels/SlideshowSubPanels.tsx
|
|
98053
|
-
import { useState as useState158, useCallback as
|
|
98028
|
+
import { useState as useState158, useCallback as useCallback181, useId as useId5 } from "react";
|
|
98054
98029
|
import { jsx as jsx245, jsxs as jsxs194 } from "react/jsx-runtime";
|
|
98055
98030
|
function SectionHeader({
|
|
98056
98031
|
children,
|
|
@@ -98238,7 +98213,7 @@ function BranchTree({
|
|
|
98238
98213
|
}) {
|
|
98239
98214
|
const [newLabel, setNewLabel] = useState158("");
|
|
98240
98215
|
const inputId = useId5();
|
|
98241
|
-
const handleCreate =
|
|
98216
|
+
const handleCreate = useCallback181(() => {
|
|
98242
98217
|
const label = newLabel.trim();
|
|
98243
98218
|
if (!label) return;
|
|
98244
98219
|
onCreateSequence(label);
|
|
@@ -98300,7 +98275,7 @@ function BranchItem({
|
|
|
98300
98275
|
const [editing, setEditing] = useState158(false);
|
|
98301
98276
|
const [draft, setDraft] = useState158(seq.label);
|
|
98302
98277
|
const [confirmingDelete, setConfirmingDelete] = useState158(false);
|
|
98303
|
-
const commitRename =
|
|
98278
|
+
const commitRename = useCallback181(() => {
|
|
98304
98279
|
const label = draft.trim();
|
|
98305
98280
|
if (label && label !== seq.label) onRename(seq.id, label);
|
|
98306
98281
|
setEditing(false);
|
|
@@ -98433,7 +98408,7 @@ function HotspotTool({
|
|
|
98433
98408
|
const selectedElementId = domEditSelection?.element?.id ?? null;
|
|
98434
98409
|
const selectedHfId = domEditSelection?.hfId ?? null;
|
|
98435
98410
|
const elementKey3 = selectedElementId || selectedHfId;
|
|
98436
|
-
const handleMakeHotspot =
|
|
98411
|
+
const handleMakeHotspot = useCallback181(() => {
|
|
98437
98412
|
if (!selectedSceneId || !targetSequenceId || !elementKey3) return;
|
|
98438
98413
|
const id = `hotspot-${elementKey3}-${generateId()}`;
|
|
98439
98414
|
const label = hotspotLabel.trim() || elementKey3;
|
|
@@ -98758,7 +98733,7 @@ function SlideshowPanel({ scenes, onPersist, onPersistNotes }) {
|
|
|
98758
98733
|
setUndoDepth(0);
|
|
98759
98734
|
setPersistError(false);
|
|
98760
98735
|
}, [compHtml]);
|
|
98761
|
-
const applyManifest =
|
|
98736
|
+
const applyManifest = useCallback182(
|
|
98762
98737
|
async (next, opts) => {
|
|
98763
98738
|
const merged = notesCtrlRef.current.mergeIntoDiscrete(next);
|
|
98764
98739
|
if (!opts?.skipUndo) {
|
|
@@ -98778,14 +98753,14 @@ function SlideshowPanel({ scenes, onPersist, onPersistNotes }) {
|
|
|
98778
98753
|
},
|
|
98779
98754
|
[onPersist]
|
|
98780
98755
|
);
|
|
98781
|
-
const handleUndo =
|
|
98756
|
+
const handleUndo = useCallback182(() => {
|
|
98782
98757
|
const prev = undoStackRef.current.pop();
|
|
98783
98758
|
if (!prev) return;
|
|
98784
98759
|
setUndoDepth(undoStackRef.current.length);
|
|
98785
98760
|
applyManifest(prev, { skipUndo: true }).catch(() => {
|
|
98786
98761
|
});
|
|
98787
98762
|
}, [applyManifest]);
|
|
98788
|
-
const handleRetryPersist =
|
|
98763
|
+
const handleRetryPersist = useCallback182(async () => {
|
|
98789
98764
|
setRetrying(true);
|
|
98790
98765
|
try {
|
|
98791
98766
|
await onPersist(manifestRef.current);
|
|
@@ -98796,7 +98771,7 @@ function SlideshowPanel({ scenes, onPersist, onPersistNotes }) {
|
|
|
98796
98771
|
setRetrying(false);
|
|
98797
98772
|
}
|
|
98798
98773
|
}, [onPersist]);
|
|
98799
|
-
const applyNotesManifest =
|
|
98774
|
+
const applyNotesManifest = useCallback182(
|
|
98800
98775
|
(next) => {
|
|
98801
98776
|
setManifest(next);
|
|
98802
98777
|
manifestRef.current = next;
|
|
@@ -98810,7 +98785,7 @@ function SlideshowPanel({ scenes, onPersist, onPersistNotes }) {
|
|
|
98810
98785
|
ctrl.flush();
|
|
98811
98786
|
};
|
|
98812
98787
|
}, []);
|
|
98813
|
-
const toggleSection =
|
|
98788
|
+
const toggleSection = useCallback182((key2) => {
|
|
98814
98789
|
setExpandedSections((prev) => {
|
|
98815
98790
|
const next = new Set(prev);
|
|
98816
98791
|
if (next.has(key2)) {
|
|
@@ -98824,25 +98799,25 @@ function SlideshowPanel({ scenes, onPersist, onPersistNotes }) {
|
|
|
98824
98799
|
const activeSlides = selectedSequenceId ? (manifest.slideSequences ?? []).find((s) => s.id === selectedSequenceId)?.slides ?? [] : manifest.slides;
|
|
98825
98800
|
const selectedSlide = activeSlides.find((s) => s.sceneId === selectedSceneId);
|
|
98826
98801
|
const sequences = manifest.slideSequences ?? [];
|
|
98827
|
-
const handleSelectBranchSlide =
|
|
98802
|
+
const handleSelectBranchSlide = useCallback182((sequenceId, sceneId) => {
|
|
98828
98803
|
setSelectedSceneId(sceneId);
|
|
98829
98804
|
setSelectedSequenceId(sequenceId);
|
|
98830
98805
|
}, []);
|
|
98831
|
-
const handleToggleSlide =
|
|
98806
|
+
const handleToggleSlide = useCallback182(
|
|
98832
98807
|
(sceneId) => {
|
|
98833
98808
|
applyManifest(toggleMainLineSlide(manifestRef.current, sceneId)).catch(() => {
|
|
98834
98809
|
});
|
|
98835
98810
|
},
|
|
98836
98811
|
[applyManifest]
|
|
98837
98812
|
);
|
|
98838
|
-
const handleReorder =
|
|
98813
|
+
const handleReorder = useCallback182(
|
|
98839
98814
|
(sceneId, dir) => {
|
|
98840
98815
|
applyManifest(reorderMainLineSlide(manifestRef.current, sceneId, dir)).catch(() => {
|
|
98841
98816
|
});
|
|
98842
98817
|
},
|
|
98843
98818
|
[applyManifest]
|
|
98844
98819
|
);
|
|
98845
|
-
const handleSetNotes =
|
|
98820
|
+
const handleSetNotes = useCallback182(
|
|
98846
98821
|
(notes) => {
|
|
98847
98822
|
if (!selectedSceneId) return;
|
|
98848
98823
|
applyNotesManifest(
|
|
@@ -98851,7 +98826,7 @@ function SlideshowPanel({ scenes, onPersist, onPersistNotes }) {
|
|
|
98851
98826
|
},
|
|
98852
98827
|
[selectedSceneId, selectedSequenceId, applyNotesManifest]
|
|
98853
98828
|
);
|
|
98854
|
-
const handleMarkFragment =
|
|
98829
|
+
const handleMarkFragment = useCallback182(() => {
|
|
98855
98830
|
if (!selectedSceneId) return;
|
|
98856
98831
|
applyManifest(
|
|
98857
98832
|
addFragment(
|
|
@@ -98863,7 +98838,7 @@ function SlideshowPanel({ scenes, onPersist, onPersistNotes }) {
|
|
|
98863
98838
|
).catch(() => {
|
|
98864
98839
|
});
|
|
98865
98840
|
}, [selectedSceneId, selectedSequenceId, currentTime, applyManifest]);
|
|
98866
|
-
const handleRemoveFragment =
|
|
98841
|
+
const handleRemoveFragment = useCallback182(
|
|
98867
98842
|
(time) => {
|
|
98868
98843
|
if (!selectedSceneId) return;
|
|
98869
98844
|
applyManifest(
|
|
@@ -98873,7 +98848,7 @@ function SlideshowPanel({ scenes, onPersist, onPersistNotes }) {
|
|
|
98873
98848
|
},
|
|
98874
98849
|
[selectedSceneId, selectedSequenceId, applyManifest]
|
|
98875
98850
|
);
|
|
98876
|
-
const handleCreateSequence =
|
|
98851
|
+
const handleCreateSequence = useCallback182(
|
|
98877
98852
|
(label) => {
|
|
98878
98853
|
const id = `seq-${generateId()}`;
|
|
98879
98854
|
applyManifest(createSequence(manifestRef.current, id, label)).catch(() => {
|
|
@@ -98881,21 +98856,21 @@ function SlideshowPanel({ scenes, onPersist, onPersistNotes }) {
|
|
|
98881
98856
|
},
|
|
98882
98857
|
[applyManifest]
|
|
98883
98858
|
);
|
|
98884
|
-
const handleRenameSequence =
|
|
98859
|
+
const handleRenameSequence = useCallback182(
|
|
98885
98860
|
(id, label) => {
|
|
98886
98861
|
applyManifest(renameSequence(manifestRef.current, id, label)).catch(() => {
|
|
98887
98862
|
});
|
|
98888
98863
|
},
|
|
98889
98864
|
[applyManifest]
|
|
98890
98865
|
);
|
|
98891
|
-
const handleDeleteSequence =
|
|
98866
|
+
const handleDeleteSequence = useCallback182(
|
|
98892
98867
|
(id) => {
|
|
98893
98868
|
applyManifest(deleteSequence(manifestRef.current, id)).catch(() => {
|
|
98894
98869
|
});
|
|
98895
98870
|
},
|
|
98896
98871
|
[applyManifest]
|
|
98897
98872
|
);
|
|
98898
|
-
const handleAssign =
|
|
98873
|
+
const handleAssign = useCallback182(
|
|
98899
98874
|
(sequenceId, sceneId, assign) => {
|
|
98900
98875
|
applyManifest(assignToBranch(manifestRef.current, sequenceId, sceneId, assign)).catch(
|
|
98901
98876
|
() => {
|
|
@@ -98904,7 +98879,7 @@ function SlideshowPanel({ scenes, onPersist, onPersistNotes }) {
|
|
|
98904
98879
|
},
|
|
98905
98880
|
[applyManifest]
|
|
98906
98881
|
);
|
|
98907
|
-
const handleAddHotspot =
|
|
98882
|
+
const handleAddHotspot = useCallback182(
|
|
98908
98883
|
(sceneId, hotspot) => {
|
|
98909
98884
|
applyManifest(
|
|
98910
98885
|
addHotspot(manifestRef.current, sceneId, hotspot, selectedSequenceId ?? void 0)
|
|
@@ -98913,7 +98888,7 @@ function SlideshowPanel({ scenes, onPersist, onPersistNotes }) {
|
|
|
98913
98888
|
},
|
|
98914
98889
|
[selectedSequenceId, applyManifest]
|
|
98915
98890
|
);
|
|
98916
|
-
const handleRemoveHotspot =
|
|
98891
|
+
const handleRemoveHotspot = useCallback182(
|
|
98917
98892
|
(sceneId, hotspotId) => {
|
|
98918
98893
|
applyManifest(
|
|
98919
98894
|
removeHotspot(manifestRef.current, sceneId, hotspotId, selectedSequenceId ?? void 0)
|
|
@@ -99063,10 +99038,10 @@ function SlideshowPanel({ scenes, onPersist, onPersistNotes }) {
|
|
|
99063
99038
|
}
|
|
99064
99039
|
|
|
99065
99040
|
// src/components/panels/VariablesPanel.tsx
|
|
99066
|
-
import { memo as memo60, useCallback as
|
|
99041
|
+
import { memo as memo60, useCallback as useCallback186, useEffect as useEffect158, useMemo as useMemo87, useState as useState163 } from "react";
|
|
99067
99042
|
|
|
99068
99043
|
// src/hooks/useVariablesPersist.ts
|
|
99069
|
-
import { useCallback as
|
|
99044
|
+
import { useCallback as useCallback183 } from "react";
|
|
99070
99045
|
function useVariablesPersist({
|
|
99071
99046
|
sdkSession,
|
|
99072
99047
|
activeCompPath,
|
|
@@ -99076,7 +99051,7 @@ function useVariablesPersist({
|
|
|
99076
99051
|
reloadPreview,
|
|
99077
99052
|
publishSdkSession
|
|
99078
99053
|
}) {
|
|
99079
|
-
return
|
|
99054
|
+
return useCallback183(
|
|
99080
99055
|
async (label, mutate) => {
|
|
99081
99056
|
if (!sdkSession) return false;
|
|
99082
99057
|
const path = activeCompPath ?? "index.html";
|
|
@@ -99111,10 +99086,10 @@ function useVariablesPersist({
|
|
|
99111
99086
|
}
|
|
99112
99087
|
|
|
99113
99088
|
// src/components/panels/VariablesOtherCompositions.tsx
|
|
99114
|
-
import { useCallback as
|
|
99089
|
+
import { useCallback as useCallback185, useState as useState162 } from "react";
|
|
99115
99090
|
|
|
99116
99091
|
// src/hooks/useProjectCompositionVariables.ts
|
|
99117
|
-
import { useCallback as
|
|
99092
|
+
import { useCallback as useCallback184, useEffect as useEffect157, useState as useState160 } from "react";
|
|
99118
99093
|
import { openComposition as openComposition4 } from "@hyperframes/sdk";
|
|
99119
99094
|
async function readGroup(path, readProjectFile) {
|
|
99120
99095
|
let content;
|
|
@@ -99157,7 +99132,7 @@ function useProjectCompositionVariables(compositionPaths, excludePath, readProje
|
|
|
99157
99132
|
}
|
|
99158
99133
|
function useEditVariablesInFile(deps) {
|
|
99159
99134
|
const { readProjectFile, writeProjectFile, recordEdit, reloadPreview } = deps;
|
|
99160
|
-
return
|
|
99135
|
+
return useCallback184(
|
|
99161
99136
|
async (path, label, mutate) => {
|
|
99162
99137
|
const originalContent = await readProjectFile(path);
|
|
99163
99138
|
await persistSdkSerialize(
|
|
@@ -99551,7 +99526,7 @@ function VariablesOtherCompositions({
|
|
|
99551
99526
|
reloadPreview
|
|
99552
99527
|
});
|
|
99553
99528
|
const [editingKey, setEditingKey] = useState162(null);
|
|
99554
|
-
const onSave =
|
|
99529
|
+
const onSave = useCallback185(
|
|
99555
99530
|
(path, decl) => {
|
|
99556
99531
|
setEditingKey(null);
|
|
99557
99532
|
void editInFile(
|
|
@@ -99562,7 +99537,7 @@ function VariablesOtherCompositions({
|
|
|
99562
99537
|
},
|
|
99563
99538
|
[editInFile]
|
|
99564
99539
|
);
|
|
99565
|
-
const onRemove =
|
|
99540
|
+
const onRemove = useCallback185(
|
|
99566
99541
|
(path, id) => {
|
|
99567
99542
|
void editInFile(
|
|
99568
99543
|
path,
|
|
@@ -99796,7 +99771,7 @@ var VariablesPanel = memo60(function VariablesPanel2({
|
|
|
99796
99771
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
99797
99772
|
[sdkSession, previewValues, refreshKey, revision]
|
|
99798
99773
|
);
|
|
99799
|
-
const copyToClipboard =
|
|
99774
|
+
const copyToClipboard = useCallback186(
|
|
99800
99775
|
(text2, what) => {
|
|
99801
99776
|
void copyTextToClipboard(text2).then(
|
|
99802
99777
|
(ok) => showToast(
|
|
@@ -99807,7 +99782,7 @@ var VariablesPanel = memo60(function VariablesPanel2({
|
|
|
99807
99782
|
},
|
|
99808
99783
|
[showToast]
|
|
99809
99784
|
);
|
|
99810
|
-
const dropPreviewOverride =
|
|
99785
|
+
const dropPreviewOverride = useCallback186(
|
|
99811
99786
|
(id) => {
|
|
99812
99787
|
if (previewValues && id in previewValues) {
|
|
99813
99788
|
const next = { ...previewValues };
|
|
@@ -99817,7 +99792,7 @@ var VariablesPanel = memo60(function VariablesPanel2({
|
|
|
99817
99792
|
},
|
|
99818
99793
|
[previewValues, setPreviewValues]
|
|
99819
99794
|
);
|
|
99820
|
-
const commitPreviewValue =
|
|
99795
|
+
const commitPreviewValue = useCallback186(
|
|
99821
99796
|
(id, value, declDefault) => {
|
|
99822
99797
|
const next = { ...previewValues ?? {} };
|
|
99823
99798
|
if (JSON.stringify(value) === JSON.stringify(declDefault)) {
|
|
@@ -99830,7 +99805,7 @@ var VariablesPanel = memo60(function VariablesPanel2({
|
|
|
99830
99805
|
},
|
|
99831
99806
|
[previewValues, setPreviewValues, reloadPreview]
|
|
99832
99807
|
);
|
|
99833
|
-
const runSchemaEdit =
|
|
99808
|
+
const runSchemaEdit = useCallback186(
|
|
99834
99809
|
async (label, mutate) => {
|
|
99835
99810
|
try {
|
|
99836
99811
|
const changed = await persistVariables(label, mutate);
|
|
@@ -99844,7 +99819,7 @@ var VariablesPanel = memo60(function VariablesPanel2({
|
|
|
99844
99819
|
},
|
|
99845
99820
|
[persistVariables, showToast]
|
|
99846
99821
|
);
|
|
99847
|
-
const handleAdd =
|
|
99822
|
+
const handleAdd = useCallback186(
|
|
99848
99823
|
(decl) => {
|
|
99849
99824
|
if (!sdkSession) return;
|
|
99850
99825
|
const check = sdkSession.can({ type: "declareVariable", declaration: decl });
|
|
@@ -99857,7 +99832,7 @@ var VariablesPanel = memo60(function VariablesPanel2({
|
|
|
99857
99832
|
},
|
|
99858
99833
|
[sdkSession, runSchemaEdit, showToast]
|
|
99859
99834
|
);
|
|
99860
|
-
const handleUpdate =
|
|
99835
|
+
const handleUpdate = useCallback186(
|
|
99861
99836
|
(decl) => {
|
|
99862
99837
|
if (!sdkSession) return;
|
|
99863
99838
|
const check = sdkSession.can({
|
|
@@ -99877,7 +99852,7 @@ var VariablesPanel = memo60(function VariablesPanel2({
|
|
|
99877
99852
|
},
|
|
99878
99853
|
[sdkSession, runSchemaEdit, showToast]
|
|
99879
99854
|
);
|
|
99880
|
-
const handleRemove =
|
|
99855
|
+
const handleRemove = useCallback186(
|
|
99881
99856
|
(id) => {
|
|
99882
99857
|
if (!sdkSession) return;
|
|
99883
99858
|
const check = sdkSession.can({ type: "removeVariableDeclaration", id });
|
|
@@ -99893,18 +99868,18 @@ var VariablesPanel = memo60(function VariablesPanel2({
|
|
|
99893
99868
|
},
|
|
99894
99869
|
[sdkSession, runSchemaEdit, dropPreviewOverride, showToast]
|
|
99895
99870
|
);
|
|
99896
|
-
const handleSetDefault =
|
|
99871
|
+
const handleSetDefault = useCallback186(
|
|
99897
99872
|
(id, value) => {
|
|
99898
99873
|
void runSchemaEdit(`Set default for "${id}"`, (s) => s.setVariableValue(id, value));
|
|
99899
99874
|
dropPreviewOverride(id);
|
|
99900
99875
|
},
|
|
99901
99876
|
[runSchemaEdit, dropPreviewOverride]
|
|
99902
99877
|
);
|
|
99903
|
-
const resetPreview =
|
|
99878
|
+
const resetPreview = useCallback186(() => {
|
|
99904
99879
|
setPreviewValues(null);
|
|
99905
99880
|
reloadPreview();
|
|
99906
99881
|
}, [setPreviewValues, reloadPreview]);
|
|
99907
|
-
const handleBind =
|
|
99882
|
+
const handleBind = useCallback186(
|
|
99908
99883
|
// Guard chain (session, selection, type-compat) — one branch per guard.
|
|
99909
99884
|
// fallow-ignore-next-line complexity
|
|
99910
99885
|
(action, id) => {
|
|
@@ -100016,7 +99991,7 @@ var VariablesPanel = memo60(function VariablesPanel2({
|
|
|
100016
99991
|
});
|
|
100017
99992
|
|
|
100018
99993
|
// src/components/panels/MotionBlurPanel.tsx
|
|
100019
|
-
import { memo as memo61, useCallback as
|
|
99994
|
+
import { memo as memo61, useCallback as useCallback187, useEffect as useEffect159, useMemo as useMemo88, useReducer as useReducer2, useRef as useRef189, useState as useState164 } from "react";
|
|
100020
99995
|
|
|
100021
99996
|
// src/components/panels/motionBlurPanelModel.ts
|
|
100022
99997
|
import {
|
|
@@ -100097,7 +100072,7 @@ function useLivePreviewAttributes(previewIframeRef, refreshKey) {
|
|
|
100097
100072
|
const timer = setInterval(read2, POLL_MS2);
|
|
100098
100073
|
return () => clearInterval(timer);
|
|
100099
100074
|
}, [previewIframeRef, refreshKey]);
|
|
100100
|
-
const hold =
|
|
100075
|
+
const hold = useCallback187((next) => {
|
|
100101
100076
|
holdUntil.current = Date.now() + SETTLE_MS;
|
|
100102
100077
|
setLive(next);
|
|
100103
100078
|
}, []);
|
|
@@ -100128,7 +100103,7 @@ var MotionBlurPanel = memo61(function MotionBlurPanel2({
|
|
|
100128
100103
|
reloadPreview,
|
|
100129
100104
|
publishSdkSession
|
|
100130
100105
|
});
|
|
100131
|
-
const apply =
|
|
100106
|
+
const apply = useCallback187(
|
|
100132
100107
|
async (patch) => {
|
|
100133
100108
|
if (!attributes) return;
|
|
100134
100109
|
let applied = [];
|
|
@@ -100183,7 +100158,7 @@ var MotionBlurPanel = memo61(function MotionBlurPanel2({
|
|
|
100183
100158
|
});
|
|
100184
100159
|
|
|
100185
100160
|
// src/hooks/useSlideshowPersist.ts
|
|
100186
|
-
import { useCallback as
|
|
100161
|
+
import { useCallback as useCallback188 } from "react";
|
|
100187
100162
|
|
|
100188
100163
|
// src/utils/setSlideshowManifest.ts
|
|
100189
100164
|
import {
|
|
@@ -100240,7 +100215,7 @@ function useSlideshowPersist({
|
|
|
100240
100215
|
publishSdkSession,
|
|
100241
100216
|
coalesceKey
|
|
100242
100217
|
}) {
|
|
100243
|
-
return
|
|
100218
|
+
return useCallback188(
|
|
100244
100219
|
async (manifest) => {
|
|
100245
100220
|
if (!sdkSession) return;
|
|
100246
100221
|
const path = activeCompPath ?? "index.html";
|
|
@@ -100298,7 +100273,7 @@ function useSlideshowTabState(params) {
|
|
|
100298
100273
|
}
|
|
100299
100274
|
|
|
100300
100275
|
// src/components/DesignPanelPromoteProvider.tsx
|
|
100301
|
-
import { useCallback as
|
|
100276
|
+
import { useCallback as useCallback189 } from "react";
|
|
100302
100277
|
import { jsx as jsx252 } from "react/jsx-runtime";
|
|
100303
100278
|
function DesignPanelPromoteProvider({
|
|
100304
100279
|
selection,
|
|
@@ -100317,7 +100292,7 @@ function DesignPanelPromoteProvider({
|
|
|
100317
100292
|
publishSdkSession: handle.publish,
|
|
100318
100293
|
activeCompPath: targetPath
|
|
100319
100294
|
});
|
|
100320
|
-
const persist2 =
|
|
100295
|
+
const persist2 = useCallback189(
|
|
100321
100296
|
async (label, mutate) => {
|
|
100322
100297
|
const committed = await rawPersist(label, mutate);
|
|
100323
100298
|
if (committed) forceReloadSharedSdkSession?.();
|
|
@@ -100325,7 +100300,7 @@ function DesignPanelPromoteProvider({
|
|
|
100325
100300
|
},
|
|
100326
100301
|
[rawPersist, forceReloadSharedSdkSession]
|
|
100327
100302
|
);
|
|
100328
|
-
const handlePersistError =
|
|
100303
|
+
const handlePersistError = useCallback189(
|
|
100329
100304
|
(error) => showToast(getStudioSaveErrorMessage(error), "error"),
|
|
100330
100305
|
[showToast]
|
|
100331
100306
|
);
|
|
@@ -100342,7 +100317,7 @@ function DesignPanelPromoteProvider({
|
|
|
100342
100317
|
}
|
|
100343
100318
|
|
|
100344
100319
|
// src/hooks/useRemoveBackground.ts
|
|
100345
|
-
import { useCallback as
|
|
100320
|
+
import { useCallback as useCallback190, useEffect as useEffect160, useRef as useRef190 } from "react";
|
|
100346
100321
|
|
|
100347
100322
|
// src/components/studioMediaJobs.ts
|
|
100348
100323
|
var MEDIA_JOB_RECONNECT_TIMEOUT_MS = 15e3;
|
|
@@ -100455,7 +100430,7 @@ function useRemoveBackground(projectId, refreshFileTree, showToast) {
|
|
|
100455
100430
|
},
|
|
100456
100431
|
[]
|
|
100457
100432
|
);
|
|
100458
|
-
return
|
|
100433
|
+
return useCallback190(
|
|
100459
100434
|
// fallow-ignore-next-line complexity
|
|
100460
100435
|
async (inputPath, options) => {
|
|
100461
100436
|
const response = await studioApiFetch(
|
|
@@ -100494,7 +100469,7 @@ function useRemoveBackground(projectId, refreshFileTree, showToast) {
|
|
|
100494
100469
|
}
|
|
100495
100470
|
|
|
100496
100471
|
// src/hooks/useApplyColorGradingScope.ts
|
|
100497
|
-
import { useCallback as
|
|
100472
|
+
import { useCallback as useCallback191 } from "react";
|
|
100498
100473
|
|
|
100499
100474
|
// src/components/editor/colorGradingScopePatch.ts
|
|
100500
100475
|
var MEDIA_TAG_RE = /<\s*(video|img)\b(?:[^>"']|"[^"]*"|'[^']*')*>/gi;
|
|
@@ -100598,7 +100573,7 @@ function useApplyColorGradingScope(recordEdit, reloadPreview) {
|
|
|
100598
100573
|
const { projectId, activeCompPath, showToast, waitForPendingDomEditSaves } = useStudioShellContext();
|
|
100599
100574
|
const { domEditSelection } = useDomEditContext();
|
|
100600
100575
|
const { readProjectFile, writeProjectFile, compositions } = useFileManagerContext();
|
|
100601
|
-
return
|
|
100576
|
+
return useCallback191(
|
|
100602
100577
|
async (scope, value) => applyColorGradingScopeUpdate({
|
|
100603
100578
|
scope,
|
|
100604
100579
|
value,
|
|
@@ -100746,11 +100721,11 @@ var StudioRightPanels = memo62(function StudioRightPanels2({
|
|
|
100746
100721
|
useCaptionDesignFocus(captionEditMode);
|
|
100747
100722
|
const handleApplyColorGradingScope = useApplyColorGradingScope(recordEdit, reloadPreview);
|
|
100748
100723
|
const handleRemoveBackground = useRemoveBackground(projectId, refreshFileTree, showToast);
|
|
100749
|
-
const setAttributeWhileDragging =
|
|
100724
|
+
const setAttributeWhileDragging = useCallback192(
|
|
100750
100725
|
(attr, value) => handleDomAttributeLiveCommit(attr, value, void 0, { previewOnly: true }),
|
|
100751
100726
|
[handleDomAttributeLiveCommit]
|
|
100752
100727
|
);
|
|
100753
|
-
const handleHideAllSelected =
|
|
100728
|
+
const handleHideAllSelected = useCallback192(() => {
|
|
100754
100729
|
if (!canHideSelections(domEditGroupSelections)) {
|
|
100755
100730
|
showToast("Audio can't be hidden. Use the group's own controls", "info");
|
|
100756
100731
|
return;
|
|
@@ -100759,7 +100734,7 @@ var StudioRightPanels = memo62(function StudioRightPanels2({
|
|
|
100759
100734
|
const keys = timelineKeysForSelections(domEditGroupSelections, elements, activeCompPath);
|
|
100760
100735
|
if (keys.length > 0) void onToggleElementHidden?.(keys, true);
|
|
100761
100736
|
}, [domEditGroupSelections, showToast, activeCompPath, onToggleElementHidden]);
|
|
100762
|
-
const convertToKeyframes =
|
|
100737
|
+
const convertToKeyframes = useCallback192(
|
|
100763
100738
|
(animId, duration) => handleGsapConvertToKeyframes(animId, void 0, duration),
|
|
100764
100739
|
[handleGsapConvertToKeyframes]
|
|
100765
100740
|
);
|
|
@@ -100926,9 +100901,9 @@ import {
|
|
|
100926
100901
|
} from "@phosphor-icons/react";
|
|
100927
100902
|
|
|
100928
100903
|
// src/hooks/useKeyframeKeyboard.ts
|
|
100929
|
-
import { useEffect as useEffect161, useCallback as
|
|
100904
|
+
import { useEffect as useEffect161, useCallback as useCallback193 } from "react";
|
|
100930
100905
|
function useKeyframeKeyboard({ enabled, onAddKeyframe }) {
|
|
100931
|
-
const handler =
|
|
100906
|
+
const handler = useCallback193(
|
|
100932
100907
|
(e) => {
|
|
100933
100908
|
if (!enabled || !onAddKeyframe) return;
|
|
100934
100909
|
if (isTypingTarget(document.activeElement)) return;
|
|
@@ -101115,7 +101090,7 @@ function TimelineToolPicker({ showSelectAroundPlayhead = true }) {
|
|
|
101115
101090
|
}
|
|
101116
101091
|
|
|
101117
101092
|
// src/components/LinkedSelectionToggle.tsx
|
|
101118
|
-
import { useCallback as
|
|
101093
|
+
import { useCallback as useCallback194, useState as useState165 } from "react";
|
|
101119
101094
|
import { createPortal as createPortal16 } from "react-dom";
|
|
101120
101095
|
import { LinkSimple } from "@phosphor-icons/react";
|
|
101121
101096
|
import { Fragment as Fragment70, jsx as jsx259, jsxs as jsxs205 } from "react/jsx-runtime";
|
|
@@ -101159,7 +101134,7 @@ function LinkedSelectionToggle() {
|
|
|
101159
101134
|
const linkedSelection = useLinkedClipPreferences((s) => s.linkedSelection);
|
|
101160
101135
|
const setLinkedSelection = useLinkedClipPreferences((s) => s.setLinkedSelection);
|
|
101161
101136
|
const [menuAt, setMenuAt] = useState165(null);
|
|
101162
|
-
const closeMenu =
|
|
101137
|
+
const closeMenu = useCallback194(() => setMenuAt(null), []);
|
|
101163
101138
|
return /* @__PURE__ */ jsxs205(Fragment70, { children: [
|
|
101164
101139
|
/* @__PURE__ */ jsx259(
|
|
101165
101140
|
Tooltip,
|
|
@@ -101710,13 +101685,13 @@ function useStudioSessionStart(projectId, resolving, waitingForServer) {
|
|
|
101710
101685
|
}
|
|
101711
101686
|
|
|
101712
101687
|
// src/hooks/useTimelineAddAtPlayhead.ts
|
|
101713
|
-
import { useCallback as
|
|
101688
|
+
import { useCallback as useCallback195 } from "react";
|
|
101714
101689
|
function useTimelineAddAtPlayhead(addAsset, addComposition, projectId) {
|
|
101715
101690
|
const placement = () => ({ start: usePlayerStore.getState().currentTime, track: 0 });
|
|
101716
101691
|
return useStableHandlers(
|
|
101717
101692
|
{
|
|
101718
|
-
addAssetAtPlayhead:
|
|
101719
|
-
addCompositionAtPlayhead:
|
|
101693
|
+
addAssetAtPlayhead: useCallback195((path) => addAsset(path, placement()), [addAsset]),
|
|
101694
|
+
addCompositionAtPlayhead: useCallback195(
|
|
101720
101695
|
(path) => addComposition(path, placement()),
|
|
101721
101696
|
[addComposition]
|
|
101722
101697
|
)
|
|
@@ -101774,14 +101749,14 @@ function useAutoOpenRootComposition({
|
|
|
101774
101749
|
}
|
|
101775
101750
|
|
|
101776
101751
|
// src/hooks/useCompositionContentLoader.ts
|
|
101777
|
-
import { useCallback as
|
|
101752
|
+
import { useCallback as useCallback196 } from "react";
|
|
101778
101753
|
function useCompositionContentLoader({
|
|
101779
101754
|
projectId,
|
|
101780
101755
|
setEditingFile,
|
|
101781
101756
|
setActiveCompPath,
|
|
101782
101757
|
showToast
|
|
101783
101758
|
}) {
|
|
101784
|
-
return
|
|
101759
|
+
return useCallback196(
|
|
101785
101760
|
(comp) => {
|
|
101786
101761
|
if (!projectId) return;
|
|
101787
101762
|
setActiveCompPath(comp.endsWith(".html") ? comp : null);
|
|
@@ -101899,11 +101874,11 @@ function StudioApp({ readOnlyPreview = false, readOnlyPreviewReason } = {}) {
|
|
|
101899
101874
|
const handleDomZIndexReorderCommitRef = useRef194(null);
|
|
101900
101875
|
const pendingTimelineEditPathRef = useRef194(/* @__PURE__ */ new Set());
|
|
101901
101876
|
const isGestureRecordingRef = useRef194(false);
|
|
101902
|
-
const setRefreshKey =
|
|
101877
|
+
const setRefreshKey = useCallback197((next) => {
|
|
101903
101878
|
requestPreviewReload();
|
|
101904
101879
|
setRefreshKeyState(next);
|
|
101905
101880
|
}, []);
|
|
101906
|
-
const reloadPreview =
|
|
101881
|
+
const reloadPreview = useCallback197(() => setRefreshKey((k) => k + 1), [setRefreshKey]);
|
|
101907
101882
|
const fileManagerResult = useFileManager({
|
|
101908
101883
|
projectId,
|
|
101909
101884
|
showToast,
|
|
@@ -101957,7 +101932,7 @@ function StudioApp({ readOnlyPreview = false, readOnlyPreviewReason } = {}) {
|
|
|
101957
101932
|
});
|
|
101958
101933
|
const invalidateGsapCacheRef = useRef194(() => {
|
|
101959
101934
|
});
|
|
101960
|
-
const invalidateGsapCache =
|
|
101935
|
+
const invalidateGsapCache = useCallback197(() => invalidateGsapCacheRef.current(), []);
|
|
101961
101936
|
const timelineEditing = useTimelineEditing({
|
|
101962
101937
|
projectId,
|
|
101963
101938
|
activeCompPath,
|
|
@@ -102013,7 +101988,7 @@ function StudioApp({ readOnlyPreview = false, readOnlyPreviewReason } = {}) {
|
|
|
102013
101988
|
handleAddMediaOverlay,
|
|
102014
101989
|
handlePreviewBlockDrop
|
|
102015
101990
|
} = useStableHandlers(blockHandlersResult, projectId);
|
|
102016
|
-
const dismissBlockParams =
|
|
101991
|
+
const dismissBlockParams = useCallback197(() => setActiveBlockParams(null), [setActiveBlockParams]);
|
|
102017
101992
|
const setRightPanelTab = useDismissingTabSetter(panelLayout.setRightPanelTab, dismissBlockParams);
|
|
102018
101993
|
const layout = useMemo91(
|
|
102019
101994
|
() => ({ ...panelLayout, setRightPanelTab }),
|
|
@@ -102174,7 +102149,7 @@ function StudioApp({ readOnlyPreview = false, readOnlyPreviewReason } = {}) {
|
|
|
102174
102149
|
previewIframe,
|
|
102175
102150
|
compositionDimensions
|
|
102176
102151
|
);
|
|
102177
|
-
const handlePreviewIframeRef =
|
|
102152
|
+
const handlePreviewIframeRef = useCallback197(
|
|
102178
102153
|
(iframe) => {
|
|
102179
102154
|
previewIframeRef.current = iframe;
|
|
102180
102155
|
usePreviewIframeStore.getState().setIframe(iframe);
|
|
@@ -102245,10 +102220,10 @@ function StudioApp({ readOnlyPreview = false, readOnlyPreviewReason } = {}) {
|
|
|
102245
102220
|
),
|
|
102246
102221
|
[toolbarSession, timelineEditing.handleTimelineElementSplit]
|
|
102247
102222
|
);
|
|
102248
|
-
const handleExport =
|
|
102223
|
+
const handleExport = useCallback197(() => {
|
|
102249
102224
|
void previewPersistence.waitForPendingDomEditSaves().then(() => renderQueue.startRender(void 0));
|
|
102250
102225
|
}, [previewPersistence, renderQueue]);
|
|
102251
|
-
const clearConsoleErrors =
|
|
102226
|
+
const clearConsoleErrors = useCallback197(() => setConsoleErrors(null), [setConsoleErrors]);
|
|
102252
102227
|
const panels = useStudioSidePanels(
|
|
102253
102228
|
{
|
|
102254
102229
|
onSelectComposition: handleSelectComposition,
|
|
@@ -102380,7 +102355,7 @@ function StudioApp({ readOnlyPreview = false, readOnlyPreviewReason } = {}) {
|
|
|
102380
102355
|
}
|
|
102381
102356
|
|
|
102382
102357
|
// src/hooks/useElementPicker.ts
|
|
102383
|
-
import { useState as useState169, useCallback as
|
|
102358
|
+
import { useState as useState169, useCallback as useCallback198, useEffect as useEffect167, useRef as useRef195 } from "react";
|
|
102384
102359
|
|
|
102385
102360
|
// src/hooks/elementPickerHoverLabel.ts
|
|
102386
102361
|
var LABEL_GAP_PX = 6;
|
|
@@ -102506,9 +102481,9 @@ function createElementPickerHoverLabel(doc = document) {
|
|
|
102506
102481
|
// src/hooks/useElementPicker.ts
|
|
102507
102482
|
function usePickerHoverLabel() {
|
|
102508
102483
|
const hoverLabelRef = useRef195(null);
|
|
102509
|
-
const clearHover =
|
|
102510
|
-
const disposeHover =
|
|
102511
|
-
const showHover =
|
|
102484
|
+
const clearHover = useCallback198(() => hoverLabelRef.current?.clear(), []);
|
|
102485
|
+
const disposeHover = useCallback198(() => hoverLabelRef.current?.dispose(), []);
|
|
102486
|
+
const showHover = useCallback198((info, iframe) => {
|
|
102512
102487
|
hoverLabelRef.current ??= createElementPickerHoverLabel();
|
|
102513
102488
|
hoverLabelRef.current.show(info, iframe);
|
|
102514
102489
|
}, []);
|
|
@@ -102518,11 +102493,11 @@ function useActivePickerIframe(iframeRef, isPickModeRef, clearHover) {
|
|
|
102518
102493
|
const activeOverrideRef = useRef195(null);
|
|
102519
102494
|
const activeIframeRef = useRef195(null);
|
|
102520
102495
|
const lastRenderedActiveIframeRef = useRef195(null);
|
|
102521
|
-
const getActiveIframe =
|
|
102496
|
+
const getActiveIframe = useCallback198(
|
|
102522
102497
|
() => activeOverrideRef.current ?? iframeRef.current,
|
|
102523
102498
|
[iframeRef]
|
|
102524
102499
|
);
|
|
102525
|
-
const setActiveIframe =
|
|
102500
|
+
const setActiveIframe = useCallback198(
|
|
102526
102501
|
(el) => {
|
|
102527
102502
|
const previous = activeOverrideRef.current ?? iframeRef.current;
|
|
102528
102503
|
const next = el ?? iframeRef.current;
|
|
@@ -102564,13 +102539,13 @@ function useElementPickerSession(iframeRef) {
|
|
|
102564
102539
|
isPickModeRef,
|
|
102565
102540
|
clearHover
|
|
102566
102541
|
);
|
|
102567
|
-
const enablePick =
|
|
102542
|
+
const enablePick = useCallback198(() => {
|
|
102568
102543
|
if (isPickModeRef.current || !postPickerControl(getActiveIframe(), "enable-pick-mode")) return;
|
|
102569
102544
|
pickStartSelectionRef.current = pickedElementRef.current;
|
|
102570
102545
|
isPickModeRef.current = true;
|
|
102571
102546
|
setIsPickMode(true);
|
|
102572
102547
|
}, [getActiveIframe]);
|
|
102573
|
-
const cancelPick =
|
|
102548
|
+
const cancelPick = useCallback198(
|
|
102574
102549
|
(notifyRuntime) => {
|
|
102575
102550
|
if (notifyRuntime) {
|
|
102576
102551
|
postPickerControl(getActiveIframe(), "disable-pick-mode");
|
|
@@ -102587,8 +102562,8 @@ function useElementPickerSession(iframeRef) {
|
|
|
102587
102562
|
},
|
|
102588
102563
|
[clearHover, getActiveIframe]
|
|
102589
102564
|
);
|
|
102590
|
-
const disablePick =
|
|
102591
|
-
const clearPick =
|
|
102565
|
+
const disablePick = useCallback198(() => cancelPick(true), [cancelPick]);
|
|
102566
|
+
const clearPick = useCallback198(() => {
|
|
102592
102567
|
pickedElementRef.current = null;
|
|
102593
102568
|
setPickedElement(null);
|
|
102594
102569
|
}, []);
|
|
@@ -102679,7 +102654,7 @@ function useElementPicker(iframeRef, options) {
|
|
|
102679
102654
|
optionsRef.current = options;
|
|
102680
102655
|
const pendingWritesRef = useRef195(/* @__PURE__ */ new Map());
|
|
102681
102656
|
settlePendingWrites(pendingWritesRef.current, options?.workspaceFiles);
|
|
102682
|
-
const syncToSource =
|
|
102657
|
+
const syncToSource = useCallback198(
|
|
102683
102658
|
(picked, live, iframe, op) => {
|
|
102684
102659
|
const opts = optionsRef.current;
|
|
102685
102660
|
if (!opts?.workspaceFiles || !opts.onSyncFiles) return;
|
|
@@ -102693,7 +102668,7 @@ function useElementPicker(iframeRef, options) {
|
|
|
102693
102668
|
},
|
|
102694
102669
|
[]
|
|
102695
102670
|
);
|
|
102696
|
-
const setStyle =
|
|
102671
|
+
const setStyle = useCallback198(
|
|
102697
102672
|
(prop, value) => {
|
|
102698
102673
|
const activeIframe = getActiveIframe();
|
|
102699
102674
|
if (!pickedElement?.selector || !activeIframe) return;
|
|
@@ -102719,7 +102694,7 @@ function useElementPicker(iframeRef, options) {
|
|
|
102719
102694
|
},
|
|
102720
102695
|
[pickedElement, getActiveIframe, setPickedElement, syncToSource]
|
|
102721
102696
|
);
|
|
102722
|
-
const setDataAttr =
|
|
102697
|
+
const setDataAttr = useCallback198(
|
|
102723
102698
|
(attr, value) => {
|
|
102724
102699
|
const activeIframe = getActiveIframe();
|
|
102725
102700
|
if (!pickedElement?.selector || !activeIframe) return;
|
|
@@ -102745,7 +102720,7 @@ function useElementPicker(iframeRef, options) {
|
|
|
102745
102720
|
},
|
|
102746
102721
|
[pickedElement, getActiveIframe, setPickedElement, syncToSource]
|
|
102747
102722
|
);
|
|
102748
|
-
const setTextContent =
|
|
102723
|
+
const setTextContent = useCallback198(
|
|
102749
102724
|
(text2) => {
|
|
102750
102725
|
const activeIframe = getActiveIframe();
|
|
102751
102726
|
if (!pickedElement?.selector || !activeIframe) return;
|
|
@@ -103023,7 +102998,7 @@ function findElementBlock(html2, elementId2) {
|
|
|
103023
102998
|
}
|
|
103024
102999
|
|
|
103025
103000
|
// src/hooks/useDomStyleCommit.ts
|
|
103026
|
-
import { useCallback as
|
|
103001
|
+
import { useCallback as useCallback199, useMemo as useMemo92, useRef as useRef196, useState as useState170 } from "react";
|
|
103027
103002
|
var noop = () => {
|
|
103028
103003
|
};
|
|
103029
103004
|
function useDomStyleCommit({
|
|
@@ -103050,7 +103025,7 @@ function useDomStyleCommit({
|
|
|
103050
103025
|
projectIdRef,
|
|
103051
103026
|
reloadPreview: noop
|
|
103052
103027
|
});
|
|
103053
|
-
const commitStyle =
|
|
103028
|
+
const commitStyle = useCallback199(
|
|
103054
103029
|
(selection, styles) => {
|
|
103055
103030
|
queue2.reset();
|
|
103056
103031
|
return projectIdRef.current ? commitDomStyles(
|
|
@@ -103071,7 +103046,7 @@ function useDomStyleCommit({
|
|
|
103071
103046
|
}
|
|
103072
103047
|
|
|
103073
103048
|
// src/hooks/useDomGeometryCommit.ts
|
|
103074
|
-
import { useCallback as
|
|
103049
|
+
import { useCallback as useCallback200, useMemo as useMemo93, useRef as useRef197, useState as useState171 } from "react";
|
|
103075
103050
|
var noop2 = () => {
|
|
103076
103051
|
};
|
|
103077
103052
|
var NO_SELECTED_ANIMATIONS = [];
|
|
@@ -103116,7 +103091,7 @@ function useDomGeometryCommit({
|
|
|
103116
103091
|
persistDomEditOperations,
|
|
103117
103092
|
showToast
|
|
103118
103093
|
});
|
|
103119
|
-
const commitWithFreshQueue =
|
|
103094
|
+
const commitWithFreshQueue = useCallback200(
|
|
103120
103095
|
(...args) => {
|
|
103121
103096
|
queue2.reset();
|
|
103122
103097
|
return commitPositionPatchToHtml(...args);
|
|
@@ -103155,7 +103130,7 @@ function useDomGeometryCommit({
|
|
|
103155
103130
|
setArcPath: gsap3.setArcPath,
|
|
103156
103131
|
updateArcSegment: gsap3.updateArcSegment
|
|
103157
103132
|
});
|
|
103158
|
-
const saved2 =
|
|
103133
|
+
const saved2 = useCallback200(
|
|
103159
103134
|
async (commit2, restore2 = noop2) => {
|
|
103160
103135
|
const refusal2 = !projectIdRef.current ? "No project is open" : !isPreviewBooted(projectIdRef.current) ? "The preview for this project has not loaded yet" : null;
|
|
103161
103136
|
if (refusal2) {
|