remotion 4.0.472 → 4.0.474

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 (36) hide show
  1. package/dist/cjs/CompositionManager.d.ts +1 -1
  2. package/dist/cjs/Img.d.ts +0 -1
  3. package/dist/cjs/Sequence.d.ts +3 -1
  4. package/dist/cjs/Sequence.js +7 -1
  5. package/dist/cjs/SequenceManager.d.ts +13 -5
  6. package/dist/cjs/SequenceManager.js +23 -13
  7. package/dist/cjs/calculate-media-duration.js +1 -1
  8. package/dist/cjs/canvas-image/CanvasImage.d.ts +0 -1
  9. package/dist/cjs/effects/use-memoized-effects.d.ts +5 -5
  10. package/dist/cjs/effects/use-memoized-effects.js +32 -21
  11. package/dist/cjs/get-effective-visual-mode-value.d.ts +2 -2
  12. package/dist/cjs/get-effective-visual-mode-value.js +11 -8
  13. package/dist/cjs/internals.d.ts +14 -14
  14. package/dist/cjs/internals.js +7 -3
  15. package/dist/cjs/interpolate-keyframed-status.d.ts +3 -1
  16. package/dist/cjs/interpolate-keyframed-status.js +3 -2
  17. package/dist/cjs/interpolate.d.ts +8 -1
  18. package/dist/cjs/interpolate.js +34 -1
  19. package/dist/cjs/no-react.d.ts +0 -1
  20. package/dist/cjs/sequence-field-schema.d.ts +70 -3
  21. package/dist/cjs/sequence-field-schema.js +6 -2
  22. package/dist/cjs/series/index.js +2 -2
  23. package/dist/cjs/timeline-position-state.d.ts +1 -0
  24. package/dist/cjs/timeline-position-state.js +6 -2
  25. package/dist/cjs/use-media-in-timeline.d.ts +1 -1
  26. package/dist/cjs/use-schema.d.ts +3 -4
  27. package/dist/cjs/use-schema.js +6 -6
  28. package/dist/cjs/version.d.ts +1 -1
  29. package/dist/cjs/version.js +1 -1
  30. package/dist/cjs/wrap-in-schema.js +3 -3
  31. package/dist/cjs/wrap-remotion-context.d.ts +2 -0
  32. package/dist/cjs/wrap-remotion-context.js +7 -1
  33. package/dist/esm/index.mjs +179 -82
  34. package/dist/esm/no-react.mjs +43 -2
  35. package/dist/esm/version.mjs +1 -1
  36. package/package.json +2 -2
@@ -1291,7 +1291,7 @@ var addSequenceStackTraces = (component) => {
1291
1291
  };
1292
1292
 
1293
1293
  // src/version.ts
1294
- var VERSION = "4.0.472";
1294
+ var VERSION = "4.0.474";
1295
1295
 
1296
1296
  // src/multiple-versions-warning.ts
1297
1297
  var checkMultipleRemotionVersions = () => {
@@ -1355,7 +1355,8 @@ __export(exports_timeline_position_state, {
1355
1355
  useAbsoluteTimelinePosition: () => useAbsoluteTimelinePosition,
1356
1356
  persistCurrentFrame: () => persistCurrentFrame,
1357
1357
  getInitialFrameState: () => getInitialFrameState,
1358
- getFrameForComposition: () => getFrameForComposition
1358
+ getFrameForComposition: () => getFrameForComposition,
1359
+ clampFrameToCompositionRange: () => clampFrameToCompositionRange
1359
1360
  });
1360
1361
  import { useContext as useContext10, useMemo as useMemo9 } from "react";
1361
1362
 
@@ -1509,6 +1510,9 @@ var getFrameForComposition = (composition) => {
1509
1510
  }
1510
1511
  return window.remotion_initialFrame ?? 0;
1511
1512
  };
1513
+ var clampFrameToCompositionRange = (frame, durationInFrames) => {
1514
+ return Math.max(0, Math.min(Math.max(0, durationInFrames - 1), frame));
1515
+ };
1512
1516
  var useTimelinePositionFromContext = (state) => {
1513
1517
  const videoConfig = useVideo();
1514
1518
  const env = useRemotionEnvironment();
@@ -1516,7 +1520,7 @@ var useTimelinePositionFromContext = (state) => {
1516
1520
  return typeof window === "undefined" ? 0 : window.remotion_initialFrame ?? 0;
1517
1521
  }
1518
1522
  const unclamped = state.frame[videoConfig.id] ?? (env.isPlayer ? 0 : getFrameForComposition(videoConfig.id));
1519
- return Math.min(videoConfig.durationInFrames - 1, unclamped);
1523
+ return clampFrameToCompositionRange(unclamped, videoConfig.durationInFrames);
1520
1524
  };
