remotion 4.0.146 → 4.0.148

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.
@@ -69,7 +69,7 @@ export type TRenderAsset = {
69
69
  audioStartFrame: number;
70
70
  };
71
71
  export declare const compositionsRef: React.RefObject<{
72
- getCompositions: () => TCompMetadataWithCalcFunction<AnyZodObject, Record<string, unknown>>[];
72
+ getCompositions: () => AnyComposition[];
73
73
  }>;
74
74
  export declare const CompositionManagerProvider: React.FC<{
75
75
  readonly children: React.ReactNode;
@@ -9,7 +9,10 @@ export type EditorPropsContextType = {
9
9
  }) => void;
10
10
  };
11
11
  export declare const EditorPropsContext: React.Context<EditorPropsContextType>;
12
+ export declare const editorPropsProviderRef: React.RefObject<{
13
+ getProps: () => Props;
14
+ }>;
12
15
  export declare const EditorPropsProvider: React.FC<{
13
- children: React.ReactNode;
16
+ readonly children: React.ReactNode;
14
17
  }>;
15
18
  export {};
@@ -23,7 +23,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
23
23
  return result;
24
24
  };
25
25
  Object.defineProperty(exports, "__esModule", { value: true });
26
- exports.EditorPropsProvider = exports.EditorPropsContext = void 0;
26
+ exports.EditorPropsProvider = exports.editorPropsProviderRef = exports.EditorPropsContext = void 0;
27
27
  const jsx_runtime_1 = require("react/jsx-runtime");
28
28
  const react_1 = __importStar(require("react"));
29
29
  exports.EditorPropsContext = (0, react_1.createContext)({
@@ -32,6 +32,7 @@ exports.EditorPropsContext = (0, react_1.createContext)({
32
32
  throw new Error('Not implemented');
33
33
  },
34
34
  });
35
+ exports.editorPropsProviderRef = react_1.default.createRef();
35
36
  const EditorPropsProvider = ({ children }) => {
36
37
  const [props, setProps] = react_1.default.useState({});
37
38
  const updateProps = (0, react_1.useCallback)(({ defaultProps, id, newProps, }) => {
@@ -45,6 +46,11 @@ const EditorPropsProvider = ({ children }) => {
45
46
  };
46
47
  });
47
48
  }, []);
49
+ (0, react_1.useImperativeHandle)(exports.editorPropsProviderRef, () => {
50
+ return {
51
+ getProps: () => props,
52
+ };
53
+ }, [props]);
48
54
  const ctx = (0, react_1.useMemo)(() => {
49
55
  return { props, updateProps };
50
56
  }, [props, updateProps]);
@@ -64,7 +64,7 @@ export declare const Internals: {
64
64
  readonly isCompositionIdValid: (id: string) => RegExpMatchArray | null;
65
65
  readonly getPreviewDomElement: () => HTMLElement | null;
66
66
  readonly compositionsRef: import("react").RefObject<{
67
- getCompositions: () => import("./CompositionManager.js").TCompMetadataWithCalcFunction<import("zod").AnyZodObject, Record<string, unknown>>[];
67
+ getCompositions: () => import("./CompositionManager.js").AnyComposition[];
68
68
  }>;
69
69
  readonly portalNode: () => HTMLElement;
70
70
  readonly waitForRoot: (fn: (comp: import("react").FC<{}>) => void) => () => void;
@@ -83,7 +83,7 @@ export declare const Internals: {
83
83
  }>;
84
84
  readonly useIsPlayer: () => boolean;
85
85
  readonly EditorPropsProvider: import("react").FC<{
86
- children: import("react").ReactNode;
86
+ readonly children: import("react").ReactNode;
87
87
  }>;
88
88
  readonly EditorPropsContext: import("react").Context<import("./EditorProps.js").EditorPropsContextType>;
89
89
  readonly usePreload: (src: string) => string;
@@ -155,5 +155,10 @@ export declare const Internals: {
155
155
  height: number;
156
156
  };
157
157
  }) => number;
