@remotion/transitions 4.0.207 → 4.0.209

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (21) hide show
  1. package/dist/esm/clock-wipe.mjs +7 -7
  2. package/dist/esm/fade.mjs +1 -1
  3. package/dist/esm/flip.mjs +2 -2
  4. package/dist/esm/index.mjs +19 -22
  5. package/dist/esm/none.mjs +1 -1
  6. package/dist/esm/slide.mjs +1 -1
  7. package/dist/esm/wipe.mjs +7 -7
  8. package/package.json +6 -6
  9. package/.rollup.cache/Users/jonathanburger/remotion/packages/transitions/dist/TransitionSeries.js +0 -148
  10. package/.rollup.cache/Users/jonathanburger/remotion/packages/transitions/dist/flatten-children.js +0 -12
  11. package/.rollup.cache/Users/jonathanburger/remotion/packages/transitions/dist/index.js +0 -5
  12. package/.rollup.cache/Users/jonathanburger/remotion/packages/transitions/dist/presentations/clock-wipe.js +0 -42
  13. package/.rollup.cache/Users/jonathanburger/remotion/packages/transitions/dist/presentations/fade.js +0 -27
  14. package/.rollup.cache/Users/jonathanburger/remotion/packages/transitions/dist/presentations/flip.js +0 -45
  15. package/.rollup.cache/Users/jonathanburger/remotion/packages/transitions/dist/presentations/slide.js +0 -72
  16. package/.rollup.cache/Users/jonathanburger/remotion/packages/transitions/dist/presentations/wipe.js +0 -159
  17. package/.rollup.cache/Users/jonathanburger/remotion/packages/transitions/dist/test/transitions.test.js +0 -33
  18. package/.rollup.cache/Users/jonathanburger/remotion/packages/transitions/dist/timings/linear-timing.js +0 -15
  19. package/.rollup.cache/Users/jonathanburger/remotion/packages/transitions/dist/timings/spring-timing.js +0 -30
  20. package/.rollup.cache/Users/jonathanburger/remotion/packages/transitions/dist/types.js +0 -1
  21. package/.rollup.cache/Users/jonathanburger/remotion/packages/transitions/dist/validate.js +0 -3
@@ -35,19 +35,19 @@ var ClockWipePresentation = ({ children, presentationDirection, presentationProg
35
35
  passedProps.outerExitStyle,
36
36
  presentationDirection
37
37
  ]);
