@remotion/transitions 4.0.73 → 4.0.75

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.
@@ -5,7 +5,7 @@ declare const TransitionSeriesTransition: <PresentationProps extends Record<stri
5
5
  type SeriesSequenceProps = PropsWithChildren<{
6
6
  durationInFrames: number;
7
7
  offset?: number;
8
- className?: number;
8
+ className?: string;
9
9
  } & LayoutAndStyle & Pick<SequencePropsWithoutDuration, 'name'>>;
10
10
  declare const SeriesSequence: ({ children }: SeriesSequenceProps) => JSX.Element;
11
11
  declare const TransitionSeries: FC<SequencePropsWithoutDuration> & {
@@ -5,7 +5,7 @@ declare const TransitionSeriesTransition: <PresentationProps extends Record<stri
5
5
  type SeriesSequenceProps = PropsWithChildren<{
6
6
  durationInFrames: number;
7
7
  offset?: number;
8
- className?: number;
8
+ className?: string;
9
9
  } & LayoutAndStyle & Pick<SequencePropsWithoutDuration, 'name'>>;
10
10
  declare const SeriesSequence: ({ children }: SeriesSequenceProps) => JSX.Element;
11
11
  declare const TransitionSeries: FC<SequencePropsWithoutDuration> & {
@@ -0,0 +1,32 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var jsxRuntime = require('react/jsx-runtime');
6
+ var paths = require('@remotion/paths');
7
+ var shapes = require('@remotion/shapes');
8
+ var react = require('react');
9
+ var remotion = require('remotion');
10
+
11
+ const ClockWipePresentation = ({ children, presentationDirection, presentationProgress, passedProps }) => {
12
+ const finishedRadius = Math.sqrt(passedProps.width ** 2 + passedProps.height ** 2) / 2;
13
+ const { path } = shapes.makePie({
14
+ radius: finishedRadius,
15
+ progress: presentationProgress,
16
+ });
17
+ const translatedPath = paths.translatePath(path, -(finishedRadius * 2 - passedProps.width) / 2, -(finishedRadius * 2 - passedProps.height) / 2);
18
+ const [clipId] = react.useState(() => String(remotion.random(null)));
19
+ const style = react.useMemo(() => {
20
+ return {
21
+ width: '100%',
22
+ height: '100%',
23
+ clipPath: presentationDirection === 'exiting' ? undefined : `url(#${clipId})`,
24
+ };
25
+ }, [clipId, presentationDirection]);
26
+ return (jsxRuntime.jsxs(remotion.AbsoluteFill, { children: [jsxRuntime.jsx(remotion.AbsoluteFill, { style: style, children: children }), presentationDirection === 'exiting' ? null : (jsxRuntime.jsx(remotion.AbsoluteFill, { children: jsxRuntime.jsx("svg", { children: jsxRuntime.jsx("defs", { children: jsxRuntime.jsx("clipPath", { id: clipId, children: jsxRuntime.jsx("path", { d: translatedPath, fill: "black" }) }) }) }) }))] }));
27
+ };
28
+ const clockWipe = (props) => {
29
+ return { component: ClockWipePresentation, props: props !== null && props !== void 0 ? props : {} };
30
+ };
31
+
32
+ exports.clockWipe = clockWipe;
@@ -0,0 +1,6 @@
1
+ import type { TransitionPresentation } from '../types.js';
2
+ export type ClockWipeProps = {
3
+ width: number;
4
+ height: number;
5
+ };
6
+ export declare const clockWipe: (props: ClockWipeProps) => TransitionPresentation<ClockWipeProps>;
@@ -0,0 +1,6 @@
1
+ import type { TransitionPresentation } from '../types.js';
2
+ export type ClockWipeProps = {
3
+ width: number;
4
+ height: number;
5
+ };
6
+ export declare const clockWipe: (props: ClockWipeProps) => TransitionPresentation<ClockWipeProps>;
@@ -0,0 +1,25 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
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
+ const ClockWipePresentation = ({ children, presentationDirection, presentationProgress, passedProps }) => {
7
+ const finishedRadius = Math.sqrt(passedProps.width ** 2 + passedProps.height ** 2) / 2;
8
+ const { path } = makePie({
9
+ radius: finishedRadius,
10
+ progress: presentationProgress,
11
+ });
12
+ const translatedPath = translatePath(path, -(finishedRadius * 2 - passedProps.width) / 2, -(finishedRadius * 2 - passedProps.height) / 2);
13
+ const [clipId] = useState(() => String(random(null)));
14
+ const style = useMemo(() => {
15
+ return {
16
+ width: '100%',
17
+ height: '100%',
18
+ clipPath: presentationDirection === 'exiting' ? undefined : `url(#${clipId})`,
19
+ };
20
+ }, [clipId, presentationDirection]);
21
+ return (_jsxs(AbsoluteFill, { children: [_jsx(AbsoluteFill, { style: style, children: children }), presentationDirection === 'exiting' ? null : (_jsx(AbsoluteFill, { children: _jsx("svg", { children: _jsx("defs", { children: _jsx("clipPath", { id: clipId, children: _jsx("path", { d: translatedPath, fill: "black" }) }) }) }) }))] }));
22
+ };
23
+ export const clockWipe = (props) => {
24
+ return { component: ClockWipePresentation, props: props !== null && props !== void 0 ? props : {} };
25
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@remotion/transitions",
3
- "version": "4.0.73",
3
+ "version": "4.0.75",
4
4
  "description": "Transition presets for Remotion",
5
5
  "sideEffects": false,
6
6
  "main": "dist/cjs/index.js",
@@ -16,7 +16,9 @@
16
16
  "url": "https://github.com/remotion-dev/remotion/issues"
17
17
  },
18
18
  "dependencies": {
19
- "remotion": "4.0.73"
19
+ "remotion": "4.0.75",
20
+ "@remotion/paths": "4.0.75",
21
+ "@remotion/shapes": "4.0.75"
20
22
  },
21
23
  "devDependencies": {
22
24
  "@jonny/eslint-config": "3.0.276",
@@ -31,8 +33,8 @@
31
33
  "@vitejs/plugin-react": "^2.0.0",
32
34
  "rollup": "^2.70.1",
33
35
  "@rollup/plugin-typescript": "^8.2.0",
34
- "remotion": "4.0.73",
35
- "@remotion/test-utils": "4.0.73"
36
+ "remotion": "4.0.75",
37
+ "@remotion/test-utils": "4.0.75"
36
38
  },
37
39
  "peerDependencies": {
38
40
  "react": ">=16.8.0",
@@ -76,6 +78,12 @@
76
78
  "require": "./dist/cjs/presentations/flip.js",
77
79
  "types": "./dist/presentations/flip.d.ts"
78
80
  },
81
+ "./clock-wipe": {
82
+ "module": "./dist/presentations/clock-wipe.js",
83
+ "import": "./dist/presentations/clock-wipe.js",
84
+ "require": "./dist/cjs/presentations/clock-wipe.js",
85
+ "types": "./dist/presentations/clock-wipe.d.ts"
86
+ },
79
87
  "./package.json": "./package.json"
80
88
  },
81
89
  "typesVersions": {
@@ -91,6 +99,9 @@
91
99
  ],
92
100
  "fade": [
93
101
  "dist/presentations/fade.d.ts"
102
+ ],
103
+ "clock-wipe": [
104
+ "dist/presentations/clock-wipe.d.ts"
94
105
  ]
95
106
  }
96
107
  },
package/rollup.config.js CHANGED
@@ -1,7 +1,7 @@
1
1
  // rollup.config.js
2
2
  import typescript from '@rollup/plugin-typescript';
3
3
 
4
- const presentations = ['slide', 'flip', 'wipe', 'fade'];
4
+ const presentations = ['slide', 'flip', 'wipe', 'fade', 'clock-wipe'];
5
5
 
6
6
  export default [
7
7
  {
@@ -32,7 +32,14 @@ export default [
32
32
  sourcemap: false,
33
33
  },
34
34
  ],
35
- external: ['remotion', 'remotion/no-react', 'react', 'react/jsx-runtime'],
35
+ external: [
36
+ 'remotion',
37
+ 'remotion/no-react',
38
+ 'react',
39
+ 'react/jsx-runtime',
40
+ '@remotion/paths',
41
+ '@remotion/shapes',
42
+ ],
36
43
  plugins: [
37
44
  typescript({
38
45
  tsconfig: 'tsconfig-cjs.json',