158
+ readonly editorPropsProviderRef: import("react").RefObject<{
159
+ getProps: () => {
160
+ [x: string]: Record<string, unknown>;
161
+ };
162
+ }>;
158
163
  };
159
164
  export type { CompositionManagerContext, CompProps, MediaVolumeContextValue, RemotionEnvironment, SerializedJSONWithCustomFields, SetMediaVolumeContextValue, SetTimelineContextValue, TRenderAsset as TAsset, TCompMetadata, TComposition, TimelinePosition as Timeline, TimelineContextValue, TSequence, WatchRemotionStaticFilesPayload, };
@@ -124,4 +124,5 @@ exports.Internals = {
124
124
  CurrentScaleContext: use_current_scale_js_1.CurrentScaleContext,
125
125
  PreviewSizeContext: use_current_scale_js_1.PreviewSizeContext,
126
126
  calculateScale: use_current_scale_js_1.calculateScale,
127
+ editorPropsProviderRef: EditorProps_js_1.editorPropsProviderRef,
127
128
  };
@@ -1,18 +1,23 @@
1
1
  import type { FC, PropsWithChildren } from 'react';
2
+ import React from 'react';
2
3
  import type { LayoutAndStyle, SequenceProps } from '../Sequence.js';
4
+ import { ENABLE_V5_BREAKING_CHANGES } from '../v5-flag.js';
3
5
  type SeriesSequenceProps = PropsWithChildren<{
4
- durationInFrames: number;
5
- offset?: number;
6
- className?: string;
6
+ readonly durationInFrames: number;
7
+ readonly offset?: number;
8
+ readonly className?: string;
7
9
  } & Pick<SequenceProps, 'layout' | 'name'> & LayoutAndStyle>;
8
- declare const SeriesSequence: import("react").ForwardRefExoticComponent<SeriesSequenceProps & import("react").RefAttributes<HTMLDivElement>>;
10
+ declare const SeriesSequence: React.ForwardRefExoticComponent<SeriesSequenceProps & React.RefAttributes<HTMLDivElement>>;
11
+ type V4Props = {
12
+ children: React.ReactNode;
13
+ };
14
+ type V5Props = SequenceProps;
15
+ type SeriesProps = true extends typeof ENABLE_V5_BREAKING_CHANGES ? V5Props : V4Props;
9
16
  /**
10
17
  * @description with this component, you can easily stitch together scenes that should play sequentially after another.
11
18
  * @see [Documentation](https://www.remotion.dev/docs/series)
12
19
  */
