@rocapine/react-native-onboarding-ui 1.38.2 → 1.39.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/UI/Pages/ComposableScreen/elements/AnimatedTextElement.d.ts +319 -0
- package/dist/UI/Pages/ComposableScreen/elements/AnimatedTextElement.d.ts.map +1 -0
- package/dist/UI/Pages/ComposableScreen/elements/AnimatedTextElement.js +173 -0
- package/dist/UI/Pages/ComposableScreen/elements/AnimatedTextElement.js.map +1 -0
- package/dist/UI/Pages/ComposableScreen/elements/ProgressIndicatorElement.d.ts.map +1 -1
- package/dist/UI/Pages/ComposableScreen/elements/ProgressIndicatorElement.js +31 -21
- package/dist/UI/Pages/ComposableScreen/elements/ProgressIndicatorElement.js.map +1 -1
- package/dist/UI/Pages/ComposableScreen/elements/renderElement.d.ts.map +1 -1
- package/dist/UI/Pages/ComposableScreen/elements/renderElement.js +4 -0
- package/dist/UI/Pages/ComposableScreen/elements/renderElement.js.map +1 -1
- package/dist/UI/Pages/ComposableScreen/types.d.ts +8 -0
- package/dist/UI/Pages/ComposableScreen/types.d.ts.map +1 -1
- package/dist/UI/Pages/ComposableScreen/types.js +8 -0
- package/dist/UI/Pages/ComposableScreen/types.js.map +1 -1
- package/package.json +1 -1
- package/src/UI/Pages/ComposableScreen/elements/AnimatedTextElement.tsx +191 -0
- package/src/UI/Pages/ComposableScreen/elements/ProgressIndicatorElement.tsx +51 -28
- package/src/UI/Pages/ComposableScreen/elements/renderElement.tsx +5 -0
- package/src/UI/Pages/ComposableScreen/types.ts +19 -0
|
@@ -0,0 +1,319 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
import { BaseBoxProps } from "./BaseBoxProps";
|
|
4
|
+
import { UIElement } from "../types";
|
|
5
|
+
import { RenderContext } from "./shared";
|
|
6
|
+
type AnimatedEasing = "linear" | "ease-in" | "ease-out" | "ease-in-out";
|
|
7
|
+
export type AnimatedTextElementProps = BaseBoxProps & {
|
|
8
|
+
from?: number;
|
|
9
|
+
to: number;
|
|
10
|
+
duration?: number;
|
|
11
|
+
delay?: number;
|
|
12
|
+
easing?: AnimatedEasing;
|
|
13
|
+
autoplay?: boolean;
|
|
14
|
+
loop?: boolean;
|
|
15
|
+
decimals?: number;
|
|
16
|
+
thousandsSeparator?: string;
|
|
17
|
+
fontSize?: number;
|
|
18
|
+
fontWeight?: string;
|
|
19
|
+
fontFamily?: string | "inherit";
|
|
20
|
+
fontStyle?: "normal" | "italic";
|
|
21
|
+
color?: string;
|
|
22
|
+
textAlign?: "left" | "center" | "right";
|
|
23
|
+
letterSpacing?: number;
|
|
24
|
+
lineHeight?: number;
|
|
25
|
+
};
|
|
26
|
+
export declare const AnimatedTextElementPropsSchema: z.ZodObject<{
|
|
27
|
+
width: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>;
|
|
28
|
+
height: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>;
|
|
29
|
+
minWidth: z.ZodOptional<z.ZodNumber>;
|
|
30
|
+
maxWidth: z.ZodOptional<z.ZodNumber>;
|
|
31
|
+
minHeight: z.ZodOptional<z.ZodNumber>;
|
|
32
|
+
maxHeight: z.ZodOptional<z.ZodNumber>;
|
|
33
|
+
flex: z.ZodOptional<z.ZodNumber>;
|
|
34
|
+
flexShrink: z.ZodOptional<z.ZodNumber>;
|
|
35
|
+
flexGrow: z.ZodOptional<z.ZodNumber>;
|
|
36
|
+
aspectRatio: z.ZodOptional<z.ZodNumber>;
|
|
37
|
+
alignSelf: z.ZodOptional<z.ZodEnum<{
|
|
38
|
+
auto: "auto";
|
|
39
|
+
center: "center";
|
|
40
|
+
"flex-start": "flex-start";
|
|
41
|
+
"flex-end": "flex-end";
|
|
42
|
+
stretch: "stretch";
|
|
43
|
+
baseline: "baseline";
|
|
44
|
+
}>>;
|
|
45
|
+
opacity: z.ZodOptional<z.ZodNumber>;
|
|
46
|
+
backgroundColor: z.ZodOptional<z.ZodString>;
|
|
47
|
+
backgroundGradient: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
48
|
+
type: z.ZodLiteral<"linear">;
|
|
49
|
+
from: z.ZodEnum<{
|
|
50
|
+
left: "left";
|
|
51
|
+
right: "right";
|
|
52
|
+
top: "top";
|
|
53
|
+
bottom: "bottom";
|
|
54
|
+
topLeft: "topLeft";
|
|
55
|
+
topRight: "topRight";
|
|
56
|
+
bottomLeft: "bottomLeft";
|
|
57
|
+
bottomRight: "bottomRight";
|
|
58
|
+
}>;
|
|
59
|
+
to: z.ZodEnum<{
|
|
60
|
+
left: "left";
|
|
61
|
+
right: "right";
|
|
62
|
+
top: "top";
|
|
63
|
+
bottom: "bottom";
|
|
64
|
+
topLeft: "topLeft";
|
|
65
|
+
topRight: "topRight";
|
|
66
|
+
bottomLeft: "bottomLeft";
|
|
67
|
+
bottomRight: "bottomRight";
|
|
68
|
+
}>;
|
|
69
|
+
stops: z.ZodArray<z.ZodObject<{
|
|
70
|
+
color: z.ZodString;
|
|
71
|
+
position: z.ZodOptional<z.ZodNumber>;
|
|
72
|
+
}, z.core.$strip>>;
|
|
73
|
+
}, z.core.$strip>], "type">>;
|
|
74
|
+
overflow: z.ZodOptional<z.ZodEnum<{
|
|
75
|
+
visible: "visible";
|
|
76
|
+
hidden: "hidden";
|
|
77
|
+
scroll: "scroll";
|
|
78
|
+
}>>;
|
|
79
|
+
margin: z.ZodOptional<z.ZodNumber>;
|
|
80
|
+
marginHorizontal: z.ZodOptional<z.ZodNumber>;
|
|
81
|
+
marginVertical: z.ZodOptional<z.ZodNumber>;
|
|
82
|
+
padding: z.ZodOptional<z.ZodNumber>;
|
|
83
|
+
paddingHorizontal: z.ZodOptional<z.ZodNumber>;
|
|
84
|
+
paddingVertical: z.ZodOptional<z.ZodNumber>;
|
|
85
|
+
borderWidth: z.ZodOptional<z.ZodNumber>;
|
|
86
|
+
borderRadius: z.ZodOptional<z.ZodNumber>;
|
|
87
|
+
borderColor: z.ZodOptional<z.ZodString>;
|
|
88
|
+
shadowColor: z.ZodOptional<z.ZodString>;
|
|
89
|
+
shadowOffset: z.ZodOptional<z.ZodObject<{
|
|
90
|
+
width: z.ZodNumber;
|
|
91
|
+
height: z.ZodNumber;
|
|
92
|
+
}, z.core.$strip>>;
|
|
93
|
+
shadowOpacity: z.ZodOptional<z.ZodNumber>;
|
|
94
|
+
shadowRadius: z.ZodOptional<z.ZodNumber>;
|
|
95
|
+
elevation: z.ZodOptional<z.ZodNumber>;
|
|
96
|
+
transform: z.ZodOptional<z.ZodObject<{
|
|
97
|
+
translateX: z.ZodOptional<z.ZodNumber>;
|
|
98
|
+
translateY: z.ZodOptional<z.ZodNumber>;
|
|
99
|
+
scale: z.ZodOptional<z.ZodNumber>;
|
|
100
|
+
scaleX: z.ZodOptional<z.ZodNumber>;
|
|
101
|
+
scaleY: z.ZodOptional<z.ZodNumber>;
|
|
102
|
+
rotate: z.ZodOptional<z.ZodNumber>;
|
|
103
|
+
}, z.core.$strip>>;
|
|
104
|
+
animation: z.ZodOptional<z.ZodObject<{
|
|
105
|
+
entering: z.ZodOptional<z.ZodObject<{
|
|
106
|
+
preset: z.ZodEnum<{
|
|
107
|
+
FadeIn: "FadeIn";
|
|
108
|
+
FadeInUp: "FadeInUp";
|
|
109
|
+
FadeInDown: "FadeInDown";
|
|
110
|
+
FadeInLeft: "FadeInLeft";
|
|
111
|
+
FadeInRight: "FadeInRight";
|
|
112
|
+
SlideInUp: "SlideInUp";
|
|
113
|
+
SlideInDown: "SlideInDown";
|
|
114
|
+
SlideInLeft: "SlideInLeft";
|
|
115
|
+
SlideInRight: "SlideInRight";
|
|
116
|
+
ZoomIn: "ZoomIn";
|
|
117
|
+
ZoomInRotate: "ZoomInRotate";
|
|
118
|
+
ZoomInUp: "ZoomInUp";
|
|
119
|
+
ZoomInDown: "ZoomInDown";
|
|
120
|
+
ZoomInLeft: "ZoomInLeft";
|
|
121
|
+
ZoomInRight: "ZoomInRight";
|
|
122
|
+
ZoomInEasyUp: "ZoomInEasyUp";
|
|
123
|
+
ZoomInEasyDown: "ZoomInEasyDown";
|
|
124
|
+
BounceIn: "BounceIn";
|
|
125
|
+
BounceInUp: "BounceInUp";
|
|
126
|
+
BounceInDown: "BounceInDown";
|
|
127
|
+
BounceInLeft: "BounceInLeft";
|
|
128
|
+
BounceInRight: "BounceInRight";
|
|
129
|
+
FlipInXUp: "FlipInXUp";
|
|
130
|
+
FlipInYLeft: "FlipInYLeft";
|
|
131
|
+
FlipInXDown: "FlipInXDown";
|
|
132
|
+
FlipInYRight: "FlipInYRight";
|
|
133
|
+
FlipInEasyX: "FlipInEasyX";
|
|
134
|
+
FlipInEasyY: "FlipInEasyY";
|
|
135
|
+
StretchInX: "StretchInX";
|
|
136
|
+
StretchInY: "StretchInY";
|
|
137
|
+
RotateInDownLeft: "RotateInDownLeft";
|
|
138
|
+
RotateInDownRight: "RotateInDownRight";
|
|
139
|
+
RotateInUpLeft: "RotateInUpLeft";
|
|
140
|
+
RotateInUpRight: "RotateInUpRight";
|
|
141
|
+
RollInLeft: "RollInLeft";
|
|
142
|
+
RollInRight: "RollInRight";
|
|
143
|
+
PinwheelIn: "PinwheelIn";
|
|
144
|
+
LightSpeedInLeft: "LightSpeedInLeft";
|
|
145
|
+
LightSpeedInRight: "LightSpeedInRight";
|
|
146
|
+
}>;
|
|
147
|
+
duration: z.ZodOptional<z.ZodNumber>;
|
|
148
|
+
delay: z.ZodOptional<z.ZodNumber>;
|
|
149
|
+
easing: z.ZodOptional<z.ZodEnum<{
|
|
150
|
+
linear: "linear";
|
|
151
|
+
"ease-in": "ease-in";
|
|
152
|
+
"ease-out": "ease-out";
|
|
153
|
+
"ease-in-out": "ease-in-out";
|
|
154
|
+
}>>;
|
|
155
|
+
spring: z.ZodOptional<z.ZodObject<{
|
|
156
|
+
damping: z.ZodOptional<z.ZodNumber>;
|
|
157
|
+
stiffness: z.ZodOptional<z.ZodNumber>;
|
|
158
|
+
mass: z.ZodOptional<z.ZodNumber>;
|
|
159
|
+
}, z.core.$strip>>;
|
|
160
|
+
}, z.core.$strip>>;
|
|
161
|
+
exiting: z.ZodOptional<z.ZodObject<{
|
|
162
|
+
preset: z.ZodEnum<{
|
|
163
|
+
FadeOut: "FadeOut";
|
|
164
|
+
FadeOutUp: "FadeOutUp";
|
|
165
|
+
FadeOutDown: "FadeOutDown";
|
|
166
|
+
FadeOutLeft: "FadeOutLeft";
|
|
167
|
+
FadeOutRight: "FadeOutRight";
|
|
168
|
+
SlideOutUp: "SlideOutUp";
|
|
169
|
+
SlideOutDown: "SlideOutDown";
|
|
170
|
+
SlideOutLeft: "SlideOutLeft";
|
|
171
|
+
SlideOutRight: "SlideOutRight";
|
|
172
|
+
ZoomOut: "ZoomOut";
|
|
173
|
+
ZoomOutRotate: "ZoomOutRotate";
|
|
174
|
+
ZoomOutUp: "ZoomOutUp";
|
|
175
|
+
ZoomOutDown: "ZoomOutDown";
|
|
176
|
+
ZoomOutLeft: "ZoomOutLeft";
|
|
177
|
+
ZoomOutRight: "ZoomOutRight";
|
|
178
|
+
ZoomOutEasyUp: "ZoomOutEasyUp";
|
|
179
|
+
ZoomOutEasyDown: "ZoomOutEasyDown";
|
|
180
|
+
BounceOut: "BounceOut";
|
|
181
|
+
BounceOutUp: "BounceOutUp";
|
|
182
|
+
BounceOutDown: "BounceOutDown";
|
|
183
|
+
BounceOutLeft: "BounceOutLeft";
|
|
184
|
+
BounceOutRight: "BounceOutRight";
|
|
185
|
+
FlipOutXUp: "FlipOutXUp";
|
|
186
|
+
FlipOutYLeft: "FlipOutYLeft";
|
|
187
|
+
FlipOutXDown: "FlipOutXDown";
|
|
188
|
+
FlipOutYRight: "FlipOutYRight";
|
|
189
|
+
FlipOutEasyX: "FlipOutEasyX";
|
|
190
|
+
FlipOutEasyY: "FlipOutEasyY";
|
|
191
|
+
StretchOutX: "StretchOutX";
|
|
192
|
+
StretchOutY: "StretchOutY";
|
|
193
|
+
RotateOutDownLeft: "RotateOutDownLeft";
|
|
194
|
+
RotateOutDownRight: "RotateOutDownRight";
|
|
195
|
+
RotateOutUpLeft: "RotateOutUpLeft";
|
|
196
|
+
RotateOutUpRight: "RotateOutUpRight";
|
|
197
|
+
RollOutLeft: "RollOutLeft";
|
|
198
|
+
RollOutRight: "RollOutRight";
|
|
199
|
+
PinwheelOut: "PinwheelOut";
|
|
200
|
+
LightSpeedOutLeft: "LightSpeedOutLeft";
|
|
201
|
+
LightSpeedOutRight: "LightSpeedOutRight";
|
|
202
|
+
}>;
|
|
203
|
+
duration: z.ZodOptional<z.ZodNumber>;
|
|
204
|
+
delay: z.ZodOptional<z.ZodNumber>;
|
|
205
|
+
easing: z.ZodOptional<z.ZodEnum<{
|
|
206
|
+
linear: "linear";
|
|
207
|
+
"ease-in": "ease-in";
|
|
208
|
+
"ease-out": "ease-out";
|
|
209
|
+
"ease-in-out": "ease-in-out";
|
|
210
|
+
}>>;
|
|
211
|
+
spring: z.ZodOptional<z.ZodObject<{
|
|
212
|
+
damping: z.ZodOptional<z.ZodNumber>;
|
|
213
|
+
stiffness: z.ZodOptional<z.ZodNumber>;
|
|
214
|
+
mass: z.ZodOptional<z.ZodNumber>;
|
|
215
|
+
}, z.core.$strip>>;
|
|
216
|
+
}, z.core.$strip>>;
|
|
217
|
+
layout: z.ZodOptional<z.ZodObject<{
|
|
218
|
+
preset: z.ZodEnum<{
|
|
219
|
+
LinearTransition: "LinearTransition";
|
|
220
|
+
FadingTransition: "FadingTransition";
|
|
221
|
+
SequencedTransition: "SequencedTransition";
|
|
222
|
+
JumpingTransition: "JumpingTransition";
|
|
223
|
+
CurvedTransition: "CurvedTransition";
|
|
224
|
+
EntryExitTransition: "EntryExitTransition";
|
|
225
|
+
}>;
|
|
226
|
+
duration: z.ZodOptional<z.ZodNumber>;
|
|
227
|
+
spring: z.ZodOptional<z.ZodObject<{
|
|
228
|
+
damping: z.ZodOptional<z.ZodNumber>;
|
|
229
|
+
stiffness: z.ZodOptional<z.ZodNumber>;
|
|
230
|
+
mass: z.ZodOptional<z.ZodNumber>;
|
|
231
|
+
}, z.core.$strip>>;
|
|
232
|
+
}, z.core.$strip>>;
|
|
233
|
+
effect: z.ZodOptional<z.ZodObject<{
|
|
234
|
+
preset: z.ZodEnum<{
|
|
235
|
+
rotate: "rotate";
|
|
236
|
+
pulse: "pulse";
|
|
237
|
+
fade: "fade";
|
|
238
|
+
shimmer: "shimmer";
|
|
239
|
+
bounce: "bounce";
|
|
240
|
+
}>;
|
|
241
|
+
duration: z.ZodOptional<z.ZodNumber>;
|
|
242
|
+
delay: z.ZodOptional<z.ZodNumber>;
|
|
243
|
+
easing: z.ZodOptional<z.ZodEnum<{
|
|
244
|
+
linear: "linear";
|
|
245
|
+
"ease-in": "ease-in";
|
|
246
|
+
"ease-out": "ease-out";
|
|
247
|
+
"ease-in-out": "ease-in-out";
|
|
248
|
+
}>>;
|
|
249
|
+
loop: z.ZodOptional<z.ZodBoolean>;
|
|
250
|
+
minScale: z.ZodOptional<z.ZodNumber>;
|
|
251
|
+
maxScale: z.ZodOptional<z.ZodNumber>;
|
|
252
|
+
minOpacity: z.ZodOptional<z.ZodNumber>;
|
|
253
|
+
degrees: z.ZodOptional<z.ZodNumber>;
|
|
254
|
+
}, z.core.$strip>>;
|
|
255
|
+
}, z.core.$strip>>;
|
|
256
|
+
onPress: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodLiteral<"continue">, z.ZodObject<{
|
|
257
|
+
type: z.ZodLiteral<"custom">;
|
|
258
|
+
function: z.ZodString;
|
|
259
|
+
variables: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
260
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
261
|
+
type: z.ZodLiteral<"setVariable">;
|
|
262
|
+
name: z.ZodString;
|
|
263
|
+
value: z.ZodString;
|
|
264
|
+
label: z.ZodOptional<z.ZodString>;
|
|
265
|
+
valueMode: z.ZodOptional<z.ZodEnum<{
|
|
266
|
+
literal: "literal";
|
|
267
|
+
expression: "expression";
|
|
268
|
+
}>>;
|
|
269
|
+
kind: z.ZodOptional<z.ZodEnum<{
|
|
270
|
+
string: "string";
|
|
271
|
+
int: "int";
|
|
272
|
+
float: "float";
|
|
273
|
+
}>>;
|
|
274
|
+
arrayOp: z.ZodOptional<z.ZodEnum<{
|
|
275
|
+
append: "append";
|
|
276
|
+
remove: "remove";
|
|
277
|
+
toggle: "toggle";
|
|
278
|
+
}>>;
|
|
279
|
+
}, z.core.$strip>]>>>;
|
|
280
|
+
from: z.ZodOptional<z.ZodNumber>;
|
|
281
|
+
to: z.ZodNumber;
|
|
282
|
+
duration: z.ZodOptional<z.ZodNumber>;
|
|
283
|
+
delay: z.ZodOptional<z.ZodNumber>;
|
|
284
|
+
easing: z.ZodOptional<z.ZodEnum<{
|
|
285
|
+
linear: "linear";
|
|
286
|
+
"ease-in": "ease-in";
|
|
287
|
+
"ease-out": "ease-out";
|
|
288
|
+
"ease-in-out": "ease-in-out";
|
|
289
|
+
}>>;
|
|
290
|
+
autoplay: z.ZodOptional<z.ZodBoolean>;
|
|
291
|
+
loop: z.ZodOptional<z.ZodBoolean>;
|
|
292
|
+
decimals: z.ZodOptional<z.ZodNumber>;
|
|
293
|
+
thousandsSeparator: z.ZodOptional<z.ZodString>;
|
|
294
|
+
fontSize: z.ZodOptional<z.ZodNumber>;
|
|
295
|
+
fontWeight: z.ZodOptional<z.ZodString>;
|
|
296
|
+
fontFamily: z.ZodOptional<z.ZodString>;
|
|
297
|
+
fontStyle: z.ZodOptional<z.ZodEnum<{
|
|
298
|
+
normal: "normal";
|
|
299
|
+
italic: "italic";
|
|
300
|
+
}>>;
|
|
301
|
+
color: z.ZodOptional<z.ZodString>;
|
|
302
|
+
textAlign: z.ZodOptional<z.ZodEnum<{
|
|
303
|
+
left: "left";
|
|
304
|
+
right: "right";
|
|
305
|
+
center: "center";
|
|
306
|
+
}>>;
|
|
307
|
+
letterSpacing: z.ZodOptional<z.ZodNumber>;
|
|
308
|
+
lineHeight: z.ZodOptional<z.ZodNumber>;
|
|
309
|
+
}, z.core.$strip>;
|
|
310
|
+
type AnimatedTextUIElement = Extract<UIElement, {
|
|
311
|
+
type: "AnimatedText";
|
|
312
|
+
}>;
|
|
313
|
+
type Props = {
|
|
314
|
+
element: AnimatedTextUIElement;
|
|
315
|
+
ctx: RenderContext;
|
|
316
|
+
};
|
|
317
|
+
export declare const AnimatedTextElementComponent: ({ element, ctx }: Props) => React.ReactElement;
|
|
318
|
+
export {};
|
|
319
|
+
//# sourceMappingURL=AnimatedTextElement.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AnimatedTextElement.d.ts","sourceRoot":"","sources":["../../../../../src/UI/Pages/ComposableScreen/elements/AnimatedTextElement.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAoB,MAAM,OAAO,CAAC;AAEzC,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAUxB,OAAO,EAAE,YAAY,EAAsB,MAAM,gBAAgB,CAAC;AAClE,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AACrC,OAAO,EAAE,aAAa,EAAyD,MAAM,UAAU,CAAC;AAGhG,KAAK,cAAc,GAAG,QAAQ,GAAG,SAAS,GAAG,UAAU,GAAG,aAAa,CAAC;AAExE,MAAM,MAAM,wBAAwB,GAAG,YAAY,GAAG;IACpD,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,cAAc,CAAC;IACxB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAChC,SAAS,CAAC,EAAE,QAAQ,GAAG,QAAQ,CAAC;IAChC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,GAAG,QAAQ,GAAG,OAAO,CAAC;IACxC,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB,CAAC;AAIF,eAAO,MAAM,8BAA8B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAkBzC,CAAC;AAQH,KAAK,qBAAqB,GAAG,OAAO,CAAC,SAAS,EAAE;IAAE,IAAI,EAAE,cAAc,CAAA;CAAE,CAAC,CAAC;AAE1E,KAAK,KAAK,GAAG;IACX,OAAO,EAAE,qBAAqB,CAAC;IAC/B,GAAG,EAAE,aAAa,CAAC;CACpB,CAAC;AAEF,eAAO,MAAM,4BAA4B,GAAI,kBAAkB,KAAK,KAAG,KAAK,CAAC,YAoH5E,CAAC"}
|
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.AnimatedTextElementComponent = exports.AnimatedTextElementPropsSchema = void 0;
|
|
37
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
38
|
+
const react_1 = __importStar(require("react"));
|
|
39
|
+
const react_native_1 = require("react-native");
|
|
40
|
+
const zod_1 = require("zod");
|
|
41
|
+
const react_native_reanimated_1 = __importStar(require("react-native-reanimated"));
|
|
42
|
+
const react_native_onboarding_1 = require("@rocapine/react-native-onboarding");
|
|
43
|
+
const BaseBoxProps_1 = require("./BaseBoxProps");
|
|
44
|
+
const shared_1 = require("./shared");
|
|
45
|
+
const buildAnimation_1 = require("./buildAnimation");
|
|
46
|
+
const EasingSchema = zod_1.z.enum(["linear", "ease-in", "ease-out", "ease-in-out"]);
|
|
47
|
+
exports.AnimatedTextElementPropsSchema = BaseBoxProps_1.BaseBoxPropsSchema.extend({
|
|
48
|
+
from: zod_1.z.number().optional(),
|
|
49
|
+
to: zod_1.z.number(),
|
|
50
|
+
duration: zod_1.z.number().min(0).optional(),
|
|
51
|
+
delay: zod_1.z.number().min(0).optional(),
|
|
52
|
+
easing: EasingSchema.optional(),
|
|
53
|
+
autoplay: zod_1.z.boolean().optional(),
|
|
54
|
+
loop: zod_1.z.boolean().optional(),
|
|
55
|
+
decimals: zod_1.z.number().int().min(0).optional(),
|
|
56
|
+
thousandsSeparator: zod_1.z.string().optional(),
|
|
57
|
+
fontSize: zod_1.z.number().optional(),
|
|
58
|
+
fontWeight: zod_1.z.string().optional(),
|
|
59
|
+
fontFamily: zod_1.z.string().optional(),
|
|
60
|
+
fontStyle: zod_1.z.enum(["normal", "italic"]).optional(),
|
|
61
|
+
color: zod_1.z.string().optional(),
|
|
62
|
+
textAlign: zod_1.z.enum(["left", "center", "right"]).optional(),
|
|
63
|
+
letterSpacing: zod_1.z.number().optional(),
|
|
64
|
+
lineHeight: zod_1.z.number().optional(),
|
|
65
|
+
});
|
|
66
|
+
// react-native-redash's ReText trick: TextInput's native `text` prop can be set
|
|
67
|
+
// from a reanimated worklet via useAnimatedProps, so the number updates on the
|
|
68
|
+
// UI thread WITHOUT a React re-render. (RN <Text> can't — its content is a
|
|
69
|
+
// child, not an animatable prop.)
|
|
70
|
+
const AnimatedTextInput = react_native_reanimated_1.default.createAnimatedComponent(react_native_1.TextInput);
|
|
71
|
+
const AnimatedTextElementComponent = ({ element, ctx }) => {
|
|
72
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
|
|
73
|
+
const { theme } = ctx;
|
|
74
|
+
const p = element.props;
|
|
75
|
+
const from = (_a = p.from) !== null && _a !== void 0 ? _a : 0;
|
|
76
|
+
const to = p.to;
|
|
77
|
+
const duration = (_b = p.duration) !== null && _b !== void 0 ? _b : 1000;
|
|
78
|
+
const delay = (_c = p.delay) !== null && _c !== void 0 ? _c : 0;
|
|
79
|
+
const easing = buildAnimation_1.EASING_MAP[(_d = p.easing) !== null && _d !== void 0 ? _d : "ease-out"];
|
|
80
|
+
const autoplay = (_e = p.autoplay) !== null && _e !== void 0 ? _e : true;
|
|
81
|
+
const loop = (_f = p.loop) !== null && _f !== void 0 ? _f : false;
|
|
82
|
+
const decimals = (_g = p.decimals) !== null && _g !== void 0 ? _g : 0;
|
|
83
|
+
const separator = (_h = p.thousandsSeparator) !== null && _h !== void 0 ? _h : ",";
|
|
84
|
+
// Text-style defaults inherited from a parent `RichText` container (empty
|
|
85
|
+
// otherwise). Element props always win over inherited values.
|
|
86
|
+
const inherited = react_1.default.useContext(shared_1.RichTextStyleContext);
|
|
87
|
+
const fontSize = (_j = p.fontSize) !== null && _j !== void 0 ? _j : inherited.fontSize;
|
|
88
|
+
const fontWeight = (_k = p.fontWeight) !== null && _k !== void 0 ? _k : inherited.fontWeight;
|
|
89
|
+
const fontStyle = (_l = p.fontStyle) !== null && _l !== void 0 ? _l : inherited.fontStyle;
|
|
90
|
+
const color = (_m = p.color) !== null && _m !== void 0 ? _m : inherited.color;
|
|
91
|
+
const textAlign = (_o = p.textAlign) !== null && _o !== void 0 ? _o : inherited.textAlign;
|
|
92
|
+
const letterSpacing = (_p = p.letterSpacing) !== null && _p !== void 0 ? _p : inherited.letterSpacing;
|
|
93
|
+
const lineHeight = (_q = p.lineHeight) !== null && _q !== void 0 ? _q : inherited.lineHeight;
|
|
94
|
+
const inheritedFontFamily = (0, shared_1.resolveInheritedFontFamily)((_r = p.fontFamily) !== null && _r !== void 0 ? _r : inherited.fontFamily, theme.typography.defaultFontFamily);
|
|
95
|
+
const resolvedFont = (0, react_native_onboarding_1.useResolvedFontStyle)(inheritedFontFamily, fontWeight);
|
|
96
|
+
// 0 -> 1 driver, lives on the UI thread.
|
|
97
|
+
const progress = (0, react_native_reanimated_1.useSharedValue)(autoplay ? 0 : 1);
|
|
98
|
+
(0, react_1.useEffect)(() => {
|
|
99
|
+
if (!autoplay)
|
|
100
|
+
return;
|
|
101
|
+
progress.value = 0;
|
|
102
|
+
const anim = (0, react_native_reanimated_1.withTiming)(1, { duration, easing });
|
|
103
|
+
const looped = loop ? (0, react_native_reanimated_1.withRepeat)(anim, -1, false) : anim;
|
|
104
|
+
progress.value = delay > 0 ? (0, react_native_reanimated_1.withDelay)(delay, looped) : looped;
|
|
105
|
+
return () => (0, react_native_reanimated_1.cancelAnimation)(progress);
|
|
106
|
+
}, [autoplay, loop, duration, delay, easing]);
|
|
107
|
+
// Worklet: maps the driver to the formatted number and writes it to the
|
|
108
|
+
// native TextInput. No JS closure (formatNumber is inlined), only primitives
|
|
109
|
+
// captured — re-keyed via the deps array. No React re-render fires.
|
|
110
|
+
const animatedProps = (0, react_native_reanimated_1.useAnimatedProps)(() => {
|
|
111
|
+
const raw = from + (to - from) * progress.value;
|
|
112
|
+
const factor = Math.pow(10, decimals);
|
|
113
|
+
const rounded = Math.round(raw * factor) / factor;
|
|
114
|
+
let str = rounded.toFixed(decimals);
|
|
115
|
+
if (separator !== "") {
|
|
116
|
+
const neg = str[0] === "-";
|
|
117
|
+
if (neg)
|
|
118
|
+
str = str.slice(1);
|
|
119
|
+
const dot = str.indexOf(".");
|
|
120
|
+
const intPart = dot === -1 ? str : str.slice(0, dot);
|
|
121
|
+
const decPart = dot === -1 ? "" : str.slice(dot);
|
|
122
|
+
let grouped = "";
|
|
123
|
+
for (let i = 0; i < intPart.length; i++) {
|
|
124
|
+
if (i > 0 && (intPart.length - i) % 3 === 0)
|
|
125
|
+
grouped += separator;
|
|
126
|
+
grouped += intPart[i];
|
|
127
|
+
}
|
|
128
|
+
str = (neg ? "-" : "") + grouped + decPart;
|
|
129
|
+
}
|
|
130
|
+
// `text` is TextInput's native prop, not in the public props type.
|
|
131
|
+
// `defaultValue` MUST be driven here too: once the count finishes, `progress`
|
|
132
|
+
// is constant and this worklet stops pushing `text`. A parent re-render then
|
|
133
|
+
// reconciles the TextInput and reverts the (uncontrolled) native value to its
|
|
134
|
+
// `defaultValue` — a static mount-time defaultValue would snap the display
|
|
135
|
+
// back to `from`. Keeping defaultValue in sync makes the fallback the live value.
|
|
136
|
+
return { text: str, defaultValue: str };
|
|
137
|
+
}, [from, to, decimals, separator]);
|
|
138
|
+
return ((0, jsx_runtime_1.jsx)(AnimatedTextInput, { editable: false, pointerEvents: "none", caretHidden: true, contextMenuHidden: true, underlineColorAndroid: "transparent", accessibilityRole: "text", animatedProps: animatedProps, style: {
|
|
139
|
+
// Neutralize TextInput defaults so it lays out like <Text>.
|
|
140
|
+
padding: 0,
|
|
141
|
+
includeFontPadding: false,
|
|
142
|
+
flex: p.flex,
|
|
143
|
+
flexShrink: p.flexShrink,
|
|
144
|
+
flexGrow: p.flexGrow,
|
|
145
|
+
alignSelf: p.alignSelf,
|
|
146
|
+
width: (0, shared_1.dim)(p.width),
|
|
147
|
+
height: (0, shared_1.dim)(p.height),
|
|
148
|
+
minWidth: p.minWidth,
|
|
149
|
+
maxWidth: p.maxWidth,
|
|
150
|
+
minHeight: p.minHeight,
|
|
151
|
+
maxHeight: p.maxHeight,
|
|
152
|
+
fontSize,
|
|
153
|
+
fontWeight: resolvedFont.resolvedToVariant ? undefined : fontWeight,
|
|
154
|
+
fontFamily: resolvedFont.fontFamily,
|
|
155
|
+
fontStyle,
|
|
156
|
+
color: color !== null && color !== void 0 ? color : theme.colors.text.primary,
|
|
157
|
+
textAlign,
|
|
158
|
+
letterSpacing,
|
|
159
|
+
lineHeight,
|
|
160
|
+
backgroundColor: p.backgroundColor,
|
|
161
|
+
margin: p.margin,
|
|
162
|
+
marginHorizontal: p.marginHorizontal,
|
|
163
|
+
marginVertical: p.marginVertical,
|
|
164
|
+
paddingHorizontal: p.paddingHorizontal,
|
|
165
|
+
paddingVertical: p.paddingVertical,
|
|
166
|
+
borderWidth: p.borderWidth,
|
|
167
|
+
borderRadius: p.borderRadius,
|
|
168
|
+
borderColor: p.borderColor,
|
|
169
|
+
opacity: p.opacity,
|
|
170
|
+
} }));
|
|
171
|
+
};
|
|
172
|
+
exports.AnimatedTextElementComponent = AnimatedTextElementComponent;
|
|
173
|
+
//# sourceMappingURL=AnimatedTextElement.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AnimatedTextElement.js","sourceRoot":"","sources":["../../../../../src/UI/Pages/ComposableScreen/elements/AnimatedTextElement.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAAyC;AACzC,+CAAyC;AACzC,6BAAwB;AACxB,mFAOiC;AACjC,+EAAyE;AACzE,iDAAkE;AAElE,qCAAgG;AAChG,qDAA8C;AAwB9C,MAAM,YAAY,GAAG,OAAC,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE,SAAS,EAAE,UAAU,EAAE,aAAa,CAAC,CAAC,CAAC;AAEjE,QAAA,8BAA8B,GAAG,iCAAkB,CAAC,MAAM,CAAC;IACtE,IAAI,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC3B,EAAE,EAAE,OAAC,CAAC,MAAM,EAAE;IACd,QAAQ,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE;IACtC,KAAK,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE;IACnC,MAAM,EAAE,YAAY,CAAC,QAAQ,EAAE;IAC/B,QAAQ,EAAE,OAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;IAChC,IAAI,EAAE,OAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;IAC5B,QAAQ,EAAE,OA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B,EAAE,CAAC,CAAC,iBAAiB;YACtC,eAAe,EAAE,CAAC,CAAC,eAAe;YAClC,WAAW,EAAE,CAAC,CAAC,WAAW;YAC1B,YAAY,EAAE,CAAC,CAAC,YAAY;YAC5B,WAAW,EAAE,CAAC,CAAC,WAAW;YAC1B,OAAO,EAAE,CAAC,CAAC,OAAO;SACnB,GACD,CACH,CAAC;AACJ,CAAC,CAAC;AApHW,QAAA,4BAA4B,gCAoHvC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProgressIndicatorElement.d.ts","sourceRoot":"","sources":["../../../../../src/UI/Pages/ComposableScreen/elements/ProgressIndicatorElement.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"ProgressIndicatorElement.d.ts","sourceRoot":"","sources":["../../../../../src/UI/Pages/ComposableScreen/elements/ProgressIndicatorElement.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAoB,MAAM,OAAO,CAAC;AAEzC,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAaxB,OAAO,EAAE,YAAY,EAAsB,MAAM,gBAAgB,CAAC;AAClE,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AACrC,OAAO,EAAE,aAAa,EAAO,MAAM,UAAU,CAAC;AAG9C,MAAM,MAAM,cAAc,GAAG,QAAQ,GAAG,SAAS,GAAG,UAAU,GAAG,aAAa,CAAC;AAE/E,MAAM,MAAM,6BAA6B,GAAG,YAAY,GAAG;IACzD,OAAO,CAAC,EAAE,QAAQ,GAAG,UAAU,CAAC;IAChC,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,cAAc,CAAC;IACxB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB,CAAC;AAIF,eAAO,MAAM,mCAAmC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAoB9C,CAAC;AAWH,KAAK,iBAAiB,GAAG,OAAO,CAAC,SAAS,EAAE;IAAE,IAAI,EAAE,mBAAmB,CAAA;CAAE,CAAC,CAAC;AAE3E,KAAK,KAAK,GAAG;IACX,OAAO,EAAE,iBAAiB,CAAC;IAC3B,GAAG,EAAE,aAAa,CAAC;CACpB,CAAC;AAEF,eAAO,MAAM,iCAAiC,GAAI,kBAAkB,KAAK,KAAG,KAAK,CAAC,YAkOjF,CAAC"}
|
|
@@ -66,6 +66,11 @@ exports.ProgressIndicatorElementPropsSchema = BaseBoxProps_1.BaseBoxPropsSchema.
|
|
|
66
66
|
labelColor: zod_1.z.string().optional(),
|
|
67
67
|
});
|
|
68
68
|
const AnimatedCircle = react_native_reanimated_1.default.createAnimatedComponent(react_native_svg_1.Circle);
|
|
69
|
+
// Native TextInput label driven from a worklet (like AnimatedText) so the
|
|
70
|
+
// `showLabel` value updates on the UI thread with NO React re-render — a
|
|
71
|
+
// `useState` label would re-render this component on every step hop and churn
|
|
72
|
+
// the reanimated mapper scheduler (destabilizing other on-screen animations).
|
|
73
|
+
const AnimatedTextInput = react_native_reanimated_1.default.createAnimatedComponent(react_native_1.TextInput);
|
|
69
74
|
const clamp = (n, min, max) => Math.max(min, Math.min(max, n));
|
|
70
75
|
const ProgressIndicatorElementComponent = ({ element, ctx }) => {
|
|
71
76
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x;
|
|
@@ -86,17 +91,15 @@ const ProgressIndicatorElementComponent = ({ element, ctx }) => {
|
|
|
86
91
|
const color = (_l = props.color) !== null && _l !== void 0 ? _l : theme.colors.primary;
|
|
87
92
|
const trackColor = (_m = props.trackColor) !== null && _m !== void 0 ? _m : theme.colors.neutral.lower;
|
|
88
93
|
const labelColor = (_o = props.labelColor) !== null && _o !== void 0 ? _o : theme.colors.text.primary;
|
|
89
|
-
// Snap a raw value to `step` within [minValue, maxValue]. The label and the
|
|
90
|
-
// written variable carry the snapped value, not a percentage.
|
|
91
|
-
const snap = (v) => clamp(minValue + Math.round((v - minValue) / step) * step, minValue, maxValue);
|
|
92
94
|
// Bound variable value (input mode, non-autoplay) or static value. `progress`
|
|
93
95
|
// is the value in [minValue, maxValue]; the fill fraction is derived from it.
|
|
94
96
|
const boundRaw = props.variableName ? (_p = variables[props.variableName]) === null || _p === void 0 ? void 0 : _p.value : undefined;
|
|
95
97
|
const boundValue = boundRaw !== undefined ? clamp(Number(boundRaw) || 0, minValue, maxValue) : undefined;
|
|
96
98
|
const target = autoplay ? maxValue : clamp((_q = boundValue !== null && boundValue !== void 0 ? boundValue : props.value) !== null && _q !== void 0 ? _q : initialValue, minValue, maxValue);
|
|
97
99
|
const progress = (0, react_native_reanimated_1.useSharedValue)(initialValue);
|
|
98
|
-
|
|
99
|
-
//
|
|
100
|
+
// (autoplay) Write the step-snapped value to the bound variable. The label is
|
|
101
|
+
// rendered natively (see labelAnimatedProps below), so it does NOT go through
|
|
102
|
+
// React state — this reaction's ONLY job is the variable write.
|
|
100
103
|
// Reaction input is the *step-snapped* value, so the JS callback fires only
|
|
101
104
|
// when the snapped value changes ((maxValue-minValue)/step hops/sweep) rather
|
|
102
105
|
// than every frame — avoids a per-frame context write storm (setVariable
|
|
@@ -110,15 +113,11 @@ const ProgressIndicatorElementComponent = ({ element, ctx }) => {
|
|
|
110
113
|
};
|
|
111
114
|
const writesVariable = autoplay && !!variableName;
|
|
112
115
|
// The dependency array is REQUIRED. Without it reanimated tears down and
|
|
113
|
-
// rebuilds this mapper on EVERY render
|
|
114
|
-
//
|
|
115
|
-
//
|
|
116
|
-
//
|
|
117
|
-
//
|
|
118
|
-
// Recreating also resets `prev` to undefined, defeating the `snapped === prev`
|
|
119
|
-
// guard so the JS callbacks over-fire. Keying on the values the worklet branches
|
|
120
|
-
// on (incl. minValue/maxValue/step) keeps the mapper stable; the JS fns it calls
|
|
121
|
-
// (setDisplayValue, setVariable via writeVariable) are already stable across renders.
|
|
116
|
+
// rebuilds this mapper on EVERY render, resetting `prev` to undefined and
|
|
117
|
+
// defeating the `snapped === prev` guard so the JS callback over-fires.
|
|
118
|
+
// Keying on the values the worklet branches on (minValue/maxValue/step) keeps
|
|
119
|
+
// the mapper stable; the JS fn it calls (setVariable via writeVariable) is
|
|
120
|
+
// already stable across renders.
|
|
122
121
|
(0, react_native_reanimated_1.useAnimatedReaction)(() => {
|
|
123
122
|
// Inline snap (worklet — can't call the JS `snap` closure). Captures the
|
|
124
123
|
// primitive minValue/maxValue/step (re-keyed via the deps array below).
|
|
@@ -127,11 +126,17 @@ const ProgressIndicatorElementComponent = ({ element, ctx }) => {
|
|
|
127
126
|
}, (snapped, prev) => {
|
|
128
127
|
if (snapped === prev)
|
|
129
128
|
return;
|
|
130
|
-
if (showLabel)
|
|
131
|
-
(0, react_native_reanimated_1.runOnJS)(setDisplayValue)(snapped);
|
|
132
129
|
if (writesVariable)
|
|
133
130
|
(0, react_native_reanimated_1.runOnJS)(writeVariable)(snapped);
|
|
134
|
-
}, [
|
|
131
|
+
}, [writesVariable, variableName, minValue, maxValue, step]);
|
|
132
|
+
// Native label text, formatted on the UI thread (snapped value + suffix).
|
|
133
|
+
// Mirrors AnimatedText: returns `defaultValue` too so a re-render reconcile
|
|
134
|
+
// can't revert the uncontrolled TextInput to a stale mount-time value.
|
|
135
|
+
const labelAnimatedProps = (0, react_native_reanimated_1.useAnimatedProps)(() => {
|
|
136
|
+
const snapped = Math.max(minValue, Math.min(maxValue, minValue + Math.round((progress.value - minValue) / step) * step));
|
|
137
|
+
const t = `${snapped}${labelSuffix}`;
|
|
138
|
+
return { text: t, defaultValue: t };
|
|
139
|
+
}, [minValue, maxValue, step, labelSuffix]);
|
|
135
140
|
// Autoplay: animate initialValue -> maxValue, optionally looping, after `delay`.
|
|
136
141
|
(0, react_1.useEffect)(() => {
|
|
137
142
|
if (!autoplay)
|
|
@@ -183,12 +188,15 @@ const ProgressIndicatorElementComponent = ({ element, ctx }) => {
|
|
|
183
188
|
paddingVertical: props.paddingVertical,
|
|
184
189
|
};
|
|
185
190
|
if (variant === "circular") {
|
|
186
|
-
return ((0, jsx_runtime_1.jsxs)(react_native_1.View, { style: [containerStyle, { width: size, height: size, alignItems: "center", justifyContent: "center" }], children: [(0, jsx_runtime_1.jsxs)(react_native_svg_1.default, { width: size, height: size, children: [(0, jsx_runtime_1.jsx)(react_native_svg_1.Circle, { cx: size / 2, cy: size / 2, r: radius, stroke: trackColor, strokeWidth: strokeWidth, fill: "none" }), (0, jsx_runtime_1.jsx)(AnimatedCircle, { cx: size / 2, cy: size / 2, r: radius, stroke: color, strokeWidth: strokeWidth, fill: "none", strokeDasharray: circumference, animatedProps: animatedCircleProps, strokeLinecap: "round", rotation: "-90", origin: `${size / 2}, ${size / 2}` })] }), props.showLabel ? ((0, jsx_runtime_1.jsx)(react_native_1.View, { style: { position: "absolute", alignItems: "center", justifyContent: "center" }, children: (0, jsx_runtime_1.
|
|
191
|
+
return ((0, jsx_runtime_1.jsxs)(react_native_1.View, { style: [containerStyle, { width: size, height: size, alignItems: "center", justifyContent: "center" }], children: [(0, jsx_runtime_1.jsxs)(react_native_svg_1.default, { width: size, height: size, children: [(0, jsx_runtime_1.jsx)(react_native_svg_1.Circle, { cx: size / 2, cy: size / 2, r: radius, stroke: trackColor, strokeWidth: strokeWidth, fill: "none" }), (0, jsx_runtime_1.jsx)(AnimatedCircle, { cx: size / 2, cy: size / 2, r: radius, stroke: color, strokeWidth: strokeWidth, fill: "none", strokeDasharray: circumference, animatedProps: animatedCircleProps, strokeLinecap: "round", rotation: "-90", origin: `${size / 2}, ${size / 2}` })] }), props.showLabel ? ((0, jsx_runtime_1.jsx)(react_native_1.View, { style: { position: "absolute", alignItems: "center", justifyContent: "center" }, children: (0, jsx_runtime_1.jsx)(AnimatedTextInput, { editable: false, pointerEvents: "none", caretHidden: true, contextMenuHidden: true, underlineColorAndroid: "transparent", accessibilityRole: "text", animatedProps: labelAnimatedProps, style: {
|
|
192
|
+
padding: 0,
|
|
193
|
+
includeFontPadding: false,
|
|
194
|
+
textAlign: "center",
|
|
187
195
|
color: labelColor,
|
|
188
196
|
fontSize: theme.typography.textStyles.heading2.fontSize,
|
|
189
197
|
fontWeight: theme.typography.fontWeight.bold,
|
|
190
198
|
fontFamily: theme.typography.textStyles.heading2.fontFamily,
|
|
191
|
-
}
|
|
199
|
+
} }) })) : null] }));
|
|
192
200
|
}
|
|
193
201
|
// Linear variant
|
|
194
202
|
const barHeight = (_u = props.thickness) !== null && _u !== void 0 ? _u : 8;
|
|
@@ -201,7 +209,9 @@ const ProgressIndicatorElementComponent = ({ element, ctx }) => {
|
|
|
201
209
|
}, children: (0, jsx_runtime_1.jsx)(react_native_reanimated_1.default.View, { style: [
|
|
202
210
|
{ height: "100%", backgroundColor: color, borderRadius: (_x = props.borderRadius) !== null && _x !== void 0 ? _x : barHeight / 2 },
|
|
203
211
|
animatedFillStyle,
|
|
204
|
-
] }) }), props.showLabel ? ((0, jsx_runtime_1.
|
|
212
|
+
] }) }), props.showLabel ? ((0, jsx_runtime_1.jsx)(AnimatedTextInput, { editable: false, pointerEvents: "none", caretHidden: true, contextMenuHidden: true, underlineColorAndroid: "transparent", accessibilityRole: "text", animatedProps: labelAnimatedProps, style: {
|
|
213
|
+
padding: 0,
|
|
214
|
+
includeFontPadding: false,
|
|
205
215
|
marginLeft: 12,
|
|
206
216
|
color: labelColor,
|
|
207
217
|
fontSize: theme.typography.textStyles.label.fontSize,
|
|
@@ -209,7 +219,7 @@ const ProgressIndicatorElementComponent = ({ element, ctx }) => {
|
|
|
209
219
|
fontFamily: theme.typography.textStyles.label.fontFamily,
|
|
210
220
|
minWidth: 44,
|
|
211
221
|
textAlign: "right",
|
|
212
|
-
}
|
|
222
|
+
} })) : null] }));
|
|
213
223
|
};
|
|
214
224
|
exports.ProgressIndicatorElementComponent = ProgressIndicatorElementComponent;
|
|
215
225
|
//# sourceMappingURL=ProgressIndicatorElement.js.map
|