@remotion/transitions 4.0.489 → 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.
@@ -1097,7 +1097,7 @@ var springTiming = (options = {}) => {
1097
1097
  };
1098
1098
  };
1099
1099
  // src/TransitionSeries.tsx
1100
- import { Children, useCallback as useCallback2, useMemo as useMemo4, useRef as useRef2 } from "react";
1100
+ import React4, { useCallback as useCallback2, useMemo as useMemo4, useRef as useRef2 } from "react";
1101
1101
  import {
1102
1102
  Internals as Internals2,
1103
1103
  Interactive,
@@ -1153,19 +1153,78 @@ import { NoReactInternals } from "remotion/no-react";
1153
1153
  var validateDurationInFrames = NoReactInternals.validateDurationInFrames;
1154
1154
 
1155
1155
  // src/TransitionSeries.tsx
1156
- import { jsx as jsx4, Fragment } from "react/jsx-runtime";
1156
+ import { jsx as jsx4, jsxs, Fragment } from "react/jsx-runtime";
1157
1157
  var { SequenceWithoutSchema } = Internals2;
1158
- var TransitionSeriesTransition = function(_props) {
1158
+ var TransitionSeriesTransitionInner = ({
1159
+ stack = null,
1160
+ _remotionInternalRender = null,
1161
+ ...props
1162
+ }) => {
1163
+ if (_remotionInternalRender) {
1164
+ return _remotionInternalRender({ ...props, stack });
1165
+ }
1159
1166
  return null;
1160
1167
  };
1161
- var SeriesOverlay = () => {
1168
+ var transitionSeriesTransitionSchema = {};
1169
+ var TransitionSeriesTransition = Interactive.withSchema({
1170
+ Component: TransitionSeriesTransitionInner,
1171
+ componentName: "<TransitionSeries.Transition>",
1172
+ componentIdentity: "dev.remotion.transitions.TransitionSeries.Transition",
1173
+ schema: transitionSeriesTransitionSchema,
1174
+ supportsEffects: false
1175
+ });
1176
+ var SeriesOverlayInner = ({
1177
+ stack = null,
1178
+ _remotionInternalRender = null,
1179
+ ...props
1180
+ }) => {
1181
+ if (_remotionInternalRender) {
1182
+ return _remotionInternalRender({ ...props, stack });
1183
+ }
1162
1184
  return null;
1163
1185
  };
1164
- var SeriesSequence = ({ children }) => {
1186
+ var transitionSeriesOverlaySchema = {};
1187
+ var SeriesOverlay = Interactive.withSchema({
1188
+ Component: SeriesOverlayInner,
1189
+ componentName: "<TransitionSeries.Overlay>",
1190
+ componentIdentity: "dev.remotion.transitions.TransitionSeries.Overlay",
1191
+ schema: transitionSeriesOverlaySchema,
1192
+ supportsEffects: false
1193
+ });
1194
+ var transitionSeriesSequenceSchema = {
1195
+ durationInFrames: Internals2.durationInFramesField,
1196
+ name: Internals2.sequenceSchema.name,
1197
+ hidden: Internals2.sequenceSchema.hidden,
1198
+ showInTimeline: Internals2.sequenceSchema.showInTimeline,
1199
+ freeze: Internals2.freezeField,
1200
+ layout: Internals2.sequenceSchema.layout
1201
+ };
1202
+ var SeriesSequenceInner = ({
1203
+ offset = 0,
1204
+ className = "",
1205
+ stack = null,
1206
+ _remotionInternalRender = null,
1207
+ ...props
1208
+ }) => {
1209
+ if (_remotionInternalRender) {
1210
+ return _remotionInternalRender({
1211
+ ...props,
1212
+ offset,
1213
+ className: className || undefined,
1214
+ stack
1215
+ });
1216
+ }
1165
1217
  return /* @__PURE__ */ jsx4(Fragment, {
1166
- children
1218
+ children: props.children
1167
1219
  });
1168
1220
  };
1221
+ var SeriesSequence = Interactive.withSchema({
1222
+ Component: SeriesSequenceInner,
1223
+ componentName: "<TransitionSeries.Sequence>",
1224
+ componentIdentity: "dev.remotion.transitions.TransitionSeries.Sequence",
1225
+ schema: transitionSeriesSequenceSchema,
1226
+ supportsEffects: false
1227
+ });
1169
1228
  var transitionSeriesSchema = {
1170
1229
  name: Internals2.sequenceSchema.name,
1171
1230
  hidden: Internals2.sequenceSchema.hidden,
@@ -1211,16 +1270,35 @@ var TransitionSeriesChildren = ({
1211
1270
  drawIfSynced(index);
1212
1271
  }, [drawIfSynced]);
1213
1272
  const childrenValue = useMemo4(() => {
1214
- let transitionOffsets = 0;
1215
- let startFrame = 0;
1216
- const overlayRenders = [];
1217
- const sequenceDurations = [];
1218
- let pendingOverlayValidation = false;
1219
- const mainChildren = Children.map(flattedChildren, (child, i) => {
1273
+ const renderChildren = (state) => {
1274
+ const {
1275
+ index: i,
1276
+ transitionOffsets,
1277
+ startFrame,
1278
+ overlayRenders,
1279
+ sequenceDurations,
1280
+ pendingOverlayValidation
1281
+ } = state;
1282
+ if (i === flattedChildren.length) {
1283
+ return overlayRenders.map((info) => /* @__PURE__ */ jsx4(SequenceWithoutSchema, {
1284
+ from: Math.round(info.overlayFrom),
1285
+ durationInFrames: info.durationInFrames,
1286
+ name: "<TS.Overlay>",
1287
+ _remotionInternalDocumentationLink: "https://www.remotion.dev/docs/transitions/transitionseries",
1288
+ _remotionInternalStack: info.stack ?? undefined,
1289
+ controls: info.controls ?? undefined,
1290
+ layout: "absolute-fill",
1291
+ children: info.children
1292
+ }, `overlay-${info.index}`));
1293
+ }
1294
+ const child = flattedChildren[i];
1220
1295
  const current = child;
1296
+ const renderNext = (overrides = {}) => {
1297
+ return renderChildren({ ...state, ...overrides, index: i + 1 });
1298
+ };
1221
1299
  if (typeof current === "string") {
1222
1300
  if (current.trim() === "") {
1223
- return null;
1301
+ return renderNext();
1224
1302
  }
1225
1303
  throw new TypeError(`The <TransitionSeries /> component only accepts a list of <TransitionSeries.Sequence /> components as its children, but you passed a string "${current}"`);
1226
1304
  }
@@ -1239,45 +1317,53 @@ var TransitionSeriesChildren = ({
1239
1317
  if (nextIsTransition) {
1240
1318
  throw new TypeError(`A <TransitionSeries.Overlay /> component must not be followed by a <TransitionSeries.Transition /> component (nth children = ${i} and ${i + 1})`);
1241
1319
  }
1242
- const overlayProps = current.props;
1243
- validateDurationInFrames(overlayProps.durationInFrames, {
1244
- component: `of a <TransitionSeries.Overlay /> component`,
1245
- allowFloats: false
1246
- });
1247
- const overlayOffset = overlayProps.offset ?? 0;
1248
- if (Number.isNaN(overlayOffset)) {
1249
- throw new TypeError(`The "offset" property of a <TransitionSeries.Overlay /> must not be NaN, but got NaN.`);
1250
- }
1251
- if (!Number.isFinite(overlayOffset)) {
1252
- throw new TypeError(`The "offset" property of a <TransitionSeries.Overlay /> must be finite, but got ${overlayOffset}.`);
1253
- }
1254
- if (overlayOffset % 1 !== 0) {
1255
- throw new TypeError(`The "offset" property of a <TransitionSeries.Overlay /> must be an integer, but got ${overlayOffset}.`);
1256
- }
1257
- const cutPoint = startFrame + transitionOffsets;
1258
- const halfDuration = overlayProps.durationInFrames / 2;
1259
- const overlayFrom = cutPoint - halfDuration + overlayOffset;
1260
- if (overlayFrom < 0) {
1261
- throw new TypeError(`A <TransitionSeries.Overlay /> extends before frame 0. The overlay starts at frame ${overlayFrom}. Reduce the duration or adjust the offset.`);
1262
- }
1263
- const prevSeqIdx = sequenceDurations.length - 1;
1264
- if (prevSeqIdx >= 0) {
1265
- const overlayStartInPrev = halfDuration - overlayOffset;
1266
- if (overlayStartInPrev > sequenceDurations[prevSeqIdx]) {
1267
- throw new TypeError(`A <TransitionSeries.Overlay /> extends beyond the previous sequence. The overlay needs ${overlayStartInPrev} frames before the cut, but the previous sequence is only ${sequenceDurations[prevSeqIdx]} frames long.`);
1320
+ const castedOverlay = current;
1321
+ return React4.cloneElement(castedOverlay, {
1322
+ _remotionInternalRender: (overlayProps) => {
1323
+ validateDurationInFrames(overlayProps.durationInFrames, {
1324
+ component: `of a <TransitionSeries.Overlay /> component`,
1325
+ allowFloats: false
1326
+ });
1327
+ const overlayOffset = overlayProps.offset ?? 0;
1328
+ if (Number.isNaN(overlayOffset)) {
1329
+ throw new TypeError(`The "offset" property of a <TransitionSeries.Overlay /> must not be NaN, but got NaN.`);
1330
+ }
1331
+ if (!Number.isFinite(overlayOffset)) {
1332
+ throw new TypeError(`The "offset" property of a <TransitionSeries.Overlay /> must be finite, but got ${overlayOffset}.`);
1333
+ }
1334
+ if (overlayOffset % 1 !== 0) {
1335
+ throw new TypeError(`The "offset" property of a <TransitionSeries.Overlay /> must be an integer, but got ${overlayOffset}.`);
1336
+ }
1337
+ const cutPoint = startFrame + transitionOffsets;
1338
+ const halfDuration = overlayProps.durationInFrames / 2;
1339
+ const overlayFrom = cutPoint - halfDuration + overlayOffset;
1340
+ if (overlayFrom < 0) {
1341
+ throw new TypeError(`A <TransitionSeries.Overlay /> extends before frame 0. The overlay starts at frame ${overlayFrom}. Reduce the duration or adjust the offset.`);
1342
+ }
1343
+ const prevSeqIdx = sequenceDurations.length - 1;
1344
+ if (prevSeqIdx >= 0) {
1345
+ const overlayStartInPrev = halfDuration - overlayOffset;
1346
+ if (overlayStartInPrev > sequenceDurations[prevSeqIdx]) {
1347
+ throw new TypeError(`A <TransitionSeries.Overlay /> extends beyond the previous sequence. The overlay needs ${overlayStartInPrev} frames before the cut, but the previous sequence is only ${sequenceDurations[prevSeqIdx]} frames long.`);
1348
+ }
1349
+ }
1350
+ const overlayRender = {
1351
+ cutPoint,
1352
+ overlayFrom,
1353
+ durationInFrames: overlayProps.durationInFrames,
1354
+ overlayOffset,
1355
+ halfDuration,
1356
+ children: overlayProps.children,
1357
+ index: i,
1358
+ controls: overlayProps.controls,
1359
+ stack: overlayProps.stack
1360
+ };
1361
+ return renderNext({
1362
+ overlayRenders: [...overlayRenders, overlayRender],
1363
+ pendingOverlayValidation: true
1364
+ });
1268
1365
  }
1269
- }
1270
- pendingOverlayValidation = true;
1271
- overlayRenders.push({
1272
- cutPoint,
1273
- overlayFrom,
1274
- durationInFrames: overlayProps.durationInFrames,
1275
- overlayOffset,
1276
- halfDuration,
1277
- children: overlayProps.children,
1278
- index: i
1279
1366
  });
1280
- return null;
1281
1367
  }
1282
1368
  if (current.type === TransitionSeriesTransition) {
1283
1369
  if (prevIsTransition) {
@@ -1286,7 +1372,27 @@ var TransitionSeriesChildren = ({
1286
1372
  if (prevIsOverlay) {
1287
1373
  throw new TypeError(`A <TransitionSeries.Overlay /> component must not be followed by a <TransitionSeries.Transition /> component (nth children = ${i - 1} and ${i})`);
1288
1374
  }
1289
- return null;
1375
+ const castedTransition = current;
1376
+ return React4.cloneElement(castedTransition, {
1377
+ _remotionInternalRender: (transitionProps) => {
1378
+ const transitionDuration = transitionProps.timing.getDurationInFrames({ fps });
1379
+ const transitionFrom = startFrame + transitionOffsets - transitionDuration;
1380
+ return /* @__PURE__ */ jsxs(Fragment, {
1381
+ children: [
1382
+ transitionDuration > 0 ? /* @__PURE__ */ jsx4(SequenceWithoutSchema, {
1383
+ from: transitionFrom,
1384
+ durationInFrames: transitionDuration,
1385
+ name: "<TS.Transition>",
1386
+ _remotionInternalDocumentationLink: "https://www.remotion.dev/docs/transitions/transitionseries",
1387
+ _remotionInternalStack: transitionProps.stack ?? undefined,
1388
+ controls: transitionProps.controls ?? undefined,
1389
+ layout: "none"
1390
+ }) : null,
1391
+ renderNext()
1392
+ ]
1393
+ });
1394
+ }
1395
+ });
1290
1396
  }
1291
1397
  if (current.type !== SeriesSequence) {
1292
1398
  throw new TypeError(`The <TransitionSeries /> component only accepts a list of <TransitionSeries.Sequence />, <TransitionSeries.Transition />, and <TransitionSeries.Overlay /> components as its children, but got ${current} instead`);
@@ -1294,186 +1400,219 @@ var TransitionSeriesChildren = ({
1294
1400
  const prev = typeof hasPrev === "string" || typeof hasPrev === "undefined" ? null : hasPrev.type === TransitionSeriesTransition ? hasPrev : null;
1295
1401
  const next = typeof nextPrev === "string" || typeof nextPrev === "undefined" ? null : nextPrev.type === TransitionSeriesTransition ? nextPrev : null;
1296
1402
  const castedChildAgain = current;
1297
- const debugInfo = `index = ${i}, duration = ${castedChildAgain.props.durationInFrames}`;
1298
- const durationInFramesProp = castedChildAgain.props.durationInFrames;
1299
- const {
1300
- durationInFrames,
1301
- children: _children,
1302
- from: _from,
1303
- ...passedProps
1304
- } = castedChildAgain.props;
1305
- validateDurationInFrames(durationInFramesProp, {
1306
- component: `of a <TransitionSeries.Sequence /> component`,
1307
- allowFloats: true
1308
- });
1309
- const offset = castedChildAgain.props.offset ?? 0;
1310
- if (Number.isNaN(offset)) {
1311
- throw new TypeError(`The "offset" property of a <TransitionSeries.Sequence /> must not be NaN, but got NaN (${debugInfo}).`);
1312
- }
1313
- if (!Number.isFinite(offset)) {
1314
- throw new TypeError(`The "offset" property of a <TransitionSeries.Sequence /> must be finite, but got ${offset} (${debugInfo}).`);
1315
- }
1316
- if (offset % 1 !== 0) {
1317
- throw new TypeError(`The "offset" property of a <TransitionSeries.Sequence /> must be finite, but got ${offset} (${debugInfo}).`);
1318
- }
1319
- const currentStartFrame = startFrame + offset;
1320
- let duration = 0;
1321
- if (prev) {
1322
- duration = prev.props.timing.getDurationInFrames({
1323
- fps
1324
- });
1325
- transitionOffsets -= duration;
1326
- }
1327
- let actualStartFrame = currentStartFrame + transitionOffsets;
1328
- startFrame += durationInFramesProp + offset;
1329
- if (actualStartFrame < 0) {
1330
- startFrame -= actualStartFrame;
1331
- actualStartFrame = 0;
1332
- }
1333
- sequenceDurations.push(durationInFramesProp);
1334
- if (pendingOverlayValidation) {
1335
- pendingOverlayValidation = false;
1336
- const lastOverlay = overlayRenders[overlayRenders.length - 1];
1337
- const framesAfterCut = lastOverlay.halfDuration + lastOverlay.overlayOffset;
1338
- if (framesAfterCut > durationInFramesProp) {
1339
- throw new TypeError(`A <TransitionSeries.Overlay /> extends beyond the next sequence. The overlay needs ${framesAfterCut} frames after the cut, but the next sequence is only ${durationInFramesProp} frames long.`);
1340
- }
1341
- }
1342
- const nextProgress = next ? next.props.timing.getProgress({
1343
- frame: frame - actualStartFrame - durationInFrames + next.props.timing.getDurationInFrames({ fps }),
1344
- fps
1345
- }) : null;
1346
- const prevProgress = prev ? prev.props.timing.getProgress({
1347
- frame: frame - actualStartFrame,
1348
- fps
1349
- }) : null;
1350
- if (next && durationInFramesProp < next.props.timing.getDurationInFrames({ fps })) {
1351
- throw new Error(`The duration of a <TransitionSeries.Sequence /> must not be shorter than the duration of the next <TransitionSeries.Transition />. The transition is ${next.props.timing.getDurationInFrames({ fps })} frames long, but the sequence is only ${durationInFramesProp} frames long (${debugInfo})`);
1352
- }
1353
- if (prev && durationInFramesProp < prev.props.timing.getDurationInFrames({ fps })) {
1354
- throw new Error(`The duration of a <TransitionSeries.Sequence /> must not be shorter than the duration of the previous <TransitionSeries.Transition />. The transition is ${prev.props.timing.getDurationInFrames({ fps })} frames long, but the sequence is only ${durationInFramesProp} frames long (${debugInfo})`);
1355
- }
1356
- if (next && prev && nextProgress !== null && prevProgress !== null) {
1357
- const nextPresentation = next.props.presentation ?? slide();
1358
- const prevPresentation = prev.props.presentation ?? slide();
1359
- const UppercaseNextPresentation = nextPresentation.component;
1360
- const UppercasePrevPresentation = prevPresentation.component;
1361
- return /* @__PURE__ */ jsx4(SequenceWithoutSchema, {
1362
- from: actualStartFrame,
1363
- durationInFrames: durationInFramesProp,
1364
- ...passedProps,
1365
- name: passedProps.name || "<TS.Sequence>",
1366
- _remotionInternalDocumentationLink: passedProps.name ? undefined : "https://www.remotion.dev/docs/transitions/transitionseries",
1367
- children: /* @__PURE__ */ jsx4(UppercaseNextPresentation, {
1368
- passedProps: nextPresentation.props ?? {},
1369
- presentationDirection: "exiting",
1370
- presentationProgress: nextProgress,
1371
- presentationDurationInFrames: next.props.timing.getDurationInFrames({ fps }),
1372
- onElementImage: () => {
1373
- throw new Error("Should not call when exiting");
1374
- },
1375
- onUnmount: () => {
1376
- throw new Error("Should not call when exiting");
1377
- },
1378
- bothEnteringAndExiting: true,
1379
- children: /* @__PURE__ */ jsx4(WrapInExitingProgressContext, {
1380
- presentationProgress: nextProgress,
1403
+ return React4.cloneElement(castedChildAgain, {
1404
+ _remotionInternalRender: (resolvedProps) => {
1405
+ const durationInFramesProp = resolvedProps.durationInFrames;
1406
+ const debugInfo = `index = ${i}, duration = ${durationInFramesProp}`;
1407
+ const {
1408
+ durationInFrames,
1409
+ children: sequenceChildren,
1410
+ offset: offsetProp,
1411
+ controls,
1412
+ stack,
1413
+ from: _from,
1414
+ ...passedProps
1415
+ } = resolvedProps;
1416
+ validateDurationInFrames(durationInFramesProp, {
1417
+ component: `of a <TransitionSeries.Sequence /> component`,
1418
+ allowFloats: true
1419
+ });
1420
+ const offset = offsetProp ?? 0;
1421
+ if (Number.isNaN(offset)) {
1422
+ throw new TypeError(`The "offset" property of a <TransitionSeries.Sequence /> must not be NaN, but got NaN (${debugInfo}).`);
1423
+ }
1424
+ if (!Number.isFinite(offset)) {
1425
+ throw new TypeError(`The "offset" property of a <TransitionSeries.Sequence /> must be finite, but got ${offset} (${debugInfo}).`);
1426
+ }
1427
+ if (offset % 1 !== 0) {
1428
+ throw new TypeError(`The "offset" property of a <TransitionSeries.Sequence /> must be finite, but got ${offset} (${debugInfo}).`);
1429
+ }
1430
+ let resolvedTransitionOffsets = transitionOffsets;
1431
+ let resolvedStartFrame = startFrame;
1432
+ let resolvedPendingOverlayValidation = pendingOverlayValidation;
1433
+ const currentStartFrame = resolvedStartFrame + offset;
1434
+ let duration = 0;
1435
+ if (prev) {
1436
+ duration = prev.props.timing.getDurationInFrames({
1437
+ fps
1438
+ });
1439
+ resolvedTransitionOffsets -= duration;
1440
+ }
1441
+ let actualStartFrame = currentStartFrame + resolvedTransitionOffsets;
1442
+ resolvedStartFrame += durationInFramesProp + offset;
1443
+ if (actualStartFrame < 0) {
1444
+ resolvedStartFrame -= actualStartFrame;
1445
+ actualStartFrame = 0;
1446
+ }
1447
+ const nextSequenceDurations = [
1448
+ ...sequenceDurations,
1449
+ durationInFramesProp
1450
+ ];
1451
+ if (resolvedPendingOverlayValidation) {
1452
+ resolvedPendingOverlayValidation = false;
1453
+ const lastOverlay = overlayRenders[overlayRenders.length - 1];
1454
+ if (!lastOverlay) {
1455
+ throw new Error("Expected an overlay to validate");
1456
+ }
1457
+ const framesAfterCut = lastOverlay.halfDuration + lastOverlay.overlayOffset;
1458
+ if (framesAfterCut > durationInFramesProp) {
1459
+ throw new TypeError(`A <TransitionSeries.Overlay /> extends beyond the next sequence. The overlay needs ${framesAfterCut} frames after the cut, but the next sequence is only ${durationInFramesProp} frames long.`);
1460
+ }
1461
+ }
1462
+ const renderSequenceAndRest = (sequence) => {
1463
+ return /* @__PURE__ */ jsxs(Fragment, {
1464
+ children: [
1465
+ sequence,
1466
+ renderNext({
1467
+ transitionOffsets: resolvedTransitionOffsets,
1468
+ startFrame: resolvedStartFrame,
1469
+ sequenceDurations: nextSequenceDurations,
1470
+ pendingOverlayValidation: resolvedPendingOverlayValidation
1471
+ })
1472
+ ]
1473
+ });
1474
+ };
1475
+ const nextProgress = next ? next.props.timing.getProgress({
1476
+ frame: frame - actualStartFrame - durationInFrames + next.props.timing.getDurationInFrames({ fps }),
1477
+ fps
1478
+ }) : null;
1479
+ const prevProgress = prev ? prev.props.timing.getProgress({
1480
+ frame: frame - actualStartFrame,
1481
+ fps
1482
+ }) : null;
1483
+ if (next && durationInFramesProp < next.props.timing.getDurationInFrames({ fps })) {
1484
+ throw new Error(`The duration of a <TransitionSeries.Sequence /> must not be shorter than the duration of the next <TransitionSeries.Transition />. The transition is ${next.props.timing.getDurationInFrames({ fps })} frames long, but the sequence is only ${durationInFramesProp} frames long (${debugInfo})`);
1485
+ }
1486
+ if (prev && durationInFramesProp < prev.props.timing.getDurationInFrames({ fps })) {
1487
+ throw new Error(`The duration of a <TransitionSeries.Sequence /> must not be shorter than the duration of the previous <TransitionSeries.Transition />. The transition is ${prev.props.timing.getDurationInFrames({ fps })} frames long, but the sequence is only ${durationInFramesProp} frames long (${debugInfo})`);
1488
+ }
1489
+ if (next && prev && nextProgress !== null && prevProgress !== null) {
1490
+ const nextPresentation = next.props.presentation ?? slide();
1491
+ const prevPresentation = prev.props.presentation ?? slide();
1492
+ const UppercaseNextPresentation = nextPresentation.component;
1493
+ const UppercasePrevPresentation = prevPresentation.component;
1494
+ return renderSequenceAndRest(/* @__PURE__ */ jsx4(SequenceWithoutSchema, {
1495
+ from: actualStartFrame,
1496
+ durationInFrames: durationInFramesProp,
1497
+ ...passedProps,
1498
+ name: passedProps.name || "<TS.Sequence>",
1499
+ _remotionInternalDocumentationLink: passedProps.name ? undefined : "https://www.remotion.dev/docs/transitions/transitionseries",
1500
+ _remotionInternalStack: stack ?? undefined,
1501
+ controls: controls ?? undefined,
1502
+ children: /* @__PURE__ */ jsx4(UppercaseNextPresentation, {
1503
+ passedProps: nextPresentation.props ?? {},
1504
+ presentationDirection: "exiting",
1505
+ presentationProgress: nextProgress,
1506
+ presentationDurationInFrames: next.props.timing.getDurationInFrames({ fps }),
1507
+ onElementImage: () => {
1508
+ throw new Error("Should not call when exiting");
1509
+ },
1510
+ onUnmount: () => {
1511
+ throw new Error("Should not call when exiting");
1512
+ },
1513
+ bothEnteringAndExiting: true,
1514
+ children: /* @__PURE__ */ jsx4(WrapInExitingProgressContext, {
1515
+ presentationProgress: nextProgress,
1516
+ children: /* @__PURE__ */ jsx4(UppercasePrevPresentation, {
1517
+ passedProps: prevPresentation.props ?? {},
1518
+ presentationDirection: "entering",
1519
+ presentationProgress: prevProgress,
1520
+ presentationDurationInFrames: prev.props.timing.getDurationInFrames({ fps }),
1521
+ onElementImage: (elementImage, draw) => {
1522
+ onPrevElementImage(elementImage, nextProgress, draw, i + 1);
1523
+ onNextElementImage(elementImage, prevProgress, draw, i - 1);
1524
+ },
1525
+ onUnmount: () => {
1526
+ onPrevElementImage(null, null, null, i + 1);
1527
+ onNextElementImage(null, null, null, i - 1);
1528
+ },
1529
+ bothEnteringAndExiting: true,
1530
+ children: /* @__PURE__ */ jsx4(WrapInEnteringProgressContext, {
1531
+ presentationProgress: prevProgress,
1532
+ children: sequenceChildren
1533
+ })
1534
+ })
1535
+ })
1536
+ })
1537
+ }, i));
1538
+ }
1539
+ if (prevProgress !== null && prev) {
1540
+ const prevPresentation = prev.props.presentation ?? slide();
1541
+ const UppercasePrevPresentation = prevPresentation.component;
1542
+ return renderSequenceAndRest(/* @__PURE__ */ jsx4(SequenceWithoutSchema, {
1543
+ from: actualStartFrame,
1544
+ durationInFrames: durationInFramesProp,
1545
+ ...passedProps,
1546
+ name: passedProps.name || "<TS.Sequence>",
1547
+ _remotionInternalDocumentationLink: passedProps.name ? undefined : "https://www.remotion.dev/docs/transitions/transitionseries",
1548
+ _remotionInternalStack: stack ?? undefined,
1549
+ controls: controls ?? undefined,
1381
1550
  children: /* @__PURE__ */ jsx4(UppercasePrevPresentation, {
1382
1551
  passedProps: prevPresentation.props ?? {},
1383
1552
  presentationDirection: "entering",
1384
1553
  presentationProgress: prevProgress,
1385
1554
  presentationDurationInFrames: prev.props.timing.getDurationInFrames({ fps }),
1386
- onElementImage: (elementImage, draw) => {
1387
- onPrevElementImage(elementImage, nextProgress, draw, i + 1);
1388
- onNextElementImage(elementImage, prevProgress, draw, i - 1);
1389
- },
1555
+ onElementImage: (elementImage, draw) => onNextElementImage(elementImage, prevProgress, draw, i - 1),
1390
1556
  onUnmount: () => {
1391
- onPrevElementImage(null, null, null, i + 1);
1392
1557
  onNextElementImage(null, null, null, i - 1);
1393
1558
  },
1394
- bothEnteringAndExiting: true,
1559
+ bothEnteringAndExiting: false,
1395
1560
  children: /* @__PURE__ */ jsx4(WrapInEnteringProgressContext, {
1396
1561
  presentationProgress: prevProgress,
1397
- children: child
1562
+ children: sequenceChildren
1398
1563
  })
1399
1564
  })
1400
- })
1401
- })
1402
- }, i);
1403
- }
1404
- if (prevProgress !== null && prev) {
1405
- const prevPresentation = prev.props.presentation ?? slide();
1406
- const UppercasePrevPresentation = prevPresentation.component;
1407
- return /* @__PURE__ */ jsx4(SequenceWithoutSchema, {
1408
- from: actualStartFrame,
1409
- durationInFrames: durationInFramesProp,
1410
- ...passedProps,
1411
- name: passedProps.name || "<TS.Sequence>",
1412
- _remotionInternalDocumentationLink: passedProps.name ? undefined : "https://www.remotion.dev/docs/transitions/transitionseries",
1413
- children: /* @__PURE__ */ jsx4(UppercasePrevPresentation, {
1414
- passedProps: prevPresentation.props ?? {},
1415
- presentationDirection: "entering",
1416
- presentationProgress: prevProgress,
1417
- presentationDurationInFrames: prev.props.timing.getDurationInFrames({ fps }),
1418
- onElementImage: (elementImage, draw) => onNextElementImage(elementImage, prevProgress, draw, i - 1),
1419
- onUnmount: () => {
1420
- onNextElementImage(null, null, null, i - 1);
1421
- },
1422
- bothEnteringAndExiting: false,
1423
- children: /* @__PURE__ */ jsx4(WrapInEnteringProgressContext, {
1424
- presentationProgress: prevProgress,
1425
- children: child
1426
- })
1427
- })
1428
- }, i);
1429
- }
1430
- if (nextProgress !== null && next) {
1431
- const nextPresentation = next.props.presentation ?? slide();
1432
- const UppercaseNextPresentation = nextPresentation.component;
1433
- return /* @__PURE__ */ jsx4(SequenceWithoutSchema, {
1434
- from: actualStartFrame,
1435
- durationInFrames: durationInFramesProp,
1436
- ...passedProps,
1437
- name: passedProps.name || "<TS.Sequence>",
1438
- _remotionInternalDocumentationLink: passedProps.name ? undefined : "https://www.remotion.dev/docs/transitions/transitionseries",
1439
- children: /* @__PURE__ */ jsx4(UppercaseNextPresentation, {
1440
- passedProps: nextPresentation.props ?? {},
1441
- presentationDirection: "exiting",
1442
- presentationProgress: nextProgress,
1443
- presentationDurationInFrames: next.props.timing.getDurationInFrames({ fps }),
1444
- onElementImage: (elementImage, draw) => onPrevElementImage(elementImage, nextProgress, draw, i + 1),
1445
- onUnmount: () => {
1446
- onPrevElementImage(null, null, null, i + 1);
1447
- },
1448
- bothEnteringAndExiting: false,
1449
- children: /* @__PURE__ */ jsx4(WrapInExitingProgressContext, {
1450
- presentationProgress: nextProgress,
1451
- children: child
1452
- })
1453
- })
1454
- }, i);
1455
- }
1456
- return /* @__PURE__ */ jsx4(SequenceWithoutSchema, {
1457
- from: actualStartFrame,
1458
- durationInFrames: durationInFramesProp,
1459
- ...passedProps,
1460
- name: passedProps.name || "<TS.Sequence>",
1461
- _remotionInternalDocumentationLink: passedProps.name ? undefined : "https://www.remotion.dev/docs/transitions/transitionseries",
1462
- children: child
1463
- }, i);
1464
- });
1465
- const overlayElements = overlayRenders.map((overlayInfo) => {
1466
- const info = overlayInfo;
1467
- return /* @__PURE__ */ jsx4(SequenceWithoutSchema, {
1468
- from: Math.round(info.overlayFrom),
1469
- durationInFrames: info.durationInFrames,
1470
- name: "<TS.Overlay>",
1471
- _remotionInternalDocumentationLink: "https://www.remotion.dev/docs/transitions/transitionseries",
1472
- layout: "absolute-fill",
1473
- children: info.children
1474
- }, `overlay-${info.index}`);
1565
+ }, i));
1566
+ }
1567
+ if (nextProgress !== null && next) {
1568
+ const nextPresentation = next.props.presentation ?? slide();
1569
+ const UppercaseNextPresentation = nextPresentation.component;
1570
+ return renderSequenceAndRest(/* @__PURE__ */ jsx4(SequenceWithoutSchema, {
1571
+ from: actualStartFrame,
1572
+ durationInFrames: durationInFramesProp,
1573
+ ...passedProps,
1574
+ name: passedProps.name || "<TS.Sequence>",
1575
+ _remotionInternalDocumentationLink: passedProps.name ? undefined : "https://www.remotion.dev/docs/transitions/transitionseries",
1576
+ _remotionInternalStack: stack ?? undefined,
1577
+ controls: controls ?? undefined,
1578
+ children: /* @__PURE__ */ jsx4(UppercaseNextPresentation, {
1579
+ passedProps: nextPresentation.props ?? {},
1580
+ presentationDirection: "exiting",
1581
+ presentationProgress: nextProgress,
1582
+ presentationDurationInFrames: next.props.timing.getDurationInFrames({ fps }),
1583
+ onElementImage: (elementImage, draw) => onPrevElementImage(elementImage, nextProgress, draw, i + 1),
1584
+ onUnmount: () => {
1585
+ onPrevElementImage(null, null, null, i + 1);
1586
+ },
1587
+ bothEnteringAndExiting: false,
1588
+ children: /* @__PURE__ */ jsx4(WrapInExitingProgressContext, {
1589
+ presentationProgress: nextProgress,
1590
+ children: sequenceChildren
1591
+ })
1592
+ })
1593
+ }, i));
1594
+ }
1595
+ return renderSequenceAndRest(/* @__PURE__ */ jsx4(SequenceWithoutSchema, {
1596
+ from: actualStartFrame,
1597
+ durationInFrames: durationInFramesProp,
1598
+ ...passedProps,
1599
+ name: passedProps.name || "<TS.Sequence>",
1600
+ _remotionInternalDocumentationLink: passedProps.name ? undefined : "https://www.remotion.dev/docs/transitions/transitionseries",
1601
+ _remotionInternalStack: stack ?? undefined,
1602
+ controls: controls ?? undefined,
1603
+ children: sequenceChildren
1604
+ }, i));
1605
+ }
1606
+ });
1607
+ };
1608
+ return renderChildren({
1609
+ index: 0,
1610
+ transitionOffsets: 0,
1611
+ startFrame: 0,
1612
+ overlayRenders: [],
1613
+ sequenceDurations: [],
1614
+ pendingOverlayValidation: false
1475
1615
  });
1476
- return [...mainChildren || [], ...overlayElements];
1477
1616
  }, [flattedChildren, fps, frame, onPrevElementImage, onNextElementImage]);
1478
1617
  return /* @__PURE__ */ jsx4(Fragment, {
1479
1618
  children: childrenValue
@@ -1515,7 +1654,6 @@ var TransitionSeries = Interactive.withSchema({
1515
1654
  TransitionSeries.Sequence = SeriesSequence;
1516
1655
  TransitionSeries.Transition = TransitionSeriesTransition;
1517
1656
  TransitionSeries.Overlay = SeriesOverlay;
1518
- Internals2.addSequenceStackTraces(TransitionSeries);
1519
1657
  // src/use-transition-progress.ts
1520
1658
  import React5 from "react";
1521
1659
  var useTransitionProgress = () => {