remotion 4.0.464 → 4.0.465

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.
@@ -9,9 +9,14 @@ type State = {
9
9
  };
10
10
  export declare class CompositionErrorBoundary extends React.Component<Props, State> {
11
11
  state: State;
12
+ private hmrStatusHandler;
12
13
  static getDerivedStateFromError(): Partial<State>;
13
14
  componentDidCatch(error: Error): void;
14
- componentDidUpdate(_prevProps: Props): void;
15
+ componentDidMount(): void;
16
+ componentDidUpdate(_prevProps: Props, prevState: State): void;
17
+ componentWillUnmount(): void;
18
+ private subscribeToHmrReset;
19
+ private unsubscribeFromHmrReset;
15
20
  render(): React.ReactNode;
16
21
  }
17
22
  export {};
@@ -5,22 +5,86 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.CompositionErrorBoundary = void 0;
7
7
  const react_1 = __importDefault(require("react"));
8
+ const getHot = () => {
9
+ var _a;
10
+ try {
11
+ if (typeof __webpack_module__ === 'undefined') {
12
+ return null;
13
+ }
14
+ return (_a = __webpack_module__.hot) !== null && _a !== void 0 ? _a : null;
15
+ }
16
+ catch (_b) {
17
+ return null;
18
+ }
19
+ };
8
20
  class CompositionErrorBoundary extends react_1.default.Component {
9
21
  constructor() {
10
22
  super(...arguments);
11
23
  this.state = { hasError: false };
24
+ this.hmrStatusHandler = null;
12
25
  }
13
26
  static getDerivedStateFromError() {
14
27
  return { hasError: true };
15
28
  }
16
29
  componentDidCatch(error) {
17
30
  this.props.onError(error);
31
+ this.subscribeToHmrReset();
18
32
  }
19
- componentDidUpdate(_prevProps) {
33
+ componentDidMount() {
34
+ // A fresh boundary mounting in the success state means any stale
35
+ // `renderError` left over by a previous boundary instance should be
36
+ // cleared. Fast Refresh sometimes unmounts the old (errored) boundary
37
+ // and mounts a new one during `apply`, so `componentDidUpdate`'s
38
+ // error→success transition never fires.
20
39
  if (!this.state.hasError) {
21
40
  this.props.onClear();
22
41
  }
23
42
  }
43
+ componentDidUpdate(_prevProps, prevState) {
44
+ if (prevState.hasError && !this.state.hasError) {
45
+ this.props.onClear();
46
+ }
47
+ }
48
+ componentWillUnmount() {
49
+ this.unsubscribeFromHmrReset();
50
+ }
51
+ subscribeToHmrReset() {
52
+ if (this.hmrStatusHandler) {
53
+ return;
54
+ }
55
+ const hot = getHot();
56
+ if (!hot) {
57
+ return;
58
+ }
59
+ // Once the boundary catches a runtime error it returns `null` on every
60
+ // render and never retries the children — so any subsequent HMR fix
61
+ // would be invisible. While in the error state, wait for the next
62
+ // time webpack HMR settles (`idle`), drop the error flag, and let the
63
+ // boundary re-render. If the children still throw, `componentDidCatch`
64
+ // resubscribes. If they succeed, `componentDidUpdate` calls
65
+ // `onClear()`. See https://github.com/remotion-dev/remotion/issues/7447.
66
+ const handler = (status) => {
67
+ if (status !== 'idle') {
68
+ return;
69
+ }
70
+ this.unsubscribeFromHmrReset();
71
+ this.setState({ hasError: false });
72
+ };
73
+ this.hmrStatusHandler = handler;
74
+ hot.addStatusHandler(handler);
75
+ }
76
+ unsubscribeFromHmrReset() {
77
+ const handler = this.hmrStatusHandler;
78
+ if (!handler) {
79
+ return;
80
+ }
81
+ this.hmrStatusHandler = null;
82
+ const hot = getHot();
83
+ if (!hot) {
84
+ return;
85
+ }
86
+ hot.removeStatusHandler(handler);
87
+ }
24
88
  render() {
25
89
  if (this.state.hasError) {
26
90
  return null;
@@ -51,11 +51,11 @@ export declare const HTML_IN_CANVAS_UNSUPPORTED_MESSAGE = "HTML in Canvas is not
51
51
  export type HtmlInCanvasOnPaint = (params: HtmlInCanvasOnPaintParams) => void | Promise<void>;
52
52
  export type HtmlInCanvasOnInitCleanup = () => void;
53
53
  export type HtmlInCanvasOnInit = (params: HtmlInCanvasOnPaintParams) => HtmlInCanvasOnInitCleanup | Promise<HtmlInCanvasOnInitCleanup>;
54
- export type HtmlInCanvasProps = Omit<SequenceProps, 'children' | 'durationInFrames' | keyof LayoutAndStyle | '_experimentalEffects'> & Omit<AbsoluteFillLayout, 'layout' | 'styleWhilePostmounted' | 'postmountFor' | 'premountFor' | 'styleWhilePremounted'> & {
54
+ export type HtmlInCanvasProps = Omit<SequenceProps, 'children' | 'durationInFrames' | keyof LayoutAndStyle | '_remotionInternalEffects'> & Omit<AbsoluteFillLayout, 'layout' | 'styleWhilePostmounted' | 'postmountFor' | 'premountFor' | 'styleWhilePremounted'> & {
55
55
  readonly durationInFrames?: number;
56
56
  readonly width: number;
57
57
  readonly height: number;
58
- readonly _experimentalEffects?: EffectsProp;
58
+ readonly effects?: EffectsProp;
59
59
  readonly children: React.ReactNode;
60
60
  readonly onPaint?: HtmlInCanvasOnPaint;
61
61
  readonly onInit?: HtmlInCanvasOnInit;
@@ -231,11 +231,11 @@ const HtmlInCanvasContent = (0, react_1.forwardRef)(({ width, height, effects, c
231
231
  return ((0, jsx_runtime_1.jsx)(HtmlInCanvasAncestorContext.Provider, { value: true, children: (0, jsx_runtime_1.jsx)("canvas", { ref: setLayoutCanvasRef, width: width, height: height, style: style, children: (0, jsx_runtime_1.jsx)("div", { ref: divRef, style: innerStyle, children: children }) }, canvasSizeKey) }));
232
232
  });
233
233
  HtmlInCanvasContent.displayName = 'HtmlInCanvasContent';
234
- const HtmlInCanvasInner = (0, react_1.forwardRef)(({ width, height, _experimentalEffects: effects = [], children, onPaint, onInit, _experimentalControls: controls, style, durationInFrames, name, ...sequenceProps }, ref) => {
234
+ const HtmlInCanvasInner = (0, react_1.forwardRef)(({ width, height, effects = [], children, onPaint, onInit, _experimentalControls: controls, style, durationInFrames, name, ...sequenceProps }, ref) => {
235
235
  const { durationInFrames: videoDuration } = (0, use_video_config_js_1.useVideoConfig)();
236
236
  const resolvedDuration = durationInFrames !== null && durationInFrames !== void 0 ? durationInFrames : videoDuration;
237
237
  const memoizedEffectDefinitions = (0, use_memoized_effects_js_1.useMemoizedEffectDefinitions)(effects);
238
- return ((0, jsx_runtime_1.jsx)(Sequence_js_1.Sequence, { durationInFrames: resolvedDuration, name: name !== null && name !== void 0 ? name : '<HtmlInCanvas>', _experimentalControls: controls, _experimentalEffects: memoizedEffectDefinitions, layout: "none", ...sequenceProps, children: (0, jsx_runtime_1.jsx)(HtmlInCanvasContent, { ref: ref, width: width, height: height, effects: effects, onPaint: onPaint, onInit: onInit, controls: controls, style: style, children: children }) }));
238
+ return ((0, jsx_runtime_1.jsx)(Sequence_js_1.Sequence, { durationInFrames: resolvedDuration, name: name !== null && name !== void 0 ? name : '<HtmlInCanvas>', _experimentalControls: controls, _remotionInternalEffects: memoizedEffectDefinitions, layout: "none", ...sequenceProps, children: (0, jsx_runtime_1.jsx)(HtmlInCanvasContent, { ref: ref, width: width, height: height, effects: effects, onPaint: onPaint, onInit: onInit, controls: controls, style: style, children: children }) }));
239
239
  });
240
240
  HtmlInCanvasInner.displayName = 'HtmlInCanvas';
241
241
  const htmlInCanvasSchema = {
package/dist/cjs/Img.d.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  import React from 'react';
2
+ import type { SequenceProps } from './Sequence.js';
2
3
  export declare function truncateSrcForLabel(src: string): string;
3
4
  type NativeImgProps = Omit<React.DetailedHTMLProps<React.ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement>, 'src'>;
4
5
  export type ImgProps = NativeImgProps & {
@@ -14,7 +15,7 @@ export type ImgProps = NativeImgProps & {
14
15
  * @deprecated For internal use only
15
16
  */
16
17
  readonly stack?: string;
17
- };
18
+ } & Pick<SequenceProps, 'durationInFrames' | 'from' | 'hidden'>;
18
19
  export declare const Img: React.ComponentType<NativeImgProps & {
19
20
  readonly maxRetries?: number;
20
21
  readonly pauseWhenLoading?: boolean;
@@ -28,5 +29,5 @@ export declare const Img: React.ComponentType<NativeImgProps & {
28
29
  * @deprecated For internal use only
29
30
  */
30
31
  readonly stack?: string;
31
- }>;
32
+ } & Pick<SequenceProps, "hidden" | "durationInFrames" | "from">>;
32
33
  export {};
package/dist/cjs/Img.js CHANGED
@@ -8,10 +8,10 @@ const enable_sequence_stack_traces_js_1 = require("./enable-sequence-stack-trace
8
8
  const get_cross_origin_value_js_1 = require("./get-cross-origin-value.js");
9
9
  const prefetch_js_1 = require("./prefetch.js");
10
10
  const sequence_field_schema_js_1 = require("./sequence-field-schema.js");
11
+ const Sequence_js_1 = require("./Sequence.js");
11
12
  const SequenceContext_js_1 = require("./SequenceContext.js");
12
13
  const use_buffer_state_js_1 = require("./use-buffer-state.js");
13
14
  const use_delay_render_js_1 = require("./use-delay-render.js");
14
- const use_media_in_timeline_js_1 = require("./use-media-in-timeline.js");
15
15
  const use_remotion_environment_js_1 = require("./use-remotion-environment.js");
16
16
  const wrap_in_schema_js_1 = require("./wrap-in-schema.js");
17
17
  function exponentialBackoff(errorCount) {
@@ -181,31 +181,11 @@ const ImgContent = ({ onError, maxRetries = 2, src, pauseWhenLoading, delayRende
181
181
  // src gets set once we've loaded and decoded the image.
182
182
  return ((0, jsx_runtime_1.jsx)("img", { ...props, ref: imageRef, crossOrigin: crossOriginValue, onError: didGetError, decoding: "sync" }));
183
183
  };
184
- const ImgInner = ({ hidden, name, stack, showInTimeline, src, _experimentalControls: controls, ...props }) => {
185
- var _a, _b;
186
- const sequenceContext = (0, react_1.useContext)(SequenceContext_js_1.SequenceContext);
187
- const [timelineId] = (0, react_1.useState)(() => String(Math.random()));
184
+ const ImgInner = ({ hidden, name, stack, showInTimeline, src, from, durationInFrames, _experimentalControls: controls, ...props }) => {
188
185
  if (!src) {
189
186
  throw new Error('No "src" prop was passed to <Img>.');
190
187
  }
191
- const stackRef = (0, react_1.useRef)(null);
192
- stackRef.current = stack !== null && stack !== void 0 ? stack : null;
193
- const getStack = (0, react_1.useCallback)(() => stackRef.current, []);
194
- (0, use_media_in_timeline_js_1.useImageInTimeline)({
195
- src,
196
- displayName: name !== null && name !== void 0 ? name : null,
197
- id: timelineId,
198
- getStack,
199
- showInTimeline: showInTimeline !== null && showInTimeline !== void 0 ? showInTimeline : true,
200
- premountDisplay: (_a = sequenceContext === null || sequenceContext === void 0 ? void 0 : sequenceContext.premountDisplay) !== null && _a !== void 0 ? _a : null,
201
- postmountDisplay: (_b = sequenceContext === null || sequenceContext === void 0 ? void 0 : sequenceContext.postmountDisplay) !== null && _b !== void 0 ? _b : null,
202
- loopDisplay: undefined,
203
- controls: controls !== null && controls !== void 0 ? controls : null,
204
- });
205
- if (hidden) {
206
- return null;
207
- }
208
- return (0, jsx_runtime_1.jsx)(ImgContent, { src: src, ...props });
188
+ return ((0, jsx_runtime_1.jsx)(Sequence_js_1.Sequence, { layout: "none", from: from !== null && from !== void 0 ? from : 0, durationInFrames: durationInFrames !== null && durationInFrames !== void 0 ? durationInFrames : Infinity, _remotionInternalStack: stack, _remotionInternalIsMedia: { type: 'image', src }, name: name !== null && name !== void 0 ? name : '<Img>', _experimentalControls: controls, showInTimeline: showInTimeline !== null && showInTimeline !== void 0 ? showInTimeline : true, hidden: hidden, children: (0, jsx_runtime_1.jsx)(ImgContent, { src: src, ...props }) }));
209
189
  };
210
190
  const imgSchema = {
211
191
  ...sequence_field_schema_js_1.sequenceVisualStyleSchema,
@@ -23,7 +23,7 @@ export type SequencePropsWithoutDuration = {
23
23
  readonly showInTimeline?: boolean;
24
24
  readonly hidden?: boolean;
25
25
  readonly _experimentalControls?: SequenceControls;
26
- readonly _experimentalEffects?: readonly EffectDefinition<unknown>[];
26
+ readonly _remotionInternalEffects?: readonly EffectDefinition<unknown>[];
27
27
  /**
28
28
  * @deprecated For internal use only.
29
29
  */
@@ -54,6 +54,9 @@ export type SequencePropsWithoutDuration = {
54
54
  readonly _remotionInternalIsMedia?: {
55
55
  type: 'video' | 'audio';
56
56
  data: BasicMediaInTimelineReturnType;
57
+ } | {
58
+ type: 'image';
59
+ src: string;
57
60
  };
58
61
  } & LayoutAndStyle;
59
62
  export type SequenceProps = {
@@ -18,7 +18,7 @@ const use_remotion_environment_js_1 = require("./use-remotion-environment.js");
18
18
  const use_video_config_js_1 = require("./use-video-config.js");
19
19
  const v5_flag_js_1 = require("./v5-flag.js");
20
20
  const wrap_in_schema_js_1 = require("./wrap-in-schema.js");
21
- const RegularSequenceRefForwardingFunction = ({ from = 0, durationInFrames = Infinity, children, name, height, width, showInTimeline = true, hidden = false, _experimentalControls: controls, _experimentalEffects, _remotionInternalLoopDisplay: loopDisplay, _remotionInternalStack: stack, _remotionInternalPremountDisplay: premountDisplay, _remotionInternalPostmountDisplay: postmountDisplay, _remotionInternalIsMedia: isMedia, ...other }, ref) => {
21
+ const RegularSequenceRefForwardingFunction = ({ from = 0, durationInFrames = Infinity, children, name, height, width, showInTimeline = true, hidden = false, _experimentalControls: controls, _remotionInternalEffects, _remotionInternalLoopDisplay: loopDisplay, _remotionInternalStack: stack, _remotionInternalPremountDisplay: premountDisplay, _remotionInternalPostmountDisplay: postmountDisplay, _remotionInternalIsMedia: isMedia, ...other }, ref) => {
22
22
  var _a;
23
23
  const { layout = 'absolute-fill' } = other;
24
24
  const [id] = (0, react_1.useState)(() => String(Math.random()));
@@ -104,33 +104,55 @@ const RegularSequenceRefForwardingFunction = ({ from = 0, durationInFrames = Inf
104
104
  const stackRef = (0, react_2.useRef)(null);
105
105
  stackRef.current = stack !== null && stack !== void 0 ? stack : inheritedStack;
106
106
  (0, react_1.useEffect)(() => {
107
- var _a, _b;
107
+ var _a, _b, _c;
108
108
  if (!env.isStudio) {
109
109
  return;
110
110
  }
111
111
  if (isMedia) {
112
- registerSequence({
113
- type: isMedia.type,
114
- controls: controls !== null && controls !== void 0 ? controls : null,
115
- effects: _experimentalEffects !== null && _experimentalEffects !== void 0 ? _experimentalEffects : [],
116
- displayName: timelineClipName,
117
- doesVolumeChange: isMedia.data.doesVolumeChange,
118
- duration: actualDurationInFrames,
119
- from,
120
- id,
121
- loopDisplay,
122
- nonce: nonce.get(),
123
- parent: (_a = parentSequence === null || parentSequence === void 0 ? void 0 : parentSequence.id) !== null && _a !== void 0 ? _a : null,
124
- playbackRate: isMedia.data.playbackRate,
125
- postmountDisplay: postmountDisplay !== null && postmountDisplay !== void 0 ? postmountDisplay : null,
126
- premountDisplay: premountDisplay !== null && premountDisplay !== void 0 ? premountDisplay : null,
127
- rootId,
128
- showInTimeline,
129
- src: isMedia.data.src,
130
- getStack: () => stackRef.current,
131
- startMediaFrom: isMedia.data.startMediaFrom,
132
- volume: isMedia.data.volumes,
133
- });
112
+ if (isMedia.type === 'image') {
113
+ registerSequence({
114
+ type: 'image',
115
+ controls: controls !== null && controls !== void 0 ? controls : null,
116
+ effects: _remotionInternalEffects !== null && _remotionInternalEffects !== void 0 ? _remotionInternalEffects : [],
117
+ displayName: timelineClipName,
118
+ duration: actualDurationInFrames,
119
+ from,
120
+ id,
121
+ loopDisplay,
122
+ nonce: nonce.get(),
123
+ parent: (_a = parentSequence === null || parentSequence === void 0 ? void 0 : parentSequence.id) !== null && _a !== void 0 ? _a : null,
124
+ postmountDisplay: postmountDisplay !== null && postmountDisplay !== void 0 ? postmountDisplay : null,
125
+ premountDisplay: premountDisplay !== null && premountDisplay !== void 0 ? premountDisplay : null,
126
+ rootId,
127
+ showInTimeline,
128
+ src: isMedia.src,
129
+ getStack: () => stackRef.current,
130
+ });
131
+ }
132
+ else {
133
+ registerSequence({
134
+ type: isMedia.type,
135
+ controls: controls !== null && controls !== void 0 ? controls : null,
136
+ effects: _remotionInternalEffects !== null && _remotionInternalEffects !== void 0 ? _remotionInternalEffects : [],
137
+ displayName: timelineClipName,
138
+ doesVolumeChange: isMedia.data.doesVolumeChange,
139
+ duration: actualDurationInFrames,
140
+ from,
141
+ id,
142
+ loopDisplay,
143
+ nonce: nonce.get(),
144
+ parent: (_b = parentSequence === null || parentSequence === void 0 ? void 0 : parentSequence.id) !== null && _b !== void 0 ? _b : null,
145
+ playbackRate: isMedia.data.playbackRate,
146
+ postmountDisplay: postmountDisplay !== null && postmountDisplay !== void 0 ? postmountDisplay : null,
147
+ premountDisplay: premountDisplay !== null && premountDisplay !== void 0 ? premountDisplay : null,
148
+ rootId,
149
+ showInTimeline,
150
+ src: isMedia.data.src,
151
+ getStack: () => stackRef.current,
152
+ startMediaFrom: isMedia.data.startMediaFrom,
153
+ volume: isMedia.data.volumes,
154
+ });
155
+ }
134
156
  return () => {
135
157
  unregisterSequence(id);
136
158
  };
@@ -140,7 +162,7 @@ const RegularSequenceRefForwardingFunction = ({ from = 0, durationInFrames = Inf
140
162
  duration: actualDurationInFrames,
141
163
  id,
142
164
  displayName: timelineClipName,
143
- parent: (_b = parentSequence === null || parentSequence === void 0 ? void 0 : parentSequence.id) !== null && _b !== void 0 ? _b : null,
165
+ parent: (_c = parentSequence === null || parentSequence === void 0 ? void 0 : parentSequence.id) !== null && _c !== void 0 ? _c : null,
144
166
  type: 'sequence',
145
167
  rootId,
146
168
  showInTimeline,
@@ -150,7 +172,7 @@ const RegularSequenceRefForwardingFunction = ({ from = 0, durationInFrames = Inf
150
172
  premountDisplay: premountDisplay !== null && premountDisplay !== void 0 ? premountDisplay : null,
151
173
  postmountDisplay: postmountDisplay !== null && postmountDisplay !== void 0 ? postmountDisplay : null,
152
174
  controls: controls !== null && controls !== void 0 ? controls : null,
153
- effects: _experimentalEffects !== null && _experimentalEffects !== void 0 ? _experimentalEffects : [],
175
+ effects: _remotionInternalEffects !== null && _remotionInternalEffects !== void 0 ? _remotionInternalEffects : [],
154
176
  });
155
177
  return () => {
156
178
  unregisterSequence(id);
@@ -173,7 +195,7 @@ const RegularSequenceRefForwardingFunction = ({ from = 0, durationInFrames = Inf
173
195
  postmountDisplay,
174
196
  env.isStudio,
175
197
  controls,
176
- _experimentalEffects,
198
+ _remotionInternalEffects,
177
199
  isMedia,
178
200
  ]);
179
201
  // Ceil to support floats
@@ -2,9 +2,9 @@ import type React from 'react';
2
2
  import type { SequenceControls } from '../CompositionManager.js';
3
3
  import type { EffectsProp } from '../effects/effect-types.js';
4
4
  import type { RemotionAnimatedImageProps } from './props';
5
- export declare const AnimatedImage: React.ComponentType<Omit<import("../Sequence.js").SequenceProps, "children" | "layout" | "durationInFrames" | "_experimentalEffects"> & RemotionAnimatedImageProps & {
5
+ export declare const AnimatedImage: React.ComponentType<Omit<import("../Sequence.js").SequenceProps, "children" | "layout" | "durationInFrames" | "_remotionInternalEffects"> & RemotionAnimatedImageProps & {
6
6
  readonly durationInFrames?: number;
7
- readonly _experimentalEffects?: EffectsProp;
7
+ readonly effects?: EffectsProp;
8
8
  } & {
9
9
  readonly _experimentalControls?: SequenceControls | undefined;
10
10
  readonly ref?: React.Ref<HTMLCanvasElement>;
@@ -142,7 +142,7 @@ const AnimatedImageContent = (0, react_1.forwardRef)(({ src, width, height, onEr
142
142
  return ((0, jsx_runtime_1.jsx)(canvas_1.Canvas, { ref: ref, width: width, height: height, fit: fit, effects: memoizedEffects, ...props }));
143
143
  });
144
144
  AnimatedImageContent.displayName = 'AnimatedImageContent';
145
- const AnimatedImageInner = ({ src, width, height, onError, fit, playbackRate, loopBehavior, id, className, style, durationInFrames, _experimentalEffects: effects = [], _experimentalControls: controls, ref, ...sequenceProps }) => {
145
+ const AnimatedImageInner = ({ src, width, height, onError, fit, playbackRate, loopBehavior, id, className, style, durationInFrames, effects = [], _experimentalControls: controls, ref, ...sequenceProps }) => {
146
146
  const { durationInFrames: videoDuration } = (0, use_video_config_js_1.useVideoConfig)();
147
147
  const resolvedDuration = durationInFrames !== null && durationInFrames !== void 0 ? durationInFrames : videoDuration;
148
148
  const memoizedEffectDefinitions = (0, use_memoized_effects_js_1.useMemoizedEffectDefinitions)(effects);
@@ -158,7 +158,7 @@ const AnimatedImageInner = ({ src, width, height, onError, fit, playbackRate, lo
158
158
  className,
159
159
  style,
160
160
  };
161
- return ((0, jsx_runtime_1.jsx)(Sequence_js_1.Sequence, { layout: "none", durationInFrames: resolvedDuration, name: "<AnimatedImage>", _experimentalControls: controls, _experimentalEffects: memoizedEffectDefinitions, ...sequenceProps, children: (0, jsx_runtime_1.jsx)(AnimatedImageContent, { ...animatedImageProps, ref: ref, effects: effects, controls: controls }) }));
161
+ return ((0, jsx_runtime_1.jsx)(Sequence_js_1.Sequence, { layout: "none", durationInFrames: resolvedDuration, name: "<AnimatedImage>", _experimentalControls: controls, _remotionInternalEffects: memoizedEffectDefinitions, ...sequenceProps, children: (0, jsx_runtime_1.jsx)(AnimatedImageContent, { ...animatedImageProps, ref: ref, effects: effects, controls: controls }) }));
162
162
  };
163
163
  exports.AnimatedImage = (0, wrap_in_schema_js_1.wrapInSchema)(AnimatedImageInner, animatedImageSchema);
164
164
  exports.AnimatedImage.displayName = 'AnimatedImage';
@@ -13,8 +13,8 @@ export type RemotionAnimatedImageProps = {
13
13
  id?: string;
14
14
  className?: string;
15
15
  };
16
- export type AnimatedImageProps = Omit<SequenceProps, 'children' | 'durationInFrames' | 'layout' | '_experimentalEffects'> & RemotionAnimatedImageProps & {
16
+ export type AnimatedImageProps = Omit<SequenceProps, 'children' | 'durationInFrames' | 'layout' | '_remotionInternalEffects'> & RemotionAnimatedImageProps & {
17
17
  readonly durationInFrames?: number;
18
- readonly _experimentalEffects?: EffectsProp;
18
+ readonly effects?: EffectsProp;
19
19
  };
20
20
  export type AnimatedImageFillMode = 'contain' | 'cover' | 'fill';
@@ -7,7 +7,7 @@ type MandatoryProps = {
7
7
  };
8
8
  type OptionalProps = {
9
9
  readonly color: string | undefined;
10
- readonly _experimentalEffects: EffectsProp;
10
+ readonly effects: EffectsProp;
11
11
  readonly className: string | undefined;
12
12
  readonly style: React.CSSProperties | undefined;
13
13
  };
@@ -33,11 +33,11 @@ const solidSchema = {
33
33
  },
34
34
  ...sequence_field_schema_js_1.sequenceVisualStyleSchema,
35
35
  };
36
- const SolidInner = ({ color, width, height, _experimentalEffects: experimentalEffects = [], className, style, overrideId, ref, }) => {
36
+ const SolidInner = ({ color, width, height, effects = [], className, style, overrideId, ref, }) => {
37
37
  const { delayRender, continueRender, cancelRender } = (0, use_delay_render_js_1.useDelayRender)();
38
38
  const [outputCanvas, setOutputCanvas] = (0, react_1.useState)(null);
39
39
  const memoizedEffects = (0, use_memoized_effects_js_1.useMemoizedEffects)({
40
- effects: experimentalEffects,
40
+ effects,
41
41
  overrideId: overrideId !== null && overrideId !== void 0 ? overrideId : null,
42
42
  });
43
43
  const sourceCanvas = (0, react_1.useMemo)(() => {
@@ -114,11 +114,11 @@ const SolidInner = ({ color, width, height, _experimentalEffects: experimentalEf
114
114
  ]);
115
115
  return ((0, jsx_runtime_1.jsx)("canvas", { ref: canvasRef, width: width, height: height, className: className, style: style }));
116
116
  };
117
- const SolidOuter = (0, react_1.forwardRef)(({ _experimentalEffects = [], _experimentalControls: controls, color, height, width, className, durationInFrames, style, name, from, hidden, showInTimeline, ...props }, ref) => {
117
+ const SolidOuter = (0, react_1.forwardRef)(({ effects = [], _experimentalControls: controls, color, height, width, className, durationInFrames, style, name, from, hidden, showInTimeline, ...props }, ref) => {
118
118
  var _a;
119
119
  props;
120
- const memoizedEffectDefinitions = (0, use_memoized_effects_js_1.useMemoizedEffectDefinitions)(_experimentalEffects);
121
- return ((0, jsx_runtime_1.jsx)(Sequence_js_1.Sequence, { layout: "none", from: from, hidden: hidden, showInTimeline: showInTimeline, _experimentalControls: controls, _experimentalEffects: memoizedEffectDefinitions, durationInFrames: durationInFrames, name: name !== null && name !== void 0 ? name : '<Solid>', ...props, children: (0, jsx_runtime_1.jsx)(SolidInner, { ref: ref, overrideId: (_a = controls === null || controls === void 0 ? void 0 : controls.overrideId) !== null && _a !== void 0 ? _a : null, color: color, height: height, width: width, className: className, style: style, _experimentalEffects: _experimentalEffects }) }));
120
+ const memoizedEffectDefinitions = (0, use_memoized_effects_js_1.useMemoizedEffectDefinitions)(effects);
121
+ return ((0, jsx_runtime_1.jsx)(Sequence_js_1.Sequence, { layout: "none", from: from, hidden: hidden, showInTimeline: showInTimeline, _experimentalControls: controls, _remotionInternalEffects: memoizedEffectDefinitions, durationInFrames: durationInFrames, name: name !== null && name !== void 0 ? name : '<Solid>', ...props, children: (0, jsx_runtime_1.jsx)(SolidInner, { ref: ref, overrideId: (_a = controls === null || controls === void 0 ? void 0 : controls.overrideId) !== null && _a !== void 0 ? _a : null, color: color, height: height, width: width, className: className, style: style, effects: effects }) }));
122
122
  });
123
123
  exports.Solid = (0, wrap_in_schema_js_1.wrapInSchema)(SolidOuter, solidSchema);
124
124
  exports.Solid.displayName = 'Solid';
@@ -9,6 +9,12 @@ export type EffectApplyParams<P, S> = {
9
9
  readonly width: number;
10
10
  readonly height: number;
11
11
  readonly gpuDevice: AnyGpuDevice | null;
12
+ /**
13
+ * When `true`, WebGL `texImage2D` uploads use `UNPACK_FLIP_Y_WEBGL` so DOM-style
14
+ * 2D frame canvases match clip-space UVs. Set by `runEffectChain` — `false` for
15
+ * prior WebGL outputs and `ImageBitmap` bridges from WebGL.
16
+ */
17
+ readonly flipSourceY: boolean;
12
18
  };
13
19
  export type EffectDefinition<P, S = unknown> = {
14
20
  readonly type: string;
@@ -68,6 +68,8 @@ const runEffectChain = async ({ state, source, effects, output, width, height, }
68
68
  if (isCancelled()) {
69
69
  return false;
70
70
  }
71
+ // Raw component sources are 2D frame canvases (Gif, WrappedCanvas.canvas, …).
72
+ let flipWebGLSourceY = true;
71
73
  for (let runIndex = 0; runIndex < runs.length; runIndex++) {
72
74
  const run = runs[runIndex];
73
75
  const [a, b] = state.pool.getPair(run.backend);
@@ -83,8 +85,10 @@ const runEffectChain = async ({ state, source, effects, output, width, height, }
83
85
  width,
84
86
  height,
85
87
  gpuDevice,
88
+ flipSourceY: run.backend === 'webgl2' ? flipWebGLSourceY : false,
86
89
  });
87
90
  if (run.backend === 'webgl2') {
91
+ flipWebGLSourceY = false;
88
92
  state.pool.assertContextNotLost(dst);
89
93
  }
90
94
  currentImage = dst;
@@ -93,19 +97,29 @@ const runEffectChain = async ({ state, source, effects, output, width, height, }
93
97
  lastTarget = (_a = currentImage) !== null && _a !== void 0 ? _a : lastTarget;
94
98
  const nextRun = runs[runIndex + 1];
95
99
  if (nextRun && nextRun.backend !== run.backend && lastTarget) {
96
- // Bridge between backend groups via `createImageBitmap` rather than
97
- // passing the canvas straight through. A direct `drawImage(webglCanvas)`
98
- // in the next backend's first effect forces an implicit GPU readback /
99
- // finish on the consuming context, which empirically blows the per-frame
100
- // vsync budget and halves the paint rate. `createImageBitmap` performs
101
- // the same handoff but pipelines the GPU work, so the next effect reads
102
- // from a ready-to-sample bitmap without stalling.
103
- const bitmap = await createImageBitmap(lastTarget);
104
- if (isCancelled()) {
105
- bitmap.close();
106
- return false;
100
+ // 2D WebGL: pass the 2D canvas directly so `texImage2D` + `UNPACK_FLIP_Y`
101
+ // matches blur-only on a raw frame canvas. `createImageBitmap` here changes
102
+ // upload orientation and produced upside-down stacks (wave + blur).
103
+ if (run.backend === '2d' && nextRun.backend === 'webgl2') {
104
+ currentImage = lastTarget;
105
+ flipWebGLSourceY = true;
106
+ }
107
+ else {
108
+ // Other bridges use `createImageBitmap` rather than passing the canvas
109
+ // straight through. A direct `drawImage(webglCanvas)` in the next
110
+ // backend's first effect forces an implicit GPU readback / finish on the
111
+ // consuming context, which empirically blows the per-frame vsync budget and
112
+ // halves the paint rate. `createImageBitmap` pipelines the GPU work.
113
+ const bitmap = await createImageBitmap(lastTarget);
114
+ if (isCancelled()) {
115
+ bitmap.close();
116
+ return false;
117
+ }
118
+ currentImage = bitmap;
119
+ if (nextRun.backend === 'webgl2') {
120
+ flipWebGLSourceY = false;
121
+ }
107
122
  }
108
- currentImage = bitmap;
109
123
  }
110
124
  }
111
125
  if (!lastTarget) {
@@ -1,4 +1,4 @@
1
- import type { LoopDisplay, SequenceControls } from './CompositionManager.js';
1
+ import type { LoopDisplay } from './CompositionManager.js';
2
2
  import type { VolumeProp } from './volume-prop.js';
3
3
  export declare const useBasicMediaInTimeline: ({ volume, mediaVolume, mediaType, src, displayName, trimBefore, trimAfter, playbackRate, sequenceDurationInFrames, mediaStartsAt, loop, }: {
4
4
  volume: VolumeProp | undefined;
@@ -24,17 +24,6 @@ export declare const useBasicMediaInTimeline: ({ volume, mediaVolume, mediaType,
24
24
  playbackRate: number;
25
25
  };
26
26
  export type BasicMediaInTimelineReturnType = ReturnType<typeof useBasicMediaInTimeline>;
27
- export declare const useImageInTimeline: ({ src, displayName, id, getStack, showInTimeline, premountDisplay, postmountDisplay, loopDisplay, controls, }: {
28
- src: string | undefined;
29
- displayName: string | null;
30
- id: string;
31
- getStack: () => string | null;
32
- showInTimeline: boolean;
33
- premountDisplay: number | null;
34
- postmountDisplay: number | null;
35
- loopDisplay: LoopDisplay | undefined;
36
- controls: SequenceControls | null;
37
- }) => void;
38
27
  export declare const useMediaInTimeline: ({ volume, mediaVolume, src, mediaType, playbackRate, displayName, id, getStack, showInTimeline, premountDisplay, postmountDisplay, loopDisplay, }: {
39
28
  volume: VolumeProp | undefined;
40
29
  mediaVolume: number;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.useMediaInTimeline = exports.useImageInTimeline = exports.useBasicMediaInTimeline = void 0;
3
+ exports.useMediaInTimeline = exports.useBasicMediaInTimeline = void 0;
4
4
  const react_1 = require("react");
5
5
  const use_audio_frame_js_1 = require("./audio/use-audio-frame.js");
6
6
  const get_asset_file_name_js_1 = require("./get-asset-file-name.js");
@@ -86,77 +86,6 @@ const useBasicMediaInTimeline = ({ volume, mediaVolume, mediaType, src, displayN
86
86
  return memoizedResult;
87
87
  };
88
88
  exports.useBasicMediaInTimeline = useBasicMediaInTimeline;
89
- const useImageInTimeline = ({ src, displayName, id, getStack, showInTimeline, premountDisplay, postmountDisplay, loopDisplay, controls, }) => {
90
- const parentSequence = (0, react_1.useContext)(SequenceContext_js_1.SequenceContext);
91
- const { registerSequence, unregisterSequence } = (0, react_1.useContext)(SequenceManager_js_1.SequenceManager);
92
- const { durationInFrames } = (0, use_video_config_js_1.useVideoConfig)();
93
- const mediaStartsAt = (0, use_audio_frame_js_1.useMediaStartsAt)();
94
- const { duration, nonce, rootId, finalDisplayName } = (0, exports.useBasicMediaInTimeline)({
95
- volume: undefined,
96
- mediaVolume: 0,
97
- mediaType: 'image',
98
- src,
99
- displayName,
100
- trimAfter: undefined,
101
- trimBefore: undefined,
102
- playbackRate: 1,
103
- sequenceDurationInFrames: durationInFrames,
104
- mediaStartsAt,
105
- loop: false,
106
- });
107
- const { isStudio } = (0, use_remotion_environment_js_1.useRemotionEnvironment)();
108
- (0, react_1.useEffect)(() => {
109
- var _a, _b, _c;
110
- if (!src) {
111
- throw new Error('No src passed');
112
- }
113
- if (!isStudio && ((_b = (_a = window.process) === null || _a === void 0 ? void 0 : _a.env) === null || _b === void 0 ? void 0 : _b.NODE_ENV) !== 'test') {
114
- return;
115
- }
116
- if (!showInTimeline) {
117
- return;
118
- }
119
- registerSequence({
120
- type: 'image',
121
- src,
122
- id,
123
- duration,
124
- from: 0,
125
- parent: (_c = parentSequence === null || parentSequence === void 0 ? void 0 : parentSequence.id) !== null && _c !== void 0 ? _c : null,
126
- displayName: finalDisplayName,
127
- rootId,
128
- showInTimeline: true,
129
- nonce: nonce.get(),
130
- loopDisplay,
131
- getStack,
132
- premountDisplay,
133
- postmountDisplay,
134
- controls,
135
- effects: [],
136
- });
137
- return () => {
138
- unregisterSequence(id);
139
- };
140
- }, [
141
- duration,
142
- id,
143
- parentSequence,
144
- src,
145
- registerSequence,
146
- unregisterSequence,
147
- nonce,
148
- getStack,
149
- showInTimeline,
150
- premountDisplay,
151
- postmountDisplay,
152
- isStudio,
153
- loopDisplay,
154
- rootId,
155
- finalDisplayName,
156
- controls,
157
- ]);
158
- };
159
- exports.useImageInTimeline = useImageInTimeline;
160
89
  const useMediaInTimeline = ({ volume, mediaVolume, src, mediaType, playbackRate, displayName, id, getStack, showInTimeline, premountDisplay, postmountDisplay, loopDisplay, }) => {
161
90
  const parentSequence = (0, react_1.useContext)(SequenceContext_js_1.SequenceContext);
162
91
  const startsAt = (0, use_audio_frame_js_1.useMediaStartsAt)();
@@ -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.464";
6
+ export declare const VERSION = "4.0.465";
@@ -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.464';
10
+ exports.VERSION = '4.0.465';
@@ -56,20 +56,70 @@ var CompositionRenderErrorContext = createContext3({
56
56
 
57
57
  // src/CompositionErrorBoundary.tsx
58
58
  import React2 from "react";
59
+ var getHot = () => {
60
+ try {
61
+ if (typeof __webpack_module__ === "undefined") {
62
+ return null;
63
+ }
64
+ return __webpack_module__.hot ?? null;
65
+ } catch {
66
+ return null;
67
+ }
68
+ };
59
69
 
60
70
  class CompositionErrorBoundary extends React2.Component {
61
71
  state = { hasError: false };
72
+ hmrStatusHandler = null;
62
73
  static getDerivedStateFromError() {
63
74
  return { hasError: true };
64
75
  }
65
76
  componentDidCatch(error) {
66
77
  this.props.onError(error);
78
+ this.subscribeToHmrReset();
67
79
  }
68
- componentDidUpdate(_prevProps) {
80
+ componentDidMount() {
69
81
  if (!this.state.hasError) {
70
82
  this.props.onClear();
71
83
  }
72
84
  }
85
+ componentDidUpdate(_prevProps, prevState) {
86
+ if (prevState.hasError && !this.state.hasError) {
87
+ this.props.onClear();
88
+ }
89
+ }
90
+ componentWillUnmount() {
91
+ this.unsubscribeFromHmrReset();
92
+ }
93
+ subscribeToHmrReset() {
94
+ if (this.hmrStatusHandler) {
95
+ return;
96
+ }
97
+ const hot = getHot();
98
+ if (!hot) {
99
+ return;
100
+ }
101
+ const handler = (status) => {
102
+ if (status !== "idle") {
103
+ return;
104
+ }
105
+ this.unsubscribeFromHmrReset();
106
+ this.setState({ hasError: false });
107
+ };
108
+ this.hmrStatusHandler = handler;
109
+ hot.addStatusHandler(handler);
110
+ }
111
+ unsubscribeFromHmrReset() {
112
+ const handler = this.hmrStatusHandler;
113
+ if (!handler) {
114
+ return;
115
+ }
116
+ this.hmrStatusHandler = null;
117
+ const hot = getHot();
118
+ if (!hot) {
119
+ return;
120
+ }
121
+ hot.removeStatusHandler(handler);
122
+ }
73
123
  render() {
74
124
  if (this.state.hasError) {
75
125
  return null;
@@ -1238,7 +1288,7 @@ var addSequenceStackTraces = (component) => {
1238
1288
  };
1239
1289
 
1240
1290
  // src/version.ts
1241
- var VERSION = "4.0.464";
1291
+ var VERSION = "4.0.465";
1242
1292
 
1243
1293
  // src/multiple-versions-warning.ts
1244
1294
  var checkMultipleRemotionVersions = () => {
@@ -2376,7 +2426,7 @@ var RegularSequenceRefForwardingFunction = ({
2376
2426
  showInTimeline = true,
2377
2427
  hidden = false,
2378
2428
  _experimentalControls: controls,
2379
- _experimentalEffects,
2429
+ _remotionInternalEffects,
2380
2430
  _remotionInternalLoopDisplay: loopDisplay,
2381
2431
  _remotionInternalStack: stack,
2382
2432
  _remotionInternalPremountDisplay: premountDisplay,
@@ -2458,28 +2508,49 @@ var RegularSequenceRefForwardingFunction = ({
2458
2508
  return;
2459
2509
  }
2460
2510
  if (isMedia) {
2461
- registerSequence({
2462
- type: isMedia.type,
2463
- controls: controls ?? null,
2464
- effects: _experimentalEffects ?? [],
2465
- displayName: timelineClipName,
2466
- doesVolumeChange: isMedia.data.doesVolumeChange,
2467
- duration: actualDurationInFrames,
2468
- from,
2469
- id,
2470
- loopDisplay,
2471
- nonce: nonce.get(),
2472
- parent: parentSequence?.id ?? null,
2473
- playbackRate: isMedia.data.playbackRate,
2474
- postmountDisplay: postmountDisplay ?? null,
2475
- premountDisplay: premountDisplay ?? null,
2476
- rootId,
2477
- showInTimeline,
2478
- src: isMedia.data.src,
2479
- getStack: () => stackRef.current,
2480
- startMediaFrom: isMedia.data.startMediaFrom,
2481
- volume: isMedia.data.volumes
2482
- });
2511
+ if (isMedia.type === "image") {
2512
+ registerSequence({
2513
+ type: "image",
2514
+ controls: controls ?? null,
2515
+ effects: _remotionInternalEffects ?? [],
2516
+ displayName: timelineClipName,
2517
+ duration: actualDurationInFrames,
2518
+ from,
2519
+ id,
2520
+ loopDisplay,
2521
+ nonce: nonce.get(),
2522
+ parent: parentSequence?.id ?? null,
2523
+ postmountDisplay: postmountDisplay ?? null,
2524
+ premountDisplay: premountDisplay ?? null,
2525
+ rootId,
2526
+ showInTimeline,
2527
+ src: isMedia.src,
2528
+ getStack: () => stackRef.current
2529
+ });
2530
+ } else {
2531
+ registerSequence({
2532
+ type: isMedia.type,
2533
+ controls: controls ?? null,
2534
+ effects: _remotionInternalEffects ?? [],
2535
+ displayName: timelineClipName,
2536
+ doesVolumeChange: isMedia.data.doesVolumeChange,
2537
+ duration: actualDurationInFrames,
2538
+ from,
2539
+ id,
2540
+ loopDisplay,
2541
+ nonce: nonce.get(),
2542
+ parent: parentSequence?.id ?? null,
2543
+ playbackRate: isMedia.data.playbackRate,
2544
+ postmountDisplay: postmountDisplay ?? null,
2545
+ premountDisplay: premountDisplay ?? null,
2546
+ rootId,
2547
+ showInTimeline,
2548
+ src: isMedia.data.src,
2549
+ getStack: () => stackRef.current,
2550
+ startMediaFrom: isMedia.data.startMediaFrom,
2551
+ volume: isMedia.data.volumes
2552
+ });
2553
+ }
2483
2554
  return () => {
2484
2555
  unregisterSequence(id);
2485
2556
  };
@@ -2499,7 +2570,7 @@ var RegularSequenceRefForwardingFunction = ({
2499
2570
  premountDisplay: premountDisplay ?? null,
2500
2571
  postmountDisplay: postmountDisplay ?? null,
2501
2572
  controls: controls ?? null,
2502
- effects: _experimentalEffects ?? []
2573
+ effects: _remotionInternalEffects ?? []
2503
2574
  });
2504
2575
  return () => {
2505
2576
  unregisterSequence(id);
@@ -2522,7 +2593,7 @@ var RegularSequenceRefForwardingFunction = ({
2522
2593
  postmountDisplay,
2523
2594
  env.isStudio,
2524
2595
  controls,
2525
- _experimentalEffects,
2596
+ _remotionInternalEffects,
2526
2597
  isMedia
2527
2598
  ]);
2528
2599
  const endThreshold = Math.ceil(cumulatedFrom + from + durationInFrames - 1);
@@ -2821,6 +2892,7 @@ var runEffectChain = async ({
2821
2892
  if (isCancelled()) {
2822
2893
  return false;
2823
2894
  }
2895
+ let flipWebGLSourceY = true;
2824
2896
  for (let runIndex = 0;runIndex < runs.length; runIndex++) {
2825
2897
  const run = runs[runIndex];
2826
2898
  const [a, b] = state.pool.getPair(run.backend);
@@ -2835,9 +2907,11 @@ var runEffectChain = async ({
2835
2907
  params: eff.params,
2836
2908
  width,
2837
2909
  height,
2838
- gpuDevice
2910
+ gpuDevice,
2911
+ flipSourceY: run.backend === "webgl2" ? flipWebGLSourceY : false
2839
2912
  });
2840
2913
  if (run.backend === "webgl2") {
2914
+ flipWebGLSourceY = false;
2841
2915
  state.pool.assertContextNotLost(dst);
2842
2916
  }
2843
2917
  currentImage = dst;
@@ -2846,12 +2920,20 @@ var runEffectChain = async ({
2846
2920
  lastTarget = currentImage ?? lastTarget;
2847
2921
  const nextRun = runs[runIndex + 1];
2848
2922
  if (nextRun && nextRun.backend !== run.backend && lastTarget) {
2849
- const bitmap = await createImageBitmap(lastTarget);
2850
- if (isCancelled()) {
2851
- bitmap.close();
2852
- return false;
2923
+ if (run.backend === "2d" && nextRun.backend === "webgl2") {
2924
+ currentImage = lastTarget;
2925
+ flipWebGLSourceY = true;
2926
+ } else {
2927
+ const bitmap = await createImageBitmap(lastTarget);
2928
+ if (isCancelled()) {
2929
+ bitmap.close();
2930
+ return false;
2931
+ }
2932
+ currentImage = bitmap;
2933
+ if (nextRun.backend === "webgl2") {
2934
+ flipWebGLSourceY = false;
2935
+ }
2853
2936
  }
2854
- currentImage = bitmap;
2855
2937
  }
2856
2938
  }
2857
2939
  if (!lastTarget) {
@@ -3310,7 +3392,7 @@ var AnimatedImageInner = ({
3310
3392
  className,
3311
3393
  style,
3312
3394
  durationInFrames,
3313
- _experimentalEffects: effects = [],
3395
+ effects = [],
3314
3396
  _experimentalControls: controls,
3315
3397
  ref,
3316
3398
  ...sequenceProps
@@ -3335,7 +3417,7 @@ var AnimatedImageInner = ({
3335
3417
  durationInFrames: resolvedDuration,
3336
3418
  name: "<AnimatedImage>",
3337
3419
  _experimentalControls: controls,
3338
- _experimentalEffects: memoizedEffectDefinitions,
3420
+ _remotionInternalEffects: memoizedEffectDefinitions,
3339
3421
  ...sequenceProps,
3340
3422
  children: /* @__PURE__ */ jsx13(AnimatedImageContent, {
3341
3423
  ...animatedImageProps,
@@ -3383,7 +3465,7 @@ var SolidInner = ({
3383
3465
  color,
3384
3466
  width,
3385
3467
  height,
3386
- _experimentalEffects: experimentalEffects = [],
3468
+ effects = [],
3387
3469
  className,
3388
3470
  style,
3389
3471
  overrideId,
@@ -3392,7 +3474,7 @@ var SolidInner = ({
3392
3474
  const { delayRender: delayRender2, continueRender: continueRender2, cancelRender: cancelRender2 } = useDelayRender();
3393
3475
  const [outputCanvas, setOutputCanvas] = useState7(null);
3394
3476
  const memoizedEffects = useMemoizedEffects({
3395
- effects: experimentalEffects,
3477
+ effects,
3396
3478
  overrideId: overrideId ?? null
3397
3479
  });
3398
3480
  const sourceCanvas = useMemo17(() => {
@@ -3472,7 +3554,7 @@ var SolidInner = ({
3472
3554
  });
3473
3555
  };
3474
3556
  var SolidOuter = forwardRef5(({
3475
- _experimentalEffects = [],
3557
+ effects = [],
3476
3558
  _experimentalControls: controls,
3477
3559
  color,
3478
3560
  height,
@@ -3486,14 +3568,14 @@ var SolidOuter = forwardRef5(({
3486
3568
  showInTimeline,
3487
3569
  ...props
3488
3570
  }, ref) => {
3489
- const memoizedEffectDefinitions = useMemoizedEffectDefinitions(_experimentalEffects);
3571
+ const memoizedEffectDefinitions = useMemoizedEffectDefinitions(effects);
3490
3572
  return /* @__PURE__ */ jsx14(Sequence, {
3491
3573
  layout: "none",
3492
3574
  from,
3493
3575
  hidden,
3494
3576
  showInTimeline,
3495
3577
  _experimentalControls: controls,
3496
- _experimentalEffects: memoizedEffectDefinitions,
3578
+ _remotionInternalEffects: memoizedEffectDefinitions,
3497
3579
  durationInFrames,
3498
3580
  name: name ?? "<Solid>",
3499
3581
  ...props,
@@ -3505,7 +3587,7 @@ var SolidOuter = forwardRef5(({
3505
3587
  width,
3506
3588
  className,
3507
3589
  style,
3508
- _experimentalEffects
3590
+ effects
3509
3591
  })
3510
3592
  });
3511
3593
  });
@@ -3731,7 +3813,7 @@ HtmlInCanvasContent.displayName = "HtmlInCanvasContent";
3731
3813
  var HtmlInCanvasInner = forwardRef6(({
3732
3814
  width,
3733
3815
  height,
3734
- _experimentalEffects: effects = [],
3816
+ effects = [],
3735
3817
  children,
3736
3818
  onPaint,
3737
3819
  onInit,
@@ -3748,7 +3830,7 @@ var HtmlInCanvasInner = forwardRef6(({
3748
3830
  durationInFrames: resolvedDuration,
3749
3831
  name: name ?? "<HtmlInCanvas>",
3750
3832
  _experimentalControls: controls,
3751
- _experimentalEffects: memoizedEffectDefinitions,
3833
+ _remotionInternalEffects: memoizedEffectDefinitions,
3752
3834
  layout: "none",
3753
3835
  ...sequenceProps,
3754
3836
  children: /* @__PURE__ */ jsx15(HtmlInCanvasContent, {
@@ -5380,85 +5462,6 @@ var useBasicMediaInTimeline = ({
5380
5462
  ]);
5381
5463
  return memoizedResult;
5382
5464
  };
5383
- var useImageInTimeline = ({
5384
- src,
5385
- displayName,
5386
- id,
5387
- getStack,
5388
- showInTimeline,
5389
- premountDisplay,
5390
- postmountDisplay,
5391
- loopDisplay,
5392
- controls
5393
- }) => {
5394
- const parentSequence = useContext24(SequenceContext);
5395
- const { registerSequence, unregisterSequence } = useContext24(SequenceManager);
5396
- const { durationInFrames } = useVideoConfig();
5397
- const mediaStartsAt = useMediaStartsAt();
5398
- const { duration, nonce, rootId, finalDisplayName } = useBasicMediaInTimeline({
5399
- volume: undefined,
5400
- mediaVolume: 0,
5401
- mediaType: "image",
5402
- src,
5403
- displayName,
5404
- trimAfter: undefined,
5405
- trimBefore: undefined,
5406
- playbackRate: 1,
5407
- sequenceDurationInFrames: durationInFrames,
5408
- mediaStartsAt,
5409
- loop: false
5410
- });
5411
- const { isStudio } = useRemotionEnvironment();
5412
- useEffect8(() => {
5413
- if (!src) {
5414
- throw new Error("No src passed");
5415
- }
5416
- if (!isStudio && window.process?.env?.NODE_ENV !== "test") {
5417
- return;
5418
- }
5419
- if (!showInTimeline) {
5420
- return;
5421
- }
5422
- registerSequence({
5423
- type: "image",
5424
- src,
5425
- id,
5426
- duration,
5427
- from: 0,
5428
- parent: parentSequence?.id ?? null,
5429
- displayName: finalDisplayName,
5430
- rootId,
5431
- showInTimeline: true,
5432
- nonce: nonce.get(),
5433
- loopDisplay,
5434
- getStack,
5435
- premountDisplay,
5436
- postmountDisplay,
5437
- controls,
5438
- effects: []
5439
- });
5440
- return () => {
5441
- unregisterSequence(id);
5442
- };
5443
- }, [
5444
- duration,
5445
- id,
5446
- parentSequence,
5447
- src,
5448
- registerSequence,
5449
- unregisterSequence,
5450
- nonce,
5451
- getStack,
5452
- showInTimeline,
5453
- premountDisplay,
5454
- postmountDisplay,
5455
- isStudio,
5456
- loopDisplay,
5457
- rootId,
5458
- finalDisplayName,
5459
- controls
5460
- ]);
5461
- };
5462
5465
  var useMediaInTimeline = ({
5463
5466
  volume,
5464
5467
  mediaVolume,
@@ -7284,8 +7287,7 @@ import {
7284
7287
  useContext as useContext32,
7285
7288
  useImperativeHandle as useImperativeHandle6,
7286
7289
  useLayoutEffect as useLayoutEffect10,
7287
- useRef as useRef21,
7288
- useState as useState17
7290
+ useRef as useRef21
7289
7291
  } from "react";
7290
7292
  import { jsx as jsx26 } from "react/jsx-runtime";
7291
7293
  function exponentialBackoff(errorCount) {
@@ -7447,34 +7449,28 @@ var ImgInner = ({
7447
7449
  stack,
7448
7450
  showInTimeline,
7449
7451
  src,
7452
+ from,
7453
+ durationInFrames,
7450
7454
  _experimentalControls: controls,
7451
7455
  ...props2
7452
7456
  }) => {
7453
- const sequenceContext = useContext32(SequenceContext);
7454
- const [timelineId] = useState17(() => String(Math.random()));
7455
7457
  if (!src) {
7456
7458
  throw new Error('No "src" prop was passed to <Img>.');
7457
7459
  }
7458
- const stackRef = useRef21(null);
7459
- stackRef.current = stack ?? null;
7460
- const getStack = useCallback17(() => stackRef.current, []);
7461
- useImageInTimeline({
7462
- src,
7463
- displayName: name ?? null,
7464
- id: timelineId,
7465
- getStack,
7460
+ return /* @__PURE__ */ jsx26(Sequence, {
7461
+ layout: "none",
7462
+ from: from ?? 0,
7463
+ durationInFrames: durationInFrames ?? Infinity,
7464
+ _remotionInternalStack: stack,
7465
+ _remotionInternalIsMedia: { type: "image", src },
7466
+ name: name ?? "<Img>",
7467
+ _experimentalControls: controls,
7466
7468
  showInTimeline: showInTimeline ?? true,
7467
- premountDisplay: sequenceContext?.premountDisplay ?? null,
7468
- postmountDisplay: sequenceContext?.postmountDisplay ?? null,
7469
- loopDisplay: undefined,
7470
- controls: controls ?? null
7471
- });
7472
- if (hidden) {
7473
- return null;
7474
- }
7475
- return /* @__PURE__ */ jsx26(ImgContent, {
7476
- src,
7477
- ...props2
7469
+ hidden,
7470
+ children: /* @__PURE__ */ jsx26(ImgContent, {
7471
+ src,
7472
+ ...props2
7473
+ })
7478
7474
  });
7479
7475
  };
7480
7476
  var imgSchema = {
@@ -7496,7 +7492,7 @@ import {
7496
7492
  useImperativeHandle as useImperativeHandle7,
7497
7493
  useMemo as useMemo31,
7498
7494
  useRef as useRef22,
7499
- useState as useState18
7495
+ useState as useState17
7500
7496
  } from "react";
7501
7497
  import { jsx as jsx27 } from "react/jsx-runtime";
7502
7498
  var CompositionManagerProvider = ({
@@ -7506,9 +7502,9 @@ var CompositionManagerProvider = ({
7506
7502
  initialCompositions,
7507
7503
  initialCanvasContent
7508
7504
  }) => {
7509
- const [folders, setFolders] = useState18([]);
7510
- const [canvasContent, setCanvasContent] = useState18(initialCanvasContent);
7511
- const [compositions, setCompositions] = useState18(initialCompositions);
7505
+ const [folders, setFolders] = useState17([]);
7506
+ const [canvasContent, setCanvasContent] = useState17(initialCanvasContent);
7507
+ const [compositions, setCompositions] = useState17(initialCompositions);
7512
7508
  const currentcompositionsRef = useRef22(compositions);
7513
7509
  const updateCompositions = useCallback18((updateComps) => {
7514
7510
  setCompositions((comps) => {
@@ -8084,7 +8080,7 @@ import {
8084
8080
  useEffect as useEffect16,
8085
8081
  useLayoutEffect as useLayoutEffect11,
8086
8082
  useMemo as useMemo34,
8087
- useState as useState19
8083
+ useState as useState18
8088
8084
  } from "react";
8089
8085
 
8090
8086
  // src/video/offthread-video-source.ts
@@ -8199,7 +8195,7 @@ var OffthreadVideoForRendering = ({
8199
8195
  toneMapped
8200
8196
  });
8201
8197
  }, [toneMapped, currentTime, src, transparent]);
8202
- const [imageSrc, setImageSrc] = useState19(null);
8198
+ const [imageSrc, setImageSrc] = useState18(null);
8203
8199
  const { delayRender: delayRender2, continueRender: continueRender2 } = useDelayRender();
8204
8200
  useLayoutEffect11(() => {
8205
8201
  if (!window.remotion_videoEnabled) {
@@ -8310,7 +8306,7 @@ import React34, {
8310
8306
  useImperativeHandle as useImperativeHandle8,
8311
8307
  useMemo as useMemo35,
8312
8308
  useRef as useRef23,
8313
- useState as useState20,
8309
+ useState as useState19,
8314
8310
  useCallback as useCallback20
8315
8311
  } from "react";
8316
8312
 
@@ -8416,7 +8412,7 @@ var VideoForDevelopmentRefForwardingFunction = (props2, ref) => {
8416
8412
  const parentSequence = useContext35(SequenceContext);
8417
8413
  const logLevel = useLogLevel();
8418
8414
  const mountTime = useMountTime();
8419
- const [timelineId] = useState20(() => String(Math.random()));
8415
+ const [timelineId] = useState19(() => String(Math.random()));
8420
8416
  if (typeof acceptableTimeShift !== "undefined") {
8421
8417
  throw new Error("acceptableTimeShift has been removed. Use acceptableTimeShiftInSeconds instead.");
8422
8418
  }
@@ -8485,7 +8481,7 @@ var VideoForDevelopmentRefForwardingFunction = (props2, ref) => {
8485
8481
  useImperativeHandle8(ref, () => {
8486
8482
  return videoRef.current;
8487
8483
  }, []);
8488
- useState20(() => playbackLogging({
8484
+ useState19(() => playbackLogging({
8489
8485
  logLevel,
8490
8486
  message: `Mounting video with source = ${actualSrc}, v=${VERSION}, user agent=${typeof navigator === "undefined" ? "server" : navigator.userAgent}`,
8491
8487
  tag: "video",
@@ -1,5 +1,5 @@
1
1
  // src/version.ts
2
- var VERSION = "4.0.464";
2
+ var VERSION = "4.0.465";
3
3
  export {
4
4
  VERSION
5
5
  };
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "url": "https://github.com/remotion-dev/remotion/tree/main/packages/core"
4
4
  },
5
5
  "name": "remotion",
6
- "version": "4.0.464",
6
+ "version": "4.0.465",
7
7
  "description": "Make videos programmatically",
8
8
  "main": "dist/cjs/index.js",
9
9
  "types": "dist/cjs/index.d.ts",
@@ -35,7 +35,7 @@
35
35
  "react-dom": "19.2.3",
36
36
  "webpack": "5.105.0",
37
37
  "zod": "4.3.6",
38
- "@remotion/eslint-config-internal": "4.0.464",
38
+ "@remotion/eslint-config-internal": "4.0.465",
39
39
  "eslint": "9.19.0",
40
40
  "@typescript/native-preview": "7.0.0-dev.20260217.1"
41
41
  },