@remotion/transitions 4.0.137 → 4.0.138

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.
@@ -1,278 +1,349 @@
1
- import { interpolate, measureSpring, spring, AbsoluteFill, Internals, Sequence, useVideoConfig, useCurrentFrame } from 'remotion';
2
- import { jsx, Fragment } from 'react/jsx-runtime';
3
- import React, { useMemo, Children } from 'react';
4
- import { NoReactInternals } from 'remotion/no-react';
5
-
6
- const linearTiming = (options) => {
1
+ // src/presentations/slide.tsx
2
+ import {useMemo} from "react";
3
+ import {AbsoluteFill} from "remotion";
4
+ import {
5
+ jsx
6
+ } from "react/jsx-runtime";
7
+ var epsilon = 0.01;
8
+ var SlidePresentation = ({
9
+ children,
10
+ presentationProgress,
11
+ presentationDirection,
12
+ passedProps: { direction = "from-left", enterStyle, exitStyle }
13
+ }) => {
14
+ const directionStyle = useMemo(() => {
15
+ const presentationProgressWithEpsilonCorrection = presentationProgress === 1 ? presentationProgress * 100 : presentationProgress * 100 - epsilon;
16
+ if (presentationDirection === "exiting") {
17
+ switch (direction) {
18
+ case "from-left":
19
+ return {
20
+ transform: `translateX(${presentationProgressWithEpsilonCorrection}%)`
21
+ };
22
+ case "from-right":
23
+ return {
24
+ transform: `translateX(-${presentationProgress * 100}%)`
25
+ };
26
+ case "from-top":
27
+ return {
28
+ transform: `translateY(${presentationProgressWithEpsilonCorrection}%)`
29
+ };
30
+ case "from-bottom":
31
+ return {
32
+ transform: `translateY(-${presentationProgress * 100}%)`
33
+ };
34
+ default:
35
+ throw new Error(`Invalid direction: ${direction}`);
36
+ }
37
+ }
38
+ switch (direction) {
39
+ case "from-left":
40
+ return {
41
+ transform: `translateX(${-100 + presentationProgress * 100}%)`
42
+ };
43
+ case "from-right":
44
+ return {
45
+ transform: `translateX(${100 - presentationProgressWithEpsilonCorrection}%)`
46
+ };
47
+ case "from-top":
48
+ return {
49
+ transform: `translateY(${-100 + presentationProgress * 100}%)`
50
+ };
51
+ case "from-bottom":
52
+ return {
53
+ transform: `translateY(${100 - presentationProgressWithEpsilonCorrection}%)`
54
+ };
55
+ default:
56
+ throw new Error(`Invalid direction: ${direction}`);
57
+ }
58
+ }, [presentationDirection, presentationProgress, direction]);
59
+ const style = useMemo(() => {
7
60
  return {
8
- getDurationInFrames: () => {
9
- return options.durationInFrames;
10
- },
11
- getProgress: ({ frame }) => {
12
- return interpolate(frame, [0, options.durationInFrames], [0, 1], {
13
- easing: options.easing,
14
- extrapolateLeft: 'clamp',
15
- extrapolateRight: 'clamp',
16
- });
17
- },
61
+ width: "100%",
62
+ height: "100%",
63
+ justifyContent: "center",
64
+ alignItems: "center",
65
+ ...directionStyle,
66
+ ...presentationDirection === "entering" ? enterStyle : exitStyle
18
67
  };
68
+ }, [directionStyle, enterStyle, exitStyle, presentationDirection]);
69
+ return jsx(AbsoluteFill, {
70
+ style,
71
+ children
72
+ }, undefined, false, undefined, this);
73
+ };
74
+ var slide = (props) => {
75
+ return {
76
+ component: SlidePresentation,
77
+ props: props ?? {}
78
+ };
19
79
  };
20
80
 
21
- const springWithInvalidArgumentRejection = (args) => {
22
- if (args.to || args.from) {
23
- throw new Error('to / from values are not supported by springWithRoundUpIfThreshold');
81
+ // src/timings/linear-timing.ts
82
+ import {interpolate} from "remotion";
83
+ var linearTiming = (options) => {
84
+ return {
85
+ getDurationInFrames: () => {
86
+ return options.durationInFrames;
87
+ },
88
+ getProgress: ({ frame }) => {
89
+ return interpolate(frame, [0, options.durationInFrames], [0, 1], {
90
+ easing: options.easing,
91
+ extrapolateLeft: "clamp",
92
+ extrapolateRight: "clamp"
93
+ });
24
94
  }
25
- return spring(args);
26
- };
27
- const springTiming = (options = {}) => {
28
- return {
29
- getDurationInFrames: ({ fps }) => {
30
- if (options.durationInFrames) {
31
- return options.durationInFrames;
32
- }
33
- return measureSpring({
34
- config: options.config,
35
- threshold: options.durationRestThreshold,
36
- fps,
37
- });
38
- },
39
- getProgress: ({ fps, frame }) => {
40
- return springWithInvalidArgumentRejection({
41
- fps,
42
- frame,
43
- config: options.config,
44
- durationInFrames: options.durationInFrames,
45
- durationRestThreshold: options.durationRestThreshold,
46
- });
47
- },
48
- };
95
+ };
49
96
  };
50
97
 
51
- const flattenChildren = (children) => {
52
- const childrenArray = React.Children.toArray(children);
53
- return childrenArray.reduce((flatChildren, child) => {
54
- if (child.type === React.Fragment) {
55
- return flatChildren.concat(flattenChildren(child.props
56
- .children));
57
- }
58
- flatChildren.push(child);
59
- return flatChildren;
60
- }, []);
98
+ // src/timings/spring-timing.ts
99
+ import {measureSpring, spring} from "remotion";
100
+ var springWithInvalidArgumentRejection = (args) => {
101
+ if (args.to || args.from) {
102
+ throw new Error("to / from values are not supported by springWithRoundUpIfThreshold");
103
+ }
104
+ return spring(args);
61
105
  };
62
-
63
- const epsilon = 0.01;
64
- const SlidePresentation = ({ children, presentationProgress, presentationDirection, passedProps: { direction = 'from-left', enterStyle, exitStyle }, }) => {
65
- const directionStyle = useMemo(() => {
66
- // Overlay the two slides barely to avoid a white line between them
67
- // Remove the correction once the presentation progress is 1
68
- const presentationProgressWithEpsilonCorrection = presentationProgress === 1
69
- ? presentationProgress * 100
70
- : presentationProgress * 100 - epsilon;
71
- if (presentationDirection === 'exiting') {
72
- switch (direction) {
73
- case 'from-left':
74
- return {
75
- transform: `translateX(${presentationProgressWithEpsilonCorrection}%)`,
76
- };
77
- case 'from-right':
78
- return {
79
- transform: `translateX(-${presentationProgress * 100}%)`,
80
- };
81
- case 'from-top':
82
- return {
83
- transform: `translateY(${presentationProgressWithEpsilonCorrection}%)`,
84
- };
85
- case 'from-bottom':
86
- return {
87
- transform: `translateY(-${presentationProgress * 100}%)`,
88
- };
89
- default:
90
- throw new Error(`Invalid direction: ${direction}`);
91
- }
92
- }
93
- switch (direction) {
94
- case 'from-left':
95
- return {
96
- transform: `translateX(${-100 + presentationProgress * 100}%)`,
97
- };
98
- case 'from-right':
99
- return {
100
- transform: `translateX(${100 - presentationProgressWithEpsilonCorrection}%)`,
101
- };
102
- case 'from-top':
103
- return {
104
- transform: `translateY(${-100 + presentationProgress * 100}%)`,
105
- };
106
- case 'from-bottom':
107
- return {
108
- transform: `translateY(${100 - presentationProgressWithEpsilonCorrection}%)`,
109
- };
110
- default:
111
- throw new Error(`Invalid direction: ${direction}`);
112
- }
113
- }, [presentationDirection, presentationProgress, direction]);
114
- const style = useMemo(() => {
115
- return {
116
- width: '100%',
117
- height: '100%',
118
- justifyContent: 'center',
119
- alignItems: 'center',
120
- ...directionStyle,
121
- ...(presentationDirection === 'entering' ? enterStyle : exitStyle),
122
- };
123
- }, [directionStyle, enterStyle, exitStyle, presentationDirection]);
124
- return jsx(AbsoluteFill, { style: style, children: children });
106
+ var springTiming = (options = {}) => {
107
+ return {
108
+ getDurationInFrames: ({ fps }) => {
109
+ if (options.durationInFrames) {
110
+ return options.durationInFrames;
111
+ }
112
+ return measureSpring({
113
+ config: options.config,
114
+ threshold: options.durationRestThreshold,
115
+ fps
116
+ });
117
+ },
118
+ getProgress: ({ fps, frame }) => {
119
+ return springWithInvalidArgumentRejection({
120
+ fps,
121
+ frame,
122
+ config: options.config,
123
+ durationInFrames: options.durationInFrames,
124
+ durationRestThreshold: options.durationRestThreshold
125
+ });
126
+ }
127
+ };
125
128
  };
126
- const slide = (props) => {
127
- return {
128
- component: SlidePresentation,
129
- props: props !== null && props !== void 0 ? props : {},
130
- };
129
+
130
+ // src/TransitionSeries.tsx
131
+ import {Children, useMemo as useMemo2} from "react";
132
+ import {Internals, Sequence, useCurrentFrame, useVideoConfig} from "remotion";
133
+
134
+ // src/flatten-children.ts
135
+ import React2 from "react";
136
+ var flattenChildren = (children) => {
137
+ const childrenArray = React2.Children.toArray(children);
138
+ return childrenArray.reduce((flatChildren, child) => {
139
+ if (child.type === React2.Fragment) {
140
+ return flatChildren.concat(flattenChildren(child.props.children));
141
+ }
142
+ flatChildren.push(child);
143
+ return flatChildren;
144
+ }, []);
131
145
  };
132
146
 
133
- /* eslint-disable prefer-destructuring */
134
- const validateDurationInFrames = NoReactInternals.validateDurationInFrames;
147
+ // src/validate.ts
148
+ import {NoReactInternals} from "remotion/no-react";
149
+ var validateDurationInFrames = NoReactInternals.validateDurationInFrames;
135
150
 
136
- // eslint-disable-next-line react/function-component-definition
137
- const TransitionSeriesTransition = function (
138
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
139
- _props) {
140
- return null;
151
+ // src/TransitionSeries.tsx
152
+ import {
153
+ jsx as jsx2,
154
+ Fragment
155
+ } from "react/jsx-runtime";
156
+ var TransitionSeriesTransition = function(_props) {
157
+ return null;
141
158
  };
142
- const SeriesSequence = ({ children }) => {
143
- // eslint-disable-next-line react/jsx-no-useless-fragment
144
- return jsx(Fragment, { children: children });
159
+ var SeriesSequence = ({ children }) => {
160
+ return jsx2(Fragment, {
161
+ children
162
+ }, undefined, false, undefined, this);
145
163
  };
146
- const TransitionSeriesChildren = ({ children, }) => {
147
- const { fps } = useVideoConfig();
148
- const frame = useCurrentFrame();
149
- const childrenValue = useMemo(() => {
150
- let transitionOffsets = 0;
151
- let startFrame = 0;
152
- const flattedChildren = flattenChildren(children);
153
- return Children.map(flattedChildren, (child, i) => {
154
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
155
- const current = child;
156
- if (typeof current === 'string') {
157
- // Don't throw if it's just some accidential whitespace
158
- if (current.trim() === '') {
159
- return null;
160
- }
161
- throw new TypeError(`The <TransitionSeries /> component only accepts a list of <TransitionSeries.Sequence /> components as its children, but you passed a string "${current}"`);
162
- }
163
- const hasPrev = flattedChildren[i - 1];
164
- const nextPrev = flattedChildren[i + 1];
165
- const prev = typeof hasPrev === 'string' || typeof hasPrev === 'undefined'
166
- ? null
167
- : hasPrev.type === TransitionSeriesTransition
168
- ? hasPrev
169
- : null;
170
- const next = typeof nextPrev === 'string' || typeof nextPrev === 'undefined'
171
- ? null
172
- : nextPrev.type === TransitionSeriesTransition
173
- ? nextPrev
174
- : null;
175
- const prevIsTransition = typeof hasPrev === 'string' || typeof hasPrev === 'undefined'
176
- ? false
177
- : hasPrev.type === TransitionSeriesTransition;
178
- if (current.type === TransitionSeriesTransition) {
179
- if (prevIsTransition) {
180
- throw new TypeError(`A <TransitionSeries.Transition /> component must not be followed by another <TransitionSeries.Transition /> component (nth children = ${i - 1} and ${i})`);
181
- }
182
- return null;
183
- }
184
- if (current.type !== SeriesSequence) {
185
- throw new TypeError(`The <TransitionSeries /> component only accepts a list of <TransitionSeries.Sequence /> and <TransitionSeries.Transition /> components as its children, but got ${current} instead`);
186
- }
187
- const castedChildAgain = current;
188
- const debugInfo = `index = ${i}, duration = ${castedChildAgain.props.durationInFrames}`;
189
- if (!(castedChildAgain === null || castedChildAgain === void 0 ? void 0 : castedChildAgain.props.children)) {
190
- throw new TypeError(`A <TransitionSeries.Sequence /> component (${debugInfo}) was detected to not have any children. Delete it to fix this error.`);
191
- }
192
- const durationInFramesProp = castedChildAgain.props.durationInFrames;
193
- const { durationInFrames, children: _children, ...passedProps } = castedChildAgain.props;
194
- validateDurationInFrames(durationInFramesProp, {
195
- component: `of a <TransitionSeries.Sequence /> component`,
196
- allowFloats: true,
197
- });
198
- const offset = (_a = castedChildAgain.props.offset) !== null && _a !== void 0 ? _a : 0;
199
- if (Number.isNaN(offset)) {
200
- throw new TypeError(`The "offset" property of a <TransitionSeries.Sequence /> must not be NaN, but got NaN (${debugInfo}).`);
201
- }
202
- if (!Number.isFinite(offset)) {
203
- throw new TypeError(`The "offset" property of a <TransitionSeries.Sequence /> must be finite, but got ${offset} (${debugInfo}).`);
204
- }
205
- if (offset % 1 !== 0) {
206
- throw new TypeError(`The "offset" property of a <TransitionSeries.Sequence /> must be finite, but got ${offset} (${debugInfo}).`);
207
- }
208
- const currentStartFrame = startFrame + offset;
209
- let duration = 0;
210
- if (prev) {
211
- duration = prev.props.timing.getDurationInFrames({
212
- fps,
213
- });
214
- transitionOffsets -= duration;
215
- }
216
- let actualStartFrame = currentStartFrame + transitionOffsets;
217
- startFrame += durationInFramesProp + offset;
218
- // Handle the case where the first item is a transition
219
- if (actualStartFrame < 0) {
220
- startFrame -= actualStartFrame;
221
- actualStartFrame = 0;
222
- }
223
- const nextProgress = next
224
- ? next.props.timing.getProgress({
225
- frame: frame -
226
- actualStartFrame -
227
- durationInFrames +
228
- next.props.timing.getDurationInFrames({ fps }),
229
- fps,
230
- })
231
- : null;
232
- const prevProgress = prev
233
- ? prev.props.timing.getProgress({
234
- frame: frame - actualStartFrame,
235
- fps,
236
- })
237
- : null;
238
- if (next &&
239
- durationInFramesProp < next.props.timing.getDurationInFrames({ fps })) {
240
- 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})`);
241
- }
242
- if (prev &&
243
- durationInFramesProp < prev.props.timing.getDurationInFrames({ fps })) {
244
- 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})`);
245
- }
246
- if (next && prev && nextProgress !== null && prevProgress !== null) {
247
- const nextPresentation = (_b = next.props.presentation) !== null && _b !== void 0 ? _b : slide();
248
- const prevPresentation = (_c = prev.props.presentation) !== null && _c !== void 0 ? _c : slide();
249
- const UppercaseNextPresentation = nextPresentation.component;
250
- const UppercasePrevPresentation = prevPresentation.component;
251
- return (jsx(Sequence, { name: passedProps.name || '<TS.Sequence>', from: Math.floor(actualStartFrame), durationInFrames: durationInFramesProp, layout: "none", stack: passedProps.stack, children: jsx(UppercaseNextPresentation, { passedProps: (_d = nextPresentation.props) !== null && _d !== void 0 ? _d : {}, presentationDirection: "exiting", presentationProgress: nextProgress, children: jsx(UppercasePrevPresentation, { passedProps: (_e = prevPresentation.props) !== null && _e !== void 0 ? _e : {}, presentationDirection: "entering", presentationProgress: prevProgress, children: jsx(Sequence, { showInTimeline: false, ...passedProps, children: child }) }) }) }));
252
- }
253
- if (prevProgress !== null && prev) {
254
- const prevPresentation = (_f = prev.props.presentation) !== null && _f !== void 0 ? _f : slide();
255
- const UppercasePrevPresentation = prevPresentation.component;
256
- return (jsx(Sequence, { name: passedProps.name || '<TS.Sequence>', from: Math.floor(actualStartFrame), durationInFrames: durationInFramesProp, layout: "none", stack: passedProps.stack, children: jsx(UppercasePrevPresentation, { passedProps: (_g = prevPresentation.props) !== null && _g !== void 0 ? _g : {}, presentationDirection: "entering", presentationProgress: prevProgress, children: jsx(Sequence, { showInTimeline: false, ...passedProps, children: child }) }) }));
257
- }
258
- if (nextProgress !== null && next) {
259
- const nextPresentation = (_h = next.props.presentation) !== null && _h !== void 0 ? _h : slide();
260
- const UppercaseNextPresentation = nextPresentation.component;
261
- return (jsx(Sequence, { name: passedProps.name || '<TS.Sequence>', from: Math.floor(actualStartFrame), durationInFrames: durationInFramesProp, layout: "none", stack: passedProps.stack, children: jsx(UppercaseNextPresentation, { passedProps: (_j = nextPresentation.props) !== null && _j !== void 0 ? _j : {}, presentationDirection: "exiting", presentationProgress: nextProgress, children: jsx(Sequence, { showInTimeline: false, ...passedProps, children: child }) }) }));
262
- }
263
- return (jsx(Sequence, { name: passedProps.name || '<TS.Sequence>', from: Math.floor(actualStartFrame), durationInFrames: durationInFramesProp, ...passedProps, children: child }));
164
+ var TransitionSeriesChildren = ({
165
+ children
166
+ }) => {
167
+ const { fps } = useVideoConfig();
168
+ const frame = useCurrentFrame();
169
+ const childrenValue = useMemo2(() => {
170
+ let transitionOffsets = 0;
171
+ let startFrame = 0;
172
+ const flattedChildren = flattenChildren(children);
173
+ return Children.map(flattedChildren, (child, i) => {
174
+ const current = child;
175
+ if (typeof current === "string") {
176
+ if (current.trim() === "") {
177
+ return null;
178
+ }
179
+ throw new TypeError(`The <TransitionSeries /> component only accepts a list of <TransitionSeries.Sequence /> components as its children, but you passed a string "${current}"`);
180
+ }
181
+ const hasPrev = flattedChildren[i - 1];
182
+ const nextPrev = flattedChildren[i + 1];
183
+ const prev = typeof hasPrev === "string" || typeof hasPrev === "undefined" ? null : hasPrev.type === TransitionSeriesTransition ? hasPrev : null;
184
+ const next = typeof nextPrev === "string" || typeof nextPrev === "undefined" ? null : nextPrev.type === TransitionSeriesTransition ? nextPrev : null;
185
+ const prevIsTransition = typeof hasPrev === "string" || typeof hasPrev === "undefined" ? false : hasPrev.type === TransitionSeriesTransition;
186
+ if (current.type === TransitionSeriesTransition) {
187
+ if (prevIsTransition) {
188
+ throw new TypeError(`A <TransitionSeries.Transition /> component must not be followed by another <TransitionSeries.Transition /> component (nth children = ${i - 1} and ${i})`);
189
+ }
190
+ return null;
191
+ }
192
+ if (current.type !== SeriesSequence) {
193
+ throw new TypeError(`The <TransitionSeries /> component only accepts a list of <TransitionSeries.Sequence /> and <TransitionSeries.Transition /> components as its children, but got ${current} instead`);
194
+ }
195
+ const castedChildAgain = current;
196
+ const debugInfo = `index = ${i}, duration = ${castedChildAgain.props.durationInFrames}`;
197
+ if (!castedChildAgain?.props.children) {
198
+ throw new TypeError(`A <TransitionSeries.Sequence /> component (${debugInfo}) was detected to not have any children. Delete it to fix this error.`);
199
+ }
200
+ const durationInFramesProp = castedChildAgain.props.durationInFrames;
201
+ const {
202
+ durationInFrames,
203
+ children: _children,
204
+ ...passedProps
205
+ } = castedChildAgain.props;
206
+ validateDurationInFrames(durationInFramesProp, {
207
+ component: `of a <TransitionSeries.Sequence /> component`,
208
+ allowFloats: true
209
+ });
210
+ const offset = castedChildAgain.props.offset ?? 0;
211
+ if (Number.isNaN(offset)) {
212
+ throw new TypeError(`The "offset" property of a <TransitionSeries.Sequence /> must not be NaN, but got NaN (${debugInfo}).`);
213
+ }
214
+ if (!Number.isFinite(offset)) {
215
+ throw new TypeError(`The "offset" property of a <TransitionSeries.Sequence /> must be finite, but got ${offset} (${debugInfo}).`);
216
+ }
217
+ if (offset % 1 !== 0) {
218
+ throw new TypeError(`The "offset" property of a <TransitionSeries.Sequence /> must be finite, but got ${offset} (${debugInfo}).`);
219
+ }
220
+ const currentStartFrame = startFrame + offset;
221
+ let duration = 0;
222
+ if (prev) {
223
+ duration = prev.props.timing.getDurationInFrames({
224
+ fps
264
225
  });
265
- }, [children, fps, frame]);
266
- // eslint-disable-next-line react/jsx-no-useless-fragment
267
- return jsx(Fragment, { children: childrenValue });
226
+ transitionOffsets -= duration;
227
+ }
228
+ let actualStartFrame = currentStartFrame + transitionOffsets;
229
+ startFrame += durationInFramesProp + offset;
230
+ if (actualStartFrame < 0) {
231
+ startFrame -= actualStartFrame;
232
+ actualStartFrame = 0;
233
+ }
234
+ const nextProgress = next ? next.props.timing.getProgress({
235
+ frame: frame - actualStartFrame - durationInFrames + next.props.timing.getDurationInFrames({ fps }),
236
+ fps
237
+ }) : null;
238
+ const prevProgress = prev ? prev.props.timing.getProgress({
239
+ frame: frame - actualStartFrame,
240
+ fps
241
+ }) : null;
242
+ if (next && durationInFramesProp < next.props.timing.getDurationInFrames({ fps })) {
243
+ 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})`);
244
+ }
245
+ if (prev && durationInFramesProp < prev.props.timing.getDurationInFrames({ fps })) {
246
+ 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})`);
247
+ }
248
+ if (next && prev && nextProgress !== null && prevProgress !== null) {
249
+ const nextPresentation = next.props.presentation ?? slide();
250
+ const prevPresentation = prev.props.presentation ?? slide();
251
+ const UppercaseNextPresentation = nextPresentation.component;
252
+ const UppercasePrevPresentation = prevPresentation.component;
253
+ return jsx2(Sequence, {
254
+ name: passedProps.name || "<TS.Sequence>",
255
+ from: Math.floor(actualStartFrame),
256
+ durationInFrames: durationInFramesProp,
257
+ layout: "none",
258
+ stack: passedProps.stack,
259
+ children: jsx2(UppercaseNextPresentation, {
260
+ passedProps: nextPresentation.props ?? {},
261
+ presentationDirection: "exiting",
262
+ presentationProgress: nextProgress,
263
+ children: jsx2(UppercasePrevPresentation, {
264
+ passedProps: prevPresentation.props ?? {},
265
+ presentationDirection: "entering",
266
+ presentationProgress: prevProgress,
267
+ children: jsx2(Sequence, {
268
+ showInTimeline: false,
269
+ ...passedProps,
270
+ children: child
271
+ }, undefined, false, undefined, this)
272
+ }, undefined, false, undefined, this)
273
+ }, undefined, false, undefined, this)
274
+ }, undefined, false, undefined, this);
275
+ }
276
+ if (prevProgress !== null && prev) {
277
+ const prevPresentation = prev.props.presentation ?? slide();
278
+ const UppercasePrevPresentation = prevPresentation.component;
279
+ return jsx2(Sequence, {
280
+ name: passedProps.name || "<TS.Sequence>",
281
+ from: Math.floor(actualStartFrame),
282
+ durationInFrames: durationInFramesProp,
283
+ layout: "none",
284
+ stack: passedProps.stack,
285
+ children: jsx2(UppercasePrevPresentation, {
286
+ passedProps: prevPresentation.props ?? {},
287
+ presentationDirection: "entering",
288
+ presentationProgress: prevProgress,
289
+ children: jsx2(Sequence, {
290
+ showInTimeline: false,
291
+ ...passedProps,
292
+ children: child
293
+ }, undefined, false, undefined, this)
294
+ }, undefined, false, undefined, this)
295
+ }, undefined, false, undefined, this);
296
+ }
297
+ if (nextProgress !== null && next) {
298
+ const nextPresentation = next.props.presentation ?? slide();
299
+ const UppercaseNextPresentation = nextPresentation.component;
300
+ return jsx2(Sequence, {
301
+ name: passedProps.name || "<TS.Sequence>",
302
+ from: Math.floor(actualStartFrame),
303
+ durationInFrames: durationInFramesProp,
304
+ layout: "none",
305
+ stack: passedProps.stack,
306
+ children: jsx2(UppercaseNextPresentation, {
307
+ passedProps: nextPresentation.props ?? {},
308
+ presentationDirection: "exiting",
309
+ presentationProgress: nextProgress,
310
+ children: jsx2(Sequence, {
311
+ showInTimeline: false,
312
+ ...passedProps,
313
+ children: child
314
+ }, undefined, false, undefined, this)
315
+ }, undefined, false, undefined, this)
316
+ }, undefined, false, undefined, this);
317
+ }
318
+ return jsx2(Sequence, {
319
+ name: passedProps.name || "<TS.Sequence>",
320
+ from: Math.floor(actualStartFrame),
321
+ durationInFrames: durationInFramesProp,
322
+ ...passedProps,
323
+ children: child
324
+ }, undefined, false, undefined, this);
325
+ });
326
+ }, [children, fps, frame]);
327
+ return jsx2(Fragment, {
328
+ children: childrenValue
329
+ }, undefined, false, undefined, this);
268
330
  };
269
- const TransitionSeries = ({ children, name, ...otherProps }) => {
270
- const displayName = name !== null && name !== void 0 ? name : '<TransitionSeries>';
271
- return (jsx(Sequence, { name: displayName, ...otherProps, children: jsx(TransitionSeriesChildren, { children: children }) }));
331
+ var TransitionSeries = ({ children, name, ...otherProps }) => {
332
+ const displayName = name ?? "<TransitionSeries>";
333
+ return jsx2(Sequence, {
334
+ name: displayName,
335
+ ...otherProps,
336
+ children: jsx2(TransitionSeriesChildren, {
337
+ children
338
+ }, undefined, false, undefined, this)
339
+ }, undefined, false, undefined, this);
272
340
  };
273
341
  TransitionSeries.Sequence = SeriesSequence;
274
342
  TransitionSeries.Transition = TransitionSeriesTransition;
275
343
  Internals.addSequenceStackTraces(TransitionSeries);
276
344
  Internals.addSequenceStackTraces(SeriesSequence);
277
-
278
- export { TransitionSeries, linearTiming, springTiming };
345
+ export {
346
+ springTiming,
347
+ linearTiming,
348
+ TransitionSeries
349
+ };