@cuemath/leap 2.8.36-tables-hg1 → 2.8.36-tables-hg3
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/assets/lottie/lottie.js +1 -1
- package/dist/assets/lottie/lottie.js.map +1 -1
- package/dist/features/circle-games/game-launcher/comps/tables-card/tables-card.js +10 -10
- package/dist/features/circle-games/game-launcher/comps/tables-card/tables-card.js.map +1 -1
- package/dist/features/circle-games/game-launcher/game-launcher.js +1 -1
- package/dist/features/circle-games/game-launcher/game-launcher.js.map +1 -1
- package/dist/features/post-game-stats/digital-meter/digital-meter-styled.js +15 -14
- package/dist/features/post-game-stats/digital-meter/digital-meter-styled.js.map +1 -1
- package/dist/features/post-game-stats/digital-meter/digital-meter.js +90 -101
- package/dist/features/post-game-stats/digital-meter/digital-meter.js.map +1 -1
- package/dist/features/post-game-stats/enums/post-game-stats-enum.js +1 -1
- package/dist/features/post-game-stats/enums/post-game-stats-enum.js.map +1 -1
- package/dist/features/post-game-stats/post-game-stats.js +40 -45
- package/dist/features/post-game-stats/post-game-stats.js.map +1 -1
- package/dist/index.d.ts +10 -3
- package/package.json +1 -1
- package/dist/features/post-game-stats/accuracy/accuracy-comps.js +0 -11
- package/dist/features/post-game-stats/accuracy/accuracy-comps.js.map +0 -1
- package/dist/features/post-game-stats/accuracy/accuracy-styled.js +0 -68
- package/dist/features/post-game-stats/accuracy/accuracy-styled.js.map +0 -1
- package/dist/features/post-game-stats/accuracy/accuracy-utils.js +0 -20
- package/dist/features/post-game-stats/accuracy/accuracy-utils.js.map +0 -1
- package/dist/features/post-game-stats/accuracy/accuracy.js +0 -80
- package/dist/features/post-game-stats/accuracy/accuracy.js.map +0 -1
- package/dist/features/post-game-stats/accuracy/constants.js +0 -17
- package/dist/features/post-game-stats/accuracy/constants.js.map +0 -1
- package/dist/features/post-game-stats/clock/clock-styled.js +0 -51
- package/dist/features/post-game-stats/clock/clock-styled.js.map +0 -1
- package/dist/features/post-game-stats/clock/clock-util.js +0 -9
- package/dist/features/post-game-stats/clock/clock-util.js.map +0 -1
- package/dist/features/post-game-stats/clock/clock.js +0 -75
- package/dist/features/post-game-stats/clock/clock.js.map +0 -1
- package/dist/features/post-game-stats/clock/constants.js +0 -16
- package/dist/features/post-game-stats/clock/constants.js.map +0 -1
@@ -1,163 +1,152 @@
|
|
1
|
-
import { jsxs as
|
2
|
-
import b from "
|
3
|
-
import {
|
4
|
-
import {
|
5
|
-
import { GAME_LAUNCHER_SIZE as h } from "../../circle-games/game-launcher/comps/card-container/constants.js";
|
1
|
+
import { jsxs as n, jsx as r, Fragment as h } from "react/jsx-runtime";
|
2
|
+
import { memo as k, useState as b, useEffect as G } from "react";
|
3
|
+
import { LOTTIE as O } from "../../../assets/lottie/lottie.js";
|
4
|
+
import { GAME_LAUNCHER_SIZE as s } from "../../circle-games/game-launcher/comps/card-container/constants.js";
|
6
5
|
import E from "../../ui/layout/flex-view.js";
|
7
|
-
import
|
8
|
-
import
|
9
|
-
import { NumberCountAnimation as
|
10
|
-
import { AnimatedArc as
|
11
|
-
import { TARGET_ACHIEVED_DELAY as
|
12
|
-
import { DigitalMeter as
|
13
|
-
|
6
|
+
import W from "../../ui/separator/separator.js";
|
7
|
+
import p from "../../ui/text/text.js";
|
8
|
+
import { NumberCountAnimation as M } from "../number-count-animation/number-count-animation.js";
|
9
|
+
import { AnimatedArc as _ } from "./comp/animated-arc/animated-arc.js";
|
10
|
+
import { TARGET_ACHIEVED_DELAY as y, TOTAL_ANIMATION_DURATION as F, TOTAL_ARC_AVAILABLE as l, BORDER_OFFSET as $, PROGRESS_FILL_DURATION as T, PROGRESS_FILL_DELAY as f } from "./constants.js";
|
11
|
+
import { DigitalMeter as u, ContentContainer as w, NumberCountContainer as B, RainboxColorText as g, LineMarking as R, MarkingContainer as L, MarkingText as C, HelperTextWrapper as P, HelperTextPrimary as U, HelperTextSecondary as j } from "./digital-meter-styled.js";
|
12
|
+
import Y from "../../ui/lottie-animation/lottie-animation.js";
|
13
|
+
const ir = k(
|
14
14
|
({
|
15
|
-
show:
|
16
|
-
value:
|
17
|
-
maxValue:
|
18
|
-
targetValue:
|
19
|
-
displayText:
|
20
|
-
progressType:
|
21
|
-
helperTextPrimary:
|
22
|
-
helperTextSecondary:
|
23
|
-
onComplete:
|
15
|
+
show: a,
|
16
|
+
value: A,
|
17
|
+
maxValue: t,
|
18
|
+
targetValue: o = 0,
|
19
|
+
displayText: D,
|
20
|
+
progressType: m,
|
21
|
+
helperTextPrimary: H,
|
22
|
+
helperTextSecondary: N,
|
23
|
+
onComplete: I
|
24
24
|
}) => {
|
25
|
-
const [
|
26
|
-
return
|
27
|
-
let
|
28
|
-
return
|
29
|
-
|
30
|
-
},
|
31
|
-
|
32
|
-
},
|
33
|
-
|
25
|
+
const [c, S] = b(!1);
|
26
|
+
return G(() => {
|
27
|
+
let i, e;
|
28
|
+
return a && (i = setTimeout(() => {
|
29
|
+
A >= o && S(!0);
|
30
|
+
}, y * 1e3), e = setTimeout(() => {
|
31
|
+
I();
|
32
|
+
}, F * 1e3)), () => {
|
33
|
+
i && clearTimeout(i), e && clearTimeout(e);
|
34
34
|
};
|
35
|
-
}, [
|
36
|
-
|
37
|
-
|
38
|
-
r && b.loadAnimation({
|
39
|
-
container: I.current,
|
40
|
-
renderer: "svg",
|
41
|
-
loop: !0,
|
42
|
-
autoplay: !0,
|
43
|
-
animationData: r
|
44
|
-
});
|
45
|
-
})();
|
46
|
-
}, [n]), s ? /* @__PURE__ */ o(P, { $isTargetAchieved: n, children: [
|
47
|
-
/* @__PURE__ */ e(
|
48
|
-
f,
|
35
|
+
}, [a, A, o, I]), a ? /* @__PURE__ */ n(u, { $isTargetAchieved: c, children: [
|
36
|
+
/* @__PURE__ */ r(
|
37
|
+
_,
|
49
38
|
{
|
50
39
|
targetAngle: l,
|
51
40
|
strokeWidth: 16,
|
52
41
|
color: "BLACK_5",
|
53
|
-
radius: (
|
42
|
+
radius: (s - $) / 2,
|
54
43
|
duration: 0
|
55
44
|
}
|
56
45
|
),
|
57
|
-
/* @__PURE__ */
|
58
|
-
/* @__PURE__ */
|
59
|
-
/* @__PURE__ */
|
46
|
+
/* @__PURE__ */ r(w, { children: /* @__PURE__ */ n(E, { $flexDirection: "column", $alignItems: "center", children: [
|
47
|
+
/* @__PURE__ */ n(E, { $flexDirection: "row", $alignItems: "flex-end", children: [
|
48
|
+
/* @__PURE__ */ r(B, { children: /* @__PURE__ */ r(
|
60
49
|
g,
|
61
50
|
{
|
62
51
|
$renderAs: "ah1",
|
63
52
|
$color: "GREEN_4",
|
64
|
-
$isTargetAchieved:
|
65
|
-
children: /* @__PURE__ */
|
66
|
-
|
53
|
+
$isTargetAchieved: c,
|
54
|
+
children: /* @__PURE__ */ r(
|
55
|
+
M,
|
67
56
|
{
|
68
57
|
initialValue: 0,
|
69
|
-
targetValue:
|
70
|
-
durationInSec:
|
71
|
-
delayInSec:
|
58
|
+
targetValue: A,
|
59
|
+
durationInSec: T,
|
60
|
+
delayInSec: f
|
72
61
|
}
|
73
62
|
)
|
74
63
|
}
|
75
64
|
) }),
|
76
|
-
|
65
|
+
m === "stepper" && /* @__PURE__ */ n(p, { $renderAs: "ac2", $color: "WHITE", children: [
|
77
66
|
"/",
|
78
|
-
|
67
|
+
t
|
79
68
|
] })
|
80
69
|
] }),
|
81
|
-
/* @__PURE__ */
|
82
|
-
/* @__PURE__ */
|
70
|
+
/* @__PURE__ */ r(W, { height: 8 }),
|
71
|
+
/* @__PURE__ */ r(p, { $renderAs: "ac4-black", $color: "WHITE_T_60", children: D })
|
83
72
|
] }) }),
|
84
|
-
|
85
|
-
const d = l /
|
86
|
-
return /* @__PURE__ */
|
87
|
-
|
73
|
+
m === "stepper" && Array.from({ length: A }, (i, e) => {
|
74
|
+
const d = l / t;
|
75
|
+
return /* @__PURE__ */ r(
|
76
|
+
_,
|
88
77
|
{
|
89
|
-
startAngle: d *
|
78
|
+
startAngle: d * e,
|
90
79
|
targetAngle: d,
|
91
80
|
strokeWidth: 12,
|
92
81
|
color: "GREEN_4",
|
93
|
-
radius: (
|
82
|
+
radius: (s - $) / 2,
|
94
83
|
mode: "fade",
|
95
|
-
duration:
|
96
|
-
delay:
|
97
|
-
playRainbowColors:
|
84
|
+
duration: T / t,
|
85
|
+
delay: f + T / t * e,
|
86
|
+
playRainbowColors: c
|
98
87
|
},
|
99
|
-
|
88
|
+
e
|
100
89
|
);
|
101
90
|
}),
|
102
|
-
|
103
|
-
const d = l /
|
104
|
-
return /* @__PURE__ */
|
105
|
-
/* @__PURE__ */
|
106
|
-
/* @__PURE__ */
|
91
|
+
m === "stepper" && Array.from({ length: t + 1 }, (i, e) => {
|
92
|
+
const d = l / t;
|
93
|
+
return /* @__PURE__ */ n(h, { children: [
|
94
|
+
/* @__PURE__ */ r(R, { $angle: d * e }, e + "linemarking"),
|
95
|
+
/* @__PURE__ */ r(L, { $angle: d * e, children: /* @__PURE__ */ r(C, { $angle: d * e, children: /* @__PURE__ */ r(
|
107
96
|
g,
|
108
97
|
{
|
109
98
|
$renderAs: "ac4-black",
|
110
|
-
$isTargetAchieved:
|
111
|
-
$color:
|
112
|
-
children:
|
99
|
+
$isTargetAchieved: e === o && c,
|
100
|
+
$color: e === o ? "GREEN_4" : "WHITE_T_60",
|
101
|
+
children: e
|
113
102
|
}
|
114
|
-
) }) },
|
103
|
+
) }) }, e)
|
115
104
|
] });
|
116
105
|
}),
|
117
|
-
|
118
|
-
/* @__PURE__ */
|
119
|
-
|
106
|
+
m === "linear" && /* @__PURE__ */ n(h, { children: [
|
107
|
+
/* @__PURE__ */ r(
|
108
|
+
_,
|
120
109
|
{
|
121
|
-
targetAngle:
|
110
|
+
targetAngle: A * l / t,
|
122
111
|
strokeWidth: 12,
|
123
112
|
color: "GREEN_4",
|
124
|
-
radius: (
|
125
|
-
duration:
|
126
|
-
delay:
|
127
|
-
playRainbowColors:
|
113
|
+
radius: (s - $) / 2,
|
114
|
+
duration: T,
|
115
|
+
delay: f,
|
116
|
+
playRainbowColors: c
|
128
117
|
}
|
129
118
|
),
|
130
|
-
/* @__PURE__ */
|
131
|
-
/* @__PURE__ */
|
132
|
-
Array.from(/* @__PURE__ */ new Set([0,
|
133
|
-
|
119
|
+
/* @__PURE__ */ n(h, { children: [
|
120
|
+
/* @__PURE__ */ r(R, { $angle: o * l / t }),
|
121
|
+
Array.from(/* @__PURE__ */ new Set([0, o, t])).map((i, e) => /* @__PURE__ */ r(
|
122
|
+
L,
|
134
123
|
{
|
135
|
-
$angle:
|
136
|
-
children: /* @__PURE__ */
|
124
|
+
$angle: i * l / t,
|
125
|
+
children: /* @__PURE__ */ r(C, { $angle: i * l / t, children: /* @__PURE__ */ r(
|
137
126
|
g,
|
138
127
|
{
|
139
128
|
$renderAs: "ac4-black",
|
140
|
-
$color:
|
141
|
-
$isTargetAchieved:
|
142
|
-
children:
|
129
|
+
$color: i === o ? "GREEN_4" : "WHITE_T_60",
|
130
|
+
$isTargetAchieved: A >= i && c && i === o,
|
131
|
+
children: i
|
143
132
|
}
|
144
133
|
) })
|
145
134
|
},
|
146
|
-
|
135
|
+
e
|
147
136
|
))
|
148
137
|
] })
|
149
138
|
] }),
|
150
|
-
/* @__PURE__ */
|
151
|
-
|
152
|
-
!
|
153
|
-
/* @__PURE__ */
|
154
|
-
/* @__PURE__ */
|
139
|
+
/* @__PURE__ */ n(P, { children: [
|
140
|
+
c && /* @__PURE__ */ r(Y, { src: O.TARGET_ACHIEVED_TEXT }),
|
141
|
+
!c && /* @__PURE__ */ n(E, { $flexDirection: "column", $alignItems: "center", children: [
|
142
|
+
/* @__PURE__ */ r(U, { $renderAs: "ac4-black", $color: "WHITE_T_60", children: H }),
|
143
|
+
/* @__PURE__ */ r(j, { $renderAs: "ab1", $color: "WHITE", children: N })
|
155
144
|
] })
|
156
145
|
] })
|
157
146
|
] }) : null;
|
158
147
|
}
|
159
148
|
);
|
160
149
|
export {
|
161
|
-
|
150
|
+
ir as DigitalMeter
|
162
151
|
};
|
163
152
|
//# sourceMappingURL=digital-meter.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"digital-meter.js","sources":["../../../../src/features/post-game-stats/digital-meter/digital-meter.tsx"],"sourcesContent":["import type { IDigitalMeterProps } from './digital-meter-types';\nimport type { FC } from 'react';\n\nimport Lottie from 'lottie-web';\nimport { memo, useEffect, useRef, useState } from 'react';\n\nimport { LOTTIE } from '../../../assets/lottie/lottie';\nimport { GAME_LAUNCHER_SIZE } from '../../circle-games/game-launcher/comps/card-container/constants';\nimport FlexView from '../../ui/layout/flex-view';\nimport Separator from '../../ui/separator/separator';\nimport Text from '../../ui/text/text';\nimport { NumberCountAnimation } from '../number-count-animation/number-count-animation';\nimport { AnimatedArc } from './comp/animated-arc/animated-arc';\nimport {\n BORDER_OFFSET,\n PROGRESS_FILL_DELAY,\n PROGRESS_FILL_DURATION,\n TARGET_ACHIEVED_DELAY,\n TOTAL_ANIMATION_DURATION,\n TOTAL_ARC_AVAILABLE,\n} from './constants';\nimport * as Styled from './digital-meter-styled';\n\nconst taregetAchieved = () => import(LOTTIE.TARGET_ACHIEVED_TEXT);\n\nexport const DigitalMeter: FC<IDigitalMeterProps> = memo(\n ({\n show,\n value,\n maxValue,\n targetValue,\n displayText,\n progressType,\n helperTextPrimary,\n helperTextSecondary,\n onComplete,\n }) => {\n const [isTargetAchieved, setIsTargetAchieved] = useState(false);\n const targetAchievedLottieContainerRef = useRef<HTMLDivElement>(null);\n\n useEffect(() => {\n let timer: ReturnType<typeof setTimeout>;\n let timerForAnimationComplete: ReturnType<typeof setTimeout>;\n\n if (show) {\n timer = setTimeout(() => {\n if (value >= targetValue) {\n setIsTargetAchieved(true);\n }\n }, TARGET_ACHIEVED_DELAY * 1000);\n\n timerForAnimationComplete = setTimeout(() => {\n onComplete();\n }, TOTAL_ANIMATION_DURATION * 1000);\n }\n\n return () => {\n timer && clearTimeout(timer);\n timerForAnimationComplete && clearTimeout(timerForAnimationComplete);\n };\n }, [show, value, targetValue, onComplete]);\n\n useEffect(() => {\n if (isTargetAchieved) {\n const loadAnimation = async () => {\n const { default: lottie } = await taregetAchieved();\n\n if (lottie) {\n Lottie.loadAnimation({\n container: targetAchievedLottieContainerRef.current as HTMLDivElement,\n renderer: 'svg',\n loop: true,\n autoplay: true,\n animationData: lottie,\n });\n }\n };\n\n loadAnimation();\n }\n }, [isTargetAchieved]);\n\n if (show) {\n return (\n <Styled.DigitalMeter $isTargetAchieved={isTargetAchieved}>\n {/* complete arc area to be filled */}\n <AnimatedArc\n targetAngle={TOTAL_ARC_AVAILABLE}\n strokeWidth={16}\n color=\"BLACK_5\"\n radius={(GAME_LAUNCHER_SIZE - BORDER_OFFSET) / 2}\n duration={0}\n />\n\n {/* center area for the content */}\n <Styled.ContentContainer>\n <FlexView $flexDirection=\"column\" $alignItems=\"center\">\n <FlexView $flexDirection=\"row\" $alignItems=\"flex-end\">\n <Styled.NumberCountContainer>\n <Styled.RainboxColorText\n $renderAs=\"ah1\"\n $color=\"GREEN_4\"\n $isTargetAchieved={isTargetAchieved}\n >\n <NumberCountAnimation\n initialValue={0}\n targetValue={value}\n durationInSec={PROGRESS_FILL_DURATION}\n delayInSec={PROGRESS_FILL_DELAY}\n />\n </Styled.RainboxColorText>\n </Styled.NumberCountContainer>\n {progressType === 'stepper' && (\n <Text $renderAs=\"ac2\" $color=\"WHITE\">\n /{maxValue}\n </Text>\n )}\n </FlexView>\n <Separator height={8} />\n <Text $renderAs=\"ac4-black\" $color=\"WHITE_T_60\">\n {displayText}\n </Text>\n </FlexView>\n </Styled.ContentContainer>\n\n {/* stepper animation */}\n {progressType === 'stepper' &&\n Array.from({ length: value }, (_, index) => {\n const arcLength = TOTAL_ARC_AVAILABLE / maxValue;\n\n return (\n <AnimatedArc\n key={index}\n startAngle={arcLength * index}\n targetAngle={arcLength}\n strokeWidth={12}\n color=\"GREEN_4\"\n radius={(GAME_LAUNCHER_SIZE - BORDER_OFFSET) / 2}\n mode=\"fade\"\n duration={PROGRESS_FILL_DURATION / maxValue}\n delay={PROGRESS_FILL_DELAY + (PROGRESS_FILL_DURATION / maxValue) * index}\n playRainbowColors={isTargetAchieved}\n />\n );\n })}\n\n {/* numbers with markings */}\n {progressType === 'stepper' &&\n Array.from({ length: maxValue + 1 }, (_, index) => {\n const arcLength = TOTAL_ARC_AVAILABLE / maxValue;\n\n return (\n <>\n <Styled.LineMarking key={index + 'linemarking'} $angle={arcLength * index} />\n\n <Styled.MarkingContainer key={index} $angle={arcLength * index}>\n <Styled.MarkingText $angle={arcLength * index}>\n <Styled.RainboxColorText\n $renderAs=\"ac4-black\"\n $isTargetAchieved={index === targetValue && isTargetAchieved}\n $color={index === targetValue ? 'GREEN_4' : 'WHITE_T_60'}\n >\n {index}\n </Styled.RainboxColorText>\n </Styled.MarkingText>\n </Styled.MarkingContainer>\n </>\n );\n })}\n\n {/* progress of linear */}\n {progressType === 'linear' && (\n <>\n <AnimatedArc\n targetAngle={(value * TOTAL_ARC_AVAILABLE) / maxValue}\n strokeWidth={12}\n color=\"GREEN_4\"\n radius={(GAME_LAUNCHER_SIZE - BORDER_OFFSET) / 2}\n duration={PROGRESS_FILL_DURATION}\n delay={PROGRESS_FILL_DELAY}\n playRainbowColors={isTargetAchieved}\n />\n <>\n {/* target line marking */}\n <Styled.LineMarking $angle={(targetValue * TOTAL_ARC_AVAILABLE) / maxValue} />\n\n {/* all markings */}\n {Array.from(new Set([0, targetValue, maxValue])).map((val, index) => (\n <Styled.MarkingContainer\n key={index}\n $angle={(val * TOTAL_ARC_AVAILABLE) / maxValue}\n >\n <Styled.MarkingText $angle={(val * TOTAL_ARC_AVAILABLE) / maxValue}>\n <Styled.RainboxColorText\n $renderAs=\"ac4-black\"\n $color={val === targetValue ? 'GREEN_4' : 'WHITE_T_60'}\n $isTargetAchieved={value >= val && isTargetAchieved && val === targetValue}\n >\n {val}\n </Styled.RainboxColorText>\n </Styled.MarkingText>\n </Styled.MarkingContainer>\n ))}\n </>\n </>\n )}\n\n {/* helper text below the animation */}\n <Styled.HelperTextWrapper>\n {isTargetAchieved && (\n <Styled.TargetAchievedTextLottie ref={targetAchievedLottieContainerRef} />\n )}\n {!isTargetAchieved && (\n <FlexView $flexDirection=\"column\" $alignItems=\"center\">\n <Styled.HelperTextPrimary $renderAs=\"ac4-black\" $color=\"WHITE_T_60\">\n {helperTextPrimary}\n </Styled.HelperTextPrimary>\n <Styled.HelperTextSecondary $renderAs=\"ab1\" $color=\"WHITE\">\n {helperTextSecondary}\n </Styled.HelperTextSecondary>\n </FlexView>\n )}\n </Styled.HelperTextWrapper>\n </Styled.DigitalMeter>\n );\n }\n\n return null;\n },\n);\n"],"names":["taregetAchieved","LOTTIE","DigitalMeter","memo","show","value","maxValue","targetValue","displayText","progressType","helperTextPrimary","helperTextSecondary","onComplete","isTargetAchieved","setIsTargetAchieved","useState","targetAchievedLottieContainerRef","useRef","useEffect","timer","timerForAnimationComplete","TARGET_ACHIEVED_DELAY","TOTAL_ANIMATION_DURATION","lottie","Lottie","jsxs","Styled.DigitalMeter","jsx","AnimatedArc","TOTAL_ARC_AVAILABLE","GAME_LAUNCHER_SIZE","BORDER_OFFSET","Styled.ContentContainer","FlexView","Styled.NumberCountContainer","Styled.RainboxColorText","NumberCountAnimation","PROGRESS_FILL_DURATION","PROGRESS_FILL_DELAY","Text","Separator","_","index","arcLength","Fragment","Styled.LineMarking","Styled.MarkingContainer","Styled.MarkingText","val","Styled.HelperTextWrapper","Styled.TargetAchievedTextLottie","Styled.HelperTextPrimary","Styled.HelperTextSecondary"],"mappings":";;;;;;;;;;;;AAuBA,MAAMA,IAAkB,MAAM,OAAOC,EAAO,uBAE/BC,KAAuCC;AAAA,EAClD,CAAC;AAAA,IACC,MAAAC;AAAA,IACA,OAAAC;AAAA,IACA,UAAAC;AAAA,IACA,aAAAC;AAAA,IACA,aAAAC;AAAA,IACA,cAAAC;AAAA,IACA,mBAAAC;AAAA,IACA,qBAAAC;AAAA,IACA,YAAAC;AAAA,EAAA,MACI;AACJ,UAAM,CAACC,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AA;AAAA,YAXKN;AAAA,UAAA,CAaR;AAAA,QAAA,GACH;AAAA,MAAA,GACF;AAAA,MAIF,gBAAAjB,EAACwB,GAAA,EACE,UAAA;AAAA,QAAApC,KACE,gBAAAc,EAAAuB,GAAA,EAAgC,KAAKlC,EAAkC,CAAA;AAAA,QAEzE,CAACH,KACA,gBAAAY,EAACQ,KAAS,gBAAe,UAAS,aAAY,UAC5C,UAAA;AAAA,UAAA,gBAAAN,EAACwB,GAAA,EAAyB,WAAU,aAAY,QAAO,cACpD,UACHzC,GAAA;AAAA,UACA,gBAAAiB,EAACyB,GAAA,EAA2B,WAAU,OAAM,QAAO,SAChD,UACHzC,GAAA;AAAA,QAAA,GACF;AAAA,MAAA,GAEJ;AAAA,IACF,EAAA,CAAA,IAIG;AAAA,EACT;AACF;"}
|
1
|
+
{"version":3,"file":"digital-meter.js","sources":["../../../../src/features/post-game-stats/digital-meter/digital-meter.tsx"],"sourcesContent":["import type { IDigitalMeterProps } from './digital-meter-types';\nimport type { FC } from 'react';\n\nimport { memo, useEffect, useState } from 'react';\n\nimport { LOTTIE } from '../../../assets/lottie/lottie';\nimport { GAME_LAUNCHER_SIZE } from '../../circle-games/game-launcher/comps/card-container/constants';\nimport FlexView from '../../ui/layout/flex-view';\nimport Separator from '../../ui/separator/separator';\nimport Text from '../../ui/text/text';\nimport { NumberCountAnimation } from '../number-count-animation/number-count-animation';\nimport { AnimatedArc } from './comp/animated-arc/animated-arc';\nimport {\n BORDER_OFFSET,\n PROGRESS_FILL_DELAY,\n PROGRESS_FILL_DURATION,\n TARGET_ACHIEVED_DELAY,\n TOTAL_ANIMATION_DURATION,\n TOTAL_ARC_AVAILABLE,\n} from './constants';\nimport * as Styled from './digital-meter-styled';\nimport LottieAnimation from '../../ui/lottie-animation/lottie-animation';\n\nexport const DigitalMeter: FC<IDigitalMeterProps> = memo(\n ({\n show,\n value,\n maxValue,\n targetValue = 0,\n displayText,\n progressType,\n helperTextPrimary,\n helperTextSecondary,\n onComplete,\n }) => {\n const [isTargetAchieved, setIsTargetAchieved] = useState(false);\n\n useEffect(() => {\n let timer: ReturnType<typeof setTimeout>;\n let timerForAnimationComplete: ReturnType<typeof setTimeout>;\n\n if (show) {\n timer = setTimeout(() => {\n if (value >= targetValue) {\n setIsTargetAchieved(true);\n }\n }, TARGET_ACHIEVED_DELAY * 1000);\n\n timerForAnimationComplete = setTimeout(() => {\n onComplete();\n }, TOTAL_ANIMATION_DURATION * 1000);\n }\n\n return () => {\n timer && clearTimeout(timer);\n timerForAnimationComplete && clearTimeout(timerForAnimationComplete);\n };\n }, [show, value, targetValue, onComplete]);\n\n if (show) {\n return (\n <Styled.DigitalMeter $isTargetAchieved={isTargetAchieved}>\n {/* complete arc area to be filled */}\n <AnimatedArc\n targetAngle={TOTAL_ARC_AVAILABLE}\n strokeWidth={16}\n color=\"BLACK_5\"\n radius={(GAME_LAUNCHER_SIZE - BORDER_OFFSET) / 2}\n duration={0}\n />\n\n {/* center area for the content */}\n <Styled.ContentContainer>\n <FlexView $flexDirection=\"column\" $alignItems=\"center\">\n <FlexView $flexDirection=\"row\" $alignItems=\"flex-end\">\n <Styled.NumberCountContainer>\n <Styled.RainboxColorText\n $renderAs=\"ah1\"\n $color=\"GREEN_4\"\n $isTargetAchieved={isTargetAchieved}\n >\n <NumberCountAnimation\n initialValue={0}\n targetValue={value}\n durationInSec={PROGRESS_FILL_DURATION}\n delayInSec={PROGRESS_FILL_DELAY}\n />\n </Styled.RainboxColorText>\n </Styled.NumberCountContainer>\n {progressType === 'stepper' && (\n <Text $renderAs=\"ac2\" $color=\"WHITE\">\n /{maxValue}\n </Text>\n )}\n </FlexView>\n <Separator height={8} />\n <Text $renderAs=\"ac4-black\" $color=\"WHITE_T_60\">\n {displayText}\n </Text>\n </FlexView>\n </Styled.ContentContainer>\n\n {/* stepper animation */}\n {progressType === 'stepper' &&\n Array.from({ length: value }, (_, index) => {\n const arcLength = TOTAL_ARC_AVAILABLE / maxValue;\n\n return (\n <AnimatedArc\n key={index}\n startAngle={arcLength * index}\n targetAngle={arcLength}\n strokeWidth={12}\n color=\"GREEN_4\"\n radius={(GAME_LAUNCHER_SIZE - BORDER_OFFSET) / 2}\n mode=\"fade\"\n duration={PROGRESS_FILL_DURATION / maxValue}\n delay={PROGRESS_FILL_DELAY + (PROGRESS_FILL_DURATION / maxValue) * index}\n playRainbowColors={isTargetAchieved}\n />\n );\n })}\n\n {/* numbers with markings */}\n {progressType === 'stepper' &&\n Array.from({ length: maxValue + 1 }, (_, index) => {\n const arcLength = TOTAL_ARC_AVAILABLE / maxValue;\n\n return (\n <>\n <Styled.LineMarking key={index + 'linemarking'} $angle={arcLength * index} />\n\n <Styled.MarkingContainer key={index} $angle={arcLength * index}>\n <Styled.MarkingText $angle={arcLength * index}>\n <Styled.RainboxColorText\n $renderAs=\"ac4-black\"\n $isTargetAchieved={index === targetValue && isTargetAchieved}\n $color={index === targetValue ? 'GREEN_4' : 'WHITE_T_60'}\n >\n {index}\n </Styled.RainboxColorText>\n </Styled.MarkingText>\n </Styled.MarkingContainer>\n </>\n );\n })}\n\n {/* progress of linear */}\n {progressType === 'linear' && (\n <>\n <AnimatedArc\n targetAngle={(value * TOTAL_ARC_AVAILABLE) / maxValue}\n strokeWidth={12}\n color=\"GREEN_4\"\n radius={(GAME_LAUNCHER_SIZE - BORDER_OFFSET) / 2}\n duration={PROGRESS_FILL_DURATION}\n delay={PROGRESS_FILL_DELAY}\n playRainbowColors={isTargetAchieved}\n />\n <>\n {/* target line marking */}\n <Styled.LineMarking $angle={(targetValue * TOTAL_ARC_AVAILABLE) / maxValue} />\n\n {/* all markings */}\n {Array.from(new Set([0, targetValue, maxValue])).map((val, index) => (\n <Styled.MarkingContainer\n key={index}\n $angle={(val * TOTAL_ARC_AVAILABLE) / maxValue}\n >\n <Styled.MarkingText $angle={(val * TOTAL_ARC_AVAILABLE) / maxValue}>\n <Styled.RainboxColorText\n $renderAs=\"ac4-black\"\n $color={val === targetValue ? 'GREEN_4' : 'WHITE_T_60'}\n $isTargetAchieved={value >= val && isTargetAchieved && val === targetValue}\n >\n {val}\n </Styled.RainboxColorText>\n </Styled.MarkingText>\n </Styled.MarkingContainer>\n ))}\n </>\n </>\n )}\n\n {/* helper text below the animation */}\n <Styled.HelperTextWrapper>\n {isTargetAchieved && (\n <LottieAnimation src={LOTTIE.TARGET_ACHIEVED_TEXT} />\n )}\n {!isTargetAchieved && (\n <FlexView $flexDirection=\"column\" $alignItems=\"center\">\n <Styled.HelperTextPrimary $renderAs=\"ac4-black\" $color=\"WHITE_T_60\">\n {helperTextPrimary}\n </Styled.HelperTextPrimary>\n <Styled.HelperTextSecondary $renderAs=\"ab1\" $color=\"WHITE\">\n {helperTextSecondary}\n </Styled.HelperTextSecondary>\n </FlexView>\n )}\n </Styled.HelperTextWrapper>\n </Styled.DigitalMeter>\n );\n }\n\n return null;\n },\n);\n"],"names":["DigitalMeter","memo","show","value","maxValue","targetValue","displayText","progressType","helperTextPrimary","helperTextSecondary","onComplete","isTargetAchieved","setIsTargetAchieved","useState","useEffect","timer","timerForAnimationComplete","TARGET_ACHIEVED_DELAY","TOTAL_ANIMATION_DURATION","jsxs","Styled.DigitalMeter","jsx","AnimatedArc","TOTAL_ARC_AVAILABLE","GAME_LAUNCHER_SIZE","BORDER_OFFSET","Styled.ContentContainer","FlexView","Styled.NumberCountContainer","Styled.RainboxColorText","NumberCountAnimation","PROGRESS_FILL_DURATION","PROGRESS_FILL_DELAY","Text","Separator","_","index","arcLength","Fragment","Styled.LineMarking","Styled.MarkingContainer","Styled.MarkingText","val","Styled.HelperTextWrapper","LottieAnimation","LOTTIE","Styled.HelperTextPrimary","Styled.HelperTextSecondary"],"mappings":";;;;;;;;;;;;AAuBO,MAAMA,KAAuCC;AAAA,EAClD,CAAC;AAAA,IACC,MAAAC;AAAA,IACA,OAAAC;AAAA,IACA,UAAAC;AAAA,IACA,aAAAC,IAAc;AAAA,IACd,aAAAC;AAAA,IACA,cAAAC;AAAA,IACA,mBAAAC;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AS,aAAY,UAC5C,UAAA;AAAA,UAAA,gBAAAN,EAACyB,GAAA,EAAyB,WAAU,aAAY,QAAO,cACpD,UACHtC,GAAA;AAAA,UACA,gBAAAa,EAAC0B,GAAA,EAA2B,WAAU,OAAM,QAAO,SAChD,UACHtC,GAAA;AAAA,QAAA,GACF;AAAA,MAAA,GAEJ;AAAA,IACF,EAAA,CAAA,IAIG;AAAA,EACT;AACF;"}
|
@@ -1,4 +1,4 @@
|
|
1
|
-
var c = /* @__PURE__ */ ((r) => (r.STREAK = "streak", r.ACCURACY = "accuracy", r.CLOCK = "clock", r.POINT = "point", r))(c || {});
|
1
|
+
var c = /* @__PURE__ */ ((r) => (r.STREAK = "streak", r.ACCURACY = "accuracy", r.CLOCK = "clock", r.POINT = "point", r.DIGITAL_METER = "digital-meter", r))(c || {});
|
2
2
|
export {
|
3
3
|
c as EPostGameStat
|
4
4
|
};
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"post-game-stats-enum.js","sources":["../../../../src/features/post-game-stats/enums/post-game-stats-enum.ts"],"sourcesContent":["export enum EPostGameStat {\n STREAK = 'streak',\n ACCURACY = 'accuracy',\n CLOCK = 'clock',\n POINT = 'point',\n}\n"],"names":["EPostGameStat"],"mappings":"AAAY,IAAAA,sBAAAA,OACVA,EAAA,SAAS,UACTA,EAAA,WAAW,YACXA,EAAA,QAAQ,SACRA,EAAA,QAAQ,
|
1
|
+
{"version":3,"file":"post-game-stats-enum.js","sources":["../../../../src/features/post-game-stats/enums/post-game-stats-enum.ts"],"sourcesContent":["export enum EPostGameStat {\n STREAK = 'streak',\n ACCURACY = 'accuracy',\n CLOCK = 'clock',\n POINT = 'point',\n DIGITAL_METER = 'digital-meter',\n}\n"],"names":["EPostGameStat"],"mappings":"AAAY,IAAAA,sBAAAA,OACVA,EAAA,SAAS,UACTA,EAAA,WAAW,YACXA,EAAA,QAAQ,SACRA,EAAA,QAAQ,SACRA,EAAA,gBAAgB,iBALNA,IAAAA,KAAA,CAAA,CAAA;"}
|
@@ -1,70 +1,65 @@
|
|
1
|
-
import { jsxs as
|
2
|
-
import { memo as
|
3
|
-
import {
|
4
|
-
import {
|
5
|
-
import {
|
6
|
-
import {
|
7
|
-
import {
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
if ((c = (o = e[r]) == null ? void 0 : o.onComplete) == null || c.call(o), r === e.length - 1) {
|
1
|
+
import { jsxs as G, jsx as n } from "react/jsx-runtime";
|
2
|
+
import { memo as j, forwardRef as B, useState as C, useCallback as A, useImperativeHandle as D } from "react";
|
3
|
+
import { DigitalMeter as M } from "./digital-meter/digital-meter.js";
|
4
|
+
import { EPostGameStat as a } from "./enums/post-game-stats-enum.js";
|
5
|
+
import { Points as N } from "./points/points.js";
|
6
|
+
import { StatsWrapper as b, BlackBg as H } from "./post-game-stats-styled.js";
|
7
|
+
import { Streak as K } from "./streak/streak.js";
|
8
|
+
const J = j(
|
9
|
+
B(({ stats: e, show: E, onComplete: l }, k) => {
|
10
|
+
var i, t, u, x, T, h, f, y, S, c, d, v, g, P, R;
|
11
|
+
const [r, w] = C(0), p = A(() => {
|
12
|
+
var o, I;
|
13
|
+
if ((I = (o = e[r]) == null ? void 0 : o.onComplete) == null || I.call(o), r === e.length - 1) {
|
15
14
|
l == null || l();
|
16
15
|
return;
|
17
16
|
}
|
18
|
-
|
19
|
-
}, [r, l, e]), m =
|
17
|
+
w((V) => V + 1);
|
18
|
+
}, [r, l, e]), m = A(() => {
|
20
19
|
var o;
|
21
|
-
(o = e[r]) != null && o.stopAtEnd ||
|
22
|
-
}, [e, r,
|
23
|
-
return
|
24
|
-
moveToNextAndPlay:
|
25
|
-
})), !
|
26
|
-
/* @__PURE__ */ n(
|
20
|
+
(o = e[r]) != null && o.stopAtEnd || p();
|
21
|
+
}, [e, r, p]);
|
22
|
+
return D(k, () => ({
|
23
|
+
moveToNextAndPlay: p
|
24
|
+
})), !E || e.length === 0 || r >= e.length ? null : /* @__PURE__ */ G(b, { children: [
|
25
|
+
/* @__PURE__ */ n(H, {}),
|
27
26
|
/* @__PURE__ */ n(
|
28
|
-
|
27
|
+
N,
|
29
28
|
{
|
30
|
-
point: e[r].value,
|
31
|
-
show: e[r].type ===
|
29
|
+
point: ((i = e[r]) == null ? void 0 : i.value) ?? 0,
|
30
|
+
show: ((t = e[r]) == null ? void 0 : t.type) === a.POINT,
|
32
31
|
onComplete: m,
|
33
|
-
onReveal: (i = e[r]) == null ? void 0 : i.onReveal
|
34
|
-
}
|
35
|
-
),
|
36
|
-
/* @__PURE__ */ n(
|
37
|
-
P,
|
38
|
-
{
|
39
|
-
currStreak: e[r].value,
|
40
|
-
show: e[r].type === p.STREAK,
|
41
|
-
onComplete: m,
|
42
|
-
helperText: e[r].helperText,
|
43
32
|
onReveal: (u = e[r]) == null ? void 0 : u.onReveal
|
44
33
|
}
|
45
34
|
),
|
46
35
|
/* @__PURE__ */ n(
|
47
|
-
|
36
|
+
K,
|
48
37
|
{
|
49
|
-
|
50
|
-
show: e[r].type ===
|
38
|
+
currStreak: ((x = e[r]) == null ? void 0 : x.value) ?? 0,
|
39
|
+
show: ((T = e[r]) == null ? void 0 : T.type) === a.STREAK,
|
51
40
|
onComplete: m,
|
52
|
-
helperText: e[r].helperText
|
41
|
+
helperText: (h = e[r]) == null ? void 0 : h.helperText,
|
42
|
+
onReveal: (f = e[r]) == null ? void 0 : f.onReveal
|
53
43
|
}
|
54
44
|
),
|
55
45
|
/* @__PURE__ */ n(
|
56
|
-
|
46
|
+
M,
|
57
47
|
{
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
48
|
+
value: ((y = e[r]) == null ? void 0 : y.value) ?? 0,
|
49
|
+
maxValue: ((S = e[r]) == null ? void 0 : S.maxValue) ?? 1,
|
50
|
+
targetValue: ((c = e[r]) == null ? void 0 : c.targetValue) ?? 0,
|
51
|
+
displayText: ((d = e[r]) == null ? void 0 : d.displayText) ?? "",
|
52
|
+
progressType: ((v = e[r]) == null ? void 0 : v.progressType) ?? "linear",
|
53
|
+
helperTextPrimary: ((g = e[r]) == null ? void 0 : g.helperTextPrimary) ?? "",
|
54
|
+
helperTextSecondary: ((P = e[r]) == null ? void 0 : P.helperTextSecondary) ?? "",
|
55
|
+
show: ((R = e[r]) == null ? void 0 : R.type) === a.DIGITAL_METER,
|
56
|
+
onComplete: m
|
62
57
|
}
|
63
58
|
)
|
64
59
|
] });
|
65
60
|
})
|
66
61
|
);
|
67
62
|
export {
|
68
|
-
|
63
|
+
J as PostGameStats
|
69
64
|
};
|
70
65
|
//# sourceMappingURL=post-game-stats.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"post-game-stats.js","sources":["../../../src/features/post-game-stats/post-game-stats.tsx"],"sourcesContent":["import type { IPostGameStatsProps, IPostGameStatsRef } from './post-game-stats-types';\n\nimport { useState, memo, useCallback, forwardRef, useImperativeHandle } from 'react';\n\nimport {
|
1
|
+
{"version":3,"file":"post-game-stats.js","sources":["../../../src/features/post-game-stats/post-game-stats.tsx"],"sourcesContent":["import type { IPostGameStatsProps, IPostGameStatsRef } from './post-game-stats-types';\n\nimport { useState, memo, useCallback, forwardRef, useImperativeHandle } from 'react';\n\nimport { DigitalMeter } from './digital-meter/digital-meter';\nimport { EPostGameStat } from './enums/post-game-stats-enum';\nimport { Points } from './points/points';\nimport * as Styled from './post-game-stats-styled';\nimport { Streak } from './streak/streak';\n\nexport const PostGameStats = memo(\n forwardRef<IPostGameStatsRef, IPostGameStatsProps>(({ stats, show, onComplete }, ref) => {\n const [currStatIndex, setCurrentStatIndex] = useState(0);\n\n const moveToNextAndPlay = useCallback(() => {\n stats[currStatIndex]?.onComplete?.();\n\n if (currStatIndex === stats.length - 1) {\n onComplete?.();\n\n return;\n }\n setCurrentStatIndex(prev => prev + 1);\n }, [currStatIndex, onComplete, stats]);\n\n const onStatAnimationComplete = useCallback(() => {\n if (stats[currStatIndex]?.stopAtEnd) {\n return;\n }\n moveToNextAndPlay(); // Autoplay since stopAtEnd is false\n }, [stats, currStatIndex, moveToNextAndPlay]);\n\n useImperativeHandle(ref, () => ({\n moveToNextAndPlay,\n }));\n\n if (!show || stats.length === 0 || currStatIndex >= stats.length) {\n return null;\n }\n\n return (\n <Styled.StatsWrapper>\n <Styled.BlackBg />\n <Points\n point={stats[currStatIndex]?.value ?? 0}\n show={stats[currStatIndex]?.type === EPostGameStat.POINT}\n onComplete={onStatAnimationComplete}\n onReveal={stats[currStatIndex]?.onReveal}\n />\n <Streak\n currStreak={stats[currStatIndex]?.value ?? 0}\n show={stats[currStatIndex]!?.type === EPostGameStat.STREAK}\n onComplete={onStatAnimationComplete}\n helperText={stats[currStatIndex]?.helperText}\n onReveal={stats[currStatIndex]?.onReveal}\n />\n <DigitalMeter\n value={stats[currStatIndex]?.value ?? 0}\n maxValue={stats[currStatIndex]?.maxValue ?? 1}\n targetValue={stats[currStatIndex]?.targetValue ?? 0}\n displayText={stats[currStatIndex]?.displayText ?? ''}\n progressType={stats[currStatIndex]?.progressType ?? 'linear'}\n helperTextPrimary={stats[currStatIndex]?.helperTextPrimary ?? ''}\n helperTextSecondary={stats[currStatIndex]?.helperTextSecondary ?? ''}\n show={stats[currStatIndex]?.type === EPostGameStat.DIGITAL_METER}\n onComplete={onStatAnimationComplete}\n />\n </Styled.StatsWrapper>\n );\n }),\n);\n"],"names":["PostGameStats","memo","forwardRef","stats","show","onComplete","ref","currStatIndex","setCurrentStatIndex","useState","moveToNextAndPlay","useCallback","_b","_a","prev","onStatAnimationComplete","useImperativeHandle","jsxs","Styled.StatsWrapper","jsx","Styled.BlackBg","Points","EPostGameStat","_c","Streak","_d","_e","_f","_g","DigitalMeter","_h","_i","_j","_k","_l","_m","_n","_o"],"mappings":";;;;;;;AAUO,MAAMA,IAAgBC;AAAA,EAC3BC,EAAmD,CAAC,EAAE,OAAAC,GAAO,MAAAC,GAAM,YAAAC,EAAA,GAAcC,MAAQ;;AACvF,UAAM,CAACC,GAAeC,CAAmB,IAAIC,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AAAA,UAClC,WAAUC,IAAAzB,EAAMI,CAAa,MAAnB,gBAAAqB,EAAsB;AAAA,QAAA;AAAA,MAClC;AAAA,MACA,gBAAAT;AAAA,QAACU;AAAA,QAAA;AAAA,UACC,SAAOC,IAAA3B,EAAMI,CAAa,MAAnB,gBAAAuB,EAAsB,UAAS;AAAA,UACtC,YAAUC,IAAA5B,EAAMI,CAAa,MAAnB,gBAAAwB,EAAsB,aAAY;AAAA,UAC5C,eAAaC,IAAA7B,EAAMI,CAAa,MAAnB,gBAAAyB,EAAsB,gBAAe;AAAA,UAClD,eAAaC,IAAA9B,EAAMI,CAAa,MAAnB,gBAAA0B,EAAsB,gBAAe;AAAA,UAClD,gBAAcC,IAAA/B,EAAMI,CAAa,MAAnB,gBAAA2B,EAAsB,iBAAgB;AAAA,UACpD,qBAAmBC,IAAAhC,EAAMI,CAAa,MAAnB,gBAAA4B,EAAsB,sBAAqB;AAAA,UAC9D,uBAAqBC,IAAAjC,EAAMI,CAAa,MAAnB,gBAAA6B,EAAsB,wBAAuB;AAAA,UAClE,QAAMC,IAAAlC,EAAMI,CAAa,MAAnB,gBAAA8B,EAAsB,UAASf,EAAc;AAAA,UACnD,YAAYP;AAAA,QAAA;AAAA,MACd;AAAA,IACF,EAAA,CAAA;AAAA,EAAA,CAEH;AACH;"}
|
package/dist/index.d.ts
CHANGED
@@ -298,7 +298,8 @@ export declare enum EPostGameStat {
|
|
298
298
|
STREAK = "streak",
|
299
299
|
ACCURACY = "accuracy",
|
300
300
|
CLOCK = "clock",
|
301
|
-
POINT = "point"
|
301
|
+
POINT = "point",
|
302
|
+
DIGITAL_METER = "digital-meter"
|
302
303
|
}
|
303
304
|
|
304
305
|
export declare const EraserIcon: React.FC<React.SVGProps<SVGSVGElement>>;
|
@@ -1010,8 +1011,8 @@ declare interface IDigitalMeterProps {
|
|
1010
1011
|
show: boolean;
|
1011
1012
|
value: number;
|
1012
1013
|
maxValue: number;
|
1014
|
+
targetValue?: number;
|
1013
1015
|
displayText: string;
|
1014
|
-
targetValue: number;
|
1015
1016
|
progressType: 'stepper' | 'linear';
|
1016
1017
|
helperTextPrimary: string;
|
1017
1018
|
helperTextSecondary: string;
|
@@ -2093,6 +2094,12 @@ export declare interface IPostGameStat {
|
|
2093
2094
|
onComplete?: () => void;
|
2094
2095
|
helperText?: ReactNode;
|
2095
2096
|
stopAtEnd?: boolean;
|
2097
|
+
targetValue?: number;
|
2098
|
+
maxValue?: number;
|
2099
|
+
helperTextPrimary?: string;
|
2100
|
+
helperTextSecondary?: string;
|
2101
|
+
progressType?: 'linear' | 'stepper';
|
2102
|
+
displayText?: string;
|
2096
2103
|
}
|
2097
2104
|
|
2098
2105
|
export declare interface IPostGameStatsProps {
|
@@ -3373,8 +3380,8 @@ export declare const LOTTIE: {
|
|
3373
3380
|
SPINNER_WHITE: string;
|
3374
3381
|
SPLASH_SCREEN: string;
|
3375
3382
|
STAY_CONNECTED_LOTTIE: string;
|
3376
|
-
TARGET_ACHIEVED_TEXT: string;
|
3377
3383
|
TABLE_MODE_REVEAL: string;
|
3384
|
+
TARGET_ACHIEVED_TEXT: string;
|
3378
3385
|
TEACHER_VALIDATION: string;
|
3379
3386
|
TOTAL_STREAK: string;
|
3380
3387
|
TOTAL_TIME: string;
|
package/package.json
CHANGED
@@ -1,11 +0,0 @@
|
|
1
|
-
import { jsx as o } from "react/jsx-runtime";
|
2
|
-
import n from "../../ui/text/text.js";
|
3
|
-
import { useAnimatedValue as m } from "./accuracy-utils.js";
|
4
|
-
const u = ({ accuracy: e, time: r }) => {
|
5
|
-
const t = m(0, e, r);
|
6
|
-
return /* @__PURE__ */ o(n, { $renderAs: "ah3", $color: "WHITE", children: `${Math.round(t)}%` });
|
7
|
-
};
|
8
|
-
export {
|
9
|
-
u as AnimatedPercentTextInput
|
10
|
-
};
|
11
|
-
//# sourceMappingURL=accuracy-comps.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"accuracy-comps.js","sources":["../../../../src/features/post-game-stats/accuracy/accuracy-comps.tsx"],"sourcesContent":["import type { IAnimatedPercentTextProps } from './accuracy-types';\n\nimport Text from '../../ui/text/text';\nimport { useAnimatedValue } from './accuracy-utils';\n\nexport const AnimatedPercentTextInput = ({ accuracy, time }: IAnimatedPercentTextProps) => {\n const animatedValue = useAnimatedValue(0, accuracy, time);\n\n return <Text $renderAs=\"ah3\" $color=\"WHITE\">{`${Math.round(animatedValue)}%`}</Text>;\n};\n"],"names":["AnimatedPercentTextInput","accuracy","time","animatedValue","useAnimatedValue","jsx","Text"],"mappings":";;;AAKO,MAAMA,IAA2B,CAAC,EAAE,UAAAC,GAAU,MAAAC,QAAsC;AACzF,QAAMC,IAAgBC,EAAiB,GAAGH,GAAUC,CAAI;AAEjD,SAAA,gBAAAG,EAACC,GAAK,EAAA,WAAU,OAAM,QAAO,SAAS,UAAA,GAAG,KAAK,MAAMH,CAAa,CAAC,IAAI,CAAA;AAC/E;"}
|
@@ -1,68 +0,0 @@
|
|
1
|
-
import o, { keyframes as r, css as s } from "styled-components";
|
2
|
-
import { GAME_LAUNCHER_SIZE as t } from "../../circle-games/game-launcher/comps/card-container/constants.js";
|
3
|
-
import { GAME_LAUNCHER_ASSET_PADDING as a } from "../../circle-games/game-launcher/comps/segmented-game-card/constants.js";
|
4
|
-
const p = 50 * 84 / 100, c = r`
|
5
|
-
0%{
|
6
|
-
opacity: 0;
|
7
|
-
}
|
8
|
-
100%{
|
9
|
-
opacity: 1;
|
10
|
-
}
|
11
|
-
`, d = r`
|
12
|
-
0%{
|
13
|
-
opacity: 1;
|
14
|
-
}
|
15
|
-
100%{
|
16
|
-
opacity: 0;
|
17
|
-
}
|
18
|
-
`, m = o.div`
|
19
|
-
height: ${t}px;
|
20
|
-
width: ${t}px;
|
21
|
-
background: transparent;
|
22
|
-
display: flex;
|
23
|
-
align-items: center;
|
24
|
-
justify-content: center;
|
25
|
-
position: relative;
|
26
|
-
`, $ = o.div`
|
27
|
-
height: ${t + a}px;
|
28
|
-
width: ${t + a}px;
|
29
|
-
position: absolute;
|
30
|
-
flex: 1;
|
31
|
-
z-index: 1;
|
32
|
-
`, y = o.div`
|
33
|
-
height: ${t + a}px;
|
34
|
-
width: ${t + a}px;
|
35
|
-
position: absolute;
|
36
|
-
z-index: 2;
|
37
|
-
transform: ${({ $translateX: e = 0, $translateY: i = 0, $rotate: n = 0 }) => `translateX(${e}px) translateY(${i}px) rotate(${n}deg)`};
|
38
|
-
`, A = o.div`
|
39
|
-
height: 100%;
|
40
|
-
width: 100%;
|
41
|
-
`, h = o.div`
|
42
|
-
z-index: 2;
|
43
|
-
opacity: 0;
|
44
|
-
position: absolute;
|
45
|
-
animation: ${({ $animationType: e, $duration: i, $delay: n }) => s`
|
46
|
-
${e === "fadein" ? c : d} ${i}ms ${n}ms ease forwards
|
47
|
-
`};
|
48
|
-
transform: translateY(${(t + p) * 84 / 200 + 25}px);
|
49
|
-
`, u = o.div`
|
50
|
-
position: absolute;
|
51
|
-
z-index: 20;
|
52
|
-
display: flex;
|
53
|
-
flex-direction: row;
|
54
|
-
align-items: flex-end;
|
55
|
-
|
56
|
-
${({ $animationType: e, $duration: i }) => e && i && s`
|
57
|
-
animation: ${e === "fadein" ? c : d} ${i}ms linear forwards;
|
58
|
-
`}
|
59
|
-
`;
|
60
|
-
export {
|
61
|
-
m as Accuracy,
|
62
|
-
$ as AccuracyMeterLottie,
|
63
|
-
A as AccuracyNeedleLottie,
|
64
|
-
y as AnimatedAccuracyNeedleContainer,
|
65
|
-
u as PercentTextWrapper,
|
66
|
-
h as TextWrapper
|
67
|
-
};
|
68
|
-
//# sourceMappingURL=accuracy-styled.js.map
|