remotion 4.0.525 → 4.0.526
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.
- package/dist/cjs/AbsoluteFill.d.ts +0 -1
- package/dist/cjs/Img.d.ts +2 -0
- package/dist/cjs/Img.js +23 -18
- package/dist/cjs/Interactive.d.ts +0 -1
- package/dist/cjs/canvas-image/CanvasImage.d.ts +1 -0
- package/dist/cjs/canvas-image/CanvasImage.js +11 -6
- package/dist/cjs/canvas-image/props.d.ts +1 -0
- package/dist/cjs/delay-render.js +1 -1
- package/dist/cjs/interactivity-schema.d.ts +1 -2
- package/dist/cjs/interactivity-schema.js +0 -1
- package/dist/cjs/internals.d.ts +0 -1
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/esm/index.mjs +49 -32
- package/dist/esm/version.mjs +1 -1
- package/package.json +2 -2
package/dist/cjs/Img.d.ts
CHANGED
|
@@ -8,6 +8,7 @@ export type ImgProps = NativeImgProps & {
|
|
|
8
8
|
readonly delayRenderRetries?: number;
|
|
9
9
|
readonly delayRenderTimeoutInMilliseconds?: number;
|
|
10
10
|
readonly onImageFrame?: (imageElement: HTMLImageElement) => void;
|
|
11
|
+
readonly onImageError?: (error: Error) => void;
|
|
11
12
|
readonly src: string;
|
|
12
13
|
readonly effects?: EffectsProp;
|
|
13
14
|
readonly showInTimeline?: boolean;
|
|
@@ -225,6 +226,7 @@ export declare const Img: React.ComponentType<NativeImgProps & {
|
|
|
225
226
|
readonly delayRenderRetries?: number | undefined;
|
|
226
227
|
readonly delayRenderTimeoutInMilliseconds?: number | undefined;
|
|
227
228
|
readonly onImageFrame?: ((imageElement: HTMLImageElement) => void) | undefined;
|
|
229
|
+
readonly onImageError?: ((error: Error) => void) | undefined;
|
|
228
230
|
readonly src: string;
|
|
229
231
|
readonly effects?: EffectsProp | undefined;
|
|
230
232
|
readonly showInTimeline?: boolean | undefined;
|
package/dist/cjs/Img.js
CHANGED
|
@@ -22,7 +22,7 @@ const with_interactivity_schema_js_1 = require("./with-interactivity-schema.js")
|
|
|
22
22
|
function exponentialBackoff(errorCount) {
|
|
23
23
|
return 1000 * 2 ** (errorCount - 1);
|
|
24
24
|
}
|
|
25
|
-
const ImgContent = ({ onError, maxRetries = 2, src, pauseWhenLoading, delayRenderRetries, delayRenderTimeoutInMilliseconds, onImageFrame, crossOrigin, decoding, ref, refForOutline, ...props }) => {
|
|
25
|
+
const ImgContent = ({ onError, onImageError, maxRetries = 2, src, pauseWhenLoading, delayRenderRetries, delayRenderTimeoutInMilliseconds, onImageFrame, crossOrigin, decoding, ref, refForOutline, ...props }) => {
|
|
26
26
|
const imageRef = (0, react_1.useRef)(null);
|
|
27
27
|
const errors = (0, react_1.useRef)({});
|
|
28
28
|
const { delayPlayback } = (0, use_buffer_state_js_1.useBufferState)();
|
|
@@ -67,34 +67,36 @@ const ImgContent = ({ onError, maxRetries = 2, src, pauseWhenLoading, delayRende
|
|
|
67
67
|
const isPremounting = Boolean(sequenceContext === null || sequenceContext === void 0 ? void 0 : sequenceContext.premounting);
|
|
68
68
|
const isPostmounting = Boolean(sequenceContext === null || sequenceContext === void 0 ? void 0 : sequenceContext.postmounting);
|
|
69
69
|
const didGetError = (0, react_1.useCallback)((e) => {
|
|
70
|
-
var _a, _b, _c, _d, _e, _f, _g;
|
|
71
|
-
var
|
|
70
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
71
|
+
var _j, _k, _l, _m;
|
|
72
72
|
if (!errors.current) {
|
|
73
73
|
return;
|
|
74
74
|
}
|
|
75
75
|
errors.current[(_a = imageRef.current) === null || _a === void 0 ? void 0 : _a.src] =
|
|
76
|
-
((
|
|
77
|
-
if (onError &&
|
|
78
|
-
((
|
|
79
|
-
onError(e);
|
|
76
|
+
((_j = errors.current[(_b = imageRef.current) === null || _b === void 0 ? void 0 : _b.src]) !== null && _j !== void 0 ? _j : 0) + 1;
|
|
77
|
+
if ((onError || onImageError) &&
|
|
78
|
+
((_k = errors.current[(_c = imageRef.current) === null || _c === void 0 ? void 0 : _c.src]) !== null && _k !== void 0 ? _k : 0) > maxRetries) {
|
|
79
|
+
onError === null || onError === void 0 ? void 0 : onError(e);
|
|
80
|
+
onImageError === null || onImageError === void 0 ? void 0 : onImageError(new Error('Error loading image with src: ' +
|
|
81
|
+
(0, truncate_src_for_label_js_1.truncateSrcForLabel)((_d = imageRef.current) === null || _d === void 0 ? void 0 : _d.src)));
|
|
80
82
|
return;
|
|
81
83
|
}
|
|
82
|
-
if (((
|
|
83
|
-
const backoff = exponentialBackoff((
|
|
84
|
+
if (((_l = errors.current[(_e = imageRef.current) === null || _e === void 0 ? void 0 : _e.src]) !== null && _l !== void 0 ? _l : 0) <= maxRetries) {
|
|
85
|
+
const backoff = exponentialBackoff((_m = errors.current[(_f = imageRef.current) === null || _f === void 0 ? void 0 : _f.src]) !== null && _m !== void 0 ? _m : 0);
|
|
84
86
|
// eslint-disable-next-line no-console
|
|
85
|
-
console.warn(`Could not load image with source ${(0, truncate_src_for_label_js_1.truncateSrcForLabel)((
|
|
87
|
+
console.warn(`Could not load image with source ${(0, truncate_src_for_label_js_1.truncateSrcForLabel)((_g = imageRef.current) === null || _g === void 0 ? void 0 : _g.src)}, retrying again in ${backoff}ms`);
|
|
86
88
|
retryIn(backoff);
|
|
87
89
|
return;
|
|
88
90
|
}
|
|
89
91
|
try {
|
|
90
92
|
cancelRender('Error loading image with src: ' +
|
|
91
|
-
(0, truncate_src_for_label_js_1.truncateSrcForLabel)((
|
|
93
|
+
(0, truncate_src_for_label_js_1.truncateSrcForLabel)((_h = imageRef.current) === null || _h === void 0 ? void 0 : _h.src));
|
|
92
94
|
}
|
|
93
|
-
catch (
|
|
95
|
+
catch (_o) {
|
|
94
96
|
// cancelRender() intentionally throws after storing the error in scope.
|
|
95
97
|
// In async image callbacks, we rely on the stored error for renderer propagation.
|
|
96
98
|
}
|
|
97
|
-
}, [cancelRender, maxRetries, onError, retryIn]);
|
|
99
|
+
}, [cancelRender, maxRetries, onError, onImageError, retryIn]);
|
|
98
100
|
if (typeof window !== 'undefined') {
|
|
99
101
|
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
100
102
|
(0, react_1.useLayoutEffect)(() => {
|
|
@@ -200,6 +202,10 @@ const NativeImgInner = ({ hidden, name, showInTimeline, src, from, trimBefore, d
|
|
|
200
202
|
if (!src) {
|
|
201
203
|
throw new Error('No "src" prop was passed to <Img>.');
|
|
202
204
|
}
|
|
205
|
+
const isMedia = (0, react_1.useMemo)(() => ({
|
|
206
|
+
type: 'image',
|
|
207
|
+
src,
|
|
208
|
+
}), [src]);
|
|
203
209
|
const { effectivePostmountFor, effectivePremountFor, freezeFrame, isPremountingOrPostmounting, postmountingActive, premountingActive, premountingStyle, } = (0, use_premounting_js_1.usePremounting)({
|
|
204
210
|
from: from !== null && from !== void 0 ? from : 0,
|
|
205
211
|
durationInFrames: durationInFrames !== null && durationInFrames !== void 0 ? durationInFrames : Infinity,
|
|
@@ -218,7 +224,7 @@ const NativeImgInner = ({ hidden, name, showInTimeline, src, from, trimBefore, d
|
|
|
218
224
|
style: premountingStyle,
|
|
219
225
|
componentName: '<Img />',
|
|
220
226
|
});
|
|
221
|
-
return (jsx_runtime_1.jsx(freeze_js_1.Freeze, { frame: freezeFrame, active: isPremountingOrPostmounting, children: jsx_runtime_1.jsx(Sequence_js_1.Sequence, { layout: "none", from: from !== null && from !== void 0 ? from : 0, trimBefore: trimBefore, durationInFrames: durationInFrames !== null && durationInFrames !== void 0 ? durationInFrames : Infinity, freeze: freeze, _remotionInternalDocumentationLink: "https://www.remotion.dev/docs/img", _remotionInternalIsMedia:
|
|
227
|
+
return (jsx_runtime_1.jsx(freeze_js_1.Freeze, { frame: freezeFrame, active: isPremountingOrPostmounting, children: jsx_runtime_1.jsx(Sequence_js_1.Sequence, { layout: "none", from: from !== null && from !== void 0 ? from : 0, trimBefore: trimBefore, durationInFrames: durationInFrames !== null && durationInFrames !== void 0 ? durationInFrames : Infinity, freeze: freeze, _remotionInternalDocumentationLink: "https://www.remotion.dev/docs/img", _remotionInternalIsMedia: isMedia, _remotionInternalPremountDisplay: effectivePremountFor || null, _remotionInternalPostmountDisplay: effectivePostmountFor || null, _remotionInternalIsPremounting: premountingActive, _remotionInternalIsPostmounting: postmountingActive, name: name !== null && name !== void 0 ? name : '<Img>', controls: controls, showInTimeline: showInTimeline !== null && showInTimeline !== void 0 ? showInTimeline : true, hidden: hidden, outlineRef: refForOutline, children: jsx_runtime_1.jsx(ImgContent, { src: src, refForOutline: refForOutline, style: croppedStyle !== null && croppedStyle !== void 0 ? croppedStyle : undefined, ...props }) }) }));
|
|
222
228
|
};
|
|
223
229
|
const CanvasImageWithPrivateProps = index_js_1.CanvasImage;
|
|
224
230
|
exports.imgSchema = {
|
|
@@ -239,7 +245,6 @@ exports.imgSchema = {
|
|
|
239
245
|
};
|
|
240
246
|
const imgCanvasFallbackIncompatibleProps = new Set([
|
|
241
247
|
'alt',
|
|
242
|
-
'crossOrigin',
|
|
243
248
|
'decoding',
|
|
244
249
|
'fetchPriority',
|
|
245
250
|
'loading',
|
|
@@ -276,12 +281,12 @@ const getFitFromObjectFit = (style) => {
|
|
|
276
281
|
}
|
|
277
282
|
return undefined;
|
|
278
283
|
};
|
|
279
|
-
const ImgInner = ({ effects = [], ref, hidden, name, showInTimeline, src, from, trimBefore, durationInFrames, freeze, premountFor, postmountFor, styleWhilePremounted, styleWhilePostmounted, controls, width, height, className, style, cropLeft, cropRight, cropTop, cropBottom, id, pauseWhenLoading, maxRetries, delayRenderRetries, delayRenderTimeoutInMilliseconds, ...props }) => {
|
|
284
|
+
const ImgInner = ({ effects = [], ref, hidden, name, showInTimeline, src, from, trimBefore, durationInFrames, freeze, premountFor, postmountFor, styleWhilePremounted, styleWhilePostmounted, controls, width, height, className, style, cropLeft, cropRight, cropTop, cropBottom, id, pauseWhenLoading, maxRetries, delayRenderRetries, delayRenderTimeoutInMilliseconds, onImageError, ...props }) => {
|
|
280
285
|
var _a;
|
|
281
286
|
const refForOutline = (0, react_1.useRef)(null);
|
|
282
287
|
const shouldPauseWhenLoading = (0, v5_flag_js_1.resolveV5Default)(pauseWhenLoading);
|
|
283
288
|
if (effects.length === 0) {
|
|
284
|
-
return (jsx_runtime_1.jsx(NativeImgInner, { ...props, ref: ref, hidden: hidden, name: name, showInTimeline: showInTimeline, src: src, from: from, trimBefore: trimBefore, durationInFrames: durationInFrames, freeze: freeze, premountFor: premountFor, postmountFor: postmountFor, styleWhilePremounted: styleWhilePremounted, styleWhilePostmounted: styleWhilePostmounted, controls: controls, width: width, height: height, className: className, style: style, cropLeft: cropLeft, cropRight: cropRight, cropTop: cropTop, cropBottom: cropBottom, id: id, pauseWhenLoading: shouldPauseWhenLoading, maxRetries: maxRetries, delayRenderRetries: delayRenderRetries, delayRenderTimeoutInMilliseconds: delayRenderTimeoutInMilliseconds, outlineRef: refForOutline }));
|
|
289
|
+
return (jsx_runtime_1.jsx(NativeImgInner, { ...props, ref: ref, hidden: hidden, name: name, showInTimeline: showInTimeline, src: src, from: from, trimBefore: trimBefore, durationInFrames: durationInFrames, freeze: freeze, premountFor: premountFor, postmountFor: postmountFor, styleWhilePremounted: styleWhilePremounted, styleWhilePostmounted: styleWhilePostmounted, controls: controls, width: width, height: height, className: className, style: style, cropLeft: cropLeft, cropRight: cropRight, cropTop: cropTop, cropBottom: cropBottom, id: id, pauseWhenLoading: shouldPauseWhenLoading, maxRetries: maxRetries, delayRenderRetries: delayRenderRetries, delayRenderTimeoutInMilliseconds: delayRenderTimeoutInMilliseconds, onImageError: onImageError, outlineRef: refForOutline }));
|
|
285
290
|
}
|
|
286
291
|
if (!src) {
|
|
287
292
|
throw new Error('No "src" prop was passed to <Img>.');
|
|
@@ -296,7 +301,7 @@ const ImgInner = ({ effects = [], ref, hidden, name, showInTimeline, src, from,
|
|
|
296
301
|
const canvasHeight = typeof height === 'number' ? height : undefined;
|
|
297
302
|
const canvasProps = props;
|
|
298
303
|
const canvasFit = (_a = getFitFromObjectFit(style)) !== null && _a !== void 0 ? _a : 'fill';
|
|
299
|
-
return (jsx_runtime_1.jsx(CanvasImageWithPrivateProps, { src: src, width: canvasWidth, height: canvasHeight, fit: canvasFit, effects: effects, className: className, style: style, cropLeft: cropLeft, cropRight: cropRight, cropTop: cropTop, cropBottom: cropBottom, id: id, pauseWhenLoading: shouldPauseWhenLoading, maxRetries: maxRetries, delayRenderRetries: delayRenderRetries, delayRenderTimeoutInMilliseconds: delayRenderTimeoutInMilliseconds, from: from, trimBefore: trimBefore, durationInFrames: durationInFrames, freeze: freeze, premountFor: premountFor, postmountFor: postmountFor, styleWhilePremounted: styleWhilePremounted, styleWhilePostmounted: styleWhilePostmounted, hidden: hidden, name: name !== null && name !== void 0 ? name : '<Img>', showInTimeline: showInTimeline, _remotionInternalDocumentationLink: "https://www.remotion.dev/docs/img", _remotionInternalCropComponentName: "<Img />", controls: controls, outlineRef: refForOutline, ...canvasProps }));
|
|
304
|
+
return (jsx_runtime_1.jsx(CanvasImageWithPrivateProps, { src: src, width: canvasWidth, height: canvasHeight, fit: canvasFit, effects: effects, className: className, style: style, cropLeft: cropLeft, cropRight: cropRight, cropTop: cropTop, cropBottom: cropBottom, id: id, onError: onImageError, pauseWhenLoading: shouldPauseWhenLoading, maxRetries: maxRetries, delayRenderRetries: delayRenderRetries, delayRenderTimeoutInMilliseconds: delayRenderTimeoutInMilliseconds, from: from, trimBefore: trimBefore, durationInFrames: durationInFrames, freeze: freeze, premountFor: premountFor, postmountFor: postmountFor, styleWhilePremounted: styleWhilePremounted, styleWhilePostmounted: styleWhilePostmounted, hidden: hidden, name: name !== null && name !== void 0 ? name : '<Img>', showInTimeline: showInTimeline, _remotionInternalDocumentationLink: "https://www.remotion.dev/docs/img", _remotionInternalCropComponentName: "<Img />", controls: controls, outlineRef: refForOutline, ...canvasProps }));
|
|
300
305
|
};
|
|
301
306
|
/*
|
|
302
307
|
* @description Works just like a regular HTML img tag. When you use the <Img> tag, Remotion will ensure that the image is loaded before rendering the frame.
|
|
@@ -219,6 +219,7 @@ export declare const canvasImageSchema: {
|
|
|
219
219
|
};
|
|
220
220
|
export declare const CanvasImage: import("react").ComponentType<import("../Interactive.js").InteractiveBaseProps & import("../Interactive.js").InteractiveCropProps & import("../Interactive.js").InteractivePremountProps & CanvasImageCanvasProps & {
|
|
221
221
|
readonly src: string;
|
|
222
|
+
readonly crossOrigin?: "" | "anonymous" | "use-credentials" | undefined;
|
|
222
223
|
readonly width?: number | undefined;
|
|
223
224
|
readonly height?: number | undefined;
|
|
224
225
|
readonly fit?: import("../calculate-image-fit.js").ImageFit | undefined;
|
|
@@ -53,7 +53,7 @@ const makeAbortError = () => {
|
|
|
53
53
|
error.name = 'AbortError';
|
|
54
54
|
return error;
|
|
55
55
|
};
|
|
56
|
-
const loadImage = ({ src, signal, }) => {
|
|
56
|
+
const loadImage = ({ src, signal, crossOrigin, }) => {
|
|
57
57
|
return new Promise((resolve, reject) => {
|
|
58
58
|
const image = new Image();
|
|
59
59
|
let settled = false;
|
|
@@ -94,7 +94,7 @@ const loadImage = ({ src, signal, }) => {
|
|
|
94
94
|
onAbort();
|
|
95
95
|
return;
|
|
96
96
|
}
|
|
97
|
-
image.crossOrigin = 'anonymous';
|
|
97
|
+
image.crossOrigin = crossOrigin !== null && crossOrigin !== void 0 ? crossOrigin : 'anonymous';
|
|
98
98
|
image.src = src;
|
|
99
99
|
});
|
|
100
100
|
};
|
|
@@ -109,7 +109,7 @@ const waitForNextFrame = ({ onFrame, }) => {
|
|
|
109
109
|
const frame = requestAnimationFrame(onFrame);
|
|
110
110
|
return () => cancelAnimationFrame(frame);
|
|
111
111
|
};
|
|
112
|
-
const CanvasImageContent = (0, react_1.forwardRef)(({ src, width, height, fit = 'fill', effects, controls, onError, className, style, id, pauseWhenLoading, maxRetries = 2, delayRenderRetries, delayRenderTimeoutInMilliseconds, refForOutline, ...canvasProps }, ref) => {
|
|
112
|
+
const CanvasImageContent = (0, react_1.forwardRef)(({ src, crossOrigin, width, height, fit = 'fill', effects, controls, onError, className, style, id, pauseWhenLoading, maxRetries = 2, delayRenderRetries, delayRenderTimeoutInMilliseconds, refForOutline, ...canvasProps }, ref) => {
|
|
113
113
|
var _a;
|
|
114
114
|
const { delayRender, continueRender, cancelRender } = (0, use_delay_render_js_1.useDelayRender)();
|
|
115
115
|
const { delayPlayback } = (0, use_buffer_state_js_1.useBufferState)();
|
|
@@ -187,7 +187,7 @@ const CanvasImageContent = (0, react_1.forwardRef)(({ src, width, height, fit =
|
|
|
187
187
|
continued: false,
|
|
188
188
|
};
|
|
189
189
|
const attemptLoad = () => {
|
|
190
|
-
loadImage({ src: actualSrc, signal: controller.signal })
|
|
190
|
+
loadImage({ src: actualSrc, signal: controller.signal, crossOrigin })
|
|
191
191
|
.then((image) => {
|
|
192
192
|
if (cancelled) {
|
|
193
193
|
return;
|
|
@@ -232,6 +232,7 @@ const CanvasImageContent = (0, react_1.forwardRef)(({ src, width, height, fit =
|
|
|
232
232
|
actualSrc,
|
|
233
233
|
cancelRender,
|
|
234
234
|
continuePendingLoadDelay,
|
|
235
|
+
crossOrigin,
|
|
235
236
|
delayRender,
|
|
236
237
|
delayRenderRetries,
|
|
237
238
|
delayRenderTimeoutInMilliseconds,
|
|
@@ -329,10 +330,14 @@ const CanvasImageContent = (0, react_1.forwardRef)(({ src, width, height, fit =
|
|
|
329
330
|
return (jsx_runtime_1.jsx("canvas", { ...canvasProps, ref: canvasRef, width: width, height: height, className: className, style: style, id: id }));
|
|
330
331
|
});
|
|
331
332
|
CanvasImageContent.displayName = 'CanvasImageContent';
|
|
332
|
-
const CanvasImageInner = (0, react_1.forwardRef)(({ src, width, height, fit, effects = [], className, style, id, onError, pauseWhenLoading, maxRetries, delayRenderRetries, delayRenderTimeoutInMilliseconds, durationInFrames, from, trimBefore, freeze, premountFor, postmountFor, styleWhilePremounted, styleWhilePostmounted, hidden, name, showInTimeline, cropLeft, cropRight, cropTop, cropBottom, controls, _remotionInternalDocumentationLink, _remotionInternalCropComponentName, outlineRef, ...canvasProps }, ref) => {
|
|
333
|
+
const CanvasImageInner = (0, react_1.forwardRef)(({ src, crossOrigin, width, height, fit, effects = [], className, style, id, onError, pauseWhenLoading, maxRetries, delayRenderRetries, delayRenderTimeoutInMilliseconds, durationInFrames, from, trimBefore, freeze, premountFor, postmountFor, styleWhilePremounted, styleWhilePostmounted, hidden, name, showInTimeline, cropLeft, cropRight, cropTop, cropBottom, controls, _remotionInternalDocumentationLink, _remotionInternalCropComponentName, outlineRef, ...canvasProps }, ref) => {
|
|
333
334
|
if (!src) {
|
|
334
335
|
throw new Error('No "src" prop was passed to <CanvasImage>.');
|
|
335
336
|
}
|
|
337
|
+
const isMedia = (0, react_1.useMemo)(() => ({
|
|
338
|
+
type: 'image',
|
|
339
|
+
src,
|
|
340
|
+
}), [src]);
|
|
336
341
|
const memoizedEffectDefinitions = (0, use_memoized_effects_js_1.useMemoizedEffectDefinitions)(effects);
|
|
337
342
|
const actualRef = (0, react_1.useRef)(null);
|
|
338
343
|
(0, react_1.useImperativeHandle)(ref, () => {
|
|
@@ -356,7 +361,7 @@ const CanvasImageInner = (0, react_1.forwardRef)(({ src, width, height, fit, eff
|
|
|
356
361
|
style: premountingStyle,
|
|
357
362
|
componentName: _remotionInternalCropComponentName !== null && _remotionInternalCropComponentName !== void 0 ? _remotionInternalCropComponentName : '<CanvasImage />',
|
|
358
363
|
});
|
|
359
|
-
return (jsx_runtime_1.jsx(freeze_js_1.Freeze, { frame: freezeFrame, active: isPremountingOrPostmounting, children: jsx_runtime_1.jsx(Sequence_js_1.Sequence, { layout: "none", from: from !== null && from !== void 0 ? from : 0, trimBefore: trimBefore, durationInFrames: durationInFrames !== null && durationInFrames !== void 0 ? durationInFrames : Infinity, 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:
|
|
364
|
+
return (jsx_runtime_1.jsx(freeze_js_1.Freeze, { frame: freezeFrame, active: isPremountingOrPostmounting, children: jsx_runtime_1.jsx(Sequence_js_1.Sequence, { layout: "none", from: from !== null && from !== void 0 ? from : 0, trimBefore: trimBefore, durationInFrames: durationInFrames !== null && durationInFrames !== void 0 ? durationInFrames : Infinity, 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, outlineRef: outlineRef !== null && outlineRef !== void 0 ? outlineRef : actualRef, children: jsx_runtime_1.jsx(CanvasImageContent, { ref: actualRef, src: src, crossOrigin: crossOrigin, width: width, height: height, fit: fit, effects: effects, controls: controls, className: className, style: croppedStyle !== null && croppedStyle !== void 0 ? croppedStyle : undefined, id: id, onError: onError, pauseWhenLoading: pauseWhenLoading, maxRetries: maxRetries, delayRenderRetries: delayRenderRetries, delayRenderTimeoutInMilliseconds: delayRenderTimeoutInMilliseconds, refForOutline: outlineRef !== null && outlineRef !== void 0 ? outlineRef : null, ...canvasProps }) }) }));
|
|
360
365
|
});
|
|
361
366
|
/*
|
|
362
367
|
* @description Renders a static image to a `<canvas>` and applies Remotion effects.
|
|
@@ -6,6 +6,7 @@ type CanvasImageSequenceProps = InteractiveBaseProps & InteractiveCropProps & In
|
|
|
6
6
|
export type CanvasImageCanvasProps = Omit<React.CanvasHTMLAttributes<HTMLCanvasElement>, 'children' | 'height' | 'onError' | 'width'>;
|
|
7
7
|
export type CanvasImageProps = CanvasImageSequenceProps & CanvasImageCanvasProps & {
|
|
8
8
|
readonly src: string;
|
|
9
|
+
readonly crossOrigin?: React.ImgHTMLAttributes<HTMLImageElement>['crossOrigin'];
|
|
9
10
|
readonly width?: number;
|
|
10
11
|
readonly height?: number;
|
|
11
12
|
readonly fit?: ImageFit;
|
package/dist/cjs/delay-render.js
CHANGED
|
@@ -30,7 +30,7 @@ const delayRenderInternal = ({ scope, environment, label, options, }) => {
|
|
|
30
30
|
scope.remotion_delayRenderHandles.push(handle);
|
|
31
31
|
const called = (_b = (_a = Error().stack) === null || _a === void 0 ? void 0 : _a.replace(/^Error/g, '')) !== null && _b !== void 0 ? _b : '';
|
|
32
32
|
if (environment.isRendering) {
|
|
33
|
-
const timeoutToUse = ((_d = (_c = options === null || options === void 0 ? void 0 : options.timeoutInMilliseconds) !== null && _c !== void 0 ? _c : scope.remotion_puppeteerTimeout) !== null && _d !== void 0 ? _d : defaultTimeout) - 2000;
|
|
33
|
+
const timeoutToUse = Math.max(0, ((_d = (_c = options === null || options === void 0 ? void 0 : options.timeoutInMilliseconds) !== null && _c !== void 0 ? _c : scope.remotion_puppeteerTimeout) !== null && _d !== void 0 ? _d : defaultTimeout) - 2000);
|
|
34
34
|
const retriesLeft = ((_e = options === null || options === void 0 ? void 0 : options.retries) !== null && _e !== void 0 ? _e : 0) - (scope.remotion_attempt - 1);
|
|
35
35
|
scope.remotion_delayRenderTimeouts[handle] = {
|
|
36
36
|
label: label !== null && label !== void 0 ? label : null,
|
|
@@ -101,7 +101,7 @@ export type FontWeightFieldSchema = {
|
|
|
101
101
|
type: 'font-weight';
|
|
102
102
|
default: number | string | undefined;
|
|
103
103
|
description?: string;
|
|
104
|
-
keyframable?:
|
|
104
|
+
keyframable?: boolean;
|
|
105
105
|
};
|
|
106
106
|
export type AssetFieldSchema = {
|
|
107
107
|
type: 'asset';
|
|
@@ -265,7 +265,6 @@ export declare const textSchema: {
|
|
|
265
265
|
readonly type: "font-weight";
|
|
266
266
|
readonly default: 400;
|
|
267
267
|
readonly description: "Font weight";
|
|
268
|
-
readonly keyframable: false;
|
|
269
268
|
};
|
|
270
269
|
readonly 'style.fontStyle': {
|
|
271
270
|
readonly type: "enum";
|
package/dist/cjs/internals.d.ts
CHANGED
package/dist/cjs/version.d.ts
CHANGED
package/dist/cjs/version.js
CHANGED
package/dist/esm/index.mjs
CHANGED
|
@@ -1200,7 +1200,7 @@ var delayRenderInternal = ({
|
|
|
1200
1200
|
scope.remotion_delayRenderHandles.push(handle);
|
|
1201
1201
|
const called = Error().stack?.replace(/^Error/g, "") ?? "";
|
|
1202
1202
|
if (environment.isRendering) {
|
|
1203
|
-
const timeoutToUse = (options?.timeoutInMilliseconds ?? scope.remotion_puppeteerTimeout ?? defaultTimeout) - 2000;
|
|
1203
|
+
const timeoutToUse = Math.max(0, (options?.timeoutInMilliseconds ?? scope.remotion_puppeteerTimeout ?? defaultTimeout) - 2000);
|
|
1204
1204
|
const retriesLeft = (options?.retries ?? 0) - (scope.remotion_attempt - 1);
|
|
1205
1205
|
scope.remotion_delayRenderTimeouts[handle] = {
|
|
1206
1206
|
label: label2 ?? null,
|
|
@@ -1537,7 +1537,7 @@ var Composition = (props) => {
|
|
|
1537
1537
|
};
|
|
1538
1538
|
|
|
1539
1539
|
// src/version.ts
|
|
1540
|
-
var VERSION = "4.0.
|
|
1540
|
+
var VERSION = "4.0.526";
|
|
1541
1541
|
|
|
1542
1542
|
// src/multiple-versions-warning.ts
|
|
1543
1543
|
var checkMultipleRemotionVersions = () => {
|
|
@@ -2061,8 +2061,7 @@ var textSchema = {
|
|
|
2061
2061
|
"style.fontWeight": {
|
|
2062
2062
|
type: "font-weight",
|
|
2063
2063
|
default: 400,
|
|
2064
|
-
description: "Font weight"
|
|
2065
|
-
keyframable: false
|
|
2064
|
+
description: "Font weight"
|
|
2066
2065
|
},
|
|
2067
2066
|
"style.fontStyle": {
|
|
2068
2067
|
type: "enum",
|
|
@@ -10936,7 +10935,8 @@ var makeAbortError = () => {
|
|
|
10936
10935
|
};
|
|
10937
10936
|
var loadImage = ({
|
|
10938
10937
|
src,
|
|
10939
|
-
signal
|
|
10938
|
+
signal,
|
|
10939
|
+
crossOrigin
|
|
10940
10940
|
}) => {
|
|
10941
10941
|
return new Promise((resolve, reject) => {
|
|
10942
10942
|
const image = new Image;
|
|
@@ -10977,7 +10977,7 @@ var loadImage = ({
|
|
|
10977
10977
|
onAbort();
|
|
10978
10978
|
return;
|
|
10979
10979
|
}
|
|
10980
|
-
image.crossOrigin = "anonymous";
|
|
10980
|
+
image.crossOrigin = crossOrigin ?? "anonymous";
|
|
10981
10981
|
image.src = src;
|
|
10982
10982
|
});
|
|
10983
10983
|
};
|
|
@@ -10998,6 +10998,7 @@ var waitForNextFrame = ({
|
|
|
10998
10998
|
};
|
|
10999
10999
|
var CanvasImageContent = forwardRef10(({
|
|
11000
11000
|
src,
|
|
11001
|
+
crossOrigin,
|
|
11001
11002
|
width,
|
|
11002
11003
|
height,
|
|
11003
11004
|
fit = "fill",
|
|
@@ -11086,7 +11087,7 @@ var CanvasImageContent = forwardRef10(({
|
|
|
11086
11087
|
continued: false
|
|
11087
11088
|
};
|
|
11088
11089
|
const attemptLoad = () => {
|
|
11089
|
-
loadImage({ src: actualSrc, signal: controller.signal }).then((image) => {
|
|
11090
|
+
loadImage({ src: actualSrc, signal: controller.signal, crossOrigin }).then((image) => {
|
|
11090
11091
|
if (cancelled) {
|
|
11091
11092
|
return;
|
|
11092
11093
|
}
|
|
@@ -11126,6 +11127,7 @@ var CanvasImageContent = forwardRef10(({
|
|
|
11126
11127
|
actualSrc,
|
|
11127
11128
|
cancelRender2,
|
|
11128
11129
|
continuePendingLoadDelay,
|
|
11130
|
+
crossOrigin,
|
|
11129
11131
|
delayRender2,
|
|
11130
11132
|
delayRenderRetries,
|
|
11131
11133
|
delayRenderTimeoutInMilliseconds,
|
|
@@ -11232,6 +11234,7 @@ var CanvasImageContent = forwardRef10(({
|
|
|
11232
11234
|
CanvasImageContent.displayName = "CanvasImageContent";
|
|
11233
11235
|
var CanvasImageInner = forwardRef10(({
|
|
11234
11236
|
src,
|
|
11237
|
+
crossOrigin,
|
|
11235
11238
|
width,
|
|
11236
11239
|
height,
|
|
11237
11240
|
fit,
|
|
@@ -11268,6 +11271,10 @@ var CanvasImageInner = forwardRef10(({
|
|
|
11268
11271
|
if (!src) {
|
|
11269
11272
|
throw new Error('No "src" prop was passed to <CanvasImage>.');
|
|
11270
11273
|
}
|
|
11274
|
+
const isMedia = useMemo32(() => ({
|
|
11275
|
+
type: "image",
|
|
11276
|
+
src
|
|
11277
|
+
}), [src]);
|
|
11271
11278
|
const memoizedEffectDefinitions = useMemoizedEffectDefinitions(effects);
|
|
11272
11279
|
const actualRef = useRef24(null);
|
|
11273
11280
|
useImperativeHandle7(ref, () => {
|
|
@@ -11314,7 +11321,7 @@ var CanvasImageInner = forwardRef10(({
|
|
|
11314
11321
|
_remotionInternalDocumentationLink: _remotionInternalDocumentationLink ?? "https://www.remotion.dev/docs/canvasimage",
|
|
11315
11322
|
controls,
|
|
11316
11323
|
_remotionInternalEffects: memoizedEffectDefinitions,
|
|
11317
|
-
_remotionInternalIsMedia:
|
|
11324
|
+
_remotionInternalIsMedia: isMedia,
|
|
11318
11325
|
_remotionInternalPremountDisplay: effectivePremountFor || null,
|
|
11319
11326
|
_remotionInternalPostmountDisplay: effectivePostmountFor || null,
|
|
11320
11327
|
_remotionInternalIsPremounting: premountingActive,
|
|
@@ -11323,6 +11330,7 @@ var CanvasImageInner = forwardRef10(({
|
|
|
11323
11330
|
children: /* @__PURE__ */ jsx28(CanvasImageContent, {
|
|
11324
11331
|
ref: actualRef,
|
|
11325
11332
|
src,
|
|
11333
|
+
crossOrigin,
|
|
11326
11334
|
width,
|
|
11327
11335
|
height,
|
|
11328
11336
|
fit,
|
|
@@ -11423,6 +11431,7 @@ import {
|
|
|
11423
11431
|
useCallback as useCallback21,
|
|
11424
11432
|
useContext as useContext37,
|
|
11425
11433
|
useLayoutEffect as useLayoutEffect14,
|
|
11434
|
+
useMemo as useMemo33,
|
|
11426
11435
|
useRef as useRef25,
|
|
11427
11436
|
useState as useState19
|
|
11428
11437
|
} from "react";
|
|
@@ -11432,6 +11441,7 @@ function exponentialBackoff2(errorCount) {
|
|
|
11432
11441
|
}
|
|
11433
11442
|
var ImgContent = ({
|
|
11434
11443
|
onError,
|
|
11444
|
+
onImageError,
|
|
11435
11445
|
maxRetries = 2,
|
|
11436
11446
|
src,
|
|
11437
11447
|
pauseWhenLoading,
|
|
@@ -11488,8 +11498,9 @@ var ImgContent = ({
|
|
|
11488
11498
|
return;
|
|
11489
11499
|
}
|
|
11490
11500
|
errors.current[imageRef.current?.src] = (errors.current[imageRef.current?.src] ?? 0) + 1;
|
|
11491
|
-
if (onError && (errors.current[imageRef.current?.src] ?? 0) > maxRetries) {
|
|
11492
|
-
onError(e);
|
|
11501
|
+
if ((onError || onImageError) && (errors.current[imageRef.current?.src] ?? 0) > maxRetries) {
|
|
11502
|
+
onError?.(e);
|
|
11503
|
+
onImageError?.(new Error("Error loading image with src: " + truncateSrcForLabel(imageRef.current?.src)));
|
|
11493
11504
|
return;
|
|
11494
11505
|
}
|
|
11495
11506
|
if ((errors.current[imageRef.current?.src] ?? 0) <= maxRetries) {
|
|
@@ -11501,7 +11512,7 @@ var ImgContent = ({
|
|
|
11501
11512
|
try {
|
|
11502
11513
|
cancelRender2("Error loading image with src: " + truncateSrcForLabel(imageRef.current?.src));
|
|
11503
11514
|
} catch {}
|
|
11504
|
-
}, [cancelRender2, maxRetries, onError, retryIn]);
|
|
11515
|
+
}, [cancelRender2, maxRetries, onError, onImageError, retryIn]);
|
|
11505
11516
|
if (typeof window !== "undefined") {
|
|
11506
11517
|
useLayoutEffect14(() => {
|
|
11507
11518
|
if (!pauseWhenLoading || !isLoading || isPremounting || isPostmounting) {
|
|
@@ -11613,6 +11624,10 @@ var NativeImgInner = ({
|
|
|
11613
11624
|
if (!src) {
|
|
11614
11625
|
throw new Error('No "src" prop was passed to <Img>.');
|
|
11615
11626
|
}
|
|
11627
|
+
const isMedia = useMemo33(() => ({
|
|
11628
|
+
type: "image",
|
|
11629
|
+
src
|
|
11630
|
+
}), [src]);
|
|
11616
11631
|
const {
|
|
11617
11632
|
effectivePostmountFor,
|
|
11618
11633
|
effectivePremountFor,
|
|
@@ -11649,7 +11664,7 @@ var NativeImgInner = ({
|
|
|
11649
11664
|
durationInFrames: durationInFrames ?? Infinity,
|
|
11650
11665
|
freeze,
|
|
11651
11666
|
_remotionInternalDocumentationLink: "https://www.remotion.dev/docs/img",
|
|
11652
|
-
_remotionInternalIsMedia:
|
|
11667
|
+
_remotionInternalIsMedia: isMedia,
|
|
11653
11668
|
_remotionInternalPremountDisplay: effectivePremountFor || null,
|
|
11654
11669
|
_remotionInternalPostmountDisplay: effectivePostmountFor || null,
|
|
11655
11670
|
_remotionInternalIsPremounting: premountingActive,
|
|
@@ -11687,7 +11702,6 @@ var imgSchema = {
|
|
|
11687
11702
|
};
|
|
11688
11703
|
var imgCanvasFallbackIncompatibleProps = new Set([
|
|
11689
11704
|
"alt",
|
|
11690
|
-
"crossOrigin",
|
|
11691
11705
|
"decoding",
|
|
11692
11706
|
"fetchPriority",
|
|
11693
11707
|
"loading",
|
|
@@ -11756,6 +11770,7 @@ var ImgInner = ({
|
|
|
11756
11770
|
maxRetries,
|
|
11757
11771
|
delayRenderRetries,
|
|
11758
11772
|
delayRenderTimeoutInMilliseconds,
|
|
11773
|
+
onImageError,
|
|
11759
11774
|
...props2
|
|
11760
11775
|
}) => {
|
|
11761
11776
|
const refForOutline = useRef25(null);
|
|
@@ -11790,6 +11805,7 @@ var ImgInner = ({
|
|
|
11790
11805
|
maxRetries,
|
|
11791
11806
|
delayRenderRetries,
|
|
11792
11807
|
delayRenderTimeoutInMilliseconds,
|
|
11808
|
+
onImageError,
|
|
11793
11809
|
outlineRef: refForOutline
|
|
11794
11810
|
});
|
|
11795
11811
|
}
|
|
@@ -11819,6 +11835,7 @@ var ImgInner = ({
|
|
|
11819
11835
|
cropTop,
|
|
11820
11836
|
cropBottom,
|
|
11821
11837
|
id,
|
|
11838
|
+
onError: onImageError,
|
|
11822
11839
|
pauseWhenLoading: shouldPauseWhenLoading,
|
|
11823
11840
|
maxRetries,
|
|
11824
11841
|
delayRenderRetries,
|
|
@@ -12085,7 +12102,7 @@ import {
|
|
|
12085
12102
|
useEffect as useEffect18,
|
|
12086
12103
|
useImperativeHandle as useImperativeHandle8,
|
|
12087
12104
|
useLayoutEffect as useLayoutEffect15,
|
|
12088
|
-
useMemo as
|
|
12105
|
+
useMemo as useMemo34,
|
|
12089
12106
|
useRef as useRef27,
|
|
12090
12107
|
useState as useState20
|
|
12091
12108
|
} from "react";
|
|
@@ -12248,7 +12265,7 @@ var CompositionManagerProvider = ({
|
|
|
12248
12265
|
getCompositions: () => currentcompositionsRef.current
|
|
12249
12266
|
};
|
|
12250
12267
|
}, []);
|
|
12251
|
-
const compositionManagerSetters =
|
|
12268
|
+
const compositionManagerSetters = useMemo34(() => {
|
|
12252
12269
|
return {
|
|
12253
12270
|
registerComposition,
|
|
12254
12271
|
unregisterComposition,
|
|
@@ -12265,7 +12282,7 @@ var CompositionManagerProvider = ({
|
|
|
12265
12282
|
unregisterFolder,
|
|
12266
12283
|
onlyRenderComposition
|
|
12267
12284
|
]);
|
|
12268
|
-
const compositionManagerContextValue =
|
|
12285
|
+
const compositionManagerContextValue = useMemo34(() => {
|
|
12269
12286
|
return {
|
|
12270
12287
|
compositions,
|
|
12271
12288
|
folders,
|
|
@@ -12510,7 +12527,7 @@ var waitForRoot = (fn) => {
|
|
|
12510
12527
|
};
|
|
12511
12528
|
|
|
12512
12529
|
// src/RemotionRoot.tsx
|
|
12513
|
-
import { useMemo as
|
|
12530
|
+
import { useMemo as useMemo35 } from "react";
|
|
12514
12531
|
import { jsx as jsx33 } from "react/jsx-runtime";
|
|
12515
12532
|
var RemotionRootContexts = ({
|
|
12516
12533
|
children,
|
|
@@ -12523,7 +12540,7 @@ var RemotionRootContexts = ({
|
|
|
12523
12540
|
frameState,
|
|
12524
12541
|
_experimentalKeepAudioContextAlive
|
|
12525
12542
|
}) => {
|
|
12526
|
-
const logging =
|
|
12543
|
+
const logging = useMemo35(() => {
|
|
12527
12544
|
return { logLevel, mountTime: Date.now() };
|
|
12528
12545
|
}, [logLevel]);
|
|
12529
12546
|
return /* @__PURE__ */ jsx33(LogLevelContext.Provider, {
|
|
@@ -12857,7 +12874,7 @@ import {
|
|
|
12857
12874
|
useContext as useContext39,
|
|
12858
12875
|
useEffect as useEffect19,
|
|
12859
12876
|
useLayoutEffect as useLayoutEffect16,
|
|
12860
|
-
useMemo as
|
|
12877
|
+
useMemo as useMemo36,
|
|
12861
12878
|
useState as useState21
|
|
12862
12879
|
} from "react";
|
|
12863
12880
|
|
|
@@ -12903,7 +12920,7 @@ var OffthreadVideoForRendering = ({
|
|
|
12903
12920
|
if (!src) {
|
|
12904
12921
|
throw new TypeError("No `src` was passed to <OffthreadVideo>.");
|
|
12905
12922
|
}
|
|
12906
|
-
const id =
|
|
12923
|
+
const id = useMemo36(() => `offthreadvideo-${random(src)}-${sequenceContext?.cumulatedFrom}-${sequenceContext?.relativeFrom}-${sequenceContext?.durationInFrames}`, [
|
|
12907
12924
|
src,
|
|
12908
12925
|
sequenceContext?.cumulatedFrom,
|
|
12909
12926
|
sequenceContext?.relativeFrom,
|
|
@@ -12958,14 +12975,14 @@ var OffthreadVideoForRendering = ({
|
|
|
12958
12975
|
sequenceContext?.cumulatedNegativeFrom,
|
|
12959
12976
|
audioStreamIndex
|
|
12960
12977
|
]);
|
|
12961
|
-
const currentTime =
|
|
12978
|
+
const currentTime = useMemo36(() => {
|
|
12962
12979
|
return getExpectedMediaFrameUncorrected({
|
|
12963
12980
|
frame,
|
|
12964
12981
|
playbackRate: playbackRate || 1,
|
|
12965
12982
|
startFrom: -mediaStartsAt
|
|
12966
12983
|
}) / videoConfig.fps;
|
|
12967
12984
|
}, [frame, mediaStartsAt, playbackRate, videoConfig.fps]);
|
|
12968
|
-
const actualSrc =
|
|
12985
|
+
const actualSrc = useMemo36(() => {
|
|
12969
12986
|
return getOffthreadVideoSource({
|
|
12970
12987
|
src,
|
|
12971
12988
|
currentTime,
|
|
@@ -13053,7 +13070,7 @@ var OffthreadVideoForRendering = ({
|
|
|
13053
13070
|
cancelRender("Failed to load image with src " + imageSrc);
|
|
13054
13071
|
}
|
|
13055
13072
|
}, [imageSrc, onError]);
|
|
13056
|
-
const className =
|
|
13073
|
+
const className = useMemo36(() => {
|
|
13057
13074
|
return [OBJECTFIT_CONTAIN_CLASS_NAME, props2.className].filter(truthy).join(" ");
|
|
13058
13075
|
}, [props2.className]);
|
|
13059
13076
|
const onImageFrame = useCallback24((img) => {
|
|
@@ -13083,7 +13100,7 @@ import React41, {
|
|
|
13083
13100
|
useContext as useContext40,
|
|
13084
13101
|
useEffect as useEffect21,
|
|
13085
13102
|
useImperativeHandle as useImperativeHandle9,
|
|
13086
|
-
useMemo as
|
|
13103
|
+
useMemo as useMemo37,
|
|
13087
13104
|
useRef as useRef28,
|
|
13088
13105
|
useState as useState22
|
|
13089
13106
|
} from "react";
|
|
@@ -13141,7 +13158,7 @@ var VideoForDevelopmentRefForwardingFunction = (props2, ref) => {
|
|
|
13141
13158
|
throw new Error("SharedAudioContext not found");
|
|
13142
13159
|
}
|
|
13143
13160
|
const videoRef = useRef28(null);
|
|
13144
|
-
const sharedSource =
|
|
13161
|
+
const sharedSource = useMemo37(() => {
|
|
13145
13162
|
if (!context.audioContext) {
|
|
13146
13163
|
return null;
|
|
13147
13164
|
}
|
|
@@ -13350,7 +13367,7 @@ var VideoForDevelopmentRefForwardingFunction = (props2, ref) => {
|
|
|
13350
13367
|
current.preload = "auto";
|
|
13351
13368
|
}
|
|
13352
13369
|
}, []);
|
|
13353
|
-
const actualStyle =
|
|
13370
|
+
const actualStyle = useMemo37(() => {
|
|
13354
13371
|
return {
|
|
13355
13372
|
...style
|
|
13356
13373
|
};
|
|
@@ -13577,7 +13594,7 @@ var watchStaticFile = (fileName, callback) => {
|
|
|
13577
13594
|
};
|
|
13578
13595
|
|
|
13579
13596
|
// src/wrap-remotion-context.tsx
|
|
13580
|
-
import React43, { useMemo as
|
|
13597
|
+
import React43, { useMemo as useMemo38 } from "react";
|
|
13581
13598
|
import { jsx as jsx37 } from "react/jsx-runtime";
|
|
13582
13599
|
function useRemotionContexts() {
|
|
13583
13600
|
const compositionManagerCtx = React43.useContext(CompositionManager);
|
|
@@ -13593,7 +13610,7 @@ function useRemotionContexts() {
|
|
|
13593
13610
|
const visualModePropStatusesRefContext = React43.useContext(VisualModePropStatusesRefContext);
|
|
13594
13611
|
const bufferManagerContext = React43.useContext(BufferingContextReact);
|
|
13595
13612
|
const logLevelContext = React43.useContext(LogLevelContext);
|
|
13596
|
-
return
|
|
13613
|
+
return useMemo38(() => ({
|
|
13597
13614
|
compositionManagerCtx,
|
|
13598
13615
|
timelineContext,
|
|
13599
13616
|
setTimelineContext,
|
|
@@ -13851,7 +13868,7 @@ var fontDataByUrl = new Map;
|
|
|
13851
13868
|
// src/series/index.tsx
|
|
13852
13869
|
import React45, {
|
|
13853
13870
|
forwardRef as forwardRef14,
|
|
13854
|
-
useMemo as
|
|
13871
|
+
useMemo as useMemo39
|
|
13855
13872
|
} from "react";
|
|
13856
13873
|
|
|
13857
13874
|
// src/series/flatten-children.tsx
|
|
@@ -13921,7 +13938,7 @@ var validateSeriesSequenceProps = ({
|
|
|
13921
13938
|
return offset;
|
|
13922
13939
|
};
|
|
13923
13940
|
var SeriesInner = (props2) => {
|
|
13924
|
-
const childrenValue =
|
|
13941
|
+
const childrenValue = useMemo39(() => {
|
|
13925
13942
|
const flattenedChildren = flattenChildren(props2.children);
|
|
13926
13943
|
const renderChildren = (i, startFrame) => {
|
|
13927
13944
|
if (i === flattenedChildren.length) {
|
|
@@ -14124,7 +14141,7 @@ import {
|
|
|
14124
14141
|
useEffect as useEffect22,
|
|
14125
14142
|
useImperativeHandle as useImperativeHandle10,
|
|
14126
14143
|
useLayoutEffect as useLayoutEffect17,
|
|
14127
|
-
useMemo as
|
|
14144
|
+
useMemo as useMemo40,
|
|
14128
14145
|
useRef as useRef29
|
|
14129
14146
|
} from "react";
|
|
14130
14147
|
|
|
@@ -14283,7 +14300,7 @@ var VideoForRenderingForwardFunction = ({
|
|
|
14283
14300
|
const mountTime = useMountTime();
|
|
14284
14301
|
const { delayRender: delayRender2, continueRender: continueRender2 } = useDelayRender();
|
|
14285
14302
|
const { registerRenderAsset, unregisterRenderAsset } = useContext41(RenderAssetManager);
|
|
14286
|
-
const id =
|
|
14303
|
+
const id = useMemo40(() => `video-${random(props2.src ?? "")}-${sequenceContext?.cumulatedFrom}-${sequenceContext?.relativeFrom}-${sequenceContext?.durationInFrames}`, [
|
|
14287
14304
|
props2.src,
|
|
14288
14305
|
sequenceContext?.cumulatedFrom,
|
|
14289
14306
|
sequenceContext?.relativeFrom,
|
package/dist/esm/version.mjs
CHANGED
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.
|
|
6
|
+
"version": "4.0.526",
|
|
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.5.4",
|
|
38
|
-
"@remotion/eslint-config-internal": "4.0.
|
|
38
|
+
"@remotion/eslint-config-internal": "4.0.526",
|
|
39
39
|
"eslint": "9.19.0",
|
|
40
40
|
"@typescript/native-preview": "7.0.0-dev.20260217.1"
|
|
41
41
|
},
|