@cuemath/leap 3.2.17-node-beta-0.1 → 3.2.18-mb
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/lottie/lottie.js +1 -1
- package/dist/assets/lottie/lottie.js.map +1 -1
- package/dist/features/auth/account-selector/account-selector.js +25 -26
- package/dist/features/auth/account-selector/account-selector.js.map +1 -1
- package/dist/features/auth/comps/auth-page-layout/auth-page-layout.js +14 -15
- package/dist/features/auth/comps/auth-page-layout/auth-page-layout.js.map +1 -1
- package/dist/features/auth/comps/user-list/user-item/user-item.js +31 -30
- package/dist/features/auth/comps/user-list/user-item/user-item.js.map +1 -1
- package/dist/features/auth/comps/user-list/user-list.js +34 -35
- package/dist/features/auth/comps/user-list/user-list.js.map +1 -1
- package/dist/features/auth/forgot-password/forgot-password-styled.js +15 -14
- package/dist/features/auth/forgot-password/forgot-password-styled.js.map +1 -1
- package/dist/features/auth/login/identifier-otp-form/identifier-otp-form-styled.js +7 -6
- package/dist/features/auth/login/identifier-otp-form/identifier-otp-form-styled.js.map +1 -1
- package/dist/features/auth/login/login-styled.js +9 -8
- package/dist/features/auth/login/login-styled.js.map +1 -1
- package/dist/features/chapters-v2/comps/node-card/node-card-tags.js +12 -19
- package/dist/features/chapters-v2/comps/node-card/node-card-tags.js.map +1 -1
- package/dist/features/chapters-v2/constants/block-constants.js +2 -3
- package/dist/features/chapters-v2/constants/block-constants.js.map +1 -1
- package/dist/features/chapters-v2/utils/index.js +4 -6
- package/dist/features/chapters-v2/utils/index.js.map +1 -1
- package/dist/features/chapters-v2/utils/node-card-utils.js +7 -11
- package/dist/features/chapters-v2/utils/node-card-utils.js.map +1 -1
- package/dist/features/circle-games/game-launcher/comps/tables-card/tables-card-styled.js +4 -4
- package/dist/features/circle-games/game-launcher/comps/tables-card/tables-card-styled.js.map +1 -1
- package/dist/features/circle-games/game-launcher/comps/tables-card/tables-card.js +85 -85
- package/dist/features/circle-games/game-launcher/comps/tables-card/tables-card.js.map +1 -1
- package/dist/features/circle-games/game-launcher/hooks/use-game-launcher-journey/use-game-launcher-journey.js +98 -121
- 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-infinite-launcher-journey/use-table-infinite-launcher-journey.js +28 -29
- package/dist/features/circle-games/game-launcher/hooks/use-table-infinite-launcher-journey/use-table-infinite-launcher-journey.js.map +1 -1
- package/dist/features/circle-games/game-launcher/hooks/use-table-launcher-journey/use-table-launcher-journey.js +42 -43
- package/dist/features/circle-games/game-launcher/hooks/use-table-launcher-journey/use-table-launcher-journey.js.map +1 -1
- package/dist/features/circle-games/games/tutorial/tutorial.js +35 -43
- package/dist/features/circle-games/games/tutorial/tutorial.js.map +1 -1
- package/dist/features/circle-games/sign-up/comp/grade-input/grade-input-styled.js +2 -2
- package/dist/features/circle-games/sign-up/comp/grade-input/grade-input-styled.js.map +1 -1
- package/dist/features/circle-games/sign-up/comp/grade-input/grade-input.js +1 -1
- package/dist/features/circle-games/sign-up/comp/grade-input/grade-input.js.map +1 -1
- package/dist/features/circle-games/sign-up/comp/username-input/username-input.js +24 -26
- package/dist/features/circle-games/sign-up/comp/username-input/username-input.js.map +1 -1
- package/dist/features/circle-games/sign-up/constants.js +1 -3
- package/dist/features/circle-games/sign-up/constants.js.map +1 -1
- package/dist/features/cue-canvas/hooks/use-canvas-sync-broker.js +42 -42
- package/dist/features/cue-canvas/hooks/use-canvas-sync-broker.js.map +1 -1
- package/dist/features/hooks/use-viewport/use-viewport.js +22 -0
- package/dist/features/hooks/use-viewport/use-viewport.js.map +1 -0
- package/dist/features/journey/comps/coachmark/coachmark.js +27 -29
- package/dist/features/journey/comps/coachmark/coachmark.js.map +1 -1
- package/dist/features/journey/journey-id/journey-id-student.js +2 -2
- package/dist/features/journey/journey-id/journey-id-student.js.map +1 -1
- package/dist/features/journey/use-journey/journey-context-provider.js +72 -73
- package/dist/features/journey/use-journey/journey-context-provider.js.map +1 -1
- package/dist/features/journey/use-journey/journey-styled.js +4 -6
- package/dist/features/journey/use-journey/journey-styled.js.map +1 -1
- package/dist/features/sheets/constants/sheet.js +1 -2
- package/dist/features/sheets/constants/sheet.js.map +1 -1
- package/dist/features/stickers/sticker-data.js +234 -0
- package/dist/features/stickers/sticker-data.js.map +1 -0
- package/dist/features/{ui/sticker-grid/sticker-grid-styles.js → stickers/sticker-selector/sticker-selector-styles.js} +4 -3
- package/dist/features/stickers/sticker-selector/sticker-selector-styles.js.map +1 -0
- package/dist/features/stickers/sticker-selector/sticker-selector.js +25 -0
- package/dist/features/stickers/sticker-selector/sticker-selector.js.map +1 -0
- package/dist/features/stickers/sticker-selector/sticker.js +57 -0
- package/dist/features/stickers/sticker-selector/sticker.js.map +1 -0
- package/dist/features/{ui/stickers/stickers-effects.js → stickers/stickers-effects/effects.js} +6 -6
- package/dist/features/stickers/stickers-effects/effects.js.map +1 -0
- package/dist/features/{ui/stickers/stickers-styled.js → stickers/stickers-effects/stickers-effects-styled.js} +2 -2
- package/dist/features/stickers/stickers-effects/stickers-effects-styled.js.map +1 -0
- package/dist/features/stickers/stickers-effects/stickers-effects-utils.js +93 -0
- package/dist/features/stickers/stickers-effects/stickers-effects-utils.js.map +1 -0
- package/dist/features/stickers/stickers-effects/stickers-effects.js +39 -0
- package/dist/features/stickers/stickers-effects/stickers-effects.js.map +1 -0
- package/dist/features/ui/arrow-tooltip/arrow-tooltip-styled.js +60 -12
- package/dist/features/ui/arrow-tooltip/arrow-tooltip-styled.js.map +1 -1
- package/dist/features/ui/arrow-tooltip/arrow-tooltip.js +77 -72
- package/dist/features/ui/arrow-tooltip/arrow-tooltip.js.map +1 -1
- package/dist/features/ui/error/error.js +27 -65
- package/dist/features/ui/error/error.js.map +1 -1
- package/dist/features/ui/lottie-animation/lottie-animation.js +29 -25
- package/dist/features/ui/lottie-animation/lottie-animation.js.map +1 -1
- package/dist/features/ui/modals/modal-styled.js +58 -34
- package/dist/features/ui/modals/modal-styled.js.map +1 -1
- package/dist/features/ui/modals/modal.js +14 -40
- package/dist/features/ui/modals/modal.js.map +1 -1
- package/dist/features/ui/nudge/nudge-styled.js +7 -14
- package/dist/features/ui/nudge/nudge-styled.js.map +1 -1
- package/dist/features/ui/nudge/nudge.js +12 -13
- package/dist/features/ui/nudge/nudge.js.map +1 -1
- package/dist/features/ui/streak-icon/streak-icon-styled.js +13 -13
- package/dist/features/ui/streak-icon/streak-icon-styled.js.map +1 -1
- package/dist/features/ui/streak-icon/streak-icon.js +15 -17
- package/dist/features/ui/streak-icon/streak-icon.js.map +1 -1
- package/dist/features/ui/text/text.js +36 -40
- package/dist/features/ui/text/text.js.map +1 -1
- package/dist/features/ui/theme/constants.js +2 -4
- package/dist/features/ui/theme/constants.js.map +1 -1
- package/dist/features/ui/theme/get-device.js +3 -3
- package/dist/features/ui/theme/get-device.js.map +1 -1
- package/dist/features/worksheet/worksheet/constants.js +13 -12
- package/dist/features/worksheet/worksheet/constants.js.map +1 -1
- package/dist/features/worksheet/worksheet/worksheet-question/learnosity-question.js +24 -24
- package/dist/features/worksheet/worksheet/worksheet-question/learnosity-question.js.map +1 -1
- package/dist/features/worksheet/worksheet/worksheet-question/worksheet-question.js +260 -246
- package/dist/features/worksheet/worksheet/worksheet-question/worksheet-question.js.map +1 -1
- package/dist/features/worksheet/worksheet/worksheet-styled.js +28 -37
- package/dist/features/worksheet/worksheet/worksheet-styled.js.map +1 -1
- package/dist/features/worksheet/worksheet/worksheet.js +164 -166
- package/dist/features/worksheet/worksheet/worksheet.js.map +1 -1
- package/dist/index.d.ts +53 -68
- package/dist/index.js +533 -547
- package/dist/index.js.map +1 -1
- package/dist/static/nudge-tap.5cb30093.json +1057 -0
- package/package.json +1 -1
- package/dist/assets/line-icons/icons/cue-board-filled.js +0 -33
- package/dist/assets/line-icons/icons/cue-board-filled.js.map +0 -1
- package/dist/assets/line-icons/icons/cue-board.js +0 -23
- package/dist/assets/line-icons/icons/cue-board.js.map +0 -1
- package/dist/assets/line-icons/icons/hint-fill.js +0 -35
- package/dist/assets/line-icons/icons/hint-fill.js.map +0 -1
- package/dist/assets/line-icons/icons/screen-grab-filled.js +0 -35
- package/dist/assets/line-icons/icons/screen-grab-filled.js.map +0 -1
- package/dist/assets/line-icons/icons/screen-grab.js +0 -23
- package/dist/assets/line-icons/icons/screen-grab.js.map +0 -1
- package/dist/assets/line-icons/icons/sticker-filled.js +0 -64
- package/dist/assets/line-icons/icons/sticker-filled.js.map +0 -1
- package/dist/assets/line-icons/icons/sticker.js +0 -46
- package/dist/assets/line-icons/icons/sticker.js.map +0 -1
- package/dist/features/puzzles/app/puzzle-app-styled.js +0 -81
- package/dist/features/puzzles/app/puzzle-app-styled.js.map +0 -1
- package/dist/features/puzzles/app/puzzle-app-view.js +0 -120
- package/dist/features/puzzles/app/puzzle-app-view.js.map +0 -1
- package/dist/features/puzzles/app/puzzle-app.js +0 -62
- package/dist/features/puzzles/app/puzzle-app.js.map +0 -1
- package/dist/features/ui/arrow-tooltip/arrow-tooltip-constants.js +0 -6
- package/dist/features/ui/arrow-tooltip/arrow-tooltip-constants.js.map +0 -1
- package/dist/features/ui/arrow-tooltip/comps/tooltip-body-styled.js +0 -63
- package/dist/features/ui/arrow-tooltip/comps/tooltip-body-styled.js.map +0 -1
- package/dist/features/ui/arrow-tooltip/comps/tooltip-body.js +0 -21
- package/dist/features/ui/arrow-tooltip/comps/tooltip-body.js.map +0 -1
- package/dist/features/ui/sticker-grid/sticker-grid-styles.js.map +0 -1
- package/dist/features/ui/sticker-grid/sticker-grid.js +0 -24
- package/dist/features/ui/sticker-grid/sticker-grid.js.map +0 -1
- package/dist/features/ui/sticker-grid/sticker.js +0 -57
- package/dist/features/ui/sticker-grid/sticker.js.map +0 -1
- package/dist/features/ui/stickers/constants.js +0 -6
- package/dist/features/ui/stickers/constants.js.map +0 -1
- package/dist/features/ui/stickers/stickers-effects.js.map +0 -1
- package/dist/features/ui/stickers/stickers-styled.js.map +0 -1
- package/dist/features/ui/stickers/stickers-utils.js +0 -91
- package/dist/features/ui/stickers/stickers-utils.js.map +0 -1
- package/dist/features/ui/stickers/stickers.js +0 -40
- package/dist/features/ui/stickers/stickers.js.map +0 -1
- package/dist/static/nudge-tap.0591aef4.json +0 -1
@@ -1,106 +1,98 @@
|
|
1
|
-
import { jsx as t, Fragment as
|
2
|
-
import { useRef as
|
3
|
-
import { useTheme as Ce } from "styled-components";
|
1
|
+
import { jsx as t, Fragment as G } from "react/jsx-runtime";
|
2
|
+
import { useRef as H, useCallback as m, useMemo as pe, useEffect as _e } from "react";
|
4
3
|
import ae from "../../../../../assets/line-icons/icons/carat-right.js";
|
5
|
-
import { PLATFORM_EVENTS_STUDENT as
|
6
|
-
import { JOURNEY_ID_STUDENT as
|
4
|
+
import { PLATFORM_EVENTS_STUDENT as ce } from "../../../../analytics-events/platform-events-student.js";
|
5
|
+
import { JOURNEY_ID_STUDENT as U } from "../../../../journey/journey-id/journey-id-student.js";
|
7
6
|
import { IndicatorType as d } from "../../../../journey/use-journey/constants.js";
|
8
|
-
import { useJourney as
|
9
|
-
import
|
10
|
-
import { useUIContext as
|
11
|
-
import
|
7
|
+
import { useJourney as Ie } from "../../../../journey/use-journey/use-journey.js";
|
8
|
+
import de from "../../../../ui/buttons/icon-button/icon-button.js";
|
9
|
+
import { useUIContext as Ce } from "../../../../ui/context/context.js";
|
10
|
+
import B from "../../../../ui/layout/flex-view.js";
|
12
11
|
import T from "../../../../ui/text/text.js";
|
13
|
-
import {
|
12
|
+
import { getTheme as fe } from "../../../../ui/theme/get-theme.js";
|
14
13
|
import { CIRCLE_ONBOARDING_ANALYTICS_STEPS as s } from "../../../enum/circle-onboarding-steps.js";
|
15
|
-
import { useCircleSounds as
|
16
|
-
import { SegmentedGameCard as
|
14
|
+
import { useCircleSounds as Ae } from "../../../hooks/use-circle-sounds/use-circle-sounds.js";
|
15
|
+
import { SegmentedGameCard as Te } from "../../comps/segmented-game-card/segmented-game-card.js";
|
17
16
|
import { GAME_LAUNCHER_ANALYTICS_EVENTS as he } from "../../game-launcher-analytics-events.js";
|
18
|
-
import { GO_TO_NEXT_SLIDE_AFTER_MS as
|
19
|
-
import { ProjectType as
|
20
|
-
const
|
17
|
+
import { GO_TO_NEXT_SLIDE_AFTER_MS as Le, SHOW_LABEL_HIGHLIGHT_AFTER_MS as Re, SHOW_NUDGE_AFTER_MS as ge, SLIDE_TO_LESSON_MS as Oe } from "./constants.js";
|
18
|
+
import { ProjectType as me } from "../../../games/web-view/enums/project-type-enum.js";
|
19
|
+
const $e = ({
|
21
20
|
carouselRefs: i,
|
22
|
-
onSegmentClick:
|
23
|
-
onJourneyComplete:
|
21
|
+
onSegmentClick: f,
|
22
|
+
onJourneyComplete: A
|
24
23
|
}) => {
|
25
|
-
const { device:
|
24
|
+
const { device: se } = fe(), h = se === "mobile", L = h ? "ab3-bold" : "ab2-bold", n = H(null), l = H(null), a = H(null), u = H([]), { playButtonSound: k } = Ae(), { nextCoachmark: g, setJourney: Y, endJourney: R } = Ie(), { onEvent: O } = Ce(), w = m(
|
26
25
|
(e) => {
|
27
|
-
|
26
|
+
O(ce.ONBOARDING_STEP_VIEWED, {
|
28
27
|
step: e
|
29
28
|
});
|
30
29
|
},
|
31
|
-
[
|
32
|
-
),
|
30
|
+
[O]
|
31
|
+
), N = m(
|
33
32
|
(e) => {
|
34
|
-
|
33
|
+
O(ce.ONBOARDING_STEP_COMPLETED, {
|
35
34
|
step: e
|
36
35
|
});
|
37
36
|
},
|
38
|
-
[
|
39
|
-
), E =
|
40
|
-
(e, r,
|
37
|
+
[O]
|
38
|
+
), E = m(
|
39
|
+
(e, r, c, S = !1, b) => {
|
41
40
|
var _, I;
|
42
|
-
S || (
|
41
|
+
S || (k(), (I = i.current) == null || I.goToIndex(((_ = i.current) == null ? void 0 : _.currentIndex) + 1), g(b, !1, Le)), w(e);
|
43
42
|
const p = setTimeout(() => {
|
44
|
-
clearTimeout(p), r.startLabelAnimation(
|
45
|
-
},
|
46
|
-
u.current.push(p),
|
43
|
+
clearTimeout(p), r.startLabelAnimation(c);
|
44
|
+
}, Re);
|
45
|
+
u.current.push(p), g(b, !0, ge);
|
47
46
|
},
|
48
|
-
[i,
|
49
|
-
),
|
47
|
+
[i, g, k, w]
|
48
|
+
), x = m(
|
50
49
|
(e, r) => {
|
51
|
-
|
50
|
+
f(e, me.PUZZLE), N(s.PUZZLE_ACTIVITY), R(r), A(r);
|
52
51
|
},
|
53
|
-
[R,
|
54
|
-
),
|
52
|
+
[R, A, f, N]
|
53
|
+
), v = m(
|
55
54
|
(e, r) => {
|
56
|
-
|
55
|
+
f(e, me.LESSON), N(s.SKILL_ACTIVITY), R(r), A(r);
|
57
56
|
},
|
58
|
-
[R,
|
59
|
-
),
|
60
|
-
(e, r,
|
61
|
-
var
|
62
|
-
const S = !!
|
63
|
-
if (!((
|
57
|
+
[R, A, f, N]
|
58
|
+
), y = m(
|
59
|
+
(e, r, c) => {
|
60
|
+
var M, W, $, D, X, F, Z, K, q, Q, z, j, ee, te, re, ne, ie, oe, le;
|
61
|
+
const S = !!c, b = !!r;
|
62
|
+
if (!((M = n == null ? void 0 : n.current) != null && M.segmentedCardWrapperRef.current) || (!((W = i == null ? void 0 : i.current) != null && W.nextBtnRef.current) || !(($ = l == null ? void 0 : l.current) != null && $.labelRef.current) || !((D = a == null ? void 0 : a.current) != null && D.labelRef.current) || !r) && e === U.CIRCLE_ACTIVITIES_INTRO_JOURNEY)
|
64
63
|
return;
|
65
|
-
const p = ((
|
64
|
+
const p = ((Z = (F = (X = n.current) == null ? void 0 : X.labelRef) == null ? void 0 : F.current) == null ? void 0 : Z.getBoundingClientRect()) || {
|
66
65
|
height: 0,
|
67
66
|
width: 0
|
68
|
-
}, _ = ((
|
67
|
+
}, _ = ((Q = (q = (K = l.current) == null ? void 0 : K.labelRef) == null ? void 0 : q.current) == null ? void 0 : Q.getBoundingClientRect()) || {
|
69
68
|
height: 0,
|
70
69
|
width: 0
|
71
|
-
}, I = ((
|
70
|
+
}, I = ((ee = (j = (z = a.current) == null ? void 0 : z.labelRef) == null ? void 0 : j.current) == null ? void 0 : ee.getBoundingClientRect()) || {
|
72
71
|
height: 0,
|
73
72
|
width: 0
|
74
|
-
},
|
73
|
+
}, P = ((ne = (re = (te = n.current) == null ? void 0 : te.segmentedCardWrapperRef) == null ? void 0 : re.current) == null ? void 0 : ne.getBoundingClientRect()) || {
|
75
74
|
height: 0,
|
76
75
|
width: 0
|
77
76
|
};
|
78
|
-
let
|
79
|
-
if (S && n.current && (
|
77
|
+
let V = [];
|
78
|
+
if (S && n.current && (V = [
|
80
79
|
{
|
81
80
|
originalElementToHighlightRef: n.current.labelRef,
|
82
81
|
type: d.TOOLTIP,
|
83
|
-
elementToHighlight: /* @__PURE__ */ t(
|
82
|
+
elementToHighlight: /* @__PURE__ */ t(G, {}),
|
84
83
|
indicator: {
|
85
84
|
position: "top",
|
86
85
|
backgroundColor: "BLUE_4",
|
87
|
-
tooltipItem: /* @__PURE__ */ t(
|
88
|
-
T,
|
89
|
-
{
|
90
|
-
$renderOnMobileAs: L,
|
91
|
-
$renderAs: O,
|
92
|
-
children: "Get faster & stay ahead in school. Practice 3 new skills everyday."
|
93
|
-
}
|
94
|
-
) }),
|
86
|
+
tooltipItem: /* @__PURE__ */ t(B, { children: /* @__PURE__ */ t(T, { $renderAs: L, children: "Get faster & stay ahead in school. Practice 3 new skills everyday." }) }),
|
95
87
|
tooltipXCoOrdinates: p.width / 2,
|
96
88
|
tooltipYCoOrdinates: p.height + 10
|
97
89
|
}
|
98
90
|
},
|
99
|
-
e ===
|
100
|
-
originalElementToHighlightRef: (
|
91
|
+
e === U.CIRCLE_ACTIVITIES_INTRO_JOURNEY ? {
|
92
|
+
originalElementToHighlightRef: (ie = i.current) == null ? void 0 : ie.nextBtnRef,
|
101
93
|
type: d.NUDGE,
|
102
94
|
elementToHighlight: /* @__PURE__ */ t(
|
103
|
-
|
95
|
+
de,
|
104
96
|
{
|
105
97
|
renderAs: "secondary",
|
106
98
|
Icon: ae,
|
@@ -116,7 +108,7 @@ const Fe = ({
|
|
116
108
|
),
|
117
109
|
indicator: {
|
118
110
|
nudge: "click",
|
119
|
-
content: !
|
111
|
+
content: !h && /* @__PURE__ */ t(T, { $renderAs: "ab1", $color: "WHITE", children: "Click to proceed" }),
|
120
112
|
nudgePointerX: 0,
|
121
113
|
nudgePointerY: 0
|
122
114
|
}
|
@@ -124,45 +116,38 @@ const Fe = ({
|
|
124
116
|
originalElementToHighlightRef: n.current.segmentedCardWrapperRef,
|
125
117
|
type: d.NUDGE,
|
126
118
|
elementToHighlight: /* @__PURE__ */ t(
|
127
|
-
|
119
|
+
Te,
|
128
120
|
{
|
129
121
|
label: "",
|
130
|
-
value:
|
131
|
-
maxValue:
|
132
|
-
initialValue:
|
133
|
-
data:
|
122
|
+
value: c.data.filter((o) => o.status === "pending").length,
|
123
|
+
maxValue: c.data.length,
|
124
|
+
initialValue: c.initialProgressValue,
|
125
|
+
data: c.data.map((o) => ({
|
134
126
|
card: o.cardLottie,
|
135
127
|
name: "",
|
136
128
|
// We dont want to show the name of the puzzle in onboarding
|
137
129
|
isCompleted: o.status === "completed",
|
138
|
-
onPress: () =>
|
130
|
+
onPress: () => v(o, e)
|
139
131
|
}))
|
140
132
|
}
|
141
133
|
),
|
142
134
|
indicator: {
|
143
135
|
nudge: "click",
|
144
|
-
content: !
|
145
|
-
nudgePointerX:
|
146
|
-
nudgePointerY:
|
136
|
+
content: !h && /* @__PURE__ */ t(T, { $renderAs: "ab1", $color: "WHITE", children: "Tap here to get started" }),
|
137
|
+
nudgePointerX: P.width * 0.6,
|
138
|
+
nudgePointerY: P.height * 0.4
|
147
139
|
}
|
148
140
|
}
|
149
|
-
]), e ===
|
141
|
+
]), e === U.CIRCLE_ACTIVITIES_INTRO_JOURNEY && l.current && a.current && b) {
|
150
142
|
const o = [
|
151
143
|
{
|
152
144
|
originalElementToHighlightRef: l.current.labelRef,
|
153
145
|
type: d.TOOLTIP,
|
154
|
-
elementToHighlight: /* @__PURE__ */ t(
|
146
|
+
elementToHighlight: /* @__PURE__ */ t(G, {}),
|
155
147
|
indicator: {
|
156
148
|
position: "top",
|
157
149
|
backgroundColor: "ORANGE_4",
|
158
|
-
tooltipItem: /* @__PURE__ */ t(
|
159
|
-
T,
|
160
|
-
{
|
161
|
-
$renderOnMobileAs: L,
|
162
|
-
$renderAs: O,
|
163
|
-
children: "Train to think deeper & plan ahead. Play 3 new games everyday."
|
164
|
-
}
|
165
|
-
) }),
|
150
|
+
tooltipItem: /* @__PURE__ */ t(B, { children: /* @__PURE__ */ t(T, { $renderAs: L, children: "Train to think deeper & plan ahead. Play 3 new games everyday." }) }),
|
166
151
|
tooltipXCoOrdinates: _.width / 2,
|
167
152
|
tooltipYCoOrdinates: _.height + 10
|
168
153
|
}
|
@@ -171,13 +156,13 @@ const Fe = ({
|
|
171
156
|
originalElementToHighlightRef: i.current.nextBtnRef,
|
172
157
|
type: d.NUDGE,
|
173
158
|
elementToHighlight: /* @__PURE__ */ t(
|
174
|
-
|
159
|
+
de,
|
175
160
|
{
|
176
161
|
renderAs: "secondary",
|
177
162
|
Icon: ae,
|
178
163
|
onClick: () => E(
|
179
164
|
s.PUZZLE_ACTIVITY,
|
180
|
-
|
165
|
+
a.current,
|
181
166
|
"PURPLE_4",
|
182
167
|
!1,
|
183
168
|
e
|
@@ -187,36 +172,29 @@ const Fe = ({
|
|
187
172
|
),
|
188
173
|
indicator: {
|
189
174
|
nudge: "click",
|
190
|
-
content: !
|
175
|
+
content: !h && /* @__PURE__ */ t(T, { $renderAs: "ab1", $color: "WHITE", children: "Click to proceed" }),
|
191
176
|
nudgePointerX: 0,
|
192
177
|
nudgePointerY: 0
|
193
178
|
}
|
194
179
|
}
|
195
|
-
],
|
180
|
+
], Ee = [
|
196
181
|
{
|
197
|
-
originalElementToHighlightRef:
|
182
|
+
originalElementToHighlightRef: a.current.labelRef,
|
198
183
|
type: d.TOOLTIP,
|
199
|
-
elementToHighlight: /* @__PURE__ */ t(
|
184
|
+
elementToHighlight: /* @__PURE__ */ t(G, {}),
|
200
185
|
indicator: {
|
201
186
|
position: "top",
|
202
187
|
backgroundColor: "PURPLE_4",
|
203
|
-
tooltipItem: /* @__PURE__ */ t(
|
204
|
-
T,
|
205
|
-
{
|
206
|
-
$renderOnMobileAs: L,
|
207
|
-
$renderAs: O,
|
208
|
-
children: "Think in new ways & stay sharp. Solve 3 new puzzles everyday."
|
209
|
-
}
|
210
|
-
) }),
|
188
|
+
tooltipItem: /* @__PURE__ */ t(B, { children: /* @__PURE__ */ t(T, { $renderAs: L, children: "Think in new ways & stay sharp. Solve 3 new puzzles everyday." }) }),
|
211
189
|
tooltipXCoOrdinates: I.width / 2,
|
212
190
|
tooltipYCoOrdinates: I.height + 10
|
213
191
|
}
|
214
192
|
},
|
215
193
|
{
|
216
|
-
originalElementToHighlightRef:
|
194
|
+
originalElementToHighlightRef: a.current.segmentedCardWrapperRef,
|
217
195
|
type: d.NUDGE,
|
218
196
|
elementToHighlight: /* @__PURE__ */ t(
|
219
|
-
|
197
|
+
Te,
|
220
198
|
{
|
221
199
|
label: "",
|
222
200
|
value: r.data.filter((C) => C.solved).length,
|
@@ -227,60 +205,59 @@ const Fe = ({
|
|
227
205
|
name: "",
|
228
206
|
// We dont want to show the name of the puzzle in onboarding
|
229
207
|
isCompleted: C.solved,
|
230
|
-
onPress: () =>
|
208
|
+
onPress: () => x(C, e)
|
231
209
|
}))
|
232
210
|
}
|
233
211
|
),
|
234
212
|
indicator: {
|
235
213
|
nudge: "click",
|
236
|
-
content: !
|
237
|
-
nudgePointerX:
|
238
|
-
nudgePointerY:
|
214
|
+
content: !h && /* @__PURE__ */ t(T, { $renderAs: "ab1", $color: "WHITE", children: "Click to solve a puzzle" }),
|
215
|
+
nudgePointerX: P.width * 0.6,
|
216
|
+
nudgePointerY: P.height * 0.4
|
239
217
|
}
|
240
218
|
}
|
241
219
|
];
|
242
|
-
|
220
|
+
Y(e, [...V, ...o, ...Ee]);
|
243
221
|
} else
|
244
|
-
|
245
|
-
(
|
246
|
-
const
|
247
|
-
clearTimeout(
|
248
|
-
},
|
249
|
-
if (u.current.push(
|
222
|
+
Y(e, V);
|
223
|
+
(oe = i.current) == null || oe.goToIndex(0);
|
224
|
+
const J = setTimeout(() => {
|
225
|
+
clearTimeout(J), g(e);
|
226
|
+
}, Oe);
|
227
|
+
if (u.current.push(J), e === U.CIRCLE_ACTIVITIES_INTRO_JOURNEY)
|
250
228
|
S && n.current ? E(s.SKILL_ACTIVITY, n.current, "BLUE_4", !0, e) : E(s.GAMES_ACTIVITY, l.current, "ORANGE_4", !0, e);
|
251
229
|
else {
|
252
|
-
(
|
230
|
+
(le = n.current) == null || le.startLabelAnimation("BLUE_4");
|
253
231
|
const o = setTimeout(() => {
|
254
|
-
clearTimeout(o),
|
255
|
-
},
|
232
|
+
clearTimeout(o), g(e, !0);
|
233
|
+
}, ge);
|
256
234
|
u.current.push(o);
|
257
235
|
}
|
258
236
|
},
|
259
237
|
[
|
260
238
|
i,
|
261
239
|
L,
|
262
|
-
|
263
|
-
|
264
|
-
V,
|
240
|
+
h,
|
241
|
+
Y,
|
265
242
|
E,
|
266
|
-
y,
|
267
243
|
v,
|
268
|
-
|
244
|
+
x,
|
245
|
+
g
|
269
246
|
]
|
270
|
-
),
|
247
|
+
), ue = pe(
|
271
248
|
() => ({
|
272
249
|
gameRefs: l,
|
273
250
|
lessonRefs: n,
|
274
|
-
puzzleRefs:
|
275
|
-
startJourney:
|
251
|
+
puzzleRefs: a,
|
252
|
+
startJourney: y
|
276
253
|
}),
|
277
|
-
[
|
254
|
+
[y]
|
278
255
|
);
|
279
|
-
return
|
256
|
+
return _e(() => () => {
|
280
257
|
u.current.forEach((e) => clearTimeout(e)), u.current = [];
|
281
|
-
}, [i]),
|
258
|
+
}, [i]), ue;
|
282
259
|
};
|
283
260
|
export {
|
284
|
-
|
261
|
+
$e as useGameLauncherJourney
|
285
262
|
};
|
286
263
|
//# 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 { TCoachmarkJourneyProps } 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 Lesson,\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';\nimport { useTheme } from 'styled-components';\n\nimport CaratRightIcon from '../../../../../assets/line-icons/icons/carat-right';\nimport { PLATFORM_EVENTS_STUDENT as AnalyticsLabel } 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 { EDeviceType } from '../../../../ui/theme/constants';\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 onJourneyComplete,\n}: IUseGameLauncherJourneyProps) => {\n const { device } = useTheme();\n const isMobile = device < EDeviceType.TABLET;\n const tooltipTextRenderAsOnMobile = 'ab3-bold';\n const tooltipTextRenderAs = 'ab2-bold';\n\n const lessonRefs = useRef<ISegmentedGameCardRefs>(null);\n const gameRefs = useRef<ISegmentedGameCardRefs>(null);\n const puzzleRefs = 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 isFirstSlide: boolean = false,\n journeyId: JOURNEY_ID_STUDENT,\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 handleEndJourneyForPuzzle = useCallback(\n (puzzlesData: Puzzle, journeyId: JOURNEY_ID_STUDENT) => {\n onSegmentClick(puzzlesData, ProjectType.PUZZLE);\n trackEventCompleted(ActionEvent.PUZZLE_ACTIVITY);\n endJourney(journeyId);\n onJourneyComplete(journeyId);\n },\n [endJourney, onJourneyComplete, onSegmentClick, trackEventCompleted],\n );\n\n const handleEndJourneyForLesson = useCallback(\n (lessonsData: Lesson, journeyId: JOURNEY_ID_STUDENT) => {\n onSegmentClick(lessonsData, ProjectType.LESSON);\n trackEventCompleted(ActionEvent.SKILL_ACTIVITY);\n endJourney(journeyId);\n onJourneyComplete(journeyId);\n },\n [endJourney, onJourneyComplete, onSegmentClick, trackEventCompleted],\n );\n\n const startJourney = useCallback(\n (\n journeyId: JOURNEY_ID_STUDENT,\n puzzlesData?: IProject<Puzzle>,\n lessonsData?: IProject<Lesson>,\n ) => {\n // If element refs are not available return, this is just for type safety\n const isLessonAvailable = !!lessonsData;\n const isPuzzleAvailable = !!puzzlesData;\n\n if (!lessonRefs?.current?.segmentedCardWrapperRef.current) return;\n\n if (\n (!carouselRefs?.current?.nextBtnRef.current ||\n !gameRefs?.current?.labelRef.current ||\n !puzzleRefs?.current?.labelRef.current ||\n !puzzlesData) &&\n journeyId === JOURNEY_ID_STUDENT.CIRCLE_ACTIVITIES_INTRO_JOURNEY\n ) {\n return;\n }\n\n const lessonLabelDims = lessonRefs.current?.labelRef?.current?.getBoundingClientRect() || {\n height: 0,\n width: 0,\n };\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 lessonRefs.current?.segmentedCardWrapperRef?.current?.getBoundingClientRect() || {\n height: 0,\n width: 0,\n };\n\n let lessonSteps: TCoachmarkJourneyProps[] = [];\n\n if (isLessonAvailable && lessonRefs.current) {\n lessonSteps = [\n {\n originalElementToHighlightRef: lessonRefs.current.labelRef,\n type: IndicatorType.TOOLTIP,\n elementToHighlight: <></>,\n indicator: {\n position: 'top',\n backgroundColor: 'BLUE_4',\n tooltipItem: (\n <FlexView>\n <Text\n $renderOnMobileAs={tooltipTextRenderAsOnMobile}\n $renderAs={tooltipTextRenderAs}\n >\n Get faster & stay ahead in school. Practice 3 new skills everyday.\n </Text>\n </FlexView>\n ),\n tooltipXCoOrdinates: lessonLabelDims.width / 2,\n tooltipYCoOrdinates: lessonLabelDims.height + 10,\n } as IArrowTooltipProps,\n },\n journeyId === JOURNEY_ID_STUDENT.CIRCLE_ACTIVITIES_INTRO_JOURNEY\n ? {\n originalElementToHighlightRef: carouselRefs.current?.nextBtnRef,\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 false,\n journeyId,\n )\n }\n analyticsLabel={GAME_LAUNCHER_ANALYTICS_EVENTS.JOURNEY_NEXT_ACTIVITY}\n />\n ),\n indicator: {\n nudge: 'click',\n content: !isMobile && (\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 originalElementToHighlightRef: lessonRefs.current.segmentedCardWrapperRef,\n type: IndicatorType.NUDGE,\n elementToHighlight: (\n <SegmentedGameCard\n label={''} // This is intentionally left blank to avoid showing the label\n value={lessonsData.data.filter(lesson => lesson.status === 'completed').length}\n maxValue={lessonsData.data.length}\n initialValue={lessonsData.initialProgressValue}\n data={lessonsData.data.map(lesson => ({\n card: lesson.cardLottie,\n name: '', // We dont want to show the name of the puzzle in onboarding\n isCompleted: lesson.status === 'completed',\n onPress: () => handleEndJourneyForLesson(lesson, journeyId),\n }))}\n />\n ),\n indicator: {\n nudge: 'click',\n content: !isMobile && (\n <Text $renderAs=\"ab1\" $color=\"WHITE\">\n Tap here to get started\n </Text>\n ),\n nudgePointerX: launcherDims.width * 0.6,\n nudgePointerY: launcherDims.height * 0.4,\n } as INudgeProps,\n },\n ];\n }\n\n if (\n journeyId === JOURNEY_ID_STUDENT.CIRCLE_ACTIVITIES_INTRO_JOURNEY &&\n gameRefs.current &&\n puzzleRefs.current &&\n isPuzzleAvailable\n ) {\n const gameSteps: TCoachmarkJourneyProps[] = [\n {\n originalElementToHighlightRef: gameRefs.current.labelRef,\n type: IndicatorType.TOOLTIP,\n elementToHighlight: <></>,\n indicator: {\n position: 'top',\n backgroundColor: 'ORANGE_4',\n tooltipItem: (\n <FlexView>\n <Text\n $renderOnMobileAs={tooltipTextRenderAsOnMobile}\n $renderAs={tooltipTextRenderAs}\n >\n Train to think deeper & plan ahead. Play 3 new games everyday.\n </Text>\n </FlexView>\n ),\n tooltipXCoOrdinates: gameLabelDims.width / 2,\n tooltipYCoOrdinates: gameLabelDims.height + 10,\n } as IArrowTooltipProps,\n },\n {\n originalElementToHighlightRef: carouselRefs.current.nextBtnRef,\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 false,\n journeyId,\n )\n }\n analyticsLabel={GAME_LAUNCHER_ANALYTICS_EVENTS.JOURNEY_NEXT_ACTIVITY}\n />\n ),\n indicator: {\n nudge: 'click',\n content: !isMobile && (\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: TCoachmarkJourneyProps[] = [\n {\n originalElementToHighlightRef: puzzleRefs.current.labelRef,\n type: IndicatorType.TOOLTIP,\n elementToHighlight: <></>,\n indicator: {\n position: 'top',\n backgroundColor: 'PURPLE_4',\n tooltipItem: (\n <FlexView>\n <Text\n $renderOnMobileAs={tooltipTextRenderAsOnMobile}\n $renderAs={tooltipTextRenderAs}\n >\n Think in new ways & stay sharp. Solve 3 new puzzles everyday.\n </Text>\n </FlexView>\n ),\n tooltipXCoOrdinates: puzzleLabelDims.width / 2,\n tooltipYCoOrdinates: puzzleLabelDims.height + 10,\n } as IArrowTooltipProps,\n },\n {\n originalElementToHighlightRef: puzzleRefs.current.segmentedCardWrapperRef,\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: () => handleEndJourneyForPuzzle(puzzle, journeyId),\n }))}\n />\n ),\n indicator: {\n nudge: 'click',\n content: !isMobile && (\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 } else {\n setJourney(journeyId, lessonSteps);\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 (journeyId === JOURNEY_ID_STUDENT.CIRCLE_ACTIVITIES_INTRO_JOURNEY) {\n if (isLessonAvailable && lessonRefs.current) {\n goToNextCard(ActionEvent.SKILL_ACTIVITY, lessonRefs.current, 'BLUE_4', true, journeyId);\n } else {\n goToNextCard(ActionEvent.GAMES_ACTIVITY, gameRefs.current!, 'ORANGE_4', true, journeyId);\n }\n } else {\n lessonRefs.current?.startLabelAnimation('BLUE_4');\n const delayBeforeShowingNudge = setTimeout(() => {\n clearTimeout(delayBeforeShowingNudge);\n nextCoachmark(journeyId, true);\n }, SHOW_NUDGE_AFTER_MS);\n\n timerRefs.current.push(delayBeforeShowingNudge); // Store to cleanup later\n }\n },\n [\n carouselRefs,\n tooltipTextRenderAsOnMobile,\n tooltipTextRenderAs,\n isMobile,\n setJourney,\n goToNextCard,\n handleEndJourneyForLesson,\n handleEndJourneyForPuzzle,\n nextCoachmark,\n ],\n );\n\n const data = useMemo(\n () => ({\n gameRefs,\n lessonRefs,\n puzzleRefs,\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","onJourneyComplete","device","useTheme","isMobile","EDeviceType","tooltipTextRenderAsOnMobile","tooltipTextRenderAs","lessonRefs","useRef","gameRefs","puzzleRefs","timerRefs","playButtonSound","useCircleSounds","nextCoachmark","setJourney","endJourney","useJourney","trackAnalytics","useUIContext","trackEventViewed","useCallback","step","AnalyticsLabel","trackEventCompleted","goToNextCard","analyticsLabelViewed","refOfNextSlide","color","isFirstSlide","journeyId","_b","_a","GO_TO_NEXT_SLIDE_AFTER_MS","animateLabelTimer","SHOW_LABEL_HIGHLIGHT_AFTER_MS","SHOW_NUDGE_AFTER_MS","handleEndJourneyForPuzzle","puzzlesData","ProjectType","ActionEvent","handleEndJourneyForLesson","lessonsData","startJourney","isLessonAvailable","isPuzzleAvailable","_c","_d","JOURNEY_ID_STUDENT","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","SegmentedGameCard","lesson","gameSteps","puzzleSteps","puzzle","_r","delayBeforeStart","SLIDE_TO_LESSON_MS","_s","delayBeforeShowingNudge","data","useMemo","useEffect","timer"],"mappings":";;;;;;;;;;;;;;;;;;;AAqCO,MAAMA,KAAyB,CAAC;AAAA,EACrC,cAAAC;AAAA,EACA,gBAAAC;AAAA,EACA,mBAAAC;AACF,MAAoC;AAC5B,QAAA,EAAE,QAAAC,OAAWC,MACbC,IAAWF,KAASG,GAAY,QAChCC,IAA8B,YAC9BC,IAAsB,YAEtBC,IAAaC,EAA+B,IAAI,GAChDC,IAAWD,EAA+B,IAAI,GAC9CE,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,GAAe,wBAAwB;AAAA,QACpD,MAAAD;AAAA,MAAA,CACD;AAAA,IACH;AAAA,IACA,CAACJ,CAAc;AAAA,EAAA,GAEXM,IAAsBH;AAAA,IAC1B,CAACC,MAAsB;AACrB,MAAAJ,EAAeK,GAAe,2BAA2B;AAAA,QACvD,MAAAD;AAAA,MAAA,CACD;AAAA,IACH;AAAA,IACA,CAACJ,CAAc;AAAA,EAAA,GAGXO,IAAeJ;AAAA,IACnB,CACEK,GACAC,GACAC,GACAC,IAAwB,IACxBC,MACG;;AACH,MAAKD,MACajB,MAChBmB,IAAAjC,EAAa,YAAb,QAAAiC,EAAsB,YAAUC,IAAAlC,EAAa,YAAb,gBAAAkC,EAAsB,gBAAe,IAC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AAE1B,YAAAC,IAAmB,WAAW,MAAM;AACxC,qBAAaA,CAAgB,GAC7BnE,EAAcgB,CAAS;AAAA,SACtBoD,EAAkB;AAIjB,UAFMvE,EAAA,QAAQ,KAAKsE,CAAgB,GAEnCnD,MAAckB,EAAmB;AAC/B,QAAAJ,KAAqBrC,EAAW,UAClCkB,EAAae,EAAY,gBAAgBjC,EAAW,SAAS,UAAU,IAAMuB,CAAS,IAEtFL,EAAae,EAAY,gBAAgB/B,EAAS,SAAU,YAAY,IAAMqB,CAAS;AAAA,WAEpF;AACM,SAAAqD,KAAA5E,EAAA,YAAA,QAAA4E,GAAS,oBAAoB;AAClC,cAAAC,IAA0B,WAAW,MAAM;AAC/C,uBAAaA,CAAuB,GACpCtE,EAAcgB,GAAW,EAAI;AAAA,WAC5BM,EAAmB;AAEZ,QAAAzB,EAAA,QAAQ,KAAKyE,CAAuB;AAAA,MAChD;AAAA,IACF;AAAA,IACA;AAAA,MACEtF;AAAA,MACAO;AAAA,MACAC;AAAA,MACAH;AAAA,MACAY;AAAA,MACAU;AAAA,MACAgB;AAAA,MACAJ;AAAA,MACAvB;AAAA,IACF;AAAA,EAAA,GAGIuE,KAAOC;AAAA,IACX,OAAO;AAAA,MACL,UAAA7E;AAAA,MACA,YAAAF;AAAA,MACA,YAAAG;AAAA,MACA,cAAAiC;AAAA,IAAA;AAAA,IAEF,CAACA,CAAY;AAAA,EAAA;AAIf,SAAA4C,GAAU,MACD,MAAM;AACX,IAAA5E,EAAU,QAAQ,QAAQ,CAAS6E,MAAA,aAAaA,CAAK,CAAC,GACtD7E,EAAU,UAAU;EAAC,GAEtB,CAACb,CAAY,CAAC,GAEVuF;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 { TCoachmarkJourneyProps } 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 Lesson,\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 { 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 { getTheme } from '../../../../ui/theme/get-theme';\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 onJourneyComplete,\n}: IUseGameLauncherJourneyProps) => {\n const { device } = getTheme();\n const isMobile = device === 'mobile';\n const tooltipTextRenderAs = isMobile ? 'ab3-bold' : 'ab2-bold';\n\n const lessonRefs = useRef<ISegmentedGameCardRefs>(null);\n const gameRefs = useRef<ISegmentedGameCardRefs>(null);\n const puzzleRefs = 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 isFirstSlide: boolean = false,\n journeyId: JOURNEY_ID_STUDENT,\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 handleEndJourneyForPuzzle = useCallback(\n (puzzlesData: Puzzle, journeyId: JOURNEY_ID_STUDENT) => {\n onSegmentClick(puzzlesData, ProjectType.PUZZLE);\n trackEventCompleted(ActionEvent.PUZZLE_ACTIVITY);\n endJourney(journeyId);\n onJourneyComplete(journeyId);\n },\n [endJourney, onJourneyComplete, onSegmentClick, trackEventCompleted],\n );\n\n const handleEndJourneyForLesson = useCallback(\n (lessonsData: Lesson, journeyId: JOURNEY_ID_STUDENT) => {\n onSegmentClick(lessonsData, ProjectType.LESSON);\n trackEventCompleted(ActionEvent.SKILL_ACTIVITY);\n endJourney(journeyId);\n onJourneyComplete(journeyId);\n },\n [endJourney, onJourneyComplete, onSegmentClick, trackEventCompleted],\n );\n\n const startJourney = useCallback(\n (\n journeyId: JOURNEY_ID_STUDENT,\n puzzlesData?: IProject<Puzzle>,\n lessonsData?: IProject<Lesson>,\n ) => {\n // If element refs are not available return, this is just for type safety\n const isLessonAvailable = !!lessonsData;\n const isPuzzleAvailable = !!puzzlesData;\n\n if (!lessonRefs?.current?.segmentedCardWrapperRef.current) return;\n\n if (\n (!carouselRefs?.current?.nextBtnRef.current ||\n !gameRefs?.current?.labelRef.current ||\n !puzzleRefs?.current?.labelRef.current ||\n !puzzlesData) &&\n journeyId === JOURNEY_ID_STUDENT.CIRCLE_ACTIVITIES_INTRO_JOURNEY\n ) {\n return;\n }\n\n const lessonLabelDims = lessonRefs.current?.labelRef?.current?.getBoundingClientRect() || {\n height: 0,\n width: 0,\n };\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 lessonRefs.current?.segmentedCardWrapperRef?.current?.getBoundingClientRect() || {\n height: 0,\n width: 0,\n };\n\n let lessonSteps: TCoachmarkJourneyProps[] = [];\n\n if (isLessonAvailable && lessonRefs.current) {\n lessonSteps = [\n {\n originalElementToHighlightRef: lessonRefs.current.labelRef,\n type: IndicatorType.TOOLTIP,\n elementToHighlight: <></>,\n indicator: {\n position: 'top',\n backgroundColor: 'BLUE_4',\n tooltipItem: (\n <FlexView>\n <Text $renderAs={tooltipTextRenderAs}>\n Get faster & stay ahead in school. Practice 3 new skills everyday.\n </Text>\n </FlexView>\n ),\n tooltipXCoOrdinates: lessonLabelDims.width / 2,\n tooltipYCoOrdinates: lessonLabelDims.height + 10,\n } as IArrowTooltipProps,\n },\n journeyId === JOURNEY_ID_STUDENT.CIRCLE_ACTIVITIES_INTRO_JOURNEY\n ? {\n originalElementToHighlightRef: carouselRefs.current?.nextBtnRef,\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 false,\n journeyId,\n )\n }\n analyticsLabel={GAME_LAUNCHER_ANALYTICS_EVENTS.JOURNEY_NEXT_ACTIVITY}\n />\n ),\n indicator: {\n nudge: 'click',\n content: !isMobile && (\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 originalElementToHighlightRef: lessonRefs.current.segmentedCardWrapperRef,\n type: IndicatorType.NUDGE,\n elementToHighlight: (\n <SegmentedGameCard\n label={''} // This is intentionally left blank to avoid showing the label\n value={lessonsData.data.filter(lesson => lesson.status === 'pending').length}\n maxValue={lessonsData.data.length}\n initialValue={lessonsData.initialProgressValue}\n data={lessonsData.data.map(lesson => ({\n card: lesson.cardLottie,\n name: '', // We dont want to show the name of the puzzle in onboarding\n isCompleted: lesson.status === 'completed',\n onPress: () => handleEndJourneyForLesson(lesson, journeyId),\n }))}\n />\n ),\n indicator: {\n nudge: 'click',\n content: !isMobile && (\n <Text $renderAs=\"ab1\" $color=\"WHITE\">\n Tap here to get started\n </Text>\n ),\n nudgePointerX: launcherDims.width * 0.6,\n nudgePointerY: launcherDims.height * 0.4,\n } as INudgeProps,\n },\n ];\n }\n\n if (\n journeyId === JOURNEY_ID_STUDENT.CIRCLE_ACTIVITIES_INTRO_JOURNEY &&\n gameRefs.current &&\n puzzleRefs.current &&\n isPuzzleAvailable\n ) {\n const gameSteps: TCoachmarkJourneyProps[] = [\n {\n originalElementToHighlightRef: gameRefs.current.labelRef,\n type: IndicatorType.TOOLTIP,\n elementToHighlight: <></>,\n indicator: {\n position: 'top',\n backgroundColor: 'ORANGE_4',\n tooltipItem: (\n <FlexView>\n <Text $renderAs={tooltipTextRenderAs}>\n Train to think deeper & plan ahead. Play 3 new games everyday.\n </Text>\n </FlexView>\n ),\n tooltipXCoOrdinates: gameLabelDims.width / 2,\n tooltipYCoOrdinates: gameLabelDims.height + 10,\n } as IArrowTooltipProps,\n },\n {\n originalElementToHighlightRef: carouselRefs.current.nextBtnRef,\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 false,\n journeyId,\n )\n }\n analyticsLabel={GAME_LAUNCHER_ANALYTICS_EVENTS.JOURNEY_NEXT_ACTIVITY}\n />\n ),\n indicator: {\n nudge: 'click',\n content: !isMobile && (\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: TCoachmarkJourneyProps[] = [\n {\n originalElementToHighlightRef: puzzleRefs.current.labelRef,\n type: IndicatorType.TOOLTIP,\n elementToHighlight: <></>,\n indicator: {\n position: 'top',\n backgroundColor: 'PURPLE_4',\n tooltipItem: (\n <FlexView>\n <Text $renderAs={tooltipTextRenderAs}>\n Think in new ways & stay sharp. Solve 3 new puzzles everyday.\n </Text>\n </FlexView>\n ),\n tooltipXCoOrdinates: puzzleLabelDims.width / 2,\n tooltipYCoOrdinates: puzzleLabelDims.height + 10,\n } as IArrowTooltipProps,\n },\n {\n originalElementToHighlightRef: puzzleRefs.current.segmentedCardWrapperRef,\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: () => handleEndJourneyForPuzzle(puzzle, journeyId),\n }))}\n />\n ),\n indicator: {\n nudge: 'click',\n content: !isMobile && (\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 } else {\n setJourney(journeyId, lessonSteps);\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 (journeyId === JOURNEY_ID_STUDENT.CIRCLE_ACTIVITIES_INTRO_JOURNEY) {\n if (isLessonAvailable && lessonRefs.current) {\n goToNextCard(ActionEvent.SKILL_ACTIVITY, lessonRefs.current, 'BLUE_4', true, journeyId);\n } else {\n goToNextCard(ActionEvent.GAMES_ACTIVITY, gameRefs.current!, 'ORANGE_4', true, journeyId);\n }\n } else {\n lessonRefs.current?.startLabelAnimation('BLUE_4');\n const delayBeforeShowingNudge = setTimeout(() => {\n clearTimeout(delayBeforeShowingNudge);\n nextCoachmark(journeyId, true);\n }, SHOW_NUDGE_AFTER_MS);\n\n timerRefs.current.push(delayBeforeShowingNudge); // Store to cleanup later\n }\n },\n [\n carouselRefs,\n tooltipTextRenderAs,\n isMobile,\n setJourney,\n goToNextCard,\n handleEndJourneyForLesson,\n handleEndJourneyForPuzzle,\n nextCoachmark,\n ],\n );\n\n const data = useMemo(\n () => ({\n gameRefs,\n lessonRefs,\n puzzleRefs,\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","onJourneyComplete","device","getTheme","isMobile","tooltipTextRenderAs","lessonRefs","useRef","gameRefs","puzzleRefs","timerRefs","playButtonSound","useCircleSounds","nextCoachmark","setJourney","endJourney","useJourney","trackAnalytics","useUIContext","trackEventViewed","useCallback","step","AnalyticsLabel","trackEventCompleted","goToNextCard","analyticsLabelViewed","refOfNextSlide","color","isFirstSlide","journeyId","_b","_a","GO_TO_NEXT_SLIDE_AFTER_MS","animateLabelTimer","SHOW_LABEL_HIGHLIGHT_AFTER_MS","SHOW_NUDGE_AFTER_MS","handleEndJourneyForPuzzle","puzzlesData","ProjectType","ActionEvent","handleEndJourneyForLesson","lessonsData","startJourney","isLessonAvailable","isPuzzleAvailable","_c","_d","JOURNEY_ID_STUDENT","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","SegmentedGameCard","lesson","gameSteps","puzzleSteps","puzzle","_r","delayBeforeStart","SLIDE_TO_LESSON_MS","_s","delayBeforeShowingNudge","data","useMemo","useEffect","timer"],"mappings":";;;;;;;;;;;;;;;;;;AAoCO,MAAMA,KAAyB,CAAC;AAAA,EACrC,cAAAC;AAAA,EACA,gBAAAC;AAAA,EACA,mBAAAC;AACF,MAAoC;AAC5B,QAAA,EAAE,QAAAC,OAAWC,MACbC,IAAWF,OAAW,UACtBG,IA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MACAvB;AAAA,IACF;AAAA,EAAA,GAGIuE,KAAOC;AAAA,IACX,OAAO;AAAA,MACL,UAAA7E;AAAA,MACA,YAAAF;AAAA,MACA,YAAAG;AAAA,MACA,cAAAiC;AAAA,IAAA;AAAA,IAEF,CAACA,CAAY;AAAA,EAAA;AAIf,SAAA4C,GAAU,MACD,MAAM;AACX,IAAA5E,EAAU,QAAQ,QAAQ,CAAS6E,MAAA,aAAaA,CAAK,CAAC,GACtD7E,EAAU,UAAU;EAAC,GAEtB,CAACX,CAAY,CAAC,GAEVqF;AACT;"}
|
@@ -1,33 +1,32 @@
|
|
1
|
-
import { jsx as o, Fragment as
|
1
|
+
import { jsx as o, Fragment as B } from "react/jsx-runtime";
|
2
2
|
import { useRef as Y, useCallback as E, useEffect as w } from "react";
|
3
|
-
import {
|
4
|
-
import {
|
5
|
-
import { JOURNEY_ID_STUDENT as J } from "../../../../journey/journey-id/journey-id-student.js";
|
3
|
+
import { PLATFORM_EVENTS_STUDENT as M } from "../../../../analytics-events/platform-events-student.js";
|
4
|
+
import { JOURNEY_ID_STUDENT as G } from "../../../../journey/journey-id/journey-id-student.js";
|
6
5
|
import { IndicatorType as p } from "../../../../journey/use-journey/constants.js";
|
7
|
-
import { useJourney as
|
8
|
-
import { useUIContext as
|
6
|
+
import { useJourney as J } from "../../../../journey/use-journey/use-journey.js";
|
7
|
+
import { useUIContext as b } from "../../../../ui/context/context.js";
|
9
8
|
import P from "../../../../ui/layout/flex-view.js";
|
10
9
|
import R from "../../../../ui/text/text.js";
|
11
|
-
import {
|
10
|
+
import { getTheme as X } from "../../../../ui/theme/get-theme.js";
|
12
11
|
import { CIRCLE_ONBOARDING_ANALYTICS_STEPS as W } from "../../../enum/circle-onboarding-steps.js";
|
13
|
-
import { useCircleSounds as
|
14
|
-
import { INFINITE_MODE_TEXT as
|
15
|
-
import
|
16
|
-
import { TABLE_CARD_INDEX as l, GO_TO_TABLE_LAUNCHER_DURATION_MS as
|
17
|
-
import { Indicator as
|
18
|
-
const
|
12
|
+
import { useCircleSounds as $ } from "../../../hooks/use-circle-sounds/use-circle-sounds.js";
|
13
|
+
import { INFINITE_MODE_TEXT as v } from "../../comps/tables-card/constants.js";
|
14
|
+
import V from "../../comps/tables-card/infinite-button/infinite-mode-launcher-button.js";
|
15
|
+
import { TABLE_CARD_INDEX as l, GO_TO_TABLE_LAUNCHER_DURATION_MS as j, SHOW_CLICK_TABLE_NUDGE_AFTER_MS as k, LESSON_CARD_INDEX as K, SHOW_INITIAL_COACHMARK_AFTER_MS as q, SHOW_INITIAL_TOOLTIP_AFTER_MS as z } from "./constants.js";
|
16
|
+
import { Indicator as Q } from "./use-table-infinite-launcher-journey-styled.js";
|
17
|
+
const Z = {
|
19
18
|
top: 6,
|
20
19
|
left: 8,
|
21
20
|
cursor: "pointer"
|
22
|
-
},
|
21
|
+
}, lt = ({
|
23
22
|
carouselRefs: n,
|
24
23
|
originalTableRef: t,
|
25
24
|
onTableInfiniteModeClick: O,
|
26
25
|
onJourneyComplete: N
|
27
26
|
}) => {
|
28
|
-
const e =
|
27
|
+
const e = G.CIRCLE_TABLES_INFINTE_JOURNEY, { device: F } = X(), I = F === "mobile" ? "ab3-bold" : "ab2-bold", _ = Y([]), { playButtonSound: C } = $(), { nextCoachmark: c, setJourney: T, addCoachmark: h, endJourney: A } = J(), { onEvent: d } = b(), L = E(() => {
|
29
28
|
var r;
|
30
|
-
A(e), O(), d(
|
29
|
+
A(e), O(), d(M.ONBOARDING_STEP_COMPLETED, {
|
31
30
|
step: W.INFINITE_MODE
|
32
31
|
}), (r = t == null ? void 0 : t.current) == null || r.stopLabelAnimation(), N(e);
|
33
32
|
}, [
|
@@ -39,30 +38,30 @@ const tt = {
|
|
39
38
|
d
|
40
39
|
]), s = E(
|
41
40
|
(r, u) => {
|
42
|
-
c(e, !1, r), d(
|
41
|
+
c(e, !1, r), d(M.ONBOARDING_STEP_VIEWED, {
|
43
42
|
step: W.INFINITE_MODE
|
44
43
|
});
|
45
44
|
const i = setTimeout(() => {
|
46
45
|
var m;
|
47
|
-
clearTimeout(i), (m = t.current) == null || m.startLabelAnimation("YELLOW_4"), t.current && t.current.labelRef.current && (t.current.labelRef.current.innerText =
|
46
|
+
clearTimeout(i), (m = t.current) == null || m.startLabelAnimation("YELLOW_4"), t.current && t.current.labelRef.current && (t.current.labelRef.current.innerText = v), c(e, !0);
|
48
47
|
}, u);
|
49
48
|
_.current.push(i);
|
50
49
|
},
|
51
50
|
[e, c, t, d]
|
52
51
|
), a = E(() => {
|
53
52
|
var r;
|
54
|
-
C(), (r = n.current) == null || r.goToIndex(l), s(
|
53
|
+
C(), (r = n.current) == null || r.goToIndex(l), s(j, k);
|
55
54
|
}, [n, C, s]), U = E(() => {
|
56
|
-
var
|
57
|
-
const r = (
|
55
|
+
var g, f, D, S, y, H, x;
|
56
|
+
const r = (g = n.current) == null ? void 0 : g.indicatorRefs, u = (f = n.current) == null ? void 0 : f.nextBtnRef, i = r == null ? void 0 : r[l];
|
58
57
|
if (!((D = t.current) != null && D.segmentedCardWrapperRef.current) || !((S = t.current) != null && S.labelRef.current) || !r || !(u != null && u.current) || !i || !i.current)
|
59
58
|
return;
|
60
59
|
const m = (y = t.current) == null ? void 0 : y.segmentedCardWrapperRef.current.getBoundingClientRect();
|
61
|
-
((
|
60
|
+
((H = n.current) == null ? void 0 : H.currentIndex) === l ? (T(e, []), s(0, k)) : (T(e, [
|
62
61
|
{
|
63
62
|
originalElementToHighlightRef: i,
|
64
63
|
type: p.TOOLTIP,
|
65
|
-
elementToHighlight: /* @__PURE__ */ o(
|
64
|
+
elementToHighlight: /* @__PURE__ */ o(Q, { $isActive: !1 }),
|
66
65
|
indicator: {
|
67
66
|
position: "bottom",
|
68
67
|
backgroundColor: "YELLOW_4",
|
@@ -72,7 +71,7 @@ const tt = {
|
|
72
71
|
{
|
73
72
|
$position: "absolute",
|
74
73
|
$flexDirection: "row",
|
75
|
-
style:
|
74
|
+
style: Z,
|
76
75
|
onClick: a,
|
77
76
|
children: /* @__PURE__ */ o(R, { $renderAs: I, children: "NEW" })
|
78
77
|
}
|
@@ -89,12 +88,12 @@ const tt = {
|
|
89
88
|
content: "",
|
90
89
|
nudgePointerY: 20
|
91
90
|
},
|
92
|
-
elementToHighlight: /* @__PURE__ */ o(
|
91
|
+
elementToHighlight: /* @__PURE__ */ o(B, {})
|
93
92
|
}
|
94
|
-
]), (
|
93
|
+
]), (x = n.current) == null || x.goToIndex(K), c(e, !1, q), c(e, !0, z)), h(e, {
|
95
94
|
originalElementToHighlightRef: t.current.segmentedCardWrapperRef,
|
96
95
|
type: p.TOOLTIP,
|
97
|
-
elementToHighlight: /* @__PURE__ */ o(
|
96
|
+
elementToHighlight: /* @__PURE__ */ o(B, {}),
|
98
97
|
indicator: {
|
99
98
|
position: "top",
|
100
99
|
backgroundColor: "YELLOW_4",
|
@@ -111,7 +110,7 @@ const tt = {
|
|
111
110
|
nudgePointerX: 0,
|
112
111
|
nudgePointerY: 10
|
113
112
|
},
|
114
|
-
elementToHighlight: /* @__PURE__ */ o(
|
113
|
+
elementToHighlight: /* @__PURE__ */ o(V, { onClick: L })
|
115
114
|
});
|
116
115
|
}, [
|
117
116
|
h,
|
@@ -132,6 +131,6 @@ const tt = {
|
|
132
131
|
};
|
133
132
|
};
|
134
133
|
export {
|
135
|
-
|
134
|
+
lt as useTableInfiniteLauncherJourney
|
136
135
|
};
|
137
136
|
//# sourceMappingURL=use-table-infinite-launcher-journey.js.map
|