@remotion/gif 4.0.535 → 4.0.537
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/cjs/Gif.js +2 -1
- package/dist/cjs/GifForDevelopment.js +2 -2
- package/dist/cjs/GifForRendering.js +2 -2
- package/dist/cjs/canvas.d.ts +2 -1
- package/dist/cjs/canvas.js +2 -2
- package/dist/cjs/props.d.ts +2 -0
- package/dist/esm/index.mjs +19 -3
- package/package.json +3 -3
package/dist/cjs/Gif.js
CHANGED
|
@@ -30,7 +30,7 @@ exports.gifSchema = {
|
|
|
30
30
|
...remotion_1.Interactive.borderRadiusSchema,
|
|
31
31
|
...remotion_1.Interactive.cropSchema,
|
|
32
32
|
};
|
|
33
|
-
const GifInner = ({ src, width, height, onLoad, onError, fit, playbackRate, loopBehavior, id, delayRenderTimeoutInMilliseconds, requestInit, durationInFrames, from, premountFor, postmountFor, styleWhilePremounted, styleWhilePostmounted, style, cropLeft, cropRight, cropTop, cropBottom, controls, effects = [], ref, ...sequenceProps }) => {
|
|
33
|
+
const GifInner = ({ src, width, height, onLoad, onError, fit, playbackRate, loopBehavior, id, delayRenderTimeoutInMilliseconds, requestInit, durationInFrames, from, premountFor, postmountFor, styleWhilePremounted, styleWhilePostmounted, style, cropLeft, cropRight, cropTop, cropBottom, controls, effects = [], effectsOutputSize, ref, ...sequenceProps }) => {
|
|
34
34
|
var _a, _b;
|
|
35
35
|
const env = (0, remotion_1.useRemotionEnvironment)();
|
|
36
36
|
const { effectivePostmountFor, effectivePremountFor, freezeFrame, isPremountingOrPostmounting, postmountingActive, premountingActive, premountingStyle, } = remotion_1.Internals.usePremounting({
|
|
@@ -74,6 +74,7 @@ const GifInner = ({ src, width, height, onLoad, onError, fit, playbackRate, loop
|
|
|
74
74
|
requestInit,
|
|
75
75
|
style: croppedStyle !== null && croppedStyle !== void 0 ? croppedStyle : undefined,
|
|
76
76
|
effects: memoizedEffects,
|
|
77
|
+
effectsOutputSize,
|
|
77
78
|
};
|
|
78
79
|
const inner = env.isRendering ? (jsx_runtime_1.jsx(GifForRendering_1.GifForRendering, { ...gifProps, ref: ref })) : (jsx_runtime_1.jsx(GifForDevelopment_1.GifForDevelopment, { ...gifProps, ref: ref }));
|
|
79
80
|
return (jsx_runtime_1.jsx(remotion_1.Freeze, { frame: freezeFrame, active: isPremountingOrPostmounting, children: jsx_runtime_1.jsx(remotion_1.Sequence, { layout: "none", from: from !== null && from !== void 0 ? from : 0, playbackRate: playbackRate, durationInFrames: durationInFrames, name: "<Gif>", _remotionInternalDocumentationLink: "https://www.remotion.dev/docs/gif/gif", controls: controls, _remotionInternalEffects: memoizedEffectDefinitions, _remotionInternalPremountDisplay: effectivePremountFor || null, _remotionInternalPostmountDisplay: effectivePostmountFor || null, _remotionInternalIsPremounting: premountingActive, _remotionInternalIsPostmounting: postmountingActive, ...sequenceProps, children: inner }) }));
|
|
@@ -11,7 +11,7 @@ const react_tools_1 = require("./react-tools");
|
|
|
11
11
|
const request_init_1 = require("./request-init");
|
|
12
12
|
const resolve_gif_source_1 = require("./resolve-gif-source");
|
|
13
13
|
const useCurrentGifIndex_1 = require("./useCurrentGifIndex");
|
|
14
|
-
exports.GifForDevelopment = (0, react_1.forwardRef)(({ src, width, height, onError, loopBehavior = 'loop', playbackRate = 1, onLoad, fit = 'fill', requestInit, effects, ...props }, ref) => {
|
|
14
|
+
exports.GifForDevelopment = (0, react_1.forwardRef)(({ src, width, height, onError, loopBehavior = 'loop', playbackRate = 1, onLoad, fit = 'fill', requestInit, effects, effectsOutputSize = null, ...props }, ref) => {
|
|
15
15
|
const resolvedSrc = (0, resolve_gif_source_1.resolveGifSource)(src);
|
|
16
16
|
const requestInitRef = (0, react_1.useRef)(requestInit);
|
|
17
17
|
requestInitRef.current = requestInit;
|
|
@@ -91,5 +91,5 @@ exports.GifForDevelopment = (0, react_1.forwardRef)(({ src, width, height, onErr
|
|
|
91
91
|
if (index === -1) {
|
|
92
92
|
return null;
|
|
93
93
|
}
|
|
94
|
-
return (jsx_runtime_1.jsx(canvas_1.Canvas, { fit: fit, index: index, frames: state.frames, width: width, height: height, effects: effects, ...props, ref: ref }));
|
|
94
|
+
return (jsx_runtime_1.jsx(canvas_1.Canvas, { fit: fit, index: index, frames: state.frames, width: width, height: height, effects: effects, effectsOutputSize: effectsOutputSize, ...props, ref: ref }));
|
|
95
95
|
});
|
|
@@ -11,7 +11,7 @@ const react_tools_1 = require("./react-tools");
|
|
|
11
11
|
const request_init_1 = require("./request-init");
|
|
12
12
|
const resolve_gif_source_1 = require("./resolve-gif-source");
|
|
13
13
|
const useCurrentGifIndex_1 = require("./useCurrentGifIndex");
|
|
14
|
-
exports.GifForRendering = (0, react_1.forwardRef)(({ src, width, height, onLoad, onError, loopBehavior = 'loop', playbackRate = 1, fit = 'fill', delayRenderTimeoutInMilliseconds, requestInit, effects, ...props }, ref) => {
|
|
14
|
+
exports.GifForRendering = (0, react_1.forwardRef)(({ src, width, height, onLoad, onError, loopBehavior = 'loop', playbackRate = 1, fit = 'fill', delayRenderTimeoutInMilliseconds, requestInit, effects, effectsOutputSize = null, ...props }, ref) => {
|
|
15
15
|
const resolvedSrc = (0, resolve_gif_source_1.resolveGifSource)(src);
|
|
16
16
|
const requestInitRef = (0, react_1.useRef)(requestInit);
|
|
17
17
|
requestInitRef.current = requestInit;
|
|
@@ -109,5 +109,5 @@ exports.GifForRendering = (0, react_1.forwardRef)(({ src, width, height, onLoad,
|
|
|
109
109
|
if (index === -1) {
|
|
110
110
|
return null;
|
|
111
111
|
}
|
|
112
|
-
return (jsx_runtime_1.jsx(canvas_1.Canvas, { fit: fit, index: index, frames: state.frames, width: width, height: height, effects: effects, ...props, ref: ref }));
|
|
112
|
+
return (jsx_runtime_1.jsx(canvas_1.Canvas, { fit: fit, index: index, frames: state.frames, width: width, height: height, effects: effects, effectsOutputSize: effectsOutputSize, ...props, ref: ref }));
|
|
113
113
|
});
|
package/dist/cjs/canvas.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { EffectDefinitionAndStack } from 'remotion';
|
|
1
|
+
import type { EffectDefinitionAndStack, EffectsOutputSize } from 'remotion';
|
|
2
2
|
import type { GifFillMode } from './props';
|
|
3
3
|
type Props = {
|
|
4
4
|
readonly index: number;
|
|
@@ -9,6 +9,7 @@ type Props = {
|
|
|
9
9
|
readonly className?: string;
|
|
10
10
|
readonly style?: React.CSSProperties;
|
|
11
11
|
readonly effects: EffectDefinitionAndStack<unknown>[];
|
|
12
|
+
readonly effectsOutputSize: EffectsOutputSize | null;
|
|
12
13
|
};
|
|
13
14
|
export declare const Canvas: import("react").ForwardRefExoticComponent<Props & import("react").RefAttributes<unknown>>;
|
|
14
15
|
export {};
|
package/dist/cjs/canvas.js
CHANGED
|
@@ -65,7 +65,7 @@ const makeCanvas = () => {
|
|
|
65
65
|
canvas.height = 0;
|
|
66
66
|
return ctx;
|
|
67
67
|
};
|
|
68
|
-
exports.Canvas = (0, react_1.forwardRef)(({ index, frames, width, height, fit, className, style, effects }, ref) => {
|
|
68
|
+
exports.Canvas = (0, react_1.forwardRef)(({ index, frames, width, height, fit, className, style, effects, effectsOutputSize, }, ref) => {
|
|
69
69
|
const canvasRef = (0, react_1.useRef)(null);
|
|
70
70
|
const [tempCtx] = (0, react_1.useState)(() => {
|
|
71
71
|
return makeCanvas();
|
|
@@ -82,7 +82,7 @@ exports.Canvas = (0, react_1.forwardRef)(({ index, frames, width, height, fit, c
|
|
|
82
82
|
}
|
|
83
83
|
return document.createElement('canvas');
|
|
84
84
|
}, []);
|
|
85
|
-
const chainState = useEffectChainState();
|
|
85
|
+
const chainState = useEffectChainState(effectsOutputSize);
|
|
86
86
|
const { delayRender, continueRender, cancelRender } = (0, remotion_1.useDelayRender)();
|
|
87
87
|
const size = (0, use_element_size_1.useElementSize)(canvasRef);
|
|
88
88
|
(0, react_1.useImperativeHandle)(ref, () => {
|
package/dist/cjs/props.d.ts
CHANGED
package/dist/esm/index.mjs
CHANGED
|
@@ -1027,7 +1027,17 @@ var makeCanvas = () => {
|
|
|
1027
1027
|
canvas.height = 0;
|
|
1028
1028
|
return ctx;
|
|
1029
1029
|
};
|
|
1030
|
-
var Canvas = forwardRef(({
|
|
1030
|
+
var Canvas = forwardRef(({
|
|
1031
|
+
index,
|
|
1032
|
+
frames,
|
|
1033
|
+
width,
|
|
1034
|
+
height,
|
|
1035
|
+
fit,
|
|
1036
|
+
className,
|
|
1037
|
+
style,
|
|
1038
|
+
effects,
|
|
1039
|
+
effectsOutputSize
|
|
1040
|
+
}, ref) => {
|
|
1031
1041
|
const canvasRef = useRef(null);
|
|
1032
1042
|
const [tempCtx] = useState2(() => {
|
|
1033
1043
|
return makeCanvas();
|
|
@@ -1044,7 +1054,7 @@ var Canvas = forwardRef(({ index, frames, width, height, fit, className, style,
|
|
|
1044
1054
|
}
|
|
1045
1055
|
return document.createElement("canvas");
|
|
1046
1056
|
}, []);
|
|
1047
|
-
const chainState = useEffectChainState();
|
|
1057
|
+
const chainState = useEffectChainState(effectsOutputSize);
|
|
1048
1058
|
const { delayRender, continueRender, cancelRender } = useDelayRender();
|
|
1049
1059
|
const size = useElementSize(canvasRef);
|
|
1050
1060
|
useImperativeHandle(ref, () => {
|
|
@@ -1215,6 +1225,7 @@ var GifForDevelopment = forwardRef2(({
|
|
|
1215
1225
|
fit = "fill",
|
|
1216
1226
|
requestInit,
|
|
1217
1227
|
effects,
|
|
1228
|
+
effectsOutputSize = null,
|
|
1218
1229
|
...props
|
|
1219
1230
|
}, ref) => {
|
|
1220
1231
|
const resolvedSrc = resolveGifSource(src);
|
|
@@ -1296,6 +1307,7 @@ var GifForDevelopment = forwardRef2(({
|
|
|
1296
1307
|
width,
|
|
1297
1308
|
height,
|
|
1298
1309
|
effects,
|
|
1310
|
+
effectsOutputSize,
|
|
1299
1311
|
...props,
|
|
1300
1312
|
ref
|
|
1301
1313
|
});
|
|
@@ -1317,6 +1329,7 @@ var GifForRendering = forwardRef3(({
|
|
|
1317
1329
|
delayRenderTimeoutInMilliseconds,
|
|
1318
1330
|
requestInit,
|
|
1319
1331
|
effects,
|
|
1332
|
+
effectsOutputSize = null,
|
|
1320
1333
|
...props
|
|
1321
1334
|
}, ref) => {
|
|
1322
1335
|
const resolvedSrc = resolveGifSource(src);
|
|
@@ -1419,6 +1432,7 @@ var GifForRendering = forwardRef3(({
|
|
|
1419
1432
|
width,
|
|
1420
1433
|
height,
|
|
1421
1434
|
effects,
|
|
1435
|
+
effectsOutputSize,
|
|
1422
1436
|
...props,
|
|
1423
1437
|
ref
|
|
1424
1438
|
});
|
|
@@ -1468,6 +1482,7 @@ var GifInner = ({
|
|
|
1468
1482
|
cropBottom,
|
|
1469
1483
|
controls,
|
|
1470
1484
|
effects = [],
|
|
1485
|
+
effectsOutputSize,
|
|
1471
1486
|
ref,
|
|
1472
1487
|
...sequenceProps
|
|
1473
1488
|
}) => {
|
|
@@ -1520,7 +1535,8 @@ var GifInner = ({
|
|
|
1520
1535
|
delayRenderTimeoutInMilliseconds,
|
|
1521
1536
|
requestInit,
|
|
1522
1537
|
style: croppedStyle ?? undefined,
|
|
1523
|
-
effects: memoizedEffects
|
|
1538
|
+
effects: memoizedEffects,
|
|
1539
|
+
effectsOutputSize
|
|
1524
1540
|
};
|
|
1525
1541
|
const inner = env.isRendering ? /* @__PURE__ */ jsx4(GifForRendering, {
|
|
1526
1542
|
...gifProps,
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"url": "https://github.com/remotion-dev/remotion/tree/main/packages/gif"
|
|
4
4
|
},
|
|
5
5
|
"name": "@remotion/gif",
|
|
6
|
-
"version": "4.0.
|
|
6
|
+
"version": "4.0.537",
|
|
7
7
|
"description": "Embed GIFs in a Remotion video",
|
|
8
8
|
"bugs": {
|
|
9
9
|
"url": "https://github.com/remotion-dev/remotion/issues"
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
}
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"remotion": "4.0.
|
|
33
|
+
"remotion": "4.0.537"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
36
36
|
"@testing-library/react": "16.1.0",
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"react": "19.2.3",
|
|
39
39
|
"react-dom": "19.2.3",
|
|
40
40
|
"webpack": "5.105.0",
|
|
41
|
-
"@remotion/eslint-config-internal": "4.0.
|
|
41
|
+
"@remotion/eslint-config-internal": "4.0.537",
|
|
42
42
|
"eslint": "9.19.0",
|
|
43
43
|
"@typescript/native-preview": "7.0.0-dev.20260217.1"
|
|
44
44
|
},
|