@cuemath/leap 2.8.41 → 2.8.43-rj-0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/line-icons/icons/carat-left.js +26 -0
- package/dist/assets/line-icons/icons/carat-left.js.map +1 -0
- package/dist/assets/line-icons/icons/carat-right.js +26 -0
- package/dist/assets/line-icons/icons/carat-right.js.map +1 -0
- package/dist/features/circle-games/enum/circle-onboarding-steps.js +1 -1
- package/dist/features/circle-games/enum/circle-onboarding-steps.js.map +1 -1
- package/dist/features/circle-games/game-launcher/comps/card-container/card-container.js +20 -11
- package/dist/features/circle-games/game-launcher/comps/card-container/card-container.js.map +1 -1
- package/dist/features/circle-games/game-launcher/comps/carousel/carousel.js +53 -47
- package/dist/features/circle-games/game-launcher/comps/carousel/carousel.js.map +1 -1
- package/dist/features/circle-games/game-launcher/comps/tables-card/tables-card.js +159 -130
- package/dist/features/circle-games/game-launcher/comps/tables-card/tables-card.js.map +1 -1
- package/dist/features/circle-games/game-launcher/dal/use-get-circle-home-details-dal/use-get-circle-home-details-dal.js +20 -16
- package/dist/features/circle-games/game-launcher/dal/use-get-circle-home-details-dal/use-get-circle-home-details-dal.js.map +1 -1
- package/dist/features/circle-games/game-launcher/game-launcher.js +95 -68
- package/dist/features/circle-games/game-launcher/game-launcher.js.map +1 -1
- package/dist/features/circle-games/game-launcher/hooks/use-game-launcher-journey/constants.js +9 -0
- package/dist/features/circle-games/game-launcher/hooks/use-game-launcher-journey/constants.js.map +1 -0
- package/dist/features/circle-games/game-launcher/hooks/use-game-launcher-journey/use-game-launcher-journey.js +217 -0
- package/dist/features/circle-games/game-launcher/hooks/use-game-launcher-journey/use-game-launcher-journey.js.map +1 -0
- package/dist/features/circle-games/game-launcher/hooks/use-table-launcher-journey/constants.js +13 -0
- package/dist/features/circle-games/game-launcher/hooks/use-table-launcher-journey/constants.js.map +1 -0
- package/dist/features/circle-games/game-launcher/hooks/use-table-launcher-journey/use-table-launcher-journey-styled.js +13 -0
- package/dist/features/circle-games/game-launcher/hooks/use-table-launcher-journey/use-table-launcher-journey-styled.js.map +1 -0
- package/dist/features/circle-games/game-launcher/hooks/use-table-launcher-journey/use-table-launcher-journey.js +205 -0
- package/dist/features/circle-games/game-launcher/hooks/use-table-launcher-journey/use-table-launcher-journey.js.map +1 -0
- package/dist/features/journey/journey-id/journey-id-student.js +1 -1
- package/dist/features/journey/journey-id/journey-id-student.js.map +1 -1
- package/dist/features/journey/use-journey/journey-context-provider.js +10 -8
- package/dist/features/journey/use-journey/journey-context-provider.js.map +1 -1
- package/dist/index.d.ts +9 -4
- package/package.json +1 -1
- package/dist/features/circle-games/game-launcher/use-game-launcher-journey/constants.js +0 -7
- package/dist/features/circle-games/game-launcher/use-game-launcher-journey/constants.js.map +0 -1
- package/dist/features/circle-games/game-launcher/use-game-launcher-journey/use-game-launcher-journey.js +0 -213
- package/dist/features/circle-games/game-launcher/use-game-launcher-journey/use-game-launcher-journey.js.map +0 -1
@@ -0,0 +1,26 @@
|
|
1
|
+
import { jsx as l } from "react/jsx-runtime";
|
2
|
+
const o = (e) => /* @__PURE__ */ l(
|
3
|
+
"svg",
|
4
|
+
{
|
5
|
+
width: "28",
|
6
|
+
height: "28",
|
7
|
+
viewBox: "0 0 28 28",
|
8
|
+
fill: "none",
|
9
|
+
xmlns: "http://www.w3.org/2000/svg",
|
10
|
+
...e,
|
11
|
+
children: /* @__PURE__ */ l(
|
12
|
+
"path",
|
13
|
+
{
|
14
|
+
fillRule: "evenodd",
|
15
|
+
clipRule: "evenodd",
|
16
|
+
d: "M8.55566 13.3004C12.4646 13.3004 15.6334 10.1316 15.6334 6.22266H17.0334C17.0334 9.7039 14.9352 12.6951 11.9343 14.0004C14.9352 15.3058 17.0334 18.297 17.0334 21.7782H15.6334C15.6334 17.8693 12.4646 14.7004 8.55566 14.7004V13.3004Z",
|
17
|
+
fill: "currentColor",
|
18
|
+
fillOpacity: "0.87"
|
19
|
+
}
|
20
|
+
)
|
21
|
+
}
|
22
|
+
);
|
23
|
+
export {
|
24
|
+
o as default
|
25
|
+
};
|
26
|
+
//# sourceMappingURL=carat-left.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"carat-left.js","sources":["../../../../src/assets/line-icons/icons/carat-left.tsx"],"sourcesContent":["const CaratLeftIcon: React.FC<React.SVGProps<SVGSVGElement>> = props => (\n <svg\n width=\"28\"\n height=\"28\"\n viewBox=\"0 0 28 28\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n {...props}\n >\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M8.55566 13.3004C12.4646 13.3004 15.6334 10.1316 15.6334 6.22266H17.0334C17.0334 9.7039 14.9352 12.6951 11.9343 14.0004C14.9352 15.3058 17.0334 18.297 17.0334 21.7782H15.6334C15.6334 17.8693 12.4646 14.7004 8.55566 14.7004V13.3004Z\"\n fill=\"currentColor\"\n fillOpacity=\"0.87\"\n />\n </svg>\n);\n\nexport default CaratLeftIcon;\n"],"names":["CaratLeftIcon","props","jsx"],"mappings":";AAAA,MAAMA,IAAyD,CAC7DC,MAAA,gBAAAC;AAAA,EAAC;AAAA,EAAA;AAAA,IACC,OAAM;AAAA,IACN,QAAO;AAAA,IACP,SAAQ;AAAA,IACR,MAAK;AAAA,IACL,OAAM;AAAA,IACL,GAAGD;AAAA,IAEJ,UAAA,gBAAAC;AAAA,MAAC;AAAA,MAAA;AAAA,QACC,UAAS;AAAA,QACT,UAAS;AAAA,QACT,GAAE;AAAA,QACF,MAAK;AAAA,QACL,aAAY;AAAA,MAAA;AAAA,IACd;AAAA,EAAA;AACF;"}
|
@@ -0,0 +1,26 @@
|
|
1
|
+
import { jsx as l } from "react/jsx-runtime";
|
2
|
+
const i = (e) => /* @__PURE__ */ l(
|
3
|
+
"svg",
|
4
|
+
{
|
5
|
+
width: "28",
|
6
|
+
height: "28",
|
7
|
+
viewBox: "0 0 28 28",
|
8
|
+
fill: "none",
|
9
|
+
xmlns: "http://www.w3.org/2000/svg",
|
10
|
+
...e,
|
11
|
+
children: /* @__PURE__ */ l(
|
12
|
+
"path",
|
13
|
+
{
|
14
|
+
fillRule: "evenodd",
|
15
|
+
clipRule: "evenodd",
|
16
|
+
d: "M19.4443 14.6996C15.5354 14.6996 12.3666 17.8684 12.3666 21.7773H10.9666C10.9666 18.2961 13.0648 15.3049 16.0657 13.9996C13.0648 12.6942 10.9666 9.70303 10.9666 6.22179L12.3666 6.22179C12.3666 10.1307 15.5354 13.2996 19.4443 13.2996V14.6996Z",
|
17
|
+
fill: "currentColor",
|
18
|
+
fillOpacity: "0.87"
|
19
|
+
}
|
20
|
+
)
|
21
|
+
}
|
22
|
+
);
|
23
|
+
export {
|
24
|
+
i as default
|
25
|
+
};
|
26
|
+
//# sourceMappingURL=carat-right.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"carat-right.js","sources":["../../../../src/assets/line-icons/icons/carat-right.tsx"],"sourcesContent":["const CaratRightIcon: React.FC<React.SVGProps<SVGSVGElement>> = props => (\n <svg\n width=\"28\"\n height=\"28\"\n viewBox=\"0 0 28 28\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n {...props}\n >\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M19.4443 14.6996C15.5354 14.6996 12.3666 17.8684 12.3666 21.7773H10.9666C10.9666 18.2961 13.0648 15.3049 16.0657 13.9996C13.0648 12.6942 10.9666 9.70303 10.9666 6.22179L12.3666 6.22179C12.3666 10.1307 15.5354 13.2996 19.4443 13.2996V14.6996Z\"\n fill=\"currentColor\"\n fillOpacity=\"0.87\"\n />\n </svg>\n);\n\nexport default CaratRightIcon;\n"],"names":["CaratRightIcon","props","jsx"],"mappings":";AAAA,MAAMA,IAA0D,CAC9DC,MAAA,gBAAAC;AAAA,EAAC;AAAA,EAAA;AAAA,IACC,OAAM;AAAA,IACN,QAAO;AAAA,IACP,SAAQ;AAAA,IACR,MAAK;AAAA,IACL,OAAM;AAAA,IACL,GAAGD;AAAA,IAEJ,UAAA,gBAAAC;AAAA,MAAC;AAAA,MAAA;AAAA,QACC,UAAS;AAAA,QACT,UAAS;AAAA,QACT,GAAE;AAAA,QACF,MAAK;AAAA,QACL,aAAY;AAAA,MAAA;AAAA,IACd;AAAA,EAAA;AACF;"}
|
@@ -1,4 +1,4 @@
|
|
1
|
-
var a = /* @__PURE__ */ ((t) => (t.SKILL_ACTIVITY = "skill_activity", t.GAMES_ACTIVITY = "games_activity", t.PUZZLE_ACTIVITY = "puzzle_activity", t.TUTORIAL = "tutorial", t.POINTS = "points", t.STREAK = "streak", t.LEADERBOARD = "leaderboard", t))(a || {});
|
1
|
+
var a = /* @__PURE__ */ ((t) => (t.SKILL_ACTIVITY = "skill_activity", t.GAMES_ACTIVITY = "games_activity", t.PUZZLE_ACTIVITY = "puzzle_activity", t.TUTORIAL = "tutorial", t.POINTS = "points", t.STREAK = "streak", t.LEADERBOARD = "leaderboard", t.TABLES = "tables", t))(a || {});
|
2
2
|
export {
|
3
3
|
a as CIRCLE_ONBOARDING_ANALYTICS_STEPS
|
4
4
|
};
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"circle-onboarding-steps.js","sources":["../../../../src/features/circle-games/enum/circle-onboarding-steps.ts"],"sourcesContent":["export enum CIRCLE_ONBOARDING_ANALYTICS_STEPS {\n SKILL_ACTIVITY = 'skill_activity',\n GAMES_ACTIVITY = 'games_activity',\n PUZZLE_ACTIVITY = 'puzzle_activity',\n TUTORIAL = 'tutorial',\n POINTS = 'points',\n STREAK = 'streak',\n LEADERBOARD = 'leaderboard',\n}\n"],"names":["CIRCLE_ONBOARDING_ANALYTICS_STEPS"],"mappings":"AAAY,IAAAA,sBAAAA,OACVA,EAAA,iBAAiB,kBACjBA,EAAA,iBAAiB,kBACjBA,EAAA,kBAAkB,mBAClBA,EAAA,WAAW,YACXA,EAAA,SAAS,UACTA,EAAA,SAAS,UACTA,EAAA,cAAc,
|
1
|
+
{"version":3,"file":"circle-onboarding-steps.js","sources":["../../../../src/features/circle-games/enum/circle-onboarding-steps.ts"],"sourcesContent":["export enum CIRCLE_ONBOARDING_ANALYTICS_STEPS {\n SKILL_ACTIVITY = 'skill_activity',\n GAMES_ACTIVITY = 'games_activity',\n PUZZLE_ACTIVITY = 'puzzle_activity',\n TUTORIAL = 'tutorial',\n POINTS = 'points',\n STREAK = 'streak',\n LEADERBOARD = 'leaderboard',\n TABLES = 'tables',\n}\n"],"names":["CIRCLE_ONBOARDING_ANALYTICS_STEPS"],"mappings":"AAAY,IAAAA,sBAAAA,OACVA,EAAA,iBAAiB,kBACjBA,EAAA,iBAAiB,kBACjBA,EAAA,kBAAkB,mBAClBA,EAAA,WAAW,YACXA,EAAA,SAAS,UACTA,EAAA,SAAS,UACTA,EAAA,cAAc,eACdA,EAAA,SAAS,UARCA,IAAAA,KAAA,CAAA,CAAA;"}
|
@@ -1,23 +1,32 @@
|
|
1
|
-
import { jsxs as
|
2
|
-
import { memo as
|
3
|
-
import { CardWrapper as
|
1
|
+
import { jsxs as m, jsx as r } from "react/jsx-runtime";
|
2
|
+
import { memo as C, forwardRef as f } from "react";
|
3
|
+
import { CardWrapper as b, ExtendedFlexView as p, AnimatedLabel as $, CardContainer as h } from "./card-container-styled.js";
|
4
4
|
const x = (e, o) => {
|
5
|
-
const {
|
6
|
-
|
5
|
+
const {
|
6
|
+
children: n,
|
7
|
+
strokeColor: a,
|
8
|
+
label: t,
|
9
|
+
isAnimated: l,
|
10
|
+
labelRef: i,
|
11
|
+
showLabel: d = !0,
|
12
|
+
labelColor: s,
|
13
|
+
...c
|
14
|
+
} = e;
|
15
|
+
return /* @__PURE__ */ m(b, { ...c, children: [
|
7
16
|
/* @__PURE__ */ r(p, { children: /* @__PURE__ */ r(
|
8
17
|
$,
|
9
18
|
{
|
10
|
-
ref:
|
19
|
+
ref: i,
|
11
20
|
$renderAs: "ac4-black",
|
12
21
|
$align: "center",
|
13
|
-
$color:
|
14
|
-
$isAnimated:
|
15
|
-
children: t
|
22
|
+
$color: s,
|
23
|
+
$isAnimated: l,
|
24
|
+
children: d ? t : ""
|
16
25
|
}
|
17
26
|
) }),
|
18
|
-
/* @__PURE__ */ r(
|
27
|
+
/* @__PURE__ */ r(h, { ref: o, $strokeColor: a, children: n })
|
19
28
|
] });
|
20
|
-
}, j =
|
29
|
+
}, j = C(f(x));
|
21
30
|
export {
|
22
31
|
j as CardContainer
|
23
32
|
};
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"card-container.js","sources":["../../../../../../src/features/circle-games/game-launcher/comps/card-container/card-container.tsx"],"sourcesContent":["import type { ICardContainerProps } from './card-container-types';\nimport type { ForwardRefRenderFunction } from 'react';\n\nimport { forwardRef, memo } from 'react';\n\nimport * as Styled from './card-container-styled';\n\nconst Container: ForwardRefRenderFunction<HTMLDivElement, ICardContainerProps> = (props, ref) => {\n const {
|
1
|
+
{"version":3,"file":"card-container.js","sources":["../../../../../../src/features/circle-games/game-launcher/comps/card-container/card-container.tsx"],"sourcesContent":["import type { ICardContainerProps } from './card-container-types';\nimport type { ForwardRefRenderFunction } from 'react';\n\nimport { forwardRef, memo } from 'react';\n\nimport * as Styled from './card-container-styled';\n\nconst Container: ForwardRefRenderFunction<HTMLDivElement, ICardContainerProps> = (props, ref) => {\n const {\n children,\n strokeColor,\n label,\n isAnimated,\n labelRef,\n showLabel = true,\n labelColor,\n ...rest\n } = props;\n\n return (\n <Styled.CardWrapper {...rest}>\n <Styled.ExtendedFlexView>\n <Styled.AnimatedLabel\n ref={labelRef}\n $renderAs=\"ac4-black\"\n $align=\"center\"\n $color={labelColor}\n $isAnimated={isAnimated}\n >\n {showLabel ? label : ''}\n </Styled.AnimatedLabel>\n </Styled.ExtendedFlexView>\n <Styled.CardContainer ref={ref} $strokeColor={strokeColor}>\n {children}\n </Styled.CardContainer>\n </Styled.CardWrapper>\n );\n};\n\nexport const CardContainer = memo(forwardRef(Container));\n"],"names":["Container","props","ref","children","strokeColor","label","isAnimated","labelRef","showLabel","labelColor","rest","jsxs","Styled.CardWrapper","jsx","Styled.ExtendedFlexView","Styled.AnimatedLabel","Styled.CardContainer","CardContainer","memo","forwardRef"],"mappings":";;;AAOA,MAAMA,IAA2E,CAACC,GAAOC,MAAQ;AACzF,QAAA;AAAA,IACJ,UAAAC;AAAA,IACA,aAAAC;AAAA,IACA,OAAAC;AAAA,IACA,YAAAC;AAAA,IACA,UAAAC;AAAA,IACA,WAAAC,IAAY;AAAA,IACZ,YAAAC;AAAA,IACA,GAAGC;AAAA,EACD,IAAAT;AAEJ,SACG,gBAAAU,EAAAC,GAAA,EAAoB,GAAGF,GACtB,UAAA;AAAA,IAAC,gBAAAG,EAAAC,GAAA,EACC,UAAA,gBAAAD;AAAA,MAACE;AAAAA,MAAA;AAAA,QACC,KAAKR;AAAA,QACL,WAAU;AAAA,QACV,QAAO;AAAA,QACP,QAAQE;AAAA,QACR,aAAaH;AAAA,QAEZ,cAAYD,IAAQ;AAAA,MAAA;AAAA,IAAA,GAEzB;AAAA,sBACCW,GAAA,EAAqB,KAAAd,GAAU,cAAcE,GAC3C,UAAAD,GACH;AAAA,EACF,EAAA,CAAA;AAEJ,GAEac,IAAgBC,EAAKC,EAAWnB,CAAS,CAAC;"}
|
@@ -1,79 +1,85 @@
|
|
1
|
-
import { jsxs as
|
2
|
-
import { memo as j, forwardRef as
|
3
|
-
import
|
4
|
-
import
|
5
|
-
import
|
6
|
-
import
|
7
|
-
import { Carousel as
|
8
|
-
const
|
9
|
-
const
|
10
|
-
|
11
|
-
}, [
|
12
|
-
|
13
|
-
}, [
|
14
|
-
|
1
|
+
import { jsxs as y, jsx as e } from "react/jsx-runtime";
|
2
|
+
import { memo as j, forwardRef as x, useMemo as u, useRef as b, useState as z, createRef as B, useCallback as d, useImperativeHandle as D, useEffect as $ } from "react";
|
3
|
+
import E from "../../../../../assets/line-icons/icons/carat-left.js";
|
4
|
+
import F from "../../../../../assets/line-icons/icons/carat-right.js";
|
5
|
+
import R from "../../../../ui/buttons/icon-button/icon-button.js";
|
6
|
+
import g from "../../../../ui/separator/separator.js";
|
7
|
+
import { Carousel as M, CarouselWrapper as S, CarouselItemContainer as H, ExtendedFlexView as T, Indicator as V } from "./carousel-styled.js";
|
8
|
+
const W = ({ items: t, defaultIndex: l = 0, onNext: s, onPrev: c, analyticsPrev: m, analyticsNext: p }, k) => {
|
9
|
+
const f = u(() => m, [m]), C = u(() => p, [p]), h = b(null), i = b(!0), [o, n] = z(l), I = u(() => t.map(() => B()), [t]), w = d(() => {
|
10
|
+
c == null || c(), n((r) => r - 1);
|
11
|
+
}, [c]), A = d(() => {
|
12
|
+
s == null || s(), n((r) => r + 1);
|
13
|
+
}, [s]), L = d((r) => {
|
14
|
+
n(r);
|
15
15
|
}, []);
|
16
|
-
return
|
17
|
-
nextBtnRef:
|
18
|
-
|
16
|
+
return D(k, () => ({
|
17
|
+
nextBtnRef: h,
|
18
|
+
indicatorRefs: I,
|
19
|
+
currentIndex: o,
|
20
|
+
goToIndex: (r) => {
|
21
|
+
n(r);
|
22
|
+
}
|
23
|
+
})), $(() => {
|
19
24
|
i.current && (i.current = !1);
|
20
|
-
}, []),
|
21
|
-
|
22
|
-
}, [l]), /* @__PURE__ */
|
23
|
-
/* @__PURE__ */
|
24
|
-
|
25
|
+
}, []), $(() => {
|
26
|
+
n(l);
|
27
|
+
}, [l]), /* @__PURE__ */ y(M, { children: [
|
28
|
+
/* @__PURE__ */ e(
|
29
|
+
S,
|
25
30
|
{
|
26
|
-
$translate:
|
31
|
+
$translate: o * 100,
|
27
32
|
$translateDuration: i.current ? 0 : 300,
|
28
|
-
children:
|
33
|
+
children: t.map((r, a) => /* @__PURE__ */ e(H, { children: r }, a))
|
29
34
|
}
|
30
35
|
),
|
31
|
-
|
32
|
-
|
36
|
+
t.length > 1 && /* @__PURE__ */ y(
|
37
|
+
T,
|
33
38
|
{
|
34
39
|
$flexDirection: "row",
|
35
40
|
$alignItems: "center",
|
36
41
|
$justifyContent: "center",
|
37
42
|
$position: "absolute",
|
38
43
|
children: [
|
39
|
-
/* @__PURE__ */
|
40
|
-
|
44
|
+
/* @__PURE__ */ e(
|
45
|
+
R,
|
41
46
|
{
|
42
47
|
renderAs: "secondary",
|
43
|
-
Icon:
|
44
|
-
onClick:
|
45
|
-
analyticsLabel:
|
46
|
-
analyticsProps:
|
47
|
-
disabled:
|
48
|
+
Icon: E,
|
49
|
+
onClick: w,
|
50
|
+
analyticsLabel: f.analyticsLabel,
|
51
|
+
analyticsProps: f.analyticsProps,
|
52
|
+
disabled: o === 0
|
48
53
|
}
|
49
54
|
),
|
50
|
-
/* @__PURE__ */
|
51
|
-
|
52
|
-
|
55
|
+
/* @__PURE__ */ e(g, { width: 48 }),
|
56
|
+
t.map((r, a) => /* @__PURE__ */ e(
|
57
|
+
V,
|
53
58
|
{
|
54
|
-
|
55
|
-
|
59
|
+
ref: I[a],
|
60
|
+
$isActive: a === o,
|
61
|
+
onClick: () => L(a)
|
56
62
|
},
|
57
|
-
|
63
|
+
a
|
58
64
|
)),
|
59
|
-
/* @__PURE__ */
|
60
|
-
/* @__PURE__ */
|
61
|
-
|
65
|
+
/* @__PURE__ */ e(g, { width: 48 }),
|
66
|
+
/* @__PURE__ */ e("div", { ref: h, children: /* @__PURE__ */ e(
|
67
|
+
R,
|
62
68
|
{
|
63
69
|
renderAs: "secondary",
|
64
|
-
Icon:
|
65
|
-
onClick:
|
70
|
+
Icon: F,
|
71
|
+
onClick: A,
|
66
72
|
analyticsLabel: C.analyticsLabel,
|
67
73
|
analyticsProps: C.analyticsProps,
|
68
|
-
disabled:
|
74
|
+
disabled: o === t.length - 1
|
69
75
|
}
|
70
76
|
) })
|
71
77
|
]
|
72
78
|
}
|
73
79
|
)
|
74
80
|
] });
|
75
|
-
},
|
81
|
+
}, Q = j(x(W));
|
76
82
|
export {
|
77
|
-
|
83
|
+
Q as Carousel
|
78
84
|
};
|
79
85
|
//# sourceMappingURL=carousel.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"carousel.js","sources":["../../../../../../src/features/circle-games/game-launcher/comps/carousel/carousel.tsx"],"sourcesContent":["import type { ICarouselProps, ICarouselRefs } from './carousel-types';\nimport type { ForwardRefRenderFunction } from 'react';\n\nimport {\n memo,\n useCallback,\n useEffect,\n useMemo,\n useRef,\n useState,\n forwardRef,\n useImperativeHandle,\n} from 'react';\n\nimport
|
1
|
+
{"version":3,"file":"carousel.js","sources":["../../../../../../src/features/circle-games/game-launcher/comps/carousel/carousel.tsx"],"sourcesContent":["import type { ICarouselProps, ICarouselRefs } from './carousel-types';\nimport type { ForwardRefRenderFunction } from 'react';\n\nimport {\n memo,\n useCallback,\n useEffect,\n useMemo,\n useRef,\n useState,\n forwardRef,\n useImperativeHandle,\n createRef,\n} from 'react';\n\nimport CaratLeftIcon from '../../../../../assets/line-icons/icons/carat-left';\nimport CaratRightIcon from '../../../../../assets/line-icons/icons/carat-right';\nimport IconButton from '../../../../ui/buttons/icon-button/icon-button';\nimport Separator from '../../../../ui/separator/separator';\nimport * as Styled from './carousel-styled';\n\nconst CarouselComponent: ForwardRefRenderFunction<ICarouselRefs, ICarouselProps> = (\n { items, defaultIndex = 0, onNext, onPrev, analyticsPrev, analyticsNext },\n ref,\n) => {\n const memoizedAnalyticsPrev = useMemo(() => analyticsPrev, [analyticsPrev]);\n const memoizedAnalyticsNext = useMemo(() => analyticsNext, [analyticsNext]);\n\n const nextBtnRef = useRef<HTMLDivElement>(null);\n const isFirstMount = useRef(true);\n const [currIndex, setCurrIndex] = useState(defaultIndex);\n\n // Create a stable array of refs for indicators\n const indicatorRefs = useMemo(() => items.map(() => createRef<HTMLDivElement>()), [items]);\n\n const handleCarouselPrev = useCallback(() => {\n onPrev?.();\n setCurrIndex(prev => prev - 1);\n }, [onPrev]);\n\n const handleCarouselNext = useCallback(() => {\n onNext?.();\n setCurrIndex(prev => prev + 1);\n }, [onNext]);\n\n const handleCarouselIndicatorClick = useCallback((index: number) => {\n setCurrIndex(index);\n }, []);\n\n useImperativeHandle(ref, () => ({\n nextBtnRef,\n indicatorRefs,\n currentIndex: currIndex,\n goToIndex: (index: number) => {\n setCurrIndex(index);\n },\n }));\n\n useEffect(() => {\n if (isFirstMount.current) {\n isFirstMount.current = false;\n }\n }, []);\n\n // Change index from parent\n useEffect(() => {\n setCurrIndex(defaultIndex);\n }, [defaultIndex]);\n\n return (\n <Styled.Carousel>\n <Styled.CarouselWrapper\n $translate={currIndex * 100}\n $translateDuration={isFirstMount.current ? 0 : 300}\n >\n {items.map((item, index) => (\n <Styled.CarouselItemContainer key={index}>{item}</Styled.CarouselItemContainer>\n ))}\n </Styled.CarouselWrapper>\n\n {items.length > 1 && (\n <Styled.ExtendedFlexView\n $flexDirection=\"row\"\n $alignItems=\"center\"\n $justifyContent=\"center\"\n $position=\"absolute\"\n >\n <IconButton\n renderAs=\"secondary\"\n Icon={CaratLeftIcon}\n onClick={handleCarouselPrev}\n analyticsLabel={memoizedAnalyticsPrev.analyticsLabel}\n analyticsProps={memoizedAnalyticsPrev.analyticsProps}\n disabled={currIndex === 0}\n />\n <Separator width={48} />\n {items.map((_, index) => (\n <Styled.Indicator\n ref={indicatorRefs[index]}\n $isActive={index === currIndex}\n key={index}\n onClick={() => handleCarouselIndicatorClick(index)}\n />\n ))}\n <Separator width={48} />\n <div ref={nextBtnRef}>\n <IconButton\n renderAs=\"secondary\"\n Icon={CaratRightIcon}\n onClick={handleCarouselNext}\n analyticsLabel={memoizedAnalyticsNext.analyticsLabel}\n analyticsProps={memoizedAnalyticsNext.analyticsProps}\n disabled={currIndex === items.length - 1}\n />\n </div>\n </Styled.ExtendedFlexView>\n )}\n </Styled.Carousel>\n );\n};\n\nexport const Carousel = memo(forwardRef(CarouselComponent));\n"],"names":["CarouselComponent","items","defaultIndex","onNext","onPrev","analyticsPrev","analyticsNext","ref","memoizedAnalyticsPrev","useMemo","memoizedAnalyticsNext","nextBtnRef","useRef","isFirstMount","currIndex","setCurrIndex","useState","indicatorRefs","createRef","handleCarouselPrev","useCallback","prev","handleCarouselNext","handleCarouselIndicatorClick","index","useImperativeHandle","useEffect","jsxs","Styled.Carousel","jsx","Styled.CarouselWrapper","item","Styled.CarouselItemContainer","Styled.ExtendedFlexView","IconButton","CaratLeftIcon","Separator","_","Styled.Indicator","CaratRightIcon","Carousel","memo","forwardRef"],"mappings":";;;;;;;AAqBA,MAAMA,IAA6E,CACjF,EAAE,OAAAC,GAAO,cAAAC,IAAe,GAAG,QAAAC,GAAQ,QAAAC,GAAQ,eAAAC,GAAe,eAAAC,EAAc,GACxEC,MACG;AACH,QAAMC,IAAwBC,EAAQ,MAAMJ,GAAe,CAACA,CAAa,CAAC,GACpEK,IAAwBD,EAAQ,MAAMH,GAAe,CAACA,CAAa,CAAC,GAEpEK,IAAaC,EAAuB,IAAI,GACxCC,IAAeD,EAAO,EAAI,GAC1B,CAACE,GAAWC,CAAY,IAAIC,EAASd,CAAY,GAGjDe,IAAgBR,EAAQ,MAAMR,EAAM,IAAI,MAAMiB,GAA2B,GAAG,CAACjB,CAAK,CAAC,GAEnFkB,IAAqBC,EAAY,MAAM;AAClC,IAAAhB,KAAA,QAAAA,KACIW,EAAA,CAAAM,MAAQA,IAAO,CAAC;AAAA,EAAA,GAC5B,CAACjB,CAAM,CAAC,GAELkB,IAAqBF,EAAY,MAAM;AAClC,IAAAjB,KAAA,QAAAA,KACIY,EAAA,CAAAM,MAAQA,IAAO,CAAC;AAAA,EAAA,GAC5B,CAAClB,CAAM,CAAC,GAELoB,IAA+BH,EAAY,CAACI,MAAkB;AAClE,IAAAT,EAAaS,CAAK;AAAA,EACpB,GAAG,CAAE,CAAA;AAEL,SAAAC,EAAoBlB,GAAK,OAAO;AAAA,IAC9B,YAAAI;AAAA,IACA,eAAAM;AAAA,IACA,cAAcH;AAAA,IACd,WAAW,CAACU,MAAkB;AAC5B,MAAAT,EAAaS,CAAK;AAAA,IACpB;AAAA,EACA,EAAA,GAEFE,EAAU,MAAM;AACd,IAAIb,EAAa,YACfA,EAAa,UAAU;AAAA,EAE3B,GAAG,CAAE,CAAA,GAGLa,EAAU,MAAM;AACd,IAAAX,EAAab,CAAY;AAAA,EAAA,GACxB,CAACA,CAAY,CAAC,GAGf,gBAAAyB,EAACC,GAAA,EACC,UAAA;AAAA,IAAA,gBAAAC;AAAA,MAACC;AAAAA,MAAA;AAAA,QACC,YAAYhB,IAAY;AAAA,QACxB,oBAAoBD,EAAa,UAAU,IAAI;AAAA,QAE9C,UAAAZ,EAAM,IAAI,CAAC8B,GAAMP,MACf,gBAAAK,EAAAG,GAAA,EAA0C,UAARD,EAAA,GAAAP,CAAa,CACjD;AAAA,MAAA;AAAA,IACH;AAAA,IAECvB,EAAM,SAAS,KACd,gBAAA0B;AAAA,MAACM;AAAAA,MAAA;AAAA,QACC,gBAAe;AAAA,QACf,aAAY;AAAA,QACZ,iBAAgB;AAAA,QAChB,WAAU;AAAA,QAEV,UAAA;AAAA,UAAA,gBAAAJ;AAAA,YAACK;AAAA,YAAA;AAAA,cACC,UAAS;AAAA,cACT,MAAMC;AAAA,cACN,SAAShB;AAAA,cACT,gBAAgBX,EAAsB;AAAA,cACtC,gBAAgBA,EAAsB;AAAA,cACtC,UAAUM,MAAc;AAAA,YAAA;AAAA,UAC1B;AAAA,UACA,gBAAAe,EAACO,GAAU,EAAA,OAAO,GAAI,CAAA;AAAA,UACrBnC,EAAM,IAAI,CAACoC,GAAGb,MACb,gBAAAK;AAAA,YAACS;AAAAA,YAAA;AAAA,cACC,KAAKrB,EAAcO,CAAK;AAAA,cACxB,WAAWA,MAAUV;AAAA,cAErB,SAAS,MAAMS,EAA6BC,CAAK;AAAA,YAAA;AAAA,YAD5CA;AAAA,UAAA,CAGR;AAAA,UACD,gBAAAK,EAACO,GAAU,EAAA,OAAO,GAAI,CAAA;AAAA,UACtB,gBAAAP,EAAC,OAAI,EAAA,KAAKlB,GACR,UAAA,gBAAAkB;AAAA,YAACK;AAAA,YAAA;AAAA,cACC,UAAS;AAAA,cACT,MAAMK;AAAA,cACN,SAASjB;AAAA,cACT,gBAAgBZ,EAAsB;AAAA,cACtC,gBAAgBA,EAAsB;AAAA,cACtC,UAAUI,MAAcb,EAAM,SAAS;AAAA,YAAA;AAAA,UAAA,GAE3C;AAAA,QAAA;AAAA,MAAA;AAAA,IACF;AAAA,EAEJ,EAAA,CAAA;AAEJ,GAEauC,IAAWC,EAAKC,EAAW1C,CAAiB,CAAC;"}
|