@remotion/studio 4.0.460 → 4.0.461

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.
Files changed (70) hide show
  1. package/dist/Studio.d.ts +0 -1
  2. package/dist/Studio.js +4 -4
  3. package/dist/components/AudioWaveform.js +17 -9
  4. package/dist/components/MenuBuildIndicator.js +1 -1
  5. package/dist/components/MenuCompositionName.js +1 -0
  6. package/dist/components/RenderButton.js +1 -1
  7. package/dist/components/Timeline/SequencePropsObserver.js +1 -1
  8. package/dist/components/Timeline/Timeline.js +11 -10
  9. package/dist/components/Timeline/TimelineBooleanField.d.ts +4 -4
  10. package/dist/components/Timeline/TimelineBooleanField.js +5 -5
  11. package/dist/components/Timeline/TimelineDragHandler.js +37 -3
  12. package/dist/components/Timeline/TimelineEnumField.d.ts +5 -5
  13. package/dist/components/Timeline/TimelineEnumField.js +7 -7
  14. package/dist/components/Timeline/TimelineExpandArrowButton.js +1 -1
  15. package/dist/components/Timeline/TimelineExpandedSection.js +3 -3
  16. package/dist/components/Timeline/TimelineFieldRow.js +49 -16
  17. package/dist/components/Timeline/TimelineHeightContainer.d.ts +1 -1
  18. package/dist/components/Timeline/TimelineHeightContainer.js +36 -3
  19. package/dist/components/Timeline/TimelineListItem.js +15 -14
  20. package/dist/components/Timeline/TimelineNumberField.d.ts +5 -5
  21. package/dist/components/Timeline/TimelineNumberField.js +12 -10
  22. package/dist/components/Timeline/TimelineRotationField.d.ts +5 -5
  23. package/dist/components/Timeline/TimelineRotationField.js +10 -10
  24. package/dist/components/Timeline/TimelineSchemaField.d.ts +4 -6
  25. package/dist/components/Timeline/TimelineSchemaField.js +8 -11
  26. package/dist/components/Timeline/TimelineSequence.js +2 -2
  27. package/dist/components/Timeline/TimelineSlider.js +2 -2
  28. package/dist/components/Timeline/TimelineStack/get-stack.js +17 -31
  29. package/dist/components/Timeline/TimelineStack/index.js +0 -10
  30. package/dist/components/Timeline/TimelineTimeIndicators.js +2 -2
  31. package/dist/components/Timeline/TimelineTracks.d.ts +1 -1
  32. package/dist/components/Timeline/TimelineTracks.js +40 -10
  33. package/dist/components/Timeline/TimelineTranslateField.d.ts +5 -5
  34. package/dist/components/Timeline/TimelineTranslateField.js +19 -37
  35. package/dist/components/Timeline/sequence-props-subscription-store.js +1 -1
  36. package/dist/components/Timeline/use-sequence-props-subscription.js +3 -3
  37. package/dist/components/Timeline/use-timeline-height.js +4 -13
  38. package/dist/error-overlay/react-overlay/utils/get-source-map.d.ts +3 -3
  39. package/dist/error-overlay/react-overlay/utils/get-source-map.js +5 -5
  40. package/dist/error-overlay/react-overlay/utils/unmapper.d.ts +0 -6
  41. package/dist/error-overlay/react-overlay/utils/unmapper.js +8 -1
  42. package/dist/esm/{chunk-nrgs0ad5.js → chunk-yzh34sp0.js} +286 -538
  43. package/dist/esm/internals.mjs +286 -538
  44. package/dist/esm/previewEntry.mjs +289 -542
  45. package/dist/esm/renderEntry.mjs +2 -5
  46. package/dist/helpers/calculate-timeline.js +26 -4
  47. package/dist/helpers/get-timeline-sequence-sort-key.d.ts +1 -0
  48. package/dist/helpers/timeline-layout.d.ts +3 -2
  49. package/dist/helpers/timeline-layout.js +31 -9
  50. package/dist/internals.d.ts +0 -1
  51. package/dist/previewEntry.js +1 -1
  52. package/dist/renderEntry.js +3 -3
  53. package/package.json +13 -22
  54. package/dist/audio-waveform-worker.d.ts +0 -1
  55. package/dist/audio-waveform-worker.js +0 -102
  56. package/dist/components/audio-waveform-worker-types.d.ts +0 -28
  57. package/dist/components/audio-waveform-worker-types.js +0 -2
  58. package/dist/components/draw-peaks.d.ts +0 -1
  59. package/dist/components/draw-peaks.js +0 -68
  60. package/dist/components/load-waveform-peaks.d.ts +0 -13
  61. package/dist/components/load-waveform-peaks.js +0 -76
  62. package/dist/components/parse-color.d.ts +0 -1
  63. package/dist/components/parse-color.js +0 -17
  64. package/dist/components/slice-waveform-peaks.d.ts +0 -7
  65. package/dist/components/slice-waveform-peaks.js +0 -15
  66. package/dist/components/waveform-peak-processor.d.ts +0 -23
  67. package/dist/components/waveform-peak-processor.js +0 -77
  68. package/dist/esm/audio-waveform-worker.mjs +0 -346
  69. package/dist/make-audio-waveform-worker.d.ts +0 -1
  70. package/dist/make-audio-waveform-worker.js +0 -10
@@ -25,7 +25,7 @@ var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require
25
25
  // src/previewEntry.tsx
26
26
  import ReactDOM10 from "react-dom/client";
27
27
  import { Internals as Internals77 } from "remotion";
28
- import { NoReactInternals as NoReactInternals16 } from "remotion/no-react";
28
+ import { NoReactInternals as NoReactInternals17 } from "remotion/no-react";
29
29
 
30
30
  // src/components/NoRegisterRoot.tsx
31
31
  import { useEffect, useState } from "react";
@@ -2301,6 +2301,7 @@ var parseError = async (error, contextLines) => {
2301
2301
  };
2302
2302
 
2303
2303
  // src/error-overlay/react-overlay/utils/unmapper.ts
2304
+ import { sourceContentFor } from "@jridgewell/trace-mapping";
2304
2305
  import { Internals } from "remotion";
2305
2306
 
2306
2307
  // src/error-overlay/react-overlay/utils/get-lines-around.ts
@@ -2317,9 +2318,9 @@ function getLinesAround(line, count, lines) {
2317
2318
  }
2318
2319
 
2319
2320
  // src/error-overlay/react-overlay/utils/get-source-map.ts
