@remotion/gif 4.0.432 → 4.0.433

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.d.ts CHANGED
@@ -1,2 +1,12 @@
1
+ import React from 'react';
2
+ import { type SequenceControls, type SequenceProps } from 'remotion';
1
3
  import type { RemotionGifProps } from './props';
2
- export declare const Gif: import("react").ForwardRefExoticComponent<RemotionGifProps & import("react").RefAttributes<HTMLCanvasElement>>;
4
+ export type GifProps = Omit<SequenceProps, 'children' | 'durationInFrames' | 'layout'> & RemotionGifProps & {
5
+ readonly durationInFrames?: number;
6
+ };
7
+ export declare const Gif: React.ComponentType<Omit<SequenceProps, "children" | "durationInFrames" | "layout"> & RemotionGifProps & {
8
+ readonly durationInFrames?: number | undefined;
9
+ } & {
10
+ readonly controls?: SequenceControls | undefined;
11
+ readonly ref?: React.Ref<HTMLCanvasElement> | undefined;
12
+ }>;
package/dist/cjs/Gif.js CHANGED
@@ -2,7 +2,6 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.Gif = void 0;
4
4
  const jsx_runtime_1 = require("react/jsx-runtime");
5
- const react_1 = require("react");
6
5
  const remotion_1 = require("remotion");
7
6
  const GifForDevelopment_1 = require("./GifForDevelopment");
8
7
  const GifForRendering_1 = require("./GifForRendering");
@@ -10,10 +9,64 @@ const GifForRendering_1 = require("./GifForRendering");
10
9
  * @description Displays a GIF that synchronizes with Remotions useCurrentFrame().
