@remotion/transitions 4.0.137 → 4.0.139
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/build.ts +30 -0
- package/dist/esm/clock-wipe.mjs +63 -43
- package/dist/esm/fade.mjs +31 -27
- package/dist/esm/flip.mjs +58 -46
- package/dist/esm/index.mjs +328 -257
- package/dist/esm/slide.mjs +77 -70
- package/dist/esm/wipe.mjs +115 -85
- package/package.json +11 -12
- package/dist/cjs/TransitionSeries.d.ts +0 -15
- package/dist/cjs/fade.js +0 -25
- package/dist/cjs/flatten-children.d.ts +0 -2
- package/dist/cjs/flip.js +0 -40
- package/dist/cjs/index.d.ts +0 -4
- package/dist/cjs/index.js +0 -280
- package/dist/cjs/presentations/fade.d.ts +0 -3
- package/dist/cjs/presentations/flip.d.ts +0 -7
- package/dist/cjs/presentations/slide.d.ts +0 -6
- package/dist/cjs/presentations/wipe.d.ts +0 -6
- package/dist/cjs/slide.js +0 -72
- package/dist/cjs/test/transitions.test.d.ts +0 -1
- package/dist/cjs/timings/linear-timing.d.ts +0 -5
- package/dist/cjs/timings/spring-timing.d.ts +0 -7
- package/dist/cjs/types.d.ts +0 -27
- package/dist/cjs/validate.d.ts +0 -2
- package/dist/cjs/wipe.js +0 -158
- package/rollup.config.js +0 -52
package/build.ts
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
const presentations = ['slide', 'flip', 'wipe', 'fade', 'clock-wipe'];
|
|
2
|
+
import {build} from 'bun';
|
|
3
|
+
import path from 'path';
|
|
4
|
+
|
|
5
|
+
const output = await build({
|
|
6
|
+
entrypoints: [
|
|
7
|
+
'src/index.ts',
|
|
8
|
+
...presentations.map((p) => `src/presentations/${p}.tsx`),
|
|
9
|
+
],
|
|
10
|
+
external: [
|
|
11
|
+
'remotion',
|
|
12
|
+
'remotion/no-react',
|
|
13
|
+
'react',
|
|
14
|
+
'react/jsx-runtime',
|
|
15
|
+
'react/jsx-runtime',
|
|
16
|
+
'react/jsx-dev-runtime',
|
|
17
|
+
'@remotion/paths',
|
|
18
|
+
'@remotion/shapes',
|
|
19
|
+
],
|
|
20
|
+
naming: '[name].mjs',
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
for (const file of output.outputs) {
|
|
24
|
+
const str = await file.text();
|
|
25
|
+
const newStr = str
|
|
26
|
+
.replace(/jsxDEV/g, 'jsx')
|
|
27
|
+
.replace(/react\/jsx-dev-runtime/g, 'react/jsx-runtime');
|
|
28
|
+
|
|
29
|
+
Bun.write(path.join('dist', 'esm', file.path), newStr);
|
|
30
|
+
}
|
package/dist/esm/clock-wipe.mjs
CHANGED
|
@@ -1,45 +1,65 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { useState
|
|
5
|
-
import { random
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
1
|
+
// src/presentations/clock-wipe.tsx
|
|
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
|
+
import {
|
|
7
|
+
jsx
|
|
8
|
+
} from "react/jsx-runtime";
|
|
9
|
+
var ClockWipePresentation = ({ children, presentationDirection, presentationProgress, passedProps }) => {
|
|
10
|
+
const finishedRadius = Math.sqrt(passedProps.width ** 2 + passedProps.height ** 2) / 2;
|
|
11
|
+
const { path } = makePie({
|
|
12
|
+
radius: finishedRadius,
|
|
13
|
+
progress: presentationProgress
|
|
14
|
+
});
|
|
15
|
+
const translatedPath = translatePath(path, -(finishedRadius * 2 - passedProps.width) / 2, -(finishedRadius * 2 - passedProps.height) / 2);
|
|
16
|
+
const [clipId] = useState(() => String(random(null)));
|
|
17
|
+
const style = useMemo(() => {
|
|
18
|
+
return {
|
|
19
|
+
width: "100%",
|
|
20
|
+
height: "100%",
|
|
21
|
+
clipPath: presentationDirection === "exiting" ? undefined : `url(#${clipId})`,
|
|
22
|
+
...presentationDirection === "entering" ? passedProps.innerEnterStyle : passedProps.innerExitStyle
|
|
23
|
+
};
|
|
24
|
+
}, [
|
|
25
|
+
clipId,
|
|
26
|
+
passedProps.innerEnterStyle,
|
|
27
|
+
passedProps.innerExitStyle,
|
|
28
|
+
presentationDirection
|
|
29
|
+
]);
|
|
30
|
+
const outerStyle = useMemo(() => {
|
|
31
|
+
return presentationDirection === "entering" ? passedProps.outerEnterStyle : passedProps.outerExitStyle;
|
|
32
|
+
}, [
|
|
33
|
+
passedProps.outerEnterStyle,
|
|
34
|
+
passedProps.outerExitStyle,
|
|
35
|
+
presentationDirection
|
|
36
|
+
]);
|
|
37
|
+
return jsx(AbsoluteFill, {
|
|
38
|
+
style: outerStyle,
|
|
39
|
+
children: [
|
|
40
|
+
jsx(AbsoluteFill, {
|
|
41
|
+
style,
|
|
42
|
+
children
|
|
43
|
+
}, undefined, false, undefined, this),
|
|
44
|
+
presentationDirection === "exiting" ? null : jsx(AbsoluteFill, {
|
|
45
|
+
children: jsx("svg", {
|
|
46
|
+
children: jsx("defs", {
|
|
47
|
+
children: jsx("clipPath", {
|
|
48
|
+
id: clipId,
|
|
49
|
+
children: jsx("path", {
|
|
50
|
+
d: translatedPath,
|
|
51
|
+
fill: "black"
|
|
52
|
+
}, undefined, false, undefined, this)
|
|
53
|
+
}, undefined, false, undefined, this)
|
|
54
|
+
}, undefined, false, undefined, this)
|
|
55
|
+
}, undefined, false, undefined, this)
|
|
56
|
+
}, undefined, false, undefined, this)
|
|
57
|
+
]
|
|
58
|
+
}, undefined, true, undefined, this);
|
|
40
59
|
};
|
|
41
|
-
|
|
42
|
-
|
|
60
|
+
var clockWipe = (props) => {
|
|
61
|
+
return { component: ClockWipePresentation, props: props ?? {} };
|
|
62
|
+
};
|
|
63
|
+
export {
|
|
64
|
+
clockWipe
|
|
43
65
|
};
|
|
44
|
-
|
|
45
|
-
export { clockWipe };
|
package/dist/esm/fade.mjs
CHANGED
|
@@ -1,30 +1,34 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
...(presentationDirection === 'entering'
|
|
11
|
-
? passedProps.enterStyle
|
|
12
|
-
: passedProps.exitStyle),
|
|
13
|
-
};
|
|
14
|
-
}, [
|
|
15
|
-
isEntering,
|
|
16
|
-
passedProps.enterStyle,
|
|
17
|
-
passedProps.exitStyle,
|
|
18
|
-
presentationDirection,
|
|
19
|
-
presentationProgress,
|
|
20
|
-
]);
|
|
21
|
-
return jsx(AbsoluteFill, { style: style, children: children });
|
|
22
|
-
};
|
|
23
|
-
const fade = (props) => {
|
|
1
|
+
// src/presentations/fade.tsx
|
|
2
|
+
import {useMemo} from "react";
|
|
3
|
+
import {AbsoluteFill} from "remotion";
|
|
4
|
+
import {
|
|
5
|
+
jsx
|
|
6
|
+
} from "react/jsx-runtime";
|
|
7
|
+
var FadePresentation = ({ children, presentationDirection, presentationProgress, passedProps }) => {
|
|
8
|
+
const isEntering = presentationDirection === "entering";
|
|
9
|
+
const style = useMemo(() => {
|
|
24
10
|
return {
|
|
25
|
-
|
|
26
|
-
|
|
11
|
+
opacity: isEntering ? presentationProgress : 1,
|
|
12
|
+
...presentationDirection === "entering" ? passedProps.enterStyle : passedProps.exitStyle
|
|
27
13
|
};
|
|
14
|
+
}, [
|
|
15
|
+
isEntering,
|
|
16
|
+
passedProps.enterStyle,
|
|
17
|
+
passedProps.exitStyle,
|
|
18
|
+
presentationDirection,
|
|
19
|
+
presentationProgress
|
|
20
|
+
]);
|
|
21
|
+
return jsx(AbsoluteFill, {
|
|
22
|
+
style,
|
|
23
|
+
children
|
|
24
|
+
}, undefined, false, undefined, this);
|
|
25
|
+
};
|
|
26
|
+
var fade = (props) => {
|
|
27
|
+
return {
|
|
28
|
+
component: FadePresentation,
|
|
29
|
+
props: props ?? {}
|
|
30
|
+
};
|
|
31
|
+
};
|
|
32
|
+
export {
|
|
33
|
+
fade
|
|
28
34
|
};
|
|
29
|
-
|
|
30
|
-
export { fade };
|
package/dist/esm/flip.mjs
CHANGED
|
@@ -1,48 +1,60 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
3
|
-
import { interpolate
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
1
|
+
// src/presentations/flip.tsx
|
|
2
|
+
import {useMemo} from "react";
|
|
3
|
+
import {AbsoluteFill, interpolate} from "remotion";
|
|
4
|
+
import {
|
|
5
|
+
jsx
|
|
6
|
+
} from "react/jsx-runtime";
|
|
7
|
+
var Flip = ({
|
|
8
|
+
children,
|
|
9
|
+
presentationDirection,
|
|
10
|
+
presentationProgress,
|
|
11
|
+
passedProps: {
|
|
12
|
+
direction = "from-left",
|
|
13
|
+
perspective = 1000,
|
|
14
|
+
innerEnterStyle,
|
|
15
|
+
innerExitStyle,
|
|
16
|
+
outerEnterStyle,
|
|
17
|
+
outerExitStyle
|
|
18
|
+
}
|
|
19
|
+
}) => {
|
|
20
|
+
const style = useMemo(() => {
|
|
21
|
+
const startRotationEntering = direction === "from-right" || direction === "from-top" ? 180 : -180;
|
|
22
|
+
const endRotationEntering = direction === "from-right" || direction === "from-top" ? -180 : 180;
|
|
23
|
+
const rotation = presentationDirection === "entering" ? interpolate(presentationProgress, [0, 1], [startRotationEntering, 0]) : interpolate(presentationProgress, [0, 1], [0, endRotationEntering]);
|
|
24
|
+
const rotateProperty = direction === "from-top" || direction === "from-bottom" ? "rotateX" : "rotateY";
|
|
25
|
+
return {
|
|
26
|
+
width: "100%",
|
|
27
|
+
height: "100%",
|
|
28
|
+
transform: `${rotateProperty}(${rotation}deg)`,
|
|
29
|
+
backfaceVisibility: "hidden",
|
|
30
|
+
WebkitBackfaceVisibility: "hidden",
|
|
31
|
+
...presentationDirection === "entering" ? innerEnterStyle : innerExitStyle
|
|
32
|
+
};
|
|
33
|
+
}, [
|
|
34
|
+
direction,
|
|
35
|
+
innerEnterStyle,
|
|
36
|
+
innerExitStyle,
|
|
37
|
+
presentationDirection,
|
|
38
|
+
presentationProgress
|
|
39
|
+
]);
|
|
40
|
+
const outer = useMemo(() => {
|
|
41
|
+
return {
|
|
42
|
+
perspective,
|
|
43
|
+
transformStyle: "preserve-3d",
|
|
44
|
+
...presentationDirection === "entering" ? outerEnterStyle : outerExitStyle
|
|
45
|
+
};
|
|
46
|
+
}, [outerEnterStyle, outerExitStyle, perspective, presentationDirection]);
|
|
47
|
+
return jsx(AbsoluteFill, {
|
|
48
|
+
style: outer,
|
|
49
|
+
children: jsx(AbsoluteFill, {
|
|
50
|
+
style,
|
|
51
|
+
children
|
|
52
|
+
}, undefined, false, undefined, this)
|
|
53
|
+
}, undefined, false, undefined, this);
|
|
43
54
|
};
|
|
44
|
-
|
|
45
|
-
|
|
55
|
+
var flip = (props) => {
|
|
56
|
+
return { component: Flip, props: props ?? {} };
|
|
57
|
+
};
|
|
58
|
+
export {
|
|
59
|
+
flip
|
|
46
60
|
};
|
|
47
|
-
|
|
48
|
-
export { flip };
|