2320
- import { SourceMapConsumer } from "source-map";
2321
- var getOriginalPosition = (source_map, line, column) => {
2322
- const result = source_map.originalPositionFor({
2321
+ import { TraceMap, originalPositionFor } from "@jridgewell/trace-mapping";
2322
+ var getOriginalPosition = (sourceMap, line, column) => {
2323
+ const result = originalPositionFor(sourceMap, {
2323
2324
  line,
2324
2325
  column
2325
2326
  });
@@ -2352,12 +2353,12 @@ async function getSourceMap(fileUri, fileContents) {
2352
2353
  throw new Error("Sorry, non-base64 inline source-map encoding is not supported.");
2353
2354
  }
2354
2355
  const converted = window.atob(sm.substring(match2[0].length));
2355
- return new SourceMapConsumer(JSON.parse(converted));
2356
+ return new TraceMap(JSON.parse(converted));
2356
2357
  }
2357
2358
  const index = fileUri.lastIndexOf("/");
2358
2359
  const url = fileUri.substring(0, index + 1) + sm;
2359
2360
  const obj = await fetch(url).then((res) => res.json());
2360
- return new SourceMapConsumer(obj);
2361
+ return new TraceMap(obj);
2361
2362
  }
2362
2363
 
2363
2364
  // src/error-overlay/react-overlay/utils/unmapper.ts
@@ -2390,7 +2391,7 @@ var unmap = async (frames, contextLines) => {
2390
2391
  const pos = getOriginalPosition(map, frame2.frame.lineNumber, frame2.frame.columnNumber);
2391
2392
  const { functionName } = frame2.frame;
2392
2393
  let hasSource = null;
2393
- hasSource = pos.source ? map.sourceContentFor(pos.source, false) : null;
2394
+ hasSource = pos.source ? sourceContentFor(map, pos.source) : null;
2394
2395
  const scriptCode = hasSource && pos.line ? getLinesAround(pos.line, contextLines, hasSource.split(`
2395
2396
  `)) : null;
2396
2397
  return {
@@ -2800,6 +2801,7 @@ import { interpolate } from "remotion";
2800
2801
  import {
2801
2802
  getFieldsToShow
2802
2803
  } from "@remotion/studio-shared";
2804
+ import { NoReactInternals } from "remotion/no-react";
2803
2805
  import {
2804
2806
  SCHEMA_FIELD_ROW_HEIGHT,
2805
2807
  UNSUPPORTED_FIELD_ROW_HEIGHT,
@@ -2816,10 +2818,15 @@ var getEffectSchemaLabels = (effect) => {
2816
2818
  if (!effect.definition.schema) {
2817
2819
  return [];
2818
2820
  }
2819
- return Object.entries(effect.definition.schema).map(([key, fieldSchema]) => ({
2820
- key,
2821
- description: fieldSchema.description
2822
- }));
2821
+ return Object.entries(effect.definition.schema).map(([key, fieldSchema]) => {
2822
+ if (fieldSchema.type === "hidden") {
2823
+ return null;
2824
+ }
2825
+ return {
2826
+ key,
2827
+ description: fieldSchema.description
2828
+ };
2829
+ }).filter(NoReactInternals.truthy);
2823
2830
  };
2824
2831
  var buildTimelineTree = ({
2825
2832
  sequence,
@@ -2832,19 +2839,28 @@ var buildTimelineTree = ({
2832
2839
  if (sequence.effects.length > 0) {
2833
2840
  roots.push({
2834
2841
  kind: "group",
2835
- nodePathInfo: { nodePath: [...nodePath, "effects"], index },
2842
+ nodePathInfo: {
2843
+ nodePath: [...nodePath, "effects"],
2844
+ index,
2845
+ numberOfSequencesWithThisNodePath: 0
2846
+ },
2836
2847
  label: "Effects",
2837
2848
  children: sequence.effects.map((effect, i) => {
2838
2849
  const effectNodePath = [...nodePath, "effects", i];
2839
2850
  return {
2840
2851
  kind: "group",
2841
- nodePathInfo: { nodePath: effectNodePath, index },
2852
+ nodePathInfo: {
2853
+ nodePath: effectNodePath,
2854
+ index,
2855
+ numberOfSequencesWithThisNodePath: 0
2856
+ },
2842
2857
  label: effect.definition.label,
2843
2858
  children: getEffectSchemaLabels(effect).map((label2) => ({
2844
2859
  kind: "field",
2845
2860
  nodePathInfo: {
2846
2861
  nodePath: [...effectNodePath, label2.key],
2847
- index
2862
+ index,
2863
+ numberOfSequencesWithThisNodePath: 0
2848
2864
  },
2849
2865
  label: label2.description ?? label2.key,
2850
2866
  field: null
@@ -2864,7 +2880,11 @@ var buildTimelineTree = ({
2864
2880
  for (const f of controlFields) {
2865
2881
  roots.push({
2866
2882
  kind: "field",
2867
- nodePathInfo: { nodePath: [...nodePath, "controls", f.key], index },
2883
+ nodePathInfo: {
2884
+ nodePath: [...nodePath, "controls", f.key],
2885
+ index,
2886
+ numberOfSequencesWithThisNodePath: 0
2887
+ },
2868
2888
  label: f.description ?? f.key,
2869
2889
  field: f
2870
2890
  });
@@ -2900,13 +2920,12 @@ var getExpandedTrackHeight = ({
2900
2920
  sequence,
2901
2921
  nodePathInfo,
2902
2922
  getIsExpanded,
2903
- getDragOverrides,
2904
2923
  getCodeValues
2905
2924
  }) => {
2906
2925
  const tree = buildTimelineTree({
2907
2926
  sequence,
2908
2927
  nodePathInfo,
2909
- getDragOverrides,
2928
+ getDragOverrides: () => ({}),
2910
2929
  getCodeValues
2911
2930
  });
2912
2931
  const flat = flattenVisibleTreeNodes({ nodes: tree, getIsExpanded });
@@ -3012,9 +3031,9 @@ var TimelineSlider = () => {
3012
3031
  if (videoConfig === null || timelineWidth === null) {
3013
3032
  return null;
3014
3033
  }
3015
- return /* @__PURE__ */ jsx29(Inner, {});
3034
+ return /* @__PURE__ */ jsx29(TimelineSliderInner, {});
3016
3035
  };
3017
- var Inner = () => {
3036
+ var TimelineSliderInner = () => {
3018
3037
  const videoConfig = useVideoConfig();
3019
3038
  const timelinePosition = Internals3.Timeline.useTimelinePosition();
3020
3039
  const ref = useRef5(null);
@@ -4252,7 +4271,7 @@ var PreviewServerConnection = ({ children, readOnlyStudio }) => {
4252
4271
 
4253
4272
  // src/helpers/use-asset-drag-events.ts
4254
4273
  import { useCallback as useCallback17, useEffect as useEffect16, useMemo as useMemo17, useRef as useRef9 } from "react";
4255
- import { NoReactInternals } from "remotion/no-react";
4274
+ import { NoReactInternals as NoReactInternals2 } from "remotion/no-react";
4256
4275
  function useAssetDragEvents({
4257
4276
  name,
4258
4277
  parentFolder,
@@ -4261,7 +4280,7 @@ function useAssetDragEvents({
4261
4280
  }) {
4262
4281
  const dragDepthRef = useRef9(0);
4263
4282
  const combinedParents = useMemo17(() => {
4264
- return [parentFolder, name].filter(NoReactInternals.truthy).join("/");
4283
+ return [parentFolder, name].filter(NoReactInternals2.truthy).join("/");
4265
4284
  }, [name, parentFolder]);
4266
4285
  const isDropDiv = useMemo17(() => {
4267
4286
  return dropLocation === combinedParents;
@@ -4301,7 +4320,7 @@ import React30, {
4301
4320
  useState as useState17
4302
4321
  } from "react";
4303
4322
  import { Internals as Internals7 } from "remotion";
4304
- import { NoReactInternals as NoReactInternals3 } from "remotion/no-react";
4323
+ import { NoReactInternals as NoReactInternals4 } from "remotion/no-react";
4305
4324
 
4306
4325
  // src/helpers/copy-text.ts
4307
4326
  var copyText = (cmd) => {
@@ -4504,7 +4523,7 @@ var InlineAction = ({
4504
4523
  };
4505
4524
 
4506
4525
  // src/components/RenderQueue/actions.ts
4507
- import { NoReactInternals as NoReactInternals2 } from "remotion/no-react";
4526
+ import { NoReactInternals as NoReactInternals3 } from "remotion/no-react";
4508
4527
 
4509
4528
  // src/components/call-api.ts
4510
4529
  var callApi = (endpoint, body, signal) => {
@@ -4561,7 +4580,7 @@ var addStillRenderJob = ({
4561
4580
  chromiumOptions,
4562
4581
  delayRenderTimeout,
4563
4582
  envVariables,
4564
- serializedInputPropsWithCustomSchema: NoReactInternals2.serializeJSONWithSpecialTypes({
4583
+ serializedInputPropsWithCustomSchema: NoReactInternals3.serializeJSONWithSpecialTypes({
4565
4584
  data: inputProps,
4566
4585
  staticBase: window.remotion_staticBase,
4567
4586
  indent: undefined
@@ -4613,7 +4632,7 @@ var addSequenceRenderJob = ({
4613
4632
  delayRenderTimeout,
4614
4633
  envVariables,
4615
4634
  concurrency,
4616
- serializedInputPropsWithCustomSchema: NoReactInternals2.serializeJSONWithSpecialTypes({
4635
+ serializedInputPropsWithCustomSchema: NoReactInternals3.serializeJSONWithSpecialTypes({
4617
4636
  data: inputProps,
4618
4637
  staticBase: window.remotion_staticBase,
4619
4638
  indent: undefined
@@ -4699,7 +4718,7 @@ var addVideoRenderJob = ({
4699
4718
  disallowParallelEncoding,
4700
4719
  chromiumOptions,
4701
4720
  envVariables,
4702
- serializedInputPropsWithCustomSchema: NoReactInternals2.serializeJSONWithSpecialTypes({
4721
+ serializedInputPropsWithCustomSchema: NoReactInternals3.serializeJSONWithSpecialTypes({
4703
4722
  data: inputProps,
4704
4723
  staticBase: window.remotion_staticBase,
4705
4724
  indent: undefined
@@ -4773,7 +4792,7 @@ var getProjectInfo = (signal) => {
4773
4792
  var callUpdateDefaultPropsApi = (compositionId, defaultProps, enumPaths) => {
4774
4793
  return callApi("/api/update-default-props", {
4775
4794
  compositionId,
4776
- defaultProps: NoReactInternals2.serializeJSONWithSpecialTypes({
4795
+ defaultProps: NoReactInternals3.serializeJSONWithSpecialTypes({
4777
4796
  data: defaultProps,
4778
4797
  indent: undefined,
4779
4798
  staticBase: window.remotion_staticBase
@@ -4940,7 +4959,7 @@ var AssetFolderTree = ({
4940
4959
  readOnlyStudio
4941
4960
  }) => {
4942
4961
  const combinedParents = useMemo19(() => {
4943
- return [parentFolder, name].filter(NoReactInternals3.truthy).join("/");
4962
+ return [parentFolder, name].filter(NoReactInternals4.truthy).join("/");
4944
4963
  }, [name, parentFolder]);
4945
4964
  return /* @__PURE__ */ jsxs18("div", {
4946
4965
  children: [
@@ -7422,7 +7441,7 @@ import { useCallback as useCallback100, useMemo as useMemo105, useState as useSt
7422
7441
  // src/helpers/use-menu-structure.tsx
7423
7442
  import { useContext as useContext22, useMemo as useMemo42 } from "react";
7424
7443
  import { Internals as Internals19 } from "remotion";
7425
- import { NoReactInternals as NoReactInternals5 } from "remotion/no-react";
7444
+ import { NoReactInternals as NoReactInternals6 } from "remotion/no-react";
7426
7445
 
7427
7446
  // src/api/restart-studio.ts
7428
7447
  import { getRemotionEnvironment as getRemotionEnvironment2 } from "remotion";
@@ -8845,7 +8864,7 @@ import {
8845
8864
  useImperativeHandle as useImperativeHandle10
8846
8865
  } from "react";
8847
8866
  import { Internals as Internals18 } from "remotion";
8848
- import { NoReactInternals as NoReactInternals4 } from "remotion/no-react";
8867
+ import { NoReactInternals as NoReactInternals5 } from "remotion/no-react";
8849
8868
 
8850
8869
  // src/icons/timelineInOutPointer.tsx
8851
8870
  import { jsx as jsx79 } from "react/jsx-runtime";
@@ -8916,7 +8935,7 @@ var getTooltipText = (pointType, key) => [
8916
8935
  `Mark ${pointType}`,
8917
8936
  areKeyboardShortcutsDisabled() ? null : `(${key})`,
8918
8937
  "- right click to clear"
8919
- ].filter(NoReactInternals4.truthy).join(" ");
8938
+ ].filter(NoReactInternals5.truthy).join(" ");
8920
8939
  var style4 = {
8921
8940
  width: 16,
8922
8941
  height: 16
@@ -9437,7 +9456,7 @@ var getFileMenu = ({
9437
9456
  quickSwitcherLabel: "Open in editor..."
9438
9457
  } : null,
9439
9458
  getGitMenuItem()
9440
- ].filter(NoReactInternals5.truthy);
9459
+ ].filter(NoReactInternals6.truthy);
9441
9460
  if (items.length === 0) {
9442
9461
  return null;
9443
9462
  }
@@ -10180,7 +10199,7 @@ var itemToSearchResult = (item, setSelectedModal, prefixes) => {
10180
10199
  ...prefixes,
10181
10200
  getItemLabel(item)
10182
10201
  ]);
10183
- }).flat(1).filter(NoReactInternals5.truthy);
10202
+ }).flat(1).filter(NoReactInternals6.truthy);
10184
10203
  }
10185
10204
  return [
10186
10205
  {
@@ -10202,7 +10221,7 @@ var makeSearchResults = (actions, setSelectedModal) => {
10202
10221
  }
10203
10222
  return itemToSearchResult(item, setSelectedModal, []);
10204
10223
  });
10205
- }).flat(Infinity).filter(NoReactInternals5.truthy);
10224
+ }).flat(Infinity).filter(NoReactInternals6.truthy);
10206
10225
  return items;
10207
10226
  };
10208
10227
 
@@ -10354,7 +10373,7 @@ import { useContext as useContext23, useEffect as useEffect32, useState as useSt
10354
10373
  import { Internals as Internals20 } from "remotion";
10355
10374
 
10356
10375
  // src/components/Timeline/TimelineStack/get-stack.ts
10357
- import { SourceMapConsumer as SourceMapConsumer2 } from "source-map";
10376
+ import { TraceMap as TraceMap2 } from "@jridgewell/trace-mapping";
10358
10377
 
10359
10378
  // src/helpers/get-location-of-sequence.ts
10360
10379
  var getLocationOfSequence = (stack2) => {
@@ -10393,40 +10412,23 @@ var getLocationOfFunctionCall = (stack2, functionName) => {
10393
10412
  };
10394
10413
 
10395
10414
  // src/components/Timeline/TimelineStack/get-stack.ts
10396
- var waiters = [];
10397
- var sourceMapConsumerCache = {};
10398
- var isCreating = {};
10415
+ var traceMapCache = {};
10416
+ var traceMapPromises = {};
10399
10417
  var getSourceMapCache = async (fileName) => {
10400
- if (sourceMapConsumerCache[fileName]) {
10401
- return sourceMapConsumerCache[fileName];
10402
- }
10403
- if (isCreating[fileName]) {
10404
- return new Promise((resolve) => {
10405
- waiters.push({
10406
- id: String(Math.random()),
10407
- forFileName: fileName,
10408
- resolve
10409
- });
10410
- });
10418
+ if (traceMapCache[fileName]) {
10419
+ return traceMapCache[fileName];
10411
10420
  }
10412
- isCreating[fileName] = true;
10413
- const res = await fetch(`${fileName}.map`);
10414
- const json = await res.json();
10415
- const map = await new Promise((resolve) => {
10416
- SourceMapConsumer2.with(json, null, (consumer) => {
10417
- resolve(consumer);
10418
- });
10419
- });
10420
- waiters.filter((w) => {
10421
- if (w.forFileName === fileName) {
10422
- w.resolve(map);
10423
- return false;
10424
- }
10425
- return true;
10421
+ if (traceMapPromises[fileName]) {
10422
+ return traceMapPromises[fileName];
10423
+ }
10424
+ traceMapPromises[fileName] = fetch(`${fileName}.map`).then((res) => res.json()).then((json) => {
10425
+ const map = new TraceMap2(json);
10426
+ traceMapCache[fileName] = map;
10427
+ return map;
10428
+ }).finally(() => {
10429
+ delete traceMapPromises[fileName];
10426
10430
  });
10427
- sourceMapConsumerCache[fileName] = map;
10428
- isCreating[fileName] = false;
10429
- return map;
10431
+ return traceMapPromises[fileName];
10430
10432
  };
10431
10433
  var getOriginalLocationFromStack = async (stack2, type) => {
10432
10434
  const location2 = type === "sequence" ? getLocationOfSequence(stack2) : getLocationOfFunctionCall(stack2, "visualControl");
@@ -10488,7 +10490,8 @@ var baseStyle = {
10488
10490
  color: "inherit",
10489
10491
  textDecoration: "none",
10490
10492
  fontSize: "inherit",
10491
- textUnderlineOffset: 2
10493
+ textUnderlineOffset: 2,
10494
+ whiteSpace: "nowrap"
10492
10495
  };
10493
10496
  var compositionNameStyle = {
10494
10497
  ...baseStyle,
@@ -10652,9 +10655,9 @@ var MenuBuildIndicator = () => {
10652
10655
  }) : /* @__PURE__ */ jsx86("div", {
10653
10656
  style: noSpinner
10654
10657
  }),
10655
- isClickable ? /* @__PURE__ */ jsx86(Spacing, {
10658
+ /* @__PURE__ */ jsx86(Spacing, {
10656
10659
  x: 0.5
10657
- }) : null,
10660
+ }),
10658
10661
  isClickable ? /* @__PURE__ */ jsx86("a", {
10659
10662
  style: projectNameHovered ? projectNameLinkHovered : projectNameLink,
10660
10663
  title: projectNameTitle,
@@ -10904,7 +10907,7 @@ var useStudioCanvasDimensions = ({
10904
10907
 
10905
10908
  // src/components/EditorGuides/Guide.tsx
10906
10909
  import { memo, useCallback as useCallback41, useContext as useContext27, useMemo as useMemo48 } from "react";
10907
- import { NoReactInternals as NoReactInternals6 } from "remotion/no-react";
10910
+ import { NoReactInternals as NoReactInternals7 } from "remotion/no-react";
10908
10911
 
10909
10912
  // src/components/ForceSpecificCursor.tsx
10910
10913
  import React60, { useMemo as useMemo47 } from "react";
@@ -11028,7 +11031,7 @@ var GuideComp = ({ guide, canvasDimensions, scale }) => {
11028
11031
  className: [
11029
11032
  "__remotion_editor_guide_content",
11030
11033
  selectedGuideId === guide.id || hoveredGuideId === guide.id ? "__remotion_editor_guide_selected" : null
11031
- ].filter(NoReactInternals6.truthy).join(" ")
11034
+ ].filter(NoReactInternals7.truthy).join(" ")
11032
11035
  })
11033
11036
  })
11034
11037
  });
@@ -12268,7 +12271,7 @@ import { useCallback as useCallback45, useContext as useContext35, useEffect as
12268
12271
  import { Internals as Internals31 } from "remotion";
12269
12272
 
12270
12273
  // src/helpers/document-title.ts
12271
- import { NoReactInternals as NoReactInternals7 } from "remotion/no-react";
12274
+ import { NoReactInternals as NoReactInternals8 } from "remotion/no-react";
12272
12275
  var currentItemName = null;
12273
12276
  var renderJobs = [];
12274
12277
  var setCurrentCanvasContentId = (id) => {
@@ -12296,7 +12299,7 @@ var updateTitle = () => {
12296
12299
  document.title = [
12297
12300
  getProgressInBrackets(currentItemName, renderJobs),
12298
12301
  `${currentCompTitle} ${suffix}`
12299
- ].filter(NoReactInternals7.truthy).join(" ");
12302
+ ].filter(NoReactInternals8.truthy).join(" ");
12300
12303
  };
12301
12304
  var getProgressInBrackets = (selectedCompositionId, jobs) => {
12302
12305
  const currentRender = jobs.find((job) => job.status === "running");
@@ -12772,7 +12775,7 @@ import { useContext as useContext41 } from "react";
12772
12775
  // src/components/RenderModal/DataEditor.tsx
12773
12776
  import React96, { useCallback as useCallback72, useContext as useContext40, useMemo as useMemo86, useState as useState55 } from "react";
12774
12777
  import { getInputProps } from "remotion";
12775
- import { NoReactInternals as NoReactInternals10 } from "remotion/no-react";
12778
+ import { NoReactInternals as NoReactInternals11 } from "remotion/no-react";
12776
12779
 
12777
12780
  // src/components/NewComposition/ValidationMessage.tsx
12778
12781
  import { useMemo as useMemo57 } from "react";
@@ -12904,7 +12907,7 @@ var Item = ({ selected, onClick, children }) => {
12904
12907
  };
12905
12908
 
12906
12909
  // src/components/RenderModal/get-render-modal-warnings.ts
12907
- import { NoReactInternals as NoReactInternals8 } from "remotion/no-react";
12910
+ import { NoReactInternals as NoReactInternals9 } from "remotion/no-react";
12908
12911
  var getInputPropsWarning = ({
12909
12912
  cliProps,
12910
12913
  propsEditType
@@ -12967,13 +12970,13 @@ var getRenderModalWarnings = ({
12967
12970
  staticFileUsed(customFileUsed, inJSONEditor),
12968
12971
  mapUsed(jsMapUsed, inJSONEditor),
12969
12972
  setUsed(jsSetUsed, inJSONEditor)
12970
- ].filter(NoReactInternals8.truthy);
12973
+ ].filter(NoReactInternals9.truthy);
12971
12974
  };
12972
12975
 
12973
12976
  // src/components/RenderModal/RenderModalJSONPropsEditor.tsx
12974
12977
  import React71, { useCallback as useCallback49, useEffect as useEffect44, useMemo as useMemo60 } from "react";
12975
12978
  import { useContext as useContext38 } from "react";
12976
- import { NoReactInternals as NoReactInternals9 } from "remotion/no-react";
12979
+ import { NoReactInternals as NoReactInternals10 } from "remotion/no-react";
12977
12980
 
12978
12981
  // src/components/RenderModal/SchemaEditor/deep-equal.ts
12979
12982
  function deepEqual(a, b) {
@@ -13281,7 +13284,7 @@ var parseJS = (value, schema) => {
13281
13284
  };
13282
13285
  var parseJSON = (str, schema) => {
13283
13286
  try {
13284
- const value = NoReactInternals9.deserializeJSONWithSpecialTypes(str);
13287
+ const value = NoReactInternals10.deserializeJSONWithSpecialTypes(str);
13285
13288
  const zodValidation = zodSafeParse(schema, value);
13286
13289
  return { str, value, validJSON: true, zodValidation };
13287
13290
  } catch (e) {
@@ -16443,7 +16446,7 @@ var DataEditor = ({
16443
16446
  return null;
16444
16447
  }
16445
16448
  const value = defaultProps;
16446
- return NoReactInternals10.serializeJSONWithSpecialTypes({
16449
+ return NoReactInternals11.serializeJSONWithSpecialTypes({
16447
16450
  data: value,
16448
16451
  indent: 2,
16449
16452
  staticBase: window.remotion_staticBase
@@ -17575,7 +17578,7 @@ var RenderQueueRemoveItem = ({ job }) => {
17575
17578
  import { useCallback as useCallback83, useContext as useContext48, useMemo as useMemo92 } from "react";
17576
17579
 
17577
17580
  // src/helpers/retry-payload.ts
17578
- import { NoReactInternals as NoReactInternals11 } from "remotion/no-react";
17581
+ import { NoReactInternals as NoReactInternals12 } from "remotion/no-react";
17579
17582
  var makeRetryPayload = (job) => {
17580
17583
  const defaults = window.remotion_renderDefaults;
17581
17584
  if (!defaults) {
@@ -17611,7 +17614,7 @@ var makeRetryPayload = (job) => {
17611
17614
  initialHeadless: job.chromiumOptions.headless,
17612
17615
  initialIgnoreCertificateErrors: job.chromiumOptions.ignoreCertificateErrors,
17613
17616
  initialDarkMode: job.chromiumOptions.darkMode,
17614
- defaultProps: NoReactInternals11.deserializeJSONWithSpecialTypes(job.serializedInputPropsWithCustomSchema),
17617
+ defaultProps: NoReactInternals12.deserializeJSONWithSpecialTypes(job.serializedInputPropsWithCustomSchema),
17615
17618
  inFrameMark: null,
17616
17619
  outFrameMark: null,
17617
17620
  initialOffthreadVideoCacheSizeInBytes: job.offthreadVideoCacheSizeInBytes,
@@ -17663,7 +17666,7 @@ var makeRetryPayload = (job) => {
17663
17666
  initialHeadless: job.chromiumOptions.headless,
17664
17667
  initialIgnoreCertificateErrors: job.chromiumOptions.ignoreCertificateErrors,
17665
17668
  initialDarkMode: job.chromiumOptions.darkMode,
17666
- defaultProps: NoReactInternals11.deserializeJSONWithSpecialTypes(job.serializedInputPropsWithCustomSchema),
17669
+ defaultProps: NoReactInternals12.deserializeJSONWithSpecialTypes(job.serializedInputPropsWithCustomSchema),
17667
17670
  initialStillImageFormat: defaults.stillImageFormat,
17668
17671
  inFrameMark: job.startFrame,
17669
17672
  outFrameMark: job.endFrame,
@@ -17718,7 +17721,7 @@ var makeRetryPayload = (job) => {
17718
17721
  initialHeadless: job.chromiumOptions.headless,
17719
17722
  initialIgnoreCertificateErrors: job.chromiumOptions.ignoreCertificateErrors,
17720
17723
  initialDarkMode: job.chromiumOptions.darkMode,
17721
- defaultProps: NoReactInternals11.deserializeJSONWithSpecialTypes(job.serializedInputPropsWithCustomSchema),
17724
+ defaultProps: NoReactInternals12.deserializeJSONWithSpecialTypes(job.serializedInputPropsWithCustomSchema),
17722
17725
  inFrameMark: job.startFrame,
17723
17726
  outFrameMark: job.endFrame,
17724
17727
  initialOffthreadVideoCacheSizeInBytes: job.offthreadVideoCacheSizeInBytes,
@@ -18172,7 +18175,7 @@ import React111, { useContext as useContext53 } from "react";
18172
18175
 
18173
18176
  // src/components/VisualControls/VisualControlHandle.tsx
18174
18177
  import { useCallback as useCallback86, useContext as useContext52, useEffect as useEffect53, useState as useState59 } from "react";
18175
- import { NoReactInternals as NoReactInternals12 } from "remotion/no-react";
18178
+ import { NoReactInternals as NoReactInternals13 } from "remotion/no-react";
18176
18179
 
18177
18180
  // src/fast-refresh-context.ts
18178
18181
  import { createContext as createContext20 } from "react";
@@ -18314,7 +18317,7 @@ var VisualControlHandle = ({ value, keyName }) => {
18314
18317
  changes: [
18315
18318
  {
18316
18319
  id: keyName,
18317
- newValueSerialized: val === undefined ? "" : NoReactInternals12.serializeJSONWithSpecialTypes({
18320
+ newValueSerialized: val === undefined ? "" : NoReactInternals13.serializeJSONWithSpecialTypes({
18318
18321
  data: val,
18319
18322
  indent: 2,
18320
18323
  staticBase: window.remotion_staticBase
@@ -18602,12 +18605,12 @@ var loadLoopOption = () => {
18602
18605
 
18603
18606
  // src/components/CheckboardToggle.tsx
18604
18607
  import { useCallback as useCallback88, useContext as useContext55 } from "react";
18605
- import { NoReactInternals as NoReactInternals13 } from "remotion/no-react";
18608
+ import { NoReactInternals as NoReactInternals14 } from "remotion/no-react";
18606
18609
  import { jsx as jsx168 } from "react/jsx-runtime";
18607
18610
  var accessibilityLabel2 = [
18608
18611
  "Show transparency as checkerboard",
18609
18612
  areKeyboardShortcutsDisabled() ? null : "(T)"
18610
- ].filter(NoReactInternals13.truthy).join(" ");
18613
+ ].filter(NoReactInternals14.truthy).join(" ");
18611
18614
  var CheckboardToggle = () => {
18612
18615
  const { checkerboard, setCheckerboard } = useContext55(CheckerboardContext);
18613
18616
  const onClick = useCallback88(() => {
@@ -18723,12 +18726,12 @@ var FpsCounter = ({ playbackSpeed }) => {
18723
18726
  // src/components/FullscreenToggle.tsx
18724
18727
  import { useCallback as useCallback89, useContext as useContext56, useEffect as useEffect55 } from "react";
18725
18728
  import { Internals as Internals38 } from "remotion";
18726
- import { NoReactInternals as NoReactInternals14 } from "remotion/no-react";
18729
+ import { NoReactInternals as NoReactInternals15 } from "remotion/no-react";
18727
18730
  import { jsx as jsx169 } from "react/jsx-runtime";
18728
18731
  var accessibilityLabel3 = [
18729
18732
  "Enter fullscreen preview",
18730
18733
  areKeyboardShortcutsDisabled() ? null : "(F)"
18731
- ].filter(NoReactInternals14.truthy).join(" ");
18734
+ ].filter(NoReactInternals15.truthy).join(" ");
18732
18735
  var FullScreenToggle = () => {
18733
18736
  const keybindings = useKeybinding();
18734
18737
  const { setSize } = useContext56(Internals38.PreviewSizeContext);
@@ -19536,7 +19539,7 @@ var RenderButton = ({
19536
19539
  };
19537
19540
  }, []);
19538
19541
  const video = Internals42.useVideo();
19539
- const getCurrentFrame2 = PlayerInternals14.useFrameImperative();
19542
+ const { getCurrentFrame: getCurrentFrame2 } = PlayerInternals14.usePlayer();
19540
19543
  const { props } = useContext58(Internals42.EditorPropsContext);
19541
19544
  const openServerRenderModal = useCallback94((copyCommandOnly) => {
19542
19545
  if (!video) {
@@ -21273,7 +21276,7 @@ var calculateTimeline = ({
21273
21276
  hash: actualHash,
21274
21277
  cascadedStart,
21275
21278
  cascadedDuration: sequence.duration,
21276
- nodePathInfo: nodePath ? { nodePath, index: 0 } : null
21279
+ nodePathInfo: nodePath ? { nodePath, index: 0, numberOfSequencesWithThisNodePath: 0 } : null
21277
21280
  });
21278
21281
  }
21279
21282
  const uniqueTracks = [];
@@ -21297,12 +21300,29 @@ var calculateTimeline = ({
21297
21300
  if (track.nodePathInfo === null) {
21298
21301
  return track;
21299
21302
  }
21300
- const key4 = JSON.stringify(track.nodePathInfo.nodePath);
21303
+ const key4 = track.nodePathInfo.nodePath.join(".");
21301
21304
  const index = nodePathIndexCounters.get(key4) ?? 0;
21302
21305
  nodePathIndexCounters.set(key4, index + 1);
21303
21306
  return {
21304
21307
  ...track,
21305
- nodePathInfo: { nodePath: track.nodePathInfo.nodePath, index }
21308
+ nodePathInfo: {
21309
+ nodePath: track.nodePathInfo.nodePath,
21310
+ index,
21311
+ numberOfSequencesWithThisNodePath: 0
21312
+ }
21313
+ };
21314
+ }).map((track) => {
21315
+ if (track.nodePathInfo === null) {
21316
+ return track;
21317
+ }
21318
+ const key4 = track.nodePathInfo.nodePath.join(".");
21319
+ return {
21320
+ ...track,
21321
+ nodePathInfo: {
21322
+ nodePath: track.nodePathInfo.nodePath,
21323
+ index: track.nodePathInfo.index,
21324
+ numberOfSequencesWithThisNodePath: nodePathIndexCounters.get(key4) ?? 0
21325
+ }
21306
21326
  };
21307
21327
  });
21308
21328
  };
@@ -21354,7 +21374,7 @@ var SequencePropsObserver = () => {
21354
21374
  if (event.type !== "sequence-props-updated") {
21355
21375
  return;
21356
21376
  }
21357
- setCodeValues(event.nodePath, event.result);
21377
+ setCodeValues(event.nodePath, () => event.result);
21358
21378
  };
21359
21379
  const unsubscribe = subscribeToEvent("sequence-props-updated", handleEvent);
21360
21380
  return () => {
@@ -21435,7 +21455,7 @@ var acquireSequencePropsSubscription = ({
21435
21455
  entries.delete(key4);
21436
21456
  }
21437
21457
  acquired.promise.then((result) => {
21438
- if (!result.canUpdate) {
21458
+ if (!result.success) {
21439
21459
  return;
21440
21460
  }
21441
21461
  return callApi("/api/unsubscribe-from-sequence-props", {
@@ -21482,13 +21502,13 @@ var useSequencePropsSubscription = ({
21482
21502
  schema,
21483
21503
  clientId,
21484
21504
  applyOnce: (result) => {
21485
- if (!result.canUpdate) {
21505
+ if (!result.success) {
21486
21506
  return;
21487
21507
  }
21488
- setCodeValues(result.nodePath, result);
21508
+ setCodeValues(result.nodePath, () => result.status);
21489
21509
  },
21490
21510
  applyEach: (result) => {
21491
- if (!result.canUpdate) {
21511
+ if (!result.success) {
21492
21512
  return;
21493
21513
  }
21494
21514
  setOverrideIdToNodePath(overrideId, result.nodePath);
@@ -21522,7 +21542,7 @@ var SubscribeToNodePaths = ({ overrideId, schema, stack: stack2 }) => {
21522
21542
 
21523
21543
  // src/components/Timeline/TimelineDragHandler.tsx
21524
21544
  import { PlayerInternals as PlayerInternals16 } from "@remotion/player";
21525
- import {
21545
+ import React132, {
21526
21546
  useCallback as useCallback101,
21527
21547
  useContext as useContext71,
21528
21548
  useEffect as useEffect67,
@@ -21662,10 +21682,10 @@ var TimelineDragHandler = () => {
21662
21682
  return /* @__PURE__ */ jsx196("div", {
21663
21683
  ref: sliderAreaRef,
21664
21684
  style: containerStyle2,
21665
- children: video ? /* @__PURE__ */ jsx196(Inner2, {}) : null
21685
+ children: video ? /* @__PURE__ */ jsx196(TimelineDragHandlerInnerMemo, {}) : null
21666
21686
  });
21667
21687
  };
21668
- var Inner2 = () => {
21688
+ var TimelineDragHandlerInner = () => {
21669
21689
  const videoConfig = useVideoConfig4();
21670
21690
  const size3 = PlayerInternals16.useElementSize(scrollableRef, {
21671
21691
  triggerOnWindowResize: true,
@@ -22064,9 +22084,10 @@ var Inner2 = () => {
22064
22084
  ]
22065
22085
  });
22066
22086
  };
22087
+ var TimelineDragHandlerInnerMemo = React132.memo(TimelineDragHandlerInner);
22067
22088
 
22068
22089
  // src/components/Timeline/TimelineHeightContainer.tsx
22069
- import { useMemo as useMemo112 } from "react";
22090
+ import React136, { useMemo as useMemo112 } from "react";
22070
22091
 
22071
22092
  // src/components/Timeline/use-timeline-height.ts
22072
22093
  import { useContext as useContext73, useMemo as useMemo111 } from "react";
@@ -22295,13 +22316,13 @@ var TimelineTimeIndicators = () => {
22295
22316
  if (video === null) {
22296
22317
  return null;
22297
22318
  }
22298
- return /* @__PURE__ */ jsx199(Inner3, {
22319
+ return /* @__PURE__ */ jsx199(TimelineTimeIndicatorsInner, {
22299
22320
  durationInFrames: video.durationInFrames,
22300
22321
  fps: video.fps,
22301
22322
  windowWidth: sliderTrack
22302
22323
  });
22303
22324
  };
22304
- var Inner3 = ({ windowWidth, durationInFrames, fps }) => {
22325
+ var TimelineTimeIndicatorsInner = ({ windowWidth, durationInFrames, fps }) => {
22305
22326
  const ref2 = useRef39(null);
22306
22327
  useEffect69(() => {
22307
22328
  const currentRef = ref2.current;
@@ -22387,30 +22408,22 @@ var useTimelineHeight = ({
22387
22408
  }) => {
22388
22409
  const { getIsExpanded } = useContext73(ExpandedTracksGetterContext);
22389
22410
  const { previewServerState } = useContext73(StudioServerConnectionCtx);
22390
- const { getDragOverrides, getCodeValues } = useContext73(Internals53.VisualModeGettersContext);
22391
- const visualModeEnabled = Boolean(process.env.EXPERIMENTAL_VISUAL_MODE_ENABLED) && previewServerState.type === "connected";
22411
+ const { getCodeValues } = useContext73(Internals53.VisualModeCodeValuesContext);
22412
+ const previewServerConnected = previewServerState.type === "connected";
22392
22413
  return useMemo111(() => {
22393
22414
  const tracksHeight = shown.reduce((acc, track) => {
22394
- const isExpanded = visualModeEnabled && track.nodePathInfo !== null && getIsExpanded(track.nodePathInfo);
22415
+ const isExpanded = previewServerConnected && track.nodePathInfo !== null && getIsExpanded(track.nodePathInfo);
22395
22416
  const layerHeight = getTimelineLayerHeight(track.sequence.type) + TIMELINE_ITEM_BORDER_BOTTOM;
22396
22417
  const expandedHeight = isExpanded && track.nodePathInfo ? getExpandedTrackHeight({
22397
22418
  sequence: track.sequence,
22398
22419
  nodePathInfo: track.nodePathInfo,
22399
22420
  getIsExpanded,
22400
- getDragOverrides,
22401
22421
  getCodeValues
22402
22422
  }) + TIMELINE_ITEM_BORDER_BOTTOM : 0;
22403
22423
  return acc + layerHeight + expandedHeight;
22404
22424
  }, 0);
22405
22425
  return tracksHeight + TIMELINE_ITEM_BORDER_BOTTOM + (hasBeenCut ? MAX_TIMELINE_TRACKS_NOTICE_HEIGHT : 0) + TIMELINE_TIME_INDICATOR_HEIGHT;
22406
- }, [
22407
- shown,
22408
- hasBeenCut,
22409
- visualModeEnabled,
22410
- getIsExpanded,
22411
- getDragOverrides,
22412
- getCodeValues
22413
- ]);
22426
+ }, [shown, hasBeenCut, previewServerConnected, getIsExpanded, getCodeValues]);
22414
22427
  };
22415
22428
 
22416
22429
  // src/components/Timeline/TimelineHeightContainer.tsx
@@ -22421,7 +22434,7 @@ var baseStyle2 = {
22421
22434
  minHeight: "100%",
22422
22435
  overflowX: "hidden"
22423
22436
  };
22424
- var TimelineHeightContainer = ({ shown, hasBeenCut, children }) => {
22437
+ var TimelineHeightContainerInner = ({ shown, hasBeenCut, children }) => {
22425
22438
  const height = useTimelineHeight({ shown, hasBeenCut });
22426
22439
  const style10 = useMemo112(() => ({ ...baseStyle2, height }), [height]);
22427
22440
  return /* @__PURE__ */ jsx200("div", {
@@ -22429,6 +22442,7 @@ var TimelineHeightContainer = ({ shown, hasBeenCut, children }) => {
22429
22442
  children
22430
22443
  });
22431
22444
  };
22445
+ var TimelineHeightContainer = React136.memo(TimelineHeightContainerInner);
22432
22446
 
22433
22447
  // src/components/Timeline/TimelineList.tsx
22434
22448
  import { PlayerInternals as PlayerInternals18 } from "@remotion/player";
@@ -22496,7 +22510,7 @@ var TimelineExpandArrowButton = ({ isExpanded, onClick, label: label9, disabled
22496
22510
  style: svgStyle,
22497
22511
  children: /* @__PURE__ */ jsx202("path", {
22498
22512
  d: "M2 1L6 4L2 7Z",
22499
- fill: "white"
22513
+ fill: "#ccc"
22500
22514
  })
22501
22515
  })
22502
22516
  });
@@ -22515,6 +22529,7 @@ import { Internals as Internals55 } from "remotion";
22515
22529
  import { useMemo as useMemo120 } from "react";
22516
22530
 
22517
22531
  // src/components/Timeline/TimelineFieldRow.tsx
22532
+ import { optimisticUpdateForCodeValues } from "@remotion/studio-shared";
22518
22533
  import { useCallback as useCallback109, useContext as useContext74, useMemo as useMemo119 } from "react";
22519
22534
  import { Internals as Internals54 } from "remotion";
22520
22535
 
@@ -22524,21 +22539,21 @@ import { jsx as jsx203 } from "react/jsx-runtime";
22524
22539
  var checkboxContainer = {
22525
22540
  marginLeft: 8
22526
22541
  };
22527
- var TimelineBooleanField = ({ field, codeValue, effectiveValue, canUpdate, onSave }) => {
22542
+ var TimelineBooleanField = ({ field, propStatus, effectiveValue, onSave }) => {
22528
22543
  const checked = Boolean(effectiveValue);
22529
22544
  const onChange = useCallback104(() => {
22530
22545
  const newValue = !checked;
22531
- if (canUpdate && newValue !== codeValue) {
22532
- onSave(field.key, newValue);
22546
+ if (propStatus.canUpdate && newValue !== propStatus.codeValue) {
22547
+ onSave(newValue);
22533
22548
  }
22534
- }, [canUpdate, onSave, field.key, checked, codeValue]);
22549
+ }, [propStatus, onSave, checked]);
22535
22550
  return /* @__PURE__ */ jsx203("div", {
22536
22551
  style: checkboxContainer,
22537
22552
  children: /* @__PURE__ */ jsx203(Checkbox, {
22538
22553
  checked,
22539
22554
  onChange,
22540
22555
  name: field.key,
22541
- disabled: !canUpdate,
22556
+ disabled: !propStatus.canUpdate,
22542
22557
  variant: "small"
22543
22558
  })
22544
22559
  });
@@ -22552,9 +22567,8 @@ var comboboxStyle = {
22552
22567
  };
22553
22568
  var TimelineEnumField = ({
22554
22569
  field,
22555
- codeValue,
22570
+ propStatus,
22556
22571
  effectiveValue,
22557
- canUpdate,
22558
22572
  onSave,
22559
22573
  onDragValueChange,
22560
22574
  onDragEnd
@@ -22566,14 +22580,14 @@ var TimelineEnumField = ({
22566
22580
  const variantKeys = Object.keys(fieldSchema.variants);
22567
22581
  const current = String(effectiveValue ?? fieldSchema.default);
22568
22582
  const onSelect = useCallback105((newValue) => {
22569
- if (!canUpdate || newValue === codeValue) {
22583
+ if (!propStatus.canUpdate || newValue === propStatus.codeValue) {
22570
22584
  return;
22571
22585
  }
22572
- onDragValueChange(field.key, newValue);
22573
- onSave(field.key, newValue).finally(() => {
22586
+ onDragValueChange(newValue);
22587
+ onSave(newValue).finally(() => {
22574
22588
  onDragEnd();
22575
22589
  });
22576
- }, [canUpdate, codeValue, field.key, onSave, onDragValueChange, onDragEnd]);
22590
+ }, [propStatus, onSave, onDragValueChange, onDragEnd]);
22577
22591
  const items = useMemo115(() => {
22578
22592
  return variantKeys.map((key4) => ({
22579
22593
  type: "item",
@@ -22585,9 +22599,9 @@ var TimelineEnumField = ({
22585
22599
  leftItem: null,
22586
22600
  subMenu: null,
22587
22601
  quickSwitcherLabel: null,
22588
- disabled: !canUpdate
22602
+ disabled: !propStatus.canUpdate
22589
22603
  }));
22590
- }, [variantKeys, onSelect, canUpdate]);
22604
+ }, [variantKeys, onSelect, propStatus]);
22591
22605
  return /* @__PURE__ */ jsx204(Combobox, {
22592
22606
  small: true,
22593
22607
  title: field.key,
@@ -22615,20 +22629,19 @@ import { jsx as jsx205 } from "react/jsx-runtime";
22615
22629
  var TimelineNumberField = ({
22616
22630
  field,
22617
22631
  effectiveValue,
22618
- canUpdate,
22619
22632
  onSave,
22620
22633
  onDragValueChange,
22621
22634
  onDragEnd,
22622
- codeValue
22635
+ propStatus
22623
22636
  }) => {
22624
22637
  const [dragValue, setDragValue] = useState72(null);
22625
22638
  const onValueChange = useCallback106((newVal) => {
22626
22639
  setDragValue(newVal);
22627
- onDragValueChange(field.key, newVal);
22628
- }, [onDragValueChange, field.key]);
22640
+ onDragValueChange(newVal);
22641
+ }, [onDragValueChange]);
22629
22642
  const onValueChangeEnd = useCallback106((newVal) => {
22630
- if (canUpdate && newVal !== codeValue) {
22631
- onSave(field.key, newVal).finally(() => {
22643
+ if (propStatus.canUpdate && newVal !== propStatus.codeValue) {
22644
+ onSave(newVal).finally(() => {
22632
22645
  setDragValue(null);
22633
22646
  onDragEnd();
22634
22647
  });
@@ -22636,18 +22649,18 @@ var TimelineNumberField = ({
22636
22649
  setDragValue(null);
22637
22650
  onDragEnd();
22638
22651
  }
22639
- }, [canUpdate, onSave, field.key, codeValue, onDragEnd]);
22652
+ }, [onSave, propStatus, onDragEnd]);
22640
22653
  const onTextChange = useCallback106((newVal) => {
22641
- if (canUpdate) {
22654
+ if (propStatus.canUpdate) {
22642
22655
  const parsed = Number(newVal);
22643
- if (!Number.isNaN(parsed) && parsed !== codeValue) {
22656
+ if (!Number.isNaN(parsed) && propStatus.canUpdate && parsed !== propStatus.codeValue) {
22644
22657
  setDragValue(parsed);
22645
- onSave(field.key, parsed).catch(() => {
22658
+ onSave(parsed).catch(() => {
22646
22659
  setDragValue(null);
22647
22660
  });
22648
22661
  }
22649
22662
  }
22650
- }, [canUpdate, onSave, field.key, codeValue]);
22663
+ }, [onSave, propStatus]);
22651
22664
  const step = field.fieldSchema.type === "number" ? field.fieldSchema.step ?? 1 : 1;
22652
22665
  const stepDecimals = useMemo116(() => getDecimalPlaces(step), [step]);
22653
22666
  const formatter = useCallback106((v) => {
@@ -22697,8 +22710,7 @@ var parseCssRotationToDegrees = (value) => {
22697
22710
  var TimelineRotationField = ({
22698
22711
  field,
22699
22712
  effectiveValue,
22700
- codeValue,
22701
- canUpdate,
22713
+ propStatus,
22702
22714
  onSave,
22703
22715
  onDragValueChange,
22704
22716
  onDragEnd
@@ -22707,12 +22719,12 @@ var TimelineRotationField = ({
22707
22719
  const degrees = useMemo117(() => parseCssRotationToDegrees(String(effectiveValue ?? "0deg")), [effectiveValue]);
22708
22720
  const onValueChange = useCallback107((newVal) => {
22709
22721
  setDragValue(newVal);
22710
- onDragValueChange(field.key, `${newVal}deg`);
22711
- }, [onDragValueChange, field.key]);
22722
+ onDragValueChange(`${newVal}deg`);
22723
+ }, [onDragValueChange]);
22712
22724
  const onValueChangeEnd = useCallback107((newVal) => {
22713
22725
  const newStr = `${newVal}deg`;
22714
- if (canUpdate && newStr !== codeValue) {
22715
- onSave(field.key, newStr).finally(() => {
22726
+ if (propStatus.canUpdate && newStr !== propStatus.codeValue) {
22727
+ onSave(newStr).finally(() => {
22716
22728
  setDragValue(null);
22717
22729
  onDragEnd();
22718
22730
  });
@@ -22720,21 +22732,21 @@ var TimelineRotationField = ({
22720
22732
  setDragValue(null);
22721
22733
  onDragEnd();
22722
22734
  }
22723
- }, [canUpdate, onSave, field.key, codeValue, onDragEnd]);
22735
+ }, [propStatus, onSave, onDragEnd]);
22724
22736
  const onTextChange = useCallback107((newVal) => {
22725
- if (canUpdate) {
22737
+ if (propStatus.canUpdate) {
22726
22738
  const parsed = Number(newVal);
22727
22739
  if (!Number.isNaN(parsed)) {
22728
22740
  const newStr = `${parsed}deg`;
22729
- if (newStr !== codeValue) {
22741
+ if (newStr !== propStatus.codeValue) {
22730
22742
  setDragValue(parsed);
22731
- onSave(field.key, newStr).catch(() => {
22743
+ onSave(newStr).catch(() => {
22732
22744
  setDragValue(null);
22733
22745
  });
22734
22746
  }
22735
22747
  }
22736
22748
  }
22737
- }, [canUpdate, onSave, field.key, codeValue]);
22749
+ }, [propStatus, onSave]);
22738
22750
  const step = field.fieldSchema.type === "rotation" ? field.fieldSchema.step ?? 1 : 1;
22739
22751
  const stepDecimals = useMemo117(() => getDecimalPlaces(step), [step]);
22740
22752
  const formatter = useCallback107((v) => {
@@ -22783,9 +22795,8 @@ var containerStyle2 = {
22783
22795
  };
22784
22796
  var TimelineTranslateField = ({
22785
22797
  field,
22786
- codeValue,
22798
+ propStatus,
22787
22799
  effectiveValue,
22788
- canUpdate,
22789
22800
  onSave,
22790
22801
  onDragValueChange,
22791
22802
  onDragEnd
@@ -22805,13 +22816,13 @@ var TimelineTranslateField = ({
22805
22816
  const onXChange = useCallback108((newVal) => {
22806
22817
  setDragX(newVal);
22807
22818
  const currentY = dragY ?? codeY;
22808
- onDragValueChange(field.key, makeString(newVal, currentY));
22809
- }, [onDragValueChange, field.key, dragY, codeY, makeString]);
22819
+ onDragValueChange(makeString(newVal, currentY));
22820
+ }, [onDragValueChange, dragY, codeY, makeString]);
22810
22821
  const onXChangeEnd = useCallback108((newVal) => {
22811
22822
  const currentY = dragY ?? codeY;
22812
22823
  const newStr = makeString(newVal, currentY);
22813
- if (canUpdate && newStr !== codeValue) {
22814
- onSave(field.key, newStr).finally(() => {
22824
+ if (propStatus.canUpdate && newStr !== propStatus.codeValue) {
22825
+ onSave(newStr).finally(() => {
22815
22826
  setDragX(null);
22816
22827
  onDragEnd();
22817
22828
  });
@@ -22819,39 +22830,30 @@ var TimelineTranslateField = ({
22819
22830
  setDragX(null);
22820
22831
  onDragEnd();
22821
22832
  }
22822
- }, [
22823
- dragY,
22824
- codeY,
22825
- makeString,
22826
- canUpdate,
22827
- codeValue,
22828
- onSave,
22829
- field.key,
22830
- onDragEnd
22831
- ]);
22833
+ }, [dragY, codeY, makeString, propStatus, onSave, onDragEnd]);
22832
22834
  const onXTextChange = useCallback108((newVal) => {
22833
- if (canUpdate) {
22835
+ if (propStatus.canUpdate) {
22834
22836
  const parsed = Number(newVal);
22835
22837
  if (!Number.isNaN(parsed)) {
22836
22838
  const currentY = dragY ?? codeY;
22837
22839
  const newStr = makeString(parsed, currentY);
22838
- if (newStr !== codeValue) {
22840
+ if (newStr !== propStatus.codeValue) {
22839
22841
  setDragX(parsed);
22840
- onSave(field.key, newStr);
22842
+ onSave(newStr);
22841
22843
  }
22842
22844
  }
22843
22845
  }
22844
- }, [canUpdate, dragY, codeY, makeString, codeValue, onSave, field.key]);
22846
+ }, [propStatus, dragY, codeY, makeString, onSave]);
22845
22847
  const onYChange = useCallback108((newVal) => {
22846
22848
  setDragY(newVal);
22847
22849
  const currentX = dragX ?? codeX;
22848
- onDragValueChange(field.key, makeString(currentX, newVal));
22849
- }, [onDragValueChange, field.key, dragX, codeX, makeString]);
22850
+ onDragValueChange(makeString(currentX, newVal));
22851
+ }, [onDragValueChange, dragX, codeX, makeString]);
22850
22852
  const onYChangeEnd = useCallback108((newVal) => {
22851
22853
  const currentX = dragX ?? codeX;
22852
22854
  const newStr = makeString(currentX, newVal);
22853
- if (canUpdate && newStr !== codeValue) {
22854
- onSave(field.key, newStr).finally(() => {
22855
+ if (propStatus.canUpdate && newStr !== propStatus.codeValue) {
22856
+ onSave(newStr).finally(() => {
22855
22857
  setDragY(null);
22856
22858
  onDragEnd();
22857
22859
  });
@@ -22859,31 +22861,22 @@ var TimelineTranslateField = ({
22859
22861
  setDragY(null);
22860
22862
  onDragEnd();
22861
22863
  }
22862
- }, [
22863
- dragX,
22864
- codeX,
22865
- makeString,
22866
- canUpdate,
22867
- codeValue,
22868
- onSave,
22869
- field.key,
22870
- onDragEnd
22871
- ]);
22864
+ }, [dragX, codeX, makeString, propStatus, onSave, onDragEnd]);
22872
22865
  const onYTextChange = useCallback108((newVal) => {
22873
- if (canUpdate) {
22866
+ if (propStatus.canUpdate) {
22874
22867
  const parsed = Number(newVal);
22875
22868
  if (!Number.isNaN(parsed)) {
22876
22869
  const currentX = dragX ?? codeX;
22877
22870
  const newStr = makeString(currentX, parsed);
22878
- if (newStr !== codeValue) {
22871
+ if (newStr !== propStatus.codeValue) {
22879
22872
  setDragY(parsed);
22880
- onSave(field.key, newStr).catch(() => {
22873
+ onSave(newStr).catch(() => {
22881
22874
  setDragY(null);
22882
22875
  });
22883
22876
  }
22884
22877
  }
22885
22878
  }
22886
- }, [canUpdate, onSave, field.key, codeValue, dragX, codeX, makeString]);
22879
+ }, [propStatus, onSave, dragX, codeX, makeString]);
22887
22880
  return /* @__PURE__ */ jsxs95("span", {
22888
22881
  style: containerStyle2,
22889
22882
  children: [
@@ -22945,18 +22938,16 @@ var TimelineFieldValue = ({
22945
22938
  onDragValueChange,
22946
22939
  onDragEnd,
22947
22940
  propStatus,
22948
- canUpdate,
22949
- effectiveValue,
22950
- codeValue
22941
+ effectiveValue
22951
22942
  }) => {
22952
- const wrapperStyle = canUpdate === null || canUpdate === false ? notEditableBackground : undefined;
22943
+ const wrapperStyle = !propStatus.canUpdate ? notEditableBackground : undefined;
22953
22944
  if (!field.supported) {
22954
22945
  return /* @__PURE__ */ jsx208("span", {
22955
22946
  style: unsupportedLabel,
22956
22947
  children: "unsupported"
22957
22948
  });
22958
22949
  }
22959
- if (propStatus !== null && !propStatus.canUpdate) {
22950
+ if (!propStatus.canUpdate) {
22960
22951
  if (propStatus.reason === "computed") {
22961
22952
  return /* @__PURE__ */ jsx208("span", {
22962
22953
  style: unsupportedLabel,
@@ -22965,24 +22956,14 @@ var TimelineFieldValue = ({
22965
22956
  }
22966
22957
  throw new Error(`Unsupported prop status: ${propStatus.reason}`);
22967
22958
  }
22968
- if (propStatus === null) {
22969
- return /* @__PURE__ */ jsx208("span", {
22970
- style: notEditableBackground,
22971
- children: /* @__PURE__ */ jsx208("span", {
22972
- style: unsupportedLabel,
22973
- children: "error"
22974
- })
22975
- });
22976
- }
22977
22959
  if (field.typeName === "number") {
22978
22960
  return /* @__PURE__ */ jsx208("span", {
22979
22961
  style: wrapperStyle,
22980
22962
  children: /* @__PURE__ */ jsx208(TimelineNumberField, {
22981
22963
  field,
22982
22964
  effectiveValue,
22983
- canUpdate,
22984
22965
  onSave,
22985
- codeValue,
22966
+ propStatus,
22986
22967
  onDragValueChange,
22987
22968
  onDragEnd
22988
22969
  })
@@ -22994,8 +22975,7 @@ var TimelineFieldValue = ({
22994
22975
  children: /* @__PURE__ */ jsx208(TimelineRotationField, {
22995
22976
  field,
22996
22977
  effectiveValue,
22997
- codeValue,
22998
- canUpdate,
22978
+ propStatus,
22999
22979
  onSave,
23000
22980
  onDragValueChange,
23001
22981
  onDragEnd
@@ -23008,8 +22988,7 @@ var TimelineFieldValue = ({
23008
22988
  children: /* @__PURE__ */ jsx208(TimelineTranslateField, {
23009
22989
  field,
23010
22990
  effectiveValue,
23011
- codeValue,
23012
- canUpdate,
22991
+ propStatus,
23013
22992
  onSave,
23014
22993
  onDragValueChange,
23015
22994
  onDragEnd
@@ -23021,8 +23000,7 @@ var TimelineFieldValue = ({
23021
23000
  style: wrapperStyle,
23022
23001
  children: /* @__PURE__ */ jsx208(TimelineBooleanField, {
23023
23002
  field,
23024
- codeValue,
23025
- canUpdate,
23003
+ propStatus,
23026
23004
  onSave,
23027
23005
  effectiveValue
23028
23006
  })
@@ -23033,8 +23011,7 @@ var TimelineFieldValue = ({
23033
23011
  style: inlineWrapper,
23034
23012
  children: /* @__PURE__ */ jsx208(TimelineEnumField, {
23035
23013
  field,
23036
- codeValue,
23037
- canUpdate,
23014
+ propStatus,
23038
23015
  onSave,
23039
23016
  effectiveValue,
23040
23017
  onDragValueChange,
@@ -23076,10 +23053,14 @@ var TimelineFieldRow = ({
23076
23053
  nodePath,
23077
23054
  schema
23078
23055
  }) => {
23079
- const { getDragOverrides, getCodeValues } = useContext74(Internals54.VisualModeGettersContext);
23056
+ const { getCodeValues } = useContext74(Internals54.VisualModeCodeValuesContext);
23057
+ const { getDragOverrides } = useContext74(Internals54.VisualModeDragOverridesContext);
23080
23058
  const { setDragOverrides, clearDragOverrides } = useContext74(Internals54.VisualModeSettersContext);
23081
23059
  const codeValuesForOverride = getCodeValues(nodePath);
23082
23060
  const codeValue = codeValuesForOverride?.[field.key] ?? null;
23061
+ if (codeValue === null) {
23062
+ throw new Error("Unexpectedly got null code value for field" + field.key);
23063
+ }
23083
23064
  const dragOverrideValue = useMemo119(() => {
23084
23065
  return nodePath === null ? undefined : (getDragOverrides(nodePath) ?? {})[field.key];
23085
23066
  }, [getDragOverrides, nodePath, field.key]);
@@ -23091,43 +23072,66 @@ var TimelineFieldRow = ({
23091
23072
  shouldResortToDefaultValueIfUndefined: true
23092
23073
  });
23093
23074
  const { setCodeValues } = useContext74(Internals54.VisualModeSettersContext);
23094
- const onSave = useCallback109((key4, value) => {
23075
+ const onSave = useCallback109((value) => {
23095
23076
  if (!codeValuesForOverride || !validatedLocation || !nodePath) {
23096
23077
  return Promise.reject(new Error("Cannot save"));
23097
23078
  }
23098
- const status = codeValuesForOverride[key4];
23099
- if (!status || !status.canUpdate) {
23079
+ if (!codeValue || !codeValue.canUpdate) {
23100
23080
  return Promise.reject(new Error("Cannot save"));
23101
23081
  }
23102
23082
  const defaultValue = field.fieldSchema.default !== undefined ? JSON.stringify(field.fieldSchema.default) : null;
23083
+ const stringifiedValue = JSON.stringify(value);
23084
+ if (value === codeValue.codeValue) {
23085
+ return Promise.resolve();
23086
+ }
23087
+ if (defaultValue === stringifiedValue && codeValue.codeValue === undefined) {
23088
+ return Promise.resolve();
23089
+ }
23090
+ let previousUpdate;
23091
+ setCodeValues(nodePath, (prev) => {
23092
+ previousUpdate = prev;
23093
+ return optimisticUpdateForCodeValues({
23094
+ previous: prev,
23095
+ fieldKey: field.key,
23096
+ value,
23097
+ schema
23098
+ });
23099
+ });
23103
23100
  return callApi("/api/save-sequence-props", {
23104
23101
  fileName: validatedLocation.source,
23105
23102
  nodePath,
23106
- key: key4,
23107
- value: JSON.stringify(value),
23103
+ key: field.key,
23104
+ value: stringifiedValue,
23108
23105
  defaultValue,
23109
23106
  schema
23110
23107
  }).then((data) => {
23111
- if (data.success) {
23112
- setCodeValues(nodePath, data.newStatus);
23113
- return;
23108
+ setCodeValues(nodePath, () => data);
23109
+ }).catch(() => {
23110
+ if (previousUpdate) {
23111
+ setCodeValues(nodePath, (current) => {
23112
+ if (previousUpdate) {
23113
+ return previousUpdate;
23114
+ }
23115
+ return current;
23116
+ });
23114
23117
  }
23115
- return Promise.reject(new Error(data.reason));
23116
23118
  });
23117
23119
  }, [
23120
+ codeValue,
23118
23121
  codeValuesForOverride,
23119
23122
  field.fieldSchema.default,
23123
+ field.key,
23120
23124
  nodePath,
23121
23125
  schema,
23122
23126
  setCodeValues,
23123
23127
  validatedLocation
23124
23128
  ]);
23125
- const onDragValueChange = useCallback109((key4, value) => {
23129
+ const onDragValueChange = useCallback109((value) => {
23126
23130
  if (nodePath === null) {
23127
23131
  throw new Error("Cannot drag value");
23128
23132
  }
23129
- setDragOverrides(nodePath, key4, value);
23130
- }, [setDragOverrides, nodePath]);
23133
+ setDragOverrides(nodePath, field.key, value);
23134
+ }, [setDragOverrides, nodePath, field.key]);
23131
23135
  const onDragEnd = useCallback109(() => {
23132
23136
  if (nodePath === null) {
23133
23137
  throw new Error("Cannot clear drag value");
@@ -23160,9 +23164,7 @@ var TimelineFieldRow = ({
23160
23164
  onSave,
23161
23165
  onDragValueChange,
23162
23166
  onDragEnd,
23163
- canUpdate: codeValue?.canUpdate ?? false,
23164
- effectiveValue,
23165
- codeValue
23167
+ effectiveValue
23166
23168
  })
23167
23169
  ]
23168
23170
  });
@@ -23265,7 +23267,8 @@ var separator = {
23265
23267
  var TimelineExpandedSection = ({ sequence, originalLocation, nodePathInfo, nestedDepth }) => {
23266
23268
  const { getIsExpanded } = useContext75(ExpandedTracksGetterContext);
23267
23269
  const { toggleTrack } = useContext75(ExpandedTracksSetterContext);
23268
- const { getDragOverrides, getCodeValues } = useContext75(Internals55.VisualModeGettersContext);
23270
+ const { getCodeValues } = useContext75(Internals55.VisualModeCodeValuesContext);
23271
+ const { getDragOverrides } = useContext75(Internals55.VisualModeDragOverridesContext);
23269
23272
  const validatedLocation = useMemo121(() => {
23270
23273
  if (!originalLocation || !originalLocation.source || !originalLocation.line) {
23271
23274
  return null;
@@ -23287,9 +23290,8 @@ var TimelineExpandedSection = ({ sequence, originalLocation, nodePathInfo, neste
23287
23290
  sequence,
23288
23291
  nodePathInfo,
23289
23292
  getIsExpanded,
23290
- getDragOverrides,
23291
23293
  getCodeValues
23292
- }), [sequence, nodePathInfo, getIsExpanded, getDragOverrides, getCodeValues]);
23294
+ }), [sequence, nodePathInfo, getIsExpanded, getCodeValues]);
23293
23295
  const style10 = useMemo121(() => {
23294
23296
  return {
23295
23297
  ...expandedSectionBase,
@@ -23402,15 +23404,8 @@ var TimelineLayerEye = ({ onInvoked, hidden, type }) => {
23402
23404
  };
23403
23405
 
23404
23406
  // src/components/Timeline/TimelineStack/index.tsx
23405
- import { SOURCE_MAP_ENDPOINT } from "@remotion/studio-shared";
23406
23407
  import { useCallback as useCallback111, useContext as useContext76, useMemo as useMemo122, useState as useState75 } from "react";
23407
- import { SourceMapConsumer as SourceMapConsumer3 } from "source-map";
23408
23408
  import { jsx as jsx213, jsxs as jsxs99, Fragment as Fragment31 } from "react/jsx-runtime";
23409
- var publicPath = window.remotion_publicPath === "/" ? "" : window.remotion_publicPath;
23410
- var withoutSlashInTheEnd = publicPath.endsWith("/") ? publicPath.slice(0, -1) : publicPath;
23411
- SourceMapConsumer3.initialize({
23412
- "lib/mappings.wasm": withoutSlashInTheEnd + SOURCE_MAP_ENDPOINT
23413
- });
23414
23409
  var TimelineStack = ({ isCompact, sequence, originalLocation }) => {
23415
23410
  const [stackHovered, setStackHovered] = useState75(false);
23416
23411
  const [titleHovered, setTitleHovered] = useState75(false);
@@ -23572,13 +23567,10 @@ var INDENT = 10;
23572
23567
  var TimelineListItem = ({ nestedDepth, sequence, isCompact, nodePathInfo }) => {
23573
23568
  const nodePath = nodePathInfo?.nodePath ?? null;
23574
23569
  const { previewServerState } = useContext77(StudioServerConnectionCtx);
23575
- const visualModeEnvEnabled = Boolean(process.env.EXPERIMENTAL_VISUAL_MODE_ENABLED);
23576
23570
  const previewConnected = previewServerState.type === "connected";
23577
- const visualModeActive = visualModeEnvEnabled && previewConnected;
23578
23571
  const { hidden, setHidden } = useContext77(Internals56.SequenceVisibilityToggleContext);
23579
23572
  const { getIsExpanded } = useContext77(ExpandedTracksGetterContext);
23580
23573
  const { toggleTrack } = useContext77(ExpandedTracksSetterContext);
23581
- const { getIsJsxInMapCallback } = useContext77(Internals56.VisualModeGettersContext);
23582
23574
  const originalLocation = useResolvedStack(sequence.stack ?? null);
23583
23575
  const validatedLocation = useMemo123(() => {
23584
23576
  if (!originalLocation || !originalLocation.source || !originalLocation.line) {
@@ -23597,8 +23589,8 @@ var TimelineListItem = ({ nestedDepth, sequence, isCompact, nodePathInfo }) => {
23597
23589
  if (!validatedLocation?.source || !nodePath) {
23598
23590
  return;
23599
23591
  }
23600
- if (getIsJsxInMapCallback(nodePath)) {
23601
- const message = "This sequence is rendered inside a .map() callback. Duplicating inserts another copy in that callback (affecting each list item). Continue?";
23592
+ if (nodePathInfo && nodePathInfo.numberOfSequencesWithThisNodePath > 1) {
23593
+ const message = "This sequence is programmatically duplicated " + nodePathInfo.numberOfSequencesWithThisNodePath + " times in the code. Duplicating inserts another copy. Continue?";
23602
23594
  if (!window.confirm(message)) {
23603
23595
  return;
23604
23596
  }
@@ -23616,13 +23608,13 @@ var TimelineListItem = ({ nestedDepth, sequence, isCompact, nodePathInfo }) => {
23616
23608
  } catch (err) {
23617
23609
  showNotification(err.message, 4000);
23618
23610
  }
23619
- }, [nodePath, validatedLocation?.source, getIsJsxInMapCallback]);
23611
+ }, [nodePath, validatedLocation?.source, nodePathInfo]);
23620
23612
  const onDeleteSequenceFromSource = useCallback112(async () => {
23621
23613
  if (!validatedLocation?.source || !nodePath) {
23622
23614
  return;
23623
23615
  }
23624
- if (getIsJsxInMapCallback(nodePath)) {
23625
- const message = "This sequence is rendered inside a .map() callback. Deleting removes all sequences in that callback. Continue?";
23616
+ if (nodePathInfo && nodePathInfo.numberOfSequencesWithThisNodePath > 1) {
23617
+ const message = "This sequence is programmatically duplicated " + nodePathInfo.numberOfSequencesWithThisNodePath + " times in the code. Deleting removes all instances. Continue?";
23626
23618
  if (!window.confirm(message)) {
23627
23619
  return;
23628
23620
  }
@@ -23640,9 +23632,9 @@ var TimelineListItem = ({ nestedDepth, sequence, isCompact, nodePathInfo }) => {
23640
23632
  } catch (err) {
23641
23633
  showNotification(err.message, 4000);
23642
23634
  }
23643
- }, [nodePath, validatedLocation?.source, getIsJsxInMapCallback]);
23635
+ }, [nodePath, validatedLocation?.source, nodePathInfo]);
23644
23636
  const contextMenuValues = useMemo123(() => {
23645
- if (!visualModeEnvEnabled) {
23637
+ if (!previewConnected) {
23646
23638
  return [];
23647
23639
  }
23648
23640
  return [
@@ -23686,9 +23678,9 @@ var TimelineListItem = ({ nestedDepth, sequence, isCompact, nodePathInfo }) => {
23686
23678
  duplicateDisabled,
23687
23679
  onDeleteSequenceFromSource,
23688
23680
  onDuplicateSequenceFromSource,
23689
- visualModeEnvEnabled
23681
+ previewConnected
23690
23682
  ]);
23691
- const isExpanded = visualModeActive && nodePathInfo !== null && getIsExpanded(nodePathInfo);
23683
+ const isExpanded = previewConnected && nodePathInfo !== null && getIsExpanded(nodePathInfo);
23692
23684
  const onToggleExpand = useCallback112(() => {
23693
23685
  if (nodePathInfo === null) {
23694
23686
  return;
@@ -23739,7 +23731,7 @@ var TimelineListItem = ({ nestedDepth, sequence, isCompact, nodePathInfo }) => {
23739
23731
  /* @__PURE__ */ jsx214(Padder, {
23740
23732
  depth: nestedDepth
23741
23733
  }),
23742
- visualModeActive ? hasExpandableContent ? /* @__PURE__ */ jsx214(TimelineExpandArrowButton, {
23734
+ previewConnected ? hasExpandableContent ? /* @__PURE__ */ jsx214(TimelineExpandArrowButton, {
23743
23735
  isExpanded,
23744
23736
  onClick: onToggleExpand,
23745
23737
  label: "track properties",
@@ -23755,11 +23747,11 @@ var TimelineListItem = ({ nestedDepth, sequence, isCompact, nodePathInfo }) => {
23755
23747
  });
23756
23748
  return /* @__PURE__ */ jsxs100(Fragment32, {
23757
23749
  children: [
23758
- visualModeEnvEnabled ? /* @__PURE__ */ jsx214(ContextMenu, {
23750
+ previewConnected ? /* @__PURE__ */ jsx214(ContextMenu, {
23759
23751
  values: contextMenuValues,
23760
23752
  children: trackRow
23761
23753
  }) : trackRow,
23762
- visualModeActive && isExpanded && hasExpandableContent && nodePathInfo ? /* @__PURE__ */ jsx214(TimelineExpandedSection, {
23754
+ previewConnected && isExpanded && hasExpandableContent && nodePathInfo ? /* @__PURE__ */ jsx214(TimelineExpandedSection, {
23763
23755
  sequence,
23764
23756
  originalLocation,
23765
23757
  nodePathInfo,
@@ -24113,7 +24105,7 @@ var TimelineScrollable = ({ children }) => {
24113
24105
  };
24114
24106
 
24115
24107
  // src/components/Timeline/TimelineTracks.tsx
24116
- import { useContext as useContext81, useMemo as useMemo128 } from "react";
24108
+ import React156, { useContext as useContext81, useMemo as useMemo128 } from "react";
24117
24109
  import { Internals as Internals61 } from "remotion";
24118
24110
 
24119
24111
  // src/components/Timeline/TimelineSequence.tsx
@@ -24236,268 +24228,15 @@ var useMaxMediaDuration = (s, fps) => {
24236
24228
 
24237
24229
  // src/components/AudioWaveform.tsx
24238
24230
  import {
24231
+ drawBars,
24239
24232
  getLoopDisplayWidth,
24240
- shouldTileLoopDisplay
24233
+ loadWaveformPeaks,
24234
+ makeAudioWaveformWorker,
24235
+ shouldTileLoopDisplay,
24236
+ sliceWaveformPeaks
24241
24237
  } from "@remotion/timeline-utils";
24242
24238
  import { useEffect as useEffect73, useMemo as useMemo125, useRef as useRef42, useState as useState77 } from "react";
24243
24239
  import { Internals as Internals59 } from "remotion";
24244
-
24245
- // src/make-audio-waveform-worker.ts
24246
- var makeAudioWaveformWorker = () => {
24247
- return new Worker(new URL("./audio-waveform-worker.mjs", import.meta.url), {
24248
- type: "module"
24249
- });
24250
- };
24251
-
24252
- // src/components/parse-color.ts
24253
- var colorCache = new Map;
24254
- var parseColor = (color) => {
24255
- const cached = colorCache.get(color);
24256
- if (cached)
24257
- return cached;
24258
- const ctx = new OffscreenCanvas(1, 1).getContext("2d");
24259
- ctx.fillStyle = color;
24260
- ctx.fillRect(0, 0, 1, 1);
24261
- const [r, g, b, a] = ctx.getImageData(0, 0, 1, 1).data;
24262
- const result = [r, g, b, a];
24263
- colorCache.set(color, result);
24264
- return result;
24265
- };
24266
-
24267
- // src/components/draw-peaks.ts
24268
- var CLIPPING_COLOR = "#FF7F50";
24269
- var drawBars = (canvas, peaks, color, volume, width) => {
24270
- const ctx = canvas.getContext("2d");
24271
- if (!ctx) {
24272
- throw new Error("Failed to get canvas context");
24273
- }
24274
- const { height } = canvas;
24275
- const w = canvas.width;
24276
- if (w === 0 || height === 0) {
24277
- return;
24278
- }
24279
- ctx.clearRect(0, 0, w, height);
24280
- if (volume === 0)
24281
- return;
24282
- const [r, g, b, a] = parseColor(color);
24283
- const [cr, cg, cb, ca] = parseColor(CLIPPING_COLOR);
24284
- const imageData = ctx.createImageData(w, height);
24285
- const { data } = imageData;
24286
- const numBars = width;
24287
- for (let barIndex = 0;barIndex < numBars; barIndex++) {
24288
- const x = barIndex;
24289
- if (x >= w)
24290
- break;
24291
- const peakIndex = Math.floor(barIndex / numBars * peaks.length);
24292
- const peak = peaks[peakIndex] || 0;
24293
- const scaledPeak = peak * volume;
24294
- const halfBar = Math.max(0, Math.min(height / 2, scaledPeak * height / 2));
24295
- if (halfBar === 0)
24296
- continue;
24297
- const mid = height / 2;
24298
- const barY = Math.round(mid - halfBar);
24299
- const barEnd = Math.round(mid + halfBar);
24300
- const isClipping = scaledPeak > 1;
24301
- const clipTopEnd = isClipping ? Math.min(barY + 2, barEnd) : barY;
24302
- const clipBotStart = isClipping ? Math.max(barEnd - 2, barY) : barEnd;
24303
- for (let y = barY;y < clipTopEnd; y++) {
24304
- const idx = (y * w + x) * 4;
24305
- data[idx] = cr;
24306
- data[idx + 1] = cg;
24307
- data[idx + 2] = cb;
24308
- data[idx + 3] = ca;
24309
- }
24310
- for (let y = clipTopEnd;y < clipBotStart; y++) {
24311
- const idx = (y * w + x) * 4;
24312
- data[idx] = r;
24313
- data[idx + 1] = g;
24314
- data[idx + 2] = b;
24315
- data[idx + 3] = a;
24316
- }
24317
- for (let y = clipBotStart;y < barEnd; y++) {
24318
- const idx = (y * w + x) * 4;
24319
- data[idx] = cr;
24320
- data[idx + 1] = cg;
24321
- data[idx + 2] = cb;
24322
- data[idx + 3] = ca;
24323
- }
24324
- }
24325
- ctx.putImageData(imageData, 0, 0);
24326
- };
24327
-
24328
- // src/components/load-waveform-peaks.ts
24329
- import { ALL_FORMATS as ALL_FORMATS3, AudioSampleSink, Input as Input3, UrlSource as UrlSource3 } from "mediabunny";
24330
-
24331
- // src/components/waveform-peak-processor.ts
24332
- var emitWaveformProgress = ({
24333
- completedPeaks,
24334
- final,
24335
- onProgress,
24336
- peaks,
24337
- totalPeaks
24338
- }) => {
24339
- onProgress?.({
24340
- peaks,
24341
- completedPeaks,
24342
- totalPeaks,
24343
- final
24344
- });
24345
- };
24346
- var createWaveformPeakProcessor = ({
24347
- totalPeaks,
24348
- samplesPerPeak,
24349
- onProgress,
24350
- progressIntervalInMs,
24351
- now
24352
- }) => {
24353
- const peaks = new Float32Array(totalPeaks);
24354
- let peakIndex = 0;
24355
- let peakMax = 0;
24356
- let sampleInPeak = 0;
24357
- let lastProgressAt = 0;
24358
- let lastProgressPeak = 0;
24359
- const emitProgress = (force) => {
24360
- const timestamp = now();
24361
- if (!force && peakIndex === lastProgressPeak && sampleInPeak === 0) {
24362
- return;
24363
- }
24364
- if (!force && timestamp - lastProgressAt < progressIntervalInMs) {
24365
- return;
24366
- }
24367
- lastProgressAt = timestamp;
24368
- lastProgressPeak = peakIndex;
24369
- emitWaveformProgress({
24370
- peaks,
24371
- completedPeaks: peakIndex,
24372
- totalPeaks,
24373
- final: force,
24374
- onProgress
24375
- });
24376
- };
24377
- return {
24378
- peaks,
24379
- processSampleChunk: (floats, channels) => {
24380
- const frameCount = Math.floor(floats.length / Math.max(1, channels));
24381
- for (let frame2 = 0;frame2 < frameCount; frame2++) {
24382
- let framePeak = 0;
24383
- for (let channel = 0;channel < channels; channel++) {
24384
- const sampleIndex = frame2 * channels + channel;
24385
- const abs = Math.abs(floats[sampleIndex] ?? 0);
24386
- if (abs > framePeak) {
24387
- framePeak = abs;
24388
- }
24389
- }
24390
- if (framePeak > peakMax) {
24391
- peakMax = framePeak;
24392
- }
24393
- sampleInPeak++;
24394
- if (sampleInPeak >= samplesPerPeak) {
24395
- if (peakIndex < totalPeaks) {
24396
- peaks[peakIndex] = peakMax;
24397
- }
24398
- peakIndex++;
24399
- peakMax = 0;
24400
- sampleInPeak = 0;
24401
- }
24402
- }
24403
- emitProgress(false);
24404
- },
24405
- finalize: () => {
24406
- if (sampleInPeak > 0 && peakIndex < totalPeaks) {
24407
- peaks[peakIndex] = peakMax;
24408
- peakIndex++;
24409
- }
24410
- emitProgress(true);
24411
- }
24412
- };
24413
- };
24414
-
24415
- // src/components/load-waveform-peaks.ts
24416
- var TARGET_SAMPLE_RATE = 100;
24417
- var DEFAULT_PROGRESS_INTERVAL_IN_MS = 50;
24418
- var peaksCache = new Map;
24419
- async function loadWaveformPeaks(url, signal, options) {
24420
- const cached = peaksCache.get(url);
24421
- if (cached) {
24422
- emitWaveformProgress({
24423
- peaks: cached,
24424
- completedPeaks: cached.length,
24425
- totalPeaks: cached.length,
24426
- final: true,
24427
- onProgress: options?.onProgress
24428
- });
24429
- return cached;
24430
- }
24431
- const input2 = new Input3({
24432
- formats: ALL_FORMATS3,
24433
- source: new UrlSource3(url)
24434
- });
24435
- try {
24436
- const audioTrack = await input2.getPrimaryAudioTrack();
24437
- if (!audioTrack) {
24438
- return new Float32Array(0);
24439
- }
24440
- if (await audioTrack.isLive()) {
24441
- throw new Error("Live streams are not currently supported by Remotion. Sorry! Source: " + url);
24442
- }
24443
- if (await audioTrack.isRelativeToUnixEpoch()) {
24444
- throw new Error("Streams with UNIX timestamps are not currently supported by Remotion. Sorry! Source: " + url);
24445
- }
24446
- const sampleRate = await audioTrack.getSampleRate();
24447
- const durationInSeconds = await audioTrack.getDurationFromMetadata({ skipLiveWait: true }) ?? await audioTrack.computeDuration({ skipLiveWait: true });
24448
- const totalPeaks = Math.ceil(durationInSeconds * TARGET_SAMPLE_RATE);
24449
- const samplesPerPeak = Math.max(1, Math.floor(sampleRate / TARGET_SAMPLE_RATE));
24450
- const sink = new AudioSampleSink(audioTrack);
24451
- const processor = createWaveformPeakProcessor({
24452
- totalPeaks,
24453
- samplesPerPeak,
24454
- onProgress: options?.onProgress,
24455
- progressIntervalInMs: options?.progressIntervalInMs ?? DEFAULT_PROGRESS_INTERVAL_IN_MS,
24456
- now: () => Date.now()
24457
- });
24458
- for await (const sample of sink.samples()) {
24459
- if (signal.aborted) {
24460
- sample.close();
24461
- return new Float32Array(0);
24462
- }
24463
- const bytesNeeded = sample.allocationSize({
24464
- format: "f32",
24465
- planeIndex: 0
24466
- });
24467
- const floats = new Float32Array(bytesNeeded / 4);
24468
- sample.copyTo(floats, { format: "f32", planeIndex: 0 });
24469
- const channels = Math.max(1, sample.numberOfChannels);
24470
- sample.close();
24471
- processor.processSampleChunk(floats, channels);
24472
- }
24473
- processor.finalize();
24474
- const { peaks } = processor;
24475
- peaksCache.set(url, peaks);
24476
- return peaks;
24477
- } finally {
24478
- input2.dispose();
24479
- }
24480
- }
24481
-
24482
- // src/components/slice-waveform-peaks.ts
24483
- var sliceWaveformPeaks = ({
24484
- durationInFrames,
24485
- fps,
24486
- peaks,
24487
- playbackRate,
24488
- startFrom
24489
- }) => {
24490
- if (peaks.length === 0) {
24491
- return peaks;
24492
- }
24493
- const startTimeInSeconds = startFrom / fps;
24494
- const durationInSeconds = durationInFrames / fps * playbackRate;
24495
- const startPeakIndex = Math.floor(startTimeInSeconds * TARGET_SAMPLE_RATE);
24496
- const endPeakIndex = Math.ceil((startTimeInSeconds + durationInSeconds) * TARGET_SAMPLE_RATE);
24497
- return peaks.subarray(Math.max(0, startPeakIndex), Math.min(peaks.length, endPeakIndex));
24498
- };
24499
-
24500
- // src/components/AudioWaveform.tsx
24501
24240
  import { jsx as jsx217, jsxs as jsxs102 } from "react/jsx-runtime";
24502
24241
  var EMPTY_PEAKS = new Float32Array(0);
24503
24242
  var canRetryCanvasTransfer = (err) => {
@@ -24546,7 +24285,13 @@ var drawLoopedWaveform = ({
24546
24285
  const targetCanvas = document.createElement("canvas");
24547
24286
  targetCanvas.width = Math.max(1, Math.ceil(loopWidth));
24548
24287
  targetCanvas.height = h;
24549
- drawBars(targetCanvas, peaks, "rgba(255, 255, 255, 0.6)", volume, targetCanvas.width);
24288
+ drawBars({
24289
+ canvas: targetCanvas,
24290
+ peaks,
24291
+ color: "rgba(255, 255, 255, 0.6)",
24292
+ volume,
24293
+ width: targetCanvas.width
24294
+ });
24550
24295
  canvas.width = w;
24551
24296
  canvas.height = h;
24552
24297
  const ctx = canvas.getContext("2d");
@@ -24709,7 +24454,13 @@ var AudioWaveform = ({
24709
24454
  })
24710
24455
  });
24711
24456
  } else {
24712
- drawBars(canvasElement, portionPeaks ?? EMPTY_PEAKS, "rgba(255, 255, 255, 0.6)", vol, w);
24457
+ drawBars({
24458
+ canvas: canvasElement,
24459
+ peaks: portionPeaks ?? EMPTY_PEAKS,
24460
+ color: "rgba(255, 255, 255, 0.6)",
24461
+ volume: vol,
24462
+ width: w
24463
+ });
24713
24464
  }
24714
24465
  }, [
24715
24466
  canUseWorkerPath,
@@ -25205,7 +24956,7 @@ var TimelineSequenceFn = ({ s }) => {
25205
24956
  if (windowWidth === null) {
25206
24957
  return null;
25207
24958
  }
25208
- return /* @__PURE__ */ jsx223(Inner4, {
24959
+ return /* @__PURE__ */ jsx223(TimelineSequenceInner, {
25209
24960
  windowWidth,
25210
24961
  s
25211
24962
  });
@@ -25282,7 +25033,7 @@ var TimelineSequenceCurrentFrame = ({
25282
25033
  ]
25283
25034
  });
25284
25035
  };
25285
- var Inner4 = ({ s, windowWidth }) => {
25036
+ var TimelineSequenceInner = ({ s, windowWidth }) => {
25286
25037
  const video = Internals60.useVideo();
25287
25038
  const maxMediaDuration = useMaxMediaDuration(s, video?.fps ?? 30);
25288
25039
  const effectiveMaxMediaDuration = s.loopDisplay ? null : maxMediaDuration;
@@ -25380,22 +25131,20 @@ var getExpandedPlaceholderStyle = ({
25380
25131
  sequence,
25381
25132
  nodePathInfo,
25382
25133
  getIsExpanded,
25383
- getDragOverrides,
25384
25134
  getCodeValues
25385
25135
  }) => ({
25386
25136
  height: getExpandedTrackHeight({
25387
25137
  sequence,
25388
25138
  nodePathInfo,
25389
25139
  getIsExpanded,
25390
- getDragOverrides,
25391
25140
  getCodeValues
25392
25141
  }) + TIMELINE_ITEM_BORDER_BOTTOM
25393
25142
  });
25394
- var TimelineTracks = ({ timeline, hasBeenCut }) => {
25143
+ var TimelineTracksInner = ({ timeline, hasBeenCut }) => {
25395
25144
  const { getIsExpanded } = useContext81(ExpandedTracksGetterContext);
25396
25145
  const { previewServerState } = useContext81(StudioServerConnectionCtx);
25397
- const { getDragOverrides, getCodeValues } = useContext81(Internals61.VisualModeGettersContext);
25398
- const visualModeEnabled = Boolean(process.env.EXPERIMENTAL_VISUAL_MODE_ENABLED) && previewServerState.type === "connected";
25146
+ const { getCodeValues } = useContext81(Internals61.VisualModeCodeValuesContext);
25147
+ const previewServerConnected = previewServerState.type === "connected";
25399
25148
  const timelineStyle = useMemo128(() => {
25400
25149
  return {
25401
25150
  ...timelineContent,
@@ -25425,12 +25174,11 @@ var TimelineTracks = ({ timeline, hasBeenCut }) => {
25425
25174
  s: track.sequence
25426
25175
  })
25427
25176
  }),
25428
- visualModeEnabled && isExpanded && track.nodePathInfo ? /* @__PURE__ */ jsx224("div", {
25177
+ isExpanded && track.nodePathInfo && previewServerConnected ? /* @__PURE__ */ jsx224("div", {
25429
25178
  style: getExpandedPlaceholderStyle({
25430
25179
  sequence: track.sequence,
25431
25180
  nodePathInfo: track.nodePathInfo,
25432
25181
  getIsExpanded,
25433
- getDragOverrides,
25434
25182
  getCodeValues
25435
25183
  })
25436
25184
  }) : null
@@ -25443,6 +25191,7 @@ var TimelineTracks = ({ timeline, hasBeenCut }) => {
25443
25191
  ]
25444
25192
  });
25445
25193
  };
25194
+ var TimelineTracks = React156.memo(TimelineTracksInner);
25446
25195
 
25447
25196
  // src/components/Timeline/Timeline.tsx
25448
25197
  import { jsx as jsx225, jsxs as jsxs108 } from "react/jsx-runtime";
@@ -25477,15 +25226,16 @@ var TimelineInner = () => {
25477
25226
  const filtered = useMemo129(() => {
25478
25227
  return timeline.filter((t) => !isTrackHidden(t) && t.sequence.from <= durationInFrames && t.sequence.duration > 0 && t.sequence.showInTimeline);
25479
25228
  }, [durationInFrames, timeline]);
25480
- const shown = filtered.slice(0, MAX_TIMELINE_TRACKS);
25229
+ const shown = useMemo129(() => {
25230
+ return filtered.length > MAX_TIMELINE_TRACKS ? filtered.slice(0, MAX_TIMELINE_TRACKS) : filtered;
25231
+ }, [filtered]);
25481
25232
  const hasBeenCut = filtered.length > shown.length;
25482
- const visualModeEnvEnabled = Boolean(process.env.EXPERIMENTAL_VISUAL_MODE_ENABLED);
25483
25233
  return /* @__PURE__ */ jsxs108("div", {
25484
25234
  ref: timelineVerticalScroll,
25485
25235
  style: container44,
25486
25236
  className: "css-reset " + VERTICAL_SCROLLBAR_CLASSNAME,
25487
25237
  children: [
25488
- visualModeEnvEnabled ? sequences.map((sequence) => {
25238
+ sequences.map((sequence) => {
25489
25239
  if (!sequence.controls || !previewConnected || !sequence.stack) {
25490
25240
  return null;
25491
25241
  }
@@ -25494,7 +25244,7 @@ var TimelineInner = () => {
25494
25244
  schema: sequence.controls.schema,
25495
25245
  stack: sequence.stack
25496
25246
  }, sequence.id);
25497
- }) : null,
25247
+ }),
25498
25248
  /* @__PURE__ */ jsx225(SequencePropsObserver, {}),
25499
25249
  /* @__PURE__ */ jsxs108(TimelineWidthProvider, {
25500
25250
  children: [
@@ -26968,7 +26718,7 @@ var isValidJSON = (value) => {
26968
26718
  return false;
26969
26719
  }
26970
26720
  };
26971
- var Inner5 = () => {
26721
+ var Inner = () => {
26972
26722
  const [value, setValue] = useState82(() => {
26973
26723
  const override = Internals68.getInputPropsOverride();
26974
26724
  if (override) {
@@ -27050,7 +26800,7 @@ var Inner5 = () => {
27050
26800
  };
27051
26801
  var OverrideInputPropsModal = () => {
27052
26802
  return /* @__PURE__ */ jsx240(DismissableModal, {
27053
- children: /* @__PURE__ */ jsx240(Inner5, {})
26803
+ children: /* @__PURE__ */ jsx240(Inner, {})
27054
26804
  });
27055
26805
  };
27056
26806
 
@@ -27831,7 +27581,7 @@ var KeyboardShortcutsExplainer = () => {
27831
27581
  };
27832
27582
 
27833
27583
  // src/components/QuickSwitcher/algolia-search.ts
27834
- import { NoReactInternals as NoReactInternals15 } from "remotion/no-react";
27584
+ import { NoReactInternals as NoReactInternals16 } from "remotion/no-react";
27835
27585
  var ALGOLIA_API_KEY = "3e42dbd4f895fe93ff5cf40d860c4a85";
27836
27586
  var ALGOLIA_APPLICATION_ID = "PLSDUOL1CA";
27837
27587
  var AGOLIA_SEARCH_URL = "https://plsduol1ca-dsn.algolia.net/1/indexes/*/queries";
@@ -27873,7 +27623,7 @@ var algoliaSearch = async (query) => {
27873
27623
  window.open(hit.url);
27874
27624
  }
27875
27625
  };
27876
- }).filter(NoReactInternals15.truthy);
27626
+ }).filter(NoReactInternals16.truthy);
27877
27627
  };
27878
27628
  var splitMatchIntoTitleAndSubtitle = (match) => {
27879
27629
  const main = match.type === "content" ? match._highlightResult.content : match._highlightResult.hierarchy[match.type];
@@ -36733,14 +36483,13 @@ import { jsx as jsx311, jsxs as jsxs160 } from "react/jsx-runtime";
36733
36483
  var getServerDisconnectedDomElement = () => {
36734
36484
  return document.getElementById("server-disconnected-overlay");
36735
36485
  };
36736
- var StudioInner = ({ rootComponent, readOnly, visualModeEnabled }) => {
36486
+ var StudioInner = ({ rootComponent, readOnly }) => {
36737
36487
  return /* @__PURE__ */ jsx311(Internals76.CompositionManagerProvider, {
36738
36488
  onlyRenderComposition: null,
36739
36489
  currentCompositionMetadata: null,
36740
36490
  initialCompositions: [],
36741
36491
  initialCanvasContent: null,
36742
36492
  children: /* @__PURE__ */ jsx311(Internals76.RemotionRootContexts, {
36743
- visualModeEnabled,
36744
36493
  frameState: null,
36745
36494
  audioEnabled: window.remotion_audioEnabled,
36746
36495
  videoEnabled: window.remotion_videoEnabled,
@@ -36764,15 +36513,14 @@ var StudioInner = ({ rootComponent, readOnly, visualModeEnabled }) => {
36764
36513
  })
36765
36514
  });
36766
36515
  };
36767
- var Studio = ({ rootComponent, readOnly, visualModeEnabled }) => {
36516
+ var Studio = ({ rootComponent, readOnly }) => {
36768
36517
  useLayoutEffect5(() => {
36769
36518
  injectCSS();
36770
36519
  }, []);
36771
36520
  return /* @__PURE__ */ jsx311(FastRefreshProvider, {
36772
36521
  children: /* @__PURE__ */ jsx311(StudioInner, {
36773
36522
  rootComponent,
36774
- readOnly,
36775
- visualModeEnabled
36523
+ readOnly
36776
36524
  })
36777
36525
  });
36778
36526
  };
@@ -36799,7 +36547,7 @@ var getRootForElement = () => {
36799
36547
  };
36800
36548
  var renderToDOM = (content7) => {
36801
36549
  if (!ReactDOM10.createRoot) {
36802
- if (NoReactInternals16.ENABLE_V5_BREAKING_CHANGES) {
36550
+ if (NoReactInternals17.ENABLE_V5_BREAKING_CHANGES) {
36803
36551
  throw new Error("Remotion 5.0 does only support React 18+. However, ReactDOM.createRoot() is undefined.");
36804
36552
  }
36805
36553
  ReactDOM10.render(content7, Internals77.getPreviewDomElement());
@@ -36811,7 +36559,6 @@ renderToDOM(/* @__PURE__ */ jsx312(NoRegisterRoot, {}));
36811
36559
  Internals77.waitForRoot((NewRoot) => {
36812
36560
  renderToDOM(/* @__PURE__ */ jsx312(Studio, {
36813
36561
  readOnly: false,
36814
- rootComponent: NewRoot,
36815
- visualModeEnabled: Boolean(process.env.EXPERIMENTAL_VISUAL_MODE_ENABLED)
36562
+ rootComponent: NewRoot
36816
36563
  }));
36817
36564
  });