@@ -29,6 +29,11 @@ const Player = lazy(
2929 . then ( module => ( { default : module . Player } ) )
3030) ;
3131
32+ const DotLottiePlayer = lazy (
33+ ( ) => import ( '@lottiefiles/dotlottie-react' )
34+ . then ( module => ( { default : module . DotLottieReact } ) )
35+ ) ;
36+
3237/**
3338 * JsonLottie Comp
3439 */
@@ -90,8 +95,9 @@ const speedOptions = [
9095] as const ;
9196
9297const ModeOptions = [
93- { label : "Data" , value : "standard" } ,
94- { label : "Advanced" , value : "advanced" } ,
98+ { label : "Lottie JSON" , value : "standard" } ,
99+ { label : "DotLottie" , value : "dotLottie" } ,
100+ { label : "IconScout" , value : "advanced" } ,
95101] as const ;
96102
97103let JsonLottieTmpComp = ( function ( ) {
@@ -102,6 +108,7 @@ let JsonLottieTmpComp = (function () {
102108 JSON . stringify ( defaultLottie , null , 2 )
103109 ) ,
104110 srcIconScout : IconscoutControl ( IconScoutAssetType . LOTTIE ) ,
111+ srcDotLottie : withDefault ( StringControl , 'https://assets-v2.lottiefiles.com/a/9e7d8a50-1180-11ee-89a6-3b0ab1ca8a0e/hUfEwc6xNt.lottie' ) ,
105112 uuidIconScout : StringControl ,
106113 valueIconScout : withDefault ( ArrayOrJSONObjectControl , JSON . stringify ( { } ) ) ,
107114 speed : dropdownControl ( speedOptions , "1" ) ,
@@ -162,27 +169,50 @@ let JsonLottieTmpComp = (function () {
162169 rotate : props . container . rotation ,
163170 } }
164171 >
165- < Player
166- key = {
167- [ props . speed , props . animationStart , props . loop , props . value , props . keepLastFrame ] as any
168- }
169- keepLastFrame = { props . keepLastFrame }
170- autoplay = { props . animationStart === "auto" && true }
171- hover = { props . animationStart === "on hover" && true }
172- loop = { props . loop === "single" ? false : true }
173- speed = { Number ( props . speed ) }
174- src = {
175- props . sourceMode === 'advanced'
176- ? ( isEmpty ( props . valueIconScout ) ? '' : props . valueIconScout )
177- : props . value
178- }
179- style = { {
180- height : "100%" ,
181- width : "100%" ,
182- maxWidth : "100%" ,
183- maxHeight : "100%" ,
184- } }
185- />
172+ { props . sourceMode === 'dotLottie'
173+ ? (
174+ < DotLottiePlayer
175+ key = {
176+ [ props . speed , props . animationStart , props . loop , props . value , props . keepLastFrame ] as any
177+ }
178+ // keepLastFrame={props.keepLastFrame}
179+ autoplay = { props . animationStart === "auto" && true }
180+ playOnHover = { props . animationStart === "on hover" && true }
181+ loop = { props . loop === "single" ? false : true }
182+ speed = { Number ( props . speed ) }
183+ src = { props . srcDotLottie }
184+ style = { {
185+ height : "100%" ,
186+ width : "100%" ,
187+ maxWidth : "100%" ,
188+ maxHeight : "100%" ,
189+ } }
190+ />
191+ )
192+ : (
193+ < Player
194+ key = {
195+ [ props . speed , props . animationStart , props . loop , props . value , props . keepLastFrame ] as any
196+ }
197+ keepLastFrame = { props . keepLastFrame }
198+ autoplay = { props . animationStart === "auto" && true }
199+ hover = { props . animationStart === "on hover" && true }
200+ loop = { props . loop === "single" ? false : true }
201+ speed = { Number ( props . speed ) }
202+ src = {
203+ props . sourceMode === 'advanced'
204+ ? ( isEmpty ( props . valueIconScout ) ? '' : props . valueIconScout )
205+ : props . value
206+ }
207+ style = { {
208+ height : "100%" ,
209+ width : "100%" ,
210+ maxWidth : "100%" ,
211+ maxHeight : "100%" ,
212+ } }
213+ />
214+ )
215+ }
186216 </ div >
187217 </ div >
188218 ) ;
@@ -198,6 +228,9 @@ let JsonLottieTmpComp = (function () {
198228 { children . sourceMode . getView ( ) === 'standard' && children . value . propertyView ( {
199229 label : trans ( "jsonLottie.lottieJson" ) ,
200230 } ) }
231+ { children . sourceMode . getView ( ) === 'dotLottie' && children . srcDotLottie . propertyView ( {
232+ label : "Source" ,
233+ } ) }
201234 { children . sourceMode . getView ( ) === 'advanced' && children . srcIconScout . propertyView ( {
202235 label : "Lottie Source" ,
203236 } ) }
0 commit comments