@remotion/transitions 4.0.84 → 4.0.86

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 (38) hide show
  1. package/clock-wipe.js +2 -0
  2. package/dist/TransitionSeries.js +29 -26
  3. package/dist/{cjs/clock-wipe.js → esm/clock-wipe.mjs} +12 -16
  4. package/dist/{cjs/fade.js → esm/fade.mjs} +6 -10
  5. package/dist/{cjs/flip.js → esm/flip.mjs} +9 -13
  6. package/dist/{cjs/index.js → esm/index.mjs} +27 -37
  7. package/dist/{cjs/slide.js → esm/slide.mjs} +7 -11
  8. package/dist/{cjs/wipe.js → esm/wipe.mjs} +9 -13
  9. package/dist/flatten-children.js +12 -5
  10. package/dist/index.js +9 -3
  11. package/dist/presentations/clock-wipe.js +16 -12
  12. package/dist/presentations/fade.js +10 -6
  13. package/dist/presentations/flip.js +13 -9
  14. package/dist/presentations/slide.js +11 -7
  15. package/dist/presentations/wipe.js +13 -9
  16. package/dist/timings/linear-timing.js +7 -3
  17. package/dist/timings/spring-timing.js +8 -4
  18. package/dist/types.js +2 -1
  19. package/dist/validate.js +5 -2
  20. package/fade.js +2 -0
  21. package/flip.js +2 -0
  22. package/package.json +28 -28
  23. package/rollup.config.js +6 -6
  24. package/slide.js +2 -0
  25. package/wipe.js +2 -0
  26. /package/dist/{cjs → esm}/TransitionSeries.d.ts +0 -0
  27. /package/dist/{cjs → esm}/flatten-children.d.ts +0 -0
  28. /package/dist/{cjs → esm}/index.d.ts +0 -0
  29. /package/dist/{cjs → esm}/presentations/clock-wipe.d.ts +0 -0
  30. /package/dist/{cjs → esm}/presentations/fade.d.ts +0 -0
  31. /package/dist/{cjs → esm}/presentations/flip.d.ts +0 -0
  32. /package/dist/{cjs → esm}/presentations/slide.d.ts +0 -0
  33. /package/dist/{cjs → esm}/presentations/wipe.d.ts +0 -0
  34. /package/dist/{cjs → esm}/test/transitions.test.d.ts +0 -0
  35. /package/dist/{cjs → esm}/timings/linear-timing.d.ts +0 -0
  36. /package/dist/{cjs → esm}/timings/spring-timing.d.ts +0 -0
  37. /package/dist/{cjs → esm}/types.d.ts +0 -0
  38. /package/dist/{cjs → esm}/validate.d.ts +0 -0
package/clock-wipe.js ADDED
@@ -0,0 +1,2 @@
1
+ // For backwards compatibility when you use `esm-wallaby`
2
+ module.exports = require('./dist/presentations/clock-wipe.js');
@@ -1,9 +1,12 @@
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';
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.TransitionSeries = void 0;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const react_1 = require("react");
6
+ const remotion_1 = require("remotion");
7
+ const flatten_children_js_1 = require("./flatten-children.js");
8
+ const slide_js_1 = require("./presentations/slide.js");
9
+ const validate_js_1 = require("./validate.js");
7
10
  // eslint-disable-next-line react/function-component-definition
8
11
  const TransitionSeriesTransition = function (
9
12
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
@@ -12,16 +15,16 @@ _props) {
12
15
  };
13
16
  const SeriesSequence = ({ children }) => {
14
17
  // eslint-disable-next-line react/jsx-no-useless-fragment
15
- return _jsx(_Fragment, { children: children });
18
+ return (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: children });
16
19
  };
17
20
  const TransitionSeriesChildren = ({ children, }) => {
18
- const { fps } = useVideoConfig();
19
- const frame = useCurrentFrame();
20
- const childrenValue = useMemo(() => {
21
+ const { fps } = (0, remotion_1.useVideoConfig)();
22
+ const frame = (0, remotion_1.useCurrentFrame)();
23
+ const childrenValue = (0, react_1.useMemo)(() => {
21
24
  let transitionOffsets = 0;
22
25
  let startFrame = 0;
23
- const flattedChildren = flattenChildren(children);
24
- return Children.map(flattedChildren, (child, i) => {
26
+ const flattedChildren = (0, flatten_children_js_1.flattenChildren)(children);
27
+ return react_1.Children.map(flattedChildren, (child, i) => {
25
28
  var _a, _b, _c, _d, _e, _f, _g, _h, _j;
26
29
  const current = child;
27
30
  if (typeof current === 'string') {
@@ -62,7 +65,7 @@ const TransitionSeriesChildren = ({ children, }) => {
62
65
  }
63
66
  const durationInFramesProp = castedChildAgain.props.durationInFrames;
64
67
  const { durationInFrames, children: _children, ...passedProps } = castedChildAgain.props;
65
- validateDurationInFrames(durationInFramesProp, {
68
+ (0, validate_js_1.validateDurationInFrames)(durationInFramesProp, {
66
69
  component: `of a <TransitionSeries.Sequence /> component`,
67
70
  allowFloats: true,
68
71
  });
@@ -115,34 +118,34 @@ const TransitionSeriesChildren = ({ children, }) => {
115
118
  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
119
  }
117
120
  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();
121
+ const nextPresentation = (_b = next.props.presentation) !== null && _b !== void 0 ? _b : (0, slide_js_1.slide)();
122
+ const prevPresentation = (_c = prev.props.presentation) !== null && _c !== void 0 ? _c : (0, slide_js_1.slide)();
120
123
  const UppercaseNextPresentation = nextPresentation.component;
121
124
  const UppercasePrevPresentation = prevPresentation.component;
122
- return (_jsx(Sequence, { 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 }) }) }) }));
125
+ return ((0, jsx_runtime_1.jsx)(remotion_1.Sequence, { name: "<TS.Sequence>", from: Math.floor(actualStartFrame), durationInFrames: durationInFramesProp, layout: "none", stack: passedProps.stack, children: (0, jsx_runtime_1.jsx)(UppercaseNextPresentation, { passedProps: (_d = nextPresentation.props) !== null && _d !== void 0 ? _d : {}, presentationDirection: "exiting", presentationProgress: nextProgress, children: (0, jsx_runtime_1.jsx)(UppercasePrevPresentation, { passedProps: (_e = prevPresentation.props) !== null && _e !== void 0 ? _e : {}, presentationDirection: "entering", presentationProgress: prevProgress, children: (0, jsx_runtime_1.jsx)(remotion_1.Sequence, { showInTimeline: false, ...passedProps, children: child }) }) }) }));
123
126
  }
124
127
  if (prevProgress !== null && prev) {
125
- const prevPresentation = (_f = prev.props.presentation) !== null && _f !== void 0 ? _f : slide();
128
+ const prevPresentation = (_f = prev.props.presentation) !== null && _f !== void 0 ? _f : (0, slide_js_1.slide)();
126
129
  const UppercasePrevPresentation = prevPresentation.component;
127
- return (_jsx(Sequence, { 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 }) }) }));
130
+ return ((0, jsx_runtime_1.jsx)(remotion_1.Sequence, { name: "<TS.Sequence>", from: Math.floor(actualStartFrame), durationInFrames: durationInFramesProp, layout: "none", stack: passedProps.stack, children: (0, jsx_runtime_1.jsx)(UppercasePrevPresentation, { passedProps: (_g = prevPresentation.props) !== null && _g !== void 0 ? _g : {}, presentationDirection: "entering", presentationProgress: prevProgress, children: (0, jsx_runtime_1.jsx)(remotion_1.Sequence, { showInTimeline: false, ...passedProps, children: child }) }) }));
128
131
  }
129
132
  if (nextProgress !== null && next) {
130
- const nextPresentation = (_h = next.props.presentation) !== null && _h !== void 0 ? _h : slide();
133
+ const nextPresentation = (_h = next.props.presentation) !== null && _h !== void 0 ? _h : (0, slide_js_1.slide)();
131
134
  const UppercaseNextPresentation = nextPresentation.component;
132
- return (_jsx(Sequence, { 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 }) }) }));
135
+ return ((0, jsx_runtime_1.jsx)(remotion_1.Sequence, { name: "<TS.Sequence>", from: Math.floor(actualStartFrame), durationInFrames: durationInFramesProp, layout: "none", stack: passedProps.stack, children: (0, jsx_runtime_1.jsx)(UppercaseNextPresentation, { passedProps: (_j = nextPresentation.props) !== null && _j !== void 0 ? _j : {}, presentationDirection: "exiting", presentationProgress: nextProgress, children: (0, jsx_runtime_1.jsx)(remotion_1.Sequence, { showInTimeline: false, ...passedProps, children: child }) }) }));
133
136
  }