1521
1525
  var useTimelineContext = () => {
1522
1526
  const state = useContext10(TimelineContext);
@@ -1723,7 +1727,6 @@ var sequenceVisualStyleSchema = {
1723
1727
  },
1724
1728
  "style.scale": {
1725
1729
  type: "scale",
1726
- min: 0.05,
1727
1730
  max: 100,
1728
1731
  step: 0.01,
1729
1732
  default: 1,
@@ -1804,6 +1807,11 @@ var sequenceSchema = {
1804
1807
  }
1805
1808
  }
1806
1809
  };
1810
+ var sequenceSchemaWithoutFrom = {
1811
+ hidden: hiddenField,
1812
+ durationInFrames: durationInFramesField,
1813
+ layout: sequenceSchema.layout
1814
+ };
1807
1815
  var sequenceSchemaDefaultLayoutNone = {
1808
1816
  ...sequenceSchema,
1809
1817
  layout: {
@@ -1824,11 +1832,17 @@ var SequenceManager = React11.createContext({
1824
1832
  },
1825
1833
  sequences: []
1826
1834
  });
1835
+ var SequenceManagerRefContext = React11.createContext({
1836
+ current: []
1837
+ });
1827
1838
  var makeSequencePropsSubscriptionKey = (key) => {
1828
1839
  return `${key.nodePath.join(".")}.${key.sequenceKeys.join(".")}.${key.effectKeys.map((keys) => keys.join(".")).join(".")}`;
1829
1840
  };
1830
- var VisualModeCodeValuesContext = React11.createContext({
1831
- codeValues: {}
1841
+ var VisualModePropStatusesContext = React11.createContext({
1842
+ propStatuses: {}
1843
+ });
1844
+ var VisualModePropStatusesRefContext = React11.createContext({
1845
+ current: {}
1832
1846
  });
1833
1847
  var VisualModeDragOverridesContext = React11.createContext({
1834
1848
  getDragOverrides: () => {
@@ -1851,18 +1865,22 @@ var VisualModeSettersContext = React11.createContext({
1851
1865
  clearEffectDragOverrides: () => {
1852
1866
  throw new Error("VisualModeSettersContext not initialized");
1853
1867
  },
1854
- setCodeValues: () => {
1868
+ setPropStatuses: () => {
1855
1869
  throw new Error("VisualModeSettersContext not initialized");
1856
1870
  }
1857
1871
  });
1858
1872
  var effectDragOverridesKey = (nodePath, effectIndex) => `${makeSequencePropsSubscriptionKey(nodePath)}.effects.${effectIndex}`;
1859
1873
  var SequenceManagerProvider = ({ children }) => {
1860
1874
  const [sequences, setSequences] = useState3([]);
1875
+ const sequencesRef = useRef4(sequences);
1876
+ sequencesRef.current = sequences;
1861
1877
  const [dragOverrides, setControlOverrides] = useState3({});
1862
1878
  const controlOverridesRef = useRef4(dragOverrides);
1863
1879
  controlOverridesRef.current = dragOverrides;
1864
1880
  const [effectDragOverridesState, setEffectDragOverridesState] = useState3({});
1865
- const [codeValues, setCodeValuesMapState] = useState3({});
1881
+ const [propStatuses, setPropStatusesMapState] = useState3({});
1882
+ const propStatusesRef = useRef4(propStatuses);
1883
+ propStatusesRef.current = propStatuses;
1866
1884
  const setDragOverrides = useCallback5((nodePath, key, value) => {
1867
1885
  setControlOverrides((prev) => ({
1868
1886
  ...prev,
@@ -1906,8 +1924,8 @@ var SequenceManagerProvider = ({ children }) => {
1906
1924
  return next;
1907
1925
  });
1908
1926
  }, []);
1909
- const setCodeValues = useCallback5((nodePath, values) => {
1910
- setCodeValuesMapState((prev) => {
1927
+ const setPropStatuses = useCallback5((nodePath, values) => {
1928
+ setPropStatusesMapState((prev) => {
1911
1929
  const key = makeSequencePropsSubscriptionKey(nodePath);
1912
1930
  const prevKey = prev[key];
1913
1931
  const newKey = values(prevKey);
@@ -1938,11 +1956,11 @@ var SequenceManagerProvider = ({ children }) => {
1938
1956
  const getEffectDragOverrides = useCallback5((nodePath, effectIndex) => {
1939
1957
  return effectDragOverridesState[effectDragOverridesKey(nodePath, effectIndex)] ?? {};
1940
1958
  }, [effectDragOverridesState]);
1941
- const codeValuesContext = useMemo12(() => {
1959
+ const propStatusesContext = useMemo12(() => {
1942
1960
  return {
1943
- codeValues
1961
+ propStatuses
1944
1962
  };
1945
- }, [codeValues]);
1963
+ }, [propStatuses]);
1946
1964
  const dragOverridesContext = useMemo12(() => {
1947
1965
  return {
1948
1966
  getDragOverrides,
@@ -1955,24 +1973,30 @@ var SequenceManagerProvider = ({ children }) => {
1955
1973
  clearDragOverrides,
1956
1974
  setEffectDragOverrides,
1957
1975
  clearEffectDragOverrides,
1958
- setCodeValues
1976
+ setPropStatuses
1959
1977
  };
1960
1978
  }, [
1961
1979
  setDragOverrides,
1962
1980
  clearDragOverrides,
1963
1981
  setEffectDragOverrides,
1964
1982
  clearEffectDragOverrides,
1965
- setCodeValues
1983
+ setPropStatuses
1966
1984
  ]);
1967
- return /* @__PURE__ */ jsx10(SequenceManager.Provider, {
1968
- value: sequenceContext,
1969
- children: /* @__PURE__ */ jsx10(VisualModeCodeValuesContext.Provider, {
1970
- value: codeValuesContext,
1971
- children: /* @__PURE__ */ jsx10(VisualModeDragOverridesContext.Provider, {
1972
- value: dragOverridesContext,
1973
- children: /* @__PURE__ */ jsx10(VisualModeSettersContext.Provider, {
1974
- value: settersContext,
1975
- children
1985
+ return /* @__PURE__ */ jsx10(SequenceManagerRefContext.Provider, {
1986
+ value: sequencesRef,
1987
+ children: /* @__PURE__ */ jsx10(SequenceManager.Provider, {
1988
+ value: sequenceContext,
1989
+ children: /* @__PURE__ */ jsx10(VisualModePropStatusesRefContext.Provider, {
1990
+ value: propStatusesRef,
1991
+ children: /* @__PURE__ */ jsx10(VisualModePropStatusesContext.Provider, {
1992
+ value: propStatusesContext,
1993
+ children: /* @__PURE__ */ jsx10(VisualModeDragOverridesContext.Provider, {
1994
+ value: dragOverridesContext,
1995
+ children: /* @__PURE__ */ jsx10(VisualModeSettersContext.Provider, {
1996
+ value: settersContext,
1997
+ children
1998
+ })
1999
+ })
1976
2000
  })
1977
2001
  })
1978
2002
  })
@@ -2483,6 +2507,40 @@ var interpolateString = ({
2483
2507
  dimensions
2484
2508
  });
2485
2509
  };
2510
+ var validateTupleOutputRange = (outputRange) => {
2511
+ const dimensions = outputRange[0]?.length;
2512
+ if (dimensions === undefined) {
2513
+ throw new Error("outputRange must have at least 1 element");
2514
+ }
2515
+ if (dimensions === 0) {
2516
+ throw new TypeError("outputRange tuples must contain at least 1 number");
2517
+ }
2518
+ for (const output of outputRange) {
2519
+ if (output.length !== dimensions) {
2520
+ throw new TypeError(`outputRange tuples must all have the same length, but got ${dimensions} and ${output.length}`);
2521
+ }
2522
+ for (const value of output) {
2523
+ if (typeof value !== "number" || !Number.isFinite(value)) {
2524
+ throw new TypeError(`outputRange tuples must contain only finite numbers, but got [${output.join(",")}]`);
2525
+ }
2526
+ }
2527
+ }
2528
+ return dimensions;
2529
+ };
2530
+ var interpolateTuple = ({
2531
+ input,
2532
+ inputRange,
2533
+ outputRange,
2534
+ options
2535
+ }) => {
2536
+ const dimensions = validateTupleOutputRange(outputRange);
2537
+ return new Array(dimensions).fill(true).map((_, axis) => interpolateNumber({
2538
+ input,
2539
+ inputRange,
2540
+ outputRange: outputRange.map((output) => output[axis]),
2541
+ options
2542
+ }));
2543
+ };
2486
2544
  function checkValidInputRange(arr) {
2487
2545
  for (let i = 1;i < arr.length; ++i) {
2488
2546
  if (!(arr[i] > arr[i - 1])) {
@@ -2558,8 +2616,11 @@ function interpolate(input, inputRange, outputRange, options) {
2558
2616
  }
2559
2617
  return interpolateString({ input, inputRange, outputRange, options });
2560
2618
  }
2619
+ if (outputRange.every((output) => Array.isArray(output))) {
2620
+ return interpolateTuple({ input, inputRange, outputRange, options });
2621
+ }
2561
2622
  if (!outputRange.every((output) => typeof output === "number")) {
2562
- throw new TypeError("outputRange must contain only numbers, or supported scale, translate, and rotate strings");
2623
+ throw new TypeError("outputRange must contain only numbers, numeric tuples, or supported scale, translate, and rotate strings");
2563
2624
  }
2564
2625
  checkInfiniteRange("outputRange", outputRange);
2565
2626
  return interpolateNumber({ input, inputRange, outputRange, options });
@@ -3076,8 +3137,9 @@ var interpolateKeyframedStatus = ({
3076
3137
  if (keyframes.length === 0) {
3077
3138
  return null;
3078
3139
  }
3079
- const inputRange = keyframes.map((k) => k.frame);
3080
- const outputs = keyframes.map((k) => k.value);
3140
+ const sortedKeyframes = [...keyframes].sort((a2, b2) => a2.frame - b2.frame);
3141
+ const inputRange = sortedKeyframes.map((k) => k.frame);
3142
+ const outputs = sortedKeyframes.map((k) => k.value);
3081
3143
  if (interpolationFunction === "interpolateColors") {
3082
3144
  if (!outputs.every((v) => typeof v === "string")) {
3083
3145
  return null;
@@ -3132,7 +3194,7 @@ var resolveDragOverrideValue = ({
3132
3194
  return { type: "resolved", value: interpolated };
3133
3195
  };
3134
3196
  var getEffectiveVisualModeValue = ({
3135
- codeValue,
3197
+ propStatus,
3136
3198
  dragOverrideValue,
3137
3199
  defaultValue,
3138
3200
  frame = null,
@@ -3145,16 +3207,19 @@ var getEffectiveVisualModeValue = ({
3145
3207
  if (dragOverride.type === "resolved" && dragOverride.value !== undefined) {
3146
3208
  return dragOverride.value;
3147
3209
  }
3148
- if (codeValue.status === "keyframed" && frame !== null) {
3149
- return interpolateKeyframedStatus({
3150
- frame,
3151
- status: codeValue
3152
- });
3210
+ if (propStatus.status === "keyframed") {
3211
+ if (frame !== null) {
3212
+ return interpolateKeyframedStatus({
3213
+ frame,
3214
+ status: propStatus
3215
+ });
3216
+ }
3217
+ return shouldResortToDefaultValueIfUndefined ? defaultValue : undefined;
3153
3218
  }
3154
- if (codeValue.codeValue === undefined && shouldResortToDefaultValueIfUndefined) {
3219
+ if (propStatus.codeValue === undefined && shouldResortToDefaultValueIfUndefined) {
3155
3220
  return defaultValue;
3156
3221
  }
3157
- return codeValue.codeValue;
3222
+ return propStatus.codeValue;
3158
3223
  };
3159
3224
 
3160
3225
  // src/sequence-node-path.tsx
@@ -3171,18 +3236,18 @@ var OverrideIdsToNodePathsSettersContext = createContext16({
3171
3236
  // src/effects/use-memoized-effects.ts
3172
3237
  var mergeOverrides = ({
3173
3238
  descriptor,
3174
- codeOverrides,
3239
+ propStatusOverrides,
3175
3240
  dragOverrides,
3176
3241
  frame
3177
3242
  }) => {
3178
- if (!codeOverrides && !dragOverrides) {
3243
+ if (!propStatusOverrides && !dragOverrides) {
3179
3244
  return { params: descriptor.params, effectKey: descriptor.effectKey };
3180
3245
  }
3181
3246
  const merged = {
3182
3247
  ...descriptor.params
3183
3248
  };
3184
- if (codeOverrides) {
3185
- for (const [key, value] of Object.entries(codeOverrides)) {
3249
+ if (propStatusOverrides) {
3250
+ for (const [key, value] of Object.entries(propStatusOverrides)) {
3186
3251
  if (value !== undefined) {
3187
3252
  merged[key] = value;
3188
3253
  }
@@ -3204,16 +3269,27 @@ var mergeOverrides = ({
3204
3269
  effectKey: descriptor.definition.calculateKey(merged)
3205
3270
  };
3206
3271
  };
3207
- var extractCodeOverrides = (propStatus) => {
3272
+ var resolvePropStatusOverrides = (propStatus, frame) => {
3208
3273
  if (!propStatus) {
3209
3274
  return null;
3210
3275
  }
3211
3276
  const out = {};
3212
3277
  let hasAny = false;
3213
3278
  for (const [key, status] of Object.entries(propStatus)) {
3214
- if (status.status !== "computed") {
3279
+ if (status.status === "static") {
3215
3280
  out[key] = status.codeValue;
3216
3281
  hasAny = true;
3282
+ continue;
3283
+ }
3284
+ if (status.status === "keyframed") {
3285
+ const value = interpolateKeyframedStatus({
3286
+ frame,
3287
+ status
3288
+ });
3289
+ if (value !== null) {
3290
+ out[key] = value;
3291
+ hasAny = true;
3292
+ }
3217
3293
  }
3218
3294
  }
3219
3295
  return hasAny ? out : null;
@@ -3229,12 +3305,12 @@ var useMemoizedEffectDefinitions = (effects) => {
3229
3305
  previousRef.current = definitions;
3230
3306
  return definitions;
3231
3307
  };
3232
- var getEffectCodeValuesCtx = ({
3233
- codeValues,
3308
+ var getEffectPropStatusesCtx = ({
3309
+ propStatuses,
3234
3310
  nodePath,
3235
3311
  effectIndex
3236
3312
  }) => {
3237
- const status = codeValues[makeSequencePropsSubscriptionKey(nodePath)];
3313
+ const status = propStatuses[makeSequencePropsSubscriptionKey(nodePath)];
3238
3314
  if (!status) {
3239
3315
  return { type: "cannot-update-sequence", reason: "not-found" };
3240
3316
  }
@@ -3250,8 +3326,8 @@ var getEffectCodeValuesCtx = ({
3250
3326
  }
3251
3327
  return { type: "can-update-effect", props: effect.props };
3252
3328
  };
3253
- var getCodeValuesCtx = (codeValues, nodePath) => {
3254
- const status = codeValues[makeSequencePropsSubscriptionKey(nodePath)];
3329
+ var getPropStatusesCtx = (propStatuses, nodePath) => {
3330
+ const status = propStatuses[makeSequencePropsSubscriptionKey(nodePath)];
3255
3331
  if (!status) {
3256
3332
  return;
3257
3333
  }
@@ -3265,7 +3341,7 @@ var useMemoizedEffects = ({
3265
3341
  overrideId
3266
3342
  }) => {
3267
3343
  const previousRef = useRef5(null);
3268
- const { codeValues } = useContext15(VisualModeCodeValuesContext);
3344
+ const { propStatuses } = useContext15(VisualModePropStatusesContext);
3269
3345
  const { getEffectDragOverrides } = useContext15(VisualModeDragOverridesContext);
3270
3346
  const frame = useCurrentFrame();
3271
3347
  const { overrideIdToNodePathMappings } = useContext15(OverrideIdsToNodePathsGettersContext);
@@ -3279,17 +3355,17 @@ var useMemoizedEffects = ({
3279
3355
  effectKey: descriptor.effectKey
3280
3356
  };
3281
3357
  }
3282
- const effectStatus = getEffectCodeValuesCtx({
3283
- codeValues,
3358
+ const effectStatus = getEffectPropStatusesCtx({
3359
+ propStatuses,
3284
3360
  nodePath,
3285
3361
  effectIndex: index
3286
3362
  });
3287
- const codeOverrides = effectStatus.type === "can-update-effect" ? extractCodeOverrides(effectStatus.props) : null;
3363
+ const propStatusOverrides = effectStatus.type === "can-update-effect" ? resolvePropStatusOverrides(effectStatus.props, frame) : null;
3288
3364
  const dragOverridesMap = getEffectDragOverrides(nodePath, index);
3289
3365
  const dragOverrides = Object.keys(dragOverridesMap).length === 0 ? null : dragOverridesMap;
3290
3366
  const { params, effectKey } = mergeOverrides({
3291
3367
  descriptor,
3292
- codeOverrides,
3368
+ propStatusOverrides,
3293
3369
  dragOverrides,
3294
3370
  frame
3295
3371
  });
@@ -3447,15 +3523,15 @@ var computeEffectiveSchemaValuesDotNotation = ({
3447
3523
  const merged = {};
3448
3524
  const propsToDelete = new Set;
3449
3525
  for (const key of Object.keys(currentValue)) {
3450
- const codeValueStatus = propStatus?.[key] ?? null;
3526
+ const status = propStatus?.[key] ?? null;
3451
3527
  const field = findFieldInSchema(schema, key);
3452
3528
  if (field?.type === "hidden") {
3453
3529
  continue;
3454
3530
  }
3455
3531
  let value;
3456
- if (codeValueStatus === null) {
3532
+ if (status === null) {
3457
3533
  value = currentValue[key];
3458
- } else if (isKeyframedStatus(codeValueStatus)) {
3534
+ } else if (isKeyframedStatus(status)) {
3459
3535
  if (field?.type === "array" || field?.keyframable === false) {
3460
3536
  value = currentValue[key];
3461
3537
  } else {
@@ -3468,18 +3544,18 @@ var computeEffectiveSchemaValuesDotNotation = ({
3468
3544
  } else if (frame !== null) {
3469
3545
  const interpolated = interpolateKeyframedStatus({
3470
3546
  frame,
3471
- status: codeValueStatus
3547
+ status
3472
3548
  });
3473
3549
  value = interpolated ?? currentValue[key];
3474
3550
  } else {
3475
3551
  value = currentValue[key];
3476
3552
  }
3477
3553
  }
3478
- } else if (codeValueStatus.status === "computed") {
3554
+ } else if (status.status === "computed") {
3479
3555
  value = currentValue[key];
3480
3556
  } else {
3481
3557
  value = getEffectiveVisualModeValue({
3482
- codeValue: codeValueStatus,
3558
+ propStatus: status,
3483
3559
  dragOverrideValue: overrideValues[key],
3484
3560
  defaultValue: field?.default,
3485
3561
  frame,
@@ -3573,7 +3649,7 @@ var wrapInSchema = ({
3573
3649
  ref
3574
3650
  });
3575
3651
  }
3576
- const { codeValues } = useContext16(VisualModeCodeValuesContext);
3652
+ const { propStatuses } = useContext16(VisualModePropStatusesContext);
3577
3653
  const { getDragOverrides } = useContext16(VisualModeDragOverridesContext);
3578
3654
  const nodePathMapping = useContext16(OverrideIdsToNodePathsGettersContext);
3579
3655
  const frame = useCurrentFrame();
@@ -3612,14 +3688,14 @@ var wrapInSchema = ({
3612
3688
  schema,
3613
3689
  currentValue: currentRuntimeValueDotNotation,
3614
3690
  overrideValues: nodePath === null ? {} : getDragOverrides(nodePath),
3615
- propStatus: nodePath === null ? undefined : getCodeValuesCtx(codeValues, nodePath),
3691
+ propStatus: nodePath === null ? undefined : getPropStatusesCtx(propStatuses, nodePath),
3616
3692
  frame
3617
3693
  });
3618
3694
  }, [
3619
3695
  currentRuntimeValueDotNotation,
3620
3696
  getDragOverrides,
3621
3697
  nodePath,
3622
- codeValues,
3698
+ propStatuses,
3623
3699
  frame
3624
3700
  ]);
3625
3701
  const activeKeys = selectActiveKeys(schema, valuesDotNotation);
@@ -3945,11 +4021,17 @@ var SequenceRefForwardingFunction = (props, ref) => {
3945
4021
  });
3946
4022
  };
3947
4023
  var SequenceInner = forwardRef3(SequenceRefForwardingFunction);
4024
+ var SequenceWithoutSchema = SequenceInner;
3948
4025
  var Sequence = wrapInSchema({
3949
4026
  Component: SequenceInner,
3950
4027
  schema: sequenceSchema,
3951
4028
  supportsEffects: false
3952
4029
  });
4030
+ var SequenceWithoutFrom = wrapInSchema({
4031
+ Component: SequenceInner,
4032
+ schema: sequenceSchemaWithoutFrom,
4033
+ supportsEffects: false
4034
+ });
3953
4035
  // src/animated-image/AnimatedImage.tsx
3954
4036
  import {
3955
4037
  forwardRef as forwardRef4,
@@ -4918,7 +5000,7 @@ var calculateMediaDuration = ({
4918
5000
  duration -= trimBefore;
4919
5001
  }
4920
5002
  const actualDuration = duration / playbackRate;
4921
- return Math.floor(actualDuration);
5003
+ return Number(actualDuration.toFixed(10));
4922
5004
  };
4923
5005
 
4924
5006
  // src/loop/index.tsx
@@ -10472,6 +10554,8 @@ function useRemotionContexts() {
10472
10554
  const resolveCompositionContext = React38.useContext(ResolveCompositionContext);
10473
10555
  const renderAssetManagerContext = React38.useContext(RenderAssetManager);
10474
10556
  const sequenceManagerContext = React38.useContext(SequenceManager);
10557
+ const sequenceManagerRefContext = React38.useContext(SequenceManagerRefContext);
10558
+ const visualModePropStatusesRefContext = React38.useContext(VisualModePropStatusesRefContext);
10475
10559
  const bufferManagerContext = React38.useContext(BufferingContextReact);
10476
10560
  const logLevelContext = React38.useContext(LogLevelContext);
10477
10561
  return useMemo37(() => ({
@@ -10485,6 +10569,8 @@ function useRemotionContexts() {
10485
10569
  resolveCompositionContext,
10486
10570
  renderAssetManagerContext,
10487
10571
  sequenceManagerContext,
10572
+ sequenceManagerRefContext,
10573
+ visualModePropStatusesRefContext,
10488
10574
  bufferManagerContext,
10489
10575
  logLevelContext
10490
10576
  }), [
@@ -10498,6 +10584,8 @@ function useRemotionContexts() {
10498
10584
  resolveCompositionContext,
10499
10585
  renderAssetManagerContext,
10500
10586
  sequenceManagerContext,
10587
+ sequenceManagerRefContext,
10588
+ visualModePropStatusesRefContext,
10501
10589
  bufferManagerContext,
10502
10590
  logLevelContext
10503
10591
  ]);
@@ -10514,21 +10602,27 @@ var RemotionContextProvider = (props2) => {
10514
10602
  value: contexts.preloadContext,
10515
10603
  children: /* @__PURE__ */ jsx35(CompositionManager.Provider, {
10516
10604
  value: contexts.compositionManagerCtx,
10517
- children: /* @__PURE__ */ jsx35(SequenceManager.Provider, {
10518
- value: contexts.sequenceManagerContext,
10519
- children: /* @__PURE__ */ jsx35(RenderAssetManager.Provider, {
10520
- value: contexts.renderAssetManagerContext,
10521
- children: /* @__PURE__ */ jsx35(ResolveCompositionContext.Provider, {
10522
- value: contexts.resolveCompositionContext,
10523
- children: /* @__PURE__ */ jsx35(TimelineContext.Provider, {
10524
- value: contexts.timelineContext,
10525
- children: /* @__PURE__ */ jsx35(SetTimelineContext.Provider, {
10526
- value: contexts.setTimelineContext,
10527
- children: /* @__PURE__ */ jsx35(SequenceContext.Provider, {
10528
- value: contexts.sequenceContext,
10529
- children: /* @__PURE__ */ jsx35(BufferingContextReact.Provider, {
10530
- value: contexts.bufferManagerContext,
10531
- children
10605
+ children: /* @__PURE__ */ jsx35(SequenceManagerRefContext.Provider, {
10606
+ value: contexts.sequenceManagerRefContext,
10607
+ children: /* @__PURE__ */ jsx35(SequenceManager.Provider, {
10608
+ value: contexts.sequenceManagerContext,
10609
+ children: /* @__PURE__ */ jsx35(VisualModePropStatusesRefContext.Provider, {
10610
+ value: contexts.visualModePropStatusesRefContext,
10611
+ children: /* @__PURE__ */ jsx35(RenderAssetManager.Provider, {
10612
+ value: contexts.renderAssetManagerContext,
10613
+ children: /* @__PURE__ */ jsx35(ResolveCompositionContext.Provider, {
10614
+ value: contexts.resolveCompositionContext,
10615
+ children: /* @__PURE__ */ jsx35(TimelineContext.Provider, {
10616
+ value: contexts.timelineContext,
10617
+ children: /* @__PURE__ */ jsx35(SetTimelineContext.Provider, {
10618
+ value: contexts.setTimelineContext,
10619
+ children: /* @__PURE__ */ jsx35(SequenceContext.Provider, {
10620
+ value: contexts.sequenceContext,
10621
+ children: /* @__PURE__ */ jsx35(BufferingContextReact.Provider, {
10622
+ value: contexts.bufferManagerContext,
10623
+ children
10624
+ })
10625
+ })
10532
10626
  })
10533
10627
  })
10534
10628
  })
@@ -10561,13 +10655,16 @@ var Internals = {
10561
10655
  VideoForPreview,
10562
10656
  CompositionManager,
10563
10657
  CompositionSetters,
10564
- VisualModeCodeValuesContext,
10658
+ VisualModePropStatusesContext,
10659
+ VisualModePropStatusesRefContext,
10565
10660
  VisualModeDragOverridesContext,
10566
10661
  VisualModeSettersContext,
10567
10662
  SequenceManager,
10663
+ SequenceManagerRefContext,
10568
10664
  SequenceStackTracesUpdateContext,
10569
10665
  wrapInSchema,
10570
10666
  sequenceSchema,
10667
+ SequenceWithoutSchema,
10571
10668
  sequenceStyleSchema,
10572
10669
  sequenceVisualStyleSchema,
10573
10670
  sequencePremountSchema,
@@ -10682,8 +10779,8 @@ var Internals = {
10682
10779
  OverrideIdsToNodePathsSettersContext,
10683
10780
  findPropsToDelete,
10684
10781
  makeSequencePropsSubscriptionKey,
10685
- getCodeValuesCtx,
10686
- getEffectCodeValuesCtx,
10782
+ getPropStatusesCtx,
10783
+ getEffectPropStatusesCtx,
10687
10784
  hiddenField,
10688
10785
  durationInFramesField,
10689
10786
  fromField
@@ -10742,6 +10839,7 @@ var SeriesSequenceRefForwardingFunction = ({ children }, _ref) => {
10742
10839
  });
10743
10840
  };
10744
10841
  var SeriesSequence = forwardRef13(SeriesSequenceRefForwardingFunction);
10842
+ var SequenceWithoutSchemaWithRef = SequenceWithoutSchema;
10745
10843
  var SeriesInner = (props2) => {
10746
10844
  const childrenValue = useMemo38(() => {
10747
10845
  let startFrame = 0;
@@ -10784,13 +10882,13 @@ var SeriesInner = (props2) => {
10784
10882
  }
10785
10883
  const currentStartFrame = startFrame + offset;
10786
10884
  startFrame += durationInFramesProp + offset;
10787
- return /* @__PURE__ */ jsx36(Sequence, {
10885
+ return /* @__PURE__ */ jsx36(SequenceWithoutSchemaWithRef, {
10886
+ ref: castedChild.ref,
10788
10887
  name: name || "<Series.Sequence>",
10789
10888
  _remotionInternalDocumentationLink: name ? undefined : "https://www.remotion.dev/docs/series",
10790
10889
  from: currentStartFrame,
10791
10890
  durationInFrames: durationInFramesProp,
10792
10891
  ...passedProps,
10793
- ref: castedChild.ref,
10794
10892
  children: child
10795
10893
  });
10796
10894
  });
@@ -10813,7 +10911,6 @@ var Series = Object.assign(wrapInSchema({
10813
10911
  Sequence: SeriesSequence
10814
10912
  });
10815
10913
  addSequenceStackTraces(Series);
10816
- addSequenceStackTraces(SeriesSequence);
10817
10914
  // src/validation/validation-spring-duration.ts
10818
10915
  var validateSpringDuration = (dur) => {
10819
10916
  if (typeof dur === "undefined") {
@@ -252,6 +252,40 @@ var interpolateString = ({
252
252
  dimensions
253
253
  });
254
254
  };
255
+ var validateTupleOutputRange = (outputRange) => {
256
+ const dimensions = outputRange[0]?.length;
257
+ if (dimensions === undefined) {
258
+ throw new Error("outputRange must have at least 1 element");
259
+ }
260
+ if (dimensions === 0) {
261
+ throw new TypeError("outputRange tuples must contain at least 1 number");
262
+ }
263
+ for (const output of outputRange) {
264
+ if (output.length !== dimensions) {
265
+ throw new TypeError(`outputRange tuples must all have the same length, but got ${dimensions} and ${output.length}`);
266
+ }
267
+ for (const value of output) {
268
+ if (typeof value !== "number" || !Number.isFinite(value)) {
269
+ throw new TypeError(`outputRange tuples must contain only finite numbers, but got [${output.join(",")}]`);
270
+ }
271
+ }
272
+ }
273
+ return dimensions;
274
+ };
275
+ var interpolateTuple = ({
276
+ input,
277
+ inputRange,
278
+ outputRange,
279
+ options
280
+ }) => {
281
+ const dimensions = validateTupleOutputRange(outputRange);
282
+ return new Array(dimensions).fill(true).map((_, axis) => interpolateNumber({
283
+ input,
284
+ inputRange,
285
+ outputRange: outputRange.map((output) => output[axis]),
286
+ options
287
+ }));
288
+ };
255
289
  function checkValidInputRange(arr) {
256
290
  for (let i = 1;i < arr.length; ++i) {
257
291
  if (!(arr[i] > arr[i - 1])) {
@@ -327,8 +361,11 @@ function interpolate(input, inputRange, outputRange, options) {
327
361
  }
328
362
  return interpolateString({ input, inputRange, outputRange, options });
329
363
  }
364
+ if (outputRange.every((output) => Array.isArray(output))) {
365
+ return interpolateTuple({ input, inputRange, outputRange, options });
366
+ }
330
367
  if (!outputRange.every((output) => typeof output === "number")) {
331
- throw new TypeError("outputRange must contain only numbers, or supported scale, translate, and rotate strings");
368
+ throw new TypeError("outputRange must contain only numbers, numeric tuples, or supported scale, translate, and rotate strings");
332
369
  }
333
370
  checkInfiniteRange("outputRange", outputRange);
334
371
  return interpolateNumber({ input, inputRange, outputRange, options });
@@ -978,7 +1015,6 @@ var sequenceVisualStyleSchema = {
978
1015
  },
979
1016
  "style.scale": {
980
1017
  type: "scale",
981
- min: 0.05,
982
1018
  max: 100,
983
1019
  step: 0.01,
984
1020
  default: 1,
@@ -1059,6 +1095,11 @@ var sequenceSchema = {
1059
1095
  }
1060
1096
  }
1061
1097
  };
1098
+ var sequenceSchemaWithoutFrom = {
1099
+ hidden: hiddenField,
1100
+ durationInFrames: durationInFramesField,
1101
+ layout: sequenceSchema.layout
1102
+ };
1062
1103
  var sequenceSchemaDefaultLayoutNone = {
1063
1104
  ...sequenceSchema,
1064
1105
  layout: {
@@ -1,5 +1,5 @@
1
1
  // src/version.ts
2
- var VERSION = "4.0.472";
2
+ var VERSION = "4.0.474";
3
3
  export {
4
4
  VERSION
5
5
  };