Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@remotion/lottie

Package Overview
Dependencies
Maintainers
1
Versions
449
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@remotion/lottie - npm Package Compare versions

Comparing version 3.2.28 to 3.2.29

2

dist/Lottie.d.ts
/// <reference types="react" />
import type { LottieProps } from './types';
export declare const Lottie: ({ animationData, className, direction, loop, playbackRate, style, }: LottieProps) => JSX.Element;
export declare const Lottie: ({ animationData, className, direction, loop, playbackRate, style, onAnimationLoaded, }: LottieProps) => JSX.Element;

@@ -14,3 +14,3 @@ "use strict";

const validate_playbackrate_1 = require("./validate-playbackrate");
const Lottie = ({ animationData, className, direction, loop, playbackRate, style, }) => {
const Lottie = ({ animationData, className, direction, loop, playbackRate, style, onAnimationLoaded, }) => {
if (typeof animationData !== 'object') {

@@ -24,5 +24,8 @@ throw new Error('animationData should be provided as an object. If you only have the path to the JSON file, load it and pass it as animationData. See https://remotion.dev/docs/lottie/lottie#example for more information.');

const containerRef = (0, react_1.useRef)(null);
const onAnimationLoadedRef = (0, react_1.useRef)();
onAnimationLoadedRef.current = onAnimationLoaded;
const [handle] = (0, react_1.useState)(() => (0, remotion_1.delayRender)('Waiting for Lottie animation to load'));
const frame = (0, remotion_1.useCurrentFrame)();
(0, react_1.useEffect)(() => {
var _a;
if (!containerRef.current) {

@@ -44,2 +47,3 @@ return;

animation.addEventListener('DOMLoaded', onComplete);
(_a = onAnimationLoadedRef.current) === null || _a === void 0 ? void 0 : _a.call(onAnimationLoadedRef, animation);
return () => {

@@ -46,0 +50,0 @@ lastFrameRef.current = animation.currentFrame;

@@ -0,1 +1,2 @@

import type { AnimationItem } from 'lottie-web';
import type { CSSProperties } from 'react';

@@ -33,2 +34,6 @@ export declare type LottieAnimationData = {

style?: CSSProperties;
/**
* Callback that gets invoked when new animation data has been initialized
*/
onAnimationLoaded?: (animation: AnimationItem) => void;
};
{
"name": "@remotion/lottie",
"version": "3.2.28",
"version": "3.2.29",
"description": "Remotion Lottie",

@@ -30,3 +30,3 @@ "main": "dist/index.js",

"dependencies": {
"remotion": "3.2.28"
"remotion": "3.2.29"
},

@@ -62,3 +62,3 @@ "peerDependencies": {

},
"gitHead": "49bb70afa503bfb0c89ee51d8bf3386ad1b91ac4"
"gitHead": "9a2ff4d68324af8d1fe55ebdf94bdadccf446a10"
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc