@cuemath/leap 2.8.41 → 2.8.43-rj-0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (36) hide show
  1. package/dist/assets/line-icons/icons/carat-left.js +26 -0
  2. package/dist/assets/line-icons/icons/carat-left.js.map +1 -0
  3. package/dist/assets/line-icons/icons/carat-right.js +26 -0
  4. package/dist/assets/line-icons/icons/carat-right.js.map +1 -0
  5. package/dist/features/circle-games/enum/circle-onboarding-steps.js +1 -1
  6. package/dist/features/circle-games/enum/circle-onboarding-steps.js.map +1 -1
  7. package/dist/features/circle-games/game-launcher/comps/card-container/card-container.js +20 -11
  8. package/dist/features/circle-games/game-launcher/comps/card-container/card-container.js.map +1 -1
  9. package/dist/features/circle-games/game-launcher/comps/carousel/carousel.js +53 -47
  10. package/dist/features/circle-games/game-launcher/comps/carousel/carousel.js.map +1 -1
  11. package/dist/features/circle-games/game-launcher/comps/tables-card/tables-card.js +159 -130
  12. package/dist/features/circle-games/game-launcher/comps/tables-card/tables-card.js.map +1 -1
  13. package/dist/features/circle-games/game-launcher/dal/use-get-circle-home-details-dal/use-get-circle-home-details-dal.js +20 -16
  14. package/dist/features/circle-games/game-launcher/dal/use-get-circle-home-details-dal/use-get-circle-home-details-dal.js.map +1 -1
  15. package/dist/features/circle-games/game-launcher/game-launcher.js +95 -68
  16. package/dist/features/circle-games/game-launcher/game-launcher.js.map +1 -1
  17. package/dist/features/circle-games/game-launcher/hooks/use-game-launcher-journey/constants.js +9 -0
  18. package/dist/features/circle-games/game-launcher/hooks/use-game-launcher-journey/constants.js.map +1 -0
  19. package/dist/features/circle-games/game-launcher/hooks/use-game-launcher-journey/use-game-launcher-journey.js +217 -0
  20. package/dist/features/circle-games/game-launcher/hooks/use-game-launcher-journey/use-game-launcher-journey.js.map +1 -0
  21. package/dist/features/circle-games/game-launcher/hooks/use-table-launcher-journey/constants.js +13 -0
  22. package/dist/features/circle-games/game-launcher/hooks/use-table-launcher-journey/constants.js.map +1 -0
  23. package/dist/features/circle-games/game-launcher/hooks/use-table-launcher-journey/use-table-launcher-journey-styled.js +13 -0
  24. package/dist/features/circle-games/game-launcher/hooks/use-table-launcher-journey/use-table-launcher-journey-styled.js.map +1 -0
  25. package/dist/features/circle-games/game-launcher/hooks/use-table-launcher-journey/use-table-launcher-journey.js +205 -0
  26. package/dist/features/circle-games/game-launcher/hooks/use-table-launcher-journey/use-table-launcher-journey.js.map +1 -0
  27. package/dist/features/journey/journey-id/journey-id-student.js +1 -1
  28. package/dist/features/journey/journey-id/journey-id-student.js.map +1 -1
  29. package/dist/features/journey/use-journey/journey-context-provider.js +10 -8
  30. package/dist/features/journey/use-journey/journey-context-provider.js.map +1 -1
  31. package/dist/index.d.ts +9 -4
  32. package/package.json +1 -1
  33. package/dist/features/circle-games/game-launcher/use-game-launcher-journey/constants.js +0 -7
  34. package/dist/features/circle-games/game-launcher/use-game-launcher-journey/constants.js.map +0 -1
  35. package/dist/features/circle-games/game-launcher/use-game-launcher-journey/use-game-launcher-journey.js +0 -213
  36. package/dist/features/circle-games/game-launcher/use-game-launcher-journey/use-game-launcher-journey.js.map +0 -1
