5
5
NumberControl ,
6
6
} from "comps/controls/codeControl" ;
7
7
import { dropdownControl } from "comps/controls/dropdownControl" ;
8
+ import { BoolControl } from "comps/controls/boolControl" ;
8
9
import { styleControl } from "comps/controls/styleControl" ;
9
10
import { LottieStyle } from "comps/controls/styleControlConstants" ;
10
11
import { trans } from "i18n" ;
@@ -22,27 +23,35 @@ import { defaultLottie } from "./jsonConstants";
22
23
*/
23
24
const animationStartOptions = [
24
25
{
25
- label : "Auto" ,
26
+ label : trans ( "jsonLottie.auto" ) ,
26
27
value : "auto" ,
27
28
} ,
28
29
{
29
- label : "On Hover" ,
30
+ label : trans ( "jsonLottie.onHover" ) ,
30
31
value : "on hover" ,
31
32
} ,
32
33
] as const ;
33
34
34
35
const loopOptions = [
35
36
{
36
- label : "Single play" ,
37
+ label : trans ( "jsonLottie.singlePlay" ) ,
37
38
value : "single" ,
38
39
} ,
39
40
{
40
- label : "Endless loop" ,
41
+ label : trans ( "jsonLottie.endlessLoop" ) ,
41
42
value : "endless" ,
42
43
} ,
43
44
] as const ;
44
45
45
46
const speedOptions = [
47
+ {
48
+ label : "0.5x" ,
49
+ value : "0.5" ,
50
+ } ,
51
+ {
52
+ label : "0.75x" ,
53
+ value : "0.75" ,
54
+ } ,
46
55
{
47
56
label : "1x" ,
48
57
value : "1" ,
@@ -81,8 +90,8 @@ let JsonLottieTmpComp = (function () {
81
90
backgroundColor : styleControl ( LottieStyle ) ,
82
91
animationStart : dropdownControl ( animationStartOptions , "auto" ) ,
83
92
loop : dropdownControl ( loopOptions , "single" ) ,
93
+ keepLastFrame : BoolControl . DEFAULT_TRUE ,
84
94
} ;
85
-
86
95
return new UICompBuilder ( childrenMap , ( props ) => {
87
96
return (
88
97
< div
@@ -95,8 +104,9 @@ let JsonLottieTmpComp = (function () {
95
104
>
96
105
< Player
97
106
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
99
108
}
109
+ keepLastFrame = { props . keepLastFrame }
100
110
autoplay = { props . animationStart === "auto" && true }
101
111
hover = { props . animationStart === "on hover" && true }
102
112
loop = { props . loop === "single" ? false : true }
@@ -117,7 +127,7 @@ let JsonLottieTmpComp = (function () {
117
127
< >
118
128
< Section name = { sectionNames . basic } >
119
129
{ children . value . propertyView ( {
120
- label : trans ( "lottieJson" ) ,
130
+ label : trans ( "jsonLottie. lottieJson" ) ,
121
131
} ) }
122
132
{ children . speed . propertyView ( {
123
133
label : trans ( "jsonLottie.speed" ) ,
@@ -128,6 +138,9 @@ let JsonLottieTmpComp = (function () {
128
138
{ children . animationStart . propertyView ( {
129
139
label : trans ( "jsonLottie.animationStart" ) ,
130
140
} ) }
141
+ { children . keepLastFrame . propertyView ( {
142
+ label : trans ( "jsonLottie.keepLastFrame" ) ,
143
+ } ) }
131
144
</ Section >
132
145
< Section name = { sectionNames . style } >
133
146
{ children . backgroundColor . getPropertyView ( ) }
0 commit comments