134
- return (_jsx(Sequence, { name: "<TS.Sequence>", from: Math.floor(actualStartFrame), durationInFrames: durationInFramesProp, ...passedProps, children: child }));
137
+ return ((0, jsx_runtime_1.jsx)(remotion_1.Sequence, { name: "<TS.Sequence>", from: Math.floor(actualStartFrame), durationInFrames: durationInFramesProp, ...passedProps, children: child }));
135
138
  });
136
139
  }, [children, fps, frame]);
137
140
  // eslint-disable-next-line react/jsx-no-useless-fragment
138
- return _jsx(_Fragment, { children: childrenValue });
141
+ return (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: childrenValue });
139
142
  };
140
143
  const TransitionSeries = ({ children, name, ...otherProps }) => {
141
144
  const displayName = name !== null && name !== void 0 ? name : '<TransitionSeries>';
142
- return (_jsx(Sequence, { name: displayName, ...otherProps, children: _jsx(TransitionSeriesChildren, { children: children }) }));
145
+ return ((0, jsx_runtime_1.jsx)(remotion_1.Sequence, { name: displayName, ...otherProps, children: (0, jsx_runtime_1.jsx)(TransitionSeriesChildren, { children: children }) }));
143
146
  };
147
+ exports.TransitionSeries = TransitionSeries;
144
148
  TransitionSeries.Sequence = SeriesSequence;
145
149
  TransitionSeries.Transition = TransitionSeriesTransition;
146
- export { TransitionSeries };
147
- Internals.addSequenceStackTraces(TransitionSeries);
148
- Internals.addSequenceStackTraces(SeriesSequence);
150
+ remotion_1.Internals.addSequenceStackTraces(TransitionSeries);
151
+ remotion_1.Internals.addSequenceStackTraces(SeriesSequence);
@@ -1,22 +1,18 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- var jsxRuntime = require('react/jsx-runtime');
6
- var paths = require('@remotion/paths');
7
- var shapes = require('@remotion/shapes');
8
- var react = require('react');
9
- var remotion = require('remotion');
1
+ import { jsxs, jsx } from 'react/jsx-runtime';
2
+ import { translatePath } from '@remotion/paths';
3
+ import { makePie } from '@remotion/shapes';
4
+ import { useState, useMemo } from 'react';
5
+ import { random, AbsoluteFill } from 'remotion';
10
6
 
