@cuemath/leap 2.9.7-hg8 → 2.9.7-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 (34) hide show
  1. package/dist/features/circle-games/game-launcher/hooks/use-game-launcher-journey/use-game-launcher-journey.js +93 -92
  2. package/dist/features/circle-games/game-launcher/hooks/use-game-launcher-journey/use-game-launcher-journey.js.map +1 -1
  3. package/dist/features/circle-games/game-launcher/hooks/use-table-launcher-journey/use-table-launcher-journey.js +88 -86
  4. package/dist/features/circle-games/game-launcher/hooks/use-table-launcher-journey/use-table-launcher-journey.js.map +1 -1
  5. package/dist/features/circle-games/games/tutorial/constants.js +3 -2
  6. package/dist/features/circle-games/games/tutorial/constants.js.map +1 -1
  7. package/dist/features/circle-games/games/tutorial/tutorial-styled.js +23 -19
  8. package/dist/features/circle-games/games/tutorial/tutorial-styled.js.map +1 -1
  9. package/dist/features/circle-games/games/tutorial/tutorial.js +41 -41
  10. package/dist/features/circle-games/games/tutorial/tutorial.js.map +1 -1
  11. package/dist/features/circle-games/games/web-view/web-view.js +46 -55
  12. package/dist/features/circle-games/games/web-view/web-view.js.map +1 -1
  13. package/dist/features/circle-games/leaderboard/comps/banner/banner.js +6 -6
  14. package/dist/features/circle-games/leaderboard/comps/banner/banner.js.map +1 -1
  15. package/dist/features/circle-games/leaderboard/comps/navigation-button/navigation-button-styled.js +1 -1
  16. package/dist/features/circle-games/leaderboard/comps/navigation-button/navigation-button-styled.js.map +1 -1
  17. package/dist/features/circle-games/leaderboard/leaderboard-styled.js +1 -1
  18. package/dist/features/circle-games/leaderboard/leaderboard-styled.js.map +1 -1
  19. package/dist/features/circle-games/leaderboard/leaderboard.js +9 -9
  20. package/dist/features/circle-games/leaderboard/leaderboard.js.map +1 -1
  21. package/dist/features/circle-games/sign-up/comp/circular-steps/circular-steps-styled.js +8 -8
  22. package/dist/features/circle-games/sign-up/comp/circular-steps/circular-steps-styled.js.map +1 -1
  23. package/dist/features/circle-games/sign-up/constants.js +9 -9
  24. package/dist/features/circle-games/sign-up/constants.js.map +1 -1
  25. package/dist/features/hooks/use-breakpoint/constants.js +7 -0
  26. package/dist/features/hooks/use-breakpoint/constants.js.map +1 -0
  27. package/dist/features/hooks/use-breakpoint/use-breakpoint.js +16 -0
  28. package/dist/features/hooks/use-breakpoint/use-breakpoint.js.map +1 -0
  29. package/dist/features/ui/arc-button/constants.js +3 -3
  30. package/dist/features/ui/arc-button/constants.js.map +1 -1
  31. package/dist/index.d.ts +10 -1
  32. package/dist/index.js +135 -133
  33. package/dist/index.js.map +1 -1
  34. package/package.json +4 -2
@@ -1,61 +1,62 @@
1
- import { jsx as r, Fragment as b } from "react/jsx-runtime";
2
- import { useRef as O, useCallback as A, useEffect as X } from "react";
3
- import J from "../../../../../assets/line-icons/icons/carat-right.js";
4
- import { PLATFORM_EVENTS_STUDENT as G } from "../../../../analytics-events/platform-events-student.js";
5
- import { JOURNEY_ID_STUDENT as K } from "../../../../journey/journey-id/journey-id-student.js";
1
+ import { jsx as r, Fragment as O } from "react/jsx-runtime";
2
+ import { useRef as R, useCallback as C, useEffect as J } from "react";
3
+ import K from "../../../../../assets/line-icons/icons/carat-right.js";
4
+ import { PLATFORM_EVENTS_STUDENT as v } from "../../../../analytics-events/platform-events-student.js";
5
+ import { useBreakpoint as j } from "../../../../hooks/use-breakpoint/use-breakpoint.js";
6
+ import { JOURNEY_ID_STUDENT as Z } from "../../../../journey/journey-id/journey-id-student.js";
6
7
  import { IndicatorType as d } from "../../../../journey/use-journey/constants.js";
7
- import { useJourney as j } from "../../../../journey/use-journey/use-journey.js";
8
- import Z from "../../../../ui/buttons/icon-button/icon-button.js";
9
- import { useUIContext as q } from "../../../../ui/context/context.js";
10
- import R from "../../../../ui/layout/flex-view.js";
8
+ import { useJourney as q } from "../../../../journey/use-journey/use-journey.js";
9
+ import z from "../../../../ui/buttons/icon-button/icon-button.js";
10
+ import { useUIContext as Q } from "../../../../ui/context/context.js";
11
+ import N from "../../../../ui/layout/flex-view.js";
11
12
  import m from "../../../../ui/text/text.js";
