@remotion/gsap 4.0.540 → 4.0.542
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/esm/index.mjs +6 -5
- package/package.json +5 -5
package/dist/esm/index.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// src/use-gsap-timeline.ts
|
|
2
2
|
import { gsap } from "gsap";
|
|
3
3
|
import { useLayoutEffect, useRef, useState } from "react";
|
|
4
|
-
import { useCurrentFrame, useVideoConfig } from "remotion";
|
|
4
|
+
import { Internals, useCurrentFrame, useVideoConfig } from "remotion";
|
|
5
5
|
|
|
6
6
|
// src/frame-time.ts
|
|
7
7
|
var frameToSeconds = (frame, fps) => {
|
|
@@ -273,6 +273,7 @@ var guardTimelineMethods = (timeline) => {
|
|
|
273
273
|
};
|
|
274
274
|
var useGsapTimeline = (build, { dependencies = EMPTY_DEPENDENCIES } = {}) => {
|
|
275
275
|
const frame = useCurrentFrame();
|
|
276
|
+
const videoEnabled = Internals.useVideoEnabled();
|
|
276
277
|
const { fps } = useVideoConfig();
|
|
277
278
|
const scopeRef = useRef(null);
|
|
278
279
|
const controlsRef = useRef(null);
|
|
@@ -287,7 +288,7 @@ var useGsapTimeline = (build, { dependencies = EMPTY_DEPENDENCIES } = {}) => {
|
|
|
287
288
|
useLayoutEffect(() => {
|
|
288
289
|
const scope = scopeRef.current;
|
|
289
290
|
builtForRef.current = scope;
|
|
290
|
-
if (!scope) {
|
|
291
|
+
if (!scope || !videoEnabled) {
|
|
291
292
|
return;
|
|
292
293
|
}
|
|
293
294
|
const state = { timeline: null, controls: null };
|
|
@@ -373,13 +374,13 @@ var useGsapTimeline = (build, { dependencies = EMPTY_DEPENDENCIES } = {}) => {
|
|
|
373
374
|
context.revert();
|
|
374
375
|
state.controls?.kill();
|
|
375
376
|
};
|
|
376
|
-
}, [...dependencies, remountNonce]);
|
|
377
|
+
}, [...dependencies, remountNonce, videoEnabled]);
|
|
377
378
|
useLayoutEffect(() => {
|
|
378
379
|
const controls = controlsRef.current;
|
|
379
|
-
if (controls) {
|
|
380
|
+
if (controls && videoEnabled) {
|
|
380
381
|
controls.renderAt(frameToSeconds(frame, fps));
|
|
381
382
|
}
|
|
382
|
-
}, [fps, frame]);
|
|
383
|
+
}, [fps, frame, videoEnabled]);
|
|
383
384
|
useLayoutEffect(() => {
|
|
384
385
|
if (scopeRef.current !== builtForRef.current) {
|
|
385
386
|
setRemountNonce((nonce) => nonce + 1);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@remotion/gsap",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.542",
|
|
4
4
|
"description": "Use GSAP timelines in Remotion",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -14,8 +14,8 @@
|
|
|
14
14
|
"formatting": "oxfmt src --check",
|
|
15
15
|
"format": "oxfmt src",
|
|
16
16
|
"lint": "eslint src",
|
|
17
|
-
"watch": "
|
|
18
|
-
"make": "
|
|
17
|
+
"watch": "node ../.monorepo/tsrs.cjs -w",
|
|
18
|
+
"make": "node ../.monorepo/tsrs.cjs && bun --env-file=../.env.bundle bundle.ts"
|
|
19
19
|
},
|
|
20
20
|
"author": "Brayden Blackwell",
|
|
21
21
|
"contributors": [],
|
|
@@ -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.542"
|
|
28
28
|
},
|
|
29
29
|
"peerDependencies": {
|
|
30
30
|
"gsap": ">=3.12.0 <4",
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
"react-dom": "19.3.1",
|
|
45
45
|
"@types/react": "19.3.0",
|
|
46
46
|
"@types/react-dom": "19.3.0",
|
|
47
|
-
"@remotion/eslint-config-internal": "4.0.
|
|
47
|
+
"@remotion/eslint-config-internal": "4.0.542",
|
|
48
48
|
"@happy-dom/global-registrator": "14.5.1",
|
|
49
49
|
"eslint": "9.19.0",
|
|
50
50
|
"gsap": "3.15.0",
|