@remotion/studio 4.0.487 → 4.0.488

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.
@@ -6142,6 +6142,10 @@ import {
6142
6142
  Internals as Internals19
6143
6143
  } from "remotion";
6144
6144
 
6145
+ // src/helpers/interactivity-enabled.ts
6146
+ var interactivityEnabled = process.env.INTERACTIVITY_ENABLED;
6147
+ var studioInteractivityEnabled = interactivityEnabled === undefined || interactivityEnabled === null ? true : interactivityEnabled !== false && interactivityEnabled !== "false";
6148
+
6145
6149
  // src/components/ExpandedTracksProvider.tsx
6146
6150
  import { createContext as createContext13, useCallback as useCallback24, useMemo as useMemo24, useState as useState20 } from "react";
6147
6151
 
@@ -9539,7 +9543,7 @@ var TimelineSelectionProvider = ({ children }) => {
9539
9543
  const { canvasContent } = useContext18(Internals19.CompositionManager);
9540
9544
  const timelineSelectionScope = canvasContent?.type === "composition" ? canvasContent.compositionId : null;
9541
9545
  const { expandParentTracks } = useContext18(ExpandedTracksSetterContext);
9542
- const canSelect = previewServerState.type === "connected" && !window.remotion_isReadOnlyStudio;
9546
+ const canSelect = studioInteractivityEnabled && previewServerState.type === "connected" && !window.remotion_isReadOnlyStudio;
9543
9547
  const [selectedItems, setSelectedItems] = useState21([]);
9544
9548
  const selectionAnchor = useRef16(null);
9545
9549
  const selectionScope = useRef16(null);
@@ -13951,12 +13955,12 @@ var ErrorLoader = ({
13951
13955
  // src/components/Canvas.tsx
13952
13956
  import {
13953
13957
  ASSET_DRAG_MIME_TYPE as ASSET_DRAG_MIME_TYPE2,
13954
- COMPOSITION_DRAG_MIME_TYPE as COMPOSITION_DRAG_MIME_TYPE4,
13955
13958
  COMPONENT_DRAG_MIME_TYPE as COMPONENT_DRAG_MIME_TYPE2,
13959
+ COMPOSITION_DRAG_MIME_TYPE as COMPOSITION_DRAG_MIME_TYPE4,
13956
13960
  ELEMENT_DRAG_MIME_TYPE as ELEMENT_DRAG_MIME_TYPE3,
13957
13961
  parseAssetDragData,
13958
- parseCompositionDragData as parseCompositionDragData3,
13959
13962
  parseComponentDragData,
13963
+ parseCompositionDragData as parseCompositionDragData3,
13960
13964
  parseSfxDragData,
13961
13965
  SFX_DRAG_MIME_TYPE as SFX_DRAG_MIME_TYPE2
13962
13966
  } from "@remotion/studio-shared";
@@ -23436,7 +23440,7 @@ var SelectedOutlineOverlay = ({
23436
23440
  selectItem(item, interaction, undefined, { reveal: true });
23437
23441
  }, [selectItem]);
23438
23442
  const outlineTargets = useMemo56(() => {
23439
- if (!editorShowOutlines) {
23443
+ if (!studioInteractivityEnabled || !editorShowOutlines) {
23440
23444
  return [];
23441
23445
  }
23442
23446
  const selectedSequenceKeys = getSelectedSequenceKeys(selectedItems);
@@ -24246,6 +24250,31 @@ var ResetZoomButton = ({ onClick }) => {
24246
24250
 
24247
24251
  // src/components/Canvas.tsx
24248
24252
  import { jsx as jsx94, jsxs as jsxs43, Fragment as Fragment19 } from "react/jsx-runtime";
24253
+ var elementInstallCompositionIdStyle = {
24254
+ fontFamily: "monospace",
24255
+ fontSize: 13
24256
+ };
24257
+ var elementInstallCodeDetailsStyle = {
24258
+ marginTop: 12,
24259
+ fontSize: 13
24260
+ };
24261
+ var elementInstallCodeSummaryStyle = {
24262
+ cursor: "pointer",
24263
+ fontSize: 13,
24264
+ fontWeight: 500
24265
+ };
24266
+ var elementInstallCodeBlockStyle = {
24267
+ marginTop: 8,
24268
+ marginBottom: 0,
24269
+ maxHeight: 240,
24270
+ overflow: "auto",
24271
+ padding: 12,
24272
+ borderRadius: 6,
24273
+ backgroundColor: "rgba(255, 255, 255, 0.06)",
24274
+ fontSize: 12,
24275
+ lineHeight: 1.5,
24276
+ whiteSpace: "pre"
24277
+ };
24249
24278
  var getContainerStyle = (editorZoomGestures) => ({
24250
24279
  flex: 1,
24251
24280
  display: "flex",
@@ -24380,12 +24409,18 @@ var Canvas = ({ canvasContent, size: size2 }) => {
24380
24409
  const suppressWheelFromWebKitPinchRef = useRef32(false);
24381
24410
  const touchPinchRef = useRef32(null);
24382
24411
  const keybindings = useKeybinding();
24412
+ const confirm = useConfirmationDialog();
24383
24413
  const config = Internals40.useUnsafeVideoConfig();
24384
24414
  const areRulersVisible = useIsRulerVisible();
24385
24415
  const { editorShowGuides } = useContext38(EditorShowGuidesContext);
24386
24416
  const { compositions } = useContext38(Internals40.CompositionManager);
24387
- const { previewServerState } = useContext38(StudioServerConnectionCtx);
24417
+ const { previewServerState, subscribeToEvent } = useContext38(StudioServerConnectionCtx);
24418
+ const previewServerClientId = previewServerState.type === "connected" ? previewServerState.clientId : null;
24388
24419
  const [isAddingAsset, setIsAddingAsset] = useState42(false);
24420
+ const [installingElementName, setInstallingElementName] = useState42(null);
24421
+ const [pendingElementInstallRequests, setPendingElementInstallRequests] = useState42([]);
24422
+ const [activeElementInstallRequest, setActiveElementInstallRequest] = useState42(null);
24423
+ const lastFocusedAtRef = useRef32(typeof document === "undefined" || document.hasFocus() ? Date.now() : null);
24389
24424
  const [assetResolution, setAssetResolution] = useState42(null);
24390
24425
  const currentCompositionId = canvasContent.type === "composition" ? canvasContent.compositionId : null;
24391
24426
  const currentComposition = useMemo58(() => {
@@ -24400,7 +24435,8 @@ var Canvas = ({ canvasContent, size: size2 }) => {
24400
24435
  compositionFile,
24401
24436
  compositionId: currentCompositionId
24402
24437
  });
24403
- const canDropAssets = previewServerState.type === "connected" && !window.remotion_isReadOnlyStudio && compositionComponentInfo?.canAddSequence === true && currentCompositionId !== null && compositionFile !== null && !isAddingAsset;
24438
+ const canInstallElements = previewServerClientId !== null && !window.remotion_isReadOnlyStudio && compositionComponentInfo?.canAddSequence === true && currentCompositionId !== null && compositionFile !== null;
24439
+ const canDropAssets = canInstallElements && !isAddingAsset;
24404
24440
  const contentDimensions = useMemo58(() => {
24405
24441
  if ((canvasContent.type === "asset" || canvasContent.type === "output" || canvasContent.type === "output-blob") && assetResolution && assetResolution.type === "found") {
24406
24442
  return assetResolution.dimensions;
@@ -24756,6 +24792,145 @@ var Canvas = ({ canvasContent, size: size2 }) => {
24756
24792
  useEffect42(() => {
24757
24793
  fetchMetadata();
24758
24794
  }, [fetchMetadata]);
24795
+ const updateElementInstallTarget = useCallback51(() => {
24796
+ if (previewServerClientId === null) {
24797
+ return;
24798
+ }
24799
+ callApi("/api/update-element-install-target", {
24800
+ clientId: previewServerClientId,
24801
+ compositionFile: canInstallElements ? compositionFile : null,
24802
+ compositionId: canInstallElements ? currentCompositionId : null,
24803
+ canInstall: canInstallElements,
24804
+ lastFocusedAt: lastFocusedAtRef.current,
24805
+ readOnly: window.remotion_isReadOnlyStudio
24806
+ }).catch(() => {
24807
+ return;
24808
+ });
24809
+ }, [
24810
+ canInstallElements,
24811
+ compositionFile,
24812
+ currentCompositionId,
24813
+ previewServerClientId
24814
+ ]);
24815
+ useEffect42(() => {
24816
+ updateElementInstallTarget();
24817
+ const interval = window.setInterval(updateElementInstallTarget, 2000);
24818
+ return () => {
24819
+ window.clearInterval(interval);
24820
+ };
24821
+ }, [updateElementInstallTarget]);
24822
+ useEffect42(() => {
24823
+ const markFocused = () => {
24824
+ lastFocusedAtRef.current = Date.now();
24825
+ updateElementInstallTarget();
24826
+ };
24827
+ window.addEventListener("focus", markFocused);
24828
+ document.addEventListener("pointerdown", markFocused, { capture: true });
24829
+ return () => {
24830
+ window.removeEventListener("focus", markFocused);
24831
+ document.removeEventListener("pointerdown", markFocused, { capture: true });
24832
+ };
24833
+ }, [updateElementInstallTarget]);
24834
+ useEffect42(() => {
24835
+ if (installingElementName === null) {
24836
+ return;
24837
+ }
24838
+ const previousTitle = document.title;
24839
+ document.title = `\uD83D\uDCE6 Install ${installingElementName} - Remotion Studio`;
24840
+ return () => {
24841
+ document.title = previousTitle;
24842
+ };
24843
+ }, [installingElementName]);
24844
+ useEffect42(() => {
24845
+ if (previewServerClientId === null) {
24846
+ return;
24847
+ }
24848
+ return subscribeToEvent("element-install-request", (event) => {
24849
+ if (event.type !== "element-install-request" || event.request.clientId !== previewServerClientId) {
24850
+ return;
24851
+ }
24852
+ setPendingElementInstallRequests((requests) => [
24853
+ ...requests,
24854
+ event.request
24855
+ ]);
24856
+ });
24857
+ }, [previewServerClientId, subscribeToEvent]);
24858
+ useEffect42(() => {
24859
+ if (activeElementInstallRequest !== null || pendingElementInstallRequests.length === 0) {
24860
+ return;
24861
+ }
24862
+ const [nextRequest, ...remainingRequests] = pendingElementInstallRequests;
24863
+ if (!nextRequest) {
24864
+ throw new Error("Expected pending Element install request");
24865
+ }
24866
+ setActiveElementInstallRequest(nextRequest);
24867
+ setPendingElementInstallRequests(remainingRequests);
24868
+ }, [activeElementInstallRequest, pendingElementInstallRequests]);
24869
+ useEffect42(() => {
24870
+ if (activeElementInstallRequest === null) {
24871
+ return;
24872
+ }
24873
+ let canceled = false;
24874
+ const handleInstallRequest = async () => {
24875
+ setInstallingElementName(activeElementInstallRequest.element.displayName);
24876
+ const accepted = await confirm({
24877
+ title: "Install Element",
24878
+ message: /* @__PURE__ */ jsxs43(Fragment19, {
24879
+ children: [
24880
+ "Install “",
24881
+ activeElementInstallRequest.element.displayName,
24882
+ "” into",
24883
+ " ",
24884
+ /* @__PURE__ */ jsx94("code", {
24885
+ style: elementInstallCompositionIdStyle,
24886
+ children: activeElementInstallRequest.compositionId
24887
+ }),
24888
+ " ",
24889
+ "composition? This will create an Element source file and update the composition source.",
24890
+ /* @__PURE__ */ jsxs43("details", {
24891
+ style: elementInstallCodeDetailsStyle,
24892
+ children: [
24893
+ /* @__PURE__ */ jsx94("summary", {
24894
+ style: elementInstallCodeSummaryStyle,
24895
+ children: "Preview Element source"
24896
+ }),
24897
+ /* @__PURE__ */ jsx94("pre", {
24898
+ style: elementInstallCodeBlockStyle,
24899
+ children: /* @__PURE__ */ jsx94("code", {
24900
+ children: activeElementInstallRequest.element.sourceCode
24901
+ })
24902
+ })
24903
+ ]
24904
+ })
24905
+ ]
24906
+ }),
24907
+ confirmLabel: "Install",
24908
+ cancelLabel: "Cancel"
24909
+ });
24910
+ if (accepted && !canceled) {
24911
+ await insertElement({
24912
+ element: activeElementInstallRequest.element,
24913
+ compositionFile: activeElementInstallRequest.compositionFile,
24914
+ compositionId: activeElementInstallRequest.compositionId,
24915
+ dropPosition: null
24916
+ });
24917
+ }
24918
+ };
24919
+ handleInstallRequest().finally(() => {
24920
+ if (canceled) {
24921
+ return;
24922
+ }
24923
+ setInstallingElementName(null);
24924
+ setActiveElementInstallRequest(null);
24925
+ }).catch((err) => {
24926
+ setTimeout(() => {
24927
+ throw err;
24928
+ }, 0);
24929
+ });
24930
+ return () => {
24931
+ canceled = true;
24932
+ };
24933
+ }, [activeElementInstallRequest, confirm]);
24759
24934
  const onDragOver = useCallback51((event) => {
24760
24935
  if (!canDropAssets || !isFileDragEvent(event) && !isAssetDragEvent(event) && !isCompositionDragEvent(event) && !isComponentDragEvent(event) && !isElementDragEvent(event) && !isSfxDragEvent(event) && !isRemoteAssetDragEvent(event) || !isDragEventInsideCanvas(event)) {
24761
24936
  return;
@@ -26960,6 +27135,9 @@ var VisualControlsProvider = ({ children }) => {
26960
27135
  if (!env.isStudio) {
26961
27136
  return value;
26962
27137
  }
27138
+ if (!studioInteractivityEnabled) {
27139
+ return value;
27140
+ }
26963
27141
  if (!z) {
26964
27142
  return value;
26965
27143
  }
@@ -33350,7 +33528,7 @@ var DefaultInspector = ({ composition, currentDefaultProps, readOnlyStudio, setD
33350
33528
  const { handles: visualControlHandles } = useContext56(VisualControlsContext);
33351
33529
  const [defaultPropsMode, setDefaultPropsMode] = useState68("schema");
33352
33530
  const compositionId = composition?.id ?? null;
33353
- const hasVisualControls = Object.keys(visualControlHandles).length > 0;
33531
+ const hasVisualControls = studioInteractivityEnabled && Object.keys(visualControlHandles).length > 0;
33354
33532
  useEffect60(() => {
33355
33533
  setDefaultPropsMode("schema");
33356
33534
  }, [compositionId]);
@@ -48188,7 +48366,7 @@ var TimelineDragHandler = () => {
48188
48366
  ref: sliderAreaRef,
48189
48367
  style: containerStyle9,
48190
48368
  ...{ [TIMELINE_SCRUBBER_ATTR]: true },
48191
- children: video ? /* @__PURE__ */ jsx258(TimelineDragHandlerInnerMemo, {}) : null
48369
+ children: video && studioInteractivityEnabled ? /* @__PURE__ */ jsx258(TimelineDragHandlerInnerMemo, {}) : null
48192
48370
  });
48193
48371
  };
48194
48372
  var TimelineDragHandlerInner = () => {
@@ -49255,6 +49433,7 @@ var TimelineSequenceItem = ({
49255
49433
  const nodePath = nodePathInfo?.sequenceSubscriptionKey ?? null;
49256
49434
  const { previewServerState } = useContext111(StudioServerConnectionCtx);
49257
49435
  const previewConnected = previewServerState.type === "connected";
49436
+ const previewInteractive = previewConnected && studioInteractivityEnabled;
49258
49437
  const { getIsExpanded } = useContext111(ExpandedTracksGetterContext);
49259
49438
  const { toggleTrack } = useContext111(ExpandedTracksSetterContext);
49260
49439
  const { setPropStatuses } = useContext111(Internals91.VisualModeSettersContext);
@@ -49291,7 +49470,7 @@ var TimelineSequenceItem = ({
49291
49470
  propStatusesForOverride,
49292
49471
  saveName
49293
49472
  } = useRenameSequence({
49294
- clientId: previewServerState.type === "connected" ? previewServerState.clientId : null,
49473
+ clientId: previewInteractive && previewServerState.type === "connected" ? previewServerState.clientId : null,
49295
49474
  nodePathInfo,
49296
49475
  sequence,
49297
49476
  validatedLocation
@@ -49299,22 +49478,22 @@ var TimelineSequenceItem = ({
49299
49478
  const canDeleteFromSource = Boolean(nodePath && validatedLocation?.source);
49300
49479
  const nodePathKey = useMemo170(() => nodePath ? Internals91.makeSequencePropsSubscriptionKey(nodePath) : null, [nodePath]);
49301
49480
  const parentId = sequence.parent ?? null;
49302
- const canReorderSequence = previewConnected && Boolean(nodePath && nodePathKey && validatedLocation?.source) && nodePathInfo?.numberOfSequencesWithThisNodePath === 1;
49303
- const canHandleSequenceDrag = previewConnected;
49481
+ const canReorderSequence = previewInteractive && Boolean(nodePath && nodePathKey && validatedLocation?.source) && nodePathInfo?.numberOfSequencesWithThisNodePath === 1;
49482
+ const canHandleSequenceDrag = previewInteractive;
49304
49483
  const confirm = useConfirmationDialog();
49305
- const deleteDisabled = useMemo170(() => !previewConnected || !sequence.controls || !canDeleteFromSource, [previewConnected, sequence.controls, canDeleteFromSource]);
49484
+ const deleteDisabled = useMemo170(() => !previewInteractive || !sequence.controls || !canDeleteFromSource, [previewInteractive, sequence.controls, canDeleteFromSource]);
49306
49485
  const duplicateDisabled = deleteDisabled;
49307
- const disableInteractivityDisabled = !previewConnected || !sequence.showInTimeline || !nodePath || !validatedLocation?.source;
49486
+ const disableInteractivityDisabled = !previewInteractive || !sequence.showInTimeline || !nodePath || !validatedLocation?.source;
49308
49487
  const onDuplicateSequenceFromSource = useCallback162(() => {
49309
- if (!validatedLocation?.source || !nodePathInfo) {
49488
+ if (duplicateDisabled || !validatedLocation?.source || !nodePathInfo) {
49310
49489
  return;
49311
49490
  }
49312
49491
  duplicateSequencesFromSource([nodePathInfo], confirm).catch(() => {
49313
49492
  return;
49314
49493
  });
49315
- }, [confirm, nodePathInfo, validatedLocation?.source]);
49494
+ }, [confirm, duplicateDisabled, nodePathInfo, validatedLocation?.source]);
49316
49495
  const onDeleteSequenceFromSource = useCallback162(async () => {
49317
- if (!validatedLocation?.source || !nodePath) {
49496
+ if (deleteDisabled || !validatedLocation?.source || !nodePath) {
49318
49497
  return;
49319
49498
  }
49320
49499
  if (nodePathInfo && nodePathInfo.numberOfSequencesWithThisNodePath > 1) {
@@ -49344,7 +49523,13 @@ var TimelineSequenceItem = ({
49344
49523
  } catch (err) {
49345
49524
  showNotification(err.message, 4000);
49346
49525
  }
49347
- }, [confirm, nodePath, validatedLocation?.source, nodePathInfo]);
49526
+ }, [
49527
+ confirm,
49528
+ deleteDisabled,
49529
+ nodePath,
49530
+ validatedLocation?.source,
49531
+ nodePathInfo
49532
+ ]);
49348
49533
  const onDisableSequenceInteractivity = useCallback162(() => {
49349
49534
  if (disableInteractivityDisabled || !nodePath || !validatedLocation?.source || previewServerState.type !== "connected") {
49350
49535
  return;
@@ -49579,8 +49764,8 @@ var TimelineSequenceItem = ({
49579
49764
  ...effectDropHighlight
49580
49765
  } : inner2;
49581
49766
  }, [effectDropHovered, inner2]);
49582
- const hasExpandableContent = Boolean(sequence.controls) || sequence.effects.length > 0;
49583
- const canToggleVisibility = previewConnected && Boolean(sequence.controls) && nodePath !== null && validatedLocation !== null && codeHiddenStatus !== undefined && codeHiddenStatus !== null && codeHiddenStatus.status === "static";
49767
+ const hasExpandableContent = studioInteractivityEnabled && (Boolean(sequence.controls) || sequence.effects.length > 0);
49768
+ const canToggleVisibility = previewInteractive && Boolean(sequence.controls) && nodePath !== null && validatedLocation !== null && codeHiddenStatus !== undefined && codeHiddenStatus !== null && codeHiddenStatus.status === "static";
49584
49769
  const onSequenceDoubleClick = useCallback162((e) => {
49585
49770
  if (isTimelineSelectionModifierEvent(e)) {
49586
49771
  e.stopPropagation();
@@ -49633,7 +49818,7 @@ var TimelineSequenceItem = ({
49633
49818
  setIsRenaming(true);
49634
49819
  }, [canRenameThisSequence]);
49635
49820
  const freezeFrameMenuItem = useSequenceFreezeFrameMenuItem({
49636
- clientId: previewServerState.type === "connected" ? previewServerState.clientId : null,
49821
+ clientId: previewInteractive && previewServerState.type === "connected" ? previewServerState.clientId : null,
49637
49822
  nodePath,
49638
49823
  propStatusesForOverride,
49639
49824
  sequence,
@@ -49642,7 +49827,7 @@ var TimelineSequenceItem = ({
49642
49827
  timelinePosition,
49643
49828
  validatedSource: validatedLocation?.source ?? null
49644
49829
  });
49645
- const canAddEffect = nodePathInfo?.supportsEffects === true && previewServerState.type === "connected" && Boolean(validatedLocation?.source);
49830
+ const canAddEffect = nodePathInfo?.supportsEffects === true && previewInteractive && Boolean(validatedLocation?.source);
49646
49831
  const onAddEffect = useCallback162(() => {
49647
49832
  if (!canAddEffect || previewServerState.type !== "connected" || !nodePath || !validatedLocation?.source) {
49648
49833
  return;
@@ -49671,7 +49856,7 @@ var TimelineSequenceItem = ({
49671
49856
  disableInteractivityDisabled,
49672
49857
  duplicateDisabled,
49673
49858
  fileLocation,
49674
- includeSourceEditItems: true,
49859
+ includeSourceEditItems: studioInteractivityEnabled,
49675
49860
  onDeleteSequenceFromSource,
49676
49861
  onDisableSequenceInteractivity,
49677
49862
  onDuplicateSequenceFromSource,
@@ -49679,7 +49864,7 @@ var TimelineSequenceItem = ({
49679
49864
  originalLocation,
49680
49865
  selectAsset,
49681
49866
  sequence,
49682
- sourceActions: [
49867
+ sourceActions: studioInteractivityEnabled ? [
49683
49868
  ...nodePathInfo?.supportsEffects ? [
49684
49869
  {
49685
49870
  type: "item",
@@ -49713,7 +49898,7 @@ var TimelineSequenceItem = ({
49713
49898
  value: "rename-sequence"
49714
49899
  },
49715
49900
  ...freezeFrameMenuItem ? [freezeFrameMenuItem] : []
49716
- ]
49901
+ ] : []
49717
49902
  });
49718
49903
  }, [
49719
49904
  assetLinkInfo,
@@ -49737,7 +49922,7 @@ var TimelineSequenceItem = ({
49737
49922
  selectAsset,
49738
49923
  sequence
49739
49924
  ]);
49740
- const canDropEffect = previewServerState.type === "connected" && nodePath !== null && validatedLocation !== null && sequence.controls?.supportsEffects === true;
49925
+ const canDropEffect = previewInteractive && nodePath !== null && validatedLocation !== null && sequence.controls?.supportsEffects === true;
49741
49926
  const sequenceReorderLineStyle = useMemo170(() => {
49742
49927
  if (!sequenceDropIndicator) {
49743
49928
  return null;
@@ -49793,7 +49978,7 @@ var TimelineSequenceItem = ({
49793
49978
  onInvoked: onToggleVisibility
49794
49979
  }) : /* @__PURE__ */ jsx266(TimelineLayerEyeSpacer, {}),
49795
49980
  arrow: hasExpandableContent && nodePathInfo !== null ? /* @__PURE__ */ jsx266(TimelineSequenceExpandArrow, {
49796
- disabled: !previewConnected,
49981
+ disabled: !previewInteractive,
49797
49982
  isExpanded,
49798
49983
  nodePathInfo,
49799
49984
  onToggleExpand,
@@ -49863,7 +50048,7 @@ var TimelineSequenceItem = ({
49863
50048
  onOpen: selectable ? onSelect : null,
49864
50049
  children: draggableTrackRow
49865
50050
  }) : draggableTrackRow,
49866
- previewConnected && isExpanded && hasExpandableContent && nodePathInfo && validatedLocation ? /* @__PURE__ */ jsx266(TimelineExpandedSection, {
50051
+ previewConnected && studioInteractivityEnabled && isExpanded && hasExpandableContent && nodePathInfo && validatedLocation ? /* @__PURE__ */ jsx266(TimelineExpandedSection, {
49867
50052
  sequence,
49868
50053
  validatedLocation,
49869
50054
  nodePathInfo,
@@ -52612,11 +52797,12 @@ var TimelineSequenceInner = ({ s, windowWidth, nodePathInfo, sequenceFrameOffset
52612
52797
  const propStatusesForOverride = useMemo176(() => {
52613
52798
  return nodePath ? Internals97.getPropStatusesCtx(propStatuses, nodePath) : undefined;
52614
52799
  }, [propStatuses, nodePath]);
52615
- const durationCanUpdate = Boolean(propStatusesForOverride?.durationInFrames?.status === "static");
52616
- const fromCanUpdate = Boolean(propStatusesForOverride?.from?.status === "static");
52617
- const trimBeforeCanUpdate = Boolean(propStatusesForOverride?.trimBefore?.status === "static");
52800
+ const durationCanUpdate = Boolean(studioInteractivityEnabled && propStatusesForOverride?.durationInFrames?.status === "static");
52801
+ const fromCanUpdate = Boolean(studioInteractivityEnabled && propStatusesForOverride?.from?.status === "static");
52802
+ const trimBeforeCanUpdate = Boolean(studioInteractivityEnabled && propStatusesForOverride?.trimBefore?.status === "static");
52618
52803
  const { previewServerState } = useContext118(StudioServerConnectionCtx);
52619
52804
  const previewConnected = previewServerState.type === "connected";
52805
+ const previewInteractive = previewConnected && studioInteractivityEnabled;
52620
52806
  const { setPropStatuses } = useContext118(Internals97.VisualModeSettersContext);
52621
52807
  const timelinePosition = Internals97.Timeline.useTimelinePosition();
52622
52808
  const selectAsset = useSelectAsset();
@@ -52636,9 +52822,9 @@ var TimelineSequenceInner = ({ s, windowWidth, nodePathInfo, sequenceFrameOffset
52636
52822
  });
52637
52823
  }, [canOpenInEditor, originalLocation]);
52638
52824
  const canDeleteFromSource = Boolean(nodePath && validatedLocation?.source);
52639
- const deleteDisabled = !previewConnected || !s.controls || !canDeleteFromSource;
52825
+ const deleteDisabled = !previewInteractive || !s.controls || !canDeleteFromSource;
52640
52826
  const duplicateDisabled = deleteDisabled;
52641
- const disableInteractivityDisabled = !previewConnected || !s.showInTimeline || !nodePath || !validatedLocation?.source;
52827
+ const disableInteractivityDisabled = !previewInteractive || !s.showInTimeline || !nodePath || !validatedLocation?.source;
52642
52828
  const mediaSrc = s.type === "audio" || s.type === "video" || s.type === "image" ? s.src : null;
52643
52829
  const assetLinkInfo = useMemo176(() => mediaSrc ? getTimelineAssetLinkInfo(mediaSrc) : null, [mediaSrc]);
52644
52830
  const onDuplicateSequenceFromSource = useCallback165(() => {
@@ -52705,7 +52891,7 @@ var TimelineSequenceInner = ({ s, windowWidth, nodePathInfo, sequenceFrameOffset
52705
52891
  validatedLocation?.source
52706
52892
  ]);
52707
52893
  const freezeFrameMenuItem = useSequenceFreezeFrameMenuItem({
52708
- clientId: previewServerState.type === "connected" ? previewServerState.clientId : null,
52894
+ clientId: previewInteractive && previewServerState.type === "connected" ? previewServerState.clientId : null,
52709
52895
  nodePath,
52710
52896
  propStatusesForOverride,
52711
52897
  sequence: s,
@@ -52725,7 +52911,7 @@ var TimelineSequenceInner = ({ s, windowWidth, nodePathInfo, sequenceFrameOffset
52725
52911
  disableInteractivityDisabled,
52726
52912
  duplicateDisabled,
52727
52913
  fileLocation,
52728
- includeSourceEditItems: true,
52914
+ includeSourceEditItems: studioInteractivityEnabled,
52729
52915
  onDeleteSequenceFromSource,
52730
52916
  onDisableSequenceInteractivity,
52731
52917
  onDuplicateSequenceFromSource,
@@ -52733,7 +52919,7 @@ var TimelineSequenceInner = ({ s, windowWidth, nodePathInfo, sequenceFrameOffset
52733
52919
  originalLocation,
52734
52920
  selectAsset,
52735
52921
  sequence: s,
52736
- sourceActions: freezeFrameMenuItem ? [freezeFrameMenuItem] : []
52922
+ sourceActions: studioInteractivityEnabled && freezeFrameMenuItem ? [freezeFrameMenuItem] : []
52737
52923
  });
52738
52924
  }, [
52739
52925
  assetLinkInfo,
@@ -52960,6 +53146,7 @@ var TimelineContextMenuArea = ({ children }) => {
52960
53146
  const [isAddingAsset, setIsAddingAsset] = useState99(false);
52961
53147
  const { previewServerState } = useContext120(StudioServerConnectionCtx);
52962
53148
  const previewConnected = previewServerState.type === "connected";
53149
+ const previewInteractive = previewConnected && studioInteractivityEnabled;
52963
53150
  const currentCompositionId = canvasContent?.type === "composition" ? canvasContent.compositionId : null;
52964
53151
  const currentComposition = useMemo179(() => {
52965
53152
  if (currentCompositionId === null) {
@@ -52973,8 +53160,8 @@ var TimelineContextMenuArea = ({ children }) => {
52973
53160
  compositionFile,
52974
53161
  compositionId: currentCompositionId
52975
53162
  });
52976
- const canInsertSolid = previewConnected && compositionComponentInfo?.canAddSequence === true && currentCompositionId !== null && compositionFile !== null && videoConfig !== null && !isAddingSolid;
52977
- const canInsertAsset = previewConnected && !window.remotion_isReadOnlyStudio && compositionComponentInfo?.canAddSequence === true && currentCompositionId !== null && compositionFile !== null && !isAddingAsset;
53163
+ const canInsertSolid = previewInteractive && compositionComponentInfo?.canAddSequence === true && currentCompositionId !== null && compositionFile !== null && videoConfig !== null && !isAddingSolid;
53164
+ const canInsertAsset = previewInteractive && !window.remotion_isReadOnlyStudio && compositionComponentInfo?.canAddSequence === true && currentCompositionId !== null && compositionFile !== null && !isAddingAsset;
52978
53165
  const insertSolid = useCallback166(async () => {
52979
53166
  if (!canInsertSolid || currentCompositionId === null || compositionFile === null || videoConfig === null) {
52980
53167
  return;
@@ -53066,6 +53253,7 @@ var TimelineInner = () => {
53066
53253
  const { overrideIdToNodePathMappings } = useContext120(Internals98.OverrideIdsToNodePathsGettersContext);
53067
53254
  const { previewServerState } = useContext120(StudioServerConnectionCtx);
53068
53255
  const previewConnected = previewServerState.type === "connected";
53256
+ const previewInteractive = previewConnected && studioInteractivityEnabled;
53069
53257
  const videoConfigIsNull = videoConfig === null;
53070
53258
  const timeline = useMemo179(() => {
53071
53259
  if (videoConfigIsNull) {
@@ -53087,7 +53275,7 @@ var TimelineInner = () => {
53087
53275
  return /* @__PURE__ */ jsxs146(TimelineContextMenuArea, {
53088
53276
  children: [
53089
53277
  sequences.map((sequence) => {
53090
- if (!shouldSubscribeToSequenceProps(sequence, previewConnected)) {
53278
+ if (!shouldSubscribeToSequenceProps(sequence, previewInteractive)) {
53091
53279
  return null;
53092
53280
  }
53093
53281
  return /* @__PURE__ */ jsx282(SubscribeToNodePaths, {
@@ -53098,15 +53286,15 @@ var TimelineInner = () => {
53098
53286
  effects: sequence.effects
53099
53287
  }, sequence.id);
53100
53288
  }),
53101
- /* @__PURE__ */ jsx282(SequencePropsObserver, {}),
53289
+ studioInteractivityEnabled ? /* @__PURE__ */ jsx282(SequencePropsObserver, {}) : null,
53102
53290
  /* @__PURE__ */ jsx282(TimelineKeyframeTracksProvider, {
53103
53291
  tracks: filtered,
53104
53292
  children: /* @__PURE__ */ jsxs146(TimelineSelectableItemsProvider, {
53105
53293
  timeline: shown,
53106
53294
  children: [
53107
- /* @__PURE__ */ jsx282(TimelineSelectAllKeybindings, {
53295
+ studioInteractivityEnabled ? /* @__PURE__ */ jsx282(TimelineSelectAllKeybindings, {
53108
53296
  timeline: shown
53109
- }),
53297
+ }) : null,
53110
53298
  /* @__PURE__ */ jsx282(TimelineHeightContainer, {
53111
53299
  shown,
53112
53300
  hasBeenCut,
@@ -53146,7 +53334,7 @@ var TimelineInner = () => {
53146
53334
  /* @__PURE__ */ jsx282(TimelineInOutPointer, {}),
53147
53335
  /* @__PURE__ */ jsx282(TimelineTimeIndicators, {}),
53148
53336
  /* @__PURE__ */ jsx282(TimelineDragHandler, {}),
53149
- /* @__PURE__ */ jsx282(TimelineInOutDragHandler, {}),
53337
+ studioInteractivityEnabled ? /* @__PURE__ */ jsx282(TimelineInOutDragHandler, {}) : null,
53150
53338
  /* @__PURE__ */ jsx282(TimelineSlider, {})
53151
53339
  ]
53152
53340
  })