@cuemath/leap 2.8.57 → 2.8.58

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.
@@ -1,6 +1,6 @@
1
1
  import { jsx as r, Fragment as R } from "react/jsx-runtime";
2
- import { useRef as A, useCallback as C, useEffect as V } from "react";
3
- import X from "../../../../../assets/line-icons/icons/carat-right.js";
2
+ import { useRef as A, useCallback as C, useEffect as X } from "react";
3
+ import J from "../../../../../assets/line-icons/icons/carat-right.js";
4
4
  import { PLATFORM_EVENTS_STUDENT as G } from "../../../../analytics-events/platform-events-student.js";
5
5
  import { JOURNEY_ID_STUDENT as K } from "../../../../journey/journey-id/journey-id-student.js";
6
6
  import { IndicatorType as d } from "../../../../journey/use-journey/constants.js";
@@ -13,21 +13,22 @@ import { CIRCLE_ONBOARDING_ANALYTICS_STEPS as v } from "../../../enum/circle-onb
13
13
  import { useCircleSounds as z } from "../../../hooks/use-circle-sounds/use-circle-sounds.js";
14
14
  import { TablesCard as M } from "../../comps/tables-card/tables-card.js";
15
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 J, LESSON_CARD_INDEX as ie, SHOW_INITIAL_TOOLTIP_AFTER_MS as le } from "./constants.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
17
  import { Indicator as ce } from "./use-table-launcher-journey-styled.js";
