remotion 3.3.2 → 3.3.4

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.
@@ -1,4 +1,4 @@
1
1
 
2
- > remotion@3.3.1 build /Users/jonathanburger/remotion/packages/core
2
+ > remotion@3.3.3 build /Users/jonathanburger/remotion/packages/core
3
3
  > tsc -d
4
4
 
@@ -7,7 +7,7 @@ export declare type SequenceContextType = {
7
7
  id: string;
8
8
  };
9
9
  export declare const SequenceContext: React.Context<SequenceContextType | null>;
10
- declare type LayoutAndStyle = {
10
+ export declare type LayoutAndStyle = {
11
11
  layout: 'none';
12
12
  } | {
13
13
  layout?: 'absolute-fill';
@@ -26,4 +26,3 @@ export declare type SequenceProps = {
26
26
  * @link https://www.remotion.dev/docs/sequence
27
27
  */
28
28
  export declare const Sequence: React.ForwardRefExoticComponent<SequenceProps & React.RefAttributes<HTMLDivElement>>;
29
- export {};
@@ -1,9 +1,9 @@
1
1
  import React from 'react';
2
+ import type { LayoutAndStyle } from '../Sequence';
2
3
  export declare type LoopProps = {
3
4
  durationInFrames: number;
4
5
  times?: number;
5
- layout?: 'absolute-fill' | 'none';
6
6
  name?: string;
7
7
  children: React.ReactNode;
8
- };
8
+ } & LayoutAndStyle;
9
9
  export declare const Loop: React.FC<LoopProps>;
@@ -5,7 +5,7 @@ const jsx_runtime_1 = require("react/jsx-runtime");
5
5
  const Sequence_1 = require("../Sequence");
6
6
  const use_video_config_1 = require("../use-video-config");
7
7
  const validate_duration_in_frames_1 = require("../validation/validate-duration-in-frames");
8
- const Loop = ({ durationInFrames, times = Infinity, children, layout, name, }) => {
8
+ const Loop = ({ durationInFrames, times = Infinity, children, name, ...props }) => {
9
9
  const { durationInFrames: compDuration } = (0, use_video_config_1.useVideoConfig)();
10
10
  (0, validate_duration_in_frames_1.validateDurationInFrames)(durationInFrames, 'of the <Loop /> component');
11
11
  if (typeof times !== 'number') {
@@ -19,10 +19,11 @@ const Loop = ({ durationInFrames, times = Infinity, children, layout, name, }) =
19
19
  }
20
20
  const maxTimes = Math.ceil(compDuration / durationInFrames);
21
21
  const actualTimes = Math.min(maxTimes, times);
22
+ const style = props.layout === 'none' ? undefined : props.style;
22
23
  return ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: new Array(actualTimes).fill(true).map((_, i) => {
23
24
  return ((0, jsx_runtime_1.jsx)(Sequence_1.Sequence
24
25
  // eslint-disable-next-line react/no-array-index-key
25
- , { durationInFrames: durationInFrames, from: i * durationInFrames, layout: layout, name: name, showLoopTimesInTimeline: actualTimes, showInTimeline: i === 0, children: children }, `loop-${i}`));
26
+ , { durationInFrames: durationInFrames, from: i * durationInFrames, name: name, showLoopTimesInTimeline: actualTimes, showInTimeline: i === 0, layout: props.layout, style: style, children: children }, `loop-${i}`));
26
27
  }) }));
27
28
  };
28
29
  exports.Loop = Loop;
@@ -1,10 +1,10 @@
1
1
  import type { FC, PropsWithChildren } from 'react';
2
- import type { SequenceProps } from '../Sequence';
2
+ import type { LayoutAndStyle, SequenceProps } from '../Sequence';
3
3
  declare type SeriesSequenceProps = PropsWithChildren<{
4
4
  durationInFrames: number;
5
5
  offset?: number;
6
- } & Pick<SequenceProps, 'layout' | 'name'>>;
7
- declare const SeriesSequence: ({ children }: SeriesSequenceProps) => JSX.Element;
6
+ } & Pick<SequenceProps, 'layout' | 'name'> & LayoutAndStyle>;
7
+ declare const SeriesSequence: import("react").ForwardRefExoticComponent<SeriesSequenceProps & import("react").RefAttributes<HTMLDivElement>>;
8
8
  declare const Series: FC<{
9
9
  children: React.ReactNode;
10
10
  }> & {
@@ -6,10 +6,12 @@ const react_1 = require("react");
6
6
  const Sequence_1 = require("../Sequence");
7
7
  const validate_duration_in_frames_1 = require("../validation/validate-duration-in-frames");
8
8
  const flatten_children_1 = require("./flatten-children");
9
- const SeriesSequence = ({ children }) => {
9
+ const SeriesSequenceRefForwardingFunction = ({ children }, _ref) => {
10
+ // Discard ref
10
11
  // eslint-disable-next-line react/jsx-no-useless-fragment
11
12
  return (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: children });
12
13
  };
14
+ const SeriesSequence = (0, react_1.forwardRef)(SeriesSequenceRefForwardingFunction);
13
15
  const Series = ({ children }) => {
14
16
  const childrenValue = (0, react_1.useMemo)(() => {
15
17
  let startFrame = 0;
@@ -45,7 +47,7 @@ const Series = ({ children }) => {
45
47
  }
46
48
  const currentStartFrame = startFrame + offset;
47
49
  startFrame += durationInFramesProp + offset;
48
- return ((0, jsx_runtime_1.jsx)(Sequence_1.Sequence, { from: currentStartFrame, durationInFrames: durationInFramesProp, ...passedProps, children: child }));
50
+ return ((0, jsx_runtime_1.jsx)(Sequence_1.Sequence, { from: currentStartFrame, durationInFrames: durationInFramesProp, ...passedProps, ref: castedChild.ref, children: child }));
49
51
  });
50
52
  }, [children]);
51
53
  /* eslint-disable react/jsx-no-useless-fragment */
package/dist/version.d.ts CHANGED
@@ -1 +1 @@
1
- export declare const VERSION = "3.3.2";
1
+ export declare const VERSION = "3.3.4";
package/dist/version.js CHANGED
@@ -2,4 +2,4 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.VERSION = void 0;
4
4
  // Automatically generated on publish
5
- exports.VERSION = '3.3.2';
5
+ exports.VERSION = '3.3.4';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "remotion",
3
- "version": "3.3.2",
3
+ "version": "3.3.4",
4
4
  "description": "Render videos in React",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -55,5 +55,5 @@
55
55
  "publishConfig": {
56
56
  "access": "public"
57
57
  },
58
- "gitHead": "d7422b5d86e4766a4cdb0bc4e291e462a6bf8bb6"
58
+ "gitHead": "d5185eb129001bbc65d1edeea0250ee52c351f30"
59
59
  }