@remotion/studio 4.0.409 → 4.0.411

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.
@@ -29,7 +29,7 @@ import { Internals as Internals66 } from "remotion";
29
29
 
30
30
  // src/components/Editor.tsx
31
31
  import { PlayerInternals as PlayerInternals19 } from "@remotion/player";
32
- import React177, { useCallback as useCallback135, useEffect as useEffect85, useMemo as useMemo136 } from "react";
32
+ import React177, { useCallback as useCallback135, useEffect as useEffect84, useMemo as useMemo136 } from "react";
33
33
  import { Internals as Internals62 } from "remotion";
34
34
 
35
35
  // src/helpers/colors.ts
@@ -3265,7 +3265,7 @@ var writeStaticFile = async ({
3265
3265
  if (window.remotion_isReadOnlyStudio) {
3266
3266
  throw new Error("writeStaticFile() is not available in read-only Studio");
3267
3267
  }
3268
- const url = new URL("/api/add-asset", window.location.origin);
3268
+ const url = new URL(`${window.remotion_staticBase}/api/add-asset`, window.location.origin);
3269
3269
  if (filePath.includes("\\")) {
3270
3270
  return Promise.reject(new Error("File path cannot contain backslashes"));
3271
3271
  }
@@ -7544,10 +7544,10 @@ var MenuBuildIndicator = () => {
7544
7544
  };
7545
7545
 
7546
7546
  // src/components/SidebarCollapserControls.tsx
7547
- import { useCallback as useCallback91, useContext as useContext59, useEffect as useEffect62 } from "react";
7547
+ import { useCallback as useCallback91, useContext as useContext59, useEffect as useEffect61 } from "react";
7548
7548
 
7549
7549
  // src/components/TopPanel.tsx
7550
- import { useCallback as useCallback90, useContext as useContext58, useEffect as useEffect61, useMemo as useMemo96 } from "react";
7550
+ import { useCallback as useCallback90, useContext as useContext58, useEffect as useEffect60, useMemo as useMemo96 } from "react";
7551
7551
 
7552
7552
  // src/helpers/use-breakpoint.ts
7553
7553
  import { useEffect as useEffect25, useState as useState30 } from "react";
@@ -16487,7 +16487,21 @@ var makeClientRetryPayload = (job) => {
16487
16487
  initialLicenseKey: job.licenseKey,
16488
16488
  defaultProps: job.inputProps,
16489
16489
  inFrameMark: job.type === "client-video" ? job.startFrame : null,
16490
- outFrameMark: job.type === "client-video" ? job.endFrame : null
16490
+ outFrameMark: job.type === "client-video" ? job.endFrame : null,
16491
+ initialDefaultOutName: job.outName,
16492
+ initialScale: job.scale,
16493
+ initialDelayRenderTimeout: job.delayRenderTimeout,
16494
+ initialMediaCacheSizeInBytes: job.mediaCacheSizeInBytes,
16495
+ initialAudioBitrate: job.type === "client-video" ? job.audioBitrate : null,
16496
+ initialAudioCodec: job.type === "client-video" ? job.audioCodec : null,
16497
+ initialContainer: job.type === "client-video" ? job.container : null,
16498
+ initialHardwareAcceleration: job.type === "client-video" ? job.hardwareAcceleration : null,
16499
+ initialVideoBitrate: job.type === "client-video" ? job.videoBitrate : null,
16500
+ initialVideoCodec: job.type === "client-video" ? job.videoCodec : null,
16501
+ initialStillImageFormat: job.type === "client-still" ? job.imageFormat : "png",
16502
+ initialKeyframeIntervalInSeconds: job.type === "client-video" ? job.keyframeIntervalInSeconds : null,
16503
+ initialMuted: job.type === "client-video" ? job.muted : null,
16504
+ initialTransparent: job.type === "client-video" ? job.transparent : null
16491
16505
  };
16492
16506
  };
16493
16507
 
@@ -17328,7 +17342,7 @@ var OptionsPanel = ({ readOnlyStudio }) => {
17328
17342
  };
17329
17343
 
17330
17344
  // src/components/PreviewToolbar.tsx
17331
- import { useContext as useContext55, useEffect as useEffect59, useRef as useRef32, useState as useState60 } from "react";
17345
+ import { useContext as useContext55, useEffect as useEffect58, useRef as useRef32, useState as useState60 } from "react";
17332
17346
  import { Internals as Internals45 } from "remotion";
17333
17347
 
17334
17348
  // src/helpers/should-show-render-button.ts
@@ -18145,14 +18159,7 @@ var PlaybackRateSelector = ({ playbackRate, setPlaybackRate }) => {
18145
18159
 
18146
18160
  // src/components/RenderButton.tsx
18147
18161
  import { PlayerInternals as PlayerInternals14 } from "@remotion/player";
18148
- import {
18149
- useCallback as useCallback88,
18150
- useContext as useContext53,
18151
- useEffect as useEffect58,
18152
- useMemo as useMemo93,
18153
- useRef as useRef31,
18154
- useState as useState59
18155
- } from "react";
18162
+ import { useCallback as useCallback88, useContext as useContext53, useMemo as useMemo93, useRef as useRef31, useState as useState59 } from "react";
18156
18163
  import ReactDOM8 from "react-dom";
18157
18164
  import { Internals as Internals43 } from "remotion";
18158
18165
  import { jsx as jsx174, jsxs as jsxs81, Fragment as Fragment23 } from "react/jsx-runtime";
@@ -18234,6 +18241,34 @@ var RenderButton = ({
18234
18241
  shouldApplyCssTransforms: true
18235
18242
  });
18236
18243
  const refresh = size4?.refresh;
18244
+ const onPointerDown = useCallback88(() => {
18245
+ setDropdownOpened((o) => {
18246
+ if (!o) {
18247
+ refresh?.();
18248
+ }
18249
+ return !o;
18250
+ });
18251
+ }, [refresh]);
18252
+ const onClickDropdown = useCallback88((e) => {
18253
+ e.stopPropagation();
18254
+ const isKeyboardInitiated = e.detail === 0;
18255
+ if (!isKeyboardInitiated) {
18256
+ return;
18257
+ }
18258
+ setDropdownOpened((o) => {
18259
+ if (!o) {
18260
+ refresh?.();
18261
+ window.addEventListener("pointerup", (evt) => {
18262
+ if (!isMenuItem(evt.target)) {
18263
+ setDropdownOpened(false);
18264
+ }
18265
+ }, {
18266
+ once: true
18267
+ });
18268
+ }
18269
+ return !o;
18270
+ });
18271
+ }, [refresh]);
18237
18272
  const connectionStatus = useContext53(StudioServerConnectionCtx).previewServerState.type;
18238
18273
  const shortcut = areKeyboardShortcutsDisabled() ? "" : "(R)";
18239
18274
  const tooltip = connectionStatus === "connected" ? "Export the current composition " + shortcut : "Connect to the Studio server to render";
@@ -18323,7 +18358,21 @@ var RenderButton = ({
18323
18358
  inFrameMark: inFrame,
18324
18359
  outFrameMark: outFrame,
18325
18360
  initialLogLevel: defaults.logLevel,
18326
- initialLicenseKey: defaults.publicLicenseKey
18361
+ initialLicenseKey: defaults.publicLicenseKey,
18362
+ initialStillImageFormat: defaults.stillImageFormat,
18363
+ initialScale: defaults.scale,
18364
+ initialDelayRenderTimeout: defaults.delayRenderTimeout,
18365
+ initialDefaultOutName: null,
18366
+ initialContainer: null,
18367
+ initialVideoCodec: null,
18368
+ initialAudioCodec: null,
18369
+ initialAudioBitrate: null,
18370
+ initialVideoBitrate: null,
18371
+ initialHardwareAcceleration: null,
18372
+ initialKeyframeIntervalInSeconds: null,
18373
+ initialTransparent: null,
18374
+ initialMuted: null,
18375
+ initialMediaCacheSizeInBytes: defaults.mediaCacheSizeInBytes
18327
18376
  });
18328
18377
  }, [video, setSelectedModal, getCurrentFrame2, props, inFrame, outFrame]);
