@remotion/transitions 4.0.88 → 4.0.89

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.
@@ -60,13 +60,19 @@ const flattenChildren = (children) => {
60
60
  }, []);
61
61
  };
62
62
 
63
+ const epsilon = 0.01;
63
64
  const SlidePresentation = ({ children, presentationProgress, presentationDirection, passedProps: { direction = 'from-left', enterStyle, exitStyle }, }) => {
64
65
  const directionStyle = useMemo(() => {
66
+ // Overlay the two slides barely to avoid a white line between them
67
+ // Remove the correction once the presentation progress is 1
68
+ const presentationProgressWithEpsilonCorrection = presentationProgress === 1
69
+ ? presentationProgress * 100
70
+ : presentationProgress * 100 - epsilon;
65
71
  if (presentationDirection === 'exiting') {
66
72
  switch (direction) {
67
73
  case 'from-left':
68
74
  return {
69
- transform: `translateX(${presentationProgress * 100}%)`,
75
+ transform: `translateX(${presentationProgressWithEpsilonCorrection}%)`,
70
76
  };
71
77
  case 'from-right':
72
78
  return {
@@ -74,7 +80,7 @@ const SlidePresentation = ({ children, presentationProgress, presentationDirecti
74
80
  };
75
81
  case 'from-top':
76
82
  return {
77
- transform: `translateY(${presentationProgress * 100}%)`,
83
+ transform: `translateY(${presentationProgressWithEpsilonCorrection}%)`,
78
84
  };
79
85
  case 'from-bottom':
80
86
  return {
@@ -91,7 +97,7 @@ const SlidePresentation = ({ children, presentationProgress, presentationDirecti
91
97
  };
92
98
  case 'from-right':
93
99
  return {
94
- transform: `translateX(${100 - presentationProgress * 100}%)`,
100
+ transform: `translateX(${100 - presentationProgressWithEpsilonCorrection}%)`,
95
101
  };
96
102
  case 'from-top':
97
103
  return {
@@ -99,7 +105,7 @@ const SlidePresentation = ({ children, presentationProgress, presentationDirecti
99
105
  };
100
106
  case 'from-bottom':
101
107
  return {
102
- transform: `translateY(${100 - presentationProgress * 100}%)`,
108
+ transform: `translateY(${100 - presentationProgressWithEpsilonCorrection}%)`,
103
109
  };
104
110
  default:
105
111
  throw new Error(`Invalid direction: ${direction}`);
@@ -2,13 +2,19 @@ import { jsx } from 'react/jsx-runtime';
2
2
  import { useMemo } from 'react';
3
3
  import { AbsoluteFill } from 'remotion';
4
4
 
5
+ const epsilon = 0.01;
5
6
  const SlidePresentation = ({ children, presentationProgress, presentationDirection, passedProps: { direction = 'from-left', enterStyle, exitStyle }, }) => {
6
7
  const directionStyle = useMemo(() => {
8
+ // Overlay the two slides barely to avoid a white line between them
9
+ // Remove the correction once the presentation progress is 1
10
+ const presentationProgressWithEpsilonCorrection = presentationProgress === 1
11
+ ? presentationProgress * 100
12
+ : presentationProgress * 100 - epsilon;
7
13
  if (presentationDirection === 'exiting') {
8
14
  switch (direction) {
9
15
  case 'from-left':
10
16
  return {
11
- transform: `translateX(${presentationProgress * 100}%)`,
17
+ transform: `translateX(${presentationProgressWithEpsilonCorrection}%)`,
12
18
  };
13
19
  case 'from-right':
14
20
  return {
@@ -16,7 +22,7 @@ const SlidePresentation = ({ children, presentationProgress, presentationDirecti
16
22
  };
17
23
  case 'from-top':
18
24
  return {
19
- transform: `translateY(${presentationProgress * 100}%)`,
25
+ transform: `translateY(${presentationProgressWithEpsilonCorrection}%)`,
20
26
  };
21
27
  case 'from-bottom':
22
28
  return {
@@ -33,7 +39,7 @@ const SlidePresentation = ({ children, presentationProgress, presentationDirecti
33
39
  };
34
40
  case 'from-right':
35
41
  return {
36
- transform: `translateX(${100 - presentationProgress * 100}%)`,
42
+ transform: `translateX(${100 - presentationProgressWithEpsilonCorrection}%)`,
37
43
  };
38
44
  case 'from-top':
39
45
  return {
@@ -41,7 +47,7 @@ const SlidePresentation = ({ children, presentationProgress, presentationDirecti
41
47
  };
42
48
  case 'from-bottom':
43
49
  return {
44
- transform: `translateY(${100 - presentationProgress * 100}%)`,
50
+ transform: `translateY(${100 - presentationProgressWithEpsilonCorrection}%)`,
45
51
  };
46
52
  default:
47
53
  throw new Error(`Invalid direction: ${direction}`);
@@ -4,13 +4,19 @@ exports.slide = 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 epsilon = 0.01;
7
8
  const SlidePresentation = ({ children, presentationProgress, presentationDirection, passedProps: { direction = 'from-left', enterStyle, exitStyle }, }) => {
8
9
  const directionStyle = (0, react_1.useMemo)(() => {
10
+ // Overlay the two slides barely to avoid a white line between them
11
+ // Remove the correction once the presentation progress is 1
12
+ const presentationProgressWithEpsilonCorrection = presentationProgress === 1
13
+ ? presentationProgress * 100
14
+ : presentationProgress * 100 - epsilon;
9
15
  if (presentationDirection === 'exiting') {
10
16
  switch (direction) {
11
17
  case 'from-left':
12
18
  return {
13
- transform: `translateX(${presentationProgress * 100}%)`,
19
+ transform: `translateX(${presentationProgressWithEpsilonCorrection}%)`,
14
20
  };
15
21
  case 'from-right':
16
22
  return {
@@ -18,7 +24,7 @@ const SlidePresentation = ({ children, presentationProgress, presentationDirecti
18
24
  };
19
25
  case 'from-top':
20
26
  return {
21
- transform: `translateY(${presentationProgress * 100}%)`,
27
+ transform: `translateY(${presentationProgressWithEpsilonCorrection}%)`,
22
28
  };
23
29
  case 'from-bottom':
24
30
  return {
@@ -35,7 +41,7 @@ const SlidePresentation = ({ children, presentationProgress, presentationDirecti
35
41
  };
36
42
  case 'from-right':
37
43
  return {
38
- transform: `translateX(${100 - presentationProgress * 100}%)`,
44
+ transform: `translateX(${100 - presentationProgressWithEpsilonCorrection}%)`,
39
45
  };
40
46
  case 'from-top':
41
47
  return {
@@ -43,7 +49,7 @@ const SlidePresentation = ({ children, presentationProgress, presentationDirecti
43
49
  };
44
50
  case 'from-bottom':
45
51
  return {
46
- transform: `translateY(${100 - presentationProgress * 100}%)`,
52
+ transform: `translateY(${100 - presentationProgressWithEpsilonCorrection}%)`,
47
53
  };
48
54
  default:
49
55
  throw new Error(`Invalid direction: ${direction}`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@remotion/transitions",
3
- "version": "4.0.88",
3
+ "version": "4.0.89",
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
- "@remotion/shapes": "4.0.88",
20
- "remotion": "4.0.88",
21
- "@remotion/paths": "4.0.88"
19
+ "remotion": "4.0.89",
20
+ "@remotion/shapes": "4.0.89",
21
+ "@remotion/paths": "4.0.89"
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.88",
37
- "@remotion/test-utils": "4.0.88"
36
+ "remotion": "4.0.89",
37
+ "@remotion/test-utils": "4.0.89"
38
38
  },
39
39
  "peerDependencies": {
40
40
  "react": ">=16.8.0",
@@ -1,19 +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?: string;
9
- /**
10
- * @deprecated For internal use only
11
- */
12
- stack?: string;
13
- } & LayoutAndStyle & Pick<SequencePropsWithoutDuration, 'name'>>;
14
- declare const SeriesSequence: ({ children }: SeriesSequenceProps) => JSX.Element;
15
- declare const TransitionSeries: FC<SequencePropsWithoutDuration> & {
16
- Sequence: typeof SeriesSequence;
17
- Transition: typeof TransitionSeriesTransition;
18
- };
19
- export { TransitionSeries };
@@ -1,2 +0,0 @@
1
- import React from 'react';
2
- export declare const flattenChildren: (children: React.ReactNode) => (string | number | React.ReactElement<any, string | React.JSXElementConstructor<any>> | React.ReactFragment | React.ReactPortal)[];
@@ -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';
@@ -1,11 +0,0 @@
1
- import React from 'react';
2
- import type { TransitionPresentation } from '../types.js';
3
- export type ClockWipeProps = {
4
- width: number;
5
- height: number;
6
- outerEnterStyle?: React.CSSProperties;
7
- outerExitStyle?: React.CSSProperties;
8
- innerEnterStyle?: React.CSSProperties;
9
- innerExitStyle?: React.CSSProperties;
10
- };
11
- export declare const clockWipe: (props: ClockWipeProps) => TransitionPresentation<ClockWipeProps>;
@@ -1,7 +0,0 @@
1
- /// <reference types="react" />
2
- import type { TransitionPresentation } from '../types.js';
3
- export type FadeProps = {
4
- enterStyle?: React.CSSProperties;
5
- exitStyle?: React.CSSProperties;
6
- };
7
- export declare const fade: (props?: FadeProps) => TransitionPresentation<FadeProps>;
@@ -1,12 +0,0 @@
1
- import React from 'react';
2
- import type { TransitionPresentation } from '../types.js';
3
- export type FlipDirection = 'from-left' | 'from-right' | 'from-top' | 'from-bottom';
4
- export type FlipProps = {
5
- direction?: FlipDirection;
6
- perspective?: number;
7
- outerEnterStyle?: React.CSSProperties;
8
- outerExitStyle?: React.CSSProperties;
9
- innerEnterStyle?: React.CSSProperties;
10
- innerExitStyle?: React.CSSProperties;
11
- };
12
- export declare const flip: (props?: FlipProps) => TransitionPresentation<FlipProps>;
@@ -1,9 +0,0 @@
1
- import React from 'react';
2
- import type { TransitionPresentation } from '../types.js';
3
- export type SlideDirection = 'from-left' | 'from-top' | 'from-right' | 'from-bottom';
4
- export type SlideProps = {
5
- direction?: SlideDirection;
6
- exitStyle?: React.CSSProperties;
7
- enterStyle?: React.CSSProperties;
8
- };
9
- export declare const slide: (props?: SlideProps) => TransitionPresentation<SlideProps>;
@@ -1,11 +0,0 @@
1
- import React from 'react';
2
- import type { TransitionPresentation } from '../types.js';
3
- export type WipeDirection = 'from-left' | 'from-top-left' | 'from-top' | 'from-top-right' | 'from-right' | 'from-bottom-right' | 'from-bottom' | 'from-bottom-left';
4
- export type WipeProps = {
5
- direction?: WipeDirection;
6
- outerEnterStyle?: React.CSSProperties;
7
- outerExitStyle?: React.CSSProperties;
8
- innerEnterStyle?: React.CSSProperties;
9
- innerExitStyle?: React.CSSProperties;
10
- };
11
- export declare const wipe: (props?: WipeProps) => TransitionPresentation<WipeProps>;
@@ -1 +0,0 @@
1
- export {};
@@ -1,5 +0,0 @@
1
- import type { TransitionTiming } from '../types.js';
2
- export declare const linearTiming: (options: {
3
- durationInFrames: number;
4
- easing?: ((input: number) => number) | undefined;
5
- }) => TransitionTiming;
@@ -1,7 +0,0 @@
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;
@@ -1,27 +0,0 @@
1
- import type { ComponentType } from 'react';
2
- export type PresentationDirection = 'entering' | 'exiting';
3
- export type TransitionTiming = {
4
- getDurationInFrames: (options: {
5
- fps: number;
6
- }) => number;
7
- getProgress: (options: {
8
- frame: number;
9
- fps: number;
10
- }) => number;
11
- };
12
- export type TransitionSeriesTransitionProps<PresentationProps extends Record<string, unknown>> = {
13
- timing: TransitionTiming;
14
- presentation?: TransitionPresentation<PresentationProps>;
15
- };
16
- type LooseComponentType<T> = ComponentType<T> | ((props: T) => React.ReactNode);
17
- export type TransitionPresentation<PresentationProps extends Record<string, unknown>> = {
18
- component: LooseComponentType<TransitionPresentationComponentProps<PresentationProps>>;
19
- props: PresentationProps;
20
- };
21
- export type TransitionPresentationComponentProps<PresentationProps extends Record<string, unknown>> = {
22
- presentationProgress: number;
23
- children: React.ReactNode;
24
- presentationDirection: PresentationDirection;
25
- passedProps: PresentationProps;
26
- };
27
- export {};
@@ -1,2 +0,0 @@
1
- import { NoReactInternals } from 'remotion/no-react';
2
- export declare const validateDurationInFrames: typeof NoReactInternals.validateDurationInFrames;