@remotion/light-leaks 4.0.430 → 4.0.432
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/dist/LightLeak.d.ts +2 -2
- package/dist/esm/index.mjs +46 -10
- package/package.json +4 -4
package/dist/LightLeak.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { type SequenceProps } from 'remotion';
|
|
3
|
-
export type LightLeakProps = Omit<SequenceProps, 'children' | '
|
|
2
|
+
import { type AbsoluteFillLayout, type LayoutAndStyle, type SequenceProps } from 'remotion';
|
|
3
|
+
export type LightLeakProps = Omit<SequenceProps, 'children' | 'durationInFrames' | keyof LayoutAndStyle> & Omit<AbsoluteFillLayout, 'layout'> & {
|
|
4
4
|
readonly durationInFrames?: number;
|
|
5
5
|
readonly seed?: number;
|
|
6
6
|
readonly hueShift?: number;
|
package/dist/esm/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// src/LightLeak.tsx
|
|
2
|
-
import { useCallback, useEffect, useRef, useState } from "react";
|
|
2
|
+
import { useCallback, useEffect, useMemo, useRef, useState } from "react";
|
|
3
3
|
import {
|
|
4
4
|
AbsoluteFill,
|
|
5
5
|
Internals,
|
|
@@ -181,30 +181,59 @@ var LightLeakCanvas = ({ seed, hueShift }) => {
|
|
|
181
181
|
});
|
|
182
182
|
};
|
|
183
183
|
var lightLeakSchema = {
|
|
184
|
-
seed: { type: "number", description: "Seed" },
|
|
184
|
+
seed: { type: "number", default: 0, description: "Seed" },
|
|
185
185
|
hueShift: {
|
|
186
186
|
type: "number",
|
|
187
187
|
min: 0,
|
|
188
188
|
max: 360,
|
|
189
|
+
default: 0,
|
|
189
190
|
description: "Hue Shift"
|
|
190
191
|
},
|
|
191
|
-
|
|
192
|
+
"style.scale": {
|
|
193
|
+
type: "number",
|
|
194
|
+
min: 0.05,
|
|
195
|
+
max: 100,
|
|
196
|
+
step: 0.01,
|
|
197
|
+
default: 1,
|
|
198
|
+
description: "Scale"
|
|
199
|
+
},
|
|
200
|
+
"style.opacity": {
|
|
201
|
+
type: "number",
|
|
202
|
+
min: 0,
|
|
203
|
+
max: 1,
|
|
204
|
+
step: 0.01,
|
|
205
|
+
default: 1,
|
|
206
|
+
description: "Opacity"
|
|
207
|
+
}
|
|
192
208
|
};
|
|
193
209
|
var LightLeak = ({
|
|
194
210
|
seed: seedProp = 0,
|
|
195
211
|
hueShift: hueShiftProp = 0,
|
|
196
212
|
durationInFrames,
|
|
197
213
|
from: fromProp,
|
|
214
|
+
style,
|
|
198
215
|
...sequenceProps
|
|
199
216
|
}) => {
|
|
217
|
+
const opacityProp = style?.opacity;
|
|
218
|
+
const scaleProp = style?.scale;
|
|
219
|
+
const schemaInput = useMemo(() => {
|
|
220
|
+
return {
|
|
221
|
+
seed: seedProp,
|
|
222
|
+
hueShift: hueShiftProp,
|
|
223
|
+
"style.opacity": opacityProp,
|
|
224
|
+
"style.scale": scaleProp
|
|
225
|
+
};
|
|
226
|
+
}, [seedProp, hueShiftProp, opacityProp, scaleProp]);
|
|
200
227
|
const {
|
|
201
228
|
controls,
|
|
202
|
-
values: {
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
229
|
+
values: {
|
|
230
|
+
seed,
|
|
231
|
+
hueShift,
|
|
232
|
+
"style.opacity": opacity,
|
|
233
|
+
"style.scale": scale,
|
|
234
|
+
..._rest
|
|
235
|
+
}
|
|
236
|
+
} = Internals.useSchema(lightLeakSchema, schemaInput);
|
|
208
237
|
const { durationInFrames: videoDuration } = useVideoConfig();
|
|
209
238
|
const resolvedDuration = durationInFrames ?? videoDuration;
|
|
210
239
|
if (typeof seed !== "number" || !Number.isFinite(seed)) {
|
|
@@ -216,12 +245,19 @@ var LightLeak = ({
|
|
|
216
245
|
if (hueShift < 0 || hueShift > 360) {
|
|
217
246
|
throw new RangeError(`"hueShift" must be between 0 and 360, but got ${hueShift}`);
|
|
218
247
|
}
|
|
248
|
+
const mergedStyle = useMemo(() => {
|
|
249
|
+
return {
|
|
250
|
+
...style,
|
|
251
|
+
opacity,
|
|
252
|
+
scale
|
|
253
|
+
};
|
|
254
|
+
}, [style, opacity, scale]);
|
|
219
255
|
return /* @__PURE__ */ jsx(Sequence, {
|
|
220
256
|
durationInFrames: resolvedDuration,
|
|
221
257
|
name: "<LightLeak>",
|
|
222
258
|
controls,
|
|
223
|
-
from,
|
|
224
259
|
...sequenceProps,
|
|
260
|
+
style: mergedStyle,
|
|
225
261
|
children: /* @__PURE__ */ jsx(LightLeakCanvas, {
|
|
226
262
|
seed,
|
|
227
263
|
hueShift
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@remotion/light-leaks",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.432",
|
|
4
4
|
"description": "Light leak effects for Remotion",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"url": "https://github.com/remotion-dev/remotion/issues"
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"remotion": "4.0.
|
|
27
|
+
"remotion": "4.0.432",
|
|
28
28
|
"zod": "4.3.6"
|
|
29
29
|
},
|
|
30
30
|
"peerDependencies": {
|
|
@@ -42,9 +42,9 @@
|
|
|
42
42
|
"devDependencies": {
|
|
43
43
|
"react": "19.2.3",
|
|
44
44
|
"react-dom": "19.2.3",
|
|
45
|
-
"@remotion/eslint-config-internal": "4.0.
|
|
45
|
+
"@remotion/eslint-config-internal": "4.0.432",
|
|
46
46
|
"eslint": "9.19.0",
|
|
47
|
-
"@typescript/native-preview": "7.0.0-dev.
|
|
47
|
+
"@typescript/native-preview": "7.0.0-dev.20260301.1"
|
|
48
48
|
},
|
|
49
49
|
"keywords": [
|
|
50
50
|
"remotion",
|