@hyperframes/studio 0.9.31 → 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/index.js CHANGED
@@ -74,7 +74,7 @@ import {
74
74
  whileScriptWrites,
75
75
  writeStudioUiPreferences,
76
76
  zoomToSelectedClips
77
- } from "./chunk-LRTUWOR4.js";
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-J3VJE463.js";
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 useCallback198, useRef as useRef194, useMemo as useMemo91 } from "react";
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";
@@ -93084,7 +93093,7 @@ function useGestureTrailOverlay({
93084
93093
  import { useMemo as useMemo90 } from "react";
93085
93094
 
93086
93095
  // src/components/StudioLeftPanels.tsx
93087
- import { memo as memo51, useCallback as useCallback175 } from "react";
93096
+ import { memo as memo51, useCallback as useCallback174 } from "react";
93088
93097
 
93089
93098
  // src/components/MediaPreview.tsx
93090
93099
  import { useEffect as useEffect141, useState as useState140 } from "react";
@@ -95107,12 +95116,12 @@ function BlockCard({
95107
95116
  }
95108
95117
 
95109
95118
  // src/components/sidebar/CompositionsTab.tsx
95110
- import { memo as memo50, useCallback as useCallback174, useEffect as useEffect150, useLayoutEffect as useLayoutEffect15, useMemo as useMemo86, useRef as useRef181, useState as useState149 } from "react";
95119
+ import { memo as memo50, useEffect as useEffect150, useLayoutEffect as useLayoutEffect15, useMemo as useMemo86, useRef as useRef181, useState as useState149 } from "react";
95111
95120
  import { jsx as jsx228, jsxs as jsxs178 } from "react/jsx-runtime";
95112
95121
  var DEFAULT_PREVIEW_STAGE = { width: 1920, height: 1080 };
95113
95122
  var CARD_W = 80;
95114
95123
  var CARD_H = 45;
95115
- var THUMBNAIL_PLAYBACK_SYNC_ATTEMPTS = 10;
95124
+ var OPAQUE_ORIGIN_SCRIPTS_ONLY_SANDBOX = "allow-scripts";
95116
95125
  function resolveCompositionPreviewScale(input) {
95117
95126
  const safeStageWidth = Number.isFinite(input.stageWidth) && input.stageWidth > 0 ? input.stageWidth : DEFAULT_PREVIEW_STAGE.width;
95118
95127
  const safeStageHeight = Number.isFinite(input.stageHeight) && input.stageHeight > 0 ? input.stageHeight : DEFAULT_PREVIEW_STAGE.height;
@@ -95132,43 +95141,22 @@ function compositionCardThumbnailUrl(projectId, comp, contentRevision) {
95132
95141
  contentRevision
95133
95142
  });
95134
95143
  }
95135
- function parsePositiveNumber(value) {
95136
- if (value == null) return null;
95137
- const parsed = Number.parseFloat(value);
95138
- 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;
95139
95146
  }
95140
- function resolveIframeDuration(iframe) {
95141
- try {
95142
- const win = iframe?.contentWindow;
95143
- const playerDuration = win?.__player?.getDuration?.();
95144
- if (Number.isFinite(playerDuration) && playerDuration != null && playerDuration > 0) {
95145
- return playerDuration;
95146
- }
95147
- } catch {
95148
- }
95149
- try {
95150
- const doc = iframe?.contentDocument;
95151
- const root = doc?.querySelector("[data-composition-id]") ?? doc?.documentElement ?? null;
95152
- return parsePositiveNumber(root?.getAttribute("data-composition-duration") ?? null) ?? parsePositiveNumber(root?.getAttribute("data-duration") ?? null);
95153
- } catch {
95154
- return null;
95155
- }
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
+ };
95156
95155
  }
95157
- function syncIframePlayback(iframe, shouldPlay) {
95158
- try {
95159
- const player = iframe?.contentWindow?.__player;
95160
- if (!player) return false;
95161
- if (shouldPlay) {
95162
- setPreviewMediaMuted(iframe, true);
95163
- player.play?.();
95164
- return true;
95165
- }
95166
- player.pause?.();
95167
- player.seek?.(resolveThumbnailSeekTime(resolveIframeDuration(iframe)));
95168
- return true;
95169
- } catch {
95170
- return false;
95171
- }
95156
+ function muteThenPlayOverRuntimeBridge(iframe) {
95157
+ if (!iframe) return;
95158
+ setPreviewMediaMuted(iframe, true);
95159
+ postRuntimeControlMessage(iframe.contentWindow, "play");
95172
95160
  }
95173
95161
  var imageUrlOf = (snapshot3) => snapshot3.status === "ready" && snapshot3.value.kind === "image" ? snapshot3.value.url : null;
95174
95162
  function useLastFrame(request2, snapshot3) {
@@ -95216,19 +95204,7 @@ function CompCard({
95216
95204
  const [livePreviewLoaded, setLivePreviewLoaded] = useState149(false);
95217
95205
  const iframeRef = useRef181(null);
95218
95206
  const hoverTimer = useRef181(null);
95219
- const syncTimer = useRef181(null);
95220
95207
  const draggedRef = useRef181(false);
95221
- const requestIframePlaybackSync = useCallback174((shouldPlay) => {
95222
- if (syncTimer.current) {
95223
- clearTimeout(syncTimer.current);
95224
- syncTimer.current = null;
95225
- }
95226
- const sync = (remainingAttempts) => {
95227
- if (syncIframePlayback(iframeRef.current, shouldPlay) || remainingAttempts <= 0) return;
95228
- syncTimer.current = setTimeout(() => sync(remainingAttempts - 1), 100);
95229
- };
95230
- sync(THUMBNAIL_PLAYBACK_SYNC_ATTEMPTS);
95231
- }, []);
95232
95208
  const handleEnter = () => {
95233
95209
  hoverTimer.current = setTimeout(() => setHovered(true), 300);
95234
95210
  };
@@ -95237,10 +95213,6 @@ function CompCard({
95237
95213
  clearTimeout(hoverTimer.current);
95238
95214
  hoverTimer.current = null;
95239
95215
  }
95240
- if (syncTimer.current) {
95241
- clearTimeout(syncTimer.current);
95242
- syncTimer.current = null;
95243
- }
95244
95216
  setHovered(false);
95245
95217
  setLivePreviewLoaded(false);
95246
95218
  };
@@ -95267,27 +95239,32 @@ function CompCard({
95267
95239
  });
95268
95240
  const thumbnailOffsetX = (CARD_W - stageSize.width * previewScale) / 2;
95269
95241
  const thumbnailOffsetY = (CARD_H - stageSize.height * previewScale) / 2;
95270
- useEffect150(() => {
95271
- if (hovered) requestIframePlaybackSync(true);
95272
- }, [hovered, requestIframePlaybackSync]);
95273
95242
  useEffect150(() => {
95274
95243
  if (livePreviewLoaded) postFrameDisplayScale(iframeRef.current);
95275
95244
  }, [livePreviewLoaded, previewScale]);
95276
95245
  useEffect150(() => {
95277
95246
  if (!hovered) return;
95278
- const onRuntimeReady = (event) => {
95247
+ const onRuntimeMessage = (event) => {
95279
95248
  const frame3 = iframeRef.current;
95280
- if (frame3 && event.source === frame3.contentWindow && event.data?.type === "ready") {
95249
+ if (!frame3 || event.source !== frame3.contentWindow) return;
95250
+ const runtimeControlListenerInstalled = event.data?.source === "hf-preview" && event.data.type === "ready";
95251
+ if (runtimeControlListenerInstalled) {
95281
95252
  postFrameDisplayScale(frame3);
95253
+ muteThenPlayOverRuntimeBridge(frame3);
95254
+ return;
95282
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
+ );
95283
95261
  };
95284
- window.addEventListener("message", onRuntimeReady);
95285
- return () => window.removeEventListener("message", onRuntimeReady);
95262
+ window.addEventListener("message", onRuntimeMessage);
95263
+ return () => window.removeEventListener("message", onRuntimeMessage);
95286
95264
  }, [hovered]);
95287
95265
  useEffect150(() => {
95288
95266
  return () => {
95289
95267
  if (hoverTimer.current) clearTimeout(hoverTimer.current);
95290
- if (syncTimer.current) clearTimeout(syncTimer.current);
95291
95268
  };
95292
95269
  }, []);
95293
95270
  return /* @__PURE__ */ jsxs178(
@@ -95343,7 +95320,7 @@ function CompCard({
95343
95320
  {
95344
95321
  ref: iframeRef,
95345
95322
  src: previewUrl,
95346
- sandbox: "allow-scripts allow-same-origin",
95323
+ sandbox: OPAQUE_ORIGIN_SCRIPTS_ONLY_SANDBOX,
95347
95324
  className: "absolute border-none pointer-events-none",
95348
95325
  style: {
95349
95326
  transformOrigin: "0 0",
@@ -95353,19 +95330,7 @@ function CompCard({
95353
95330
  top: thumbnailOffsetY,
95354
95331
  transform: `scale(${previewScale})`
95355
95332
  },
95356
- onLoad: (e) => {
95357
- try {
95358
- const iframe = e.currentTarget;
95359
- const root = iframe.contentDocument?.querySelector("[data-composition-id]");
95360
- const width = Number(root?.getAttribute("data-width")) || DEFAULT_PREVIEW_STAGE.width;
95361
- const height = Number(root?.getAttribute("data-height")) || DEFAULT_PREVIEW_STAGE.height;
95362
- setStageSize({ width, height });
95363
- setLivePreviewLoaded(true);
95364
- requestIframePlaybackSync(true);
95365
- } catch {
95366
- setStageSize(DEFAULT_PREVIEW_STAGE);
95367
- }
95368
- },
95333
+ onLoad: () => setLivePreviewLoaded(true),
95369
95334
  title: `${name} preview`,
95370
95335
  tabIndex: -1
95371
95336
  }
@@ -95650,7 +95615,7 @@ var StudioLeftPanels = memo51(function StudioLeftPanels2({
95650
95615
  handleImportFiles,
95651
95616
  handleContentChange
95652
95617
  } = useFileManagerContext();
95653
- const handleRenderComposition = useCallback175(
95618
+ const handleRenderComposition = useCallback174(
95654
95619
  async (comp) => {
95655
95620
  if (renderQueue.ffmpegMissing) {
95656
95621
  useDockLayoutStore.getState().activatePanel("renders");
@@ -95760,10 +95725,10 @@ function CodeBody({
95760
95725
  }
95761
95726
 
95762
95727
  // src/components/StudioRightPanels.tsx
95763
- import { memo as memo62, useCallback as useCallback193 } from "react";
95728
+ import { memo as memo62, useCallback as useCallback192 } from "react";
95764
95729
 
95765
95730
  // src/components/editor/LayersPanel.tsx
95766
- import { memo as memo52, useState as useState151, useCallback as useCallback177, useEffect as useEffect151, useRef as useRef183 } from "react";
95731
+ import { memo as memo52, useState as useState151, useCallback as useCallback176, useEffect as useEffect151, useRef as useRef183 } from "react";
95767
95732
 
95768
95733
  // src/components/editor/layerKind.ts
95769
95734
  function isCompositionHost(el) {
@@ -95781,7 +95746,7 @@ function layerKindOf(el, hasChildren) {
95781
95746
  }
95782
95747
 
95783
95748
  // src/components/editor/useLayerDrag.ts
95784
- import { useRef as useRef182, useState as useState150, useCallback as useCallback176 } from "react";
95749
+ import { useRef as useRef182, useState as useState150, useCallback as useCallback175 } from "react";
95785
95750
  var DRAG_THRESHOLD_PX4 = 4;
95786
95751
  function isLayerDraggable(layer) {
95787
95752
  if (!(layer.selector || layer.id)) return false;
@@ -95851,7 +95816,7 @@ function useLayerDrag({
95851
95816
  const dragRef = useRef182(null);
95852
95817
  const [dragKey, setDragKey] = useState150(null);
95853
95818
  const [insertionLineY, setInsertionLineY] = useState150(null);
95854
- const handleRowPointerDown = useCallback176(
95819
+ const handleRowPointerDown = useCallback175(
95855
95820
  (layerIndex, e) => {
95856
95821
  if (e.button !== 0) return;
95857
95822
  const layer = visibleLayers[layerIndex];
@@ -95878,7 +95843,7 @@ function useLayerDrag({
95878
95843
  },
95879
95844
  [visibleLayers, scrollContainerRef, onSingleSibling]
95880
95845
  );
95881
- const handleContainerPointerMove = useCallback176(
95846
+ const handleContainerPointerMove = useCallback175(
95882
95847
  (e) => {
95883
95848
  const drag = dragRef.current;
95884
95849
  if (!drag) return;
@@ -95904,7 +95869,7 @@ function useLayerDrag({
95904
95869
  },
95905
95870
  [visibleLayers, scrollContainerRef]
95906
95871
  );
95907
- const handleContainerPointerUp = useCallback176(() => {
95872
+ const handleContainerPointerUp = useCallback175(() => {
95908
95873
  const drag = dragRef.current;
95909
95874
  dragRef.current = null;
95910
95875
  setDragKey(null);
@@ -96060,7 +96025,7 @@ var LayersPanel = memo52(function LayersPanel2({ host }) {
96060
96025
  });
96061
96026
  const isMasterView = !activeCompPath || activeCompPath === "index.html";
96062
96027
  const livePreviewIframe = useLivePreviewIframe();
96063
- const collectLayers = useCallback177(() => {
96028
+ const collectLayers = useCallback176(() => {
96064
96029
  const iframe = previewIframeRef.current;
96065
96030
  if (!iframe) return;
96066
96031
  let doc = null;
@@ -96108,7 +96073,7 @@ var LayersPanel = memo52(function LayersPanel2({ host }) {
96108
96073
  throttle.cancel();
96109
96074
  };
96110
96075
  }, [collectLayers]);
96111
- const resolveSelection = useCallback177(
96076
+ const resolveSelection = useCallback176(
96112
96077
  (layer) => {
96113
96078
  const doc = previewIframeRef.current?.contentDocument;
96114
96079
  const el = liveLayerElement(layer, doc, activeCompPath);
@@ -96121,7 +96086,7 @@ var LayersPanel = memo52(function LayersPanel2({ host }) {
96121
96086
  },
96122
96087
  [activeCompPath, isMasterView, previewIframeRef, activeGroupElement]
96123
96088
  );
96124
- const seekToLayer = useCallback177(
96089
+ const seekToLayer = useCallback176(
96125
96090
  async (layer) => {
96126
96091
  const selection = await resolveSelection(layer);
96127
96092
  if (!selection) return;
@@ -96150,7 +96115,7 @@ var LayersPanel = memo52(function LayersPanel2({ host }) {
96150
96115
  },
96151
96116
  [currentTime, resolveSelection, timelineElements]
96152
96117
  );
96153
- const handleSelectLayer = useCallback177(
96118
+ const handleSelectLayer = useCallback176(
96154
96119
  async (layer) => {
96155
96120
  const selection = await resolveSelection(layer);
96156
96121
  if (!selection) return;
@@ -96160,7 +96125,7 @@ var LayersPanel = memo52(function LayersPanel2({ host }) {
96160
96125
  },
96161
96126
  [resolveSelection, applyDomSelection, seekToLayer, scheduleReveal]
96162
96127
  );
96163
- const handleLayerDoubleClick = useCallback177(
96128
+ const handleLayerDoubleClick = useCallback176(
96164
96129
  async (layer) => {
96165
96130
  const selection = await resolveSelection(layer);
96166
96131
  if (selection?.element.hasAttribute("data-hf-group")) {
@@ -96171,7 +96136,7 @@ var LayersPanel = memo52(function LayersPanel2({ host }) {
96171
96136
  },
96172
96137
  [resolveSelection, setActiveGroupElement, handleSelectLayer]
96173
96138
  );
96174
- const handleLayerHover = useCallback177(
96139
+ const handleLayerHover = useCallback176(
96175
96140
  async (layer) => {
96176
96141
  if (!layer) {
96177
96142
  updateDomEditHoverSelection(null);
@@ -96182,11 +96147,11 @@ var LayersPanel = memo52(function LayersPanel2({ host }) {
96182
96147
  },
96183
96148
  [resolveSelection, updateDomEditHoverSelection]
96184
96149
  );
96185
- const toggleCollapse = useCallback177((key2, e) => {
96150
+ const toggleCollapse = useCallback176((key2, e) => {
96186
96151
  e.stopPropagation();
96187
96152
  setCollapsed((prev) => ({ ...prev, [key2]: !prev[key2] }));
96188
96153
  }, []);
96189
- const handleReorder = useCallback177(
96154
+ const handleReorder = useCallback176(
96190
96155
  (event) => {
96191
96156
  const { siblingLayers, fromIndex, toIndex } = event;
96192
96157
  const reordered = [...siblingLayers];
@@ -96249,7 +96214,7 @@ var LayersPanel = memo52(function LayersPanel2({ host }) {
96249
96214
  );
96250
96215
  const selectedKey = domEditSelection ? getDomEditLayerKey(domEditSelection) : null;
96251
96216
  const visibleLayers = getVisibleLayers(layers, collapsed);
96252
- const handleSingleSibling = useCallback177(() => {
96217
+ const handleSingleSibling = useCallback176(() => {
96253
96218
  showToast("Only one layer at this level", "info");
96254
96219
  }, [showToast]);
96255
96220
  const {
@@ -96387,10 +96352,10 @@ var LayersPanel = memo52(function LayersPanel2({ host }) {
96387
96352
  });
96388
96353
 
96389
96354
  // src/captions/components/CaptionPropertyPanel.tsx
96390
- import { memo as memo54, useCallback as useCallback179, useState as useState153 } from "react";
96355
+ import { memo as memo54, useCallback as useCallback178, useState as useState153 } from "react";
96391
96356
 
96392
96357
  // src/captions/components/CaptionAnimationPanel.tsx
96393
- import { memo as memo53, useCallback as useCallback178 } from "react";
96358
+ import { memo as memo53, useCallback as useCallback177 } from "react";
96394
96359
 
96395
96360
  // src/captions/components/shared.tsx
96396
96361
  import { useEffect as useEffect152, useRef as useRef184, useState as useState152 } from "react";
@@ -96615,25 +96580,25 @@ var CaptionAnimationPanel = memo53(function CaptionAnimationPanel2() {
96615
96580
  }
96616
96581
  const group = resolvedGroupId ? model?.groups.get(resolvedGroupId) : void 0;
96617
96582
  const animation2 = group?.animation;
96618
- const handleEntranceChange = useCallback178(
96583
+ const handleEntranceChange = useCallback177(
96619
96584
  (update) => {
96620
96585
  if (resolvedGroupId) updateGroupAnimation(resolvedGroupId, "entrance", update);
96621
96586
  },
96622
96587
  [resolvedGroupId, updateGroupAnimation]
96623
96588
  );
96624
- const handleHighlightChange = useCallback178(
96589
+ const handleHighlightChange = useCallback177(
96625
96590
  (update) => {
96626
96591
  if (resolvedGroupId) updateGroupAnimation(resolvedGroupId, "highlight", update);
96627
96592
  },
96628
96593
  [resolvedGroupId, updateGroupAnimation]
96629
96594
  );
96630
- const handleExitChange = useCallback178(
96595
+ const handleExitChange = useCallback177(
96631
96596
  (update) => {
96632
96597
  if (resolvedGroupId) updateGroupAnimation(resolvedGroupId, "exit", update);
96633
96598
  },
96634
96599
  [resolvedGroupId, updateGroupAnimation]
96635
96600
  );
96636
- const handleApplyToAll = useCallback178(() => {
96601
+ const handleApplyToAll = useCallback177(() => {
96637
96602
  if (animation2) applyAnimationToAll(animation2);
96638
96603
  }, [animation2, applyAnimationToAll]);
96639
96604
  if (!group || !resolvedGroupId || !animation2) {
@@ -96733,7 +96698,7 @@ var CaptionPropertyPanel = memo54(function CaptionPropertyPanel2({
96733
96698
  ...groupStyle,
96734
96699
  ...segmentOverrides
96735
96700
  };
96736
- const applyToIframeDom = useCallback179(
96701
+ const applyToIframeDom = useCallback178(
96737
96702
  (updates) => {
96738
96703
  const iframe = iframeRef.current;
96739
96704
  if (!iframe || !model) return;
@@ -96807,7 +96772,7 @@ var CaptionPropertyPanel = memo54(function CaptionPropertyPanel2({
96807
96772
  },
96808
96773
  [iframeRef, model, selectedSegmentIds]
96809
96774
  );
96810
- const handleStyleChange = useCallback179(
96775
+ const handleStyleChange = useCallback178(
96811
96776
  (updates) => {
96812
96777
  if (selectedGroupId) {
96813
96778
  updateGroupStyle(selectedGroupId, updates);
@@ -96912,7 +96877,7 @@ var CaptionPropertyPanel = memo54(function CaptionPropertyPanel2({
96912
96877
  });
96913
96878
 
96914
96879
  // src/components/editor/BlockParamsPanel.tsx
96915
- import { memo as memo55, useCallback as useCallback180, useEffect as useEffect153, useRef as useRef185, useState as useState154 } from "react";
96880
+ import { memo as memo55, useCallback as useCallback179, useEffect as useEffect153, useRef as useRef185, useState as useState154 } from "react";
96916
96881
  import { jsx as jsx236, jsxs as jsxs185 } from "react/jsx-runtime";
96917
96882
  var BlockParamsPanel = memo55(function BlockParamsPanel2({
96918
96883
  blockName,
@@ -96935,7 +96900,7 @@ var BlockParamsPanel = memo55(function BlockParamsPanel2({
96935
96900
  );
96936
96901
  const [commitState, setCommitState] = useState154({ tone: "idle" });
96937
96902
  const commitTimersRef = useRef185(/* @__PURE__ */ new Map());
96938
- const commitParamNow = useCallback180(
96903
+ const commitParamNow = useCallback179(
96939
96904
  async (key2, nextValue) => {
96940
96905
  if (!fileManager) return;
96941
96906
  const previous = appliedRef.current[key2];
@@ -96980,7 +96945,7 @@ var BlockParamsPanel = memo55(function BlockParamsPanel2({
96980
96945
  },
96981
96946
  [fileManager, compositionPath, setRefreshKey, blockName]
96982
96947
  );
96983
- const commitParam = useCallback180(
96948
+ const commitParam = useCallback179(
96984
96949
  (key2, nextValue) => fileManager ? serializeStudioFileMutation(
96985
96950
  fileManager.writeProjectFile,
96986
96951
  compositionPath,
@@ -96988,7 +96953,7 @@ var BlockParamsPanel = memo55(function BlockParamsPanel2({
96988
96953
  ) : Promise.resolve(),
96989
96954
  [commitParamNow, compositionPath, fileManager]
96990
96955
  );
96991
- const handleChange = useCallback180(
96956
+ const handleChange = useCallback179(
96992
96957
  (key2, value) => {
96993
96958
  setValues((prev) => ({ ...prev, [key2]: value }));
96994
96959
  const timers = commitTimersRef.current;
@@ -97168,7 +97133,7 @@ function RenderDurationNote({
97168
97133
  }
97169
97134
 
97170
97135
  // src/components/renders/RenderQueueItem.tsx
97171
- import { memo as memo56, useCallback as useCallback181, useState as useState155 } from "react";
97136
+ import { memo as memo56, useCallback as useCallback180, useState as useState155 } from "react";
97172
97137
 
97173
97138
  // src/components/renders/RenderQueueInfo.tsx
97174
97139
  import { jsx as jsx237, jsxs as jsxs187 } from "react/jsx-runtime";
@@ -97272,10 +97237,10 @@ var RenderQueueItem = memo56(function RenderQueueItem2({
97272
97237
  const [videoReady, setVideoReady] = useState155(false);
97273
97238
  const [confirmingDelete, setConfirmingDelete] = useState155(false);
97274
97239
  const fileSrc = buildProjectApiPath(projectId, `/renders/file/${job.filename}`);
97275
- const handleOpen = useCallback181(() => {
97240
+ const handleOpen = useCallback180(() => {
97276
97241
  window.open(fileSrc, "_blank");
97277
97242
  }, [fileSrc]);
97278
- const handleDownload = useCallback181(
97243
+ const handleDownload = useCallback180(
97279
97244
  (e) => {
97280
97245
  e.stopPropagation();
97281
97246
  const a = document.createElement("a");
@@ -98056,11 +98021,11 @@ var RenderQueuePanel = memo59(function RenderQueuePanel2() {
98056
98021
  });
98057
98022
 
98058
98023
  // src/components/panels/SlideshowPanel.tsx
98059
- import { useState as useState159, useEffect as useEffect156, useCallback as useCallback183, useRef as useRef188 } from "react";
98024
+ import { useState as useState159, useEffect as useEffect156, useCallback as useCallback182, useRef as useRef188 } from "react";
98060
98025
  import { parseSlideshowManifest } from "@hyperframes/core/slideshow";
98061
98026
 
98062
98027
  // src/components/panels/SlideshowSubPanels.tsx
98063
- import { useState as useState158, useCallback as useCallback182, useId as useId5 } from "react";
98028
+ import { useState as useState158, useCallback as useCallback181, useId as useId5 } from "react";
98064
98029
  import { jsx as jsx245, jsxs as jsxs194 } from "react/jsx-runtime";
98065
98030
  function SectionHeader({
98066
98031
  children,
@@ -98248,7 +98213,7 @@ function BranchTree({
98248
98213
  }) {
98249
98214
  const [newLabel, setNewLabel] = useState158("");
98250
98215
  const inputId = useId5();
98251
- const handleCreate = useCallback182(() => {
98216
+ const handleCreate = useCallback181(() => {
98252
98217
  const label = newLabel.trim();
98253
98218
  if (!label) return;
98254
98219
  onCreateSequence(label);
@@ -98310,7 +98275,7 @@ function BranchItem({
98310
98275
  const [editing, setEditing] = useState158(false);
98311
98276
  const [draft, setDraft] = useState158(seq.label);
98312
98277
  const [confirmingDelete, setConfirmingDelete] = useState158(false);
98313
- const commitRename = useCallback182(() => {
98278
+ const commitRename = useCallback181(() => {
98314
98279
  const label = draft.trim();
98315
98280
  if (label && label !== seq.label) onRename(seq.id, label);
98316
98281
  setEditing(false);
@@ -98443,7 +98408,7 @@ function HotspotTool({
98443
98408
  const selectedElementId = domEditSelection?.element?.id ?? null;
98444
98409
  const selectedHfId = domEditSelection?.hfId ?? null;
98445
98410
  const elementKey3 = selectedElementId || selectedHfId;
98446
- const handleMakeHotspot = useCallback182(() => {
98411
+ const handleMakeHotspot = useCallback181(() => {
98447
98412
  if (!selectedSceneId || !targetSequenceId || !elementKey3) return;
98448
98413
  const id = `hotspot-${elementKey3}-${generateId()}`;
98449
98414
  const label = hotspotLabel.trim() || elementKey3;
@@ -98768,7 +98733,7 @@ function SlideshowPanel({ scenes, onPersist, onPersistNotes }) {
98768
98733
  setUndoDepth(0);
98769
98734
  setPersistError(false);
98770
98735
  }, [compHtml]);
98771
- const applyManifest = useCallback183(
98736
+ const applyManifest = useCallback182(
98772
98737
  async (next, opts) => {
98773
98738
  const merged = notesCtrlRef.current.mergeIntoDiscrete(next);
98774
98739
  if (!opts?.skipUndo) {
@@ -98788,14 +98753,14 @@ function SlideshowPanel({ scenes, onPersist, onPersistNotes }) {
98788
98753
  },
98789
98754
  [onPersist]
98790
98755
  );
98791
- const handleUndo = useCallback183(() => {
98756
+ const handleUndo = useCallback182(() => {
98792
98757
  const prev = undoStackRef.current.pop();
98793
98758
  if (!prev) return;
98794
98759
  setUndoDepth(undoStackRef.current.length);
98795
98760
  applyManifest(prev, { skipUndo: true }).catch(() => {
98796
98761
  });
98797
98762
  }, [applyManifest]);
98798
- const handleRetryPersist = useCallback183(async () => {
98763
+ const handleRetryPersist = useCallback182(async () => {
98799
98764
  setRetrying(true);
98800
98765
  try {
98801
98766
  await onPersist(manifestRef.current);
@@ -98806,7 +98771,7 @@ function SlideshowPanel({ scenes, onPersist, onPersistNotes }) {
98806
98771
  setRetrying(false);
98807
98772
  }
98808
98773
  }, [onPersist]);
98809
- const applyNotesManifest = useCallback183(
98774
+ const applyNotesManifest = useCallback182(
98810
98775
  (next) => {
98811
98776
  setManifest(next);
98812
98777
  manifestRef.current = next;
@@ -98820,7 +98785,7 @@ function SlideshowPanel({ scenes, onPersist, onPersistNotes }) {
98820
98785
  ctrl.flush();
98821
98786
  };
98822
98787
  }, []);
98823
- const toggleSection = useCallback183((key2) => {
98788
+ const toggleSection = useCallback182((key2) => {
98824
98789
  setExpandedSections((prev) => {
98825
98790
  const next = new Set(prev);
98826
98791
  if (next.has(key2)) {
@@ -98834,25 +98799,25 @@ function SlideshowPanel({ scenes, onPersist, onPersistNotes }) {
98834
98799
  const activeSlides = selectedSequenceId ? (manifest.slideSequences ?? []).find((s) => s.id === selectedSequenceId)?.slides ?? [] : manifest.slides;
98835
98800
  const selectedSlide = activeSlides.find((s) => s.sceneId === selectedSceneId);
98836
98801
  const sequences = manifest.slideSequences ?? [];
98837
- const handleSelectBranchSlide = useCallback183((sequenceId, sceneId) => {
98802
+ const handleSelectBranchSlide = useCallback182((sequenceId, sceneId) => {
98838
98803
  setSelectedSceneId(sceneId);
98839
98804
  setSelectedSequenceId(sequenceId);
98840
98805
  }, []);
98841
- const handleToggleSlide = useCallback183(
98806
+ const handleToggleSlide = useCallback182(
98842
98807
  (sceneId) => {
98843
98808
  applyManifest(toggleMainLineSlide(manifestRef.current, sceneId)).catch(() => {
98844
98809
  });
98845
98810
  },
98846
98811
  [applyManifest]
98847
98812
  );
98848
- const handleReorder = useCallback183(
98813
+ const handleReorder = useCallback182(
98849
98814
  (sceneId, dir) => {
98850
98815
  applyManifest(reorderMainLineSlide(manifestRef.current, sceneId, dir)).catch(() => {
98851
98816
  });
98852
98817
  },
98853
98818
  [applyManifest]
98854
98819
  );
98855
- const handleSetNotes = useCallback183(
98820
+ const handleSetNotes = useCallback182(
98856
98821
  (notes) => {
98857
98822
  if (!selectedSceneId) return;
98858
98823
  applyNotesManifest(
@@ -98861,7 +98826,7 @@ function SlideshowPanel({ scenes, onPersist, onPersistNotes }) {
98861
98826
  },
98862
98827
  [selectedSceneId, selectedSequenceId, applyNotesManifest]
98863
98828
  );
98864
- const handleMarkFragment = useCallback183(() => {
98829
+ const handleMarkFragment = useCallback182(() => {
98865
98830
  if (!selectedSceneId) return;
98866
98831
  applyManifest(
98867
98832
  addFragment(
@@ -98873,7 +98838,7 @@ function SlideshowPanel({ scenes, onPersist, onPersistNotes }) {
98873
98838
  ).catch(() => {
98874
98839
  });
98875
98840
  }, [selectedSceneId, selectedSequenceId, currentTime, applyManifest]);
98876
- const handleRemoveFragment = useCallback183(
98841
+ const handleRemoveFragment = useCallback182(
98877
98842
  (time) => {
98878
98843
  if (!selectedSceneId) return;
98879
98844
  applyManifest(
@@ -98883,7 +98848,7 @@ function SlideshowPanel({ scenes, onPersist, onPersistNotes }) {
98883
98848
  },
98884
98849
  [selectedSceneId, selectedSequenceId, applyManifest]
98885
98850
  );
98886
- const handleCreateSequence = useCallback183(
98851
+ const handleCreateSequence = useCallback182(
98887
98852
  (label) => {
98888
98853
  const id = `seq-${generateId()}`;
98889
98854
  applyManifest(createSequence(manifestRef.current, id, label)).catch(() => {
@@ -98891,21 +98856,21 @@ function SlideshowPanel({ scenes, onPersist, onPersistNotes }) {
98891
98856
  },
98892
98857
  [applyManifest]
98893
98858
  );
98894
- const handleRenameSequence = useCallback183(
98859
+ const handleRenameSequence = useCallback182(
98895
98860
  (id, label) => {
98896
98861
  applyManifest(renameSequence(manifestRef.current, id, label)).catch(() => {
98897
98862
  });
98898
98863
  },
98899
98864
  [applyManifest]
98900
98865
  );
98901
- const handleDeleteSequence = useCallback183(
98866
+ const handleDeleteSequence = useCallback182(
98902
98867
  (id) => {
98903
98868
  applyManifest(deleteSequence(manifestRef.current, id)).catch(() => {
98904
98869
  });
98905
98870
  },
98906
98871
  [applyManifest]
98907
98872
  );
98908
- const handleAssign = useCallback183(
98873
+ const handleAssign = useCallback182(
98909
98874
  (sequenceId, sceneId, assign) => {
98910
98875
  applyManifest(assignToBranch(manifestRef.current, sequenceId, sceneId, assign)).catch(
98911
98876
  () => {
@@ -98914,7 +98879,7 @@ function SlideshowPanel({ scenes, onPersist, onPersistNotes }) {
98914
98879
  },
98915
98880
  [applyManifest]
98916
98881
  );
98917
- const handleAddHotspot = useCallback183(
98882
+ const handleAddHotspot = useCallback182(
98918
98883
  (sceneId, hotspot) => {
98919
98884
  applyManifest(
98920
98885
  addHotspot(manifestRef.current, sceneId, hotspot, selectedSequenceId ?? void 0)
@@ -98923,7 +98888,7 @@ function SlideshowPanel({ scenes, onPersist, onPersistNotes }) {
98923
98888
  },
98924
98889
  [selectedSequenceId, applyManifest]
98925
98890
  );
98926
- const handleRemoveHotspot = useCallback183(
98891
+ const handleRemoveHotspot = useCallback182(
98927
98892
  (sceneId, hotspotId) => {
98928
98893
  applyManifest(
98929
98894
  removeHotspot(manifestRef.current, sceneId, hotspotId, selectedSequenceId ?? void 0)
@@ -99073,10 +99038,10 @@ function SlideshowPanel({ scenes, onPersist, onPersistNotes }) {
99073
99038
  }
99074
99039
 
99075
99040
  // src/components/panels/VariablesPanel.tsx
99076
- import { memo as memo60, useCallback as useCallback187, useEffect as useEffect158, useMemo as useMemo87, useState as useState163 } from "react";
99041
+ import { memo as memo60, useCallback as useCallback186, useEffect as useEffect158, useMemo as useMemo87, useState as useState163 } from "react";
99077
99042
 
99078
99043
  // src/hooks/useVariablesPersist.ts
99079
- import { useCallback as useCallback184 } from "react";
99044
+ import { useCallback as useCallback183 } from "react";
99080
99045
  function useVariablesPersist({
99081
99046
  sdkSession,
99082
99047
  activeCompPath,
@@ -99086,7 +99051,7 @@ function useVariablesPersist({
99086
99051
  reloadPreview,
99087
99052
  publishSdkSession
99088
99053
  }) {
99089
- return useCallback184(
99054
+ return useCallback183(
99090
99055
  async (label, mutate) => {
99091
99056
  if (!sdkSession) return false;
99092
99057
  const path = activeCompPath ?? "index.html";
@@ -99121,10 +99086,10 @@ function useVariablesPersist({
99121
99086
  }
99122
99087
 
99123
99088
  // src/components/panels/VariablesOtherCompositions.tsx
99124
- import { useCallback as useCallback186, useState as useState162 } from "react";
99089
+ import { useCallback as useCallback185, useState as useState162 } from "react";
99125
99090
 
99126
99091
  // src/hooks/useProjectCompositionVariables.ts
99127
- import { useCallback as useCallback185, useEffect as useEffect157, useState as useState160 } from "react";
99092
+ import { useCallback as useCallback184, useEffect as useEffect157, useState as useState160 } from "react";
99128
99093
  import { openComposition as openComposition4 } from "@hyperframes/sdk";
99129
99094
  async function readGroup(path, readProjectFile) {
99130
99095
  let content;
@@ -99167,7 +99132,7 @@ function useProjectCompositionVariables(compositionPaths, excludePath, readProje
99167
99132
  }
99168
99133
  function useEditVariablesInFile(deps) {
99169
99134
  const { readProjectFile, writeProjectFile, recordEdit, reloadPreview } = deps;
99170
- return useCallback185(
99135
+ return useCallback184(
99171
99136
  async (path, label, mutate) => {
99172
99137
  const originalContent = await readProjectFile(path);
99173
99138
  await persistSdkSerialize(
@@ -99561,7 +99526,7 @@ function VariablesOtherCompositions({
99561
99526
  reloadPreview
99562
99527
  });
99563
99528
  const [editingKey, setEditingKey] = useState162(null);
99564
- const onSave = useCallback186(
99529
+ const onSave = useCallback185(
99565
99530
  (path, decl) => {
99566
99531
  setEditingKey(null);
99567
99532
  void editInFile(
@@ -99572,7 +99537,7 @@ function VariablesOtherCompositions({
99572
99537
  },
99573
99538
  [editInFile]
99574
99539
  );
99575
- const onRemove = useCallback186(
99540
+ const onRemove = useCallback185(
99576
99541
  (path, id) => {
99577
99542
  void editInFile(
99578
99543
  path,
@@ -99806,7 +99771,7 @@ var VariablesPanel = memo60(function VariablesPanel2({
99806
99771
  // eslint-disable-next-line react-hooks/exhaustive-deps
99807
99772
  [sdkSession, previewValues, refreshKey, revision]
99808
99773
  );
99809
- const copyToClipboard = useCallback187(
99774
+ const copyToClipboard = useCallback186(
99810
99775
  (text2, what) => {
99811
99776
  void copyTextToClipboard(text2).then(
99812
99777
  (ok) => showToast(
@@ -99817,7 +99782,7 @@ var VariablesPanel = memo60(function VariablesPanel2({
99817
99782
  },
99818
99783
  [showToast]
99819
99784
  );
99820
- const dropPreviewOverride = useCallback187(
99785
+ const dropPreviewOverride = useCallback186(
99821
99786
  (id) => {
99822
99787
  if (previewValues && id in previewValues) {
99823
99788
  const next = { ...previewValues };
@@ -99827,7 +99792,7 @@ var VariablesPanel = memo60(function VariablesPanel2({
99827
99792
  },
99828
99793
  [previewValues, setPreviewValues]
99829
99794
  );
99830
- const commitPreviewValue = useCallback187(
99795
+ const commitPreviewValue = useCallback186(
99831
99796
  (id, value, declDefault) => {
99832
99797
  const next = { ...previewValues ?? {} };
99833
99798
  if (JSON.stringify(value) === JSON.stringify(declDefault)) {
@@ -99840,7 +99805,7 @@ var VariablesPanel = memo60(function VariablesPanel2({
99840
99805
  },
99841
99806
  [previewValues, setPreviewValues, reloadPreview]
99842
99807
  );
99843
- const runSchemaEdit = useCallback187(
99808
+ const runSchemaEdit = useCallback186(
99844
99809
  async (label, mutate) => {
99845
99810
  try {
99846
99811
  const changed = await persistVariables(label, mutate);
@@ -99854,7 +99819,7 @@ var VariablesPanel = memo60(function VariablesPanel2({
99854
99819
  },
99855
99820
  [persistVariables, showToast]
99856
99821
  );
99857
- const handleAdd = useCallback187(
99822
+ const handleAdd = useCallback186(
99858
99823
  (decl) => {
99859
99824
  if (!sdkSession) return;
99860
99825
  const check = sdkSession.can({ type: "declareVariable", declaration: decl });
@@ -99867,7 +99832,7 @@ var VariablesPanel = memo60(function VariablesPanel2({
99867
99832
  },
99868
99833
  [sdkSession, runSchemaEdit, showToast]
99869
99834
  );
99870
- const handleUpdate = useCallback187(
99835
+ const handleUpdate = useCallback186(
99871
99836
  (decl) => {
99872
99837
  if (!sdkSession) return;
99873
99838
  const check = sdkSession.can({
@@ -99887,7 +99852,7 @@ var VariablesPanel = memo60(function VariablesPanel2({
99887
99852
  },
99888
99853
  [sdkSession, runSchemaEdit, showToast]
99889
99854
  );
99890
- const handleRemove = useCallback187(
99855
+ const handleRemove = useCallback186(
99891
99856
  (id) => {
99892
99857
  if (!sdkSession) return;
99893
99858
  const check = sdkSession.can({ type: "removeVariableDeclaration", id });
@@ -99903,18 +99868,18 @@ var VariablesPanel = memo60(function VariablesPanel2({
99903
99868
  },
99904
99869
  [sdkSession, runSchemaEdit, dropPreviewOverride, showToast]
99905
99870
  );
99906
- const handleSetDefault = useCallback187(
99871
+ const handleSetDefault = useCallback186(
99907
99872
  (id, value) => {
99908
99873
  void runSchemaEdit(`Set default for "${id}"`, (s) => s.setVariableValue(id, value));
99909
99874
  dropPreviewOverride(id);
99910
99875
  },
99911
99876
  [runSchemaEdit, dropPreviewOverride]
99912
99877
  );
99913
- const resetPreview = useCallback187(() => {
99878
+ const resetPreview = useCallback186(() => {
99914
99879
  setPreviewValues(null);
99915
99880
  reloadPreview();
99916
99881
  }, [setPreviewValues, reloadPreview]);
99917
- const handleBind = useCallback187(
99882
+ const handleBind = useCallback186(
99918
99883
  // Guard chain (session, selection, type-compat) — one branch per guard.
99919
99884
  // fallow-ignore-next-line complexity
99920
99885
  (action, id) => {
@@ -100026,7 +99991,7 @@ var VariablesPanel = memo60(function VariablesPanel2({
100026
99991
  });
100027
99992
 
100028
99993
  // src/components/panels/MotionBlurPanel.tsx
100029
- import { memo as memo61, useCallback as useCallback188, useEffect as useEffect159, useMemo as useMemo88, useReducer as useReducer2, useRef as useRef189, useState as useState164 } from "react";
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";
100030
99995
 
100031
99996
  // src/components/panels/motionBlurPanelModel.ts
100032
99997
  import {
@@ -100107,7 +100072,7 @@ function useLivePreviewAttributes(previewIframeRef, refreshKey) {
100107
100072
  const timer = setInterval(read2, POLL_MS2);
100108
100073
  return () => clearInterval(timer);
100109
100074
  }, [previewIframeRef, refreshKey]);
100110
- const hold = useCallback188((next) => {
100075
+ const hold = useCallback187((next) => {
100111
100076
  holdUntil.current = Date.now() + SETTLE_MS;
100112
100077
  setLive(next);
100113
100078
  }, []);
@@ -100138,7 +100103,7 @@ var MotionBlurPanel = memo61(function MotionBlurPanel2({
100138
100103
  reloadPreview,
100139
100104
  publishSdkSession
100140
100105
  });
100141
- const apply = useCallback188(
100106
+ const apply = useCallback187(
100142
100107
  async (patch) => {
100143
100108
  if (!attributes) return;
100144
100109
  let applied = [];
@@ -100193,7 +100158,7 @@ var MotionBlurPanel = memo61(function MotionBlurPanel2({
100193
100158
  });
100194
100159
 
100195
100160
  // src/hooks/useSlideshowPersist.ts
100196
- import { useCallback as useCallback189 } from "react";
100161
+ import { useCallback as useCallback188 } from "react";
100197
100162
 
100198
100163
  // src/utils/setSlideshowManifest.ts
100199
100164
  import {
@@ -100250,7 +100215,7 @@ function useSlideshowPersist({
100250
100215
  publishSdkSession,
100251
100216
  coalesceKey
100252
100217
  }) {
100253
- return useCallback189(
100218
+ return useCallback188(
100254
100219
  async (manifest) => {
100255
100220
  if (!sdkSession) return;
100256
100221
  const path = activeCompPath ?? "index.html";
@@ -100308,7 +100273,7 @@ function useSlideshowTabState(params) {
100308
100273
  }
100309
100274
 
100310
100275
  // src/components/DesignPanelPromoteProvider.tsx
100311
- import { useCallback as useCallback190 } from "react";
100276
+ import { useCallback as useCallback189 } from "react";
100312
100277
  import { jsx as jsx252 } from "react/jsx-runtime";
100313
100278
  function DesignPanelPromoteProvider({
100314
100279
  selection,
@@ -100327,7 +100292,7 @@ function DesignPanelPromoteProvider({
100327
100292
  publishSdkSession: handle.publish,
100328
100293
  activeCompPath: targetPath
100329
100294
  });
100330
- const persist2 = useCallback190(
100295
+ const persist2 = useCallback189(
100331
100296
  async (label, mutate) => {
100332
100297
  const committed = await rawPersist(label, mutate);
100333
100298
  if (committed) forceReloadSharedSdkSession?.();
@@ -100335,7 +100300,7 @@ function DesignPanelPromoteProvider({
100335
100300
  },
100336
100301
  [rawPersist, forceReloadSharedSdkSession]
100337
100302
  );
100338
- const handlePersistError = useCallback190(
100303
+ const handlePersistError = useCallback189(
100339
100304
  (error) => showToast(getStudioSaveErrorMessage(error), "error"),
100340
100305
  [showToast]
100341
100306
  );
@@ -100352,7 +100317,7 @@ function DesignPanelPromoteProvider({
100352
100317
  }
100353
100318
 
100354
100319
  // src/hooks/useRemoveBackground.ts
100355
- import { useCallback as useCallback191, useEffect as useEffect160, useRef as useRef190 } from "react";
100320
+ import { useCallback as useCallback190, useEffect as useEffect160, useRef as useRef190 } from "react";
100356
100321
 
100357
100322
  // src/components/studioMediaJobs.ts
100358
100323
  var MEDIA_JOB_RECONNECT_TIMEOUT_MS = 15e3;
@@ -100465,7 +100430,7 @@ function useRemoveBackground(projectId, refreshFileTree, showToast) {
100465
100430
  },
100466
100431
  []
100467
100432
  );
100468
- return useCallback191(
100433
+ return useCallback190(
100469
100434
  // fallow-ignore-next-line complexity
100470
100435
  async (inputPath, options) => {
100471
100436
  const response = await studioApiFetch(
@@ -100504,7 +100469,7 @@ function useRemoveBackground(projectId, refreshFileTree, showToast) {
100504
100469
  }
100505
100470
 
100506
100471
  // src/hooks/useApplyColorGradingScope.ts
100507
- import { useCallback as useCallback192 } from "react";
100472
+ import { useCallback as useCallback191 } from "react";
100508
100473
 
100509
100474
  // src/components/editor/colorGradingScopePatch.ts
100510
100475
  var MEDIA_TAG_RE = /<\s*(video|img)\b(?:[^>"']|"[^"]*"|'[^']*')*>/gi;
@@ -100608,7 +100573,7 @@ function useApplyColorGradingScope(recordEdit, reloadPreview) {
100608
100573
  const { projectId, activeCompPath, showToast, waitForPendingDomEditSaves } = useStudioShellContext();
100609
100574
  const { domEditSelection } = useDomEditContext();
100610
100575
  const { readProjectFile, writeProjectFile, compositions } = useFileManagerContext();
100611
- return useCallback192(
100576
+ return useCallback191(
100612
100577
  async (scope, value) => applyColorGradingScopeUpdate({
100613
100578
  scope,
100614
100579
  value,
@@ -100756,11 +100721,11 @@ var StudioRightPanels = memo62(function StudioRightPanels2({
100756
100721
  useCaptionDesignFocus(captionEditMode);
100757
100722
  const handleApplyColorGradingScope = useApplyColorGradingScope(recordEdit, reloadPreview);
100758
100723
  const handleRemoveBackground = useRemoveBackground(projectId, refreshFileTree, showToast);
100759
- const setAttributeWhileDragging = useCallback193(
100724
+ const setAttributeWhileDragging = useCallback192(
100760
100725
  (attr, value) => handleDomAttributeLiveCommit(attr, value, void 0, { previewOnly: true }),
100761
100726
  [handleDomAttributeLiveCommit]
100762
100727
  );
100763
- const handleHideAllSelected = useCallback193(() => {
100728
+ const handleHideAllSelected = useCallback192(() => {
100764
100729
  if (!canHideSelections(domEditGroupSelections)) {
100765
100730
  showToast("Audio can't be hidden. Use the group's own controls", "info");
100766
100731
  return;
@@ -100769,7 +100734,7 @@ var StudioRightPanels = memo62(function StudioRightPanels2({
100769
100734
  const keys = timelineKeysForSelections(domEditGroupSelections, elements, activeCompPath);
100770
100735
  if (keys.length > 0) void onToggleElementHidden?.(keys, true);
100771
100736
  }, [domEditGroupSelections, showToast, activeCompPath, onToggleElementHidden]);
100772
- const convertToKeyframes = useCallback193(
100737
+ const convertToKeyframes = useCallback192(
100773
100738
  (animId, duration) => handleGsapConvertToKeyframes(animId, void 0, duration),
100774
100739
  [handleGsapConvertToKeyframes]
100775
100740
  );
@@ -100936,9 +100901,9 @@ import {
100936
100901
  } from "@phosphor-icons/react";
100937
100902
 
100938
100903
  // src/hooks/useKeyframeKeyboard.ts
100939
- import { useEffect as useEffect161, useCallback as useCallback194 } from "react";
100904
+ import { useEffect as useEffect161, useCallback as useCallback193 } from "react";
100940
100905
  function useKeyframeKeyboard({ enabled, onAddKeyframe }) {
100941
- const handler = useCallback194(
100906
+ const handler = useCallback193(
100942
100907
  (e) => {
100943
100908
  if (!enabled || !onAddKeyframe) return;
100944
100909
  if (isTypingTarget(document.activeElement)) return;
@@ -101125,7 +101090,7 @@ function TimelineToolPicker({ showSelectAroundPlayhead = true }) {
101125
101090
  }
101126
101091
 
101127
101092
  // src/components/LinkedSelectionToggle.tsx
101128
- import { useCallback as useCallback195, useState as useState165 } from "react";
101093
+ import { useCallback as useCallback194, useState as useState165 } from "react";
101129
101094
  import { createPortal as createPortal16 } from "react-dom";
101130
101095
  import { LinkSimple } from "@phosphor-icons/react";
101131
101096
  import { Fragment as Fragment70, jsx as jsx259, jsxs as jsxs205 } from "react/jsx-runtime";
@@ -101169,7 +101134,7 @@ function LinkedSelectionToggle() {
101169
101134
  const linkedSelection = useLinkedClipPreferences((s) => s.linkedSelection);
101170
101135
  const setLinkedSelection = useLinkedClipPreferences((s) => s.setLinkedSelection);
101171
101136
  const [menuAt, setMenuAt] = useState165(null);
101172
- const closeMenu = useCallback195(() => setMenuAt(null), []);
101137
+ const closeMenu = useCallback194(() => setMenuAt(null), []);
101173
101138
  return /* @__PURE__ */ jsxs205(Fragment70, { children: [
101174
101139
  /* @__PURE__ */ jsx259(
101175
101140
  Tooltip,
@@ -101720,13 +101685,13 @@ function useStudioSessionStart(projectId, resolving, waitingForServer) {
101720
101685
  }
101721
101686
 
101722
101687
  // src/hooks/useTimelineAddAtPlayhead.ts
101723
- import { useCallback as useCallback196 } from "react";
101688
+ import { useCallback as useCallback195 } from "react";
101724
101689
  function useTimelineAddAtPlayhead(addAsset, addComposition, projectId) {
101725
101690
  const placement = () => ({ start: usePlayerStore.getState().currentTime, track: 0 });
101726
101691
  return useStableHandlers(
101727
101692
  {
101728
- addAssetAtPlayhead: useCallback196((path) => addAsset(path, placement()), [addAsset]),
101729
- addCompositionAtPlayhead: useCallback196(
101693
+ addAssetAtPlayhead: useCallback195((path) => addAsset(path, placement()), [addAsset]),
101694
+ addCompositionAtPlayhead: useCallback195(
101730
101695
  (path) => addComposition(path, placement()),
101731
101696
  [addComposition]
101732
101697
  )
@@ -101784,14 +101749,14 @@ function useAutoOpenRootComposition({
101784
101749
  }
101785
101750
 
101786
101751
  // src/hooks/useCompositionContentLoader.ts
101787
- import { useCallback as useCallback197 } from "react";
101752
+ import { useCallback as useCallback196 } from "react";
101788
101753
  function useCompositionContentLoader({
101789
101754
  projectId,
101790
101755
  setEditingFile,
101791
101756
  setActiveCompPath,
101792
101757
  showToast
101793
101758
  }) {
101794
- return useCallback197(
101759
+ return useCallback196(
101795
101760
  (comp) => {
101796
101761
  if (!projectId) return;
101797
101762
  setActiveCompPath(comp.endsWith(".html") ? comp : null);
@@ -101909,11 +101874,11 @@ function StudioApp({ readOnlyPreview = false, readOnlyPreviewReason } = {}) {
101909
101874
  const handleDomZIndexReorderCommitRef = useRef194(null);
101910
101875
  const pendingTimelineEditPathRef = useRef194(/* @__PURE__ */ new Set());
101911
101876
  const isGestureRecordingRef = useRef194(false);
101912
- const setRefreshKey = useCallback198((next) => {
101877
+ const setRefreshKey = useCallback197((next) => {
101913
101878
  requestPreviewReload();
101914
101879
  setRefreshKeyState(next);
101915
101880
  }, []);
101916
- const reloadPreview = useCallback198(() => setRefreshKey((k) => k + 1), [setRefreshKey]);
101881
+ const reloadPreview = useCallback197(() => setRefreshKey((k) => k + 1), [setRefreshKey]);
101917
101882
  const fileManagerResult = useFileManager({
101918
101883
  projectId,
101919
101884
  showToast,
@@ -101967,7 +101932,7 @@ function StudioApp({ readOnlyPreview = false, readOnlyPreviewReason } = {}) {
101967
101932
  });
101968
101933
  const invalidateGsapCacheRef = useRef194(() => {
101969
101934
  });
101970
- const invalidateGsapCache = useCallback198(() => invalidateGsapCacheRef.current(), []);
101935
+ const invalidateGsapCache = useCallback197(() => invalidateGsapCacheRef.current(), []);
101971
101936
  const timelineEditing = useTimelineEditing({
101972
101937
  projectId,
101973
101938
  activeCompPath,
@@ -102023,7 +101988,7 @@ function StudioApp({ readOnlyPreview = false, readOnlyPreviewReason } = {}) {
102023
101988
  handleAddMediaOverlay,
102024
101989
  handlePreviewBlockDrop
102025
101990
  } = useStableHandlers(blockHandlersResult, projectId);
102026
- const dismissBlockParams = useCallback198(() => setActiveBlockParams(null), [setActiveBlockParams]);
101991
+ const dismissBlockParams = useCallback197(() => setActiveBlockParams(null), [setActiveBlockParams]);
102027
101992
  const setRightPanelTab = useDismissingTabSetter(panelLayout.setRightPanelTab, dismissBlockParams);
102028
101993
  const layout = useMemo91(
102029
101994
  () => ({ ...panelLayout, setRightPanelTab }),
@@ -102184,7 +102149,7 @@ function StudioApp({ readOnlyPreview = false, readOnlyPreviewReason } = {}) {
102184
102149
  previewIframe,
102185
102150
  compositionDimensions
102186
102151
  );
102187
- const handlePreviewIframeRef = useCallback198(
102152
+ const handlePreviewIframeRef = useCallback197(
102188
102153
  (iframe) => {
102189
102154
  previewIframeRef.current = iframe;
102190
102155
  usePreviewIframeStore.getState().setIframe(iframe);
@@ -102255,10 +102220,10 @@ function StudioApp({ readOnlyPreview = false, readOnlyPreviewReason } = {}) {
102255
102220
  ),
102256
102221
  [toolbarSession, timelineEditing.handleTimelineElementSplit]
102257
102222
  );
102258
- const handleExport = useCallback198(() => {
102223
+ const handleExport = useCallback197(() => {
102259
102224
  void previewPersistence.waitForPendingDomEditSaves().then(() => renderQueue.startRender(void 0));
102260
102225
  }, [previewPersistence, renderQueue]);
102261
- const clearConsoleErrors = useCallback198(() => setConsoleErrors(null), [setConsoleErrors]);
102226
+ const clearConsoleErrors = useCallback197(() => setConsoleErrors(null), [setConsoleErrors]);
102262
102227
  const panels = useStudioSidePanels(
102263
102228
  {
102264
102229
  onSelectComposition: handleSelectComposition,
@@ -102390,7 +102355,7 @@ function StudioApp({ readOnlyPreview = false, readOnlyPreviewReason } = {}) {
102390
102355
  }
102391
102356
 
102392
102357
  // src/hooks/useElementPicker.ts
102393
- import { useState as useState169, useCallback as useCallback199, useEffect as useEffect167, useRef as useRef195 } from "react";
102358
+ import { useState as useState169, useCallback as useCallback198, useEffect as useEffect167, useRef as useRef195 } from "react";
102394
102359
 
102395
102360
  // src/hooks/elementPickerHoverLabel.ts
102396
102361
  var LABEL_GAP_PX = 6;
@@ -102516,9 +102481,9 @@ function createElementPickerHoverLabel(doc = document) {
102516
102481
  // src/hooks/useElementPicker.ts
102517
102482
  function usePickerHoverLabel() {
102518
102483
  const hoverLabelRef = useRef195(null);
102519
- const clearHover = useCallback199(() => hoverLabelRef.current?.clear(), []);
102520
- const disposeHover = useCallback199(() => hoverLabelRef.current?.dispose(), []);
102521
- const showHover = useCallback199((info, iframe) => {
102484
+ const clearHover = useCallback198(() => hoverLabelRef.current?.clear(), []);
102485
+ const disposeHover = useCallback198(() => hoverLabelRef.current?.dispose(), []);
102486
+ const showHover = useCallback198((info, iframe) => {
102522
102487
  hoverLabelRef.current ??= createElementPickerHoverLabel();
102523
102488
  hoverLabelRef.current.show(info, iframe);
102524
102489
  }, []);
@@ -102528,11 +102493,11 @@ function useActivePickerIframe(iframeRef, isPickModeRef, clearHover) {
102528
102493
  const activeOverrideRef = useRef195(null);
102529
102494
  const activeIframeRef = useRef195(null);
102530
102495
  const lastRenderedActiveIframeRef = useRef195(null);
102531
- const getActiveIframe = useCallback199(
102496
+ const getActiveIframe = useCallback198(
102532
102497
  () => activeOverrideRef.current ?? iframeRef.current,
102533
102498
  [iframeRef]
102534
102499
  );
102535
- const setActiveIframe = useCallback199(
102500
+ const setActiveIframe = useCallback198(
102536
102501
  (el) => {
102537
102502
  const previous = activeOverrideRef.current ?? iframeRef.current;
102538
102503
  const next = el ?? iframeRef.current;
@@ -102574,13 +102539,13 @@ function useElementPickerSession(iframeRef) {
102574
102539
  isPickModeRef,
102575
102540
  clearHover
102576
102541
  );
102577
- const enablePick = useCallback199(() => {
102542
+ const enablePick = useCallback198(() => {
102578
102543
  if (isPickModeRef.current || !postPickerControl(getActiveIframe(), "enable-pick-mode")) return;
102579
102544
  pickStartSelectionRef.current = pickedElementRef.current;
102580
102545
  isPickModeRef.current = true;
102581
102546
  setIsPickMode(true);
102582
102547
  }, [getActiveIframe]);
102583
- const cancelPick = useCallback199(
102548
+ const cancelPick = useCallback198(
102584
102549
  (notifyRuntime) => {
102585
102550
  if (notifyRuntime) {
102586
102551
  postPickerControl(getActiveIframe(), "disable-pick-mode");
@@ -102597,8 +102562,8 @@ function useElementPickerSession(iframeRef) {
102597
102562
  },
102598
102563
  [clearHover, getActiveIframe]
102599
102564
  );
102600
- const disablePick = useCallback199(() => cancelPick(true), [cancelPick]);
102601
- const clearPick = useCallback199(() => {
102565
+ const disablePick = useCallback198(() => cancelPick(true), [cancelPick]);
102566
+ const clearPick = useCallback198(() => {
102602
102567
  pickedElementRef.current = null;
102603
102568
  setPickedElement(null);
102604
102569
  }, []);
@@ -102689,7 +102654,7 @@ function useElementPicker(iframeRef, options) {
102689
102654
  optionsRef.current = options;
102690
102655
  const pendingWritesRef = useRef195(/* @__PURE__ */ new Map());
102691
102656
  settlePendingWrites(pendingWritesRef.current, options?.workspaceFiles);
102692
- const syncToSource = useCallback199(
102657
+ const syncToSource = useCallback198(
102693
102658
  (picked, live, iframe, op) => {
102694
102659
  const opts = optionsRef.current;
102695
102660
  if (!opts?.workspaceFiles || !opts.onSyncFiles) return;
@@ -102703,7 +102668,7 @@ function useElementPicker(iframeRef, options) {
102703
102668
  },
102704
102669
  []
102705
102670
  );
102706
- const setStyle = useCallback199(
102671
+ const setStyle = useCallback198(
102707
102672
  (prop, value) => {
102708
102673
  const activeIframe = getActiveIframe();
102709
102674
  if (!pickedElement?.selector || !activeIframe) return;
@@ -102729,7 +102694,7 @@ function useElementPicker(iframeRef, options) {
102729
102694
  },
102730
102695
  [pickedElement, getActiveIframe, setPickedElement, syncToSource]
102731
102696
  );
102732
- const setDataAttr = useCallback199(
102697
+ const setDataAttr = useCallback198(
102733
102698
  (attr, value) => {
102734
102699
  const activeIframe = getActiveIframe();
102735
102700
  if (!pickedElement?.selector || !activeIframe) return;
@@ -102755,7 +102720,7 @@ function useElementPicker(iframeRef, options) {
102755
102720
  },
102756
102721
  [pickedElement, getActiveIframe, setPickedElement, syncToSource]
102757
102722
  );
102758
- const setTextContent = useCallback199(
102723
+ const setTextContent = useCallback198(
102759
102724
  (text2) => {
102760
102725
  const activeIframe = getActiveIframe();
102761
102726
  if (!pickedElement?.selector || !activeIframe) return;
@@ -103033,7 +102998,7 @@ function findElementBlock(html2, elementId2) {
103033
102998
  }
103034
102999
 
103035
103000
  // src/hooks/useDomStyleCommit.ts
103036
- import { useCallback as useCallback200, useMemo as useMemo92, useRef as useRef196, useState as useState170 } from "react";
103001
+ import { useCallback as useCallback199, useMemo as useMemo92, useRef as useRef196, useState as useState170 } from "react";
103037
103002
  var noop = () => {
103038
103003
  };
103039
103004
  function useDomStyleCommit({
@@ -103060,7 +103025,7 @@ function useDomStyleCommit({
103060
103025
  projectIdRef,
103061
103026
  reloadPreview: noop
103062
103027
  });
103063
- const commitStyle = useCallback200(
103028
+ const commitStyle = useCallback199(
103064
103029
  (selection, styles) => {
103065
103030
  queue2.reset();
103066
103031
  return projectIdRef.current ? commitDomStyles(
@@ -103081,7 +103046,7 @@ function useDomStyleCommit({
103081
103046
  }
103082
103047
 
103083
103048
  // src/hooks/useDomGeometryCommit.ts
103084
- import { useCallback as useCallback201, useMemo as useMemo93, useRef as useRef197, useState as useState171 } from "react";
103049
+ import { useCallback as useCallback200, useMemo as useMemo93, useRef as useRef197, useState as useState171 } from "react";
103085
103050
  var noop2 = () => {
103086
103051
  };
103087
103052
  var NO_SELECTED_ANIMATIONS = [];
@@ -103126,7 +103091,7 @@ function useDomGeometryCommit({
103126
103091
  persistDomEditOperations,
103127
103092
  showToast
103128
103093
  });
103129
- const commitWithFreshQueue = useCallback201(
103094
+ const commitWithFreshQueue = useCallback200(
103130
103095
  (...args) => {
103131
103096
  queue2.reset();
103132
103097
  return commitPositionPatchToHtml(...args);
@@ -103165,7 +103130,7 @@ function useDomGeometryCommit({
103165
103130
  setArcPath: gsap3.setArcPath,
103166
103131
  updateArcSegment: gsap3.updateArcSegment
103167
103132
  });
103168
- const saved2 = useCallback201(
103133
+ const saved2 = useCallback200(
103169
103134
  async (commit2, restore2 = noop2) => {
103170
103135
  const refusal2 = !projectIdRef.current ? "No project is open" : !isPreviewBooted(projectIdRef.current) ? "The preview for this project has not loaded yet" : null;
103171
103136
  if (refusal2) {