remotion 4.0.536 → 4.0.538

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 (172) hide show
  1. package/dist/cjs/AbsoluteFill.d.ts +62 -62
  2. package/dist/cjs/AbsoluteFill.js +3 -3
  3. package/dist/cjs/AbsoluteFillElement.d.ts +1 -1
  4. package/dist/cjs/AbsoluteFillElement.js +36 -3
  5. package/dist/cjs/CanUseRemotionHooks.js +1 -1
  6. package/dist/cjs/Composition.js +5 -11
  7. package/dist/cjs/CompositionErrorBoundary.js +5 -2
  8. package/dist/cjs/CompositionManager.d.ts +1 -0
  9. package/dist/cjs/CompositionManagerContext.d.ts +3 -0
  10. package/dist/cjs/CompositionManagerContext.js +5 -3
  11. package/dist/cjs/CompositionManagerProvider.d.ts +1 -1
  12. package/dist/cjs/CompositionManagerProvider.js +3 -1
  13. package/dist/cjs/CompositionRegistryProvider.d.ts +1 -1
  14. package/dist/cjs/CompositionRegistryProvider.js +1 -1
  15. package/dist/cjs/EditorProps.d.ts +2 -2
  16. package/dist/cjs/EditorProps.js +1 -1
  17. package/dist/cjs/Folder.js +1 -1
  18. package/dist/cjs/HtmlInCanvas.d.ts +58 -67
  19. package/dist/cjs/HtmlInCanvas.js +84 -20
  20. package/dist/cjs/HtmlInCanvasFallback.d.ts +6 -0
  21. package/dist/cjs/HtmlInCanvasFallback.js +39 -0
  22. package/dist/cjs/IFrame.d.ts +2 -2
  23. package/dist/cjs/IFrame.js +1 -1
  24. package/dist/cjs/Img.d.ts +62 -62
  25. package/dist/cjs/Img.js +160 -132
  26. package/dist/cjs/Interactive.d.ts +147 -145
  27. package/dist/cjs/Interactive.js +2 -2
  28. package/dist/cjs/RemotionRoot.js +1 -1
  29. package/dist/cjs/RenderAssetManager.js +1 -1
  30. package/dist/cjs/Sequence.js +37 -27
  31. package/dist/cjs/SequenceActivityBoundary.js +1 -1
  32. package/dist/cjs/SequenceActivityBudget.js +1 -1
  33. package/dist/cjs/SequenceActivitySuspensionProvider.js +1 -1
  34. package/dist/cjs/SequenceManager.d.ts +6 -0
  35. package/dist/cjs/SequenceManager.js +71 -27
  36. package/dist/cjs/SequenceRegistryProvider.js +16 -3
  37. package/dist/cjs/TimelineContext.js +1 -1
  38. package/dist/cjs/Track.js +2 -2
  39. package/dist/cjs/animated-image/AnimatedImage.d.ts +69 -69
  40. package/dist/cjs/animated-image/AnimatedImage.js +17 -12
  41. package/dist/cjs/animated-image/canvas.d.ts +6 -5
  42. package/dist/cjs/animated-image/canvas.js +1 -1
  43. package/dist/cjs/animated-image/create-image-decoder.d.ts +1 -1
  44. package/dist/cjs/animated-image/decode-image.d.ts +1 -1
  45. package/dist/cjs/animated-image/get-duration-in-seconds.d.ts +1 -1
  46. package/dist/cjs/animated-image/index.js +1 -1
  47. package/dist/cjs/audio/AudioForPreview.js +5 -28
  48. package/dist/cjs/audio/AudioForRendering.d.ts +5 -20
  49. package/dist/cjs/audio/AudioForRendering.js +44 -5
  50. package/dist/cjs/audio/html5-audio.d.ts +36 -36
  51. package/dist/cjs/audio/html5-audio.js +8 -10
  52. package/dist/cjs/audio/index.js +1 -1
  53. package/dist/cjs/audio/shared-audio-tags.js +10 -16
  54. package/dist/cjs/audio/shared-element-source-node.d.ts +1 -1
  55. package/dist/cjs/audio/use-audio-context.d.ts +2 -1
  56. package/dist/cjs/audio/wait-until-actually-resumed.d.ts +2 -1
  57. package/dist/cjs/buffer-until-first-frame.d.ts +4 -3
  58. package/dist/cjs/buffering.js +1 -1
  59. package/dist/cjs/cancel-render.js +3 -0
  60. package/dist/cjs/canvas-image/CanvasImage.d.ts +71 -71
  61. package/dist/cjs/canvas-image/CanvasImage.js +27 -24
  62. package/dist/cjs/canvas-image/index.js +1 -1
  63. package/dist/cjs/codec.d.ts +1 -1
  64. package/dist/cjs/committed-metadata.d.ts +4 -2
  65. package/dist/cjs/composition-registry-fallback.d.ts +4 -2
  66. package/dist/cjs/composition-registry-fallback.js +12 -10
  67. package/dist/cjs/create-element-source-proxy.js +46 -6
  68. package/dist/cjs/default-css.d.ts +1 -1
  69. package/dist/cjs/delay-render.d.ts +2 -1
  70. package/dist/cjs/delay-render.js +4 -2
  71. package/dist/cjs/easing.js +3 -1
  72. package/dist/cjs/effects/Solid.d.ts +60 -60
  73. package/dist/cjs/effects/Solid.js +2 -2
  74. package/dist/cjs/effects/canvas-pool.js +6 -9
  75. package/dist/cjs/effects/index.js +1 -1
  76. package/dist/cjs/effects/use-memoized-effects.d.ts +2 -1
  77. package/dist/cjs/effects/use-memoized-effects.js +107 -54
  78. package/dist/cjs/freeze.js +2 -2
  79. package/dist/cjs/get-cross-origin-value.d.ts +1 -1
  80. package/dist/cjs/get-effective-visual-mode-value.d.ts +2 -2
  81. package/dist/cjs/index.d.ts +3 -1
  82. package/dist/cjs/index.js +32 -32
  83. package/dist/cjs/interactivity-schema.d.ts +286 -286
  84. package/dist/cjs/internals.d.ts +411 -595
  85. package/dist/cjs/internals.js +8 -0
  86. package/dist/cjs/interpolate-colors.d.ts +1 -1
  87. package/dist/cjs/interpolate-colors.js +17 -16
  88. package/dist/cjs/interpolate.d.ts +2 -9
  89. package/dist/cjs/is-player.js +1 -1
  90. package/dist/cjs/loading-indicator.js +2 -6
  91. package/dist/cjs/log-level-context.d.ts +1 -1
  92. package/dist/cjs/log.d.ts +12 -7
  93. package/dist/cjs/loop/index.js +1 -1
  94. package/dist/cjs/media-resource-manager.d.ts +1 -1
  95. package/dist/cjs/media-tag-current-time-timestamp.d.ts +1 -1
  96. package/dist/cjs/no-react.d.ts +85 -91
  97. package/dist/cjs/no-react.js +2 -2
  98. package/dist/cjs/play-and-handle-not-allowed-error.d.ts +5 -4
  99. package/dist/cjs/playback-logging.d.ts +2 -1
  100. package/dist/cjs/playback-pitch-context.d.ts +1 -0
  101. package/dist/cjs/playback-pitch-context.js +5 -0
  102. package/dist/cjs/prefetch-state.js +1 -1
  103. package/dist/cjs/prefetch.d.ts +7 -6
  104. package/dist/cjs/props-if-has-props.d.ts +2 -1
  105. package/dist/cjs/prores-profile.d.ts +1 -1
  106. package/dist/cjs/register-root.d.ts +2 -2
  107. package/dist/cjs/render-resource-manager.d.ts +1 -1
  108. package/dist/cjs/render-types.d.ts +2 -2
  109. package/dist/cjs/resolve-video-config.d.ts +8 -8
  110. package/dist/cjs/runtime-value-store.d.ts +1 -1
  111. package/dist/cjs/scale-value.d.ts +1 -1
  112. package/dist/cjs/seek.d.ts +3 -2
  113. package/dist/cjs/sequence-activity-context.js +1 -1
  114. package/dist/cjs/sequence-crop.js +1 -4
  115. package/dist/cjs/series/flatten-children.d.ts +3 -1
  116. package/dist/cjs/series/index.js +4 -5
  117. package/dist/cjs/series/is-inside-series.js +2 -2
  118. package/dist/cjs/spring/index.d.ts +1 -1
  119. package/dist/cjs/spring/index.js +1 -1
  120. package/dist/cjs/spring/measure-spring.d.ts +1 -1
  121. package/dist/cjs/spring/spring-utils.d.ts +1 -1
  122. package/dist/cjs/spring/spring-utils.js +11 -5
  123. package/dist/cjs/timeline-position-state.d.ts +2 -1
  124. package/dist/cjs/timeline-position-state.js +23 -3
  125. package/dist/cjs/use-amplification.d.ts +4 -7
  126. package/dist/cjs/use-current-frame.d.ts +1 -0
  127. package/dist/cjs/use-current-frame.js +14 -7
  128. package/dist/cjs/use-current-scale.d.ts +2 -2
  129. package/dist/cjs/use-delay-render.d.ts +2 -1
  130. package/dist/cjs/use-lazy-component.d.ts +1 -1
  131. package/dist/cjs/use-lazy-component.js +15 -5
  132. package/dist/cjs/use-media-buffering.d.ts +3 -2
  133. package/dist/cjs/use-media-duration.d.ts +4 -0
  134. package/dist/cjs/use-media-duration.js +36 -0
  135. package/dist/cjs/use-media-enabled.d.ts +1 -1
  136. package/dist/cjs/use-media-enabled.js +1 -1
  137. package/dist/cjs/use-media-in-timeline.d.ts +1 -1
  138. package/dist/cjs/use-media-playback.d.ts +3 -3
  139. package/dist/cjs/use-media-tag.d.ts +2 -2
  140. package/dist/cjs/use-pixel-density.d.ts +1 -1
  141. package/dist/cjs/use-premounting.d.ts +1 -1
  142. package/dist/cjs/use-premounting.js +6 -2
  143. package/dist/cjs/use-request-video-callback-time.d.ts +3 -3
  144. package/dist/cjs/use-schema.d.ts +4 -4
  145. package/dist/cjs/use-video.js +1 -1
  146. package/dist/cjs/validate-media-props.d.ts +1 -1
  147. package/dist/cjs/validation/validate-default-props.d.ts +1 -1
  148. package/dist/cjs/validation/validate-duration-in-frames.js +3 -3
  149. package/dist/cjs/version.d.ts +1 -1
  150. package/dist/cjs/version.js +1 -1
  151. package/dist/cjs/video/MediaPlaybackError.js +0 -1
  152. package/dist/cjs/video/OffthreadVideo.js +5 -5
  153. package/dist/cjs/video/OffthreadVideoForRendering.js +9 -7
  154. package/dist/cjs/video/VideoForPreview.js +6 -28
  155. package/dist/cjs/video/VideoForRendering.d.ts +5 -3
  156. package/dist/cjs/video/VideoForRendering.js +4 -2
  157. package/dist/cjs/video/duration-state.d.ts +1 -0
  158. package/dist/cjs/video/duration-state.js +8 -2
  159. package/dist/cjs/video/emit-video-frame.d.ts +1 -1
  160. package/dist/cjs/video/html5-video.d.ts +36 -36
  161. package/dist/cjs/video/html5-video.js +8 -10
  162. package/dist/cjs/video/index.js +2 -2
  163. package/dist/cjs/video/seek-until-right.d.ts +3 -2
  164. package/dist/cjs/warn-about-non-seekable-media.d.ts +1 -1
  165. package/dist/cjs/with-interactivity-schema.d.ts +1 -1
  166. package/dist/cjs/with-interactivity-schema.js +15 -18
  167. package/dist/cjs/wrap-remotion-context.d.ts +4 -4
  168. package/dist/cjs/wrap-remotion-context.js +2 -2
  169. package/dist/esm/index.mjs +1060 -728
  170. package/dist/esm/no-react.mjs +30 -25
  171. package/dist/esm/version.mjs +1 -1
  172. package/package.json +4 -4
