@remotion/transitions 4.0.142 → 4.0.144
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.md +4 -0
- package/bunfig.toml +2 -0
- package/dist/TransitionSeries.d.ts +14 -6
- package/dist/TransitionSeries.js +17 -5
- package/dist/esm/index.mjs +20 -11
- package/dist/esm/slide.mjs +3 -2
- package/dist/presentations/clock-wipe.d.ts +6 -0
- package/dist/presentations/clock-wipe.js +6 -0
- package/dist/presentations/fade.d.ts +6 -0
- package/dist/presentations/fade.js +6 -0
- package/dist/presentations/flip.d.ts +6 -0
- package/dist/presentations/flip.js +6 -0
- package/dist/presentations/slide.d.ts +6 -0
- package/dist/presentations/slide.js +9 -2
- package/dist/presentations/wipe.d.ts +6 -0
- package/dist/presentations/wipe.js +6 -0
- package/dist/timings/linear-timing.d.ts +9 -0
- package/dist/timings/linear-timing.js +9 -0
- package/dist/timings/spring-timing.d.ts +1 -0
- package/dist/timings/spring-timing.js +6 -7
- package/happydom.ts +6 -0
- package/package.json +8 -8
- package/vitest.config.mts +11 -0
- /package/{build.ts → bundle.ts} +0 -0
package/LICENSE.md
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
# Remotion License
|
|
2
2
|
|
|
3
|
+
In Remotion 5.0, the license will slightly change. [View the changes here](https://github.com/remotion-dev/remotion/pull/3750).
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
3
7
|
Depending on the type of your legal entity, you are granted permission to use Remotion for your project. Individuals and small companies are allowed to use Remotion to create videos for free (even commercial), while a company license is required for for-profit organizations of a certain size. This two-tier system was designed to ensure funding for this project while still allowing the source code to be available and the program to be free for most. Read below for the exact terms of use.
|
|
4
8
|
|
|
5
9
|
- [Free license](#free-license)
|
package/bunfig.toml
ADDED
|
@@ -1,17 +1,25 @@
|
|
|
1
1
|
import type { FC, PropsWithChildren } from 'react';
|
|
2
|
-
import type { LayoutAndStyle, SequencePropsWithoutDuration } from 'remotion';
|
|
2
|
+
import type { AbsoluteFillLayout, LayoutAndStyle, SequencePropsWithoutDuration } from 'remotion';
|
|
3
|
+
import { NoReactInternals } from 'remotion/no-react';
|
|
3
4
|
import type { TransitionSeriesTransitionProps } from './types.js';
|
|
4
5
|
declare const TransitionSeriesTransition: <PresentationProps extends Record<string, unknown>>(_props: TransitionSeriesTransitionProps<PresentationProps>) => null;
|
|
6
|
+
type LayoutBasedProps = true extends typeof NoReactInternals.ENABLE_V5_BREAKING_CHANGES ? AbsoluteFillLayout : LayoutAndStyle;
|
|
5
7
|
type SeriesSequenceProps = PropsWithChildren<{
|
|
6
|
-
durationInFrames: number;
|
|
7
|
-
offset?: number;
|
|
8
|
-
className?: string;
|
|
8
|
+
readonly durationInFrames: number;
|
|
9
|
+
readonly offset?: number;
|
|
10
|
+
readonly className?: string;
|
|
9
11
|
/**
|
|
10
12
|
* @deprecated For internal use only
|
|
11
13
|
*/
|
|
12
|
-
stack?: string;
|
|
13
|
-
} &
|
|
14
|
+
readonly stack?: string;
|
|
15
|
+
} & LayoutBasedProps & Pick<SequencePropsWithoutDuration, 'name'>>;
|
|
14
16
|
declare const SeriesSequence: ({ children }: SeriesSequenceProps) => import("react/jsx-runtime.js").JSX.Element;
|
|
17
|
+
/**
|
|
18
|
+
* @description A React component designed to manage a series of transitions and sequences where each transition may have specific timing and presentation components. It extends the capabilities of `<Sequence>` and is specifically structured to handle transitions that involve entering and exiting sequences.
|
|
19
|
+
* @see [Documentation](https://remotion.dev/docs/transitions/transitionseries)
|
|
20
|
+
* @param {SequencePropsWithoutDuration} props The properties for setting the initial rendering behavior like from, name, etc. It additionally accepts children that are specifically `<TransitionSeries.Sequence>` or `<TransitionSeries.Transition>`.
|
|
21
|
+
* @returns React component that renders the transitions and sequences.
|
|
22
|
+
*/
|
|
15
23
|
declare const TransitionSeries: FC<SequencePropsWithoutDuration> & {
|
|
16
24
|
Sequence: typeof SeriesSequence;
|
|
17
25
|
Transition: typeof TransitionSeriesTransition;
|
package/dist/TransitionSeries.js
CHANGED
|
@@ -4,6 +4,7 @@ exports.TransitionSeries = void 0;
|
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const react_1 = require("react");
|
|
6
6
|
const remotion_1 = require("remotion");
|
|
7
|
+
const no_react_1 = require("remotion/no-react");
|
|
7
8
|
const flatten_children_js_1 = require("./flatten-children.js");
|
|
8
9
|
const slide_js_1 = require("./presentations/slide.js");
|
|
9
10
|
const validate_js_1 = require("./validate.js");
|
|
@@ -122,17 +123,17 @@ const TransitionSeriesChildren = ({ children, }) => {
|
|
|
122
123
|
const prevPresentation = (_c = prev.props.presentation) !== null && _c !== void 0 ? _c : (0, slide_js_1.slide)();
|
|
123
124
|
const UppercaseNextPresentation = nextPresentation.component;
|
|
124
125
|
const UppercasePrevPresentation = prevPresentation.component;
|
|
125
|
-
return ((0, jsx_runtime_1.jsx)(remotion_1.Sequence, { from: Math.floor(actualStartFrame), ...passedProps, name: passedProps.name || '<TS.Sequence>', 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: child }) }) }));
|
|
126
|
+
return ((0, jsx_runtime_1.jsx)(remotion_1.Sequence, { from: Math.floor(actualStartFrame), durationInFrames: durationInFramesProp, ...passedProps, name: passedProps.name || '<TS.Sequence>', 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: child }) }) }));
|
|
126
127
|
}
|
|
127
128
|
if (prevProgress !== null && prev) {
|
|
128
129
|
const prevPresentation = (_f = prev.props.presentation) !== null && _f !== void 0 ? _f : (0, slide_js_1.slide)();
|
|
129
130
|
const UppercasePrevPresentation = prevPresentation.component;
|
|
130
|
-
return ((0, jsx_runtime_1.jsx)(remotion_1.Sequence, { from: Math.floor(actualStartFrame), ...passedProps, name: passedProps.name || '<TS.Sequence>', children: (0, jsx_runtime_1.jsx)(UppercasePrevPresentation, { passedProps: (_g = prevPresentation.props) !== null && _g !== void 0 ? _g : {}, presentationDirection: "entering", presentationProgress: prevProgress, children: child }) }));
|
|
131
|
+
return ((0, jsx_runtime_1.jsx)(remotion_1.Sequence, { from: Math.floor(actualStartFrame), durationInFrames: durationInFramesProp, ...passedProps, name: passedProps.name || '<TS.Sequence>', children: (0, jsx_runtime_1.jsx)(UppercasePrevPresentation, { passedProps: (_g = prevPresentation.props) !== null && _g !== void 0 ? _g : {}, presentationDirection: "entering", presentationProgress: prevProgress, children: child }) }));
|
|
131
132
|
}
|
|
132
133
|
if (nextProgress !== null && next) {
|
|
133
134
|
const nextPresentation = (_h = next.props.presentation) !== null && _h !== void 0 ? _h : (0, slide_js_1.slide)();
|
|
134
135
|
const UppercaseNextPresentation = nextPresentation.component;
|
|
135
|
-
return ((0, jsx_runtime_1.jsx)(remotion_1.Sequence, { from: Math.floor(actualStartFrame), ...passedProps, name: passedProps.name || '<TS.Sequence>', children: (0, jsx_runtime_1.jsx)(UppercaseNextPresentation, { passedProps: (_j = nextPresentation.props) !== null && _j !== void 0 ? _j : {}, presentationDirection: "exiting", presentationProgress: nextProgress, children: child }) }));
|
|
136
|
+
return ((0, jsx_runtime_1.jsx)(remotion_1.Sequence, { from: Math.floor(actualStartFrame), durationInFrames: durationInFramesProp, ...passedProps, name: passedProps.name || '<TS.Sequence>', children: (0, jsx_runtime_1.jsx)(UppercaseNextPresentation, { passedProps: (_j = nextPresentation.props) !== null && _j !== void 0 ? _j : {}, presentationDirection: "exiting", presentationProgress: nextProgress, children: child }) }));
|
|
136
137
|
}
|
|
137
138
|
return ((0, jsx_runtime_1.jsx)(remotion_1.Sequence, { from: Math.floor(actualStartFrame), durationInFrames: durationInFramesProp, ...passedProps, name: passedProps.name || '<TS.Sequence>', children: child }));
|
|
138
139
|
});
|
|
@@ -140,9 +141,20 @@ const TransitionSeriesChildren = ({ children, }) => {
|
|
|
140
141
|
// eslint-disable-next-line react/jsx-no-useless-fragment
|
|
141
142
|
return (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: childrenValue });
|
|
142
143
|
};
|
|
143
|
-
|
|
144
|
+
/**
|
|
145
|
+
* @description A React component designed to manage a series of transitions and sequences where each transition may have specific timing and presentation components. It extends the capabilities of `<Sequence>` and is specifically structured to handle transitions that involve entering and exiting sequences.
|
|
146
|
+
* @see [Documentation](https://remotion.dev/docs/transitions/transitionseries)
|
|
147
|
+
* @param {SequencePropsWithoutDuration} props The properties for setting the initial rendering behavior like from, name, etc. It additionally accepts children that are specifically `<TransitionSeries.Sequence>` or `<TransitionSeries.Transition>`.
|
|
148
|
+
* @returns React component that renders the transitions and sequences.
|
|
149
|
+
*/
|
|
150
|
+
const TransitionSeries = ({ children, name, layout: passedLayout, ...otherProps }) => {
|
|
144
151
|
const displayName = name !== null && name !== void 0 ? name : '<TransitionSeries>';
|
|
145
|
-
|
|
152
|
+
const layout = passedLayout !== null && passedLayout !== void 0 ? passedLayout : 'absolute-fill';
|
|
153
|
+
if (no_react_1.NoReactInternals.ENABLE_V5_BREAKING_CHANGES &&
|
|
154
|
+
layout !== 'absolute-fill') {
|
|
155
|
+
throw new TypeError(`The "layout" prop of <TransitionSeries /> is not supported anymore in v5. TransitionSeries' must be absolutely positioned.`);
|
|
156
|
+
}
|
|
157
|
+
return ((0, jsx_runtime_1.jsx)(remotion_1.Sequence, { name: displayName, layout: layout, ...otherProps, children: (0, jsx_runtime_1.jsx)(TransitionSeriesChildren, { children: children }) }));
|
|
146
158
|
};
|
|
147
159
|
exports.TransitionSeries = TransitionSeries;
|
|
148
160
|
TransitionSeries.Sequence = SeriesSequence;
|
package/dist/esm/index.mjs
CHANGED
|
@@ -13,6 +13,7 @@ var SlidePresentation = ({
|
|
|
13
13
|
}) => {
|
|
14
14
|
const directionStyle = useMemo(() => {
|
|
15
15
|
const presentationProgressWithEpsilonCorrection = presentationProgress === 1 ? presentationProgress * 100 : presentationProgress * 100 - epsilon;
|
|
16
|
+
console.log(presentationProgressWithEpsilonCorrection);
|
|
16
17
|
if (presentationDirection === "exiting") {
|
|
17
18
|
switch (direction) {
|
|
18
19
|
case "from-left":
|
|
@@ -21,7 +22,7 @@ var SlidePresentation = ({
|
|
|
21
22
|
};
|
|
22
23
|
case "from-right":
|
|
23
24
|
return {
|
|
24
|
-
transform: `translateX(
|
|
25
|
+
transform: `translateX(${-presentationProgress * 100}%)`
|
|
25
26
|
};
|
|
26
27
|
case "from-top":
|
|
27
28
|
return {
|
|
@@ -29,7 +30,7 @@ var SlidePresentation = ({
|
|
|
29
30
|
};
|
|
30
31
|
case "from-bottom":
|
|
31
32
|
return {
|
|
32
|
-
transform: `translateY(
|
|
33
|
+
transform: `translateY(${-presentationProgress * 100}%)`
|
|
33
34
|
};
|
|
34
35
|
default:
|
|
35
36
|
throw new Error(`Invalid direction: ${direction}`);
|
|
@@ -97,12 +98,6 @@ var linearTiming = (options) => {
|
|
|
97
98
|
|
|
98
99
|
// src/timings/spring-timing.ts
|
|
99
100
|
import {measureSpring, spring} from "remotion";
|
|
100
|
-
var springWithInvalidArgumentRejection = (args) => {
|
|
101
|
-
if (args.to || args.from) {
|
|
102
|
-
throw new Error("to / from values are not supported by springWithRoundUpIfThreshold");
|
|
103
|
-
}
|
|
104
|
-
return spring(args);
|
|
105
|
-
};
|
|
106
101
|
var springTiming = (options = {}) => {
|
|
107
102
|
return {
|
|
108
103
|
getDurationInFrames: ({ fps }) => {
|
|
@@ -116,12 +111,17 @@ var springTiming = (options = {}) => {
|
|
|
116
111
|
});
|
|
117
112
|
},
|
|
118
113
|
getProgress: ({ fps, frame }) => {
|
|
119
|
-
|
|
114
|
+
const to = options.reverse ? 0 : 1;
|
|
115
|
+
const from = options.reverse ? 1 : 0;
|
|
116
|
+
return spring({
|
|
120
117
|
fps,
|
|
121
118
|
frame,
|
|
119
|
+
to,
|
|
120
|
+
from,
|
|
122
121
|
config: options.config,
|
|
123
122
|
durationInFrames: options.durationInFrames,
|
|
124
|
-
durationRestThreshold: options.durationRestThreshold
|
|
123
|
+
durationRestThreshold: options.durationRestThreshold,
|
|
124
|
+
reverse: options.reverse
|
|
125
125
|
});
|
|
126
126
|
}
|
|
127
127
|
};
|
|
@@ -130,6 +130,7 @@ var springTiming = (options = {}) => {
|
|
|
130
130
|
// src/TransitionSeries.tsx
|
|
131
131
|
import {Children, useMemo as useMemo2} from "react";
|
|
132
132
|
import {Internals, Sequence, useCurrentFrame, useVideoConfig} from "remotion";
|
|
133
|
+
import {NoReactInternals as NoReactInternals2} from "remotion/no-react";
|
|
133
134
|
|
|
134
135
|
// src/flatten-children.ts
|
|
135
136
|
import React2 from "react";
|
|
@@ -252,6 +253,7 @@ var TransitionSeriesChildren = ({
|
|
|
252
253
|
const UppercasePrevPresentation = prevPresentation.component;
|
|
253
254
|
return jsx2(Sequence, {
|
|
254
255
|
from: Math.floor(actualStartFrame),
|
|
256
|
+
durationInFrames: durationInFramesProp,
|
|
255
257
|
...passedProps,
|
|
256
258
|
name: passedProps.name || "<TS.Sequence>",
|
|
257
259
|
children: jsx2(UppercaseNextPresentation, {
|
|
@@ -272,6 +274,7 @@ var TransitionSeriesChildren = ({
|
|
|
272
274
|
const UppercasePrevPresentation = prevPresentation.component;
|
|
273
275
|
return jsx2(Sequence, {
|
|
274
276
|
from: Math.floor(actualStartFrame),
|
|
277
|
+
durationInFrames: durationInFramesProp,
|
|
275
278
|
...passedProps,
|
|
276
279
|
name: passedProps.name || "<TS.Sequence>",
|
|
277
280
|
children: jsx2(UppercasePrevPresentation, {
|
|
@@ -287,6 +290,7 @@ var TransitionSeriesChildren = ({
|
|
|
287
290
|
const UppercaseNextPresentation = nextPresentation.component;
|
|
288
291
|
return jsx2(Sequence, {
|
|
289
292
|
from: Math.floor(actualStartFrame),
|
|
293
|
+
durationInFrames: durationInFramesProp,
|
|
290
294
|
...passedProps,
|
|
291
295
|
name: passedProps.name || "<TS.Sequence>",
|
|
292
296
|
children: jsx2(UppercaseNextPresentation, {
|
|
@@ -310,10 +314,15 @@ var TransitionSeriesChildren = ({
|
|
|
310
314
|
children: childrenValue
|
|
311
315
|
}, undefined, false, undefined, this);
|
|
312
316
|
};
|
|
313
|
-
var TransitionSeries = ({ children, name, ...otherProps }) => {
|
|
317
|
+
var TransitionSeries = ({ children, name, layout: passedLayout, ...otherProps }) => {
|
|
314
318
|
const displayName = name ?? "<TransitionSeries>";
|
|
319
|
+
const layout = passedLayout ?? "absolute-fill";
|
|
320
|
+
if (NoReactInternals2.ENABLE_V5_BREAKING_CHANGES && layout !== "absolute-fill") {
|
|
321
|
+
throw new TypeError(`The "layout" prop of <TransitionSeries /> is not supported anymore in v5. TransitionSeries' must be absolutely positioned.`);
|
|
322
|
+
}
|
|
315
323
|
return jsx2(Sequence, {
|
|
316
324
|
name: displayName,
|
|
325
|
+
layout,
|
|
317
326
|
...otherProps,
|
|
318
327
|
children: jsx2(TransitionSeriesChildren, {
|
|
319
328
|
children
|
package/dist/esm/slide.mjs
CHANGED
|
@@ -13,6 +13,7 @@ var SlidePresentation = ({
|
|
|
13
13
|
}) => {
|
|
14
14
|
const directionStyle = useMemo(() => {
|
|
15
15
|
const presentationProgressWithEpsilonCorrection = presentationProgress === 1 ? presentationProgress * 100 : presentationProgress * 100 - epsilon;
|
|
16
|
+
console.log(presentationProgressWithEpsilonCorrection);
|
|
16
17
|
if (presentationDirection === "exiting") {
|
|
17
18
|
switch (direction) {
|
|
18
19
|
case "from-left":
|
|
@@ -21,7 +22,7 @@ var SlidePresentation = ({
|
|
|
21
22
|
};
|
|
22
23
|
case "from-right":
|
|
23
24
|
return {
|
|
24
|
-
transform: `translateX(
|
|
25
|
+
transform: `translateX(${-presentationProgress * 100}%)`
|
|
25
26
|
};
|
|
26
27
|
case "from-top":
|
|
27
28
|
return {
|
|
@@ -29,7 +30,7 @@ var SlidePresentation = ({
|
|
|
29
30
|
};
|
|
30
31
|
case "from-bottom":
|
|
31
32
|
return {
|
|
32
|
-
transform: `translateY(
|
|
33
|
+
transform: `translateY(${-presentationProgress * 100}%)`
|
|
33
34
|
};
|
|
34
35
|
default:
|
|
35
36
|
throw new Error(`Invalid direction: ${direction}`);
|
|
@@ -8,4 +8,10 @@ export type ClockWipeProps = {
|
|
|
8
8
|
innerEnterStyle?: React.CSSProperties;
|
|
9
9
|
innerExitStyle?: React.CSSProperties;
|
|
10
10
|
};
|
|
11
|
+
/**
|
|
12
|
+
* Creates a clock wipe transition. This transition effect uses a circular wipe to reveal the underlying scene as the current scene exits.
|
|
13
|
+
* @see [Documentation](https://remotion.dev/docs/transitions/presentations/clock-wipe)
|
|
14
|
+
* @param {ClockWipeProps} props - The properties for the clock wipe effect, including dimensions and optional styles for entering and exiting states.
|
|
15
|
+
* @returns {TransitionPresentation<ClockWipeProps>} An object containing the ClockWipe component and its props to be used in transition presentations.
|
|
16
|
+
*/
|
|
11
17
|
export declare const clockWipe: (props: ClockWipeProps) => TransitionPresentation<ClockWipeProps>;
|
|
@@ -40,6 +40,12 @@ const ClockWipePresentation = ({ children, presentationDirection, presentationPr
|
|
|
40
40
|
]);
|
|
41
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" }) }) }) }) }))] }));
|
|
42
42
|
};
|
|
43
|
+
/**
|
|
44
|
+
* Creates a clock wipe transition. This transition effect uses a circular wipe to reveal the underlying scene as the current scene exits.
|
|
45
|
+
* @see [Documentation](https://remotion.dev/docs/transitions/presentations/clock-wipe)
|
|
46
|
+
* @param {ClockWipeProps} props - The properties for the clock wipe effect, including dimensions and optional styles for entering and exiting states.
|
|
47
|
+
* @returns {TransitionPresentation<ClockWipeProps>} An object containing the ClockWipe component and its props to be used in transition presentations.
|
|
48
|
+
*/
|
|
43
49
|
const clockWipe = (props) => {
|
|
44
50
|
return { component: ClockWipePresentation, props: props !== null && props !== void 0 ? props : {} };
|
|
45
51
|
};
|
|
@@ -4,4 +4,10 @@ export type FadeProps = {
|
|
|
4
4
|
enterStyle?: React.CSSProperties;
|
|
5
5
|
exitStyle?: React.CSSProperties;
|
|
6
6
|
};
|
|
7
|
+
/**
|
|
8
|
+
* Provides a simple fade transition component for sliding elements in and out.
|
|
9
|
+
* @see [Documentation](https://remotion.dev/docs/transitions/presentations/fade)
|
|
10
|
+
* @param {FadeProps} [props] Optional properties to define 'enterStyle' and 'exitStyle'.
|
|
11
|
+
* @returns {TransitionPresentation<FadeProps>} The transition presentation component setup.
|
|
12
|
+
*/
|
|
7
13
|
export declare const fade: (props?: FadeProps) => TransitionPresentation<FadeProps>;
|
|
@@ -22,6 +22,12 @@ const FadePresentation = ({ children, presentationDirection, presentationProgres
|
|
|
22
22
|
]);
|
|
23
23
|
return (0, jsx_runtime_1.jsx)(remotion_1.AbsoluteFill, { style: style, children: children });
|
|
24
24
|
};
|
|
25
|
+
/**
|
|
26
|
+
* Provides a simple fade transition component for sliding elements in and out.
|
|
27
|
+
* @see [Documentation](https://remotion.dev/docs/transitions/presentations/fade)
|
|
28
|
+
* @param {FadeProps} [props] Optional properties to define 'enterStyle' and 'exitStyle'.
|
|
29
|
+
* @returns {TransitionPresentation<FadeProps>} The transition presentation component setup.
|
|
30
|
+
*/
|
|
25
31
|
const fade = (props) => {
|
|
26
32
|
return {
|
|
27
33
|
component: FadePresentation,
|
|
@@ -9,4 +9,10 @@ export type FlipProps = {
|
|
|
9
9
|
innerEnterStyle?: React.CSSProperties;
|
|
10
10
|
innerExitStyle?: React.CSSProperties;
|
|
11
11
|
};
|
|
12
|
+
/**
|
|
13
|
+
* @description A presentation where the exiting slide flips by 180 degrees, revealing the next slide on the back side. This function configures a 3D flip effect for transitions between components in presentations.
|
|
14
|
+
* @see [Documentation](https://remotion.dev/docs/transitions/presentations/flip)
|
|
15
|
+
* @param {FlipProps} [props] Optional properties to configure the flip effect, including direction, perspective, and styles.
|
|
16
|
+
* @returns {TransitionPresentation<FlipProps>} An object with the Flip component and configuration properties.
|
|
17
|
+
*/
|
|
12
18
|
export declare const flip: (props?: FlipProps) => TransitionPresentation<FlipProps>;
|
|
@@ -43,6 +43,12 @@ const Flip = ({ children, presentationDirection, presentationProgress, passedPro
|
|
|
43
43
|
}, [outerEnterStyle, outerExitStyle, perspective, presentationDirection]);
|
|
44
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 }) }));
|
|
45
45
|
};
|
|
46
|
+
/**
|
|
47
|
+
* @description A presentation where the exiting slide flips by 180 degrees, revealing the next slide on the back side. This function configures a 3D flip effect for transitions between components in presentations.
|
|
48
|
+
* @see [Documentation](https://remotion.dev/docs/transitions/presentations/flip)
|
|
49
|
+
* @param {FlipProps} [props] Optional properties to configure the flip effect, including direction, perspective, and styles.
|
|
50
|
+
* @returns {TransitionPresentation<FlipProps>} An object with the Flip component and configuration properties.
|
|
51
|
+
*/
|
|
46
52
|
const flip = (props) => {
|
|
47
53
|
return { component: Flip, props: props !== null && props !== void 0 ? props : {} };
|
|
48
54
|
};
|
|
@@ -6,4 +6,10 @@ export type SlideProps = {
|
|
|
6
6
|
exitStyle?: React.CSSProperties;
|
|
7
7
|
enterStyle?: React.CSSProperties;
|
|
8
8
|
};
|
|
9
|
+
/**
|
|
10
|
+
* Implements a sliding transition for presentation components where the entering slide pushes out the exiting slide based on the specified direction.
|
|
11
|
+
* @see [Documentation](https://remotion.dev/docs/transitions/presentations/slide)
|
|
12
|
+
* @param {SlideProps} [props] Configuration options for the slide transition: includes direction, enterStyle, and exitStyle.
|
|
13
|
+
* @returns {TransitionPresentation<SlideProps>} Returns a transition configuration object including the component and its props.
|
|
14
|
+
*/
|
|
9
15
|
export declare const slide: (props?: SlideProps) => TransitionPresentation<SlideProps>;
|
|
@@ -12,6 +12,7 @@ const SlidePresentation = ({ children, presentationProgress, presentationDirecti
|
|
|
12
12
|
const presentationProgressWithEpsilonCorrection = presentationProgress === 1
|
|
13
13
|
? presentationProgress * 100
|
|
14
14
|
: presentationProgress * 100 - epsilon;
|
|
15
|
+
console.log(presentationProgressWithEpsilonCorrection);
|
|
15
16
|
if (presentationDirection === 'exiting') {
|
|
16
17
|
switch (direction) {
|
|
17
18
|
case 'from-left':
|
|
@@ -20,7 +21,7 @@ const SlidePresentation = ({ children, presentationProgress, presentationDirecti
|
|
|
20
21
|
};
|
|
21
22
|
case 'from-right':
|
|
22
23
|
return {
|
|
23
|
-
transform: `translateX(
|
|
24
|
+
transform: `translateX(${-presentationProgress * 100}%)`,
|
|
24
25
|
};
|
|
25
26
|
case 'from-top':
|
|
26
27
|
return {
|
|
@@ -28,7 +29,7 @@ const SlidePresentation = ({ children, presentationProgress, presentationDirecti
|
|
|
28
29
|
};
|
|
29
30
|
case 'from-bottom':
|
|
30
31
|
return {
|
|
31
|
-
transform: `translateY(
|
|
32
|
+
transform: `translateY(${-presentationProgress * 100}%)`,
|
|
32
33
|
};
|
|
33
34
|
default:
|
|
34
35
|
throw new Error(`Invalid direction: ${direction}`);
|
|
@@ -67,6 +68,12 @@ const SlidePresentation = ({ children, presentationProgress, presentationDirecti
|
|
|
67
68
|
}, [directionStyle, enterStyle, exitStyle, presentationDirection]);
|
|
68
69
|
return (0, jsx_runtime_1.jsx)(remotion_1.AbsoluteFill, { style: style, children: children });
|
|
69
70
|
};
|
|
71
|
+
/**
|
|
72
|
+
* Implements a sliding transition for presentation components where the entering slide pushes out the exiting slide based on the specified direction.
|
|
73
|
+
* @see [Documentation](https://remotion.dev/docs/transitions/presentations/slide)
|
|
74
|
+
* @param {SlideProps} [props] Configuration options for the slide transition: includes direction, enterStyle, and exitStyle.
|
|
75
|
+
* @returns {TransitionPresentation<SlideProps>} Returns a transition configuration object including the component and its props.
|
|
76
|
+
*/
|
|
70
77
|
const slide = (props) => {
|
|
71
78
|
return {
|
|
72
79
|
component: SlidePresentation,
|
|
@@ -8,4 +8,10 @@ export type WipeProps = {
|
|
|
8
8
|
innerEnterStyle?: React.CSSProperties;
|
|
9
9
|
innerExitStyle?: React.CSSProperties;
|
|
10
10
|
};
|
|
11
|
+
/**
|
|
12
|
+
* @description A presentation where the entering slide slides over the exiting slide.
|
|
13
|
+
* @see [Documentation](https://remotion.dev/docs/transitions/presentations/wipe)
|
|
14
|
+
* @param {WipeProps} [props] - Optional properties to configure the transition.
|
|
15
|
+
* @returns {TransitionPresentation<WipeProps>} Transition presentation object setup for wipe effect.
|
|
16
|
+
*/
|
|
11
17
|
export declare const wipe: (props?: WipeProps) => TransitionPresentation<WipeProps>;
|
|
@@ -154,6 +154,12 @@ const WipePresentation = ({ children, presentationProgress, presentationDirectio
|
|
|
154
154
|
}, []);
|
|
155
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" }) }) }) }) })] }));
|
|
156
156
|
};
|
|
157
|
+
/**
|
|
158
|
+
* @description A presentation where the entering slide slides over the exiting slide.
|
|
159
|
+
* @see [Documentation](https://remotion.dev/docs/transitions/presentations/wipe)
|
|
160
|
+
* @param {WipeProps} [props] - Optional properties to configure the transition.
|
|
161
|
+
* @returns {TransitionPresentation<WipeProps>} Transition presentation object setup for wipe effect.
|
|
162
|
+
*/
|
|
157
163
|
const wipe = (props) => {
|
|
158
164
|
return {
|
|
159
165
|
component: WipePresentation,
|
|
@@ -1,4 +1,13 @@
|
|
|
1
1
|
import type { TransitionTiming } from '../types.js';
|
|
2
|
+
/**
|
|
3
|
+
* Creates a linear timing object for managing animations in frame units.
|
|
4
|
+
* @description Provides a mechanism to handle frame-based transitions linearly, optionally incorporating easing functions.
|
|
5
|
+
* @see [Documentation](https://remotion.dev/docs/transitions/timings/lineartiming)
|
|
6
|
+
* @param {Object} options Configuration options for the linear timing
|
|
7
|
+
* @param {number} options.durationInFrames Specifies the total duration of the transition in frames
|
|
8
|
+
* @param {((input: number) => number)=} options.easing Optional easing function to modify the interpolation of values
|
|
9
|
+
* @returns {TransitionTiming} An object representing the timing of the transition, including methods to get duration and progress
|
|
10
|
+
*/
|
|
2
11
|
export declare const linearTiming: (options: {
|
|
3
12
|
durationInFrames: number;
|
|
4
13
|
easing?: ((input: number) => number) | undefined;
|
|
@@ -2,6 +2,15 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.linearTiming = void 0;
|
|
4
4
|
const remotion_1 = require("remotion");
|
|
5
|
+
/**
|
|
6
|
+
* Creates a linear timing object for managing animations in frame units.
|
|
7
|
+
* @description Provides a mechanism to handle frame-based transitions linearly, optionally incorporating easing functions.
|
|
8
|
+
* @see [Documentation](https://remotion.dev/docs/transitions/timings/lineartiming)
|
|
9
|
+
* @param {Object} options Configuration options for the linear timing
|
|
10
|
+
* @param {number} options.durationInFrames Specifies the total duration of the transition in frames
|
|
11
|
+
* @param {((input: number) => number)=} options.easing Optional easing function to modify the interpolation of values
|
|
12
|
+
* @returns {TransitionTiming} An object representing the timing of the transition, including methods to get duration and progress
|
|
13
|
+
*/
|
|
5
14
|
const linearTiming = (options) => {
|
|
6
15
|
return {
|
|
7
16
|
getDurationInFrames: () => {
|
|
@@ -2,12 +2,6 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.springTiming = void 0;
|
|
4
4
|
const remotion_1 = require("remotion");
|
|
5
|
-
const springWithInvalidArgumentRejection = (args) => {
|
|
6
|
-
if (args.to || args.from) {
|
|
7
|
-
throw new Error('to / from values are not supported by springWithRoundUpIfThreshold');
|
|
8
|
-
}
|
|
9
|
-
return (0, remotion_1.spring)(args);
|
|
10
|
-
};
|
|
11
5
|
const springTiming = (options = {}) => {
|
|
12
6
|
return {
|
|
13
7
|
getDurationInFrames: ({ fps }) => {
|
|
@@ -21,12 +15,17 @@ const springTiming = (options = {}) => {
|
|
|
21
15
|
});
|
|
22
16
|
},
|
|
23
17
|
getProgress: ({ fps, frame }) => {
|
|
24
|
-
|
|
18
|
+
const to = options.reverse ? 0 : 1;
|
|
19
|
+
const from = options.reverse ? 1 : 0;
|
|
20
|
+
return (0, remotion_1.spring)({
|
|
25
21
|
fps,
|
|
26
22
|
frame,
|
|
23
|
+
to,
|
|
24
|
+
from,
|
|
27
25
|
config: options.config,
|
|
28
26
|
durationInFrames: options.durationInFrames,
|
|
29
27
|
durationRestThreshold: options.durationRestThreshold,
|
|
28
|
+
reverse: options.reverse,
|
|
30
29
|
});
|
|
31
30
|
},
|
|
32
31
|
};
|
package/happydom.ts
ADDED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@remotion/transitions",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.144",
|
|
4
4
|
"description": "Transition presets for Remotion",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"main": "dist/esm/index.mjs",
|
|
@@ -16,9 +16,9 @@
|
|
|
16
16
|
"url": "https://github.com/remotion-dev/remotion/issues"
|
|
17
17
|
},
|
|
18
18
|
"dependencies": {
|
|
19
|
-
"
|
|
20
|
-
"remotion": "4.0.
|
|
21
|
-
"@remotion/
|
|
19
|
+
"remotion": "4.0.144",
|
|
20
|
+
"@remotion/paths": "4.0.144",
|
|
21
|
+
"@remotion/shapes": "4.0.144"
|
|
22
22
|
},
|
|
23
23
|
"devDependencies": {
|
|
24
24
|
"@jonny/eslint-config": "3.0.281",
|
|
@@ -32,8 +32,8 @@
|
|
|
32
32
|
"@types/react-dom": "18.2.18",
|
|
33
33
|
"@types/bun": "^1.0.12",
|
|
34
34
|
"@vitejs/plugin-react": "^2.0.0",
|
|
35
|
-
"
|
|
36
|
-
"remotion": "4.0.
|
|
35
|
+
"remotion": "4.0.144",
|
|
36
|
+
"@remotion/test-utils": "4.0.144"
|
|
37
37
|
},
|
|
38
38
|
"peerDependencies": {
|
|
39
39
|
"react": ">=16.8.0",
|
|
@@ -105,10 +105,10 @@
|
|
|
105
105
|
}
|
|
106
106
|
},
|
|
107
107
|
"scripts": {
|
|
108
|
-
"test": "vitest --run",
|
|
108
|
+
"test": "vitest src --run",
|
|
109
109
|
"lint": "eslint src --ext ts,tsx",
|
|
110
110
|
"formatting": "prettier src --check",
|
|
111
111
|
"watch": "tsc -w",
|
|
112
|
-
"build": "tsc -d && bun
|
|
112
|
+
"build": "tsc -d && bun bundle.ts"
|
|
113
113
|
}
|
|
114
114
|
}
|
/package/{build.ts → bundle.ts}
RENAMED
|
File without changes
|