11
10
  * @see [Documentation](https://remotion.dev/docs/gif)
12
11
  */
13
- exports.Gif = (0, react_1.forwardRef)((props, ref) => {
12
+ const gifSchema = {
13
+ playbackRate: {
14
+ type: 'number',
15
+ min: 0,
16
+ max: 10,
17
+ step: 0.1,
18
+ default: 1,
19
+ description: 'Playback Rate',
20
+ },
21
+ 'style.translate': {
22
+ type: 'translate',
23
+ step: 1,
24
+ default: '0px 0px',
25
+ description: 'Position',
26
+ },
27
+ 'style.scale': {
28
+ type: 'number',
29
+ min: 0.05,
30
+ max: 100,
31
+ step: 0.01,
32
+ default: 1,
33
+ description: 'Scale',
34
+ },
35
+ 'style.rotate': {
36
+ type: 'rotation',
37
+ step: 1,
38
+ default: '0deg',
39
+ description: 'Rotation',
40
+ },
41
+ 'style.opacity': {
42
+ type: 'number',
43
+ min: 0,
44
+ max: 1,
45
+ step: 0.01,
46
+ default: 1,
47
+ description: 'Opacity',
48
+ },
49
+ };
50
+ const GifInner = ({ src, width, height, onLoad, onError, fit, playbackRate, loopBehavior, id, delayRenderTimeoutInMilliseconds, durationInFrames, style, controls, ref, ...sequenceProps }) => {
14
51
  const env = (0, remotion_1.useRemotionEnvironment)();
15
- if (env.isRendering) {
16
- return jsx_runtime_1.jsx(GifForRendering_1.GifForRendering, { ...props, ref: ref });
17
- }
18
- return jsx_runtime_1.jsx(GifForDevelopment_1.GifForDevelopment, { ...props, ref: ref });
19
- });
52
+ const { durationInFrames: videoDuration } = (0, remotion_1.useVideoConfig)();
53
+ const resolvedDuration = durationInFrames !== null && durationInFrames !== void 0 ? durationInFrames : videoDuration;
54
+ const gifProps = {
55
+ src,
56
+ width,
57
+ height,
58
+ onLoad,
59
+ onError,
60
+ fit,
61
+ playbackRate,
62
+ loopBehavior,
63
+ id,
64
+ delayRenderTimeoutInMilliseconds,
65
+ style,
66
+ };
67
+ const inner = env.isRendering ? (jsx_runtime_1.jsx(GifForRendering_1.GifForRendering, { ...gifProps, ref: ref })) : (jsx_runtime_1.jsx(GifForDevelopment_1.GifForDevelopment, { ...gifProps, ref: ref }));
68
+ return (jsx_runtime_1.jsx(remotion_1.Sequence, { layout: "none", durationInFrames: resolvedDuration, name: "<Gif>", controls: controls, ...sequenceProps, children: inner }));
69
+ };
70
+ exports.Gif = remotion_1.Internals.wrapInSchema(GifInner, gifSchema);
71
+ exports.Gif.displayName = 'Gif';
72
+ remotion_1.Internals.addSequenceStackTraces(exports.Gif);
@@ -1,4 +1,4 @@
1
1
  export { getGifDurationInSeconds } from './get-gif-duration-in-seconds';
2
- export { Gif } from './Gif';
2
+ export { Gif, type GifProps } from './Gif';
3
3
  export { preloadGif } from './preload-gif';
4
4
  export { GifFillMode, RemotionGifProps } from './props';
@@ -819,8 +819,12 @@ var getGifDurationInSeconds = async (src2) => {
819
819
  return calcDuration(parsed);
820
820
  };
821
821
  // src/Gif.tsx
822
- import { forwardRef as forwardRef4 } from "react";
823
- import { useRemotionEnvironment } from "remotion";
822
+ import {
823
+ Internals as Internals2,
824
+ Sequence,
825
+ useRemotionEnvironment,
826
+ useVideoConfig as useVideoConfig2
827
+ } from "remotion";
824
828
 
825
829
  // src/GifForDevelopment.tsx
826
830
  import { forwardRef as forwardRef2, useEffect as useEffect3, useRef as useRef2, useState as useState3 } from "react";
@@ -1237,19 +1241,96 @@ var GifForRendering = forwardRef3(({
1237
1241
 
1238
1242
  // src/Gif.tsx
1239
1243
  import { jsx as jsx4 } from "react/jsx-runtime";
1240
- var Gif = forwardRef4((props, ref) => {
1241
- const env = useRemotionEnvironment();
1242
- if (env.isRendering) {
1243
- return /* @__PURE__ */ jsx4(GifForRendering, {
1244
- ...props,
1245
- ref
1246
- });
1244
+ var gifSchema = {
1245
+ playbackRate: {
1246
+ type: "number",
1247
+ min: 0,
1248
+ max: 10,
1249
+ step: 0.1,
1250
+ default: 1,
1251
+ description: "Playback Rate"
1252
+ },
1253
+ "style.translate": {
1254
+ type: "translate",
1255
+ step: 1,
1256
+ default: "0px 0px",
1257
+ description: "Position"
1258
+ },
1259
+ "style.scale": {
1260
+ type: "number",
1261
+ min: 0.05,
1262
+ max: 100,
1263
+ step: 0.01,
1264
+ default: 1,
1265
+ description: "Scale"
1266
+ },
1267
+ "style.rotate": {
1268
+ type: "rotation",
1269
+ step: 1,
1270
+ default: "0deg",
1271
+ description: "Rotation"
1272
+ },
1273
+ "style.opacity": {
1274
+ type: "number",
1275
+ min: 0,
1276
+ max: 1,
1277
+ step: 0.01,
1278
+ default: 1,
1279
+ description: "Opacity"
1247
1280
  }
1248
- return /* @__PURE__ */ jsx4(GifForDevelopment, {
1249
- ...props,
1281
+ };
1282
+ var GifInner = ({
1283
+ src: src2,
1284
+ width,
1285
+ height,
1286
+ onLoad,
1287
+ onError,
1288
+ fit,
1289
+ playbackRate,
1290
+ loopBehavior,
1291
+ id,
1292
+ delayRenderTimeoutInMilliseconds,
1293
+ durationInFrames,
1294
+ style,
1295
+ controls,
1296
+ ref,
1297
+ ...sequenceProps
1298
+ }) => {
1299
+ const env = useRemotionEnvironment();
1300
+ const { durationInFrames: videoDuration } = useVideoConfig2();
1301
+ const resolvedDuration = durationInFrames ?? videoDuration;
1302
+ const gifProps = {
1303
+ src: src2,
1304
+ width,
1305
+ height,
1306
+ onLoad,
1307
+ onError,
1308
+ fit,
1309
+ playbackRate,
1310
+ loopBehavior,
1311
+ id,
1312
+ delayRenderTimeoutInMilliseconds,
1313
+ style
1314
+ };
1315
+ const inner = env.isRendering ? /* @__PURE__ */ jsx4(GifForRendering, {
1316
+ ...gifProps,
1317
+ ref
1318
+ }) : /* @__PURE__ */ jsx4(GifForDevelopment, {
1319
+ ...gifProps,
1250
1320
  ref
1251
1321
  });
1252
- });
1322
+ return /* @__PURE__ */ jsx4(Sequence, {
1323
+ layout: "none",
1324
+ durationInFrames: resolvedDuration,
1325
+ name: "<Gif>",
1326
+ controls,
1327
+ ...sequenceProps,
1328
+ children: inner
1329
+ });
1330
+ };
1331
+ var Gif = Internals2.wrapInSchema(GifInner, gifSchema);
1332
+ Gif.displayName = "Gif";
1333
+ Internals2.addSequenceStackTraces(Gif);
1253
1334
  // src/preload-gif.ts
1254
1335
  var preloadGif = (src2) => {
1255
1336
  const resolvedSrc = resolveGifSource(src2);
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.432",
6
+ "version": "4.0.433",
7
7
  "description": "Embed GIFs in a Remotion video",
8
8
  "sideEffects": false,
9
9
  "bugs": {
@@ -30,16 +30,16 @@
30
30
  }
31
31
  },
32
32
  "dependencies": {
33
- "remotion": "4.0.432"
33
+ "remotion": "4.0.433"
34
34
  },
35
35
  "devDependencies": {
36
36
  "esbuild": "0.25.0",
37
37
  "react": "19.2.3",
38
38
  "react-dom": "19.2.3",
39
39
  "webpack": "5.105.0",
40
- "@remotion/eslint-config-internal": "4.0.432",
40
+ "@remotion/eslint-config-internal": "4.0.433",
41
41
  "eslint": "9.19.0",
42
- "@typescript/native-preview": "7.0.0-dev.20260301.1"
42
+ "@typescript/native-preview": "7.0.0-dev.20260217.1"
43
43
  },
44
44
  "peerDependencies": {
45
45
  "react": ">=16.8.0",