@remotion/transitions 4.0.84 → 4.0.85
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/dist/index.d.mts
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { linearTiming } from './timings/linear-timing.mjs';
|
|
2
|
+
export { springTiming } from './timings/spring-timing.mjs';
|
|
3
|
+
export { TransitionSeries } from './TransitionSeries.js';
|
|
4
|
+
export { TransitionPresentation, TransitionPresentationComponentProps, TransitionTiming, } from './types.js';
|
package/dist/index.mjs
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { interpolate } from 'remotion';
|
|
2
|
+
export const linearTiming = (options) => {
|
|
3
|
+
return {
|
|
4
|
+
getDurationInFrames: () => {
|
|
5
|
+
return options.durationInFrames;
|
|
6
|
+
},
|
|
7
|
+
getProgress: ({ frame }) => {
|
|
8
|
+
return interpolate(frame, [0, options.durationInFrames], [0, 1], {
|
|
9
|
+
easing: options.easing,
|
|
10
|
+
extrapolateLeft: 'clamp',
|
|
11
|
+
extrapolateRight: 'clamp',
|
|
12
|
+
});
|
|
13
|
+
},
|
|
14
|
+
};
|
|
15
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { SpringConfig } from 'remotion';
|
|
2
|
+
import type { TransitionTiming } from '../types.js';
|
|
3
|
+
export declare const springTiming: (options?: {
|
|
4
|
+
config?: Partial<SpringConfig>;
|
|
5
|
+
durationInFrames?: number;
|
|
6
|
+
durationRestThreshold?: number;
|
|
7
|
+
}) => TransitionTiming;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { measureSpring, spring } from 'remotion';
|
|
2
|
+
const springWithInvalidArgumentRejection = (args) => {
|
|
3
|
+
if (args.to || args.from) {
|
|
4
|
+
throw new Error('to / from values are not supported by springWithRoundUpIfThreshold');
|
|
5
|
+
}
|
|
6
|
+
return spring(args);
|
|
7
|
+
};
|
|
8
|
+
export const springTiming = (options = {}) => {
|
|
9
|
+
return {
|
|
10
|
+
getDurationInFrames: ({ fps }) => {
|
|
11
|
+
if (options.durationInFrames) {
|
|
12
|
+
return options.durationInFrames;
|
|
13
|
+
}
|
|
14
|
+
return measureSpring({
|
|
15
|
+
config: options.config,
|
|
16
|
+
threshold: options.durationRestThreshold,
|
|
17
|
+
fps,
|
|
18
|
+
});
|
|
19
|
+
},
|
|
20
|
+
getProgress: ({ fps, frame }) => {
|
|
21
|
+
return springWithInvalidArgumentRejection({
|
|
22
|
+
fps,
|
|
23
|
+
frame,
|
|
24
|
+
config: options.config,
|
|
25
|
+
durationInFrames: options.durationInFrames,
|
|
26
|
+
durationRestThreshold: options.durationRestThreshold,
|
|
27
|
+
});
|
|
28
|
+
},
|
|
29
|
+
};
|
|
30
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@remotion/transitions",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.85",
|
|
4
4
|
"description": "Transition presets for Remotion",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"main": "dist/cjs/index.js",
|
|
@@ -16,9 +16,9 @@
|
|
|
16
16
|
"url": "https://github.com/remotion-dev/remotion/issues"
|
|
17
17
|
},
|
|
18
18
|
"dependencies": {
|
|
19
|
-
"
|
|
20
|
-
"@remotion/
|
|
21
|
-
"remotion": "4.0.
|
|
19
|
+
"remotion": "4.0.85",
|
|
20
|
+
"@remotion/paths": "4.0.85",
|
|
21
|
+
"@remotion/shapes": "4.0.85"
|
|
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.
|
|
37
|
-
"@remotion/test-utils": "4.0.
|
|
36
|
+
"remotion": "4.0.85",
|
|
37
|
+
"@remotion/test-utils": "4.0.85"
|
|
38
38
|
},
|
|
39
39
|
"peerDependencies": {
|
|
40
40
|
"react": ">=16.8.0",
|