@remotion/transitions 4.0.136 → 4.0.138
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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/dist/esm/slide.mjs
CHANGED
|
@@ -1,75 +1,82 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
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
|
-
case 'from-right':
|
|
41
|
-
return {
|
|
42
|
-
transform: `translateX(${100 - presentationProgressWithEpsilonCorrection}%)`,
|
|
43
|
-
};
|
|
44
|
-
case 'from-top':
|
|
45
|
-
return {
|
|
46
|
-
transform: `translateY(${-100 + presentationProgress * 100}%)`,
|
|
47
|
-
};
|
|
48
|
-
case 'from-bottom':
|
|
49
|
-
return {
|
|
50
|
-
transform: `translateY(${100 - presentationProgressWithEpsilonCorrection}%)`,
|
|
51
|
-
};
|
|
52
|
-
default:
|
|
53
|
-
throw new Error(`Invalid direction: ${direction}`);
|
|
54
|
-
}
|
|
55
|
-
}, [presentationDirection, presentationProgress, direction]);
|
|
56
|
-
const style = useMemo(() => {
|
|
1
|
+
// src/presentations/slide.tsx
|
|
2
|
+
import {useMemo} from "react";
|
|
3
|
+
import {AbsoluteFill} from "remotion";
|
|
4
|
+
import {
|
|
5
|
+
jsx
|
|
6
|
+
} from "react/jsx-runtime";
|
|
7
|
+
var epsilon = 0.01;
|
|
8
|
+
var SlidePresentation = ({
|
|
9
|
+
children,
|
|
10
|
+
presentationProgress,
|
|
11
|
+
presentationDirection,
|
|
12
|
+
passedProps: { direction = "from-left", enterStyle, exitStyle }
|
|
13
|
+
}) => {
|
|
14
|
+
const directionStyle = useMemo(() => {
|
|
15
|
+
const presentationProgressWithEpsilonCorrection = presentationProgress === 1 ? presentationProgress * 100 : presentationProgress * 100 - epsilon;
|
|
16
|
+
if (presentationDirection === "exiting") {
|
|
17
|
+
switch (direction) {
|
|
18
|
+
case "from-left":
|
|
19
|
+
return {
|
|
20
|
+
transform: `translateX(${presentationProgressWithEpsilonCorrection}%)`
|
|
21
|
+
};
|
|
22
|
+
case "from-right":
|
|
23
|
+
return {
|
|
24
|
+
transform: `translateX(-${presentationProgress * 100}%)`
|
|
25
|
+
};
|
|
26
|
+
case "from-top":
|
|
27
|
+
return {
|
|
28
|
+
transform: `translateY(${presentationProgressWithEpsilonCorrection}%)`
|
|
29
|
+
};
|
|
30
|
+
case "from-bottom":
|
|
31
|
+
return {
|
|
32
|
+
transform: `translateY(-${presentationProgress * 100}%)`
|
|
33
|
+
};
|
|
34
|
+
default:
|
|
35
|
+
throw new Error(`Invalid direction: ${direction}`);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
switch (direction) {
|
|
39
|
+
case "from-left":
|
|
57
40
|
return {
|
|
58
|
-
|
|
59
|
-
height: '100%',
|
|
60
|
-
justifyContent: 'center',
|
|
61
|
-
alignItems: 'center',
|
|
62
|
-
...directionStyle,
|
|
63
|
-
...(presentationDirection === 'entering' ? enterStyle : exitStyle),
|
|
41
|
+
transform: `translateX(${-100 + presentationProgress * 100}%)`
|
|
64
42
|
};
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
}
|
|
68
|
-
|
|
43
|
+
case "from-right":
|
|
44
|
+
return {
|
|
45
|
+
transform: `translateX(${100 - presentationProgressWithEpsilonCorrection}%)`
|
|
46
|
+
};
|
|
47
|
+
case "from-top":
|
|
48
|
+
return {
|
|
49
|
+
transform: `translateY(${-100 + presentationProgress * 100}%)`
|
|
50
|
+
};
|
|
51
|
+
case "from-bottom":
|
|
52
|
+
return {
|
|
53
|
+
transform: `translateY(${100 - presentationProgressWithEpsilonCorrection}%)`
|
|
54
|
+
};
|
|
55
|
+
default:
|
|
56
|
+
throw new Error(`Invalid direction: ${direction}`);
|
|
57
|
+
}
|
|
58
|
+
}, [presentationDirection, presentationProgress, direction]);
|
|
59
|
+
const style = useMemo(() => {
|
|
69
60
|
return {
|
|
70
|
-
|
|
71
|
-
|
|
61
|
+
width: "100%",
|
|
62
|
+
height: "100%",
|
|
63
|
+
justifyContent: "center",
|
|
64
|
+
alignItems: "center",
|
|
65
|
+
...directionStyle,
|
|
66
|
+
...presentationDirection === "entering" ? enterStyle : exitStyle
|
|
72
67
|
};
|
|
68
|
+
}, [directionStyle, enterStyle, exitStyle, presentationDirection]);
|
|
69
|
+
return jsx(AbsoluteFill, {
|
|
70
|
+
style,
|
|
71
|
+
children
|
|
72
|
+
}, undefined, false, undefined, this);
|
|
73
|
+
};
|
|
74
|
+
var slide = (props) => {
|
|
75
|
+
return {
|
|
76
|
+
component: SlidePresentation,
|
|
77
|
+
props: props ?? {}
|
|
78
|
+
};
|
|
79
|
+
};
|
|
80
|
+
export {
|
|
81
|
+
slide
|
|
73
82
|
};
|
|
74
|
-
|
|
75
|
-
export { slide };
|
package/dist/esm/wipe.mjs
CHANGED
|
@@ -1,162 +1,192 @@
|
|
|
1
|
-
|
|
2
|
-
import { useState
|
|
3
|
-
import { random
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
// src/presentations/wipe.tsx
|
|
2
|
+
import {useMemo, useState} from "react";
|
|
3
|
+
import {AbsoluteFill, random} from "remotion";
|
|
4
|
+
import {
|
|
5
|
+
jsx
|
|
6
|
+
} from "react/jsx-runtime";
|
|
7
|
+
var makePathIn = (progress, direction) => {
|
|
8
|
+
switch (direction) {
|
|
9
|
+
case "from-left":
|
|
10
|
+
return `
|
|
9
11
|
M 0 0
|
|
10
12
|
L ${progress} 0
|
|
11
13
|
L ${progress} 1
|
|
12
14
|
L 0 1
|
|
13
15
|
Z`;
|
|
14
|
-
|
|
15
|
-
|
|
16
|
+
case "from-top-left":
|
|
17
|
+
return `
|
|
16
18
|
M 0 0
|
|
17
19
|
L ${progress * 2} 0
|
|
18
20
|
L 0 ${progress * 2}
|
|
19
21
|
Z`;
|
|
20
|
-
|
|
21
|
-
|
|
22
|
+
case "from-top":
|
|
23
|
+
return `
|
|
22
24
|
M 0 0
|
|
23
25
|
L 1 0
|
|
24
26
|
L 1 ${progress}
|
|
25
27
|
L 0 ${progress}
|
|
26
28
|
Z`;
|
|
27
|
-
|
|
28
|
-
|
|
29
|
+
case "from-top-right":
|
|
30
|
+
return `
|
|
29
31
|
M 1 0
|
|
30
32
|
L ${1 - progress * 2} 0
|
|
31
33
|
L 1 ${progress * 2}
|
|
32
34
|
Z`;
|
|
33
|
-
|
|
34
|
-
|
|
35
|
+
case "from-right":
|
|
36
|
+
return `
|
|
35
37
|
M 1 0
|
|
36
38
|
L 1 1
|
|
37
39
|
L ${1 - progress} 1
|
|
38
40
|
L ${1 - progress} 0
|
|
39
41
|
Z`;
|
|
40
|
-
|
|
41
|
-
|
|
42
|
+
case "from-bottom-right":
|
|
43
|
+
return `
|
|
42
44
|
M 1 1
|
|
43
45
|
L ${1 - progress * 2} 1
|
|
44
46
|
L 1 ${1 - progress * 2}
|
|
45
47
|
Z`;
|
|
46
|
-
|
|
47
|
-
|
|
48
|
+
case "from-bottom":
|
|
49
|
+
return `
|
|
48
50
|
M 0 1
|
|
49
51
|
L 1 1
|
|
50
52
|
L 1 ${1 - progress}
|
|
51
53
|
L 0 ${1 - progress}
|
|
52
54
|
Z`;
|
|
53
|
-
|
|
54
|
-
|
|
55
|
+
case "from-bottom-left":
|
|
56
|
+
return `
|
|
55
57
|
M 0 1
|
|
56
58
|
L 0 ${1 - progress * 2}
|
|
57
59
|
L ${progress * 2} 1
|
|
58
60
|
Z`;
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
61
|
+
default:
|
|
62
|
+
throw new Error(`Unknown direction ${JSON.stringify(direction)}`);
|
|
63
|
+
}
|
|
62
64
|
};
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
65
|
+
var makePathOut = (progress, direction) => {
|
|
66
|
+
switch (direction) {
|
|
67
|
+
case "from-left":
|
|
68
|
+
return `
|
|
67
69
|
M 1 1
|
|
68
70
|
L ${1 - progress} 1
|
|
69
71
|
L ${1 - progress} 0
|
|
70
72
|
L 1 0
|
|
71
73
|
Z`;
|
|
72
|
-
|
|
73
|
-
|
|
74
|
+
case "from-top-left":
|
|
75
|
+
return `
|
|
74
76
|
M 1 1
|
|
75
77
|
L ${1 - 2 * progress} 1
|
|
76
78
|
L 1 ${1 - 2 * progress}
|
|
77
79
|
Z`;
|
|
78
|
-
|
|
79
|
-
|
|
80
|
+
case "from-top":
|
|
81
|
+
return `
|
|
80
82
|
M 1 1
|
|
81
83
|
L 0 1
|
|
82
84
|
L 0 ${1 - progress}
|
|
83
85
|
L 1 ${1 - progress}
|
|
84
86
|
Z`;
|
|
85
|
-
|
|
86
|
-
|
|
87
|
+
case "from-top-right":
|
|
88
|
+
return `
|
|
87
89
|
M 0 1
|
|
88
90
|
L ${progress * 2} 1
|
|
89
91
|
L 0 ${1 - progress * 2}
|
|
90
92
|
Z`;
|
|
91
|
-
|
|
92
|
-
|
|
93
|
+
case "from-right":
|
|
94
|
+
return `
|
|
93
95
|
M 0 0
|
|
94
96
|
L ${progress} 0
|
|
95
97
|
L ${progress} 1
|
|
96
98
|
L 0 1
|
|
97
99
|
Z`;
|
|
98
|
-
|
|
99
|
-
|
|
100
|
+
case "from-bottom-right":
|
|
101
|
+
return `
|
|
100
102
|
M 0 0
|
|
101
103
|
L ${progress * 2} 0
|
|
102
104
|
L 0 ${progress * 2}
|
|
103
105
|
Z`;
|
|
104
|
-
|
|
105
|
-
|
|
106
|
+
case "from-bottom":
|
|
107
|
+
return `
|
|
106
108
|
M 1 0
|
|
107
109
|
L 0 0
|
|
108
110
|
L 0 ${progress}
|
|
109
111
|
L 1 ${progress}
|
|
110
112
|
Z`;
|
|
111
|
-
|
|
112
|
-
|
|
113
|
+
case "from-bottom-left":
|
|
114
|
+
return `
|
|
113
115
|
M 1 0
|
|
114
116
|
L ${1 - progress * 2} 0
|
|
115
117
|
L 1 ${progress * 2}
|
|
116
118
|
Z`;
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
119
|
+
default:
|
|
120
|
+
throw new Error(`Unknown direction ${JSON.stringify(direction)}`);
|
|
121
|
+
}
|
|
120
122
|
};
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
pointerEvents: 'none',
|
|
151
|
-
};
|
|
152
|
-
}, []);
|
|
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" }) }) }) }) })] }));
|
|
154
|
-
};
|
|
155
|
-
const wipe = (props) => {
|
|
123
|
+
var WipePresentation = ({
|
|
124
|
+
children,
|
|
125
|
+
presentationProgress,
|
|
126
|
+
presentationDirection,
|
|
127
|
+
passedProps: {
|
|
128
|
+
direction = "from-left",
|
|
129
|
+
innerEnterStyle,
|
|
130
|
+
innerExitStyle,
|
|
131
|
+
outerEnterStyle,
|
|
132
|
+
outerExitStyle
|
|
133
|
+
}
|
|
134
|
+
}) => {
|
|
135
|
+
const [clipId] = useState(() => String(random(null)));
|
|
136
|
+
const progressInDirection = presentationDirection === "entering" ? presentationProgress : 1 - presentationProgress;
|
|
137
|
+
const path = presentationDirection === "entering" ? makePathIn(progressInDirection, direction) : makePathOut(progressInDirection, direction);
|
|
138
|
+
const style = useMemo(() => {
|
|
139
|
+
return {
|
|
140
|
+
width: "100%",
|
|
141
|
+
height: "100%",
|
|
142
|
+
justifyContent: "center",
|
|
143
|
+
alignItems: "center",
|
|
144
|
+
clipPath: `url(#${clipId})`,
|
|
145
|
+
...presentationDirection === "entering" ? innerEnterStyle : innerExitStyle
|
|
146
|
+
};
|
|
147
|
+
}, [clipId, innerEnterStyle, innerExitStyle, presentationDirection]);
|
|
148
|
+
const outerStyle = useMemo(() => {
|
|
149
|
+
return presentationDirection === "entering" ? outerEnterStyle : outerExitStyle;
|
|
150
|
+
}, [outerEnterStyle, outerExitStyle, presentationDirection]);
|
|
151
|
+
const svgStyle = useMemo(() => {
|
|
156
152
|
return {
|
|
157
|
-
|
|
158
|
-
|
|
153
|
+
width: "100%",
|
|
154
|
+
height: "100%",
|
|
155
|
+
pointerEvents: "none"
|
|
159
156
|
};
|
|
157
|
+
}, []);
|
|
158
|
+
return jsx(AbsoluteFill, {
|
|
159
|
+
style: outerStyle,
|
|
160
|
+
children: [
|
|
161
|
+
jsx(AbsoluteFill, {
|
|
162
|
+
style,
|
|
163
|
+
children
|
|
164
|
+
}, undefined, false, undefined, this),
|
|
165
|
+
jsx(AbsoluteFill, {
|
|
166
|
+
children: jsx("svg", {
|
|
167
|
+
viewBox: "0 0 1 1",
|
|
168
|
+
style: svgStyle,
|
|
169
|
+
children: jsx("defs", {
|
|
170
|
+
children: jsx("clipPath", {
|
|
171
|
+
id: clipId,
|
|
172
|
+
clipPathUnits: "objectBoundingBox",
|
|
173
|
+
children: jsx("path", {
|
|
174
|
+
d: path,
|
|
175
|
+
fill: "black"
|
|
176
|
+
}, undefined, false, undefined, this)
|
|
177
|
+
}, undefined, false, undefined, this)
|
|
178
|
+
}, undefined, false, undefined, this)
|
|
179
|
+
}, undefined, false, undefined, this)
|
|
180
|
+
}, undefined, false, undefined, this)
|
|
181
|
+
]
|
|
182
|
+
}, undefined, true, undefined, this);
|
|
183
|
+
};
|
|
184
|
+
var wipe = (props) => {
|
|
185
|
+
return {
|
|
186
|
+
component: WipePresentation,
|
|
187
|
+
props: props ?? {}
|
|
188
|
+
};
|
|
189
|
+
};
|
|
190
|
+
export {
|
|
191
|
+
wipe
|
|
160
192
|
};
|
|
161
|
-
|
|
162
|
-
export { wipe };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@remotion/transitions",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.138",
|
|
4
4
|
"description": "Transition presets for Remotion",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"main": "dist/esm/index.mjs",
|
|
@@ -16,25 +16,24 @@
|
|
|
16
16
|
"url": "https://github.com/remotion-dev/remotion/issues"
|
|
17
17
|
},
|
|
18
18
|
"dependencies": {
|
|
19
|
-
"remotion": "4.0.
|
|
20
|
-
"@remotion/shapes": "4.0.
|
|
21
|
-
"@remotion/paths": "4.0.
|
|
19
|
+
"remotion": "4.0.138",
|
|
20
|
+
"@remotion/shapes": "4.0.138",
|
|
21
|
+
"@remotion/paths": "4.0.138"
|
|
22
22
|
},
|
|
23
23
|
"devDependencies": {
|
|
24
|
-
"@jonny/eslint-config": "3.0.
|
|
25
|
-
"eslint": "8.
|
|
26
|
-
"prettier": "3.
|
|
24
|
+
"@jonny/eslint-config": "3.0.281",
|
|
25
|
+
"eslint": "8.56.0",
|
|
26
|
+
"prettier": "3.2.5",
|
|
27
27
|
"prettier-plugin-organize-imports": "3.2.4",
|
|
28
28
|
"react": "18.2.0",
|
|
29
29
|
"react-dom": "18.2.0",
|
|
30
30
|
"vitest": "0.31.1",
|
|
31
31
|
"@types/react": "18.2.48",
|
|
32
32
|
"@types/react-dom": "18.2.18",
|
|
33
|
+
"@types/bun": "^1.0.12",
|
|
33
34
|
"@vitejs/plugin-react": "^2.0.0",
|
|
34
|
-
"
|
|
35
|
-
"@
|
|
36
|
-
"remotion": "4.0.136",
|
|
37
|
-
"@remotion/test-utils": "4.0.136"
|
|
35
|
+
"remotion": "4.0.138",
|
|
36
|
+
"@remotion/test-utils": "4.0.138"
|
|
38
37
|
},
|
|
39
38
|
"peerDependencies": {
|
|
40
39
|
"react": ">=16.8.0",
|
|
@@ -110,6 +109,6 @@
|
|
|
110
109
|
"lint": "eslint src --ext ts,tsx",
|
|
111
110
|
"formatting": "prettier src --check",
|
|
112
111
|
"watch": "tsc -w",
|
|
113
|
-
"build": "tsc -d &&
|
|
112
|
+
"build": "tsc -d && bun build.ts"
|
|
114
113
|
}
|
|
115
114
|
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import type { FC, PropsWithChildren } from 'react';
|
|
2
|
-
import type { LayoutAndStyle, SequencePropsWithoutDuration } from 'remotion';
|
|
3
|
-
import type { TransitionSeriesTransitionProps } from './types.js';
|
|
4
|
-
declare const TransitionSeriesTransition: <PresentationProps extends Record<string, unknown>>(_props: TransitionSeriesTransitionProps<PresentationProps>) => null;
|
|
5
|
-
type SeriesSequenceProps = PropsWithChildren<{
|
|
6
|
-
durationInFrames: number;
|
|
7
|
-
offset?: number;
|
|
8
|
-
className?: number;
|
|
9
|
-
} & LayoutAndStyle & Pick<SequencePropsWithoutDuration, 'name'>>;
|
|
10
|
-
declare const SeriesSequence: ({ children }: SeriesSequenceProps) => JSX.Element;
|
|
11
|
-
declare const TransitionSeries: FC<SequencePropsWithoutDuration> & {
|
|
12
|
-
Sequence: typeof SeriesSequence;
|
|
13
|
-
Transition: typeof TransitionSeriesTransition;
|
|
14
|
-
};
|
|
15
|
-
export { TransitionSeries };
|
package/dist/cjs/fade.js
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
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');
|
|
8
|
-
|
|
9
|
-
const FadePresentation = ({ children, presentationDirection, presentationProgress }) => {
|
|
10
|
-
const isEntering = presentationDirection === 'entering';
|
|
11
|
-
const style = react.useMemo(() => {
|
|
12
|
-
return {
|
|
13
|
-
opacity: isEntering ? presentationProgress : 1,
|
|
14
|
-
};
|
|
15
|
-
}, [isEntering, presentationProgress]);
|
|
16
|
-
return (jsxRuntime.jsx(remotion.AbsoluteFill, { children: jsxRuntime.jsx(remotion.AbsoluteFill, { style: style, children: children }) }));
|
|
17
|
-
};
|
|
18
|
-
const fade = (props) => {
|
|
19
|
-
return {
|
|
20
|
-
component: FadePresentation,
|
|
21
|
-
props: props !== null && props !== void 0 ? props : {},
|
|
22
|
-
};
|
|
23
|
-
};
|
|
24
|
-
|
|
25
|
-
exports.fade = fade;
|
package/dist/cjs/flip.js
DELETED
|
@@ -1,40 +0,0 @@
|
|
|
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');
|
|
8
|
-
|
|
9
|
-
const Flip = ({ children, presentationDirection, presentationProgress, passedProps: { direction = 'from-left', perspective = 1000 }, }) => {
|
|
10
|
-
const style = react.useMemo(() => {
|
|
11
|
-
const startRotationEntering = direction === 'from-right' || direction === 'from-top' ? 180 : -180;
|
|
12
|
-
const endRotationEntering = direction === 'from-right' || direction === 'from-top' ? -180 : 180;
|
|
13
|
-
const rotation = presentationDirection === 'entering'
|
|
14
|
-
? remotion.interpolate(presentationProgress, [0, 1], [startRotationEntering, 0])
|
|
15
|
-
: remotion.interpolate(presentationProgress, [0, 1], [0, endRotationEntering]);
|
|
16
|
-
const rotateProperty = direction === 'from-top' || direction === 'from-bottom'
|
|
17
|
-
? 'rotateX'
|
|
18
|
-
: 'rotateY';
|
|
19
|
-
return {
|
|
20
|
-
width: '100%',
|
|
21
|
-
height: '100%',
|
|
22
|
-
transform: `${rotateProperty}(${rotation}deg)`,
|
|
23
|
-
backfaceVisibility: 'hidden',
|
|
24
|
-
WebkitBackfaceVisibility: 'hidden',
|
|
25
|
-
};
|
|
26
|
-
}, [direction, presentationDirection, presentationProgress]);
|
|
27
|
-
const outer = react.useMemo(() => {
|
|
28
|
-
return {
|
|
29
|
-
perspective,
|
|
30
|
-
// Make children also their backface hidden
|
|
31
|
-
transformStyle: 'preserve-3d',
|
|
32
|
-
};
|
|
33
|
-
}, [perspective]);
|
|
34
|
-
return (jsxRuntime.jsx(remotion.AbsoluteFill, { style: outer, children: jsxRuntime.jsx(remotion.AbsoluteFill, { style: style, children: children }) }));
|
|
35
|
-
};
|
|
36
|
-
const flip = (props) => {
|
|
37
|
-
return { component: Flip, props: props !== null && props !== void 0 ? props : {} };
|
|
38
|
-
};
|
|
39
|
-
|
|
40
|
-
exports.flip = flip;
|
package/dist/cjs/index.d.ts
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
export { linearTiming } from './timings/linear-timing.js';
|
|
2
|
-
export { springTiming } from './timings/spring-timing.js';
|
|
3
|
-
export { TransitionSeries } from './TransitionSeries.js';
|
|
4
|
-
export { TransitionPresentation, TransitionPresentationComponentProps, TransitionTiming, } from './types.js';
|