11
7
  const ClockWipePresentation = ({ children, presentationDirection, presentationProgress, passedProps }) => {
12
8
  const finishedRadius = Math.sqrt(passedProps.width ** 2 + passedProps.height ** 2) / 2;
13
- const { path } = shapes.makePie({
9
+ const { path } = makePie({
14
10
  radius: finishedRadius,
15
11
  progress: presentationProgress,
16
12
  });
17
- const translatedPath = paths.translatePath(path, -(finishedRadius * 2 - passedProps.width) / 2, -(finishedRadius * 2 - passedProps.height) / 2);
18
- const [clipId] = react.useState(() => String(remotion.random(null)));
19
- const style = react.useMemo(() => {
13
+ const translatedPath = translatePath(path, -(finishedRadius * 2 - passedProps.width) / 2, -(finishedRadius * 2 - passedProps.height) / 2);
14
+ const [clipId] = useState(() => String(random(null)));
15
+ const style = useMemo(() => {
20
16
  return {
21
17
  width: '100%',
22
18
  height: '100%',
@@ -31,7 +27,7 @@ const ClockWipePresentation = ({ children, presentationDirection, presentationPr
31
27
  passedProps.innerExitStyle,
32
28
  presentationDirection,
33
29
  ]);
34
- const outerStyle = react.useMemo(() => {
30
+ const outerStyle = useMemo(() => {
35
31
  return presentationDirection === 'entering'
36
32
  ? passedProps.outerEnterStyle
37
33
  : passedProps.outerExitStyle;
@@ -40,10 +36,10 @@ const ClockWipePresentation = ({ children, presentationDirection, presentationPr
40
36
  passedProps.outerExitStyle,
41
37
  presentationDirection,
42
38
  ]);
43
- return (jsxRuntime.jsxs(remotion.AbsoluteFill, { style: outerStyle, children: [jsxRuntime.jsx(remotion.AbsoluteFill, { style: style, children: children }), presentationDirection === 'exiting' ? null : (jsxRuntime.jsx(remotion.AbsoluteFill, { children: jsxRuntime.jsx("svg", { children: jsxRuntime.jsx("defs", { children: jsxRuntime.jsx("clipPath", { id: clipId, children: jsxRuntime.jsx("path", { d: translatedPath, fill: "black" }) }) }) }) }))] }));
39
+ 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" }) }) }) }) }))] }));
44
40
  };
45
41
  const clockWipe = (props) => {
46
42
  return { component: ClockWipePresentation, props: props !== null && props !== void 0 ? props : {} };
47
43
  };
48
44
 
49
- exports.clockWipe = clockWipe;
45
+ export { clockWipe };
@@ -1,14 +1,10 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- var jsxRuntime = require('react/jsx-runtime');
6
- var react = require('react');
7
- var remotion = require('remotion');
1
+ import { jsx } from 'react/jsx-runtime';
2
+ import { useMemo } from 'react';
3
+ import { AbsoluteFill } from 'remotion';
8
4
 
9
5
  const FadePresentation = ({ children, presentationDirection, presentationProgress, passedProps }) => {
10
6
  const isEntering = presentationDirection === 'entering';
11
- const style = react.useMemo(() => {
7
+ const style = useMemo(() => {
12
8
  return {
13
9
  opacity: isEntering ? presentationProgress : 1,
14
10
  ...(presentationDirection === 'entering'
@@ -22,7 +18,7 @@ const FadePresentation = ({ children, presentationDirection, presentationProgres
22
18
  presentationDirection,
23
19
  presentationProgress,
24
20
  ]);
25
- return jsxRuntime.jsx(remotion.AbsoluteFill, { style: style, children: children });
21
+ return jsx(AbsoluteFill, { style: style, children: children });
26
22
  };
27
23
  const fade = (props) => {
28
24
  return {
@@ -31,4 +27,4 @@ const fade = (props) => {
31
27
  };
32
28
  };
33
29
 
34
- exports.fade = fade;
30
+ export { fade };
@@ -1,18 +1,14 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- var jsxRuntime = require('react/jsx-runtime');
6
- var react = require('react');
7
- var remotion = require('remotion');
1
+ import { jsx } from 'react/jsx-runtime';
2
+ import { useMemo } from 'react';
3
+ import { interpolate, AbsoluteFill } from 'remotion';
8
4
 
9
5
  const Flip = ({ children, presentationDirection, presentationProgress, passedProps: { direction = 'from-left', perspective = 1000, innerEnterStyle, innerExitStyle, outerEnterStyle, outerExitStyle, }, }) => {
10
- const style = react.useMemo(() => {
6
+ const style = useMemo(() => {
11
7
  const startRotationEntering = direction === 'from-right' || direction === 'from-top' ? 180 : -180;
12
8
  const endRotationEntering = direction === 'from-right' || direction === 'from-top' ? -180 : 180;
13
9
  const rotation = presentationDirection === 'entering'
14
- ? remotion.interpolate(presentationProgress, [0, 1], [startRotationEntering, 0])
15
- : remotion.interpolate(presentationProgress, [0, 1], [0, endRotationEntering]);
10
+ ? interpolate(presentationProgress, [0, 1], [startRotationEntering, 0])
11
+ : interpolate(presentationProgress, [0, 1], [0, endRotationEntering]);
16
12
  const rotateProperty = direction === 'from-top' || direction === 'from-bottom'
17
13
  ? 'rotateX'
18
14
  : 'rotateY';
@@ -33,7 +29,7 @@ const Flip = ({ children, presentationDirection, presentationProgress, passedPro
33
29
  presentationDirection,
34
30
  presentationProgress,
35
31
  ]);
36
- const outer = react.useMemo(() => {
32
+ const outer = useMemo(() => {
37
33
  return {
38
34
  perspective,
39
35
  // Make children also their backface hidden
@@ -43,10 +39,10 @@ const Flip = ({ children, presentationDirection, presentationProgress, passedPro
43
39
  : outerExitStyle),
44
40
  };
45
41
  }, [outerEnterStyle, outerExitStyle, perspective, presentationDirection]);
46
- return (jsxRuntime.jsx(remotion.AbsoluteFill, { style: outer, children: jsxRuntime.jsx(remotion.AbsoluteFill, { style: style, children: children }) }));
42
+ return (jsx(AbsoluteFill, { style: outer, children: jsx(AbsoluteFill, { style: style, children: children }) }));
47
43
  };
48
44
  const flip = (props) => {
49
45
  return { component: Flip, props: props !== null && props !== void 0 ? props : {} };
50
46
  };
51
47
 
52
- exports.flip = flip;
48
+ export { flip };
@@ -1,15 +1,7 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- var remotion = require('remotion');
6
- var jsxRuntime = require('react/jsx-runtime');
7
- var React = require('react');
8
- var noReact = require('remotion/no-react');
9
-
10
- function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
11
-
12
- var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
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';
13
5
 
14
6
  const linearTiming = (options) => {
15
7
  return {
@@ -17,7 +9,7 @@ const linearTiming = (options) => {
17
9
  return options.durationInFrames;
18
10
  },
19
11
  getProgress: ({ frame }) => {
20
- return remotion.interpolate(frame, [0, options.durationInFrames], [0, 1], {
12
+ return interpolate(frame, [0, options.durationInFrames], [0, 1], {
21
13
  easing: options.easing,
22
14
  extrapolateLeft: 'clamp',
23
15
  extrapolateRight: 'clamp',
@@ -30,7 +22,7 @@ const springWithInvalidArgumentRejection = (args) => {
30
22
  if (args.to || args.from) {
31
23
  throw new Error('to / from values are not supported by springWithRoundUpIfThreshold');
32
24
  }
33
- return remotion.spring(args);
25
+ return spring(args);
34
26
  };
35
27
  const springTiming = (options = {}) => {
36
28
  return {
@@ -38,7 +30,7 @@ const springTiming = (options = {}) => {
38
30
  if (options.durationInFrames) {
39
31
  return options.durationInFrames;
40
32
  }
41
- return remotion.measureSpring({
33
+ return measureSpring({
42
34
  config: options.config,
43
35
  threshold: options.durationRestThreshold,
44
36
  fps,
@@ -57,9 +49,9 @@ const springTiming = (options = {}) => {
57
49
  };
58
50
 
59
51
  const flattenChildren = (children) => {
60
- const childrenArray = React__default["default"].Children.toArray(children);
52
+ const childrenArray = React.Children.toArray(children);
61
53
  return childrenArray.reduce((flatChildren, child) => {
62
- if (child.type === React__default["default"].Fragment) {
54
+ if (child.type === React.Fragment) {
63
55
  return flatChildren.concat(flattenChildren(child.props
64
56
  .children));
65
57
  }
@@ -69,7 +61,7 @@ const flattenChildren = (children) => {
69
61
  };
70
62
 
71
63
  const SlidePresentation = ({ children, presentationProgress, presentationDirection, passedProps: { direction = 'from-left', enterStyle, exitStyle }, }) => {
72
- const directionStyle = React.useMemo(() => {
64
+ const directionStyle = useMemo(() => {
73
65
  if (presentationDirection === 'exiting') {
74
66
  switch (direction) {
75
67
  case 'from-left':
@@ -113,7 +105,7 @@ const SlidePresentation = ({ children, presentationProgress, presentationDirecti
113
105
  throw new Error(`Invalid direction: ${direction}`);
114
106
  }
115
107
  }, [presentationDirection, presentationProgress, direction]);
116
- const style = React.useMemo(() => {
108
+ const style = useMemo(() => {
117
109
  return {
118
110
  width: '100%',
119
111
  height: '100%',
@@ -123,7 +115,7 @@ const SlidePresentation = ({ children, presentationProgress, presentationDirecti
123
115
  ...(presentationDirection === 'entering' ? enterStyle : exitStyle),
124
116
  };
125
117
  }, [directionStyle, enterStyle, exitStyle, presentationDirection]);
126
- return jsxRuntime.jsx(remotion.AbsoluteFill, { style: style, children: children });
118
+ return jsx(AbsoluteFill, { style: style, children: children });
127
119
  };
128
120
  const slide = (props) => {
129
121
  return {
@@ -133,7 +125,7 @@ const slide = (props) => {
133
125
  };
134
126
 
135
127
  /* eslint-disable prefer-destructuring */
136
- const validateDurationInFrames = noReact.NoReactInternals.validateDurationInFrames;
128
+ const validateDurationInFrames = NoReactInternals.validateDurationInFrames;
137
129
 
138
130
  // eslint-disable-next-line react/function-component-definition
139
131
  const TransitionSeriesTransition = function (
@@ -143,16 +135,16 @@ _props) {
143
135
  };
144
136
  const SeriesSequence = ({ children }) => {
145
137
  // eslint-disable-next-line react/jsx-no-useless-fragment
146
- return jsxRuntime.jsx(jsxRuntime.Fragment, { children: children });
138
+ return jsx(Fragment, { children: children });
147
139
  };
148
140
  const TransitionSeriesChildren = ({ children, }) => {
149
- const { fps } = remotion.useVideoConfig();
150
- const frame = remotion.useCurrentFrame();
151
- const childrenValue = React.useMemo(() => {
141
+ const { fps } = useVideoConfig();
142
+ const frame = useCurrentFrame();
143
+ const childrenValue = useMemo(() => {
152
144
  let transitionOffsets = 0;
153
145
  let startFrame = 0;
154
146
  const flattedChildren = flattenChildren(children);
155
- return React.Children.map(flattedChildren, (child, i) => {
147
+ return Children.map(flattedChildren, (child, i) => {
156
148
  var _a, _b, _c, _d, _e, _f, _g, _h, _j;
157
149
  const current = child;
158
150
  if (typeof current === 'string') {
@@ -250,33 +242,31 @@ const TransitionSeriesChildren = ({ children, }) => {
250
242
  const prevPresentation = (_c = prev.props.presentation) !== null && _c !== void 0 ? _c : slide();
251
243
  const UppercaseNextPresentation = nextPresentation.component;
252
244
  const UppercasePrevPresentation = prevPresentation.component;
253
- return (jsxRuntime.jsx(remotion.Sequence, { name: "<TS.Sequence>", from: Math.floor(actualStartFrame), durationInFrames: durationInFramesProp, layout: "none", stack: passedProps.stack, children: jsxRuntime.jsx(UppercaseNextPresentation, { passedProps: (_d = nextPresentation.props) !== null && _d !== void 0 ? _d : {}, presentationDirection: "exiting", presentationProgress: nextProgress, children: jsxRuntime.jsx(UppercasePrevPresentation, { passedProps: (_e = prevPresentation.props) !== null && _e !== void 0 ? _e : {}, presentationDirection: "entering", presentationProgress: prevProgress, children: jsxRuntime.jsx(remotion.Sequence, { showInTimeline: false, ...passedProps, children: child }) }) }) }));
245
+ return (jsx(Sequence, { 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 }) }) }) }));
254
246
  }
255
247
  if (prevProgress !== null && prev) {
256
248
  const prevPresentation = (_f = prev.props.presentation) !== null && _f !== void 0 ? _f : slide();
257
249
  const UppercasePrevPresentation = prevPresentation.component;
258
- return (jsxRuntime.jsx(remotion.Sequence, { name: "<TS.Sequence>", from: Math.floor(actualStartFrame), durationInFrames: durationInFramesProp, layout: "none", stack: passedProps.stack, children: jsxRuntime.jsx(UppercasePrevPresentation, { passedProps: (_g = prevPresentation.props) !== null && _g !== void 0 ? _g : {}, presentationDirection: "entering", presentationProgress: prevProgress, children: jsxRuntime.jsx(remotion.Sequence, { showInTimeline: false, ...passedProps, children: child }) }) }));
250
+ return (jsx(Sequence, { 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 }) }) }));
259
251
  }
260
252
  if (nextProgress !== null && next) {
261
253
  const nextPresentation = (_h = next.props.presentation) !== null && _h !== void 0 ? _h : slide();
262
254
  const UppercaseNextPresentation = nextPresentation.component;
263
- return (jsxRuntime.jsx(remotion.Sequence, { name: "<TS.Sequence>", from: Math.floor(actualStartFrame), durationInFrames: durationInFramesProp, layout: "none", stack: passedProps.stack, children: jsxRuntime.jsx(UppercaseNextPresentation, { passedProps: (_j = nextPresentation.props) !== null && _j !== void 0 ? _j : {}, presentationDirection: "exiting", presentationProgress: nextProgress, children: jsxRuntime.jsx(remotion.Sequence, { showInTimeline: false, ...passedProps, children: child }) }) }));
255
+ return (jsx(Sequence, { 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 }) }) }));
264
256
  }
265
- return (jsxRuntime.jsx(remotion.Sequence, { name: "<TS.Sequence>", from: Math.floor(actualStartFrame), durationInFrames: durationInFramesProp, ...passedProps, children: child }));
257
+ return (jsx(Sequence, { name: "<TS.Sequence>", from: Math.floor(actualStartFrame), durationInFrames: durationInFramesProp, ...passedProps, children: child }));
266
258
  });
267
259
  }, [children, fps, frame]);
268
260
  // eslint-disable-next-line react/jsx-no-useless-fragment
269
- return jsxRuntime.jsx(jsxRuntime.Fragment, { children: childrenValue });
261
+ return jsx(Fragment, { children: childrenValue });
270
262
  };
271
263
  const TransitionSeries = ({ children, name, ...otherProps }) => {
272
264
  const displayName = name !== null && name !== void 0 ? name : '<TransitionSeries>';
273
- return (jsxRuntime.jsx(remotion.Sequence, { name: displayName, ...otherProps, children: jsxRuntime.jsx(TransitionSeriesChildren, { children: children }) }));
265
+ return (jsx(Sequence, { name: displayName, ...otherProps, children: jsx(TransitionSeriesChildren, { children: children }) }));
274
266
  };
275
267
  TransitionSeries.Sequence = SeriesSequence;
276
268
  TransitionSeries.Transition = TransitionSeriesTransition;
277
- remotion.Internals.addSequenceStackTraces(TransitionSeries);
278
- remotion.Internals.addSequenceStackTraces(SeriesSequence);
269
+ Internals.addSequenceStackTraces(TransitionSeries);
270
+ Internals.addSequenceStackTraces(SeriesSequence);
279
271
 
280
- exports.TransitionSeries = TransitionSeries;
281
- exports.linearTiming = linearTiming;
282
- exports.springTiming = springTiming;
272
+ export { TransitionSeries, linearTiming, springTiming };
@@ -1,13 +1,9 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- var jsxRuntime = require('react/jsx-runtime');
6
- var react = require('react');
7
- var remotion = require('remotion');
1
+ import { jsx } from 'react/jsx-runtime';
2
+ import { useMemo } from 'react';
3
+ import { AbsoluteFill } from 'remotion';
8
4
 
9
5
  const SlidePresentation = ({ children, presentationProgress, presentationDirection, passedProps: { direction = 'from-left', enterStyle, exitStyle }, }) => {
10
- const directionStyle = react.useMemo(() => {
6
+ const directionStyle = useMemo(() => {
11
7
  if (presentationDirection === 'exiting') {
12
8
  switch (direction) {
13
9
  case 'from-left':
@@ -51,7 +47,7 @@ const SlidePresentation = ({ children, presentationProgress, presentationDirecti
51
47
  throw new Error(`Invalid direction: ${direction}`);
52
48
  }
53
49
  }, [presentationDirection, presentationProgress, direction]);
54
- const style = react.useMemo(() => {
50
+ const style = useMemo(() => {
55
51
  return {
56
52
  width: '100%',
57
53
  height: '100%',
@@ -61,7 +57,7 @@ const SlidePresentation = ({ children, presentationProgress, presentationDirecti
61
57
  ...(presentationDirection === 'entering' ? enterStyle : exitStyle),
62
58
  };
63
59
  }, [directionStyle, enterStyle, exitStyle, presentationDirection]);
64
- return jsxRuntime.jsx(remotion.AbsoluteFill, { style: style, children: children });
60
+ return jsx(AbsoluteFill, { style: style, children: children });
65
61
  };
66
62
  const slide = (props) => {
67
63
  return {
@@ -70,4 +66,4 @@ const slide = (props) => {
70
66
  };
71
67
  };
72
68
 
73
- exports.slide = slide;
69
+ export { slide };
@@ -1,10 +1,6 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- var jsxRuntime = require('react/jsx-runtime');
6
- var react = require('react');
7
- var remotion = require('remotion');
1
+ import { jsxs, jsx } from 'react/jsx-runtime';
2
+ import { useState, useMemo } from 'react';
3
+ import { random, AbsoluteFill } from 'remotion';
8
4
 
9
5
  const makePathIn = (progress, direction) => {
10
6
  switch (direction) {
@@ -123,14 +119,14 @@ Z`;
123
119
  }
124
120
  };
125
121
  const WipePresentation = ({ children, presentationProgress, presentationDirection, passedProps: { direction = 'from-left', innerEnterStyle, innerExitStyle, outerEnterStyle, outerExitStyle, }, }) => {
126
- const [clipId] = react.useState(() => String(remotion.random(null)));
122
+ const [clipId] = useState(() => String(random(null)));
127
123
  const progressInDirection = presentationDirection === 'entering'
128
124
  ? presentationProgress
129
125
  : 1 - presentationProgress;
130
126
  const path = presentationDirection === 'entering'
131
127
  ? makePathIn(progressInDirection, direction)
132
128
  : makePathOut(progressInDirection, direction);
133
- const style = react.useMemo(() => {
129
+ const style = useMemo(() => {
134
130
  return {
135
131
  width: '100%',
136
132
  height: '100%',
@@ -142,19 +138,19 @@ const WipePresentation = ({ children, presentationProgress, presentationDirectio
142
138
  : innerExitStyle),
143
139
  };
144
140
  }, [clipId, innerEnterStyle, innerExitStyle, presentationDirection]);
145
- const outerStyle = react.useMemo(() => {
141
+ const outerStyle = useMemo(() => {
146
142
  return presentationDirection === 'entering'
147
143
  ? outerEnterStyle
148
144
  : outerExitStyle;
149
145
  }, [outerEnterStyle, outerExitStyle, presentationDirection]);
150
- const svgStyle = react.useMemo(() => {
146
+ const svgStyle = useMemo(() => {
151
147
  return {
152
148
  width: '100%',
153
149
  height: '100%',
154
150
  pointerEvents: 'none',
155
151
  };
156
152
  }, []);
157
- return (jsxRuntime.jsxs(remotion.AbsoluteFill, { style: outerStyle, children: [jsxRuntime.jsx(remotion.AbsoluteFill, { style: style, children: children }), jsxRuntime.jsx(remotion.AbsoluteFill, { children: jsxRuntime.jsx("svg", { viewBox: "0 0 1 1", style: svgStyle, children: jsxRuntime.jsx("defs", { children: jsxRuntime.jsx("clipPath", { id: clipId, clipPathUnits: "objectBoundingBox", children: jsxRuntime.jsx("path", { d: path, fill: "black" }) }) }) }) })] }));
153
+ 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" }) }) }) }) })] }));
158
154
  };
159
155
  const wipe = (props) => {
160
156
  return {
@@ -163,4 +159,4 @@ const wipe = (props) => {
163
159
  };
164
160
  };
165
161
 
166
- exports.wipe = wipe;
162
+ export { wipe };
@@ -1,12 +1,19 @@
1
- import React from 'react';
2
- export const flattenChildren = (children) => {
3
- const childrenArray = React.Children.toArray(children);
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.flattenChildren = void 0;
7
+ const react_1 = __importDefault(require("react"));
8
+ const flattenChildren = (children) => {
9
+ const childrenArray = react_1.default.Children.toArray(children);
4
10
  return childrenArray.reduce((flatChildren, child) => {
5
- if (child.type === React.Fragment) {
6
- return flatChildren.concat(flattenChildren(child.props
11
+ if (child.type === react_1.default.Fragment) {
12
+ return flatChildren.concat((0, exports.flattenChildren)(child.props
7
13
  .children));
8
14
  }
9
15
  flatChildren.push(child);
10
16
  return flatChildren;
11
17
  }, []);
12
18
  };
19
+ exports.flattenChildren = flattenChildren;
package/dist/index.js CHANGED
@@ -1,5 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.TransitionSeries = exports.springTiming = exports.linearTiming = void 0;
1
4
  // Timings
2
- export { linearTiming } from './timings/linear-timing.js';
3
- export { springTiming } from './timings/spring-timing.js';
5
+ var linear_timing_js_1 = require("./timings/linear-timing.js");
6
+ Object.defineProperty(exports, "linearTiming", { enumerable: true, get: function () { return linear_timing_js_1.linearTiming; } });
7
+ var spring_timing_js_1 = require("./timings/spring-timing.js");
8
+ Object.defineProperty(exports, "springTiming", { enumerable: true, get: function () { return spring_timing_js_1.springTiming; } });
4
9
  // Component
5
- export { TransitionSeries } from './TransitionSeries.js';
10
+ var TransitionSeries_js_1 = require("./TransitionSeries.js");
11
+ Object.defineProperty(exports, "TransitionSeries", { enumerable: true, get: function () { return TransitionSeries_js_1.TransitionSeries; } });
@@ -1,17 +1,20 @@
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';
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.clockWipe = void 0;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const paths_1 = require("@remotion/paths");
6
+ const shapes_1 = require("@remotion/shapes");
7
+ const react_1 = require("react");
8
+ const remotion_1 = require("remotion");
6
9
  const ClockWipePresentation = ({ children, presentationDirection, presentationProgress, passedProps }) => {
7
10
  const finishedRadius = Math.sqrt(passedProps.width ** 2 + passedProps.height ** 2) / 2;
8
- const { path } = makePie({
11
+ const { path } = (0, shapes_1.makePie)({
9
12
  radius: finishedRadius,
10
13
  progress: presentationProgress,
11
14
  });
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
+ const translatedPath = (0, paths_1.translatePath)(path, -(finishedRadius * 2 - passedProps.width) / 2, -(finishedRadius * 2 - passedProps.height) / 2);
16
+ const [clipId] = (0, react_1.useState)(() => String((0, remotion_1.random)(null)));
17
+ const style = (0, react_1.useMemo)(() => {
15
18
  return {
16
19
  width: '100%',
17
20
  height: '100%',
@@ -26,7 +29,7 @@ const ClockWipePresentation = ({ children, presentationDirection, presentationPr
26
29
  passedProps.innerExitStyle,
27
30
  presentationDirection,
28
31
  ]);
29
- const outerStyle = useMemo(() => {
32
+ const outerStyle = (0, react_1.useMemo)(() => {
30
33
  return presentationDirection === 'entering'
31
34
  ? passedProps.outerEnterStyle
32
35
  : passedProps.outerExitStyle;
@@ -35,8 +38,9 @@ const ClockWipePresentation = ({ children, presentationDirection, presentationPr
35
38
  passedProps.outerExitStyle,
36
39
  presentationDirection,
37
40
  ]);
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" }) }) }) }) }))] }));
41
+ return ((0, jsx_runtime_1.jsxs)(remotion_1.AbsoluteFill, { style: outerStyle, children: [(0, jsx_runtime_1.jsx)(remotion_1.AbsoluteFill, { style: style, children: children }), presentationDirection === 'exiting' ? null : ((0, jsx_runtime_1.jsx)(remotion_1.AbsoluteFill, { children: (0, jsx_runtime_1.jsx)("svg", { children: (0, jsx_runtime_1.jsx)("defs", { children: (0, jsx_runtime_1.jsx)("clipPath", { id: clipId, children: (0, jsx_runtime_1.jsx)("path", { d: translatedPath, fill: "black" }) }) }) }) }))] }));
39
42
  };
40
- export const clockWipe = (props) => {
43
+ const clockWipe = (props) => {
41
44
  return { component: ClockWipePresentation, props: props !== null && props !== void 0 ? props : {} };
42
45
  };
46
+ exports.clockWipe = clockWipe;
@@ -1,9 +1,12 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import { useMemo } from 'react';
3
- import { AbsoluteFill } from 'remotion';
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.fade = void 0;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const react_1 = require("react");
6
+ const remotion_1 = require("remotion");
4
7
  const FadePresentation = ({ children, presentationDirection, presentationProgress, passedProps }) => {
5
8
  const isEntering = presentationDirection === 'entering';
6
- const style = useMemo(() => {
9
+ const style = (0, react_1.useMemo)(() => {
7
10
  return {
8
11
  opacity: isEntering ? presentationProgress : 1,
9
12
  ...(presentationDirection === 'entering'
@@ -17,11 +20,12 @@ const FadePresentation = ({ children, presentationDirection, presentationProgres
17
20
  presentationDirection,
18
21
  presentationProgress,
19
22
  ]);
20
- return _jsx(AbsoluteFill, { style: style, children: children });
23
+ return (0, jsx_runtime_1.jsx)(remotion_1.AbsoluteFill, { style: style, children: children });
21
24
  };
22
- export const fade = (props) => {
25
+ const fade = (props) => {
23
26
  return {
24
27
  component: FadePresentation,
25
28
  props: props !== null && props !== void 0 ? props : {},
26
29
  };
27
30
  };
31
+ exports.fade = fade;
@@ -1,13 +1,16 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import { useMemo } from 'react';
3
- import { AbsoluteFill, interpolate } from 'remotion';
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.flip = void 0;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const react_1 = require("react");
6
+ const remotion_1 = require("remotion");
4
7
  const Flip = ({ children, presentationDirection, presentationProgress, passedProps: { direction = 'from-left', perspective = 1000, innerEnterStyle, innerExitStyle, outerEnterStyle, outerExitStyle, }, }) => {
5
- const style = useMemo(() => {
8
+ const style = (0, react_1.useMemo)(() => {
6
9
  const startRotationEntering = direction === 'from-right' || direction === 'from-top' ? 180 : -180;
7
10
  const endRotationEntering = direction === 'from-right' || direction === 'from-top' ? -180 : 180;
8
11
  const rotation = presentationDirection === 'entering'
9
- ? interpolate(presentationProgress, [0, 1], [startRotationEntering, 0])
10
- : interpolate(presentationProgress, [0, 1], [0, endRotationEntering]);
12
+ ? (0, remotion_1.interpolate)(presentationProgress, [0, 1], [startRotationEntering, 0])
13
+ : (0, remotion_1.interpolate)(presentationProgress, [0, 1], [0, endRotationEntering]);
11
14
  const rotateProperty = direction === 'from-top' || direction === 'from-bottom'
12
15
  ? 'rotateX'
13
16
  : 'rotateY';
@@ -28,7 +31,7 @@ const Flip = ({ children, presentationDirection, presentationProgress, passedPro
28
31
  presentationDirection,
29
32
  presentationProgress,
30
33
  ]);
31
- const outer = useMemo(() => {
34
+ const outer = (0, react_1.useMemo)(() => {
32
35
  return {
33
36
  perspective,
34
37
  // Make children also their backface hidden
@@ -38,8 +41,9 @@ const Flip = ({ children, presentationDirection, presentationProgress, passedPro
38
41
  : outerExitStyle),
39
42
  };
40
43
  }, [outerEnterStyle, outerExitStyle, perspective, presentationDirection]);
41
- return (_jsx(AbsoluteFill, { style: outer, children: _jsx(AbsoluteFill, { style: style, children: children }) }));
44
+ return ((0, jsx_runtime_1.jsx)(remotion_1.AbsoluteFill, { style: outer, children: (0, jsx_runtime_1.jsx)(remotion_1.AbsoluteFill, { style: style, children: children }) }));
42
45
  };
43
- export const flip = (props) => {
46
+ const flip = (props) => {
44
47
  return { component: Flip, props: props !== null && props !== void 0 ? props : {} };
45
48
  };
49
+ exports.flip = flip;
@@ -1,8 +1,11 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import { useMemo } from 'react';
3
- import { AbsoluteFill } from 'remotion';
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.slide = void 0;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const react_1 = require("react");
6
+ const remotion_1 = require("remotion");
4
7
  const SlidePresentation = ({ children, presentationProgress, presentationDirection, passedProps: { direction = 'from-left', enterStyle, exitStyle }, }) => {
5
- const directionStyle = useMemo(() => {
8
+ const directionStyle = (0, react_1.useMemo)(() => {
6
9
  if (presentationDirection === 'exiting') {
7
10
  switch (direction) {
8
11
  case 'from-left':
@@ -46,7 +49,7 @@ const SlidePresentation = ({ children, presentationProgress, presentationDirecti
46
49
  throw new Error(`Invalid direction: ${direction}`);
47
50
  }
48
51
  }, [presentationDirection, presentationProgress, direction]);
49
- const style = useMemo(() => {
52
+ const style = (0, react_1.useMemo)(() => {
50
53
  return {
51
54
  width: '100%',
52
55
  height: '100%',
@@ -56,11 +59,12 @@ const SlidePresentation = ({ children, presentationProgress, presentationDirecti
56
59
  ...(presentationDirection === 'entering' ? enterStyle : exitStyle),
57
60
  };
58
61
  }, [directionStyle, enterStyle, exitStyle, presentationDirection]);
59
- return _jsx(AbsoluteFill, { style: style, children: children });
62
+ return (0, jsx_runtime_1.jsx)(remotion_1.AbsoluteFill, { style: style, children: children });
60
63
  };
61
- export const slide = (props) => {
64
+ const slide = (props) => {
62
65
  return {
63
66
  component: SlidePresentation,
64
67
  props: props !== null && props !== void 0 ? props : {},
65
68
  };
66
69
  };
70
+ exports.slide = slide;
@@ -1,6 +1,9 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { useMemo, useState } from 'react';
3
- import { AbsoluteFill, random } from 'remotion';
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.wipe = void 0;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const react_1 = require("react");
6
+ const remotion_1 = require("remotion");
4
7
  const makePathIn = (progress, direction) => {
5
8
  switch (direction) {
6
9
  case 'from-left':
@@ -118,14 +121,14 @@ Z`;
118
121
  }
119
122
  };
120
123
  const WipePresentation = ({ children, presentationProgress, presentationDirection, passedProps: { direction = 'from-left', innerEnterStyle, innerExitStyle, outerEnterStyle, outerExitStyle, }, }) => {
121
- const [clipId] = useState(() => String(random(null)));
124
+ const [clipId] = (0, react_1.useState)(() => String((0, remotion_1.random)(null)));
122
125
  const progressInDirection = presentationDirection === 'entering'
123
126
  ? presentationProgress
124
127
  : 1 - presentationProgress;
125
128
  const path = presentationDirection === 'entering'
126
129
  ? makePathIn(progressInDirection, direction)
127
130
  : makePathOut(progressInDirection, direction);
128
- const style = useMemo(() => {
131
+ const style = (0, react_1.useMemo)(() => {
129
132
  return {
130
133
  width: '100%',
131
134
  height: '100%',
@@ -137,23 +140,24 @@ const WipePresentation = ({ children, presentationProgress, presentationDirectio
137
140
  : innerExitStyle),
138
141
  };
139
142
  }, [clipId, innerEnterStyle, innerExitStyle, presentationDirection]);
140
- const outerStyle = useMemo(() => {
143
+ const outerStyle = (0, react_1.useMemo)(() => {
141
144
  return presentationDirection === 'entering'
142
145
  ? outerEnterStyle
143
146
  : outerExitStyle;
144
147
  }, [outerEnterStyle, outerExitStyle, presentationDirection]);
145
- const svgStyle = useMemo(() => {
148
+ const svgStyle = (0, react_1.useMemo)(() => {
146
149
  return {
147
150
  width: '100%',
148
151
  height: '100%',
149
152
  pointerEvents: 'none',
150
153
  };
151
154
  }, []);
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" }) }) }) }) })] }));
155
+ return ((0, jsx_runtime_1.jsxs)(remotion_1.AbsoluteFill, { style: outerStyle, children: [(0, jsx_runtime_1.jsx)(remotion_1.AbsoluteFill, { style: style, children: children }), (0, jsx_runtime_1.jsx)(remotion_1.AbsoluteFill, { children: (0, jsx_runtime_1.jsx)("svg", { viewBox: "0 0 1 1", style: svgStyle, children: (0, jsx_runtime_1.jsx)("defs", { children: (0, jsx_runtime_1.jsx)("clipPath", { id: clipId, clipPathUnits: "objectBoundingBox", children: (0, jsx_runtime_1.jsx)("path", { d: path, fill: "black" }) }) }) }) })] }));
153
156
  };
154
- export const wipe = (props) => {
157
+ const wipe = (props) => {
155
158
  return {
156
159
  component: WipePresentation,
157
160
  props: props !== null && props !== void 0 ? props : {},
158
161
  };
159
162
  };
163
+ exports.wipe = wipe;
@@ -1,11 +1,14 @@
1
- import { interpolate } from 'remotion';
2
- export const linearTiming = (options) => {
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.linearTiming = void 0;
4
+ const remotion_1 = require("remotion");
5
+ const linearTiming = (options) => {
3
6
  return {
4
7
  getDurationInFrames: () => {
5
8
  return options.durationInFrames;
6
9
  },
7
10
  getProgress: ({ frame }) => {
8
- return interpolate(frame, [0, options.durationInFrames], [0, 1], {
11
+ return (0, remotion_1.interpolate)(frame, [0, options.durationInFrames], [0, 1], {
9
12
  easing: options.easing,
10
13
  extrapolateLeft: 'clamp',
11
14
  extrapolateRight: 'clamp',
@@ -13,3 +16,4 @@ export const linearTiming = (options) => {
13
16
  },
14
17
  };
15
18
  };
19
+ exports.linearTiming = linearTiming;
@@ -1,17 +1,20 @@
1
- import { measureSpring, spring } from 'remotion';
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.springTiming = void 0;
4
+ const remotion_1 = require("remotion");
2
5
  const springWithInvalidArgumentRejection = (args) => {
3
6
  if (args.to || args.from) {
4
7
  throw new Error('to / from values are not supported by springWithRoundUpIfThreshold');
5
8
  }
6
- return spring(args);
9
+ return (0, remotion_1.spring)(args);
7
10
  };
8
- export const springTiming = (options = {}) => {
11
+ const springTiming = (options = {}) => {
9
12
  return {
10
13
  getDurationInFrames: ({ fps }) => {
11
14
  if (options.durationInFrames) {
12
15
  return options.durationInFrames;
13
16
  }
14
- return measureSpring({
17
+ return (0, remotion_1.measureSpring)({
15
18
  config: options.config,
16
19
  threshold: options.durationRestThreshold,
17
20
  fps,
@@ -28,3 +31,4 @@ export const springTiming = (options = {}) => {
28
31
  },
29
32
  };
30
33
  };
34
+ exports.springTiming = springTiming;
package/dist/types.js CHANGED
@@ -1 +1,2 @@
1
- export {};
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
package/dist/validate.js CHANGED
@@ -1,3 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.validateDurationInFrames = void 0;
1
4
  /* eslint-disable prefer-destructuring */
2
- import { NoReactInternals } from 'remotion/no-react';
3
- export const validateDurationInFrames = NoReactInternals.validateDurationInFrames;
5
+ const no_react_1 = require("remotion/no-react");
6
+ exports.validateDurationInFrames = no_react_1.NoReactInternals.validateDurationInFrames;
package/fade.js ADDED
@@ -0,0 +1,2 @@
1
+ // For backwards compatibility when you use `esm-wallaby`
2
+ module.exports = require('./dist/presentations/fade.js');
package/flip.js ADDED
@@ -0,0 +1,2 @@
1
+ // For backwards compatibility when you use `esm-wallaby`
2
+ module.exports = require('./dist/presentations/flip.js');
package/package.json CHANGED
@@ -1,14 +1,14 @@
1
1
  {
2
2
  "name": "@remotion/transitions",
3
- "version": "4.0.84",
3
+ "version": "4.0.86",
4
4
  "description": "Transition presets for Remotion",
5
5
  "sideEffects": false,
6
- "main": "dist/cjs/index.js",
7
- "module": "dist/index.js",
6
+ "main": "dist/esm/index.mjs",
7
+ "module": "dist/esm/index.js",
8
8
  "types": "dist/index.d.ts",
9
9
  "author": "Jonny Burger",
10
10
  "contributors": [],
11
- "license": "MIT",
11
+ "license": "UNLICENSED",
12
12
  "repository": {
13
13
  "url": "https://github.com/remotion-dev/remotion"
14
14
  },
@@ -16,9 +16,9 @@
16
16
  "url": "https://github.com/remotion-dev/remotion/issues"
17
17
  },
18
18
  "dependencies": {
19
- "@remotion/paths": "4.0.84",
20
- "@remotion/shapes": "4.0.84",
21
- "remotion": "4.0.84"
19
+ "@remotion/paths": "4.0.86",
20
+ "remotion": "4.0.86",
21
+ "@remotion/shapes": "4.0.86"
22
22
  },
23
23
  "devDependencies": {
24
24
  "@jonny/eslint-config": "3.0.276",
@@ -33,8 +33,8 @@
33
33
  "@vitejs/plugin-react": "^2.0.0",
34
34
  "rollup": "^2.70.1",
35
35
  "@rollup/plugin-typescript": "^8.2.0",
36
- "remotion": "4.0.84",
37
- "@remotion/test-utils": "4.0.84"
36
+ "@remotion/test-utils": "4.0.86",
37
+ "remotion": "4.0.86"
38
38
  },
39
39
  "peerDependencies": {
40
40
  "react": ">=16.8.0",
@@ -49,39 +49,39 @@
49
49
  },
50
50
  "exports": {
51
51
  ".": {
52
- "module": "./dist/index.js",
53
- "import": "./dist/index.js",
52
+ "module": "./dist/esm/index.mjs",
53
+ "import": "./dist/esm/index.mjs",
54
54
  "types": "./dist/index.d.ts",
55
- "require": "./dist/cjs/index.js"
55
+ "require": "./dist/index.js"
56
56
  },
57
57
  "./fade": {
58
- "module": "./dist/presentations/fade.js",
59
- "import": "./dist/presentations/fade.js",
60
- "require": "./dist/cjs/presentations/fade.js",
58
+ "module": "./dist/esm/fade.mjs",
59
+ "import": "./dist/esm/fade.mjs",
60
+ "require": "./dist/presentations/fade.js",
61
61
  "types": "./dist/presentations/fade.d.ts"
62
62
  },
63
63
  "./slide": {
64
- "module": "./dist/presentations/slide.js",
65
- "import": "./dist/presentations/slide.js",
66
- "require": "./dist/cjs/presentations/slide.js",
64
+ "module": "./dist/esm/slide.mjs",
65
+ "import": "./dist/esm/slide.mjs",
66
+ "require": "./dist/presentations/slide.js",
67
67
  "types": "./dist/presentations/slide.d.ts"
68
68
  },
69
69
  "./wipe": {
70
- "module": "./dist/presentations/wipe.js",
71
- "import": "./dist/presentations/wipe.js",
72
- "require": "./dist/cjs/presentations/wipe.js",
70
+ "module": "./dist/esm/wipe.mjs",
71
+ "import": "./dist/esm/wipe.mjs",
72
+ "require": "./dist/presentations/wipe.js",
73
73
  "types": "./dist/presentations/wipe.d.ts"
74
74
  },
75
75
  "./flip": {
76
- "module": "./dist/presentations/flip.js",
77
- "import": "./dist/presentations/flip.js",
78
- "require": "./dist/cjs/presentations/flip.js",
76
+ "module": "./dist/esm/flip.mjs",
77
+ "import": "./dist/esm/flip.mjs",
78
+ "require": "./dist/presentations/flip.js",
79
79
  "types": "./dist/presentations/flip.d.ts"
80
80
  },
81
81
  "./clock-wipe": {
82
- "module": "./dist/presentations/clock-wipe.js",
83
- "import": "./dist/presentations/clock-wipe.js",
84
- "require": "./dist/cjs/presentations/clock-wipe.js",
82
+ "module": "./dist/esm/clock-wipe.mjs",
83
+ "import": "./dist/esm/clock-wipe.mjs",
84
+ "require": "./dist/presentations/clock-wipe.js",
85
85
  "types": "./dist/presentations/clock-wipe.d.ts"
86
86
  },
87
87
  "./package.json": "./package.json"
@@ -109,6 +109,6 @@
109
109
  "lint": "eslint src --ext ts,tsx",
110
110
  "formatting": "prettier src --check",
111
111
  "watch": "tsc -w",
112
- "build": "rollup --config rollup.config.js && tsc -d"
112
+ "build": "tsc -d && rollup --config rollup.config.js"
113
113
  }
114
114
  }
package/rollup.config.js CHANGED
@@ -8,15 +8,15 @@ export default [
8
8
  input: 'src/index.ts',
9
9
  output: [
10
10
  {
11
- file: 'dist/cjs/index.js',
12
- format: 'cjs',
11
+ file: 'dist/esm/index.mjs',
12
+ format: 'es',
13
13
  sourcemap: false,
14
14
  },
15
15
  ],
16
16
  external: ['remotion', 'remotion/no-react', 'react', 'react/jsx-runtime'],
17
17
  plugins: [
18
18
  typescript({
19
- tsconfig: 'tsconfig-cjs.json',
19
+ tsconfig: 'tsconfig.json',
20
20
  sourceMap: false,
21
21
  outputToFilesystem: true,
22
22
  }),
@@ -27,8 +27,8 @@ export default [
27
27
  input: `src/presentations/${p}.tsx`,
28
28
  output: [
29
29
  {
30
- file: `dist/cjs/${p}.js`,
31
- format: 'cjs',
30
+ file: `dist/esm/${p}.mjs`,
31
+ format: 'es',
32
32
  sourcemap: false,
33
33
  },
34
34
  ],
@@ -42,7 +42,7 @@ export default [
42
42
  ],
43
43
  plugins: [
44
44
  typescript({
45
- tsconfig: 'tsconfig-cjs.json',
45
+ tsconfig: 'tsconfig.json',
46
46
  sourceMap: false,
47
47
  outputToFilesystem: true,
48
48
  }),
package/slide.js ADDED
@@ -0,0 +1,2 @@
1
+ // For backwards compatibility when you use `esm-wallaby`
2
+ module.exports = require('./dist/presentations/slide.js');
package/wipe.js ADDED
@@ -0,0 +1,2 @@
1
+ // For backwards compatibility when you use `esm-wallaby`
2
+ module.exports = require('./dist/presentations/wipe.js');
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes