@remotion/studio 4.0.413 → 4.0.415

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.
@@ -4,14 +4,14 @@ import {
4
4
  } from "./chunk-6jf1natv.js";
5
5
 
6
6
  // src/Studio.tsx
7
- import { useLayoutEffect as useLayoutEffect2 } from "react";
7
+ import { useContext as useContext90, useLayoutEffect as useLayoutEffect2 } from "react";
8
8
  import { createPortal } from "react-dom";
9
9
  import { Internals as Internals66 } from "remotion";
10
10
 
11
11
  // src/components/Editor.tsx
12
12
  import { PlayerInternals as PlayerInternals19 } from "@remotion/player";
13
13
  import React177, { useCallback as useCallback135, useEffect as useEffect84, useMemo as useMemo136 } from "react";
14
- import { Internals as Internals62 } from "remotion";
14
+ import { Internals as Internals61 } from "remotion";
15
15
 
16
16
  // src/helpers/colors.ts
17
17
  var BACKGROUND = "rgb(31,36,40)";
@@ -856,7 +856,7 @@ var useZIndex = () => {
856
856
 
857
857
  // src/components/EditorContent.tsx
858
858
  import { useContext as useContext70 } from "react";
859
- import { Internals as Internals55 } from "remotion";
859
+ import { Internals as Internals54 } from "remotion";
860
860
 
861
861
  // src/helpers/is-current-selected-still.ts
862
862
  import { useContext as useContext5 } from "react";
@@ -10598,7 +10598,7 @@ import {
10598
10598
  useMemo as useMemo90,
10599
10599
  useState as useState56
10600
10600
  } from "react";
10601
- import { Internals as Internals37 } from "remotion";
10601
+ import { Internals as Internals36 } from "remotion";
10602
10602
 
10603
10603
  // src/visual-controls/VisualControls.tsx
10604
10604
  import {
@@ -11077,6 +11077,14 @@ var saveDefaultProps = async ({
11077
11077
  return Promise.reject(err);
11078
11078
  };
11079
11079
 
11080
+ // src/fast-refresh-context.ts
11081
+ import { createContext as createContext17 } from "react";
11082
+ var FastRefreshContext = createContext17({
11083
+ fastRefreshes: 0,
11084
+ manualRefreshes: 0,
11085
+ increaseManualRefreshes: () => {}
11086
+ });
11087
+
11080
11088
  // src/components/RenderModal/SchemaEditor/SchemaResetButton.tsx
11081
11089
  import { useCallback as useCallback43 } from "react";
11082
11090
  import { jsx as jsx96 } from "react/jsx-runtime";
@@ -11133,7 +11141,7 @@ var container24 = {
11133
11141
  flexDirection: "row"
11134
11142
  };
11135
11143
  var GlobalPropsEditorUpdateButton = ({ compositionId, currentDefaultProps }) => {
11136
- const { fastRefreshes } = useContext33(Internals28.NonceContext);
11144
+ const { fastRefreshes } = useContext33(FastRefreshContext);
11137
11145
  const [disabled, setDisabled] = React63.useState(false);
11138
11146
  const onClicked = useCallback45(() => {
11139
11147
  setDisabled(true);
@@ -11895,10 +11903,10 @@ var fieldsetLabel = {
11895
11903
  };
11896
11904
 
11897
11905
  // src/components/RenderModal/SchemaEditor/Fieldset.tsx
11898
- import { createContext as createContext17, useContext as useContext34, useMemo as useMemo58 } from "react";
11906
+ import { createContext as createContext18, useContext as useContext34, useMemo as useMemo58 } from "react";
11899
11907
  import { jsx as jsx104 } from "react/jsx-runtime";
11900
11908
  var SCHEMA_EDITOR_FIELDSET_PADDING = 10;
11901
- var AlreadyPaddedRightContext = createContext17(false);
11909
+ var AlreadyPaddedRightContext = createContext18(false);
11902
11910
  var Fieldset = ({ children, shouldPad }) => {
11903
11911
  const alreadyPadded = useContext34(AlreadyPaddedRightContext);
11904
11912
  const style8 = useMemo58(() => {
@@ -12720,7 +12728,7 @@ var ZodFieldValidation = ({ localValue, path }) => {
12720
12728
 
12721
12729
  // src/components/RenderModal/SchemaEditor/local-state.tsx
12722
12730
  import {
12723
- createContext as createContext18,
12731
+ createContext as createContext19,
12724
12732
  useCallback as useCallback53,
12725
12733
  useContext as useContext35,
12726
12734
  useEffect as useEffect42,
@@ -12730,7 +12738,7 @@ import {
12730
12738
  } from "react";
12731
12739
  import { Internals as Internals29 } from "remotion";
12732
12740
  import { jsx as jsx114 } from "react/jsx-runtime";
12733
- var RevisionContext = createContext18({
12741
+ var RevisionContext = createContext19({
12734
12742
  childResetRevision: 0
12735
12743
  });
12736
12744
  var useLocalState = ({
@@ -15628,7 +15636,7 @@ var DataEditor = ({
15628
15636
  return canSaveDefaultPropsObjectState[unresolvedComposition.id] ? canSaveDefaultPropsObjectState[unresolvedComposition.id] : defaultTypeCanSaveState;
15629
15637
  }, [canSaveDefaultPropsObjectState, unresolvedComposition.id]);
15630
15638
  const showSaveButton = mayShowSaveButton && canSaveDefaultProps.canUpdate;
15631
- const { fastRefreshes } = useContext36(Internals31.NonceContext);
15639
+ const { fastRefreshes } = useContext36(FastRefreshContext);
15632
15640
  const checkIfCanSaveDefaultProps = useCallback69(async () => {
15633
15641
  try {
15634
15642
  const can = await canUpdateDefaultProps(unresolvedComposition.id, readOnlyStudio);
@@ -16863,7 +16871,6 @@ import React107, { useContext as useContext47 } from "react";
16863
16871
 
16864
16872
  // src/components/VisualControls/VisualControlHandle.tsx
16865
16873
  import { useCallback as useCallback80, useContext as useContext46, useEffect as useEffect51, useState as useState55 } from "react";
16866
- import { Internals as Internals36 } from "remotion";
16867
16874
  import { NoReactInternals as NoReactInternals12 } from "remotion/no-react";
16868
16875
 
16869
16876
  // src/components/VisualControls/ClickableFileName.tsx
@@ -17055,8 +17062,7 @@ var VisualControlHandle = ({ value, keyName }) => {
17055
17062
  const zodTypes = useZodTypesIfPossible();
17056
17063
  const state = useContext46(VisualControlsContext);
17057
17064
  const { updateValue } = useContext46(SetVisualControlsContext);
17058
- const { fastRefreshes } = useContext46(Internals36.NonceContext);
17059
- const { increaseManualRefreshes } = useContext46(Internals36.SetNonceContext);
17065
+ const { fastRefreshes, increaseManualRefreshes } = useContext46(FastRefreshContext);
17060
17066
  const [saving, setSaving] = useState55(false);
17061
17067
  const currentValue = getVisualControlEditedValue({
17062
17068
  handles: state.handles,
@@ -17197,7 +17203,7 @@ var persistSelectedOptionsSidebarPanel2 = (panel2) => {
17197
17203
  };
17198
17204
  var optionsSidebarTabs = createRef9();
17199
17205
  var OptionsPanel = ({ readOnlyStudio }) => {
17200
- const { props, updateProps, resetUnsaved } = useContext48(Internals37.EditorPropsContext);
17206
+ const { props, updateProps, resetUnsaved } = useContext48(Internals36.EditorPropsContext);
17201
17207
  const [saving, setSaving] = useState56(false);
17202
17208
  const isMobileLayout = useMobileLayout();
17203
17209
  const visualControlsTabActivated = useContext48(VisualControlsTabActivatedContext);
@@ -17230,7 +17236,7 @@ var OptionsPanel = ({ readOnlyStudio }) => {
17230
17236
  }
17231
17237
  };
17232
17238
  }, []);
17233
- const { compositions, canvasContent } = useContext48(Internals37.CompositionManager);
17239
+ const { compositions, canvasContent } = useContext48(Internals36.CompositionManager);
17234
17240
  const composition = useMemo90(() => {
17235
17241
  if (canvasContent === null || canvasContent.type !== "composition") {
17236
17242
  return null;
@@ -17271,9 +17277,9 @@ var OptionsPanel = ({ readOnlyStudio }) => {
17271
17277
  }
17272
17278
  }, [resetUnsaved]);
17273
17279
  useEffect52(() => {
17274
- window.addEventListener(Internals37.PROPS_UPDATED_EXTERNALLY, reset);
17280
+ window.addEventListener(Internals36.PROPS_UPDATED_EXTERNALLY, reset);
17275
17281
  return () => {
17276
- window.removeEventListener(Internals37.PROPS_UPDATED_EXTERNALLY, reset);
17282
+ window.removeEventListener(Internals36.PROPS_UPDATED_EXTERNALLY, reset);
17277
17283
  };
17278
17284
  }, [reset]);
17279
17285
  return /* @__PURE__ */ jsxs78("div", {
@@ -17324,7 +17330,7 @@ var OptionsPanel = ({ readOnlyStudio }) => {
17324
17330
 
17325
17331
  // src/components/PreviewToolbar.tsx
17326
17332
  import { useContext as useContext55, useEffect as useEffect58, useRef as useRef32, useState as useState60 } from "react";
17327
- import { Internals as Internals45 } from "remotion";
17333
+ import { Internals as Internals44 } from "remotion";
17328
17334
 
17329
17335
  // src/helpers/should-show-render-button.ts
17330
17336
  var shouldShowRenderButton = (readOnlyStudio) => {
@@ -17389,7 +17395,7 @@ import {
17389
17395
  useRef as useRef30,
17390
17396
  useState as useState57
17391
17397
  } from "react";
17392
- import { Internals as Internals38 } from "remotion";
17398
+ import { Internals as Internals37 } from "remotion";
17393
17399
  import { jsxs as jsxs79 } from "react/jsx-runtime";
17394
17400
  var label6 = {
17395
17401
  color: "white",
@@ -17402,9 +17408,9 @@ var pushWithMaxSize = (arr, value, maxSize) => {
17402
17408
  return arr.slice(-maxSize);
17403
17409
  };
17404
17410
  var FpsCounter = ({ playbackSpeed }) => {
17405
- const videoConfig = Internals38.useUnsafeVideoConfig();
17406
- const [playing] = Internals38.Timeline.usePlayingState();
17407
- const frame2 = Internals38.Timeline.useTimelinePosition();
17411
+ const videoConfig = Internals37.useUnsafeVideoConfig();
17412
+ const [playing] = Internals37.Timeline.usePlayingState();
17413
+ const frame2 = Internals37.Timeline.useTimelinePosition();
17408
17414
  const [marker, rerender] = useState57({});
17409
17415
  const [fps, setFps] = useState57(0);
17410
17416
  const previousUpdates = useRef30([]);
@@ -17466,7 +17472,7 @@ var FpsCounter = ({ playbackSpeed }) => {
17466
17472
 
17467
17473
  // src/components/FullscreenToggle.tsx
17468
17474
  import { useCallback as useCallback83, useContext as useContext50, useEffect as useEffect54 } from "react";
17469
- import { Internals as Internals39 } from "remotion";
17475
+ import { Internals as Internals38 } from "remotion";
17470
17476
  import { NoReactInternals as NoReactInternals14 } from "remotion/no-react";
17471
17477
  import { jsx as jsx163 } from "react/jsx-runtime";
17472
17478
  var accessibilityLabel3 = [
@@ -17475,7 +17481,7 @@ var accessibilityLabel3 = [
17475
17481
  ].filter(NoReactInternals14.truthy).join(" ");
17476
17482
  var FullScreenToggle = () => {
17477
17483
  const keybindings = useKeybinding();
17478
- const { setSize } = useContext50(Internals39.PreviewSizeContext);
17484
+ const { setSize } = useContext50(Internals38.PreviewSizeContext);
17479
17485
  const onClick = useCallback83(() => {
17480
17486
  drawRef.current?.requestFullscreen();
17481
17487
  if (document.fullscreenElement)
@@ -17602,7 +17608,7 @@ var MuteToggle = ({ muted, setMuted }) => {
17602
17608
  // src/components/PlayPause.tsx
17603
17609
  import { PlayerInternals as PlayerInternals12 } from "@remotion/player";
17604
17610
  import { useCallback as useCallback86, useEffect as useEffect55, useState as useState58 } from "react";
17605
- import { Internals as Internals40 } from "remotion";
17611
+ import { Internals as Internals39 } from "remotion";
17606
17612
 
17607
17613
  // src/icons/jump-to-start.tsx
17608
17614
  import { jsx as jsx167 } from "react/jsx-runtime";
@@ -17697,7 +17703,7 @@ var iconButton = {
17697
17703
  };
17698
17704
  var PlayPause = ({ playbackRate, loop, bufferStateDelayInMilliseconds }) => {
17699
17705
  const { inFrame, outFrame } = useTimelineInOutFramePosition();
17700
- const videoConfig = Internals40.useUnsafeVideoConfig();
17706
+ const videoConfig = Internals39.useUnsafeVideoConfig();
17701
17707
  const [showBufferIndicator, setShowBufferState] = useState58(false);
17702
17708
  const {
17703
17709
  playing,
@@ -18037,7 +18043,7 @@ var PlaybackKeyboardShortcutsManager = ({ setPlaybackRate }) => {
18037
18043
 
18038
18044
  // src/components/PlaybackRatePersistor.tsx
18039
18045
  import { useContext as useContext51, useEffect as useEffect57 } from "react";
18040
- import { Internals as Internals41 } from "remotion";
18046
+ import { Internals as Internals40 } from "remotion";
18041
18047
 
18042
18048
  // src/state/playbackrate.ts
18043
18049
  var key3 = "remotion.playbackrate";
@@ -18057,7 +18063,7 @@ var loadPlaybackRate = () => {
18057
18063
 
18058
18064
  // src/components/PlaybackRatePersistor.tsx
18059
18065
  var PlaybackRatePersistor = () => {
18060
- const { setPlaybackRate, playbackRate } = useContext51(Internals41.TimelineContext);
18066
+ const { setPlaybackRate, playbackRate } = useContext51(Internals40.TimelineContext);
18061
18067
  useEffect57(() => {
18062
18068
  setPlaybackRate(loadPlaybackRate());
18063
18069
  }, [setPlaybackRate]);
@@ -18069,7 +18075,7 @@ var PlaybackRatePersistor = () => {
18069
18075
 
18070
18076
  // src/components/PlaybackRateSelector.tsx
18071
18077
  import { useContext as useContext52, useMemo as useMemo92 } from "react";
18072
- import { Internals as Internals42 } from "remotion";
18078
+ import { Internals as Internals41 } from "remotion";
18073
18079
  import { jsx as jsx173 } from "react/jsx-runtime";
18074
18080
  var commonPlaybackRates = [
18075
18081
  -4,
@@ -18090,7 +18096,7 @@ var getPlaybackRateLabel = (playbackRate) => {
18090
18096
  var accessibilityLabel5 = "Change the playback rate";
18091
18097
  var comboStyle2 = { width: 80 };
18092
18098
  var PlaybackRateSelector = ({ playbackRate, setPlaybackRate }) => {
18093
- const { canvasContent } = useContext52(Internals42.CompositionManager);
18099
+ const { canvasContent } = useContext52(Internals41.CompositionManager);
18094
18100
  const isStill = useIsStill();
18095
18101
  const style9 = useMemo92(() => {
18096
18102
  return {
@@ -18142,7 +18148,7 @@ var PlaybackRateSelector = ({ playbackRate, setPlaybackRate }) => {
18142
18148
  import { PlayerInternals as PlayerInternals14 } from "@remotion/player";
18143
18149
  import { useCallback as useCallback88, useContext as useContext53, useMemo as useMemo93, useRef as useRef31, useState as useState59 } from "react";
18144
18150
  import ReactDOM8 from "react-dom";
18145
- import { Internals as Internals43 } from "remotion";
18151
+ import { Internals as Internals42 } from "remotion";
18146
18152
  import { jsx as jsx174, jsxs as jsxs81, Fragment as Fragment23 } from "react/jsx-runtime";
18147
18153
  var splitButtonContainer = {
18148
18154
  display: "inline-flex",
@@ -18261,9 +18267,9 @@ var RenderButton = ({
18261
18267
  }
18262
18268
  };
18263
18269
  }, []);
18264
- const video = Internals43.useVideo();
18270
+ const video = Internals42.useVideo();
18265
18271
  const getCurrentFrame2 = PlayerInternals14.useFrameImperative();
18266
- const { props } = useContext53(Internals43.EditorPropsContext);
18272
+ const { props } = useContext53(Internals42.EditorPropsContext);
18267
18273
  const openServerRenderModal = useCallback88(() => {
18268
18274
  if (!video) {
18269
18275
  return null;
@@ -18552,7 +18558,7 @@ var RenderButton = ({
18552
18558
 
18553
18559
  // src/components/Timeline/TimelineZoomControls.tsx
18554
18560
  import { useCallback as useCallback89, useContext as useContext54 } from "react";
18555
- import { Internals as Internals44 } from "remotion";
18561
+ import { Internals as Internals43 } from "remotion";
18556
18562
 
18557
18563
  // src/icons/minus.tsx
18558
18564
  import { jsx as jsx175 } from "react/jsx-runtime";
@@ -18584,7 +18590,7 @@ var iconStyle4 = {
18584
18590
  width: 14
18585
18591
  };
18586
18592
  var TimelineZoomControls = () => {
18587
- const { canvasContent } = useContext54(Internals44.CompositionManager);
18593
+ const { canvasContent } = useContext54(Internals43.CompositionManager);
18588
18594
  const { setZoom, zoom: zoomMap } = useContext54(TimelineZoomCtx);
18589
18595
  const { tabIndex } = useZIndex();
18590
18596
  const onMinusClicked = useCallback89(() => {
@@ -18707,9 +18713,9 @@ var padding2 = {
18707
18713
  width: TIMELINE_PADDING
18708
18714
  };
18709
18715
  var PreviewToolbar = ({ readOnlyStudio, bufferStateDelayInMilliseconds }) => {
18710
- const { playbackRate, setPlaybackRate } = useContext55(Internals45.TimelineContext);
18711
- const { mediaMuted } = useContext55(Internals45.MediaVolumeContext);
18712
- const { setMediaMuted } = useContext55(Internals45.SetMediaVolumeContext);
18716
+ const { playbackRate, setPlaybackRate } = useContext55(Internals44.TimelineContext);
18717
+ const { mediaMuted } = useContext55(Internals44.MediaVolumeContext);
18718
+ const { setMediaMuted } = useContext55(Internals44.SetMediaVolumeContext);
18713
18719
  const isVideoComposition = useIsVideoComposition();
18714
18720
  const previewToolbarRef = useRef32(null);
18715
18721
  const leftScrollIndicatorRef = useRef32(null);
@@ -19653,7 +19659,7 @@ var MenuToolbar = ({ readOnlyStudio }) => {
19653
19659
 
19654
19660
  // src/components/Timeline/Timeline.tsx
19655
19661
  import { useContext as useContext69, useMemo as useMemo109 } from "react";
19656
- import { Internals as Internals54 } from "remotion";
19662
+ import { Internals as Internals53 } from "remotion";
19657
19663
 
19658
19664
  // src/helpers/get-sequence-visible-range.ts
19659
19665
  var getCascadedStart = (sequence, sequences) => {
@@ -19854,11 +19860,11 @@ import {
19854
19860
  useRef as useRef35,
19855
19861
  useState as useState65
19856
19862
  } from "react";
19857
- import { Internals as Internals47, useVideoConfig as useVideoConfig4 } from "remotion";
19863
+ import { Internals as Internals46, useVideoConfig as useVideoConfig4 } from "remotion";
19858
19864
 
19859
19865
  // src/components/Timeline/TimelineInOutPointer.tsx
19860
19866
  import { createRef as createRef10, useContext as useContext61 } from "react";
19861
- import { Internals as Internals46 } from "remotion";
19867
+ import { Internals as Internals45 } from "remotion";
19862
19868
  import { jsx as jsx185, jsxs as jsxs89, Fragment as Fragment27 } from "react/jsx-runtime";
19863
19869
  var areaHighlight = {
19864
19870
  position: "absolute",
@@ -19871,7 +19877,7 @@ var inMarkerAreaRef = createRef10();
19871
19877
  var outMarkerAreaRef = createRef10();
19872
19878
  var TimelineInOutPointer = () => {
19873
19879
  const { inFrame, outFrame } = useTimelineInOutFramePosition();
19874
- const videoConfig = Internals46.useUnsafeVideoConfig();
19880
+ const videoConfig = Internals45.useUnsafeVideoConfig();
19875
19881
  const timelineWidth = useContext61(TimelineWidthContext);
19876
19882
  if (!videoConfig || timelineWidth === null) {
19877
19883
  return null;
@@ -19967,9 +19973,9 @@ var getClientXWithScroll = (x) => {
19967
19973
  return x + scrollableRef.current?.scrollLeft;
19968
19974
  };
19969
19975
  var TimelineDragHandler = () => {
19970
- const video = Internals47.useUnsafeVideoConfig();
19976
+ const video = Internals46.useUnsafeVideoConfig();
19971
19977
  const { zoom: zoomMap } = useContext63(TimelineZoomCtx);
19972
- const { canvasContent } = useContext63(Internals47.CompositionManager);
19978
+ const { canvasContent } = useContext63(Internals46.CompositionManager);
19973
19979
  const containerStyle3 = useMemo100(() => {
19974
19980
  if (!canvasContent || canvasContent.type !== "composition") {
19975
19981
  return {};
@@ -19996,7 +20002,7 @@ var Inner2 = () => {
19996
20002
  shouldApplyCssTransforms: true
19997
20003
  });
19998
20004
  const { isHighestContext } = useZIndex();
19999
- const setFrame = Internals47.useTimelineSetFrame();
20005
+ const setFrame = Internals46.useTimelineSetFrame();
20000
20006
  const [inOutDragging, setInOutDragging] = useState65({
20001
20007
  dragging: false
20002
20008
  });
@@ -20211,7 +20217,7 @@ var Inner2 = () => {
20211
20217
  });
20212
20218
  setFrame((c) => {
20213
20219
  const newObj = { ...c, [videoConfig.id]: frame2 };
20214
- Internals47.persistCurrentFrame(newObj);
20220
+ Internals46.persistCurrentFrame(newObj);
20215
20221
  return newObj;
20216
20222
  });
20217
20223
  if (dragging.wasPlaying) {
@@ -20386,7 +20392,7 @@ import { useRef as useRef38 } from "react";
20386
20392
 
20387
20393
  // src/components/Timeline/TimelineListItem.tsx
20388
20394
  import { useCallback as useCallback97, useContext as useContext65, useMemo as useMemo102 } from "react";
20389
- import { Internals as Internals48 } from "remotion";
20395
+ import { Internals as Internals47 } from "remotion";
20390
20396
 
20391
20397
  // src/components/Timeline/TimelineLayerEye.tsx
20392
20398
  import { useCallback as useCallback95 } from "react";
@@ -20649,7 +20655,7 @@ var space = {
20649
20655
  flexShrink: 0
20650
20656
  };
20651
20657
  var TimelineListItem = ({ nestedDepth, sequence, isCompact }) => {
20652
- const { hidden, setHidden } = useContext65(Internals48.SequenceVisibilityToggleContext);
20658
+ const { hidden, setHidden } = useContext65(Internals47.SequenceVisibilityToggleContext);
20653
20659
  const padder = useMemo102(() => {
20654
20660
  return {
20655
20661
  width: Number(SPACING * 1.5) * nestedDepth,
@@ -20705,7 +20711,7 @@ var TimelineListItem = ({ nestedDepth, sequence, isCompact }) => {
20705
20711
 
20706
20712
  // src/components/Timeline/TimelineTimeIndicators.tsx
20707
20713
  import { useContext as useContext66, useEffect as useEffect66, useMemo as useMemo103, useRef as useRef37 } from "react";
20708
- import { Internals as Internals50 } from "remotion";
20714
+ import { Internals as Internals49 } from "remotion";
20709
20715
 
20710
20716
  // src/components/TimeValue.tsx
20711
20717
  import { PlayerInternals as PlayerInternals17 } from "@remotion/player";
@@ -20715,7 +20721,7 @@ import {
20715
20721
  useImperativeHandle as useImperativeHandle13,
20716
20722
  useRef as useRef36
20717
20723
  } from "react";
20718
- import { Internals as Internals49, useCurrentFrame } from "remotion";
20724
+ import { Internals as Internals48, useCurrentFrame } from "remotion";
20719
20725
  import { jsx as jsx191, jsxs as jsxs93 } from "react/jsx-runtime";
20720
20726
  var text = {
20721
20727
  color: "white",
@@ -20744,7 +20750,7 @@ var frameStyle = {
20744
20750
  };
20745
20751
  var TimeValue = () => {
20746
20752
  const frame2 = useCurrentFrame();
20747
- const config = Internals49.useUnsafeVideoConfig();
20753
+ const config = Internals48.useUnsafeVideoConfig();
20748
20754
  const isStill = useIsStill();
20749
20755
  const { seek, play, pause, toggle } = PlayerInternals17.usePlayer();
20750
20756
  const keybindings = useKeybinding();
@@ -20755,7 +20761,7 @@ var TimeValue = () => {
20755
20761
  const onValueChange = useCallback98((val) => {
20756
20762
  seek(val);
20757
20763
  }, [seek]);
20758
- useImperativeHandle13(Internals49.timeValueRef, () => ({
20764
+ useImperativeHandle13(Internals48.timeValueRef, () => ({
20759
20765
  goToFrame: () => {
20760
20766
  ref.current?.click();
20761
20767
  },
@@ -20862,7 +20868,7 @@ var TimelineTimePadding = () => {
20862
20868
  };
20863
20869
  var TimelineTimeIndicators = () => {
20864
20870
  const sliderTrack = useContext66(TimelineWidthContext);
20865
- const video = Internals50.useVideo();
20871
+ const video = Internals49.useVideo();
20866
20872
  if (sliderTrack === null) {
20867
20873
  return null;
20868
20874
  }
@@ -20985,13 +20991,13 @@ var TimelineList = ({ timeline }) => {
20985
20991
 
20986
20992
  // src/components/Timeline/TimelinePlayCursorSyncer.tsx
20987
20993
  import { useContext as useContext67, useEffect as useEffect67 } from "react";
20988
- import { Internals as Internals51 } from "remotion";
20994
+ import { Internals as Internals50 } from "remotion";
20989
20995
  var lastTimelinePositionWhileScrolling = null;
20990
20996
  var TimelinePlayCursorSyncer = () => {
20991
- const video = Internals51.useVideo();
20992
- const timelineContext = useContext67(Internals51.TimelineContext);
20993
- const timelinePosition = Internals51.Timeline.useTimelinePosition();
20994
- const { canvasContent } = useContext67(Internals51.CompositionManager);
20997
+ const video = Internals50.useVideo();
20998
+ const timelineContext = useContext67(Internals50.TimelineContext);
20999
+ const timelinePosition = Internals50.Timeline.useTimelinePosition();
21000
+ const { canvasContent } = useContext67(Internals50.CompositionManager);
20995
21001
  const { zoom: zoomMap } = useContext67(TimelineZoomCtx);
20996
21002
  const compositionId = canvasContent && canvasContent.type === "composition" ? canvasContent.compositionId : null;
20997
21003
  const zoom = compositionId ? zoomMap[compositionId] ?? TIMELINE_MIN_ZOOM : null;
@@ -21082,7 +21088,7 @@ import { useMemo as useMemo108 } from "react";
21082
21088
 
21083
21089
  // src/components/Timeline/TimelineSequence.tsx
21084
21090
  import { useContext as useContext68, useMemo as useMemo107 } from "react";
21085
- import { Internals as Internals53, useCurrentFrame as useCurrentFrame2 } from "remotion";
21091
+ import { Internals as Internals52, useCurrentFrame as useCurrentFrame2 } from "remotion";
21086
21092
 
21087
21093
  // src/helpers/get-timeline-sequence-layout.ts
21088
21094
  var SEQUENCE_BORDER_WIDTH = 1;
@@ -36063,7 +36069,7 @@ var useMaxMediaDuration = (s, fps) => {
36063
36069
  // src/components/AudioWaveform.tsx
36064
36070
  import { getAudioData, getWaveformPortion } from "@remotion/media-utils";
36065
36071
  import { useEffect as useEffect69, useMemo as useMemo106, useRef as useRef39, useState as useState68 } from "react";
36066
- import { Internals as Internals52 } from "remotion";
36072
+ import { Internals as Internals51 } from "remotion";
36067
36073
 
36068
36074
  // src/components/AudioWaveformBar.tsx
36069
36075
  import { useMemo as useMemo105 } from "react";
@@ -36122,7 +36128,7 @@ var AudioWaveform = ({
36122
36128
  const [metadata, setMetadata] = useState68(null);
36123
36129
  const [error, setError] = useState68(null);
36124
36130
  const mountState = useRef39({ isMounted: true });
36125
- const vidConf = Internals52.useUnsafeVideoConfig();
36131
+ const vidConf = Internals51.useUnsafeVideoConfig();
36126
36132
  if (vidConf === null) {
36127
36133
  throw new Error("Expected video config");
36128
36134
  }
@@ -36800,7 +36806,7 @@ var TimelineSequence = ({ s }) => {
36800
36806
  });
36801
36807
  };
36802
36808
  var Inner4 = ({ s, windowWidth }) => {
36803
- const video = Internals53.useVideo();
36809
+ const video = Internals52.useVideo();
36804
36810
  const maxMediaDuration = useMaxMediaDuration(s, video?.fps ?? 30);
36805
36811
  if (!video) {
36806
36812
  throw new TypeError("Expected video config");
@@ -36977,8 +36983,8 @@ var noop3 = () => {
36977
36983
  return;
36978
36984
  };
36979
36985
  var Timeline = () => {
36980
- const { sequences } = useContext69(Internals54.SequenceManager);
36981
- const videoConfig = Internals54.useUnsafeVideoConfig();
36986
+ const { sequences } = useContext69(Internals53.SequenceManager);
36987
+ const videoConfig = Internals53.useUnsafeVideoConfig();
36982
36988
  const timeline = useMemo109(() => {
36983
36989
  if (!videoConfig) {
36984
36990
  return [];
@@ -37071,7 +37077,7 @@ var container45 = {
37071
37077
  };
37072
37078
  var EditorContent = ({ readOnlyStudio, children }) => {
37073
37079
  const isStill = useIsStill();
37074
- const { canvasContent } = useContext70(Internals55.CompositionManager);
37080
+ const { canvasContent } = useContext70(Internals54.CompositionManager);
37075
37081
  const onlyTopPanel = canvasContent === null || isStill || canvasContent.type !== "composition";
37076
37082
  return /* @__PURE__ */ jsxs101("div", {
37077
37083
  style: container45,
@@ -37518,7 +37524,7 @@ import { useCallback as useCallback102, useContext as useContext76, useMemo as u
37518
37524
 
37519
37525
  // src/components/RenderModal/ResolveCompositionBeforeModal.tsx
37520
37526
  import React145, { useContext as useContext74, useEffect as useEffect73, useMemo as useMemo111 } from "react";
37521
- import { Internals as Internals56 } from "remotion";
37527
+ import { Internals as Internals55 } from "remotion";
37522
37528
  import { jsx as jsx210, jsxs as jsxs104 } from "react/jsx-runtime";
37523
37529
  var loaderContainer2 = {
37524
37530
  paddingTop: 40,
@@ -37538,11 +37544,11 @@ var loaderLabel2 = {
37538
37544
  };
37539
37545
  var ResolvedCompositionContext = React145.createContext(null);
37540
37546
  var ResolveCompositionBeforeModal = ({ compositionId, children }) => {
37541
- const resolved = Internals56.useResolvedVideoConfig(compositionId);
37542
- const unresolvedContext = useContext74(Internals56.CompositionManager);
37547
+ const resolved = Internals55.useResolvedVideoConfig(compositionId);
37548
+ const unresolvedContext = useContext74(Internals55.CompositionManager);
37543
37549
  const unresolved = unresolvedContext.compositions.find((c) => compositionId === c.id);
37544
37550
  useEffect73(() => {
37545
- const { current } = Internals56.resolveCompositionsRef;
37551
+ const { current } = Internals55.resolveCompositionsRef;
37546
37552
  if (!current) {
37547
37553
  throw new Error("No ref to trigger composition calc");
37548
37554
  }
@@ -37857,13 +37863,13 @@ var DeleteComposition = ({ compositionId }) => {
37857
37863
 
37858
37864
  // src/components/NewComposition/DuplicateComposition.tsx
37859
37865
  import { useCallback as useCallback104, useContext as useContext77, useMemo as useMemo113, useState as useState71 } from "react";
37860
- import { Internals as Internals58 } from "remotion";
37866
+ import { Internals as Internals57 } from "remotion";
37861
37867
 
37862
37868
  // src/helpers/validate-new-comp-data.ts
37863
- import { Internals as Internals57 } from "remotion";
37869
+ import { Internals as Internals56 } from "remotion";
37864
37870
  var validateCompositionName = (compName, compositions) => {
37865
- if (!Internals57.isCompositionIdValid(compName)) {
37866
- return Internals57.invalidCompositionErrorMessage;
37871
+ if (!Internals56.isCompositionIdValid(compName)) {
37872
+ return Internals56.invalidCompositionErrorMessage;
37867
37873
  }
37868
37874
  if (compositions.find((c) => c.id === compName)) {
37869
37875
  return `A composition with that name already exists.`;
@@ -37972,7 +37978,7 @@ var DuplicateCompositionLoaded = ({ initialType }) => {
37972
37978
  const hadFpsDefined = unresolved.fps !== undefined;
37973
37979
  const hadDurationDefined = unresolved.durationInFrames !== undefined;
37974
37980
  const [selectedFrameRate, setFrameRate] = useState71(resolved.result.fps);
37975
- const { compositions } = useContext77(Internals58.CompositionManager);
37981
+ const { compositions } = useContext77(Internals57.CompositionManager);
37976
37982
  const [type, setType] = useState71(initialCompType);
37977
37983
  const [newId, setName] = useState71(() => {
37978
37984
  const numberAtEnd = resolved.result.id.match(/([0-9]+)$/)?.[0];
@@ -38316,7 +38322,7 @@ var DuplicateComposition = ({ compositionId, compositionType }) => {
38316
38322
 
38317
38323
  // src/components/NewComposition/RenameComposition.tsx
38318
38324
  import { useCallback as useCallback105, useContext as useContext78, useMemo as useMemo114, useState as useState72 } from "react";
38319
- import { Internals as Internals59 } from "remotion";
38325
+ import { Internals as Internals58 } from "remotion";
38320
38326
  import { jsx as jsx216, jsxs as jsxs110, Fragment as Fragment33 } from "react/jsx-runtime";
38321
38327
  var content5 = {
38322
38328
  padding: 12,
@@ -38331,7 +38337,7 @@ var RenameCompositionLoaded = () => {
38331
38337
  throw new Error("Resolved composition context");
38332
38338
  }
38333
38339
  const { resolved } = context;
38334
- const { compositions } = useContext78(Internals59.CompositionManager);
38340
+ const { compositions } = useContext78(Internals58.CompositionManager);
38335
38341
  const [newId, setName] = useState72(() => {
38336
38342
  return resolved.result.id;
38337
38343
  });
@@ -38426,7 +38432,7 @@ var RenameComposition = ({ compositionId }) => {
38426
38432
 
38427
38433
  // src/components/OverrideInputProps.tsx
38428
38434
  import { useCallback as useCallback106, useContext as useContext79, useMemo as useMemo115, useState as useState73 } from "react";
38429
- import { Internals as Internals60 } from "remotion";
38435
+ import { Internals as Internals59 } from "remotion";
38430
38436
  import { jsx as jsx217, jsxs as jsxs111 } from "react/jsx-runtime";
38431
38437
  var style11 = {
38432
38438
  padding: 12,
@@ -38462,7 +38468,7 @@ var isValidJSON = (value) => {
38462
38468
  };
38463
38469
  var Inner5 = () => {
38464
38470
  const [value, setValue] = useState73(() => {
38465
- const override = Internals60.getInputPropsOverride();
38471
+ const override = Internals59.getInputPropsOverride();
38466
38472
  if (override) {
38467
38473
  return JSON.stringify(override, null, 2);
38468
38474
  }
@@ -38477,14 +38483,14 @@ var Inner5 = () => {
38477
38483
  const onChange = useCallback106((newValue) => {
38478
38484
  if (newValue.trim() === "") {
38479
38485
  setValue(null);
38480
- Internals60.setInputPropsOverride(null);
38486
+ Internals59.setInputPropsOverride(null);
38481
38487
  return;
38482
38488
  }
38483
38489
  setValue(newValue);
38484
38490
  if (!isValidJSON(newValue)) {
38485
38491
  return;
38486
38492
  }
38487
- Internals60.setInputPropsOverride(JSON.parse(newValue));
38493
+ Internals59.setInputPropsOverride(JSON.parse(newValue));
38488
38494
  }, [setValue]);
38489
38495
  const onReset = useCallback106(() => {
38490
38496
  onChange("");
@@ -38555,7 +38561,7 @@ import {
38555
38561
  useRef as useRef42,
38556
38562
  useState as useState75
38557
38563
  } from "react";
38558
- import { Internals as Internals61 } from "remotion";
38564
+ import { Internals as Internals60 } from "remotion";
38559
38565
 
38560
38566
  // src/icons/keys.tsx
38561
38567
  import { jsx as jsx218 } from "react/jsx-runtime";
@@ -39620,7 +39626,7 @@ var mapModeToQuery = (mode) => {
39620
39626
  throw new Error("no mode" + mode);
39621
39627
  };
39622
39628
  var QuickSwitcherContent = ({ initialMode, invocationTimestamp, readOnlyStudio }) => {
39623
- const { compositions } = useContext80(Internals61.CompositionManager);
39629
+ const { compositions } = useContext80(Internals60.CompositionManager);
39624
39630
  const [state, setState] = useState75(() => {
39625
39631
  return {
39626
39632
  query: mapModeToQuery(initialMode),
@@ -39668,7 +39674,7 @@ var QuickSwitcherContent = ({ initialMode, invocationTimestamp, readOnlyStudio }
39668
39674
  selectComposition(c, true);
39669
39675
  setSelectedModal(null);
39670
39676
  const selector = `.__remotion-composition[data-compname="${c.id}"]`;
39671
- Internals61.compositionSelectorRef.current?.expandComposition(c.id);
39677
+ Internals60.compositionSelectorRef.current?.expandComposition(c.id);
39672
39678
  waitForElm(selector).then(() => {
39673
39679
  document.querySelector(selector)?.scrollIntoView({ block: "center" });
39674
39680
  });
@@ -46706,13 +46712,13 @@ var Editor = ({ Root, readOnlyStudio }) => {
46706
46712
  onOutsideClick: noop,
46707
46713
  children: /* @__PURE__ */ jsxs149(TimelineZoomContext, {
46708
46714
  children: [
46709
- /* @__PURE__ */ jsx274(Internals62.CurrentScaleContext.Provider, {
46715
+ /* @__PURE__ */ jsx274(Internals61.CurrentScaleContext.Provider, {
46710
46716
  value,
46711
46717
  children: /* @__PURE__ */ jsxs149("div", {
46712
46718
  style: background2,
46713
46719
  children: [
46714
46720
  canvasMounted ? /* @__PURE__ */ jsx274(MemoRoot, {}) : null,
46715
- /* @__PURE__ */ jsxs149(Internals62.CanUseRemotionHooksProvider, {
46721
+ /* @__PURE__ */ jsxs149(Internals61.CanUseRemotionHooksProvider, {
46716
46722
  children: [
46717
46723
  /* @__PURE__ */ jsx274(EditorContent, {
46718
46724
  readOnlyStudio,
@@ -46743,7 +46749,7 @@ import { PlayerInternals as PlayerInternals20 } from "@remotion/player";
46743
46749
 
46744
46750
  // src/state/preview-size.tsx
46745
46751
  import { useCallback as useCallback136, useContext as useContext86, useMemo as useMemo137, useState as useState88 } from "react";
46746
- import { Internals as Internals63 } from "remotion";
46752
+ import { Internals as Internals62 } from "remotion";
46747
46753
  import { jsx as jsx275 } from "react/jsx-runtime";
46748
46754
  var key5 = "remotion.previewSize";
46749
46755
  var persistPreviewSizeOption = (option) => {
@@ -46792,7 +46798,7 @@ var PreviewSizeProvider = ({ children }) => {
46792
46798
  setTranslation
46793
46799
  };
46794
46800
  }, [editorZoomGestures, size4, setSize, translation]);
46795
- return /* @__PURE__ */ jsx275(Internals63.PreviewSizeContext.Provider, {
46801
+ return /* @__PURE__ */ jsx275(Internals62.PreviewSizeContext.Provider, {
46796
46802
  value: previewSizeCtx,
46797
46803
  children
46798
46804
  });
@@ -46824,7 +46830,7 @@ var CheckerboardProvider = ({ children }) => {
46824
46830
 
46825
46831
  // src/components/MediaVolumeProvider.tsx
46826
46832
  import { useMemo as useMemo139, useState as useState90 } from "react";
46827
- import { Internals as Internals64 } from "remotion";
46833
+ import { Internals as Internals63 } from "remotion";
46828
46834
  import { jsx as jsx277 } from "react/jsx-runtime";
46829
46835
  var MediaVolumeProvider = ({ children }) => {
46830
46836
  const [mediaMuted, setMediaMuted] = useState90(() => loadMuteOption());
@@ -46841,9 +46847,9 @@ var MediaVolumeProvider = ({ children }) => {
46841
46847
  setMediaVolume
46842
46848
  };
46843
46849
  }, []);
46844
- return /* @__PURE__ */ jsx277(Internals64.MediaVolumeContext.Provider, {
46850
+ return /* @__PURE__ */ jsx277(Internals63.MediaVolumeContext.Provider, {
46845
46851
  value: mediaVolumeContextValue,
46846
- children: /* @__PURE__ */ jsx277(Internals64.SetMediaVolumeContext.Provider, {
46852
+ children: /* @__PURE__ */ jsx277(Internals63.SetMediaVolumeContext.Provider, {
46847
46853
  value: setMediaVolumeContextValue,
46848
46854
  children
46849
46855
  })
@@ -47259,8 +47265,35 @@ var ServerDisconnected = () => {
47259
47265
  });
47260
47266
  };
47261
47267
 
47268
+ // src/FastRefreshProvider.tsx
47269
+ import { useCallback as useCallback142, useEffect as useEffect87, useMemo as useMemo145, useState as useState96 } from "react";
47270
+ import { jsx as jsx285 } from "react/jsx-runtime";
47271
+ var FastRefreshProvider = ({ children }) => {
47272
+ const [fastRefreshes, setFastRefreshes] = useState96(0);
47273
+ const [manualRefreshes, setManualRefreshes] = useState96(0);
47274
+ const increaseManualRefreshes = useCallback142(() => {
47275
+ setManualRefreshes((i) => i + 1);
47276
+ }, []);
47277
+ useEffect87(() => {
47278
+ if (typeof __webpack_module__ !== "undefined") {
47279
+ if (__webpack_module__.hot) {
47280
+ __webpack_module__.hot.addStatusHandler((status) => {
47281
+ if (status === "idle") {
47282
+ setFastRefreshes((i) => i + 1);
47283
+ }
47284
+ });
47285
+ }
47286
+ }
47287
+ }, []);
47288
+ const value = useMemo145(() => ({ fastRefreshes, manualRefreshes, increaseManualRefreshes }), [fastRefreshes, manualRefreshes, increaseManualRefreshes]);
47289
+ return /* @__PURE__ */ jsx285(FastRefreshContext.Provider, {
47290
+ value,
47291
+ children
47292
+ });
47293
+ };
47294
+
47262
47295
  // src/helpers/inject-css.ts
47263
- import { Internals as Internals65 } from "remotion";
47296
+ import { Internals as Internals64 } from "remotion";
47264
47297
  var makeDefaultGlobalCSS = () => {
47265
47298
  const unhoveredDragAreaFactor = 2;
47266
47299
  const fromMiddle = 50 / unhoveredDragAreaFactor;
@@ -47411,46 +47444,320 @@ var injectCSS = () => {
47411
47444
  if (injected) {
47412
47445
  return;
47413
47446
  }
47414
- Internals65.CSSUtils.injectCSS(makeDefaultGlobalCSS());
47447
+ Internals64.CSSUtils.injectCSS(makeDefaultGlobalCSS());
47415
47448
  injected = true;
47416
47449
  };
47417
47450
 
47451
+ // src/ResolveCompositionConfigInStudio.tsx
47452
+ import {
47453
+ useCallback as useCallback143,
47454
+ useContext as useContext89,
47455
+ useEffect as useEffect88,
47456
+ useImperativeHandle as useImperativeHandle14,
47457
+ useMemo as useMemo146,
47458
+ useState as useState97
47459
+ } from "react";
47460
+ import { getInputProps as getInputProps2, Internals as Internals65 } from "remotion";
47461
+ import { jsx as jsx286 } from "react/jsx-runtime";
47462
+ var ResolveCompositionConfigInStudio = ({ children }) => {
47463
+ const [currentRenderModalComposition, setCurrentRenderModalComposition] = useState97(null);
47464
+ const { compositions, canvasContent, currentCompositionMetadata } = useContext89(Internals65.CompositionManager);
47465
+ const { fastRefreshes, manualRefreshes } = useContext89(FastRefreshContext);
47466
+ if (manualRefreshes) {}
47467
+ const selectedComposition = useMemo146(() => {
47468
+ return compositions.find((c) => canvasContent && canvasContent.type === "composition" && canvasContent.compositionId === c.id);
47469
+ }, [canvasContent, compositions]);
47470
+ const renderModalComposition = compositions.find((c) => c.id === currentRenderModalComposition);
47471
+ const { props: allEditorProps } = useContext89(Internals65.EditorPropsContext);
47472
+ const env = Internals65.getRemotionEnvironment();
47473
+ const inputProps = useMemo146(() => {
47474
+ return typeof window === "undefined" || env.isPlayer ? {} : getInputProps2() ?? {};
47475
+ }, [env.isPlayer]);
47476
+ const [resolvedConfigs, setResolvedConfigs] = useState97({});
47477
+ const selectedEditorProps = useMemo146(() => {
47478
+ return selectedComposition ? allEditorProps[selectedComposition.id] ?? {} : {};
47479
+ }, [allEditorProps, selectedComposition]);
47480
+ const renderModalProps = useMemo146(() => {
47481
+ return renderModalComposition ? allEditorProps[renderModalComposition.id] ?? {} : {};
47482
+ }, [allEditorProps, renderModalComposition]);
47483
+ const hasResolution = Boolean(currentCompositionMetadata);
47484
+ const doResolution = useCallback143(({
47485
+ calculateMetadata,
47486
+ combinedProps,
47487
+ compositionDurationInFrames,
47488
+ compositionFps,
47489
+ compositionHeight,
47490
+ compositionId,
47491
+ compositionWidth,
47492
+ defaultProps
47493
+ }) => {
47494
+ const controller = new AbortController;
47495
+ if (hasResolution) {
47496
+ return controller;
47497
+ }
47498
+ const { signal } = controller;
47499
+ const result = Internals65.resolveVideoConfigOrCatch({
47500
+ compositionId,
47501
+ calculateMetadata,
47502
+ inputProps: combinedProps,
47503
+ signal,
47504
+ defaultProps,
47505
+ compositionDurationInFrames,
47506
+ compositionFps,
47507
+ compositionHeight,
47508
+ compositionWidth
47509
+ });
47510
+ if (result.type === "error") {
47511
+ setResolvedConfigs((r) => ({
47512
+ ...r,
47513
+ [compositionId]: {
47514
+ type: "error",
47515
+ error: result.error
47516
+ }
47517
+ }));
47518
+ return controller;
47519
+ }
47520
+ const promOrNot = result.result;
47521
+ if (typeof promOrNot === "object" && "then" in promOrNot) {
47522
+ setResolvedConfigs((r) => {
47523
+ const prev = r[compositionId];
47524
+ if (prev?.type === "success" || prev?.type === "success-and-refreshing") {
47525
+ return {
47526
+ ...r,
47527
+ [compositionId]: {
47528
+ type: "success-and-refreshing",
47529
+ result: prev.result
47530
+ }
47531
+ };
47532
+ }
47533
+ return {
47534
+ ...r,
47535
+ [compositionId]: {
47536
+ type: "loading"
47537
+ }
47538
+ };
47539
+ });
47540
+ promOrNot.then((c) => {
47541
+ if (controller.signal.aborted) {
47542
+ return;
47543
+ }
47544
+ setResolvedConfigs((r) => ({
47545
+ ...r,
47546
+ [compositionId]: {
47547
+ type: "success",
47548
+ result: c
47549
+ }
47550
+ }));
47551
+ }).catch((err) => {
47552
+ if (controller.signal.aborted) {
47553
+ return;
47554
+ }
47555
+ setResolvedConfigs((r) => ({
47556
+ ...r,
47557
+ [compositionId]: {
47558
+ type: "error",
47559
+ error: err
47560
+ }
47561
+ }));
47562
+ });
47563
+ } else {
47564
+ setResolvedConfigs((r) => ({
47565
+ ...r,
47566
+ [compositionId]: {
47567
+ type: "success",
47568
+ result: promOrNot
47569
+ }
47570
+ }));
47571
+ }
47572
+ return controller;
47573
+ }, [hasResolution]);
47574
+ const currentComposition = canvasContent?.type === "composition" ? canvasContent.compositionId : null;
47575
+ useImperativeHandle14(Internals65.resolveCompositionsRef, () => {
47576
+ return {
47577
+ setCurrentRenderModalComposition: (id) => {
47578
+ setCurrentRenderModalComposition(id);
47579
+ },
47580
+ reloadCurrentlySelectedComposition: () => {
47581
+ if (!currentComposition) {
47582
+ return;
47583
+ }
47584
+ const composition = compositions.find((c) => c.id === currentComposition);
47585
+ if (!composition) {
47586
+ throw new Error(`Could not find composition with id ${currentComposition}`);
47587
+ }
47588
+ const editorProps = allEditorProps[currentComposition] ?? {};
47589
+ const defaultProps = {
47590
+ ...composition.defaultProps ?? {},
47591
+ ...editorProps ?? {}
47592
+ };
47593
+ const props = {
47594
+ ...defaultProps,
47595
+ ...inputProps ?? {}
47596
+ };
47597
+ doResolution({
47598
+ defaultProps,
47599
+ calculateMetadata: composition.calculateMetadata,
47600
+ combinedProps: props,
47601
+ compositionDurationInFrames: composition.durationInFrames ?? null,
47602
+ compositionFps: composition.fps ?? null,
47603
+ compositionHeight: composition.height ?? null,
47604
+ compositionWidth: composition.width ?? null,
47605
+ compositionId: composition.id
47606
+ });
47607
+ }
47608
+ };
47609
+ }, [
47610
+ allEditorProps,
47611
+ compositions,
47612
+ currentComposition,
47613
+ doResolution,
47614
+ inputProps
47615
+ ]);
47616
+ const isTheSame = selectedComposition?.id === renderModalComposition?.id;
47617
+ const currentDefaultProps = useMemo146(() => {
47618
+ return {
47619
+ ...selectedComposition?.defaultProps ?? {},
47620
+ ...selectedEditorProps ?? {}
47621
+ };
47622
+ }, [selectedComposition?.defaultProps, selectedEditorProps]);
47623
+ const originalProps = useMemo146(() => {
47624
+ return {
47625
+ ...currentDefaultProps,
47626
+ ...inputProps ?? {}
47627
+ };
47628
+ }, [currentDefaultProps, inputProps]);
47629
+ const canResolve = selectedComposition && Boolean(selectedComposition.calculateMetadata);
47630
+ const shouldIgnoreUpdate = typeof window !== "undefined" && window.remotion_ignoreFastRefreshUpdate && fastRefreshes <= window.remotion_ignoreFastRefreshUpdate;
47631
+ useEffect88(() => {
47632
+ if (shouldIgnoreUpdate) {
47633
+ return;
47634
+ }
47635
+ if (canResolve) {
47636
+ const controller = doResolution({
47637
+ calculateMetadata: selectedComposition.calculateMetadata,
47638
+ combinedProps: originalProps,
47639
+ compositionDurationInFrames: selectedComposition.durationInFrames ?? null,
47640
+ compositionFps: selectedComposition.fps ?? null,
47641
+ compositionHeight: selectedComposition.height ?? null,
47642
+ compositionWidth: selectedComposition.width ?? null,
47643
+ defaultProps: currentDefaultProps,
47644
+ compositionId: selectedComposition.id
47645
+ });
47646
+ return () => {
47647
+ controller.abort();
47648
+ };
47649
+ }
47650
+ }, [
47651
+ canResolve,
47652
+ currentDefaultProps,
47653
+ doResolution,
47654
+ originalProps,
47655
+ selectedComposition?.calculateMetadata,
47656
+ selectedComposition?.durationInFrames,
47657
+ selectedComposition?.fps,
47658
+ selectedComposition?.height,
47659
+ selectedComposition?.id,
47660
+ selectedComposition?.width,
47661
+ shouldIgnoreUpdate
47662
+ ]);
47663
+ useEffect88(() => {
47664
+ if (renderModalComposition && !isTheSame) {
47665
+ const combinedProps = {
47666
+ ...renderModalComposition.defaultProps ?? {},
47667
+ ...renderModalProps ?? {},
47668
+ ...inputProps ?? {}
47669
+ };
47670
+ const controller = doResolution({
47671
+ calculateMetadata: renderModalComposition.calculateMetadata,
47672
+ compositionDurationInFrames: renderModalComposition.durationInFrames ?? null,
47673
+ compositionFps: renderModalComposition.fps ?? null,
47674
+ compositionHeight: renderModalComposition.height ?? null,
47675
+ compositionId: renderModalComposition.id,
47676
+ compositionWidth: renderModalComposition.width ?? null,
47677
+ defaultProps: currentDefaultProps,
47678
+ combinedProps
47679
+ });
47680
+ return () => {
47681
+ controller.abort();
47682
+ };
47683
+ }
47684
+ }, [
47685
+ currentDefaultProps,
47686
+ doResolution,
47687
+ inputProps,
47688
+ isTheSame,
47689
+ renderModalComposition,
47690
+ renderModalProps
47691
+ ]);
47692
+ const resolvedConfigsIncludingStaticOnes = useMemo146(() => {
47693
+ const staticComps = compositions.filter((c) => {
47694
+ return c.calculateMetadata === null;
47695
+ });
47696
+ return {
47697
+ ...resolvedConfigs,
47698
+ ...staticComps.reduce((acc, curr) => {
47699
+ return {
47700
+ ...acc,
47701
+ [curr.id]: {
47702
+ type: "success",
47703
+ result: { ...curr, defaultProps: curr.defaultProps ?? {} }
47704
+ }
47705
+ };
47706
+ }, {})
47707
+ };
47708
+ }, [compositions, resolvedConfigs]);
47709
+ return /* @__PURE__ */ jsx286(Internals65.ResolveCompositionContext.Provider, {
47710
+ value: resolvedConfigsIncludingStaticOnes,
47711
+ children
47712
+ });
47713
+ };
47714
+
47418
47715
  // src/Studio.tsx
47419
- import { jsx as jsx285, jsxs as jsxs152 } from "react/jsx-runtime";
47716
+ import { jsx as jsx287, jsxs as jsxs152 } from "react/jsx-runtime";
47420
47717
  var getServerDisconnectedDomElement = () => {
47421
47718
  return document.getElementById("server-disconnected-overlay");
47422
47719
  };
47423
- var Studio = ({ rootComponent, readOnly }) => {
47424
- useLayoutEffect2(() => {
47425
- injectCSS();
47426
- }, []);
47427
- return /* @__PURE__ */ jsx285(Internals66.CompositionManagerProvider, {
47720
+ var StudioInner = ({ rootComponent, readOnly }) => {
47721
+ const { fastRefreshes, manualRefreshes } = useContext90(FastRefreshContext);
47722
+ return /* @__PURE__ */ jsx287(Internals66.CompositionManagerProvider, {
47428
47723
  onlyRenderComposition: null,
47429
47724
  currentCompositionMetadata: null,
47430
47725
  initialCompositions: [],
47431
47726
  initialCanvasContent: null,
47432
- children: /* @__PURE__ */ jsx285(Internals66.RemotionRootContexts, {
47727
+ children: /* @__PURE__ */ jsx287(Internals66.RemotionRootContexts, {
47433
47728
  frameState: null,
47434
47729
  audioEnabled: window.remotion_audioEnabled,
47435
47730
  videoEnabled: window.remotion_videoEnabled,
47436
47731
  logLevel: window.remotion_logLevel,
47437
47732
  numberOfAudioTags: window.remotion_numberOfAudioTags,
47438
47733
  audioLatencyHint: window.remotion_audioLatencyHint ?? "interactive",
47439
- children: /* @__PURE__ */ jsx285(Internals66.ResolveCompositionConfigInStudio, {
47734
+ nonceContextSeed: fastRefreshes + manualRefreshes,
47735
+ children: /* @__PURE__ */ jsx287(ResolveCompositionConfigInStudio, {
47440
47736
  children: /* @__PURE__ */ jsxs152(EditorContexts, {
47441
47737
  readOnlyStudio: readOnly,
47442
47738
  children: [
47443
- /* @__PURE__ */ jsx285(Editor, {
47739
+ /* @__PURE__ */ jsx287(Editor, {
47444
47740
  readOnlyStudio: readOnly,
47445
47741
  Root: rootComponent
47446
47742
  }),
47447
- readOnly ? null : createPortal(/* @__PURE__ */ jsx285(ServerDisconnected, {}), getServerDisconnectedDomElement())
47743
+ readOnly ? null : createPortal(/* @__PURE__ */ jsx287(ServerDisconnected, {}), getServerDisconnectedDomElement())
47448
47744
  ]
47449
47745
  })
47450
47746
  })
47451
47747
  })
47452
47748
  });
47453
47749
  };
47750
+ var Studio = ({ rootComponent, readOnly }) => {
47751
+ useLayoutEffect2(() => {
47752
+ injectCSS();
47753
+ }, []);
47754
+ return /* @__PURE__ */ jsx287(FastRefreshProvider, {
47755
+ children: /* @__PURE__ */ jsx287(StudioInner, {
47756
+ rootComponent,
47757
+ readOnly
47758
+ })
47759
+ });
47760
+ };
47454
47761
 
47455
47762
  // src/internals.ts
47456
47763
  var StudioInternals = {