12
- import { CIRCLE_ONBOARDING_ANALYTICS_STEPS as v } from "../../../enum/circle-onboarding-steps.js";
13
- import { useCircleSounds as z } from "../../../hooks/use-circle-sounds/use-circle-sounds.js";
14
- import { TablesCard as M } from "../../comps/tables-card/tables-card.js";
15
- import { GAME_LAUNCHER_ANALYTICS_EVENTS as Q } from "../../game-launcher-analytics-events.js";
16
- import { SHOW_PICK_A_LEVEL_TOOLTIP_AFTER_MS as ee, SHOW_PICK_A_LEVEL_NUDGE_AFTER_MS as te, START_ANIMATING_CLONED_ELEM as $, TABLE_CARD_INDEX as x, GO_TO_TABLE_LAUNCHER_DURATION_MS as re, SHOW_CLICK_TABLE_NUDGE_AFTER_MS as ne, PUZZLE_CARD_INDEX as oe, SHOW_INITIAL_COACHMARK_AFTER_MS as w, LESSON_CARD_INDEX as ie, SHOW_INITIAL_TOOLTIP_AFTER_MS as le } from "./constants.js";
17
- import { Indicator as ce } from "./use-table-launcher-journey-styled.js";
18
- const Oe = ({
13
+ import { CIRCLE_ONBOARDING_ANALYTICS_STEPS as M } from "../../../enum/circle-onboarding-steps.js";
14
+ import { useCircleSounds as ee } from "../../../hooks/use-circle-sounds/use-circle-sounds.js";
15
+ import { TablesCard as $ } from "../../comps/tables-card/tables-card.js";
16
+ import { GAME_LAUNCHER_ANALYTICS_EVENTS as te } from "../../game-launcher-analytics-events.js";
17
+ import { SHOW_PICK_A_LEVEL_TOOLTIP_AFTER_MS as re, SHOW_PICK_A_LEVEL_NUDGE_AFTER_MS as ne, START_ANIMATING_CLONED_ELEM as x, TABLE_CARD_INDEX as w, GO_TO_TABLE_LAUNCHER_DURATION_MS as oe, SHOW_CLICK_TABLE_NUDGE_AFTER_MS as ie, PUZZLE_CARD_INDEX as le, SHOW_INITIAL_COACHMARK_AFTER_MS as F, LESSON_CARD_INDEX as ce, SHOW_INITIAL_TOOLTIP_AFTER_MS as ae } from "./constants.js";
18
+ import { Indicator as se } from "./use-table-launcher-journey-styled.js";
19
+ const Se = ({
19
20
  carouselRefs: a,
20
- onTableSegmentClick: N,
21
- onJourneyComplete: S
21
+ onTableSegmentClick: S,
22
+ onJourneyComplete: P
22
23
  }) => {
23
- const e = K.CIRCLE_TABLES_INTRO_JOURNEY, t = O(null), p = O(null), T = O([]), { playButtonSound: P } = z(), { nextCoachmark: l, setJourney: C, addCoachmark: u, endJourney: H } = j(), { onEvent: f } = q(), L = A(
24
+ const e = Z.CIRCLE_TABLES_INTRO_JOURNEY, { isMobile: T } = j(), t = R(null), f = R(null), g = R([]), { playButtonSound: H } = ee(), { nextCoachmark: l, setJourney: L, addCoachmark: u, endJourney: y } = q(), { onEvent: A } = Q(), I = C(
24
25
  (n) => {
25
26
  var c, o;
26
- H(e), n && N(n), f(G.ONBOARDING_STEP_COMPLETED, {
27
- step: v.TABLES
28
- }), (c = t == null ? void 0 : t.current) == null || c.setLabelVisiblity(!0), (o = t == null ? void 0 : t.current) == null || o.stopLabelAnimation(), S(e);
27
+ y(e), n && S(n), A(v.ONBOARDING_STEP_COMPLETED, {
28
+ step: M.TABLES
29
+ }), (c = t == null ? void 0 : t.current) == null || c.setLabelVisiblity(!0), (o = t == null ? void 0 : t.current) == null || o.stopLabelAnimation(), P(e);
29
30
  },
30
- [H, e, S, N, f]
31
- ), y = A(
31
+ [y, e, P, S, A]
32
+ ), D = C(
32
33
  (n, c) => {
33
- var g, E, h;
34
- if (!((g = t.current) != null && g.segmentedCardWrapperRef.current) || !((E = t.current) != null && E.labelRef.current))
34
+ var E, h, p;
35
+ if (!((E = t.current) != null && E.segmentedCardWrapperRef.current) || !((h = t.current) != null && h.labelRef.current))
35
36
  return;
36
- const o = t.current.labelRef.current.getBoundingClientRect(), i = (h = t.current) == null ? void 0 : h.segmentedCardWrapperRef.current.getBoundingClientRect();
37
+ const o = t.current.labelRef.current.getBoundingClientRect(), i = (p = t.current) == null ? void 0 : p.segmentedCardWrapperRef.current.getBoundingClientRect();
37
38
  u(e, {
38
39
  originalElementToHighlightRef: t.current.segmentedCardWrapperRef,
39
40
  isActive: !1,
40
41
  type: d.TOOLTIP,
41
42
  elementToHighlight: /* @__PURE__ */ r(
42
- M,
43
+ $,
43
44
  {
44
- ref: p,
45
+ ref: f,
45
46
  defaultTable: c,
46
47
  label: n.label,
47
48
  data: n.data,
48
- onPress: L,
49
- onGoBackFromTableLevel: L
49
+ onPress: I,
50
+ onGoBackFromTableLevel: I
50
51
  }
51
52
  ),
52
53
  indicator: {
53
- position: "left",
54
+ position: "top",
54
55
  backgroundColor: "YELLOW_4",
55
56
  width: 236,
56
- tooltipItem: /* @__PURE__ */ r(R, { children: /* @__PURE__ */ r(m, { $renderAs: "ab2-bold", children: "Each table has 3 levels—clear them and earn 3 stars!" }) }),
57
- tooltipXCoOrdinates: 0,
58
- tooltipYCoOrdinates: o.height * 0.35
57
+ tooltipItem: /* @__PURE__ */ r(N, { children: /* @__PURE__ */ r(m, { $renderAs: "ab2-bold", children: "Each table has 3 levels—clear them and earn 3 stars!" }) }),
58
+ tooltipXCoOrdinates: o.width / 2,
59
+ tooltipYCoOrdinates: 45
59
60
  }
60
61
  }), u(e, {
61
62
  originalElementToHighlightRef: t.current.segmentedCardWrapperRef,
@@ -63,58 +64,58 @@ const Oe = ({
63
64
  type: d.NUDGE,
64
65
  indicator: {
65
66
  nudge: "click",
66
- content: /* @__PURE__ */ r(m, { $renderAs: "ab1", $color: "WHITE", children: "Pick a level" }),
67
+ content: !T && /* @__PURE__ */ r(m, { $renderAs: "ab1", $color: "WHITE", children: "Pick a level" }),
67
68
  nudgePointerX: i.width / 2 + 50,
68
69
  nudgePointerY: i.height * 0.4
69
70
  },
70
- elementToHighlight: /* @__PURE__ */ r(b, {})
71
- }), l(e, !1, ee), l(e, !0, te);
71
+ elementToHighlight: /* @__PURE__ */ r(O, {})
72
+ }), l(e, !1, re), l(e, !0, ne);
72
73
  const s = setTimeout(() => {
73
74
  var _;
74
- clearTimeout(s), (_ = p.current) == null || _.startLabelAnimation("YELLOW_4");
75
- }, $);
76
- T.current.push(s);
75
+ clearTimeout(s), (_ = f.current) == null || _.startLabelAnimation("YELLOW_4");
76
+ }, x);
77
+ g.current.push(s);
77
78
  },
78
- [u, L, e, l]
79
- ), I = A(() => {
79
+ [u, I, T, e, l]
80
+ ), b = C(() => {
80
81
  var o;
81
- P(), (o = a.current) == null || o.goToIndex(x), l(e, !1, re), f(G.ONBOARDING_STEP_VIEWED, {
82
- step: v.TABLES
82
+ H(), (o = a.current) == null || o.goToIndex(w), l(e, !1, oe), A(v.ONBOARDING_STEP_VIEWED, {
83
+ step: M.TABLES
83
84
  });
84
85
  const n = setTimeout(() => {
85
86
  var i;
86
87
  clearTimeout(n), (i = t.current) == null || i.setLabelVisiblity(!1), l(e, !0);
87
- }, ne);
88
- T.current.push(n);
88
+ }, ie);
89
+ g.current.push(n);
89
90
  const c = setTimeout(() => {
90
91
  var i;
91
- clearTimeout(c), (i = p.current) == null || i.startLabelAnimation("YELLOW_4");
92
- }, $);
93
- T.current.push(c);
94
- }, [a, e, l, P, f]), F = A(
92
+ clearTimeout(c), (i = f.current) == null || i.startLabelAnimation("YELLOW_4");
93
+ }, x);
94
+ g.current.push(c);
95
+ }, [a, e, l, H, A]), V = C(
95
96
  (n, c = !1) => {
96
- var h, _, D, W, Y, k, B, U;
97
- const o = (h = a.current) == null ? void 0 : h.indicatorRefs, i = (_ = a.current) == null ? void 0 : _.nextBtnRef, s = o == null ? void 0 : o[x];
98
- if (!((D = t.current) != null && D.segmentedCardWrapperRef.current) || !((W = t.current) != null && W.labelRef.current) || !o || !(i != null && i.current) || !s || !s.current)
97
+ var p, _, W, k, B, Y, U, G;
98
+ const o = (p = a.current) == null ? void 0 : p.indicatorRefs, i = (_ = a.current) == null ? void 0 : _.nextBtnRef, s = o == null ? void 0 : o[w];
99
+ if (!((W = t.current) != null && W.segmentedCardWrapperRef.current) || !((k = t.current) != null && k.labelRef.current) || !o || !(i != null && i.current) || !s || !s.current)
99
100
  return;
100
- const g = t.current.labelRef.current.getBoundingClientRect(), E = (Y = t.current) == null ? void 0 : Y.segmentedCardWrapperRef.current.getBoundingClientRect();
101
- c ? (C(e, [
101
+ const E = t.current.labelRef.current.getBoundingClientRect(), h = (B = t.current) == null ? void 0 : B.segmentedCardWrapperRef.current.getBoundingClientRect();
102
+ c ? (L(e, [
102
103
  {
103
104
  originalElementToHighlightRef: s,
104
105
  isActive: !1,
105
106
  type: d.TOOLTIP,
106
- elementToHighlight: /* @__PURE__ */ r(ce, { $isActive: !1 }),
107
+ elementToHighlight: /* @__PURE__ */ r(se, { $isActive: !1 }),
107
108
  indicator: {
108
109
  position: "bottom",
109
110
  backgroundColor: "YELLOW_4",
110
111
  width: 52,
111
112
  tooltipItem: /* @__PURE__ */ r(
112
- R,
113
+ N,
113
114
  {
114
115
  $position: "absolute",
115
116
  $flexDirection: "row",
116
117
  style: { top: 6, left: 8, cursor: "pointer" },
117
- onClick: I,
118
+ onClick: b,
118
119
  children: /* @__PURE__ */ r(m, { $renderAs: "ab2-bold", children: "NEW" })
119
120
  }
120
121
  ),
@@ -131,41 +132,41 @@ const Oe = ({
131
132
  content: "",
132
133
  nudgePointerY: 20
133
134
  },
134
- elementToHighlight: /* @__PURE__ */ r(b, {})
135
+ elementToHighlight: /* @__PURE__ */ r(O, {})
135
136
  }
136
- ]), (U = a.current) == null || U.goToIndex(ie), l(e, !1, w), l(e, !0, le)) : (C(e, [
137
+ ]), (G = a.current) == null || G.goToIndex(ce), l(e, !1, F), l(e, !0, ae)) : (L(e, [
137
138
  {
138
- originalElementToHighlightRef: (k = a.current) == null ? void 0 : k.nextBtnRef,
139
+ originalElementToHighlightRef: (Y = a.current) == null ? void 0 : Y.nextBtnRef,
139
140
  isActive: !1,
140
141
  type: d.NUDGE,
141
142
  indicator: {
142
143
  nudge: "click",
143
- content: /* @__PURE__ */ r(m, { $renderAs: "ab1", $color: "WHITE", children: "Click to proceed" }),
144
+ content: !T && /* @__PURE__ */ r(m, { $renderAs: "ab1", $color: "WHITE", children: "Click to proceed" }),
144
145
  nudgePointerX: 0,
145
146
  nudgePointerY: 0
146
147
  },
147
148
  elementToHighlight: /* @__PURE__ */ r(
148
- Z,
149
+ z,
149
150
  {
150
151
  renderAs: "secondary",
151
- Icon: J,
152
- onClick: I,
153
- analyticsLabel: Q.JOURNEY_NEXT_ACTIVITY
152
+ Icon: K,
153
+ onClick: b,
154
+ analyticsLabel: te.JOURNEY_NEXT_ACTIVITY
154
155
  }
155
156
  )
156
157
  }
157
- ]), (B = a.current) == null || B.goToIndex(oe), l(e, !1, w)), u(e, {
158
+ ]), (U = a.current) == null || U.goToIndex(le), l(e, !1, F)), u(e, {
158
159
  originalElementToHighlightRef: t.current.labelRef,
159
160
  isActive: !1,
160
161
  type: d.TOOLTIP,
161
- elementToHighlight: /* @__PURE__ */ r(b, {}),
162
+ elementToHighlight: /* @__PURE__ */ r(O, {}),
162
163
  indicator: {
163
- position: "right",
164
+ position: "top",
164
165
  backgroundColor: "YELLOW_4",
165
166
  width: 264,
166
- tooltipItem: /* @__PURE__ */ r(R, { children: /* @__PURE__ */ r(m, { $renderAs: "ab2-bold", children: "Get faster at multiplication! Practice everyday and become a Tables champ." }) }),
167
- tooltipXCoOrdinates: g.width + 50,
168
- tooltipYCoOrdinates: g.height / 2
167
+ tooltipItem: /* @__PURE__ */ r(N, { children: /* @__PURE__ */ r(m, { $renderAs: "ab2-bold", children: "Get faster at multiplication! Practice everyday and become a Tables champ." }) }),
168
+ tooltipXCoOrdinates: E.width / 2,
169
+ tooltipYCoOrdinates: E.height + 10
169
170
  }
170
171
  }), u(e, {
171
172
  originalElementToHighlightRef: t.current.segmentedCardWrapperRef,
@@ -173,19 +174,19 @@ const Oe = ({
173
174
  type: d.NUDGE,
174
175
  indicator: {
175
176
  nudge: "click",
176
- content: /* @__PURE__ */ r(m, { $renderAs: "ab1", $color: "WHITE", children: "Pick a table to start" }),
177
- nudgePointerX: E.width / 2 + 50,
178
- nudgePointerY: E.height / 2
177
+ content: !T && /* @__PURE__ */ r(m, { $renderAs: "ab1", $color: "WHITE", children: "Pick a table to start" }),
178
+ nudgePointerX: h.width / 2 + 50,
179
+ nudgePointerY: h.height / 2
179
180
  },
180
181
  elementToHighlight: /* @__PURE__ */ r(
181
- M,
182
+ $,
182
183
  {
183
- ref: p,
184
+ ref: f,
184
185
  label: n.label,
185
186
  data: n.data,
186
187
  onPress: () => {
187
188
  },
188
- onPressTableSegment: (V) => y(n, V)
189
+ onPressTableSegment: (X) => D(n, X)
189
190
  }
190
191
  )
191
192
  });
@@ -193,21 +194,22 @@ const Oe = ({
193
194
  [
194
195
  u,
195
196
  a,
196
- I,
197
- y,
197
+ b,
198
+ D,
199
+ T,
198
200
  e,
199
201
  l,
200
- C
202
+ L
201
203
  ]
202
204
  );
203
- return X(() => () => {
204
- T.current.forEach((n) => clearTimeout(n)), T.current = [];
205
+ return J(() => () => {
206
+ g.current.forEach((n) => clearTimeout(n)), g.current = [];
205
207
  }, [e]), {
206
208
  tableRef: t,
207
- startJourney: F
209
+ startJourney: V
208
210
  };
209
211
  };
210
212
  export {
211
- Oe as useTableLauncherJourney
213
+ Se as useTableLauncherJourney
212
214
  };
213
215
  //# sourceMappingURL=use-table-launcher-journey.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"use-table-launcher-journey.js","sources":["../../../../../../src/features/circle-games/game-launcher/hooks/use-table-launcher-journey/use-table-launcher-journey.tsx"],"sourcesContent":["/* eslint-disable react-native/no-inline-styles */\nimport type { IArrowTooltipProps } from '../../../../ui/arrow-tooltip/arrow-tooltip-types';\nimport type { INudgeProps } from '../../../../ui/nudge/nudge-types';\nimport type { ITableCardRef, ITableDetails } from '../../comps/tables-card/tables-card-types';\nimport type {\n ITableInfo,\n ITables,\n} from '../../dal/use-get-circle-home-details-dal/use-get-circle-home-dal-types';\nimport type { IUseTableJourneyProps } from './use-table-launcher-journey-types';\n\nimport { useCallback, useEffect, useRef } from 'react';\n\nimport CaratRightIcon from '../../../../../assets/line-icons/icons/carat-right';\nimport { PLATFORM_EVENTS_STUDENT } from '../../../../analytics-events/platform-events-student';\nimport { JOURNEY_ID_STUDENT } from '../../../../journey/journey-id/journey-id-student';\nimport { IndicatorType } from '../../../../journey/use-journey/constants';\nimport { useJourney } from '../../../../journey/use-journey/use-journey';\nimport IconButton from '../../../../ui/buttons/icon-button/icon-button';\nimport { useUIContext } from '../../../../ui/context/context';\nimport FlexView from '../../../../ui/layout/flex-view';\nimport Text from '../../../../ui/text/text';\nimport { CIRCLE_ONBOARDING_ANALYTICS_STEPS as Action } from '../../../enum/circle-onboarding-steps';\nimport { useCircleSounds } from '../../../hooks/use-circle-sounds/use-circle-sounds';\nimport { TablesCard } from '../../comps/tables-card/tables-card';\nimport { GAME_LAUNCHER_ANALYTICS_EVENTS } from '../../game-launcher-analytics-events';\nimport {\n LESSON_CARD_INDEX,\n PUZZLE_CARD_INDEX,\n SHOW_PICK_A_LEVEL_NUDGE_AFTER_MS,\n SHOW_PICK_A_LEVEL_TOOLTIP_AFTER_MS,\n TABLE_CARD_INDEX,\n} from './constants';\nimport {\n GO_TO_TABLE_LAUNCHER_DURATION_MS,\n SHOW_CLICK_TABLE_NUDGE_AFTER_MS,\n SHOW_INITIAL_COACHMARK_AFTER_MS,\n SHOW_INITIAL_TOOLTIP_AFTER_MS,\n START_ANIMATING_CLONED_ELEM,\n} from './constants';\nimport * as S from './use-table-launcher-journey-styled';\n\nexport const useTableLauncherJourney = ({\n carouselRefs,\n onTableSegmentClick,\n onJourneyComplete,\n}: IUseTableJourneyProps) => {\n const journeyId = JOURNEY_ID_STUDENT.CIRCLE_TABLES_INTRO_JOURNEY;\n\n const originalTableRef = useRef<ITableCardRef>(null);\n const highlightedTableRef = useRef<ITableCardRef>(null);\n\n const timerRefs = useRef<ReturnType<typeof setTimeout>[]>([]);\n\n const { playButtonSound } = useCircleSounds();\n const { nextCoachmark, setJourney, addCoachmark, endJourney } = useJourney();\n const { onEvent: trackAnalytics } = useUIContext();\n\n const handleEndJourney = useCallback(\n (tableDetails?: ITableDetails) => {\n endJourney(journeyId);\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 },\n [endJourney, journeyId, 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={handleEndJourney}\n onGoBackFromTableLevel={handleEndJourney}\n />\n ),\n indicator: {\n position: 'left',\n backgroundColor: 'YELLOW_4',\n width: 236,\n tooltipItem: (\n <FlexView>\n <Text $renderAs=\"ab2-bold\">Each table has 3 levels—clear them and earn 3 stars!</Text>\n </FlexView>\n ),\n tooltipXCoOrdinates: 0,\n tooltipYCoOrdinates: segmentedCardDims.height * 0.35,\n } as IArrowTooltipProps,\n });\n\n addCoachmark(journeyId, {\n originalElementToHighlightRef: originalTableRef.current.segmentedCardWrapperRef,\n isActive: false,\n type: IndicatorType.NUDGE,\n indicator: {\n nudge: 'click',\n content: (\n <Text $renderAs=\"ab1\" $color=\"WHITE\">\n Pick a level\n </Text>\n ),\n nudgePointerX: tableCardDims.width / 2 + 50,\n nudgePointerY: tableCardDims.height * 0.4,\n } as INudgeProps,\n elementToHighlight: <></>,\n });\n\n nextCoachmark(journeyId, false, SHOW_PICK_A_LEVEL_TOOLTIP_AFTER_MS); // Show coachmark => Each table has 3... and Hide the previous two\n nextCoachmark(journeyId, true, SHOW_PICK_A_LEVEL_NUDGE_AFTER_MS); // Show nudge => Pick a level\n\n const startAnimationOnLabelAgain = setTimeout(() => {\n clearTimeout(startAnimationOnLabelAgain);\n highlightedTableRef.current?.startLabelAnimation('YELLOW_4');\n }, START_ANIMATING_CLONED_ELEM);\n\n timerRefs.current.push(startAnimationOnLabelAgain);\n },\n [addCoachmark, handleEndJourney, journeyId, nextCoachmark],\n );\n\n const goToTableLauncher = useCallback(() => {\n playButtonSound();\n carouselRefs.current?.goToIndex(TABLE_CARD_INDEX);\n nextCoachmark(journeyId, false, GO_TO_TABLE_LAUNCHER_DURATION_MS);\n\n trackAnalytics(PLATFORM_EVENTS_STUDENT.ONBOARDING_STEP_VIEWED, {\n step: Action.TABLES,\n });\n\n const showNudge = setTimeout(() => {\n clearTimeout(showNudge);\n originalTableRef.current?.setLabelVisiblity(false);\n nextCoachmark(journeyId, true);\n }, SHOW_CLICK_TABLE_NUDGE_AFTER_MS);\n\n timerRefs.current.push(showNudge);\n\n const animateLabel = setTimeout(() => {\n clearTimeout(animateLabel);\n highlightedTableRef.current?.startLabelAnimation('YELLOW_4');\n }, START_ANIMATING_CLONED_ELEM);\n\n timerRefs.current.push(animateLabel);\n }, [carouselRefs, journeyId, nextCoachmark, playButtonSound, trackAnalytics]);\n\n const startJourney = useCallback(\n (tablesData: ITables, isTutorialOnboardingDone: boolean = false) => {\n const paginationList = carouselRefs.current?.indicatorRefs;\n const carouselNextBtnRef = carouselRefs.current?.nextBtnRef;\n const tablePaginationRef = paginationList?.[TABLE_CARD_INDEX];\n\n if (\n !originalTableRef.current?.segmentedCardWrapperRef.current ||\n !originalTableRef.current?.labelRef.current ||\n !paginationList ||\n !carouselNextBtnRef?.current ||\n !tablePaginationRef ||\n !tablePaginationRef.current\n ) {\n return;\n }\n\n const labelDims = originalTableRef.current.labelRef.current.getBoundingClientRect();\n const tableCardDims =\n originalTableRef.current?.segmentedCardWrapperRef.current.getBoundingClientRect();\n\n // TAKE THE USER TO THE TABLE CARD\n if (!isTutorialOnboardingDone) {\n setJourney(journeyId, [\n {\n originalElementToHighlightRef: carouselRefs.current?.nextBtnRef,\n isActive: false,\n type: IndicatorType.NUDGE,\n indicator: {\n nudge: 'click',\n content: (\n <Text $renderAs=\"ab1\" $color=\"WHITE\">\n Click to proceed\n </Text>\n ),\n nudgePointerX: 0,\n nudgePointerY: 0,\n } as INudgeProps,\n elementToHighlight: (\n <IconButton\n renderAs=\"secondary\"\n Icon={CaratRightIcon}\n onClick={goToTableLauncher}\n analyticsLabel={GAME_LAUNCHER_ANALYTICS_EVENTS.JOURNEY_NEXT_ACTIVITY}\n />\n ),\n },\n ]);\n carouselRefs.current?.goToIndex(PUZZLE_CARD_INDEX);\n nextCoachmark(journeyId, false, SHOW_INITIAL_COACHMARK_AFTER_MS); // Show nudge => Click to proceed\n } else {\n setJourney(journeyId, [\n {\n originalElementToHighlightRef: tablePaginationRef as React.RefObject<HTMLDivElement>,\n isActive: false,\n type: IndicatorType.TOOLTIP,\n elementToHighlight: <S.Indicator $isActive={false} />,\n indicator: {\n position: 'bottom',\n backgroundColor: 'YELLOW_4',\n width: 52,\n tooltipItem: (\n <FlexView\n $position=\"absolute\"\n $flexDirection=\"row\"\n style={{ top: 6, left: 8, cursor: 'pointer' }}\n onClick={goToTableLauncher}\n >\n <Text $renderAs=\"ab2-bold\">NEW</Text>\n </FlexView>\n ),\n tooltipYCoOrdinates: 14, // Need some offset in Y direction from top\n } as IArrowTooltipProps,\n },\n {\n originalElementToHighlightRef: tablePaginationRef as React.RefObject<HTMLDivElement>,\n isActive: false,\n type: IndicatorType.NUDGE,\n indicator: {\n nudge: 'click',\n content: '',\n nudgePointerY: 20,\n } as INudgeProps,\n elementToHighlight: <></>,\n },\n ]);\n carouselRefs.current?.goToIndex(LESSON_CARD_INDEX);\n nextCoachmark(journeyId, false, SHOW_INITIAL_COACHMARK_AFTER_MS); // Show Coachmark => NEW\n nextCoachmark(journeyId, true, SHOW_INITIAL_TOOLTIP_AFTER_MS); // Show Nudge over Coachmark\n }\n\n // SHOW THE USER SELECT A TABLE\n addCoachmark(journeyId, {\n originalElementToHighlightRef: originalTableRef.current.labelRef,\n isActive: false,\n type: IndicatorType.TOOLTIP,\n elementToHighlight: <></>,\n indicator: {\n position: 'right',\n backgroundColor: 'YELLOW_4',\n width: 264,\n tooltipItem: (\n <FlexView>\n <Text $renderAs=\"ab2-bold\">\n Get faster at multiplication! Practice everyday and become a Tables champ.\n </Text>\n </FlexView>\n ),\n tooltipXCoOrdinates: labelDims.width + 50,\n tooltipYCoOrdinates: labelDims.height / 2,\n } as IArrowTooltipProps,\n });\n\n addCoachmark(journeyId, {\n originalElementToHighlightRef: originalTableRef.current.segmentedCardWrapperRef,\n isActive: false,\n type: IndicatorType.NUDGE,\n indicator: {\n nudge: 'click',\n content: (\n <Text $renderAs=\"ab1\" $color=\"WHITE\">\n {'Pick a table to start'}\n </Text>\n ),\n nudgePointerX: tableCardDims.width / 2 + 50,\n nudgePointerY: tableCardDims.height / 2,\n } as INudgeProps,\n elementToHighlight: (\n <TablesCard\n ref={highlightedTableRef}\n label={tablesData.label}\n data={tablesData.data}\n onPress={() => {}}\n onPressTableSegment={tableInfo => handleTableSegmentClick(tablesData, tableInfo)}\n />\n ),\n });\n },\n [\n addCoachmark,\n carouselRefs,\n goToTableLauncher,\n handleTableSegmentClick,\n journeyId,\n nextCoachmark,\n setJourney,\n ],\n );\n\n // Cleanup on unmount\n useEffect(() => {\n return () => {\n timerRefs.current.forEach(timer => clearTimeout(timer));\n timerRefs.current = [];\n };\n }, [journeyId]);\n\n return {\n tableRef: originalTableRef,\n startJourney,\n };\n};\n"],"names":["useTableLauncherJourney","carouselRefs","onTableSegmentClick","onJourneyComplete","journeyId","JOURNEY_ID_STUDENT","originalTableRef","useRef","highlightedTableRef","timerRefs","playButtonSound","useCircleSounds","nextCoachmark","setJourney","addCoachmark","endJourney","useJourney","trackAnalytics","useUIContext","handleEndJourney","useCallback","tableDetails","PLATFORM_EVENTS_STUDENT","Action","_a","_b","handleTableSegmentClick","launcherData","tableData","segmentedCardDims","tableCardDims","_c","IndicatorType","jsx","TablesCard","FlexView","Text","Fragment","SHOW_PICK_A_LEVEL_TOOLTIP_AFTER_MS","SHOW_PICK_A_LEVEL_NUDGE_AFTER_MS","startAnimationOnLabelAgain","START_ANIMATING_CLONED_ELEM","goToTableLauncher","TABLE_CARD_INDEX","GO_TO_TABLE_LAUNCHER_DURATION_MS","showNudge","SHOW_CLICK_TABLE_NUDGE_AFTER_MS","animateLabel","startJourney","tablesData","isTutorialOnboardingDone","paginationList","carouselNextBtnRef","tablePaginationRef","_d","labelDims","_e","S.Indicator","_h","LESSON_CARD_INDEX","SHOW_INITIAL_COACHMARK_AFTER_MS","SHOW_INITIAL_TOOLTIP_AFTER_MS","_f","IconButton","CaratRightIcon","GAME_LAUNCHER_ANALYTICS_EVENTS","_g","PUZZLE_CARD_INDEX","tableInfo","useEffect","timer"],"mappings":";;;;;;;;;;;;;;;;;AAyCO,MAAMA,KAA0B,CAAC;AAAA,EACtC,cAAAC;AAAA,EACA,qBAAAC;AAAA,EACA,mBAAAC;AACF,MAA6B;AAC3B,QAAMC,IAAYC,EAAmB,6BAE/BC,IAAmBC,EAAsB,IAAI,GAC7CC,IAAsBD,EAAsB,IAAI,GAEhDE,IAAYF,EAAwC,CAAA,CAAE,GAEtD,EAAE,iBAAAG,MAAoBC,KACtB,EAAE,eAAAC,GAAe,YAAAC,GAAY,cAAAC,GAAc,YAAAC,EAAA,IAAeC,KAC1D,EAAE,SAASC,EAAe,IAAIC,EAAa,GAE3CC,IAAmBC;AAAA,IACvB,CAACC,MAAiC;;AAChC,MAAAN,EAAWX,CAAS,GAEhBi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BAAqBA,EAAU,SAAS;AAAA,QAC1C;AAAA,MAAA,CACD,GAEDzC,EAAaV,GAAW;AAAA,QACtB,+BAA+BE,EAAiB,QAAQ;AAAA,QACxD,UAAU;AAAA,QACV,MAAM0B,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,KAAK1B;AAAA,YACL,OAAOyC,EAAW;AAAA,YAClB,MAAMA,EAAW;AAAA,YACjB,SAAS,MAAM;AAAA,YAAC;AAAA,YAChB,qBAAqB,CAAAmB,MAAa1C,EAAwBuB,GAAYmB,CAAS;AAAA,UAAA;AAAA,QACjF;AAAA,MAAA,CAEH;AAAA,IACH;AAAA,IACA;AAAA,MACEtD;AAAA,MACAb;AAAA,MACAyC;AAAA,MACAhB;AAAA,MACAtB;AAAA,MACAQ;AAAA,MACAC;AAAA,IACF;AAAA,EAAA;AAIF,SAAAwD,EAAU,MACD,MAAM;AACX,IAAA5D,EAAU,QAAQ,QAAQ,CAAS6D,MAAA,aAAaA,CAAK,CAAC,GACtD7D,EAAU,UAAU;EAAC,GAEtB,CAACL,CAAS,CAAC,GAEP;AAAA,IACL,UAAUE;AAAA,IACV,cAAA0C;AAAA,EAAA;AAEJ;"}
1
+ {"version":3,"file":"use-table-launcher-journey.js","sources":["../../../../../../src/features/circle-games/game-launcher/hooks/use-table-launcher-journey/use-table-launcher-journey.tsx"],"sourcesContent":["/* eslint-disable react-native/no-inline-styles */\nimport type { IArrowTooltipProps } from '../../../../ui/arrow-tooltip/arrow-tooltip-types';\nimport type { INudgeProps } from '../../../../ui/nudge/nudge-types';\nimport type { ITableCardRef, ITableDetails } from '../../comps/tables-card/tables-card-types';\nimport type {\n ITableInfo,\n ITables,\n} from '../../dal/use-get-circle-home-details-dal/use-get-circle-home-dal-types';\nimport type { IUseTableJourneyProps } from './use-table-launcher-journey-types';\n\nimport { useCallback, useEffect, useRef } from 'react';\n\nimport CaratRightIcon from '../../../../../assets/line-icons/icons/carat-right';\nimport { PLATFORM_EVENTS_STUDENT } from '../../../../analytics-events/platform-events-student';\nimport { useBreakpoint } from '../../../../hooks/use-breakpoint/use-breakpoint';\nimport { JOURNEY_ID_STUDENT } from '../../../../journey/journey-id/journey-id-student';\nimport { IndicatorType } from '../../../../journey/use-journey/constants';\nimport { useJourney } from '../../../../journey/use-journey/use-journey';\nimport IconButton from '../../../../ui/buttons/icon-button/icon-button';\nimport { useUIContext } from '../../../../ui/context/context';\nimport FlexView from '../../../../ui/layout/flex-view';\nimport Text from '../../../../ui/text/text';\nimport { CIRCLE_ONBOARDING_ANALYTICS_STEPS as Action } from '../../../enum/circle-onboarding-steps';\nimport { useCircleSounds } from '../../../hooks/use-circle-sounds/use-circle-sounds';\nimport { TablesCard } from '../../comps/tables-card/tables-card';\nimport { GAME_LAUNCHER_ANALYTICS_EVENTS } from '../../game-launcher-analytics-events';\nimport {\n LESSON_CARD_INDEX,\n PUZZLE_CARD_INDEX,\n SHOW_PICK_A_LEVEL_NUDGE_AFTER_MS,\n SHOW_PICK_A_LEVEL_TOOLTIP_AFTER_MS,\n TABLE_CARD_INDEX,\n} from './constants';\nimport {\n GO_TO_TABLE_LAUNCHER_DURATION_MS,\n SHOW_CLICK_TABLE_NUDGE_AFTER_MS,\n SHOW_INITIAL_COACHMARK_AFTER_MS,\n SHOW_INITIAL_TOOLTIP_AFTER_MS,\n START_ANIMATING_CLONED_ELEM,\n} from './constants';\nimport * as S from './use-table-launcher-journey-styled';\n\nexport const useTableLauncherJourney = ({\n carouselRefs,\n onTableSegmentClick,\n onJourneyComplete,\n}: IUseTableJourneyProps) => {\n const journeyId = JOURNEY_ID_STUDENT.CIRCLE_TABLES_INTRO_JOURNEY;\n const { isMobile } = useBreakpoint();\n\n const originalTableRef = useRef<ITableCardRef>(null);\n const highlightedTableRef = useRef<ITableCardRef>(null);\n\n const timerRefs = useRef<ReturnType<typeof setTimeout>[]>([]);\n\n const { playButtonSound } = useCircleSounds();\n const { nextCoachmark, setJourney, addCoachmark, endJourney } = useJourney();\n const { onEvent: trackAnalytics } = useUIContext();\n\n const handleEndJourney = useCallback(\n (tableDetails?: ITableDetails) => {\n endJourney(journeyId);\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 },\n [endJourney, journeyId, 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={handleEndJourney}\n onGoBackFromTableLevel={handleEndJourney}\n />\n ),\n indicator: {\n position: 'top',\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: segmentedCardDims.width / 2,\n tooltipYCoOrdinates: 45,\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: !isMobile && (\n <Text $renderAs=\"ab1\" $color=\"WHITE\">\n Pick a level\n </Text>\n ),\n nudgePointerX: tableCardDims.width / 2 + 50,\n nudgePointerY: tableCardDims.height * 0.4,\n } as INudgeProps,\n elementToHighlight: <></>,\n });\n\n nextCoachmark(journeyId, false, SHOW_PICK_A_LEVEL_TOOLTIP_AFTER_MS); // Show coachmark => Each table has 3... and Hide the previous two\n nextCoachmark(journeyId, true, SHOW_PICK_A_LEVEL_NUDGE_AFTER_MS); // Show nudge => Pick a level\n\n const startAnimationOnLabelAgain = setTimeout(() => {\n clearTimeout(startAnimationOnLabelAgain);\n highlightedTableRef.current?.startLabelAnimation('YELLOW_4');\n }, START_ANIMATING_CLONED_ELEM);\n\n timerRefs.current.push(startAnimationOnLabelAgain);\n },\n [addCoachmark, handleEndJourney, isMobile, journeyId, nextCoachmark],\n );\n\n const goToTableLauncher = useCallback(() => {\n playButtonSound();\n carouselRefs.current?.goToIndex(TABLE_CARD_INDEX);\n nextCoachmark(journeyId, false, GO_TO_TABLE_LAUNCHER_DURATION_MS);\n\n trackAnalytics(PLATFORM_EVENTS_STUDENT.ONBOARDING_STEP_VIEWED, {\n step: Action.TABLES,\n });\n\n const showNudge = setTimeout(() => {\n clearTimeout(showNudge);\n originalTableRef.current?.setLabelVisiblity(false);\n nextCoachmark(journeyId, true);\n }, SHOW_CLICK_TABLE_NUDGE_AFTER_MS);\n\n timerRefs.current.push(showNudge);\n\n const animateLabel = setTimeout(() => {\n clearTimeout(animateLabel);\n highlightedTableRef.current?.startLabelAnimation('YELLOW_4');\n }, START_ANIMATING_CLONED_ELEM);\n\n timerRefs.current.push(animateLabel);\n }, [carouselRefs, journeyId, nextCoachmark, playButtonSound, trackAnalytics]);\n\n const startJourney = useCallback(\n (tablesData: ITables, isTutorialOnboardingDone: boolean = false) => {\n const paginationList = carouselRefs.current?.indicatorRefs;\n const carouselNextBtnRef = carouselRefs.current?.nextBtnRef;\n const tablePaginationRef = paginationList?.[TABLE_CARD_INDEX];\n\n if (\n !originalTableRef.current?.segmentedCardWrapperRef.current ||\n !originalTableRef.current?.labelRef.current ||\n !paginationList ||\n !carouselNextBtnRef?.current ||\n !tablePaginationRef ||\n !tablePaginationRef.current\n ) {\n return;\n }\n\n const labelDims = originalTableRef.current.labelRef.current.getBoundingClientRect();\n const tableCardDims =\n originalTableRef.current?.segmentedCardWrapperRef.current.getBoundingClientRect();\n\n // TAKE THE USER TO THE TABLE CARD\n if (!isTutorialOnboardingDone) {\n setJourney(journeyId, [\n {\n originalElementToHighlightRef: carouselRefs.current?.nextBtnRef,\n isActive: false,\n type: IndicatorType.NUDGE,\n indicator: {\n nudge: 'click',\n content: !isMobile && (\n <Text $renderAs=\"ab1\" $color=\"WHITE\">\n Click to proceed\n </Text>\n ),\n nudgePointerX: 0,\n nudgePointerY: 0,\n } as INudgeProps,\n elementToHighlight: (\n <IconButton\n renderAs=\"secondary\"\n Icon={CaratRightIcon}\n onClick={goToTableLauncher}\n analyticsLabel={GAME_LAUNCHER_ANALYTICS_EVENTS.JOURNEY_NEXT_ACTIVITY}\n />\n ),\n },\n ]);\n carouselRefs.current?.goToIndex(PUZZLE_CARD_INDEX);\n nextCoachmark(journeyId, false, SHOW_INITIAL_COACHMARK_AFTER_MS); // Show nudge => Click to proceed\n } else {\n setJourney(journeyId, [\n {\n originalElementToHighlightRef: tablePaginationRef as React.RefObject<HTMLDivElement>,\n isActive: false,\n type: IndicatorType.TOOLTIP,\n elementToHighlight: <S.Indicator $isActive={false} />,\n indicator: {\n position: 'bottom',\n backgroundColor: 'YELLOW_4',\n width: 52,\n tooltipItem: (\n <FlexView\n $position=\"absolute\"\n $flexDirection=\"row\"\n style={{ top: 6, left: 8, cursor: 'pointer' }}\n onClick={goToTableLauncher}\n >\n <Text $renderAs=\"ab2-bold\">NEW</Text>\n </FlexView>\n ),\n tooltipYCoOrdinates: 14, // Need some offset in Y direction from top\n } as IArrowTooltipProps,\n },\n {\n originalElementToHighlightRef: tablePaginationRef as React.RefObject<HTMLDivElement>,\n isActive: false,\n type: IndicatorType.NUDGE,\n indicator: {\n nudge: 'click',\n content: '',\n nudgePointerY: 20,\n } as INudgeProps,\n elementToHighlight: <></>,\n },\n ]);\n carouselRefs.current?.goToIndex(LESSON_CARD_INDEX);\n nextCoachmark(journeyId, false, SHOW_INITIAL_COACHMARK_AFTER_MS); // Show Coachmark => NEW\n nextCoachmark(journeyId, true, SHOW_INITIAL_TOOLTIP_AFTER_MS); // Show Nudge over Coachmark\n }\n\n // SHOW THE USER SELECT A TABLE\n addCoachmark(journeyId, {\n originalElementToHighlightRef: originalTableRef.current.labelRef,\n isActive: false,\n type: IndicatorType.TOOLTIP,\n elementToHighlight: <></>,\n indicator: {\n position: 'top',\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 / 2,\n tooltipYCoOrdinates: labelDims.height + 10,\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: !isMobile && (\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 isMobile,\n journeyId,\n nextCoachmark,\n setJourney,\n ],\n );\n\n // Cleanup on unmount\n useEffect(() => {\n return () => {\n timerRefs.current.forEach(timer => clearTimeout(timer));\n timerRefs.current = [];\n };\n }, [journeyId]);\n\n return {\n tableRef: originalTableRef,\n startJourney,\n };\n};\n"],"names":["useTableLauncherJourney","carouselRefs","onTableSegmentClick","onJourneyComplete","journeyId","JOURNEY_ID_STUDENT","isMobile","useBreakpoint","originalTableRef","useRef","highlightedTableRef","timerRefs","playButtonSound","useCircleSounds","nextCoachmark","setJourney","addCoachmark","endJourney","useJourney","trackAnalytics","useUIContext","handleEndJourney","useCallback","tableDetails","PLATFORM_EVENTS_STUDENT","Action","_a","_b","handleTableSegmentClick","launcherData","tableData","segmentedCardDims","tableCardDims","_c","IndicatorType","jsx","TablesCard","FlexView","Text","Fragment","SHOW_PICK_A_LEVEL_TOOLTIP_AFTER_MS","SHOW_PICK_A_LEVEL_NUDGE_AFTER_MS","startAnimationOnLabelAgain","START_ANIMATING_CLONED_ELEM","goToTableLauncher","TABLE_CARD_INDEX","GO_TO_TABLE_LAUNCHER_DURATION_MS","showNudge","SHOW_CLICK_TABLE_NUDGE_AFTER_MS","animateLabel","startJourney","tablesData","isTutorialOnboardingDone","paginationList","carouselNextBtnRef","tablePaginationRef","_d","labelDims","_e","S.Indicator","_h","LESSON_CARD_INDEX","SHOW_INITIAL_COACHMARK_AFTER_MS","SHOW_INITIAL_TOOLTIP_AFTER_MS","_f","IconButton","CaratRightIcon","GAME_LAUNCHER_ANALYTICS_EVENTS","_g","PUZZLE_CARD_INDEX","tableInfo","useEffect","timer"],"mappings":";;;;;;;;;;;;;;;;;;AA0CO,MAAMA,KAA0B,CAAC;AAAA,EACtC,cAAAC;AAAA,EACA,qBAAAC;AAAA,EACA,mBAAAC;AACF,MAA6B;AAC3B,QAAMC,IAAYC,EAAmB,6BAC/B,EAAE,UAAAC,MAAaC,KAEf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;EAAC,GAEtB,CAACP,CAAS,CAAC,GAEP;AAAA,IACL,UAAUI;AAAA,IACV,cAAA0C;AAAA,EAAA;AAEJ;"}
@@ -1,5 +1,6 @@
1
- const o = 64 + (window.topInset || 0);
1
+ const E = 64, H = 129;
2
2
  export {
3
- o as HEADER_HEIGHT
3
+ E as HEADER_HEIGHT,
4
+ H as JOURNEY_SEPARATOR_HEIGHT
4
5
  };
5
6
  //# sourceMappingURL=constants.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"constants.js","sources":["../../../../../src/features/circle-games/games/tutorial/constants.ts"],"sourcesContent":["export const HEADER_HEIGHT = 64 + (window.topInset || 0);\n"],"names":["HEADER_HEIGHT"],"mappings":"AAAa,MAAAA,IAAgB,MAAM,OAAO,YAAY;"}
1
+ {"version":3,"file":"constants.js","sources":["../../../../../src/features/circle-games/games/tutorial/constants.ts"],"sourcesContent":["export const HEADER_HEIGHT = 64;\n\nexport const JOURNEY_SEPARATOR_HEIGHT = 129;\n"],"names":["HEADER_HEIGHT","JOURNEY_SEPARATOR_HEIGHT"],"mappings":"AAAO,MAAMA,IAAgB,IAEhBC,IAA2B;"}
@@ -1,6 +1,6 @@
1
1
  import o from "styled-components";
2
- import { HEADER_HEIGHT as t } from "./constants.js";
3
- const n = o.div`
2
+ import { HEADER_HEIGHT as e, JOURNEY_SEPARATOR_HEIGHT as t } from "./constants.js";
3
+ const s = o.div`
4
4
  display: flex;
5
5
  flex-direction: column;
6
6
  height: 100%;
@@ -9,29 +9,29 @@ const n = o.div`
9
9
  position: relative;
10
10
  width: inherit;
11
11
  `, d = o.div`
12
- height: ${t}px;
13
- padding-top: ${(window.topInset || 0) + 24}px;
12
+ height: ${e}px;
13
+ padding-top: 24px;
14
14
  width: 100%;
15
15
  background: ${({ theme: i }) => i.colors.WHITE_T_03};
16
16
  backdrop-filter: blur(40px);
17
17
  position: relative;
18
18
  flex-shrink: 0;
19
- `, s = o.div`
19
+ `, a = o.div`
20
20
  position: absolute;
21
21
  right: 16px;
22
- top: ${(window.topInset || 0) + 22}px;
22
+ top: 22px;
23
23
  z-index: 1;
24
24
  &:hover {
25
25
  background: ${({ theme: i }) => i.colors.BLACK_4};
26
26
  cursor: pointer;
27
27
  }
28
- `, p = o.div`
28
+ `, l = o.div`
29
29
  display: flex;
30
30
  flex-direction: column;
31
31
  /* overflow: hidden; */
32
32
  flex-grow: 1;
33
33
  position: relative;
34
- `, a = o.div`
34
+ `, p = o.div`
35
35
  width: 100%;
36
36
  position: absolute;
37
37
  top: 0;
@@ -39,20 +39,24 @@ const n = o.div`
39
39
  bottom: 0;
40
40
  right: 0;
41
41
  & video {
42
+ height: ${({ isJourneyActive: i }) => i ? `calc(100% - ${t}px)` : "100%"};
43
+ transform: translateY(
44
+ ${({ isJourneyActive: i }) => i ? `${t}px` : 0}
45
+ );
46
+ transition: all 0.2s ease-in-out;
42
47
  width: 100%;
43
- height: 100%;
44
48
  }
45
- `, l = o.div`
49
+ `, h = o.div`
46
50
  height: 40px;
47
51
  width: 100%;
48
52
  position: relative;
49
53
  display: flex;
50
- `, h = o.div`
54
+ `, c = o.div`
51
55
  height: 2px;
52
56
  position: relative;
53
57
  width: 100%;
54
58
  z-index: 1;
55
- `, c = o.div`
59
+ `, x = o.div`
56
60
  height: inherit;
57
61
  background: ${({ theme: i }) => i.colors.WHITE};
58
62
  position: absolute;
@@ -61,13 +65,13 @@ const n = o.div`
61
65
  transition: width 0.4s linear;
62
66
  `;
63
67
  export {
64
- p as GameTutorialContainer,
68
+ l as GameTutorialContainer,
65
69
  d as GameTutorialHeader,
66
- n as GameTutorialWrapper,
67
- s as HeaderIconContainer,
68
- a as VideoContainer,
69
- c as VideoProgress,
70
- h as VideoProgressContainer,
71
- l as VideoProgressWrapper
70
+ s as GameTutorialWrapper,
71
+ a as HeaderIconContainer,
72
+ p as VideoContainer,
73
+ x as VideoProgress,
74
+ c as VideoProgressContainer,
75
+ h as VideoProgressWrapper
72
76
  };
73
77
  //# sourceMappingURL=tutorial-styled.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"tutorial-styled.js","sources":["../../../../../src/features/circle-games/games/tutorial/tutorial-styled.tsx"],"sourcesContent":["import styled from 'styled-components';\n\nimport { HEADER_HEIGHT } from './constants';\n\nexport const GameTutorialWrapper = styled.div`\n display: flex;\n flex-direction: column;\n height: 100%;\n min-height: 250px;\n background: ${({ theme }) => theme.colors.BLACK_1};\n position: relative;\n width: inherit;\n`;\n\nexport const GameTutorialHeader = styled.div`\n height: ${HEADER_HEIGHT}px;\n padding-top: ${(window.topInset || 0) + 24}px;\n width: 100%;\n background: ${({ theme }) => theme.colors.WHITE_T_03};\n backdrop-filter: blur(40px);\n position: relative;\n flex-shrink: 0;\n`;\n\nexport const HeaderIconContainer = styled.div`\n position: absolute;\n right: 16px;\n top: ${(window.topInset || 0) + 22}px;\n z-index: 1;\n &:hover {\n background: ${({ theme }) => theme.colors.BLACK_4};\n cursor: pointer;\n }\n`;\n\nexport const GameTutorialContainer = styled.div`\n display: flex;\n flex-direction: column;\n /* overflow: hidden; */\n flex-grow: 1;\n position: relative;\n`;\n\nexport const VideoContainer = styled.div`\n width: 100%;\n position: absolute;\n top: 0;\n left: 0;\n bottom: 0;\n right: 0;\n & video {\n width: 100%;\n height: 100%;\n }\n`;\n\nexport const VideoProgressWrapper = styled.div`\n height: 40px;\n width: 100%;\n position: relative;\n display: flex;\n`;\n\nexport const VideoProgressContainer = styled.div`\n height: 2px;\n position: relative;\n width: 100%;\n z-index: 1;\n`;\n\nexport const VideoProgress = styled.div<{ $width: number }>`\n height: inherit;\n background: ${({ theme }) => theme.colors.WHITE};\n position: absolute;\n z-index: 2;\n width: ${({ $width }) => $width || 0}%;\n transition: width 0.4s linear;\n`;\n"],"names":["GameTutorialWrapper","styled","theme","GameTutorialHeader","HEADER_HEIGHT","HeaderIconContainer","GameTutorialContainer","VideoContainer","VideoProgressWrapper","VideoProgressContainer","VideoProgress","$width"],"mappings":";;AAIO,MAAMA,IAAsBC,EAAO;AAAA;AAAA;AAAA;AAAA;AAAA,gBAK1B,CAAC,EAAE,OAAAC,EAAA,MAAYA,EAAM,OAAO,OAAO;AAAA;AAAA;AAAA,GAKtCC,IAAqBF,EAAO;AAAA,YAC7BG,CAAa;AAAA,kBACP,OAAO,YAAY,KAAK,EAAE;AAAA;AAAA,gBAE5B,CAAC,EAAE,OAAAF,EAAA,MAAYA,EAAM,OAAO,UAAU;AAAA;AAAA;AAAA;AAAA,GAMzCG,IAAsBJ,EAAO;AAAA;AAAA;AAAA,UAGhC,OAAO,YAAY,KAAK,EAAE;AAAA;AAAA;AAAA,kBAGlB,CAAC,EAAE,OAAAC,EAAA,MAAYA,EAAM,OAAO,OAAO;AAAA;AAAA;AAAA,GAKxCI,IAAwBL,EAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,GAQ/BM,IAAiBN,EAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,GAaxBO,IAAuBP,EAAO;AAAA;AAAA;AAAA;AAAA;AAAA,GAO9BQ,IAAyBR,EAAO;AAAA;AAAA;AAAA;AAAA;AAAA,GAOhCS,IAAgBT,EAAO;AAAA;AAAA,gBAEpB,CAAC,EAAE,OAAAC,EAAA,MAAYA,EAAM,OAAO,KAAK;AAAA;AAAA;AAAA,WAGtC,CAAC,EAAE,QAAAS,QAAaA,KAAU,CAAC;AAAA;AAAA;"}
1
+ {"version":3,"file":"tutorial-styled.js","sources":["../../../../../src/features/circle-games/games/tutorial/tutorial-styled.tsx"],"sourcesContent":["import styled from 'styled-components';\n\nimport { HEADER_HEIGHT, JOURNEY_SEPARATOR_HEIGHT } from './constants';\n\nexport const GameTutorialWrapper = styled.div`\n display: flex;\n flex-direction: column;\n height: 100%;\n min-height: 250px;\n background: ${({ theme }) => theme.colors.BLACK_1};\n position: relative;\n width: inherit;\n`;\n\nexport const GameTutorialHeader = styled.div`\n height: ${HEADER_HEIGHT}px;\n padding-top: 24px;\n width: 100%;\n background: ${({ theme }) => theme.colors.WHITE_T_03};\n backdrop-filter: blur(40px);\n position: relative;\n flex-shrink: 0;\n`;\n\nexport const HeaderIconContainer = styled.div`\n position: absolute;\n right: 16px;\n top: 22px;\n z-index: 1;\n &:hover {\n background: ${({ theme }) => theme.colors.BLACK_4};\n cursor: pointer;\n }\n`;\n\nexport const GameTutorialContainer = styled.div`\n display: flex;\n flex-direction: column;\n /* overflow: hidden; */\n flex-grow: 1;\n position: relative;\n`;\n\nexport const VideoContainer = styled.div<{ isJourneyActive?: boolean }>`\n width: 100%;\n position: absolute;\n top: 0;\n left: 0;\n bottom: 0;\n right: 0;\n & video {\n height: ${({ isJourneyActive }) =>\n isJourneyActive ? `calc(100% - ${JOURNEY_SEPARATOR_HEIGHT}px)` : '100%'};\n transform: translateY(\n ${({ isJourneyActive }) => (isJourneyActive ? `${JOURNEY_SEPARATOR_HEIGHT}px` : 0)}\n );\n transition: all 0.2s ease-in-out;\n width: 100%;\n }\n`;\n\nexport const VideoProgressWrapper = styled.div`\n height: 40px;\n width: 100%;\n position: relative;\n display: flex;\n`;\n\nexport const VideoProgressContainer = styled.div`\n height: 2px;\n position: relative;\n width: 100%;\n z-index: 1;\n`;\n\nexport const VideoProgress = styled.div<{ $width: number }>`\n height: inherit;\n background: ${({ theme }) => theme.colors.WHITE};\n position: absolute;\n z-index: 2;\n width: ${({ $width }) => $width || 0}%;\n transition: width 0.4s linear;\n`;\n"],"names":["GameTutorialWrapper","styled","theme","GameTutorialHeader","HEADER_HEIGHT","HeaderIconContainer","GameTutorialContainer","VideoContainer","isJourneyActive","JOURNEY_SEPARATOR_HEIGHT","VideoProgressWrapper","VideoProgressContainer","VideoProgress","$width"],"mappings":";;AAIO,MAAMA,IAAsBC,EAAO;AAAA;AAAA;AAAA;AAAA;AAAA,gBAK1B,CAAC,EAAE,OAAAC,EAAA,MAAYA,EAAM,OAAO,OAAO;AAAA;AAAA;AAAA,GAKtCC,IAAqBF,EAAO;AAAA,YAC7BG,CAAa;AAAA;AAAA;AAAA,gBAGT,CAAC,EAAE,OAAAF,EAAA,MAAYA,EAAM,OAAO,UAAU;AAAA;AAAA;AAAA;AAAA,GAMzCG,IAAsBJ,EAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAMxB,CAAC,EAAE,OAAAC,EAAA,MAAYA,EAAM,OAAO,OAAO;AAAA;AAAA;AAAA,GAKxCI,IAAwBL,EAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,GAQ/BM,IAAiBN,EAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,cAQvB,CAAC,EAAE,iBAAAO,EAAgB,MAC3BA,IAAkB,eAAeC,CAAwB,QAAQ,MAAM;AAAA;AAAA,QAErE,CAAC,EAAE,iBAAAD,EAAgB,MAAOA,IAAkB,GAAGC,CAAwB,OAAO,CAAE;AAAA;AAAA;AAAA;AAAA;AAAA,GAO3EC,IAAuBT,EAAO;AAAA;AAAA;AAAA;AAAA;AAAA,GAO9BU,IAAyBV,EAAO;AAAA;AAAA;AAAA;AAAA;AAAA,GAOhCW,IAAgBX,EAAO;AAAA;AAAA,gBAEpB,CAAC,EAAE,OAAAC,EAAA,MAAYA,EAAM,OAAO,KAAK;AAAA;AAAA;AAAA,WAGtC,CAAC,EAAE,QAAAW,QAAaA,KAAU,CAAC;AAAA;AAAA;"}
@@ -1,44 +1,44 @@
1
- import { jsxs as a, jsx as r } from "react/jsx-runtime";
2
- import { useState as l, useRef as f, useCallback as h } from "react";
3
- import g from "../../../../assets/line-icons/icons/cross.js";
4
- import C from "../../../ui/text/text.js";
5
- import { GameTutorialWrapper as I, GameTutorialHeader as V, HeaderIconContainer as x, GameTutorialContainer as T, VideoContainer as $, VideoProgressWrapper as G, VideoProgressContainer as H, VideoProgress as P } from "./tutorial-styled.js";
6
- const E = ({
7
- src: d,
8
- title: t,
9
- onCross: o,
10
- showProgress: m = !0,
11
- onTutorialPlayedOnce: e
12
- }) => {
13
- const [i, u] = l(0), s = f(!1), p = h(
14
- (n) => {
15
- const c = (n.target.currentTime || 0) / (n.target.duration || 1) * 100;
16
- c >= 90 && !s.current && (s.current = !0, e == null || e()), u(c);
17
- },
18
- [e]
19
- );
20
- return /* @__PURE__ */ a(I, { children: [
21
- (t || o) && /* @__PURE__ */ a(V, { children: [
22
- t && /* @__PURE__ */ r(C, { $renderAs: "ac3", $color: "WHITE", $align: "center", children: t }),
23
- o && /* @__PURE__ */ r(x, { children: /* @__PURE__ */ r(g, { color: "#fff", onClick: o }) })
24
- ] }),
25
- /* @__PURE__ */ r(T, { children: /* @__PURE__ */ r($, { children: /* @__PURE__ */ r(
26
- "video",
27
- {
28
- loop: !0,
29
- autoPlay: !0,
30
- muted: !0,
31
- src: d,
32
- onTimeUpdate: p,
33
- disablePictureInPicture: !0,
34
- itemType: "video/mp4",
35
- playsInline: !0
36
- }
37
- ) }) }),
38
- m && /* @__PURE__ */ r(G, { children: /* @__PURE__ */ r(H, { children: i > 0 && /* @__PURE__ */ r(P, { $width: i }) }) })
39
- ] });
40
- };
1
+ import { jsxs as d, jsx as r } from "react/jsx-runtime";
2
+ import { forwardRef as I, useState as v, useRef as u, useCallback as C, useImperativeHandle as V } from "react";
3
+ import x from "../../../../assets/line-icons/icons/cross.js";
4
+ import { useJourney as H } from "../../../journey/use-journey/use-journey.js";
5
+ import T from "../../../ui/text/text.js";
6
+ import { GameTutorialWrapper as $, GameTutorialHeader as G, HeaderIconContainer as P, GameTutorialContainer as R, VideoContainer as W, VideoProgressWrapper as b, VideoProgressContainer as j, VideoProgress as k } from "./tutorial-styled.js";
7
+ const q = I(
8
+ ({ src: m, title: o, onCross: t, showProgress: p = !0, onTutorialPlayedOnce: e }, f) => {
9
+ const [i, l] = v(0), n = u(!1), s = u(null), { isJourneyActive: h } = H(), g = C(
10
+ (c) => {
11
+ const a = (c.target.currentTime || 0) / (c.target.duration || 1) * 100;
12
+ a >= 90 && !n.current && (n.current = !0, e == null || e()), l(a);
13
+ },
14
+ [e]
15
+ );
16
+ return V(f, () => ({
17
+ videoRef: s
18
+ })), /* @__PURE__ */ d($, { children: [
19
+ (o || t) && /* @__PURE__ */ d(G, { children: [
20
+ o && /* @__PURE__ */ r(T, { $renderAs: "ac3", $color: "WHITE", $align: "center", children: o }),
21
+ t && /* @__PURE__ */ r(P, { children: /* @__PURE__ */ r(x, { color: "#fff", onClick: t }) })
22
+ ] }),
23
+ /* @__PURE__ */ r(R, { children: /* @__PURE__ */ r(W, { isJourneyActive: h, children: /* @__PURE__ */ r(
24
+ "video",
25
+ {
26
+ ref: s,
27
+ loop: !0,
28
+ autoPlay: !0,
29
+ muted: !0,
30
+ src: m,
31
+ onTimeUpdate: g,
32
+ disablePictureInPicture: !0,
33
+ itemType: "video/mp4",
34
+ playsInline: !0
35
+ }
36
+ ) }) }),
37
+ p && /* @__PURE__ */ r(b, { children: /* @__PURE__ */ r(j, { children: i > 0 && /* @__PURE__ */ r(k, { $width: i }) }) })
38
+ ] });
39
+ }
40
+ );
41
41
  export {
42
- E as Tutorial
42
+ q as Tutorial
43
43
  };
44
44
  //# sourceMappingURL=tutorial.js.map