13
- declare const Series: FC<{
14
- children: React.ReactNode;
15
- }> & {
20
+ declare const Series: FC<SeriesProps> & {
16
21
  Sequence: typeof SeriesSequence;
17
22
  };
18
23
  export { Series };
@@ -5,6 +5,7 @@ const jsx_runtime_1 = require("react/jsx-runtime");
5
5
  const react_1 = require("react");
6
6
  const Sequence_js_1 = require("../Sequence.js");
7
7
  const enable_sequence_stack_traces_js_1 = require("../enable-sequence-stack-traces.js");
8
+ const v5_flag_js_1 = require("../v5-flag.js");
8
9
  const validate_duration_in_frames_js_1 = require("../validation/validate-duration-in-frames.js");
9
10
  const flatten_children_js_1 = require("./flatten-children.js");
10
11
  const is_inside_series_js_1 = require("./is-inside-series.js");
@@ -19,10 +20,10 @@ const SeriesSequence = (0, react_1.forwardRef)(SeriesSequenceRefForwardingFuncti
19
20
  * @description with this component, you can easily stitch together scenes that should play sequentially after another.
20
21
  * @see [Documentation](https://www.remotion.dev/docs/series)
21
22
  */
22
- const Series = ({ children }) => {
23
+ const Series = (props) => {
23
24
  const childrenValue = (0, react_1.useMemo)(() => {
24
25
  let startFrame = 0;
25
- const flattenedChildren = (0, flatten_children_js_1.flattenChildren)(children);
26
+ const flattenedChildren = (0, flatten_children_js_1.flattenChildren)(props.children);
26
27
  return react_1.Children.map(flattenedChildren, (child, i) => {
27
28
  var _a;
28
29
  const castedChild = child;
@@ -63,7 +64,10 @@ const Series = ({ children }) => {
63
64
  startFrame += durationInFramesProp + offset;
64
65
  return ((0, jsx_runtime_1.jsx)(Sequence_js_1.Sequence, { name: name || '<Series.Sequence>', from: currentStartFrame, durationInFrames: durationInFramesProp, ...passedProps, ref: castedChild.ref, children: child }));
65
66
  });
66
- }, [children]);
67
+ }, [props.children]);
68
+ if (v5_flag_js_1.ENABLE_V5_BREAKING_CHANGES) {
69
+ return ((0, jsx_runtime_1.jsx)(is_inside_series_js_1.IsInsideSeriesContainer, { children: (0, jsx_runtime_1.jsx)(Sequence_js_1.Sequence, { ...props, children: childrenValue }) }));
70
+ }
67
71
  return (0, jsx_runtime_1.jsx)(is_inside_series_js_1.IsInsideSeriesContainer, { children: childrenValue });
68
72
  };
69
73
  exports.Series = Series;
@@ -11,6 +11,9 @@ const advanceCache = {};
11
11
  function advance({ animation, now, config, }) {
12
12
  const { toValue, lastTimestamp, current, velocity } = animation;
13
13
  const deltaTime = Math.min(now - lastTimestamp, 64);
14
+ if (config.damping <= 0) {
15
+ throw new Error('Spring damping must be greater than 0, otherwise the spring() animation will never end, causing an infinite loop.');
16
+ }
14
17
  const c = config.damping;
15
18
  const m = config.mass;
16
19
  const k = config.stiffness;
@@ -3,4 +3,4 @@
3
3
  * @see [Documentation](https://remotion.dev/docs/version)
4
4
  * @returns {string} The current version of the remotion package
5
5
  */
6
- export declare const VERSION = "4.0.146";
6
+ export declare const VERSION = "4.0.148";
@@ -7,4 +7,4 @@ exports.VERSION = void 0;
7
7
  * @see [Documentation](https://remotion.dev/docs/version)
8
8
  * @returns {string} The current version of the remotion package
9
9
  */
10
- exports.VERSION = '4.0.146';
10
+ exports.VERSION = '4.0.148';
@@ -1,4 +1,4 @@
1
- import React, { createContext, useState, useMemo, useLayoutEffect, useContext, useEffect, forwardRef, useCallback, useRef, createRef, useImperativeHandle, useReducer, Suspense, Children } from 'react';
1
+ import React, { createContext, useState, useMemo, useLayoutEffect, useContext, useEffect, forwardRef, useCallback, useRef, useImperativeHandle, createRef, useReducer, Suspense, Children } from 'react';
2
2
  import { jsx, jsxs } from 'react/jsx-runtime';
3
3
  import { createPortal } from 'react-dom';
4
4
 
@@ -110,7 +110,7 @@ function truthy(value) {
110
110
  * @see [Documentation](https://remotion.dev/docs/version)
111
111
  * @returns {string} The current version of the remotion package
112
112
  */
113
- const VERSION = '4.0.146';
113
+ const VERSION = '4.0.148';
114
114
 
115
115
  const checkMultipleRemotionVersions = () => {
116
116
  if (typeof globalThis === 'undefined') {
@@ -265,6 +265,7 @@ const EditorPropsContext = createContext({
265
265
  throw new Error('Not implemented');
266
266
  },
267
267
  });
268
+ const editorPropsProviderRef = React.createRef();
268
269
  const EditorPropsProvider = ({ children }) => {
269
270
  const [props, setProps] = React.useState({});
270
271
  const updateProps = useCallback(({ defaultProps, id, newProps, }) => {
@@ -278,6 +279,11 @@ const EditorPropsProvider = ({ children }) => {
278
279
  };
279
280
  });
280
281
  }, []);
282
+ useImperativeHandle(editorPropsProviderRef, () => {
283
+ return {
284
+ getProps: () => props,
285
+ };
286
+ }, [props]);
281
287
  const ctx = useMemo(() => {
282
288
  return { props, updateProps };
283
289
  }, [props, updateProps]);
@@ -4059,6 +4065,7 @@ const Internals = {
4059
4065
  CurrentScaleContext,
4060
4066
  PreviewSizeContext,
4061
4067
  calculateScale,
4068
+ editorPropsProviderRef,
4062
4069
  };
4063
4070
 
4064
4071
  /**
@@ -4516,10 +4523,10 @@ const SeriesSequence = forwardRef(SeriesSequenceRefForwardingFunction);
4516
4523
  * @description with this component, you can easily stitch together scenes that should play sequentially after another.
4517
4524
  * @see [Documentation](https://www.remotion.dev/docs/series)
4518
4525
  */
4519
- const Series = ({ children }) => {
4526
+ const Series = (props) => {
4520
4527
  const childrenValue = useMemo(() => {
4521
4528
  let startFrame = 0;
4522
- const flattenedChildren = flattenChildren(children);
4529
+ const flattenedChildren = flattenChildren(props.children);
4523
4530
  return Children.map(flattenedChildren, (child, i) => {
4524
4531
  var _a;
4525
4532
  const castedChild = child;
@@ -4560,7 +4567,7 @@ const Series = ({ children }) => {
4560
4567
  startFrame += durationInFramesProp + offset;
4561
4568
  return (jsx(Sequence, { name: name || '<Series.Sequence>', from: currentStartFrame, durationInFrames: durationInFramesProp, ...passedProps, ref: castedChild.ref, children: child }));
4562
4569
  });
4563
- }, [children]);
4570
+ }, [props.children]);
4564
4571
  return jsx(IsInsideSeriesContainer, { children: childrenValue });
4565
4572
  };
4566
4573
  Series.Sequence = SeriesSequence;
@@ -4594,6 +4601,9 @@ const advanceCache = {};
4594
4601
  function advance({ animation, now, config, }) {
4595
4602
  const { toValue, lastTimestamp, current, velocity } = animation;
4596
4603
  const deltaTime = Math.min(now - lastTimestamp, 64);
4604
+ if (config.damping <= 0) {
4605
+ throw new Error('Spring damping must be greater than 0, otherwise the spring() animation will never end, causing an infinite loop.');
4606
+ }
4597
4607
  const c = config.damping;
4598
4608
  const m = config.mass;
4599
4609
  const k = config.stiffness;
@@ -4,6 +4,6 @@
4
4
  * @see [Documentation](https://remotion.dev/docs/version)
5
5
  * @returns {string} The current version of the remotion package
6
6
  */
7
- const VERSION = '4.0.146';
7
+ const VERSION = '4.0.148';
8
8
 
9
9
  export { VERSION };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "remotion",
3
- "version": "4.0.146",
3
+ "version": "4.0.148",
4
4
  "description": "Render videos in React",
5
5
  "main": "dist/cjs/index.js",
6
6
  "types": "dist/cjs/index.d.ts",
@@ -24,15 +24,15 @@
24
24
  "@happy-dom/global-registrator": "14.5.1",
25
25
  "happy-dom": "14.5.1",
26
26
  "@types/node": "18.14.6",
27
- "@types/react": "18.2.48",
28
- "@types/react-dom": "18.2.18",
27
+ "@types/react": "18.3.1",
28
+ "@types/react-dom": "18.3.0",
29
29
  "eslint": "8.56.0",
30
30
  "eslint-plugin-require-extensions": "^0.1.2",
31
31
  "jsdom": "21.1.0",
32
32
  "prettier": "3.2.5",
33
33
  "prettier-plugin-organize-imports": "3.2.4",
34
- "react": "18.2.0",
35
- "react-dom": "18.2.0",
34
+ "react": "18.3.1",
35
+ "react-dom": "18.3.1",
36
36
  "rimraf": "^3.0.2",
37
37
  "rollup": "^2.70.1",
38
38
  "vitest": "0.31.1",