@cuemath/leap 3.0.7-hg2 → 3.0.7-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/features/circle-games/game-launcher/comps/tables-card/table-mode-star/table-mode-star.js +20 -20
- package/dist/features/circle-games/game-launcher/comps/tables-card/table-mode-star/table-mode-star.js.map +1 -1
- package/dist/features/circle-games/game-launcher/comps/tables-card/table-segment-star/table-segment-star.js +33 -31
- package/dist/features/circle-games/game-launcher/comps/tables-card/table-segment-star/table-segment-star.js.map +1 -1
- package/dist/features/circle-games/game-launcher/comps/tables-card/tables-card.js +55 -55
- package/dist/features/circle-games/game-launcher/comps/tables-card/tables-card.js.map +1 -1
- package/dist/features/ui/lottie-animation/lottie-animation.js +26 -24
- package/dist/features/ui/lottie-animation/lottie-animation.js.map +1 -1
- package/package.json +1 -1
@@ -1,35 +1,35 @@
|
|
1
|
-
import { jsxs as
|
2
|
-
import { useState as l, useMemo as
|
3
|
-
import { LOTTIE as
|
4
|
-
import
|
1
|
+
import { jsxs as s, jsx as t } from "react/jsx-runtime";
|
2
|
+
import { memo as L, useState as l, useMemo as T, useEffect as u } from "react";
|
3
|
+
import { LOTTIE as E } from "../../../../../../assets/lottie/lottie.js";
|
4
|
+
import p from "../../../../../ui/lottie-animation/lottie-animation.js";
|
5
5
|
import { STAR_SIZE as a } from "./constants.js";
|
6
|
-
import { StarContainer as
|
7
|
-
const
|
6
|
+
import { StarContainer as _, LottieContainer as d, Circle as h, Path as w } from "./table-mode-star-styled.js";
|
7
|
+
const x = {
|
8
8
|
loop: !1
|
9
|
-
},
|
10
|
-
const [i, n] = l(!1), [
|
9
|
+
}, C = L(({ isStarAchieved: e, rewardStar: o }) => {
|
10
|
+
const [i, n] = l(!1), [m, f] = l(e && !o), c = T(() => ({
|
11
11
|
name: "complete",
|
12
12
|
callback: () => {
|
13
13
|
f(!0), n(!1);
|
14
14
|
}
|
15
15
|
}), []);
|
16
|
-
return
|
16
|
+
return u(() => {
|
17
17
|
let r;
|
18
18
|
return e && o && (r = setTimeout(() => {
|
19
19
|
n(!0);
|
20
20
|
}, 1e3)), () => {
|
21
21
|
r && clearTimeout(r);
|
22
22
|
};
|
23
|
-
}, [e, o]), /* @__PURE__ */
|
24
|
-
i && /* @__PURE__ */ t(
|
25
|
-
|
23
|
+
}, [e, o]), /* @__PURE__ */ s(_, { children: [
|
24
|
+
i && /* @__PURE__ */ t(d, { children: /* @__PURE__ */ t(
|
25
|
+
p,
|
26
26
|
{
|
27
|
-
src:
|
28
|
-
settings:
|
27
|
+
src: E.TABLE_MODE_STAR,
|
28
|
+
settings: x,
|
29
29
|
eventListener: c
|
30
30
|
}
|
31
31
|
) }),
|
32
|
-
!i && /* @__PURE__ */
|
32
|
+
!i && /* @__PURE__ */ s(
|
33
33
|
"svg",
|
34
34
|
{
|
35
35
|
xmlns: "http://www.w3.org/2000/svg",
|
@@ -38,20 +38,20 @@ const w = {
|
|
38
38
|
viewBox: "0 0 16 16",
|
39
39
|
fill: "none",
|
40
40
|
children: [
|
41
|
-
/* @__PURE__ */ t(
|
41
|
+
/* @__PURE__ */ t(h, { cx: "8", cy: "8", r: "8", $fill: m ? "GREEN_6" : "WHITE_T_15" }),
|
42
42
|
/* @__PURE__ */ t(
|
43
|
-
|
43
|
+
w,
|
44
44
|
{
|
45
45
|
d: "M8 2L6.23664 5.57295L2.29366 6.1459L5.14683 8.92705L4.47329 12.8541L8 11L11.5267 12.8541L10.8532 8.92705L13.7063 6.1459L9.76336 5.57295L8 2Z",
|
46
|
-
$fill:
|
46
|
+
$fill: m ? "GREEN_4" : "WHITE_T_15"
|
47
47
|
}
|
48
48
|
)
|
49
49
|
]
|
50
50
|
}
|
51
51
|
)
|
52
52
|
] });
|
53
|
-
};
|
53
|
+
});
|
54
54
|
export {
|
55
|
-
|
55
|
+
C as default
|
56
56
|
};
|
57
57
|
//# sourceMappingURL=table-mode-star.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"table-mode-star.js","sources":["../../../../../../../src/features/circle-games/game-launcher/comps/tables-card/table-mode-star/table-mode-star.tsx"],"sourcesContent":["import type { ITableModeStarProps } from './table-mode-star-types';\nimport type { AnimationEventName } from 'lottie-web';\n\nimport React, { useEffect, useMemo, useState } from 'react';\n\nimport { LOTTIE } from '../../../../../../assets/lottie/lottie';\nimport LottieAnimation from '../../../../../ui/lottie-animation/lottie-animation';\nimport { STAR_SIZE } from './constants';\nimport * as Styled from './table-mode-star-styled';\n\nconst settings = {\n loop: false,\n};\n\nconst TableModeStar: React.FC<ITableModeStarProps> = ({ isStarAchieved, rewardStar }) => {\n const [animateStar, setAnimateStar] = useState(false);\n const [starRewarded, setStarRewarded] = useState(isStarAchieved && !rewardStar);\n\n const onAnimationFinish = useMemo(() => {\n return {\n name: 'complete' as AnimationEventName,\n callback: () => {\n setStarRewarded(true);\n setAnimateStar(false);\n },\n };\n }, []);\n\n useEffect(() => {\n let timer: ReturnType<typeof setTimeout>;\n\n if (isStarAchieved && rewardStar) {\n timer = setTimeout(() => {\n setAnimateStar(true);\n }, 1000);\n }\n\n return () => {\n timer && clearTimeout(timer);\n };\n }, [isStarAchieved, rewardStar]);\n\n return (\n <Styled.StarContainer>\n {animateStar && (\n <Styled.LottieContainer>\n <LottieAnimation\n src={LOTTIE.TABLE_MODE_STAR}\n settings={settings}\n eventListener={onAnimationFinish}\n />\n </Styled.LottieContainer>\n )}\n {!animateStar && (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width={STAR_SIZE}\n height={STAR_SIZE}\n viewBox=\"0 0 16 16\"\n fill=\"none\"\n >\n <Styled.Circle cx=\"8\" cy=\"8\" r=\"8\" $fill={starRewarded ? 'GREEN_6' : 'WHITE_T_15'} />\n <Styled.Path\n d=\"M8 2L6.23664 5.57295L2.29366 6.1459L5.14683 8.92705L4.47329 12.8541L8 11L11.5267 12.8541L10.8532 8.92705L13.7063 6.1459L9.76336 5.57295L8 2Z\"\n $fill={starRewarded ? 'GREEN_4' : 'WHITE_T_15'}\n />\n </svg>\n )}\n </Styled.StarContainer>\n );\n};\n\nexport default TableModeStar;\n"],"names":["settings","TableModeStar","isStarAchieved","rewardStar","animateStar","setAnimateStar","useState","starRewarded","setStarRewarded","onAnimationFinish","useMemo","useEffect","timer","jsxs","Styled.StarContainer","jsx","Styled.LottieContainer","LottieAnimation","LOTTIE","STAR_SIZE","Styled.Circle","Styled.Path"],"mappings":";;;;;;AAUA,MAAMA,IAAW;AAAA,EACf,MAAM;AACR,GAEMC,IAA+
|
1
|
+
{"version":3,"file":"table-mode-star.js","sources":["../../../../../../../src/features/circle-games/game-launcher/comps/tables-card/table-mode-star/table-mode-star.tsx"],"sourcesContent":["import type { ITableModeStarProps } from './table-mode-star-types';\nimport type { AnimationEventName } from 'lottie-web';\n\nimport React, { memo, useEffect, useMemo, useState } from 'react';\n\nimport { LOTTIE } from '../../../../../../assets/lottie/lottie';\nimport LottieAnimation from '../../../../../ui/lottie-animation/lottie-animation';\nimport { STAR_SIZE } from './constants';\nimport * as Styled from './table-mode-star-styled';\n\nconst settings = {\n loop: false,\n};\n\nconst TableModeStar: React.FC<ITableModeStarProps> = memo(({ isStarAchieved, rewardStar }) => {\n const [animateStar, setAnimateStar] = useState(false);\n const [starRewarded, setStarRewarded] = useState(isStarAchieved && !rewardStar);\n\n const onAnimationFinish = useMemo(() => {\n return {\n name: 'complete' as AnimationEventName,\n callback: () => {\n setStarRewarded(true);\n setAnimateStar(false);\n },\n };\n }, []);\n\n useEffect(() => {\n let timer: ReturnType<typeof setTimeout>;\n\n if (isStarAchieved && rewardStar) {\n timer = setTimeout(() => {\n setAnimateStar(true);\n }, 1000);\n }\n\n return () => {\n timer && clearTimeout(timer);\n };\n }, [isStarAchieved, rewardStar]);\n\n return (\n <Styled.StarContainer>\n {animateStar && (\n <Styled.LottieContainer>\n <LottieAnimation\n src={LOTTIE.TABLE_MODE_STAR}\n settings={settings}\n eventListener={onAnimationFinish}\n />\n </Styled.LottieContainer>\n )}\n {!animateStar && (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width={STAR_SIZE}\n height={STAR_SIZE}\n viewBox=\"0 0 16 16\"\n fill=\"none\"\n >\n <Styled.Circle cx=\"8\" cy=\"8\" r=\"8\" $fill={starRewarded ? 'GREEN_6' : 'WHITE_T_15'} />\n <Styled.Path\n d=\"M8 2L6.23664 5.57295L2.29366 6.1459L5.14683 8.92705L4.47329 12.8541L8 11L11.5267 12.8541L10.8532 8.92705L13.7063 6.1459L9.76336 5.57295L8 2Z\"\n $fill={starRewarded ? 'GREEN_4' : 'WHITE_T_15'}\n />\n </svg>\n )}\n </Styled.StarContainer>\n );\n});\n\nexport default TableModeStar;\n"],"names":["settings","TableModeStar","memo","isStarAchieved","rewardStar","animateStar","setAnimateStar","useState","starRewarded","setStarRewarded","onAnimationFinish","useMemo","useEffect","timer","jsxs","Styled.StarContainer","jsx","Styled.LottieContainer","LottieAnimation","LOTTIE","STAR_SIZE","Styled.Circle","Styled.Path"],"mappings":";;;;;;AAUA,MAAMA,IAAW;AAAA,EACf,MAAM;AACR,GAEMC,IAA+CC,EAAK,CAAC,EAAE,gBAAAC,GAAgB,YAAAC,QAAiB;AAC5F,QAAM,CAACC,GAAaC,CAAc,IAAIC,EAAS,EAAK,GAC9C,CAACC,GAAcC,CAAe,IAAIF,EAASJ,KAAkB,CAACC,CAAU,GAExEM,IAAoBC,EAAQ,OACzB;AAAA,IACL,MAAM;AAAA,IACN,UAAU,MAAM;AACd,MAAAF,EAAgB,EAAI,GACpBH,EAAe,EAAK;AAAA,IACtB;AAAA,EAAA,IAED,CAAE,CAAA;AAEL,SAAAM,EAAU,MAAM;AACV,QAAAC;AAEJ,WAAIV,KAAkBC,MACpBS,IAAQ,WAAW,MAAM;AACvB,MAAAP,EAAe,EAAI;AAAA,OAClB,GAAI,IAGF,MAAM;AACX,MAAAO,KAAS,aAAaA,CAAK;AAAA,IAAA;AAAA,EAC7B,GACC,CAACV,GAAgBC,CAAU,CAAC,GAG7B,gBAAAU,EAACC,GAAA,EACE,UAAA;AAAA,IACCV,KAAA,gBAAAW,EAACC,GAAA,EACC,UAAA,gBAAAD;AAAA,MAACE;AAAA,MAAA;AAAA,QACC,KAAKC,EAAO;AAAA,QACZ,UAAAnB;AAAA,QACA,eAAeU;AAAA,MAAA;AAAA,IAAA,GAEnB;AAAA,IAED,CAACL,KACA,gBAAAS;AAAA,MAAC;AAAA,MAAA;AAAA,QACC,OAAM;AAAA,QACN,OAAOM;AAAA,QACP,QAAQA;AAAA,QACR,SAAQ;AAAA,QACR,MAAK;AAAA,QAEL,UAAA;AAAA,UAAA,gBAAAJ,EAACK,GAAA,EAAc,IAAG,KAAI,IAAG,KAAI,GAAE,KAAI,OAAOb,IAAe,YAAY,aAAc,CAAA;AAAA,UACnF,gBAAAQ;AAAA,YAACM;AAAAA,YAAA;AAAA,cACC,GAAE;AAAA,cACF,OAAOd,IAAe,YAAY;AAAA,YAAA;AAAA,UACpC;AAAA,QAAA;AAAA,MAAA;AAAA,IACF;AAAA,EAEJ,EAAA,CAAA;AAEJ,CAAC;"}
|
@@ -1,37 +1,39 @@
|
|
1
1
|
import { jsxs as c, jsx as r } from "react/jsx-runtime";
|
2
|
-
import { useState as i, useMemo as
|
3
|
-
import { LOTTIE as
|
4
|
-
import
|
5
|
-
import { StarContainer as
|
6
|
-
const
|
2
|
+
import { memo as f, useState as i, useMemo as u, useEffect as T } from "react";
|
3
|
+
import { LOTTIE as p } from "../../../../../../assets/lottie/lottie.js";
|
4
|
+
import S from "../../../../../ui/lottie-animation/lottie-animation.js";
|
5
|
+
import { StarContainer as E, LottieContainer as L, TableStar as d } from "./table-segment-star-styled.js";
|
6
|
+
const A = {
|
7
7
|
loop: !1
|
8
|
-
},
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
}), []);
|
15
|
-
return u(() => {
|
16
|
-
let o;
|
17
|
-
return t && e && (o = setTimeout(() => {
|
18
|
-
a(!0);
|
19
|
-
}, 1e3)), () => {
|
20
|
-
o && clearTimeout(o);
|
21
|
-
};
|
22
|
-
}, [t, e]), /* @__PURE__ */ c(S, { children: [
|
23
|
-
n && /* @__PURE__ */ r(E, { children: /* @__PURE__ */ r(
|
24
|
-
p,
|
25
|
-
{
|
26
|
-
src: T.TABLE_SEGMENT_STAR,
|
27
|
-
settings: d,
|
28
|
-
eventListener: l
|
8
|
+
}, j = f(
|
9
|
+
({ isStarAchieved: t, rewardStar: e }) => {
|
10
|
+
const [n, a] = i(!1), [m, s] = i(t && !e), l = u(() => ({
|
11
|
+
name: "complete",
|
12
|
+
callback: () => {
|
13
|
+
s(!0), a(!1);
|
29
14
|
}
|
30
|
-
)
|
31
|
-
|
32
|
-
|
33
|
-
|
15
|
+
}), []);
|
16
|
+
return T(() => {
|
17
|
+
let o;
|
18
|
+
return t && e && (o = setTimeout(() => {
|
19
|
+
a(!0);
|
20
|
+
}, 1e3)), () => {
|
21
|
+
o && clearTimeout(o);
|
22
|
+
};
|
23
|
+
}, [t, e]), /* @__PURE__ */ c(E, { children: [
|
24
|
+
n && /* @__PURE__ */ r(L, { children: /* @__PURE__ */ r(
|
25
|
+
S,
|
26
|
+
{
|
27
|
+
src: p.TABLE_SEGMENT_STAR,
|
28
|
+
settings: A,
|
29
|
+
eventListener: l
|
30
|
+
}
|
31
|
+
) }),
|
32
|
+
!n && /* @__PURE__ */ r(d, { $isStarAchieved: m })
|
33
|
+
] });
|
34
|
+
}
|
35
|
+
);
|
34
36
|
export {
|
35
|
-
|
37
|
+
j as default
|
36
38
|
};
|
37
39
|
//# sourceMappingURL=table-segment-star.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"table-segment-star.js","sources":["../../../../../../../src/features/circle-games/game-launcher/comps/tables-card/table-segment-star/table-segment-star.tsx"],"sourcesContent":["import type { ITableSegmentStarProps } from './table-segment-star-types';\nimport type { AnimationEventName } from 'lottie-web';\n\nimport React, { useEffect, useMemo, useState } from 'react';\n\nimport { LOTTIE } from '../../../../../../assets/lottie/lottie';\nimport LottieAnimation from '../../../../../ui/lottie-animation/lottie-animation';\nimport * as Styled from './table-segment-star-styled';\n\nconst settings = {\n loop: false,\n};\n\nconst TableSegmentStar: React.FC<ITableSegmentStarProps> = ({ isStarAchieved, rewardStar }) => {\n
|
1
|
+
{"version":3,"file":"table-segment-star.js","sources":["../../../../../../../src/features/circle-games/game-launcher/comps/tables-card/table-segment-star/table-segment-star.tsx"],"sourcesContent":["import type { ITableSegmentStarProps } from './table-segment-star-types';\nimport type { AnimationEventName } from 'lottie-web';\n\nimport React, { memo, useEffect, useMemo, useState } from 'react';\n\nimport { LOTTIE } from '../../../../../../assets/lottie/lottie';\nimport LottieAnimation from '../../../../../ui/lottie-animation/lottie-animation';\nimport * as Styled from './table-segment-star-styled';\n\nconst settings = {\n loop: false,\n};\n\nconst TableSegmentStar: React.FC<ITableSegmentStarProps> = memo(\n ({ isStarAchieved, rewardStar }) => {\n const [animateStar, setAnimateStar] = useState(false);\n const [starRewarded, setStarRewarded] = useState(isStarAchieved && !rewardStar);\n\n const onAnimationFinish = useMemo(() => {\n return {\n name: 'complete' as AnimationEventName,\n callback: () => {\n setStarRewarded(true);\n setAnimateStar(false);\n },\n };\n }, []);\n\n useEffect(() => {\n let timer: ReturnType<typeof setTimeout>;\n\n if (isStarAchieved && rewardStar) {\n timer = setTimeout(() => {\n setAnimateStar(true);\n }, 1000);\n }\n\n return () => {\n timer && clearTimeout(timer);\n };\n }, [isStarAchieved, rewardStar]);\n\n return (\n <Styled.StarContainer>\n {animateStar && (\n <Styled.LottieContainer>\n <LottieAnimation\n src={LOTTIE.TABLE_SEGMENT_STAR}\n settings={settings}\n eventListener={onAnimationFinish}\n />\n </Styled.LottieContainer>\n )}\n {!animateStar && <Styled.TableStar $isStarAchieved={starRewarded} />}\n </Styled.StarContainer>\n );\n },\n);\n\nexport default TableSegmentStar;\n"],"names":["settings","TableSegmentStar","memo","isStarAchieved","rewardStar","animateStar","setAnimateStar","useState","starRewarded","setStarRewarded","onAnimationFinish","useMemo","useEffect","timer","jsxs","Styled.StarContainer","jsx","Styled.LottieContainer","LottieAnimation","LOTTIE","Styled.TableStar"],"mappings":";;;;;AASA,MAAMA,IAAW;AAAA,EACf,MAAM;AACR,GAEMC,IAAqDC;AAAA,EACzD,CAAC,EAAE,gBAAAC,GAAgB,YAAAC,QAAiB;AAClC,UAAM,CAACC,GAAaC,CAAc,IAAIC,EAAS,EAAK,GAC9C,CAACC,GAAcC,CAAe,IAAIF,EAASJ,KAAkB,CAACC,CAAU,GAExEM,IAAoBC,EAAQ,OACzB;AAAA,MACL,MAAM;AAAA,MACN,UAAU,MAAM;AACd,QAAAF,EAAgB,EAAI,GACpBH,EAAe,EAAK;AAAA,MACtB;AAAA,IAAA,IAED,CAAE,CAAA;AAEL,WAAAM,EAAU,MAAM;AACV,UAAAC;AAEJ,aAAIV,KAAkBC,MACpBS,IAAQ,WAAW,MAAM;AACvB,QAAAP,EAAe,EAAI;AAAA,SAClB,GAAI,IAGF,MAAM;AACX,QAAAO,KAAS,aAAaA,CAAK;AAAA,MAAA;AAAA,IAC7B,GACC,CAACV,GAAgBC,CAAU,CAAC,GAG7B,gBAAAU,EAACC,GAAA,EACE,UAAA;AAAA,MACCV,KAAA,gBAAAW,EAACC,GAAA,EACC,UAAA,gBAAAD;AAAA,QAACE;AAAA,QAAA;AAAA,UACC,KAAKC,EAAO;AAAA,UACZ,UAAAnB;AAAA,UACA,eAAeU;AAAA,QAAA;AAAA,MAAA,GAEnB;AAAA,MAED,CAACL,KAAe,gBAAAW,EAACI,GAAA,EAAiB,iBAAiBZ,EAAc,CAAA;AAAA,IACpE,EAAA,CAAA;AAAA,EAEJ;AACF;"}
|
@@ -2,20 +2,20 @@ import { jsx as t, jsxs as a } from "react/jsx-runtime";
|
|
2
2
|
import Ae, { forwardRef as be, useState as o, useRef as N, useCallback as i, useMemo as z, useImperativeHandle as Ee, useEffect as K, memo as ge } from "react";
|
3
3
|
import Ne from "../../../../../assets/line-icons/icons/back2.js";
|
4
4
|
import { LOTTIE as R } from "../../../../../assets/lottie/lottie.js";
|
5
|
-
import
|
6
|
-
import { useUIContext as
|
7
|
-
import
|
5
|
+
import Se from "../../../../ui/arrow-tooltip/arrow-tooltip.js";
|
6
|
+
import { useUIContext as pe } from "../../../../ui/context/context.js";
|
7
|
+
import Ce from "../../../../ui/layout/flex-view.js";
|
8
8
|
import w from "../../../../ui/lottie-animation/lottie-animation.js";
|
9
|
-
import
|
9
|
+
import ve from "../../../../ui/separator/separator.js";
|
10
10
|
import F from "../../../../ui/text/text.js";
|
11
|
-
import { useCircleSounds as
|
12
|
-
import { GAME_LAUNCHER_ANALYTICS_EVENTS as
|
13
|
-
import { CardContainer as
|
14
|
-
import { GAME_LAUNCHER_SIZE as
|
15
|
-
import { TABLE_REVEAL_ANIMATION as
|
11
|
+
import { useCircleSounds as Ie } from "../../../hooks/use-circle-sounds/use-circle-sounds.js";
|
12
|
+
import { GAME_LAUNCHER_ANALYTICS_EVENTS as Le } from "../../game-launcher-analytics-events.js";
|
13
|
+
import { CardContainer as fe } from "../card-container/card-container.js";
|
14
|
+
import { GAME_LAUNCHER_SIZE as S, GAME_LAUNCHER_SIZE_LARGE as _e } from "../card-container/constants.js";
|
15
|
+
import { TABLE_REVEAL_ANIMATION as p, TABLE_MODE_LABEL_COLOR as Te } from "./constants.js";
|
16
16
|
import He from "./table-mode/table-mode.js";
|
17
17
|
import $e from "./table-segment-star/table-segment-star.js";
|
18
|
-
import { CardWrapper as Re, TableSegmentsWrapper as we, InfiniteButtonWrapper as ye, AbsoluteView as
|
18
|
+
import { CardWrapper as Re, TableSegmentsWrapper as we, InfiniteButtonWrapper as ye, AbsoluteView as C, TableSegmentCardShadowContainer as We, TableSegment as Be, TableNumber as De, TableModeContainer as Pe, TableModeWrapper as ke, AnimatedView as Ve, ModeOverlay as xe, IconWrapper as Ue } from "./tables-card-styled.js";
|
19
19
|
const y = {
|
20
20
|
renderer: "svg"
|
21
21
|
}, qe = {
|
@@ -24,33 +24,33 @@ const y = {
|
|
24
24
|
...y
|
25
25
|
}, je = be(
|
26
26
|
({
|
27
|
-
data:
|
27
|
+
data: s,
|
28
28
|
label: W,
|
29
29
|
onPress: b,
|
30
30
|
openModesOfTable: r,
|
31
31
|
defaultTable: E,
|
32
32
|
onGoBackFromTableLevel: g,
|
33
|
-
onPressTableSegment:
|
33
|
+
onPressTableSegment: v
|
34
34
|
}, G) => {
|
35
35
|
var Y;
|
36
|
-
const { onEvent: B } =
|
36
|
+
const { onEvent: B } = pe(), { playButtonSound: m } = Ie(), [u, I] = o(!0), [d, h] = o(
|
37
37
|
(r == null ? void 0 : r.tableNumber) ?? null
|
38
|
-
), [
|
39
|
-
stars: ((Y =
|
38
|
+
), [L, D] = o(null), [J, A] = o("WHITE_T_60"), [c, f] = o({
|
39
|
+
stars: ((Y = s.tableList.find((e) => e.tableNumber === (r == null ? void 0 : r.tableNumber))) == null ? void 0 : Y.stars) ?? [],
|
40
40
|
tableNumber: (r == null ? void 0 : r.tableNumber) ?? 0
|
41
41
|
}), [Q, X] = o(!0), [_, P] = o(!1), [k, M] = o("WHITE_T_60"), V = N(null), x = N(null), [U, O] = o((r == null ? void 0 : r.rewardStar) ?? []), [q] = o(!1), T = N(null), H = N(), j = i(
|
42
42
|
(e) => {
|
43
|
-
if (
|
44
|
-
|
43
|
+
if (v) {
|
44
|
+
v(e);
|
45
45
|
return;
|
46
46
|
}
|
47
|
-
m(),
|
47
|
+
m(), I(!0), h(e.tableNumber), f({ ...e }), O([]), B(Le.TABLE_SELECTED, {
|
48
48
|
meta: {
|
49
49
|
table_of: e.tableNumber
|
50
50
|
}
|
51
51
|
});
|
52
52
|
},
|
53
|
-
[
|
53
|
+
[v, m, B]
|
54
54
|
), ee = i(
|
55
55
|
(e) => {
|
56
56
|
A(_ ? k : "WHITE_T_60"), h(e.tableNumber);
|
@@ -60,14 +60,14 @@ const y = {
|
|
60
60
|
A("WHITE_T_60"), !c.tableNumber && h(null);
|
61
61
|
}, [c.tableNumber]), re = i(() => {
|
62
62
|
var n;
|
63
|
-
g == null || g(), m(),
|
64
|
-
const e = (
|
65
|
-
(n = T.current) == null || n.playSegments(
|
66
|
-
|
63
|
+
g == null || g(), m(), I(!1), h(null);
|
64
|
+
const e = (p.DISAPPEAR[1] - p.DISAPPEAR[0]) / 30;
|
65
|
+
(n = T.current) == null || n.playSegments(p.DISAPPEAR, !0), H.current = setTimeout(() => {
|
66
|
+
f({ stars: [], tableNumber: 0 });
|
67
67
|
}, e * 1e3);
|
68
68
|
}, [g, m]), ie = i(() => {
|
69
69
|
var e;
|
70
|
-
(e = T.current) == null || e.playSegments(
|
70
|
+
(e = T.current) == null || e.playSegments(p.REVEAL, !0);
|
71
71
|
}, []), ne = i((e) => {
|
72
72
|
const n = {
|
73
73
|
sequence: 1,
|
@@ -77,13 +77,13 @@ const y = {
|
|
77
77
|
A(Te[e] ?? "WHITE_T_60"), D(n[e] ?? 0);
|
78
78
|
}, []), oe = i(() => {
|
79
79
|
D(null), A("WHITE_T_60");
|
80
|
-
}, []),
|
80
|
+
}, []), l = z(() => c, [c]), le = z(() => [
|
81
81
|
{
|
82
82
|
top: 20,
|
83
83
|
left: 10.5,
|
84
84
|
type: "sequence",
|
85
|
-
tableNumber:
|
86
|
-
isStarAchieved:
|
85
|
+
tableNumber: l.tableNumber,
|
86
|
+
isStarAchieved: l.stars.includes("sequence"),
|
87
87
|
semicirclePosiiionTop: "-19%",
|
88
88
|
semicirclePosiiionLeft: "-43%",
|
89
89
|
semicircleHoverColor: "#B259004D"
|
@@ -92,8 +92,8 @@ const y = {
|
|
92
92
|
top: 20,
|
93
93
|
left: 65.5,
|
94
94
|
type: "random",
|
95
|
-
tableNumber:
|
96
|
-
isStarAchieved:
|
95
|
+
tableNumber: l.tableNumber,
|
96
|
+
isStarAchieved: l.stars.includes("random"),
|
97
97
|
semicirclePosiiionTop: "-19%",
|
98
98
|
semicirclePosiiionLeft: "65%",
|
99
99
|
semicircleHoverColor: "#0055CC4D"
|
@@ -102,18 +102,18 @@ const y = {
|
|
102
102
|
top: 66,
|
103
103
|
left: 38,
|
104
104
|
type: "advance",
|
105
|
-
tableNumber:
|
106
|
-
isStarAchieved:
|
105
|
+
tableNumber: l.tableNumber,
|
106
|
+
isStarAchieved: l.stars.includes("advance"),
|
107
107
|
semicirclePosiiionTop: "74%",
|
108
108
|
semicirclePosiiionLeft: "11%",
|
109
109
|
semicircleHoverColor: "#A9099C4D"
|
110
110
|
}
|
111
|
-
], [
|
111
|
+
], [l.tableNumber, l.stars]), se = i(() => {
|
112
112
|
b({
|
113
113
|
mode: "infinite",
|
114
|
-
infiniteModeHighScore:
|
114
|
+
infiniteModeHighScore: s.infiniteModeHighScore
|
115
115
|
});
|
116
|
-
}, [b,
|
116
|
+
}, [b, s.infiniteModeHighScore]), ce = i(
|
117
117
|
(e, n) => {
|
118
118
|
b({
|
119
119
|
mode: e,
|
@@ -122,7 +122,7 @@ const y = {
|
|
122
122
|
});
|
123
123
|
},
|
124
124
|
[b, c.tableNumber]
|
125
|
-
), ae = i(() =>
|
125
|
+
), ae = i(() => L ? `${d}× LEVEL${L}` : d ? `${d}× Table` : W, [L, d, W]), me = i((e) => {
|
126
126
|
A(e), M(e), P(!0);
|
127
127
|
}, []), ue = i(() => P(!1), []), de = i((e) => X(e), []);
|
128
128
|
return Ee(G, () => ({
|
@@ -135,9 +135,9 @@ const y = {
|
|
135
135
|
})), K(() => () => {
|
136
136
|
H.current && clearTimeout(H.current);
|
137
137
|
}, []), K(() => {
|
138
|
-
E && (m(),
|
138
|
+
E && (m(), I(!0), h(E.tableNumber), f({ ...E }));
|
139
139
|
}, [E, m]), /* @__PURE__ */ t(
|
140
|
-
|
140
|
+
fe,
|
141
141
|
{
|
142
142
|
labelRef: V,
|
143
143
|
ref: x,
|
@@ -149,7 +149,7 @@ const y = {
|
|
149
149
|
children: /* @__PURE__ */ a(Re, { children: [
|
150
150
|
/* @__PURE__ */ a(we, { children: [
|
151
151
|
/* @__PURE__ */ t(
|
152
|
-
|
152
|
+
Se,
|
153
153
|
{
|
154
154
|
renderAs: "primary",
|
155
155
|
position: "top",
|
@@ -158,21 +158,21 @@ const y = {
|
|
158
158
|
children: /* @__PURE__ */ a(
|
159
159
|
ye,
|
160
160
|
{
|
161
|
-
onClick: q ?
|
161
|
+
onClick: q ? se : void 0,
|
162
162
|
children: [
|
163
|
-
/* @__PURE__ */ t(
|
163
|
+
/* @__PURE__ */ t(C, { children: /* @__PURE__ */ t(
|
164
164
|
w,
|
165
165
|
{
|
166
166
|
src: R.INFINITE_BUTTON_BG,
|
167
|
-
|
167
|
+
overrideSettings: y,
|
168
168
|
animateOnIntersect: !0
|
169
169
|
}
|
170
170
|
) }),
|
171
|
-
/* @__PURE__ */ t(
|
171
|
+
/* @__PURE__ */ t(C, { children: /* @__PURE__ */ t(
|
172
172
|
w,
|
173
173
|
{
|
174
174
|
src: R.INFINITE_BUTTON_SYMBOL,
|
175
|
-
|
175
|
+
overrideSettings: y,
|
176
176
|
animateOnIntersect: !0
|
177
177
|
}
|
178
178
|
) })
|
@@ -182,18 +182,18 @@ const y = {
|
|
182
182
|
}
|
183
183
|
),
|
184
184
|
/* @__PURE__ */ t(We, {}),
|
185
|
-
|
186
|
-
const he = 360 /
|
185
|
+
s.tableList.map((e, n) => {
|
186
|
+
const he = 360 / s.tableList.length, Z = -(90 + 360 / (2 * s.tableList.length)) + he * (n + 1);
|
187
187
|
return /* @__PURE__ */ t(
|
188
188
|
Be,
|
189
189
|
{
|
190
190
|
$angle: Z,
|
191
|
-
$totalSegments:
|
191
|
+
$totalSegments: s.tableList.length,
|
192
192
|
$zIndex: n + 1,
|
193
193
|
onClick: () => j(e),
|
194
194
|
onMouseOver: () => ee(e),
|
195
195
|
onMouseLeave: te,
|
196
|
-
children: /* @__PURE__ */ a(
|
196
|
+
children: /* @__PURE__ */ a(Ce, { $flexDirection: "row", $justifyContent: "center", $alignItems: "center", children: [
|
197
197
|
["sequence", "random", "advance"].map(($) => /* @__PURE__ */ t(
|
198
198
|
$e,
|
199
199
|
{
|
@@ -202,11 +202,11 @@ const y = {
|
|
202
202
|
},
|
203
203
|
$
|
204
204
|
)),
|
205
|
-
/* @__PURE__ */ t(
|
205
|
+
/* @__PURE__ */ t(ve, { width: S * 0.055 }),
|
206
206
|
/* @__PURE__ */ t(De, { $angle: -Z, children: /* @__PURE__ */ t(
|
207
207
|
F,
|
208
208
|
{
|
209
|
-
$renderAs:
|
209
|
+
$renderAs: S === _e ? "ac3-black" : "ac4-black",
|
210
210
|
$color: d === e.tableNumber ? "BLACK_1" : "WHITE",
|
211
211
|
children: e.tableNumber
|
212
212
|
}
|
@@ -219,7 +219,7 @@ const y = {
|
|
219
219
|
] }),
|
220
220
|
c.tableNumber > 0 && /* @__PURE__ */ t(Pe, { children: /* @__PURE__ */ a(ke, { children: [
|
221
221
|
/* @__PURE__ */ a(Ve, { animation: u ? "fade-in" : "fade-out", children: [
|
222
|
-
|
222
|
+
le.map((e, n) => /* @__PURE__ */ a(Ae.Fragment, { children: [
|
223
223
|
/* @__PURE__ */ t(
|
224
224
|
xe,
|
225
225
|
{
|
@@ -232,7 +232,7 @@ const y = {
|
|
232
232
|
}
|
233
233
|
),
|
234
234
|
/* @__PURE__ */ t(
|
235
|
-
|
235
|
+
C,
|
236
236
|
{
|
237
237
|
$top: e.top,
|
238
238
|
$left: e.left,
|
@@ -249,12 +249,12 @@ const y = {
|
|
249
249
|
}
|
250
250
|
)
|
251
251
|
] }, n)),
|
252
|
-
/* @__PURE__ */ t(
|
252
|
+
/* @__PURE__ */ t(C, { $top: 50, $left: 50, $alignCenter: !0, children: /* @__PURE__ */ t(Ue, { children: /* @__PURE__ */ t(
|
253
253
|
Ne,
|
254
254
|
{
|
255
255
|
onClick: re,
|
256
|
-
height:
|
257
|
-
width:
|
256
|
+
height: S * 0.1,
|
257
|
+
width: S * 0.1
|
258
258
|
}
|
259
259
|
) }) })
|
260
260
|
] }),
|
@@ -263,7 +263,7 @@ const y = {
|
|
263
263
|
{
|
264
264
|
src: R.TABLE_MODE_REVEAL,
|
265
265
|
ref: T,
|
266
|
-
|
266
|
+
overrideSettings: qe,
|
267
267
|
onRender: ie,
|
268
268
|
animateOnIntersect: !0
|
269
269
|
}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"tables-card.js","sources":["../../../../../../src/features/circle-games/game-launcher/comps/tables-card/tables-card.tsx"],"sourcesContent":["import type { ILottieAnimationRef } from '../../../../ui/lottie-animation/types';\nimport type { TColorNames } from '../../../../ui/types';\nimport type {\n ITableInfo,\n TTableMode,\n} from '../../dal/use-get-circle-home-details-dal/use-get-circle-home-dal-types';\nimport type { ITableCardRef, ITablesCardProps } from './tables-card-types';\n\nimport React, {\n forwardRef,\n memo,\n useCallback,\n useEffect,\n useImperativeHandle,\n useMemo,\n useRef,\n useState,\n} from 'react';\n\nimport Back2Icon from '../../../../../assets/line-icons/icons/back2';\nimport { LOTTIE } from '../../../../../assets/lottie/lottie';\nimport ArrowTooltip from '../../../../ui/arrow-tooltip/arrow-tooltip';\nimport { useUIContext } from '../../../../ui/context/context';\nimport FlexView from '../../../../ui/layout/flex-view';\nimport LottieAnimation from '../../../../ui/lottie-animation/lottie-animation';\nimport Separator from '../../../../ui/separator/separator';\nimport Text from '../../../../ui/text/text';\nimport { useCircleSounds } from '../../../hooks/use-circle-sounds/use-circle-sounds';\nimport { GAME_LAUNCHER_ANALYTICS_EVENTS } from '../../game-launcher-analytics-events';\nimport { CardContainer } from '../card-container/card-container';\nimport { GAME_LAUNCHER_SIZE, GAME_LAUNCHER_SIZE_LARGE } from '../card-container/constants';\nimport { TABLE_MODE_LABEL_COLOR, TABLE_REVEAL_ANIMATION } from './constants';\nimport TableMode from './table-mode/table-mode';\nimport TableSegmentStar from './table-segment-star/table-segment-star';\nimport * as Styled from './tables-card-styled';\n\nconst rendererSettings = {\n renderer: 'svg',\n};\n\nconst animationSettings = {\n loop: false,\n autoplay: false,\n ...rendererSettings,\n};\n\nconst TablesCardComponent = forwardRef<ITableCardRef, ITablesCardProps>(\n (\n {\n data,\n label,\n onPress,\n openModesOfTable,\n defaultTable,\n onGoBackFromTableLevel,\n onPressTableSegment,\n },\n ref,\n ) => {\n const { onEvent: trackEvent } = useUIContext();\n const { playButtonSound } = useCircleSounds();\n const [fadeIn, setFadeIn] = useState(true);\n const [highlightedTable, setHighlightedTable] = useState<number | null>(\n openModesOfTable?.tableNumber ?? null,\n );\n const [highlightedLevel, setHighlightedLevel] = useState<number | null>(null);\n const [labelColor, setLabelColor] = useState<TColorNames>('WHITE_T_60');\n const [revealTableModes, setRevealTableModes] = useState<ITableInfo>({\n stars:\n data.tableList.find(table => table.tableNumber === openModesOfTable?.tableNumber)?.stars ??\n [],\n tableNumber: openModesOfTable?.tableNumber ?? 0,\n });\n\n const [showLabel, setShowLabel] = useState(true);\n const [isLabelAnimated, setIsLabelAnimated] = useState(false);\n const [animatedColor, setAniimatedColor] = useState<TColorNames>('WHITE_T_60');\n\n const labelRef = useRef<HTMLDivElement>(null);\n const cardRef = useRef<HTMLDivElement>(null);\n\n const [rewardStar, setRewardStar] = useState(openModesOfTable?.rewardStar ?? []);\n const [enableInfiniteMode] = useState(false);\n\n const revealAnimationRef = useRef<ILottieAnimationRef | null>(null);\n const disappearAnimationTimer = useRef<ReturnType<typeof setTimeout>>();\n\n const handleTableSegmentClick = useCallback(\n (table: ITableInfo) => {\n if (onPressTableSegment) {\n onPressTableSegment(table);\n\n return;\n }\n playButtonSound();\n setFadeIn(true);\n setHighlightedTable(table.tableNumber);\n setRevealTableModes({ ...table });\n setRewardStar([]);\n trackEvent(GAME_LAUNCHER_ANALYTICS_EVENTS.TABLE_SELECTED, {\n meta: {\n table_of: table.tableNumber,\n },\n });\n },\n [onPressTableSegment, playButtonSound, trackEvent],\n );\n\n const handleTableSegmentMouseOver = useCallback(\n (table: ITableInfo) => {\n setLabelColor(isLabelAnimated ? animatedColor : 'WHITE_T_60');\n setHighlightedTable(table.tableNumber);\n },\n [animatedColor, isLabelAnimated],\n );\n\n const handleTableSegmentMouseLeave = useCallback(() => {\n setLabelColor('WHITE_T_60');\n !revealTableModes.tableNumber && setHighlightedTable(null);\n }, [revealTableModes.tableNumber]);\n\n const goBack = useCallback(() => {\n onGoBackFromTableLevel?.();\n playButtonSound();\n setFadeIn(false);\n setHighlightedTable(null);\n const time = (TABLE_REVEAL_ANIMATION.DISAPPEAR[1] - TABLE_REVEAL_ANIMATION.DISAPPEAR[0]) / 30;\n\n revealAnimationRef.current?.playSegments(TABLE_REVEAL_ANIMATION.DISAPPEAR, true);\n disappearAnimationTimer.current = setTimeout(() => {\n setRevealTableModes({ stars: [], tableNumber: 0 });\n }, time * 1000);\n }, [onGoBackFromTableLevel, playButtonSound]);\n\n const showTableModes = useCallback(() => {\n revealAnimationRef.current?.playSegments(TABLE_REVEAL_ANIMATION.REVEAL, true);\n }, []);\n\n const handleModeMouseOver = useCallback((type: TTableMode) => {\n const level: Partial<Record<TTableMode, number>> = {\n sequence: 1,\n random: 2,\n advance: 3,\n };\n\n setLabelColor(TABLE_MODE_LABEL_COLOR[type] ?? 'WHITE_T_60');\n setHighlightedLevel(level[type] ?? 0);\n }, []);\n\n const handleModeMouseLeave = useCallback(() => {\n setHighlightedLevel(null);\n setLabelColor('WHITE_T_60');\n }, []);\n\n const revealTableModesMemo = useMemo(() => revealTableModes, [revealTableModes]);\n\n const tableModes = useMemo(() => {\n return [\n {\n top: 20,\n left: 10.5,\n type: 'sequence' as TTableMode,\n tableNumber: revealTableModesMemo.tableNumber,\n isStarAchieved: revealTableModesMemo.stars.includes('sequence'),\n semicirclePosiiionTop: '-19%',\n semicirclePosiiionLeft: '-43%',\n semicircleHoverColor: '#B259004D',\n },\n {\n top: 20,\n left: 65.5,\n type: 'random' as TTableMode,\n tableNumber: revealTableModesMemo.tableNumber,\n isStarAchieved: revealTableModesMemo.stars.includes('random'),\n semicirclePosiiionTop: '-19%',\n semicirclePosiiionLeft: '65%',\n semicircleHoverColor: '#0055CC4D',\n },\n {\n top: 66,\n left: 38,\n type: 'advance' as TTableMode,\n tableNumber: revealTableModesMemo.tableNumber,\n isStarAchieved: revealTableModesMemo.stars.includes('advance'),\n semicirclePosiiionTop: '74%',\n semicirclePosiiionLeft: '11%',\n semicircleHoverColor: '#A9099C4D',\n },\n ];\n }, [revealTableModesMemo.tableNumber, revealTableModesMemo.stars]);\n\n // Disabled infinite mode\n const handleInfiniteModeClick = useCallback(() => {\n onPress({\n mode: 'infinite',\n infiniteModeHighScore: data.infiniteModeHighScore,\n });\n }, [onPress, data.infiniteModeHighScore]);\n\n const handleNormalModeClick = useCallback(\n (mode: TTableMode, isStarRewarded: boolean) => {\n onPress({\n mode,\n tableNumber: revealTableModes.tableNumber,\n isStarRewarded,\n });\n },\n [onPress, revealTableModes.tableNumber],\n );\n\n const getHighlightedText = useCallback(() => {\n if (highlightedLevel) {\n return `${highlightedTable}× LEVEL${highlightedLevel}`;\n }\n\n return highlightedTable ? `${highlightedTable}× Table` : label;\n }, [highlightedLevel, highlightedTable, label]);\n\n const startLabelAnimation = useCallback((color: TColorNames) => {\n setLabelColor(color);\n setAniimatedColor(color);\n setIsLabelAnimated(true);\n }, []);\n\n const stopLabelAnimation = useCallback(() => setIsLabelAnimated(false), []);\n const setLabelVisiblity = useCallback((visible: boolean) => setShowLabel(visible), []);\n\n useImperativeHandle(ref, () => ({\n labelRef: labelRef,\n segmentedCardWrapperRef: cardRef,\n startLabelAnimation,\n stopLabelAnimation,\n setLabelVisiblity,\n handleTableSegmentClick,\n }));\n\n useEffect(() => {\n return () => {\n disappearAnimationTimer.current && clearTimeout(disappearAnimationTimer.current);\n };\n }, []);\n\n // Used in trial journey, to open table levels by default if given in props\n useEffect(() => {\n if (defaultTable) {\n playButtonSound();\n setFadeIn(true);\n setHighlightedTable(defaultTable.tableNumber);\n setRevealTableModes({ ...defaultTable });\n }\n }, [defaultTable, playButtonSound]);\n\n return (\n <CardContainer\n labelRef={labelRef}\n ref={cardRef}\n strokeColor=\"WHITE\"\n label={getHighlightedText()}\n labelColor={labelColor}\n isAnimated={isLabelAnimated}\n showLabel={showLabel}\n >\n <Styled.CardWrapper>\n {/* table selection */}\n <Styled.TableSegmentsWrapper>\n {/* infinite button */}\n <ArrowTooltip\n renderAs=\"primary\"\n position=\"top\"\n hidden={enableInfiniteMode}\n tooltipItem={\n <Text $renderAs=\"ab3\" $color=\"WHITE\">\n Coming Soon\n </Text>\n }\n >\n <Styled.InfiniteButtonWrapper\n onClick={enableInfiniteMode ? handleInfiniteModeClick : undefined}\n >\n <Styled.AbsoluteView>\n <LottieAnimation\n src={LOTTIE.INFINITE_BUTTON_BG}\n settings={rendererSettings}\n animateOnIntersect\n />\n </Styled.AbsoluteView>\n <Styled.AbsoluteView>\n <LottieAnimation\n src={LOTTIE.INFINITE_BUTTON_SYMBOL}\n settings={rendererSettings}\n animateOnIntersect\n />\n </Styled.AbsoluteView>\n </Styled.InfiniteButtonWrapper>\n </ArrowTooltip>\n\n {/* card shadow */}\n <Styled.TableSegmentCardShadowContainer />\n\n {/* table segments */}\n {data.tableList.map((table, index) => {\n const segmentAngle = 360 / data.tableList.length;\n const startAngle = -(90 + 360 / (2 * data.tableList.length));\n const currentAngle = startAngle + segmentAngle * (index + 1);\n\n return (\n <Styled.TableSegment\n key={index}\n $angle={currentAngle}\n $totalSegments={data.tableList.length}\n $zIndex={index + 1}\n onClick={() => handleTableSegmentClick(table)}\n onMouseOver={() => handleTableSegmentMouseOver(table)}\n onMouseLeave={handleTableSegmentMouseLeave}\n >\n <FlexView $flexDirection=\"row\" $justifyContent=\"center\" $alignItems=\"center\">\n {['sequence', 'random', 'advance'].map(star => (\n <TableSegmentStar\n key={star}\n isStarAchieved={table.stars.includes(star as TTableMode)}\n rewardStar={\n !fadeIn && openModesOfTable?.tableNumber === table.tableNumber\n ? rewardStar.includes(star as TTableMode)\n : undefined\n }\n />\n ))}\n <Separator width={GAME_LAUNCHER_SIZE * 0.055} />\n\n <Styled.TableNumber $angle={-currentAngle}>\n <Text\n $renderAs={\n GAME_LAUNCHER_SIZE === GAME_LAUNCHER_SIZE_LARGE\n ? 'ac3-black'\n : 'ac4-black'\n }\n $color={highlightedTable === table.tableNumber ? 'BLACK_1' : 'WHITE'}\n >\n {table.tableNumber}\n </Text>\n </Styled.TableNumber>\n </FlexView>\n </Styled.TableSegment>\n );\n })}\n </Styled.TableSegmentsWrapper>\n\n {/* table modes */}\n {revealTableModes.tableNumber > 0 && (\n <Styled.TableModeContainer>\n <Styled.TableModeWrapper>\n {/* tables modes with back button */}\n <Styled.AnimatedView animation={fadeIn ? 'fade-in' : 'fade-out'}>\n {tableModes.map((tableMode, index) => (\n <React.Fragment key={index}>\n <Styled.ModeOverlay\n $top={tableMode.semicirclePosiiionTop}\n $left={tableMode.semicirclePosiiionLeft}\n $hoverColor={tableMode.semicircleHoverColor}\n onClick={() =>\n fadeIn\n ? handleNormalModeClick(tableMode.type, tableMode.isStarAchieved)\n : undefined\n }\n onMouseOver={() =>\n fadeIn ? handleModeMouseOver(tableMode.type as TTableMode) : undefined\n }\n onMouseLeave={fadeIn ? handleModeMouseLeave : undefined}\n />\n <Styled.AbsoluteView\n $top={tableMode.top}\n $left={tableMode.left}\n $isPointerEventsNone={true}\n >\n <TableMode\n tableNumber={tableMode.tableNumber}\n isStarAchieved={tableMode.isStarAchieved}\n type={tableMode.type as TTableMode}\n rewardStar={rewardStar.includes(tableMode.type as TTableMode)}\n />\n </Styled.AbsoluteView>\n </React.Fragment>\n ))}\n {/* back button */}\n <Styled.AbsoluteView $top={50} $left={50} $alignCenter={true}>\n <Styled.IconWrapper>\n <Back2Icon\n onClick={goBack}\n height={GAME_LAUNCHER_SIZE * 0.1}\n width={GAME_LAUNCHER_SIZE * 0.1}\n />\n </Styled.IconWrapper>\n </Styled.AbsoluteView>\n </Styled.AnimatedView>\n\n {/* overlay lottie for modes */}\n <LottieAnimation\n src={LOTTIE.TABLE_MODE_REVEAL}\n ref={revealAnimationRef}\n settings={animationSettings}\n onRender={showTableModes}\n animateOnIntersect\n />\n </Styled.TableModeWrapper>\n </Styled.TableModeContainer>\n )}\n </Styled.CardWrapper>\n </CardContainer>\n );\n },\n);\n\nexport const TablesCard = memo(TablesCardComponent);\n"],"names":["rendererSettings","animationSettings","TablesCardComponent","forwardRef","data","label","onPress","openModesOfTable","defaultTable","onGoBackFromTableLevel","onPressTableSegment","ref","trackEvent","useUIContext","playButtonSound","useCircleSounds","fadeIn","setFadeIn","useState","highlightedTable","setHighlightedTable","highlightedLevel","setHighlightedLevel","labelColor","setLabelColor","revealTableModes","setRevealTableModes","_a","table","showLabel","setShowLabel","isLabelAnimated","setIsLabelAnimated","animatedColor","setAniimatedColor","labelRef","useRef","cardRef","rewardStar","setRewardStar","enableInfiniteMode","revealAnimationRef","disappearAnimationTimer","handleTableSegmentClick","useCallback","GAME_LAUNCHER_ANALYTICS_EVENTS","handleTableSegmentMouseOver","handleTableSegmentMouseLeave","goBack","time","TABLE_REVEAL_ANIMATION","showTableModes","handleModeMouseOver","type","level","TABLE_MODE_LABEL_COLOR","handleModeMouseLeave","revealTableModesMemo","useMemo","tableModes","handleInfiniteModeClick","handleNormalModeClick","mode","isStarRewarded","getHighlightedText","startLabelAnimation","color","stopLabelAnimation","setLabelVisiblity","visible","useImperativeHandle","useEffect","jsx","CardContainer","jsxs","Styled.CardWrapper","Styled.TableSegmentsWrapper","ArrowTooltip","Text","Styled.InfiniteButtonWrapper","Styled.AbsoluteView","LottieAnimation","LOTTIE","Styled.TableSegmentCardShadowContainer","index","segmentAngle","currentAngle","Styled.TableSegment","FlexView","star","TableSegmentStar","Separator","GAME_LAUNCHER_SIZE","Styled.TableNumber","GAME_LAUNCHER_SIZE_LARGE","Styled.TableModeContainer","Styled.TableModeWrapper","Styled.AnimatedView","tableMode","React","Styled.ModeOverlay","TableMode","Styled.IconWrapper","Back2Icon","TablesCard","memo"],"mappings":";;;;;;;;;;;;;;;;;;AAoCA,MAAMA,IAAmB;AAAA,EAC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AAAA,EAGN;AACF,GAEaqD,KAAaC,GAAKvG,EAAmB;"}
|
1
|
+
{"version":3,"file":"tables-card.js","sources":["../../../../../../src/features/circle-games/game-launcher/comps/tables-card/tables-card.tsx"],"sourcesContent":["import type { ILottieAnimationRef } from '../../../../ui/lottie-animation/types';\nimport type { TColorNames } from '../../../../ui/types';\nimport type {\n ITableInfo,\n TTableMode,\n} from '../../dal/use-get-circle-home-details-dal/use-get-circle-home-dal-types';\nimport type { ITableCardRef, ITablesCardProps } from './tables-card-types';\n\nimport React, {\n forwardRef,\n memo,\n useCallback,\n useEffect,\n useImperativeHandle,\n useMemo,\n useRef,\n useState,\n} from 'react';\n\nimport Back2Icon from '../../../../../assets/line-icons/icons/back2';\nimport { LOTTIE } from '../../../../../assets/lottie/lottie';\nimport ArrowTooltip from '../../../../ui/arrow-tooltip/arrow-tooltip';\nimport { useUIContext } from '../../../../ui/context/context';\nimport FlexView from '../../../../ui/layout/flex-view';\nimport LottieAnimation from '../../../../ui/lottie-animation/lottie-animation';\nimport Separator from '../../../../ui/separator/separator';\nimport Text from '../../../../ui/text/text';\nimport { useCircleSounds } from '../../../hooks/use-circle-sounds/use-circle-sounds';\nimport { GAME_LAUNCHER_ANALYTICS_EVENTS } from '../../game-launcher-analytics-events';\nimport { CardContainer } from '../card-container/card-container';\nimport { GAME_LAUNCHER_SIZE, GAME_LAUNCHER_SIZE_LARGE } from '../card-container/constants';\nimport { TABLE_MODE_LABEL_COLOR, TABLE_REVEAL_ANIMATION } from './constants';\nimport TableMode from './table-mode/table-mode';\nimport TableSegmentStar from './table-segment-star/table-segment-star';\nimport * as Styled from './tables-card-styled';\n\nconst rendererSettings = {\n renderer: 'svg',\n};\n\nconst animationSettings = {\n loop: false,\n autoplay: false,\n ...rendererSettings,\n};\n\nconst TablesCardComponent = forwardRef<ITableCardRef, ITablesCardProps>(\n (\n {\n data,\n label,\n onPress,\n openModesOfTable,\n defaultTable,\n onGoBackFromTableLevel,\n onPressTableSegment,\n },\n ref,\n ) => {\n const { onEvent: trackEvent } = useUIContext();\n const { playButtonSound } = useCircleSounds();\n const [fadeIn, setFadeIn] = useState(true);\n const [highlightedTable, setHighlightedTable] = useState<number | null>(\n openModesOfTable?.tableNumber ?? null,\n );\n const [highlightedLevel, setHighlightedLevel] = useState<number | null>(null);\n const [labelColor, setLabelColor] = useState<TColorNames>('WHITE_T_60');\n const [revealTableModes, setRevealTableModes] = useState<ITableInfo>({\n stars:\n data.tableList.find(table => table.tableNumber === openModesOfTable?.tableNumber)?.stars ??\n [],\n tableNumber: openModesOfTable?.tableNumber ?? 0,\n });\n\n const [showLabel, setShowLabel] = useState(true);\n const [isLabelAnimated, setIsLabelAnimated] = useState(false);\n const [animatedColor, setAniimatedColor] = useState<TColorNames>('WHITE_T_60');\n\n const labelRef = useRef<HTMLDivElement>(null);\n const cardRef = useRef<HTMLDivElement>(null);\n\n const [rewardStar, setRewardStar] = useState(openModesOfTable?.rewardStar ?? []);\n const [enableInfiniteMode] = useState(false);\n\n const revealAnimationRef = useRef<ILottieAnimationRef | null>(null);\n const disappearAnimationTimer = useRef<ReturnType<typeof setTimeout>>();\n\n const handleTableSegmentClick = useCallback(\n (table: ITableInfo) => {\n if (onPressTableSegment) {\n onPressTableSegment(table);\n\n return;\n }\n playButtonSound();\n setFadeIn(true);\n setHighlightedTable(table.tableNumber);\n setRevealTableModes({ ...table });\n setRewardStar([]);\n trackEvent(GAME_LAUNCHER_ANALYTICS_EVENTS.TABLE_SELECTED, {\n meta: {\n table_of: table.tableNumber,\n },\n });\n },\n [onPressTableSegment, playButtonSound, trackEvent],\n );\n\n const handleTableSegmentMouseOver = useCallback(\n (table: ITableInfo) => {\n setLabelColor(isLabelAnimated ? animatedColor : 'WHITE_T_60');\n setHighlightedTable(table.tableNumber);\n },\n [animatedColor, isLabelAnimated],\n );\n\n const handleTableSegmentMouseLeave = useCallback(() => {\n setLabelColor('WHITE_T_60');\n !revealTableModes.tableNumber && setHighlightedTable(null);\n }, [revealTableModes.tableNumber]);\n\n const goBack = useCallback(() => {\n onGoBackFromTableLevel?.();\n playButtonSound();\n setFadeIn(false);\n setHighlightedTable(null);\n const time = (TABLE_REVEAL_ANIMATION.DISAPPEAR[1] - TABLE_REVEAL_ANIMATION.DISAPPEAR[0]) / 30;\n\n revealAnimationRef.current?.playSegments(TABLE_REVEAL_ANIMATION.DISAPPEAR, true);\n disappearAnimationTimer.current = setTimeout(() => {\n setRevealTableModes({ stars: [], tableNumber: 0 });\n }, time * 1000);\n }, [onGoBackFromTableLevel, playButtonSound]);\n\n const showTableModes = useCallback(() => {\n revealAnimationRef.current?.playSegments(TABLE_REVEAL_ANIMATION.REVEAL, true);\n }, []);\n\n const handleModeMouseOver = useCallback((type: TTableMode) => {\n const level: Partial<Record<TTableMode, number>> = {\n sequence: 1,\n random: 2,\n advance: 3,\n };\n\n setLabelColor(TABLE_MODE_LABEL_COLOR[type] ?? 'WHITE_T_60');\n setHighlightedLevel(level[type] ?? 0);\n }, []);\n\n const handleModeMouseLeave = useCallback(() => {\n setHighlightedLevel(null);\n setLabelColor('WHITE_T_60');\n }, []);\n\n const revealTableModesMemo = useMemo(() => revealTableModes, [revealTableModes]);\n\n const tableModes = useMemo(() => {\n return [\n {\n top: 20,\n left: 10.5,\n type: 'sequence' as TTableMode,\n tableNumber: revealTableModesMemo.tableNumber,\n isStarAchieved: revealTableModesMemo.stars.includes('sequence'),\n semicirclePosiiionTop: '-19%',\n semicirclePosiiionLeft: '-43%',\n semicircleHoverColor: '#B259004D',\n },\n {\n top: 20,\n left: 65.5,\n type: 'random' as TTableMode,\n tableNumber: revealTableModesMemo.tableNumber,\n isStarAchieved: revealTableModesMemo.stars.includes('random'),\n semicirclePosiiionTop: '-19%',\n semicirclePosiiionLeft: '65%',\n semicircleHoverColor: '#0055CC4D',\n },\n {\n top: 66,\n left: 38,\n type: 'advance' as TTableMode,\n tableNumber: revealTableModesMemo.tableNumber,\n isStarAchieved: revealTableModesMemo.stars.includes('advance'),\n semicirclePosiiionTop: '74%',\n semicirclePosiiionLeft: '11%',\n semicircleHoverColor: '#A9099C4D',\n },\n ];\n }, [revealTableModesMemo.tableNumber, revealTableModesMemo.stars]);\n\n // Disabled infinite mode\n const handleInfiniteModeClick = useCallback(() => {\n onPress({\n mode: 'infinite',\n infiniteModeHighScore: data.infiniteModeHighScore,\n });\n }, [onPress, data.infiniteModeHighScore]);\n\n const handleNormalModeClick = useCallback(\n (mode: TTableMode, isStarRewarded: boolean) => {\n onPress({\n mode,\n tableNumber: revealTableModes.tableNumber,\n isStarRewarded,\n });\n },\n [onPress, revealTableModes.tableNumber],\n );\n\n const getHighlightedText = useCallback(() => {\n if (highlightedLevel) {\n return `${highlightedTable}× LEVEL${highlightedLevel}`;\n }\n\n return highlightedTable ? `${highlightedTable}× Table` : label;\n }, [highlightedLevel, highlightedTable, label]);\n\n const startLabelAnimation = useCallback((color: TColorNames) => {\n setLabelColor(color);\n setAniimatedColor(color);\n setIsLabelAnimated(true);\n }, []);\n\n const stopLabelAnimation = useCallback(() => setIsLabelAnimated(false), []);\n const setLabelVisiblity = useCallback((visible: boolean) => setShowLabel(visible), []);\n\n useImperativeHandle(ref, () => ({\n labelRef: labelRef,\n segmentedCardWrapperRef: cardRef,\n startLabelAnimation,\n stopLabelAnimation,\n setLabelVisiblity,\n handleTableSegmentClick,\n }));\n\n useEffect(() => {\n return () => {\n disappearAnimationTimer.current && clearTimeout(disappearAnimationTimer.current);\n };\n }, []);\n\n // Used in trial journey, to open table levels by default if given in props\n useEffect(() => {\n if (defaultTable) {\n playButtonSound();\n setFadeIn(true);\n setHighlightedTable(defaultTable.tableNumber);\n setRevealTableModes({ ...defaultTable });\n }\n }, [defaultTable, playButtonSound]);\n\n return (\n <CardContainer\n labelRef={labelRef}\n ref={cardRef}\n strokeColor=\"WHITE\"\n label={getHighlightedText()}\n labelColor={labelColor}\n isAnimated={isLabelAnimated}\n showLabel={showLabel}\n >\n <Styled.CardWrapper>\n {/* table selection */}\n <Styled.TableSegmentsWrapper>\n {/* infinite button */}\n <ArrowTooltip\n renderAs=\"primary\"\n position=\"top\"\n hidden={enableInfiniteMode}\n tooltipItem={\n <Text $renderAs=\"ab3\" $color=\"WHITE\">\n Coming Soon\n </Text>\n }\n >\n <Styled.InfiniteButtonWrapper\n onClick={enableInfiniteMode ? handleInfiniteModeClick : undefined}\n >\n <Styled.AbsoluteView>\n <LottieAnimation\n src={LOTTIE.INFINITE_BUTTON_BG}\n overrideSettings={rendererSettings}\n animateOnIntersect\n />\n </Styled.AbsoluteView>\n <Styled.AbsoluteView>\n <LottieAnimation\n src={LOTTIE.INFINITE_BUTTON_SYMBOL}\n overrideSettings={rendererSettings}\n animateOnIntersect\n />\n </Styled.AbsoluteView>\n </Styled.InfiniteButtonWrapper>\n </ArrowTooltip>\n\n {/* card shadow */}\n <Styled.TableSegmentCardShadowContainer />\n\n {/* table segments */}\n {data.tableList.map((table, index) => {\n const segmentAngle = 360 / data.tableList.length;\n const startAngle = -(90 + 360 / (2 * data.tableList.length));\n const currentAngle = startAngle + segmentAngle * (index + 1);\n\n return (\n <Styled.TableSegment\n key={index}\n $angle={currentAngle}\n $totalSegments={data.tableList.length}\n $zIndex={index + 1}\n onClick={() => handleTableSegmentClick(table)}\n onMouseOver={() => handleTableSegmentMouseOver(table)}\n onMouseLeave={handleTableSegmentMouseLeave}\n >\n <FlexView $flexDirection=\"row\" $justifyContent=\"center\" $alignItems=\"center\">\n {['sequence', 'random', 'advance'].map(star => (\n <TableSegmentStar\n key={star}\n isStarAchieved={table.stars.includes(star as TTableMode)}\n rewardStar={\n !fadeIn && openModesOfTable?.tableNumber === table.tableNumber\n ? rewardStar.includes(star as TTableMode)\n : undefined\n }\n />\n ))}\n <Separator width={GAME_LAUNCHER_SIZE * 0.055} />\n\n <Styled.TableNumber $angle={-currentAngle}>\n <Text\n $renderAs={\n GAME_LAUNCHER_SIZE === GAME_LAUNCHER_SIZE_LARGE\n ? 'ac3-black'\n : 'ac4-black'\n }\n $color={highlightedTable === table.tableNumber ? 'BLACK_1' : 'WHITE'}\n >\n {table.tableNumber}\n </Text>\n </Styled.TableNumber>\n </FlexView>\n </Styled.TableSegment>\n );\n })}\n </Styled.TableSegmentsWrapper>\n\n {/* table modes */}\n {revealTableModes.tableNumber > 0 && (\n <Styled.TableModeContainer>\n <Styled.TableModeWrapper>\n {/* tables modes with back button */}\n <Styled.AnimatedView animation={fadeIn ? 'fade-in' : 'fade-out'}>\n {tableModes.map((tableMode, index) => (\n <React.Fragment key={index}>\n <Styled.ModeOverlay\n $top={tableMode.semicirclePosiiionTop}\n $left={tableMode.semicirclePosiiionLeft}\n $hoverColor={tableMode.semicircleHoverColor}\n onClick={() =>\n fadeIn\n ? handleNormalModeClick(tableMode.type, tableMode.isStarAchieved)\n : undefined\n }\n onMouseOver={() =>\n fadeIn ? handleModeMouseOver(tableMode.type as TTableMode) : undefined\n }\n onMouseLeave={fadeIn ? handleModeMouseLeave : undefined}\n />\n <Styled.AbsoluteView\n $top={tableMode.top}\n $left={tableMode.left}\n $isPointerEventsNone={true}\n >\n <TableMode\n tableNumber={tableMode.tableNumber}\n isStarAchieved={tableMode.isStarAchieved}\n type={tableMode.type as TTableMode}\n rewardStar={rewardStar.includes(tableMode.type as TTableMode)}\n />\n </Styled.AbsoluteView>\n </React.Fragment>\n ))}\n {/* back button */}\n <Styled.AbsoluteView $top={50} $left={50} $alignCenter={true}>\n <Styled.IconWrapper>\n <Back2Icon\n onClick={goBack}\n height={GAME_LAUNCHER_SIZE * 0.1}\n width={GAME_LAUNCHER_SIZE * 0.1}\n />\n </Styled.IconWrapper>\n </Styled.AbsoluteView>\n </Styled.AnimatedView>\n\n {/* overlay lottie for modes */}\n <LottieAnimation\n src={LOTTIE.TABLE_MODE_REVEAL}\n ref={revealAnimationRef}\n overrideSettings={animationSettings}\n onRender={showTableModes}\n animateOnIntersect\n />\n </Styled.TableModeWrapper>\n </Styled.TableModeContainer>\n )}\n </Styled.CardWrapper>\n </CardContainer>\n );\n },\n);\n\nexport const TablesCard = memo(TablesCardComponent);\n"],"names":["rendererSettings","animationSettings","TablesCardComponent","forwardRef","data","label","onPress","openModesOfTable","defaultTable","onGoBackFromTableLevel","onPressTableSegment","ref","trackEvent","useUIContext","playButtonSound","useCircleSounds","fadeIn","setFadeIn","useState","highlightedTable","setHighlightedTable","highlightedLevel","setHighlightedLevel","labelColor","setLabelColor","revealTableModes","setRevealTableModes","_a","table","showLabel","setShowLabel","isLabelAnimated","setIsLabelAnimated","animatedColor","setAniimatedColor","labelRef","useRef","cardRef","rewardStar","setRewardStar","enableInfiniteMode","revealAnimationRef","disappearAnimationTimer","handleTableSegmentClick","useCallback","GAME_LAUNCHER_ANALYTICS_EVENTS","handleTableSegmentMouseOver","handleTableSegmentMouseLeave","goBack","time","TABLE_REVEAL_ANIMATION","showTableModes","handleModeMouseOver","type","level","TABLE_MODE_LABEL_COLOR","handleModeMouseLeave","revealTableModesMemo","useMemo","tableModes","handleInfiniteModeClick","handleNormalModeClick","mode","isStarRewarded","getHighlightedText","startLabelAnimation","color","stopLabelAnimation","setLabelVisiblity","visible","useImperativeHandle","useEffect","jsx","CardContainer","jsxs","Styled.CardWrapper","Styled.TableSegmentsWrapper","ArrowTooltip","Text","Styled.InfiniteButtonWrapper","Styled.AbsoluteView","LottieAnimation","LOTTIE","Styled.TableSegmentCardShadowContainer","index","segmentAngle","currentAngle","Styled.TableSegment","FlexView","star","TableSegmentStar","Separator","GAME_LAUNCHER_SIZE","Styled.TableNumber","GAME_LAUNCHER_SIZE_LARGE","Styled.TableModeContainer","Styled.TableModeWrapper","Styled.AnimatedView","tableMode","React","Styled.ModeOverlay","TableMode","Styled.IconWrapper","Back2Icon","TablesCard","memo"],"mappings":";;;;;;;;;;;;;;;;;;AAoCA,MAAMA,IAAmB;AAAA,EACvB,UAAU;AACZ,GAEMC,KAAoB;AAAA,EACxB,MAAM;AAAA,EACN,UAAU;AAAA,EACV,GAAGD;AACL,GAEME,KAAsBC;AAAA,EAC1B,CACE;AAAA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
|
-
import
|
3
|
-
import { memo as
|
4
|
-
import
|
5
|
-
import { fetchLottie as
|
6
|
-
const
|
2
|
+
import b from "lottie-web";
|
3
|
+
import { memo as A, forwardRef as I, useRef as m, useMemo as S, useImperativeHandle as x, useEffect as O } from "react";
|
4
|
+
import $ from "../layout/flex-view.js";
|
5
|
+
import { fetchLottie as k } from "./helper.js";
|
6
|
+
const F = I((L, h) => {
|
7
7
|
const {
|
8
8
|
src: l,
|
9
9
|
width: w = "100%",
|
10
10
|
height: y = "100%",
|
11
|
-
settings:
|
11
|
+
settings: o,
|
12
12
|
eventListener: n,
|
13
13
|
onRender: a,
|
14
|
-
animateOnIntersect: s
|
15
|
-
|
14
|
+
animateOnIntersect: s,
|
15
|
+
overrideSettings: g
|
16
|
+
} = L, c = m(null), r = m(null), u = m(null), d = S(
|
16
17
|
() => ({
|
17
|
-
...
|
18
|
-
renderer: window.ReactNativeWebView ? "canvas" : (
|
18
|
+
...o,
|
19
|
+
renderer: window.ReactNativeWebView ? "canvas" : (o == null ? void 0 : o.renderer) ?? "svg",
|
20
|
+
...g || {}
|
19
21
|
}),
|
20
|
-
[
|
22
|
+
[o]
|
21
23
|
);
|
22
24
|
return x(
|
23
25
|
h,
|
24
26
|
() => ({
|
25
|
-
playSegments: (t,
|
27
|
+
playSegments: (t, i) => {
|
26
28
|
var e;
|
27
|
-
return (e = r.current) == null ? void 0 : e.playSegments(t,
|
29
|
+
return (e = r.current) == null ? void 0 : e.playSegments(t, i);
|
28
30
|
},
|
29
|
-
addEventListener: (t,
|
31
|
+
addEventListener: (t, i) => {
|
30
32
|
var e;
|
31
|
-
return (e = r.current) == null ? void 0 : e.addEventListener(t,
|
33
|
+
return (e = r.current) == null ? void 0 : e.addEventListener(t, i);
|
32
34
|
},
|
33
|
-
removeEventListener: (t,
|
35
|
+
removeEventListener: (t, i) => {
|
34
36
|
var e;
|
35
|
-
return (e = r.current) == null ? void 0 : e.removeEventListener(t,
|
37
|
+
return (e = r.current) == null ? void 0 : e.removeEventListener(t, i);
|
36
38
|
},
|
37
39
|
play: () => {
|
38
40
|
var t;
|
@@ -48,9 +50,9 @@ const k = A((L, h) => {
|
|
48
50
|
let t = !1;
|
49
51
|
return (async () => {
|
50
52
|
try {
|
51
|
-
const e = await
|
53
|
+
const e = await k(l);
|
52
54
|
requestAnimationFrame(() => {
|
53
|
-
!c.current || t || (r.current =
|
55
|
+
!c.current || t || (r.current = b.loadAnimation({
|
54
56
|
container: c.current,
|
55
57
|
animationData: e,
|
56
58
|
loop: !0,
|
@@ -58,8 +60,8 @@ const k = A((L, h) => {
|
|
58
60
|
...d
|
59
61
|
}), s && (u.current = new IntersectionObserver(
|
60
62
|
([f]) => {
|
61
|
-
var
|
62
|
-
f && f.isIntersecting ? (
|
63
|
+
var v, p;
|
64
|
+
f && f.isIntersecting ? (v = r.current) == null || v.play() : (p = r.current) == null || p.pause();
|
63
65
|
},
|
64
66
|
{ threshold: 0 }
|
65
67
|
), u.current.observe(c.current)), a == null || a(), n && r.current.addEventListener(n.name, n.callback));
|
@@ -71,9 +73,9 @@ const k = A((L, h) => {
|
|
71
73
|
var e;
|
72
74
|
t = !0, r.current && (n && r.current.removeEventListener(n.name, n.callback), s && ((e = u.current) == null || e.disconnect()), r.current.destroy());
|
73
75
|
};
|
74
|
-
}, [l, n, a, s, d]), /* @__PURE__ */ E(
|
75
|
-
}),
|
76
|
+
}, [l, n, a, s, d]), /* @__PURE__ */ E($, { ref: c, $width: w, $height: y });
|
77
|
+
}), H = A(F);
|
76
78
|
export {
|
77
|
-
|
79
|
+
H as default
|
78
80
|
};
|
79
81
|
//# sourceMappingURL=lottie-animation.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"lottie-animation.js","sources":["../../../../src/features/ui/lottie-animation/lottie-animation.tsx"],"sourcesContent":["import type { ILottieAnimationProps, ILottieAnimationRef } from './types';\nimport type { AnimationEventName, AnimationItem, AnimationSegment, RendererType } from 'lottie-web';\n\nimport lottie from 'lottie-web';\nimport { forwardRef, memo, useEffect, useImperativeHandle, useMemo, useRef } from 'react';\n\nimport FlexView from '../layout/flex-view';\nimport { fetchLottie } from './helper';\n\nconst LottieAnimation = forwardRef<ILottieAnimationRef, ILottieAnimationProps>((props, ref) => {\n const {\n src,\n width = '100%',\n height = '100%',\n settings,\n eventListener,\n onRender,\n animateOnIntersect,\n } = props;\n\n const container = useRef<HTMLDivElement>(null);\n const animationInstance = useRef<AnimationItem | null>(null);\n const intersectionObserver = useRef<IntersectionObserver | null>(null);\n const newSettings = useMemo(\n () => ({\n ...settings,\n renderer: (window.ReactNativeWebView
|
1
|
+
{"version":3,"file":"lottie-animation.js","sources":["../../../../src/features/ui/lottie-animation/lottie-animation.tsx"],"sourcesContent":["import type { ILottieAnimationProps, ILottieAnimationRef } from './types';\nimport type { AnimationEventName, AnimationItem, AnimationSegment, RendererType } from 'lottie-web';\n\nimport lottie from 'lottie-web';\nimport { forwardRef, memo, useEffect, useImperativeHandle, useMemo, useRef } from 'react';\n\nimport FlexView from '../layout/flex-view';\nimport { fetchLottie } from './helper';\n\nconst LottieAnimation = forwardRef<ILottieAnimationRef, ILottieAnimationProps>((props, ref) => {\n const {\n src,\n width = '100%',\n height = '100%',\n settings,\n eventListener,\n onRender,\n animateOnIntersect,\n overrideSettings,\n } = props;\n\n const container = useRef<HTMLDivElement>(null);\n const animationInstance = useRef<AnimationItem | null>(null);\n const intersectionObserver = useRef<IntersectionObserver | null>(null);\n const newSettings = useMemo(\n () => ({\n ...settings,\n renderer: (window.ReactNativeWebView\n ? 'canvas'\n : settings?.renderer ?? 'svg') as RendererType,\n ...(overrideSettings || {}),\n }),\n [settings],\n );\n\n useImperativeHandle(\n ref,\n () => ({\n playSegments: (segments: AnimationSegment, forceFlag?: boolean) =>\n animationInstance.current?.playSegments(segments, forceFlag),\n addEventListener: (eventName: string, callback: () => void) =>\n animationInstance.current?.addEventListener(eventName as AnimationEventName, callback),\n removeEventListener: (eventName: string, callback: () => void) =>\n animationInstance.current?.removeEventListener(eventName as AnimationEventName, callback),\n play: () => animationInstance.current?.play(),\n stop: () => animationInstance.current?.stop(),\n }),\n [],\n );\n\n useEffect(() => {\n let destroyed = false;\n\n const loadAnimation = async () => {\n try {\n const animationData = await fetchLottie(src);\n\n // Wait for layout\n requestAnimationFrame(() => {\n if (!container.current || destroyed) return;\n\n animationInstance.current = lottie.loadAnimation({\n container: container.current,\n animationData,\n loop: true,\n autoplay: true,\n ...newSettings,\n });\n\n if (animateOnIntersect) {\n intersectionObserver.current = new IntersectionObserver(\n ([entry]) => {\n if (entry && entry.isIntersecting) {\n animationInstance.current?.play();\n } else {\n animationInstance.current?.pause();\n }\n },\n { threshold: 0 },\n );\n\n intersectionObserver.current.observe(container.current);\n }\n\n onRender?.();\n\n if (eventListener) {\n animationInstance.current.addEventListener(eventListener.name, eventListener.callback);\n }\n });\n } catch (error) {\n console.error('Error loading Lottie animation:', error);\n }\n };\n\n loadAnimation();\n\n return () => {\n destroyed = true;\n if (animationInstance.current) {\n if (eventListener) {\n animationInstance.current.removeEventListener(eventListener.name, eventListener.callback);\n }\n\n if (animateOnIntersect) {\n intersectionObserver.current?.disconnect();\n }\n\n animationInstance.current.destroy();\n }\n };\n }, [src, eventListener, onRender, animateOnIntersect, newSettings]);\n\n return <FlexView ref={container} $width={width} $height={height} />;\n});\n\nexport default memo(LottieAnimation);\n"],"names":["LottieAnimation","forwardRef","props","ref","src","width","height","settings","eventListener","onRender","animateOnIntersect","overrideSettings","container","useRef","animationInstance","intersectionObserver","newSettings","useMemo","useImperativeHandle","segments","forceFlag","_a","eventName","callback","useEffect","destroyed","animationData","fetchLottie","lottie","entry","_b","error","FlexView","LottieAnimation$1","memo"],"mappings":";;;;;AASA,MAAMA,IAAkBC,EAAuD,CAACC,GAAOC,MAAQ;AACvF,QAAA;AAAA,IACJ,KAAAC;AAAA,IACA,OAAAC,IAAQ;AAAA,IACR,QAAAC,IAAS;AAAA,IACT,UAAAC;AAAA,IACA,eAAAC;AAAA,IACA,U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