@remotion/motion-blur 4.0.537 → 4.0.538
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.
|
@@ -45,13 +45,13 @@ const CameraMotionBlur = ({ children, shutterAngle = 180, samples = 10, }) => {
|
|
|
45
45
|
samples,
|
|
46
46
|
shutterFraction,
|
|
47
47
|
});
|
|
48
|
-
return (jsx_runtime_1.jsx(remotion_1.AbsoluteFill, { style: { isolation: 'isolate' }, children: new Array(actualSamples).fill(true).map((_, i) => {
|
|
48
|
+
return ((0, jsx_runtime_1.jsx)(remotion_1.AbsoluteFill, { style: { isolation: 'isolate' }, children: new Array(actualSamples).fill(true).map((_, i) => {
|
|
49
49
|
const sample = i + 1;
|
|
50
50
|
const sampleFrameOffset = shutterFraction * (sample / actualSamples);
|
|
51
|
-
return (jsx_runtime_1.jsx(remotion_1.AbsoluteFill, { style: {
|
|
51
|
+
return ((0, jsx_runtime_1.jsx)(remotion_1.AbsoluteFill, { style: {
|
|
52
52
|
mixBlendMode: 'plus-lighter',
|
|
53
53
|
filter: `opacity(${1 / actualSamples})`,
|
|
54
|
-
}, children: jsx_runtime_1.jsx(remotion_1.Freeze, { frame: currentFrame - sampleFrameOffset + 1, children: children }) }, `frame-${i.toString()}`));
|
|
54
|
+
}, children: (0, jsx_runtime_1.jsx)(remotion_1.Freeze, { frame: currentFrame - sampleFrameOffset + 1, children: children }) }, `frame-${i.toString()}`));
|
|
55
55
|
}) }));
|
|
56
56
|
};
|
|
57
57
|
exports.CameraMotionBlur = CameraMotionBlur;
|
|
@@ -36,16 +36,16 @@ const htmlInCanvasMotionBlurSchema = {
|
|
|
36
36
|
const MotionBlurSample = ({ children, width, height, index, count, shutterInFrames, firstFrame, lastFrame, }) => {
|
|
37
37
|
const frame = (0, remotion_1.useCurrentFrame)();
|
|
38
38
|
const sampleFrame = Math.max(firstFrame, Math.min(lastFrame, frame + ((index + 0.5) / count - 0.5) * shutterInFrames));
|
|
39
|
-
const content = jsx_runtime_1.jsx(remotion_1.Freeze, { frame: sampleFrame, children: children });
|
|
39
|
+
const content = (0, jsx_runtime_1.jsx)(remotion_1.Freeze, { frame: sampleFrame, children: children });
|
|
40
40
|
const isRepresentativeSample = index === Math.floor(count / 2);
|
|
41
|
-
return (jsx_runtime_1.jsx("div", { "aria-hidden": !isRepresentativeSample, ...(index === 0 ? {} : { drawable: '' }), style: {
|
|
41
|
+
return ((0, jsx_runtime_1.jsx)("div", { "aria-hidden": !isRepresentativeSample, ...(index === 0 ? {} : { drawable: '' }), style: {
|
|
42
42
|
position: 'absolute',
|
|
43
43
|
inset: 0,
|
|
44
44
|
width,
|
|
45
45
|
height,
|
|
46
46
|
isolation: 'isolate',
|
|
47
47
|
pointerEvents: isRepresentativeSample ? 'auto' : 'none',
|
|
48
|
-
}, children: isRepresentativeSample ? (content) : (jsx_runtime_1.jsx(remotion_1.Internals.DisableSequenceRegistrationProvider, { children: content })) }));
|
|
48
|
+
}, children: isRepresentativeSample ? (content) : ((0, jsx_runtime_1.jsx)(remotion_1.Internals.DisableSequenceRegistrationProvider, { children: content })) }));
|
|
49
49
|
};
|
|
50
50
|
const HtmlInCanvasMotionBlurInner = ({ children, width, height, shutterAngle = 180, samples = 8, disabled = false, from, durationInFrames, trimBefore, playbackRate, loop, freeze, hidden, name, premountFor, postmountFor, showInTimeline, styleWhilePremounted, styleWhilePostmounted, controls, }) => {
|
|
51
51
|
const { durationInFrames: compositionDurationInFrames } = (0, remotion_1.useVideoConfig)();
|
|
@@ -99,12 +99,13 @@ const HtmlInCanvasMotionBlurInner = ({ children, width, height, shutterAngle = 1
|
|
|
99
99
|
}
|
|
100
100
|
}
|
|
101
101
|
}, [actualSamples]);
|
|
102
|
-
const
|
|
103
|
-
|
|
102
|
+
const passThrough = remotion_1.Internals.useHtmlInCanvasUnsupportedMessage() !== null;
|
|
103
|
+
const sampleElements = Array.from({ length: passThrough ? 0 : actualSamples }, (_, index) => {
|
|
104
|
+
return ((0, jsx_runtime_1.jsx)(MotionBlurSample, { width: width, height: height, index: index, count: actualSamples, shutterInFrames: shutterInFrames, firstFrame: firstFrame, lastFrame: lastFrame, children: children }, index));
|
|
104
105
|
});
|
|
105
106
|
// The root wrapper holds the first sample. The rest must be canvas children.
|
|
106
107
|
// Reuse HtmlInCanvas's Sequence for the motion blur controls.
|
|
107
|
-
return (jsx_runtime_1.jsx(remotion_1.HtmlInCanvas, { width: width, height: height, from: from, durationInFrames: durationInFrames, trimBefore: trimBefore, playbackRate: playbackRate, loop: loop, freeze: freeze, hidden: hidden, name: name !== null && name !== void 0 ? name : '<HtmlInCanvasMotionBlur>', premountFor: premountFor, postmountFor: postmountFor, showInTimeline: showInTimeline, styleWhilePremounted: styleWhilePremounted, styleWhilePostmounted: styleWhilePostmounted, controls, onPaint: onPaint, _remotionInternalCanvasSiblings: sampleElements.slice(1), children: sampleElements[0] }));
|
|
108
|
+
return ((0, jsx_runtime_1.jsx)(remotion_1.HtmlInCanvas, { width: width, height: height, from: from, durationInFrames: durationInFrames, trimBefore: trimBefore, playbackRate: playbackRate, loop: loop, freeze: freeze, hidden: hidden, name: name !== null && name !== void 0 ? name : '<HtmlInCanvasMotionBlur>', premountFor: premountFor, postmountFor: postmountFor, showInTimeline: showInTimeline, styleWhilePremounted: styleWhilePremounted, styleWhilePostmounted: styleWhilePostmounted, controls, onPaint: onPaint, _remotionInternalCanvasSiblings: sampleElements.slice(1), _remotionInternalFallbackLabel: "Motion blur is not visible", children: passThrough ? children : sampleElements[0] }));
|
|
108
109
|
};
|
|
109
110
|
/**
|
|
110
111
|
* Experimental motion blur that averages separately captured HTML-in-canvas
|
package/dist/cjs/Trail.js
CHANGED
|
@@ -30,10 +30,10 @@ const Trail = ({ children, layers, lagInFrames, trailOpacity, }) => {
|
|
|
30
30
|
!Number.isFinite(lagInFrames)) {
|
|
31
31
|
throw new TypeError(`"lagInFrames" must be a number, but got ${JSON.stringify(lagInFrames)}`);
|
|
32
32
|
}
|
|
33
|
-
return (jsx_runtime_1.jsxs(remotion_1.AbsoluteFill, { children: [new Array(layers).fill(true).map((_, i) => {
|
|
34
|
-
return (jsx_runtime_1.jsx(remotion_1.AbsoluteFill, { style: {
|
|
33
|
+
return ((0, jsx_runtime_1.jsxs)(remotion_1.AbsoluteFill, { children: [new Array(layers).fill(true).map((_, i) => {
|
|
34
|
+
return ((0, jsx_runtime_1.jsx)(remotion_1.AbsoluteFill, { style: {
|
|
35
35
|
opacity: trailOpacity - ((layers - i) / layers) * trailOpacity,
|
|
36
|
-
}, children: jsx_runtime_1.jsx(remotion_1.Freeze, { frame: frame - lagInFrames * (layers - i), children: children }) }, `frame-${i.toString()}`));
|
|
36
|
+
}, children: (0, jsx_runtime_1.jsx)(remotion_1.Freeze, { frame: frame - lagInFrames * (layers - i), children: children }) }, `frame-${i.toString()}`));
|
|
37
37
|
}), children] }));
|
|
38
38
|
};
|
|
39
39
|
exports.Trail = Trail;
|
package/dist/cjs/index.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.Trail = exports.HtmlInCanvasMotionBlur = exports.CameraMotionBlur = void 0;
|
|
4
|
-
|
|
4
|
+
var CameraMotionBlur_1 = require("./CameraMotionBlur");
|
|
5
5
|
Object.defineProperty(exports, "CameraMotionBlur", { enumerable: true, get: function () { return CameraMotionBlur_1.CameraMotionBlur; } });
|
|
6
|
-
|
|
6
|
+
var HtmlInCanvasMotionBlur_1 = require("./HtmlInCanvasMotionBlur");
|
|
7
7
|
Object.defineProperty(exports, "HtmlInCanvasMotionBlur", { enumerable: true, get: function () { return HtmlInCanvasMotionBlur_1.HtmlInCanvasMotionBlur; } });
|
|
8
|
-
|
|
8
|
+
var Trail_1 = require("./Trail");
|
|
9
9
|
Object.defineProperty(exports, "Trail", { enumerable: true, get: function () { return Trail_1.Trail; } });
|
package/dist/esm/index.mjs
CHANGED
|
@@ -194,7 +194,8 @@ var HtmlInCanvasMotionBlurInner = ({
|
|
|
194
194
|
}
|
|
195
195
|
}
|
|
196
196
|
}, [actualSamples]);
|
|
197
|
-
const
|
|
197
|
+
const passThrough = Internals.useHtmlInCanvasUnsupportedMessage() !== null;
|
|
198
|
+
const sampleElements = Array.from({ length: passThrough ? 0 : actualSamples }, (_, index) => {
|
|
198
199
|
return /* @__PURE__ */ jsx2(MotionBlurSample, {
|
|
199
200
|
width,
|
|
200
201
|
height,
|
|
@@ -225,7 +226,8 @@ var HtmlInCanvasMotionBlurInner = ({
|
|
|
225
226
|
...{ controls },
|
|
226
227
|
onPaint,
|
|
227
228
|
_remotionInternalCanvasSiblings: sampleElements.slice(1),
|
|
228
|
-
|
|
229
|
+
_remotionInternalFallbackLabel: "Motion blur is not visible",
|
|
230
|
+
children: passThrough ? children : sampleElements[0]
|
|
229
231
|
});
|
|
230
232
|
};
|
|
231
233
|
var HtmlInCanvasMotionBlur = Interactive.withSchema({
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"url": "https://github.com/remotion-dev/remotion/tree/main/packages/motion-blur"
|
|
4
4
|
},
|
|
5
5
|
"name": "@remotion/motion-blur",
|
|
6
|
-
"version": "4.0.
|
|
6
|
+
"version": "4.0.538",
|
|
7
7
|
"description": "Motion blur effect for Remotion",
|
|
8
8
|
"main": "dist/cjs/index.js",
|
|
9
9
|
"types": "dist/cjs/index.d.ts",
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
"formatting": "oxfmt src --check",
|
|
13
13
|
"format": "oxfmt src",
|
|
14
14
|
"lint": "eslint src",
|
|
15
|
-
"make": "
|
|
15
|
+
"make": "tsc -d && bun --env-file=../.env.bundle bundle.ts"
|
|
16
16
|
},
|
|
17
17
|
"author": "Matt McGillivray, Ilija Boshkov <ilija@codechem.com>, Jonny Burger <jonny@remotion.dev>",
|
|
18
18
|
"contributors": [],
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
"url": "https://github.com/remotion-dev/remotion/issues"
|
|
22
22
|
},
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"remotion": "4.0.
|
|
24
|
+
"remotion": "4.0.538"
|
|
25
25
|
},
|
|
26
26
|
"peerDependencies": {
|
|
27
27
|
"react": ">=16.8.0",
|
|
@@ -39,10 +39,10 @@
|
|
|
39
39
|
"devDependencies": {
|
|
40
40
|
"react": "19.2.3",
|
|
41
41
|
"react-dom": "19.2.3",
|
|
42
|
-
"remotion": "4.0.
|
|
43
|
-
"@remotion/eslint-config-internal": "4.0.
|
|
42
|
+
"remotion": "4.0.538",
|
|
43
|
+
"@remotion/eslint-config-internal": "4.0.538",
|
|
44
44
|
"eslint": "9.19.0",
|
|
45
|
-
"
|
|
45
|
+
"typescript": "7.1.0-beta"
|
|
46
46
|
},
|
|
47
47
|
"keywords": [
|
|
48
48
|
"remotion",
|