@remotion/gif 4.0.495 → 4.0.497
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 +4 -3
- package/dist/cjs/Gif.js +19 -6
- package/dist/esm/index.mjs +48 -12
- package/package.json +3 -3
package/dist/cjs/Gif.d.ts
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { type EffectsProp, type InteractiveBaseProps, type InteractiveTransformProps, type SequenceControls } from 'remotion';
|
|
2
|
+
import { type EffectsProp, type InteractiveBaseProps, type InteractivePremountProps, type InteractiveTransformProps, type SequenceControls, type InteractivitySchema } from 'remotion';
|
|
3
3
|
import type { RemotionGifProps } from './props';
|
|
4
|
-
export type GifProps = InteractiveBaseProps & InteractiveTransformProps & RemotionGifProps & {
|
|
4
|
+
export type GifProps = InteractiveBaseProps & InteractivePremountProps & InteractiveTransformProps & RemotionGifProps & {
|
|
5
5
|
readonly effects?: EffectsProp;
|
|
6
6
|
};
|
|
7
|
-
export declare const
|
|
7
|
+
export declare const gifSchema: InteractivitySchema;
|
|
8
|
+
export declare const Gif: React.ComponentType<InteractiveBaseProps & InteractivePremountProps & InteractiveTransformProps & RemotionGifProps & {
|
|
8
9
|
readonly effects?: EffectsProp | undefined;
|
|
9
10
|
} & {
|
|
10
11
|
readonly controls?: SequenceControls | undefined;
|
package/dist/cjs/Gif.js
CHANGED
|
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.Gif = void 0;
|
|
6
|
+
exports.Gif = exports.gifSchema = void 0;
|
|
7
7
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
8
|
const react_1 = __importDefault(require("react"));
|
|
9
9
|
const remotion_1 = require("remotion");
|
|
@@ -14,8 +14,9 @@ const { useMemoizedEffectDefinitions, useMemoizedEffects } = remotion_1.Internal
|
|
|
14
14
|
* @description Displays a GIF that synchronizes with Remotions useCurrentFrame().
|
|
15
15
|
* @see [Documentation](https://remotion.dev/docs/gif)
|
|
16
16
|
*/
|
|
17
|
-
|
|
17
|
+
exports.gifSchema = {
|
|
18
18
|
...remotion_1.Internals.baseSchema,
|
|
19
|
+
...remotion_1.Internals.premountSchema,
|
|
19
20
|
playbackRate: {
|
|
20
21
|
type: 'number',
|
|
21
22
|
min: 0,
|
|
@@ -27,11 +28,23 @@ const gifSchema = {
|
|
|
27
28
|
keyframable: false,
|
|
28
29
|
},
|
|
29
30
|
...remotion_1.Internals.transformSchema,
|
|
31
|
+
...remotion_1.Interactive.backgroundSchema,
|
|
32
|
+
...remotion_1.Interactive.borderSchema,
|
|
30
33
|
};
|
|
31
|
-
const GifInner = ({ src, width, height, onLoad, onError, fit, playbackRate, loopBehavior, id, delayRenderTimeoutInMilliseconds, requestInit, durationInFrames, style, controls, effects = [], ref, ...sequenceProps }) => {
|
|
34
|
+
const GifInner = ({ src, width, height, onLoad, onError, fit, playbackRate, loopBehavior, id, delayRenderTimeoutInMilliseconds, requestInit, durationInFrames, from, premountFor, postmountFor, styleWhilePremounted, styleWhilePostmounted, style, controls, effects = [], ref, ...sequenceProps }) => {
|
|
32
35
|
var _a;
|
|
33
36
|
const env = (0, remotion_1.useRemotionEnvironment)();
|
|
34
37
|
const refForOutline = react_1.default.useRef(null);
|
|
38
|
+
const { effectivePostmountFor, effectivePremountFor, freezeFrame, isPremountingOrPostmounting, postmountingActive, premountingActive, premountingStyle, } = remotion_1.Internals.usePremounting({
|
|
39
|
+
from: from !== null && from !== void 0 ? from : 0,
|
|
40
|
+
durationInFrames: durationInFrames !== null && durationInFrames !== void 0 ? durationInFrames : Infinity,
|
|
41
|
+
premountFor: premountFor !== null && premountFor !== void 0 ? premountFor : null,
|
|
42
|
+
postmountFor: postmountFor !== null && postmountFor !== void 0 ? postmountFor : null,
|
|
43
|
+
style: style !== null && style !== void 0 ? style : null,
|
|
44
|
+
styleWhilePremounted: styleWhilePremounted !== null && styleWhilePremounted !== void 0 ? styleWhilePremounted : null,
|
|
45
|
+
styleWhilePostmounted: styleWhilePostmounted !== null && styleWhilePostmounted !== void 0 ? styleWhilePostmounted : null,
|
|
46
|
+
hideWhilePremounted: 'display-none',
|
|
47
|
+
});
|
|
35
48
|
const memoizedEffectDefinitions = useMemoizedEffectDefinitions(effects);
|
|
36
49
|
const memoizedEffects = useMemoizedEffects({
|
|
37
50
|
effects,
|
|
@@ -49,17 +62,17 @@ const GifInner = ({ src, width, height, onLoad, onError, fit, playbackRate, loop
|
|
|
49
62
|
id,
|
|
50
63
|
delayRenderTimeoutInMilliseconds,
|
|
51
64
|
requestInit,
|
|
52
|
-
style,
|
|
65
|
+
style: premountingStyle !== null && premountingStyle !== void 0 ? premountingStyle : undefined,
|
|
53
66
|
effects: memoizedEffects,
|
|
54
67
|
};
|
|
55
68
|
const inner = env.isRendering ? (jsx_runtime_1.jsx(GifForRendering_1.GifForRendering, { ...gifProps, ref: ref })) : (jsx_runtime_1.jsx(GifForDevelopment_1.GifForDevelopment, { ...gifProps, ref: ref, refForOutline: refForOutline }));
|
|
56
|
-
return (jsx_runtime_1.jsx(remotion_1.Sequence, { layout: "none", durationInFrames: durationInFrames, name: "<Gif>", _remotionInternalDocumentationLink: "https://www.remotion.dev/docs/gif/gif", controls: controls, _remotionInternalEffects: memoizedEffectDefinitions, ...sequenceProps, outlineRef: refForOutline, children: inner }));
|
|
69
|
+
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, durationInFrames: durationInFrames !== null && durationInFrames !== void 0 ? durationInFrames : Infinity, 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, outlineRef: refForOutline, children: inner }) }));
|
|
57
70
|
};
|
|
58
71
|
exports.Gif = remotion_1.Interactive.withSchema({
|
|
59
72
|
Component: GifInner,
|
|
60
73
|
componentName: '<Gif>',
|
|
61
74
|
componentIdentity: 'dev.remotion.gif.Gif',
|
|
62
|
-
schema: gifSchema,
|
|
75
|
+
schema: exports.gifSchema,
|
|
63
76
|
supportsEffects: true,
|
|
64
77
|
});
|
|
65
78
|
exports.Gif.displayName = 'Gif';
|
package/dist/esm/index.mjs
CHANGED
|
@@ -874,6 +874,7 @@ var getGifDurationInSeconds = async (src2, options) => {
|
|
|
874
874
|
// src/Gif.tsx
|
|
875
875
|
import React from "react";
|
|
876
876
|
import {
|
|
877
|
+
Freeze,
|
|
877
878
|
Internals as Internals3,
|
|
878
879
|
Interactive,
|
|
879
880
|
Sequence,
|
|
@@ -1442,6 +1443,7 @@ import { jsx as jsx4 } from "react/jsx-runtime";
|
|
|
1442
1443
|
var { useMemoizedEffectDefinitions, useMemoizedEffects } = Internals3;
|
|
1443
1444
|
var gifSchema = {
|
|
1444
1445
|
...Internals3.baseSchema,
|
|
1446
|
+
...Internals3.premountSchema,
|
|
1445
1447
|
playbackRate: {
|
|
1446
1448
|
type: "number",
|
|
1447
1449
|
min: 0,
|
|
@@ -1452,7 +1454,9 @@ var gifSchema = {
|
|
|
1452
1454
|
hiddenFromList: false,
|
|
1453
1455
|
keyframable: false
|
|
1454
1456
|
},
|
|
1455
|
-
...Internals3.transformSchema
|
|
1457
|
+
...Internals3.transformSchema,
|
|
1458
|
+
...Interactive.backgroundSchema,
|
|
1459
|
+
...Interactive.borderSchema
|
|
1456
1460
|
};
|
|
1457
1461
|
var GifInner = ({
|
|
1458
1462
|
src: src2,
|
|
@@ -1467,6 +1471,11 @@ var GifInner = ({
|
|
|
1467
1471
|
delayRenderTimeoutInMilliseconds,
|
|
1468
1472
|
requestInit,
|
|
1469
1473
|
durationInFrames,
|
|
1474
|
+
from,
|
|
1475
|
+
premountFor,
|
|
1476
|
+
postmountFor,
|
|
1477
|
+
styleWhilePremounted,
|
|
1478
|
+
styleWhilePostmounted,
|
|
1470
1479
|
style,
|
|
1471
1480
|
controls,
|
|
1472
1481
|
effects = [],
|
|
@@ -1475,6 +1484,24 @@ var GifInner = ({
|
|
|
1475
1484
|
}) => {
|
|
1476
1485
|
const env = useRemotionEnvironment();
|
|
1477
1486
|
const refForOutline = React.useRef(null);
|
|
1487
|
+
const {
|
|
1488
|
+
effectivePostmountFor,
|
|
1489
|
+
effectivePremountFor,
|
|
1490
|
+
freezeFrame,
|
|
1491
|
+
isPremountingOrPostmounting,
|
|
1492
|
+
postmountingActive,
|
|
1493
|
+
premountingActive,
|
|
1494
|
+
premountingStyle
|
|
1495
|
+
} = Internals3.usePremounting({
|
|
1496
|
+
from: from ?? 0,
|
|
1497
|
+
durationInFrames: durationInFrames ?? Infinity,
|
|
1498
|
+
premountFor: premountFor ?? null,
|
|
1499
|
+
postmountFor: postmountFor ?? null,
|
|
1500
|
+
style: style ?? null,
|
|
1501
|
+
styleWhilePremounted: styleWhilePremounted ?? null,
|
|
1502
|
+
styleWhilePostmounted: styleWhilePostmounted ?? null,
|
|
1503
|
+
hideWhilePremounted: "display-none"
|
|
1504
|
+
});
|
|
1478
1505
|
const memoizedEffectDefinitions = useMemoizedEffectDefinitions(effects);
|
|
1479
1506
|
const memoizedEffects = useMemoizedEffects({
|
|
1480
1507
|
effects,
|
|
@@ -1492,7 +1519,7 @@ var GifInner = ({
|
|
|
1492
1519
|
id,
|
|
1493
1520
|
delayRenderTimeoutInMilliseconds,
|
|
1494
1521
|
requestInit,
|
|
1495
|
-
style,
|
|
1522
|
+
style: premountingStyle ?? undefined,
|
|
1496
1523
|
effects: memoizedEffects
|
|
1497
1524
|
};
|
|
1498
1525
|
const inner = env.isRendering ? /* @__PURE__ */ jsx4(GifForRendering, {
|
|
@@ -1503,16 +1530,25 @@ var GifInner = ({
|
|
|
1503
1530
|
ref,
|
|
1504
1531
|
refForOutline
|
|
1505
1532
|
});
|
|
1506
|
-
return /* @__PURE__ */ jsx4(
|
|
1507
|
-
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
|
|
1511
|
-
|
|
1512
|
-
|
|
1513
|
-
|
|
1514
|
-
|
|
1515
|
-
|
|
1533
|
+
return /* @__PURE__ */ jsx4(Freeze, {
|
|
1534
|
+
frame: freezeFrame,
|
|
1535
|
+
active: isPremountingOrPostmounting,
|
|
1536
|
+
children: /* @__PURE__ */ jsx4(Sequence, {
|
|
1537
|
+
layout: "none",
|
|
1538
|
+
from: from ?? 0,
|
|
1539
|
+
durationInFrames: durationInFrames ?? Infinity,
|
|
1540
|
+
name: "<Gif>",
|
|
1541
|
+
_remotionInternalDocumentationLink: "https://www.remotion.dev/docs/gif/gif",
|
|
1542
|
+
controls,
|
|
1543
|
+
_remotionInternalEffects: memoizedEffectDefinitions,
|
|
1544
|
+
_remotionInternalPremountDisplay: effectivePremountFor || null,
|
|
1545
|
+
_remotionInternalPostmountDisplay: effectivePostmountFor || null,
|
|
1546
|
+
_remotionInternalIsPremounting: premountingActive,
|
|
1547
|
+
_remotionInternalIsPostmounting: postmountingActive,
|
|
1548
|
+
...sequenceProps,
|
|
1549
|
+
outlineRef: refForOutline,
|
|
1550
|
+
children: inner
|
|
1551
|
+
})
|
|
1516
1552
|
});
|
|
1517
1553
|
};
|
|
1518
1554
|
var Gif = Interactive.withSchema({
|
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.497",
|
|
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.497"
|
|
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.497",
|
|
42
42
|
"eslint": "9.19.0",
|
|
43
43
|
"@typescript/native-preview": "7.0.0-dev.20260217.1"
|
|
44
44
|
},
|