38
- return jsxs(AbsoluteFill, {
38
+ return /* @__PURE__ */ jsxs(AbsoluteFill, {
39
39
  style: outerStyle,
40
40
  children: [
41
- jsx(AbsoluteFill, {
41
+ /* @__PURE__ */ jsx(AbsoluteFill, {
42
42
  style,
43
43
  children
44
44
  }),
45
- presentationDirection === "exiting" ? null : jsx(AbsoluteFill, {
46
- children: jsx("svg", {
47
- children: jsx("defs", {
48
- children: jsx("clipPath", {
45
+ presentationDirection === "exiting" ? null : /* @__PURE__ */ jsx(AbsoluteFill, {
46
+ children: /* @__PURE__ */ jsx("svg", {
47
+ children: /* @__PURE__ */ jsx("defs", {
48
+ children: /* @__PURE__ */ jsx("clipPath", {
49
49
  id: clipId,
50
- children: jsx("path", {
50
+ children: /* @__PURE__ */ jsx("path", {
51
51
  d: translatedPath,
52
52
  fill: "black"
53
53
  })
package/dist/esm/fade.mjs CHANGED
@@ -19,7 +19,7 @@ var FadePresentation = ({ children, presentationDirection, presentationProgress,
19
19
  presentationDirection,
20
20
  presentationProgress
21
21
  ]);
22
- return jsx(AbsoluteFill, {
22
+ return /* @__PURE__ */ jsx(AbsoluteFill, {
23
23
  style,
24
24
  children
25
25
  });
package/dist/esm/flip.mjs CHANGED
@@ -44,9 +44,9 @@ var Flip = ({
44
44
  ...presentationDirection === "entering" ? outerEnterStyle : outerExitStyle
45
45
  };
46
46
  }, [outerEnterStyle, outerExitStyle, perspective, presentationDirection]);
47
- return jsx(AbsoluteFill, {
47
+ return /* @__PURE__ */ jsx(AbsoluteFill, {
48
48
  style: outer,
49
- children: jsx(AbsoluteFill, {
49
+ children: /* @__PURE__ */ jsx(AbsoluteFill, {
50
50
  style,
51
51
  children
52
52
  })
@@ -66,7 +66,7 @@ var SlidePresentation = ({
66
66
  ...presentationDirection === "entering" ? enterStyle : exitStyle
67
67
  };
68
68
  }, [directionStyle, enterStyle, exitStyle, presentationDirection]);
69
- return jsx(AbsoluteFill, {
69
+ return /* @__PURE__ */ jsx(AbsoluteFill, {
70
70
  style,
71
71
  children
72
72
  });
@@ -94,7 +94,6 @@ var linearTiming = (options) => {
94
94
  }
95
95
  };
96
96
  };
97
-
98
97
  // src/timings/spring-timing.ts
99
98
  import {measureSpring, spring} from "remotion";
100
99
  var springTiming = (options = {}) => {
@@ -125,7 +124,6 @@ var springTiming = (options = {}) => {
125
124
  }
126
125
  };
127
126
  };
128
-
129
127
  // src/TransitionSeries.tsx
130
128
  import {Children, useMemo as useMemo3} from "react";
131
129
  import {Internals, Sequence, useCurrentFrame, useVideoConfig} from "remotion";
@@ -144,7 +142,7 @@ var WrapInEnteringProgressContext = ({ presentationProgress, children }) => {
144
142
  enteringProgress: presentationProgress
145
143
  };
146
144
  }, [presentationProgress]);
147
- return jsx2(EnteringContext.Provider, {
145
+ return /* @__PURE__ */ jsx2(EnteringContext.Provider, {
148
146
  value,
149
147
  children
150
148
  });
@@ -155,7 +153,7 @@ var WrapInExitingProgressContext = ({ presentationProgress, children }) => {
155
153
  exitingProgress: presentationProgress
156
154
  };
157
155
  }, [presentationProgress]);
158
- return jsx2(ExitingContext.Provider, {
156
+ return /* @__PURE__ */ jsx2(ExitingContext.Provider, {
159
157
  value,
160
158
  children
161
159
  });
@@ -187,7 +185,7 @@ var TransitionSeriesTransition = function(_props) {
187
185
  return null;
188
186
  };
189
187
  var SeriesSequence = ({ children }) => {
190
- return jsx3(Fragment, {
188
+ return /* @__PURE__ */ jsx3(Fragment, {
191
189
  children
192
190
  });
193
191
  };
@@ -280,24 +278,24 @@ var TransitionSeriesChildren = ({
280
278
  const prevPresentation = prev.props.presentation ?? slide();
281
279
  const UppercaseNextPresentation = nextPresentation.component;
282
280
  const UppercasePrevPresentation = prevPresentation.component;
283
- return jsx3(Sequence, {
281
+ return /* @__PURE__ */ jsx3(Sequence, {
284
282
  from: Math.floor(actualStartFrame),
285
283
  durationInFrames: durationInFramesProp,
286
284
  ...passedProps,
287
285
  name: passedProps.name || "<TS.Sequence>",
288
- children: jsx3(UppercaseNextPresentation, {
286
+ children: /* @__PURE__ */ jsx3(UppercaseNextPresentation, {
289
287
  passedProps: nextPresentation.props ?? {},
290
288
  presentationDirection: "exiting",
291
289
  presentationProgress: nextProgress,
292
290
  presentationDurationInFrames: next.props.timing.getDurationInFrames({ fps }),
293
- children: jsx3(WrapInExitingProgressContext, {
291
+ children: /* @__PURE__ */ jsx3(WrapInExitingProgressContext, {
294
292
  presentationProgress: nextProgress,
295
- children: jsx3(UppercasePrevPresentation, {
293
+ children: /* @__PURE__ */ jsx3(UppercasePrevPresentation, {
296
294
  passedProps: prevPresentation.props ?? {},
297
295
  presentationDirection: "entering",
298
296
  presentationProgress: prevProgress,
299
297
  presentationDurationInFrames: prev.props.timing.getDurationInFrames({ fps }),
300
- children: jsx3(WrapInEnteringProgressContext, {
298
+ children: /* @__PURE__ */ jsx3(WrapInEnteringProgressContext, {
301
299
  presentationProgress: prevProgress,
302
300
  children: child
303
301
  })
@@ -309,17 +307,17 @@ var TransitionSeriesChildren = ({
309
307
  if (prevProgress !== null && prev) {
310
308
  const prevPresentation = prev.props.presentation ?? slide();
311
309
  const UppercasePrevPresentation = prevPresentation.component;
312
- return jsx3(Sequence, {
310
+ return /* @__PURE__ */ jsx3(Sequence, {
313
311
  from: Math.floor(actualStartFrame),
314
312
  durationInFrames: durationInFramesProp,
315
313
  ...passedProps,
316
314
  name: passedProps.name || "<TS.Sequence>",
317
- children: jsx3(UppercasePrevPresentation, {
315
+ children: /* @__PURE__ */ jsx3(UppercasePrevPresentation, {
318
316
  passedProps: prevPresentation.props ?? {},
319
317
  presentationDirection: "entering",
320
318
  presentationProgress: prevProgress,
321
319
  presentationDurationInFrames: prev.props.timing.getDurationInFrames({ fps }),
322
- children: jsx3(WrapInEnteringProgressContext, {
320
+ children: /* @__PURE__ */ jsx3(WrapInEnteringProgressContext, {
323
321
  presentationProgress: prevProgress,
324
322
  children: child
325
323
  })
@@ -329,24 +327,24 @@ var TransitionSeriesChildren = ({
329
327
  if (nextProgress !== null && next) {
330
328
  const nextPresentation = next.props.presentation ?? slide();
331
329
  const UppercaseNextPresentation = nextPresentation.component;
332
- return jsx3(Sequence, {
330
+ return /* @__PURE__ */ jsx3(Sequence, {
333
331
  from: Math.floor(actualStartFrame),
334
332
  durationInFrames: durationInFramesProp,
335
333
  ...passedProps,
336
334
  name: passedProps.name || "<TS.Sequence>",
337
- children: jsx3(UppercaseNextPresentation, {
335
+ children: /* @__PURE__ */ jsx3(UppercaseNextPresentation, {
338
336
  passedProps: nextPresentation.props ?? {},
339
337
  presentationDirection: "exiting",
340
338
  presentationProgress: nextProgress,
341
339
  presentationDurationInFrames: next.props.timing.getDurationInFrames({ fps }),
342
- children: jsx3(WrapInExitingProgressContext, {
340
+ children: /* @__PURE__ */ jsx3(WrapInExitingProgressContext, {
343
341
  presentationProgress: nextProgress,
344
342
  children: child
345
343
  })
346
344
  })
347
345
  }, i);
348
346
  }
349
- return jsx3(Sequence, {
347
+ return /* @__PURE__ */ jsx3(Sequence, {
350
348
  from: Math.floor(actualStartFrame),
351
349
  durationInFrames: durationInFramesProp,
352
350
  ...passedProps,
@@ -355,7 +353,7 @@ var TransitionSeriesChildren = ({
355
353
  }, i);
356
354
  });
357
355
  }, [children, fps, frame]);
358
- return jsx3(Fragment, {
356
+ return /* @__PURE__ */ jsx3(Fragment, {
359
357
  children: childrenValue
360
358
  });
361
359
  };
@@ -365,11 +363,11 @@ var TransitionSeries = ({ children, name, layout: passedLayout, ...otherProps })
365
363
  if (NoReactInternals2.ENABLE_V5_BREAKING_CHANGES && layout !== "absolute-fill") {
366
364
  throw new TypeError(`The "layout" prop of <TransitionSeries /> is not supported anymore in v5. TransitionSeries' must be absolutely positioned.`);
367
365
  }
368
- return jsx3(Sequence, {
366
+ return /* @__PURE__ */ jsx3(Sequence, {
369
367
  name: displayName,
370
368
  layout,
371
369
  ...otherProps,
372
- children: jsx3(TransitionSeriesChildren, {
370
+ children: /* @__PURE__ */ jsx3(TransitionSeriesChildren, {
373
371
  children
374
372
  })
375
373
  });
@@ -378,7 +376,6 @@ TransitionSeries.Sequence = SeriesSequence;
378
376
  TransitionSeries.Transition = TransitionSeriesTransition;
379
377
  Internals.addSequenceStackTraces(TransitionSeries);
380
378
  Internals.addSequenceStackTraces(SeriesSequence);
381
-
382
379
  // src/use-transition-progress.ts
383
380
  import React4 from "react";
384
381
  var useTransitionProgress = () => {
package/dist/esm/none.mjs CHANGED
@@ -10,7 +10,7 @@ var NonePresentation = ({ children, presentationDirection, passedProps }) => {
10
10
  ...presentationDirection === "entering" ? passedProps.enterStyle : passedProps.exitStyle
11
11
  };
12
12
  }, [passedProps.enterStyle, passedProps.exitStyle, presentationDirection]);
13
- return jsx(AbsoluteFill, {
13
+ return /* @__PURE__ */ jsx(AbsoluteFill, {
14
14
  style,
15
15
  children
16
16
  });
@@ -66,7 +66,7 @@ var SlidePresentation = ({
66
66
  ...presentationDirection === "entering" ? enterStyle : exitStyle
67
67
  };
68
68
  }, [directionStyle, enterStyle, exitStyle, presentationDirection]);
69
- return jsx(AbsoluteFill, {
69
+ return /* @__PURE__ */ jsx(AbsoluteFill, {
70
70
  style,
71
71
  children
72
72
  });
package/dist/esm/wipe.mjs CHANGED
@@ -156,22 +156,22 @@ var WipePresentation = ({
156
156
  pointerEvents: "none"
157
157
  };
158
158
  }, []);
159
- return jsxs(AbsoluteFill, {
159
+ return /* @__PURE__ */ jsxs(AbsoluteFill, {
160
160
  style: outerStyle,
161
161
  children: [
162
- jsx(AbsoluteFill, {
162
+ /* @__PURE__ */ jsx(AbsoluteFill, {
163
163
  style,
164
164
  children
165
165
  }),
166
- jsx(AbsoluteFill, {
167
- children: jsx("svg", {
166
+ /* @__PURE__ */ jsx(AbsoluteFill, {
167
+ children: /* @__PURE__ */ jsx("svg", {
168
168
  viewBox: "0 0 1 1",
169
169
  style: svgStyle,
170
- children: jsx("defs", {
171
- children: jsx("clipPath", {
170
+ children: /* @__PURE__ */ jsx("defs", {
171
+ children: /* @__PURE__ */ jsx("clipPath", {
172
172
  id: clipId,
173
173
  clipPathUnits: "objectBoundingBox",
174
- children: jsx("path", {
174
+ children: /* @__PURE__ */ jsx("path", {
175
175
  d: path,
176
176
  fill: "black"
177
177
  })
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "url": "https://github.com/remotion-dev/remotion/tree/main/packages/transitions"
4
4
  },
5
5
  "name": "@remotion/transitions",
6
- "version": "4.0.207",
6
+ "version": "4.0.209",
7
7
  "description": "Library for creating transitions in Remotion",
8
8
  "sideEffects": false,
9
9
  "main": "dist/esm/index.mjs",
@@ -16,17 +16,17 @@
16
16
  "url": "https://github.com/remotion-dev/remotion/issues"
17
17
  },
18
18
  "dependencies": {
19
- "remotion": "4.0.207",
20
- "@remotion/shapes": "4.0.207",
21
- "@remotion/paths": "4.0.207"
19
+ "remotion": "4.0.209",
20
+ "@remotion/paths": "4.0.209",
21
+ "@remotion/shapes": "4.0.209"
22
22
  },
23
23
  "devDependencies": {
24
24
  "@happy-dom/global-registrator": "14.5.1",
25
25
  "react": "18.3.1",
26
26
  "react-dom": "18.3.1",
27
27
  "@vitejs/plugin-react": "^2.0.0",
28
- "remotion": "4.0.207",
29
- "@remotion/test-utils": "4.0.207"
28
+ "@remotion/test-utils": "4.0.209",
29
+ "remotion": "4.0.209"
30
30
  },
31
31
  "peerDependencies": {
32
32
  "react": ">=16.8.0",
@@ -1,148 +0,0 @@
1
- import { Fragment as _Fragment, jsx as _jsx } from "react/jsx-runtime";
2
- import { Children, useMemo } from 'react';
3
- import { Internals, Sequence, useCurrentFrame, useVideoConfig } from 'remotion';
4
- import { flattenChildren } from './flatten-children.js';
5
- import { slide } from './presentations/slide.js';
6
- import { validateDurationInFrames } from './validate.js';
7
- // eslint-disable-next-line react/function-component-definition
8
- const TransitionSeriesTransition = function (
9
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
10
- _props) {
11
- return null;
12
- };
13
- const SeriesSequence = ({ children }) => {
14
- // eslint-disable-next-line react/jsx-no-useless-fragment
15
- return _jsx(_Fragment, { children: children });
16
- };
17
- const TransitionSeriesChildren = ({ children, }) => {
18
- const { fps } = useVideoConfig();
19
- const frame = useCurrentFrame();
20
- const childrenValue = useMemo(() => {
21
- let transitionOffsets = 0;
22
- let startFrame = 0;
23
- const flattedChildren = flattenChildren(children);
24
- return Children.map(flattedChildren, (child, i) => {
25
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
26
- const current = child;
27
- if (typeof current === 'string') {
28
- // Don't throw if it's just some accidential whitespace
29
- if (current.trim() === '') {
30
- return null;
31
- }
32
- throw new TypeError(`The <TransitionSeries /> component only accepts a list of <TransitionSeries.Sequence /> components as its children, but you passed a string "${current}"`);
33
- }
34
- const hasPrev = flattedChildren[i - 1];
35
- const nextPrev = flattedChildren[i + 1];
36
- const prev = typeof hasPrev === 'string' || typeof hasPrev === 'undefined'
37
- ? null
38
- : hasPrev.type === TransitionSeriesTransition
39
- ? hasPrev
40
- : null;
41
- const next = typeof nextPrev === 'string' || typeof nextPrev === 'undefined'
42
- ? null
43
- : nextPrev.type === TransitionSeriesTransition
44
- ? nextPrev
45
- : null;
46
- const prevIsTransition = typeof hasPrev === 'string' || typeof hasPrev === 'undefined'
47
- ? false
48
- : hasPrev.type === TransitionSeriesTransition;
49
- if (current.type === TransitionSeriesTransition) {
50
- if (prevIsTransition) {
51
- throw new TypeError(`A <TransitionSeries.Transition /> component must not be followed by another <TransitionSeries.Transition /> component (nth children = ${i - 1} and ${i})`);
52
- }
53
- return null;
54
- }
55
- if (current.type !== SeriesSequence) {
56
- throw new TypeError(`The <TransitionSeries /> component only accepts a list of <TransitionSeries.Sequence /> and <TransitionSeries.Transition /> components as its children, but got ${current} instead`);
57
- }
58
- const castedChildAgain = current;
59
- const debugInfo = `index = ${i}, duration = ${castedChildAgain.props.durationInFrames}`;
60
- if (!(castedChildAgain === null || castedChildAgain === void 0 ? void 0 : castedChildAgain.props.children)) {
61
- throw new TypeError(`A <TransitionSeries.Sequence /> component (${debugInfo}) was detected to not have any children. Delete it to fix this error.`);
62
- }
63
- const durationInFramesProp = castedChildAgain.props.durationInFrames;
64
- const { durationInFrames, children: _children, ...passedProps } = castedChildAgain.props;
65
- validateDurationInFrames(durationInFramesProp, {
66
- component: `of a <TransitionSeries.Sequence /> component`,
67
- allowFloats: true,
68
- });
69
- const offset = (_a = castedChildAgain.props.offset) !== null && _a !== void 0 ? _a : 0;
70
- if (Number.isNaN(offset)) {
71
- throw new TypeError(`The "offset" property of a <TransitionSeries.Sequence /> must not be NaN, but got NaN (${debugInfo}).`);
72
- }
73
- if (!Number.isFinite(offset)) {
74
- throw new TypeError(`The "offset" property of a <TransitionSeries.Sequence /> must be finite, but got ${offset} (${debugInfo}).`);
75
- }
76
- if (offset % 1 !== 0) {
77
- throw new TypeError(`The "offset" property of a <TransitionSeries.Sequence /> must be finite, but got ${offset} (${debugInfo}).`);
78
- }
79
- const currentStartFrame = startFrame + offset;
80
- let duration = 0;
81
- if (prev) {
82
- duration = prev.props.timing.getDurationInFrames({
83
- fps,
84
- });
85
- transitionOffsets -= duration;
86
- }
87
- let actualStartFrame = currentStartFrame + transitionOffsets;
88
- startFrame += durationInFramesProp + offset;
89
- // Handle the case where the first item is a transition
90
- if (actualStartFrame < 0) {
91
- startFrame -= actualStartFrame;
92
- actualStartFrame = 0;
93
- }
94
- const nextProgress = next
95
- ? next.props.timing.getProgress({
96
- frame: frame -
97
- actualStartFrame -
98
- durationInFrames +
99
- next.props.timing.getDurationInFrames({ fps }),
100
- fps,
101
- })
102
- : null;
103
- const prevProgress = prev
104
- ? prev.props.timing.getProgress({
105
- frame: frame - actualStartFrame,
106
- fps,
107
- })
108
- : null;
109
- if (next &&
110
- durationInFramesProp < next.props.timing.getDurationInFrames({ fps })) {
111
- 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})`);
112
- }
113
- if (prev &&
114
- durationInFramesProp < prev.props.timing.getDurationInFrames({ fps })) {
115
- 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})`);
116
- }
117
- if (next && prev && nextProgress !== null && prevProgress !== null) {
118
- const nextPresentation = (_b = next.props.presentation) !== null && _b !== void 0 ? _b : slide();
119
- const prevPresentation = (_c = prev.props.presentation) !== null && _c !== void 0 ? _c : slide();
120
- const UppercaseNextPresentation = nextPresentation.component;
121
- const UppercasePrevPresentation = prevPresentation.component;
122
- 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 }) }) }) }));
123
- }
124
- if (prevProgress !== null && prev) {
125
- const prevPresentation = (_f = prev.props.presentation) !== null && _f !== void 0 ? _f : slide();
126
- const UppercasePrevPresentation = prevPresentation.component;
127
- 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 }) }) }));
128
- }
129
- if (nextProgress !== null && next) {
130
- const nextPresentation = (_h = next.props.presentation) !== null && _h !== void 0 ? _h : slide();
131
- const UppercaseNextPresentation = nextPresentation.component;
132
- 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 }) }) }));
133
- }
134
- return (_jsx(Sequence, { name: passedProps.name || '<TS.Sequence>', from: Math.floor(actualStartFrame), durationInFrames: durationInFramesProp, ...passedProps, children: child }));
135
- });
136
- }, [children, fps, frame]);
137
- // eslint-disable-next-line react/jsx-no-useless-fragment
138
- return _jsx(_Fragment, { children: childrenValue });
139
- };
140
- const TransitionSeries = ({ children, name, ...otherProps }) => {
141
- const displayName = name !== null && name !== void 0 ? name : '<TransitionSeries>';
142
- return (_jsx(Sequence, { name: displayName, ...otherProps, children: _jsx(TransitionSeriesChildren, { children: children }) }));
143
- };
144
- TransitionSeries.Sequence = SeriesSequence;
145
- TransitionSeries.Transition = TransitionSeriesTransition;
146
- export { TransitionSeries };
147
- Internals.addSequenceStackTraces(TransitionSeries);
148
- Internals.addSequenceStackTraces(SeriesSequence);
@@ -1,12 +0,0 @@
1
- import React from 'react';
2
- export const flattenChildren = (children) => {
3
- const childrenArray = React.Children.toArray(children);
4
- return childrenArray.reduce((flatChildren, child) => {
5
- if (child.type === React.Fragment) {
6
- return flatChildren.concat(flattenChildren(child.props
7
- .children));
8
- }
9
- flatChildren.push(child);
10
- return flatChildren;
11
- }, []);
12
- };
@@ -1,5 +0,0 @@
1
- // Timings
2
- export { linearTiming } from './timings/linear-timing.js';
3
- export { springTiming } from './timings/spring-timing.js';
4
- // Component
5
- export { TransitionSeries } from './TransitionSeries.js';
@@ -1,42 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { translatePath } from '@remotion/paths';
3
- import { makePie } from '@remotion/shapes';
4
- import { useMemo, useState } from 'react';
5
- import { AbsoluteFill, random } from 'remotion';
6
- const ClockWipePresentation = ({ children, presentationDirection, presentationProgress, passedProps }) => {
7
- const finishedRadius = Math.sqrt(passedProps.width ** 2 + passedProps.height ** 2) / 2;
8
- const { path } = makePie({
9
- radius: finishedRadius,
10
- progress: presentationProgress,
11
- });
12
- const translatedPath = translatePath(path, -(finishedRadius * 2 - passedProps.width) / 2, -(finishedRadius * 2 - passedProps.height) / 2);
13
- const [clipId] = useState(() => String(random(null)));
14
- const style = useMemo(() => {
15
- return {
16
- width: '100%',
17
- height: '100%',
18
- clipPath: presentationDirection === 'exiting' ? undefined : `url(#${clipId})`,
19
- ...(presentationDirection === 'entering'
20
- ? passedProps.innerEnterStyle
21
- : passedProps.innerExitStyle),
22
- };
23
- }, [
24
- clipId,
25
- passedProps.innerEnterStyle,
26
- passedProps.innerExitStyle,
27
- presentationDirection,
28
- ]);
29
- const outerStyle = useMemo(() => {
30
- return presentationDirection === 'entering'
31
- ? passedProps.outerEnterStyle
32
- : passedProps.outerExitStyle;
33
- }, [
34
- passedProps.outerEnterStyle,
35
- passedProps.outerExitStyle,
36
- presentationDirection,
37
- ]);
38
- return (_jsxs(AbsoluteFill, { style: outerStyle, children: [_jsx(AbsoluteFill, { style: style, children: children }), presentationDirection === 'exiting' ? null : (_jsx(AbsoluteFill, { children: _jsx("svg", { children: _jsx("defs", { children: _jsx("clipPath", { id: clipId, children: _jsx("path", { d: translatedPath, fill: "black" }) }) }) }) }))] }));
39
- };
40
- export const clockWipe = (props) => {
41
- return { component: ClockWipePresentation, props: props !== null && props !== void 0 ? props : {} };
42
- };
@@ -1,27 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import { useMemo } from 'react';
3
- import { AbsoluteFill } from 'remotion';
4
- const FadePresentation = ({ children, presentationDirection, presentationProgress, passedProps }) => {
5
- const isEntering = presentationDirection === 'entering';
6
- const style = useMemo(() => {
7
- return {
8
- opacity: isEntering ? presentationProgress : 1,
9
- ...(presentationDirection === 'entering'
10
- ? passedProps.enterStyle
11
- : passedProps.exitStyle),
12
- };
13
- }, [
14
- isEntering,
15
- passedProps.enterStyle,
16
- passedProps.exitStyle,
17
- presentationDirection,
18
- presentationProgress,
19
- ]);
20
- return _jsx(AbsoluteFill, { style: style, children: children });
21
- };
22
- export const fade = (props) => {
23
- return {
24
- component: FadePresentation,
25
- props: props !== null && props !== void 0 ? props : {},
26
- };
27
- };
@@ -1,45 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import { useMemo } from 'react';
3
- import { AbsoluteFill, interpolate } from 'remotion';
4
- const Flip = ({ children, presentationDirection, presentationProgress, passedProps: { direction = 'from-left', perspective = 1000, innerEnterStyle, innerExitStyle, outerEnterStyle, outerExitStyle, }, }) => {
5
- const style = useMemo(() => {
6
- const startRotationEntering = direction === 'from-right' || direction === 'from-top' ? 180 : -180;
7
- const endRotationEntering = direction === 'from-right' || direction === 'from-top' ? -180 : 180;
8
- const rotation = presentationDirection === 'entering'
9
- ? interpolate(presentationProgress, [0, 1], [startRotationEntering, 0])
10
- : interpolate(presentationProgress, [0, 1], [0, endRotationEntering]);
11
- const rotateProperty = direction === 'from-top' || direction === 'from-bottom'
12
- ? 'rotateX'
13
- : 'rotateY';
14
- return {
15
- width: '100%',
16
- height: '100%',
17
- transform: `${rotateProperty}(${rotation}deg)`,
18
- backfaceVisibility: 'hidden',
19
- WebkitBackfaceVisibility: 'hidden',
20
- ...(presentationDirection === 'entering'
21
- ? innerEnterStyle
22
- : innerExitStyle),
23
- };
24
- }, [
25
- direction,
26
- innerEnterStyle,
27
- innerExitStyle,
28
- presentationDirection,
29
- presentationProgress,
30
- ]);
31
- const outer = useMemo(() => {
32
- return {
33
- perspective,
34
- // Make children also their backface hidden
35
- transformStyle: 'preserve-3d',
36
- ...(presentationDirection === 'entering'
37
- ? outerEnterStyle
38
- : outerExitStyle),
39
- };
40
- }, [outerEnterStyle, outerExitStyle, perspective, presentationDirection]);
41
- return (_jsx(AbsoluteFill, { style: outer, children: _jsx(AbsoluteFill, { style: style, children: children }) }));
42
- };
43
- export const flip = (props) => {
44
- return { component: Flip, props: props !== null && props !== void 0 ? props : {} };
45
- };
@@ -1,72 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import { useMemo } from 'react';
3
- import { AbsoluteFill } from 'remotion';
4
- const epsilon = 0.01;
5
- const SlidePresentation = ({ children, presentationProgress, presentationDirection, passedProps: { direction = 'from-left', enterStyle, exitStyle }, }) => {
6
- const directionStyle = useMemo(() => {
7
- // Overlay the two slides barely to avoid a white line between them
8
- // Remove the correction once the presentation progress is 1
9
- const presentationProgressWithEpsilonCorrection = presentationProgress === 1
10
- ? presentationProgress * 100
11
- : presentationProgress * 100 - epsilon;
12
- if (presentationDirection === 'exiting') {
13
- switch (direction) {
14
- case 'from-left':
15
- return {
16
- transform: `translateX(${presentationProgressWithEpsilonCorrection}%)`,
17
- };
18
- case 'from-right':
19
- return {
20
- transform: `translateX(-${presentationProgress * 100}%)`,
21
- };
22
- case 'from-top':
23
- return {
24
- transform: `translateY(${presentationProgressWithEpsilonCorrection}%)`,
25
- };
26
- case 'from-bottom':
27
- return {
28
- transform: `translateY(-${presentationProgress * 100}%)`,
29
- };
30
- default:
31
- throw new Error(`Invalid direction: ${direction}`);
32
- }
33
- }
34
- switch (direction) {
35
- case 'from-left':
36
- return {
37
- transform: `translateX(${-100 + presentationProgress * 100}%)`,
38
- };
39
- case 'from-right':
40
- return {
41
- transform: `translateX(${100 - presentationProgressWithEpsilonCorrection}%)`,
42
- };
43
- case 'from-top':
44
- return {
45
- transform: `translateY(${-100 + presentationProgress * 100}%)`,
46
- };
47
- case 'from-bottom':
48
- return {
49
- transform: `translateY(${100 - presentationProgressWithEpsilonCorrection}%)`,
50
- };
51
- default:
52
- throw new Error(`Invalid direction: ${direction}`);
53
- }
54
- }, [presentationDirection, presentationProgress, direction]);
55
- const style = useMemo(() => {
56
- return {
57
- width: '100%',
58
- height: '100%',
59
- justifyContent: 'center',
60
- alignItems: 'center',
61
- ...directionStyle,
62
- ...(presentationDirection === 'entering' ? enterStyle : exitStyle),
63
- };
64
- }, [directionStyle, enterStyle, exitStyle, presentationDirection]);
65
- return _jsx(AbsoluteFill, { style: style, children: children });
66
- };
67
- export const slide = (props) => {
68
- return {
69
- component: SlidePresentation,
70
- props: props !== null && props !== void 0 ? props : {},
71
- };
72
- };
@@ -1,159 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { useMemo, useState } from 'react';
3
- import { AbsoluteFill, random } from 'remotion';
4
- const makePathIn = (progress, direction) => {
5
- switch (direction) {
6
- case 'from-left':
7
- return `
8
- M 0 0
9
- L ${progress} 0
10
- L ${progress} 1
11
- L 0 1
12
- Z`;
13
- case 'from-top-left':
14
- return `
15
- M 0 0
16
- L ${progress * 2} 0
17
- L 0 ${progress * 2}
18
- Z`;
19
- case 'from-top':
20
- return `
21
- M 0 0
22
- L 1 0
23
- L 1 ${progress}
24
- L 0 ${progress}
25
- Z`;
26
- case 'from-top-right':
27
- return `
28
- M 1 0
29
- L ${1 - progress * 2} 0
30
- L 1 ${progress * 2}
31
- Z`;
32
- case 'from-right':
33
- return `
34
- M 1 0
35
- L 1 1
36
- L ${1 - progress} 1
37
- L ${1 - progress} 0
38
- Z`;
39
- case 'from-bottom-right':
40
- return `
41
- M 1 1
42
- L ${1 - progress * 2} 1
43
- L 1 ${1 - progress * 2}
44
- Z`;
45
- case 'from-bottom':
46
- return `
47
- M 0 1
48
- L 1 1
49
- L 1 ${1 - progress}
50
- L 0 ${1 - progress}
51
- Z`;
52
- case 'from-bottom-left':
53
- return `
54
- M 0 1
55
- L 0 ${1 - progress * 2}
56
- L ${progress * 2} 1
57
- Z`;
58
- default:
59
- throw new Error(`Unknown direction ${JSON.stringify(direction)}`);
60
- }
61
- };
62
- const makePathOut = (progress, direction) => {
63
- switch (direction) {
64
- case 'from-left':
65
- return `
66
- M 1 1
67
- L ${1 - progress} 1
68
- L ${1 - progress} 0
69
- L 1 0
70
- Z`;
71
- case 'from-top-left':
72
- return `
73
- M 1 1
74
- L ${1 - 2 * progress} 1
75
- L 1 ${1 - 2 * progress}
76
- Z`;
77
- case 'from-top':
78
- return `
79
- M 1 1
80
- L 0 1
81
- L 0 ${1 - progress}
82
- L 1 ${1 - progress}
83
- Z`;
84
- case 'from-top-right':
85
- return `
86
- M 0 1
87
- L ${progress * 2} 1
88
- L 0 ${1 - progress * 2}
89
- Z`;
90
- case 'from-right':
91
- return `
92
- M 0 0
93
- L ${progress} 0
94
- L ${progress} 1
95
- L 0 1
96
- Z`;
97
- case 'from-bottom-right':
98
- return `
99
- M 0 0
100
- L ${progress * 2} 0
101
- L 0 ${progress * 2}
102
- Z`;
103
- case 'from-bottom':
104
- return `
105
- M 1 0
106
- L 0 0
107
- L 0 ${progress}
108
- L 1 ${progress}
109
- Z`;
110
- case 'from-bottom-left':
111
- return `
112
- M 1 0
113
- L ${1 - progress * 2} 0
114
- L 1 ${progress * 2}
115
- Z`;
116
- default:
117
- throw new Error(`Unknown direction ${JSON.stringify(direction)}`);
118
- }
119
- };
120
- const WipePresentation = ({ children, presentationProgress, presentationDirection, passedProps: { direction = 'from-left', innerEnterStyle, innerExitStyle, outerEnterStyle, outerExitStyle, }, }) => {
121
- const [clipId] = useState(() => String(random(null)));
122
- const progressInDirection = presentationDirection === 'entering'
123
- ? presentationProgress
124
- : 1 - presentationProgress;
125
- const path = presentationDirection === 'entering'
126
- ? makePathIn(progressInDirection, direction)
127
- : makePathOut(progressInDirection, direction);
128
- const style = useMemo(() => {
129
- return {
130
- width: '100%',
131
- height: '100%',
132
- justifyContent: 'center',
133
- alignItems: 'center',
134
- clipPath: `url(#${clipId})`,
135
- ...(presentationDirection === 'entering'
136
- ? innerEnterStyle
137
- : innerExitStyle),
138
- };
139
- }, [clipId, innerEnterStyle, innerExitStyle, presentationDirection]);
140
- const outerStyle = useMemo(() => {
141
- return presentationDirection === 'entering'
142
- ? outerEnterStyle
143
- : outerExitStyle;
144
- }, [outerEnterStyle, outerExitStyle, presentationDirection]);
145
- const svgStyle = useMemo(() => {
146
- return {
147
- width: '100%',
148
- height: '100%',
149
- pointerEvents: 'none',
150
- };
151
- }, []);
152
- return (_jsxs(AbsoluteFill, { style: outerStyle, children: [_jsx(AbsoluteFill, { style: style, children: children }), _jsx(AbsoluteFill, { children: _jsx("svg", { viewBox: "0 0 1 1", style: svgStyle, children: _jsx("defs", { children: _jsx("clipPath", { id: clipId, clipPathUnits: "objectBoundingBox", children: _jsx("path", { d: path, fill: "black" }) }) }) }) })] }));
153
- };
154
- export const wipe = (props) => {
155
- return {
156
- component: WipePresentation,
157
- props: props !== null && props !== void 0 ? props : {},
158
- };
159
- };
@@ -1,33 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- /**
3
- * @vitest-environment jsdom
4
- */
5
- import { makeMockCompositionManagerContext, makeTimelineContext, } from '@remotion/test-utils';
6
- import { renderToString } from 'react-dom/server';
7
- import { AbsoluteFill, Internals } from 'remotion';
8
- import { expect, test } from 'vitest';
9
- import { fade } from '../presentations/fade.js';
10
- import { linearTiming } from '../timings/linear-timing.js';
11
- import { TransitionSeries } from '../TransitionSeries.js';
12
- const renderForFrame = (frame, markup) => {
13
- return renderToString(_jsx(Internals.CanUseRemotionHooksProvider, { children: _jsx(Internals.CompositionManager.Provider, { value: makeMockCompositionManagerContext(), children: _jsx(Internals.Timeline.TimelineContext.Provider, { value: makeTimelineContext(frame), children: markup }) }) }));
14
- };
15
- const Letter = ({ children, color }) => {
16
- return (_jsx(AbsoluteFill, { style: {
17
- backgroundColor: color,
18
- opacity: 0.9,
19
- justifyContent: 'center',
20
- alignItems: 'center',
21
- fontSize: 200,
22
- color: 'white',
23
- }, children: children }));
24
- };
25
- test('Should throw if two transitions in a row', () => {
26
- expect(() => {
27
- return renderForFrame(10, _jsxs(TransitionSeries, { children: [_jsx(TransitionSeries.Sequence, { durationInFrames: 60, children: _jsx(Letter, { color: "green", children: "C" }) }), _jsx(TransitionSeries.Transition, { presentation: fade({}), timing: linearTiming({
28
- durationInFrames: 40,
29
- }) }), _jsx(TransitionSeries.Transition, { presentation: fade({}), timing: linearTiming({
30
- durationInFrames: 40,
31
- }) })] }));
32
- }).toThrow('A <TransitionSeries.Transition /> component must not be followed by another <TransitionSeries.Transition /> component (nth children = 1 and 2)');
33
- });
@@ -1,15 +0,0 @@
1
- import { interpolate } from 'remotion';
2
- export const linearTiming = (options) => {
3
- return {
4
- getDurationInFrames: () => {
5
- return options.durationInFrames;
6
- },
7
- getProgress: ({ frame }) => {
8
- return interpolate(frame, [0, options.durationInFrames], [0, 1], {
9
- easing: options.easing,
10
- extrapolateLeft: 'clamp',
11
- extrapolateRight: 'clamp',
12
- });
13
- },
14
- };
15
- };
@@ -1,30 +0,0 @@
1
- import { measureSpring, spring } from 'remotion';
2
- const springWithInvalidArgumentRejection = (args) => {
3
- if (args.to || args.from) {
4
- throw new Error('to / from values are not supported by springWithRoundUpIfThreshold');
5
- }
6
- return spring(args);
7
- };
8
- export const springTiming = (options = {}) => {
9
- return {
10
- getDurationInFrames: ({ fps }) => {
11
- if (options.durationInFrames) {
12
- return options.durationInFrames;
13
- }
14
- return measureSpring({
15
- config: options.config,
16
- threshold: options.durationRestThreshold,
17
- fps,
18
- });
19
- },
20
- getProgress: ({ fps, frame }) => {
21
- return springWithInvalidArgumentRejection({
22
- fps,
23
- frame,
24
- config: options.config,
25
- durationInFrames: options.durationInFrames,
26
- durationRestThreshold: options.durationRestThreshold,
27
- });
28
- },
29
- };
30
- };
@@ -1,3 +0,0 @@
1
- /* eslint-disable prefer-destructuring */
2
- import { NoReactInternals } from 'remotion/no-react';
3
- export const validateDurationInFrames = NoReactInternals.validateDurationInFrames;