remotion 4.0.490 → 4.0.491
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/CompositionManager.d.ts +2 -0
- package/dist/cjs/HtmlInCanvas.js +116 -67
- package/dist/cjs/Sequence.js +2 -0
- package/dist/cjs/SequenceManager.d.ts +7 -0
- package/dist/cjs/SequenceManager.js +1 -1
- package/dist/cjs/audio/shared-audio-tags.js +19 -10
- package/dist/cjs/internals.d.ts +3 -3
- package/dist/cjs/interpolate-translate.d.ts +8 -0
- package/dist/cjs/interpolate-translate.js +70 -0
- package/dist/cjs/series/index.js +107 -34
- package/dist/cjs/use-media-in-timeline.js +1 -0
- package/dist/cjs/use-schema.d.ts +17 -0
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/cjs/wrap-in-schema.d.ts +3 -3
- package/dist/cjs/wrap-in-schema.js +2 -2
- package/dist/esm/index.mjs +228 -113
- package/dist/esm/version.mjs +1 -1
- package/package.json +2 -2
package/dist/esm/index.mjs
CHANGED
|
@@ -1285,7 +1285,7 @@ var addSequenceStackTraces = (component) => {
|
|
|
1285
1285
|
};
|
|
1286
1286
|
|
|
1287
1287
|
// src/version.ts
|
|
1288
|
-
var VERSION = "4.0.
|
|
1288
|
+
var VERSION = "4.0.491";
|
|
1289
1289
|
|
|
1290
1290
|
// src/multiple-versions-warning.ts
|
|
1291
1291
|
var checkMultipleRemotionVersions = () => {
|
|
@@ -1964,7 +1964,7 @@ var SequenceManagerRefContext = React11.createContext({
|
|
|
1964
1964
|
current: []
|
|
1965
1965
|
});
|
|
1966
1966
|
var makeSequencePropsSubscriptionKey = (key) => {
|
|
1967
|
-
return `${key.nodePath.join(".")}
|
|
1967
|
+
return `${key.absolutePath}\x00${key.nodePath.join(".")}\x00${key.sequenceKeys.join(".")}\x00${key.effectKeys.map((keys) => keys.join(".")).join(".")}`;
|
|
1968
1968
|
};
|
|
1969
1969
|
var VisualModePropStatusesContext = React11.createContext({
|
|
1970
1970
|
propStatuses: {}
|
|
@@ -4631,6 +4631,7 @@ var RegularSequenceRefForwardingFunction = ({
|
|
|
4631
4631
|
src: isMedia.data.src,
|
|
4632
4632
|
getStack: () => stackRef.current,
|
|
4633
4633
|
startMediaFrom: startMediaFrom ?? isMedia.data.startMediaFrom,
|
|
4634
|
+
mediaFrameAtSequenceZero,
|
|
4634
4635
|
volume: isMedia.data.volumes,
|
|
4635
4636
|
refForOutline: refForOutline ?? null,
|
|
4636
4637
|
isInsideSeries,
|
|
@@ -4694,6 +4695,7 @@ var RegularSequenceRefForwardingFunction = ({
|
|
|
4694
4695
|
isInsideSeries,
|
|
4695
4696
|
registeredFrozenFrame,
|
|
4696
4697
|
startMediaFrom,
|
|
4698
|
+
mediaFrameAtSequenceZero,
|
|
4697
4699
|
frozenMediaFrame
|
|
4698
4700
|
]);
|
|
4699
4701
|
const endThreshold = Math.ceil(cumulatedFrom + from + durationInFrames - 1);
|
|
@@ -6773,7 +6775,9 @@ var SharedAudioTagsContextProvider = ({ children, numberOfAudioTags }) => {
|
|
|
6773
6775
|
return;
|
|
6774
6776
|
}
|
|
6775
6777
|
if (data === undefined) {
|
|
6776
|
-
current.src
|
|
6778
|
+
if (current.src !== EMPTY_AUDIO) {
|
|
6779
|
+
current.src = EMPTY_AUDIO;
|
|
6780
|
+
}
|
|
6777
6781
|
return;
|
|
6778
6782
|
}
|
|
6779
6783
|
if (!data) {
|
|
@@ -6842,7 +6846,7 @@ var SharedAudioTagsContextProvider = ({ children, numberOfAudioTags }) => {
|
|
|
6842
6846
|
if (prevA.id === id) {
|
|
6843
6847
|
const isTheSame = compareProps(aud, prevA.props) && prevA.premounting === premounting && prevA.postmounting === postmounting;
|
|
6844
6848
|
if (isTheSame) {
|
|
6845
|
-
return prevA;
|
|
6849
|
+
return prevA.audioMounted === audioMounted ? prevA : { ...prevA, audioMounted };
|
|
6846
6850
|
}
|
|
6847
6851
|
changed = true;
|
|
6848
6852
|
return {
|
|
@@ -6854,7 +6858,7 @@ var SharedAudioTagsContextProvider = ({ children, numberOfAudioTags }) => {
|
|
|
6854
6858
|
audioMounted
|
|
6855
6859
|
};
|
|
6856
6860
|
}
|
|
6857
|
-
return prevA;
|
|
6861
|
+
return prevA.audioMounted === audioMounted ? prevA : { ...prevA, audioMounted };
|
|
6858
6862
|
});
|
|
6859
6863
|
if (changed) {
|
|
6860
6864
|
rerenderAudios();
|
|
@@ -6893,16 +6897,19 @@ var SharedAudioTagsContextProvider = ({ children, numberOfAudioTags }) => {
|
|
|
6893
6897
|
unregisterAudio,
|
|
6894
6898
|
updateAudio
|
|
6895
6899
|
]);
|
|
6900
|
+
const sharedAudioTagElements = useMemo21(() => {
|
|
6901
|
+
return refs.map(({ id, ref }) => {
|
|
6902
|
+
return /* @__PURE__ */ jsx19("audio", {
|
|
6903
|
+
ref,
|
|
6904
|
+
preload: "metadata",
|
|
6905
|
+
src: EMPTY_AUDIO
|
|
6906
|
+
}, id);
|
|
6907
|
+
});
|
|
6908
|
+
}, [refs]);
|
|
6896
6909
|
return /* @__PURE__ */ jsxs2(SharedAudioTagsContext.Provider, {
|
|
6897
6910
|
value: audioTagsValue,
|
|
6898
6911
|
children: [
|
|
6899
|
-
|
|
6900
|
-
return /* @__PURE__ */ jsx19("audio", {
|
|
6901
|
-
ref,
|
|
6902
|
-
preload: "metadata",
|
|
6903
|
-
src: EMPTY_AUDIO
|
|
6904
|
-
}, id);
|
|
6905
|
-
}),
|
|
6912
|
+
sharedAudioTagElements,
|
|
6906
6913
|
children
|
|
6907
6914
|
]
|
|
6908
6915
|
});
|
|
@@ -7384,6 +7391,7 @@ var useMediaInTimeline = ({
|
|
|
7384
7391
|
showInTimeline: true,
|
|
7385
7392
|
nonce: nonce.get(),
|
|
7386
7393
|
startMediaFrom: 0 - startsAt,
|
|
7394
|
+
mediaFrameAtSequenceZero: null,
|
|
7387
7395
|
doesVolumeChange,
|
|
7388
7396
|
loopDisplay,
|
|
7389
7397
|
playbackRate,
|
|
@@ -9115,16 +9123,16 @@ var isMissingPaintRecordError = (error2) => {
|
|
|
9115
9123
|
return error2 instanceof DOMException && error2.name === "InvalidStateError";
|
|
9116
9124
|
};
|
|
9117
9125
|
var missingPaintRecordMessage = "HtmlInCanvas: Expected the element to be inside the viewport during rendering, but Chrome had no cached paint record for it.";
|
|
9118
|
-
var
|
|
9119
|
-
|
|
9126
|
+
var resizePaintTarget = ({
|
|
9127
|
+
target,
|
|
9120
9128
|
width,
|
|
9121
9129
|
height
|
|
9122
9130
|
}) => {
|
|
9123
|
-
if (
|
|
9124
|
-
|
|
9131
|
+
if (target.width !== width) {
|
|
9132
|
+
target.width = width;
|
|
9125
9133
|
}
|
|
9126
|
-
if (
|
|
9127
|
-
|
|
9134
|
+
if (target.height !== height) {
|
|
9135
|
+
target.height = height;
|
|
9128
9136
|
}
|
|
9129
9137
|
};
|
|
9130
9138
|
var defaultOnPaint = ({
|
|
@@ -9140,7 +9148,7 @@ var defaultOnPaint = ({
|
|
|
9140
9148
|
const transform = ctx.drawElementImage(elementImage, 0, 0);
|
|
9141
9149
|
element.style.transform = transform.toString();
|
|
9142
9150
|
};
|
|
9143
|
-
var HtmlInCanvasAncestorContext = createContext23(
|
|
9151
|
+
var HtmlInCanvasAncestorContext = createContext23(null);
|
|
9144
9152
|
var HtmlInCanvasContent = forwardRef9(({
|
|
9145
9153
|
width,
|
|
9146
9154
|
height,
|
|
@@ -9152,20 +9160,22 @@ var HtmlInCanvasContent = forwardRef9(({
|
|
|
9152
9160
|
controls,
|
|
9153
9161
|
style
|
|
9154
9162
|
}, ref) => {
|
|
9155
|
-
const
|
|
9163
|
+
const ancestor = useContext31(HtmlInCanvasAncestorContext);
|
|
9156
9164
|
assertHtmlInCanvasDimensions(width, height);
|
|
9157
9165
|
const resolvedPixelDensity = resolveHtmlInCanvasPixelDensity(pixelDensity);
|
|
9158
9166
|
const canvasWidth = Math.ceil(width * resolvedPixelDensity);
|
|
9159
9167
|
const canvasHeight = Math.ceil(height * resolvedPixelDensity);
|
|
9160
9168
|
const { continueRender: continueRender2, cancelRender: cancelRender2 } = useDelayRender();
|
|
9161
|
-
const { isRendering } = useRemotionEnvironment();
|
|
9169
|
+
const { isClientSideRendering, isRendering } = useRemotionEnvironment();
|
|
9170
|
+
const canRetryMissingPaintRecord = !isRendering || isClientSideRendering;
|
|
9171
|
+
const usesDirectLayoutCanvas = onPaint === undefined && onInit === undefined;
|
|
9162
9172
|
if (!isHtmlInCanvasSupported()) {
|
|
9163
9173
|
cancelRender2(new Error(HTML_IN_CANVAS_UNSUPPORTED_MESSAGE));
|
|
9164
9174
|
}
|
|
9165
9175
|
const canvas2dRef = useRef22(null);
|
|
9166
|
-
const
|
|
9176
|
+
const paintTargetRef = useRef22(null);
|
|
9167
9177
|
const divRef = useRef22(null);
|
|
9168
|
-
const canvasSizeKey = `${width}x${height}@${resolvedPixelDensity}`;
|
|
9178
|
+
const canvasSizeKey = `${width}x${height}@${resolvedPixelDensity}-${usesDirectLayoutCanvas ? "direct" : "offscreen"}`;
|
|
9169
9179
|
const setLayoutCanvasRef = useCallback16((node) => {
|
|
9170
9180
|
canvas2dRef.current = node;
|
|
9171
9181
|
if (typeof ref === "function") {
|
|
@@ -9188,17 +9198,19 @@ var HtmlInCanvasContent = forwardRef9(({
|
|
|
9188
9198
|
const initializedRef = useRef22(false);
|
|
9189
9199
|
const onInitCleanupRef = useRef22(null);
|
|
9190
9200
|
const unmountedRef = useRef22(false);
|
|
9201
|
+
const ancestorRef = useRef22(ancestor);
|
|
9202
|
+
ancestorRef.current = ancestor;
|
|
9191
9203
|
const onPaintCb = useCallback16(async () => {
|
|
9192
9204
|
const element = divRef.current;
|
|
9193
9205
|
if (!element) {
|
|
9194
9206
|
throw new Error("Canvas or scene element not found");
|
|
9195
9207
|
}
|
|
9196
|
-
const
|
|
9197
|
-
if (!
|
|
9198
|
-
throw new Error("HtmlInCanvas:
|
|
9208
|
+
const paintTarget = paintTargetRef.current;
|
|
9209
|
+
if (!paintTarget) {
|
|
9210
|
+
throw new Error("HtmlInCanvas: paint target is not ready because the canvas is remounting");
|
|
9199
9211
|
}
|
|
9200
|
-
|
|
9201
|
-
|
|
9212
|
+
resizePaintTarget({
|
|
9213
|
+
target: paintTarget,
|
|
9202
9214
|
width: canvasWidth,
|
|
9203
9215
|
height: canvasHeight
|
|
9204
9216
|
});
|
|
@@ -9209,22 +9221,30 @@ var HtmlInCanvasContent = forwardRef9(({
|
|
|
9209
9221
|
}
|
|
9210
9222
|
const handle = delayRender("onPaint");
|
|
9211
9223
|
if (!initializedRef.current) {
|
|
9212
|
-
|
|
9213
|
-
|
|
9214
|
-
|
|
9215
|
-
}
|
|
9216
|
-
|
|
9217
|
-
|
|
9218
|
-
|
|
9224
|
+
const currentOnInit = onInitRef.current;
|
|
9225
|
+
if (!currentOnInit) {
|
|
9226
|
+
initializedRef.current = true;
|
|
9227
|
+
} else {
|
|
9228
|
+
let initImage;
|
|
9229
|
+
try {
|
|
9230
|
+
initImage = placeholderCanvas.captureElementImage(element);
|
|
9231
|
+
} catch (error2) {
|
|
9232
|
+
if (isMissingPaintRecordError(error2) && canRetryMissingPaintRecord) {
|
|
9233
|
+
continueRender2(handle);
|
|
9234
|
+
return;
|
|
9235
|
+
}
|
|
9236
|
+
if (isMissingPaintRecordError(error2)) {
|
|
9237
|
+
throw new Error(missingPaintRecordMessage);
|
|
9238
|
+
}
|
|
9219
9239
|
throw error2;
|
|
9220
9240
|
}
|
|
9221
|
-
}
|
|
9222
|
-
if (initImage) {
|
|
9223
9241
|
initializedRef.current = true;
|
|
9224
|
-
|
|
9225
|
-
|
|
9242
|
+
try {
|
|
9243
|
+
if (paintTarget instanceof HTMLCanvasElement) {
|
|
9244
|
+
throw new Error("HtmlInCanvas: onInit requires an OffscreenCanvas paint target");
|
|
9245
|
+
}
|
|
9226
9246
|
const cleanup = await currentOnInit({
|
|
9227
|
-
canvas:
|
|
9247
|
+
canvas: paintTarget,
|
|
9228
9248
|
element,
|
|
9229
9249
|
elementImage: initImage,
|
|
9230
9250
|
pixelDensity: resolvedPixelDensity
|
|
@@ -9237,15 +9257,16 @@ var HtmlInCanvasContent = forwardRef9(({
|
|
|
9237
9257
|
} else {
|
|
9238
9258
|
onInitCleanupRef.current = cleanup;
|
|
9239
9259
|
}
|
|
9260
|
+
} finally {
|
|
9261
|
+
initImage.close();
|
|
9240
9262
|
}
|
|
9241
9263
|
}
|
|
9242
9264
|
}
|
|
9243
|
-
const handler = onPaintRef.current ?? defaultOnPaint;
|
|
9244
9265
|
let elImage;
|
|
9245
9266
|
try {
|
|
9246
9267
|
elImage = placeholderCanvas.captureElementImage(element);
|
|
9247
9268
|
} catch (error2) {
|
|
9248
|
-
if (isMissingPaintRecordError(error2) &&
|
|
9269
|
+
if (isMissingPaintRecordError(error2) && canRetryMissingPaintRecord) {
|
|
9249
9270
|
continueRender2(handle);
|
|
9250
9271
|
return;
|
|
9251
9272
|
}
|
|
@@ -9254,20 +9275,41 @@ var HtmlInCanvasContent = forwardRef9(({
|
|
|
9254
9275
|
}
|
|
9255
9276
|
throw error2;
|
|
9256
9277
|
}
|
|
9257
|
-
|
|
9258
|
-
|
|
9259
|
-
|
|
9260
|
-
|
|
9261
|
-
|
|
9262
|
-
|
|
9263
|
-
|
|
9264
|
-
|
|
9265
|
-
|
|
9266
|
-
|
|
9267
|
-
|
|
9268
|
-
|
|
9269
|
-
|
|
9270
|
-
|
|
9278
|
+
try {
|
|
9279
|
+
const currentOnPaint = onPaintRef.current;
|
|
9280
|
+
if (currentOnPaint) {
|
|
9281
|
+
if (paintTarget instanceof HTMLCanvasElement) {
|
|
9282
|
+
throw new Error("HtmlInCanvas: onPaint requires an OffscreenCanvas paint target");
|
|
9283
|
+
}
|
|
9284
|
+
const paintResult = currentOnPaint({
|
|
9285
|
+
canvas: paintTarget,
|
|
9286
|
+
element,
|
|
9287
|
+
elementImage: elImage,
|
|
9288
|
+
pixelDensity: resolvedPixelDensity
|
|
9289
|
+
});
|
|
9290
|
+
if (paintResult) {
|
|
9291
|
+
await paintResult;
|
|
9292
|
+
}
|
|
9293
|
+
} else {
|
|
9294
|
+
defaultOnPaint({
|
|
9295
|
+
canvas: paintTarget,
|
|
9296
|
+
element,
|
|
9297
|
+
elementImage: elImage,
|
|
9298
|
+
pixelDensity: resolvedPixelDensity
|
|
9299
|
+
});
|
|
9300
|
+
}
|
|
9301
|
+
await runEffectChain({
|
|
9302
|
+
state: chainState.get(canvasWidth, canvasHeight),
|
|
9303
|
+
source: paintTarget,
|
|
9304
|
+
effects: effectsRef.current,
|
|
9305
|
+
output: paintTarget,
|
|
9306
|
+
width: canvasWidth,
|
|
9307
|
+
height: canvasHeight
|
|
9308
|
+
});
|
|
9309
|
+
} finally {
|
|
9310
|
+
elImage.close();
|
|
9311
|
+
}
|
|
9312
|
+
ancestorRef.current?.requestParentPaint();
|
|
9271
9313
|
continueRender2(handle);
|
|
9272
9314
|
} catch (error2) {
|
|
9273
9315
|
cancelRender2(error2);
|
|
@@ -9279,7 +9321,7 @@ var HtmlInCanvasContent = forwardRef9(({
|
|
|
9279
9321
|
continueRender2,
|
|
9280
9322
|
cancelRender2,
|
|
9281
9323
|
resolvedPixelDensity,
|
|
9282
|
-
|
|
9324
|
+
canRetryMissingPaintRecord
|
|
9283
9325
|
]);
|
|
9284
9326
|
useLayoutEffect9(() => {
|
|
9285
9327
|
const placeholder = canvas2dRef.current;
|
|
@@ -9287,10 +9329,10 @@ var HtmlInCanvasContent = forwardRef9(({
|
|
|
9287
9329
|
throw new Error("Canvas not found");
|
|
9288
9330
|
}
|
|
9289
9331
|
placeholder.layoutSubtree = true;
|
|
9290
|
-
const
|
|
9291
|
-
|
|
9292
|
-
|
|
9293
|
-
|
|
9332
|
+
const paintTarget = usesDirectLayoutCanvas ? placeholder : placeholder.transferControlToOffscreen();
|
|
9333
|
+
paintTargetRef.current = paintTarget;
|
|
9334
|
+
resizePaintTarget({
|
|
9335
|
+
target: paintTarget,
|
|
9294
9336
|
width: canvasWidth,
|
|
9295
9337
|
height: canvasHeight
|
|
9296
9338
|
});
|
|
@@ -9299,13 +9341,19 @@ var HtmlInCanvasContent = forwardRef9(({
|
|
|
9299
9341
|
placeholder.addEventListener("paint", onPaintCb);
|
|
9300
9342
|
return () => {
|
|
9301
9343
|
placeholder.removeEventListener("paint", onPaintCb);
|
|
9302
|
-
|
|
9344
|
+
paintTargetRef.current = null;
|
|
9303
9345
|
initializedRef.current = false;
|
|
9304
9346
|
unmountedRef.current = true;
|
|
9305
9347
|
onInitCleanupRef.current?.();
|
|
9306
9348
|
onInitCleanupRef.current = null;
|
|
9307
9349
|
};
|
|
9308
|
-
}, [
|
|
9350
|
+
}, [
|
|
9351
|
+
onPaintCb,
|
|
9352
|
+
cancelRender2,
|
|
9353
|
+
canvasWidth,
|
|
9354
|
+
canvasHeight,
|
|
9355
|
+
usesDirectLayoutCanvas
|
|
9356
|
+
]);
|
|
9309
9357
|
const onPaintChangedRef = useRef22(false);
|
|
9310
9358
|
useLayoutEffect9(() => {
|
|
9311
9359
|
if (!onPaintChangedRef.current) {
|
|
@@ -9344,11 +9392,15 @@ var HtmlInCanvasContent = forwardRef9(({
|
|
|
9344
9392
|
...style ?? {}
|
|
9345
9393
|
};
|
|
9346
9394
|
}, [height, style, width]);
|
|
9347
|
-
|
|
9348
|
-
|
|
9349
|
-
|
|
9395
|
+
const ancestorValue = useMemo30(() => {
|
|
9396
|
+
return {
|
|
9397
|
+
requestParentPaint: () => {
|
|
9398
|
+
canvas2dRef.current?.requestPaint?.();
|
|
9399
|
+
}
|
|
9400
|
+
};
|
|
9401
|
+
}, []);
|
|
9350
9402
|
return /* @__PURE__ */ jsx25(HtmlInCanvasAncestorContext.Provider, {
|
|
9351
|
-
value:
|
|
9403
|
+
value: ancestorValue,
|
|
9352
9404
|
children: /* @__PURE__ */ jsx25("canvas", {
|
|
9353
9405
|
ref: setLayoutCanvasRef,
|
|
9354
9406
|
width: canvasWidth,
|
|
@@ -11969,8 +12021,7 @@ var Internals = {
|
|
|
11969
12021
|
fromField
|
|
11970
12022
|
};
|
|
11971
12023
|
// src/series/index.tsx
|
|
11972
|
-
import {
|
|
11973
|
-
Children,
|
|
12024
|
+
import React41, {
|
|
11974
12025
|
forwardRef as forwardRef14,
|
|
11975
12026
|
useMemo as useMemo38
|
|
11976
12027
|
} from "react";
|
|
@@ -11989,67 +12040,131 @@ var flattenChildren = (children) => {
|
|
|
11989
12040
|
};
|
|
11990
12041
|
|
|
11991
12042
|
// src/series/index.tsx
|
|
11992
|
-
import { jsx as jsx37 } from "react/jsx-runtime";
|
|
11993
|
-
var
|
|
12043
|
+
import { jsx as jsx37, jsxs as jsxs3, Fragment } from "react/jsx-runtime";
|
|
12044
|
+
var seriesSequenceSchema = {
|
|
12045
|
+
durationInFrames: Interactive.baseSchema.durationInFrames,
|
|
12046
|
+
name: Interactive.sequenceSchema.name,
|
|
12047
|
+
hidden: Interactive.sequenceSchema.hidden,
|
|
12048
|
+
showInTimeline: Interactive.sequenceSchema.showInTimeline,
|
|
12049
|
+
freeze: Interactive.baseSchema.freeze,
|
|
12050
|
+
layout: Interactive.sequenceSchema.layout
|
|
12051
|
+
};
|
|
12052
|
+
var SeriesSequenceInner = forwardRef14(({
|
|
12053
|
+
offset = 0,
|
|
12054
|
+
className = "",
|
|
12055
|
+
stack = null,
|
|
12056
|
+
_remotionInternalRender = null,
|
|
12057
|
+
...props2
|
|
12058
|
+
}, ref) => {
|
|
11994
12059
|
useRequireToBeInsideSeries();
|
|
12060
|
+
if (_remotionInternalRender) {
|
|
12061
|
+
return _remotionInternalRender({ ...props2, offset, className: className || undefined, stack }, ref);
|
|
12062
|
+
}
|
|
11995
12063
|
return /* @__PURE__ */ jsx37(IsNotInsideSeriesProvider, {
|
|
11996
|
-
children
|
|
12064
|
+
children: props2.children
|
|
11997
12065
|
});
|
|
11998
|
-
};
|
|
11999
|
-
var SeriesSequence =
|
|
12066
|
+
});
|
|
12067
|
+
var SeriesSequence = Interactive.withSchema({
|
|
12068
|
+
Component: SeriesSequenceInner,
|
|
12069
|
+
componentName: "<Series.Sequence>",
|
|
12070
|
+
componentIdentity: "dev.remotion.remotion.Series.Sequence",
|
|
12071
|
+
schema: seriesSequenceSchema,
|
|
12072
|
+
supportsEffects: false
|
|
12073
|
+
});
|
|
12000
12074
|
var SequenceWithoutSchemaWithRef = SequenceWithoutSchema;
|
|
12075
|
+
var validateSeriesSequenceProps = ({
|
|
12076
|
+
durationInFrames,
|
|
12077
|
+
offset: offsetProp,
|
|
12078
|
+
index,
|
|
12079
|
+
childrenLength
|
|
12080
|
+
}) => {
|
|
12081
|
+
const debugInfo = `index = ${index}, duration = ${durationInFrames}`;
|
|
12082
|
+
if (index !== childrenLength - 1 || durationInFrames !== Infinity) {
|
|
12083
|
+
validateDurationInFrames(durationInFrames, {
|
|
12084
|
+
component: `of a <Series.Sequence /> component`,
|
|
12085
|
+
allowFloats: true
|
|
12086
|
+
});
|
|
12087
|
+
}
|
|
12088
|
+
const offset = offsetProp ?? 0;
|
|
12089
|
+
if (Number.isNaN(offset)) {
|
|
12090
|
+
throw new TypeError(`The "offset" property of a <Series.Sequence /> must not be NaN, but got NaN (${debugInfo}).`);
|
|
12091
|
+
}
|
|
12092
|
+
if (!Number.isFinite(offset)) {
|
|
12093
|
+
throw new TypeError(`The "offset" property of a <Series.Sequence /> must be finite, but got ${offset} (${debugInfo}).`);
|
|
12094
|
+
}
|
|
12095
|
+
if (offset % 1 !== 0) {
|
|
12096
|
+
throw new TypeError(`The "offset" property of a <Series.Sequence /> must be finite, but got ${offset} (${debugInfo}).`);
|
|
12097
|
+
}
|
|
12098
|
+
return offset;
|
|
12099
|
+
};
|
|
12001
12100
|
var SeriesInner = (props2) => {
|
|
12002
12101
|
const childrenValue = useMemo38(() => {
|
|
12003
|
-
let startFrame = 0;
|
|
12004
12102
|
const flattenedChildren = flattenChildren(props2.children);
|
|
12005
|
-
|
|
12103
|
+
const renderChildren = (i, startFrame) => {
|
|
12104
|
+
if (i === flattenedChildren.length) {
|
|
12105
|
+
return null;
|
|
12106
|
+
}
|
|
12107
|
+
const child = flattenedChildren[i];
|
|
12006
12108
|
const castedChild = child;
|
|
12007
12109
|
if (typeof castedChild === "string") {
|
|
12008
12110
|
if (castedChild.trim() === "") {
|
|
12009
|
-
return
|
|
12111
|
+
return renderChildren(i + 1, startFrame);
|
|
12010
12112
|
}
|
|
12011
12113
|
throw new TypeError(`The <Series /> component only accepts a list of <Series.Sequence /> components as its children, but you passed a string "${castedChild}"`);
|
|
12012
12114
|
}
|
|
12013
12115
|
if (castedChild.type !== SeriesSequence) {
|
|
12014
12116
|
throw new TypeError(`The <Series /> component only accepts a list of <Series.Sequence /> components as its children, but got ${castedChild} instead`);
|
|
12015
12117
|
}
|
|
12016
|
-
const
|
|
12017
|
-
|
|
12018
|
-
|
|
12019
|
-
|
|
12020
|
-
|
|
12021
|
-
|
|
12022
|
-
name,
|
|
12023
|
-
...passedProps
|
|
12024
|
-
} = castedChild.props;
|
|
12025
|
-
if (i !== flattenedChildren.length - 1 || durationInFramesProp !== Infinity) {
|
|
12026
|
-
validateDurationInFrames(durationInFramesProp, {
|
|
12027
|
-
component: `of a <Series.Sequence /> component`,
|
|
12028
|
-
allowFloats: true
|
|
12029
|
-
});
|
|
12030
|
-
}
|
|
12031
|
-
const offset = castedChild.props.offset ?? 0;
|
|
12032
|
-
if (Number.isNaN(offset)) {
|
|
12033
|
-
throw new TypeError(`The "offset" property of a <Series.Sequence /> must not be NaN, but got NaN (${debugInfo}).`);
|
|
12034
|
-
}
|
|
12035
|
-
if (!Number.isFinite(offset)) {
|
|
12036
|
-
throw new TypeError(`The "offset" property of a <Series.Sequence /> must be finite, but got ${offset} (${debugInfo}).`);
|
|
12037
|
-
}
|
|
12038
|
-
if (offset % 1 !== 0) {
|
|
12039
|
-
throw new TypeError(`The "offset" property of a <Series.Sequence /> must be finite, but got ${offset} (${debugInfo}).`);
|
|
12040
|
-
}
|
|
12041
|
-
const currentStartFrame = startFrame + offset;
|
|
12042
|
-
startFrame += durationInFramesProp + offset;
|
|
12043
|
-
return /* @__PURE__ */ jsx37(SequenceWithoutSchemaWithRef, {
|
|
12044
|
-
ref: castedChild.ref,
|
|
12045
|
-
name: name || "<Series.Sequence>",
|
|
12046
|
-
_remotionInternalDocumentationLink: name ? undefined : "https://www.remotion.dev/docs/series",
|
|
12047
|
-
from: currentStartFrame,
|
|
12048
|
-
durationInFrames: durationInFramesProp,
|
|
12049
|
-
...passedProps,
|
|
12050
|
-
children: child
|
|
12118
|
+
const castedElement = castedChild;
|
|
12119
|
+
validateSeriesSequenceProps({
|
|
12120
|
+
durationInFrames: castedElement.props.durationInFrames,
|
|
12121
|
+
offset: castedElement.props.offset,
|
|
12122
|
+
index: i,
|
|
12123
|
+
childrenLength: flattenedChildren.length
|
|
12051
12124
|
});
|
|
12052
|
-
|
|
12125
|
+
return React41.cloneElement(castedElement, {
|
|
12126
|
+
_remotionInternalRender: (resolvedProps, ref) => {
|
|
12127
|
+
const durationInFramesProp = resolvedProps.durationInFrames;
|
|
12128
|
+
const {
|
|
12129
|
+
durationInFrames: _durationInFrames,
|
|
12130
|
+
children: sequenceChildren,
|
|
12131
|
+
offset: offsetProp,
|
|
12132
|
+
controls,
|
|
12133
|
+
stack,
|
|
12134
|
+
from: _from,
|
|
12135
|
+
name,
|
|
12136
|
+
...passedProps
|
|
12137
|
+
} = resolvedProps;
|
|
12138
|
+
const offset = validateSeriesSequenceProps({
|
|
12139
|
+
durationInFrames: durationInFramesProp,
|
|
12140
|
+
offset: offsetProp,
|
|
12141
|
+
index: i,
|
|
12142
|
+
childrenLength: flattenedChildren.length
|
|
12143
|
+
});
|
|
12144
|
+
const currentStartFrame = startFrame + offset;
|
|
12145
|
+
const nextStartFrame = startFrame + durationInFramesProp + offset;
|
|
12146
|
+
return /* @__PURE__ */ jsxs3(Fragment, {
|
|
12147
|
+
children: [
|
|
12148
|
+
/* @__PURE__ */ jsx37(SequenceWithoutSchemaWithRef, {
|
|
12149
|
+
ref,
|
|
12150
|
+
name: name || "<Series.Sequence>",
|
|
12151
|
+
_remotionInternalDocumentationLink: name ? undefined : "https://www.remotion.dev/docs/series",
|
|
12152
|
+
_remotionInternalStack: stack ?? undefined,
|
|
12153
|
+
controls: controls ?? undefined,
|
|
12154
|
+
from: currentStartFrame,
|
|
12155
|
+
durationInFrames: durationInFramesProp,
|
|
12156
|
+
...passedProps,
|
|
12157
|
+
children: /* @__PURE__ */ jsx37(IsNotInsideSeriesProvider, {
|
|
12158
|
+
children: sequenceChildren
|
|
12159
|
+
})
|
|
12160
|
+
}),
|
|
12161
|
+
renderChildren(i + 1, nextStartFrame)
|
|
12162
|
+
]
|
|
12163
|
+
});
|
|
12164
|
+
}
|
|
12165
|
+
});
|
|
12166
|
+
};
|
|
12167
|
+
return renderChildren(0, 0);
|
|
12053
12168
|
}, [props2.children]);
|
|
12054
12169
|
return /* @__PURE__ */ jsx37(IsInsideSeriesContainer, {
|
|
12055
12170
|
children: /* @__PURE__ */ jsx37(Sequence, {
|
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.491",
|
|
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.
|
|
38
|
+
"@remotion/eslint-config-internal": "4.0.491",
|
|
39
39
|
"eslint": "9.19.0",
|
|
40
40
|
"@typescript/native-preview": "7.0.0-dev.20260217.1"
|
|
41
41
|
},
|