@remotion/motion-blur 4.0.0-prefetch.12 → 4.0.0-retry.8
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 +1 -1
- package/dist/CameraMotionBlur.d.ts +7 -0
- package/dist/CameraMotionBlur.js +37 -0
- package/dist/MotionBlur.d.ts +5 -4
- package/dist/MotionBlur.js +6 -24
- package/dist/Trail.d.ts +8 -0
- package/dist/Trail.js +35 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +5 -1
- package/package.json +5 -5
package/LICENSE.md
CHANGED
|
@@ -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.
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CameraMotionBlur = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const remotion_1 = require("remotion");
|
|
6
|
+
const CameraMotionBlur = ({ children, shutterAngle = 180, samples = 10, }) => {
|
|
7
|
+
const currentFrame = (0, remotion_1.useCurrentFrame)();
|
|
8
|
+
if (typeof samples !== 'number' ||
|
|
9
|
+
Number.isNaN(samples) ||
|
|
10
|
+
!Number.isFinite(samples)) {
|
|
11
|
+
throw new TypeError(`"samples" must be a number, but got ${JSON.stringify(samples)}`);
|
|
12
|
+
}
|
|
13
|
+
if (samples % 1 !== 0) {
|
|
14
|
+
throw new TypeError(`"samples" must be an integer, but got ${JSON.stringify(samples)}`);
|
|
15
|
+
}
|
|
16
|
+
if (samples < 0) {
|
|
17
|
+
throw new TypeError(`"samples" must be non-negative, but got ${JSON.stringify(samples)}`);
|
|
18
|
+
}
|
|
19
|
+
if (typeof shutterAngle !== 'number' ||
|
|
20
|
+
Number.isNaN(shutterAngle) ||
|
|
21
|
+
!Number.isFinite(shutterAngle)) {
|
|
22
|
+
throw new TypeError(`"shutterAngle" must be a number, but got ${JSON.stringify(shutterAngle)}`);
|
|
23
|
+
}
|
|
24
|
+
if (shutterAngle < 0 || shutterAngle > 360) {
|
|
25
|
+
throw new TypeError(`"shutterAngle" must be between 0 and 360, but got ${JSON.stringify(shutterAngle)}`);
|
|
26
|
+
}
|
|
27
|
+
const shutterFraction = shutterAngle / 360;
|
|
28
|
+
return ((0, jsx_runtime_1.jsx)(remotion_1.AbsoluteFill, { style: { isolation: 'isolate' }, children: new Array(samples).fill(true).map((_, i) => {
|
|
29
|
+
const sample = i + 1;
|
|
30
|
+
const sampleFrameOffset = shutterFraction * (sample / samples);
|
|
31
|
+
return ((0, jsx_runtime_1.jsx)(remotion_1.AbsoluteFill, { style: {
|
|
32
|
+
mixBlendMode: 'plus-lighter',
|
|
33
|
+
filter: `opacity(${1 / samples})`,
|
|
34
|
+
}, children: (0, jsx_runtime_1.jsx)(remotion_1.Freeze, { frame: currentFrame - sampleFrameOffset, children: children }) }, `frame-${i.toString()}`));
|
|
35
|
+
}) }));
|
|
36
|
+
};
|
|
37
|
+
exports.CameraMotionBlur = CameraMotionBlur;
|
package/dist/MotionBlur.d.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
layers: number;
|
|
5
|
-
lagInFrames: number;
|
|
2
|
+
import type { TrailProps } from './Trail';
|
|
3
|
+
export declare type MotionBlurProps = Omit<TrailProps, 'trailOpacity'> & {
|
|
6
4
|
blurOpacity: number;
|
|
7
5
|
};
|
|
6
|
+
/**
|
|
7
|
+
* @deprecated The component has been renamed "Trail" instead: https://remotion.dev/docs/motion-blur/trail
|
|
8
|
+
*/
|
|
8
9
|
export declare const MotionBlur: React.FC<MotionBlurProps>;
|
package/dist/MotionBlur.js
CHANGED
|
@@ -2,34 +2,16 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.MotionBlur = void 0;
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
-
const
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
!Number.isFinite(layers)) {
|
|
11
|
-
throw new TypeError(`"layers" must be a number, but got ${JSON.stringify(layers)}`);
|
|
12
|
-
}
|
|
13
|
-
if (layers % 1 !== 0) {
|
|
14
|
-
throw new TypeError(`"layers" must be an integer, but got ${JSON.stringify(layers)}`);
|
|
15
|
-
}
|
|
16
|
-
if (layers < 0) {
|
|
17
|
-
throw new TypeError(`"layers" must be non-negative, but got ${JSON.stringify(layers)}`);
|
|
18
|
-
}
|
|
5
|
+
const Trail_1 = require("./Trail");
|
|
6
|
+
/**
|
|
7
|
+
* @deprecated The component has been renamed "Trail" instead: https://remotion.dev/docs/motion-blur/trail
|
|
8
|
+
*/
|
|
9
|
+
const MotionBlur = ({ blurOpacity, ...rest }) => {
|
|
19
10
|
if (typeof blurOpacity !== 'number' ||
|
|
20
11
|
Number.isNaN(blurOpacity) ||
|
|
21
12
|
!Number.isFinite(blurOpacity)) {
|
|
22
13
|
throw new TypeError(`"blurOpacity" must be a number, but got ${JSON.stringify(blurOpacity)}`);
|
|
23
14
|
}
|
|
24
|
-
|
|
25
|
-
Number.isNaN(lagInFrames) ||
|
|
26
|
-
!Number.isFinite(lagInFrames)) {
|
|
27
|
-
throw new TypeError(`"lagInFrames" must be a number, but got ${JSON.stringify(lagInFrames)}`);
|
|
28
|
-
}
|
|
29
|
-
return ((0, jsx_runtime_1.jsxs)(remotion_1.AbsoluteFill, { children: [new Array(layers).fill(true).map((_, i) => {
|
|
30
|
-
return ((0, jsx_runtime_1.jsx)(remotion_1.AbsoluteFill, { style: {
|
|
31
|
-
opacity: blurOpacity - ((i + 1) / layers) * blurOpacity,
|
|
32
|
-
}, children: (0, jsx_runtime_1.jsx)(remotion_1.Freeze, { frame: frame - lagInFrames * i, children: children }) }, `frame-${i.toString()}`));
|
|
33
|
-
}), children] }));
|
|
15
|
+
return (0, jsx_runtime_1.jsx)(Trail_1.Trail, { ...rest, trailOpacity: blurOpacity });
|
|
34
16
|
};
|
|
35
17
|
exports.MotionBlur = MotionBlur;
|
package/dist/Trail.d.ts
ADDED
package/dist/Trail.js
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Trail = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const remotion_1 = require("remotion");
|
|
6
|
+
const Trail = ({ children, layers, lagInFrames, trailOpacity, }) => {
|
|
7
|
+
const frame = (0, remotion_1.useCurrentFrame)();
|
|
8
|
+
if (typeof layers !== 'number' ||
|
|
9
|
+
Number.isNaN(layers) ||
|
|
10
|
+
!Number.isFinite(layers)) {
|
|
11
|
+
throw new TypeError(`"layers" must be a number, but got ${JSON.stringify(layers)}`);
|
|
12
|
+
}
|
|
13
|
+
if (layers % 1 !== 0) {
|
|
14
|
+
throw new TypeError(`"layers" must be an integer, but got ${JSON.stringify(layers)}`);
|
|
15
|
+
}
|
|
16
|
+
if (layers < 0) {
|
|
17
|
+
throw new TypeError(`"layers" must be non-negative, but got ${JSON.stringify(layers)}`);
|
|
18
|
+
}
|
|
19
|
+
if (typeof trailOpacity !== 'number' ||
|
|
20
|
+
Number.isNaN(trailOpacity) ||
|
|
21
|
+
!Number.isFinite(trailOpacity)) {
|
|
22
|
+
throw new TypeError(`"trailOpacity" must be a number, but got ${JSON.stringify(trailOpacity)}`);
|
|
23
|
+
}
|
|
24
|
+
if (typeof lagInFrames !== 'number' ||
|
|
25
|
+
Number.isNaN(lagInFrames) ||
|
|
26
|
+
!Number.isFinite(lagInFrames)) {
|
|
27
|
+
throw new TypeError(`"lagInFrames" must be a number, but got ${JSON.stringify(lagInFrames)}`);
|
|
28
|
+
}
|
|
29
|
+
return ((0, jsx_runtime_1.jsxs)(remotion_1.AbsoluteFill, { children: [new Array(layers).fill(true).map((_, i) => {
|
|
30
|
+
return ((0, jsx_runtime_1.jsx)(remotion_1.AbsoluteFill, { style: {
|
|
31
|
+
opacity: trailOpacity - ((layers - i) / layers) * trailOpacity,
|
|
32
|
+
}, children: (0, jsx_runtime_1.jsx)(remotion_1.Freeze, { frame: frame - lagInFrames * (layers - i), children: children }) }, `frame-${i.toString()}`));
|
|
33
|
+
}), children] }));
|
|
34
|
+
};
|
|
35
|
+
exports.Trail = Trail;
|
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.MotionBlur = void 0;
|
|
3
|
+
exports.Trail = exports.MotionBlur = exports.CameraMotionBlur = void 0;
|
|
4
|
+
var CameraMotionBlur_1 = require("./CameraMotionBlur");
|
|
5
|
+
Object.defineProperty(exports, "CameraMotionBlur", { enumerable: true, get: function () { return CameraMotionBlur_1.CameraMotionBlur; } });
|
|
4
6
|
var MotionBlur_1 = require("./MotionBlur");
|
|
5
7
|
Object.defineProperty(exports, "MotionBlur", { enumerable: true, get: function () { return MotionBlur_1.MotionBlur; } });
|
|
8
|
+
var Trail_1 = require("./Trail");
|
|
9
|
+
Object.defineProperty(exports, "Trail", { enumerable: true, get: function () { return Trail_1.Trail; } });
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@remotion/motion-blur",
|
|
3
|
-
"version": "4.0.0-
|
|
3
|
+
"version": "4.0.0-retry.8+c5430346e",
|
|
4
4
|
"description": "Motion blur effect for Remotion",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"url": "https://github.com/remotion-dev/remotion/issues"
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"remotion": "4.0.0-
|
|
23
|
+
"remotion": "4.0.0-retry.8+c5430346e"
|
|
24
24
|
},
|
|
25
25
|
"peerDependencies": {
|
|
26
26
|
"react": ">=16.8.0",
|
|
@@ -28,13 +28,13 @@
|
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
30
30
|
"@jonny/eslint-config": "3.0.266",
|
|
31
|
-
"@types/react": "18.0.
|
|
31
|
+
"@types/react": "18.0.23",
|
|
32
32
|
"eslint": "8.25.0",
|
|
33
33
|
"prettier": "^2.7.1",
|
|
34
34
|
"prettier-plugin-organize-imports": "^2.3.4",
|
|
35
35
|
"react": "18.0.0",
|
|
36
36
|
"react-dom": "18.0.0",
|
|
37
|
-
"remotion": "3.2.
|
|
37
|
+
"remotion": "3.2.39",
|
|
38
38
|
"typescript": "^4.7.0"
|
|
39
39
|
},
|
|
40
40
|
"keywords": [
|
|
@@ -45,5 +45,5 @@
|
|
|
45
45
|
"publishConfig": {
|
|
46
46
|
"access": "public"
|
|
47
47
|
},
|
|
48
|
-
"gitHead": "
|
|
48
|
+
"gitHead": "c5430346ee9385f740948246b3d0774913f9ad6c"
|
|
49
49
|
}
|