New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

lottie-react

Package Overview
Dependencies
Maintainers
1
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

lottie-react - npm Package Compare versions

Comparing version 1.1.0 to 1.1.1

1

build/compiled/index.js

@@ -6,2 +6,3 @@ import Lottie from "./components/Lottie";

export const useAnimator = useLottie;
export { useLottie };
export default Lottie;

2

build/index.es.js

@@ -415,3 +415,3 @@ import React, { useRef, useEffect, forwardRef } from 'react';

export default Lottie;
export { Animator, useAnimator };
export { Animator, useAnimator, useLottie };
//# sourceMappingURL=index.es.js.map

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

import e,{useRef as n,useEffect as t,forwardRef as o}from"react";import r from"prop-types";import a from"lottie-web";var u=function(o){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},u=o.animationData,l=o.loop,i=o.autoplay,c=o.initialSegment,d=o.onComplete,p=o.onLoopComplete,m=o.onEnterFrame,s=o.onSegmentStart,f=o.onConfigReady,y=o.onDataReady,g=o.onDataFailed,S=o.onLoadedImages,v=o.onDOMLoaded,D=o.onDestroy,h=n(null),b=n(null),O=function(){h.current&&h.current.play()},L=function(){h.current&&h.current.stop()},C=function(){h.current&&h.current.pause()},T=function(e){h.current&&h.current.setSpeed(e)},A=function(e,n){h.current&&h.current.goToAndPlay(e,n)},E=function(e,n){h.current&&h.current.goToAndStop(e,n)},P=function(e){h.current&&h.current.setDirection(e)},R=function(e,n){h.current&&h.current.playSegments(e,n)},F=function(e){h.current&&h.current.setSubframe(e)},j=function(){h.current&&h.current.destroy()},w=function(e){if(h.current)return h.current.getDuration(e)},x=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};h.current&&h.current.destroy();var n=Object.assign(Object.assign({animationData:u||null,loop:Number.isNaN(l)?!1!==l:l,autoplay:!1!==i,initialSegment:c||null},e),{container:b.current});h.current=a.loadAnimation(n)};t((function(){x()}),[u,l,i,c]);var I=function(e,n){var t=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return h.current&&(t&&h.current.removeEventListener(e),e&&n)?(h.current.addEventListener(e,n),function(){h.current.removeEventListener(e,n)}):function(){}};t((function(){var e=[{name:"complete",handler:d},{name:"loopComplete",handler:p},{name:"enterFrame",handler:m},{name:"segmentStart",handler:s},{name:"config_ready",handler:f},{name:"data_ready",handler:y},{name:"data_failed",handler:g},{name:"loaded_images",handler:S},{name:"DOMLoaded",handler:v},{name:"destroy",handler:D}].map((function(e){return I(e.name,e.handler)}));return function(){e.forEach((function(e){return e()}))}}),[d,p,m,s,f,y,g,S,v,D]);var M=e.createElement("div",{style:r,ref:b});return{View:M,play:O,stop:L,pause:C,setSpeed:T,goToAndStop:E,goToAndPlay:A,setDirection:P,playSegments:R,setSubframe:F,destroy:j,getDuration:w}},l=function(e,n){var t={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&n.indexOf(o)<0&&(t[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(o=Object.getOwnPropertySymbols(e);r<o.length;r++)n.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(e,o[r])&&(t[o[r]]=e[o[r]])}return t},i=o((function(e,o){var r=e.style,a=l(e,["style"]),i=o||n(),c=u(a,r),d=c.View,p=c.play,m=c.stop,s=c.pause,f=c.setSpeed,y=c.goToAndStop,g=c.goToAndPlay,S=c.setDirection,v=c.playSegments,D=c.setSubframe,h=c.destroy,b=c.getDuration;return t((function(){i&&(i.current={play:p,stop:m,pause:s,setSpeed:f,goToAndPlay:g,goToAndStop:y,setDirection:S,playSegments:v,setSubframe:D,destroy:h,getDuration:b})}),[i.current]),d}));i.propTypes={animationData:r.shape(void 0).isRequired,loop:r.oneOfType([r.bool,r.number]),autoplay:r.bool,initialSegment:r.arrayOf(r.shape(r.number.isRequired)),onComplete:r.func,onLoopComplete:r.func,onEnterFrame:r.func,onSegmentStart:r.func,onConfigReady:r.func,onDataReady:r.func,onDataFailed:r.func,onLoadedImages:r.func,onDOMLoaded:r.func,onDestroy:r.func,style:r.shape(void 0)},i.defaultProps={loop:!0,autoplay:!0,initialSegment:null,onComplete:null,onLoopComplete:null,onEnterFrame:null,onSegmentStart:null,onConfigReady:null,onDataReady:null,onDataFailed:null,onLoadedImages:null,onDOMLoaded:null,onDestroy:null,style:null};var c=i,d=u;export default i;export{c as Animator,d as useAnimator};
import e,{useRef as n,useEffect as t,forwardRef as o}from"react";import r from"prop-types";import a from"lottie-web";var u=function(o){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},u=o.animationData,l=o.loop,i=o.autoplay,c=o.initialSegment,d=o.onComplete,p=o.onLoopComplete,m=o.onEnterFrame,s=o.onSegmentStart,f=o.onConfigReady,y=o.onDataReady,g=o.onDataFailed,S=o.onLoadedImages,v=o.onDOMLoaded,D=o.onDestroy,h=n(null),b=n(null),O=function(){h.current&&h.current.play()},L=function(){h.current&&h.current.stop()},C=function(){h.current&&h.current.pause()},T=function(e){h.current&&h.current.setSpeed(e)},A=function(e,n){h.current&&h.current.goToAndPlay(e,n)},E=function(e,n){h.current&&h.current.goToAndStop(e,n)},P=function(e){h.current&&h.current.setDirection(e)},R=function(e,n){h.current&&h.current.playSegments(e,n)},F=function(e){h.current&&h.current.setSubframe(e)},j=function(){h.current&&h.current.destroy()},w=function(e){if(h.current)return h.current.getDuration(e)},x=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};h.current&&h.current.destroy();var n=Object.assign(Object.assign({animationData:u||null,loop:Number.isNaN(l)?!1!==l:l,autoplay:!1!==i,initialSegment:c||null},e),{container:b.current});h.current=a.loadAnimation(n)};t((function(){x()}),[u,l,i,c]);var I=function(e,n){var t=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return h.current&&(t&&h.current.removeEventListener(e),e&&n)?(h.current.addEventListener(e,n),function(){h.current.removeEventListener(e,n)}):function(){}};t((function(){var e=[{name:"complete",handler:d},{name:"loopComplete",handler:p},{name:"enterFrame",handler:m},{name:"segmentStart",handler:s},{name:"config_ready",handler:f},{name:"data_ready",handler:y},{name:"data_failed",handler:g},{name:"loaded_images",handler:S},{name:"DOMLoaded",handler:v},{name:"destroy",handler:D}].map((function(e){return I(e.name,e.handler)}));return function(){e.forEach((function(e){return e()}))}}),[d,p,m,s,f,y,g,S,v,D]);var M=e.createElement("div",{style:r,ref:b});return{View:M,play:O,stop:L,pause:C,setSpeed:T,goToAndStop:E,goToAndPlay:A,setDirection:P,playSegments:R,setSubframe:F,destroy:j,getDuration:w}},l=function(e,n){var t={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&n.indexOf(o)<0&&(t[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(o=Object.getOwnPropertySymbols(e);r<o.length;r++)n.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(e,o[r])&&(t[o[r]]=e[o[r]])}return t},i=o((function(e,o){var r=e.style,a=l(e,["style"]),i=o||n(),c=u(a,r),d=c.View,p=c.play,m=c.stop,s=c.pause,f=c.setSpeed,y=c.goToAndStop,g=c.goToAndPlay,S=c.setDirection,v=c.playSegments,D=c.setSubframe,h=c.destroy,b=c.getDuration;return t((function(){i&&(i.current={play:p,stop:m,pause:s,setSpeed:f,goToAndPlay:g,goToAndStop:y,setDirection:S,playSegments:v,setSubframe:D,destroy:h,getDuration:b})}),[i.current]),d}));i.propTypes={animationData:r.shape(void 0).isRequired,loop:r.oneOfType([r.bool,r.number]),autoplay:r.bool,initialSegment:r.arrayOf(r.shape(r.number.isRequired)),onComplete:r.func,onLoopComplete:r.func,onEnterFrame:r.func,onSegmentStart:r.func,onConfigReady:r.func,onDataReady:r.func,onDataFailed:r.func,onLoadedImages:r.func,onDOMLoaded:r.func,onDestroy:r.func,style:r.shape(void 0)},i.defaultProps={loop:!0,autoplay:!0,initialSegment:null,onComplete:null,onLoopComplete:null,onEnterFrame:null,onSegmentStart:null,onConfigReady:null,onDataReady:null,onDataFailed:null,onLoadedImages:null,onDOMLoaded:null,onDestroy:null,style:null};var c=i,d=u;export default i;export{c as Animator,d as useAnimator,u as useLottie};

@@ -424,2 +424,3 @@ 'use strict';

exports.useAnimator = useAnimator;
exports.useLottie = useLottie;
//# sourceMappingURL=index.js.map

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

"use strict";function e(e){return e&&"object"==typeof e&&"default"in e?e.default:e}Object.defineProperty(exports,"__esModule",{value:!0});var n=require("react"),t=e(n),r=e(require("prop-types")),o=e(require("lottie-web")),a=function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},a=e.animationData,u=e.loop,l=e.autoplay,i=e.initialSegment,c=e.onComplete,d=e.onLoopComplete,s=e.onEnterFrame,f=e.onSegmentStart,p=e.onConfigReady,m=e.onDataReady,y=e.onDataFailed,g=e.onLoadedImages,S=e.onDOMLoaded,v=e.onDestroy,D=n.useRef(null),b=n.useRef(null),h=function(){D.current&&D.current.play()},O=function(){D.current&&D.current.stop()},L=function(){D.current&&D.current.pause()},E=function(e){D.current&&D.current.setSpeed(e)},R=function(e,n){D.current&&D.current.goToAndPlay(e,n)},A=function(e,n){D.current&&D.current.goToAndStop(e,n)},C=function(e){D.current&&D.current.setDirection(e)},T=function(e,n){D.current&&D.current.playSegments(e,n)},P=function(e){D.current&&D.current.setSubframe(e)},j=function(){D.current&&D.current.destroy()},w=function(e){if(D.current)return D.current.getDuration(e)},F=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};D.current&&D.current.destroy();var n=Object.assign(Object.assign({animationData:a||null,loop:Number.isNaN(u)?!1!==u:u,autoplay:!1!==l,initialSegment:i||null},e),{container:b.current});D.current=o.loadAnimation(n)};n.useEffect((function(){F()}),[a,u,l,i]);var x=function(e,n){var t=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return D.current&&(t&&D.current.removeEventListener(e),e&&n)?(D.current.addEventListener(e,n),function(){D.current.removeEventListener(e,n)}):function(){}};n.useEffect((function(){var e=[{name:"complete",handler:c},{name:"loopComplete",handler:d},{name:"enterFrame",handler:s},{name:"segmentStart",handler:f},{name:"config_ready",handler:p},{name:"data_ready",handler:m},{name:"data_failed",handler:y},{name:"loaded_images",handler:g},{name:"DOMLoaded",handler:S},{name:"destroy",handler:v}].map((function(e){return x(e.name,e.handler)}));return function(){e.forEach((function(e){return e()}))}}),[c,d,s,f,p,m,y,g,S,v]);var _=t.createElement("div",{style:r,ref:b});return{View:_,play:h,stop:O,pause:L,setSpeed:E,goToAndStop:A,goToAndPlay:R,setDirection:C,playSegments:T,setSubframe:P,destroy:j,getDuration:w}},u=function(e,n){var t={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&n.indexOf(r)<0&&(t[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)n.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(t[r[o]]=e[r[o]])}return t},l=n.forwardRef((function(e,t){var r=e.style,o=u(e,["style"]),l=t||n.useRef(),i=a(o,r),c=i.View,d=i.play,s=i.stop,f=i.pause,p=i.setSpeed,m=i.goToAndStop,y=i.goToAndPlay,g=i.setDirection,S=i.playSegments,v=i.setSubframe,D=i.destroy,b=i.getDuration;return n.useEffect((function(){l&&(l.current={play:d,stop:s,pause:f,setSpeed:p,goToAndPlay:y,goToAndStop:m,setDirection:g,playSegments:S,setSubframe:v,destroy:D,getDuration:b})}),[l.current]),c}));l.propTypes={animationData:r.shape(void 0).isRequired,loop:r.oneOfType([r.bool,r.number]),autoplay:r.bool,initialSegment:r.arrayOf(r.shape(r.number.isRequired)),onComplete:r.func,onLoopComplete:r.func,onEnterFrame:r.func,onSegmentStart:r.func,onConfigReady:r.func,onDataReady:r.func,onDataFailed:r.func,onLoadedImages:r.func,onDOMLoaded:r.func,onDestroy:r.func,style:r.shape(void 0)},l.defaultProps={loop:!0,autoplay:!0,initialSegment:null,onComplete:null,onLoopComplete:null,onEnterFrame:null,onSegmentStart:null,onConfigReady:null,onDataReady:null,onDataFailed:null,onLoadedImages:null,onDOMLoaded:null,onDestroy:null,style:null};var i=l,c=a;exports.Animator=i,exports.default=l,exports.useAnimator=c;
"use strict";function e(e){return e&&"object"==typeof e&&"default"in e?e.default:e}Object.defineProperty(exports,"__esModule",{value:!0});var n=require("react"),t=e(n),r=e(require("prop-types")),o=e(require("lottie-web")),a=function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},a=e.animationData,u=e.loop,l=e.autoplay,i=e.initialSegment,c=e.onComplete,d=e.onLoopComplete,s=e.onEnterFrame,f=e.onSegmentStart,p=e.onConfigReady,m=e.onDataReady,y=e.onDataFailed,g=e.onLoadedImages,S=e.onDOMLoaded,v=e.onDestroy,D=n.useRef(null),b=n.useRef(null),h=function(){D.current&&D.current.play()},O=function(){D.current&&D.current.stop()},L=function(){D.current&&D.current.pause()},E=function(e){D.current&&D.current.setSpeed(e)},R=function(e,n){D.current&&D.current.goToAndPlay(e,n)},A=function(e,n){D.current&&D.current.goToAndStop(e,n)},C=function(e){D.current&&D.current.setDirection(e)},T=function(e,n){D.current&&D.current.playSegments(e,n)},P=function(e){D.current&&D.current.setSubframe(e)},j=function(){D.current&&D.current.destroy()},w=function(e){if(D.current)return D.current.getDuration(e)},x=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};D.current&&D.current.destroy();var n=Object.assign(Object.assign({animationData:a||null,loop:Number.isNaN(u)?!1!==u:u,autoplay:!1!==l,initialSegment:i||null},e),{container:b.current});D.current=o.loadAnimation(n)};n.useEffect((function(){x()}),[a,u,l,i]);var F=function(e,n){var t=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return D.current&&(t&&D.current.removeEventListener(e),e&&n)?(D.current.addEventListener(e,n),function(){D.current.removeEventListener(e,n)}):function(){}};n.useEffect((function(){var e=[{name:"complete",handler:c},{name:"loopComplete",handler:d},{name:"enterFrame",handler:s},{name:"segmentStart",handler:f},{name:"config_ready",handler:p},{name:"data_ready",handler:m},{name:"data_failed",handler:y},{name:"loaded_images",handler:g},{name:"DOMLoaded",handler:S},{name:"destroy",handler:v}].map((function(e){return F(e.name,e.handler)}));return function(){e.forEach((function(e){return e()}))}}),[c,d,s,f,p,m,y,g,S,v]);var _=t.createElement("div",{style:r,ref:b});return{View:_,play:h,stop:O,pause:L,setSpeed:E,goToAndStop:A,goToAndPlay:R,setDirection:C,playSegments:T,setSubframe:P,destroy:j,getDuration:w}},u=function(e,n){var t={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&n.indexOf(r)<0&&(t[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)n.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(t[r[o]]=e[r[o]])}return t},l=n.forwardRef((function(e,t){var r=e.style,o=u(e,["style"]),l=t||n.useRef(),i=a(o,r),c=i.View,d=i.play,s=i.stop,f=i.pause,p=i.setSpeed,m=i.goToAndStop,y=i.goToAndPlay,g=i.setDirection,S=i.playSegments,v=i.setSubframe,D=i.destroy,b=i.getDuration;return n.useEffect((function(){l&&(l.current={play:d,stop:s,pause:f,setSpeed:p,goToAndPlay:y,goToAndStop:m,setDirection:g,playSegments:S,setSubframe:v,destroy:D,getDuration:b})}),[l.current]),c}));l.propTypes={animationData:r.shape(void 0).isRequired,loop:r.oneOfType([r.bool,r.number]),autoplay:r.bool,initialSegment:r.arrayOf(r.shape(r.number.isRequired)),onComplete:r.func,onLoopComplete:r.func,onEnterFrame:r.func,onSegmentStart:r.func,onConfigReady:r.func,onDataReady:r.func,onDataFailed:r.func,onLoadedImages:r.func,onDOMLoaded:r.func,onDestroy:r.func,style:r.shape(void 0)},l.defaultProps={loop:!0,autoplay:!0,initialSegment:null,onComplete:null,onLoopComplete:null,onEnterFrame:null,onSegmentStart:null,onConfigReady:null,onDataReady:null,onDataFailed:null,onLoadedImages:null,onDOMLoaded:null,onDestroy:null,style:null};var i=l,c=a;exports.Animator=i,exports.default=l,exports.useAnimator=c,exports.useLottie=a;

@@ -423,2 +423,3 @@ (function (global, factory) {

exports.useAnimator = useAnimator;
exports.useLottie = useLottie;

@@ -425,0 +426,0 @@ Object.defineProperty(exports, '__esModule', { value: true });

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

!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports,require("react"),require("prop-types"),require("lottie-web")):"function"==typeof define&&define.amd?define(["exports","react","prop-types","lottie-web"],n):n((e=e||self)["lottie-react"]={},e.React,e.PropTypes,e.Lottie)}(this,(function(e,n,t,o){"use strict";var r="default"in n?n.default:n;t=t&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t,o=o&&Object.prototype.hasOwnProperty.call(o,"default")?o.default:o;var a=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},a=e.animationData,u=e.loop,l=e.autoplay,i=e.initialSegment,c=e.onComplete,d=e.onLoopComplete,f=e.onEnterFrame,p=e.onSegmentStart,s=e.onConfigReady,m=e.onDataReady,y=e.onDataFailed,g=e.onLoadedImages,S=e.onDOMLoaded,v=e.onDestroy,b=n.useRef(null),D=n.useRef(null),h=function(){b.current&&b.current.play()},O=function(){b.current&&b.current.stop()},L=function(){b.current&&b.current.pause()},R=function(e){b.current&&b.current.setSpeed(e)},E=function(e,n){b.current&&b.current.goToAndPlay(e,n)},P=function(e,n){b.current&&b.current.goToAndStop(e,n)},A=function(e){b.current&&b.current.setDirection(e)},T=function(e,n){b.current&&b.current.playSegments(e,n)},j=function(e){b.current&&b.current.setSubframe(e)},w=function(){b.current&&b.current.destroy()},C=function(e){if(b.current)return b.current.getDuration(e)},F=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};b.current&&b.current.destroy();var n=Object.assign(Object.assign({animationData:a||null,loop:Number.isNaN(u)?!1!==u:u,autoplay:!1!==l,initialSegment:i||null},e),{container:D.current});b.current=o.loadAnimation(n)};n.useEffect((function(){F()}),[a,u,l,i]);var _=function(e,n){var t=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return b.current&&(t&&b.current.removeEventListener(e),e&&n)?(b.current.addEventListener(e,n),function(){b.current.removeEventListener(e,n)}):function(){}};n.useEffect((function(){var e=[{name:"complete",handler:c},{name:"loopComplete",handler:d},{name:"enterFrame",handler:f},{name:"segmentStart",handler:p},{name:"config_ready",handler:s},{name:"data_ready",handler:m},{name:"data_failed",handler:y},{name:"loaded_images",handler:g},{name:"DOMLoaded",handler:S},{name:"destroy",handler:v}].map((function(e){return _(e.name,e.handler)}));return function(){e.forEach((function(e){return e()}))}}),[c,d,f,p,s,m,y,g,S,v]);var q=r.createElement("div",{style:t,ref:D});return{View:q,play:h,stop:O,pause:L,setSpeed:R,goToAndStop:P,goToAndPlay:E,setDirection:A,playSegments:T,setSubframe:j,destroy:w,getDuration:C}},u=function(e,n){var t={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&n.indexOf(o)<0&&(t[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(o=Object.getOwnPropertySymbols(e);r<o.length;r++)n.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(e,o[r])&&(t[o[r]]=e[o[r]])}return t},l=n.forwardRef((function(e,t){var o=e.style,r=u(e,["style"]),l=t||n.useRef(),i=a(r,o),c=i.View,d=i.play,f=i.stop,p=i.pause,s=i.setSpeed,m=i.goToAndStop,y=i.goToAndPlay,g=i.setDirection,S=i.playSegments,v=i.setSubframe,b=i.destroy,D=i.getDuration;return n.useEffect((function(){l&&(l.current={play:d,stop:f,pause:p,setSpeed:s,goToAndPlay:y,goToAndStop:m,setDirection:g,playSegments:S,setSubframe:v,destroy:b,getDuration:D})}),[l.current]),c}));l.propTypes={animationData:t.shape(void 0).isRequired,loop:t.oneOfType([t.bool,t.number]),autoplay:t.bool,initialSegment:t.arrayOf(t.shape(t.number.isRequired)),onComplete:t.func,onLoopComplete:t.func,onEnterFrame:t.func,onSegmentStart:t.func,onConfigReady:t.func,onDataReady:t.func,onDataFailed:t.func,onLoadedImages:t.func,onDOMLoaded:t.func,onDestroy:t.func,style:t.shape(void 0)},l.defaultProps={loop:!0,autoplay:!0,initialSegment:null,onComplete:null,onLoopComplete:null,onEnterFrame:null,onSegmentStart:null,onConfigReady:null,onDataReady:null,onDataFailed:null,onLoadedImages:null,onDOMLoaded:null,onDestroy:null,style:null};var i=l,c=a;e.Animator=i,e.default=l,e.useAnimator=c,Object.defineProperty(e,"__esModule",{value:!0})}));
!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports,require("react"),require("prop-types"),require("lottie-web")):"function"==typeof define&&define.amd?define(["exports","react","prop-types","lottie-web"],n):n((e=e||self)["lottie-react"]={},e.React,e.PropTypes,e.Lottie)}(this,(function(e,n,t,o){"use strict";var r="default"in n?n.default:n;t=t&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t,o=o&&Object.prototype.hasOwnProperty.call(o,"default")?o.default:o;var a=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},a=e.animationData,u=e.loop,l=e.autoplay,i=e.initialSegment,c=e.onComplete,d=e.onLoopComplete,f=e.onEnterFrame,p=e.onSegmentStart,s=e.onConfigReady,m=e.onDataReady,y=e.onDataFailed,g=e.onLoadedImages,S=e.onDOMLoaded,v=e.onDestroy,b=n.useRef(null),D=n.useRef(null),h=function(){b.current&&b.current.play()},O=function(){b.current&&b.current.stop()},L=function(){b.current&&b.current.pause()},R=function(e){b.current&&b.current.setSpeed(e)},E=function(e,n){b.current&&b.current.goToAndPlay(e,n)},P=function(e,n){b.current&&b.current.goToAndStop(e,n)},A=function(e){b.current&&b.current.setDirection(e)},T=function(e,n){b.current&&b.current.playSegments(e,n)},j=function(e){b.current&&b.current.setSubframe(e)},w=function(){b.current&&b.current.destroy()},C=function(e){if(b.current)return b.current.getDuration(e)},F=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};b.current&&b.current.destroy();var n=Object.assign(Object.assign({animationData:a||null,loop:Number.isNaN(u)?!1!==u:u,autoplay:!1!==l,initialSegment:i||null},e),{container:D.current});b.current=o.loadAnimation(n)};n.useEffect((function(){F()}),[a,u,l,i]);var _=function(e,n){var t=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return b.current&&(t&&b.current.removeEventListener(e),e&&n)?(b.current.addEventListener(e,n),function(){b.current.removeEventListener(e,n)}):function(){}};n.useEffect((function(){var e=[{name:"complete",handler:c},{name:"loopComplete",handler:d},{name:"enterFrame",handler:f},{name:"segmentStart",handler:p},{name:"config_ready",handler:s},{name:"data_ready",handler:m},{name:"data_failed",handler:y},{name:"loaded_images",handler:g},{name:"DOMLoaded",handler:S},{name:"destroy",handler:v}].map((function(e){return _(e.name,e.handler)}));return function(){e.forEach((function(e){return e()}))}}),[c,d,f,p,s,m,y,g,S,v]);var q=r.createElement("div",{style:t,ref:D});return{View:q,play:h,stop:O,pause:L,setSpeed:R,goToAndStop:P,goToAndPlay:E,setDirection:A,playSegments:T,setSubframe:j,destroy:w,getDuration:C}},u=function(e,n){var t={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&n.indexOf(o)<0&&(t[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(o=Object.getOwnPropertySymbols(e);r<o.length;r++)n.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(e,o[r])&&(t[o[r]]=e[o[r]])}return t},l=n.forwardRef((function(e,t){var o=e.style,r=u(e,["style"]),l=t||n.useRef(),i=a(r,o),c=i.View,d=i.play,f=i.stop,p=i.pause,s=i.setSpeed,m=i.goToAndStop,y=i.goToAndPlay,g=i.setDirection,S=i.playSegments,v=i.setSubframe,b=i.destroy,D=i.getDuration;return n.useEffect((function(){l&&(l.current={play:d,stop:f,pause:p,setSpeed:s,goToAndPlay:y,goToAndStop:m,setDirection:g,playSegments:S,setSubframe:v,destroy:b,getDuration:D})}),[l.current]),c}));l.propTypes={animationData:t.shape(void 0).isRequired,loop:t.oneOfType([t.bool,t.number]),autoplay:t.bool,initialSegment:t.arrayOf(t.shape(t.number.isRequired)),onComplete:t.func,onLoopComplete:t.func,onEnterFrame:t.func,onSegmentStart:t.func,onConfigReady:t.func,onDataReady:t.func,onDataFailed:t.func,onLoadedImages:t.func,onDOMLoaded:t.func,onDestroy:t.func,style:t.shape(void 0)},l.defaultProps={loop:!0,autoplay:!0,initialSegment:null,onComplete:null,onLoopComplete:null,onEnterFrame:null,onSegmentStart:null,onConfigReady:null,onDataReady:null,onDataFailed:null,onLoadedImages:null,onDOMLoaded:null,onDestroy:null,style:null};var i=l,c=a;e.Animator=i,e.default=l,e.useAnimator=c,e.useLottie=a,Object.defineProperty(e,"__esModule",{value:!0})}));
{
"name": "lottie-react",
"version": "1.1.0",
"version": "1.1.1",
"description": "Lottie for React",

@@ -5,0 +5,0 @@ "author": "David Gamote",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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