18
18
  const Oe = ({
19
19
  carouselRefs: a,
20
- onTableSegmentClick: S
20
+ onTableSegmentClick: S,
21
+ onJourneyComplete: P
21
22
  }) => {
22
- const e = K.CIRCLE_TABLES_INTRO_JOURNEY, t = A(null), p = A(null), L = A(!1), T = A([]), { playButtonSound: P } = z(), { nextCoachmark: o, setJourney: I, addCoachmark: u, endJourney: y } = j(), { onEvent: _ } = q(), b = C(
23
+ const e = K.CIRCLE_TABLES_INTRO_JOURNEY, t = A(null), _ = A(null), L = A(!1), T = A([]), { playButtonSound: H } = z(), { nextCoachmark: o, setJourney: I, addCoachmark: u } = j(), { onEvent: p } = q(), b = C(
23
24
  (n) => {
24
25
  var c, i;
25
- n && S(n), _(G.ONBOARDING_STEP_COMPLETED, {
26
+ n && S(n), p(G.ONBOARDING_STEP_COMPLETED, {
26
27
  step: v.TABLES
27
- }), (c = t == null ? void 0 : t.current) == null || c.setLabelVisiblity(!0), (i = t == null ? void 0 : t.current) == null || i.stopLabelAnimation(), o(e, !1), y(e);
28
+ }), (c = t == null ? void 0 : t.current) == null || c.setLabelVisiblity(!0), (i = t == null ? void 0 : t.current) == null || i.stopLabelAnimation(), P(e), o(e, !1);
28
29
  },
29
- [y, e, o, S, _]
30
- ), H = C(
30
+ [e, o, P, S, p]
31
+ ), y = C(
31
32
  (n, c) => {
32
33
  var g, E, h;
33
34
  if (!((g = t.current) != null && g.segmentedCardWrapperRef.current) || !((E = t.current) != null && E.labelRef.current))
@@ -40,7 +41,7 @@ const Oe = ({
40
41
  elementToHighlight: /* @__PURE__ */ r(
41
42
  M,
42
43
  {
43
- ref: p,
44
+ ref: _,
44
45
  defaultTable: c,
45
46
  label: n.label,
46
47
  data: n.data,
@@ -70,14 +71,14 @@ const Oe = ({
70
71
  }), o(e, !1, ee), o(e, !0, te);
71
72
  const s = setTimeout(() => {
72
73
  var f;
73
- clearTimeout(s), (f = p.current) == null || f.startLabelAnimation("YELLOW_4");
74
+ clearTimeout(s), (f = _.current) == null || f.startLabelAnimation("YELLOW_4");
74
75
  }, $);
75
76
  T.current.push(s);
76
77
  },
77
78
  [u, b, e, o]
78
79
  ), O = C(() => {
79
80
  var i;
80
- P(), (i = a.current) == null || i.goToIndex(x), o(e, !1, re), _(G.ONBOARDING_STEP_VIEWED, {
81
+ H(), (i = a.current) == null || i.goToIndex(x), o(e, !1, re), p(G.ONBOARDING_STEP_VIEWED, {
81
82
  step: v.TABLES
82
83
  });
83
84
  const n = setTimeout(() => {
@@ -87,10 +88,10 @@ const Oe = ({
87
88
  T.current.push(n);
88
89
  const c = setTimeout(() => {
89
90
  var l;
90
- clearTimeout(c), (l = p.current) == null || l.startLabelAnimation("YELLOW_4");
91
+ clearTimeout(c), (l = _.current) == null || l.startLabelAnimation("YELLOW_4");
91
92
  }, $);
92
93
  T.current.push(c);
93
- }, [a, e, o, P, _]), w = C(
94
+ }, [a, e, o, H, p]), F = C(
94
95
  (n, c = !1) => {
95
96
  var h, f, D, W, Y, k, B, U;
96
97
  if (L.current)
@@ -135,7 +136,7 @@ const Oe = ({
135
136
  },
136
137
  elementToHighlight: /* @__PURE__ */ r(R, {})
137
138
  }
138
- ]), (U = a.current) == null || U.goToIndex(ie), o(e, !1, J), o(e, !0, le)) : (I(e, [
139
+ ]), (U = a.current) == null || U.goToIndex(ie), o(e, !1, w), o(e, !0, le)) : (I(e, [
139
140
  {
140
141
  originalElementToHighlightRef: (k = a.current) == null ? void 0 : k.nextBtnRef,
141
142
  isActive: !1,
@@ -150,13 +151,13 @@ const Oe = ({
150
151
  Z,
151
152
  {
152
153
  renderAs: "secondary",
153
- Icon: X,
154
+ Icon: J,
154
155
  onClick: O,
155
156
  analyticsLabel: Q.JOURNEY_NEXT_ACTIVITY
156
157
  }
157
158
  )
158
159
  }
159
- ]), (B = a.current) == null || B.goToIndex(oe), o(e, !1, J)), u(e, {
160
+ ]), (B = a.current) == null || B.goToIndex(oe), o(e, !1, w)), u(e, {
160
161
  originalElementToHighlightRef: t.current.labelRef,
161
162
  isActive: !1,
162
163
  type: d.TOOLTIP,
@@ -182,12 +183,12 @@ const Oe = ({
182
183
  elementToHighlight: /* @__PURE__ */ r(
183
184
  M,
184
185
  {
185
- ref: p,
186
+ ref: _,
186
187
  label: n.label,
187
188
  data: n.data,
188
189
  onPress: () => {
189
190
  },
190
- onPressTableSegment: (F) => H(n, F)
191
+ onPressTableSegment: (V) => y(n, V)
191
192
  }
192
193
  )
193
194
  });
@@ -196,17 +197,17 @@ const Oe = ({
196
197
  u,
197
198
  a,
198
199
  O,
199
- H,
200
+ y,
200
201
  e,
201
202
  o,
202
203
  I
203
204
  ]
204
205
  );
205
- return V(() => () => {
206
+ return X(() => () => {
206
207
  T.current.forEach((n) => clearTimeout(n)), T.current = [], L.current = !1;
207
208
  }, [e]), {
208
209
  tableRef: t,
209
- startJourney: w
210
+ startJourney: F
210
211
  };
211
212
  };
212
213
  export {
@@ -1 +1 @@
1
- {"version":3,"file":"use-table-launcher-journey.js","sources":["../../../../../../src/features/circle-games/game-launcher/hooks/use-table-launcher-journey/use-table-launcher-journey.tsx"],"sourcesContent":["/* eslint-disable react-native/no-inline-styles */\nimport type { IArrowTooltipProps } from '../../../../ui/arrow-tooltip/arrow-tooltip-types';\nimport type { INudgeProps } from '../../../../ui/nudge/nudge-types';\nimport type { ITableCardRef, ITableDetails } from '../../comps/tables-card/tables-card-types';\nimport type {\n ITableInfo,\n ITables,\n} from '../../dal/use-get-circle-home-details-dal/use-get-circle-home-dal-types';\nimport type { IUseTableJourneyProps } from './use-table-launcher-journey-types';\n\nimport { useCallback, useEffect, useRef } from 'react';\n\nimport CaratRightIcon from '../../../../../assets/line-icons/icons/carat-right';\nimport { PLATFORM_EVENTS_STUDENT } from '../../../../analytics-events/platform-events-student';\nimport { JOURNEY_ID_STUDENT } from '../../../../journey/journey-id/journey-id-student';\nimport { IndicatorType } from '../../../../journey/use-journey/constants';\nimport { useJourney } from '../../../../journey/use-journey/use-journey';\nimport IconButton from '../../../../ui/buttons/icon-button/icon-button';\nimport { useUIContext } from '../../../../ui/context/context';\nimport FlexView from '../../../../ui/layout/flex-view';\nimport Text from '../../../../ui/text/text';\nimport { CIRCLE_ONBOARDING_ANALYTICS_STEPS as Action } from '../../../enum/circle-onboarding-steps';\nimport { useCircleSounds } from '../../../hooks/use-circle-sounds/use-circle-sounds';\nimport { TablesCard } from '../../comps/tables-card/tables-card';\nimport { GAME_LAUNCHER_ANALYTICS_EVENTS } from '../../game-launcher-analytics-events';\nimport {\n LESSON_CARD_INDEX,\n PUZZLE_CARD_INDEX,\n SHOW_PICK_A_LEVEL_NUDGE_AFTER_MS,\n SHOW_PICK_A_LEVEL_TOOLTIP_AFTER_MS,\n TABLE_CARD_INDEX,\n} from './constants';\nimport {\n GO_TO_TABLE_LAUNCHER_DURATION_MS,\n SHOW_CLICK_TABLE_NUDGE_AFTER_MS,\n SHOW_INITIAL_COACHMARK_AFTER_MS,\n SHOW_INITIAL_TOOLTIP_AFTER_MS,\n START_ANIMATING_CLONED_ELEM,\n} from './constants';\nimport * as S from './use-table-launcher-journey-styled';\n\nexport const useTableLauncherJourney = ({\n carouselRefs,\n onTableSegmentClick,\n}: IUseTableJourneyProps) => {\n const journeyId = JOURNEY_ID_STUDENT.CIRCLE_TABLES_INTRO_JOURNEY;\n const originalTableRef = useRef<ITableCardRef>(null);\n const highlightedTableRef = useRef<ITableCardRef>(null);\n const isJourneyInProgress = useRef(false);\n\n const timerRefs = useRef<ReturnType<typeof setTimeout>[]>([]);\n\n const { playButtonSound } = useCircleSounds();\n const { nextCoachmark, setJourney, addCoachmark, endJourney } = useJourney();\n const { onEvent: trackAnalytics } = useUIContext();\n\n const handleEndJourney = useCallback(\n (tableDetails?: ITableDetails) => {\n // Only when User clicked on play\n if (tableDetails) {\n onTableSegmentClick(tableDetails);\n }\n trackAnalytics(PLATFORM_EVENTS_STUDENT.ONBOARDING_STEP_COMPLETED, {\n step: Action.TABLES,\n });\n\n // Reset original table card ref label\n originalTableRef?.current?.setLabelVisiblity(true);\n originalTableRef?.current?.stopLabelAnimation();\n nextCoachmark(journeyId, false);\n endJourney(journeyId);\n },\n [endJourney, journeyId, nextCoachmark, 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 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 // 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 isJourneyInProgress.current = false;\n };\n }, [journeyId]);\n\n return {\n tableRef: originalTableRef,\n startJourney,\n };\n};\n"],"names":["useTableLauncherJourney","carouselRefs","onTableSegmentClick","journeyId","JOURNEY_ID_STUDENT","originalTableRef","useRef","highlightedTableRef","isJourneyInProgress","timerRefs","playButtonSound","useCircleSounds","nextCoachmark","setJourney","addCoachmark","endJourney","useJourney","trackAnalytics","useUIContext","handleEndJourney","useCallback","tableDetails","PLATFORM_EVENTS_STUDENT","Action","_a","_b","handleTableSegmentClick","launcherData","tableData","segmentedCardDims","tableCardDims","_c","IndicatorType","jsx","TablesCard","FlexView","Text","Fragment","SHOW_PICK_A_LEVEL_TOOLTIP_AFTER_MS","SHOW_PICK_A_LEVEL_NUDGE_AFTER_MS","startAnimationOnLabelAgain","START_ANIMATING_CLONED_ELEM","goToTableLauncher","TABLE_CARD_INDEX","GO_TO_TABLE_LAUNCHER_DURATION_MS","showNudge","SHOW_CLICK_TABLE_NUDGE_AFTER_MS","animateLabel","startJourney","tablesData","isTutorialOnboardingDone","paginationList","carouselNextBtnRef","tablePaginationRef","_d","labelDims","_e","S.Indicator","_h","LESSON_CARD_INDEX","SHOW_INITIAL_COACHMARK_AFTER_MS","SHOW_INITIAL_TOOLTIP_AFTER_MS","_f","IconButton","CaratRightIcon","GAME_LAUNCHER_ANALYTICS_EVENTS","_g","PUZZLE_CARD_INDEX","tableInfo","useEffect","timer"],"mappings":";;;;;;;;;;;;;;;;;AAyCO,MAAMA,KAA0B,CAAC;AAAA,EACtC,cAAAC;AAAA,EACA,qBAAAC;AACF,MAA6B;AAC3B,QAAMC,IAAYC,EAAmB,6BAC/BC,IAAmBC,EAAsB,IAAI,GAC7CC,IAAsBD,EAAsB,IAAI,GAChDE,IAAsBF,EAAO,EAAK,GAElCG,IAAYH,EAAwC,CAAA,CAAE,GAEtD,EAAE,iBAAAI,MAAoBC,KACtB,EAAE,eAAAC,GAAe,YAAAC,GAAY,cAAAC,GAAc,YAAAC,EAAA,IAAeC,KAC1D,EAAE,SAASC,EAAe,IAAIC,EAAa,GAE3CC,IAAmBC;AAAA,IACvB,CAACC,MAAi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AF,EAACG,KAAK,WAAU,YAAW,wFAE3B,EACF,CAAA;AAAA,UAEF,qBAAqBmB,EAAU,QAAQ;AAAA,UACvC,qBAAqBA,EAAU,SAAS;AAAA,QAC1C;AAAA,MAAA,CACD,GAEDzC,EAAaX,GAAW;AAAA,QACtB,+BAA+BE,EAAiB,QAAQ;AAAA,QACxD,UAAU;AAAA,QACV,MAAM2B,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,KAAK3B;AAAA,YACL,OAAO0C,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,MACAvB;AAAA,MACAS;AAAA,MACAC;AAAA,IACF;AAAA,EAAA;AAIF,SAAAwD,EAAU,MACD,MAAM;AACX,IAAA5D,EAAU,QAAQ,QAAQ,CAAS6D,MAAA,aAAaA,CAAK,CAAC,GACtD7D,EAAU,UAAU,IACpBD,EAAoB,UAAU;AAAA,EAAA,GAE/B,CAACL,CAAS,CAAC,GAEP;AAAA,IACL,UAAUE;AAAA,IACV,cAAA2C;AAAA,EAAA;AAEJ;"}
1
+ {"version":3,"file":"use-table-launcher-journey.js","sources":["../../../../../../src/features/circle-games/game-launcher/hooks/use-table-launcher-journey/use-table-launcher-journey.tsx"],"sourcesContent":["/* eslint-disable react-native/no-inline-styles */\nimport type { IArrowTooltipProps } from '../../../../ui/arrow-tooltip/arrow-tooltip-types';\nimport type { INudgeProps } from '../../../../ui/nudge/nudge-types';\nimport type { ITableCardRef, ITableDetails } from '../../comps/tables-card/tables-card-types';\nimport type {\n ITableInfo,\n ITables,\n} from '../../dal/use-get-circle-home-details-dal/use-get-circle-home-dal-types';\nimport type { IUseTableJourneyProps } from './use-table-launcher-journey-types';\n\nimport { useCallback, useEffect, useRef } from 'react';\n\nimport CaratRightIcon from '../../../../../assets/line-icons/icons/carat-right';\nimport { PLATFORM_EVENTS_STUDENT } from '../../../../analytics-events/platform-events-student';\nimport { JOURNEY_ID_STUDENT } from '../../../../journey/journey-id/journey-id-student';\nimport { IndicatorType } from '../../../../journey/use-journey/constants';\nimport { useJourney } from '../../../../journey/use-journey/use-journey';\nimport IconButton from '../../../../ui/buttons/icon-button/icon-button';\nimport { useUIContext } from '../../../../ui/context/context';\nimport FlexView from '../../../../ui/layout/flex-view';\nimport Text from '../../../../ui/text/text';\nimport { CIRCLE_ONBOARDING_ANALYTICS_STEPS as Action } from '../../../enum/circle-onboarding-steps';\nimport { useCircleSounds } from '../../../hooks/use-circle-sounds/use-circle-sounds';\nimport { TablesCard } from '../../comps/tables-card/tables-card';\nimport { GAME_LAUNCHER_ANALYTICS_EVENTS } from '../../game-launcher-analytics-events';\nimport {\n LESSON_CARD_INDEX,\n PUZZLE_CARD_INDEX,\n SHOW_PICK_A_LEVEL_NUDGE_AFTER_MS,\n SHOW_PICK_A_LEVEL_TOOLTIP_AFTER_MS,\n TABLE_CARD_INDEX,\n} from './constants';\nimport {\n GO_TO_TABLE_LAUNCHER_DURATION_MS,\n SHOW_CLICK_TABLE_NUDGE_AFTER_MS,\n SHOW_INITIAL_COACHMARK_AFTER_MS,\n SHOW_INITIAL_TOOLTIP_AFTER_MS,\n START_ANIMATING_CLONED_ELEM,\n} from './constants';\nimport * as S from './use-table-launcher-journey-styled';\n\nexport const useTableLauncherJourney = ({\n carouselRefs,\n onTableSegmentClick,\n 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 timerRefs = useRef<ReturnType<typeof setTimeout>[]>([]);\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 timerRefs.current.push(startAnimationOnLabelAgain);\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 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 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 // 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 isJourneyInProgress.current = false;\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","isJourneyInProgress","timerRefs","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","_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,E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Q,QAAQ,CAAS4D,MAAA,aAAaA,CAAK,CAAC,GACtD5D,EAAU,UAAU,IACpBD,EAAoB,UAAU;AAAA,EAAA,GAE/B,CAACL,CAAS,CAAC,GAEP;AAAA,IACL,UAAUE;AAAA,IACV,cAAA0C;AAAA,EAAA;AAEJ;"}
@@ -1,107 +1,71 @@
1
- import { jsxs as O, jsx as $ } from "react/jsx-runtime";
2
- import { createContext as R, useState as L, useRef as C, useCallback as y, useMemo as D, useEffect as T } from "react";
3
- import { Coachmark as b } from "../comps/coachmark/coachmark.js";
4
- import { usePostJourneyProgress as q, useGetJourneyProgress as M } from "../journey-progress-api/journey-progress-api.js";
5
- import { BlurOverlay as N } from "./journey-styled.js";
6
- const j = R(null), F = ({ children: w, appId: J, userId: u }) => {
7
- const [c, p] = L([]), [s, a] = L([]), i = C(-1), r = C(), f = C([]), { post: g } = q(), { data: l = null, get: k } = M(), v = y(
1
+ import { jsxs as p, jsx as k } from "react/jsx-runtime";
2
+ import { createContext as $, useState as g, useRef as d, useCallback as i, useMemo as w } from "react";
3
+ import { Coachmark as A } from "../comps/coachmark/coachmark.js";
4
+ import { BlurOverlay as R } from "./journey-styled.js";
5
+ const b = $(null), j = ({ children: v }) => {
6
+ const [o, u] = g([]), c = d(-1), r = d(), l = d([]), y = i(
8
7
  (e, t) => {
9
- if (s.length > 0) {
8
+ if (o.length > 0) {
10
9
  console.error(
11
10
  `setJourney: Other Journey is already active, Current Journey: ${r.current}, New Journey Request: ${e}`
12
11
  );
13
12
  return;
14
13
  }
15
- r.current = e, i.current = -1, a([...t]);
14
+ r.current = e, c.current = -1, u([...t]);
16
15
  },
17
- [s.length]
18
- ), d = y(() => {
19
- f.current.forEach((e) => {
16
+ [o.length]
17
+ ), h = i(() => {
18
+ l.current.forEach((e) => {
20
19
  clearTimeout(e);
21
- }), f.current = [], r.current = void 0, i.current = -1, a([]);
22
- }, []), x = y(
23
- (e) => {
24
- if (c.includes(e)) {
25
- console.error(`endJourney: Journey ID ${e} is already completed.`);
26
- return;
27
- }
28
- p((t) => [...t, e]), g({
29
- app_id: J,
30
- user_id: u,
31
- journey_id: e,
32
- journey_status: "COMPLETED"
33
- }), d();
34
- },
35
- [J, d, c, g, u]
36
- ), E = y((e, t) => {
20
+ }), l.current = [], r.current = void 0, c.current = -1, u([]);
21
+ }, []), f = i((e, t) => {
37
22
  if (!r.current || e !== r.current) {
38
23
  console.error(
39
24
  r.current ? `A Journey is already active, Current Journey: ${r.current}, New Journey Request: ${e}` : "addCoachmark was called before setJourney and Journey ID is undefined"
40
25
  );
41
26
  return;
42
27
  }
43
- a((n) => [...n, t]);
44
- }, []), P = y(
45
- (e, t = !1, n = 0) => {
28
+ u((s) => [...s, t]);
29
+ }, []), J = i(
30
+ (e, t = !1, s = 0) => {
46
31
  if (!r.current || e !== r.current) {
47
32
  console.error(
48
33
  r.current ? "nextCoachmark was called before setJourney" : `A Journey is already active, Current Journey: ${r.current}, New Journey Request: ${e}`
49
34
  );
50
35
  return;
51
36
  }
52
- n !== 0 && a((o) => o.map((m) => ({ ...m, isActive: !1 })));
53
- const _ = setTimeout(() => {
54
- clearTimeout(_);
55
- const o = i.current + 1;
56
- a((m) => {
57
- if (o >= m.length || m.length === 0)
58
- return r.current = void 0, i.current = -1, [];
59
- i.current = o;
60
- const h = [...m];
61
- return h[o].isActive = !0, o > 0 && (h[o - 1].isActive = t), h;
37
+ s !== 0 && u((n) => n.map((a) => ({ ...a, isActive: !1 })));
38
+ const C = setTimeout(() => {
39
+ clearTimeout(C);
40
+ const n = c.current + 1;
41
+ u((a) => {
42
+ if (n >= a.length || a.length === 0)
43
+ return r.current = void 0, c.current = -1, [];
44
+ c.current = n;
45
+ const m = [...a];
46
+ return m[n].isActive = !0, n > 0 && (m[n - 1].isActive = t), m;
62
47
  });
63
- }, n);
64
- f.current.push(_);
48
+ }, s);
49
+ l.current.push(C);
65
50
  },
66
51
  []
67
- ), A = D(
52
+ ), x = w(
68
53
  () => ({
69
- nextCoachmark: P,
70
- setJourney: v,
71
- addCoachmark: E,
72
- clearJourney: d,
73
- endJourney: x,
74
- coachmarks: s,
75
- completedJourneys: c
54
+ nextCoachmark: J,
55
+ setJourney: y,
56
+ addCoachmark: f,
57
+ clearJourney: h,
58
+ coachmarks: o
76
59
  }),
77
- [
78
- P,
79
- v,
80
- E,
81
- d,
82
- x,
83
- s,
84
- c
85
- ]
60
+ [J, y, f, h, o]
86
61
  );
87
- return T(() => {
88
- u && k(u, {
89
- app_id: J,
90
- user_id: u,
91
- journey_status: "COMPLETED"
92
- });
93
- }, [J, k, u]), T(() => {
94
- if (l && c.length === 0) {
95
- const t = (l == null ? void 0 : l.filter((n) => n.status === "COMPLETED")).map((n) => n.journey_id);
96
- p(t);
97
- }
98
- }, [c.length, l]), /* @__PURE__ */ O(j.Provider, { value: A, children: [
99
- s.length > 0 && /* @__PURE__ */ $(N, { children: s.map((e, t) => /* @__PURE__ */ $(b, { coachmark: e }, `coachmark-${t}`)) }),
100
- w
62
+ return /* @__PURE__ */ p(b.Provider, { value: x, children: [
63
+ o.length > 0 && /* @__PURE__ */ k(R, { children: o.map((e, t) => /* @__PURE__ */ k(A, { coachmark: e }, `coachmark-${t}`)) }),
64
+ v
101
65
  ] });
102
66
  };
103
67
  export {
104
- j as JourneyContext,
105
- F as JourneyProvider
68
+ b as JourneyContext,
69
+ j as JourneyProvider
106
70
  };
107
71
  //# 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":["/* eslint-disable no-console */\nimport type { TJourneyId } from '../journey-id/journey-id-types';\nimport type {\n ICoachmarkProps,\n IJourneyContext,\n IJourneyProviderProps,\n} from './journey-context-types';\nimport type { FC } from 'react';\n\nimport { createContext, useCallback, useEffect, useMemo, useRef, useState } from 'react';\n\nimport { Coachmark } from '../comps/coachmark/coachmark';\nimport {\n useGetJourneyProgress,\n usePostJourneyProgress,\n} from '../journey-progress-api/journey-progress-api';\nimport * as S from './journey-styled';\n\nexport const JourneyContext = createContext<IJourneyContext | null>(null);\n\nexport const JourneyProvider: FC<IJourneyProviderProps> = ({ children, appId, userId }) => {\n const [completedJourneys, setCompletedJourneys] = useState<TJourneyId[]>([]);\n const [coachmarkList, setCoachmarkList] = useState<ICoachmarkProps[]>([]);\n const currentIndex = useRef(-1);\n const currentJourneyIdStudent = useRef<TJourneyId | undefined>();\n const timerRefs = useRef<ReturnType<typeof setTimeout>[]>([]);\n\n const { post: postJourneyCompletion } = usePostJourneyProgress();\n const { data: journeyProgressData = null, get: getJourneyProgress } = useGetJourneyProgress();\n\n const setJourney = useCallback(\n (id: TJourneyId, coachmarks: ICoachmarkProps[]) => {\n if (coachmarkList.length > 0) {\n console.error(\n `setJourney: Other Journey is already active, Current Journey: ${currentJourneyIdStudent.current}, New Journey Request: ${id}`,\n );\n\n return;\n }\n currentJourneyIdStudent.current = id;\n currentIndex.current = -1;\n setCoachmarkList([...coachmarks]);\n },\n [coachmarkList.length],\n );\n\n const clearJourney = useCallback(() => {\n // Clear all timers\n timerRefs.current.forEach(timer => {\n clearTimeout(timer);\n });\n timerRefs.current = [];\n currentJourneyIdStudent.current = undefined;\n currentIndex.current = -1;\n setCoachmarkList([]);\n }, []);\n\n const endJourney = useCallback(\n (journeyId: TJourneyId) => {\n if (completedJourneys.includes(journeyId)) {\n console.error(`endJourney: Journey ID ${journeyId} is already completed.`);\n\n return;\n }\n setCompletedJourneys(prev => [...prev, journeyId]);\n postJourneyCompletion({\n app_id: appId,\n user_id: userId,\n journey_id: journeyId,\n journey_status: 'COMPLETED',\n });\n clearJourney();\n },\n [appId, clearJourney, completedJourneys, postJourneyCompletion, userId],\n );\n\n const addCoachmark = useCallback((id: TJourneyId, coachmark: ICoachmarkProps) => {\n if (!currentJourneyIdStudent.current || id !== currentJourneyIdStudent.current) {\n console.error(\n currentJourneyIdStudent.current\n ? `A Journey is already active, Current Journey: ${currentJourneyIdStudent.current}, New Journey Request: ${id}`\n : `addCoachmark was called before setJourney and Journey ID is undefined`,\n );\n\n return;\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 console.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 return;\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 timerRefs.current.push(timer);\n },\n [],\n );\n\n const memoizedContextValue = useMemo(\n () => ({\n nextCoachmark,\n setJourney,\n addCoachmark,\n clearJourney,\n endJourney,\n coachmarks: coachmarkList,\n completedJourneys,\n }),\n [\n nextCoachmark,\n setJourney,\n addCoachmark,\n clearJourney,\n endJourney,\n coachmarkList,\n completedJourneys,\n ],\n );\n\n // Get the initial state of incompleteJourneys\n useEffect(() => {\n if (userId) {\n getJourneyProgress(userId, {\n app_id: appId,\n user_id: userId,\n journey_status: 'COMPLETED',\n });\n }\n }, [appId, getJourneyProgress, userId]);\n\n // Set the data to context state initially\n useEffect(() => {\n if (journeyProgressData && completedJourneys.length === 0) {\n const completedJourneysList = journeyProgressData?.filter(journey => {\n return journey.status === 'COMPLETED';\n });\n const completedJourneysIds = completedJourneysList.map(journey => journey.journey_id);\n\n setCompletedJourneys(completedJourneysIds);\n }\n }, [completedJourneys.length, journeyProgressData]);\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","appId","userId","completedJourneys","setCompletedJourneys","useState","coachmarkList","setCoachmarkList","currentIndex","useRef","currentJourneyIdStudent","timerRefs","postJourneyCompletion","usePostJourneyProgress","journeyProgressData","getJourneyProgress","useGetJourneyProgress","setJourney","useCallback","id","coachmarks","clearJourney","timer","endJourney","journeyId","prev","addCoachmark","coachmark","nextCoachmark","keepPrevActive","delayInMs","prevList","item","currIndex","updatedCoachmarkList","memoizedContextValue","useMemo","useEffect","completedJourneysIds","journey","jsxs","jsx","S.BlurOverlay","index","Coachmark"],"mappings":";;;;;AAkBa,MAAAA,IAAiBC,EAAsC,IAAI,GAE3DC,IAA6C,CAAC,EAAE,UAAAC,GAAU,OAAAC,GAAO,QAAAC,QAAa;AACzF,QAAM,CAACC,GAAmBC,CAAoB,IAAIC,EAAuB,CAAE,CAAA,GACrE,CAACC,GAAeC,CAAgB,IAAIF,EAA4B,CAAE,CAAA,GAClEG,IAAeC,EAAO,EAAE,GACxBC,IAA0BD,KAC1BE,IAAYF,EAAwC,CAAA,CAAE,GAEtD,EAAE,MAAMG,EAAsB,IAAIC,EAAuB,GACzD,EAAE,MAAMC,IAAsB,MAAM,KAAKC,EAAA,IAAuBC,KAEhEC,IAAaC;AAAA,IACjB,CAACC,GAAgBC,MAAkC;AAC7C,UAAAd,EAAc,SAAS,GAAG;AACp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B;AAAA,EAEF,GAAA,CAACD,GAAOc,GAAoBb,CAAM,CAAC,GAGtCmC,EAAU,MAAM;AACV,QAAAvB,KAAuBX,EAAkB,WAAW,GAAG;AAIzD,YAAMmC,KAHwBxB,KAAA,gBAAAA,EAAqB,OAAO,CAAWyB,MAC5DA,EAAQ,WAAW,cAEuB,IAAI,CAAAA,MAAWA,EAAQ,UAAU;AAEpF,MAAAnC,EAAqBkC,CAAoB;AAAA,IAC3C;AAAA,EACC,GAAA,CAACnC,EAAkB,QAAQW,CAAmB,CAAC,GAG/C,gBAAA0B,EAAA3C,EAAe,UAAf,EAAwB,OAAOsC,GAC7B,UAAA;AAAA,IAAA7B,EAAc,SAAS,KACtB,gBAAAmC,EAACC,GAAA,EACE,YAAc,IAAI,CAACf,GAAWgB,wBAC5BC,GAAqC,EAAA,WAAAjB,EAAA,GAAtB,aAAagB,CAAK,EAA0B,CAC7D,GACH;AAAA,IAED3C;AAAA,EACH,EAAA,CAAA;AAEJ;"}
1
+ {"version":3,"file":"journey-context-provider.js","sources":["../../../../src/features/journey/use-journey/journey-context-provider.tsx"],"sourcesContent":["/* eslint-disable no-console */\nimport 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 const timerRefs = useRef<ReturnType<typeof setTimeout>[]>([]);\n\n const setJourney = useCallback(\n (id: TJourneyId, coachmarks: ICoachmarkProps[]) => {\n if (coachmarkList.length > 0) {\n console.error(\n `setJourney: Other Journey is already active, Current Journey: ${currentJourneyIdStudent.current}, New Journey Request: ${id}`,\n );\n\n return;\n }\n currentJourneyIdStudent.current = id;\n currentIndex.current = -1;\n setCoachmarkList([...coachmarks]);\n },\n [coachmarkList.length],\n );\n\n const clearJourney = useCallback(() => {\n // Clear all timers\n timerRefs.current.forEach(timer => {\n clearTimeout(timer);\n });\n timerRefs.current = [];\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 console.error(\n currentJourneyIdStudent.current\n ? `A Journey is already active, Current Journey: ${currentJourneyIdStudent.current}, New Journey Request: ${id}`\n : `addCoachmark was called before setJourney and Journey ID is undefined`,\n );\n\n return;\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 console.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 return;\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 timerRefs.current.push(timer);\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","timerRefs","setJourney","useCallback","id","coachmarks","clearJourney","timer","addCoachmark","coachmark","prev","nextCoachmark","keepPrevActive","delayInMs","prevList","item","currIndex","updatedCoachmarkList","memoizedContextValue","useMemo","jsxs","jsx","S.BlurOverlay","index","Coachmark"],"mappings":";;;;AAUa,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,KAC1BE,IAAYF,EAAwC,CAAA,CAAE,GAEtDG,IAAaC;AAAA,IACjB,CAACC,GAAgBC,MAAkC;AAC7C,UAAAV,EAAc,SAAS,GAAG;AACpB,gBAAA;AAAA,UACN,iEAAiEK,EAAwB,OAAO,0BAA0BI,CAAE;AAAA,QAAA;AAG9H;AAAA,MACF;AACA,MAAAJ,EAAwB,UAAUI,GAClCN,EAAa,UAAU,IACNF,EAAA,CAAC,GAAGS,CAAU,CAAC;AAAA,IAClC;AAAA,IACA,CAACV,EAAc,MAAM;AAAA,EAAA,GAGjBW,IAAeH,EA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qBD,IAAY,CAAC,EAAsB,WAAWJ,IAG/DK;AAAA,QAAA,CACR;AAAA,SACAJ,CAAS;AAEF,MAAAZ,EAAA,QAAQ,KAAKM,CAAK;AAAA,IAC9B;AAAA,IACA,CAAC;AAAA,EAAA,GAGGW,IAAuBC;AAAA,IAC3B,OAAO;AAAA,MACL,eAAAR;AAAA,MACA,YAAAT;AAAA,MACA,cAAAM;AAAA,MACA,cAAAF;AAAA,MACA,YAAYX;AAAA,IAAA;AAAA,IAEd,CAACgB,GAAeT,GAAYM,GAAcF,GAAcX,CAAa;AAAA,EAAA;AAGvE,SACG,gBAAAyB,EAAA7B,EAAe,UAAf,EAAwB,OAAO2B,GAC7B,UAAA;AAAA,IAAAvB,EAAc,SAAS,KACtB,gBAAA0B,EAACC,GAAA,EACE,YAAc,IAAI,CAACb,GAAWc,wBAC5BC,GAAqC,EAAA,WAAAf,EAAA,GAAtB,aAAac,CAAK,EAA0B,CAC7D,GACH;AAAA,IAED7B;AAAA,EACH,EAAA,CAAA;AAEJ;"}
package/dist/index.d.ts CHANGED
@@ -1121,6 +1121,7 @@ declare interface IGameLauncherProps {
1121
1121
  defaultIndex?: number;
1122
1122
  journeyId?: TJourneyId;
1123
1123
  isTutorialOnboardingDone?: boolean;
1124
+ onJourneyComplete: (journeyId: TJourneyId) => void;
1124
1125
  }
1125
1126
 
1126
1127
  declare interface IGetArrowTooltipConfig {
@@ -1326,14 +1327,6 @@ export declare interface IJourneyContext {
1326
1327
  * @param delayInMs - Optional delay (in milliseconds) before rendering the current coachmark.
1327
1328
  */
1328
1329
  nextCoachmark: (id: TJourneyId, keepPrevActive?: boolean, delayInMs?: number) => void;
1329
- endJourney: (id: TJourneyId) => void;
1330
- completedJourneys: TJourneyId[];
1331
- }
1332
-
1333
- declare interface IJourneyProviderProps {
1334
- children: React.ReactNode;
1335
- appId: string;
1336
- userId: string;
1337
1330
  }
1338
1331
 
1339
1332
  export declare interface ILayout {
@@ -3440,7 +3433,9 @@ export declare enum JOURNEY_ID_STUDENT {
3440
3433
  CIRCLE_STREAK_REDUCTION_JOURNEY = "CIRCLE_STREAK_REDUCTION_JOURNEY"
3441
3434
  }
3442
3435
 
3443
- export declare const JourneyProvider: FC<IJourneyProviderProps>;
3436
+ export declare const JourneyProvider: FC<{
3437
+ children: ReactNode;
3438
+ }>;
3444
3439
 
3445
3440
  export declare const Leaderboard: ({ leaderboardData, type, userId, onClose, isLoading, streakInfo, }: ILeaderboardProps) => JSX_2.Element;
3446
3441
 
@@ -3725,7 +3720,12 @@ export declare enum PLATFORM_EVENTS_STUDENT {
3725
3720
 
3726
3721
  export declare enum PLATFORM_EVENTS_TEACHER {
3727
3722
  PAGE_VIEWED = "page_viewed",
3728
- RESOURCE_ASSIGNED = "resource_assigned"
3723
+ RESOURCE_ASSIGNED = "resource_assigned",
3724
+ LESSON_FEEDBACK_POSITIVE = "lesson_feedback_positive",
3725
+ LESSON_FEEDBACK_NEGATIVE = "lesson_feedback_negative",
3726
+ LESSON_FEEDBACK_BACK_BUTTON = "lesson_feedback_back_button",
3727
+ LESSON_FEEDBACK_SUBMIT = "lesson_feedback_submit",
3728
+ LESSON_FEEDBACK_NEXT = "lesson_feedback_next"
3729
3729
  }
3730
3730
 
3731
3731
  export declare const Play2Icon: React_2.FC<React_2.SVGProps<SVGSVGElement>>;
@@ -4280,6 +4280,11 @@ export declare type TInclassMessage = {
4280
4280
  attemptId: string;
4281
4281
  itemType: TItemType;
4282
4282
  };
4283
+ } | {
4284
+ eventName: 'STUDENT_LEARNING_WORKSHEET_COMPLETED';
4285
+ eventPayload: {
4286
+ worksheetId: string;
4287
+ };
4283
4288
  } | {
4284
4289
  eventName: typeof EVENTS.CHAPTER_UPDATED;
4285
4290
  eventPayload: {
@@ -5017,8 +5022,6 @@ export declare const useGetCircleHomeDetailsDal: (userId: string, grade: string,
5017
5022
  invalidateCircleHomeDetails: () => void;
5018
5023
  };
5019
5024
 
5020
- export declare const useGetEligibleJourneys: (allJourneyIds: TJourneyId[]) => JOURNEY_ID_STUDENT | null | undefined;
5021
-
5022
5025
  declare const useGetLeaderboard: (initialId?: string, initialQuery?: IGetLeaderboardPayloadModel | undefined) => {
5023
5026
  get: (id: string, query: IGetLeaderboardPayloadModel, meta: void) => Promise<void>;
5024
5027
  resource: ResourceModel<IGetLeaderboardResponseModel> | undefined;