@cuemath/leap 3.5.0 → 3.5.1-akm-6
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/illustrations/illustrations.js +7 -0
- package/dist/assets/illustrations/illustrations.js.map +1 -1
- package/dist/assets/lottie/lottie.js +3 -0
- package/dist/assets/lottie/lottie.js.map +1 -1
- package/dist/features/analytics-events/platform-events-student.js +1 -1
- package/dist/features/analytics-events/platform-events-student.js.map +1 -1
- package/dist/features/analytics-events/whitelist-events.js +1 -1
- package/dist/features/analytics-events/whitelist-events.js.map +1 -1
- package/dist/features/auth/comps/animated-avatar-message/animated-text/animated-text.js.map +1 -1
- package/dist/features/auth/comps/resend-otp/resend-otp.js.map +1 -1
- package/dist/features/auth/comps/tabs/tab-tem/tab-item.js +31 -16
- package/dist/features/auth/comps/tabs/tab-tem/tab-item.js.map +1 -1
- package/dist/features/auth/comps/tabs/tabs.js +22 -5
- package/dist/features/auth/comps/tabs/tabs.js.map +1 -1
- package/dist/features/chapters/lpar-chapter/constants/block-icons.js.map +1 -1
- package/dist/features/chapters-v2/comps/tag/tag.js.map +1 -1
- package/dist/features/circle-games/about-game-activities/about-game-activities-constants.js +40 -0
- package/dist/features/circle-games/about-game-activities/about-game-activities-constants.js.map +1 -0
- package/dist/features/circle-games/about-game-activities/about-game-activities-styled.js +52 -0
- package/dist/features/circle-games/about-game-activities/about-game-activities-styled.js.map +1 -0
- package/dist/features/circle-games/about-game-activities/about-game-activities.js +69 -0
- package/dist/features/circle-games/about-game-activities/about-game-activities.js.map +1 -0
- package/dist/features/circle-games/comps/arc-container/arc-container-styled.js +77 -0
- package/dist/features/circle-games/comps/arc-container/arc-container-styled.js.map +1 -0
- package/dist/features/circle-games/comps/arc-container/arc-container.js +37 -0
- package/dist/features/circle-games/comps/arc-container/arc-container.js.map +1 -0
- package/dist/features/circle-games/comps/arc-container/constants.js +10 -0
- package/dist/features/circle-games/comps/arc-container/constants.js.map +1 -0
- package/dist/features/circle-games/comps/info-bar/info-bar.js.map +1 -1
- package/dist/features/circle-games/{game-launcher → game-launcher-v2}/api/get-content-for-today/constants.js +1 -1
- package/dist/features/circle-games/game-launcher-v2/api/get-content-for-today/constants.js.map +1 -0
- package/dist/features/circle-games/game-launcher-v2/api/get-content-for-today/get-circle-home-api.js.map +1 -0
- package/dist/features/circle-games/game-launcher-v2/comps/card-container/card-container-styled.js.map +1 -0
- package/dist/features/circle-games/game-launcher-v2/comps/card-container/card-container.js.map +1 -0
- package/dist/features/circle-games/game-launcher-v2/comps/card-container/constants.js +11 -0
- package/dist/features/circle-games/game-launcher-v2/comps/card-container/constants.js.map +1 -0
- package/dist/features/circle-games/game-launcher-v2/comps/carousel/carousel-styled.js +121 -0
- package/dist/features/circle-games/game-launcher-v2/comps/carousel/carousel-styled.js.map +1 -0
- package/dist/features/circle-games/game-launcher-v2/comps/carousel/carousel.js +110 -0
- package/dist/features/circle-games/game-launcher-v2/comps/carousel/carousel.js.map +1 -0
- package/dist/features/circle-games/game-launcher-v2/comps/carousel/constants.js +9 -0
- package/dist/features/circle-games/game-launcher-v2/comps/carousel/constants.js.map +1 -0
- package/dist/features/circle-games/game-launcher-v2/comps/carousel-badge/carousel-badge-style.js +20 -0
- package/dist/features/circle-games/game-launcher-v2/comps/carousel-badge/carousel-badge-style.js.map +1 -0
- package/dist/features/circle-games/game-launcher-v2/comps/carousel-badge/carousel-badge.js +17 -0
- package/dist/features/circle-games/game-launcher-v2/comps/carousel-badge/carousel-badge.js.map +1 -0
- package/dist/features/circle-games/game-launcher-v2/comps/carousel-badge/carousel-single-badge.js +20 -0
- package/dist/features/circle-games/game-launcher-v2/comps/carousel-badge/carousel-single-badge.js.map +1 -0
- package/dist/features/circle-games/game-launcher-v2/comps/circular-game-card/circular-game-card-styled.js +66 -0
- package/dist/features/circle-games/game-launcher-v2/comps/circular-game-card/circular-game-card-styled.js.map +1 -0
- package/dist/features/circle-games/game-launcher-v2/comps/circular-game-card/circular-game-card.js +89 -0
- package/dist/features/circle-games/game-launcher-v2/comps/circular-game-card/circular-game-card.js.map +1 -0
- package/dist/features/circle-games/game-launcher-v2/comps/circular-game-card/constants.js +8 -0
- package/dist/features/circle-games/game-launcher-v2/comps/circular-game-card/constants.js.map +1 -0
- package/dist/features/circle-games/game-launcher-v2/comps/game-card-content/constants.js +6 -0
- package/dist/features/circle-games/game-launcher-v2/comps/game-card-content/constants.js.map +1 -0
- package/dist/features/circle-games/game-launcher-v2/comps/game-card-content/game-card-content-styled.js +57 -0
- package/dist/features/circle-games/game-launcher-v2/comps/game-card-content/game-card-content-styled.js.map +1 -0
- package/dist/features/circle-games/game-launcher-v2/comps/game-card-content/game-card-content.js +9 -0
- package/dist/features/circle-games/game-launcher-v2/comps/game-card-content/game-card-content.js.map +1 -0
- package/dist/features/circle-games/game-launcher-v2/comps/segmented-game-card/constants.js +7 -0
- package/dist/features/circle-games/game-launcher-v2/comps/segmented-game-card/constants.js.map +1 -0
- package/dist/features/circle-games/game-launcher-v2/comps/swipable-card/swipeable-card-styled.js +14 -0
- package/dist/features/circle-games/game-launcher-v2/comps/swipable-card/swipeable-card-styled.js.map +1 -0
- package/dist/features/circle-games/game-launcher-v2/comps/swipable-card/swipeable-card.js +24 -0
- package/dist/features/circle-games/game-launcher-v2/comps/swipable-card/swipeable-card.js.map +1 -0
- package/dist/features/circle-games/game-launcher-v2/comps/tables-card/constants.js.map +1 -0
- package/dist/features/circle-games/game-launcher-v2/comps/tables-card/infinite-button/infinite-mode-launcher-button.js.map +1 -0
- package/dist/features/circle-games/game-launcher-v2/comps/tables-card/spl-events-text/constants.js.map +1 -0
- package/dist/features/circle-games/game-launcher-v2/comps/tables-card/spl-events-text/spl-events-text-style.js.map +1 -0
- package/dist/features/circle-games/game-launcher-v2/comps/tables-card/spl-events-text/spl-events-text-types.js.map +1 -0
- package/dist/features/circle-games/game-launcher-v2/comps/tables-card/spl-events-text/spl-events-text.js.map +1 -0
- package/dist/features/circle-games/game-launcher-v2/comps/tables-card/table-mode/table-mode-styled.js.map +1 -0
- package/dist/features/circle-games/game-launcher-v2/comps/tables-card/table-mode/table-mode.js.map +1 -0
- package/dist/features/circle-games/game-launcher-v2/comps/tables-card/table-mode-star/constants.js.map +1 -0
- package/dist/features/circle-games/game-launcher-v2/comps/tables-card/table-mode-star/table-mode-star-styled.js.map +1 -0
- package/dist/features/circle-games/{game-launcher → game-launcher-v2}/comps/tables-card/table-mode-star/table-mode-star.js +3 -3
- package/dist/features/circle-games/game-launcher-v2/comps/tables-card/table-mode-star/table-mode-star.js.map +1 -0
- package/dist/features/circle-games/game-launcher-v2/comps/tables-card/table-segment-star/table-segment-star-styled.js.map +1 -0
- package/dist/features/circle-games/{game-launcher → game-launcher-v2}/comps/tables-card/table-segment-star/table-segment-star.js +7 -7
- package/dist/features/circle-games/game-launcher-v2/comps/tables-card/table-segment-star/table-segment-star.js.map +1 -0
- package/dist/features/circle-games/game-launcher-v2/comps/tables-card/tables-card-styled.js.map +1 -0
- package/dist/features/circle-games/{game-launcher → game-launcher-v2}/comps/tables-card/tables-card.js +18 -18
- package/dist/features/circle-games/game-launcher-v2/comps/tables-card/tables-card.js.map +1 -0
- package/dist/features/circle-games/game-launcher-v2/dal/use-get-circle-home-details-dal/helper.js +94 -0
- package/dist/features/circle-games/game-launcher-v2/dal/use-get-circle-home-details-dal/helper.js.map +1 -0
- package/dist/features/circle-games/game-launcher-v2/dal/use-get-circle-home-details-dal/use-get-circle-home-details-dal.js.map +1 -0
- package/dist/features/circle-games/game-launcher-v2/game-launcher-analytics-events.js +13 -0
- package/dist/features/circle-games/game-launcher-v2/game-launcher-analytics-events.js.map +1 -0
- package/dist/features/circle-games/game-launcher-v2/game-launcher-v2.js +321 -0
- package/dist/features/circle-games/game-launcher-v2/game-launcher-v2.js.map +1 -0
- package/dist/features/circle-games/game-launcher-v2/helpers.js +8 -0
- package/dist/features/circle-games/game-launcher-v2/helpers.js.map +1 -0
- package/dist/features/circle-games/game-launcher-v2/hooks/use-game-launcher-journey/constants.js +6 -0
- package/dist/features/circle-games/game-launcher-v2/hooks/use-game-launcher-journey/constants.js.map +1 -0
- package/dist/features/circle-games/game-launcher-v2/hooks/use-game-launcher-journey/use-game-launcher-journey.js +160 -0
- package/dist/features/circle-games/game-launcher-v2/hooks/use-game-launcher-journey/use-game-launcher-journey.js.map +1 -0
- package/dist/features/circle-games/game-launcher-v2/hooks/use-table-infinite-launcher-journey/constants.js +5 -0
- package/dist/features/circle-games/game-launcher-v2/hooks/use-table-infinite-launcher-journey/constants.js.map +1 -0
- package/dist/features/circle-games/game-launcher-v2/hooks/use-table-infinite-launcher-journey/use-table-infinite-launcher-journey.js +92 -0
- package/dist/features/circle-games/game-launcher-v2/hooks/use-table-infinite-launcher-journey/use-table-infinite-launcher-journey.js.map +1 -0
- package/dist/features/circle-games/game-launcher-v2/hooks/use-table-launcher-journey/constants.js +10 -0
- package/dist/features/circle-games/game-launcher-v2/hooks/use-table-launcher-journey/constants.js.map +1 -0
- package/dist/features/circle-games/game-launcher-v2/hooks/use-table-launcher-journey/use-table-launcher-journey.js +159 -0
- package/dist/features/circle-games/game-launcher-v2/hooks/use-table-launcher-journey/use-table-launcher-journey.js.map +1 -0
- package/dist/features/circle-games/games/tutorial/tutorial-styled.js +13 -10
- package/dist/features/circle-games/games/tutorial/tutorial-styled.js.map +1 -1
- package/dist/features/circle-games/games/tutorial/tutorial.js +53 -65
- package/dist/features/circle-games/games/tutorial/tutorial.js.map +1 -1
- package/dist/features/circle-games/hooks/use-circle-sounds/constants.js +9 -7
- package/dist/features/circle-games/hooks/use-circle-sounds/constants.js.map +1 -1
- package/dist/features/circle-games/hooks/use-circle-sounds/use-circle-sounds-enums.js +2 -2
- package/dist/features/circle-games/hooks/use-circle-sounds/use-circle-sounds-enums.js.map +1 -1
- package/dist/features/circle-games/hooks/use-circle-sounds/use-circle-sounds.js +50 -48
- package/dist/features/circle-games/hooks/use-circle-sounds/use-circle-sounds.js.map +1 -1
- package/dist/features/circle-games/leaderboard/comps/leaderboard-item/leaderboard-item.js.map +1 -1
- package/dist/features/circle-games/leaderboard/comps/navigation-button/navigation-button.js.map +1 -1
- package/dist/features/circle-games/sign-up/api/use-validate-username-api/use-username-availability-get.js +4 -4
- package/dist/features/circle-games/sign-up/api/use-validate-username-api/use-username-availability-get.js.map +1 -1
- package/dist/features/circle-games/sign-up/comp/input-wrapper/input-wrapper.js +8 -8
- package/dist/features/circle-games/sign-up/comp/input-wrapper/input-wrapper.js.map +1 -1
- package/dist/features/communication/hooks/use-inclass-message-broker/use-inclass-message-broker.js +4 -4
- package/dist/features/communication/hooks/use-inclass-message-broker/use-inclass-message-broker.js.map +1 -1
- package/dist/features/communication/hooks/use-trial-session-message-broker/use-trial-session-message-broker.js +4 -4
- package/dist/features/communication/hooks/use-trial-session-message-broker/use-trial-session-message-broker.js.map +1 -1
- package/dist/features/cue-canvas/cue-canvas.js.map +1 -1
- package/dist/features/cue-canvas/hooks/use-canvas-sync-broker.js +4 -4
- package/dist/features/cue-canvas/hooks/use-canvas-sync-broker.js.map +1 -1
- package/dist/features/cue-canvas/sidebar/homework/homework-menu.js.map +1 -1
- package/dist/features/cue-canvas/sidebar/homework/homework-request.js.map +1 -1
- package/dist/features/cue-canvas/sidebar/puzzles/filter-selection-menu.js.map +1 -1
- package/dist/features/cue-canvas/sidebar/puzzles/filters-section.js.map +1 -1
- package/dist/features/cue-canvas/sidebar/puzzles/filters.js.map +1 -1
- package/dist/features/cue-canvas/sidebar/puzzles/puzzle-menu-header.js.map +1 -1
- package/dist/features/cue-canvas/sidebar/puzzles/puzzle-menu.js.map +1 -1
- package/dist/features/cue-canvas/toolbar/color-palette.js.map +1 -1
- package/dist/features/cue-canvas/toolbar/grid-menu.js.map +1 -1
- package/dist/features/cue-canvas/toolbar/toolbar.js.map +1 -1
- package/dist/features/homework/homework-card.js.map +1 -1
- package/dist/features/homework/hw-card-list/hw-card-list.js.map +1 -1
- package/dist/features/homework/node-progress.js.map +1 -1
- package/dist/features/journey/hooks/use-get-tracked-views.js +13 -0
- package/dist/features/journey/hooks/use-get-tracked-views.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/tracking-id/tracking-id-student.js +5 -0
- package/dist/features/journey/tracking-id/tracking-id-student.js.map +1 -0
- package/dist/features/journey/tracking-id/tracking-ids.js +8 -0
- package/dist/features/journey/tracking-id/tracking-ids.js.map +1 -0
- package/dist/features/journey/use-journey/journey-context-provider.js +42 -42
- package/dist/features/journey/use-journey/journey-context-provider.js.map +1 -1
- package/dist/features/milestone/create/comps/info-points/info-points.js +12 -12
- package/dist/features/milestone/create/comps/info-points/info-points.js.map +1 -1
- package/dist/features/milestone/create/submit-modal/submit-modal.js.map +1 -1
- package/dist/features/milestone/create/submit-modal/submit-with-plan-modal/submit-with-plan-modal.js.map +1 -1
- package/dist/features/milestone/milestone-list-container/milestone-list/milestone-widget/outcome/outcome-rank.js.map +1 -1
- package/dist/features/milestone/outcome/comps/outcome-collection/input-descriptor.js +1 -5
- package/dist/features/milestone/outcome/comps/outcome-collection/input-descriptor.js.map +1 -1
- package/dist/features/notification/notification.js.map +1 -1
- package/dist/features/parent-dashboard/comps/next-steps/next-steps.js.map +1 -1
- package/dist/features/pointer-sync/hooks/use-pointer-sync.js +6 -6
- package/dist/features/pointer-sync/hooks/use-pointer-sync.js.map +1 -1
- package/dist/features/post-game-stats/accuracy/accuracy-styled.js +2 -2
- package/dist/features/post-game-stats/accuracy/accuracy-styled.js.map +1 -1
- package/dist/features/post-game-stats/clock/clock-styled.js +2 -2
- package/dist/features/post-game-stats/clock/clock-styled.js.map +1 -1
- package/dist/features/post-game-stats/digital-meter/constants.js +1 -1
- package/dist/features/post-game-stats/digital-meter/constants.js.map +1 -1
- package/dist/features/post-game-stats/digital-meter/digital-meter-styled.js +1 -1
- package/dist/features/post-game-stats/digital-meter/digital-meter-styled.js.map +1 -1
- package/dist/features/post-game-stats/digital-meter/digital-meter.js +27 -27
- package/dist/features/post-game-stats/digital-meter/digital-meter.js.map +1 -1
- package/dist/features/post-game-stats/points/points.js +5 -4
- package/dist/features/post-game-stats/points/points.js.map +1 -1
- package/dist/features/post-game-stats/post-game-stats-styled.js +9 -8
- package/dist/features/post-game-stats/post-game-stats-styled.js.map +1 -1
- package/dist/features/post-game-stats/post-game-stats.js +107 -105
- package/dist/features/post-game-stats/post-game-stats.js.map +1 -1
- package/dist/features/post-game-stats/score/score-styled.js +2 -2
- package/dist/features/post-game-stats/score/score-styled.js.map +1 -1
- package/dist/features/post-game-stats/streak/constants.js +1 -1
- package/dist/features/post-game-stats/streak/constants.js.map +1 -1
- package/dist/features/post-game-stats/streak/streak-styled.js +2 -2
- package/dist/features/post-game-stats/streak/streak-styled.js.map +1 -1
- package/dist/features/talk-meter/hooks/use-talk-meter.js +4 -4
- package/dist/features/talk-meter/hooks/use-talk-meter.js.map +1 -1
- package/dist/features/trial-session/comps/learning-plan/use-learning-plan-scroll-sync.js +5 -5
- package/dist/features/trial-session/comps/learning-plan/use-learning-plan-scroll-sync.js.map +1 -1
- package/dist/features/ui/arc-button/arc-button-styled.js +23 -21
- package/dist/features/ui/arc-button/arc-button-styled.js.map +1 -1
- package/dist/features/ui/arc-button/arc-button.js +18 -17
- package/dist/features/ui/arc-button/arc-button.js.map +1 -1
- package/dist/features/ui/nudge/nudge.js +14 -13
- package/dist/features/ui/nudge/nudge.js.map +1 -1
- package/dist/features/worksheet/user-pointer-pin/hooks/use-user-location.js +5 -5
- package/dist/features/worksheet/user-pointer-pin/hooks/use-user-location.js.map +1 -1
- package/dist/index.d.ts +103 -44
- package/dist/index.js +368 -366
- package/dist/index.js.map +1 -1
- package/dist/static/accuracy-badge.2e161f00.svg +1 -0
- package/dist/static/clock-badge.0adb4ba6.svg +1 -0
- package/dist/static/daily-work-out-complete.eaffdd2b.json +1 -0
- package/dist/static/down-arrow-badge.f462f615.svg +1 -0
- package/dist/static/green-tick.43b94c3a.svg +1 -0
- package/dist/static/nudge-swipe.3b97c01a.json +1 -0
- package/dist/static/pill-tick.c06f606d.json +1 -0
- package/dist/static/points-badge.96bdecc9.svg +1 -0
- package/dist/static/star-badge.5450c267.svg +1 -0
- package/dist/static/up-arrow-badge.71fe7ad1.svg +1 -0
- package/package.json +2 -2
- package/dist/assets/line-icons/icons/carat-left.js +0 -26
- package/dist/assets/line-icons/icons/carat-left.js.map +0 -1
- package/dist/assets/line-icons/icons/carat-right.js +0 -26
- package/dist/assets/line-icons/icons/carat-right.js.map +0 -1
- package/dist/features/circle-games/game-launcher/api/get-content-for-today/constants.js.map +0 -1
- package/dist/features/circle-games/game-launcher/api/get-content-for-today/get-circle-home-api.js.map +0 -1
- package/dist/features/circle-games/game-launcher/comps/card-container/card-container-styled.js.map +0 -1
- package/dist/features/circle-games/game-launcher/comps/card-container/card-container.js.map +0 -1
- package/dist/features/circle-games/game-launcher/comps/card-container/constants.js +0 -7
- package/dist/features/circle-games/game-launcher/comps/card-container/constants.js.map +0 -1
- package/dist/features/circle-games/game-launcher/comps/carousel/carousel-styled.js +0 -39
- package/dist/features/circle-games/game-launcher/comps/carousel/carousel-styled.js.map +0 -1
- package/dist/features/circle-games/game-launcher/comps/carousel/carousel.js +0 -85
- package/dist/features/circle-games/game-launcher/comps/carousel/carousel.js.map +0 -1
- package/dist/features/circle-games/game-launcher/comps/segmented-game-card/constants.js +0 -12
- package/dist/features/circle-games/game-launcher/comps/segmented-game-card/constants.js.map +0 -1
- package/dist/features/circle-games/game-launcher/comps/segmented-game-card/segmented-game-card-styled.js +0 -138
- package/dist/features/circle-games/game-launcher/comps/segmented-game-card/segmented-game-card-styled.js.map +0 -1
- package/dist/features/circle-games/game-launcher/comps/segmented-game-card/segmented-game-card.js +0 -105
- package/dist/features/circle-games/game-launcher/comps/segmented-game-card/segmented-game-card.js.map +0 -1
- package/dist/features/circle-games/game-launcher/comps/tables-card/constants.js.map +0 -1
- package/dist/features/circle-games/game-launcher/comps/tables-card/infinite-button/infinite-mode-launcher-button.js.map +0 -1
- package/dist/features/circle-games/game-launcher/comps/tables-card/spl-events-text/constants.js.map +0 -1
- package/dist/features/circle-games/game-launcher/comps/tables-card/spl-events-text/spl-events-text-style.js.map +0 -1
- package/dist/features/circle-games/game-launcher/comps/tables-card/spl-events-text/spl-events-text-types.js.map +0 -1
- package/dist/features/circle-games/game-launcher/comps/tables-card/spl-events-text/spl-events-text.js.map +0 -1
- package/dist/features/circle-games/game-launcher/comps/tables-card/table-mode/table-mode-styled.js.map +0 -1
- package/dist/features/circle-games/game-launcher/comps/tables-card/table-mode/table-mode.js.map +0 -1
- package/dist/features/circle-games/game-launcher/comps/tables-card/table-mode-star/constants.js.map +0 -1
- package/dist/features/circle-games/game-launcher/comps/tables-card/table-mode-star/table-mode-star-styled.js.map +0 -1
- package/dist/features/circle-games/game-launcher/comps/tables-card/table-mode-star/table-mode-star.js.map +0 -1
- package/dist/features/circle-games/game-launcher/comps/tables-card/table-segment-star/table-segment-star-styled.js.map +0 -1
- package/dist/features/circle-games/game-launcher/comps/tables-card/table-segment-star/table-segment-star.js.map +0 -1
- package/dist/features/circle-games/game-launcher/comps/tables-card/tables-card-styled.js.map +0 -1
- package/dist/features/circle-games/game-launcher/comps/tables-card/tables-card.js.map +0 -1
- package/dist/features/circle-games/game-launcher/dal/use-get-circle-home-details-dal/helper.js +0 -73
- package/dist/features/circle-games/game-launcher/dal/use-get-circle-home-details-dal/helper.js.map +0 -1
- package/dist/features/circle-games/game-launcher/dal/use-get-circle-home-details-dal/use-get-circle-home-details-dal.js.map +0 -1
- package/dist/features/circle-games/game-launcher/game-launcher-analytics-events.js +0 -12
- package/dist/features/circle-games/game-launcher/game-launcher-analytics-events.js.map +0 -1
- package/dist/features/circle-games/game-launcher/game-launcher.js +0 -219
- package/dist/features/circle-games/game-launcher/game-launcher.js.map +0 -1
- package/dist/features/circle-games/game-launcher/hooks/use-game-launcher-journey/constants.js +0 -8
- package/dist/features/circle-games/game-launcher/hooks/use-game-launcher-journey/constants.js.map +0 -1
- package/dist/features/circle-games/game-launcher/hooks/use-game-launcher-journey/use-game-launcher-journey.js +0 -286
- package/dist/features/circle-games/game-launcher/hooks/use-game-launcher-journey/use-game-launcher-journey.js.map +0 -1
- package/dist/features/circle-games/game-launcher/hooks/use-table-infinite-launcher-journey/constants.js +0 -10
- package/dist/features/circle-games/game-launcher/hooks/use-table-infinite-launcher-journey/constants.js.map +0 -1
- package/dist/features/circle-games/game-launcher/hooks/use-table-infinite-launcher-journey/use-table-infinite-launcher-journey-styled.js +0 -13
- package/dist/features/circle-games/game-launcher/hooks/use-table-infinite-launcher-journey/use-table-infinite-launcher-journey-styled.js.map +0 -1
- package/dist/features/circle-games/game-launcher/hooks/use-table-infinite-launcher-journey/use-table-infinite-launcher-journey.js +0 -137
- package/dist/features/circle-games/game-launcher/hooks/use-table-infinite-launcher-journey/use-table-infinite-launcher-journey.js.map +0 -1
- package/dist/features/circle-games/game-launcher/hooks/use-table-launcher-journey/constants.js +0 -14
- package/dist/features/circle-games/game-launcher/hooks/use-table-launcher-journey/constants.js.map +0 -1
- package/dist/features/circle-games/game-launcher/hooks/use-table-launcher-journey/use-table-launcher-journey-styled.js +0 -13
- package/dist/features/circle-games/game-launcher/hooks/use-table-launcher-journey/use-table-launcher-journey-styled.js.map +0 -1
- package/dist/features/circle-games/game-launcher/hooks/use-table-launcher-journey/use-table-launcher-journey.js +0 -230
- package/dist/features/circle-games/game-launcher/hooks/use-table-launcher-journey/use-table-launcher-journey.js.map +0 -1
- /package/dist/features/circle-games/{game-launcher → game-launcher-v2}/api/get-content-for-today/get-circle-home-api.js +0 -0
- /package/dist/features/circle-games/{game-launcher → game-launcher-v2}/comps/card-container/card-container-styled.js +0 -0
- /package/dist/features/circle-games/{game-launcher → game-launcher-v2}/comps/card-container/card-container.js +0 -0
- /package/dist/features/circle-games/{game-launcher → game-launcher-v2}/comps/tables-card/constants.js +0 -0
- /package/dist/features/circle-games/{game-launcher → game-launcher-v2}/comps/tables-card/infinite-button/infinite-mode-launcher-button.js +0 -0
- /package/dist/features/circle-games/{game-launcher → game-launcher-v2}/comps/tables-card/spl-events-text/constants.js +0 -0
- /package/dist/features/circle-games/{game-launcher → game-launcher-v2}/comps/tables-card/spl-events-text/spl-events-text-style.js +0 -0
- /package/dist/features/circle-games/{game-launcher → game-launcher-v2}/comps/tables-card/spl-events-text/spl-events-text-types.js +0 -0
- /package/dist/features/circle-games/{game-launcher → game-launcher-v2}/comps/tables-card/spl-events-text/spl-events-text.js +0 -0
- /package/dist/features/circle-games/{game-launcher → game-launcher-v2}/comps/tables-card/table-mode/table-mode-styled.js +0 -0
- /package/dist/features/circle-games/{game-launcher → game-launcher-v2}/comps/tables-card/table-mode/table-mode.js +0 -0
- /package/dist/features/circle-games/{game-launcher → game-launcher-v2}/comps/tables-card/table-mode-star/constants.js +0 -0
- /package/dist/features/circle-games/{game-launcher → game-launcher-v2}/comps/tables-card/table-mode-star/table-mode-star-styled.js +0 -0
- /package/dist/features/circle-games/{game-launcher → game-launcher-v2}/comps/tables-card/table-segment-star/table-segment-star-styled.js +0 -0
- /package/dist/features/circle-games/{game-launcher → game-launcher-v2}/comps/tables-card/tables-card-styled.js +0 -0
- /package/dist/features/circle-games/{game-launcher → game-launcher-v2}/dal/use-get-circle-home-details-dal/use-get-circle-home-details-dal.js +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"homework-card.js","sources":["../../../src/features/homework/homework-card.tsx"],"sourcesContent":["import type { FC } from 'react';\nimport React, { memo, useCallback, useMemo, useRef } from 'react';\n\nimport Eye2Icon from '../../assets/line-icons/icons/eye2';\nimport Home2Icon from '../../assets/line-icons/icons/home2';\nimport MoreVerticalIcon from '../../assets/line-icons/icons/more-vertical';\nimport RedoIcon from '../../assets/line-icons/icons/redo';\nimport type {\n INodeCardCallbacks,\n INodeDataProps,\n} from '../chapters-v2/comps/node-card/node-card-types';\nimport ArrowTooltip from '../ui/arrow-tooltip/arrow-tooltip';\nimport Clickable from '../ui/buttons/clickable/clickable';\nimport useContextMenuClickHandler from '../ui/hooks/use-context-menu-click-handler';\nimport FlexView from '../ui/layout/flex-view';\nimport type { TUserTypes } from '../ui/types';\nimport CardMenuOptions from './card-menu-options';\nimport HomeworkView from './homework-card-view';\nimport * as Styled from './styles';\nimport { getCardAnalyticProps } from './utils';\n\ninterface IHomeworkCardProps extends INodeCardCallbacks {\n header: string;\n nodeData: INodeDataProps;\n subHeader: string;\n userType: TUserTypes;\n studentId: string;\n userMilestoneId?: string;\n renderAs: 'homework' | 'milestone';\n shouldOpenOnRight: boolean;\n isInQueue?: boolean;\n puzzleHWCardRef?: React.RefObject<HTMLDivElement>;\n}\n\nconst HomeworkCard: FC<IHomeworkCardProps> = ({\n // callbacks\n nodeData,\n onNodeAttempt,\n onNodeReattempt,\n onNodeReview,\n onNodeUnassign,\n onNodeView,\n onNodeAssignAsHomework,\n\n header,\n isInQueue,\n renderAs,\n shouldOpenOnRight,\n studentId,\n subHeader,\n userMilestoneId,\n userType,\n puzzleHWCardRef,\n}) => {\n const isHomeWork = renderAs === 'homework';\n const {\n node_type: nodeType,\n state,\n permissions,\n user_node_id: userNodeId,\n user_milestone_id: nodeDataMilestoneId,\n homework_id: homeworkId,\n } = nodeData;\n\n const milestoneId = userMilestoneId || nodeDataMilestoneId || '';\n const isPuzzleCard = nodeType === 'PUZZLE_CARD';\n const isSheetLocked = state === 'LOCKED';\n\n const teacherContainerRef = useRef<HTMLDivElement>(null) as React.RefObject<HTMLDivElement>;\n const studentContainerRef = useRef<HTMLDivElement>(null) as React.RefObject<HTMLDivElement>;\n const { menuVisible: teacherMenuVisible, onMenuClick: onTeacherMenuClick } =\n useContextMenuClickHandler(teacherContainerRef);\n const { menuVisible: studentMenuVisible, onMenuClick: onStudentMenuClick } =\n useContextMenuClickHandler(studentContainerRef);\n\n const {\n can_start: canStart,\n can_resume: canResume,\n can_review: canReview,\n can_unassign: canUnassign,\n can_reset: canReset,\n can_assign_as_homework: canAssignAsHw,\n } = permissions;\n const isStudent = userType === 'STUDENT';\n\n const onStudentViewSheet = useCallback(() => {\n if (canReview) {\n if (typeof onNodeReview !== 'function') {\n throw new Error('onReview must be a function');\n }\n\n if (!userNodeId) {\n throw new Error('user node id must be present to review the sheet');\n }\n onNodeReview(nodeData, milestoneId);\n\n return;\n }\n }, [canReview, onNodeReview, userNodeId, nodeData, milestoneId]);\n\n const onStudentCardClick = useCallback(() => {\n if (canStart || canResume) {\n if (typeof onNodeAttempt !== 'function') {\n throw new Error('onNodeAttempt must be a function');\n }\n\n onNodeAttempt(nodeData, milestoneId, homeworkId);\n\n return;\n }\n\n if (!isHomeWork) {\n onStudentMenuClick();\n\n return;\n }\n onStudentViewSheet();\n }, [\n canStart,\n canResume,\n isHomeWork,\n onStudentViewSheet,\n onNodeAttempt,\n nodeData,\n milestoneId,\n homeworkId,\n onStudentMenuClick,\n ]);\n\n const onTeacherCardClick = useCallback(() => {\n if (canReview) {\n if (typeof onNodeReview !== 'function') {\n throw new Error('onNodeReview must be a function');\n }\n\n if (!userNodeId) {\n throw new Error('user node id must be present to review the sheet');\n }\n onNodeReview(nodeData, milestoneId, homeworkId);\n\n return;\n }\n\n if (typeof onNodeView !== 'function') {\n throw new Error('onNodeView must be a function');\n }\n\n onNodeView(nodeData, milestoneId);\n }, [canReview, onNodeView, nodeData, milestoneId, onNodeReview, userNodeId, homeworkId]);\n\n const handleOnMenuOptionClick = useCallback(\n (optionId: string) => {\n switch (optionId) {\n case 'teacher-card-view':\n onTeacherCardClick();\n\n return;\n case 'student-card-view':\n onStudentViewSheet();\n\n return;\n case 'teacher-card-unassign':\n onNodeUnassign?.(nodeData, milestoneId);\n\n return;\n case 'student-card-reattempt':\n case 'teacher-card-redo':\n onNodeReattempt?.(nodeData, milestoneId);\n\n return;\n\n case 'teacher-card-assign-as-hw':\n onNodeAssignAsHomework?.(nodeData, milestoneId);\n\n return;\n\n default:\n throw new Error(`No callback function for ${optionId}`);\n }\n },\n [\n nodeData,\n onNodeAssignAsHomework,\n onNodeReattempt,\n onNodeUnassign,\n onStudentViewSheet,\n onTeacherCardClick,\n milestoneId,\n ],\n );\n\n const teacherOptions = [\n {\n id: 'teacher-card-view',\n label: canReview ? 'Review' : 'View',\n icon: Eye2Icon,\n disabled: false,\n onClick: handleOnMenuOptionClick,\n },\n {\n id: 'teacher-card-unassign',\n label: 'Unassign',\n icon: Styled.StyledMinus2Icon,\n disabled: isHomeWork ? nodeType === 'MASTERY' : !canUnassign,\n onClick: handleOnMenuOptionClick,\n },\n {\n id: 'teacher-card-redo',\n label: 'Redo',\n icon: RedoIcon,\n disabled: !canReset,\n onClick: handleOnMenuOptionClick,\n },\n {\n id: 'teacher-card-assign-as-hw',\n label: 'Assign as HW',\n icon: Home2Icon,\n disabled: !canAssignAsHw,\n onClick: handleOnMenuOptionClick,\n },\n ];\n\n const studentOptions = [\n {\n id: 'student-card-view',\n label: 'Review',\n icon: Eye2Icon,\n disabled: !canReview,\n onClick: handleOnMenuOptionClick,\n },\n {\n id: 'student-card-reattempt',\n label: 'Reattempt',\n icon: RedoIcon,\n disabled: !canReset,\n onClick: handleOnMenuOptionClick,\n },\n ];\n\n const analyticsLabel = useMemo(\n () =>\n getCardAnalyticProps({\n canResume,\n canStart,\n homeworkId,\n isHomeWork,\n isStudent,\n milestoneId,\n nodeType,\n studentId,\n userNodeId,\n }),\n [\n isStudent,\n isHomeWork,\n studentId,\n nodeType,\n canStart,\n canResume,\n homeworkId,\n userNodeId,\n milestoneId,\n ],\n );\n\n const isClickableDisabled = isStudent && isPuzzleCard && isSheetLocked;\n\n return (\n <Styled.CardContainer $position=\"relative\" $width=\"fit-content\">\n <Clickable\n onClick={isStudent ? onStudentCardClick : onTeacherCardClick}\n label=\"homework-card\"\n analyticsLabel={analyticsLabel.analyticsLabel}\n analyticsProps={analyticsLabel.analyticsProps}\n disabled={isClickableDisabled}\n >\n <HomeworkView\n header={header}\n isInQueue={isInQueue}\n nodeData={nodeData}\n studentContainerRef={studentContainerRef}\n subHeader={subHeader}\n userType={userType}\n isMilestone={renderAs === 'milestone'}\n puzzleHWCardRef={puzzleHWCardRef}\n />\n </Clickable>\n {isStudent && !isHomeWork && (\n <CardMenuOptions\n $width={200}\n options={studentOptions}\n triggerRef={studentContainerRef}\n visible={studentMenuVisible}\n shouldOpenOnRight={false}\n />\n )}\n {!isStudent && !isPuzzleCard && (\n <Styled.MenuWrapper $position=\"absolute\" $width=\"fit-content\" $borderRadiusX={2}>\n <ArrowTooltip\n renderAs=\"primary\"\n tooltipItem=\"Review\"\n position=\"bottom\"\n zIndex={6}\n parentWidth=\"100%\"\n hidden={teacherMenuVisible || (state !== 'WAIT_FOR_REVIEW' && isHomeWork)}\n >\n <Styled.CardKebabMenuWrapper\n $alignItems=\"center\"\n $justifyContent=\"center\"\n ref={teacherContainerRef}\n onClick={onTeacherMenuClick}\n >\n <MoreVerticalIcon width={16} height={16} />\n </Styled.CardKebabMenuWrapper>\n </ArrowTooltip>\n <CardMenuOptions\n options={teacherOptions}\n triggerRef={teacherContainerRef}\n visible={teacherMenuVisible}\n shouldOpenOnRight={shouldOpenOnRight}\n $width={144}\n />\n </Styled.MenuWrapper>\n )}\n {isInQueue && (\n <Styled.BlurContainer $background=\"WHITE_5\">\n <Styled.BlurFlexView $heightX={1} $widthX={6}>\n <ArrowTooltip renderAs=\"primary\" tooltipItem=\"Not visible to student\" position=\"bottom\">\n <FlexView $heightX={1} $widthX={6} />\n </ArrowTooltip>\n </Styled.BlurFlexView>\n </Styled.BlurContainer>\n )}\n </Styled.CardContainer>\n );\n};\n\nexport default memo(HomeworkCard);\n"],"names":["HomeworkCard","nodeData","onNodeAttempt","onNodeReattempt","onNodeReview","onNodeUnassign","onNodeView","onNodeAssignAsHomework","header","isInQueue","renderAs","shouldOpenOnRight","studentId","subHeader","userMilestoneId","userType","puzzleHWCardRef","isHomeWork","nodeType","state","permissions","userNodeId","nodeDataMilestoneId","homeworkId","milestoneId","isPuzzleCard","isSheetLocked","teacherContainerRef","useRef","studentContainerRef","teacherMenuVisible","onTeacherMenuClick","useContextMenuClickHandler","studentMenuVisible","onStudentMenuClick","canStart","canResume","canReview","canUnassign","canReset","canAssignAsHw","isStudent","onStudentViewSheet","useCallback","onStudentCardClick","onTeacherCardClick","handleOnMenuOptionClick","optionId","teacherOptions","Eye2Icon","Styled.StyledMinus2Icon","RedoIcon","Home2Icon","studentOptions","analyticsLabel","useMemo","getCardAnalyticProps","isClickableDisabled","Styled.CardContainer","jsx","Clickable","HomeworkView","CardMenuOptions","jsxs","Styled.MenuWrapper","ArrowTooltip","Styled.CardKebabMenuWrapper","MoreVerticalIcon","Styled.BlurContainer","Styled.BlurFlexView","FlexView","HomeworkCard$1","memo"],"mappings":";;;;;;;;;;;;;;AAkCA,MAAMA,KAAuC,CAAC;AAAA;AAAA,EAE5C,UAAAC;AAAA,EACA,eAAAC;AAAA,EACA,iBAAAC;AAAA,EACA,cAAAC;AAAA,EACA,gBAAAC;AAAA,EACA,YAAAC;AAAA,EACA,wBAAAC;AAAA,EAEA,QAAAC;AAAA,EACA,WAAAC;AAAA,EACA,UAAAC;AAAA,EACA,mBAAAC;AAAA,EACA,WAAAC;AAAA,EACA,WAAAC;AAAA,EACA,iBAAAC;AAAA,EACA,UAAAC;AAAA,EACA,iBAAAC;AACF,MAAM;AACJ,QAAMC,IAAaP,MAAa,YAC1B;AAAA,IACJ,WAAWQ;AAAA,IACX,OAAAC;AAAA,IACA,aAAAC;AAAA,IACA,cAAcC;AAAA,IACd,mBAAmBC;AAAA,IACnB,aAAaC;AAAA,EACX,IAAAtB,GAEEuB,IAAcV,KAAmBQ,KAAuB,IACxDG,IAAeP,MAAa,eAC5BQ,IAAgBP,MAAU,UAE1BQ,IAAsBC,EAAuB,IAAI,GACjDC,IAAsBD,EAAuB,IAAI,GACjD,EAAE,aAAaE,GAAoB,aAAaC,MACpDC,EAA2BL,CAAmB,GAC1C,EAAE,aAAaM,GAAoB,aAAaC,MACpDF,EAA2BH,CAAmB,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AAAsC,EAAAC,IAAA,EAAmB,WAAU,YAAW,QAAO,eAAc,gBAAgB,GAC5E,UAAA;AAAA,MAAA,gBAAAL;AAAA,QAACM;AAAA,QAAA;AAAA,UACC,UAAS;AAAA,UACT,aAAY;AAAA,UACZ,UAAS;AAAA,UACT,QAAQ;AAAA,UACR,aAAY;AAAA,UACZ,QAAQnC,KAAuBX,MAAU,qBAAqBF;AAAA,UAE9D,UAAA,gBAAA0C;AAAA,YAACO;AAAAA,YAAA;AAAA,cACC,aAAY;AAAA,cACZ,iBAAgB;AAAA,cAChB,KAAKvC;AAAA,cACL,SAASI;AAAA,cAET,UAAC,gBAAA4B,EAAAQ,IAAA,EAAiB,OAAO,IAAI,QAAQ,IAAI;AAAA,YAAA;AAAA,UAC3C;AAAA,QAAA;AAAA,MACF;AAAA,MACA,gBAAAR;AAAA,QAACG;AAAA,QAAA;AAAA,UACC,SAASd;AAAA,UACT,YAAYrB;AAAA,UACZ,SAASG;AAAA,UACT,mBAAAnB;AAAA,UACA,QAAQ;AAAA,QAAA;AAAA,MACV;AAAA,IAAA,GACF;AAAA,IAEDF,KACC,gBAAAkD,EAACS,IAAA,EAAqB,aAAY,WAChC,UAAA,gBAAAT,EAACU,IAAA,EAAoB,UAAU,GAAG,SAAS,GACzC,UAAC,gBAAAV,EAAAM,GAAA,EAAa,UAAS,WAAU,aAAY,0BAAyB,UAAS,UAC7E,UAAA,gBAAAN,EAACW,IAAS,EAAA,UAAU,GAAG,SAAS,EAAG,CAAA,EACrC,CAAA,EACF,CAAA,GACF;AAAA,EAEJ,EAAA,CAAA;AAEJ,GAEeC,KAAAC,GAAKxE,EAAY;"}
|
|
1
|
+
{"version":3,"file":"homework-card.js","sources":["../../../src/features/homework/homework-card.tsx"],"sourcesContent":["import type { FC } from 'react';\nimport { memo, useCallback, useMemo, useRef } from 'react';\n\nimport Eye2Icon from '../../assets/line-icons/icons/eye2';\nimport Home2Icon from '../../assets/line-icons/icons/home2';\nimport MoreVerticalIcon from '../../assets/line-icons/icons/more-vertical';\nimport RedoIcon from '../../assets/line-icons/icons/redo';\nimport type {\n INodeCardCallbacks,\n INodeDataProps,\n} from '../chapters-v2/comps/node-card/node-card-types';\nimport ArrowTooltip from '../ui/arrow-tooltip/arrow-tooltip';\nimport Clickable from '../ui/buttons/clickable/clickable';\nimport useContextMenuClickHandler from '../ui/hooks/use-context-menu-click-handler';\nimport FlexView from '../ui/layout/flex-view';\nimport type { TUserTypes } from '../ui/types';\nimport CardMenuOptions from './card-menu-options';\nimport HomeworkView from './homework-card-view';\nimport * as Styled from './styles';\nimport { getCardAnalyticProps } from './utils';\n\ninterface IHomeworkCardProps extends INodeCardCallbacks {\n header: string;\n nodeData: INodeDataProps;\n subHeader: string;\n userType: TUserTypes;\n studentId: string;\n userMilestoneId?: string;\n renderAs: 'homework' | 'milestone';\n shouldOpenOnRight: boolean;\n isInQueue?: boolean;\n puzzleHWCardRef?: React.RefObject<HTMLDivElement>;\n}\n\nconst HomeworkCard: FC<IHomeworkCardProps> = ({\n // callbacks\n nodeData,\n onNodeAttempt,\n onNodeReattempt,\n onNodeReview,\n onNodeUnassign,\n onNodeView,\n onNodeAssignAsHomework,\n\n header,\n isInQueue,\n renderAs,\n shouldOpenOnRight,\n studentId,\n subHeader,\n userMilestoneId,\n userType,\n puzzleHWCardRef,\n}) => {\n const isHomeWork = renderAs === 'homework';\n const {\n node_type: nodeType,\n state,\n permissions,\n user_node_id: userNodeId,\n user_milestone_id: nodeDataMilestoneId,\n homework_id: homeworkId,\n } = nodeData;\n\n const milestoneId = userMilestoneId || nodeDataMilestoneId || '';\n const isPuzzleCard = nodeType === 'PUZZLE_CARD';\n const isSheetLocked = state === 'LOCKED';\n\n const teacherContainerRef = useRef<HTMLDivElement>(null) as React.RefObject<HTMLDivElement>;\n const studentContainerRef = useRef<HTMLDivElement>(null) as React.RefObject<HTMLDivElement>;\n const { menuVisible: teacherMenuVisible, onMenuClick: onTeacherMenuClick } =\n useContextMenuClickHandler(teacherContainerRef);\n const { menuVisible: studentMenuVisible, onMenuClick: onStudentMenuClick } =\n useContextMenuClickHandler(studentContainerRef);\n\n const {\n can_start: canStart,\n can_resume: canResume,\n can_review: canReview,\n can_unassign: canUnassign,\n can_reset: canReset,\n can_assign_as_homework: canAssignAsHw,\n } = permissions;\n const isStudent = userType === 'STUDENT';\n\n const onStudentViewSheet = useCallback(() => {\n if (canReview) {\n if (typeof onNodeReview !== 'function') {\n throw new Error('onReview must be a function');\n }\n\n if (!userNodeId) {\n throw new Error('user node id must be present to review the sheet');\n }\n onNodeReview(nodeData, milestoneId);\n\n return;\n }\n }, [canReview, onNodeReview, userNodeId, nodeData, milestoneId]);\n\n const onStudentCardClick = useCallback(() => {\n if (canStart || canResume) {\n if (typeof onNodeAttempt !== 'function') {\n throw new Error('onNodeAttempt must be a function');\n }\n\n onNodeAttempt(nodeData, milestoneId, homeworkId);\n\n return;\n }\n\n if (!isHomeWork) {\n onStudentMenuClick();\n\n return;\n }\n onStudentViewSheet();\n }, [\n canStart,\n canResume,\n isHomeWork,\n onStudentViewSheet,\n onNodeAttempt,\n nodeData,\n milestoneId,\n homeworkId,\n onStudentMenuClick,\n ]);\n\n const onTeacherCardClick = useCallback(() => {\n if (canReview) {\n if (typeof onNodeReview !== 'function') {\n throw new Error('onNodeReview must be a function');\n }\n\n if (!userNodeId) {\n throw new Error('user node id must be present to review the sheet');\n }\n onNodeReview(nodeData, milestoneId, homeworkId);\n\n return;\n }\n\n if (typeof onNodeView !== 'function') {\n throw new Error('onNodeView must be a function');\n }\n\n onNodeView(nodeData, milestoneId);\n }, [canReview, onNodeView, nodeData, milestoneId, onNodeReview, userNodeId, homeworkId]);\n\n const handleOnMenuOptionClick = useCallback(\n (optionId: string) => {\n switch (optionId) {\n case 'teacher-card-view':\n onTeacherCardClick();\n\n return;\n case 'student-card-view':\n onStudentViewSheet();\n\n return;\n case 'teacher-card-unassign':\n onNodeUnassign?.(nodeData, milestoneId);\n\n return;\n case 'student-card-reattempt':\n case 'teacher-card-redo':\n onNodeReattempt?.(nodeData, milestoneId);\n\n return;\n\n case 'teacher-card-assign-as-hw':\n onNodeAssignAsHomework?.(nodeData, milestoneId);\n\n return;\n\n default:\n throw new Error(`No callback function for ${optionId}`);\n }\n },\n [\n nodeData,\n onNodeAssignAsHomework,\n onNodeReattempt,\n onNodeUnassign,\n onStudentViewSheet,\n onTeacherCardClick,\n milestoneId,\n ],\n );\n\n const teacherOptions = [\n {\n id: 'teacher-card-view',\n label: canReview ? 'Review' : 'View',\n icon: Eye2Icon,\n disabled: false,\n onClick: handleOnMenuOptionClick,\n },\n {\n id: 'teacher-card-unassign',\n label: 'Unassign',\n icon: Styled.StyledMinus2Icon,\n disabled: isHomeWork ? nodeType === 'MASTERY' : !canUnassign,\n onClick: handleOnMenuOptionClick,\n },\n {\n id: 'teacher-card-redo',\n label: 'Redo',\n icon: RedoIcon,\n disabled: !canReset,\n onClick: handleOnMenuOptionClick,\n },\n {\n id: 'teacher-card-assign-as-hw',\n label: 'Assign as HW',\n icon: Home2Icon,\n disabled: !canAssignAsHw,\n onClick: handleOnMenuOptionClick,\n },\n ];\n\n const studentOptions = [\n {\n id: 'student-card-view',\n label: 'Review',\n icon: Eye2Icon,\n disabled: !canReview,\n onClick: handleOnMenuOptionClick,\n },\n {\n id: 'student-card-reattempt',\n label: 'Reattempt',\n icon: RedoIcon,\n disabled: !canReset,\n onClick: handleOnMenuOptionClick,\n },\n ];\n\n const analyticsLabel = useMemo(\n () =>\n getCardAnalyticProps({\n canResume,\n canStart,\n homeworkId,\n isHomeWork,\n isStudent,\n milestoneId,\n nodeType,\n studentId,\n userNodeId,\n }),\n [\n isStudent,\n isHomeWork,\n studentId,\n nodeType,\n canStart,\n canResume,\n homeworkId,\n userNodeId,\n milestoneId,\n ],\n );\n\n const isClickableDisabled = isStudent && isPuzzleCard && isSheetLocked;\n\n return (\n <Styled.CardContainer $position=\"relative\" $width=\"fit-content\">\n <Clickable\n onClick={isStudent ? onStudentCardClick : onTeacherCardClick}\n label=\"homework-card\"\n analyticsLabel={analyticsLabel.analyticsLabel}\n analyticsProps={analyticsLabel.analyticsProps}\n disabled={isClickableDisabled}\n >\n <HomeworkView\n header={header}\n isInQueue={isInQueue}\n nodeData={nodeData}\n studentContainerRef={studentContainerRef}\n subHeader={subHeader}\n userType={userType}\n isMilestone={renderAs === 'milestone'}\n puzzleHWCardRef={puzzleHWCardRef}\n />\n </Clickable>\n {isStudent && !isHomeWork && (\n <CardMenuOptions\n $width={200}\n options={studentOptions}\n triggerRef={studentContainerRef}\n visible={studentMenuVisible}\n shouldOpenOnRight={false}\n />\n )}\n {!isStudent && !isPuzzleCard && (\n <Styled.MenuWrapper $position=\"absolute\" $width=\"fit-content\" $borderRadiusX={2}>\n <ArrowTooltip\n renderAs=\"primary\"\n tooltipItem=\"Review\"\n position=\"bottom\"\n zIndex={6}\n parentWidth=\"100%\"\n hidden={teacherMenuVisible || (state !== 'WAIT_FOR_REVIEW' && isHomeWork)}\n >\n <Styled.CardKebabMenuWrapper\n $alignItems=\"center\"\n $justifyContent=\"center\"\n ref={teacherContainerRef}\n onClick={onTeacherMenuClick}\n >\n <MoreVerticalIcon width={16} height={16} />\n </Styled.CardKebabMenuWrapper>\n </ArrowTooltip>\n <CardMenuOptions\n options={teacherOptions}\n triggerRef={teacherContainerRef}\n visible={teacherMenuVisible}\n shouldOpenOnRight={shouldOpenOnRight}\n $width={144}\n />\n </Styled.MenuWrapper>\n )}\n {isInQueue && (\n <Styled.BlurContainer $background=\"WHITE_5\">\n <Styled.BlurFlexView $heightX={1} $widthX={6}>\n <ArrowTooltip renderAs=\"primary\" tooltipItem=\"Not visible to student\" position=\"bottom\">\n <FlexView $heightX={1} $widthX={6} />\n </ArrowTooltip>\n </Styled.BlurFlexView>\n </Styled.BlurContainer>\n )}\n </Styled.CardContainer>\n );\n};\n\nexport default memo(HomeworkCard);\n"],"names":["HomeworkCard","nodeData","onNodeAttempt","onNodeReattempt","onNodeReview","onNodeUnassign","onNodeView","onNodeAssignAsHomework","header","isInQueue","renderAs","shouldOpenOnRight","studentId","subHeader","userMilestoneId","userType","puzzleHWCardRef","isHomeWork","nodeType","state","permissions","userNodeId","nodeDataMilestoneId","homeworkId","milestoneId","isPuzzleCard","isSheetLocked","teacherContainerRef","useRef","studentContainerRef","teacherMenuVisible","onTeacherMenuClick","useContextMenuClickHandler","studentMenuVisible","onStudentMenuClick","canStart","canResume","canReview","canUnassign","canReset","canAssignAsHw","isStudent","onStudentViewSheet","useCallback","onStudentCardClick","onTeacherCardClick","handleOnMenuOptionClick","optionId","teacherOptions","Eye2Icon","Styled.StyledMinus2Icon","RedoIcon","Home2Icon","studentOptions","analyticsLabel","useMemo","getCardAnalyticProps","isClickableDisabled","Styled.CardContainer","jsx","Clickable","HomeworkView","CardMenuOptions","jsxs","Styled.MenuWrapper","ArrowTooltip","Styled.CardKebabMenuWrapper","MoreVerticalIcon","Styled.BlurContainer","Styled.BlurFlexView","FlexView","HomeworkCard$1","memo"],"mappings":";;;;;;;;;;;;;;AAkCA,MAAMA,KAAuC,CAAC;AAAA;AAAA,EAE5C,UAAAC;AAAA,EACA,eAAAC;AAAA,EACA,iBAAAC;AAAA,EACA,cAAAC;AAAA,EACA,gBAAAC;AAAA,EACA,YAAAC;AAAA,EACA,wBAAAC;AAAA,EAEA,QAAAC;AAAA,EACA,WAAAC;AAAA,EACA,UAAAC;AAAA,EACA,mBAAAC;AAAA,EACA,WAAAC;AAAA,EACA,WAAAC;AAAA,EACA,iBAAAC;AAAA,EACA,UAAAC;AAAA,EACA,iBAAAC;AACF,MAAM;AACJ,QAAMC,IAAaP,MAAa,YAC1B;AAAA,IACJ,WAAWQ;AAAA,IACX,OAAAC;AAAA,IACA,aAAAC;AAAA,IACA,cAAcC;AAAA,IACd,mBAAmBC;AAAA,IACnB,aAAaC;AAAA,EACX,IAAAtB,GAEEuB,IAAcV,KAAmBQ,KAAuB,IACxDG,IAAeP,MAAa,eAC5BQ,IAAgBP,MAAU,UAE1BQ,I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-card-list.js","sources":["../../../../src/features/homework/hw-card-list/hw-card-list.tsx"],"sourcesContent":["import
|
|
1
|
+
{"version":3,"file":"hw-card-list.js","sources":["../../../../src/features/homework/hw-card-list/hw-card-list.tsx"],"sourcesContent":["import { memo, useCallback, useEffect, useMemo, type FC } from 'react';\n\nimport type {\n INodeCardCallbacks,\n INodeDataProps,\n} from '../../chapters-v2/comps/node-card/node-card-types';\nimport type { IHomepageStartJourneyProps } from '../../journey/hooks/use-home-page-journey/homepage-journey-types';\nimport { usePuzzleAssignedJourney } from '../../journey/hooks/use-puzzles-journey/use-puzzle-assigned';\nimport { useJourney } from '../../journey/use-journey/use-journey';\nimport type { TUserTypes } from '../../ui/types';\nimport { getPuzzleCardData } from '../utils';\nimport { useGetHomeworks } from './api/get-homeworks';\nimport HwCardListView from './hw-card-list-view';\n\ninterface HWCardListProps extends INodeCardCallbacks {\n userType: TUserTypes;\n studentId: string;\n stream: string;\n onTestPreview?: (sheetData: INodeDataProps, milestoneId?: string) => void;\n onTestStart?: (sheetData: INodeDataProps, homeworkId?: string) => void;\n onTestReview?: (sheetData: INodeDataProps, milestoneId?: string) => void;\n homeworkRef?: React.RefObject<HTMLDivElement>;\n startHomePageJourney?: ({ studentId, stream, userType }: IHomepageStartJourneyProps) => void;\n canStartJourney?: boolean;\n canStartPuzzleAssignedJourney?: boolean;\n}\n\nconst HWCardList: FC<HWCardListProps> = ({\n userType,\n studentId,\n stream,\n onTestStart,\n onNodeAttempt,\n onTestPreview,\n onNodeView,\n onTestReview,\n onNodeReview,\n onNodeUnassign,\n homeworkRef,\n startHomePageJourney,\n canStartJourney,\n canStartPuzzleAssignedJourney,\n}) => {\n const {\n get: getHomeworks,\n data: hwDetails,\n isProcessingFailed,\n isProcessing,\n isProcessed,\n isStale,\n } = useGetHomeworks(studentId);\n const { isJourneyActive } = useJourney();\n\n const { puzzleHWCardRef, startJourney: startPuzzleAssignedJourney } = usePuzzleAssignedJourney();\n\n const puzzleCardData = useMemo(() => getPuzzleCardData(hwDetails), [hwDetails]);\n\n useEffect(() => {\n if (isProcessed && startHomePageJourney && !isJourneyActive && canStartJourney) {\n startHomePageJourney({ studentId, stream, userType });\n }\n }, [\n canStartJourney,\n isJourneyActive,\n isProcessed,\n startHomePageJourney,\n stream,\n studentId,\n userType,\n ]);\n\n const fetchHomeworks = useCallback(() => {\n getHomeworks(studentId, undefined, { stream });\n }, [getHomeworks, stream, studentId]);\n\n useEffect(() => {\n if (!isProcessing && isStale) {\n fetchHomeworks();\n }\n }, [fetchHomeworks, isProcessing, isStale]);\n\n useEffect(() => {\n fetchHomeworks();\n }, [fetchHomeworks]);\n\n useEffect(() => {\n if (\n canStartPuzzleAssignedJourney &&\n !isJourneyActive &&\n startPuzzleAssignedJourney &&\n puzzleCardData\n ) {\n startPuzzleAssignedJourney(puzzleCardData);\n }\n }, [canStartPuzzleAssignedJourney, puzzleCardData, isJourneyActive, startPuzzleAssignedJourney]);\n\n if (isProcessingFailed) {\n return null;\n }\n\n return (\n <div ref={homeworkRef}>\n <HwCardListView\n isHwProcessing={isProcessing}\n hwDetails={hwDetails}\n onTestStart={onTestStart}\n onNodeAttempt={onNodeAttempt}\n onTestPreview={onTestPreview}\n onNodeView={onNodeView}\n onTestReview={onTestReview}\n onNodeReview={onNodeReview}\n onNodeUnassign={onNodeUnassign}\n userType={userType}\n studentId={studentId}\n puzzleHWCardRef={puzzleHWCardRef}\n />\n </div>\n );\n};\n\nexport default memo(HWCardList);\n"],"names":["HWCardList","userType","studentId","stream","onTestStart","onNodeAttempt","onTestPreview","onNodeView","onTestReview","onNodeReview","onNodeUnassign","homeworkRef","startHomePageJourney","canStartJourney","canStartPuzzleAssignedJourney","getHomeworks","hwDetails","isProcessingFailed","isProcessing","isProcessed","isStale","useGetHomeworks","isJourneyActive","useJourney","puzzleHWCardRef","startPuzzleAssignedJourney","usePuzzleAssignedJourney","puzzleCardData","useMemo","getPuzzleCardData","useEffect","fetchHomeworks","useCallback","jsx","HwCardListView","hwCardList","mem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ACQ,KACDG,KACAE,KAEAF,EAA2BE,CAAc;AAAA,KAE1C,CAACb,GAA+Ba,GAAgBL,GAAiBG,CAA0B,CAAC,GAE3FR,IACK,OAIP,gBAAAgB,EAAC,OAAI,EAAA,KAAKtB,GACR,UAAA,gBAAAsB;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,gBAAgBhB;AAAA,MAChB,WAAAF;AAAA,MACA,aAAAZ;AAAA,MACA,eAAAC;AAAA,MACA,eAAAC;AAAA,MACA,YAAAC;AAAA,MACA,cAAAC;AAAA,MACA,cAAAC;AAAA,MACA,gBAAAC;AAAA,MACA,UAAAT;AAAA,MACA,WAAAC;AAAA,MACA,iBAAAsB;AAAA,IAAA;AAAA,EAEJ,EAAA,CAAA;AAEJ,GAEeW,IAAAC,EAAKpC,CAAU;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"node-progress.js","sources":["../../../src/features/homework/node-progress.tsx"],"sourcesContent":["import { differenceInDays } from 'date-fns';\nimport
|
|
1
|
+
{"version":3,"file":"node-progress.js","sources":["../../../src/features/homework/node-progress.tsx"],"sourcesContent":["import { differenceInDays } from 'date-fns';\nimport { memo, type FC } from 'react';\nimport styled from 'styled-components';\n\nimport FlexView from '../ui/layout/flex-view';\nimport type { TColorNames } from '../ui/types';\n\ninterface NodeProgressProps {\n unlockedOn: number | string | Date;\n dueDate: number | string | Date;\n progressBg: TColorNames;\n}\n\nconst ProgressBar = styled(FlexView)<{ progress: number }>`\n height: 100%;\n border-radius: 4px;\n transition: all 300ms;\n width: ${props => props.progress}%;\n`;\n\nconst ProgressContainer = styled(FlexView)`\n position: absolute;\n top: -1px;\n right: 0px;\n width: 100%;\n height: 2px;\n background-color: ${props => props.theme.colors.BLACK};\n z-index: 2;\n`;\n\nconst NodeProgress: FC<NodeProgressProps> = ({ unlockedOn, dueDate, progressBg }) => {\n const calculateProgress = () => {\n const totalDays = differenceInDays(dueDate, unlockedOn);\n const daysElapsed = differenceInDays(new Date(), unlockedOn);\n\n if (daysElapsed > totalDays) return 100;\n\n const progress = Math.min(Math.max((daysElapsed / totalDays) * 100, 0), 100);\n\n return progress;\n };\n\n const progress = calculateProgress();\n\n return (\n <ProgressContainer>\n <ProgressBar progress={progress} $background={progressBg} />\n </ProgressContainer>\n );\n};\n\nexport default memo(NodeProgress);\n"],"names":["ProgressBar","styled","FlexView","props","ProgressContainer","NodeProgress","unlockedOn","dueDate","progressBg","progress","totalDays","differenceInDays","daysElapsed","jsx","NodeProgress$1","memo"],"mappings":";;;;;AAaA,MAAMA,IAAcC,EAAOC,CAAQ;AAAA;AAAA;AAAA;AAAA,WAIxB,CAAAC,MAASA,EAAM,QAAQ;AAAA,GAG5BC,IAAoBH,EAAOC,CAAQ;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,sBAMnB,CAASC,MAAAA,EAAM,MAAM,OAAO,KAAK;AAAA;AAAA,GAIjDE,IAAsC,CAAC,EAAE,YAAAC,GAAY,SAAAC,GAAS,YAAAC,QAAiB;AAYnF,QAAMC,KAXoB,MAAM;AACxB,UAAAC,IAAYC,EAAiBJ,GAASD,CAAU,GAChDM,IAAcD,EAAqB,oBAAA,QAAQL,CAAU;AAEvD,WAAAM,IAAcF,IAAkB,MAEnB,KAAK,IAAI,KAAK,IAAKE,IAAcF,IAAa,KAAK,CAAC,GAAG,GAAG;AAAA,EAEpE;AAKT,2BACGN,GACC,EAAA,UAAA,gBAAAS,EAACb,KAAY,UAAAS,GAAoB,aAAaD,EAAY,CAAA,EAC5D,CAAA;AAEJ,GAEeM,IAAAC,EAAKV,CAAY;"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { useMemo as t } from "react";
|
|
2
|
+
import { TRACKING_IDS as o } from "../tracking-id/tracking-ids.js";
|
|
3
|
+
import { useJourney as s } from "../use-journey/use-journey.js";
|
|
4
|
+
const m = () => {
|
|
5
|
+
const { userCompletedJourneyIds: e } = s();
|
|
6
|
+
return t(() => Array.isArray(e) ? e.filter(
|
|
7
|
+
(r) => Object.values(o).includes(r)
|
|
8
|
+
) : [], [e]);
|
|
9
|
+
};
|
|
10
|
+
export {
|
|
11
|
+
m as useGetTrackedViews
|
|
12
|
+
};
|
|
13
|
+
//# sourceMappingURL=use-get-tracked-views.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-get-tracked-views.js","sources":["../../../../src/features/journey/hooks/use-get-tracked-views.ts"],"sourcesContent":["import { useMemo } from 'react';\n\nimport type { TTrackingId } from '../tracking-id/tracking-id-types';\nimport { TRACKING_IDS } from '../tracking-id/tracking-ids';\nimport { useJourney } from '../use-journey/use-journey';\n\nexport const useGetTrackedViews = () => {\n const { userCompletedJourneyIds } = useJourney();\n\n const trackedViews = useMemo(() => {\n if (!Array.isArray(userCompletedJourneyIds)) return [];\n\n return userCompletedJourneyIds.filter(trackingId =>\n Object.values(TRACKING_IDS).includes(trackingId as TTrackingId),\n );\n }, [userCompletedJourneyIds]);\n\n return trackedViews;\n};\n"],"names":["useGetTrackedViews","userCompletedJourneyIds","useJourney","useMemo","TRACKING_IDS","trackingId"],"mappings":";;;AAMO,MAAMA,IAAqB,MAAM;AAChC,QAAA,EAAE,yBAAAC,MAA4BC;AAU7B,SARcC,EAAQ,MACtB,MAAM,QAAQF,CAAuB,IAEnCA,EAAwB;AAAA,IAAO,OACpC,OAAO,OAAOG,CAAY,EAAE,SAASC,CAAyB;AAAA,EAAA,IAHZ,CAAA,GAKnD,CAACJ,CAAuB,CAAC;AAG9B;"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var R = /* @__PURE__ */ ((E) => (E.CIRCLE_ACTIVITIES_INTRO_JOURNEY = "CIRCLE_ACTIVITIES_INTRO_JOURNEY", E.CIRCLE_LEADERBOARD_INTRO_JOURNEY = "CIRCLE_LEADERBOARD_INTRO_JOURNEY", E.CIRCLE_POINTS_REWARD_JOURNEY = "CIRCLE_POINTS_REWARD_JOURNEY", E.CIRCLE_STREAK_UPDATE_JOURNEY = "CIRCLE_STREAK_UPDATE_JOURNEY", E.CIRCLE_TUTORIAL_JOURNEY = "CIRCLE_TUTORIAL_JOURNEY", E.CIRCLE_TABLES_INTRO_JOURNEY = "CIRCLE_TABLES_INTRO_JOURNEY", E.CIRCLE_TABLES_INFINTE_JOURNEY = "CIRCLE_TABLES_INFINITE_JOURNEY", E.CIRCLE_LESSONS_K_1_INTRO_JOURNEY = "CIRCLE_LESSONS_K_1_INTRO_JOURNEY", E.PLA_SWITCH_USER_JOURNEY = "PLA_SWITCH_USER_JOURNEY", E.HOMEPAGE_JOURNEY = "HOMEPAGE_JOURNEY", E.CHAPTER_PAGE_JOURNEY = "CHAPTER_PAGE_JOURNEY", E.PUZZLE_ATTEMPT_JOURNEY = "PUZZLE_ATTEMPT_JOURNEY", E.CHALLENGE_ARENA_JOURNEY = "CHALLENGE_ARENA_JOURNEY", E.DOWNLOAD_NODE_JOURNEY = "DOWNLOAD_NODE_JOURNEY", E.DOWNLOAD_BLOCK_JOURNEY = "DOWNLOAD_BLOCK_JOURNEY", E.PUZZLE_ASSIGNED_JOURNEY = "PUZZLE_ASSIGNED_JOURNEY", E.PUZZLE_DASHBOARD_JOURNEY = "PUZZLE_DASHBOARD_JOURNEY", E))(R || {});
|
|
1
|
+
var R = /* @__PURE__ */ ((E) => (E.CIRCLE_ACTIVITIES_INTRO_JOURNEY = "CIRCLE_ACTIVITIES_INTRO_JOURNEY", E.CIRCLE_ACTIVITIES_INTRO_JOURNEY_V2 = "CIRCLE_ACTIVITIES_INTRO_JOURNEY_V2", E.CIRCLE_LEADERBOARD_INTRO_JOURNEY = "CIRCLE_LEADERBOARD_INTRO_JOURNEY", E.CIRCLE_POINTS_REWARD_JOURNEY = "CIRCLE_POINTS_REWARD_JOURNEY", E.CIRCLE_STREAK_UPDATE_JOURNEY = "CIRCLE_STREAK_UPDATE_JOURNEY", E.CIRCLE_TUTORIAL_JOURNEY = "CIRCLE_TUTORIAL_JOURNEY", E.CIRCLE_TABLES_INTRO_JOURNEY = "CIRCLE_TABLES_INTRO_JOURNEY", E.CIRCLE_TABLES_INFINTE_JOURNEY = "CIRCLE_TABLES_INFINITE_JOURNEY", E.CIRCLE_LESSONS_K_1_INTRO_JOURNEY = "CIRCLE_LESSONS_K_1_INTRO_JOURNEY", E.CIRCLE_LESSONS_K_1_INTRO_JOURNEY_V2 = "CIRCLE_LESSONS_K_1_INTRO_JOURNEY_V2", E.PLA_SWITCH_USER_JOURNEY = "PLA_SWITCH_USER_JOURNEY", E.HOMEPAGE_JOURNEY = "HOMEPAGE_JOURNEY", E.CHAPTER_PAGE_JOURNEY = "CHAPTER_PAGE_JOURNEY", E.PUZZLE_ATTEMPT_JOURNEY = "PUZZLE_ATTEMPT_JOURNEY", E.CHALLENGE_ARENA_JOURNEY = "CHALLENGE_ARENA_JOURNEY", E.DOWNLOAD_NODE_JOURNEY = "DOWNLOAD_NODE_JOURNEY", E.DOWNLOAD_BLOCK_JOURNEY = "DOWNLOAD_BLOCK_JOURNEY", E.PUZZLE_ASSIGNED_JOURNEY = "PUZZLE_ASSIGNED_JOURNEY", E.PUZZLE_DASHBOARD_JOURNEY = "PUZZLE_DASHBOARD_JOURNEY", E))(R || {});
|
|
2
2
|
export {
|
|
3
3
|
R as JOURNEY_ID_STUDENT
|
|
4
4
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"journey-id-student.js","sources":["../../../../src/features/journey/journey-id/journey-id-student.ts"],"sourcesContent":["export enum JOURNEY_ID_STUDENT {\n CIRCLE_ACTIVITIES_INTRO_JOURNEY = 'CIRCLE_ACTIVITIES_INTRO_JOURNEY',\n CIRCLE_LEADERBOARD_INTRO_JOURNEY = 'CIRCLE_LEADERBOARD_INTRO_JOURNEY',\n CIRCLE_POINTS_REWARD_JOURNEY = 'CIRCLE_POINTS_REWARD_JOURNEY',\n CIRCLE_STREAK_UPDATE_JOURNEY = 'CIRCLE_STREAK_UPDATE_JOURNEY',\n CIRCLE_TUTORIAL_JOURNEY = 'CIRCLE_TUTORIAL_JOURNEY',\n CIRCLE_TABLES_INTRO_JOURNEY = 'CIRCLE_TABLES_INTRO_JOURNEY',\n CIRCLE_TABLES_INFINTE_JOURNEY = 'CIRCLE_TABLES_INFINITE_JOURNEY',\n CIRCLE_LESSONS_K_1_INTRO_JOURNEY = 'CIRCLE_LESSONS_K_1_INTRO_JOURNEY',\n PLA_SWITCH_USER_JOURNEY = 'PLA_SWITCH_USER_JOURNEY',\n\n // TODO: Deprecate bottom journeys, they are not actually journeys\n HOMEPAGE_JOURNEY = 'HOMEPAGE_JOURNEY',\n CHAPTER_PAGE_JOURNEY = 'CHAPTER_PAGE_JOURNEY',\n PUZZLE_ATTEMPT_JOURNEY = 'PUZZLE_ATTEMPT_JOURNEY',\n CHALLENGE_ARENA_JOURNEY = 'CHALLENGE_ARENA_JOURNEY',\n DOWNLOAD_NODE_JOURNEY = 'DOWNLOAD_NODE_JOURNEY',\n DOWNLOAD_BLOCK_JOURNEY = 'DOWNLOAD_BLOCK_JOURNEY',\n PUZZLE_ASSIGNED_JOURNEY = 'PUZZLE_ASSIGNED_JOURNEY',\n PUZZLE_DASHBOARD_JOURNEY = 'PUZZLE_DASHBOARD_JOURNEY',\n}\n"],"names":["JOURNEY_ID_STUDENT"],"mappings":"AAAY,IAAAA,sBAAAA,OACVA,EAAA,kCAAkC,mCAClCA,EAAA,mCAAmC,oCACnCA,EAAA,+BAA+B,gCAC/BA,EAAA,+BAA+B,gCAC/BA,EAAA,0BAA0B,2BAC1BA,EAAA,8BAA8B,+BAC9BA,EAAA,gCAAgC,kCAChCA,EAAA,mCAAmC,oCACnCA,EAAA,0BAA0B,2BAG1BA,EAAA,mBAAmB,oBACnBA,EAAA,uBAAuB,wBACvBA,EAAA,yBAAyB,0BACzBA,EAAA,0BAA0B,2BAC1BA,EAAA,wBAAwB,yBACxBA,EAAA,yBAAyB,0BACzBA,EAAA,0BAA0B,2BAC1BA,EAAA,2BAA2B,
|
|
1
|
+
{"version":3,"file":"journey-id-student.js","sources":["../../../../src/features/journey/journey-id/journey-id-student.ts"],"sourcesContent":["export enum JOURNEY_ID_STUDENT {\n CIRCLE_ACTIVITIES_INTRO_JOURNEY = 'CIRCLE_ACTIVITIES_INTRO_JOURNEY',\n CIRCLE_ACTIVITIES_INTRO_JOURNEY_V2 = 'CIRCLE_ACTIVITIES_INTRO_JOURNEY_V2',\n CIRCLE_LEADERBOARD_INTRO_JOURNEY = 'CIRCLE_LEADERBOARD_INTRO_JOURNEY',\n CIRCLE_POINTS_REWARD_JOURNEY = 'CIRCLE_POINTS_REWARD_JOURNEY',\n CIRCLE_STREAK_UPDATE_JOURNEY = 'CIRCLE_STREAK_UPDATE_JOURNEY',\n CIRCLE_TUTORIAL_JOURNEY = 'CIRCLE_TUTORIAL_JOURNEY',\n CIRCLE_TABLES_INTRO_JOURNEY = 'CIRCLE_TABLES_INTRO_JOURNEY',\n CIRCLE_TABLES_INFINTE_JOURNEY = 'CIRCLE_TABLES_INFINITE_JOURNEY',\n CIRCLE_LESSONS_K_1_INTRO_JOURNEY = 'CIRCLE_LESSONS_K_1_INTRO_JOURNEY',\n CIRCLE_LESSONS_K_1_INTRO_JOURNEY_V2 = 'CIRCLE_LESSONS_K_1_INTRO_JOURNEY_V2',\n PLA_SWITCH_USER_JOURNEY = 'PLA_SWITCH_USER_JOURNEY',\n\n // TODO: Deprecate bottom journeys, they are not actually journeys\n HOMEPAGE_JOURNEY = 'HOMEPAGE_JOURNEY',\n CHAPTER_PAGE_JOURNEY = 'CHAPTER_PAGE_JOURNEY',\n PUZZLE_ATTEMPT_JOURNEY = 'PUZZLE_ATTEMPT_JOURNEY',\n CHALLENGE_ARENA_JOURNEY = 'CHALLENGE_ARENA_JOURNEY',\n DOWNLOAD_NODE_JOURNEY = 'DOWNLOAD_NODE_JOURNEY',\n DOWNLOAD_BLOCK_JOURNEY = 'DOWNLOAD_BLOCK_JOURNEY',\n PUZZLE_ASSIGNED_JOURNEY = 'PUZZLE_ASSIGNED_JOURNEY',\n PUZZLE_DASHBOARD_JOURNEY = 'PUZZLE_DASHBOARD_JOURNEY',\n}\n"],"names":["JOURNEY_ID_STUDENT"],"mappings":"AAAY,IAAAA,sBAAAA,OACVA,EAAA,kCAAkC,mCAClCA,EAAA,qCAAqC,sCACrCA,EAAA,mCAAmC,oCACnCA,EAAA,+BAA+B,gCAC/BA,EAAA,+BAA+B,gCAC/BA,EAAA,0BAA0B,2BAC1BA,EAAA,8BAA8B,+BAC9BA,EAAA,gCAAgC,kCAChCA,EAAA,mCAAmC,oCACnCA,EAAA,sCAAsC,uCACtCA,EAAA,0BAA0B,2BAG1BA,EAAA,mBAAmB,oBACnBA,EAAA,uBAAuB,wBACvBA,EAAA,yBAAyB,0BACzBA,EAAA,0BAA0B,2BAC1BA,EAAA,wBAAwB,yBACxBA,EAAA,yBAAyB,0BACzBA,EAAA,0BAA0B,2BAC1BA,EAAA,2BAA2B,4BArBjBA,IAAAA,KAAA,CAAA,CAAA;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tracking-id-student.js","sources":["../../../../src/features/journey/tracking-id/tracking-id-student.ts"],"sourcesContent":["export enum TRACKING_ID_STUDENT {\n // circle\n INFO_ABOUT_GAME_ACTIVITIES = 'INFO_ABOUT_GAME_ACTIVITIES',\n}\n"],"names":["TRACKING_ID_STUDENT"],"mappings":"AAAY,IAAAA,sBAAAA,OAEVA,EAAA,6BAA6B,8BAFnBA,IAAAA,KAAA,CAAA,CAAA;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tracking-ids.js","sources":["../../../../src/features/journey/tracking-id/tracking-ids.ts"],"sourcesContent":["import { TRACKING_ID_STUDENT } from './tracking-id-student';\n\nexport const TRACKING_IDS = {\n ...TRACKING_ID_STUDENT,\n};\n"],"names":["TRACKING_IDS","TRACKING_ID_STUDENT"],"mappings":";AAEO,MAAMA,IAAe;AAAA,EAC1B,GAAGC;AACL;"}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { jsxs as W, jsx as
|
|
2
|
-
import { createContext as M, useState as s, useRef as
|
|
1
|
+
import { jsxs as W, jsx as O } from "react/jsx-runtime";
|
|
2
|
+
import { createContext as M, useState as s, useRef as w, useCallback as c, useMemo as G, useEffect as T } from "react";
|
|
3
3
|
import { Coachmark as F } from "../comps/coachmark/coachmark.js";
|
|
4
4
|
import { usePostUserJourney as I, useGetUserJourney as K } from "../user-journey-api/user-journey-api.js";
|
|
5
5
|
import { Overlay as Q } from "./journey-styled.js";
|
|
6
6
|
const X = M(null), ne = ({ children: U, appId: l, userId: i }) => {
|
|
7
|
-
const [q, z] = s(!0), [D, H] = s(!1), [p, x] = s(null), [y, d] = s([]), [f, A] = s(!1),
|
|
8
|
-
height:
|
|
9
|
-
width:
|
|
10
|
-
}), { post: _ } = I(), { data:
|
|
7
|
+
const [q, z] = s(!0), [D, H] = s(!1), [p, x] = s(null), [y, d] = s([]), [f, A] = s(!1), h = w(-1), t = w(void 0), g = w([]), [L, N] = s(!1), [$, R] = s({
|
|
8
|
+
height: document.body.clientHeight,
|
|
9
|
+
width: document.body.clientWidth
|
|
10
|
+
}), { post: _ } = I(), { data: C = null, get: P } = K(), J = c(
|
|
11
11
|
(e) => {
|
|
12
12
|
_({
|
|
13
13
|
app_id: l,
|
|
@@ -17,37 +17,37 @@ const X = M(null), ne = ({ children: U, appId: l, userId: i }) => {
|
|
|
17
17
|
});
|
|
18
18
|
},
|
|
19
19
|
[l, _, i]
|
|
20
|
-
),
|
|
21
|
-
(e, r, o,
|
|
22
|
-
var
|
|
20
|
+
), b = c(
|
|
21
|
+
(e, r, o, k = !0) => {
|
|
22
|
+
var m, n;
|
|
23
23
|
if (y.length > 0) {
|
|
24
24
|
console.error(
|
|
25
25
|
`setJourney: Other Journey is already active, Current Journey: ${t.current}, New Journey Request: ${e}`
|
|
26
26
|
);
|
|
27
27
|
return;
|
|
28
28
|
}
|
|
29
|
-
A(!0), z(
|
|
29
|
+
A(!0), z(k), t.current = e, h.current = -1, d(
|
|
30
30
|
r.map((u) => ({
|
|
31
31
|
...u,
|
|
32
32
|
isActive: !1
|
|
33
33
|
// New coachmarks are inactive by default
|
|
34
34
|
}))
|
|
35
35
|
), o && (R({
|
|
36
|
-
height: ((
|
|
36
|
+
height: ((m = o.current) == null ? void 0 : m.clientHeight) || window.innerHeight,
|
|
37
37
|
width: ((n = o.current) == null ? void 0 : n.clientWidth) || window.innerWidth
|
|
38
38
|
}), N(!0));
|
|
39
39
|
},
|
|
40
40
|
[y.length]
|
|
41
41
|
), a = c(() => {
|
|
42
|
-
|
|
42
|
+
g.current.forEach((e) => {
|
|
43
43
|
clearTimeout(e);
|
|
44
|
-
}),
|
|
45
|
-
}, []),
|
|
44
|
+
}), g.current = [], t.current = void 0, h.current = -1, d([]), A(!1);
|
|
45
|
+
}, []), B = c(
|
|
46
46
|
(e) => {
|
|
47
47
|
a(), x((r) => r && !r.includes(e) ? [...r, e] : r), J(e);
|
|
48
48
|
},
|
|
49
49
|
[a, J]
|
|
50
|
-
),
|
|
50
|
+
), E = c((e, r) => {
|
|
51
51
|
if (!t.current || e !== t.current) {
|
|
52
52
|
console.error(
|
|
53
53
|
t.current ? `A Journey is already active, Current Journey: ${t.current}, New Journey Request: ${e}` : "addCoachmark was called before setJourney and Journey ID is undefined"
|
|
@@ -62,71 +62,71 @@ const X = M(null), ne = ({ children: U, appId: l, userId: i }) => {
|
|
|
62
62
|
// New coachmarks are inactive by default
|
|
63
63
|
}
|
|
64
64
|
]);
|
|
65
|
-
}, []),
|
|
66
|
-
(e, r = !1, o = 0,
|
|
65
|
+
}, []), S = c(
|
|
66
|
+
(e, r = !1, o = 0, k = !1) => {
|
|
67
67
|
if (!t.current || e !== t.current) {
|
|
68
68
|
console.error(
|
|
69
69
|
t.current ? "nextCoachmark was called before setJourney" : `A Journey is already active, Current Journey: ${t.current}, New Journey Request: ${e}`
|
|
70
70
|
);
|
|
71
71
|
return;
|
|
72
72
|
}
|
|
73
|
-
H(
|
|
74
|
-
const
|
|
75
|
-
clearTimeout(
|
|
76
|
-
const n =
|
|
73
|
+
H(k), o !== 0 && d((n) => n.map((u) => ({ ...u, isActive: !1 })));
|
|
74
|
+
const m = setTimeout(() => {
|
|
75
|
+
clearTimeout(m);
|
|
76
|
+
const n = h.current + 1;
|
|
77
77
|
d((u) => {
|
|
78
78
|
if (n >= u.length || u.length === 0)
|
|
79
79
|
return a(), [];
|
|
80
|
-
|
|
81
|
-
const
|
|
82
|
-
return
|
|
80
|
+
h.current = n;
|
|
81
|
+
const v = [...u];
|
|
82
|
+
return v[n].isActive = !0, n > 0 && (v[n - 1].isActive = r), v;
|
|
83
83
|
});
|
|
84
84
|
}, o);
|
|
85
|
-
|
|
85
|
+
g.current.push(m);
|
|
86
86
|
},
|
|
87
87
|
[a]
|
|
88
|
-
),
|
|
88
|
+
), j = c(
|
|
89
89
|
(e) => {
|
|
90
90
|
J(e);
|
|
91
91
|
},
|
|
92
92
|
[J]
|
|
93
93
|
), V = G(
|
|
94
94
|
() => ({
|
|
95
|
-
nextCoachmark:
|
|
96
|
-
setJourney:
|
|
97
|
-
addCoachmark:
|
|
95
|
+
nextCoachmark: S,
|
|
96
|
+
setJourney: b,
|
|
97
|
+
addCoachmark: E,
|
|
98
98
|
clearJourney: a,
|
|
99
|
-
endJourney:
|
|
99
|
+
endJourney: B,
|
|
100
100
|
coachmarks: y,
|
|
101
101
|
userCompletedJourneyIds: p,
|
|
102
102
|
isJourneyActive: f,
|
|
103
|
-
trackView:
|
|
103
|
+
trackView: j
|
|
104
104
|
}),
|
|
105
105
|
[
|
|
106
|
-
j,
|
|
107
|
-
B,
|
|
108
106
|
S,
|
|
109
|
-
|
|
107
|
+
b,
|
|
110
108
|
E,
|
|
109
|
+
a,
|
|
110
|
+
B,
|
|
111
111
|
y,
|
|
112
112
|
p,
|
|
113
113
|
f,
|
|
114
|
-
|
|
114
|
+
j
|
|
115
115
|
]
|
|
116
116
|
);
|
|
117
|
-
return
|
|
117
|
+
return T(() => {
|
|
118
118
|
l && i && P(i, {
|
|
119
119
|
app_id: l,
|
|
120
120
|
user_id: i,
|
|
121
121
|
journey_status: "COMPLETED"
|
|
122
122
|
});
|
|
123
|
-
}, [l, P, i]),
|
|
124
|
-
if (
|
|
125
|
-
const e =
|
|
123
|
+
}, [l, P, i]), T(() => {
|
|
124
|
+
if (C) {
|
|
125
|
+
const e = C.map((r) => r.journey_id);
|
|
126
126
|
x(e);
|
|
127
127
|
}
|
|
128
|
-
}, [
|
|
129
|
-
f && /* @__PURE__ */
|
|
128
|
+
}, [C]), /* @__PURE__ */ W(X.Provider, { value: V, children: [
|
|
129
|
+
f && /* @__PURE__ */ O(
|
|
130
130
|
Q,
|
|
131
131
|
{
|
|
132
132
|
about: "journey-overlay",
|
|
@@ -135,7 +135,7 @@ const X = M(null), ne = ({ children: U, appId: l, userId: i }) => {
|
|
|
135
135
|
$isJourneyBlurred: D,
|
|
136
136
|
$isBlockingJourney: q,
|
|
137
137
|
"data-testid": t.current,
|
|
138
|
-
children: y.map((e, r) => /* @__PURE__ */
|
|
138
|
+
children: y.map((e, r) => /* @__PURE__ */ O(
|
|
139
139
|
F,
|
|
140
140
|
{
|
|
141
141
|
coachmark: e,
|
|
@@ -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 { FC, RefObject } from 'react';\nimport { createContext, useCallback, useEffect, useMemo, useRef, useState } from 'react';\n\nimport { Coachmark } from '../comps/coachmark/coachmark';\nimport type { TJourneyId } from '../journey-id/journey-id-types';\nimport type { TTrackingId } from '../tracking-id/tracking-id-types';\nimport { useGetUserJourney, usePostUserJourney } from '../user-journey-api/user-journey-api';\nimport type {\n ICoachmarkProps,\n IJourneyContext,\n IJourneyProviderProps,\n TCoachmarkJourneyProps,\n} from './journey-context-types';\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 [isBlockingJourney, setIsBlockingJourney] = useState<boolean>(true);\n const [isJourneyBlurred, setIsJourneyBlurred] = useState<boolean>(false);\n const [userCompletedJourneyIds, setUserCompletedJourneyIds] = useState<TJourneyId[] | null>(null);\n const [coachmarkList, setCoachmarkList] = useState<ICoachmarkProps[]>([]);\n const [isJourneyActive, setIsJourneyActive] = useState(false);\n const currentIndex = useRef(-1);\n const currentJourneyId = useRef<TJourneyId | undefined>(undefined);\n const timerRefs = useRef<ReturnType<typeof setTimeout>[]>([]);\n\n const [isScrollableJourney, setIsScrollableJourney] = useState<boolean>(false);\n const [overlaySize, setOverlaySize] = useState({\n height: window.innerHeight,\n width: window.innerWidth,\n });\n\n const { post: postJourneyCompletion } = usePostUserJourney();\n const { data: userCompletedJourneys = null, get: getJourneyProgress } = useGetUserJourney();\n\n const saveProgress = useCallback(\n (journeyId: TJourneyId | TTrackingId) => {\n postJourneyCompletion({\n app_id: appId,\n user_id: userId,\n journey_id: journeyId,\n journey_status: 'COMPLETED',\n });\n },\n [appId, postJourneyCompletion, userId],\n );\n\n const setJourney = useCallback(\n (\n id: TJourneyId,\n coachmarks: TCoachmarkJourneyProps[],\n scrollableContRef?: RefObject<HTMLDivElement | null>,\n isBlocking: boolean = true,\n ) => {\n if (coachmarkList.length > 0) {\n console.error(\n `setJourney: Other Journey is already active, Current Journey: ${currentJourneyId.current}, New Journey Request: ${id}`,\n );\n\n return;\n }\n setIsJourneyActive(true);\n setIsBlockingJourney(isBlocking);\n currentJourneyId.current = id;\n currentIndex.current = -1;\n setCoachmarkList(\n coachmarks.map((item: TCoachmarkJourneyProps) => {\n return {\n ...item,\n isActive: false, // New coachmarks are inactive by default\n } as ICoachmarkProps;\n }),\n );\n if (scrollableContRef) {\n setOverlaySize({\n height: scrollableContRef.current?.clientHeight || window.innerHeight,\n width: scrollableContRef.current?.clientWidth || window.innerWidth,\n });\n setIsScrollableJourney(true);\n }\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 currentJourneyId.current = undefined;\n currentIndex.current = -1;\n setCoachmarkList([]);\n setIsJourneyActive(false);\n }, []);\n\n const endJourney = useCallback(\n (journeyId: TJourneyId) => {\n clearJourney();\n setUserCompletedJourneyIds(prev => {\n if (prev && !prev.includes(journeyId)) {\n return [...prev, journeyId];\n }\n\n return prev;\n });\n saveProgress(journeyId);\n },\n [clearJourney, saveProgress],\n );\n\n const addCoachmark = useCallback((id: TJourneyId, coachmark: TCoachmarkJourneyProps) => {\n if (!currentJourneyId.current || id !== currentJourneyId.current) {\n console.error(\n currentJourneyId.current\n ? `A Journey is already active, Current Journey: ${currentJourneyId.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 => [\n ...prev,\n {\n ...coachmark,\n isActive: false, // New coachmarks are inactive by default\n } as ICoachmarkProps,\n ]);\n }, []);\n\n const nextCoachmark = useCallback(\n (\n id: TJourneyId,\n keepPrevActive: boolean = false,\n delayInMs: number = 0,\n shouldBlurNextJourney: boolean = false,\n ) => {\n if (!currentJourneyId.current || id !== currentJourneyId.current) {\n console.error(\n currentJourneyId.current\n ? `nextCoachmark was called before setJourney`\n : `A Journey is already active, Current Journey: ${currentJourneyId.current}, New Journey Request: ${id}`,\n );\n\n return;\n }\n\n setIsJourneyBlurred(shouldBlurNextJourney);\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: TCoachmarkJourneyProps) => {\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 clearJourney();\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 [clearJourney],\n );\n\n const trackView = useCallback(\n (viewId: TTrackingId) => {\n saveProgress(viewId);\n },\n [saveProgress],\n );\n\n const memoizedContextValue: IJourneyContext = useMemo(\n () => ({\n nextCoachmark,\n setJourney,\n addCoachmark,\n clearJourney,\n endJourney,\n coachmarks: coachmarkList,\n userCompletedJourneyIds,\n isJourneyActive,\n trackView,\n }),\n [\n nextCoachmark,\n setJourney,\n addCoachmark,\n clearJourney,\n endJourney,\n coachmarkList,\n userCompletedJourneyIds,\n isJourneyActive,\n trackView,\n ],\n );\n\n // Get the initial state of incompleteJourneys\n useEffect(() => {\n if (appId && 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 (userCompletedJourneys) {\n const completedUserJourneysIds = userCompletedJourneys.map(journey => journey.journey_id);\n\n setUserCompletedJourneyIds(completedUserJourneysIds);\n }\n }, [userCompletedJourneys]);\n\n return (\n <JourneyContext.Provider value={memoizedContextValue}>\n {isJourneyActive && (\n <S.Overlay\n about=\"journey-overlay\"\n height={overlaySize.height}\n width={overlaySize.width}\n $isJourneyBlurred={isJourneyBlurred}\n $isBlockingJourney={isBlockingJourney}\n data-testid={currentJourneyId.current}\n >\n {coachmarkList.map((coachmark, index) => (\n <Coachmark\n key={`coachmark-${index}`}\n coachmark={coachmark}\n isInsideScrollView={isScrollableJourney}\n />\n ))}\n </S.Overlay>\n )}\n {children}\n </JourneyContext.Provider>\n );\n};\n"],"names":["JourneyContext","createContext","JourneyProvider","children","appId","userId","isBlockingJourney","setIsBlockingJourney","useState","isJourneyBlurred","setIsJourneyBlurred","userCompletedJourneyIds","setUserCompletedJourneyIds","coachmarkList","setCoachmarkList","isJourneyActive","setIsJourneyActive","currentIndex","useRef","currentJourneyId","timerRefs","isScrollableJourney","setIsScrollableJourney","overlaySize","setOverlaySize","postJourneyCompletion","usePostUserJourney","userCompletedJourneys","getJourneyProgress","useGetUserJourney","saveProgress","useCallback","journeyId","setJourney","id","coachmarks","scrollableContRef","isBlocking","item","_a","_b","clearJourney","timer","endJourney","prev","addCoachmark","coachmark","nextCoachmark","keepPrevActive","delayInMs","shouldBlurNextJourney","prevList","currIndex","updatedCoachmarkList","trackView","viewId","memoizedContextValue","useMemo","useEffect","completedUserJourneysIds","journey","jsxs","jsx","S.Overlay","index","Coachmark"],"mappings":";;;;;AAgBa,MAAAA,IAAiBC,EAAsC,IAAI,GAE3DC,KAA6C,CAAC,EAAE,UAAAC,GAAU,OAAAC,GAAO,QAAAC,QAAa;AACzF,QAAM,CAACC,GAAmBC,CAAoB,IAAIC,EAAkB,EAAI,GAClE,CAACC,GAAkBC,CAAmB,IAAIF,EAAkB,EAAK,GACjE,CAACG,GAAyBC,CAA0B,IAAIJ,EAA8B,IAAI,GAC1F,CAACK,GAAeC,CAAgB,IAAIN,EAA4B,CAAE,CAAA,GAClE,CAACO,GAAiBC,CAAkB,IAAIR,EAAS,EAAK,GACtDS,IAAeC,EAAO,EAAE,GACxBC,IAAmBD,EAA+B,MAAS,GAC3DE,IAAYF,EAAwC,CAAA,CAAE,GAEtD,CAACG,GAAqBC,CAAsB,IAAId,EAAkB,EAAK,GACvE,CAACe,GAAaC,CAAc,IAAIhB,EAAS;AAAA,IAC7C,QAAQ,OAAO;AAAA,IACf,OAAO,OAAO;AAAA,EAAA,CACf,GAEK,EAAE,MAAMiB,EAAsB,IAAIC,EAAmB,GACrD,EAAE,MAAMC,IAAwB,MAAM,KAAKC,EAAA,IAAuBC,KAElEC,IAAeC;AAAA,IAC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BAAoBH;AAAA,QACpB,eAAaa,EAAiB;AAAA,QAE7B,UAAcN,EAAA,IAAI,CAACiC,GAAWkB,MAC7B,gBAAAF;AAAA,UAACG;AAAA,UAAA;AAAA,YAEC,WAAAnB;AAAA,YACA,oBAAoBzB;AAAA,UAAA;AAAA,UAFf,aAAa2C,CAAK;AAAA,QAAA,CAI1B;AAAA,MAAA;AAAA,IACH;AAAA,IAED7D;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 { FC, RefObject } from 'react';\nimport { createContext, useCallback, useEffect, useMemo, useRef, useState } from 'react';\n\nimport { Coachmark } from '../comps/coachmark/coachmark';\nimport type { TJourneyId } from '../journey-id/journey-id-types';\nimport type { TTrackingId } from '../tracking-id/tracking-id-types';\nimport { useGetUserJourney, usePostUserJourney } from '../user-journey-api/user-journey-api';\nimport type {\n ICoachmarkProps,\n IJourneyContext,\n IJourneyProviderProps,\n TCoachmarkJourneyProps,\n} from './journey-context-types';\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 [isBlockingJourney, setIsBlockingJourney] = useState<boolean>(true);\n const [isJourneyBlurred, setIsJourneyBlurred] = useState<boolean>(false);\n const [userCompletedJourneyIds, setUserCompletedJourneyIds] = useState<TJourneyId[] | null>(null);\n const [coachmarkList, setCoachmarkList] = useState<ICoachmarkProps[]>([]);\n const [isJourneyActive, setIsJourneyActive] = useState(false);\n const currentIndex = useRef(-1);\n const currentJourneyId = useRef<TJourneyId | undefined>(undefined);\n const timerRefs = useRef<ReturnType<typeof setTimeout>[]>([]);\n\n const [isScrollableJourney, setIsScrollableJourney] = useState<boolean>(false);\n const [overlaySize, setOverlaySize] = useState({\n height: document.body.clientHeight,\n width: document.body.clientWidth,\n });\n\n const { post: postJourneyCompletion } = usePostUserJourney();\n const { data: userCompletedJourneys = null, get: getJourneyProgress } = useGetUserJourney();\n\n const saveProgress = useCallback(\n (journeyId: TJourneyId | TTrackingId) => {\n postJourneyCompletion({\n app_id: appId,\n user_id: userId,\n journey_id: journeyId,\n journey_status: 'COMPLETED',\n });\n },\n [appId, postJourneyCompletion, userId],\n );\n\n const setJourney = useCallback(\n (\n id: TJourneyId,\n coachmarks: TCoachmarkJourneyProps[],\n scrollableContRef?: RefObject<HTMLDivElement | null>,\n isBlocking: boolean = true,\n ) => {\n if (coachmarkList.length > 0) {\n console.error(\n `setJourney: Other Journey is already active, Current Journey: ${currentJourneyId.current}, New Journey Request: ${id}`,\n );\n\n return;\n }\n setIsJourneyActive(true);\n setIsBlockingJourney(isBlocking);\n currentJourneyId.current = id;\n currentIndex.current = -1;\n setCoachmarkList(\n coachmarks.map((item: TCoachmarkJourneyProps) => {\n return {\n ...item,\n isActive: false, // New coachmarks are inactive by default\n } as ICoachmarkProps;\n }),\n );\n if (scrollableContRef) {\n setOverlaySize({\n height: scrollableContRef.current?.clientHeight || window.innerHeight,\n width: scrollableContRef.current?.clientWidth || window.innerWidth,\n });\n setIsScrollableJourney(true);\n }\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 currentJourneyId.current = undefined;\n currentIndex.current = -1;\n setCoachmarkList([]);\n setIsJourneyActive(false);\n }, []);\n\n const endJourney = useCallback(\n (journeyId: TJourneyId) => {\n clearJourney();\n setUserCompletedJourneyIds(prev => {\n if (prev && !prev.includes(journeyId)) {\n return [...prev, journeyId];\n }\n\n return prev;\n });\n saveProgress(journeyId);\n },\n [clearJourney, saveProgress],\n );\n\n const addCoachmark = useCallback((id: TJourneyId, coachmark: TCoachmarkJourneyProps) => {\n if (!currentJourneyId.current || id !== currentJourneyId.current) {\n console.error(\n currentJourneyId.current\n ? `A Journey is already active, Current Journey: ${currentJourneyId.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 => [\n ...prev,\n {\n ...coachmark,\n isActive: false, // New coachmarks are inactive by default\n } as ICoachmarkProps,\n ]);\n }, []);\n\n const nextCoachmark = useCallback(\n (\n id: TJourneyId,\n keepPrevActive: boolean = false,\n delayInMs: number = 0,\n shouldBlurNextJourney: boolean = false,\n ) => {\n if (!currentJourneyId.current || id !== currentJourneyId.current) {\n console.error(\n currentJourneyId.current\n ? `nextCoachmark was called before setJourney`\n : `A Journey is already active, Current Journey: ${currentJourneyId.current}, New Journey Request: ${id}`,\n );\n\n return;\n }\n\n setIsJourneyBlurred(shouldBlurNextJourney);\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: TCoachmarkJourneyProps) => {\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 clearJourney();\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 [clearJourney],\n );\n\n const trackView = useCallback(\n (viewId: TTrackingId) => {\n saveProgress(viewId);\n },\n [saveProgress],\n );\n\n const memoizedContextValue: IJourneyContext = useMemo(\n () => ({\n nextCoachmark,\n setJourney,\n addCoachmark,\n clearJourney,\n endJourney,\n coachmarks: coachmarkList,\n userCompletedJourneyIds,\n isJourneyActive,\n trackView,\n }),\n [\n nextCoachmark,\n setJourney,\n addCoachmark,\n clearJourney,\n endJourney,\n coachmarkList,\n userCompletedJourneyIds,\n isJourneyActive,\n trackView,\n ],\n );\n\n // Get the initial state of incompleteJourneys\n useEffect(() => {\n if (appId && 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 (userCompletedJourneys) {\n const completedUserJourneysIds = userCompletedJourneys.map(journey => journey.journey_id);\n\n setUserCompletedJourneyIds(completedUserJourneysIds);\n }\n }, [userCompletedJourneys]);\n\n return (\n <JourneyContext.Provider value={memoizedContextValue}>\n {isJourneyActive && (\n <S.Overlay\n about=\"journey-overlay\"\n height={overlaySize.height}\n width={overlaySize.width}\n $isJourneyBlurred={isJourneyBlurred}\n $isBlockingJourney={isBlockingJourney}\n data-testid={currentJourneyId.current}\n >\n {coachmarkList.map((coachmark, index) => (\n <Coachmark\n key={`coachmark-${index}`}\n coachmark={coachmark}\n isInsideScrollView={isScrollableJourney}\n />\n ))}\n </S.Overlay>\n )}\n {children}\n </JourneyContext.Provider>\n );\n};\n"],"names":["JourneyContext","createContext","JourneyProvider","children","appId","userId","isBlockingJourney","setIsBlockingJourney","useState","isJourneyBlurred","setIsJourneyBlurred","userCompletedJourneyIds","setUserCompletedJourneyIds","coachmarkList","setCoachmarkList","isJourneyActive","setIsJourneyActive","currentIndex","useRef","currentJourneyId","timerRefs","isScrollableJourney","setIsScrollableJourney","overlaySize","setOverlaySize","postJourneyCompletion","usePostUserJourney","userCompletedJourneys","getJourneyProgress","useGetUserJourney","saveProgress","useCallback","journeyId","setJourney","id","coachmarks","scrollableContRef","isBlocking","item","_a","_b","clearJourney","timer","endJourney","prev","addCoachmark","coachmark","nextCoachmark","keepPrevActive","delayInMs","shouldBlurNextJourney","prevList","currIndex","updatedCoachmarkList","trackView","viewId","memoizedContextValue","useMemo","useEffect","completedUserJourneysIds","journey","jsxs","js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C;AAAA,IAAA;AAAA,IAEF;AAAA,MACEP;AAAA,MACAd;AAAA,MACAY;AAAA,MACAJ;AAAA,MACAE;AAAA,MACA9B;AAAA,MACAF;AAAA,MACAI;AAAA,MACAuC;AAAA,IACF;AAAA,EAAA;AAIF,SAAAI,EAAU,MAAM;AACd,IAAItD,KAASC,KACXuB,EAAmBvB,GAAQ;AAAA,MACzB,QAAQD;AAAA,MACR,SAASC;AAAA,MACT,gBAAgB;AAAA,IAAA,CACjB;AAAA,EAEF,GAAA,CAACD,GAAOwB,GAAoBvB,CAAM,CAAC,GAGtCqD,EAAU,MAAM;AACd,QAAI/B,GAAuB;AACzB,YAAMgC,IAA2BhC,EAAsB,IAAI,CAAAiC,MAAWA,EAAQ,UAAU;AAExF,MAAAhD,EAA2B+C,CAAwB;AAAA,IACrD;AAAA,EAAA,GACC,CAAChC,CAAqB,CAAC,GAGvB,gBAAAkC,EAAA7D,EAAe,UAAf,EAAwB,OAAOwD,GAC7B,UAAA;AAAA,IACCzC,KAAA,gBAAA+C;AAAA,MAACC;AAAAA,MAAA;AAAA,QACC,OAAM;AAAA,QACN,QAAQxC,EAAY;AAAA,QACpB,OAAOA,EAAY;AAAA,QACnB,mBAAmBd;AAAA,QACnB,oBAAoBH;AAAA,QACpB,eAAaa,EAAiB;AAAA,QAE7B,UAAcN,EAAA,IAAI,CAACiC,GAAWkB,MAC7B,gBAAAF;AAAA,UAACG;AAAA,UAAA;AAAA,YAEC,WAAAnB;AAAA,YACA,oBAAoBzB;AAAA,UAAA;AAAA,UAFf,aAAa2C,CAAK;AAAA,QAAA,CAI1B;AAAA,MAAA;AAAA,IACH;AAAA,IAED7D;AAAA,EACH,EAAA,CAAA;AAEJ;"}
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import { jsxs as m, jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { memo as a } from "react";
|
|
3
|
+
import t from "../../../../ui/layout/flex-view.js";
|
|
4
4
|
import f from "../../../../ui/text/text.js";
|
|
5
5
|
import { ProgressiveLoader as l } from "../../styled-comps/progressive-loader.js";
|
|
6
|
-
const X =
|
|
7
|
-
({ loadStatically: o, headerText: s, config:
|
|
8
|
-
/* @__PURE__ */
|
|
9
|
-
|
|
6
|
+
const X = a(
|
|
7
|
+
({ loadStatically: o, headerText: s, config: $, stepNumberOffset: i, handleTransitionEnd: d }) => /* @__PURE__ */ m(t, { $flexGapX: 1, $flexDirection: "column", children: [
|
|
8
|
+
/* @__PURE__ */ r(l, { $stepNumber: i + 1, $disabled: o, children: /* @__PURE__ */ r(f, { $renderAs: "h6", $marginBottomX: 0.75, children: s }) }),
|
|
9
|
+
$.map(({ point: p, icon: n }, e, c) => /* @__PURE__ */ r(
|
|
10
10
|
l,
|
|
11
11
|
{
|
|
12
|
-
$stepNumber: i + 2 +
|
|
13
|
-
onAnimationEnd:
|
|
12
|
+
$stepNumber: i + 2 + e,
|
|
13
|
+
onAnimationEnd: e === c.length - 1 ? d : () => null,
|
|
14
14
|
$disabled: o,
|
|
15
|
-
children: /* @__PURE__ */ t
|
|
16
|
-
/* @__PURE__ */
|
|
17
|
-
|
|
15
|
+
children: /* @__PURE__ */ m(t, { $flexGapX: 0.5, $flexDirection: "row", $borderRadiusX: 1, $alignItems: "center", children: [
|
|
16
|
+
/* @__PURE__ */ r("img", { alt: `pointer ${e}`, src: n }),
|
|
17
|
+
p
|
|
18
18
|
] })
|
|
19
19
|
},
|
|
20
20
|
n
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"info-points.js","sources":["../../../../../../src/features/milestone/create/comps/info-points/info-points.tsx"],"sourcesContent":["import
|
|
1
|
+
{"version":3,"file":"info-points.js","sources":["../../../../../../src/features/milestone/create/comps/info-points/info-points.tsx"],"sourcesContent":["import { memo, type FC } from 'react';\n\nimport FlexView from '../../../../ui/layout/flex-view';\nimport Text from '../../../../ui/text/text';\nimport { ProgressiveLoader } from '../../styled-comps/progressive-loader';\nimport type { IInfoPointProps } from './info-points-types';\n\nconst InfoPoints: FC<IInfoPointProps> = memo(\n ({ loadStatically, headerText, config, stepNumberOffset, handleTransitionEnd }) => {\n return (\n <FlexView $flexGapX={1} $flexDirection=\"column\">\n <ProgressiveLoader $stepNumber={stepNumberOffset + 1} $disabled={loadStatically}>\n <Text $renderAs=\"h6\" $marginBottomX={0.75}>\n {headerText}\n </Text>\n </ProgressiveLoader>\n {config.map(({ point, icon: iconName }, idx, arr) => (\n <ProgressiveLoader\n $stepNumber={stepNumberOffset + 2 + idx}\n onAnimationEnd={idx === arr.length - 1 ? handleTransitionEnd : () => null}\n $disabled={loadStatically}\n key={iconName}\n >\n <FlexView $flexGapX={0.5} $flexDirection=\"row\" $borderRadiusX={1} $alignItems=\"center\">\n <img alt={`pointer ${idx}`} src={iconName} />\n {point}\n </FlexView>\n </ProgressiveLoader>\n ))}\n </FlexView>\n );\n },\n);\n\nexport default InfoPoints;\n"],"names":["InfoPoints","memo","loadStatically","headerText","config","stepNumberOffset","handleTransitionEnd","jsxs","FlexView","jsx","ProgressiveLoader","Text","point","iconName","idx","arr"],"mappings":";;;;;AAOA,MAAMA,IAAkCC;AAAA,EACtC,CAAC,EAAE,gBAAAC,GAAgB,YAAAC,GAAY,QAAAC,GAAQ,kBAAAC,GAAkB,qBAAAC,QAEpD,gBAAAC,EAAAC,GAAA,EAAS,WAAW,GAAG,gBAAe,UACrC,UAAA;AAAA,IAAA,gBAAAC,EAACC,GAAkB,EAAA,aAAaL,IAAmB,GAAG,WAAWH,GAC/D,UAAC,gBAAAO,EAAAE,GAAA,EAAK,WAAU,MAAK,gBAAgB,MAClC,YACH,CAAA,GACF;AAAA,IACCP,EAAO,IAAI,CAAC,EAAE,OAAAQ,GAAO,MAAMC,EAAY,GAAAC,GAAKC,MAC3C,gBAAAN;AAAA,MAACC;AAAA,MAAA;AAAA,QACC,aAAaL,IAAmB,IAAIS;AAAA,QACpC,gBAAgBA,MAAQC,EAAI,SAAS,IAAIT,IAAsB,MAAM;AAAA,QACrE,WAAWJ;AAAA,QAGX,UAAA,gBAAAK,EAACC,KAAS,WAAW,KAAK,gBAAe,OAAM,gBAAgB,GAAG,aAAY,UAC5E,UAAA;AAAA,UAAA,gBAAAC,EAAC,SAAI,KAAK,WAAWK,CAAG,IAAI,KAAKD,GAAU;AAAA,UAC1CD;AAAA,QAAA,GACH;AAAA,MAAA;AAAA,MALKC;AAAA,IAAA,CAOR;AAAA,EACH,EAAA,CAAA;AAGN;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"submit-modal.js","sources":["../../../../../src/features/milestone/create/submit-modal/submit-modal.tsx"],"sourcesContent":["import { useState } from 'react';\n\nimport type {\n IMilestoneFormData,\n TCourseStream,\n TMilestoneFormFlow,\n} from '../milestone-create-types';\nimport SubmitWithPlanModal from './submit-with-plan-modal/submit-with-plan-modal';\nimport useSubmitMilestone from './use-submit-milestone';\n\ninterface ISubmitModalProps {\n studentName: string;\n studentId: string;\n parentName: string;\n teacherName: string;\n formData: Required<IMilestoneFormData>; //should we make a type like this\n parentId: string;\n onSubmit: () => void;\n onError: () => void;\n isMilestoneEdit?: boolean;\n milestoneId?: string;\n analyticsProps: Record<string, unknown>;\n isWithoutPlan: boolean;\n submitBaseMessage: string;\n flow: TMilestoneFormFlow;\n courseStream: TCourseStream;\n}\n\nconst SubmitModal:
|
|
1
|
+
{"version":3,"file":"submit-modal.js","sources":["../../../../../src/features/milestone/create/submit-modal/submit-modal.tsx"],"sourcesContent":["import { useState, type FC } from 'react';\n\nimport type {\n IMilestoneFormData,\n TCourseStream,\n TMilestoneFormFlow,\n} from '../milestone-create-types';\nimport SubmitWithPlanModal from './submit-with-plan-modal/submit-with-plan-modal';\nimport useSubmitMilestone from './use-submit-milestone';\n\ninterface ISubmitModalProps {\n studentName: string;\n studentId: string;\n parentName: string;\n teacherName: string;\n formData: Required<IMilestoneFormData>; //should we make a type like this\n parentId: string;\n onSubmit: () => void;\n onError: () => void;\n isMilestoneEdit?: boolean;\n milestoneId?: string;\n analyticsProps: Record<string, unknown>;\n isWithoutPlan: boolean;\n submitBaseMessage: string;\n flow: TMilestoneFormFlow;\n courseStream: TCourseStream;\n}\n\nconst SubmitModal: FC<ISubmitModalProps> = ({\n flow,\n isWithoutPlan,\n formData,\n milestoneId = null,\n studentId,\n onSubmit,\n isMilestoneEdit = false,\n analyticsProps,\n courseStream,\n ...props\n}) => {\n const [error, setError] = useState('');\n const { submit: handleMilestoneSubmit, isProcessing } = useSubmitMilestone({\n formData,\n isMilestoneEdit: Boolean(isMilestoneEdit),\n studentId,\n milestoneId,\n onSubmit,\n setError,\n analyticsProps,\n flow,\n courseStream,\n });\n\n return (\n <SubmitWithPlanModal\n error={error}\n flow={flow}\n formData={formData}\n {...props}\n isProcessing={isProcessing}\n onSubmit={handleMilestoneSubmit}\n submitAnalyticsProps={analyticsProps}\n />\n );\n};\n\nexport default SubmitModal;\n"],"names":["SubmitModal","flow","isWithoutPlan","formData","milestoneId","studentId","onSubmit","isMilestoneEdit","analyticsProps","courseStream","props","error","setError","useState","handleMilestoneSubmit","isProcessing","useSubmitMilestone","jsx","SubmitWithPlanModal","SubmitModal$1"],"mappings":";;;;AA4BA,MAAMA,IAAqC,CAAC;AAAA,EAC1C,MAAAC;AAAA,EACA,eAAAC;AAAA,EACA,UAAAC;AAAA,EACA,aAAAC,IAAc;AAAA,EACd,WAAAC;AAAA,EACA,UAAAC;AAAA,EACA,iBAAAC,IAAkB;AAAA,EAClB,gBAAAC;AAAA,EACA,cAAAC;AAAA,EACA,GAAGC;AACL,MAAM;AACJ,QAAM,CAACC,GAAOC,CAAQ,IAAIC,EAAS,EAAE,GAC/B,EAAE,QAAQC,GAAuB,cAAAC,EAAA,IAAiBC,EAAmB;AAAA,IACzE,UAAAb;AAAA,IACA,iBAAiB,EAAQI;AAAA,IACzB,WAAAF;AAAA,IACA,aAAAD;AAAA,IACA,UAAAE;AAAA,IACA,UAAAM;AAAA,IACA,gBAAAJ;AAAA,IACA,MAAAP;AAAA,IACA,cAAAQ;AAAA,EAAA,CACD;AAGC,SAAA,gBAAAQ;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,OAAAP;AAAA,MACA,MAAAV;AAAA,MACA,UAAAE;AAAA,MACC,GAAGO;AAAA,MACJ,cAAAK;AAAA,MACA,UAAUD;AAAA,MACV,sBAAsBN;AAAA,IAAA;AAAA,EAAA;AAG5B,GAEAW,IAAenB;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"submit-with-plan-modal.js","sources":["../../../../../../src/features/milestone/create/submit-modal/submit-with-plan-modal/submit-with-plan-modal.tsx"],"sourcesContent":["import { useCallback, useState } from 'react';\n\nimport Button from '../../../../ui/buttons/button/button';\nimport FlexView from '../../../../ui/layout/flex-view';\nimport Text from '../../../../ui/text/text';\nimport type { IMilestoneFormData, TMilestoneFormFlow } from '../../milestone-create-types';\nimport * as Styled from './submit-with-plan-modal-styled';\nimport { createPlanApprovalMessage } from './submit-with-plan-modal-util';\n\ninterface ISubmitWithPlanModalProps {\n studentName: string;\n parentName: string;\n teacherName: string;\n formData: Required<IMilestoneFormData>; //should we make a type like this\n parentId: string;\n onSubmit: (message: string) => void;\n onError: () => void;\n isMilestoneEdit?: boolean;\n milestoneId?: string;\n error: string;\n isProcessing: boolean;\n submitAnalyticsProps?: Record<string, unknown>;\n submitBaseMessage: string;\n flow: TMilestoneFormFlow;\n}\n\nconst SubmitWithPlanModal:
|
|
1
|
+
{"version":3,"file":"submit-with-plan-modal.js","sources":["../../../../../../src/features/milestone/create/submit-modal/submit-with-plan-modal/submit-with-plan-modal.tsx"],"sourcesContent":["import { useCallback, useState, type FC } from 'react';\n\nimport Button from '../../../../ui/buttons/button/button';\nimport FlexView from '../../../../ui/layout/flex-view';\nimport Text from '../../../../ui/text/text';\nimport type { IMilestoneFormData, TMilestoneFormFlow } from '../../milestone-create-types';\nimport * as Styled from './submit-with-plan-modal-styled';\nimport { createPlanApprovalMessage } from './submit-with-plan-modal-util';\n\ninterface ISubmitWithPlanModalProps {\n studentName: string;\n parentName: string;\n teacherName: string;\n formData: Required<IMilestoneFormData>; //should we make a type like this\n parentId: string;\n onSubmit: (message: string) => void;\n onError: () => void;\n isMilestoneEdit?: boolean;\n milestoneId?: string;\n error: string;\n isProcessing: boolean;\n submitAnalyticsProps?: Record<string, unknown>;\n submitBaseMessage: string;\n flow: TMilestoneFormFlow;\n}\n\nconst SubmitWithPlanModal: FC<ISubmitWithPlanModalProps> = ({\n studentName,\n parentName,\n teacherName,\n formData,\n onSubmit: handleSubmit,\n error,\n isProcessing,\n submitAnalyticsProps,\n submitBaseMessage,\n flow,\n}) => {\n const [message, setMessage] = useState(() => {\n const { milestoneEndDate, testName, testType, grade } = formData;\n\n return createPlanApprovalMessage(submitBaseMessage, {\n parentName,\n teacherName,\n studentName,\n testName,\n testDate: milestoneEndDate,\n testType,\n grade,\n });\n });\n\n const isEditFlow = flow === 'EDIT';\n\n const handleSubmitClick = useCallback(() => {\n handleSubmit(isEditFlow ? '' : message);\n }, [handleSubmit, isEditFlow, message]);\n\n return (\n <>\n <FlexView $gapX={1} $gutterX={1}>\n <Text $renderAs=\"h4\" $marginBottomX={0.75}>\n Share learning plan with parent\n </Text>\n\n <Text $renderAs=\"body2\" color=\"BLACK_75\" $marginBottomX={0.75}>\n Edit the message if needed, before you share it with the parent.\n </Text>\n\n <Text $renderAs=\"body1Medium\" $marginBottomX={0.75}>\n {parentName}{' '}\n <Text $renderAs=\"body2\" $inline>\n ({studentName}'s parent)\n </Text>\n </Text>\n\n <Styled.StyledTextArea onChange={e => setMessage(e.target.value)} value={message} />\n </FlexView>\n\n <Styled.BottomWrapper $alignItems=\"center\">\n <Text color=\"BLACK_75\" $renderAs=\"body3\" $align=\"center\" $widthX={26} $marginBottomX={1}>\n ℹ️ On tapping, the plan will be saved, & the parent will be updated via Email, WhatsApp &\n CueChat (if installed)\n </Text>\n\n {error && (\n <Text $renderAs=\"body2\" $color=\"RED\" $align=\"center\" $widthX={26} $marginBottomX={1}>\n {error}\n </Text>\n )}\n\n <FlexView $flexDirection=\"row\" $alignItems=\"center\" $flexGap={12}>\n {isEditFlow && (\n <Button\n renderAs=\"secondary\"\n size=\"small\"\n widthX={13.5}\n label=\"Submit without share\"\n onClick={handleSubmitClick}\n busy={isProcessing}\n analyticsProps={submitAnalyticsProps}\n />\n )}\n\n <Button\n renderAs=\"primary\"\n size=\"small\"\n widthX={13.5}\n label=\"Submit & share\"\n onClick={handleSubmitClick}\n busy={isProcessing}\n disabled={message === ''}\n analyticsProps={submitAnalyticsProps}\n />\n </FlexView>\n </Styled.BottomWrapper>\n </>\n );\n};\n\nexport default SubmitWithPlanModal;\n"],"names":["SubmitWithPlanModal","studentName","parentName","teacherName","formData","handleSubmit","error","isProcessing","submitAnalyticsProps","submitBaseMessage","flow","message","setMessage","useState","milestoneEndDate","testName","testType","grade","createPlanApprovalMessage","isEditFlow","handleSubmitClick","useCallback","jsxs","Fragment","FlexView","jsx","Text","Styled.StyledTextArea","e","Styled.BottomWrapper","Button"],"mappings":";;;;;;;AA0BA,MAAMA,IAAqD,CAAC;AAAA,EAC1D,aAAAC;AAAA,EACA,YAAAC;AAAA,EACA,aAAAC;AAAA,EACA,UAAAC;AAAA,EACA,UAAUC;AAAA,EACV,OAAAC;AAAA,EACA,cAAAC;AAAA,EACA,sBAAAC;AAAA,EACA,mBAAAC;AAAA,EACA,MAAAC;AACF,MAAM;AACJ,QAAM,CAACC,GAASC,CAAU,IAAIC,EAAS,MAAM;AAC3C,UAAM,EAAE,kBAAAC,GAAkB,UAAAC,GAAU,UAAAC,GAAU,OAAAC,MAAUb;AAExD,WAAOc,EAA0BT,GAAmB;AAAA,MAClD,YAAAP;AAAA,MACA,aAAAC;AAAA,MACA,aAAAF;AAAA,MACA,UAAAc;AAAA,MACA,UAAUD;AAAA,MACV,UAAAE;AAAA,MACA,OAAAC;AAAA,IAAA,CACD;AAAA,EAAA,CACF,GAEKE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AAAA,YACC,UAAS;AAAA,YACT,MAAK;AAAA,YACL,QAAQ;AAAA,YACR,OAAM;AAAA,YACN,SAASV;AAAA,YACT,MAAMb;AAAA,YACN,gBAAgBC;AAAA,UAAA;AAAA,QAClB;AAAA,QAGF,gBAAAiB;AAAA,UAACK;AAAA,UAAA;AAAA,YACC,UAAS;AAAA,YACT,MAAK;AAAA,YACL,QAAQ;AAAA,YACR,OAAM;AAAA,YACN,SAASV;AAAA,YACT,MAAMb;AAAA,YACN,UAAUI,MAAY;AAAA,YACtB,gBAAgBH;AAAA,UAAA;AAAA,QAClB;AAAA,MAAA,GACF;AAAA,IAAA,GACF;AAAA,EACF,EAAA,CAAA;AAEJ;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"outcome-rank.js","sources":["../../../../../../../src/features/milestone/milestone-list-container/milestone-list/milestone-widget/outcome/outcome-rank.tsx"],"sourcesContent":["import
|
|
1
|
+
{"version":3,"file":"outcome-rank.js","sources":["../../../../../../../src/features/milestone/milestone-list-container/milestone-list/milestone-widget/outcome/outcome-rank.tsx"],"sourcesContent":["import { memo, type FC } from 'react';\n\nimport { convertToTitleCase } from '../../../../../../helpers/label-text';\nimport FlexView from '../../../../../ui/layout/flex-view';\nimport Separator from '../../../../../ui/separator/separator';\nimport Text from '../../../../../ui/text/text';\n\nconst Ranks: FC<{\n value: Record<string, string>;\n}> = memo(({ value }) => {\n const valuesList = Object.entries(value);\n\n return (\n <>\n {valuesList.map(([level, rank], idx) => {\n const isLastItem = idx === valuesList.length - 1;\n const rankInfo = isLastItem ? rank : `${rank}, `;\n\n return (\n <FlexView\n key={`outcome_ranks_${level}_${idx}`}\n $flexDirection=\"row\"\n $alignItems=\"center\"\n $flexGap={4}\n >\n <Text $renderAs=\"ab2\">{convertToTitleCase(level)} :</Text>\n <Text $renderAs=\"ab1-bold\">{rankInfo}</Text>\n <Separator width={1} />\n </FlexView>\n );\n })}\n </>\n );\n});\n\nexport default Ranks;\n"],"names":["Ranks","memo","value","valuesList","jsx","Fragment","level","rank","idx","rankInfo","jsxs","FlexView","Text","convertToTitleCase","Separator"],"mappings":";;;;;;AAOA,MAAMA,IAEDC,EAAK,CAAC,EAAE,OAAAC,QAAY;AACjB,QAAAC,IAAa,OAAO,QAAQD,CAAK;AAGrC,SAAA,gBAAAE,EAAAC,GAAA,EACG,YAAW,IAAI,CAAC,CAACC,GAAOC,CAAI,GAAGC,MAAQ;AAEtC,UAAMC,IADaD,MAAQL,EAAW,SAAS,IACjBI,IAAO,GAAGA,CAAI;AAG1C,WAAA,gBAAAG;AAAA,MAACC;AAAA,MAAA;AAAA,QAEC,gBAAe;AAAA,QACf,aAAY;AAAA,QACZ,UAAU;AAAA,QAEV,UAAA;AAAA,UAAC,gBAAAD,EAAAE,GAAA,EAAK,WAAU,OAAO,UAAA;AAAA,YAAAC,EAAmBP,CAAK;AAAA,YAAE;AAAA,UAAA,GAAE;AAAA,UAClD,gBAAAF,EAAAQ,GAAA,EAAK,WAAU,YAAY,UAASH,GAAA;AAAA,UACrC,gBAAAL,EAACU,GAAU,EAAA,OAAO,EAAG,CAAA;AAAA,QAAA;AAAA,MAAA;AAAA,MAPhB,iBAAiBR,CAAK,IAAIE,CAAG;AAAA,IAAA;AAAA,EAUvC,CAAA,EACH,CAAA;AAEJ,CAAC;"}
|
|
@@ -1,10 +1,6 @@
|
|
|
1
1
|
import { jsxs as n, Fragment as $, jsx as e } from "react/jsx-runtime";
|
|
2
2
|
import m from "../../../../ui/text/text.js";
|
|
3
|
-
const a = ({
|
|
4
|
-
index: r,
|
|
5
|
-
question: o,
|
|
6
|
-
description: t
|
|
7
|
-
}) => /* @__PURE__ */ n($, { children: [
|
|
3
|
+
const a = ({ index: r, question: o, description: t }) => /* @__PURE__ */ n($, { children: [
|
|
8
4
|
/* @__PURE__ */ e(m, { $renderAs: "body1", $marginBottomX: 0.5, children: r ? `${r}. ${o}` : o }),
|
|
9
5
|
t && /* @__PURE__ */ e(m, { $renderAs: "body2", $color: "BLACK_75", $marginBottomX: 0.5, children: t })
|
|
10
6
|
] });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"input-descriptor.js","sources":["../../../../../../src/features/milestone/outcome/comps/outcome-collection/input-descriptor.tsx"],"sourcesContent":["import
|
|
1
|
+
{"version":3,"file":"input-descriptor.js","sources":["../../../../../../src/features/milestone/outcome/comps/outcome-collection/input-descriptor.tsx"],"sourcesContent":["import { type FC } from 'react';\n\nimport Text from '../../../../ui/text/text';\n\ntype RenderInputDescriptionProps = {\n index: number | null;\n question: string;\n description?: string | null;\n};\n\nconst InputDescription: FC<RenderInputDescriptionProps> = ({ index, question, description }) => {\n return (\n <>\n <Text $renderAs=\"body1\" $marginBottomX={0.5}>\n {index ? `${index}. ${question}` : question}\n </Text>\n {description && (\n <Text $renderAs=\"body2\" $color=\"BLACK_75\" $marginBottomX={0.5}>\n {description}\n </Text>\n )}\n </>\n );\n};\n\nexport default InputDescription;\n"],"names":["InputDescription","index","question","description","jsxs","Fragment","jsx","Text"],"mappings":";;AAUA,MAAMA,IAAoD,CAAC,EAAE,OAAAC,GAAO,UAAAC,GAAU,aAAAC,QAGxE,gBAAAC,EAAAC,GAAA,EAAA,UAAA;AAAA,EAAC,gBAAAC,EAAAC,GAAA,EAAK,WAAU,SAAQ,gBAAgB,KACrC,UAAQN,IAAA,GAAGA,CAAK,KAAKC,CAAQ,KAAKA,GACrC;AAAA,EACCC,uBACEI,GAAK,EAAA,WAAU,SAAQ,QAAO,YAAW,gBAAgB,KACvD,UACHJ,EAAA,CAAA;AAEJ,EAAA,CAAA;"}
|