@cuemath/leap 3.3.37-m → 3.3.37
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/gif/gif.js +4 -1
- package/dist/assets/gif/gif.js.map +1 -1
- package/dist/assets/illustrations/illustrations.js +1 -1
- package/dist/assets/illustrations/illustrations.js.map +1 -1
- package/dist/assets/line-icons/icons/chevron-right.js.map +1 -1
- package/dist/features/auth/comps/animated-avatar-message/animated-avatar-message.js +1 -1
- package/dist/features/auth/comps/animated-avatar-message/animated-avatar-message.js.map +1 -1
- package/dist/features/auth/comps/otp-input/otp-input.js +35 -29
- package/dist/features/auth/comps/otp-input/otp-input.js.map +1 -1
- package/dist/features/auth/pla-signup/pla-analytics-events.js +13 -3
- package/dist/features/auth/pla-signup/pla-analytics-events.js.map +1 -1
- package/dist/features/chapters-v2/chapter-details/block-sections/block-sections.js +43 -34
- package/dist/features/chapters-v2/chapter-details/block-sections/block-sections.js.map +1 -1
- package/dist/features/chapters-v2/chapter-details/chapter-details.js +140 -101
- package/dist/features/chapters-v2/chapter-details/chapter-details.js.map +1 -1
- package/dist/features/chapters-v2/utils/index.js +20 -16
- package/dist/features/chapters-v2/utils/index.js.map +1 -1
- package/dist/features/circle-games/game-launcher/api/get-content-for-today/get-circle-home-api.js +6 -6
- package/dist/features/circle-games/game-launcher/api/get-content-for-today/get-circle-home-api.js.map +1 -1
- package/dist/features/circle-games/game-launcher/dal/use-get-circle-home-details-dal/use-get-circle-home-details-dal.js +20 -21
- package/dist/features/circle-games/game-launcher/dal/use-get-circle-home-details-dal/use-get-circle-home-details-dal.js.map +1 -1
- package/dist/features/circle-games/games/web-view/web-view-types.js.map +1 -1
- package/dist/features/circle-games/sign-up/sign-up.js +6 -6
- package/dist/features/circle-games/sign-up/sign-up.js.map +1 -1
- package/dist/features/homework/hw-card-list/hw-card-list-view.js +17 -17
- package/dist/features/journey/hooks/use-chapter-page-journey/use-download-block-journey.js +86 -0
- package/dist/features/journey/hooks/use-chapter-page-journey/use-download-block-journey.js.map +1 -0
- package/dist/features/journey/hooks/use-chapter-page-journey/use-download-node-journey.js +140 -0
- package/dist/features/journey/hooks/use-chapter-page-journey/use-download-node-journey.js.map +1 -0
- package/dist/features/journey/journey-id/journey-id-student.js +1 -1
- package/dist/features/journey/journey-id/journey-id-student.js.map +1 -1
- package/dist/features/journey/journey-id/journey-id-teacher.js +2 -2
- package/dist/features/journey/journey-id/journey-id-teacher.js.map +1 -1
- package/dist/features/journey/mocks/chapter-page-journey-mock-data.js +400 -0
- package/dist/features/journey/mocks/chapter-page-journey-mock-data.js.map +1 -1
- package/dist/features/milestone/constants.js +28 -15
- package/dist/features/milestone/constants.js.map +1 -1
- package/dist/features/milestone/create/comps/goal-completion-date-selector/goal-completion-date-selector.js +6 -6
- package/dist/features/milestone/create/comps/sheets-list/sheets-list-styled.js +2 -2
- package/dist/features/milestone/create/comps/test-type-step/test-type-utils.js +23 -16
- package/dist/features/milestone/create/comps/test-type-step/test-type-utils.js.map +1 -1
- package/dist/features/milestone/create/milestone-create-helpers.js +13 -7
- package/dist/features/milestone/create/milestone-create-helpers.js.map +1 -1
- package/dist/features/parent-dashboard/api/cancel-subscription.js +9 -0
- package/dist/features/parent-dashboard/api/cancel-subscription.js.map +1 -0
- package/dist/features/parent-dashboard/comps/billing-information/billing-information-styled.js +20 -0
- package/dist/features/parent-dashboard/comps/billing-information/billing-information-styled.js.map +1 -0
- package/dist/features/parent-dashboard/comps/billing-information/billing-information.js +74 -0
- package/dist/features/parent-dashboard/comps/billing-information/billing-information.js.map +1 -0
- package/dist/features/{trial-session/comps/pla → parent-dashboard/comps}/next-steps/next-steps-constants.js +1 -1
- package/dist/features/parent-dashboard/comps/next-steps/next-steps-constants.js.map +1 -0
- package/dist/features/{trial-session/comps/pla → parent-dashboard/comps}/next-steps/next-steps-styled.js +1 -1
- package/dist/features/parent-dashboard/comps/next-steps/next-steps-styled.js.map +1 -0
- package/dist/features/{trial-session/comps/pla → parent-dashboard/comps}/next-steps/next-steps.js +5 -5
- package/dist/features/parent-dashboard/comps/next-steps/next-steps.js.map +1 -0
- package/dist/features/parent-dashboard/comps/pla-first-session-introduction/pla-first-session-introduction.js +28 -22
- package/dist/features/parent-dashboard/comps/pla-first-session-introduction/pla-first-session-introduction.js.map +1 -1
- package/dist/features/parent-dashboard/comps/session-status/hooks/use-countdown.js +34 -0
- package/dist/features/parent-dashboard/comps/session-status/hooks/use-countdown.js.map +1 -0
- package/dist/features/parent-dashboard/comps/session-status/hooks/use-session-status-config.js +137 -0
- package/dist/features/parent-dashboard/comps/session-status/hooks/use-session-status-config.js.map +1 -0
- package/dist/features/parent-dashboard/comps/session-status/session-status-constants.js +20 -0
- package/dist/features/parent-dashboard/comps/session-status/session-status-constants.js.map +1 -0
- package/dist/features/parent-dashboard/comps/session-status/session-status-helpers.js +19 -0
- package/dist/features/parent-dashboard/comps/session-status/session-status-helpers.js.map +1 -0
- package/dist/features/{trial-session/comps/pla → parent-dashboard/comps}/session-status/session-status-styled.js +2 -2
- package/dist/features/parent-dashboard/comps/session-status/session-status-styled.js.map +1 -0
- package/dist/features/parent-dashboard/comps/session-status/session-status.js +124 -0
- package/dist/features/parent-dashboard/comps/session-status/session-status.js.map +1 -0
- package/dist/features/{trial-session/comps/pla → parent-dashboard/comps}/session-summary/session-summary-constants.js +18 -12
- package/dist/features/parent-dashboard/comps/session-summary/session-summary-constants.js.map +1 -0
- package/dist/features/parent-dashboard/comps/session-summary/session-summary.js +54 -0
- package/dist/features/parent-dashboard/comps/session-summary/session-summary.js.map +1 -0
- package/dist/features/{trial-session/comps/pla → parent-dashboard/comps}/session-summary/summary-card/summary-card-styled.js +1 -1
- package/dist/features/parent-dashboard/comps/session-summary/summary-card/summary-card-styled.js.map +1 -0
- package/dist/features/parent-dashboard/comps/session-summary/summary-card/summary-card.js +72 -0
- package/dist/features/parent-dashboard/comps/session-summary/summary-card/summary-card.js.map +1 -0
- package/dist/features/parent-dashboard/comps/upcoming-sessions/upcoming-sessions-constants.js.map +1 -0
- package/dist/features/{trial-session/comps/pla → parent-dashboard/comps}/upcoming-sessions/upcoming-sessions-styled.js +1 -1
- package/dist/features/parent-dashboard/comps/upcoming-sessions/upcoming-sessions-styled.js.map +1 -0
- package/dist/features/parent-dashboard/comps/upcoming-sessions/upcoming-sessions-types.js.map +1 -0
- package/dist/features/{trial-session/comps/pla → parent-dashboard/comps}/upcoming-sessions/upcoming-sessions.js +14 -14
- package/dist/features/parent-dashboard/comps/upcoming-sessions/upcoming-sessions.js.map +1 -0
- package/dist/features/parent-dashboard/hooks/use-fetch-parent-home.js +1 -1
- package/dist/features/parent-dashboard/hooks/use-fetch-parent-home.js.map +1 -1
- package/dist/features/parent-dashboard/hooks/use-parent-home-data.js +48 -46
- package/dist/features/parent-dashboard/hooks/use-parent-home-data.js.map +1 -1
- package/dist/features/parent-dashboard/modals/cancel-subscription/cancel-subscription-constants.js +21 -0
- package/dist/features/parent-dashboard/modals/cancel-subscription/cancel-subscription-constants.js.map +1 -0
- package/dist/features/parent-dashboard/modals/cancel-subscription/cancel-subscription.js +85 -0
- package/dist/features/parent-dashboard/modals/cancel-subscription/cancel-subscription.js.map +1 -0
- package/dist/features/parent-dashboard/modals/cancellation-confirmation/cancellation-confirmation.js +23 -0
- package/dist/features/parent-dashboard/modals/cancellation-confirmation/cancellation-confirmation.js.map +1 -0
- package/dist/features/parent-dashboard/modals/cancellation-reason/cancellation-reason-constant.js +55 -0
- package/dist/features/parent-dashboard/modals/cancellation-reason/cancellation-reason-constant.js.map +1 -0
- package/dist/features/parent-dashboard/modals/cancellation-reason/cancellation-reason-styled.js +71 -0
- package/dist/features/parent-dashboard/modals/cancellation-reason/cancellation-reason-styled.js.map +1 -0
- package/dist/features/parent-dashboard/modals/cancellation-reason/cancellation-reason.js +119 -0
- package/dist/features/parent-dashboard/modals/cancellation-reason/cancellation-reason.js.map +1 -0
- package/dist/features/parent-dashboard/modals/hooks/use-pla-model-handlers.js +58 -0
- package/dist/features/parent-dashboard/modals/hooks/use-pla-model-handlers.js.map +1 -0
- package/dist/features/parent-dashboard/modals/student-profile-summary/student-profile-summary.js +16 -17
- package/dist/features/parent-dashboard/modals/student-profile-summary/student-profile-summary.js.map +1 -1
- package/dist/features/parent-dashboard/modals/trial-report/trial-report-styled.js +4 -8
- package/dist/features/parent-dashboard/modals/trial-report/trial-report-styled.js.map +1 -1
- package/dist/features/parent-dashboard/modals/tutor-change/tutor-change-styled.js +3 -3
- package/dist/features/parent-dashboard/modals/tutor-change/tutor-change-styled.js.map +1 -1
- package/dist/features/parent-dashboard/modals/view-payment-method/view-payment-method.js +76 -0
- package/dist/features/parent-dashboard/modals/view-payment-method/view-payment-method.js.map +1 -0
- package/dist/features/parent-dashboard/parent-dashboard-constants.js +45 -4
- package/dist/features/parent-dashboard/parent-dashboard-constants.js.map +1 -1
- package/dist/features/parent-dashboard/parent-dashboard-types.js +3 -3
- package/dist/features/parent-dashboard/parent-dashboard-types.js.map +1 -1
- package/dist/features/parent-dashboard/parent-dashboard-view.js +197 -174
- package/dist/features/parent-dashboard/parent-dashboard-view.js.map +1 -1
- package/dist/features/stickers/sticker-selector/sticker-selector.js +57 -58
- package/dist/features/stickers/sticker-selector/sticker-selector.js.map +1 -1
- package/dist/features/stickers/stickers-effects/stickers-effects-helper.js.map +1 -1
- package/dist/features/stickers/stickers-effects/stickers-effects-styled.js +17 -32
- package/dist/features/stickers/stickers-effects/stickers-effects-styled.js.map +1 -1
- package/dist/features/stickers/stickers-effects/stickers-effects.js +56 -40
- package/dist/features/stickers/stickers-effects/stickers-effects.js.map +1 -1
- package/dist/features/student-details/class-details/class-details-utils.js +6 -6
- package/dist/features/trial-session/api/teacher-availability.js +9 -0
- package/dist/features/trial-session/api/teacher-availability.js.map +1 -0
- package/dist/features/trial-session/comps/class-preference/class-preference.js +74 -58
- package/dist/features/trial-session/comps/class-preference/class-preference.js.map +1 -1
- package/dist/features/trial-session/comps/class-preference/helpers.js +28 -0
- package/dist/features/trial-session/comps/class-preference/helpers.js.map +1 -0
- package/dist/features/trial-session/comps/learning-plan/index.js +47 -45
- package/dist/features/trial-session/comps/learning-plan/index.js.map +1 -1
- package/dist/features/trial-session/comps/navigation-bar/index.js +41 -40
- package/dist/features/trial-session/comps/navigation-bar/index.js.map +1 -1
- package/dist/features/trial-session/comps/school-goals/school-goals.js +59 -57
- package/dist/features/trial-session/comps/school-goals/school-goals.js.map +1 -1
- package/dist/features/trial-session/comps/session-report/session-report.js +15 -15
- package/dist/features/trial-session/comps/session-report/session-report.js.map +1 -1
- package/dist/features/trial-session/comps/student-enrichment/student-enrichment.js +41 -40
- package/dist/features/trial-session/comps/student-enrichment/student-enrichment.js.map +1 -1
- package/dist/features/trial-session/comps/student-feedback/student-feedback-constants.js +5 -0
- package/dist/features/trial-session/comps/student-feedback/student-feedback-constants.js.map +1 -1
- package/dist/features/trial-session/comps/student-feedback/student-feedback.js +96 -51
- package/dist/features/trial-session/comps/student-feedback/student-feedback.js.map +1 -1
- package/dist/features/trial-session/comps/student-profile/student-profile.js +70 -63
- package/dist/features/trial-session/comps/student-profile/student-profile.js.map +1 -1
- package/dist/features/trial-session/comps/teacher-intro/teacher-profile/teacher-profile.js +43 -44
- package/dist/features/trial-session/comps/teacher-intro/teacher-profile/teacher-profile.js.map +1 -1
- package/dist/features/trial-session/comps/test-prep/test-prep.js +41 -40
- package/dist/features/trial-session/comps/test-prep/test-prep.js.map +1 -1
- package/dist/features/trial-session/comps/trial-circle-game/trial-circle-game.js +60 -61
- package/dist/features/trial-session/comps/trial-circle-game/trial-circle-game.js.map +1 -1
- package/dist/features/trial-session/helper.js +76 -61
- package/dist/features/trial-session/helper.js.map +1 -1
- package/dist/features/trial-session/hooks/use-slide-config-update.js +49 -0
- package/dist/features/trial-session/hooks/use-slide-config-update.js.map +1 -0
- package/dist/features/trial-session/hooks/use-trial-session-navigation.js +174 -144
- package/dist/features/trial-session/hooks/use-trial-session-navigation.js.map +1 -1
- package/dist/features/trial-session/trial-session-types.js.map +1 -1
- package/dist/features/trial-session/trial-session-view.js +99 -110
- package/dist/features/trial-session/trial-session-view.js.map +1 -1
- package/dist/features/ui/accordion/accordion-items/accordion-items.js +13 -13
- package/dist/features/ui/accordion/accordion-items/accordion-items.js.map +1 -1
- package/dist/features/ui/modals/modal-styled.js +45 -13
- package/dist/features/ui/modals/modal-styled.js.map +1 -1
- package/dist/features/ui/modals/modal.js +31 -31
- package/dist/features/ui/modals/modal.js.map +1 -1
- package/dist/features/utils/utils.js +1 -1
- package/dist/features/utils/utils.js.map +1 -1
- package/dist/index.d.ts +95 -144
- package/dist/index.js +292 -301
- package/dist/index.js.map +1 -1
- package/dist/static/learning-session-grid-bg-mobile.8d2b7258.gif +0 -0
- package/dist/static/way-forward-grid-bg-mobile.374043d7.gif +0 -0
- package/dist/static/your-goals-grid-bg-mobile.62557024.gif +0 -0
- package/package.json +2 -3
- package/dist/features/parent-dashboard/modals/student-profile-summary/student-profile-summary-styled.js +0 -12
- package/dist/features/parent-dashboard/modals/student-profile-summary/student-profile-summary-styled.js.map +0 -1
- package/dist/features/stickers/sticker-selector/hooks/use-handle-sticker-send.js +0 -32
- package/dist/features/stickers/sticker-selector/hooks/use-handle-sticker-send.js.map +0 -1
- package/dist/features/stickers/sticker-selector/hooks/use-stickers-journey/use-stickers-journey.js +0 -72
- package/dist/features/stickers/sticker-selector/hooks/use-stickers-journey/use-stickers-journey.js.map +0 -1
- package/dist/features/stickers/stickers-effects/comps/sticker-with-fallback.js +0 -34
- package/dist/features/stickers/stickers-effects/comps/sticker-with-fallback.js.map +0 -1
- package/dist/features/stickers/stickers-effects/constants.js +0 -26
- package/dist/features/stickers/stickers-effects/constants.js.map +0 -1
- package/dist/features/stickers/stickers-effects/context/sticker-provider.js +0 -28
- package/dist/features/stickers/stickers-effects/context/sticker-provider.js.map +0 -1
- package/dist/features/stickers/stickers-effects/hooks/use-stickers.js +0 -12
- package/dist/features/stickers/stickers-effects/hooks/use-stickers.js.map +0 -1
- package/dist/features/stickers/stickers-effects/stickers-effects-types.js +0 -6
- package/dist/features/stickers/stickers-effects/stickers-effects-types.js.map +0 -1
- package/dist/features/trial-session/comps/pla/next-steps/next-steps-constants.js.map +0 -1
- package/dist/features/trial-session/comps/pla/next-steps/next-steps-styled.js.map +0 -1
- package/dist/features/trial-session/comps/pla/next-steps/next-steps.js.map +0 -1
- package/dist/features/trial-session/comps/pla/session-status/hooks/use-session-countdown.js +0 -29
- package/dist/features/trial-session/comps/pla/session-status/hooks/use-session-countdown.js.map +0 -1
- package/dist/features/trial-session/comps/pla/session-status/hooks/use-session-status-config.js +0 -132
- package/dist/features/trial-session/comps/pla/session-status/hooks/use-session-status-config.js.map +0 -1
- package/dist/features/trial-session/comps/pla/session-status/session-status-constants.js +0 -11
- package/dist/features/trial-session/comps/pla/session-status/session-status-constants.js.map +0 -1
- package/dist/features/trial-session/comps/pla/session-status/session-status-helpers.js +0 -19
- package/dist/features/trial-session/comps/pla/session-status/session-status-helpers.js.map +0 -1
- package/dist/features/trial-session/comps/pla/session-status/session-status-styled.js.map +0 -1
- package/dist/features/trial-session/comps/pla/session-status/session-status.js +0 -127
- package/dist/features/trial-session/comps/pla/session-status/session-status.js.map +0 -1
- package/dist/features/trial-session/comps/pla/session-summary/session-summary-constants.js.map +0 -1
- package/dist/features/trial-session/comps/pla/session-summary/session-summary.js +0 -53
- package/dist/features/trial-session/comps/pla/session-summary/session-summary.js.map +0 -1
- package/dist/features/trial-session/comps/pla/session-summary/summary-card/summary-card-styled.js.map +0 -1
- package/dist/features/trial-session/comps/pla/session-summary/summary-card/summary-card.js +0 -56
- package/dist/features/trial-session/comps/pla/session-summary/summary-card/summary-card.js.map +0 -1
- package/dist/features/trial-session/comps/pla/upcoming-sessions/upcoming-sessions-constants.js.map +0 -1
- package/dist/features/trial-session/comps/pla/upcoming-sessions/upcoming-sessions-styled.js.map +0 -1
- package/dist/features/trial-session/comps/pla/upcoming-sessions/upcoming-sessions-types.js.map +0 -1
- package/dist/features/trial-session/comps/pla/upcoming-sessions/upcoming-sessions.js.map +0 -1
- package/dist/node_modules/date-fns/_lib/getRoundingMethod.js +0 -10
- package/dist/node_modules/date-fns/_lib/getRoundingMethod.js.map +0 -1
- package/dist/node_modules/date-fns/differenceInMilliseconds.js +0 -9
- package/dist/node_modules/date-fns/differenceInMilliseconds.js.map +0 -1
- package/dist/node_modules/date-fns/differenceInSeconds.js +0 -11
- package/dist/node_modules/date-fns/differenceInSeconds.js.map +0 -1
- package/dist/static/trophy.a8ea85ef.json +0 -6813
- /package/dist/features/{trial-session/comps/pla → parent-dashboard/comps}/upcoming-sessions/upcoming-sessions-constants.js +0 -0
- /package/dist/features/{trial-session/comps/pla → parent-dashboard/comps}/upcoming-sessions/upcoming-sessions-types.js +0 -0
|
@@ -1,148 +1,187 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { memo as
|
|
3
|
-
import { ILLUSTRATIONS as
|
|
4
|
-
import
|
|
5
|
-
import { useChallengeArenaJourney as
|
|
6
|
-
import {
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
import {
|
|
16
|
-
|
|
1
|
+
import { jsxs as p, jsx as o, Fragment as z } from "react/jsx-runtime";
|
|
2
|
+
import { memo as G, useCallback as M, useEffect as f, useMemo as h } from "react";
|
|
3
|
+
import { ILLUSTRATIONS as V } from "../../../assets/illustrations/illustrations.js";
|
|
4
|
+
import q from "../../../assets/line-icons/icons/back2.js";
|
|
5
|
+
import { useChallengeArenaJourney as K } from "../../journey/hooks/use-chapter-page-journey/use-challenge-arena-journey.js";
|
|
6
|
+
import { useDownloadBlockJourney as Q } from "../../journey/hooks/use-chapter-page-journey/use-download-block-journey.js";
|
|
7
|
+
import { useDownloadNodeJourney as Y } from "../../journey/hooks/use-chapter-page-journey/use-download-node-journey.js";
|
|
8
|
+
import { useJourney as Z } from "../../journey/use-journey/use-journey.js";
|
|
9
|
+
import ee from "../../ui/buttons/button/button.js";
|
|
10
|
+
import oe from "../../ui/buttons/icon-button/icon-button.js";
|
|
11
|
+
import te from "../../ui/layout/flex-view.js";
|
|
12
|
+
import re from "../../ui/loader/app-loader/app-loader.js";
|
|
13
|
+
import ne from "../../ui/text/text.js";
|
|
14
|
+
import { useGetChapterDetails as ae } from "../api/chapter.js";
|
|
15
|
+
import { getHasDownloadBlock as ie, getHasNonDownloadBlockWithPdfNode as se } from "../utils/index.js";
|
|
16
|
+
import le from "./block-sections/block-sections.js";
|
|
17
|
+
import ce from "./chapter-banner/chapter-banner.js";
|
|
18
|
+
import { ContentWrapper as de, BackButtonContainer as me, BackButtonWrapper as pe, LoaderWrapper as fe } from "./chapter-details-styled.js";
|
|
19
|
+
const he = G((S) => {
|
|
17
20
|
const {
|
|
18
|
-
userChapterId:
|
|
19
|
-
studentId:
|
|
20
|
-
userType:
|
|
21
|
-
onBlockSkipUnskip:
|
|
22
|
-
onNodeAttempt:
|
|
23
|
-
onNodeAssignAsHomework:
|
|
24
|
-
onNodeMarkAsDone:
|
|
25
|
-
onNodeReattempt:
|
|
26
|
-
onNodeReview:
|
|
27
|
-
onNodeView:
|
|
28
|
-
onExit:
|
|
29
|
-
onNodeUnassign:
|
|
30
|
-
onNodeUnlock:
|
|
31
|
-
onNodeSkipUnSkip:
|
|
32
|
-
startChapterPageJourney:
|
|
33
|
-
onBlockReset:
|
|
34
|
-
chapterPageRef:
|
|
35
|
-
bannerRef:
|
|
36
|
-
coreBlocksRef:
|
|
37
|
-
canStartJourney:
|
|
38
|
-
canStartChallengeArenaJourney:
|
|
39
|
-
|
|
40
|
-
|
|
21
|
+
userChapterId: s,
|
|
22
|
+
studentId: l,
|
|
23
|
+
userType: t,
|
|
24
|
+
onBlockSkipUnskip: J,
|
|
25
|
+
onNodeAttempt: A,
|
|
26
|
+
onNodeAssignAsHomework: b,
|
|
27
|
+
onNodeMarkAsDone: $,
|
|
28
|
+
onNodeReattempt: x,
|
|
29
|
+
onNodeReview: I,
|
|
30
|
+
onNodeView: v,
|
|
31
|
+
onExit: P,
|
|
32
|
+
onNodeUnassign: _,
|
|
33
|
+
onNodeUnlock: E,
|
|
34
|
+
onNodeSkipUnSkip: H,
|
|
35
|
+
startChapterPageJourney: m,
|
|
36
|
+
onBlockReset: L,
|
|
37
|
+
chapterPageRef: T,
|
|
38
|
+
bannerRef: U,
|
|
39
|
+
coreBlocksRef: W,
|
|
40
|
+
canStartJourney: r,
|
|
41
|
+
canStartChallengeArenaJourney: u,
|
|
42
|
+
canStartDownloadNodeJourney: c,
|
|
43
|
+
canStartDownloadBlockJourney: n
|
|
44
|
+
} = S, { isJourneyActive: g } = Z(), {
|
|
45
|
+
get: k,
|
|
41
46
|
data: e,
|
|
42
|
-
isProcessing:
|
|
43
|
-
isProcessingFailed:
|
|
44
|
-
isStale:
|
|
45
|
-
} =
|
|
46
|
-
|
|
47
|
-
}, [
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
}, [
|
|
51
|
-
const { blockSectionRef:
|
|
52
|
-
|
|
53
|
-
|
|
47
|
+
isProcessing: a,
|
|
48
|
+
isProcessingFailed: j,
|
|
49
|
+
isStale: y
|
|
50
|
+
} = ae(), i = M(() => {
|
|
51
|
+
k(s, void 0, { studentId: l });
|
|
52
|
+
}, [k, s, l]);
|
|
53
|
+
f(() => {
|
|
54
|
+
i();
|
|
55
|
+
}, [i]);
|
|
56
|
+
const { blockSectionRef: F, startJourney: B } = K(), {
|
|
57
|
+
blockSectionRef: w,
|
|
58
|
+
downloadCoreBlockRef: O,
|
|
59
|
+
startJourney: C
|
|
60
|
+
} = Y(), { blockSectionRef: N, startJourney: R } = Q(), D = h(
|
|
61
|
+
() => e && ie(e.blocks),
|
|
62
|
+
[e]
|
|
63
|
+
), d = h(
|
|
64
|
+
() => e && se(e.blocks),
|
|
65
|
+
[e]
|
|
66
|
+
), X = h(
|
|
67
|
+
() => c && d ? w : n ? N : void 0,
|
|
68
|
+
[
|
|
69
|
+
c,
|
|
70
|
+
n,
|
|
71
|
+
d,
|
|
72
|
+
w,
|
|
73
|
+
N
|
|
74
|
+
]
|
|
75
|
+
);
|
|
76
|
+
return f(() => {
|
|
77
|
+
e && !g && (r && m && m({
|
|
78
|
+
chapterDetails: e,
|
|
79
|
+
userChapterId: s,
|
|
80
|
+
studentId: l,
|
|
81
|
+
userType: t
|
|
82
|
+
}), !r && u && B({
|
|
83
|
+
chapterDetails: e,
|
|
84
|
+
userType: t
|
|
85
|
+
}), !r && c && d && C({
|
|
54
86
|
chapterDetails: e,
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
}), e && !l && h && !m && f({
|
|
87
|
+
userType: t,
|
|
88
|
+
canStartDownloadBlockJourney: n
|
|
89
|
+
}), !r && n && D && R({
|
|
59
90
|
chapterDetails: e,
|
|
60
|
-
userType:
|
|
61
|
-
});
|
|
91
|
+
userType: t
|
|
92
|
+
}));
|
|
62
93
|
}, [
|
|
63
|
-
|
|
64
|
-
|
|
94
|
+
u,
|
|
95
|
+
r,
|
|
65
96
|
e,
|
|
97
|
+
g,
|
|
98
|
+
B,
|
|
66
99
|
m,
|
|
67
|
-
|
|
100
|
+
R,
|
|
101
|
+
C,
|
|
102
|
+
l,
|
|
68
103
|
s,
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
104
|
+
t,
|
|
105
|
+
d,
|
|
106
|
+
D,
|
|
107
|
+
c,
|
|
108
|
+
n
|
|
109
|
+
]), f(() => {
|
|
110
|
+
!a && y && i();
|
|
111
|
+
}, [i, a, y]), j ? /* @__PURE__ */ p(te, { $flexGapX: 1.5, $height: "100vh", $justifyContent: "center", $alignItems: "center", children: [
|
|
112
|
+
/* @__PURE__ */ o(ne, { $renderAs: "h6", children: "Oops! Something went wrong. Please try again later." }),
|
|
113
|
+
/* @__PURE__ */ o(
|
|
114
|
+
ee,
|
|
78
115
|
{
|
|
79
116
|
widthX: 14,
|
|
80
117
|
size: "small",
|
|
81
118
|
shape: "square",
|
|
82
119
|
renderAs: "primary",
|
|
83
120
|
label: "Try again",
|
|
84
|
-
onClick:
|
|
121
|
+
onClick: i
|
|
85
122
|
}
|
|
86
123
|
)
|
|
87
|
-
] }) : !e &&
|
|
88
|
-
|
|
124
|
+
] }) : !e && a ? /* @__PURE__ */ o(re, { height: "100vh" }) : /* @__PURE__ */ p(
|
|
125
|
+
de,
|
|
89
126
|
{
|
|
90
|
-
ref:
|
|
127
|
+
ref: T,
|
|
91
128
|
$widthX: 50,
|
|
92
|
-
$disablePointerEvents:
|
|
129
|
+
$disablePointerEvents: a,
|
|
93
130
|
$justifyContent: "center",
|
|
94
131
|
$alignItems: "center",
|
|
95
132
|
$height: "max-content",
|
|
96
133
|
children: [
|
|
97
|
-
|
|
98
|
-
|
|
134
|
+
t === "TEACHER" && /* @__PURE__ */ o(me, { $height: "100%", className: "goal-widget-chapter-item", children: /* @__PURE__ */ o(pe, { children: /* @__PURE__ */ o(
|
|
135
|
+
oe,
|
|
99
136
|
{
|
|
100
|
-
Icon:
|
|
137
|
+
Icon: q,
|
|
101
138
|
renderAs: "secondary-gray",
|
|
102
139
|
analyticsLabel: "chapter_page_exit",
|
|
103
140
|
size: "xsmall",
|
|
104
|
-
onClick:
|
|
141
|
+
onClick: P
|
|
105
142
|
}
|
|
106
143
|
) }) }),
|
|
107
|
-
|
|
108
|
-
e && /* @__PURE__ */
|
|
109
|
-
/* @__PURE__ */
|
|
110
|
-
|
|
144
|
+
a && /* @__PURE__ */ o(fe, { children: /* @__PURE__ */ o("img", { src: V.LOADER_1, alt: "loader" }) }),
|
|
145
|
+
e && /* @__PURE__ */ p(z, { children: [
|
|
146
|
+
/* @__PURE__ */ o(
|
|
147
|
+
ce,
|
|
111
148
|
{
|
|
112
149
|
title: e.name,
|
|
113
150
|
imageHue: e.image_hue,
|
|
114
151
|
imageUrl: e.image_url,
|
|
115
152
|
progressStats: e == null ? void 0 : e.progress_stat,
|
|
116
|
-
bannerRef:
|
|
153
|
+
bannerRef: U
|
|
117
154
|
}
|
|
118
155
|
),
|
|
119
|
-
/* @__PURE__ */
|
|
120
|
-
|
|
156
|
+
/* @__PURE__ */ o(
|
|
157
|
+
le,
|
|
121
158
|
{
|
|
122
159
|
imageHue: e.image_hue,
|
|
123
|
-
userType:
|
|
160
|
+
userType: t,
|
|
124
161
|
blocks: e.blocks,
|
|
125
|
-
onBlockSkipUnskip:
|
|
126
|
-
onNodeAttempt:
|
|
127
|
-
onNodeAssignAsHomework:
|
|
128
|
-
onNodeMarkAsDone:
|
|
129
|
-
onNodeReattempt:
|
|
130
|
-
onNodeReview:
|
|
131
|
-
onNodeView:
|
|
132
|
-
coreBlocksRef:
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
162
|
+
onBlockSkipUnskip: J,
|
|
163
|
+
onNodeAttempt: A,
|
|
164
|
+
onNodeAssignAsHomework: b,
|
|
165
|
+
onNodeMarkAsDone: $,
|
|
166
|
+
onNodeReattempt: x,
|
|
167
|
+
onNodeReview: I,
|
|
168
|
+
onNodeView: v,
|
|
169
|
+
coreBlocksRef: W,
|
|
170
|
+
challengeBlockRef: F,
|
|
171
|
+
downloadCoreBlockRef: O,
|
|
172
|
+
downloadBlockRef: X,
|
|
173
|
+
onNodeUnassign: _,
|
|
174
|
+
onNodeUnlock: E,
|
|
175
|
+
onNodeSkipUnSkip: H,
|
|
176
|
+
onBlockReset: L
|
|
138
177
|
}
|
|
139
178
|
)
|
|
140
179
|
] })
|
|
141
180
|
]
|
|
142
181
|
}
|
|
143
182
|
);
|
|
144
|
-
}),
|
|
183
|
+
}), Pe = he;
|
|
145
184
|
export {
|
|
146
|
-
|
|
185
|
+
Pe as default
|
|
147
186
|
};
|
|
148
187
|
//# sourceMappingURL=chapter-details.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chapter-details.js","sources":["../../../../src/features/chapters-v2/chapter-details/chapter-details.tsx"],"sourcesContent":["import type { IChapterDetails } from './chapter-details-types';\nimport type { FC } from 'react';\n\nimport { memo, useCallback, useEffect } from 'react';\n\nimport { ILLUSTRATIONS } from '../../../assets/illustrations/illustrations';\nimport Back2Icon from '../../../assets/line-icons/icons/back2';\nimport { useChallengeArenaJourney } from '../../journey/hooks/use-chapter-page-journey/use-challenge-arena-journey';\nimport { useJourney } from '../../journey/use-journey/use-journey';\nimport Button from '../../ui/buttons/button/button';\nimport IconButton from '../../ui/buttons/icon-button/icon-button';\nimport FlexView from '../../ui/layout/flex-view';\nimport AppLoader from '../../ui/loader/app-loader/app-loader';\nimport Text from '../../ui/text/text';\nimport { useGetChapterDetails } from '../api/chapter';\nimport BlockSections from './block-sections/block-sections';\nimport ChapterBanner from './chapter-banner/chapter-banner';\nimport * as Styled from './chapter-details-styled';\n\nconst ChapterDetails: FC<IChapterDetails> = memo(props => {\n const {\n userChapterId,\n studentId,\n userType,\n onBlockSkipUnskip,\n onNodeAttempt,\n onNodeAssignAsHomework,\n onNodeMarkAsDone,\n onNodeReattempt,\n onNodeReview,\n onNodeView,\n onExit,\n onNodeUnassign,\n onNodeUnlock,\n onNodeSkipUnSkip,\n startChapterPageJourney,\n onBlockReset,\n chapterPageRef,\n bannerRef,\n coreBlocksRef,\n canStartJourney,\n canStartChallengeArenaJourney,\n } = props;\n const { isJourneyActive } = useJourney();\n const {\n get: getChapterDetails,\n data: chapterDetails,\n isProcessing,\n isProcessingFailed,\n isStale,\n } = useGetChapterDetails();\n\n const fetchChapterDetails = useCallback(() => {\n getChapterDetails(userChapterId, undefined, { studentId });\n }, [getChapterDetails, userChapterId, studentId]);\n\n useEffect(() => {\n fetchChapterDetails();\n }, [fetchChapterDetails]);\n\n const { blockSectionRef, startJourney: startChallengeArenaJourney } = useChallengeArenaJourney();\n\n useEffect(() => {\n if (chapterDetails && canStartJourney && !isJourneyActive && startChapterPageJourney) {\n startChapterPageJourney({\n chapterDetails: chapterDetails,\n userChapterId,\n studentId,\n userType,\n });\n }\n\n if (chapterDetails && !canStartJourney && canStartChallengeArenaJourney && !isJourneyActive) {\n startChallengeArenaJourney({\n chapterDetails,\n userType,\n });\n }\n }, [\n canStartChallengeArenaJourney,\n canStartJourney,\n chapterDetails,\n isJourneyActive,\n startChallengeArenaJourney,\n startChapterPageJourney,\n studentId,\n userChapterId,\n userType,\n ]);\n\n useEffect(() => {\n if (!isProcessing && isStale) {\n fetchChapterDetails();\n }\n }, [fetchChapterDetails, isProcessing, isStale]);\n\n if (isProcessingFailed) {\n return (\n <FlexView $flexGapX={1.5} $height=\"100vh\" $justifyContent=\"center\" $alignItems=\"center\">\n <Text $renderAs=\"h6\">Oops! Something went wrong. Please try again later.</Text>\n <Button\n widthX={14}\n size=\"small\"\n shape=\"square\"\n renderAs=\"primary\"\n label=\"Try again\"\n onClick={fetchChapterDetails}\n />\n </FlexView>\n );\n }\n\n if (!chapterDetails && isProcessing) {\n return <AppLoader height=\"100vh\" />;\n }\n\n return (\n <Styled.ContentWrapper\n ref={chapterPageRef}\n $widthX={50}\n $disablePointerEvents={isProcessing}\n $justifyContent=\"center\"\n $alignItems=\"center\"\n $height=\"max-content\"\n >\n {userType === 'TEACHER' && (\n <Styled.BackButtonContainer $height=\"100%\" className=\"goal-widget-chapter-item\">\n <Styled.BackButtonWrapper>\n <IconButton\n Icon={Back2Icon}\n renderAs=\"secondary-gray\"\n analyticsLabel=\"chapter_page_exit\"\n size=\"xsmall\"\n onClick={onExit}\n />\n </Styled.BackButtonWrapper>\n </Styled.BackButtonContainer>\n )}\n\n {isProcessing && (\n <Styled.LoaderWrapper>\n <img src={ILLUSTRATIONS.LOADER_1} alt=\"loader\" />\n </Styled.LoaderWrapper>\n )}\n\n {chapterDetails && (\n <>\n <ChapterBanner\n title={chapterDetails.name}\n imageHue={chapterDetails.image_hue}\n imageUrl={chapterDetails.image_url}\n progressStats={chapterDetails?.progress_stat}\n bannerRef={bannerRef}\n />\n <BlockSections\n imageHue={chapterDetails.image_hue}\n userType={userType}\n blocks={chapterDetails.blocks}\n onBlockSkipUnskip={onBlockSkipUnskip}\n onNodeAttempt={onNodeAttempt}\n onNodeAssignAsHomework={onNodeAssignAsHomework}\n onNodeMarkAsDone={onNodeMarkAsDone}\n onNodeReattempt={onNodeReattempt}\n onNodeReview={onNodeReview}\n onNodeView={onNodeView}\n coreBlocksRef={coreBlocksRef}\n blockSectionRef={blockSectionRef}\n onNodeUnassign={onNodeUnassign}\n onNodeUnlock={onNodeUnlock}\n onNodeSkipUnSkip={onNodeSkipUnSkip}\n onBlockReset={onBlockReset}\n />\n </>\n )}\n </Styled.ContentWrapper>\n );\n});\n\nexport default ChapterDetails;\n"],"names":["ChapterDetails","memo","props","userChapterId","studentId","userType","onBlockSkipUnskip","onNodeAttempt","onNodeAssignAsHomework","onNodeMarkAsDone","onNodeReattempt","onNodeReview","onNodeView","onExit","onNodeUnassign","onNodeUnlock","onNodeSkipUnSkip","startChapterPageJourney","onBlockReset","chapterPageRef","bannerRef","coreBlocksRef","canStartJourney","canStartChallengeArenaJourney","isJourneyActive","useJourney","getChapterDetails","chapterDetails","isProcessing","isProcessingFailed","isStale","useGetChapterDetails","fetchChapterDetails","useCallback","useEffect","blockSectionRef","startChallengeArenaJourney","useChallengeArenaJourney","jsxs","FlexView","jsx","Text","Button","AppLoader","Styled.ContentWrapper","Styled.BackButtonContainer","Styled.BackButtonWrapper","IconButton","Back2Icon","Styled.LoaderWrapper","ILLUSTRATIONS","Fragment","ChapterBanner","BlockSections","ChapterDetails$1"],"mappings":";;;;;;;;;;;;;;;AAmBA,MAAMA,IAAsCC,EAAK,CAASC,MAAA;AAClD,QAAA;AAAA,IACJ,eAAAC;AAAA,IACA,WAAAC;AAAA,IACA,UAAAC;AAAA,IACA,mBAAAC;AAAA,IACA,eAAAC;AAAA,IACA,wBAAAC;AAAA,IACA,kBAAAC;AAAA,IACA,iBAAAC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ACF;AAAA,UACA,gBAAAoB;AAAA,YAACa;AAAA,YAAA;AAAA,cACC,UAAU1B,EAAe;AAAA,cACzB,UAAAtB;AAAA,cACA,QAAQsB,EAAe;AAAA,cACvB,mBAAArB;AAAA,cACA,eAAAC;AAAA,cACA,wBAAAC;AAAA,cACA,kBAAAC;AAAA,cACA,iBAAAC;AAAA,cACA,cAAAC;AAAA,cACA,YAAAC;AAAA,cACA,eAAAS;AAAA,cACA,iBAAAc;AAAA,cACA,gBAAArB;AAAA,cACA,cAAAC;AAAA,cACA,kBAAAC;AAAA,cACA,cAAAE;AAAA,YAAA;AAAA,UACF;AAAA,QAAA,GACF;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAIR,CAAC,GAEDoC,KAAetD;"}
|
|
1
|
+
{"version":3,"file":"chapter-details.js","sources":["../../../../src/features/chapters-v2/chapter-details/chapter-details.tsx"],"sourcesContent":["import type { IChapterDetails } from './chapter-details-types';\nimport type { FC } from 'react';\n\nimport { memo, useCallback, useEffect, useMemo } from 'react';\n\nimport { ILLUSTRATIONS } from '../../../assets/illustrations/illustrations';\nimport Back2Icon from '../../../assets/line-icons/icons/back2';\nimport { useChallengeArenaJourney } from '../../journey/hooks/use-chapter-page-journey/use-challenge-arena-journey';\nimport { useDownloadBlockJourney } from '../../journey/hooks/use-chapter-page-journey/use-download-block-journey';\nimport { useDownloadNodeJourney } from '../../journey/hooks/use-chapter-page-journey/use-download-node-journey';\nimport { useJourney } from '../../journey/use-journey/use-journey';\nimport Button from '../../ui/buttons/button/button';\nimport IconButton from '../../ui/buttons/icon-button/icon-button';\nimport FlexView from '../../ui/layout/flex-view';\nimport AppLoader from '../../ui/loader/app-loader/app-loader';\nimport Text from '../../ui/text/text';\nimport { useGetChapterDetails } from '../api/chapter';\nimport { getHasDownloadBlock, getHasNonDownloadBlockWithPdfNode } from '../utils';\nimport BlockSections from './block-sections/block-sections';\nimport ChapterBanner from './chapter-banner/chapter-banner';\nimport * as Styled from './chapter-details-styled';\n\nconst ChapterDetails: FC<IChapterDetails> = memo(props => {\n const {\n userChapterId,\n studentId,\n userType,\n onBlockSkipUnskip,\n onNodeAttempt,\n onNodeAssignAsHomework,\n onNodeMarkAsDone,\n onNodeReattempt,\n onNodeReview,\n onNodeView,\n onExit,\n onNodeUnassign,\n onNodeUnlock,\n onNodeSkipUnSkip,\n startChapterPageJourney,\n onBlockReset,\n chapterPageRef,\n bannerRef,\n coreBlocksRef,\n canStartJourney,\n canStartChallengeArenaJourney,\n canStartDownloadNodeJourney,\n canStartDownloadBlockJourney,\n } = props;\n\n const { isJourneyActive } = useJourney();\n const {\n get: getChapterDetails,\n data: chapterDetails,\n isProcessing,\n isProcessingFailed,\n isStale,\n } = useGetChapterDetails();\n\n const fetchChapterDetails = useCallback(() => {\n getChapterDetails(userChapterId, undefined, { studentId });\n }, [getChapterDetails, userChapterId, studentId]);\n\n useEffect(() => {\n fetchChapterDetails();\n }, [fetchChapterDetails]);\n\n const { blockSectionRef: challengeBlockRef, startJourney: startChallengeArenaJourney } =\n useChallengeArenaJourney();\n\n const {\n blockSectionRef: downloadBlockRef,\n downloadCoreBlockRef,\n startJourney: startDownloadNodeJourney,\n } = useDownloadNodeJourney();\n\n const { blockSectionRef: downloadBlockSectionRef, startJourney: startDownloadBlockJourney } =\n useDownloadBlockJourney();\n\n const hasDownloadBlock = useMemo(\n () => chapterDetails && getHasDownloadBlock(chapterDetails.blocks),\n [chapterDetails],\n );\n const hasNonDownloadBlockWithPdfNode = useMemo(\n () => chapterDetails && getHasNonDownloadBlockWithPdfNode(chapterDetails.blocks),\n [chapterDetails],\n );\n\n const activeDownloadBlockRef = useMemo(\n () =>\n canStartDownloadNodeJourney && hasNonDownloadBlockWithPdfNode\n ? downloadBlockRef\n : canStartDownloadBlockJourney\n ? downloadBlockSectionRef\n : undefined,\n [\n canStartDownloadNodeJourney,\n canStartDownloadBlockJourney,\n hasNonDownloadBlockWithPdfNode,\n downloadBlockRef,\n downloadBlockSectionRef,\n ],\n );\n\n useEffect(() => {\n if (chapterDetails && !isJourneyActive) {\n if (canStartJourney && startChapterPageJourney) {\n startChapterPageJourney({\n chapterDetails: chapterDetails,\n userChapterId,\n studentId,\n userType,\n });\n }\n\n if (!canStartJourney && canStartChallengeArenaJourney) {\n startChallengeArenaJourney({\n chapterDetails,\n userType,\n });\n }\n\n if (!canStartJourney && canStartDownloadNodeJourney && hasNonDownloadBlockWithPdfNode) {\n startDownloadNodeJourney({\n chapterDetails,\n userType,\n canStartDownloadBlockJourney,\n });\n }\n\n if (!canStartJourney && canStartDownloadBlockJourney && hasDownloadBlock) {\n startDownloadBlockJourney({\n chapterDetails,\n userType,\n });\n }\n }\n }, [\n canStartChallengeArenaJourney,\n canStartJourney,\n chapterDetails,\n isJourneyActive,\n startChallengeArenaJourney,\n startChapterPageJourney,\n startDownloadBlockJourney,\n startDownloadNodeJourney,\n studentId,\n userChapterId,\n userType,\n hasNonDownloadBlockWithPdfNode,\n hasDownloadBlock,\n canStartDownloadNodeJourney,\n canStartDownloadBlockJourney,\n ]);\n\n useEffect(() => {\n if (!isProcessing && isStale) {\n fetchChapterDetails();\n }\n }, [fetchChapterDetails, isProcessing, isStale]);\n\n if (isProcessingFailed) {\n return (\n <FlexView $flexGapX={1.5} $height=\"100vh\" $justifyContent=\"center\" $alignItems=\"center\">\n <Text $renderAs=\"h6\">Oops! Something went wrong. Please try again later.</Text>\n <Button\n widthX={14}\n size=\"small\"\n shape=\"square\"\n renderAs=\"primary\"\n label=\"Try again\"\n onClick={fetchChapterDetails}\n />\n </FlexView>\n );\n }\n\n if (!chapterDetails && isProcessing) {\n return <AppLoader height=\"100vh\" />;\n }\n\n return (\n <Styled.ContentWrapper\n ref={chapterPageRef}\n $widthX={50}\n $disablePointerEvents={isProcessing}\n $justifyContent=\"center\"\n $alignItems=\"center\"\n $height=\"max-content\"\n >\n {userType === 'TEACHER' && (\n <Styled.BackButtonContainer $height=\"100%\" className=\"goal-widget-chapter-item\">\n <Styled.BackButtonWrapper>\n <IconButton\n Icon={Back2Icon}\n renderAs=\"secondary-gray\"\n analyticsLabel=\"chapter_page_exit\"\n size=\"xsmall\"\n onClick={onExit}\n />\n </Styled.BackButtonWrapper>\n </Styled.BackButtonContainer>\n )}\n\n {isProcessing && (\n <Styled.LoaderWrapper>\n <img src={ILLUSTRATIONS.LOADER_1} alt=\"loader\" />\n </Styled.LoaderWrapper>\n )}\n\n {chapterDetails && (\n <>\n <ChapterBanner\n title={chapterDetails.name}\n imageHue={chapterDetails.image_hue}\n imageUrl={chapterDetails.image_url}\n progressStats={chapterDetails?.progress_stat}\n bannerRef={bannerRef}\n />\n <BlockSections\n imageHue={chapterDetails.image_hue}\n userType={userType}\n blocks={chapterDetails.blocks}\n onBlockSkipUnskip={onBlockSkipUnskip}\n onNodeAttempt={onNodeAttempt}\n onNodeAssignAsHomework={onNodeAssignAsHomework}\n onNodeMarkAsDone={onNodeMarkAsDone}\n onNodeReattempt={onNodeReattempt}\n onNodeReview={onNodeReview}\n onNodeView={onNodeView}\n coreBlocksRef={coreBlocksRef}\n challengeBlockRef={challengeBlockRef}\n downloadCoreBlockRef={downloadCoreBlockRef}\n downloadBlockRef={activeDownloadBlockRef}\n onNodeUnassign={onNodeUnassign}\n onNodeUnlock={onNodeUnlock}\n onNodeSkipUnSkip={onNodeSkipUnSkip}\n onBlockReset={onBlockReset}\n />\n </>\n )}\n </Styled.ContentWrapper>\n );\n});\n\nexport default ChapterDetails;\n"],"names":["ChapterDetails","memo","props","userChapterId","studentId","userType","onBlockSkipUnskip","onNodeAttempt","onNodeAssignAsHomework","onNodeMarkAsDone","onNodeReattempt","onNodeReview","onNodeView","onExit","onNodeUnassign","onNodeUnlock","onNodeSkipUnSkip","startChapterPageJourney","onBlockReset","chapterPageRef","bannerRef","coreBlocksRef","canStartJourney","canStartChallengeArenaJourney","canStartDownloadNodeJourney","canStartDownloadBlockJourney","isJourneyActive","useJourney","getChapterDetails","chapterDetails","isProcessing","isProcessingFailed","isStale","useGetChapterDetails","fetchChapterDetails","useCallback","useEffect","challengeBlockRef","startChallengeArenaJourney","useChallengeArenaJourney","downloadBlockRef","downloadCoreBlockRef","startDownloadNodeJourney","useDownloadNodeJourney","downloadBlockSectionRef","startDownloadBlockJourney","useDownloadBlockJourney","hasDownloadBlock","useMemo","getHasDownloadBlock","hasNonDownloadBlockWithPdfNode","getHasNonDownloadBlockWithPdfNode","activeDownloadBlockRef","jsxs","FlexView","jsx","Text","Button","AppLoader","Styled.ContentWrapper","Styled.BackButtonContainer","Styled.BackButtonWrapper","IconButton","Back2Icon","Styled.LoaderWrapper","ILLUSTRATIONS","Fragment","ChapterBanner","BlockSections","ChapterDetails$1"],"mappings":";;;;;;;;;;;;;;;;;;AAsBA,MAAMA,KAAsCC,EAAK,CAASC,MAAA;AAClD,QAAA;AAAA,IACJ,eAAAC;AAAA,IACA,WAAAC;AAAA,IACA,UAAAC;AAAA,IACA,mBAAAC;AAAA,IACA,eAAAC;AAAA,IACA,wBAAAC;AAAA,IACA,kBAAAC;AAAA,IACA,iBAAAC;AAAA,IACA,cAAAC;AAAA,IACA,YAAAC;AAAA,IACA,QAAAC;AAAA,IACA,gBAAAC;AAAA,IACA,cAAAC;AAAA,IACA,kBAAAC;AAAA,IACA,yBAAAC;AAAA,IACA,cAAAC;AAAA,IACA,gBAAAC;AAAA,IACA,WAAAC;AAAA,IACA,eAAAC;AAAA,IACA,iBAAAC;AAAA,IACA,+BAAAC;AAAA,IACA,6BAAAC;AAAA,IACA,8BAAAC;AAAA,EACE,IAAAvB,GAEE,EAAE,iBAAAwB,MAAoBC,KACtB;AAAA,IACJ,KAAKC;AAAA,IACL,MAAMC;AAAA,IACN,cAAAC;AAAA,IACA,oBAAAC;AAAA,IACA,SAAAC;AAAA,MACEC,GAAqB,GAEnBC,IAAsBC,EAAY,MAAM;AAC5C,IAAAP,EAAkBzB,GAAe,QAAW,EAAE,WAAAC,EAAW,CAAA;AAAA,EACxD,GAAA,CAACwB,GAAmBzB,GAAeC,CAAS,CA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GDpC,KAEG,gBAAAwB,EAAAa,GAAA,EAAA,UAAA;AAAA,UAAA,gBAAAX;AAAA,YAACY;AAAA,YAAA;AAAA,cACC,OAAOtC,EAAe;AAAA,cACtB,UAAUA,EAAe;AAAA,cACzB,UAAUA,EAAe;AAAA,cACzB,eAAeA,KAAA,gBAAAA,EAAgB;AAAA,cAC/B,WAAAT;AAAA,YAAA;AAAA,UACF;AAAA,UACA,gBAAAmC;AAAA,YAACa;AAAA,YAAA;AAAA,cACC,UAAUvC,EAAe;AAAA,cACzB,UAAAxB;AAAA,cACA,QAAQwB,EAAe;AAAA,cACvB,mBAAAvB;AAAA,cACA,eAAAC;AAAA,cACA,wBAAAC;AAAA,cACA,kBAAAC;AAAA,cACA,iBAAAC;AAAA,cACA,cAAAC;AAAA,cACA,YAAAC;AAAA,cACA,eAAAS;AAAA,cACA,mBAAAgB;AAAA,cACA,sBAAAI;AAAA,cACA,kBAAkBW;AAAA,cAClB,gBAAAtC;AAAA,cACA,cAAAC;AAAA,cACA,kBAAAC;AAAA,cACA,cAAAE;AAAA,YAAA;AAAA,UACF;AAAA,QAAA,GACF;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAIR,CAAC,GAEDmD,KAAerE;"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { ILLUSTRATIONS as e } from "../../../assets/illustrations/illustrations.js";
|
|
2
|
-
const
|
|
2
|
+
const S = (E) => {
|
|
3
3
|
if (!E) return 0;
|
|
4
|
-
const { mandatory:
|
|
5
|
-
return
|
|
6
|
-
},
|
|
4
|
+
const { mandatory: _ } = E, { completed: t, total: c } = _;
|
|
5
|
+
return c === 0 ? 0 : Math.floor(t / c * 100);
|
|
6
|
+
}, A = (E) => {
|
|
7
7
|
switch (E) {
|
|
8
8
|
case "LEVEL2":
|
|
9
9
|
case "LEVEL3":
|
|
@@ -52,20 +52,24 @@ const A = (E) => {
|
|
|
52
52
|
default:
|
|
53
53
|
return e.NODE_PROJECT_BG;
|
|
54
54
|
}
|
|
55
|
-
},
|
|
55
|
+
}, r = ({
|
|
56
56
|
isSkipped: E,
|
|
57
|
-
sheetsLength:
|
|
58
|
-
isGoalBlock:
|
|
59
|
-
lessonIdx:
|
|
60
|
-
isSatMockTestBlock:
|
|
57
|
+
sheetsLength: _,
|
|
58
|
+
isGoalBlock: t,
|
|
59
|
+
lessonIdx: c,
|
|
60
|
+
isSatMockTestBlock: a
|
|
61
61
|
}) => {
|
|
62
|
-
if (!
|
|
63
|
-
if (!(E || !
|
|
64
|
-
return `${
|
|
65
|
-
}
|
|
62
|
+
if (!t && !a) return `(${_})`;
|
|
63
|
+
if (!(E || !c))
|
|
64
|
+
return `${c}`;
|
|
65
|
+
}, T = (E) => E.some(
|
|
66
|
+
(_) => _.block_type !== "DOWNLOADS" && _.sheets.some((t) => t.node_type === "PDF")
|
|
67
|
+
), N = (E) => E.some((_) => _.block_type === "DOWNLOADS");
|
|
66
68
|
export {
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
69
|
+
S as getChapterCompletionPercentage,
|
|
70
|
+
N as getHasDownloadBlock,
|
|
71
|
+
T as getHasNonDownloadBlockWithPdfNode,
|
|
72
|
+
A as getNodeTypeBasedBgImage,
|
|
73
|
+
r as getSheetNLessonCount
|
|
70
74
|
};
|
|
71
75
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../src/features/chapters-v2/utils/index.ts"],"sourcesContent":["import type {
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../src/features/chapters-v2/utils/index.ts"],"sourcesContent":["import type {\n IChapterBlockData,\n IChapterProgressStats,\n} from '../chapter-details/chapter-details-types';\nimport type { INodeDataProps } from '../comps/node-card/node-card-types';\n\nimport { ILLUSTRATIONS } from '../../../assets/illustrations/illustrations';\n\n// This function calculates the completion percentage of a chapter based on progress stats.\n// If no progress stats are provided, it returns 0.\n// It uses the `mandatory` field from the progress stats to determine the completed and total items.\n// It returns an integer representing the percentage of completion, rounded down to the nearest whole number.\nconst getChapterCompletionPercentage = (progressStats: IChapterProgressStats | null) => {\n if (!progressStats) return 0;\n\n const { mandatory } = progressStats;\n const { completed, total } = mandatory;\n\n if (total === 0) {\n return 0;\n }\n\n const percentage = Math.floor((completed / total) * 100);\n\n return percentage;\n};\n\nconst getNodeTypeBasedBgImage = (nodeType: INodeDataProps['node_type']) => {\n switch (nodeType) {\n case 'LEVEL2':\n case 'LEVEL3':\n case 'HIDDEN_BASIC':\n return ILLUSTRATIONS.NODE_TEST_PREP_BG;\n case 'LEARNING':\n case 'SAT_MATH_LEARNING':\n case 'SAT_ENGLISH_LEARNING':\n return ILLUSTRATIONS.NODE_LEARN_BG;\n case 'RECAP':\n case 'REMEDIAL':\n case 'REVISION':\n case 'PPT_BASIC':\n case 'SAT_MATH_RECAP':\n case 'SAT_ENGLISH_RECAP':\n return ILLUSTRATIONS.NODE_RECAP_BG;\n\n case 'DYNAMIC':\n case 'ASSESSMENT':\n case 'CHAPTER_ASSESSMENT':\n case 'DIAGNOSTIC':\n case 'TURING_ASSESSMENT':\n return ILLUSTRATIONS.NODE_CUSTOM_TEST_BG;\n\n case 'PRACTICE':\n case 'EXTRA_PRACTICE':\n case 'TARGET_PRACTICE':\n case 'MASTERY':\n case 'TURING_PRACTICE':\n case 'SAT_MATH_ASSESSMENT':\n case 'SAT_ENGLISH_ASSESSMENT':\n return ILLUSTRATIONS.NODE_PRACTICE_BG;\n\n case 'PUZZLE':\n case 'PUZZLE_EASY':\n case 'PUZZLE_MEDIUM':\n case 'PUZZLE_HARD':\n return ILLUSTRATIONS.NODE_PUZZLE_BG;\n\n case 'TURING_SUBJECTIVE':\n return ILLUSTRATIONS.NODE_SUBJECTIVE_BG;\n\n case 'TURING_BASIC':\n case 'PYTHON_BASIC':\n case 'PYTHON_VISUAL':\n return ILLUSTRATIONS.NODE_ACTIVITY_BG;\n\n case 'VIDEO':\n return ILLUSTRATIONS.NODE_VIDEO_BG;\n\n case 'PDF':\n return ILLUSTRATIONS.NODE_DOWNLOAD_BG;\n\n default:\n return ILLUSTRATIONS.NODE_PROJECT_BG;\n }\n};\n\ninterface IGetSheetNLessonCountParams {\n isSkipped: boolean;\n sheetsLength: number;\n isGoalBlock?: boolean;\n lessonIdx?: number;\n isSatMockTestBlock?: boolean;\n}\n\nconst getSheetNLessonCount = ({\n isSkipped,\n sheetsLength,\n isGoalBlock,\n lessonIdx,\n isSatMockTestBlock,\n}: IGetSheetNLessonCountParams) => {\n if (!isGoalBlock && !isSatMockTestBlock) return `(${sheetsLength})`;\n\n if (isSkipped || !lessonIdx) return undefined;\n\n return `${lessonIdx}`;\n};\n\nconst getHasNonDownloadBlockWithPdfNode = (blocks: IChapterBlockData[]) => {\n return blocks.some(\n blockInfo =>\n blockInfo.block_type !== 'DOWNLOADS' &&\n blockInfo.sheets.some(sheetInfo => sheetInfo.node_type === 'PDF'),\n );\n};\n\nconst getHasDownloadBlock = (blocks: IChapterBlockData[]) => {\n return blocks.some(blockInfo => blockInfo.block_type === 'DOWNLOADS');\n};\n\nexport {\n getChapterCompletionPercentage,\n getNodeTypeBasedBgImage,\n getSheetNLessonCount,\n getHasNonDownloadBlockWithPdfNode,\n getHasDownloadBlock,\n};\n"],"names":["getChapterCompletionPercentage","progressStats","mandatory","completed","total","getNodeTypeBasedBgImage","nodeType","ILLUSTRATIONS","getSheetNLessonCount","isSkipped","sheetsLength","isGoalBlock","lessonIdx","isSatMockTestBlock","getHasNonDownloadBlockWithPdfNode","blocks","blockInfo","sheetInfo","getHasDownloadBlock"],"mappings":";AAYM,MAAAA,IAAiC,CAACC,MAAgD;AAClF,MAAA,CAACA,EAAsB,QAAA;AAErB,QAAA,EAAE,WAAAC,EAAc,IAAAD,GAChB,EAAE,WAAAE,GAAW,OAAAC,EAAU,IAAAF;AAE7B,SAAIE,MAAU,IACL,IAGU,KAAK,MAAOD,IAAYC,IAAS,GAAG;AAGzD,GAEMC,IAA0B,CAACC,MAA0C;AACzE,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AACH,MACpBA,EAAO,KAAK,CAAaC,MAAAA,EAAU,eAAe,WAAW;"}
|
package/dist/features/circle-games/game-launcher/api/get-content-for-today/get-circle-home-api.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { createGetAPI as
|
|
2
|
-
import { BASE_URL as
|
|
3
|
-
const { useGet:
|
|
4
|
-
getURL: (
|
|
1
|
+
import { createGetAPI as i } from "@cuemath/rest-api";
|
|
2
|
+
import { BASE_URL as r } from "./constants.js";
|
|
3
|
+
const { useGet: a, invalidate: c } = i({
|
|
4
|
+
getURL: (o, { user_id: e, grade: t }) => `${r}/circle-home/?intelenrollment_id=${e}&grade=${t}`
|
|
5
5
|
});
|
|
6
6
|
export {
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
c as invalidateCircleHomeAPI,
|
|
8
|
+
a as useGetCircleHomeAPI
|
|
9
9
|
};
|
|
10
10
|
//# sourceMappingURL=get-circle-home-api.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-circle-home-api.js","sources":["../../../../../../src/features/circle-games/game-launcher/api/get-content-for-today/get-circle-home-api.ts"],"sourcesContent":["import type {\n IGetCircleHomeResponseModel,\n IGetCircleHomePayloadModel,\n} from './get-circle-home-api-types';\n\nimport { createGetAPI } from '@cuemath/rest-api';\n\nimport { BASE_URL } from './constants';\n\nexport const { useGet: useGetCircleHomeAPI, invalidate: invalidateCircleHomeAPI } = createGetAPI<\n IGetCircleHomeResponseModel,\n IGetCircleHomePayloadModel\n>({\n getURL: (_, { user_id,
|
|
1
|
+
{"version":3,"file":"get-circle-home-api.js","sources":["../../../../../../src/features/circle-games/game-launcher/api/get-content-for-today/get-circle-home-api.ts"],"sourcesContent":["import type {\n IGetCircleHomeResponseModel,\n IGetCircleHomePayloadModel,\n} from './get-circle-home-api-types';\n\nimport { createGetAPI } from '@cuemath/rest-api';\n\nimport { BASE_URL } from './constants';\n\nexport const { useGet: useGetCircleHomeAPI, invalidate: invalidateCircleHomeAPI } = createGetAPI<\n IGetCircleHomeResponseModel,\n IGetCircleHomePayloadModel\n>({\n getURL: (_, { user_id, grade }) =>\n `${BASE_URL}/circle-home/?intelenrollment_id=${user_id}&grade=${grade}`,\n});\n"],"names":["useGetCircleHomeAPI","invalidateCircleHomeAPI","createGetAPI","_","user_id","grade","BASE_URL"],"mappings":";;AASO,MAAM,EAAE,QAAQA,GAAqB,YAAYC,EAAA,IAA4BC,EAGlF;AAAA,EACA,QAAQ,CAACC,GAAG,EAAE,SAAAC,GAAS,OAAAC,EACrB,MAAA,GAAGC,CAAQ,oCAAoCF,CAAO,UAAUC,CAAK;AACzE,CAAC;"}
|
|
@@ -1,37 +1,36 @@
|
|
|
1
|
-
import { useMemo as
|
|
2
|
-
import { useGetCircleHomeAPI as
|
|
3
|
-
import { transformCircleHomeData as
|
|
4
|
-
const
|
|
5
|
-
const t =
|
|
1
|
+
import { useMemo as H, useState as D, useCallback as s, useEffect as p } from "react";
|
|
2
|
+
import { useGetCircleHomeAPI as u, invalidateCircleHomeAPI as y } from "../../api/get-content-for-today/get-circle-home-api.js";
|
|
3
|
+
import { transformCircleHomeData as c } from "./helper.js";
|
|
4
|
+
const A = (e, a) => {
|
|
5
|
+
const t = H(
|
|
6
6
|
() => ({
|
|
7
7
|
user_id: e,
|
|
8
|
-
grade: a
|
|
9
|
-
country_code: l
|
|
8
|
+
grade: a
|
|
10
9
|
}),
|
|
11
|
-
[e, a
|
|
10
|
+
[e, a]
|
|
12
11
|
), {
|
|
13
12
|
data: o = null,
|
|
14
|
-
get:
|
|
13
|
+
get: l,
|
|
15
14
|
isProcessed: i,
|
|
16
|
-
...
|
|
17
|
-
} =
|
|
18
|
-
|
|
15
|
+
...n
|
|
16
|
+
} = u(e, t), [r, m] = D(
|
|
17
|
+
c(o)
|
|
19
18
|
), C = s(() => {
|
|
20
|
-
|
|
21
|
-
}, [
|
|
22
|
-
|
|
19
|
+
l(e, t);
|
|
20
|
+
}, [l, t, e]), f = s(() => {
|
|
21
|
+
y(e, t);
|
|
23
22
|
}, [t, e]);
|
|
24
|
-
return
|
|
25
|
-
i && o &&
|
|
23
|
+
return p(() => {
|
|
24
|
+
i && o && m(c(o));
|
|
26
25
|
}, [o, i]), {
|
|
27
|
-
data:
|
|
26
|
+
data: r,
|
|
28
27
|
isProcessed: i,
|
|
29
28
|
getCircleHomeDetails: C,
|
|
30
|
-
invalidateCircleHomeDetails:
|
|
31
|
-
...
|
|
29
|
+
invalidateCircleHomeDetails: f,
|
|
30
|
+
...n
|
|
32
31
|
};
|
|
33
32
|
};
|
|
34
33
|
export {
|
|
35
|
-
|
|
34
|
+
A as useGetCircleHomeDetailsDal
|
|
36
35
|
};
|
|
37
36
|
//# sourceMappingURL=use-get-circle-home-details-dal.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-get-circle-home-details-dal.js","sources":["../../../../../../src/features/circle-games/game-launcher/dal/use-get-circle-home-details-dal/use-get-circle-home-details-dal.ts"],"sourcesContent":["import type { ICircleHomeDetails } from './use-get-circle-home-dal-types';\n\nimport { useCallback, useEffect, useMemo, useState } from 'react';\n\nimport {\n invalidateCircleHomeAPI,\n useGetCircleHomeAPI,\n} from '../../api/get-content-for-today/get-circle-home-api';\nimport { transformCircleHomeData } from './helper';\n\nexport const useGetCircleHomeDetailsDal = (\n userId: string,\n grade: string,\n
|
|
1
|
+
{"version":3,"file":"use-get-circle-home-details-dal.js","sources":["../../../../../../src/features/circle-games/game-launcher/dal/use-get-circle-home-details-dal/use-get-circle-home-details-dal.ts"],"sourcesContent":["import type { ICircleHomeDetails } from './use-get-circle-home-dal-types';\n\nimport { useCallback, useEffect, useMemo, useState } from 'react';\n\nimport {\n invalidateCircleHomeAPI,\n useGetCircleHomeAPI,\n} from '../../api/get-content-for-today/get-circle-home-api';\nimport { transformCircleHomeData } from './helper';\n\nexport const useGetCircleHomeDetailsDal = (\n userId: string,\n grade: string,\n): Omit<ReturnType<typeof useGetCircleHomeAPI>, 'data' | 'get'> & {\n data: ICircleHomeDetails | null;\n getCircleHomeDetails: () => void;\n invalidateCircleHomeDetails: () => void;\n} => {\n const initialQuery = useMemo(\n () => ({\n user_id: userId,\n grade,\n }),\n [userId, grade],\n );\n\n const {\n data = null,\n get: getHomeDetails,\n isProcessed,\n ...rest\n } = useGetCircleHomeAPI(userId, initialQuery);\n const [contentForToday, setContentForToday] = useState<ICircleHomeDetails | null>(\n transformCircleHomeData(data),\n );\n\n const getCircleHomeDetails = useCallback(() => {\n getHomeDetails(userId, initialQuery);\n }, [getHomeDetails, initialQuery, userId]);\n\n const invalidateCircleHomeDetails = useCallback(() => {\n invalidateCircleHomeAPI(userId, initialQuery);\n }, [initialQuery, userId]);\n\n useEffect(() => {\n if (isProcessed && data) {\n setContentForToday(transformCircleHomeData(data));\n }\n }, [data, isProcessed]);\n\n return {\n data: contentForToday,\n isProcessed,\n getCircleHomeDetails,\n invalidateCircleHomeDetails,\n ...rest,\n };\n};\n"],"names":["useGetCircleHomeDetailsDal","userId","grade","initialQuery","useMemo","data","getHomeDetails","isProcessed","rest","useGetCircleHomeAPI","contentForToday","setContentForToday","useState","transformCircleHomeData","getCircleHomeDetails","useCallback","invalidateCircleHomeDetails","invalidateCircleHomeAPI","useEffect"],"mappings":";;;AAUa,MAAAA,IAA6B,CACxCC,GACAC,MAKG;AACH,QAAMC,IAAeC;AAAA,IACnB,OAAO;AAAA,MACL,SAASH;AAAA,MACT,OAAAC;AAAA,IAAA;AAAA,IAEF,CAACD,GAAQC,CAAK;AAAA,EAAA,GAGV;AAAA,IACJ,MAAAG,IAAO;AAAA,IACP,KAAKC;AAAA,IACL,aAAAC;AAAA,IACA,GAAGC;AAAA,EAAA,IACDC,EAAoBR,GAAQE,CAAY,GACtC,CAACO,GAAiBC,CAAkB,IAAIC;AAAA,IAC5CC,EAAwBR,CAAI;AAAA,EAAA,GAGxBS,IAAuBC,EAAY,MAAM;AAC7C,IAAAT,EAAeL,GAAQE,CAAY;AAAA,EAClC,GAAA,CAACG,GAAgBH,GAAcF,CAAM,CAAC,GAEnCe,IAA8BD,EAAY,MAAM;AACpD,IAAAE,EAAwBhB,GAAQE,CAAY;AAAA,EAAA,GAC3C,CAACA,GAAcF,CAAM,CAAC;AAEzB,SAAAiB,EAAU,MAAM;AACd,IAAIX,KAAeF,KACEM,EAAAE,EAAwBR,CAAI,CAAC;AAAA,EAClD,GACC,CAACA,GAAME,CAAW,CAAC,GAEf;AAAA,IACL,MAAMG;AAAA,IACN,aAAAH;AAAA,IACA,sBAAAO;AAAA,IACA,6BAAAE;AAAA,IACA,GAAGR;AAAA,EAAA;AAEP;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"web-view-types.js","sources":["../../../../../src/features/circle-games/games/web-view/web-view-types.ts"],"sourcesContent":["import type { IAvatarLayer } from '../../../ui/avatar/avatar-types';\nimport type { TUserTypes } from '../../../ui/types';\nimport type { WebViewEvent, ProjectOutcome, ProjectType } from './enums';\nimport type { WEBVIEW_ANALYTICS_EVENTS } from './web-view-analytics-events';\nimport type { IframeHTMLAttributes } from 'react';\n\nexport interface IPlayer {\n id: string;\n username: string;\n grade?: string;\n avatar?: IAvatarLayer[] | null;\n playerType: TUserTypes;\n
|
|
1
|
+
{"version":3,"file":"web-view-types.js","sources":["../../../../../src/features/circle-games/games/web-view/web-view-types.ts"],"sourcesContent":["import type { IAvatarLayer } from '../../../ui/avatar/avatar-types';\nimport type { TUserTypes } from '../../../ui/types';\nimport type { WebViewEvent, ProjectOutcome, ProjectType } from './enums';\nimport type { WEBVIEW_ANALYTICS_EVENTS } from './web-view-analytics-events';\nimport type { IframeHTMLAttributes } from 'react';\n\nexport interface IPlayer {\n id: string;\n username: string;\n grade?: string;\n avatar?: IAvatarLayer[] | null;\n playerType: TUserTypes;\n isAdmin?: boolean;\n}\n\ninterface ISyncableWebGameProps {\n joinByRoomId?: string;\n enableSync?: boolean; // applicable for all except multiplayer games and tables\n}\n\ninterface IBaseWebGameProps {\n projectId: string;\n variant: string;\n projectType: ProjectType;\n enableCloseButton?: boolean;\n}\n\nexport interface IMultiplayerWebGameProps extends IBaseWebGameProps, ISyncableWebGameProps {\n enablePlayerTurnIndicators?: boolean;\n}\n\nexport interface IPuzzleWebGameProps extends IBaseWebGameProps, ISyncableWebGameProps {\n question: string;\n askHintPermission?: boolean;\n}\n\nexport interface ILessonWebGameProps extends IBaseWebGameProps, ISyncableWebGameProps {\n miniGameIdentifier: string;\n sessionId: string;\n targetQuestions: number;\n}\n\nexport interface ITableWebGameProps extends IBaseWebGameProps {\n tableNumber: number;\n infiniteModeHighScore?: number;\n}\n\nexport interface IVibrationPattern {\n pattern: number[] | number;\n}\n\nexport enum IStatsToAwardErrorCode {\n DEFAULT = 'default',\n SUCCESS = 'success',\n FAIL = 'fail',\n}\n\nexport interface IPlayerStats {\n points: number;\n accuracy: number;\n timeSpent: number;\n streakDays: number;\n streakStatusToday: 'pending' | 'completed';\n errorCode: IStatsToAwardErrorCode;\n outcome: ProjectOutcome;\n value: string;\n starEligibleTime?: number;\n starEligibleAccuracy?: number;\n starRewarded?: boolean;\n}\n\nexport interface IInfoMessage {\n message: string;\n position: 'top' | 'bottom';\n}\n\nexport interface ITrackEvent {\n eventName: typeof WEBVIEW_ANALYTICS_EVENTS;\n properties: Record<string, unknown>;\n}\n\nexport interface IWebViewProps extends IframeHTMLAttributes<HTMLIFrameElement> {\n baseUrl: string;\n projectDetails:\n | IMultiplayerWebGameProps\n | IPuzzleWebGameProps\n | ILessonWebGameProps\n | ITableWebGameProps;\n parentDomain: string;\n playerDetails: IPlayer;\n onBack?: () => void;\n onGameLoad?: () => void;\n onGamePlayFinish?: (playerStats: IPlayerStats) => void;\n handleInfoMessage?: (infoMessage: IInfoMessage) => void;\n}\n\nexport interface IMessageProps {\n event: `${WebViewEvent}`;\n payload: IVibrationPattern | IPlayerStats | IInfoMessage | ITrackEvent | null;\n}\n"],"names":["IStatsToAwardErrorCode"],"mappings":"AAmDY,IAAAA,sBAAAA,OACVA,EAAA,UAAU,WACVA,EAAA,UAAU,WACVA,EAAA,OAAO,QAHGA,IAAAA,KAAA,CAAA,CAAA;"}
|
|
@@ -35,7 +35,7 @@ const Xe = ({
|
|
|
35
35
|
}) => {
|
|
36
36
|
const [v, U] = o(0), [n, u] = o(l), [h, p] = o(""), [t, _] = o(
|
|
37
37
|
j.find((e) => e.key === L) ?? null
|
|
38
|
-
), [S, i] = o(!1),
|
|
38
|
+
), [S, i] = o(!1), $ = Re(G), f = se(null), [z, W] = o(!1), [J, O] = o(!1), P = (e) => {
|
|
39
39
|
i(!1), e ? (f.current = e, u(e.username), A && A(e), a()) : p(I.SOMETHING_WENT_WRONG);
|
|
40
40
|
}, Q = (e) => {
|
|
41
41
|
i(!1), e ? (f.current = e, u(e.username), B && B(e), a()) : p(I.SOMETHING_WENT_WRONG);
|
|
@@ -43,7 +43,7 @@ const Xe = ({
|
|
|
43
43
|
i(!1), e ? (u(e.username), f.current = e, a()) : p(I.SOMETHING_WENT_WRONG);
|
|
44
44
|
}, { createUser: D } = ge(P), { updateUser: H } = Ee(Q), { updateUsername: q } = Te(Z), ee = () => {
|
|
45
45
|
O(!0), setTimeout(() => {
|
|
46
|
-
|
|
46
|
+
W(!0);
|
|
47
47
|
}, 500);
|
|
48
48
|
}, re = async (e) => {
|
|
49
49
|
_(e);
|
|
@@ -102,7 +102,7 @@ const Xe = ({
|
|
|
102
102
|
width: 144,
|
|
103
103
|
isVisible: !0,
|
|
104
104
|
onClick: () => {
|
|
105
|
-
a(), O(!1),
|
|
105
|
+
a(), O(!1), W(!1);
|
|
106
106
|
}
|
|
107
107
|
}
|
|
108
108
|
)
|
|
@@ -193,21 +193,21 @@ for your child` : "Claim your unique alias",
|
|
|
193
193
|
c ? /* @__PURE__ */ s(ie, { children: [
|
|
194
194
|
/* @__PURE__ */ r(d, { $renderAs: "ac4-black", $align: "center", $color: "GREEN_4", children: "Premium access unlocked!" }),
|
|
195
195
|
/* @__PURE__ */ r(ae, { height: 12 }),
|
|
196
|
-
/* @__PURE__ */ s(d, { $renderAs: "ub2", $color: "WHITE", children: [
|
|
196
|
+
/* @__PURE__ */ s(d, { $renderAs: "ub2", $color: "WHITE", $align: "center", children: [
|
|
197
197
|
"Your child can directly login to leap.cuemath.com using “",
|
|
198
198
|
/* @__PURE__ */ r(d, { $color: "GREEN_4", $renderAs: "ub2", $inline: !0, children: n }),
|
|
199
199
|
"” as both username and password."
|
|
200
200
|
] })
|
|
201
201
|
] }) : /* @__PURE__ */ s(Y, { children: [
|
|
202
202
|
/* @__PURE__ */ s(d, { $renderAs: "ab1", $color: "WHITE", children: [
|
|
203
|
-
|
|
203
|
+
$.primaryText,
|
|
204
204
|
k && /* @__PURE__ */ s(Ne, { children: [
|
|
205
205
|
" ",
|
|
206
206
|
k,
|
|
207
207
|
" days of FREE"
|
|
208
208
|
] })
|
|
209
209
|
] }),
|
|
210
|
-
/* @__PURE__ */ r(d, { $renderAs: "ab1", $color: "WHITE", children:
|
|
210
|
+
/* @__PURE__ */ r(d, { $renderAs: "ab1", $color: "WHITE", children: $.secondaryText })
|
|
211
211
|
] }),
|
|
212
212
|
w ? /* @__PURE__ */ r(de, { marginY: 24 }) : /* @__PURE__ */ r(
|
|
213
213
|
N,
|