@cuemath/leap 2.8.62-rj-3 → 2.8.62-rj-4
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/carousel/carousel.js.map +1 -1
- package/dist/features/circle-games/game-launcher/hooks/use-game-launcher-journey/use-game-launcher-journey.js +78 -79
- package/dist/features/circle-games/game-launcher/hooks/use-game-launcher-journey/use-game-launcher-journey.js.map +1 -1
- package/dist/features/circle-games/game-launcher/hooks/use-table-launcher-journey/use-table-launcher-journey.js +117 -114
- package/dist/features/circle-games/game-launcher/hooks/use-table-launcher-journey/use-table-launcher-journey.js.map +1 -1
- package/package.json +1 -1
@@ -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 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(() =>
|
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,O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;"}
|
@@ -1,103 +1,102 @@
|
|
1
|
-
import { jsx as t, Fragment as
|
2
|
-
import { useRef as
|
3
|
-
import
|
4
|
-
import { PLATFORM_EVENTS_STUDENT as
|
1
|
+
import { jsx as t, Fragment as L } from "react/jsx-runtime";
|
2
|
+
import { useRef as I, useCallback as p, useMemo as oe, useEffect as le } from "react";
|
3
|
+
import j from "../../../../../assets/line-icons/icons/carat-right.js";
|
4
|
+
import { PLATFORM_EVENTS_STUDENT as z } from "../../../../analytics-events/platform-events-student.js";
|
5
5
|
import { IndicatorType as a } from "../../../../journey/use-journey/constants.js";
|
6
|
-
import { useJourney as
|
7
|
-
import
|
8
|
-
import { useUIContext as
|
9
|
-
import
|
6
|
+
import { useJourney as ce } from "../../../../journey/use-journey/use-journey.js";
|
7
|
+
import ee from "../../../../ui/buttons/icon-button/icon-button.js";
|
8
|
+
import { useUIContext as ae } from "../../../../ui/context/context.js";
|
9
|
+
import O from "../../../../ui/layout/flex-view.js";
|
10
10
|
import d from "../../../../ui/text/text.js";
|
11
11
|
import { CIRCLE_ONBOARDING_ANALYTICS_STEPS as _ } from "../../../enum/circle-onboarding-steps.js";
|
12
|
-
import { useCircleSounds as
|
12
|
+
import { useCircleSounds as de } from "../../../hooks/use-circle-sounds/use-circle-sounds.js";
|
13
13
|
import { SegmentedGameCard as he } from "../../comps/segmented-game-card/segmented-game-card.js";
|
14
|
-
import { GAME_LAUNCHER_ANALYTICS_EVENTS as
|
15
|
-
import { GO_TO_NEXT_SLIDE_AFTER_MS as
|
16
|
-
import { ProjectType as
|
17
|
-
const
|
14
|
+
import { GAME_LAUNCHER_ANALYTICS_EVENTS as te } from "../../game-launcher-analytics-events.js";
|
15
|
+
import { GO_TO_NEXT_SLIDE_AFTER_MS as se, SHOW_LABEL_HIGHLIGHT_AFTER_MS as me, SHOW_NUDGE_AFTER_MS as ge, SLIDE_TO_LESSON_MS as Te } from "./constants.js";
|
16
|
+
import { ProjectType as ue } from "../../../games/web-view/enums/project-type-enum.js";
|
17
|
+
const Ge = ({
|
18
18
|
carouselRefs: n,
|
19
|
-
onSegmentClick:
|
19
|
+
onSegmentClick: S
|
20
20
|
}) => {
|
21
|
-
const o =
|
21
|
+
const o = I(null), r = I(null), l = I(null), C = I([]), { playButtonSound: b } = de(), { nextCoachmark: h, setJourney: R, endJourney: N } = ce(), { onEvent: f } = ae(), P = p(
|
22
22
|
(e) => {
|
23
|
-
|
23
|
+
f(z.ONBOARDING_STEP_VIEWED, {
|
24
24
|
step: e
|
25
25
|
});
|
26
26
|
},
|
27
|
-
[
|
28
|
-
),
|
27
|
+
[f]
|
28
|
+
), y = p(
|
29
29
|
(e) => {
|
30
|
-
|
30
|
+
f(z.ONBOARDING_STEP_COMPLETED, {
|
31
31
|
step: e
|
32
32
|
});
|
33
33
|
},
|
34
|
-
[
|
35
|
-
),
|
36
|
-
(e, c, i,
|
37
|
-
var
|
38
|
-
|
39
|
-
const
|
40
|
-
clearTimeout(
|
34
|
+
[f]
|
35
|
+
), s = p(
|
36
|
+
(e, c, i, m, A = !1) => {
|
37
|
+
var T, u;
|
38
|
+
A || (b(), (u = n.current) == null || u.goToIndex(((T = n.current) == null ? void 0 : T.currentIndex) + 1), h(m, !1, se)), P(e);
|
39
|
+
const g = setTimeout(() => {
|
40
|
+
clearTimeout(g), c.startLabelAnimation(i);
|
41
41
|
}, me);
|
42
|
-
C.current.push(
|
42
|
+
C.current.push(g), h(m, !0, ge);
|
43
43
|
},
|
44
|
-
[n,
|
45
|
-
),
|
44
|
+
[n, h, b, P]
|
45
|
+
), H = p(
|
46
46
|
(e, c) => {
|
47
|
-
|
47
|
+
S(e, ue.PUZZLE), y(_.PUZZLE_ACTIVITY), N(c);
|
48
48
|
},
|
49
|
-
[N,
|
50
|
-
),
|
49
|
+
[N, S, y]
|
50
|
+
), G = p(
|
51
51
|
(e, c, i) => {
|
52
|
-
var Y, v, B, U, V, x, D, M,
|
53
|
-
if (
|
52
|
+
var w, Y, v, B, U, V, x, D, M, W, X, $, J, F, Z, K, q, Q;
|
53
|
+
if (!((w = n == null ? void 0 : n.current) != null && w.nextBtnRef.current) || !((Y = r == null ? void 0 : r.current) != null && Y.segmentedCardWrapperRef.current) || !((v = o == null ? void 0 : o.current) != null && v.labelRef.current) || !((B = r == null ? void 0 : r.current) != null && B.labelRef.current) || !e)
|
54
54
|
return;
|
55
|
-
|
56
|
-
const g = ((D = (x = (V = l.current) == null ? void 0 : V.labelRef) == null ? void 0 : x.current) == null ? void 0 : D.getBoundingClientRect()) || {
|
55
|
+
const m = ((x = (V = (U = l.current) == null ? void 0 : U.labelRef) == null ? void 0 : V.current) == null ? void 0 : x.getBoundingClientRect()) || {
|
57
56
|
height: 0,
|
58
57
|
width: 0
|
59
|
-
},
|
58
|
+
}, A = ((W = (M = (D = o.current) == null ? void 0 : D.labelRef) == null ? void 0 : M.current) == null ? void 0 : W.getBoundingClientRect()) || {
|
60
59
|
height: 0,
|
61
60
|
width: 0
|
62
|
-
},
|
61
|
+
}, g = ((J = ($ = (X = r.current) == null ? void 0 : X.labelRef) == null ? void 0 : $.current) == null ? void 0 : J.getBoundingClientRect()) || {
|
63
62
|
height: 0,
|
64
63
|
width: 0
|
65
|
-
},
|
64
|
+
}, T = ((K = (Z = (F = r.current) == null ? void 0 : F.segmentedCardWrapperRef) == null ? void 0 : Z.current) == null ? void 0 : K.getBoundingClientRect()) || {
|
66
65
|
height: 0,
|
67
66
|
width: 0
|
68
67
|
};
|
69
|
-
let
|
70
|
-
c && l.current && (
|
68
|
+
let u = [];
|
69
|
+
c && l.current && (u = [
|
71
70
|
{
|
72
71
|
originalElementToHighlightRef: l.current.labelRef,
|
73
72
|
isActive: !1,
|
74
73
|
type: a.TOOLTIP,
|
75
|
-
elementToHighlight: /* @__PURE__ */ t(
|
74
|
+
elementToHighlight: /* @__PURE__ */ t(L, {}),
|
76
75
|
indicator: {
|
77
76
|
position: "right",
|
78
77
|
backgroundColor: "BLUE_4",
|
79
78
|
width: 264,
|
80
|
-
tooltipItem: /* @__PURE__ */ t(
|
81
|
-
tooltipXCoOrdinates:
|
82
|
-
tooltipYCoOrdinates:
|
79
|
+
tooltipItem: /* @__PURE__ */ t(O, { children: /* @__PURE__ */ t(d, { $renderAs: "ab2-bold", children: "Get faster & stay ahead in school. Practice 3 new skills everyday." }) }),
|
80
|
+
tooltipXCoOrdinates: m.width + 50,
|
81
|
+
tooltipYCoOrdinates: m.height / 2
|
83
82
|
}
|
84
83
|
},
|
85
84
|
{
|
86
|
-
originalElementToHighlightRef: (
|
85
|
+
originalElementToHighlightRef: (q = n.current) == null ? void 0 : q.nextBtnRef,
|
87
86
|
isActive: !1,
|
88
87
|
type: a.NUDGE,
|
89
88
|
elementToHighlight: /* @__PURE__ */ t(
|
90
|
-
|
89
|
+
ee,
|
91
90
|
{
|
92
91
|
renderAs: "secondary",
|
93
|
-
Icon:
|
94
|
-
onClick: () =>
|
92
|
+
Icon: j,
|
93
|
+
onClick: () => s(
|
95
94
|
_.GAMES_ACTIVITY,
|
96
95
|
o.current,
|
97
96
|
"ORANGE_4",
|
98
97
|
i
|
99
98
|
),
|
100
|
-
analyticsLabel:
|
99
|
+
analyticsLabel: te.JOURNEY_NEXT_ACTIVITY
|
101
100
|
}
|
102
101
|
),
|
103
102
|
indicator: {
|
@@ -108,19 +107,19 @@ const ke = ({
|
|
108
107
|
}
|
109
108
|
}
|
110
109
|
]);
|
111
|
-
const
|
110
|
+
const ne = [
|
112
111
|
{
|
113
112
|
originalElementToHighlightRef: o.current.labelRef,
|
114
113
|
isActive: !1,
|
115
114
|
type: a.TOOLTIP,
|
116
|
-
elementToHighlight: /* @__PURE__ */ t(
|
115
|
+
elementToHighlight: /* @__PURE__ */ t(L, {}),
|
117
116
|
indicator: {
|
118
117
|
position: "right",
|
119
118
|
backgroundColor: "ORANGE_4",
|
120
119
|
width: 264,
|
121
|
-
tooltipItem: /* @__PURE__ */ t(
|
122
|
-
tooltipXCoOrdinates:
|
123
|
-
tooltipYCoOrdinates:
|
120
|
+
tooltipItem: /* @__PURE__ */ t(O, { children: /* @__PURE__ */ t(d, { $renderAs: "ab2-bold", children: "Train to think deeper & plan ahead. Play 3 new games everyday." }) }),
|
121
|
+
tooltipXCoOrdinates: A.width + 50,
|
122
|
+
tooltipYCoOrdinates: A.height / 2
|
124
123
|
}
|
125
124
|
},
|
126
125
|
{
|
@@ -128,17 +127,17 @@ const ke = ({
|
|
128
127
|
isActive: !1,
|
129
128
|
type: a.NUDGE,
|
130
129
|
elementToHighlight: /* @__PURE__ */ t(
|
131
|
-
|
130
|
+
ee,
|
132
131
|
{
|
133
132
|
renderAs: "secondary",
|
134
|
-
Icon:
|
135
|
-
onClick: () =>
|
133
|
+
Icon: j,
|
134
|
+
onClick: () => s(
|
136
135
|
_.PUZZLE_ACTIVITY,
|
137
136
|
r.current,
|
138
137
|
"PURPLE_4",
|
139
138
|
i
|
140
139
|
),
|
141
|
-
analyticsLabel:
|
140
|
+
analyticsLabel: te.JOURNEY_NEXT_ACTIVITY
|
142
141
|
}
|
143
142
|
),
|
144
143
|
indicator: {
|
@@ -148,19 +147,19 @@ const ke = ({
|
|
148
147
|
nudgePointerY: 0
|
149
148
|
}
|
150
149
|
}
|
151
|
-
],
|
150
|
+
], ie = [
|
152
151
|
{
|
153
152
|
originalElementToHighlightRef: r.current.labelRef,
|
154
153
|
isActive: !1,
|
155
154
|
type: a.TOOLTIP,
|
156
|
-
elementToHighlight: /* @__PURE__ */ t(
|
155
|
+
elementToHighlight: /* @__PURE__ */ t(L, {}),
|
157
156
|
indicator: {
|
158
157
|
position: "right",
|
159
158
|
backgroundColor: "PURPLE_4",
|
160
159
|
width: 264,
|
161
|
-
tooltipItem: /* @__PURE__ */ t(
|
162
|
-
tooltipXCoOrdinates:
|
163
|
-
tooltipYCoOrdinates:
|
160
|
+
tooltipItem: /* @__PURE__ */ t(O, { children: /* @__PURE__ */ t(d, { $renderAs: "ab2-bold", children: "Think in new ways & stay sharp. Solve 3 new puzzles everyday." }) }),
|
161
|
+
tooltipXCoOrdinates: g.width + 50,
|
162
|
+
tooltipYCoOrdinates: g.height / 2
|
164
163
|
}
|
165
164
|
},
|
166
165
|
{
|
@@ -179,39 +178,39 @@ const ke = ({
|
|
179
178
|
name: "",
|
180
179
|
// We dont want to show the name of the puzzle in onboarding
|
181
180
|
isCompleted: E.solved,
|
182
|
-
onPress: () =>
|
181
|
+
onPress: () => H(E, i)
|
183
182
|
}))
|
184
183
|
}
|
185
184
|
),
|
186
185
|
indicator: {
|
187
186
|
nudge: "click",
|
188
187
|
content: /* @__PURE__ */ t(d, { $renderAs: "ab1", $color: "WHITE", children: "Click to solve a puzzle" }),
|
189
|
-
nudgePointerX:
|
190
|
-
nudgePointerY:
|
188
|
+
nudgePointerX: T.width * 0.6,
|
189
|
+
nudgePointerY: T.height * 0.4
|
191
190
|
}
|
192
191
|
}
|
193
192
|
];
|
194
|
-
|
195
|
-
const
|
196
|
-
clearTimeout(
|
193
|
+
R(i, [...u, ...ne, ...ie]), (Q = n.current) == null || Q.goToIndex(0);
|
194
|
+
const k = setTimeout(() => {
|
195
|
+
clearTimeout(k), h(i);
|
197
196
|
}, Te);
|
198
|
-
C.current.push(
|
197
|
+
C.current.push(k), c && l.current ? s(_.SKILL_ACTIVITY, l.current, "BLUE_4", i, !0) : s(_.GAMES_ACTIVITY, o.current, "ORANGE_4", i, !0);
|
199
198
|
},
|
200
|
-
[n,
|
201
|
-
),
|
199
|
+
[n, H, s, h, R]
|
200
|
+
), re = oe(
|
202
201
|
() => ({
|
203
202
|
gameRefs: o,
|
204
203
|
puzzleRefs: r,
|
205
204
|
lessonRefs: l,
|
206
|
-
startJourney:
|
205
|
+
startJourney: G
|
207
206
|
}),
|
208
|
-
[
|
207
|
+
[G]
|
209
208
|
);
|
210
|
-
return
|
211
|
-
C.current.forEach((e) => clearTimeout(e)), C.current = []
|
212
|
-
}, [n]),
|
209
|
+
return le(() => () => {
|
210
|
+
C.current.forEach((e) => clearTimeout(e)), C.current = [];
|
211
|
+
}, [n]), re;
|
213
212
|
};
|
214
213
|
export {
|
215
|
-
|
214
|
+
Ge as useGameLauncherJourney
|
216
215
|
};
|
217
216
|
//# sourceMappingURL=use-game-launcher-journey.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"use-game-launcher-journey.js","sources":["../../../../../../src/features/circle-games/game-launcher/hooks/use-game-launcher-journey/use-game-launcher-journey.tsx"],"sourcesContent":["import type { TJourneyId } from '../../../../journey/journey-id/journey-id-types';\nimport type { ICoachmarkProps } from '../../../../journey/use-journey/journey-context-types';\nimport type { IArrowTooltipProps } from '../../../../ui/arrow-tooltip/arrow-tooltip-types';\nimport type { INudgeProps } from '../../../../ui/nudge/nudge-types';\nimport type { TColorNames } from '../../../../ui/types';\nimport type { ISegmentedGameCardRefs } from '../../comps/segmented-game-card/segmented-game-card-types';\nimport type {\n IProject,\n Puzzle,\n} from '../../dal/use-get-circle-home-details-dal/use-get-circle-home-dal-types';\nimport type { IUseGameLauncherJourneyProps } from './use-game-launcher-journey-types';\n\nimport { useCallback, useEffect, useMemo, useRef } from 'react';\n\nimport CaratRightIcon from '../../../../../assets/line-icons/icons/carat-right';\nimport { PLATFORM_EVENTS_STUDENT as AnalyticsLabel } from '../../../../analytics-events/platform-events-student';\nimport { IndicatorType } from '../../../../journey/use-journey/constants';\nimport { useJourney } from '../../../../journey/use-journey/use-journey';\nimport IconButton from '../../../../ui/buttons/icon-button/icon-button';\nimport { useUIContext } from '../../../../ui/context/context';\nimport FlexView from '../../../../ui/layout/flex-view';\nimport Text from '../../../../ui/text/text';\nimport { CIRCLE_ONBOARDING_ANALYTICS_STEPS as ActionEvent } from '../../../enum/circle-onboarding-steps';\nimport { ProjectType } from '../../../games/web-view/enums';\nimport { useCircleSounds } from '../../../hooks/use-circle-sounds/use-circle-sounds';\nimport { SegmentedGameCard } from '../../comps/segmented-game-card/segmented-game-card';\nimport { GAME_LAUNCHER_ANALYTICS_EVENTS } from '../../game-launcher-analytics-events';\nimport {\n GO_TO_NEXT_SLIDE_AFTER_MS,\n SHOW_LABEL_HIGHLIGHT_AFTER_MS,\n SHOW_NUDGE_AFTER_MS,\n SLIDE_TO_LESSON_MS,\n} from './constants';\n\nexport const useGameLauncherJourney = ({\n carouselRefs,\n onSegmentClick,\n}: IUseGameLauncherJourneyProps) => {\n const gameRefs = useRef<ISegmentedGameCardRefs>(null);\n const puzzleRefs = useRef<ISegmentedGameCardRefs>(null);\n const lessonRefs = useRef<ISegmentedGameCardRefs>(null);\n const timerRefs = useRef<ReturnType<typeof setTimeout>[]>([]);\n\n const isJourneyInProgress = useRef(false);\n\n const { playButtonSound } = useCircleSounds();\n const { nextCoachmark, setJourney, endJourney } = useJourney();\n const { onEvent: trackAnalytics } = useUIContext();\n\n const trackEventViewed = useCallback(\n (step: ActionEvent) => {\n trackAnalytics(AnalyticsLabel.ONBOARDING_STEP_VIEWED, {\n step,\n });\n },\n [trackAnalytics],\n );\n const trackEventCompleted = useCallback(\n (step: ActionEvent) => {\n trackAnalytics(AnalyticsLabel.ONBOARDING_STEP_COMPLETED, {\n step,\n });\n },\n [trackAnalytics],\n );\n\n const goToNextCard = useCallback(\n (\n analyticsLabelViewed: ActionEvent,\n refOfNextSlide: ISegmentedGameCardRefs,\n color: TColorNames,\n journeyId: TJourneyId,\n isFirstSlide: boolean = false,\n ) => {\n if (!isFirstSlide) {\n playButtonSound();\n carouselRefs.current?.goToIndex(carouselRefs.current?.currentIndex + 1);\n nextCoachmark(journeyId, false, GO_TO_NEXT_SLIDE_AFTER_MS);\n }\n\n trackEventViewed(analyticsLabelViewed);\n\n const animateLabelTimer = setTimeout(() => {\n clearTimeout(animateLabelTimer);\n refOfNextSlide.startLabelAnimation(color);\n }, SHOW_LABEL_HIGHLIGHT_AFTER_MS);\n\n timerRefs.current.push(animateLabelTimer); // Store to cleanup later\n\n nextCoachmark(journeyId, true, SHOW_NUDGE_AFTER_MS);\n },\n [carouselRefs, nextCoachmark, playButtonSound, trackEventViewed],\n );\n\n const handleEndJourney = useCallback(\n (puzzlesData: Puzzle, journeyId: TJourneyId) => {\n onSegmentClick(puzzlesData, ProjectType.PUZZLE);\n trackEventCompleted(ActionEvent.PUZZLE_ACTIVITY);\n endJourney(journeyId);\n },\n [endJourney, onSegmentClick, trackEventCompleted],\n );\n\n const startJourney = useCallback(\n (puzzlesData: IProject<Puzzle>, isLessonAvailable: boolean, journeyId: TJourneyId) => {\n if (isJourneyInProgress.current) {\n return;\n }\n\n // If element refs are not available return, this is just for type safety\n if (\n !carouselRefs?.current?.nextBtnRef.current ||\n !puzzleRefs?.current?.segmentedCardWrapperRef.current ||\n !gameRefs?.current?.labelRef.current ||\n !puzzleRefs?.current?.labelRef.current ||\n !puzzlesData\n ) {\n return;\n }\n\n isJourneyInProgress.current = true;\n const lessonLabelDims = lessonRefs.current?.labelRef?.current?.getBoundingClientRect() || {\n height: 0,\n width: 0,\n };\n const gameLabelDims = gameRefs.current?.labelRef?.current?.getBoundingClientRect() || {\n height: 0,\n width: 0,\n };\n const puzzleLabelDims = puzzleRefs.current?.labelRef?.current?.getBoundingClientRect() || {\n height: 0,\n width: 0,\n };\n\n const launcherDims =\n puzzleRefs.current?.segmentedCardWrapperRef?.current?.getBoundingClientRect() || {\n height: 0,\n width: 0,\n };\n\n let lessonSteps: ICoachmarkProps[] = [];\n\n if (isLessonAvailable && lessonRefs.current) {\n lessonSteps = [\n {\n originalElementToHighlightRef: lessonRefs.current.labelRef,\n isActive: false,\n type: IndicatorType.TOOLTIP,\n elementToHighlight: <></>,\n indicator: {\n position: 'right',\n backgroundColor: 'BLUE_4',\n width: 264,\n tooltipItem: (\n <FlexView>\n <Text $renderAs=\"ab2-bold\">\n Get faster & stay ahead in school. Practice 3 new skills everyday.\n </Text>\n </FlexView>\n ),\n tooltipXCoOrdinates: lessonLabelDims.width + 50,\n tooltipYCoOrdinates: lessonLabelDims.height / 2,\n } as IArrowTooltipProps,\n },\n {\n originalElementToHighlightRef: carouselRefs.current?.nextBtnRef,\n isActive: false,\n type: IndicatorType.NUDGE,\n elementToHighlight: (\n <IconButton\n renderAs=\"secondary\"\n Icon={CaratRightIcon}\n onClick={() =>\n goToNextCard(\n ActionEvent.GAMES_ACTIVITY,\n gameRefs.current as ISegmentedGameCardRefs,\n 'ORANGE_4',\n journeyId,\n )\n }\n analyticsLabel={GAME_LAUNCHER_ANALYTICS_EVENTS.JOURNEY_NEXT_ACTIVITY}\n />\n ),\n indicator: {\n nudge: 'click',\n content: (\n <Text $renderAs=\"ab1\" $color=\"WHITE\">\n Click to proceed\n </Text>\n ),\n nudgePointerX: 0,\n nudgePointerY: 0,\n } as INudgeProps,\n },\n ];\n }\n\n const gameSteps: ICoachmarkProps[] = [\n {\n originalElementToHighlightRef: gameRefs.current.labelRef,\n isActive: false,\n type: IndicatorType.TOOLTIP,\n elementToHighlight: <></>,\n indicator: {\n position: 'right',\n backgroundColor: 'ORANGE_4',\n width: 264,\n tooltipItem: (\n <FlexView>\n <Text $renderAs=\"ab2-bold\">\n Train to think deeper & plan ahead. Play 3 new games everyday.\n </Text>\n </FlexView>\n ),\n tooltipXCoOrdinates: gameLabelDims.width + 50,\n tooltipYCoOrdinates: gameLabelDims.height / 2,\n } as IArrowTooltipProps,\n },\n {\n originalElementToHighlightRef: carouselRefs.current.nextBtnRef,\n isActive: false,\n type: IndicatorType.NUDGE,\n elementToHighlight: (\n <IconButton\n renderAs=\"secondary\"\n Icon={CaratRightIcon}\n onClick={() =>\n goToNextCard(\n ActionEvent.PUZZLE_ACTIVITY,\n puzzleRefs.current as ISegmentedGameCardRefs,\n 'PURPLE_4',\n journeyId,\n )\n }\n analyticsLabel={GAME_LAUNCHER_ANALYTICS_EVENTS.JOURNEY_NEXT_ACTIVITY}\n />\n ),\n indicator: {\n nudge: 'click',\n content: (\n <Text $renderAs=\"ab1\" $color=\"WHITE\">\n Click to proceed\n </Text>\n ),\n nudgePointerX: 0,\n nudgePointerY: 0,\n } as INudgeProps,\n },\n ];\n\n const puzzleSteps: ICoachmarkProps[] = [\n {\n originalElementToHighlightRef: puzzleRefs.current.labelRef,\n isActive: false,\n type: IndicatorType.TOOLTIP,\n elementToHighlight: <></>,\n indicator: {\n position: 'right',\n backgroundColor: 'PURPLE_4',\n width: 264,\n tooltipItem: (\n <FlexView>\n <Text $renderAs=\"ab2-bold\">\n Think in new ways & stay sharp. Solve 3 new puzzles everyday.\n </Text>\n </FlexView>\n ),\n tooltipXCoOrdinates: puzzleLabelDims.width + 50,\n tooltipYCoOrdinates: puzzleLabelDims.height / 2,\n } as IArrowTooltipProps,\n },\n {\n originalElementToHighlightRef: puzzleRefs.current.segmentedCardWrapperRef,\n isActive: false,\n type: IndicatorType.NUDGE,\n elementToHighlight: (\n <SegmentedGameCard\n label={''} // This is intentionally left blank to avoid showing the label\n value={puzzlesData.data.filter(puzzle => puzzle.solved).length}\n maxValue={puzzlesData.data.length}\n initialValue={puzzlesData.initialProgressValue}\n data={puzzlesData.data.map(puzzle => ({\n card: puzzle.cardLottie,\n name: '', // We dont want to show the name of the puzzle in onboarding\n isCompleted: puzzle.solved,\n onPress: () => handleEndJourney(puzzle, journeyId),\n }))}\n />\n ),\n indicator: {\n nudge: 'click',\n content: (\n <Text $renderAs=\"ab1\" $color=\"WHITE\">\n Click to solve a puzzle\n </Text>\n ),\n nudgePointerX: launcherDims.width * 0.6,\n nudgePointerY: launcherDims.height * 0.4,\n } as INudgeProps,\n },\n ];\n\n setJourney(journeyId, [...lessonSteps, ...gameSteps, ...puzzleSteps]);\n\n carouselRefs.current?.goToIndex(0); // Always start from 0th Index no matter what the current index is\n\n const delayBeforeStart = setTimeout(() => {\n clearTimeout(delayBeforeStart);\n nextCoachmark(journeyId);\n }, SLIDE_TO_LESSON_MS);\n\n timerRefs.current.push(delayBeforeStart); // Store to cleanup later\n\n if (isLessonAvailable && lessonRefs.current) {\n goToNextCard(ActionEvent.SKILL_ACTIVITY, lessonRefs.current, 'BLUE_4', journeyId, true);\n } else {\n goToNextCard(ActionEvent.GAMES_ACTIVITY, gameRefs.current, 'ORANGE_4', journeyId, true);\n }\n },\n [carouselRefs, handleEndJourney, goToNextCard, nextCoachmark, setJourney],\n );\n\n const data = useMemo(\n () => ({\n gameRefs,\n puzzleRefs,\n lessonRefs,\n startJourney,\n }),\n [startJourney],\n );\n\n // Cleanup on unmount\n useEffect(() => {\n return () => {\n timerRefs.current.forEach(timer => clearTimeout(timer));\n timerRefs.current = [];\n isJourneyInProgress.current = false;\n };\n }, [carouselRefs]);\n\n return data;\n};\n"],"names":["useGameLauncherJourney","carouselRefs","onSegmentClick","gameRefs","useRef","puzzleRefs","lessonRefs","timerRefs","isJourneyInProgress","playButtonSound","useCircleSounds","nextCoachmark","setJourney","endJourney","useJourney","trackAnalytics","useUIContext","trackEventViewed","useCallback","step","AnalyticsLabel","trackEventCompleted","goToNextCard","analyticsLabelViewed","refOfNextSlide","color","journeyId","isFirstSlide","_b","_a","GO_TO_NEXT_SLIDE_AFTER_MS","animateLabelTimer","SHOW_LABEL_HIGHLIGHT_AFTER_MS","SHOW_NUDGE_AFTER_MS","handleEndJourney","puzzlesData","ProjectType","ActionEvent","startJourney","isLessonAvailable","_c","_d","lessonLabelDims","_g","_f","_e","gameLabelDims","_j","_i","_h","puzzleLabelDims","_m","_l","_k","launcherDims","_p","_o","_n","lessonSteps","IndicatorType","jsx","Fragment","FlexView","Text","_q","IconButton","CaratRightIcon","GAME_LAUNCHER_ANALYTICS_EVENTS","gameSteps","puzzleSteps","SegmentedGameCard","puzzle","_r","delayBeforeStart","SLIDE_TO_LESSON_MS","data","useMemo","useEffect","timer"],"mappings":";;;;;;;;;;;;;;;;AAkCO,MAAMA,KAAyB,CAAC;AAAA,EACrC,cAAAC;AAAA,EACA,gBAAAC;AACF,MAAoC;AAC5B,QAAAC,IAAWC,EAA+B,IAAI,GAC9CC,IAAaD,EAA+B,IAAI,GAChDE,IAAaF,EAA+B,IAAI,GAChDG,IAAYH,EAAwC,CAAA,CAAE,GAEtDI,IAAsBJ,EAAO,EAAK,GAElC,EAAE,iBA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AACT;"}
|
1
|
+
{"version":3,"file":"use-game-launcher-journey.js","sources":["../../../../../../src/features/circle-games/game-launcher/hooks/use-game-launcher-journey/use-game-launcher-journey.tsx"],"sourcesContent":["import type { TJourneyId } from '../../../../journey/journey-id/journey-id-types';\nimport type { ICoachmarkProps } from '../../../../journey/use-journey/journey-context-types';\nimport type { IArrowTooltipProps } from '../../../../ui/arrow-tooltip/arrow-tooltip-types';\nimport type { INudgeProps } from '../../../../ui/nudge/nudge-types';\nimport type { TColorNames } from '../../../../ui/types';\nimport type { ISegmentedGameCardRefs } from '../../comps/segmented-game-card/segmented-game-card-types';\nimport type {\n IProject,\n Puzzle,\n} from '../../dal/use-get-circle-home-details-dal/use-get-circle-home-dal-types';\nimport type { IUseGameLauncherJourneyProps } from './use-game-launcher-journey-types';\n\nimport { useCallback, useEffect, useMemo, useRef } from 'react';\n\nimport CaratRightIcon from '../../../../../assets/line-icons/icons/carat-right';\nimport { PLATFORM_EVENTS_STUDENT as AnalyticsLabel } from '../../../../analytics-events/platform-events-student';\nimport { IndicatorType } from '../../../../journey/use-journey/constants';\nimport { useJourney } from '../../../../journey/use-journey/use-journey';\nimport IconButton from '../../../../ui/buttons/icon-button/icon-button';\nimport { useUIContext } from '../../../../ui/context/context';\nimport FlexView from '../../../../ui/layout/flex-view';\nimport Text from '../../../../ui/text/text';\nimport { CIRCLE_ONBOARDING_ANALYTICS_STEPS as ActionEvent } from '../../../enum/circle-onboarding-steps';\nimport { ProjectType } from '../../../games/web-view/enums';\nimport { useCircleSounds } from '../../../hooks/use-circle-sounds/use-circle-sounds';\nimport { SegmentedGameCard } from '../../comps/segmented-game-card/segmented-game-card';\nimport { GAME_LAUNCHER_ANALYTICS_EVENTS } from '../../game-launcher-analytics-events';\nimport {\n GO_TO_NEXT_SLIDE_AFTER_MS,\n SHOW_LABEL_HIGHLIGHT_AFTER_MS,\n SHOW_NUDGE_AFTER_MS,\n SLIDE_TO_LESSON_MS,\n} from './constants';\n\nexport const useGameLauncherJourney = ({\n carouselRefs,\n onSegmentClick,\n}: IUseGameLauncherJourneyProps) => {\n const gameRefs = useRef<ISegmentedGameCardRefs>(null);\n const puzzleRefs = useRef<ISegmentedGameCardRefs>(null);\n const lessonRefs = useRef<ISegmentedGameCardRefs>(null);\n const timerRefs = useRef<ReturnType<typeof setTimeout>[]>([]);\n\n const { playButtonSound } = useCircleSounds();\n const { nextCoachmark, setJourney, endJourney } = useJourney();\n const { onEvent: trackAnalytics } = useUIContext();\n\n const trackEventViewed = useCallback(\n (step: ActionEvent) => {\n trackAnalytics(AnalyticsLabel.ONBOARDING_STEP_VIEWED, {\n step,\n });\n },\n [trackAnalytics],\n );\n const trackEventCompleted = useCallback(\n (step: ActionEvent) => {\n trackAnalytics(AnalyticsLabel.ONBOARDING_STEP_COMPLETED, {\n step,\n });\n },\n [trackAnalytics],\n );\n\n const goToNextCard = useCallback(\n (\n analyticsLabelViewed: ActionEvent,\n refOfNextSlide: ISegmentedGameCardRefs,\n color: TColorNames,\n journeyId: TJourneyId,\n isFirstSlide: boolean = false,\n ) => {\n if (!isFirstSlide) {\n playButtonSound();\n carouselRefs.current?.goToIndex(carouselRefs.current?.currentIndex + 1);\n nextCoachmark(journeyId, false, GO_TO_NEXT_SLIDE_AFTER_MS);\n }\n\n trackEventViewed(analyticsLabelViewed);\n\n const animateLabelTimer = setTimeout(() => {\n clearTimeout(animateLabelTimer);\n refOfNextSlide.startLabelAnimation(color);\n }, SHOW_LABEL_HIGHLIGHT_AFTER_MS);\n\n timerRefs.current.push(animateLabelTimer); // Store to cleanup later\n\n nextCoachmark(journeyId, true, SHOW_NUDGE_AFTER_MS);\n },\n [carouselRefs, nextCoachmark, playButtonSound, trackEventViewed],\n );\n\n const handleEndJourney = useCallback(\n (puzzlesData: Puzzle, journeyId: TJourneyId) => {\n onSegmentClick(puzzlesData, ProjectType.PUZZLE);\n trackEventCompleted(ActionEvent.PUZZLE_ACTIVITY);\n endJourney(journeyId);\n },\n [endJourney, onSegmentClick, trackEventCompleted],\n );\n\n const startJourney = useCallback(\n (puzzlesData: IProject<Puzzle>, isLessonAvailable: boolean, journeyId: TJourneyId) => {\n // If element refs are not available return, this is just for type safety\n if (\n !carouselRefs?.current?.nextBtnRef.current ||\n !puzzleRefs?.current?.segmentedCardWrapperRef.current ||\n !gameRefs?.current?.labelRef.current ||\n !puzzleRefs?.current?.labelRef.current ||\n !puzzlesData\n ) {\n return;\n }\n\n const lessonLabelDims = lessonRefs.current?.labelRef?.current?.getBoundingClientRect() || {\n height: 0,\n width: 0,\n };\n const gameLabelDims = gameRefs.current?.labelRef?.current?.getBoundingClientRect() || {\n height: 0,\n width: 0,\n };\n const puzzleLabelDims = puzzleRefs.current?.labelRef?.current?.getBoundingClientRect() || {\n height: 0,\n width: 0,\n };\n\n const launcherDims =\n puzzleRefs.current?.segmentedCardWrapperRef?.current?.getBoundingClientRect() || {\n height: 0,\n width: 0,\n };\n\n let lessonSteps: ICoachmarkProps[] = [];\n\n if (isLessonAvailable && lessonRefs.current) {\n lessonSteps = [\n {\n originalElementToHighlightRef: lessonRefs.current.labelRef,\n isActive: false,\n type: IndicatorType.TOOLTIP,\n elementToHighlight: <></>,\n indicator: {\n position: 'right',\n backgroundColor: 'BLUE_4',\n width: 264,\n tooltipItem: (\n <FlexView>\n <Text $renderAs=\"ab2-bold\">\n Get faster & stay ahead in school. Practice 3 new skills everyday.\n </Text>\n </FlexView>\n ),\n tooltipXCoOrdinates: lessonLabelDims.width + 50,\n tooltipYCoOrdinates: lessonLabelDims.height / 2,\n } as IArrowTooltipProps,\n },\n {\n originalElementToHighlightRef: carouselRefs.current?.nextBtnRef,\n isActive: false,\n type: IndicatorType.NUDGE,\n elementToHighlight: (\n <IconButton\n renderAs=\"secondary\"\n Icon={CaratRightIcon}\n onClick={() =>\n goToNextCard(\n ActionEvent.GAMES_ACTIVITY,\n gameRefs.current as ISegmentedGameCardRefs,\n 'ORANGE_4',\n journeyId,\n )\n }\n analyticsLabel={GAME_LAUNCHER_ANALYTICS_EVENTS.JOURNEY_NEXT_ACTIVITY}\n />\n ),\n indicator: {\n nudge: 'click',\n content: (\n <Text $renderAs=\"ab1\" $color=\"WHITE\">\n Click to proceed\n </Text>\n ),\n nudgePointerX: 0,\n nudgePointerY: 0,\n } as INudgeProps,\n },\n ];\n }\n\n const gameSteps: ICoachmarkProps[] = [\n {\n originalElementToHighlightRef: gameRefs.current.labelRef,\n isActive: false,\n type: IndicatorType.TOOLTIP,\n elementToHighlight: <></>,\n indicator: {\n position: 'right',\n backgroundColor: 'ORANGE_4',\n width: 264,\n tooltipItem: (\n <FlexView>\n <Text $renderAs=\"ab2-bold\">\n Train to think deeper & plan ahead. Play 3 new games everyday.\n </Text>\n </FlexView>\n ),\n tooltipXCoOrdinates: gameLabelDims.width + 50,\n tooltipYCoOrdinates: gameLabelDims.height / 2,\n } as IArrowTooltipProps,\n },\n {\n originalElementToHighlightRef: carouselRefs.current.nextBtnRef,\n isActive: false,\n type: IndicatorType.NUDGE,\n elementToHighlight: (\n <IconButton\n renderAs=\"secondary\"\n Icon={CaratRightIcon}\n onClick={() =>\n goToNextCard(\n ActionEvent.PUZZLE_ACTIVITY,\n puzzleRefs.current as ISegmentedGameCardRefs,\n 'PURPLE_4',\n journeyId,\n )\n }\n analyticsLabel={GAME_LAUNCHER_ANALYTICS_EVENTS.JOURNEY_NEXT_ACTIVITY}\n />\n ),\n indicator: {\n nudge: 'click',\n content: (\n <Text $renderAs=\"ab1\" $color=\"WHITE\">\n Click to proceed\n </Text>\n ),\n nudgePointerX: 0,\n nudgePointerY: 0,\n } as INudgeProps,\n },\n ];\n\n const puzzleSteps: ICoachmarkProps[] = [\n {\n originalElementToHighlightRef: puzzleRefs.current.labelRef,\n isActive: false,\n type: IndicatorType.TOOLTIP,\n elementToHighlight: <></>,\n indicator: {\n position: 'right',\n backgroundColor: 'PURPLE_4',\n width: 264,\n tooltipItem: (\n <FlexView>\n <Text $renderAs=\"ab2-bold\">\n Think in new ways & stay sharp. Solve 3 new puzzles everyday.\n </Text>\n </FlexView>\n ),\n tooltipXCoOrdinates: puzzleLabelDims.width + 50,\n tooltipYCoOrdinates: puzzleLabelDims.height / 2,\n } as IArrowTooltipProps,\n },\n {\n originalElementToHighlightRef: puzzleRefs.current.segmentedCardWrapperRef,\n isActive: false,\n type: IndicatorType.NUDGE,\n elementToHighlight: (\n <SegmentedGameCard\n label={''} // This is intentionally left blank to avoid showing the label\n value={puzzlesData.data.filter(puzzle => puzzle.solved).length}\n maxValue={puzzlesData.data.length}\n initialValue={puzzlesData.initialProgressValue}\n data={puzzlesData.data.map(puzzle => ({\n card: puzzle.cardLottie,\n name: '', // We dont want to show the name of the puzzle in onboarding\n isCompleted: puzzle.solved,\n onPress: () => handleEndJourney(puzzle, journeyId),\n }))}\n />\n ),\n indicator: {\n nudge: 'click',\n content: (\n <Text $renderAs=\"ab1\" $color=\"WHITE\">\n Click to solve a puzzle\n </Text>\n ),\n nudgePointerX: launcherDims.width * 0.6,\n nudgePointerY: launcherDims.height * 0.4,\n } as INudgeProps,\n },\n ];\n\n setJourney(journeyId, [...lessonSteps, ...gameSteps, ...puzzleSteps]);\n\n carouselRefs.current?.goToIndex(0); // Always start from 0th Index no matter what the current index is\n\n const delayBeforeStart = setTimeout(() => {\n clearTimeout(delayBeforeStart);\n nextCoachmark(journeyId);\n }, SLIDE_TO_LESSON_MS);\n\n timerRefs.current.push(delayBeforeStart); // Store to cleanup later\n\n if (isLessonAvailable && lessonRefs.current) {\n goToNextCard(ActionEvent.SKILL_ACTIVITY, lessonRefs.current, 'BLUE_4', journeyId, true);\n } else {\n goToNextCard(ActionEvent.GAMES_ACTIVITY, gameRefs.current, 'ORANGE_4', journeyId, true);\n }\n },\n [carouselRefs, handleEndJourney, goToNextCard, nextCoachmark, setJourney],\n );\n\n const data = useMemo(\n () => ({\n gameRefs,\n puzzleRefs,\n lessonRefs,\n startJourney,\n }),\n [startJourney],\n );\n\n // Cleanup on unmount\n useEffect(() => {\n return () => {\n timerRefs.current.forEach(timer => clearTimeout(timer));\n timerRefs.current = [];\n };\n }, [carouselRefs]);\n\n return data;\n};\n"],"names":["useGameLauncherJourney","carouselRefs","onSegmentClick","gameRefs","useRef","puzzleRefs","lessonRefs","timerRefs","playButtonSound","useCircleSounds","nextCoachmark","setJourney","endJourney","useJourney","trackAnalytics","useUIContext","trackEventViewed","useCallback","step","AnalyticsLabel","trackEventCompleted","goToNextCard","analyticsLabelViewed","refOfNextSlide","color","journeyId","isFirstSlide","_b","_a","GO_TO_NEXT_SLIDE_AFTER_MS","animateLabelTimer","SHOW_LABEL_HIGHLIGHT_AFTER_MS","SHOW_NUDGE_AFTER_MS","handleEndJourney","puzzlesData","ProjectType","ActionEvent","startJourney","isLessonAvailable","_c","_d","lessonLabelDims","_g","_f","_e","gameLabelDims","_j","_i","_h","puzzleLabelDims","_m","_l","_k","launcherDims","_p","_o","_n","lessonSteps","IndicatorType","jsx","Fragment","FlexView","Text","_q","IconButton","CaratRightIcon","GAME_LAUNCHER_ANALYTICS_EVENTS","gameSteps","puzzleSteps","SegmentedGameCard","puzzle","_r","delayBeforeStart","SLIDE_TO_LESSON_MS","data","useMemo","useEffect","timer"],"mappings":";;;;;;;;;;;;;;;;AAkCO,MAAMA,KAAyB,CAAC;AAAA,EACrC,cAAAC;AAAA,EACA,gBAAAC;AACF,MAAoC;AAC5B,QAAAC,IAAWC,EAA+B,IAAI,GAC9CC,IAAaD,EAA+B,IAAI,GAChDE,IAAaF,EAA+B,IAAI,GAChDG,IAAYH,EAAwC,CAAA,CAAE,GAEtD,EAAE,iBAAAI,MAAoBC,MACtB,EAAE,eAAAC,GAAe,YAAAC,GAAY,YAAAC,MAAeC,GAAW,GACvD,EAAE,SAASC,EAAe,IAAIC,GAAa,GAE3CC,IAAmBC;AAAA,IACvB,CAACC,MAAsB;AACrB,MAAAJ,EAAeK,EAAe,wBAAwB;AAAA,QACpD,MAAAD;AAAA,MAAA,CACD;AAAA,IACH;AAAA,IACA,CAACJ,CAAc;AAAA,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,EAAa,QAAQ;AAAA,YACpC,eAAeA,EAAa,SAAS;AAAA,UACvC;AAAA,QACF;AAAA,MAAA;AAGS,MAAA1C,EAAAc,GAAW,CAAC,GAAGgC,GAAa,GAAGU,IAAW,GAAGC,EAAW,CAAC,IAEvDG,IAAAtE,EAAA,YAAA,QAAAsE,EAAS,UAAU;AAE1B,YAAAC,IAAmB,WAAW,MAAM;AACxC,qBAAaA,CAAgB,GAC7B9D,EAAce,CAAS;AAAA,SACtBgD,EAAkB;AAEX,MAAAlE,EAAA,QAAQ,KAAKiE,CAAgB,GAEnClC,KAAqBhC,EAAW,UAClCe,EAAae,EAAY,gBAAgB9B,EAAW,SAAS,UAAUmB,GAAW,EAAI,IAEtFJ,EAAae,EAAY,gBAAgBjC,EAAS,SAAS,YAAYsB,GAAW,EAAI;AAAA,IAE1F;AAAA,IACA,CAACxB,GAAcgC,GAAkBZ,GAAcX,GAAeC,CAAU;AAAA,EAAA,GAGpE+D,KAAOC;AAAA,IACX,OAAO;AAAA,MACL,UAAAxE;AAAA,MACA,YAAAE;AAAA,MACA,YAAAC;AAAA,MACA,cAAA+B;AAAA,IAAA;AAAA,IAEF,CAACA,CAAY;AAAA,EAAA;AAIf,SAAAuC,GAAU,MACD,MAAM;AACX,IAAArE,EAAU,QAAQ,QAAQ,CAASsE,MAAA,aAAaA,CAAK,CAAC,GACtDtE,EAAU,UAAU;EAAC,GAEtB,CAACN,CAAY,CAAC,GAEVyE;AACT;"}
|
@@ -1,116 +1,119 @@
|
|
1
|
-
import { jsx as r, Fragment as
|
2
|
-
import { useRef as
|
3
|
-
import
|
4
|
-
import { PLATFORM_EVENTS_STUDENT as
|
5
|
-
import { JOURNEY_ID_STUDENT as
|
6
|
-
import { IndicatorType as
|
7
|
-
import { useJourney as
|
8
|
-
import
|
9
|
-
import { useUIContext as
|
10
|
-
import
|
1
|
+
import { jsx as r, Fragment as b } from "react/jsx-runtime";
|
2
|
+
import { useRef as O, useCallback as A, useEffect as J } from "react";
|
3
|
+
import V from "../../../../../assets/line-icons/icons/carat-right.js";
|
4
|
+
import { PLATFORM_EVENTS_STUDENT as U } from "../../../../analytics-events/platform-events-student.js";
|
5
|
+
import { JOURNEY_ID_STUDENT as X } from "../../../../journey/journey-id/journey-id-student.js";
|
6
|
+
import { IndicatorType as d } from "../../../../journey/use-journey/constants.js";
|
7
|
+
import { useJourney as K } from "../../../../journey/use-journey/use-journey.js";
|
8
|
+
import j from "../../../../ui/buttons/icon-button/icon-button.js";
|
9
|
+
import { useUIContext as Z } from "../../../../ui/context/context.js";
|
10
|
+
import R from "../../../../ui/layout/flex-view.js";
|
11
11
|
import m from "../../../../ui/text/text.js";
|
12
|
-
import { CIRCLE_ONBOARDING_ANALYTICS_STEPS as
|
13
|
-
import { useCircleSounds as
|
14
|
-
import { TablesCard as
|
15
|
-
import { GAME_LAUNCHER_ANALYTICS_EVENTS as
|
16
|
-
import { SHOW_PICK_A_LEVEL_TOOLTIP_AFTER_MS as
|
17
|
-
import { Indicator as
|
18
|
-
const
|
12
|
+
import { CIRCLE_ONBOARDING_ANALYTICS_STEPS as G } from "../../../enum/circle-onboarding-steps.js";
|
13
|
+
import { useCircleSounds as q } from "../../../hooks/use-circle-sounds/use-circle-sounds.js";
|
14
|
+
import { TablesCard as v } from "../../comps/tables-card/tables-card.js";
|
15
|
+
import { GAME_LAUNCHER_ANALYTICS_EVENTS as z } from "../../game-launcher-analytics-events.js";
|
16
|
+
import { SHOW_PICK_A_LEVEL_TOOLTIP_AFTER_MS as Q, SHOW_PICK_A_LEVEL_NUDGE_AFTER_MS as ee, START_ANIMATING_CLONED_ELEM as M, TABLE_CARD_INDEX as $, GO_TO_TABLE_LAUNCHER_DURATION_MS as te, SHOW_CLICK_TABLE_NUDGE_AFTER_MS as re, PUZZLE_CARD_INDEX as ne, SHOW_INITIAL_COACHMARK_AFTER_MS as x, LESSON_CARD_INDEX as oe, SHOW_INITIAL_TOOLTIP_AFTER_MS as ie } from "./constants.js";
|
17
|
+
import { Indicator as le } from "./use-table-launcher-journey-styled.js";
|
18
|
+
const be = ({
|
19
19
|
carouselRefs: a,
|
20
|
-
onTableSegmentClick:
|
20
|
+
onTableSegmentClick: N
|
21
21
|
}) => {
|
22
|
-
const
|
23
|
-
(
|
24
|
-
var
|
25
|
-
|
26
|
-
step:
|
27
|
-
}), (
|
22
|
+
const t = X.CIRCLE_TABLES_INTRO_JOURNEY, e = O(null), _ = O(null), T = O([]), { playButtonSound: S } = q(), { nextCoachmark: l, setJourney: C, addCoachmark: u, endJourney: P } = K(), { onEvent: f } = Z(), L = A(
|
23
|
+
(n) => {
|
24
|
+
var c, o;
|
25
|
+
n && N(n), f(U.ONBOARDING_STEP_COMPLETED, {
|
26
|
+
step: G.TABLES
|
27
|
+
}), (c = e == null ? void 0 : e.current) == null || c.setLabelVisiblity(!0), (o = e == null ? void 0 : e.current) == null || o.stopLabelAnimation(), P(t);
|
28
28
|
},
|
29
|
-
[
|
30
|
-
),
|
31
|
-
(
|
32
|
-
var g;
|
33
|
-
|
34
|
-
|
35
|
-
|
29
|
+
[P, t, N, f]
|
30
|
+
), H = A(
|
31
|
+
(n, c) => {
|
32
|
+
var g, E, h;
|
33
|
+
if (!((g = e.current) != null && g.segmentedCardWrapperRef.current) || !((E = e.current) != null && E.labelRef.current))
|
34
|
+
return;
|
35
|
+
const o = e.current.labelRef.current.getBoundingClientRect(), i = (h = e.current) == null ? void 0 : h.segmentedCardWrapperRef.current.getBoundingClientRect();
|
36
|
+
u(t, {
|
37
|
+
originalElementToHighlightRef: e.current.segmentedCardWrapperRef,
|
36
38
|
isActive: !1,
|
37
|
-
type:
|
39
|
+
type: d.TOOLTIP,
|
38
40
|
elementToHighlight: /* @__PURE__ */ r(
|
39
|
-
|
41
|
+
v,
|
40
42
|
{
|
41
|
-
ref:
|
42
|
-
defaultTable:
|
43
|
-
label:
|
44
|
-
data:
|
45
|
-
onPress:
|
46
|
-
onGoBackFromTableLevel:
|
43
|
+
ref: _,
|
44
|
+
defaultTable: c,
|
45
|
+
label: n.label,
|
46
|
+
data: n.data,
|
47
|
+
onPress: L,
|
48
|
+
onGoBackFromTableLevel: L
|
47
49
|
}
|
48
50
|
),
|
49
51
|
indicator: {
|
50
52
|
position: "left",
|
51
53
|
backgroundColor: "YELLOW_4",
|
52
54
|
width: 236,
|
53
|
-
tooltipItem: /* @__PURE__ */ r(
|
55
|
+
tooltipItem: /* @__PURE__ */ r(R, { children: /* @__PURE__ */ r(m, { $renderAs: "ab2-bold", children: "Each table has 3 levels—clear them and earn 3 stars!" }) }),
|
54
56
|
tooltipXCoOrdinates: 0,
|
55
|
-
tooltipYCoOrdinates:
|
57
|
+
tooltipYCoOrdinates: o.height * 0.35
|
56
58
|
}
|
57
|
-
}),
|
58
|
-
originalElementToHighlightRef:
|
59
|
+
}), u(t, {
|
60
|
+
originalElementToHighlightRef: e.current.segmentedCardWrapperRef,
|
59
61
|
isActive: !1,
|
60
|
-
type:
|
62
|
+
type: d.NUDGE,
|
61
63
|
indicator: {
|
62
64
|
nudge: "click",
|
63
65
|
content: /* @__PURE__ */ r(m, { $renderAs: "ab1", $color: "WHITE", children: "Pick a level" }),
|
64
|
-
nudgePointerX:
|
65
|
-
nudgePointerY:
|
66
|
+
nudgePointerX: i.width / 2 + 50,
|
67
|
+
nudgePointerY: i.height * 0.4
|
66
68
|
},
|
67
|
-
elementToHighlight: /* @__PURE__ */ r(
|
68
|
-
}),
|
69
|
-
const
|
70
|
-
var
|
71
|
-
clearTimeout(
|
72
|
-
},
|
73
|
-
T.current.push(
|
69
|
+
elementToHighlight: /* @__PURE__ */ r(b, {})
|
70
|
+
}), l(t, !1, Q), l(t, !0, ee);
|
71
|
+
const s = setTimeout(() => {
|
72
|
+
var p;
|
73
|
+
clearTimeout(s), (p = _.current) == null || p.startLabelAnimation("YELLOW_4");
|
74
|
+
}, M);
|
75
|
+
T.current.push(s);
|
74
76
|
},
|
75
|
-
[
|
76
|
-
),
|
77
|
-
|
78
|
-
|
77
|
+
[u, L, t, l]
|
78
|
+
), I = A(() => {
|
79
|
+
var o;
|
80
|
+
S(), (o = a.current) == null || o.goToIndex($), l(t, !1, te), f(U.ONBOARDING_STEP_VIEWED, {
|
81
|
+
step: G.TABLES
|
79
82
|
});
|
80
|
-
const
|
81
|
-
var
|
82
|
-
clearTimeout(
|
83
|
-
},
|
84
|
-
T.current.push(
|
85
|
-
const
|
86
|
-
var
|
87
|
-
clearTimeout(
|
88
|
-
},
|
89
|
-
T.current.push(
|
90
|
-
}, [a,
|
91
|
-
(
|
92
|
-
var
|
93
|
-
const
|
94
|
-
if (!((
|
83
|
+
const n = setTimeout(() => {
|
84
|
+
var i;
|
85
|
+
clearTimeout(n), (i = e.current) == null || i.setLabelVisiblity(!1), l(t, !0);
|
86
|
+
}, re);
|
87
|
+
T.current.push(n);
|
88
|
+
const c = setTimeout(() => {
|
89
|
+
var i;
|
90
|
+
clearTimeout(c), (i = _.current) == null || i.startLabelAnimation("YELLOW_4");
|
91
|
+
}, M);
|
92
|
+
T.current.push(c);
|
93
|
+
}, [a, t, l, S, f]), w = A(
|
94
|
+
(n, c = !1) => {
|
95
|
+
var h, p, y, D, W, Y, k, B;
|
96
|
+
const o = (h = a.current) == null ? void 0 : h.indicatorRefs, i = (p = a.current) == null ? void 0 : p.nextBtnRef, s = o == null ? void 0 : o[$];
|
97
|
+
if (!((y = e.current) != null && y.segmentedCardWrapperRef.current) || !((D = e.current) != null && D.labelRef.current) || !o || !(i != null && i.current) || !s || !s.current)
|
95
98
|
return;
|
96
|
-
const g =
|
97
|
-
|
99
|
+
const g = e.current.labelRef.current.getBoundingClientRect(), E = (W = e.current) == null ? void 0 : W.segmentedCardWrapperRef.current.getBoundingClientRect();
|
100
|
+
c ? (C(t, [
|
98
101
|
{
|
99
|
-
originalElementToHighlightRef:
|
102
|
+
originalElementToHighlightRef: s,
|
100
103
|
isActive: !1,
|
101
|
-
type:
|
102
|
-
elementToHighlight: /* @__PURE__ */ r(
|
104
|
+
type: d.TOOLTIP,
|
105
|
+
elementToHighlight: /* @__PURE__ */ r(le, { $isActive: !1 }),
|
103
106
|
indicator: {
|
104
107
|
position: "bottom",
|
105
108
|
backgroundColor: "YELLOW_4",
|
106
109
|
width: 52,
|
107
110
|
tooltipItem: /* @__PURE__ */ r(
|
108
|
-
|
111
|
+
R,
|
109
112
|
{
|
110
113
|
$position: "absolute",
|
111
114
|
$flexDirection: "row",
|
112
115
|
style: { top: 6, left: 8, cursor: "pointer" },
|
113
|
-
onClick:
|
116
|
+
onClick: I,
|
114
117
|
children: /* @__PURE__ */ r(m, { $renderAs: "ab2-bold", children: "NEW" })
|
115
118
|
}
|
116
119
|
),
|
@@ -119,21 +122,21 @@ const fe = ({
|
|
119
122
|
}
|
120
123
|
},
|
121
124
|
{
|
122
|
-
originalElementToHighlightRef:
|
125
|
+
originalElementToHighlightRef: s,
|
123
126
|
isActive: !1,
|
124
|
-
type:
|
127
|
+
type: d.NUDGE,
|
125
128
|
indicator: {
|
126
129
|
nudge: "click",
|
127
130
|
content: "",
|
128
131
|
nudgePointerY: 20
|
129
132
|
},
|
130
|
-
elementToHighlight: /* @__PURE__ */ r(
|
133
|
+
elementToHighlight: /* @__PURE__ */ r(b, {})
|
131
134
|
}
|
132
|
-
]), a.current.goToIndex(
|
135
|
+
]), (B = a.current) == null || B.goToIndex(oe), l(t, !1, x), l(t, !0, ie)) : (C(t, [
|
133
136
|
{
|
134
|
-
originalElementToHighlightRef: a.current.nextBtnRef,
|
137
|
+
originalElementToHighlightRef: (Y = a.current) == null ? void 0 : Y.nextBtnRef,
|
135
138
|
isActive: !1,
|
136
|
-
type:
|
139
|
+
type: d.NUDGE,
|
137
140
|
indicator: {
|
138
141
|
nudge: "click",
|
139
142
|
content: /* @__PURE__ */ r(m, { $renderAs: "ab1", $color: "WHITE", children: "Click to proceed" }),
|
@@ -141,32 +144,32 @@ const fe = ({
|
|
141
144
|
nudgePointerY: 0
|
142
145
|
},
|
143
146
|
elementToHighlight: /* @__PURE__ */ r(
|
144
|
-
|
147
|
+
j,
|
145
148
|
{
|
146
149
|
renderAs: "secondary",
|
147
|
-
Icon:
|
148
|
-
onClick:
|
149
|
-
analyticsLabel:
|
150
|
+
Icon: V,
|
151
|
+
onClick: I,
|
152
|
+
analyticsLabel: z.JOURNEY_NEXT_ACTIVITY
|
150
153
|
}
|
151
154
|
)
|
152
155
|
}
|
153
|
-
]), a.current.goToIndex(
|
154
|
-
originalElementToHighlightRef:
|
156
|
+
]), (k = a.current) == null || k.goToIndex(ne), l(t, !1, x)), u(t, {
|
157
|
+
originalElementToHighlightRef: e.current.labelRef,
|
155
158
|
isActive: !1,
|
156
|
-
type:
|
157
|
-
elementToHighlight: /* @__PURE__ */ r(
|
159
|
+
type: d.TOOLTIP,
|
160
|
+
elementToHighlight: /* @__PURE__ */ r(b, {}),
|
158
161
|
indicator: {
|
159
162
|
position: "right",
|
160
163
|
backgroundColor: "YELLOW_4",
|
161
164
|
width: 264,
|
162
|
-
tooltipItem: /* @__PURE__ */ r(
|
165
|
+
tooltipItem: /* @__PURE__ */ r(R, { children: /* @__PURE__ */ r(m, { $renderAs: "ab2-bold", children: "Get faster at multiplication! Practice everyday and become a Tables champ." }) }),
|
163
166
|
tooltipXCoOrdinates: g.width + 50,
|
164
167
|
tooltipYCoOrdinates: g.height / 2
|
165
168
|
}
|
166
|
-
}),
|
167
|
-
originalElementToHighlightRef:
|
169
|
+
}), u(t, {
|
170
|
+
originalElementToHighlightRef: e.current.segmentedCardWrapperRef,
|
168
171
|
isActive: !1,
|
169
|
-
type:
|
172
|
+
type: d.NUDGE,
|
170
173
|
indicator: {
|
171
174
|
nudge: "click",
|
172
175
|
content: /* @__PURE__ */ r(m, { $renderAs: "ab1", $color: "WHITE", children: "Pick a table to start" }),
|
@@ -174,36 +177,36 @@ const fe = ({
|
|
174
177
|
nudgePointerY: E.height / 2
|
175
178
|
},
|
176
179
|
elementToHighlight: /* @__PURE__ */ r(
|
177
|
-
|
180
|
+
v,
|
178
181
|
{
|
179
|
-
ref:
|
180
|
-
label:
|
181
|
-
data:
|
182
|
+
ref: _,
|
183
|
+
label: n.label,
|
184
|
+
data: n.data,
|
182
185
|
onPress: () => {
|
183
186
|
},
|
184
|
-
onPressTableSegment: (
|
187
|
+
onPressTableSegment: (F) => H(n, F)
|
185
188
|
}
|
186
189
|
)
|
187
190
|
});
|
188
191
|
},
|
189
192
|
[
|
190
|
-
|
193
|
+
u,
|
191
194
|
a,
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
195
|
+
I,
|
196
|
+
H,
|
197
|
+
t,
|
198
|
+
l,
|
199
|
+
C
|
197
200
|
]
|
198
201
|
);
|
199
|
-
return
|
200
|
-
T.current.forEach((
|
201
|
-
}, [
|
202
|
-
tableRef:
|
203
|
-
startJourney:
|
202
|
+
return J(() => () => {
|
203
|
+
T.current.forEach((n) => clearTimeout(n)), T.current = [];
|
204
|
+
}, [t]), {
|
205
|
+
tableRef: e,
|
206
|
+
startJourney: w
|
204
207
|
};
|
205
208
|
};
|
206
209
|
export {
|
207
|
-
|
210
|
+
be as useTableLauncherJourney
|
208
211
|
};
|
209
212
|
//# sourceMappingURL=use-table-launcher-journey.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"use-table-launcher-journey.js","sources":["../../../../../../src/features/circle-games/game-launcher/hooks/use-table-launcher-journey/use-table-launcher-journey.tsx"],"sourcesContent":["/* eslint-disable react-native/no-inline-styles */\nimport type { IArrowTooltipProps } from '../../../../ui/arrow-tooltip/arrow-tooltip-types';\nimport type { INudgeProps } from '../../../../ui/nudge/nudge-types';\nimport type { ITableCardRef, ITableDetails } from '../../comps/tables-card/tables-card-types';\nimport type {\n ITableInfo,\n ITables,\n} from '../../dal/use-get-circle-home-details-dal/use-get-circle-home-dal-types';\nimport type { IUseTableJourneyProps } from './use-table-launcher-journey-types';\n\nimport { useCallback, useEffect, useRef } from 'react';\n\nimport CaratRightIcon from '../../../../../assets/line-icons/icons/carat-right';\nimport { PLATFORM_EVENTS_STUDENT } from '../../../../analytics-events/platform-events-student';\nimport { JOURNEY_ID_STUDENT } from '../../../../journey/journey-id/journey-id-student';\nimport { IndicatorType } from '../../../../journey/use-journey/constants';\nimport { useJourney } from '../../../../journey/use-journey/use-journey';\nimport IconButton from '../../../../ui/buttons/icon-button/icon-button';\nimport { useUIContext } from '../../../../ui/context/context';\nimport FlexView from '../../../../ui/layout/flex-view';\nimport Text from '../../../../ui/text/text';\nimport { CIRCLE_ONBOARDING_ANALYTICS_STEPS as Action } from '../../../enum/circle-onboarding-steps';\nimport { useCircleSounds } from '../../../hooks/use-circle-sounds/use-circle-sounds';\nimport { TablesCard } from '../../comps/tables-card/tables-card';\nimport { GAME_LAUNCHER_ANALYTICS_EVENTS } from '../../game-launcher-analytics-events';\nimport {\n LESSON_CARD_INDEX,\n PUZZLE_CARD_INDEX,\n SHOW_PICK_A_LEVEL_NUDGE_AFTER_MS,\n SHOW_PICK_A_LEVEL_TOOLTIP_AFTER_MS,\n TABLE_CARD_INDEX,\n} from './constants';\nimport {\n GO_TO_TABLE_LAUNCHER_DURATION_MS,\n SHOW_CLICK_TABLE_NUDGE_AFTER_MS,\n SHOW_INITIAL_COACHMARK_AFTER_MS,\n SHOW_INITIAL_TOOLTIP_AFTER_MS,\n START_ANIMATING_CLONED_ELEM,\n} from './constants';\nimport * as S from './use-table-launcher-journey-styled';\n\nexport const useTableLauncherJourney = ({\n carouselRefs,\n onTableSegmentClick,\n}: IUseTableJourneyProps) => {\n const journeyId = JOURNEY_ID_STUDENT.CIRCLE_TABLES_INTRO_JOURNEY;\n const originalTableRef = useRef<ITableCardRef>(null);\n const highlightedTableRef = useRef<ITableCardRef>(null);\n\n const timerRefs = useRef<ReturnType<typeof setTimeout>[]>([]);\n\n const { playButtonSound } = useCircleSounds();\n const { nextCoachmark, setJourney, addCoachmark, endJourney } = useJourney();\n const { onEvent: trackAnalytics } = useUIContext();\n\n const handleEndJourney = useCallback(\n (tableDetails?: ITableDetails) => {\n // Only when User clicked on play\n if (tableDetails) {\n onTableSegmentClick(tableDetails);\n }\n trackAnalytics(PLATFORM_EVENTS_STUDENT.ONBOARDING_STEP_COMPLETED, {\n step: Action.TABLES,\n });\n\n // Reset original table card ref label\n originalTableRef?.current?.setLabelVisiblity(true);\n originalTableRef?.current?.stopLabelAnimation();\n endJourney(journeyId);\n },\n [endJourney, journeyId, onTableSegmentClick, trackAnalytics],\n );\n\n const handleTableSegmentClick = useCallback(\n (launcherData: ITables, tableData: ITableInfo) => {\n const segmentedCardDims = originalTableRef.current.labelRef.current.getBoundingClientRect();\n const tableCardDims =\n originalTableRef.current?.segmentedCardWrapperRef.current.getBoundingClientRect();\n\n addCoachmark(journeyId, {\n originalElementToHighlightRef: originalTableRef.current.segmentedCardWrapperRef,\n isActive: false,\n type: IndicatorType.TOOLTIP,\n elementToHighlight: (\n <TablesCard\n ref={highlightedTableRef}\n defaultTable={tableData}\n label={launcherData.label}\n data={launcherData.data}\n onPress={handleEndJourney}\n onGoBackFromTableLevel={handleEndJourney}\n />\n ),\n indicator: {\n position: 'left',\n backgroundColor: 'YELLOW_4',\n width: 236,\n tooltipItem: (\n <FlexView>\n <Text $renderAs=\"ab2-bold\">Each table has 3 levels—clear them and earn 3 stars!</Text>\n </FlexView>\n ),\n tooltipXCoOrdinates: 0,\n tooltipYCoOrdinates: segmentedCardDims.height * 0.35,\n } as IArrowTooltipProps,\n });\n\n addCoachmark(journeyId, {\n originalElementToHighlightRef: originalTableRef.current.segmentedCardWrapperRef,\n isActive: false,\n type: IndicatorType.NUDGE,\n indicator: {\n nudge: 'click',\n content: (\n <Text $renderAs=\"ab1\" $color=\"WHITE\">\n Pick a level\n </Text>\n ),\n nudgePointerX: tableCardDims.width / 2 + 50,\n nudgePointerY: tableCardDims.height * 0.4,\n } as INudgeProps,\n elementToHighlight: <></>,\n });\n\n nextCoachmark(journeyId, false, SHOW_PICK_A_LEVEL_TOOLTIP_AFTER_MS); // Show coachmark => Each table has 3... and Hide the previous two\n nextCoachmark(journeyId, true, SHOW_PICK_A_LEVEL_NUDGE_AFTER_MS); // Show nudge => Pick a level\n\n const startAnimationOnLabelAgain = setTimeout(() => {\n clearTimeout(startAnimationOnLabelAgain);\n highlightedTableRef.current?.startLabelAnimation('YELLOW_4');\n }, START_ANIMATING_CLONED_ELEM);\n\n timerRefs.current.push(startAnimationOnLabelAgain);\n },\n [addCoachmark, handleEndJourney, journeyId, nextCoachmark],\n );\n\n const goToTableLauncher = useCallback(() => {\n playButtonSound();\n carouselRefs.current.goToIndex(TABLE_CARD_INDEX);\n nextCoachmark(journeyId, false, GO_TO_TABLE_LAUNCHER_DURATION_MS);\n\n trackAnalytics(PLATFORM_EVENTS_STUDENT.ONBOARDING_STEP_VIEWED, {\n step: Action.TABLES,\n });\n\n const showNudge = setTimeout(() => {\n clearTimeout(showNudge);\n originalTableRef.current?.setLabelVisiblity(false);\n nextCoachmark(journeyId, true);\n }, SHOW_CLICK_TABLE_NUDGE_AFTER_MS);\n\n timerRefs.current.push(showNudge);\n\n const animateLabel = setTimeout(() => {\n clearTimeout(animateLabel);\n highlightedTableRef.current?.startLabelAnimation('YELLOW_4');\n }, START_ANIMATING_CLONED_ELEM);\n\n timerRefs.current.push(animateLabel);\n }, [carouselRefs, journeyId, nextCoachmark, playButtonSound, trackAnalytics]);\n\n const startJourney = useCallback(\n (tablesData: ITables, isTutorialOnboardingDone: boolean = false) => {\n const paginationList = carouselRefs.current.indicatorRefs;\n const carouselNextBtnRef = carouselRefs.current.nextBtnRef;\n const tablePaginationRef = paginationList?.[TABLE_CARD_INDEX];\n\n if (\n !originalTableRef.current?.segmentedCardWrapperRef.current ||\n !originalTableRef.current?.labelRef.current ||\n !paginationList ||\n !carouselNextBtnRef?.current ||\n !tablePaginationRef ||\n !tablePaginationRef.current\n ) {\n return;\n }\n\n const labelDims = originalTableRef.current.labelRef.current.getBoundingClientRect();\n const tableCardDims =\n originalTableRef.current?.segmentedCardWrapperRef.current.getBoundingClientRect();\n\n // TAKE THE USER TO THE TABLE CARD\n if (!isTutorialOnboardingDone) {\n setJourney(journeyId, [\n {\n originalElementToHighlightRef: carouselRefs.current.nextBtnRef,\n isActive: false,\n type: IndicatorType.NUDGE,\n indicator: {\n nudge: 'click',\n content: (\n <Text $renderAs=\"ab1\" $color=\"WHITE\">\n Click to proceed\n </Text>\n ),\n nudgePointerX: 0,\n nudgePointerY: 0,\n } as INudgeProps,\n elementToHighlight: (\n <IconButton\n renderAs=\"secondary\"\n Icon={CaratRightIcon}\n onClick={goToTableLauncher}\n analyticsLabel={GAME_LAUNCHER_ANALYTICS_EVENTS.JOURNEY_NEXT_ACTIVITY}\n />\n ),\n },\n ]);\n carouselRefs.current.goToIndex(PUZZLE_CARD_INDEX);\n nextCoachmark(journeyId, false, SHOW_INITIAL_COACHMARK_AFTER_MS); // Show nudge => Click to proceed\n } else {\n setJourney(journeyId, [\n {\n originalElementToHighlightRef: tablePaginationRef as React.RefObject<HTMLDivElement>,\n isActive: false,\n type: IndicatorType.TOOLTIP,\n elementToHighlight: <S.Indicator $isActive={false} />,\n indicator: {\n position: 'bottom',\n backgroundColor: 'YELLOW_4',\n width: 52,\n tooltipItem: (\n <FlexView\n $position=\"absolute\"\n $flexDirection=\"row\"\n style={{ top: 6, left: 8, cursor: 'pointer' }}\n onClick={goToTableLauncher}\n >\n <Text $renderAs=\"ab2-bold\">NEW</Text>\n </FlexView>\n ),\n tooltipYCoOrdinates: 14, // Need some offset in Y direction from top\n } as IArrowTooltipProps,\n },\n {\n originalElementToHighlightRef: tablePaginationRef as React.RefObject<HTMLDivElement>,\n isActive: false,\n type: IndicatorType.NUDGE,\n indicator: {\n nudge: 'click',\n content: '',\n nudgePointerY: 20,\n } as INudgeProps,\n elementToHighlight: <></>,\n },\n ]);\n carouselRefs.current.goToIndex(LESSON_CARD_INDEX);\n nextCoachmark(journeyId, false, SHOW_INITIAL_COACHMARK_AFTER_MS); // Show Coachmark => NEW\n nextCoachmark(journeyId, true, SHOW_INITIAL_TOOLTIP_AFTER_MS); // Show Nudge over Coachmark\n }\n\n // SHOW THE USER SELECT A TABLE\n addCoachmark(journeyId, {\n originalElementToHighlightRef: originalTableRef.current.labelRef,\n isActive: false,\n type: IndicatorType.TOOLTIP,\n elementToHighlight: <></>,\n indicator: {\n position: 'right',\n backgroundColor: 'YELLOW_4',\n width: 264,\n tooltipItem: (\n <FlexView>\n <Text $renderAs=\"ab2-bold\">\n Get faster at multiplication! Practice everyday and become a Tables champ.\n </Text>\n </FlexView>\n ),\n tooltipXCoOrdinates: labelDims.width + 50,\n tooltipYCoOrdinates: labelDims.height / 2,\n } as IArrowTooltipProps,\n });\n\n addCoachmark(journeyId, {\n originalElementToHighlightRef: originalTableRef.current.segmentedCardWrapperRef,\n isActive: false,\n type: IndicatorType.NUDGE,\n indicator: {\n nudge: 'click',\n content: (\n <Text $renderAs=\"ab1\" $color=\"WHITE\">\n {'Pick a table to start'}\n </Text>\n ),\n nudgePointerX: tableCardDims.width / 2 + 50,\n nudgePointerY: tableCardDims.height / 2,\n } as INudgeProps,\n elementToHighlight: (\n <TablesCard\n ref={highlightedTableRef}\n label={tablesData.label}\n data={tablesData.data}\n onPress={() => {}}\n onPressTableSegment={tableInfo => handleTableSegmentClick(tablesData, tableInfo)}\n />\n ),\n });\n },\n [\n addCoachmark,\n carouselRefs,\n goToTableLauncher,\n handleTableSegmentClick,\n journeyId,\n nextCoachmark,\n setJourney,\n ],\n );\n\n // Cleanup on unmount\n useEffect(() => {\n return () => {\n timerRefs.current.forEach(timer => clearTimeout(timer));\n timerRefs.current = [];\n };\n }, [journeyId]);\n\n return {\n tableRef: originalTableRef,\n startJourney,\n };\n};\n"],"names":["useTableLauncherJourney","carouselRefs","onTableSegmentClick","journeyId","JOURNEY_ID_STUDENT","originalTableRef","useRef","highlightedTableRef","timerRefs","playButtonSound","useCircleSounds","nextCoachmark","setJourney","addCoachmark","endJourney","useJourney","trackAnalytics","useUIContext","handleEndJourney","useCallback","tableDetails","PLATFORM_EVENTS_STUDENT","Action","_a","_b","handleTableSegmentClick","launcherData","tableData","segmentedCardDims","tableCardDims","IndicatorType","jsx","TablesCard","FlexView","Text","Fragment","SHOW_PICK_A_LEVEL_TOOLTIP_AFTER_MS","SHOW_PICK_A_LEVEL_NUDGE_AFTER_MS","startAnimationOnLabelAgain","START_ANIMATING_CLONED_ELEM","goToTableLauncher","TABLE_CARD_INDEX","GO_TO_TABLE_LAUNCHER_DURATION_MS","showNudge","SHOW_CLICK_TABLE_NUDGE_AFTER_MS","animateLabel","startJourney","tablesData","isTutorialOnboardingDone","paginationList","carouselNextBtnRef","tablePaginationRef","labelDims","_c","S.Indicator","LESSON_CARD_INDEX","SHOW_INITIAL_COACHMARK_AFTER_MS","SHOW_INITIAL_TOOLTIP_AFTER_MS","IconButton","CaratRightIcon","GAME_LAUNCHER_ANALYTICS_EVENTS","PUZZLE_CARD_INDEX","tableInfo","useEffect","timer"],"mappings":";;;;;;;;;;;;;;;;;AAyCO,MAAMA,KAA0B,CAAC;AAAA,EACtC,cAAAC;AAAA,EACA,qBAAAC;AACF,MAA6B;AAC3B,QAAMC,IAAYC,EAAmB,6BAC/BC,IAAmBC,EAAsB,IAAI,GAC7CC,IAAsBD,EAAsB,IAAI,GAEhDE,IAAYF,EAAwC,CAAA,CAAE,GAEtD,EAAE,iBAAAG,MAAoBC,KACtB,EAAE,eAAAC,GAAe,YAAAC,GAAY,cAAAC,GAAc,YAAAC,EAAA,IAAeC,KAC1D,EAAE,SAASC,EAAe,IAAIC,EAAa,GAE3CC,IAAmBC;AAAA,IACvB,CAACC,MAAiC;;AAEhC,MAAIA,KACFlB,EAAoBkB,CAAY,GAElCJ,EAAeK,EAAwB,2BAA2B;AAAA,QAChE,MAAMC,EAAO;AAAA,MAAA,CACd,IAGiBC,IAAAlB,KAAA,gBAAAA,EAAA,YAAA,QAAAkB,EAAS,kBAAkB,MAC7CC,IAAAnB,KAAA,gBAAAA,EAAkB,YAAlB,QAAAmB,EAA2B,sBAC3BV,EAAWX,CAA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,YAChB,qBAAqB,CAAAe,MAAarC,EAAwBsB,GAAYe,CAAS;AAAA,UAAA;AAAA,QACjF;AAAA,MAAA,CAEH;AAAA,IACH;AAAA,IACA;AAAA,MACEjD;AAAA,MACAZ;AAAA,MACAuC;AAAA,MACAf;AAAA,MACAtB;AAAA,MACAQ;AAAA,MACAC;AAAA,IACF;AAAA,EAAA;AAIF,SAAAmD,EAAU,MACD,MAAM;AACX,IAAAvD,EAAU,QAAQ,QAAQ,CAASwD,MAAA,aAAaA,CAAK,CAAC,GACtDxD,EAAU,UAAU;EAAC,GAEtB,CAACL,CAAS,CAAC,GAEP;AAAA,IACL,UAAUE;AAAA,IACV,cAAAyC;AAAA,EAAA;AAEJ;"}
|
1
|
+
{"version":3,"file":"use-table-launcher-journey.js","sources":["../../../../../../src/features/circle-games/game-launcher/hooks/use-table-launcher-journey/use-table-launcher-journey.tsx"],"sourcesContent":["/* eslint-disable react-native/no-inline-styles */\nimport type { IArrowTooltipProps } from '../../../../ui/arrow-tooltip/arrow-tooltip-types';\nimport type { INudgeProps } from '../../../../ui/nudge/nudge-types';\nimport type { ITableCardRef, ITableDetails } from '../../comps/tables-card/tables-card-types';\nimport type {\n ITableInfo,\n ITables,\n} from '../../dal/use-get-circle-home-details-dal/use-get-circle-home-dal-types';\nimport type { IUseTableJourneyProps } from './use-table-launcher-journey-types';\n\nimport { useCallback, useEffect, useRef } from 'react';\n\nimport CaratRightIcon from '../../../../../assets/line-icons/icons/carat-right';\nimport { PLATFORM_EVENTS_STUDENT } from '../../../../analytics-events/platform-events-student';\nimport { JOURNEY_ID_STUDENT } from '../../../../journey/journey-id/journey-id-student';\nimport { IndicatorType } from '../../../../journey/use-journey/constants';\nimport { useJourney } from '../../../../journey/use-journey/use-journey';\nimport IconButton from '../../../../ui/buttons/icon-button/icon-button';\nimport { useUIContext } from '../../../../ui/context/context';\nimport FlexView from '../../../../ui/layout/flex-view';\nimport Text from '../../../../ui/text/text';\nimport { CIRCLE_ONBOARDING_ANALYTICS_STEPS as Action } from '../../../enum/circle-onboarding-steps';\nimport { useCircleSounds } from '../../../hooks/use-circle-sounds/use-circle-sounds';\nimport { TablesCard } from '../../comps/tables-card/tables-card';\nimport { GAME_LAUNCHER_ANALYTICS_EVENTS } from '../../game-launcher-analytics-events';\nimport {\n LESSON_CARD_INDEX,\n PUZZLE_CARD_INDEX,\n SHOW_PICK_A_LEVEL_NUDGE_AFTER_MS,\n SHOW_PICK_A_LEVEL_TOOLTIP_AFTER_MS,\n TABLE_CARD_INDEX,\n} from './constants';\nimport {\n GO_TO_TABLE_LAUNCHER_DURATION_MS,\n SHOW_CLICK_TABLE_NUDGE_AFTER_MS,\n SHOW_INITIAL_COACHMARK_AFTER_MS,\n SHOW_INITIAL_TOOLTIP_AFTER_MS,\n START_ANIMATING_CLONED_ELEM,\n} from './constants';\nimport * as S from './use-table-launcher-journey-styled';\n\nexport const useTableLauncherJourney = ({\n carouselRefs,\n onTableSegmentClick,\n}: IUseTableJourneyProps) => {\n const journeyId = JOURNEY_ID_STUDENT.CIRCLE_TABLES_INTRO_JOURNEY;\n const originalTableRef = useRef<ITableCardRef>(null);\n const highlightedTableRef = useRef<ITableCardRef>(null);\n\n const timerRefs = useRef<ReturnType<typeof setTimeout>[]>([]);\n\n const { playButtonSound } = useCircleSounds();\n const { nextCoachmark, setJourney, addCoachmark, endJourney } = useJourney();\n const { onEvent: trackAnalytics } = useUIContext();\n\n const handleEndJourney = useCallback(\n (tableDetails?: ITableDetails) => {\n // Only when User clicked on play\n if (tableDetails) {\n onTableSegmentClick(tableDetails);\n }\n trackAnalytics(PLATFORM_EVENTS_STUDENT.ONBOARDING_STEP_COMPLETED, {\n step: Action.TABLES,\n });\n\n // Reset original table card ref label\n originalTableRef?.current?.setLabelVisiblity(true);\n originalTableRef?.current?.stopLabelAnimation();\n endJourney(journeyId);\n },\n [endJourney, journeyId, onTableSegmentClick, trackAnalytics],\n );\n\n const handleTableSegmentClick = useCallback(\n (launcherData: ITables, tableData: ITableInfo) => {\n if (\n !originalTableRef.current?.segmentedCardWrapperRef.current ||\n !originalTableRef.current?.labelRef.current\n ) {\n return;\n }\n\n const segmentedCardDims = originalTableRef.current.labelRef.current.getBoundingClientRect();\n const tableCardDims =\n originalTableRef.current?.segmentedCardWrapperRef.current.getBoundingClientRect();\n\n addCoachmark(journeyId, {\n originalElementToHighlightRef: originalTableRef.current.segmentedCardWrapperRef,\n isActive: false,\n type: IndicatorType.TOOLTIP,\n elementToHighlight: (\n <TablesCard\n ref={highlightedTableRef}\n defaultTable={tableData}\n label={launcherData.label}\n data={launcherData.data}\n onPress={handleEndJourney}\n onGoBackFromTableLevel={handleEndJourney}\n />\n ),\n indicator: {\n position: 'left',\n backgroundColor: 'YELLOW_4',\n width: 236,\n tooltipItem: (\n <FlexView>\n <Text $renderAs=\"ab2-bold\">Each table has 3 levels—clear them and earn 3 stars!</Text>\n </FlexView>\n ),\n tooltipXCoOrdinates: 0,\n tooltipYCoOrdinates: segmentedCardDims.height * 0.35,\n } as IArrowTooltipProps,\n });\n\n addCoachmark(journeyId, {\n originalElementToHighlightRef: originalTableRef.current.segmentedCardWrapperRef,\n isActive: false,\n type: IndicatorType.NUDGE,\n indicator: {\n nudge: 'click',\n content: (\n <Text $renderAs=\"ab1\" $color=\"WHITE\">\n Pick a level\n </Text>\n ),\n nudgePointerX: tableCardDims.width / 2 + 50,\n nudgePointerY: tableCardDims.height * 0.4,\n } as INudgeProps,\n elementToHighlight: <></>,\n });\n\n nextCoachmark(journeyId, false, SHOW_PICK_A_LEVEL_TOOLTIP_AFTER_MS); // Show coachmark => Each table has 3... and Hide the previous two\n nextCoachmark(journeyId, true, SHOW_PICK_A_LEVEL_NUDGE_AFTER_MS); // Show nudge => Pick a level\n\n const startAnimationOnLabelAgain = setTimeout(() => {\n clearTimeout(startAnimationOnLabelAgain);\n highlightedTableRef.current?.startLabelAnimation('YELLOW_4');\n }, START_ANIMATING_CLONED_ELEM);\n\n timerRefs.current.push(startAnimationOnLabelAgain);\n },\n [addCoachmark, handleEndJourney, journeyId, nextCoachmark],\n );\n\n const goToTableLauncher = useCallback(() => {\n playButtonSound();\n carouselRefs.current?.goToIndex(TABLE_CARD_INDEX);\n nextCoachmark(journeyId, false, GO_TO_TABLE_LAUNCHER_DURATION_MS);\n\n trackAnalytics(PLATFORM_EVENTS_STUDENT.ONBOARDING_STEP_VIEWED, {\n step: Action.TABLES,\n });\n\n const showNudge = setTimeout(() => {\n clearTimeout(showNudge);\n originalTableRef.current?.setLabelVisiblity(false);\n nextCoachmark(journeyId, true);\n }, SHOW_CLICK_TABLE_NUDGE_AFTER_MS);\n\n timerRefs.current.push(showNudge);\n\n const animateLabel = setTimeout(() => {\n clearTimeout(animateLabel);\n highlightedTableRef.current?.startLabelAnimation('YELLOW_4');\n }, START_ANIMATING_CLONED_ELEM);\n\n timerRefs.current.push(animateLabel);\n }, [carouselRefs, journeyId, nextCoachmark, playButtonSound, trackAnalytics]);\n\n const startJourney = useCallback(\n (tablesData: ITables, isTutorialOnboardingDone: boolean = false) => {\n const paginationList = carouselRefs.current?.indicatorRefs;\n const carouselNextBtnRef = carouselRefs.current?.nextBtnRef;\n const tablePaginationRef = paginationList?.[TABLE_CARD_INDEX];\n\n if (\n !originalTableRef.current?.segmentedCardWrapperRef.current ||\n !originalTableRef.current?.labelRef.current ||\n !paginationList ||\n !carouselNextBtnRef?.current ||\n !tablePaginationRef ||\n !tablePaginationRef.current\n ) {\n return;\n }\n\n const labelDims = originalTableRef.current.labelRef.current.getBoundingClientRect();\n const tableCardDims =\n originalTableRef.current?.segmentedCardWrapperRef.current.getBoundingClientRect();\n\n // TAKE THE USER TO THE TABLE CARD\n if (!isTutorialOnboardingDone) {\n setJourney(journeyId, [\n {\n originalElementToHighlightRef: carouselRefs.current?.nextBtnRef,\n isActive: false,\n type: IndicatorType.NUDGE,\n indicator: {\n nudge: 'click',\n content: (\n <Text $renderAs=\"ab1\" $color=\"WHITE\">\n Click to proceed\n </Text>\n ),\n nudgePointerX: 0,\n nudgePointerY: 0,\n } as INudgeProps,\n elementToHighlight: (\n <IconButton\n renderAs=\"secondary\"\n Icon={CaratRightIcon}\n onClick={goToTableLauncher}\n analyticsLabel={GAME_LAUNCHER_ANALYTICS_EVENTS.JOURNEY_NEXT_ACTIVITY}\n />\n ),\n },\n ]);\n carouselRefs.current?.goToIndex(PUZZLE_CARD_INDEX);\n nextCoachmark(journeyId, false, SHOW_INITIAL_COACHMARK_AFTER_MS); // Show nudge => Click to proceed\n } else {\n setJourney(journeyId, [\n {\n originalElementToHighlightRef: tablePaginationRef as React.RefObject<HTMLDivElement>,\n isActive: false,\n type: IndicatorType.TOOLTIP,\n elementToHighlight: <S.Indicator $isActive={false} />,\n indicator: {\n position: 'bottom',\n backgroundColor: 'YELLOW_4',\n width: 52,\n tooltipItem: (\n <FlexView\n $position=\"absolute\"\n $flexDirection=\"row\"\n style={{ top: 6, left: 8, cursor: 'pointer' }}\n onClick={goToTableLauncher}\n >\n <Text $renderAs=\"ab2-bold\">NEW</Text>\n </FlexView>\n ),\n tooltipYCoOrdinates: 14, // Need some offset in Y direction from top\n } as IArrowTooltipProps,\n },\n {\n originalElementToHighlightRef: tablePaginationRef as React.RefObject<HTMLDivElement>,\n isActive: false,\n type: IndicatorType.NUDGE,\n indicator: {\n nudge: 'click',\n content: '',\n nudgePointerY: 20,\n } as INudgeProps,\n elementToHighlight: <></>,\n },\n ]);\n carouselRefs.current?.goToIndex(LESSON_CARD_INDEX);\n nextCoachmark(journeyId, false, SHOW_INITIAL_COACHMARK_AFTER_MS); // Show Coachmark => NEW\n nextCoachmark(journeyId, true, SHOW_INITIAL_TOOLTIP_AFTER_MS); // Show Nudge over Coachmark\n }\n\n // SHOW THE USER SELECT A TABLE\n addCoachmark(journeyId, {\n originalElementToHighlightRef: originalTableRef.current.labelRef,\n isActive: false,\n type: IndicatorType.TOOLTIP,\n elementToHighlight: <></>,\n indicator: {\n position: 'right',\n backgroundColor: 'YELLOW_4',\n width: 264,\n tooltipItem: (\n <FlexView>\n <Text $renderAs=\"ab2-bold\">\n Get faster at multiplication! Practice everyday and become a Tables champ.\n </Text>\n </FlexView>\n ),\n tooltipXCoOrdinates: labelDims.width + 50,\n tooltipYCoOrdinates: labelDims.height / 2,\n } as IArrowTooltipProps,\n });\n\n addCoachmark(journeyId, {\n originalElementToHighlightRef: originalTableRef.current.segmentedCardWrapperRef,\n isActive: false,\n type: IndicatorType.NUDGE,\n indicator: {\n nudge: 'click',\n content: (\n <Text $renderAs=\"ab1\" $color=\"WHITE\">\n {'Pick a table to start'}\n </Text>\n ),\n nudgePointerX: tableCardDims.width / 2 + 50,\n nudgePointerY: tableCardDims.height / 2,\n } as INudgeProps,\n elementToHighlight: (\n <TablesCard\n ref={highlightedTableRef}\n label={tablesData.label}\n data={tablesData.data}\n onPress={() => {}}\n onPressTableSegment={tableInfo => handleTableSegmentClick(tablesData, tableInfo)}\n />\n ),\n });\n },\n [\n addCoachmark,\n carouselRefs,\n goToTableLauncher,\n handleTableSegmentClick,\n journeyId,\n nextCoachmark,\n setJourney,\n ],\n );\n\n // Cleanup on unmount\n useEffect(() => {\n return () => {\n timerRefs.current.forEach(timer => clearTimeout(timer));\n timerRefs.current = [];\n };\n }, [journeyId]);\n\n return {\n tableRef: originalTableRef,\n startJourney,\n };\n};\n"],"names":["useTableLauncherJourney","carouselRefs","onTableSegmentClick","journeyId","JOURNEY_ID_STUDENT","originalTableRef","useRef","highlightedTableRef","timerRefs","playButtonSound","useCircleSounds","nextCoachmark","setJourney","addCoachmark","endJourney","useJourney","trackAnalytics","useUIContext","handleEndJourney","useCallback","tableDetails","PLATFORM_EVENTS_STUDENT","Action","_a","_b","handleTableSegmentClick","launcherData","tableData","segmentedCardDims","tableCardDims","_c","IndicatorType","jsx","TablesCard","FlexView","Text","Fragment","SHOW_PICK_A_LEVEL_TOOLTIP_AFTER_MS","SHOW_PICK_A_LEVEL_NUDGE_AFTER_MS","startAnimationOnLabelAgain","START_ANIMATING_CLONED_ELEM","goToTableLauncher","TABLE_CARD_INDEX","GO_TO_TABLE_LAUNCHER_DURATION_MS","showNudge","SHOW_CLICK_TABLE_NUDGE_AFTER_MS","animateLabel","startJourney","tablesData","isTutorialOnboardingDone","paginationList","carouselNextBtnRef","tablePaginationRef","_d","labelDims","_e","S.Indicator","_h","LESSON_CARD_INDEX","SHOW_INITIAL_COACHMARK_AFTER_MS","SHOW_INITIAL_TOOLTIP_AFTER_MS","_f","IconButton","CaratRightIcon","GAME_LAUNCHER_ANALYTICS_EVENTS","_g","PUZZLE_CARD_INDEX","tableInfo","useEffect","timer"],"mappings":";;;;;;;;;;;;;;;;;AAyCO,MAAMA,KAA0B,CAAC;AAAA,EACtC,cAAAC;AAAA,EACA,qBAAAC;AACF,MAA6B;AAC3B,QAAMC,IAAYC,EAAmB,6BAC/BC,IAAmBC,EAAsB,IAAI,GAC7CC,IAAsBD,EAAsB,IAAI,GAEhDE,IAAYF,EAAwC,CAAA,CAAE,GAEtD,EAAE,iBAAAG,MAAoBC,KACtB,EAAE,eAAAC,GAAe,YAAAC,GAAY,cAAAC,GAAc,YAAAC,EAAA,IAAeC,KAC1D,EAAE,SAASC,EAAe,IAAIC,EAAa,GAE3CC,IAAmBC;AAAA,IACvB,CAACC,MAAiC;;AAEhC,MAAIA,KACFlB,EAAoBkB,CAAY,GAElCJ,EAAeK,EAAwB,2BAA2B;AAAA,QAChE,MAAMC,EAAO;AAAA,MAAA,CACd,IAGiBC,IAAAlB,KAAA,gBAAAA,EAAA,YAAA,QAAAkB,EAAS,kBAAkB,MAC7CC,IAAAnB,KAAA,gBAAAA,EAAkB,YAAlB,QAAAmB,EAA2B,sBAC3BV,EAAWX,CAAS;AAAA,IACtB;AAAA,IACA,CAACW,GAAYX,GAAWD,GAAqBc,CAAc;AAAA,EAAA,GAGvDS,IAA0BN;AAAA,IAC9B,CAACO,GAAuBC,MAA0B;;AAE9C,UAAA,GAACJ,IAAAlB,EAAiB,YAAjB,QAAAkB,EAA0B,wBAAwB,YACnD,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