@@ -0,0 +1,205 @@
1
+ import { jsx as r, Fragment as L } from "react/jsx-runtime";
2
+ import { useRef as I, useCallback as p } from "react";
3
+ import F from "../../../../../assets/line-icons/icons/carat-right.js";
4
+ import { PLATFORM_EVENTS_STUDENT as B } from "../../../../analytics-events/platform-events-student.js";
5
+ import { JOURNEY_ID_STUDENT as V } from "../../../../journey/journey-id/journey-id-student.js";
6
+ import { IndicatorType as d } from "../../../../journey/use-journey/constants.js";
7
+ import { useJourney as J } from "../../../../journey/use-journey/use-journey.js";
8
+ import X from "../../../../ui/buttons/icon-button/icon-button.js";
9
+ import { useUIContext as K } from "../../../../ui/context/context.js";
10
+ import b from "../../../../ui/layout/flex-view.js";
11
+ import m from "../../../../ui/text/text.js";
12
+ import { CIRCLE_ONBOARDING_ANALYTICS_STEPS as U } from "../../../enum/circle-onboarding-steps.js";
13
+ import { useCircleSounds as j } from "../../../hooks/use-circle-sounds/use-circle-sounds.js";
14
+ import { TablesCard as G } 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 z, START_ANIMATING_CLONED_ELEM as v, TABLE_CARD_INDEX as M, GO_TO_TABLE_LAUNCHER_DURATION_MS as Q, SHOW_CLICK_TABLE_NUDGE_AFTER_MS as ee, PUZZLE_CARD_INDEX as te, SHOW_INITIAL_COACHMARK_AFTER_MS as $, SHOW_INITIAL_TOOLTIP_AFTER_MS as re } from "./constants.js";
17
+ import { Indicator as ne } from "./use-table-launcher-journey-styled.js";
18
+ const Ce = ({
19
+ carouselRefs: s,
20
+ onTableSegmentClick: O,
21
+ onJourneyComplete: R
22
+ }) => {
23
+ const e = V.CIRCLE_TABLES_INTRO_JOURNEY, t = I(null), f = I(null), N = I(!1), { playButtonSound: P } = j(), { nextCoachmark: n, setJourney: S, addCoachmark: a } = J(), { onEvent: _ } = K(), A = p(
24
+ (l) => {
25
+ var c, i;
26
+ l && O(l), _(B.ONBOARDING_STEP_COMPLETED, {
27
+ step: U.TABLES
28
+ }), (c = t == null ? void 0 : t.current) == null || c.setLabelVisiblity(!0), (i = t == null ? void 0 : t.current) == null || i.stopLabelAnimation(), R(e), n(e, !1);
29
+ },
30
+ [e, n, R, O, _]
31
+ ), H = p(
32
+ (l, c) => {
33
+ var g, T, E;
34
+ if (!((g = t.current) != null && g.segmentedCardWrapperRef.current) || !((T = t.current) != null && T.labelRef.current))
35
+ return;
36
+ const i = t.current.labelRef.current.getBoundingClientRect(), o = (E = t.current) == null ? void 0 : E.segmentedCardWrapperRef.current.getBoundingClientRect();
37
+ a(e, {
38
+ originalElementToHighlightRef: t.current.segmentedCardWrapperRef,
39
+ isActive: !1,
40
+ type: d.TOOLTIP,
41
+ elementToHighlight: /* @__PURE__ */ r(
42
+ G,
43
+ {
44
+ ref: f,
45
+ defaultTable: c,
46
+ label: l.label,
47
+ data: l.data,
48
+ onPress: A,
49
+ onGoBackFromTableLevel: A
50
+ }
51
+ ),
52
+ indicator: {
53
+ position: "left",
54
+ backgroundColor: "YELLOW_4",
55
+ width: 236,
56
+ tooltipItem: /* @__PURE__ */ r(b, { children: /* @__PURE__ */ r(m, { $renderAs: "ab2-bold", children: "Each table has 3 levels—clear them and earn 3 stars!" }) }),
57
+ tooltipXCoOrdinates: 0,
58
+ tooltipYCoOrdinates: i.height * 0.35
59
+ }
60
+ }), a(e, {
61
+ originalElementToHighlightRef: t.current.segmentedCardWrapperRef,
62
+ isActive: !1,
63
+ type: d.NUDGE,
64
+ indicator: {
65
+ nudge: "click",
66
+ content: /* @__PURE__ */ r(m, { $renderAs: "ab1", $color: "WHITE", children: "Pick a level" }),
67
+ nudgePointerX: o.width / 2 + 50,
68
+ nudgePointerY: o.height * 0.4
69
+ },
70
+ elementToHighlight: /* @__PURE__ */ r(L, {})
71
+ }), n(e, !1, q), n(e, !0, z);
72
+ const u = setTimeout(() => {
73
+ var h;
74
+ clearTimeout(u), (h = f.current) == null || h.startLabelAnimation("YELLOW_4");
75
+ }, v);
76
+ },
77
+ [a, A, e, n]
78
+ ), C = p(() => {
79
+ var i;
80
+ P(), (i = s.current) == null || i.goToIndex(M), n(e, !1, Q), _(B.ONBOARDING_STEP_VIEWED, {
81
+ step: U.TABLES
82
+ });
83
+ const l = setTimeout(() => {
84
+ var o;
85
+ clearTimeout(l), (o = t.current) == null || o.setLabelVisiblity(!1), n(e, !0);
86
+ }, ee), c = setTimeout(() => {
87
+ var o;
88
+ clearTimeout(c), (o = f.current) == null || o.startLabelAnimation("YELLOW_4");
89
+ }, v);
90
+ }, [s, e, n, P, _]), x = p(
91
+ (l, c = !1) => {
92
+ var E, h, y, W, D, Y, k;
93
+ if (N.current)
94
+ return;
95
+ const i = (E = s.current) == null ? void 0 : E.indicatorRefs, o = (h = s.current) == null ? void 0 : h.nextBtnRef, u = i == null ? void 0 : i[M];
96
+ if (!((y = t.current) != null && y.segmentedCardWrapperRef.current) || !((W = t.current) != null && W.labelRef.current) || !i || !(o != null && o.current) || !u || !u.current)
97
+ return;
98
+ N.current = !0;
99
+ const g = t.current.labelRef.current.getBoundingClientRect(), T = (D = t.current) == null ? void 0 : D.segmentedCardWrapperRef.current.getBoundingClientRect();
100
+ S(e, []), c ? (a(e, {
101
+ originalElementToHighlightRef: u,
102
+ isActive: !1,
103
+ type: d.TOOLTIP,
104
+ elementToHighlight: /* @__PURE__ */ r(ne, { $isActive: !1 }),
105
+ indicator: {
106
+ position: "bottom",
107
+ backgroundColor: "YELLOW_4",
108
+ width: 52,
109
+ tooltipItem: /* @__PURE__ */ r(
110
+ b,
111
+ {
112
+ $position: "absolute",
113
+ $flexDirection: "row",
114
+ style: { top: 6, left: 8, cursor: "pointer" },
115
+ onClick: C,
116
+ children: /* @__PURE__ */ r(m, { $renderAs: "ab2-bold", children: "NEW" })
117
+ }
118
+ ),
119
+ tooltipYCoOrdinates: 14
120
+ // Need some offset in Y direction from top
121
+ }
122
+ }), a(e, {
123
+ originalElementToHighlightRef: u,
124
+ isActive: !1,
125
+ type: d.NUDGE,
126
+ indicator: {
127
+ nudge: "click",
128
+ content: "",
129
+ nudgePointerY: 20
130
+ },
131
+ elementToHighlight: /* @__PURE__ */ r(L, {})
132
+ }), n(e, !1, $), n(e, !0, re)) : (a(e, {
133
+ originalElementToHighlightRef: (Y = s.current) == null ? void 0 : Y.nextBtnRef,
134
+ isActive: !1,
135
+ type: d.NUDGE,
136
+ indicator: {
137
+ nudge: "click",
138
+ content: /* @__PURE__ */ r(m, { $renderAs: "ab1", $color: "WHITE", children: "Click to proceed" }),
139
+ nudgePointerX: 0,
140
+ nudgePointerY: 0
141
+ },
142
+ elementToHighlight: /* @__PURE__ */ r(
143
+ X,
144
+ {
145
+ renderAs: "secondary",
146
+ Icon: F,
147
+ onClick: C,
148
+ analyticsLabel: Z.JOURNEY_NEXT_ACTIVITY
149
+ }
150
+ )
151
+ }), (k = s.current) == null || k.goToIndex(te), n(e, !1, $)), a(e, {
152
+ originalElementToHighlightRef: t.current.labelRef,
153
+ isActive: !1,
154
+ type: d.TOOLTIP,
155
+ elementToHighlight: /* @__PURE__ */ r(L, {}),
156
+ indicator: {
157
+ position: "right",
158
+ backgroundColor: "YELLOW_4",
159
+ width: 264,
160
+ tooltipItem: /* @__PURE__ */ r(b, { children: /* @__PURE__ */ r(m, { $renderAs: "ab2-bold", children: "Get faster at multiplication! Practice everyday and become a Tables champ." }) }),
161
+ tooltipXCoOrdinates: g.width + 50,
162
+ tooltipYCoOrdinates: g.height / 2
163
+ }
164
+ }), a(e, {
165
+ originalElementToHighlightRef: t.current.segmentedCardWrapperRef,
166
+ isActive: !1,
167
+ type: d.NUDGE,
168
+ indicator: {
169
+ nudge: "click",
170
+ content: /* @__PURE__ */ r(m, { $renderAs: "ab1", $color: "WHITE", children: "Pick a table to start" }),
171
+ nudgePointerX: T.width / 2 + 50,
172
+ nudgePointerY: T.height / 2
173
+ },
174
+ elementToHighlight: /* @__PURE__ */ r(
175
+ G,
176
+ {
177
+ ref: f,
178
+ label: l.label,
179
+ data: l.data,
180
+ onPress: () => {
181
+ },
182
+ onPressTableSegment: (w) => H(l, w)
183
+ }
184
+ )
185
+ });
186
+ },
187
+ [
188
+ a,
189
+ s,
190
+ C,
191
+ H,
192
+ e,
193
+ n,
194
+ S
195
+ ]
196
+ );
197
+ return {
198
+ tableRef: t,
199
+ startJourney: x
200
+ };
201
+ };
202
+ export {
203
+ Ce as useTableLauncherJourney
204
+ };
205
+ //# sourceMappingURL=use-table-launcher-journey.js.map
@@ -0,0 +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, 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 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 onJourneyComplete,\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 const isJourneyInProgress = useRef(false);\n\n const { playButtonSound } = useCircleSounds();\n const { nextCoachmark, setJourney, addCoachmark } = useJourney();\n const { onEvent: trackAnalytics } = useUIContext();\n\n const endJourney = 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 onJourneyComplete(journeyId);\n nextCoachmark(journeyId, false);\n },\n [journeyId, nextCoachmark, onJourneyComplete, 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={endJourney}\n onGoBackFromTableLevel={endJourney}\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 [addCoachmark, endJourney, 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 const animateLabel = setTimeout(() => {\n clearTimeout(animateLabel);\n highlightedTableRef.current?.startLabelAnimation('YELLOW_4');\n }, START_ANIMATING_CLONED_ELEM);\n }, [carouselRefs, journeyId, nextCoachmark, playButtonSound, trackAnalytics]);\n\n const startJourney = useCallback(\n (tablesData: ITables, isTutorialOnboardingDone: boolean = false) => {\n if (isJourneyInProgress.current) {\n return;\n }\n\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 isJourneyInProgress.current = true;\n\n const labelDims = originalTableRef.current.labelRef.current.getBoundingClientRect();\n const tableCardDims =\n originalTableRef.current?.segmentedCardWrapperRef.current.getBoundingClientRect();\n\n setJourney(journeyId, []);\n\n // TAKE THE USER TO THE TABLE CARD\n if (!isTutorialOnboardingDone) {\n addCoachmark(journeyId, {\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 carouselRefs.current?.goToIndex(PUZZLE_CARD_INDEX);\n nextCoachmark(journeyId, false, SHOW_INITIAL_COACHMARK_AFTER_MS); // Show nudge => Click to proceed\n } else {\n addCoachmark(journeyId, {\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 addCoachmark(journeyId, {\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 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 return {\n tableRef: originalTableRef,\n startJourney,\n };\n};\n"],"names":["useTableLauncherJourney","carouselRefs","onTableSegmentClick","onJourneyComplete","journeyId","JOURNEY_ID_STUDENT","originalTableRef","useRef","highlightedTableRef","isJourneyInProgress","playButtonSound","useCircleSounds","nextCoachmark","setJourney","addCoachmark","useJourney","trackAnalytics","useUIContext","endJourney","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","SHOW_INITIAL_COACHMARK_AFTER_MS","SHOW_INITIAL_TOOLTIP_AFTER_MS","_f","IconButton","CaratRightIcon","GAME_LAUNCHER_ANALYTICS_EVENTS","_g","PUZZLE_CARD_INDEX","tableInfo"],"mappings":";;;;;;;;;;;;;;;;;AAwCO,MAAMA,KAA0B,CAAC;AAAA,EACtC,cAAAC;AAAA,EACA,qBAAAC;AAAA,EACA,mBAAAC;AACF,MAA6B;AAC3B,QAAMC,IAAYC,EAAmB,6BAC/BC,IAAmBC,EAAsB,IAAI,GAC7CC,IAAsBD,EAAsB,IAAI,GAChDE,IAAsBF,EAAO,EAAK,GAElC,EAAE,iBAAAG,MAAoBC,KACtB,EAAE,eAAAC,GAAe,YAAAC,GAAY,cAAAC,MAAiBC,EAAW,GACzD,EAAE,SAASC,EAAe,IAAIC,EAAa,GAE3CC,IAAaC;AAAA,IAC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;AAAA,QACtB,+BAA+BE,EAAiB,QAAQ;AAAA,QACxD,UAAU;AAAA,QACV,MAAMyB,EAAc;AAAA,QACpB,WAAW;AAAA,UACT,OAAO;AAAA,UACP,SACG,gBAAAC,EAAAG,GAAA,EAAK,WAAU,OAAM,QAAO,SAC1B,UACH,yBAAA;AAAA,UAEF,eAAeN,EAAc,QAAQ,IAAI;AAAA,UACzC,eAAeA,EAAc,SAAS;AAAA,QACxC;AAAA,QACA,oBACE,gBAAAG;AAAA,UAACC;AAAA,UAAA;AAAA,YACC,KAAKzB;AAAA,YACL,OAAOwC,EAAW;AAAA,YAClB,MAAMA,EAAW;AAAA,YACjB,SAAS,MAAM;AAAA,YAAC;AAAA,YAChB,qBAAqB,CAAAiB,MAAaxC,EAAwBuB,GAAYiB,CAAS;AAAA,UAAA;AAAA,QACjF;AAAA,MAAA,CAEH;AAAA,IACH;AAAA,IACA;AAAA,MACEnD;AAAA,MACAb;AAAA,MACAwC;AAAA,MACAhB;AAAA,MACArB;AAAA,MACAQ;AAAA,MACAC;AAAA,IACF;AAAA,EAAA;AAGK,SAAA;AAAA,IACL,UAAUP;AAAA,IACV,cAAAyC;AAAA,EAAA;AAEJ;"}
@@ -1,4 +1,4 @@
1
- var E = /* @__PURE__ */ ((R) => (R.CIRCLE_ACTIVITIES_INTRO_JOURNEY = "CIRCLE_ACTIVITIES_INTRO_JOURNEY", R.CIRCLE_LEADERBOARD_INTRO_JOURNEY = "CIRCLE_LEADERBOARD_INTRO_JOURNEY", R.CIRCLE_POINTS_REWARD_JOURNEY = "CIRCLE_POINTS_REWARD_JOURNEY", R.CIRCLE_STREAK_UPDATE_JOURNEY = "CIRCLE_STREAK_UPDATE_JOURNEY", R.CIRCLE_TUTORIAL_JOURNEY = "CIRCLE_TUTORIAL_JOURNEY", R))(E || {});
1
+ var E = /* @__PURE__ */ ((R) => (R.CIRCLE_ACTIVITIES_INTRO_JOURNEY = "CIRCLE_ACTIVITIES_INTRO_JOURNEY", R.CIRCLE_LEADERBOARD_INTRO_JOURNEY = "CIRCLE_LEADERBOARD_INTRO_JOURNEY", R.CIRCLE_POINTS_REWARD_JOURNEY = "CIRCLE_POINTS_REWARD_JOURNEY", R.CIRCLE_STREAK_UPDATE_JOURNEY = "CIRCLE_STREAK_UPDATE_JOURNEY", R.CIRCLE_TUTORIAL_JOURNEY = "CIRCLE_TUTORIAL_JOURNEY", R.CIRCLE_TABLES_INTRO_JOURNEY = "CIRCLE_TABLES_INTRO_JOURNEY", R))(E || {});
2
2
  export {
3
3
  E as JOURNEY_ID_STUDENT
4
4
  };
@@ -1 +1 @@
1
- {"version":3,"file":"journey-id-student.js","sources":["../../../../src/features/journey/journey-id/journey-id-student.ts"],"sourcesContent":["export enum JOURNEY_ID_STUDENT {\n CIRCLE_ACTIVITIES_INTRO_JOURNEY = 'CIRCLE_ACTIVITIES_INTRO_JOURNEY',\n CIRCLE_LEADERBOARD_INTRO_JOURNEY = 'CIRCLE_LEADERBOARD_INTRO_JOURNEY',\n CIRCLE_POINTS_REWARD_JOURNEY = 'CIRCLE_POINTS_REWARD_JOURNEY',\n CIRCLE_STREAK_UPDATE_JOURNEY = 'CIRCLE_STREAK_UPDATE_JOURNEY',\n CIRCLE_TUTORIAL_JOURNEY = 'CIRCLE_TUTORIAL_JOURNEY',\n}\n"],"names":["JOURNEY_ID_STUDENT"],"mappings":"AAAY,IAAAA,sBAAAA,OACVA,EAAA,kCAAkC,mCAClCA,EAAA,mCAAmC,oCACnCA,EAAA,+BAA+B,gCAC/BA,EAAA,+BAA+B,gCAC/BA,EAAA,0BAA0B,2BALhBA,IAAAA,KAAA,CAAA,CAAA;"}
1
+ {"version":3,"file":"journey-id-student.js","sources":["../../../../src/features/journey/journey-id/journey-id-student.ts"],"sourcesContent":["export enum JOURNEY_ID_STUDENT {\n CIRCLE_ACTIVITIES_INTRO_JOURNEY = 'CIRCLE_ACTIVITIES_INTRO_JOURNEY',\n CIRCLE_LEADERBOARD_INTRO_JOURNEY = 'CIRCLE_LEADERBOARD_INTRO_JOURNEY',\n CIRCLE_POINTS_REWARD_JOURNEY = 'CIRCLE_POINTS_REWARD_JOURNEY',\n CIRCLE_STREAK_UPDATE_JOURNEY = 'CIRCLE_STREAK_UPDATE_JOURNEY',\n CIRCLE_TUTORIAL_JOURNEY = 'CIRCLE_TUTORIAL_JOURNEY',\n CIRCLE_TABLES_INTRO_JOURNEY = 'CIRCLE_TABLES_INTRO_JOURNEY',\n}\n"],"names":["JOURNEY_ID_STUDENT"],"mappings":"AAAY,IAAAA,sBAAAA,OACVA,EAAA,kCAAkC,mCAClCA,EAAA,mCAAmC,oCACnCA,EAAA,+BAA+B,gCAC/BA,EAAA,+BAA+B,gCAC/BA,EAAA,0BAA0B,2BAC1BA,EAAA,8BAA8B,+BANpBA,IAAAA,KAAA,CAAA,CAAA;"}
@@ -2,7 +2,7 @@ import { jsxs as v, jsx as J } from "react/jsx-runtime";
2
2
  import { createContext as x, useState as $, useRef as f, useCallback as i, useMemo as p } from "react";
3
3
  import { Coachmark as g } from "../comps/coachmark/coachmark.js";
4
4
  import { BlurOverlay as A } from "./journey-styled.js";
5
- const R = x(null), j = ({ children: C }) => {
5
+ const E = x(null), j = ({ children: C }) => {
6
6
  const [o, u] = $([]), c = f(-1), r = f(), l = i(
7
7
  (e, t) => {
8
8
  if (o.length > 0)
@@ -22,13 +22,15 @@ const R = x(null), j = ({ children: C }) => {
22
22
  u((s) => [...s, t]);
23
23
  }, []), d = i(
24
24
  (e, t = !1, s = 0) => {
25
- if (!r.current || e !== r.current)
25
+ if (!r.current)
26
+ throw new Error("nextCoachmark was called before setJourney");
27
+ if (e !== r.current)
26
28
  throw new Error(
27
- r.current ? "nextCoachmark was called before setJourney" : `A Journey is already active, Current Journey: ${r.current}, New Journey Request: ${e}`
29
+ `A Journey is already active, Current Journey: ${r.current}, New Journey Request: ${e}`
28
30
  );
29
31
  s !== 0 && u((n) => n.map((a) => ({ ...a, isActive: !1 })));
30
- const w = setTimeout(() => {
31
- clearTimeout(w);
32
+ const k = setTimeout(() => {
33
+ clearTimeout(k);
32
34
  const n = c.current + 1;
33
35
  u((a) => {
34
36
  if (n >= a.length || a.length === 0)
@@ -40,7 +42,7 @@ const R = x(null), j = ({ children: C }) => {
40
42
  }, s);
41
43
  },
42
44
  []
43
- ), k = p(
45
+ ), w = p(
44
46
  () => ({
45
47
  nextCoachmark: d,
46
48
  setJourney: l,
@@ -50,13 +52,13 @@ const R = x(null), j = ({ children: C }) => {
50
52
  }),
51
53
  [d, l, y, h, o]
52
54
  );
53
- return /* @__PURE__ */ v(R.Provider, { value: k, children: [
55
+ return /* @__PURE__ */ v(E.Provider, { value: w, children: [
54
56
  o.length > 0 && /* @__PURE__ */ J(A, { children: o.map((e, t) => /* @__PURE__ */ J(g, { coachmark: e }, `coachmark-${t}`)) }),
55
57
  C
56
58
  ] });
57
59
  };
58
60
  export {
59
- R as JourneyContext,
61
+ E as JourneyContext,
60
62
  j as JourneyProvider
61
63
  };
62
64
  //# sourceMappingURL=journey-context-provider.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"journey-context-provider.js","sources":["../../../../src/features/journey/use-journey/journey-context-provider.tsx"],"sourcesContent":["import type { TJourneyId } from '../journey-id/journey-id-types';\nimport type { ICoachmarkProps, IJourneyContext } from './journey-context-types';\nimport type { FC, ReactNode } from 'react';\n\nimport { createContext, useCallback, useMemo, useRef, useState } from 'react';\n\nimport { Coachmark } from '../comps/coachmark/coachmark';\nimport * as S from './journey-styled';\n\nexport const JourneyContext = createContext<IJourneyContext | null>(null);\n\nexport const JourneyProvider: FC<{ children: ReactNode }> = ({ children }) => {\n const [coachmarkList, setCoachmarkList] = useState<ICoachmarkProps[]>([]);\n const currentIndex = useRef(-1);\n const currentJourneyIdStudent = useRef<TJourneyId | undefined>();\n\n const setJourney = useCallback(\n (id: TJourneyId, coachmarks: ICoachmarkProps[]) => {\n if (coachmarkList.length > 0) {\n throw new Error(\n `setJourney: Other Journey is already active, Current Journey: ${currentJourneyIdStudent.current}, New Journey Request: ${id}`,\n );\n }\n currentJourneyIdStudent.current = id;\n currentIndex.current = -1;\n setCoachmarkList([...coachmarks]);\n },\n [coachmarkList.length],\n );\n\n const clearJourney = useCallback(() => {\n currentJourneyIdStudent.current = undefined;\n currentIndex.current = -1;\n setCoachmarkList([]);\n }, []);\n\n const addCoachmark = useCallback((id: TJourneyId, coachmark: ICoachmarkProps) => {\n if (!currentJourneyIdStudent.current || id !== currentJourneyIdStudent.current) {\n throw new Error(\n currentJourneyIdStudent.current\n ? `addCoachmark was called before setJourney`\n : `A Journey is already active, Current Journey: ${currentJourneyIdStudent.current}, New Journey Request: ${id}`,\n );\n }\n\n setCoachmarkList(prev => [...prev, coachmark]);\n }, []);\n\n const nextCoachmark = useCallback(\n (id: TJourneyId, keepPrevActive: boolean = false, delayInMs: number = 0) => {\n if (!currentJourneyIdStudent.current || id !== currentJourneyIdStudent.current) {\n throw new Error(\n currentJourneyIdStudent.current\n ? `nextCoachmark was called before setJourney`\n : `A Journey is already active, Current Journey: ${currentJourneyIdStudent.current}, New Journey Request: ${id}`,\n );\n }\n\n if (delayInMs !== 0) {\n // If delay is not 0, we will hide all them coachmarks and reveal only after the delay\n setCoachmarkList(prevList => {\n return prevList.map((item: ICoachmarkProps) => {\n return { ...item, isActive: false };\n });\n });\n }\n\n const timer = setTimeout(() => {\n clearTimeout(timer);\n const currIndex = currentIndex.current + 1;\n\n setCoachmarkList(prevList => {\n // Finish onboarding\n if (currIndex >= prevList.length || prevList.length === 0) {\n currentJourneyIdStudent.current = undefined;\n currentIndex.current = -1;\n\n return [];\n }\n\n currentIndex.current = currIndex;\n const updatedCoachmarkList = [...prevList];\n\n (updatedCoachmarkList[currIndex] as ICoachmarkProps).isActive = true;\n\n if (currIndex > 0) {\n (updatedCoachmarkList[currIndex - 1] as ICoachmarkProps).isActive = keepPrevActive;\n }\n\n return updatedCoachmarkList;\n });\n }, delayInMs);\n },\n [],\n );\n\n const memoizedContextValue = useMemo(\n () => ({\n nextCoachmark,\n setJourney,\n addCoachmark,\n clearJourney,\n coachmarks: coachmarkList,\n }),\n [nextCoachmark, setJourney, addCoachmark, clearJourney, coachmarkList],\n );\n\n return (\n <JourneyContext.Provider value={memoizedContextValue}>\n {coachmarkList.length > 0 && (\n <S.BlurOverlay>\n {coachmarkList.map((coachmark, index) => (\n <Coachmark key={`coachmark-${index}`} coachmark={coachmark} />\n ))}\n </S.BlurOverlay>\n )}\n {children}\n </JourneyContext.Provider>\n );\n};\n"],"names":["JourneyContext","createContext","JourneyProvider","children","coachmarkList","setCoachmarkList","useState","currentIndex","useRef","currentJourneyIdStudent","setJourney","useCallback","id","coachmarks","clearJourney","addCoachmark","coachmark","prev","nextCoachmark","keepPrevActive","delayInMs","prevList","item","timer","currIndex","updatedCoachmarkList","memoizedContextValue","useMemo","jsxs","jsx","S.BlurOverlay","index","Coachmark"],"mappings":";;;;AASa,MAAAA,IAAiBC,EAAsC,IAAI,GAE3DC,IAA+C,CAAC,EAAE,UAAAC,QAAe;AAC5E,QAAM,CAACC,GAAeC,CAAgB,IAAIC,EAA4B,CAAE,CAAA,GAClEC,IAAeC,EAAO,EAAE,GACxBC,IAA0BD,KAE1BE,IAAaC;AAAA,IACjB,CAACC,GAAgBC,MAAkC;AAC7C,UAAAT,EAAc,SAAS;AACzB,cAAM,IAAI;AAAA,UACR,iEAAiEK,EAAwB,OAAO,0BAA0BG,CAAE;AAAA,QAAA;AAGhI,MAAAH,EAAwB,UAAUG,GAClCL,EAAa,UAAU,IACNF,EAAA,CAAC,GAAGQ,CAAU,CAAC;AAAA,IAClC;AAAA,IACA,CAACT,EAAc,MAAM;AAAA,EAAA,GAGjBU,IAAeH,EAAY,MAAM;AACrC,IAAAF,EAAwB,UAAU,QAClCF,EAAa,UAAU,IACvBF,EAAiB,CAAE,CAAA;AAAA,EACrB,GAAG,CAAE,CAAA,GAECU,IAAeJ,EAAY,CAACC,GAAgBI,MAA+B;AAC/E,QAAI,CAACP,EAAwB,WAAWG,MAAOH,E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gBAAAwB,EAAA5B,EAAe,UAAf,EAAwB,OAAO0B,GAC7B,UAAA;AAAA,IAAAtB,EAAc,SAAS,KACtB,gBAAAyB,EAACC,GAAA,EACE,YAAc,IAAI,CAACd,GAAWe,wBAC5BC,GAAqC,EAAA,WAAAhB,EAAA,GAAtB,aAAae,CAAK,EAA0B,CAC7D,GACH;AAAA,IAED5B;AAAA,EACH,EAAA,CAAA;AAEJ;"}
1
+ {"version":3,"file":"journey-context-provider.js","sources":["../../../../src/features/journey/use-journey/journey-context-provider.tsx"],"sourcesContent":["import type { TJourneyId } from '../journey-id/journey-id-types';\nimport type { ICoachmarkProps, IJourneyContext } from './journey-context-types';\nimport type { FC, ReactNode } from 'react';\n\nimport { createContext, useCallback, useMemo, useRef, useState } from 'react';\n\nimport { Coachmark } from '../comps/coachmark/coachmark';\nimport * as S from './journey-styled';\n\nexport const JourneyContext = createContext<IJourneyContext | null>(null);\n\nexport const JourneyProvider: FC<{ children: ReactNode }> = ({ children }) => {\n const [coachmarkList, setCoachmarkList] = useState<ICoachmarkProps[]>([]);\n const currentIndex = useRef(-1);\n const currentJourneyIdStudent = useRef<TJourneyId | undefined>();\n\n const setJourney = useCallback(\n (id: TJourneyId, coachmarks: ICoachmarkProps[]) => {\n if (coachmarkList.length > 0) {\n throw new Error(\n `setJourney: Other Journey is already active, Current Journey: ${currentJourneyIdStudent.current}, New Journey Request: ${id}`,\n );\n }\n currentJourneyIdStudent.current = id;\n currentIndex.current = -1;\n setCoachmarkList([...coachmarks]);\n },\n [coachmarkList.length],\n );\n\n const clearJourney = useCallback(() => {\n currentJourneyIdStudent.current = undefined;\n currentIndex.current = -1;\n setCoachmarkList([]);\n }, []);\n\n const addCoachmark = useCallback((id: TJourneyId, coachmark: ICoachmarkProps) => {\n if (!currentJourneyIdStudent.current || id !== currentJourneyIdStudent.current) {\n throw new Error(\n currentJourneyIdStudent.current\n ? `addCoachmark was called before setJourney`\n : `A Journey is already active, Current Journey: ${currentJourneyIdStudent.current}, New Journey Request: ${id}`,\n );\n }\n\n setCoachmarkList(prev => [...prev, coachmark]);\n }, []);\n\n const nextCoachmark = useCallback(\n (id: TJourneyId, keepPrevActive: boolean = false, delayInMs: number = 0) => {\n if (!currentJourneyIdStudent.current) {\n throw new Error('nextCoachmark was called before setJourney');\n }\n\n if (id !== currentJourneyIdStudent.current) {\n throw new Error(\n `A Journey is already active, Current Journey: ${currentJourneyIdStudent.current}, New Journey Request: ${id}`,\n );\n }\n\n if (delayInMs !== 0) {\n // If delay is not 0, we will hide all them coachmarks and reveal only after the delay\n setCoachmarkList(prevList => {\n return prevList.map((item: ICoachmarkProps) => {\n return { ...item, isActive: false };\n });\n });\n }\n\n const timer = setTimeout(() => {\n clearTimeout(timer);\n const currIndex = currentIndex.current + 1;\n\n setCoachmarkList(prevList => {\n // Finish onboarding\n if (currIndex >= prevList.length || prevList.length === 0) {\n currentJourneyIdStudent.current = undefined;\n currentIndex.current = -1;\n\n return [];\n }\n\n currentIndex.current = currIndex;\n const updatedCoachmarkList = [...prevList];\n\n (updatedCoachmarkList[currIndex] as ICoachmarkProps).isActive = true;\n\n if (currIndex > 0) {\n (updatedCoachmarkList[currIndex - 1] as ICoachmarkProps).isActive = keepPrevActive;\n }\n\n return updatedCoachmarkList;\n });\n }, delayInMs);\n },\n [],\n );\n\n const memoizedContextValue = useMemo(\n () => ({\n nextCoachmark,\n setJourney,\n addCoachmark,\n clearJourney,\n coachmarks: coachmarkList,\n }),\n [nextCoachmark, setJourney, addCoachmark, clearJourney, coachmarkList],\n );\n\n return (\n <JourneyContext.Provider value={memoizedContextValue}>\n {coachmarkList.length > 0 && (\n <S.BlurOverlay>\n {coachmarkList.map((coachmark, index) => (\n <Coachmark key={`coachmark-${index}`} coachmark={coachmark} />\n ))}\n </S.BlurOverlay>\n )}\n {children}\n </JourneyContext.Provider>\n );\n};\n"],"names":["JourneyContext","createContext","JourneyProvider","children","coachmarkList","setCoachmarkList","useState","currentIndex","useRef","currentJourneyIdStudent","setJourney","useCallback","id","coachmarks","clearJourney","addCoachmark","coachmark","prev","nextCoachmark","keepPrevActive","delayInMs","prevList","item","timer","currIndex","updatedCoachmarkList","memoizedContextValue","useMemo","jsxs","jsx","S.BlurOverlay","index","Coachmark"],"mappings":";;;;AASa,MAAAA,IAAiBC,EAAsC,IAAI,GAE3DC,IAA+C,CAAC,EAAE,UAAAC,QAAe;AAC5E,QAAM,CAACC,GAAeC,CAAgB,IAAIC,EAA4B,CAAE,CAAA,GAClEC,IAAeC,EAAO,EAAE,GACxBC,IAA0BD,KAE1BE,IAAaC;AAAA,IACjB,CAACC,GAAgBC,MAAkC;AAC7C,UAAAT,EAAc,SAAS;AACzB,cAAM,IAAI;AAAA,UACR,iEAAiEK,EAAwB,OAAO,0BAA0BG,CAAE;AAAA,QAAA;AAGhI,MAAAH,EAAwB,UAAUG,GAClCL,EAAa,UAAU,IACNF,EAAA,CAAC,GAAGQ,CAAU,CAAC;AAAA,IAClC;AAAA,IACA,CAACT,EAAc,MAAM;AAAA,EAAA,GAGjBU,IAAeH,EAAY,MAAM;AACrC,IAAAF,EAAwB,UAAU,QAClCF,EAAa,UAAU,IACvBF,EAAiB,CAAE,CAAA;AAAA,EACrB,GAAG,CAAE,CAAA,GAECU,IAAeJ,EAAY,CAACC,GAAgBI,MAA+B;AAC/E,QAAI,CAACP,EAAwB,WAAWG,MAAOH,EAAwB;AACrE,YAAM,IAAI;AAAA,QACRA,EAAwB,UACpB,8CACA,iDAAiDA,EAAwB,OAAO,0BAA0BG,CAAE;AAAA,MAAA;AAIpH,IAAAP,EAAiB,CAAQY,MAAA,CAAC,GAAGA,GAAMD,CAAS,CAAC;AAAA,EAC/C,GAAG,CAAE,CAAA,GAECE,IAAgBP;AAAA,IACpB,CAACC,GAAgBO,IAA0B,IAAOC,IAAoB,MAAM;AACtE,UAAA,CAACX,EAAwB;AACrB,cAAA,IAAI,MAAM,4CAA4C;AAG1D,UAAAG,MAAOH,EAAwB;AACjC,cAAM,IAAI;AAAA,UAC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",
174
174
  POINTS = "points",
175
175
  STREAK = "streak",
176
- LEADERBOARD = "leaderboard"
176
+ LEADERBOARD = "leaderboard",
177
+ TABLES = "tables"
177
178
  }
178
179
 
179
180
  export declare enum CircleSoundKey {
@@ -888,6 +889,7 @@ declare interface ICoachMarkCompletion {
888
889
  CIRCLE_POINTS_REWARD_JOURNEY: boolean;
889
890
  CIRCLE_STREAK_UPDATE_JOURNEY: boolean;
890
891
  CIRCLE_TUTORIAL_JOURNEY: boolean;
892
+ CIRCLE_TABLES_INTRO_JOURNEY: boolean;
891
893
  }
892
894
 
893
895
  export declare interface ICoachmarkProgress {
@@ -896,6 +898,7 @@ export declare interface ICoachmarkProgress {
896
898
  CIRCLE_POINTS_REWARD_JOURNEY: boolean;
897
899
  CIRCLE_STREAK_UPDATE_JOURNEY: boolean;
898
900
  CIRCLE_TUTORIAL_JOURNEY: boolean;
901
+ CIRCLE_TABLES_INTRO_JOURNEY: boolean;
899
902
  }
900
903
 
901
904
  /**
@@ -1103,6 +1106,7 @@ declare interface IGameLauncherProps {
1103
1106
  data: IProjectData | null;
1104
1107
  defaultIndex?: number;
1105
1108
  journeyId?: TJourneyId;
1109
+ isTutorialOnboardingDone?: boolean;
1106
1110
  onJourneyComplete: (journeyId: TJourneyId) => void;
1107
1111
  }
1108
1112
 
@@ -3350,7 +3354,8 @@ export declare enum JOURNEY_ID_STUDENT {
3350
3354
  CIRCLE_LEADERBOARD_INTRO_JOURNEY = "CIRCLE_LEADERBOARD_INTRO_JOURNEY",
3351
3355
  CIRCLE_POINTS_REWARD_JOURNEY = "CIRCLE_POINTS_REWARD_JOURNEY",
3352
3356
  CIRCLE_STREAK_UPDATE_JOURNEY = "CIRCLE_STREAK_UPDATE_JOURNEY",
3353
- CIRCLE_TUTORIAL_JOURNEY = "CIRCLE_TUTORIAL_JOURNEY"
3357
+ CIRCLE_TUTORIAL_JOURNEY = "CIRCLE_TUTORIAL_JOURNEY",
3358
+ CIRCLE_TABLES_INTRO_JOURNEY = "CIRCLE_TABLES_INTRO_JOURNEY"
3354
3359
  }
3355
3360
 
3356
3361
  export declare const JourneyProvider: FC<{
@@ -4905,9 +4910,9 @@ declare const useGetCircleHomeAPI: (initialId?: string, initialQuery?: IGetCircl
4905
4910
  } & Record<string, unknown>) | undefined;
4906
4911
  };
4907
4912
 
4908
- export declare const useGetCircleHomeDetailsDal: (userId: string, countryCode: string, grade: string) => Omit<ReturnType<typeof useGetCircleHomeAPI>, "data" | "get"> & {
4913
+ export declare const useGetCircleHomeDetailsDal: (userId: string, grade: string) => Omit<ReturnType<typeof useGetCircleHomeAPI>, "data" | "get"> & {
4909
4914
  data: ICircleHomeDetails | null;
4910
- getCircleHomeDetails: () => void;
4915
+ getCircleHomeDetails: (countryCode: string) => void;
4911
4916
  };
4912
4917
 
4913
4918
  declare const useGetLeaderboard: (initialId?: string, initialQuery?: IGetLeaderboardPayloadModel | undefined) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cuemath/leap",
3
- "version": "2.8.41",
3
+ "version": "2.8.43-rj-0",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "dist"
@@ -1,7 +0,0 @@
1
- const _ = 500, E = 1500, S = 3e3;
2
- export {
3
- _ as GO_TO_NEXT_SLIDE_AFTER_MS,
4
- E as SHOW_LABEL_HIGHLIGHT_AFTER_MS,
5
- S as SHOW_NUDGE_AFTER_MS
6
- };
7
- //# sourceMappingURL=constants.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"constants.js","sources":["../../../../../src/features/circle-games/game-launcher/use-game-launcher-journey/constants.ts"],"sourcesContent":["export const GO_TO_NEXT_SLIDE_AFTER_MS = 500;\nexport const SHOW_LABEL_HIGHLIGHT_AFTER_MS = 1500;\nexport const SHOW_NUDGE_AFTER_MS = 3000;\nexport const FIRST_COACHMARK_AFTER_MS = 200;\n"],"names":["GO_TO_NEXT_SLIDE_AFTER_MS","SHOW_LABEL_HIGHLIGHT_AFTER_MS","SHOW_NUDGE_AFTER_MS"],"mappings":"AAAO,MAAMA,IAA4B,KAC5BC,IAAgC,MAChCC,IAAsB;"}
@@ -1,213 +0,0 @@
1
- import { jsx as e, Fragment as R } from "react/jsx-runtime";
2
- import { useRef as u, useCallback as T, useMemo as ne } from "react";
3
- import Q from "../../../../assets/line-icons/icons/next.js";
4
- import { PLATFORM_EVENTS_STUDENT as j } from "../../../analytics-events/platform-events-student.js";
5
- import { IndicatorType as s } from "../../../journey/use-journey/constants.js";
6
- import { useJourney as ie } from "../../../journey/use-journey/use-journey.js";
7
- import z from "../../../ui/buttons/icon-button/icon-button.js";
8
- import { useUIContext as oe } from "../../../ui/context/context.js";
9
- import I from "../../../ui/layout/flex-view.js";
10
- import d from "../../../ui/text/text.js";
11
- import { CIRCLE_ONBOARDING_ANALYTICS_STEPS as E } from "../../enum/circle-onboarding-steps.js";
12
- import { useCircleSounds as le } from "../../hooks/use-circle-sounds/use-circle-sounds.js";
13
- import { SegmentedGameCard as ce } from "../comps/segmented-game-card/segmented-game-card.js";
14
- import { GAME_LAUNCHER_ANALYTICS_EVENTS as ee } from "../game-launcher-analytics-events.js";
15
- import { GO_TO_NEXT_SLIDE_AFTER_MS as ae, SHOW_LABEL_HIGHLIGHT_AFTER_MS as se, SHOW_NUDGE_AFTER_MS as de } from "./constants.js";
16
- import { ProjectType as he } from "../../games/web-view/enums/project-type-enum.js";
17
- const Se = ({
18
- onSegmentClick: L,
19
- setCarouselIndex: O,
20
- onJourneyComplete: b
21
- }) => {
22
- const c = u(null), i = u(null), r = u(null), a = u(null), C = u(!1), { playButtonSound: P } = le(), { nextCoachmark: o, setJourney: N } = ie(), { onEvent: f } = oe(), S = T(
23
- (t) => {
24
- f(j.ONBOARDING_STEP_VIEWED, {
25
- step: t
26
- });
27
- },
28
- [f]
29
- ), y = T(
30
- (t) => {
31
- f(j.ONBOARDING_STEP_COMPLETED, {
32
- step: t
33
- });
34
- },
35
- [f]
36
- ), h = T(
37
- (t, l, n, g, p = !1) => {
38
- p || (P(), O((_) => _ + 1), o(g, !1, ae)), S(t);
39
- const A = setTimeout(() => {
40
- clearTimeout(A), l.startLabelAnimation(n);
41
- }, se);
42
- o(g, !0, de);
43
- },
44
- [o, P, O, S]
45
- ), H = T(
46
- (t, l) => {
47
- L(t, he.PUZZLE), y(E.PUZZLE_ACTIVITY), o(l), b(l);
48
- },
49
- [o, b, L, y]
50
- ), G = T(
51
- (t, l, n) => {
52
- var w, Y, v, U, V, B, D, x, M, W, X, $, J, F, Z, K, q;
53
- if (C.current || !((w = c == null ? void 0 : c.current) != null && w.nextBtnRef.current) || !((Y = r == null ? void 0 : r.current) != null && Y.segmentedCardWrapperRef.current) || !((v = i == null ? void 0 : i.current) != null && v.labelRef.current) || !((U = r == null ? void 0 : r.current) != null && U.labelRef.current) || !t)
54
- return;
55
- C.current = !0;
56
- const g = ((D = (B = (V = a.current) == null ? void 0 : V.labelRef) == null ? void 0 : B.current) == null ? void 0 : D.getBoundingClientRect()) || {
57
- height: 0,
58
- width: 0
59
- }, p = ((W = (M = (x = i.current) == null ? void 0 : x.labelRef) == null ? void 0 : M.current) == null ? void 0 : W.getBoundingClientRect()) || {
60
- height: 0,
61
- width: 0
62
- }, A = ((J = ($ = (X = r.current) == null ? void 0 : X.labelRef) == null ? void 0 : $.current) == null ? void 0 : J.getBoundingClientRect()) || {
63
- height: 0,
64
- width: 0
65
- }, _ = ((K = (Z = (F = r.current) == null ? void 0 : F.segmentedCardWrapperRef) == null ? void 0 : Z.current) == null ? void 0 : K.getBoundingClientRect()) || {
66
- height: 0,
67
- width: 0
68
- };
69
- let k = [];
70
- l && a.current && (k = [
71
- {
72
- originalElementToHighlightRef: a.current.labelRef,
73
- isActive: !1,
74
- type: s.TOOLTIP,
75
- elementToHighlight: /* @__PURE__ */ e(R, {}),
76
- indicator: {
77
- position: "right",
78
- backgroundColor: "BLUE_4",
79
- width: 264,
80
- tooltipItem: /* @__PURE__ */ e(I, { children: /* @__PURE__ */ e(d, { $renderAs: "ab2-bold", children: "Get faster & stay ahead in school. Practice 3 new skills everyday." }) }),
81
- tooltipXCoOrdinates: g.width + 50,
82
- tooltipYCoOrdinates: g.height / 2
83
- }
84
- },
85
- {
86
- originalElementToHighlightRef: (q = c.current) == null ? void 0 : q.nextBtnRef,
87
- isActive: !1,
88
- type: s.NUDGE,
89
- elementToHighlight: /* @__PURE__ */ e(
90
- z,
91
- {
92
- renderAs: "secondary",
93
- Icon: Q,
94
- onClick: () => h(
95
- E.GAMES_ACTIVITY,
96
- i.current,
97
- "ORANGE_4",
98
- n
99
- ),
100
- analyticsLabel: ee.JOURNEY_NEXT_ACTIVITY
101
- }
102
- ),
103
- indicator: {
104
- nudge: "click",
105
- content: /* @__PURE__ */ e(d, { $renderAs: "ab1", $color: "WHITE", children: "Click to proceed" }),
106
- nudgePointerX: 0,
107
- nudgePointerY: 0
108
- }
109
- }
110
- ]);
111
- const te = [
112
- {
113
- originalElementToHighlightRef: i.current.labelRef,
114
- isActive: !1,
115
- type: s.TOOLTIP,
116
- elementToHighlight: /* @__PURE__ */ e(R, {}),
117
- indicator: {
118
- position: "right",
119
- backgroundColor: "ORANGE_4",
120
- width: 264,
121
- tooltipItem: /* @__PURE__ */ e(I, { children: /* @__PURE__ */ e(d, { $renderAs: "ab2-bold", children: "Train to think deeper & plan ahead. Play 3 new games everyday." }) }),
122
- tooltipXCoOrdinates: p.width + 50,
123
- tooltipYCoOrdinates: p.height / 2
124
- }
125
- },
126
- {
127
- originalElementToHighlightRef: c.current.nextBtnRef,
128
- isActive: !1,
129
- type: s.NUDGE,
130
- elementToHighlight: /* @__PURE__ */ e(
131
- z,
132
- {
133
- renderAs: "secondary",
134
- Icon: Q,
135
- onClick: () => h(
136
- E.PUZZLE_ACTIVITY,
137
- r.current,
138
- "PURPLE_4",
139
- n
140
- ),
141
- analyticsLabel: ee.JOURNEY_NEXT_ACTIVITY
142
- }
143
- ),
144
- indicator: {
145
- nudge: "click",
146
- content: /* @__PURE__ */ e(d, { $renderAs: "ab1", $color: "WHITE", children: "Click to proceed" }),
147
- nudgePointerX: 0,
148
- nudgePointerY: 0
149
- }
150
- }
151
- ], re = [
152
- {
153
- originalElementToHighlightRef: r.current.labelRef,
154
- isActive: !1,
155
- type: s.TOOLTIP,
156
- elementToHighlight: /* @__PURE__ */ e(R, {}),
157
- indicator: {
158
- position: "right",
159
- backgroundColor: "PURPLE_4",
160
- width: 264,
161
- tooltipItem: /* @__PURE__ */ e(I, { children: /* @__PURE__ */ e(d, { $renderAs: "ab2-bold", children: "Think in new ways & stay sharp. Solve 3 new puzzles everyday." }) }),
162
- tooltipXCoOrdinates: A.width + 50,
163
- tooltipYCoOrdinates: A.height / 2
164
- }
165
- },
166
- {
167
- originalElementToHighlightRef: r.current.segmentedCardWrapperRef,
168
- isActive: !1,
169
- type: s.NUDGE,
170
- elementToHighlight: /* @__PURE__ */ e(
171
- ce,
172
- {
173
- label: "",
174
- value: t.data.filter((m) => m.solved).length,
175
- maxValue: t.data.length,
176
- initialValue: t.initialProgressValue,
177
- data: t.data.map((m) => ({
178
- card: m.cardLottie,
179
- name: "",
180
- // We dont want to show the name of the puzzle in onboarding
181
- isCompleted: m.solved,
182
- onPress: () => H(m, n)
183
- }))
184
- }
185
- ),
186
- indicator: {
187
- nudge: "click",
188
- content: /* @__PURE__ */ e(d, { $renderAs: "ab1", $color: "WHITE", children: "Click to solve a puzzle" }),
189
- nudgePointerX: _.width * 0.6,
190
- nudgePointerY: _.height * 0.4
191
- }
192
- }
193
- ];
194
- N(n, [...k, ...te, ...re]), o(n), l && a.current ? h(E.SKILL_ACTIVITY, a.current, "BLUE_4", n, !0) : h(E.GAMES_ACTIVITY, i.current, "ORANGE_4", n, !0);
195
- },
196
- [H, h, o, N]
197
- );
198
- return ne(
199
- () => ({
200
- gameRefs: i,
201
- puzzleRefs: r,
202
- lessonRefs: a,
203
- carouselNextBtnRef: c,
204
- isJourneyInProgress: C,
205
- startJourney: G
206
- }),
207
- [G]
208
- );
209
- };
210
- export {
211
- Se as useGameLauncherJourney
212
- };
213
- //# sourceMappingURL=use-game-launcher-journey.js.map