55 NumberControl ,
66} from "comps/controls/codeControl" ;
77import { dropdownControl } from "comps/controls/dropdownControl" ;
8+ import { BoolControl } from "comps/controls/boolControl" ;
89import { styleControl } from "comps/controls/styleControl" ;
910import { LottieStyle } from "comps/controls/styleControlConstants" ;
1011import { trans } from "i18n" ;
@@ -22,27 +23,35 @@ import { defaultLottie } from "./jsonConstants";
2223 */
2324const animationStartOptions = [
2425 {
25- label : "Auto" ,
26+ label : trans ( "jsonLottie.auto" ) ,
2627 value : "auto" ,
2728 } ,
2829 {
29- label : "On Hover" ,
30+ label : trans ( "jsonLottie.onHover" ) ,
3031 value : "on hover" ,
3132 } ,
3233] as const ;
3334
3435const loopOptions = [
3536 {
36- label : "Single play" ,
37+ label : trans ( "jsonLottie.singlePlay" ) ,
3738 value : "single" ,
3839 } ,
3940 {
40- label : "Endless loop" ,
41+ label : trans ( "jsonLottie.endlessLoop" ) ,
4142 value : "endless" ,
4243 } ,
4344] as const ;
4445
4546const speedOptions = [
47+ {
48+ label : "0.5x" ,
49+ value : "0.5" ,
50+ } ,
51+ {
52+ label : "0.75x" ,
53+ value : "0.75" ,
54+ } ,
4655 {
4756 label : "1x" ,
4857 value : "1" ,
@@ -81,8 +90,8 @@ let JsonLottieTmpComp = (function () {
8190 backgroundColor : styleControl ( LottieStyle ) ,
8291 animationStart : dropdownControl ( animationStartOptions , "auto" ) ,
8392 loop : dropdownControl ( loopOptions , "single" ) ,
93+ keepLastFrame : BoolControl . DEFAULT_TRUE ,
8494 } ;
85-
8695 return new UICompBuilder ( childrenMap , ( props ) => {
8796 return (
8897 < div
@@ -95,8 +104,9 @@ let JsonLottieTmpComp = (function () {
95104 >
96105 < Player
97106 key = {
98- [ props . speed , props . animationStart , props . loop , props . value ] as any
107+ [ props . speed , props . animationStart , props . loop , props . value , props . keepLastFrame ] as any
99108 }
109+ keepLastFrame = { props . keepLastFrame }
100110 autoplay = { props . animationStart === "auto" && true }
101111 hover = { props . animationStart === "on hover" && true }
102112 loop = { props . loop === "single" ? false : true }
@@ -117,7 +127,7 @@ let JsonLottieTmpComp = (function () {
117127 < >
118128 < Section name = { sectionNames . basic } >
119129 { children . value . propertyView ( {
120- label : trans ( "lottieJson" ) ,
130+ label : trans ( "jsonLottie. lottieJson" ) ,
121131 } ) }
122132 { children . speed . propertyView ( {
123133 label : trans ( "jsonLottie.speed" ) ,
@@ -128,6 +138,9 @@ let JsonLottieTmpComp = (function () {
128138 { children . animationStart . propertyView ( {
129139 label : trans ( "jsonLottie.animationStart" ) ,
130140 } ) }
141+ { children . keepLastFrame . propertyView ( {
142+ label : trans ( "jsonLottie.keepLastFrame" ) ,
143+ } ) }
131144 </ Section >
132145 < Section name = { sectionNames . style } >
133146 { children . backgroundColor . getPropertyView ( ) }
0 commit comments