18329
18378
  const onClick = useCallback88(() => {
@@ -18374,46 +18423,6 @@ var RenderButton = ({
18374
18423
  }
18375
18424
  ];
18376
18425
  }, [handleRenderTypeChange]);
18377
- useEffect58(() => {
18378
- const { current } = dropdownRef;
18379
- if (!current) {
18380
- return;
18381
- }
18382
- const onPointerDown = () => {
18383
- return setDropdownOpened((o) => {
18384
- if (!o) {
18385
- refresh?.();
18386
- }
18387
- return !o;
18388
- });
18389
- };
18390
- const onClickDropdown = (e) => {
18391
- e.stopPropagation();
18392
- const isKeyboardInitiated = e.detail === 0;
18393
- if (!isKeyboardInitiated) {
18394
- return;
18395
- }
18396
- return setDropdownOpened((o) => {
18397
- if (!o) {
18398
- refresh?.();
18399
- window.addEventListener("pointerup", (evt) => {
18400
- if (!isMenuItem(evt.target)) {
18401
- setDropdownOpened(false);
18402
- }
18403
- }, {
18404
- once: true
18405
- });
18406
- }
18407
- return !o;
18408
- });
18409
- };
18410
- current.addEventListener("pointerdown", onPointerDown);
18411
- current.addEventListener("click", onClickDropdown);
18412
- return () => {
18413
- current.removeEventListener("pointerdown", onPointerDown);
18414
- current.removeEventListener("click", onClickDropdown);
18415
- };
18416
- }, [refresh]);
18417
18426
  const spaceToBottom = useMemo93(() => {
18418
18427
  const margin2 = 10;
18419
18428
  if (size4 && dropdownOpened) {
@@ -18481,7 +18490,6 @@ var RenderButton = ({
18481
18490
  /* @__PURE__ */ jsx174("button", {
18482
18491
  style: { display: "none" },
18483
18492
  id: "render-modal-button-client",
18484
- disabled: connectionStatus !== "connected" && renderType === "server-render",
18485
18493
  onClick: openClientRenderModal,
18486
18494
  type: "button"
18487
18495
  }),
@@ -18525,6 +18533,8 @@ var RenderButton = ({
18525
18533
  style: dropdownTriggerStyle,
18526
18534
  disabled: connectionStatus !== "connected",
18527
18535
  className: MENU_INITIATOR_CLASSNAME,
18536
+ onPointerDown,
18537
+ onClick: onClickDropdown,
18528
18538
  children: /* @__PURE__ */ jsx174(CaretDown, {})
18529
18539
  })
18530
18540
  ]
@@ -18727,7 +18737,7 @@ var PreviewToolbar = ({ readOnlyStudio, bufferStateDelayInMilliseconds }) => {
18727
18737
  const [loop, setLoop] = useState60(loadLoopOption());
18728
18738
  const isFullscreenSupported = checkFullscreenSupport();
18729
18739
  const isMobileLayout = useMobileLayout();
18730
- useEffect59(() => {
18740
+ useEffect58(() => {
18731
18741
  if (isMobileLayout && previewToolbarRef.current) {
18732
18742
  const updateScrollableIndicatorProps = (target) => {
18733
18743
  const boundingBox = target.getBoundingClientRect();
@@ -19007,7 +19017,7 @@ var SplitterElement = ({ children, type, sticky }) => {
19007
19017
 
19008
19018
  // src/components/Splitter/SplitterHandle.tsx
19009
19019
  import { PlayerInternals as PlayerInternals15 } from "@remotion/player";
19010
- import { useContext as useContext57, useEffect as useEffect60, useRef as useRef34, useState as useState62 } from "react";
19020
+ import { useContext as useContext57, useEffect as useEffect59, useRef as useRef34, useState as useState62 } from "react";
19011
19021
  import { jsx as jsx180 } from "react/jsx-runtime";
19012
19022
  var SPLITTER_HANDLE_SIZE = 3;
19013
19023
  var containerRow2 = {
@@ -19023,7 +19033,7 @@ var SplitterHandle = ({ allowToCollapse, onCollapse }) => {
19023
19033
  }
19024
19034
  const [lastPointerUp, setLastPointerUp] = useState62(() => Date.now());
19025
19035
  const ref = useRef34(null);
19026
- useEffect60(() => {
19036
+ useEffect59(() => {
19027
19037
  if (context.isDragging.current) {
19028
19038
  return;
19029
19039
  }
@@ -19106,7 +19116,7 @@ var SplitterHandle = ({ allowToCollapse, onCollapse }) => {
19106
19116
  }
19107
19117
  };
19108
19118
  }, [allowToCollapse, context, context.flexValue, lastPointerUp, onCollapse]);
19109
- useEffect60(() => {
19119
+ useEffect59(() => {
19110
19120
  const { current } = ref;
19111
19121
  if (!current) {
19112
19122
  return;
@@ -19193,7 +19203,7 @@ var TopPanel = ({ readOnlyStudio, onMounted, drawRef: drawRef2, bufferStateDelay
19193
19203
  }
19194
19204
  return "expanded";
19195
19205
  }, [sidebarCollapsedStateRight]);
19196
- useEffect61(() => {
19206
+ useEffect60(() => {
19197
19207
  onMounted();
19198
19208
  }, [onMounted]);
19199
19209
  const canvasContainerStyle = useMemo96(() => ({
@@ -19363,7 +19373,7 @@ var SidebarCollapserControls = () => {
19363
19373
  toggleLeft,
19364
19374
  toggleRight
19365
19375
  ]);
19366
- useEffect62(() => {
19376
+ useEffect61(() => {
19367
19377
  const left3 = keybindings.registerKeybinding({
19368
19378
  event: "keydown",
19369
19379
  key: "b",
@@ -19441,7 +19451,7 @@ var SidebarCollapserControls = () => {
19441
19451
  import {
19442
19452
  useCallback as useCallback92,
19443
19453
  useContext as useContext60,
19444
- useEffect as useEffect63,
19454
+ useEffect as useEffect62,
19445
19455
  useMemo as useMemo97,
19446
19456
  useState as useState63
19447
19457
  } from "react";
@@ -19493,7 +19503,7 @@ var UpdateCheck = () => {
19493
19503
  });
19494
19504
  return controller;
19495
19505
  }, []);
19496
- useEffect63(() => {
19506
+ useEffect62(() => {
19497
19507
  const abortUpdate = checkForUpdates();
19498
19508
  const abortBugs = checkForBugs();
19499
19509
  return () => {
@@ -19858,7 +19868,7 @@ import { PlayerInternals as PlayerInternals16 } from "@remotion/player";
19858
19868
  import {
19859
19869
  useCallback as useCallback94,
19860
19870
  useContext as useContext63,
19861
- useEffect as useEffect64,
19871
+ useEffect as useEffect63,
19862
19872
  useMemo as useMemo100,
19863
19873
  useRef as useRef35,
19864
19874
  useState as useState65
@@ -20289,7 +20299,7 @@ var Inner2 = () => {
20289
20299
  videoConfig,
20290
20300
  width
20291
20301
  ]);
20292
- useEffect64(() => {
20302
+ useEffect63(() => {
20293
20303
  if (!dragging.dragging) {
20294
20304
  return;
20295
20305
  }
@@ -20300,7 +20310,7 @@ var Inner2 = () => {
20300
20310
  window.removeEventListener("pointerup", onPointerUpScrubbing);
20301
20311
  };
20302
20312
  }, [dragging.dragging, onPointerMoveScrubbing, onPointerUpScrubbing]);
20303
- useEffect64(() => {
20313
+ useEffect63(() => {
20304
20314
  if (inOutDragging.dragging === false) {
20305
20315
  return;
20306
20316
  }
@@ -20476,7 +20486,7 @@ import { SOURCE_MAP_ENDPOINT } from "@remotion/studio-shared";
20476
20486
  import {
20477
20487
  useCallback as useCallback96,
20478
20488
  useContext as useContext64,
20479
- useEffect as useEffect65,
20489
+ useEffect as useEffect64,
20480
20490
  useMemo as useMemo101,
20481
20491
  useState as useState66
20482
20492
  } from "react";
@@ -20565,7 +20575,7 @@ var TimelineStack = ({ isCompact, sequence }) => {
20565
20575
  window.open(getGitRefUrl(window.remotion_gitSource, originalLocation), "_blank");
20566
20576
  }
20567
20577
  }, [canOpenInEditor, canOpenInGitHub, openEditor, originalLocation]);
20568
- useEffect65(() => {
20578
+ useEffect64(() => {
20569
20579
  if (!sequence.stack) {
20570
20580
  return;
20571
20581
  }
@@ -20713,14 +20723,14 @@ var TimelineListItem = ({ nestedDepth, sequence, isCompact }) => {
20713
20723
  };
20714
20724
 
20715
20725
  // src/components/Timeline/TimelineTimeIndicators.tsx
20716
- import { useContext as useContext66, useEffect as useEffect67, useMemo as useMemo103, useRef as useRef37 } from "react";
20726
+ import { useContext as useContext66, useEffect as useEffect66, useMemo as useMemo103, useRef as useRef37 } from "react";
20717
20727
  import { Internals as Internals50 } from "remotion";
20718
20728
 
20719
20729
  // src/components/TimeValue.tsx
20720
20730
  import { PlayerInternals as PlayerInternals17 } from "@remotion/player";
20721
20731
  import {
20722
20732
  useCallback as useCallback98,
20723
- useEffect as useEffect66,
20733
+ useEffect as useEffect65,
20724
20734
  useImperativeHandle as useImperativeHandle13,
20725
20735
  useRef as useRef36
20726
20736
  } from "react";
@@ -20773,7 +20783,7 @@ var TimeValue = () => {
20773
20783
  pause,
20774
20784
  toggle
20775
20785
  }), [seek, play, pause, toggle]);
20776
- useEffect66(() => {
20786
+ useEffect65(() => {
20777
20787
  const gKey = keybindings.registerKeybinding({
20778
20788
  event: "keypress",
20779
20789
  key: "g",
@@ -20886,7 +20896,7 @@ var TimelineTimeIndicators = () => {
20886
20896
  };
20887
20897
  var Inner3 = ({ windowWidth, durationInFrames, fps }) => {
20888
20898
  const ref = useRef37(null);
20889
- useEffect67(() => {
20899
+ useEffect66(() => {
20890
20900
  const currentRef = ref.current;
20891
20901
  if (!currentRef) {
20892
20902
  return;
@@ -20993,7 +21003,7 @@ var TimelineList = ({ timeline }) => {
20993
21003
  };
20994
21004
 
20995
21005
  // src/components/Timeline/TimelinePlayCursorSyncer.tsx
20996
- import { useContext as useContext67, useEffect as useEffect68 } from "react";
21006
+ import { useContext as useContext67, useEffect as useEffect67 } from "react";
20997
21007
  import { Internals as Internals51 } from "remotion";
20998
21008
  var lastTimelinePositionWhileScrolling = null;
20999
21009
  var TimelinePlayCursorSyncer = () => {
@@ -21011,7 +21021,7 @@ var TimelinePlayCursorSyncer = () => {
21011
21021
  setCurrentFps(video.fps);
21012
21022
  }
21013
21023
  const playing = timelineContext.playing ?? false;
21014
- useEffect68(() => {
21024
+ useEffect67(() => {
21015
21025
  if (!video) {
21016
21026
  return;
21017
21027
  }
@@ -21024,7 +21034,7 @@ var TimelinePlayCursorSyncer = () => {
21024
21034
  frame: timelinePosition
21025
21035
  });
21026
21036
  }, [playing, timelineContext, timelinePosition, video]);
21027
- useEffect68(() => {
21037
+ useEffect67(() => {
21028
21038
  const { current } = scrollableRef;
21029
21039
  if (!current) {
21030
21040
  return;
@@ -36027,7 +36037,7 @@ var readAscii = (slice, length) => {
36027
36037
  */
36028
36038
 
36029
36039
  // src/helpers/use-max-media-duration.ts
36030
- import { useEffect as useEffect69, useState as useState67 } from "react";
36040
+ import { useEffect as useEffect68, useState as useState67 } from "react";
36031
36041
  var cache = new Map;
36032
36042
  var getSrc = (s) => {
36033
36043
  if (s.type === "video") {
@@ -36041,7 +36051,7 @@ var getSrc = (s) => {
36041
36051
  var useMaxMediaDuration = (s, fps) => {
36042
36052
  const src = getSrc(s);
36043
36053
  const [maxMediaDuration, setMaxMediaDuration] = useState67(src ? cache.get(src) ?? null : Infinity);
36044
- useEffect69(() => {
36054
+ useEffect68(() => {
36045
36055
  if (!src) {
36046
36056
  return;
36047
36057
  }
@@ -36071,7 +36081,7 @@ var useMaxMediaDuration = (s, fps) => {
36071
36081
 
36072
36082
  // src/components/AudioWaveform.tsx
36073
36083
  import { getAudioData, getWaveformPortion } from "@remotion/media-utils";
36074
- import { useEffect as useEffect70, useMemo as useMemo106, useRef as useRef39, useState as useState68 } from "react";
36084
+ import { useEffect as useEffect69, useMemo as useMemo106, useRef as useRef39, useState as useState68 } from "react";
36075
36085
  import { Internals as Internals52 } from "remotion";
36076
36086
 
36077
36087
  // src/components/AudioWaveformBar.tsx
@@ -36136,14 +36146,14 @@ var AudioWaveform = ({
36136
36146
  throw new Error("Expected video config");
36137
36147
  }
36138
36148
  const canvas = useRef39(null);
36139
- useEffect70(() => {
36149
+ useEffect69(() => {
36140
36150
  const { current } = mountState;
36141
36151
  current.isMounted = true;
36142
36152
  return () => {
36143
36153
  current.isMounted = false;
36144
36154
  };
36145
36155
  }, []);
36146
- useEffect70(() => {
36156
+ useEffect69(() => {
36147
36157
  if (!canvas.current) {
36148
36158
  return;
36149
36159
  }
@@ -36170,7 +36180,7 @@ var AudioWaveform = ({
36170
36180
  context.strokeStyle = LIGHT_TRANSPARENT;
36171
36181
  context.stroke();
36172
36182
  }, [visualizationWidth, metadata, startFrom, volume, doesVolumeChange]);
36173
- useEffect70(() => {
36183
+ useEffect69(() => {
36174
36184
  setError(null);
36175
36185
  getAudioData(src).then((data) => {
36176
36186
  if (mountState.current.isMounted) {
@@ -36345,7 +36355,7 @@ var TimelineSequenceFrame = ({ roundedFrame, premounted, postmounted }) => {
36345
36355
  };
36346
36356
 
36347
36357
  // src/components/Timeline/TimelineVideoInfo.tsx
36348
- import { useEffect as useEffect71, useRef as useRef40, useState as useState69 } from "react";
36358
+ import { useEffect as useEffect70, useRef as useRef40, useState as useState69 } from "react";
36349
36359
  import { useVideoConfig as useVideoConfig5 } from "remotion";
36350
36360
 
36351
36361
  // src/helpers/extract-frames.ts
@@ -36663,12 +36673,12 @@ var TimelineVideoInfo = ({ src, visualizationWidth, startFrom, durationInFrames
36663
36673
  const ref = useRef40(null);
36664
36674
  const [error, setError] = useState69(null);
36665
36675
  const aspectRatio = useRef40(getAspectRatioFromCache(src));
36666
- useEffect71(() => {
36676
+ useEffect70(() => {
36667
36677
  return () => {
36668
36678
  clearFramesForSrc(src);
36669
36679
  };
36670
36680
  }, [src]);
36671
- useEffect71(() => {
36681
+ useEffect70(() => {
36672
36682
  if (error) {
36673
36683
  return;
36674
36684
  }
@@ -37121,13 +37131,13 @@ var EditorContent = ({ readOnlyStudio, children }) => {
37121
37131
  };
37122
37132
 
37123
37133
  // src/components/GlobalKeybindings.tsx
37124
- import { useContext as useContext71, useEffect as useEffect72 } from "react";
37134
+ import { useContext as useContext71, useEffect as useEffect71 } from "react";
37125
37135
  var GlobalKeybindings = () => {
37126
37136
  const keybindings = useKeybinding();
37127
37137
  const { setSelectedModal } = useContext71(ModalsContext);
37128
37138
  const { setCheckerboard } = useContext71(CheckerboardContext);
37129
37139
  const { navigateToNextComposition, navigateToPreviousComposition } = useCompositionNavigation();
37130
- useEffect72(() => {
37140
+ useEffect71(() => {
37131
37141
  const nKey = keybindings.registerKeybinding({
37132
37142
  event: "keypress",
37133
37143
  key: "n",
@@ -37232,8 +37242,13 @@ var GlobalKeybindings = () => {
37232
37242
  import { useContext as useContext85 } from "react";
37233
37243
 
37234
37244
  // src/components/InstallPackage.tsx
37235
- import { apiDocs, descriptions, installableMap } from "@remotion/studio-shared";
37236
- import React144, { useCallback as useCallback100, useContext as useContext73, useEffect as useEffect73 } from "react";
37245
+ import {
37246
+ apiDocs,
37247
+ descriptions,
37248
+ extraPackages,
37249
+ installableMap
37250
+ } from "@remotion/studio-shared";
37251
+ import React144, { useCallback as useCallback100, useContext as useContext73, useEffect as useEffect72 } from "react";
37237
37252
  import { VERSION as VERSION2 } from "remotion";
37238
37253
 
37239
37254
  // src/api/install-package.ts
@@ -37367,7 +37382,7 @@ var InstallPackageModal = ({ packageManager }) => {
37367
37382
  const canSelectPackages = state.type === "idle" && ctx.type === "connected";
37368
37383
  const disabled = !(canSelectPackages || state.type === "done") || selectedPackages.length === 0;
37369
37384
  const { registerKeybinding } = useKeybinding();
37370
- useEffect73(() => {
37385
+ useEffect72(() => {
37371
37386
  if (disabled) {
37372
37387
  return;
37373
37388
  }
@@ -37412,42 +37427,72 @@ var InstallPackageModal = ({ packageManager }) => {
37412
37427
  selectedPackages.length === 1 ? "" : "s",
37413
37428
  ". Check your terminal for progress."
37414
37429
  ]
37415
- }) : /* @__PURE__ */ jsx209("div", {
37430
+ }) : /* @__PURE__ */ jsxs103("div", {
37416
37431
  style: text2,
37417
- children: Object.entries(installableMap).filter(([, install]) => install).map(([pkgShort]) => {
37418
- const pkg = pkgShort === "core" ? "remotion" : `@remotion/${pkgShort}`;
37419
- const isInstalled = window.remotion_installedPackages?.includes(pkg) ?? false;
37420
- const link = apiDocs[pkgShort];
37421
- const description = descriptions[pkgShort];
37422
- if (!link) {
37423
- throw new Error("No link for " + pkg);
37424
- }
37425
- if (!description) {
37426
- throw new Error("No description for " + pkg);
37427
- }
37428
- return /* @__PURE__ */ jsxs103(Row, {
37429
- align: "center",
37430
- children: [
37431
- /* @__PURE__ */ jsx209(Checkbox, {
37432
- checked: map[pkg],
37433
- name: pkg,
37434
- onChange: () => {
37435
- setMap((prev) => ({ ...prev, [pkg]: !prev[pkg] }));
37436
- },
37437
- disabled: !canSelectPackages || isInstalled
37438
- }),
37439
- /* @__PURE__ */ jsx209(Spacing, {
37440
- x: 1.5
37441
- }),
37442
- /* @__PURE__ */ jsx209(InstallablePackageComp, {
37443
- description,
37444
- isInstalled,
37445
- link,
37446
- pkg
37447
- })
37448
- ]
37449
- }, pkg);
37450
- })
37432
+ children: [
37433
+ Object.entries(installableMap).filter(([, install]) => install).map(([pkgShort]) => {
37434
+ const pkg = pkgShort === "core" ? "remotion" : `@remotion/${pkgShort}`;
37435
+ const isInstalled = window.remotion_installedPackages?.includes(pkg) ?? false;
37436
+ const link = apiDocs[pkgShort];
37437
+ const description = descriptions[pkgShort];
37438
+ if (!link) {
37439
+ throw new Error("No link for " + pkg);
37440
+ }
37441
+ if (!description) {
37442
+ throw new Error("No description for " + pkg);
37443
+ }
37444
+ return /* @__PURE__ */ jsxs103(Row, {
37445
+ align: "center",
37446
+ children: [
37447
+ /* @__PURE__ */ jsx209(Checkbox, {
37448
+ checked: map[pkg],
37449
+ name: pkg,
37450
+ onChange: () => {
37451
+ setMap((prev) => ({ ...prev, [pkg]: !prev[pkg] }));
37452
+ },
37453
+ disabled: !canSelectPackages || isInstalled
37454
+ }),
37455
+ /* @__PURE__ */ jsx209(Spacing, {
37456
+ x: 1.5
37457
+ }),
37458
+ /* @__PURE__ */ jsx209(InstallablePackageComp, {
37459
+ description,
37460
+ isInstalled,
37461
+ link,
37462
+ pkg
37463
+ })
37464
+ ]
37465
+ }, pkg);
37466
+ }),
37467
+ extraPackages.map((extraPkg) => {
37468
+ const isInstalled = window.remotion_installedPackages?.includes(extraPkg.name) ?? false;
37469
+ return /* @__PURE__ */ jsxs103(Row, {
37470
+ align: "center",
37471
+ children: [
37472
+ /* @__PURE__ */ jsx209(Checkbox, {
37473
+ checked: map[extraPkg.name],
37474
+ name: extraPkg.name,
37475
+ onChange: () => {
37476
+ setMap((prev) => ({
37477
+ ...prev,
37478
+ [extraPkg.name]: !prev[extraPkg.name]
37479
+ }));
37480
+ },
37481
+ disabled: !canSelectPackages || isInstalled
37482
+ }),
37483
+ /* @__PURE__ */ jsx209(Spacing, {
37484
+ x: 1.5
37485
+ }),
37486
+ /* @__PURE__ */ jsx209(InstallablePackageComp, {
37487
+ description: extraPkg.description,
37488
+ isInstalled,
37489
+ link: extraPkg.docsUrl,
37490
+ pkg: `${extraPkg.name}@${extraPkg.version}`
37491
+ })
37492
+ ]
37493
+ }, extraPkg.name);
37494
+ })
37495
+ ]
37451
37496
  })
37452
37497
  }),
37453
37498
  /* @__PURE__ */ jsx209(ModalFooterContainer, {
@@ -37491,7 +37536,7 @@ var InstallPackageModal = ({ packageManager }) => {
37491
37536
  import { useCallback as useCallback102, useContext as useContext76, useMemo as useMemo112 } from "react";
37492
37537
 
37493
37538
  // src/components/RenderModal/ResolveCompositionBeforeModal.tsx
37494
- import React145, { useContext as useContext74, useEffect as useEffect74, useMemo as useMemo111 } from "react";
37539
+ import React145, { useContext as useContext74, useEffect as useEffect73, useMemo as useMemo111 } from "react";
37495
37540
  import { Internals as Internals56 } from "remotion";
37496
37541
  import { jsx as jsx210, jsxs as jsxs104 } from "react/jsx-runtime";
37497
37542
  var loaderContainer2 = {
@@ -37515,7 +37560,7 @@ var ResolveCompositionBeforeModal = ({ compositionId, children }) => {
37515
37560
  const resolved = Internals56.useResolvedVideoConfig(compositionId);
37516
37561
  const unresolvedContext = useContext74(Internals56.CompositionManager);
37517
37562
  const unresolved = unresolvedContext.compositions.find((c) => compositionId === c.id);
37518
- useEffect74(() => {
37563
+ useEffect73(() => {
37519
37564
  const { current } = Internals56.resolveCompositionsRef;
37520
37565
  if (!current) {
37521
37566
  throw new Error("No ref to trigger composition calc");
@@ -37573,7 +37618,7 @@ var ResolveCompositionBeforeModal = ({ compositionId, children }) => {
37573
37618
  };
37574
37619
 
37575
37620
  // src/components/NewComposition/CodemodFooter.tsx
37576
- import { useCallback as useCallback101, useContext as useContext75, useEffect as useEffect75, useState as useState70 } from "react";
37621
+ import { useCallback as useCallback101, useContext as useContext75, useEffect as useEffect74, useState as useState70 } from "react";
37577
37622
 
37578
37623
  // src/components/NewComposition/DiffPreview.tsx
37579
37624
  import { jsx as jsx211, jsxs as jsxs105 } from "react/jsx-runtime";
@@ -37638,7 +37683,7 @@ var CodemodFooter = ({
37638
37683
  type: "loading"
37639
37684
  });
37640
37685
  const [projectInfo, setProjectInfo] = useState70(null);
37641
- useEffect75(() => {
37686
+ useEffect74(() => {
37642
37687
  const controller = new AbortController;
37643
37688
  getProjectInfo(controller.signal).then((info) => {
37644
37689
  setProjectInfo(info.projectInfo);
@@ -37684,7 +37729,7 @@ var CodemodFooter = ({
37684
37729
  });
37685
37730
  }
37686
37731
  }, [codemod]);
37687
- useEffect75(() => {
37732
+ useEffect74(() => {
37688
37733
  const abortController = new AbortController;
37689
37734
  let aborted = false;
37690
37735
  getCanApplyCodemod(abortController.signal).then(() => {
@@ -37702,7 +37747,7 @@ var CodemodFooter = ({
37702
37747
  }, [codemodStatus, getCanApplyCodemod, setSelectedModal]);
37703
37748
  const disabled = !valid || submitting || projectInfo === null || codemodStatus.type !== "success";
37704
37749
  const { registerKeybinding } = useKeybinding();
37705
- useEffect75(() => {
37750
+ useEffect74(() => {
37706
37751
  if (disabled) {
37707
37752
  return;
37708
37753
  }
@@ -38524,7 +38569,7 @@ var OverrideInputPropsModal = () => {
38524
38569
  import {
38525
38570
  useCallback as useCallback107,
38526
38571
  useContext as useContext80,
38527
- useEffect as useEffect77,
38572
+ useEffect as useEffect76,
38528
38573
  useMemo as useMemo117,
38529
38574
  useRef as useRef42,
38530
38575
  useState as useState75
@@ -39324,7 +39369,7 @@ var QuickSwitcherNoResults = ({ query, mode }) => {
39324
39369
  };
39325
39370
 
39326
39371
  // src/components/QuickSwitcher/QuickSwitcherResult.tsx
39327
- import { useEffect as useEffect76, useMemo as useMemo116, useRef as useRef41, useState as useState74 } from "react";
39372
+ import { useEffect as useEffect75, useMemo as useMemo116, useRef as useRef41, useState as useState74 } from "react";
39328
39373
  import { jsx as jsx221, jsxs as jsxs114, Fragment as Fragment35 } from "react/jsx-runtime";
39329
39374
  var container49 = {
39330
39375
  paddingLeft: 16,
@@ -39356,7 +39401,7 @@ var QuickSwitcherResult = ({ result, selected }) => {
39356
39401
  const [hovered, setIsHovered] = useState74(false);
39357
39402
  const ref = useRef41(null);
39358
39403
  const keybindings = useKeybinding();
39359
- useEffect76(() => {
39404
+ useEffect75(() => {
39360
39405
  const { current } = ref;
39361
39406
  if (!current) {
39362
39407
  return;
@@ -39370,7 +39415,7 @@ var QuickSwitcherResult = ({ result, selected }) => {
39370
39415
  current.removeEventListener("mouseleave", onMouseLeave);
39371
39416
  };
39372
39417
  }, []);
39373
- useEffect76(() => {
39418
+ useEffect75(() => {
39374
39419
  if (!selected) {
39375
39420
  return;
39376
39421
  }
@@ -39387,7 +39432,7 @@ var QuickSwitcherResult = ({ result, selected }) => {
39387
39432
  binding.unregister();
39388
39433
  };
39389
39434
  }, [keybindings, result.onSelected, selected]);
39390
- useEffect76(() => {
39435
+ useEffect75(() => {
39391
39436
  if (selected) {
39392
39437
  ref.current?.scrollIntoView({
39393
39438
  block: "nearest",
@@ -39601,7 +39646,7 @@ var QuickSwitcherContent = ({ initialMode, invocationTimestamp, readOnlyStudio }
39601
39646
  selectedIndex: 0
39602
39647
  };
39603
39648
  });
39604
- useEffect77(() => {
39649
+ useEffect76(() => {
39605
39650
  setState({
39606
39651
  query: mapModeToQuery(initialMode),
39607
39652
  selectedIndex: 0
@@ -39675,7 +39720,7 @@ var QuickSwitcherContent = ({ initialMode, invocationTimestamp, readOnlyStudio }
39675
39720
  };
39676
39721
  });
39677
39722
  }, []);
39678
- useEffect77(() => {
39723
+ useEffect76(() => {
39679
39724
  const binding = keybindings.registerKeybinding({
39680
39725
  key: "ArrowUp",
39681
39726
  callback: onArrowUp,
@@ -39689,7 +39734,7 @@ var QuickSwitcherContent = ({ initialMode, invocationTimestamp, readOnlyStudio }
39689
39734
  binding.unregister();
39690
39735
  };
39691
39736
  }, [keybindings, onArrowDown, onArrowUp]);
39692
- useEffect77(() => {
39737
+ useEffect76(() => {
39693
39738
  if (mode !== "docs") {
39694
39739
  return;
39695
39740
  }
@@ -39714,7 +39759,7 @@ var QuickSwitcherContent = ({ initialMode, invocationTimestamp, readOnlyStudio }
39714
39759
  cancelled = true;
39715
39760
  };
39716
39761
  }, [actualQuery, mode]);
39717
- useEffect77(() => {
39762
+ useEffect76(() => {
39718
39763
  const binding = keybindings.registerKeybinding({
39719
39764
  key: "ArrowDown",
39720
39765
  callback: onArrowDown,
@@ -40368,7 +40413,7 @@ import { getDefaultOutLocation } from "@remotion/studio-shared";
40368
40413
  import {
40369
40414
  useCallback as useCallback127,
40370
40415
  useContext as useContext83,
40371
- useEffect as useEffect80,
40416
+ useEffect as useEffect79,
40372
40417
  useMemo as useMemo128,
40373
40418
  useReducer as useReducer2,
40374
40419
  useRef as useRef44,
@@ -40538,7 +40583,7 @@ import { useCallback as useCallback112 } from "react";
40538
40583
  import { BrowserSafeApis } from "@remotion/renderer/client";
40539
40584
 
40540
40585
  // src/components/RenderModal/CliCopyButton.tsx
40541
- import { useCallback as useCallback111, useEffect as useEffect78, useMemo as useMemo121, useState as useState78 } from "react";
40586
+ import { useCallback as useCallback111, useEffect as useEffect77, useMemo as useMemo121, useState as useState78 } from "react";
40542
40587
  import { jsx as jsx234 } from "react/jsx-runtime";
40543
40588
  var svgStyle2 = {
40544
40589
  width: 16,
@@ -40589,7 +40634,7 @@ var CliCopyButton = ({
40589
40634
  const onPointerLeave = useCallback111(() => {
40590
40635
  setHovered(false);
40591
40636
  }, []);
40592
- useEffect78(() => {
40637
+ useEffect77(() => {
40593
40638
  if (!copied) {
40594
40639
  return;
40595
40640
  }
@@ -41911,14 +41956,14 @@ import { BrowserSafeApis as BrowserSafeApis4 } from "@remotion/renderer/client";
41911
41956
  import { useCallback as useCallback119, useMemo as useMemo123 } from "react";
41912
41957
 
41913
41958
  // src/helpers/use-file-existence.ts
41914
- import { useContext as useContext82, useEffect as useEffect79, useRef as useRef43, useState as useState80 } from "react";
41959
+ import { useContext as useContext82, useEffect as useEffect78, useRef as useRef43, useState as useState80 } from "react";
41915
41960
  var useFileExistence = (outName) => {
41916
41961
  const [exists, setExists] = useState80(false);
41917
41962
  const { previewServerState: state, subscribeToEvent } = useContext82(StudioServerConnectionCtx);
41918
41963
  const clientId = state.type === "connected" ? state.clientId : undefined;
41919
41964
  const currentOutName = useRef43("");
41920
41965
  currentOutName.current = outName;
41921
- useEffect79(() => {
41966
+ useEffect78(() => {
41922
41967
  if (!clientId) {
41923
41968
  return;
41924
41969
  }
@@ -41934,7 +41979,7 @@ var useFileExistence = (outName) => {
41934
41979
  unsubscribeFromFileExistenceWatcher({ file: outName, clientId });
41935
41980
  };
41936
41981
  }, [clientId, outName]);
41937
- useEffect79(() => {
41982
+ useEffect78(() => {
41938
41983
  const listener = (event) => {
41939
41984
  if (event.type !== "watched-file-deleted") {
41940
41985
  return;
@@ -41951,7 +41996,7 @@ var useFileExistence = (outName) => {
41951
41996
  unsub();
41952
41997
  };
41953
41998
  }, [outName, subscribeToEvent]);
41954
- useEffect79(() => {
41999
+ useEffect78(() => {
41955
42000
  const listener = (event) => {
41956
42001
  if (event.type !== "watched-file-undeleted") {
41957
42002
  return;
@@ -44003,7 +44048,7 @@ var RenderModal = ({
44003
44048
  offthreadVideoThreads,
44004
44049
  mediaCacheSizeInBytes
44005
44050
  ]);
44006
- useEffect80(() => {
44051
+ useEffect79(() => {
44007
44052
  return () => {
44008
44053
  isMounted.current = false;
44009
44054
  };
@@ -44172,7 +44217,7 @@ var RenderModal = ({
44172
44217
  onClickVideo();
44173
44218
  }
44174
44219
  }, [renderMode, onClickStill, onClickSequence, onClickVideo]);
44175
- useEffect80(() => {
44220
+ useEffect79(() => {
44176
44221
  if (renderDisabled) {
44177
44222
  return;
44178
44223
  }
@@ -44500,7 +44545,7 @@ import {
44500
44545
  getEncodableAudioCodecs,
44501
44546
  getSupportedAudioCodecsForContainer
44502
44547
  } from "@remotion/web-renderer";
44503
- import { useEffect as useEffect81, useRef as useRef45, useState as useState82 } from "react";
44548
+ import { useEffect as useEffect80, useRef as useRef45, useState as useState82 } from "react";
44504
44549
  var useEncodableAudioCodecs = (container60) => {
44505
44550
  const cacheRef = useRef45({});
44506
44551
  const [codecsByContainer, setCodecsByContainer] = useState82(() => {
@@ -44508,7 +44553,7 @@ var useEncodableAudioCodecs = (container60) => {
44508
44553
  [container60]: getSupportedAudioCodecsForContainer(container60)
44509
44554
  };
44510
44555
  });
44511
- useEffect81(() => {
44556
+ useEffect80(() => {
44512
44557
  const cached = cacheRef.current[container60];
44513
44558
  if (cached) {
44514
44559
  return;
@@ -44542,7 +44587,7 @@ import {
44542
44587
  getEncodableVideoCodecs,
44543
44588
  getSupportedVideoCodecsForContainer
44544
44589
  } from "@remotion/web-renderer";
44545
- import { useEffect as useEffect82, useRef as useRef46, useState as useState83 } from "react";
44590
+ import { useEffect as useEffect81, useRef as useRef46, useState as useState83 } from "react";
44546
44591
  var useEncodableVideoCodecs = (container60) => {
44547
44592
  const cacheRef = useRef46({});
44548
44593
  const [codecsByContainer, setCodecsByContainer] = useState83(() => {
@@ -44550,7 +44595,7 @@ var useEncodableVideoCodecs = (container60) => {
44550
44595
  [container60]: getSupportedVideoCodecsForContainer(container60)
44551
44596
  };
44552
44597
  });
44553
- useEffect82(() => {
44598
+ useEffect81(() => {
44554
44599
  const cached = cacheRef.current[container60];
44555
44600
  if (cached) {
44556
44601
  return;
@@ -45189,7 +45234,7 @@ var WebRenderModalBasic = ({
45189
45234
  };
45190
45235
 
45191
45236
  // src/components/RenderModal/WebRenderModalLicense.tsx
45192
- import { useCallback as useCallback129, useEffect as useEffect83, useState as useState84 } from "react";
45237
+ import { useCallback as useCallback129, useEffect as useEffect82, useState as useState84 } from "react";
45193
45238
 
45194
45239
  // src/icons/check-circle-filled.tsx
45195
45240
  import { jsx as jsx264 } from "react/jsx-runtime";
@@ -45411,7 +45456,7 @@ var WebRenderModalLicense = ({
45411
45456
  }) => {
45412
45457
  const [licenseValidation, setLicenseValidation] = useState84({ valid: true, message: null, details: null });
45413
45458
  const [isLoading, setIsLoading] = useState84(false);
45414
- useEffect83(() => {
45459
+ useEffect82(() => {
45415
45460
  if (licenseKey === null || licenseKey === "free-license") {
45416
45461
  return setLicenseValidation({
45417
45462
  valid: true,
@@ -45760,7 +45805,21 @@ var WebRenderModal = ({
45760
45805
  inFrameMark,
45761
45806
  outFrameMark,
45762
45807
  initialLogLevel,
45763
- initialLicenseKey
45808
+ initialLicenseKey,
45809
+ initialStillImageFormat,
45810
+ initialDefaultOutName,
45811
+ initialScale,
45812
+ initialDelayRenderTimeout,
45813
+ initialMediaCacheSizeInBytes,
45814
+ initialContainer,
45815
+ initialVideoCodec,
45816
+ initialAudioCodec,
45817
+ initialAudioBitrate,
45818
+ initialVideoBitrate,
45819
+ initialHardwareAcceleration,
45820
+ initialKeyframeIntervalInSeconds,
45821
+ initialTransparent,
45822
+ initialMuted
45764
45823
  }) => {
45765
45824
  const context = useContext84(ResolvedCompositionContext);
45766
45825
  const { setSelectedModal } = useContext84(ModalsContext);
@@ -45778,25 +45837,25 @@ var WebRenderModal = ({
45778
45837
  });
45779
45838
  const [renderMode, setRenderMode] = useState85(isVideo ? "video" : "still");
45780
45839
  const [tab, setTab] = useState85("general");
45781
- const [imageFormat, setImageFormat] = useState85("png");
45840
+ const [imageFormat, setImageFormat] = useState85(() => initialStillImageFormat ?? "png");
45782
45841
  const [frame2, setFrame] = useState85(() => initialFrame);
45783
45842
  const [logLevel, setLogLevel] = useState85(() => initialLogLevel);
45784
45843
  const [inputProps, setInputProps] = useState85(() => defaultProps);
45785
- const [delayRenderTimeout, setDelayRenderTimeout] = useState85(30000);
45786
- const [mediaCacheSizeInBytes, setMediaCacheSizeInBytes] = useState85(null);
45844
+ const [delayRenderTimeout, setDelayRenderTimeout] = useState85(initialDelayRenderTimeout ?? 30000);
45845
+ const [mediaCacheSizeInBytes, setMediaCacheSizeInBytes] = useState85(initialMediaCacheSizeInBytes);
45787
45846
  const [saving, setSaving] = useState85(false);
45788
- const [codec, setCodec] = useState85("h264");
45789
- const [container61, setContainer] = useState85("mp4");
45790
- const [audioCodec, setAudioCodec] = useState85("aac");
45791
- const [audioBitrate, setAudioBitrate] = useState85("medium");
45792
- const [videoBitrate, setVideoBitrate] = useState85("high");
45793
- const [hardwareAcceleration, setHardwareAcceleration] = useState85("no-preference");
45794
- const [keyframeIntervalInSeconds, setKeyframeIntervalInSeconds] = useState85(5);
45795
- const [startFrame, setStartFrame] = useState85(() => inFrameMark ?? null);
45796
- const [endFrame, setEndFrame] = useState85(() => outFrameMark ?? null);
45797
- const [transparent, setTransparent] = useState85(false);
45798
- const [muted, setMuted] = useState85(false);
45799
- const [scale, setScale] = useState85(1);
45847
+ const [codec, setCodec] = useState85(initialVideoCodec ?? "h264");
45848
+ const [container61, setContainer] = useState85(initialContainer ?? "mp4");
45849
+ const [audioCodec, setAudioCodec] = useState85(initialAudioCodec ?? "aac");
45850
+ const [audioBitrate, setAudioBitrate] = useState85(initialAudioBitrate ?? "medium");
45851
+ const [videoBitrate, setVideoBitrate] = useState85(initialVideoBitrate ?? "high");
45852
+ const [hardwareAcceleration, setHardwareAcceleration] = useState85(initialHardwareAcceleration ?? "no-preference");
45853
+ const [keyframeIntervalInSeconds, setKeyframeIntervalInSeconds] = useState85(initialKeyframeIntervalInSeconds ?? 5);
45854
+ const [startFrame, setStartFrame] = useState85(() => inFrameMark);
45855
+ const [endFrame, setEndFrame] = useState85(() => outFrameMark);
45856
+ const [transparent, setTransparent] = useState85(initialTransparent ?? false);
45857
+ const [muted, setMuted] = useState85(initialMuted ?? false);
45858
+ const [scale, setScale] = useState85(initialScale ?? 1);
45800
45859
  const [licenseKey, setLicenseKey] = useState85(initialLicenseKey);
45801
45860
  const encodableAudioCodecs = useEncodableAudioCodecs(container61);
45802
45861
  const encodableVideoCodecs = useEncodableVideoCodecs(container61);
@@ -45824,7 +45883,10 @@ var WebRenderModal = ({
45824
45883
  }
45825
45884
  return Math.max(0, Math.min(finalEndFrame, startFrame));
45826
45885
  }, [finalEndFrame, startFrame]);
45827
- const [initialOutName] = useState85(() => {
45886
+ const [initialOutNameState] = useState85(() => {
45887
+ if (initialDefaultOutName) {
45888
+ return initialDefaultOutName;
45889
+ }
45828
45890
  return getDefaultOutLocation2({
45829
45891
  compositionName: resolvedComposition.id,
45830
45892
  defaultExtension: renderMode === "still" ? imageFormat : isVideo ? container61 : imageFormat,
@@ -45833,7 +45895,7 @@ var WebRenderModal = ({
45833
45895
  clientSideRender: true
45834
45896
  });
45835
45897
  });
45836
- const [outName, setOutName] = useState85(() => initialOutName);
45898
+ const [outName, setOutName] = useState85(() => initialOutNameState);
45837
45899
  const setStillFormat = useCallback131((format) => {
45838
45900
  setImageFormat(format);
45839
45901
  setOutName((prev) => {
@@ -46245,7 +46307,7 @@ var WebRenderModalWithLoader = (props) => {
46245
46307
  import { useCallback as useCallback134, useMemo as useMemo135 } from "react";
46246
46308
 
46247
46309
  // src/components/CopyButton.tsx
46248
- import { useCallback as useCallback132, useEffect as useEffect84, useState as useState86 } from "react";
46310
+ import { useCallback as useCallback132, useEffect as useEffect83, useState as useState86 } from "react";
46249
46311
  import { jsx as jsx269, jsxs as jsxs145 } from "react/jsx-runtime";
46250
46312
  var iconStyle8 = {
46251
46313
  width: 16,
@@ -46283,7 +46345,7 @@ var CopyButton = ({ textToCopy, label: label12, labelWhenCopied }) => {
46283
46345
  showNotification(`Could not copy: ${err.message}`, 2000);
46284
46346
  });
46285
46347
  }, [textToCopy]);
46286
- useEffect84(() => {
46348
+ useEffect83(() => {
46287
46349
  if (!copied) {
46288
46350
  return;
46289
46351
  }
@@ -46540,14 +46602,7 @@ var Modals = ({ readOnlyStudio }) => {
46540
46602
  }),
46541
46603
  modalContextType && modalContextType.type === "input-props-override" && /* @__PURE__ */ jsx273(OverrideInputPropsModal, {}),
46542
46604
  modalContextType && modalContextType.type === "web-render" && /* @__PURE__ */ jsx273(WebRenderModalWithLoader, {
46543
- type: "web-render",
46544
- initialFrame: modalContextType.initialFrame,
46545
- compositionId: modalContextType.compositionId,
46546
- defaultProps: modalContextType.defaultProps,
46547
- inFrameMark: modalContextType.inFrameMark,
46548
- outFrameMark: modalContextType.outFrameMark,
46549
- initialLogLevel: modalContextType.initialLogLevel,
46550
- initialLicenseKey: modalContextType.initialLicenseKey
46605
+ ...modalContextType
46551
46606
  }),
46552
46607
  modalContextType && canRender && modalContextType.type === "server-render" && /* @__PURE__ */ jsx273(RenderModalWithLoader, {
46553
46608
  initialFrame: modalContextType.initialFrame,
@@ -46635,7 +46690,7 @@ var Editor = ({ Root, readOnlyStudio }) => {
46635
46690
  triggerOnWindowResize: false,
46636
46691
  shouldApplyCssTransforms: true
46637
46692
  });
46638
- useEffect85(() => {
46693
+ useEffect84(() => {
46639
46694
  if (readOnlyStudio) {
46640
46695
  return;
46641
46696
  }
@@ -46833,7 +46888,7 @@ var ModalsProvider = ({ children }) => {
46833
46888
 
46834
46889
  // src/components/RenderQueue/ClientRenderQueueProcessor.tsx
46835
46890
  import { renderMediaOnWeb, renderStillOnWeb } from "@remotion/web-renderer";
46836
- import { useCallback as useCallback138, useContext as useContext87, useEffect as useEffect86 } from "react";
46891
+ import { useCallback as useCallback138, useContext as useContext87, useEffect as useEffect85 } from "react";
46837
46892
  var downloadBlob = (blob, filename) => {
46838
46893
  const url = URL.createObjectURL(blob);
46839
46894
  const a = document.createElement("a");
@@ -46969,7 +47024,7 @@ var ClientRenderQueueProcessor = () => {
46969
47024
  markClientJobFailed,
46970
47025
  markClientJobCancelled
46971
47026
  ]);
46972
- useEffect86(() => {
47027
+ useEffect85(() => {
46973
47028
  setProcessJobCallback(processJob);
46974
47029
  return () => setProcessJobCallback(null);
46975
47030
  }, [processJob, setProcessJobCallback]);
@@ -46977,7 +47032,7 @@ var ClientRenderQueueProcessor = () => {
46977
47032
  };
46978
47033
 
46979
47034
  // src/components/SetTimelineInOutProvider.tsx
46980
- import { useEffect as useEffect87, useMemo as useMemo141, useState as useState92 } from "react";
47035
+ import { useEffect as useEffect86, useMemo as useMemo141, useState as useState92 } from "react";
46981
47036
 
46982
47037
  // src/state/marks.ts
46983
47038
  var localStorageKey5 = () => `remotion.editor.marksv2`;
@@ -47001,7 +47056,7 @@ var SetTimelineInOutProvider = ({ children }) => {
47001
47056
  setInAndOutFrames
47002
47057
  };
47003
47058
  }, []);
47004
- useEffect87(() => {
47059
+ useEffect86(() => {
47005
47060
  persistMarks(inAndOutFrames);
47006
47061
  }, [inAndOutFrames]);
47007
47062
  return /* @__PURE__ */ jsx279(TimelineInOutContext.Provider, {