@@ -2,52 +2,52 @@ import type { EffectsProp, EffectsOutputSize } from '../effects/effect-types.js'
2
2
  import type { CanvasImageCanvasProps } from './props.js';
3
3
  export declare const canvasImageSchema: {
4
4
  readonly 'style.transformOrigin': {
5
- readonly type: "transform-origin";
5
+ readonly type: 'transform-origin';
6
6
  readonly step: 1;
7
- readonly default: "50% 50%";
8
- readonly description: "Transform origin";
7
+ readonly default: '50% 50%';
8
+ readonly description: 'Transform origin';
9
9
  };
10
10
  readonly 'style.translate': {
11
- readonly type: "translate";
11
+ readonly type: 'translate';
12
12
  readonly step: 1;
13
- readonly default: "0px 0px";
14
- readonly description: "Offset";
13
+ readonly default: '0px 0px';
14
+ readonly description: 'Offset';
15
15
  };
16
16
  readonly 'style.scale': {
17
- readonly type: "scale";
17
+ readonly type: 'scale';
18
18
  readonly max: 100;
19
19
  readonly step: 0.01;
20
20
  readonly default: 1;
21
- readonly description: "Scale";
22
- readonly defaultKeyframeOutput: "perceptual-scale";
21
+ readonly description: 'Scale';
22
+ readonly defaultKeyframeOutput: 'perceptual-scale';
23
23
  };
24
24
  readonly 'style.rotate': {
25
- readonly type: "rotation-css";
25
+ readonly type: 'rotation-css';
26
26
  readonly step: 1;
27
- readonly default: "0deg";
28
- readonly description: "Rotation";
27
+ readonly default: '0deg';
28
+ readonly description: 'Rotation';
29
29
  };
30
30
  readonly 'style.opacity': {
31
- readonly type: "number";
31
+ readonly type: 'number';
32
32
  readonly min: 0;
33
33
  readonly max: 1;
34
34
  readonly step: 0.01;
35
35
  readonly default: 1;
36
- readonly description: "Opacity";
36
+ readonly description: 'Opacity';
37
37
  readonly hiddenFromList: false;
38
38
  };
39
39
  readonly 'style.borderWidth': {
40
- readonly type: "number";
40
+ readonly type: 'number';
41
41
  readonly default: undefined;
42
42
  readonly min: 0;
43
43
  readonly step: 1;
44
- readonly description: "Border width";
44
+ readonly description: 'Border width';
45
45
  readonly hiddenFromList: false;
46
46
  };
47
47
  readonly 'style.borderStyle': {
48
- readonly type: "enum";
49
- readonly default: "none";
50
- readonly description: "Border style";
48
+ readonly type: 'enum';
49
+ readonly default: 'none';
50
+ readonly description: 'Border style';
51
51
  readonly variants: {
52
52
  readonly none: {};
53
53
  readonly hidden: {};
@@ -62,67 +62,67 @@ export declare const canvasImageSchema: {
62
62
  };
63
63
  };
64
64
  readonly 'style.borderColor': {
65
- readonly type: "color";
65
+ readonly type: 'color';
66
66
  readonly default: undefined;
67
- readonly description: "Border color";
67
+ readonly description: 'Border color';
68
68
  };
69
69
  readonly 'style.borderRadius': {
70
- readonly type: "number";
70
+ readonly type: 'number';
71
71
  readonly default: 0;
72
72
  readonly min: 0;
73
73
  readonly step: 1;
74
- readonly description: "Border radius";
74
+ readonly description: 'Border radius';
75
75
  readonly hiddenFromList: false;
76
76
  readonly keyframable: true;
77
77
  };
78
78
  readonly 'style.borderTopLeftRadius': {
79
- readonly type: "number";
79
+ readonly type: 'number';
80
80
  readonly default: 0;
81
81
  readonly min: 0;
82
82
  readonly step: 1;
83
- readonly description: "Top left radius";
83
+ readonly description: 'Top left radius';
84
84
  readonly hiddenFromList: false;
85
85
  };
86
86
  readonly 'style.borderTopRightRadius': {
87
- readonly type: "number";
87
+ readonly type: 'number';
88
88
  readonly default: 0;
89
89
  readonly min: 0;
90
90
  readonly step: 1;
91
- readonly description: "Top right radius";
91
+ readonly description: 'Top right radius';
92
92
  readonly hiddenFromList: false;
93
93
  };
94
94
  readonly 'style.borderBottomRightRadius': {
95
- readonly type: "number";
95
+ readonly type: 'number';
96
96
  readonly default: 0;
97
97
  readonly min: 0;
98
98
  readonly step: 1;
99
- readonly description: "Bottom right radius";
99
+ readonly description: 'Bottom right radius';
100
100
  readonly hiddenFromList: false;
101
101
  };
102
102
  readonly 'style.borderBottomLeftRadius': {
103
- readonly type: "number";
103
+ readonly type: 'number';
104
104
  readonly default: 0;
105
105
  readonly min: 0;
106
106
  readonly step: 1;
107
- readonly description: "Bottom left radius";
107
+ readonly description: 'Bottom left radius';
108
108
  readonly hiddenFromList: false;
109
109
  };
110
110
  readonly 'style.backgroundColor': {
111
- readonly type: "color";
112
- readonly default: "transparent";
113
- readonly description: "Color";
111
+ readonly type: 'color';
112
+ readonly default: 'transparent';
113
+ readonly description: 'Color';
114
114
  };
115
115
  readonly premountFor: {
116
- readonly type: "number";
116
+ readonly type: 'number';
117
117
  readonly default: undefined;
118
- readonly description: "Premount For";
118
+ readonly description: 'Premount For';
119
119
  readonly min: 0;
120
120
  readonly step: 1;
121
121
  readonly hiddenFromList: false;
122
122
  readonly keyframable: false;
123
123
  };
124
124
  readonly postmountFor: {
125
- readonly type: "number";
125
+ readonly type: 'number';
126
126
  readonly default: 0;
127
127
  readonly min: 0;
128
128
  readonly step: 1;
@@ -130,9 +130,9 @@ export declare const canvasImageSchema: {
130
130
  readonly keyframable: false;
131
131
  };
132
132
  readonly cropLeft: {
133
- readonly type: "number";
133
+ readonly type: 'number';
134
134
  readonly default: 0;
135
- readonly description: "Crop left";
135
+ readonly description: 'Crop left';
136
136
  readonly min: 0;
137
137
  readonly max: 1;
138
138
  readonly step: 0.01;
@@ -140,9 +140,9 @@ export declare const canvasImageSchema: {
140
140
  readonly keyframable: true;
141
141
  };
142
142
  readonly cropRight: {
143
- readonly type: "number";
143
+ readonly type: 'number';
144
144
  readonly default: 0;
145
- readonly description: "Crop right";
145
+ readonly description: 'Crop right';
146
146
  readonly min: 0;
147
147
  readonly max: 1;
148
148
  readonly step: 0.01;
@@ -150,9 +150,9 @@ export declare const canvasImageSchema: {
150
150
  readonly keyframable: true;
151
151
  };
152
152
  readonly cropTop: {
153
- readonly type: "number";
153
+ readonly type: 'number';
154
154
  readonly default: 0;
155
- readonly description: "Crop top";
155
+ readonly description: 'Crop top';
156
156
  readonly min: 0;
157
157
  readonly max: 1;
158
158
  readonly step: 0.01;
@@ -160,9 +160,9 @@ export declare const canvasImageSchema: {
160
160
  readonly keyframable: true;
161
161
  };
162
162
  readonly cropBottom: {
163
- readonly type: "number";
163
+ readonly type: 'number';
164
164
  readonly default: 0;
165
- readonly description: "Crop bottom";
165
+ readonly description: 'Crop bottom';
166
166
  readonly min: 0;
167
167
  readonly max: 1;
168
168
  readonly step: 0.01;
@@ -170,27 +170,27 @@ export declare const canvasImageSchema: {
170
170
  readonly keyframable: true;
171
171
  };
172
172
  readonly durationInFrames: {
173
- readonly type: "number";
173
+ readonly type: 'number';
174
174
  readonly default: undefined;
175
175
  readonly min: 1;
176
176
  readonly step: 1;
177
177
  readonly hiddenFromList: true;
178
178
  };
179
179
  readonly from: {
180
- readonly type: "number";
180
+ readonly type: 'number';
181
181
  readonly default: 0;
182
182
  readonly step: 1;
183
183
  readonly hiddenFromList: true;
184
184
  };
185
185
  readonly trimBefore: {
186
- readonly type: "number";
186
+ readonly type: 'number';
187
187
  readonly default: 0;
188
188
  readonly min: 0;
189
189
  readonly step: 1;
190
190
  readonly hiddenFromList: true;
191
191
  };
192
192
  readonly freeze: {
193
- readonly type: "number";
193
+ readonly type: 'number';
194
194
  readonly default: null;
195
195
  readonly step: 1;
196
196
  readonly hiddenFromList: true;
@@ -199,16 +199,16 @@ export declare const canvasImageSchema: {
199
199
  readonly name: import("../interactivity-schema.js").HiddenFieldSchema;
200
200
  readonly showInTimeline: import("../interactivity-schema.js").HiddenFieldSchema;
201
201
  readonly src: {
202
- readonly type: "asset";
203
- readonly assetType: "image";
202
+ readonly type: 'asset';
203
+ readonly assetType: 'image';
204
204
  readonly default: undefined;
205
- readonly description: "Source";
205
+ readonly description: 'Source';
206
206
  readonly keyframable: false;
207
207
  };
208
208
  readonly fit: {
209
- readonly type: "enum";
210
- readonly default: "fill";
211
- readonly description: "Fit";
209
+ readonly type: 'enum';
210
+ readonly default: 'fill';
211
+ readonly description: 'Fit';
212
212
  readonly variants: {
213
213
  readonly fill: {};
214
214
  readonly contain: {};
@@ -218,20 +218,20 @@ export declare const canvasImageSchema: {
218
218
  };
219
219
  export declare const CanvasImage: import("react").ComponentType<Omit<import("../Interactive.js").InteractiveBaseProps, "playbackRate"> & import("../Interactive.js").InteractiveCropProps & import("../Interactive.js").InteractivePremountProps & CanvasImageCanvasProps & {
220
220
  readonly src: string;
221
- readonly crossOrigin?: "" | "anonymous" | "use-credentials" | undefined;
222
- readonly width?: number | undefined;
223
- readonly height?: number | undefined;
224
- readonly fit?: import("../calculate-image-fit.js").ImageFit | undefined;
225
- readonly effects?: EffectsProp | undefined;
226
- readonly effectsOutputSize?: EffectsOutputSize | undefined;
227
- readonly className?: string | undefined;
228
- readonly style?: import("react").CSSProperties | undefined;
229
- readonly id?: string | undefined;
230
- readonly onError?: ((error: Error) => void) | undefined;
231
- readonly pauseWhenLoading?: boolean | undefined;
232
- readonly maxRetries?: number | undefined;
233
- readonly delayRenderRetries?: number | undefined;
234
- readonly delayRenderTimeoutInMilliseconds?: number | undefined;
235
- readonly _remotionInternalDocumentationLink?: string | undefined;
236
- readonly _remotionInternalCropComponentName?: string | undefined;
221
+ readonly crossOrigin?: React.ImgHTMLAttributes<HTMLImageElement>['crossOrigin'];
222
+ readonly width?: number;
223
+ readonly height?: number;
224
+ readonly fit?: import("../calculate-image-fit.js").ImageFit;
225
+ readonly effects?: EffectsProp;
226
+ readonly effectsOutputSize?: EffectsOutputSize;
227
+ readonly className?: string;
228
+ readonly style?: React.CSSProperties;
229
+ readonly id?: string;
230
+ readonly onError?: (error: Error) => void;
231
+ readonly pauseWhenLoading?: boolean;
232
+ readonly maxRetries?: number;
233
+ readonly delayRenderRetries?: number;
234
+ readonly delayRenderTimeoutInMilliseconds?: number;
235
+ readonly _remotionInternalDocumentationLink?: string;
236
+ readonly _remotionInternalCropComponentName?: string;
237
237
  } & import("react").RefAttributes<HTMLCanvasElement>>;
@@ -47,6 +47,27 @@ exports.canvasImageSchema = {
47
47
  ...interactivity_schema_js_1.borderSchema,
48
48
  ...interactivity_schema_js_1.borderRadiusSchema,
49
49
  };
50
+ const continueImageLoadDelay = (pendingLoadDelayRef, setIsLoadPending, continueRender, { markAsReady }) => {
51
+ const pending = pendingLoadDelayRef.current;
52
+ if (!pending || pending.continued) {
53
+ return;
54
+ }
55
+ pending.continued = true;
56
+ if (markAsReady) {
57
+ setIsLoadPending(false);
58
+ }
59
+ continueRender(pending.handle);
60
+ pendingLoadDelayRef.current = null;
61
+ };
62
+ const setCanvasRef = (setOutputCanvas, ref, canvas) => {
63
+ setOutputCanvas(canvas);
64
+ if (typeof ref === 'function') {
65
+ ref(canvas);
66
+ }
67
+ else if (ref) {
68
+ ref.current = canvas;
69
+ }
70
+ };
50
71
  const makeAbortError = () => {
51
72
  if (typeof DOMException !== 'undefined') {
52
73
  return new DOMException('Image loading was aborted', 'AbortError');
@@ -96,7 +117,7 @@ const loadImage = ({ src, signal, crossOrigin, }) => {
96
117
  onAbort();
97
118
  return;
98
119
  }
99
- image.crossOrigin = crossOrigin !== null && crossOrigin !== void 0 ? crossOrigin : 'anonymous';
120
+ image.crossOrigin = crossOrigin || 'anonymous';
100
121
  image.src = src;
101
122
  });
102
123
  };
@@ -129,33 +150,15 @@ const CanvasImageContent = (0, react_1.forwardRef)(({ src, crossOrigin, width, h
129
150
  const [isLoadPending, setIsLoadPending] = (0, react_1.useState)(false);
130
151
  const isPremounting = Boolean(sequenceContext === null || sequenceContext === void 0 ? void 0 : sequenceContext.premounting);
131
152
  const isPostmounting = Boolean(sequenceContext === null || sequenceContext === void 0 ? void 0 : sequenceContext.postmounting);
132
- const continuePendingLoadDelay = (0, react_1.useCallback)(({ markAsReady }) => {
133
- const pending = pendingLoadDelayRef.current;
134
- if (!pending || pending.continued) {
135
- return;
136
- }
137
- pending.continued = true;
138
- if (markAsReady) {
139
- setIsLoadPending(false);
140
- }
141
- continueRender(pending.handle);
142
- pendingLoadDelayRef.current = null;
143
- }, [continueRender]);
153
+ // Bound callbacks keep only these inputs, including after minification.
154
+ const continuePendingLoadDelay = (0, react_1.useMemo)(() => continueImageLoadDelay.bind(null, pendingLoadDelayRef, setIsLoadPending, continueRender), [continueRender]);
144
155
  const sourceCanvas = (0, react_1.useMemo)(() => {
145
156
  if (typeof document === 'undefined') {
146
157
  return null;
147
158
  }
148
159
  return document.createElement('canvas');
149
160
  }, []);
150
- const canvasRef = (0, react_1.useCallback)((canvas) => {
151
- setOutputCanvas(canvas);
152
- if (typeof ref === 'function') {
153
- ref(canvas);
154
- }
155
- else if (ref) {
156
- ref.current = canvas;
157
- }
158
- }, [ref]);
161
+ const canvasRef = (0, react_1.useMemo)(() => setCanvasRef.bind(null, setOutputCanvas, ref), [ref]);
159
162
  (0, react_1.useLayoutEffect)(() => {
160
163
  if (!pauseWhenLoading ||
161
164
  !isLoadPending ||
@@ -327,7 +330,7 @@ const CanvasImageContent = (0, react_1.forwardRef)(({ src, crossOrigin, width, h
327
330
  sourceCanvas,
328
331
  width,
329
332
  ]);
330
- return (jsx_runtime_1.jsx("canvas", { ...canvasProps, ref: canvasRef, width: width, height: height, className: className, style: style, id: id }));
333
+ return ((0, jsx_runtime_1.jsx)("canvas", { ...canvasProps, ref: canvasRef, width: width, height: height, className: className, style: style, id: id }));
331
334
  });
332
335
  CanvasImageContent.displayName = 'CanvasImageContent';
333
336
  const CanvasImageInner = (0, react_1.forwardRef)(({ src, crossOrigin, width, height, fit, effects = [], effectsOutputSize, className, style, id, onError, pauseWhenLoading, maxRetries, delayRenderRetries, delayRenderTimeoutInMilliseconds, durationInFrames, from, trimBefore, loop, freeze, premountFor, postmountFor, styleWhilePremounted, styleWhilePostmounted, hidden, name, showInTimeline, cropLeft, cropRight, cropTop, cropBottom, controls, _remotionInternalDocumentationLink, _remotionInternalCropComponentName, ...canvasProps }, ref) => {
@@ -365,7 +368,7 @@ const CanvasImageInner = (0, react_1.forwardRef)(({ src, crossOrigin, width, hei
365
368
  style: premountingStyle,
366
369
  componentName: _remotionInternalCropComponentName !== null && _remotionInternalCropComponentName !== void 0 ? _remotionInternalCropComponentName : '<CanvasImage />',
367
370
  });
368
- return (jsx_runtime_1.jsx(freeze_js_1.Freeze, { frame: freezeFrame, active: isPremountingOrPostmounting, _remotionInternalIsPremounting: premountingActive, children: jsx_runtime_1.jsx(Sequence_js_1.Sequence, { layout: "none", from: from !== null && from !== void 0 ? from : 0, trimBefore: trimBefore, loop: loop, durationInFrames: durationInFrames, freeze: freeze, hidden: hidden, showInTimeline: showInTimeline !== null && showInTimeline !== void 0 ? showInTimeline : true, name: name !== null && name !== void 0 ? name : '<CanvasImage>', _remotionInternalDocumentationLink: _remotionInternalDocumentationLink !== null && _remotionInternalDocumentationLink !== void 0 ? _remotionInternalDocumentationLink : 'https://www.remotion.dev/docs/canvasimage', controls: controls, _remotionInternalEffects: memoizedEffectDefinitions, _remotionInternalIsMedia: isMedia, _remotionInternalPremountDisplay: effectivePremountFor || null, _remotionInternalPostmountDisplay: effectivePostmountFor || null, _remotionInternalIsPremounting: premountingActive, _remotionInternalIsPostmounting: postmountingActive, children: jsx_runtime_1.jsx(sequence_activity_context_js_1.SequenceContent, { children: jsx_runtime_1.jsx(CanvasImageContent, { ref: actualRef, src: src, crossOrigin: crossOrigin, width: width, height: height, fit: fit, effects: effects, effectsOutputSize: effectsOutputSize !== null && effectsOutputSize !== void 0 ? effectsOutputSize : null, controls: controls, className: className, style: croppedStyle !== null && croppedStyle !== void 0 ? croppedStyle : undefined, id: id, onError: onError, pauseWhenLoading: pauseWhenLoading, maxRetries: maxRetries, delayRenderRetries: delayRenderRetries, delayRenderTimeoutInMilliseconds: delayRenderTimeoutInMilliseconds, ...canvasProps }) }) }) }));
371
+ return ((0, jsx_runtime_1.jsx)(freeze_js_1.Freeze, { frame: freezeFrame, active: isPremountingOrPostmounting, _remotionInternalIsPremounting: premountingActive, children: (0, jsx_runtime_1.jsx)(Sequence_js_1.Sequence, { layout: "none", from: from !== null && from !== void 0 ? from : 0, trimBefore: trimBefore, loop: loop, durationInFrames: durationInFrames, freeze: freeze, hidden: hidden, showInTimeline: showInTimeline !== null && showInTimeline !== void 0 ? showInTimeline : true, name: name !== null && name !== void 0 ? name : '<CanvasImage>', _remotionInternalDocumentationLink: _remotionInternalDocumentationLink !== null && _remotionInternalDocumentationLink !== void 0 ? _remotionInternalDocumentationLink : 'https://www.remotion.dev/docs/canvasimage', controls: controls, _remotionInternalEffects: memoizedEffectDefinitions, _remotionInternalIsMedia: isMedia, _remotionInternalPremountDisplay: effectivePremountFor || null, _remotionInternalPostmountDisplay: effectivePostmountFor || null, _remotionInternalIsPremounting: premountingActive, _remotionInternalIsPostmounting: postmountingActive, children: (0, jsx_runtime_1.jsx)(sequence_activity_context_js_1.SequenceContent, { children: (0, jsx_runtime_1.jsx)(CanvasImageContent, { ref: actualRef, src: src, crossOrigin: crossOrigin, width: width, height: height, fit: fit, effects: effects, effectsOutputSize: effectsOutputSize !== null && effectsOutputSize !== void 0 ? effectsOutputSize : null, controls: controls, className: className, style: croppedStyle !== null && croppedStyle !== void 0 ? croppedStyle : undefined, id: id, onError: onError, pauseWhenLoading: pauseWhenLoading, maxRetries: maxRetries, delayRenderRetries: delayRenderRetries, delayRenderTimeoutInMilliseconds: delayRenderTimeoutInMilliseconds, ...canvasProps }) }) }) }));
369
372
  });
370
373
  /*
371
374
  * @description Renders a static image to a `<canvas>` and applies Remotion effects.
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.CanvasImage = void 0;
4
- const CanvasImage_js_1 = require("./CanvasImage.js");
4
+ var CanvasImage_js_1 = require("./CanvasImage.js");
5
5
  Object.defineProperty(exports, "CanvasImage", { enumerable: true, get: function () { return CanvasImage_js_1.CanvasImage; } });
@@ -1,4 +1,4 @@
1
- export declare const validCodecs: readonly ["h264", "h265", "vp8", "vp9", "av1", "mp3", "aac", "wav", "prores", "h264-mkv", "h264-ts", "gif"];
1
+ export declare const validCodecs: readonly ['h264', 'h265', 'vp8', 'vp9', 'av1', 'mp3', 'aac', 'wav', 'prores', 'h264-mkv', 'h264-ts', 'gif'];
2
2
  export type Codec = (typeof validCodecs)[number];
3
3
  export type CodecOrUndefined = Codec | undefined;
4
4
  export declare const DEFAULT_CODEC: Codec;
@@ -1,6 +1,7 @@
1
1
  import type { Provider, ProviderExoticComponent, ProviderProps, RefObject } from 'react';
2
2
  import type { AnyComposition, TSequence } from './CompositionManager.js';
3
3
  import type { TFolder } from './Folder.js';
4
+ declare const COMMITTED_METADATA_PROP = "_remotionCommitMetadata";
4
5
  export declare const COMMIT_ORDER_EVENT = "remotion:commit-order";
5
6
  export declare const COMMIT_REGISTRATION_ERROR_EVENT = "remotion:commit-registration-error";
6
7
  export declare const isCommitRegistrationObserverInstalled: () => boolean;
@@ -54,15 +55,16 @@ export type CommittedMetadata = {
54
55
  readonly onCommit: ((snapshot: CommittedCompositionSnapshot) => void) | null;
55
56
  };
56
57
  export declare const withCommittedMetadata: <T>(provider: Provider<T>) => ProviderExoticComponent<ProviderProps<T> & {
57
- readonly _remotionCommitMetadata: CommittedMetadata | null;
58
+ readonly [COMMITTED_METADATA_PROP]: CommittedMetadata | null;
58
59
  }>;
59
60
  export declare const CommittedMetadataProvider: ProviderExoticComponent<ProviderProps<null> & {
60
61
  readonly _remotionCommitMetadata: CommittedMetadata | null;
61
62
  }>;
62
63
  export declare const CommittedMetadataInternals: {
63
- metadataProp: "_remotionCommitMetadata";
64
+ metadataProp: typeof COMMITTED_METADATA_PROP;
64
65
  eventName: string;
65
66
  installationMarker: symbol;
66
67
  failureMarker: symbol;
67
68
  registrationErrorEventName: string;
68
69
  };
70
+ export {};
@@ -7,8 +7,10 @@ export type CommittedCompositionEntry = {
7
7
  readonly type: 'folder';
8
8
  readonly value: TFolder;
9
9
  };
10
- export declare const CompositionRegistryFallbackContext: import("react").Context<{
10
+ type CompositionRegistryFallback = {
11
11
  readonly entries: Map<object, CommittedCompositionEntry>;
12
12
  readonly notifyCommit: () => void;
13
- } | null>;
13
+ };
14
+ export declare const CompositionRegistryFallbackContext: import("react").Context<CompositionRegistryFallback | null>;
14
15
  export declare const useCommittedCompositionEntry: (entry: CommittedCompositionEntry | null) => void;
16
+ export {};
@@ -4,6 +4,15 @@ exports.useCommittedCompositionEntry = exports.CompositionRegistryFallbackContex
4
4
  const react_1 = require("react");
5
5
  exports.CompositionRegistryFallbackContext = (0, react_1.createContext)(null);
6
6
  const useIsomorphicLayoutEffect = typeof window === 'undefined' ? react_1.useEffect : react_1.useLayoutEffect;
7
+ const createEntryCleanup = (registry, identity) => {
8
+ if (registry === null) {
9
+ return;
10
+ }
11
+ return () => {
12
+ registry.entries.delete(identity);
13
+ registry.notifyCommit();
14
+ };
15
+ };
7
16
  // The fallback stages descriptors during layout effects and publishes one
8
17
  // complete snapshot after the commit, including mount and unmount changes.
9
18
  const useCommittedCompositionEntry = (entry) => {
@@ -21,15 +30,8 @@ const useCommittedCompositionEntry = (entry) => {
21
30
  }
22
31
  registry.notifyCommit();
23
32
  }, [entry, registry]);
24
- useIsomorphicLayoutEffect(() => {
25
- if (registry === null) {
26
- return;
27
- }
28
- const identity = key.current;
29
- return () => {
30
- registry.entries.delete(identity);
31
- registry.notifyCommit();
32
- };
33
- }, [registry]);
33
+ // The cleanup outlives entry changes. Binding a separate factory prevents it
34
+ // from sharing a closure with the original entry, even after minification.
35
+ useIsomorphicLayoutEffect(createEntryCleanup.bind(null, registry, key.current), [registry]);
34
36
  };
35
37
  exports.useCommittedCompositionEntry = useCommittedCompositionEntry;
@@ -7,6 +7,7 @@ const internalStackProp = enable_sequence_stack_traces_js_1.REMOTION_INTERNAL_ST
7
7
  const createElementSourceProxy = (api, sourceArgumentIndex, getSourceFileName) => {
8
8
  return new Proxy(api, {
9
9
  apply(target, thisArg, argArray) {
10
+ var _a;
10
11
  const component = argArray[0];
11
12
  if (componentsToAddStacksTo.includes(component)) {
12
13
  const [first, props, ...rest] = argArray;
@@ -18,19 +19,58 @@ const createElementSourceProxy = (api, sourceArgumentIndex, getSourceFileName) =
18
19
  (props === null || props === void 0 ? void 0 : props.controls)
19
20
  ? (0, enable_sequence_stack_traces_js_1.getStackForControls)(props.controls)
20
21
  : null;
21
- const stack = existingStack ||
22
- (controlsStack !== null && controlsStack !== void 0 ? controlsStack : (source &&
22
+ let stack = existingStack || controlsStack;
23
+ if (!stack) {
24
+ if (source &&
23
25
  typeof source.fileName === 'string' &&
24
26
  typeof source.lineNumber === 'number' &&
25
- typeof source.columnNumber === 'number'
26
- ? (0, enable_sequence_stack_traces_js_1.makeOriginalSourceStack)({
27
+ typeof source.columnNumber === 'number') {
28
+ stack = (0, enable_sequence_stack_traces_js_1.makeOriginalSourceStack)({
27
29
  fileName: getSourceFileName(source.fileName),
28
30
  lineNumber: source.lineNumber,
29
31
  // JSX development locations are one-based, like stack traces.
30
32
  // Resolved source locations and AST lookups use zero-based columns.
31
33
  columnNumber: source.columnNumber - 1,
32
- })
33
- : new Error().stack));
34
+ });
35
+ }
36
+ else {
37
+ // Avoid collecting the full Studio error stack just to discard it.
38
+ // Restore the limit before formatting, which can invoke user code.
39
+ const { stackTraceLimit } = Error;
40
+ const canLimitStack = typeof stackTraceLimit === 'number' &&
41
+ stackTraceLimit > 2 &&
42
+ ((_a = Object.getOwnPropertyDescriptor(Error, 'stackTraceLimit')) === null || _a === void 0 ? void 0 : _a.writable);
43
+ let capturedError;
44
+ try {
45
+ if (canLimitStack) {
46
+ Error.stackTraceLimit = 2;
47
+ }
48
+ capturedError = new Error();
49
+ }
50
+ finally {
51
+ if (canLimitStack) {
52
+ Error.stackTraceLimit = stackTraceLimit;
53
+ }
54
+ }
55
+ const capturedStack = capturedError.stack;
56
+ // Keep the proxy and JSX call site, including its generated URL for
57
+ // Fast Refresh. Later React scheduler frames vary between renders.
58
+ // V8 adds an Error header; Firefox and Safari start with a frame.
59
+ if (capturedStack) {
60
+ const firstFrameEnd = capturedStack.indexOf('\n', capturedStack.startsWith('Error\n') ? 6 : 0);
61
+ const callerEnd = firstFrameEnd === -1
62
+ ? -1
63
+ : capturedStack.indexOf('\n', firstFrameEnd + 1);
64
+ stack =
65
+ callerEnd === -1
66
+ ? capturedStack
67
+ : capturedStack.slice(0, callerEnd);
68
+ }
69
+ else {
70
+ stack = capturedStack;
71
+ }
72
+ }
73
+ }
34
74
  const newProps = existingStack
35
75
  ? { ...props }
36
76
  : {
@@ -1,3 +1,3 @@
1
- export declare const injectCSS: (css: string) => () => void;
1
+ export declare const injectCSS: (css: string) => (() => void);
2
2
  export declare const OBJECTFIT_CONTAIN_CLASS_NAME = "__remotion_objectfitcontain";
3
3
  export declare const makeDefaultPreviewCSS: (scope: string | null, backgroundColor: string) => string;
@@ -14,6 +14,7 @@ export type DelayRenderScope = {
14
14
  remotion_attempt: number;
15
15
  remotion_delayRenderHandles: number[];
16
16
  remotion_cancelledError?: string;
17
+ remotion_cancelledErrorObject?: Error;
17
18
  };
18
19
  export type DelayRenderOptions = {
19
20
  timeoutInMilliseconds?: number;
@@ -31,7 +32,7 @@ type DelayRenderInternalOptions = {
31
32
  options: DelayRenderOptions;
32
33
  };
33
34
  export declare const delayRenderInternal: ({ scope, environment, label, options, }: DelayRenderInternalOptions) => number;
34
- export declare const delayRender: (label?: string | undefined, options?: DelayRenderOptions | undefined) => number;
35
+ export declare const delayRender: (label?: string, options?: DelayRenderOptions) => number;
35
36
  /**
36
37
  * Internal function that accepts environment as parameter.
37
38
  * @private
@@ -6,7 +6,7 @@ const delay_render_constants_js_1 = require("./delay-render-constants.js");
6
6
  const get_remotion_environment_js_1 = require("./get-remotion-environment.js");
7
7
  const log_js_1 = require("./log.js");
8
8
  const truthy_js_1 = require("./truthy.js");
9
- const delay_render_constants_js_2 = require("./delay-render-constants.js");
9
+ var delay_render_constants_js_2 = require("./delay-render-constants.js");
10
10
  Object.defineProperty(exports, "DELAY_RENDER_CALLSTACK_TOKEN", { enumerable: true, get: function () { return delay_render_constants_js_2.DELAY_RENDER_CALLSTACK_TOKEN; } });
11
11
  Object.defineProperty(exports, "DELAY_RENDER_CLEAR_TOKEN", { enumerable: true, get: function () { return delay_render_constants_js_2.DELAY_RENDER_CLEAR_TOKEN; } });
12
12
  Object.defineProperty(exports, "DELAY_RENDER_RETRIES_LEFT", { enumerable: true, get: function () { return delay_render_constants_js_2.DELAY_RENDER_RETRIES_LEFT; } });
@@ -49,7 +49,9 @@ const delayRenderInternal = ({ scope, environment, label, options, }) => {
49
49
  .join(' ');
50
50
  // in client-side rendering, don't throw (would be uncaught from setTimeout)
51
51
  if (environment.isClientSideRendering) {
52
- scope.remotion_cancelledError = (0, cancel_render_js_1.getErrorStackWithMessage)(Error(message));
52
+ const error = Error(message);
53
+ scope.remotion_cancelledErrorObject = error;
54
+ scope.remotion_cancelledError = (0, cancel_render_js_1.getErrorStackWithMessage)(error);
53
55
  }
54
56
  else {
55
57
  (0, cancel_render_js_1.cancelRenderInternal)(scope, Error(message));
@@ -9,6 +9,7 @@ const index_js_1 = require("./spring/index.js");
9
9
  // there so we return endpoints instead of NaN or unintended extrapolation.
10
10
  const clampUnit = (t) => Math.min(1, Math.max(0, t));
11
11
  const springEasingDurationInFrames = 30;
12
+ let easeBezier = null;
12
13
  /**
13
14
  * @description The Easing module implements common easing functions. You can use it with the interpolate() API.
14
15
  * @see [Documentation](https://www.remotion.dev/docs/easing)
@@ -24,7 +25,8 @@ class Easing {
24
25
  return t;
25
26
  }
26
27
  static ease(t) {
27
- return Easing.bezier(0.42, 0, 1, 1)(t);
28
+ easeBezier !== null && easeBezier !== void 0 ? easeBezier : (easeBezier = Easing.bezier(0.42, 0, 1, 1));
29
+ return easeBezier(t);
28
30
  }
29
31
  static quad(t) {
30
32
  return t * t;