@remotion/three 4.0.0-webhook.27 → 4.1.0-alpha2
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/LICENSE.md +8 -8
- package/dist/{SuspenseLoader.d.ts → cjs/SuspenseLoader.d.ts} +0 -0
- package/dist/{SuspenseLoader.js → cjs/SuspenseLoader.js} +9 -6
- package/dist/cjs/ThreeCanvas.d.ts +12 -0
- package/dist/{ThreeCanvas.js → cjs/ThreeCanvas.js} +4 -0
- package/dist/{index.d.ts → cjs/index.d.ts} +0 -0
- package/dist/{index.js → cjs/index.js} +0 -0
- package/dist/cjs/use-video-texture.d.ts +9 -0
- package/dist/{use-video-texture.js → cjs/use-video-texture.js} +30 -11
- package/dist/esm/SuspenseLoader.d.ts +4 -0
- package/dist/esm/ThreeCanvas.d.ts +12 -0
- package/dist/esm/index.d.ts +2 -0
- package/dist/esm/index.mjs +131 -0
- package/dist/esm/use-video-texture.d.ts +9 -0
- package/package.json +61 -58
- package/rollup.config.js +29 -0
- package/.prettierrc.js +0 -14
- package/dist/ThreeCanvas.d.ts +0 -8
- package/dist/use-video-texture.d.ts +0 -5
- package/tsconfig.json +0 -14
package/LICENSE.md
CHANGED
|
@@ -1,34 +1,34 @@
|
|
|
1
1
|
# Remotion License
|
|
2
2
|
|
|
3
|
-
Depending on the type of your legal entity, you are granted permission to use Remotion for your project. Individuals and small companies are allowed to use Remotion create videos for free (even commercial), while a company license is required for for-profit
|
|
3
|
+
Depending on the type of your legal entity, you are granted permission to use Remotion for your project. Individuals and small companies are allowed to use Remotion to create videos for free (even commercial), while a company license is required for for-profit organizations of a certain size. This two-tier system was designed to ensure funding for this project while still allowing the source code to be available and the program to be free for most. Read below for the exact terms of use.
|
|
4
4
|
|
|
5
5
|
- [Free license](#free-license)
|
|
6
6
|
- [Company license](#company-license)
|
|
7
7
|
|
|
8
8
|
## Free license
|
|
9
9
|
|
|
10
|
-
Copyright ©
|
|
10
|
+
Copyright © 2023 [Remotion](https://www.remotion.dev/)
|
|
11
11
|
|
|
12
12
|
### Eligibility
|
|
13
13
|
|
|
14
14
|
You are eligible to use Remotion for free if you are:
|
|
15
15
|
|
|
16
16
|
- an individual
|
|
17
|
-
- a for-profit
|
|
18
|
-
- a non-profit or not-for-profit
|
|
17
|
+
- a for-profit organization with up to 3 employees
|
|
18
|
+
- a non-profit or not-for-profit organization
|
|
19
19
|
- evaluating whether Remotion is a good fit, and are not yet using it in a commercial way
|
|
20
20
|
|
|
21
21
|
### Allowed use cases
|
|
22
22
|
|
|
23
|
-
Permission is hereby granted, free of charge, to any person eligible for the "Free license", to use the software non-commercially or commercially for the purpose of creating videos and images and to modify
|
|
23
|
+
Permission is hereby granted, free of charge, to any person eligible for the "Free license", to use the software non-commercially or commercially for the purpose of creating videos and images and to modify the software to their own liking, for the purpose of fulfilling their custom use case or to contribute bug fixes or improvements back to Remotion.
|
|
24
24
|
|
|
25
25
|
### Disallowed use cases
|
|
26
26
|
|
|
27
|
-
It is not allowed to copy or modify Remotion code for the purpose of selling, renting, licensing, relicensing, sublicensing your own derivate of Remotion.
|
|
27
|
+
It is not allowed to copy or modify Remotion code for the purpose of selling, renting, licensing, relicensing, or sublicensing your own derivate of Remotion.
|
|
28
28
|
|
|
29
29
|
### Warranty notice
|
|
30
30
|
|
|
31
|
-
The software is provided "as is", without warranty of any kind, express or implied, including but not limited to the warranties of merchantability, fitness for a particular purpose and
|
|
31
|
+
The software is provided "as is", without warranty of any kind, express or implied, including but not limited to the warranties of merchantability, fitness for a particular purpose, and non-infringement. In no event shall the author or copyright holders be liable for any claim, damages or other liability, whether in an action of contract, tort or otherwise, arising from, out of or in connection with the software or the use or other dealings in the software.
|
|
32
32
|
|
|
33
33
|
### Support
|
|
34
34
|
|
|
@@ -36,6 +36,6 @@ Support is provided on a best-we-can-do basis via GitHub Issues and Discord.
|
|
|
36
36
|
|
|
37
37
|
## Company license
|
|
38
38
|
|
|
39
|
-
You are required to obtain a company license to use Remotion if you are not within the group of entities eligible for a free license. This license will enable you to use Remotion for the allowed use cases specified in the free license, and give you access to prioritized support.
|
|
39
|
+
You are required to obtain a company license to use Remotion if you are not within the group of entities eligible for a free license. This license will enable you to use Remotion for the allowed use cases specified in the free license, and give you access to prioritized support (read the [Support Policy](/docs/support)).
|
|
40
40
|
|
|
41
41
|
Visit [companies.remotion.dev](https://companies.remotion.dev) for pricing and to buy a license.
|
|
File without changes
|
|
@@ -5,12 +5,15 @@ const jsx_runtime_1 = require("react/jsx-runtime");
|
|
|
5
5
|
const react_1 = require("react");
|
|
6
6
|
const remotion_1 = require("remotion");
|
|
7
7
|
const Unblocker = () => {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
(0, remotion_1.
|
|
12
|
-
|
|
13
|
-
|
|
8
|
+
if (typeof document !== 'undefined') {
|
|
9
|
+
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
10
|
+
(0, react_1.useLayoutEffect)(() => {
|
|
11
|
+
const handle = (0, remotion_1.delayRender)(`Waiting for <Suspense /> of <ThreeCanvas /> to resolve`);
|
|
12
|
+
return () => {
|
|
13
|
+
(0, remotion_1.continueRender)(handle);
|
|
14
|
+
};
|
|
15
|
+
}, []);
|
|
16
|
+
}
|
|
14
17
|
return null;
|
|
15
18
|
};
|
|
16
19
|
const SuspenseLoader = ({ children }) => {
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Canvas } from '@react-three/fiber';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
export type ThreeCanvasProps = React.ComponentProps<typeof Canvas> & {
|
|
4
|
+
width: number;
|
|
5
|
+
height: number;
|
|
6
|
+
children: React.ReactNode;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* @description A wrapper for React Three Fiber's <Canvas /> which synchronizes with Remotions useCurrentFrame().
|
|
10
|
+
* @see [Documentation](https://www.remotion.dev/docs/three-canvas)
|
|
11
|
+
*/
|
|
12
|
+
export declare const ThreeCanvas: (props: ThreeCanvasProps) => JSX.Element;
|
|
@@ -16,6 +16,10 @@ const Scale = ({ width, height }) => {
|
|
|
16
16
|
}, [setSize, width, height, set]);
|
|
17
17
|
return null;
|
|
18
18
|
};
|
|
19
|
+
/**
|
|
20
|
+
* @description A wrapper for React Three Fiber's <Canvas /> which synchronizes with Remotions useCurrentFrame().
|
|
21
|
+
* @see [Documentation](https://www.remotion.dev/docs/three-canvas)
|
|
22
|
+
*/
|
|
19
23
|
const ThreeCanvas = (props) => {
|
|
20
24
|
const { children, width, height, style, onCreated, ...rest } = props;
|
|
21
25
|
const [waitForCreated] = (0, react_1.useState)(() => (0, remotion_1.delayRender)('Waiting for <ThreeCanvas/> to be created'));
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { Video } from 'remotion';
|
|
3
|
+
import type { VideoTexture } from 'three/src/textures/VideoTexture';
|
|
4
|
+
export type UseVideoTextureOptions = React.ComponentProps<typeof Video>;
|
|
5
|
+
/**
|
|
6
|
+
* @description Allows you to use a video in React Three Fiber that is synchronized with Remotion's useCurrentFrame().
|
|
7
|
+
* @see [Documentation](https://www.remotion.dev/docs/use-video-texture)
|
|
8
|
+
*/
|
|
9
|
+
export declare const useVideoTexture: (videoRef: React.RefObject<HTMLVideoElement>) => VideoTexture | null;
|
|
@@ -26,7 +26,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
26
26
|
exports.useVideoTexture = void 0;
|
|
27
27
|
const react_1 = __importStar(require("react"));
|
|
28
28
|
const remotion_1 = require("remotion");
|
|
29
|
-
const three_1 = require("three");
|
|
30
29
|
let warned = false;
|
|
31
30
|
const warnAboutRequestVideoFrameCallback = () => {
|
|
32
31
|
if (warned) {
|
|
@@ -35,20 +34,40 @@ const warnAboutRequestVideoFrameCallback = () => {
|
|
|
35
34
|
warned = true;
|
|
36
35
|
console.warn('Browser does not support requestVideoFrameCallback. Cannot display video.');
|
|
37
36
|
};
|
|
37
|
+
/**
|
|
38
|
+
* @description Allows you to use a video in React Three Fiber that is synchronized with Remotion's useCurrentFrame().
|
|
39
|
+
* @see [Documentation](https://www.remotion.dev/docs/use-video-texture)
|
|
40
|
+
*/
|
|
38
41
|
const useVideoTexture = (videoRef) => {
|
|
39
|
-
const [loaded] = (0, react_1.useState)(() =>
|
|
42
|
+
const [loaded] = (0, react_1.useState)(() => {
|
|
43
|
+
if (typeof document === 'undefined') {
|
|
44
|
+
return 0;
|
|
45
|
+
}
|
|
46
|
+
return (0, remotion_1.delayRender)(`Waiting for texture in useVideoTexture() to be loaded`);
|
|
47
|
+
});
|
|
40
48
|
const [videoTexture, setVideoTexture] = (0, react_1.useState)(null);
|
|
49
|
+
const [vidText] = (0, react_1.useState)(() => Promise.resolve().then(() => __importStar(require('three/src/textures/VideoTexture.js'))));
|
|
50
|
+
const [error, setError] = (0, react_1.useState)(null);
|
|
41
51
|
const frame = (0, remotion_1.useCurrentFrame)();
|
|
52
|
+
if (error) {
|
|
53
|
+
throw error;
|
|
54
|
+
}
|
|
42
55
|
const onReady = (0, react_1.useCallback)(() => {
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
56
|
+
vidText
|
|
57
|
+
.then(({ VideoTexture }) => {
|
|
58
|
+
if (!videoRef.current) {
|
|
59
|
+
throw new Error('Video not ready');
|
|
60
|
+
}
|
|
61
|
+
const vt = new VideoTexture(videoRef.current);
|
|
62
|
+
videoRef.current.width = videoRef.current.videoWidth;
|
|
63
|
+
videoRef.current.height = videoRef.current.videoHeight;
|
|
64
|
+
setVideoTexture(vt);
|
|
65
|
+
(0, remotion_1.continueRender)(loaded);
|
|
66
|
+
})
|
|
67
|
+
.catch((err) => {
|
|
68
|
+
setError(err);
|
|
69
|
+
});
|
|
70
|
+
}, [loaded, vidText, videoRef]);
|
|
52
71
|
react_1.default.useEffect(() => {
|
|
53
72
|
if (!videoRef.current) {
|
|
54
73
|
return;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Canvas } from '@react-three/fiber';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
export type ThreeCanvasProps = React.ComponentProps<typeof Canvas> & {
|
|
4
|
+
width: number;
|
|
5
|
+
height: number;
|
|
6
|
+
children: React.ReactNode;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* @description A wrapper for React Three Fiber's <Canvas /> which synchronizes with Remotions useCurrentFrame().
|
|
10
|
+
* @see [Documentation](https://www.remotion.dev/docs/three-canvas)
|
|
11
|
+
*/
|
|
12
|
+
export declare const ThreeCanvas: (props: ThreeCanvasProps) => JSX.Element;
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
|
+
import { Canvas, useThree } from '@react-three/fiber';
|
|
3
|
+
import React, { Suspense, useLayoutEffect, useState, useCallback } from 'react';
|
|
4
|
+
import { delayRender, continueRender, Internals, useCurrentFrame } from 'remotion';
|
|
5
|
+
|
|
6
|
+
const Unblocker = () => {
|
|
7
|
+
if (typeof document !== 'undefined') {
|
|
8
|
+
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
9
|
+
useLayoutEffect(() => {
|
|
10
|
+
const handle = delayRender(`Waiting for <Suspense /> of <ThreeCanvas /> to resolve`);
|
|
11
|
+
return () => {
|
|
12
|
+
continueRender(handle);
|
|
13
|
+
};
|
|
14
|
+
}, []);
|
|
15
|
+
}
|
|
16
|
+
return null;
|
|
17
|
+
};
|
|
18
|
+
const SuspenseLoader = ({ children }) => {
|
|
19
|
+
return jsx(Suspense, { fallback: jsx(Unblocker, {}), children: children });
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
const Scale = ({ width, height }) => {
|
|
23
|
+
const { set, setSize: threeSetSize } = useThree();
|
|
24
|
+
const [setSize] = useState(() => threeSetSize);
|
|
25
|
+
useLayoutEffect(() => {
|
|
26
|
+
setSize(width, height);
|
|
27
|
+
set({ setSize: () => null });
|
|
28
|
+
return () => set({ setSize });
|
|
29
|
+
}, [setSize, width, height, set]);
|
|
30
|
+
return null;
|
|
31
|
+
};
|
|
32
|
+
/**
|
|
33
|
+
* @description A wrapper for React Three Fiber's <Canvas /> which synchronizes with Remotions useCurrentFrame().
|
|
34
|
+
* @see [Documentation](https://www.remotion.dev/docs/three-canvas)
|
|
35
|
+
*/
|
|
36
|
+
const ThreeCanvas = (props) => {
|
|
37
|
+
const { children, width, height, style, onCreated, ...rest } = props;
|
|
38
|
+
const [waitForCreated] = useState(() => delayRender('Waiting for <ThreeCanvas/> to be created'));
|
|
39
|
+
Internals.validateDimension(width, 'width', 'of the <ThreeCanvas /> component');
|
|
40
|
+
Internals.validateDimension(height, 'height', 'of the <ThreeCanvas /> component');
|
|
41
|
+
const contexts = Internals.useRemotionContexts();
|
|
42
|
+
const actualStyle = {
|
|
43
|
+
width: props.width,
|
|
44
|
+
height: props.height,
|
|
45
|
+
...(style !== null && style !== void 0 ? style : {}),
|
|
46
|
+
};
|
|
47
|
+
const remotion_onCreated = useCallback((state) => {
|
|
48
|
+
continueRender(waitForCreated);
|
|
49
|
+
onCreated === null || onCreated === void 0 ? void 0 : onCreated(state);
|
|
50
|
+
}, [onCreated, waitForCreated]);
|
|
51
|
+
return (jsx(SuspenseLoader, { children: jsxs(Canvas, { style: actualStyle, ...rest, onCreated: remotion_onCreated, children: [jsx(Scale, { width: width, height: height }), jsx(Internals.RemotionContextProvider, { contexts: contexts, children: children })] }) }));
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
let warned = false;
|
|
55
|
+
const warnAboutRequestVideoFrameCallback = () => {
|
|
56
|
+
if (warned) {
|
|
57
|
+
return false;
|
|
58
|
+
}
|
|
59
|
+
warned = true;
|
|
60
|
+
console.warn('Browser does not support requestVideoFrameCallback. Cannot display video.');
|
|
61
|
+
};
|
|
62
|
+
/**
|
|
63
|
+
* @description Allows you to use a video in React Three Fiber that is synchronized with Remotion's useCurrentFrame().
|
|
64
|
+
* @see [Documentation](https://www.remotion.dev/docs/use-video-texture)
|
|
65
|
+
*/
|
|
66
|
+
const useVideoTexture = (videoRef) => {
|
|
67
|
+
const [loaded] = useState(() => {
|
|
68
|
+
if (typeof document === 'undefined') {
|
|
69
|
+
return 0;
|
|
70
|
+
}
|
|
71
|
+
return delayRender(`Waiting for texture in useVideoTexture() to be loaded`);
|
|
72
|
+
});
|
|
73
|
+
const [videoTexture, setVideoTexture] = useState(null);
|
|
74
|
+
const [vidText] = useState(() => import('three/src/textures/VideoTexture.js'));
|
|
75
|
+
const [error, setError] = useState(null);
|
|
76
|
+
const frame = useCurrentFrame();
|
|
77
|
+
if (error) {
|
|
78
|
+
throw error;
|
|
79
|
+
}
|
|
80
|
+
const onReady = useCallback(() => {
|
|
81
|
+
vidText
|
|
82
|
+
.then(({ VideoTexture }) => {
|
|
83
|
+
if (!videoRef.current) {
|
|
84
|
+
throw new Error('Video not ready');
|
|
85
|
+
}
|
|
86
|
+
const vt = new VideoTexture(videoRef.current);
|
|
87
|
+
videoRef.current.width = videoRef.current.videoWidth;
|
|
88
|
+
videoRef.current.height = videoRef.current.videoHeight;
|
|
89
|
+
setVideoTexture(vt);
|
|
90
|
+
continueRender(loaded);
|
|
91
|
+
})
|
|
92
|
+
.catch((err) => {
|
|
93
|
+
setError(err);
|
|
94
|
+
});
|
|
95
|
+
}, [loaded, vidText, videoRef]);
|
|
96
|
+
React.useEffect(() => {
|
|
97
|
+
if (!videoRef.current) {
|
|
98
|
+
return;
|
|
99
|
+
}
|
|
100
|
+
if (videoRef.current.readyState >= 2) {
|
|
101
|
+
onReady();
|
|
102
|
+
return;
|
|
103
|
+
}
|
|
104
|
+
videoRef.current.addEventListener('loadeddata', () => {
|
|
105
|
+
onReady();
|
|
106
|
+
}, { once: true });
|
|
107
|
+
}, [loaded, onReady, videoRef]);
|
|
108
|
+
React.useEffect(() => {
|
|
109
|
+
const { current } = videoRef;
|
|
110
|
+
if (!current) {
|
|
111
|
+
return;
|
|
112
|
+
}
|
|
113
|
+
if (!current.requestVideoFrameCallback) {
|
|
114
|
+
warnAboutRequestVideoFrameCallback();
|
|
115
|
+
return;
|
|
116
|
+
}
|
|
117
|
+
const ready = () => {
|
|
118
|
+
// Now force a new render so the latest video frame shows up in the canvas
|
|
119
|
+
// Allow remotion to continue
|
|
120
|
+
};
|
|
121
|
+
current.requestVideoFrameCallback(ready);
|
|
122
|
+
}, [frame, loaded, videoRef]);
|
|
123
|
+
if (typeof HTMLVideoElement === 'undefined' ||
|
|
124
|
+
!HTMLVideoElement.prototype.requestVideoFrameCallback) {
|
|
125
|
+
continueRender(loaded);
|
|
126
|
+
return null;
|
|
127
|
+
}
|
|
128
|
+
return videoTexture;
|
|
129
|
+
};
|
|
130
|
+
|
|
131
|
+
export { ThreeCanvas, useVideoTexture };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { Video } from 'remotion';
|
|
3
|
+
import type { VideoTexture } from 'three/src/textures/VideoTexture';
|
|
4
|
+
export type UseVideoTextureOptions = React.ComponentProps<typeof Video>;
|
|
5
|
+
/**
|
|
6
|
+
* @description Allows you to use a video in React Three Fiber that is synchronized with Remotion's useCurrentFrame().
|
|
7
|
+
* @see [Documentation](https://www.remotion.dev/docs/use-video-texture)
|
|
8
|
+
*/
|
|
9
|
+
export declare const useVideoTexture: (videoRef: React.RefObject<HTMLVideoElement>) => VideoTexture | null;
|
package/package.json
CHANGED
|
@@ -1,59 +1,62 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
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
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
2
|
+
"name": "@remotion/three",
|
|
3
|
+
"version": "4.1.0-alpha2",
|
|
4
|
+
"description": "Utility functions for using react-three-fiber with remotion",
|
|
5
|
+
"main": "dist/cjs/index.js",
|
|
6
|
+
"types": "dist/cjs/index.d.ts",
|
|
7
|
+
"module": "dist/esm/index.mjs",
|
|
8
|
+
"sideEffects": false,
|
|
9
|
+
"author": "Björn Zeutzheim",
|
|
10
|
+
"contributors": [],
|
|
11
|
+
"license": "MIT",
|
|
12
|
+
"repository": {
|
|
13
|
+
"url": "https://github.com/remotion-dev/remotion"
|
|
14
|
+
},
|
|
15
|
+
"bugs": {
|
|
16
|
+
"url": "https://github.com/remotion-dev/remotion/issues"
|
|
17
|
+
},
|
|
18
|
+
"dependencies": {
|
|
19
|
+
"remotion": "4.1.0-alpha2"
|
|
20
|
+
},
|
|
21
|
+
"peerDependencies": {
|
|
22
|
+
"@react-three/fiber": ">=8.0.0",
|
|
23
|
+
"react": ">=16.8.0",
|
|
24
|
+
"react-dom": ">=16.8.0",
|
|
25
|
+
"three": ">=0.137.0"
|
|
26
|
+
},
|
|
27
|
+
"devDependencies": {
|
|
28
|
+
"@jonny/eslint-config": "3.0.266",
|
|
29
|
+
"@react-three/fiber": ">=8.0.0",
|
|
30
|
+
"@rollup/plugin-typescript": "^8.2.0",
|
|
31
|
+
"@types/node": "18.14.6",
|
|
32
|
+
"@types/react": "18.0.26",
|
|
33
|
+
"@types/react-reconciler": "^0.26.4",
|
|
34
|
+
"@types/three": "^0.134.0",
|
|
35
|
+
"@types/web": "0.0.78",
|
|
36
|
+
"eslint": "8.42.0",
|
|
37
|
+
"prettier": "^2.7.1",
|
|
38
|
+
"prettier-plugin-organize-imports": "^2.3.4",
|
|
39
|
+
"react": "18.0.0",
|
|
40
|
+
"react-dom": "18.0.0",
|
|
41
|
+
"rollup": "^2.70.1",
|
|
42
|
+
"three": "^0.145.0",
|
|
43
|
+
"typescript": "4.9.5"
|
|
44
|
+
},
|
|
45
|
+
"keywords": [
|
|
46
|
+
"remotion",
|
|
47
|
+
"ffmpeg",
|
|
48
|
+
"video",
|
|
49
|
+
"react",
|
|
50
|
+
"three",
|
|
51
|
+
"player"
|
|
52
|
+
],
|
|
53
|
+
"publishConfig": {
|
|
54
|
+
"access": "public"
|
|
55
|
+
},
|
|
56
|
+
"scripts": {
|
|
57
|
+
"formatting": "prettier src --check",
|
|
58
|
+
"lint": "eslint src --ext ts,tsx",
|
|
59
|
+
"watch": "tsc -w",
|
|
60
|
+
"build": "rollup --config rollup.config.js && tsc -d"
|
|
61
|
+
}
|
|
62
|
+
}
|
package/rollup.config.js
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
// rollup.config.js
|
|
2
|
+
import typescript from '@rollup/plugin-typescript';
|
|
3
|
+
|
|
4
|
+
export default [
|
|
5
|
+
{
|
|
6
|
+
input: 'src/index.ts',
|
|
7
|
+
output: [
|
|
8
|
+
{
|
|
9
|
+
file: 'dist/esm/index.mjs',
|
|
10
|
+
format: 'es',
|
|
11
|
+
sourcemap: false,
|
|
12
|
+
},
|
|
13
|
+
],
|
|
14
|
+
external: [
|
|
15
|
+
'react',
|
|
16
|
+
'remotion',
|
|
17
|
+
'react/jsx-runtime',
|
|
18
|
+
'@react-three/fiber',
|
|
19
|
+
'three/src/textures/VideoTexture.js',
|
|
20
|
+
],
|
|
21
|
+
plugins: [
|
|
22
|
+
typescript({
|
|
23
|
+
tsconfig: 'tsconfig-esm.json',
|
|
24
|
+
sourceMap: false,
|
|
25
|
+
outputToFilesystem: true,
|
|
26
|
+
}),
|
|
27
|
+
],
|
|
28
|
+
},
|
|
29
|
+
];
|
package/.prettierrc.js
DELETED
package/dist/ThreeCanvas.d.ts
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { Canvas } from '@react-three/fiber';
|
|
2
|
-
import React from 'react';
|
|
3
|
-
export declare type ThreeCanvasProps = React.ComponentProps<typeof Canvas> & {
|
|
4
|
-
width: number;
|
|
5
|
-
height: number;
|
|
6
|
-
children: React.ReactNode;
|
|
7
|
-
};
|
|
8
|
-
export declare const ThreeCanvas: (props: ThreeCanvasProps) => JSX.Element;
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import type { Video } from 'remotion';
|
|
3
|
-
import { VideoTexture } from 'three';
|
|
4
|
-
export declare type UseVideoTextureOptions = React.ComponentProps<typeof Video>;
|
|
5
|
-
export declare const useVideoTexture: (videoRef: React.RefObject<HTMLVideoElement>) => VideoTexture | null;
|