@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
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"game-launcher-v2.js","sources":["../../../../src/features/circle-games/game-launcher-v2/game-launcher-v2.tsx"],"sourcesContent":["import type { FC } from 'react';\nimport React, { memo, useCallback, useEffect, useMemo, useRef } from 'react';\n\nimport { ILLUSTRATIONS } from '../../../assets/illustrations/illustrations';\nimport { LOTTIE } from '../../../assets/lottie/lottie';\nimport { JOURNEY_ID_STUDENT } from '../../journey/journey-id/journey-id-student';\nimport { useJourney } from '../../journey/use-journey/use-journey';\nimport { CircularLoader } from '../../ui/loader/circular-loader/circular-loader';\nimport LottieAnimation from '../../ui/lottie-animation/lottie-animation';\nimport { ProjectType } from '../games/web-view/enums';\nimport { useCircleSounds } from '../hooks/use-circle-sounds/use-circle-sounds';\nimport { CircleSoundKey } from '../hooks/use-circle-sounds/use-circle-sounds-enums';\nimport { GAME_LAUNCHER_SIZE } from './comps/card-container/constants';\nimport { BadgesGroup } from './comps/carousel-badge/carousel-badge';\nimport { Carousel } from './comps/carousel/carousel';\nimport type { ICarouselItemWithMeta, ICarouselRefs } from './comps/carousel/carousel-types';\nimport { CircularGameCard } from './comps/circular-game-card/circular-game-card';\nimport {\n type ICircularGameCardProps,\n type ICircularGameCardRefs,\n} from './comps/circular-game-card/circular-game-card-types';\nimport { GAME_LAUNCHER_ASSET_PADDING } from './comps/circular-game-card/constants';\nimport { TablesCard } from './comps/tables-card/tables-card';\nimport type { ITableCardRef, ITableDetails } from './comps/tables-card/tables-card-types';\nimport type {\n Game,\n Lesson,\n Puzzle,\n} from './dal/use-get-circle-home-details-dal/use-get-circle-home-dal-types';\nimport { GAME_LAUNCHER_ANALYTICS_EVENTS } from './game-launcher-analytics-events';\nimport type { IGameLauncherProps } from './game-launcher-types';\nimport { formatDuration } from './helpers';\nimport { useGameLauncherJourney } from './hooks/use-game-launcher-journey/use-game-launcher-journey';\nimport { useTableInfiniteLauncherJourney } from './hooks/use-table-infinite-launcher-journey/use-table-infinite-launcher-journey';\nimport { useTableLauncherJourney } from './hooks/use-table-launcher-journey/use-table-launcher-journey';\n\nconst sleepyBoiDimension = GAME_LAUNCHER_SIZE + GAME_LAUNCHER_ASSET_PADDING;\n\nexport const GameLauncherV2: FC<IGameLauncherProps> = memo(\n ({\n journeyId,\n onSegmentClick,\n data,\n isLoading,\n isTutorialOnboardingDone,\n defaultIndex = 0,\n onJourneyComplete,\n }) => {\n const carouselRefs = useRef<ICarouselRefs>(null!);\n const tableRef = useRef<ITableCardRef>(null!);\n const { isJourneyActive } = useJourney();\n\n const { play } = useCircleSounds();\n\n const handleLessonSegmentClick = useCallback(\n (lesson: Lesson) => {\n play(CircleSoundKey.GAME_CARD_CLICK);\n onSegmentClick(lesson, ProjectType.LESSON);\n },\n [onSegmentClick, play],\n );\n\n const onTableSegmentClick = useCallback(\n (table: ITableDetails) => {\n play(CircleSoundKey.GAME_CARD_CLICK);\n onSegmentClick(table, ProjectType.TABLE);\n },\n [onSegmentClick, play],\n );\n\n const handleGameSegmentClick = useCallback(\n (game: Game) => {\n play(CircleSoundKey.GAME_CARD_CLICK);\n onSegmentClick(game, ProjectType.GAME);\n },\n [onSegmentClick, play],\n );\n\n const handlePuzzleSegmentClick = useCallback(\n (puzzle: Puzzle) => {\n play(CircleSoundKey.GAME_CARD_CLICK);\n onSegmentClick(puzzle, ProjectType.PUZZLE);\n },\n [onSegmentClick, play],\n );\n\n const onTableInfiniteModeClick = useCallback(() => {\n play(CircleSoundKey.GAME_CARD_CLICK);\n onSegmentClick({ mode: 'infinite' } as ITableDetails, ProjectType.TABLE);\n }, [onSegmentClick, play]);\n\n const {\n firstCardRefs,\n secondCardRefs,\n startJourney: startLessonPuzzleGamesJourney,\n } = useGameLauncherJourney({\n carouselRefs,\n onSegmentClick,\n onJourneyComplete,\n });\n\n const { startJourney: startInfiniteTablesJourney } = useTableInfiniteLauncherJourney({\n carouselRefs,\n onTableInfiniteModeClick,\n onJourneyComplete,\n originalTableRef: tableRef,\n });\n\n const { startJourney: startTablesJourney } = useTableLauncherJourney({\n carouselRefs,\n originalTableRef: tableRef,\n onTableSegmentClick,\n onJourneyComplete,\n onNextJourney: startInfiniteTablesJourney,\n });\n\n const items = useMemo<ICarouselItemWithMeta[]>(() => {\n const mergedItems: ICarouselItemWithMeta[] = [];\n\n if (!data) return mergedItems;\n\n let itemCount = 0;\n\n const assignRefIfFirstOrSecond = (\n element: React.ReactElement<\n ICircularGameCardProps & React.RefAttributes<ICircularGameCardRefs>\n >,\n ): React.ReactElement => {\n let refToAssign: React.Ref<ICircularGameCardRefs> | null = null;\n\n if (itemCount === 0) {\n refToAssign = firstCardRefs;\n } else if (itemCount === 1) {\n refToAssign = secondCardRefs;\n }\n\n itemCount++;\n\n return refToAssign ? React.cloneElement(element, { ref: refToAssign }) : element;\n };\n\n // Games\n if (data.games) {\n const label = data.games.label;\n\n data.games.data.forEach((game, index) => {\n mergedItems.push({\n ...(game.isPlayed && {\n isCompleted: true,\n carouselBadge: (\n <BadgesGroup\n badges={[\n {\n label: 'Won',\n color: 'YELLOW_4',\n illustration: ILLUSTRATIONS.UP_ARROW_BADGE,\n value: game.wonToday,\n },\n {\n label: 'Loss',\n color: 'ORANGE_4',\n illustration: ILLUSTRATIONS.DOWN_ARROW_BADGE,\n value: game.lostToday,\n },\n ]}\n />\n ),\n }),\n element: assignRefIfFirstOrSecond(\n <CircularGameCard\n key={`game-${index}`}\n data={{\n card: game.cardLottie,\n name: game.name,\n isCompleted: false,\n displayNameImage: game.displayNameImage,\n onPress: () => handleGameSegmentClick(game),\n }}\n label={label}\n value={game.isPlayed ? 1 : 0}\n maxValue={1}\n />,\n ),\n });\n });\n }\n\n // Puzzles\n if (data.puzzles) {\n const label = data.puzzles.label;\n\n data.puzzles.data.forEach((puzzle, index) => {\n const isCompleted = puzzle.solved;\n\n mergedItems.push({\n ...(isCompleted && {\n isCompleted,\n carouselBadge: (\n <BadgesGroup\n badges={[\n {\n label: '',\n color: 'YELLOW_4',\n illustration: ILLUSTRATIONS.STAR_BADGE,\n value: puzzle.firstAttempt.solvedWithHint ? 'Solved with hint' : 'Solved',\n },\n {\n label: '',\n color: 'YELLOW_4',\n illustration: ILLUSTRATIONS.POINTS_BADGE,\n value: puzzle.firstAttempt.pointsScored,\n },\n ]}\n />\n ),\n }),\n element: assignRefIfFirstOrSecond(\n <CircularGameCard\n key={`puzzle-${index}`}\n data={{\n card: puzzle.cardLottie,\n name: puzzle.name,\n isCompleted,\n displayNameImage: puzzle.displayNameImage,\n onPress: () => handlePuzzleSegmentClick(puzzle),\n }}\n label={label}\n value={isCompleted ? 1 : 0}\n maxValue={1}\n />,\n ),\n });\n });\n }\n\n // Lessons\n if (data.lessons) {\n const label = data.lessons.label;\n\n data.lessons.data.forEach((lesson, index) => {\n const isCompleted = lesson.status === 'completed';\n\n mergedItems.push({\n ...(isCompleted && {\n isCompleted,\n carouselBadge: (\n <BadgesGroup\n badges={[\n {\n label: '%',\n color: 'YELLOW_4',\n illustration: ILLUSTRATIONS.ACCURACY_BADGE,\n value: lesson.firstAttempt.accuracy * 100,\n },\n {\n label: '',\n color: 'YELLOW_4',\n illustration: ILLUSTRATIONS.CLOCK_BADGE,\n value: formatDuration(lesson.firstAttempt.grossTimeTaken),\n },\n {\n label: '',\n color: 'YELLOW_4',\n illustration: ILLUSTRATIONS.POINTS_BADGE,\n value: lesson.firstAttempt.pointsScored,\n },\n ]}\n />\n ),\n }),\n element: assignRefIfFirstOrSecond(\n <CircularGameCard\n key={`lesson-${index}`}\n data={{\n card: lesson.cardLottie,\n name: lesson.name,\n isCompleted,\n displayNameImage: lesson.displayNameImage,\n onPress: () => handleLessonSegmentClick(lesson),\n }}\n label={label}\n value={isCompleted ? 1 : 0}\n maxValue={1}\n />,\n ),\n });\n });\n }\n\n // Tables (keep its own ref)\n if (data.tables) {\n mergedItems.push({\n isCompleted: false,\n element: (\n <TablesCard\n key=\"tables-card\"\n ref={tableRef}\n label={data.tables.label}\n data={data.tables.data}\n onPress={onTableSegmentClick}\n openModesOfTable={data.tables.openModesOfTable}\n />\n ),\n });\n }\n\n return mergedItems;\n }, [\n data,\n handleGameSegmentClick,\n handleLessonSegmentClick,\n handlePuzzleSegmentClick,\n onTableSegmentClick,\n firstCardRefs,\n secondCardRefs,\n tableRef,\n ]);\n\n const sleepyBoiItem = useMemo(\n () => [\n <LottieAnimation\n src={LOTTIE.SLEEPY_BOI}\n width={sleepyBoiDimension}\n height={sleepyBoiDimension}\n />,\n ],\n [],\n );\n\n useEffect(() => {\n if (isLoading || !data || isJourneyActive) {\n return;\n }\n\n if (\n data?.lessons &&\n (journeyId === JOURNEY_ID_STUDENT.CIRCLE_ACTIVITIES_INTRO_JOURNEY_V2 ||\n journeyId === JOURNEY_ID_STUDENT.CIRCLE_LESSONS_K_1_INTRO_JOURNEY_V2)\n ) {\n startLessonPuzzleGamesJourney(journeyId, data);\n\n return;\n }\n\n if (data?.tables && journeyId === JOURNEY_ID_STUDENT.CIRCLE_TABLES_INTRO_JOURNEY) {\n startTablesJourney(data?.tables);\n\n return;\n }\n\n if (data?.tables && journeyId === JOURNEY_ID_STUDENT.CIRCLE_TABLES_INFINTE_JOURNEY) {\n startInfiniteTablesJourney();\n\n return;\n }\n }, [\n data,\n isJourneyActive,\n isLoading,\n isTutorialOnboardingDone,\n journeyId,\n startInfiniteTablesJourney,\n startLessonPuzzleGamesJourney,\n startTablesJourney,\n ]);\n\n if (isLoading) return <CircularLoader />;\n\n if (!data) {\n return (\n <Carousel\n items={[{ element: sleepyBoiItem }]}\n analyticsSwipeLeft={{ analyticsLabel: '' }}\n analyticsSwipeRight={{ analyticsLabel: '' }}\n analyticsCardClick={{ analyticsLabel: '' }}\n />\n );\n }\n\n return (\n <Carousel\n ref={carouselRefs}\n items={items}\n defaultIndex={defaultIndex}\n analyticsSwipeLeft={{\n analyticsLabel: GAME_LAUNCHER_ANALYTICS_EVENTS.SWIPE_LEFT,\n }}\n analyticsSwipeRight={{\n analyticsLabel: GAME_LAUNCHER_ANALYTICS_EVENTS.SWIPE_RIGHT,\n }}\n analyticsCardClick={{\n analyticsLabel: GAME_LAUNCHER_ANALYTICS_EVENTS.CARD_SELECTION,\n }}\n />\n );\n },\n);\n"],"names":["sleepyBoiDimension","GAME_LAUNCHER_SIZE","GAME_LAUNCHER_ASSET_PADDING","GameLauncherV2","memo","journeyId","onSegmentClick","data","isLoading","isTutorialOnboardingDone","defaultIndex","onJourneyComplete","carouselRefs","useRef","tableRef","isJourneyActive","useJourney","play","useCircleSounds","handleLessonSegmentClick","useCallback","lesson","CircleSoundKey","ProjectType","onTableSegmentClick","table","handleGameSegmentClick","game","handlePuzzleSegmentClick","puzzle","onTableInfiniteModeClick","firstCardRefs","secondCardRefs","startLessonPuzzleGamesJourney","useGameLauncherJourney","startInfiniteTablesJourney","useTableInfiniteLauncherJourney","startTablesJourney","useTableLauncherJourney","items","useMemo","mergedItems","itemCount","assignRefIfFirstOrSecond","element","refToAssign","React","label","index","jsx","BadgesGroup","ILLUSTRATIONS","CircularGameCard","isCompleted","formatDuration","TablesCard","sleepyBoiItem","LottieAnimation","LOTTIE","useEffect","JOURNEY_ID_STUDENT","CircularLoader","Carousel","GAME_LAUNCHER_ANALYTICS_EVENTS"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAoCA,MAAMA,IAAqBC,IAAqBC,GAEnCC,KAAyCC;AAAA,EACpD,CAAC;AAAA,IACC,WAAAC;AAAA,IACA,gBAAAC;AAAA,IACA,MAAAC;AAAA,IACA,WAAAC;AAAA,IACA,0BAAAC;AAAA,IACA,cAAAC,IAAe;AAAA,IACf,mBAAAC;AAAA,EAAA,MACI;AACE,UAAAC,IAAeC,EAAsB,IAAK,GAC1CC,IAAWD,EAAsB,IAAK,GACtC,EAAE,iBAAAE,MAAoBC,KAEtB,EAAE,MAAAC,MAASC,KAEXC,IAA2BC;AAAA,MAC/B,CAACC,MAAmB;AAClB,QAAAJ,EAAKK,EAAe,eAAe,GACpBhB,EAAAe,GAAQE,EAAY,MAAM;AAAA,MAC3C;AAAA,MACA,CAACjB,GAAgBW,CAAI;AAAA,IAAA,GAGjBO,IAAsBJ;AAAA,MAC1B,CAACK,MAAyB;AACxB,QAAAR,EAAKK,EAAe,eAAe,GACpBhB,EAAAmB,GAAOF,EAAY,KAAK;AAAA,MACzC;AAAA,MACA,CAACjB,GAAgBW,CAAI;AAAA,IAAA,GAGjBS,IAAyBN;AAAA,MAC7B,CAACO,MAAe;AACd,QAAAV,EAAKK,EAAe,eAAe,GACpBhB,EAAAqB,GAAMJ,EAAY,IAAI;AAAA,MACvC;AAAA,MACA,CAACjB,GAAgBW,CAAI;AAAA,IAAA,GAGjBW,IAA2BR;AAA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"],"sourcesContent":["export function formatDuration(ms: number): string {\n const totalSeconds = Math.floor(ms / 1000);\n const minutes = Math.floor(totalSeconds / 60);\n const seconds = totalSeconds % 60;\n\n const minPart = minutes > 0 ? `${minutes}m ` : '';\n const secPart = `${seconds}s`;\n\n return `${minPart}${secPart}`.trim();\n}\n"],"names":["formatDuration","ms","totalSeconds","minutes","seconds","minPart","secPart"],"mappings":"AAAO,SAASA,EAAeC,GAAoB;AACjD,QAAMC,IAAe,KAAK,MAAMD,IAAK,GAAI,GACnCE,IAAU,KAAK,MAAMD,IAAe,EAAE,GACtCE,IAAUF,IAAe,IAEzBG,IAAUF,IAAU,IAAI,GAAGA,CAAO,OAAO,IACzCG,IAAU,GAAGF,CAAO;AAE1B,SAAO,GAAGC,CAAO,GAAGC,CAAO,GAAG,KAAK;AACrC;"}
|
package/dist/features/circle-games/game-launcher-v2/hooks/use-game-launcher-journey/constants.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.js","sources":["../../../../../../src/features/circle-games/game-launcher-v2/hooks/use-game-launcher-journey/constants.ts"],"sourcesContent":["export const SLIDE_TO_LESSON_MS = 500;\n\nexport const GO_TO_NEXT_SLIDE_AFTER_MS = 500;\nexport const SHOW_LABEL_HIGHLIGHT_AFTER_MS = 1500;\nexport const SHOW_NUDGE_AFTER_MS = 2000;\nexport const FIRST_COACHMARK_AFTER_MS = 200;\n"],"names":["SLIDE_TO_LESSON_MS","SHOW_NUDGE_AFTER_MS"],"mappings":"AAAO,MAAMA,IAAqB,KAIrBC,IAAsB;"}
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
import { jsx as n } from "react/jsx-runtime";
|
|
2
|
+
import { useRef as A, useCallback as I, useMemo as q, useEffect as Q } from "react";
|
|
3
|
+
import { useTheme as D } from "styled-components";
|
|
4
|
+
import { PLATFORM_EVENTS_STUDENT as F } from "../../../../analytics-events/platform-events-student.js";
|
|
5
|
+
import { CarouselItem as j } from "../../comps/carousel/carousel-styled.js";
|
|
6
|
+
import { IndicatorType as N } from "../../../../journey/use-journey/constants.js";
|
|
7
|
+
import { useJourney as ee } from "../../../../journey/use-journey/use-journey.js";
|
|
8
|
+
import { useUIContext as re } from "../../../../ui/context/context.js";
|
|
9
|
+
import S from "../../../../ui/text/text.js";
|
|
10
|
+
import { EDeviceType as ne } from "../../../../ui/theme/constants.js";
|
|
11
|
+
import { CIRCLE_ONBOARDING_ANALYTICS_STEPS as _ } from "../../../enum/circle-onboarding-steps.js";
|
|
12
|
+
import { CircularGameCard as ie } from "../../comps/circular-game-card/circular-game-card.js";
|
|
13
|
+
import te from "../../comps/swipable-card/swipeable-card.js";
|
|
14
|
+
import { SHOW_NUDGE_AFTER_MS as L, SLIDE_TO_LESSON_MS as oe } from "./constants.js";
|
|
15
|
+
import { ProjectType as J } from "../../../games/web-view/enums/project-type-enum.js";
|
|
16
|
+
const _e = ({
|
|
17
|
+
carouselRefs: i,
|
|
18
|
+
onSegmentClick: m,
|
|
19
|
+
onJourneyComplete: d
|
|
20
|
+
}) => {
|
|
21
|
+
const { device: Z } = D(), t = Z <= ne.TABLET, s = A([]), T = A(null), l = A(null), { nextCoachmark: h, setJourney: P, endJourney: f } = ee(), { onEvent: a } = re(), g = I(
|
|
22
|
+
(r) => {
|
|
23
|
+
a(F.ONBOARDING_STEP_COMPLETED, {
|
|
24
|
+
step: r
|
|
25
|
+
});
|
|
26
|
+
},
|
|
27
|
+
[a]
|
|
28
|
+
), R = I(
|
|
29
|
+
(r, e) => {
|
|
30
|
+
m(r, J.PUZZLE), g(_.PUZZLE_ACTIVITY), f(e), d(e);
|
|
31
|
+
},
|
|
32
|
+
[f, d, m, g]
|
|
33
|
+
), b = I(
|
|
34
|
+
(r, e) => {
|
|
35
|
+
m(r, J.LESSON), g(_.SKILL_ACTIVITY), f(e), d(e);
|
|
36
|
+
},
|
|
37
|
+
[f, d, m, g]
|
|
38
|
+
), O = I(
|
|
39
|
+
(r, e) => {
|
|
40
|
+
var y, H, W, z, G, x, v, w, U, Y, k, B, M, V;
|
|
41
|
+
const E = (y = i.current) == null ? void 0 : y.indicatorRefs, C = ((W = (H = T.current) == null ? void 0 : H.circularCardWrapperRef.current) == null ? void 0 : W.getBoundingClientRect()) || {
|
|
42
|
+
height: 0,
|
|
43
|
+
width: 0
|
|
44
|
+
};
|
|
45
|
+
if (!(E != null && E[0]) || !l.current || !T.current || (((G = (z = e == null ? void 0 : e.games) == null ? void 0 : z.data) == null ? void 0 : G.length) ?? 0) + (((v = (x = e == null ? void 0 : e.lessons) == null ? void 0 : x.data) == null ? void 0 : v.length) ?? 0) + (((U = (w = e == null ? void 0 : e.puzzles) == null ? void 0 : w.data) == null ? void 0 : U.length) ?? 0) <= 2)
|
|
46
|
+
return;
|
|
47
|
+
const p = !((k = (Y = e == null ? void 0 : e.games) == null ? void 0 : Y.data) != null && k.length), o = p ? (B = e == null ? void 0 : e.lessons) == null ? void 0 : B.data[1] : (M = e == null ? void 0 : e.puzzles) == null ? void 0 : M.data[0];
|
|
48
|
+
if (!o)
|
|
49
|
+
return;
|
|
50
|
+
a(F.ONBOARDING_STEP_VIEWED, {
|
|
51
|
+
step: p ? _.SKILL_ACTIVITY : _.GAMES_ACTIVITY
|
|
52
|
+
});
|
|
53
|
+
const K = [
|
|
54
|
+
t ? {
|
|
55
|
+
originalElementToHighlightRef: T.current.circularCardWrapperRef,
|
|
56
|
+
type: N.NUDGE,
|
|
57
|
+
elementToHighlight: /* @__PURE__ */ n(
|
|
58
|
+
te,
|
|
59
|
+
{
|
|
60
|
+
onSwipeLeft: () => {
|
|
61
|
+
var u;
|
|
62
|
+
(u = i.current) == null || u.goToIndex(1);
|
|
63
|
+
const c = setTimeout(() => {
|
|
64
|
+
clearTimeout(c), l.current.circularCardWrapperRef.current.style.visibility = "hidden";
|
|
65
|
+
}, L);
|
|
66
|
+
h(r, !1, L), s.current.push(c);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
),
|
|
70
|
+
indicator: {
|
|
71
|
+
nudge: "swipe",
|
|
72
|
+
content: /* @__PURE__ */ n(S, { $renderAs: "ab2", $color: "WHITE", children: "Swipe to explore" }),
|
|
73
|
+
nudgePointerX: C.width / 2 - 30,
|
|
74
|
+
nudgePointerY: C.height + 50
|
|
75
|
+
}
|
|
76
|
+
} : {
|
|
77
|
+
originalElementToHighlightRef: E[1],
|
|
78
|
+
type: N.NUDGE,
|
|
79
|
+
elementToHighlight: /* @__PURE__ */ n(j, { $isSelected: !1, $isCompleted: !1, $isTouchDevice: t, children: /* @__PURE__ */ n(
|
|
80
|
+
S,
|
|
81
|
+
{
|
|
82
|
+
$renderAs: "ac3-black",
|
|
83
|
+
$color: "WHITE_T_60",
|
|
84
|
+
$marginBottom: 0,
|
|
85
|
+
onClick: () => {
|
|
86
|
+
var u;
|
|
87
|
+
(u = i.current) == null || u.goToIndex(1);
|
|
88
|
+
const c = setTimeout(() => {
|
|
89
|
+
clearTimeout(c), l.current.circularCardWrapperRef.current.style.visibility = "hidden";
|
|
90
|
+
}, L);
|
|
91
|
+
s.current.push(c), h(r, !1, L);
|
|
92
|
+
},
|
|
93
|
+
children: 2
|
|
94
|
+
}
|
|
95
|
+
) }),
|
|
96
|
+
indicator: {
|
|
97
|
+
nudge: "click",
|
|
98
|
+
content: !t && /* @__PURE__ */ n(S, { $renderAs: "ab1", $color: "WHITE", children: "Click to proceed" }),
|
|
99
|
+
nudgePointerX: 0,
|
|
100
|
+
nudgePointerY: 0
|
|
101
|
+
}
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
originalElementToHighlightRef: l.current.circularCardWrapperRef,
|
|
105
|
+
type: N.NUDGE,
|
|
106
|
+
elementToHighlight: /* @__PURE__ */ n(
|
|
107
|
+
ie,
|
|
108
|
+
{
|
|
109
|
+
label: "",
|
|
110
|
+
data: {
|
|
111
|
+
card: o.cardLottie,
|
|
112
|
+
name: o.name,
|
|
113
|
+
isCompleted: !1,
|
|
114
|
+
displayNameImage: o.displayNameImage,
|
|
115
|
+
onPress: () => {
|
|
116
|
+
p ? b(o, r) : R(o, r);
|
|
117
|
+
}
|
|
118
|
+
},
|
|
119
|
+
value: 0
|
|
120
|
+
}
|
|
121
|
+
),
|
|
122
|
+
indicator: {
|
|
123
|
+
nudge: "click",
|
|
124
|
+
content: /* @__PURE__ */ n(S, { $renderAs: t ? "ab2" : "ab1", $color: "WHITE", children: t ? "Tap to start" : " Click to start" }),
|
|
125
|
+
nudgePointerX: C.width / 2,
|
|
126
|
+
nudgePointerY: C.height / 2
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
];
|
|
130
|
+
P(r, K), (V = i.current) == null || V.goToIndex(0);
|
|
131
|
+
const $ = setTimeout(() => {
|
|
132
|
+
clearTimeout($), h(r);
|
|
133
|
+
}, oe);
|
|
134
|
+
s.current.push($);
|
|
135
|
+
},
|
|
136
|
+
[
|
|
137
|
+
i,
|
|
138
|
+
a,
|
|
139
|
+
t,
|
|
140
|
+
P,
|
|
141
|
+
h,
|
|
142
|
+
b,
|
|
143
|
+
R
|
|
144
|
+
]
|
|
145
|
+
), X = q(
|
|
146
|
+
() => ({
|
|
147
|
+
firstCardRefs: T,
|
|
148
|
+
secondCardRefs: l,
|
|
149
|
+
startJourney: O
|
|
150
|
+
}),
|
|
151
|
+
[O]
|
|
152
|
+
);
|
|
153
|
+
return Q(() => () => {
|
|
154
|
+
s.current.forEach((r) => clearTimeout(r)), s.current = [];
|
|
155
|
+
}, [i]), X;
|
|
156
|
+
};
|
|
157
|
+
export {
|
|
158
|
+
_e as useGameLauncherJourney
|
|
159
|
+
};
|
|
160
|
+
//# sourceMappingURL=use-game-launcher-journey.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-game-launcher-journey.js","sources":["../../../../../../src/features/circle-games/game-launcher-v2/hooks/use-game-launcher-journey/use-game-launcher-journey.tsx"],"sourcesContent":["import { useCallback, useEffect, useMemo, useRef } from 'react';\nimport { useTheme } from 'styled-components';\n\nimport {\n PLATFORM_EVENTS_STUDENT as AnalyticsLabel,\n PLATFORM_EVENTS_STUDENT,\n} from '../../../../analytics-events/platform-events-student';\nimport { CarouselItem } from '../../../../circle-games/game-launcher-v2/comps/carousel/carousel-styled';\nimport { type JOURNEY_ID_STUDENT } from '../../../../journey/journey-id/journey-id-student';\nimport { IndicatorType } from '../../../../journey/use-journey/constants';\nimport type { TCoachmarkJourneyProps } from '../../../../journey/use-journey/journey-context-types';\nimport { useJourney } from '../../../../journey/use-journey/use-journey';\nimport { useUIContext } from '../../../../ui/context/context';\nimport type { INudgeProps } from '../../../../ui/nudge/nudge-types';\nimport Text from '../../../../ui/text/text';\nimport { EDeviceType } from '../../../../ui/theme/constants';\nimport { CIRCLE_ONBOARDING_ANALYTICS_STEPS as ActionEvent } from '../../../enum/circle-onboarding-steps';\nimport { ProjectType } from '../../../games/web-view/enums';\nimport { CircularGameCard } from '../../comps/circular-game-card/circular-game-card';\nimport { type ICircularGameCardRefs } from '../../comps/circular-game-card/circular-game-card-types';\nimport SwipeableCard from '../../comps/swipable-card/swipeable-card';\nimport type {\n Lesson,\n Puzzle,\n} from '../../dal/use-get-circle-home-details-dal/use-get-circle-home-dal-types';\nimport { type IProjectData } from '../../game-launcher-types';\nimport { SHOW_NUDGE_AFTER_MS, SLIDE_TO_LESSON_MS } from './constants';\nimport type { IUseGameLauncherJourneyProps } from './use-game-launcher-journey-types';\n\nexport const useGameLauncherJourney = ({\n carouselRefs,\n onSegmentClick,\n onJourneyComplete,\n}: IUseGameLauncherJourneyProps) => {\n const { device } = useTheme();\n const isMobile = device <= EDeviceType.TABLET;\n\n const timerRefs = useRef<ReturnType<typeof setTimeout>[]>([]);\n\n const firstCardRefs = useRef<ICircularGameCardRefs>(null);\n const secondCardRefs = useRef<ICircularGameCardRefs>(null);\n const { nextCoachmark, setJourney, endJourney } = useJourney();\n const { onEvent: trackAnalytics } = useUIContext();\n\n const trackEventCompleted = useCallback(\n (step: ActionEvent) => {\n trackAnalytics(AnalyticsLabel.ONBOARDING_STEP_COMPLETED, {\n step,\n });\n },\n [trackAnalytics],\n );\n\n const handleEndJourneyForPuzzle = useCallback(\n (puzzlesData: Puzzle, journeyId: JOURNEY_ID_STUDENT) => {\n onSegmentClick(puzzlesData, ProjectType.PUZZLE);\n trackEventCompleted(ActionEvent.PUZZLE_ACTIVITY);\n endJourney(journeyId);\n onJourneyComplete(journeyId);\n },\n [endJourney, onJourneyComplete, onSegmentClick, trackEventCompleted],\n );\n\n const handleEndJourneyForLesson = useCallback(\n (lessonsData: Lesson, journeyId: JOURNEY_ID_STUDENT) => {\n onSegmentClick(lessonsData, ProjectType.LESSON);\n trackEventCompleted(ActionEvent.SKILL_ACTIVITY);\n endJourney(journeyId);\n onJourneyComplete(journeyId);\n },\n [endJourney, onJourneyComplete, onSegmentClick, trackEventCompleted],\n );\n\n const startJourney = useCallback(\n (journeyId: JOURNEY_ID_STUDENT, projectData?: IProjectData) => {\n const paginationList = carouselRefs.current?.indicatorRefs;\n\n const launcherDims =\n firstCardRefs.current?.circularCardWrapperRef.current?.getBoundingClientRect() || {\n height: 0,\n width: 0,\n };\n\n // Exit early if required refs or data are missing\n if (!paginationList?.[0] || !secondCardRefs.current || !firstCardRefs.current) {\n return;\n }\n\n if (\n (projectData?.games?.data?.length ?? 0) +\n (projectData?.lessons?.data?.length ?? 0) +\n (projectData?.puzzles?.data?.length ?? 0) <=\n 2\n ) {\n return;\n }\n\n const showLessonCard = !projectData?.games?.data?.length;\n const firstPuzzle = showLessonCard\n ? projectData?.lessons?.data[1]\n : projectData?.puzzles?.data[0];\n\n if (!firstPuzzle) {\n return;\n }\n\n trackAnalytics(PLATFORM_EVENTS_STUDENT.ONBOARDING_STEP_VIEWED, {\n step: showLessonCard ? ActionEvent.SKILL_ACTIVITY : ActionEvent.GAMES_ACTIVITY,\n });\n\n const puzzleSteps: TCoachmarkJourneyProps[] = [\n isMobile\n ? {\n originalElementToHighlightRef: firstCardRefs.current.circularCardWrapperRef,\n type: IndicatorType.NUDGE,\n elementToHighlight: (\n <SwipeableCard\n onSwipeLeft={() => {\n carouselRefs.current?.goToIndex(1);\n\n const animateLabelTimer = setTimeout(() => {\n clearTimeout(animateLabelTimer);\n secondCardRefs.current!.circularCardWrapperRef.current.style.visibility =\n 'hidden';\n }, SHOW_NUDGE_AFTER_MS);\n\n nextCoachmark(journeyId, false, SHOW_NUDGE_AFTER_MS);\n timerRefs.current.push(animateLabelTimer);\n }}\n />\n ),\n indicator: {\n nudge: 'swipe',\n content: (\n <Text $renderAs=\"ab2\" $color=\"WHITE\">\n Swipe to explore\n </Text>\n ),\n nudgePointerX: launcherDims.width / 2 - 30,\n nudgePointerY: launcherDims.height + 50,\n } as INudgeProps,\n }\n : {\n originalElementToHighlightRef: paginationList[1] as React.RefObject<HTMLDivElement>,\n type: IndicatorType.NUDGE,\n elementToHighlight: (\n <CarouselItem $isSelected={false} $isCompleted={false} $isTouchDevice={isMobile}>\n <Text\n $renderAs=\"ac3-black\"\n $color=\"WHITE_T_60\"\n $marginBottom={0}\n onClick={() => {\n carouselRefs.current?.goToIndex(1);\n\n const animateLabelTimer = setTimeout(() => {\n clearTimeout(animateLabelTimer);\n secondCardRefs.current!.circularCardWrapperRef.current.style.visibility =\n 'hidden';\n }, SHOW_NUDGE_AFTER_MS);\n\n timerRefs.current.push(animateLabelTimer);\n\n nextCoachmark(journeyId, false, SHOW_NUDGE_AFTER_MS);\n }}\n >\n {2}\n </Text>\n </CarouselItem>\n ),\n indicator: {\n nudge: 'click',\n content: !isMobile && (\n <Text $renderAs=\"ab1\" $color=\"WHITE\">\n Click to proceed\n </Text>\n ),\n nudgePointerX: 0,\n nudgePointerY: 0,\n } as INudgeProps,\n },\n {\n originalElementToHighlightRef: secondCardRefs.current.circularCardWrapperRef,\n type: IndicatorType.NUDGE,\n elementToHighlight: (\n <CircularGameCard\n label=\"\"\n data={{\n card: firstPuzzle!.cardLottie,\n name: firstPuzzle!.name,\n isCompleted: false,\n displayNameImage: firstPuzzle!.displayNameImage,\n onPress: () => {\n showLessonCard\n ? handleEndJourneyForLesson(firstPuzzle as Lesson, journeyId)\n : handleEndJourneyForPuzzle(firstPuzzle as Puzzle, journeyId);\n },\n }}\n value={0}\n />\n ),\n indicator: {\n nudge: 'click',\n content: (\n <Text $renderAs={isMobile ? 'ab2' : 'ab1'} $color=\"WHITE\">\n {isMobile ? 'Tap to start' : ' Click to start'}\n </Text>\n ),\n nudgePointerX: launcherDims.width / 2,\n nudgePointerY: launcherDims.height / 2,\n } as INudgeProps,\n },\n ];\n\n setJourney(journeyId, puzzleSteps);\n carouselRefs.current?.goToIndex(0);\n const delayBeforeStart = setTimeout(() => {\n clearTimeout(delayBeforeStart);\n nextCoachmark(journeyId);\n }, SLIDE_TO_LESSON_MS);\n\n timerRefs.current.push(delayBeforeStart);\n },\n [\n carouselRefs,\n trackAnalytics,\n isMobile,\n setJourney,\n nextCoachmark,\n handleEndJourneyForLesson,\n handleEndJourneyForPuzzle,\n ],\n );\n\n const data = useMemo(\n () => ({\n firstCardRefs,\n secondCardRefs,\n startJourney,\n }),\n [startJourney],\n );\n\n // Cleanup on unmount\n useEffect(() => {\n return () => {\n timerRefs.current.forEach(timer => clearTimeout(timer));\n timerRefs.current = [];\n };\n }, [carouselRefs]);\n\n return data;\n};\n"],"names":["useGameLauncherJourney","carouselRefs","onSegmentClick","onJourneyComplete","device","useTheme","isMobile","EDeviceType","timerRefs","useRef","firstCardRefs","secondCardRefs","nextCoachmark","setJourney","endJourney","useJourney","trackAnalytics","useUIContext","trackEventCompleted","useCallback","step","AnalyticsLabel","handleEndJourneyForPuzzle","puzzlesData","journeyId","ProjectType","ActionEvent","handleEndJourneyForLesson","lessonsData","startJourney","projectData","paginationList","_a","launcherDims","_c","_b","_e","_d","_g","_f","_i","_h","showLessonCard","_k","_j","firstPuzzle","_l","_m","PLATFORM_EVENTS_STUDENT","puzzleSteps","IndicatorType","jsx","SwipeableCard","animateLabelTimer","SHOW_NUDGE_AFTER_MS","Text","Carou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|
+
{"version":3,"file":"constants.js","sources":["../../../../../../src/features/circle-games/game-launcher-v2/hooks/use-table-infinite-launcher-journey/constants.ts"],"sourcesContent":["export const LESSON_CARD_INDEX = 0;\nexport const TABLE_CARD_INDEX = 3;\n\nexport const SHOW_INITIAL_COACHMARK_AFTER_MS = 500;\nexport const SHOW_INITIAL_TOOLTIP_AFTER_MS = 1500;\n\nexport const GO_TO_TABLE_LAUNCHER_DURATION_MS = 1000;\nexport const SHOW_CLICK_TABLE_NUDGE_AFTER_MS = 3000;\n"],"names":["SHOW_CLICK_TABLE_NUDGE_AFTER_MS"],"mappings":"AAOO,MAAMA,IAAkC;"}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { jsx as i, Fragment as D } from "react/jsx-runtime";
|
|
2
|
+
import { useRef as a, useCallback as d, useEffect as l } from "react";
|
|
3
|
+
import { useTheme as y } from "styled-components";
|
|
4
|
+
import { PLATFORM_EVENTS_STUDENT as T } from "../../../../analytics-events/platform-events-student.js";
|
|
5
|
+
import { JOURNEY_ID_STUDENT as S } from "../../../../journey/journey-id/journey-id-student.js";
|
|
6
|
+
import { IndicatorType as f } from "../../../../journey/use-journey/constants.js";
|
|
7
|
+
import { useJourney as B } from "../../../../journey/use-journey/use-journey.js";
|
|
8
|
+
import { useUIContext as M } from "../../../../ui/context/context.js";
|
|
9
|
+
import g from "../../../../ui/layout/flex-view.js";
|
|
10
|
+
import x from "../../../../ui/text/text.js";
|
|
11
|
+
import { EDeviceType as F } from "../../../../ui/theme/constants.js";
|
|
12
|
+
import { CIRCLE_ONBOARDING_ANALYTICS_STEPS as C } from "../../../enum/circle-onboarding-steps.js";
|
|
13
|
+
import { INFINITE_MODE_TEXT as P } from "../../comps/tables-card/constants.js";
|
|
14
|
+
import J from "../../comps/tables-card/infinite-button/infinite-mode-launcher-button.js";
|
|
15
|
+
import { SHOW_CLICK_TABLE_NUDGE_AFTER_MS as U } from "./constants.js";
|
|
16
|
+
const Q = ({
|
|
17
|
+
originalTableRef: t,
|
|
18
|
+
onTableInfiniteModeClick: E,
|
|
19
|
+
onJourneyComplete: p
|
|
20
|
+
}) => {
|
|
21
|
+
const e = S.CIRCLE_TABLES_INFINTE_JOURNEY, { device: L } = y(), I = L === F.MOBILE ? "ab3-bold" : "ab2-bold", m = a([]), { nextCoachmark: s, setJourney: _, endJourney: h } = B(), { onEvent: c } = M(), N = d(() => {
|
|
22
|
+
var r;
|
|
23
|
+
h(e), E(), c(T.ONBOARDING_STEP_COMPLETED, {
|
|
24
|
+
step: C.INFINITE_MODE
|
|
25
|
+
}), (r = t == null ? void 0 : t.current) == null || r.stopLabelAnimation(), p(e);
|
|
26
|
+
}, [
|
|
27
|
+
h,
|
|
28
|
+
e,
|
|
29
|
+
p,
|
|
30
|
+
E,
|
|
31
|
+
t,
|
|
32
|
+
c
|
|
33
|
+
]), O = d(
|
|
34
|
+
(r, u) => {
|
|
35
|
+
s(e, !1, r), c(T.ONBOARDING_STEP_VIEWED, {
|
|
36
|
+
step: C.INFINITE_MODE
|
|
37
|
+
});
|
|
38
|
+
const o = setTimeout(() => {
|
|
39
|
+
var n;
|
|
40
|
+
clearTimeout(o), (n = t.current) == null || n.startLabelAnimation("YELLOW_4"), t.current && t.current.labelRef.current && (t.current.labelRef.current.innerText = P), s(e, !0);
|
|
41
|
+
}, u);
|
|
42
|
+
m.current.push(o);
|
|
43
|
+
},
|
|
44
|
+
[e, s, t, c]
|
|
45
|
+
), A = d(() => {
|
|
46
|
+
var u, o, n;
|
|
47
|
+
if (!((u = t.current) != null && u.segmentedCardWrapperRef.current) || !((o = t.current) != null && o.labelRef.current))
|
|
48
|
+
return;
|
|
49
|
+
const r = (n = t.current) == null ? void 0 : n.segmentedCardWrapperRef.current.getBoundingClientRect();
|
|
50
|
+
_(e, [
|
|
51
|
+
{
|
|
52
|
+
originalElementToHighlightRef: t.current.segmentedCardWrapperRef,
|
|
53
|
+
type: f.TOOLTIP,
|
|
54
|
+
elementToHighlight: /* @__PURE__ */ i(D, {}),
|
|
55
|
+
indicator: {
|
|
56
|
+
position: "top",
|
|
57
|
+
backgroundColor: "YELLOW_4",
|
|
58
|
+
width: 260,
|
|
59
|
+
tooltipItem: /* @__PURE__ */ i(g, { children: /* @__PURE__ */ i(x, { $renderAs: I, children: "Challenge yourself in Infinity Mode! Break records and climb the leaderboard." }) }),
|
|
60
|
+
tooltipXCoOrdinates: r.width / 2,
|
|
61
|
+
tooltipYCoOrdinates: -(1 * r.height) / 3
|
|
62
|
+
}
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
originalElementToHighlightRef: t.current.infiniteButtonRef,
|
|
66
|
+
type: f.NUDGE,
|
|
67
|
+
indicator: {
|
|
68
|
+
nudge: "click",
|
|
69
|
+
nudgePointerX: 0,
|
|
70
|
+
nudgePointerY: 10
|
|
71
|
+
},
|
|
72
|
+
elementToHighlight: /* @__PURE__ */ i(J, { onClick: N })
|
|
73
|
+
}
|
|
74
|
+
]), O(0, U);
|
|
75
|
+
}, [
|
|
76
|
+
N,
|
|
77
|
+
e,
|
|
78
|
+
t,
|
|
79
|
+
_,
|
|
80
|
+
O,
|
|
81
|
+
I
|
|
82
|
+
]);
|
|
83
|
+
return l(() => () => {
|
|
84
|
+
m.current.forEach((r) => clearTimeout(r)), m.current = [];
|
|
85
|
+
}, [e]), {
|
|
86
|
+
startJourney: A
|
|
87
|
+
};
|
|
88
|
+
};
|
|
89
|
+
export {
|
|
90
|
+
Q as useTableInfiniteLauncherJourney
|
|
91
|
+
};
|
|
92
|
+
//# sourceMappingURL=use-table-infinite-launcher-journey.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-table-infinite-launcher-journey.js","sources":["../../../../../../src/features/circle-games/game-launcher-v2/hooks/use-table-infinite-launcher-journey/use-table-infinite-launcher-journey.tsx"],"sourcesContent":["import { useCallback, useEffect, useRef } from 'react';\nimport { useTheme } from 'styled-components';\n\nimport { PLATFORM_EVENTS_STUDENT } from '../../../../analytics-events/platform-events-student';\nimport { JOURNEY_ID_STUDENT } from '../../../../journey/journey-id/journey-id-student';\nimport { IndicatorType } from '../../../../journey/use-journey/constants';\nimport { useJourney } from '../../../../journey/use-journey/use-journey';\nimport type { IArrowTooltipProps } from '../../../../ui/arrow-tooltip/arrow-tooltip-types';\nimport { useUIContext } from '../../../../ui/context/context';\nimport FlexView from '../../../../ui/layout/flex-view';\nimport type { INudgeProps } from '../../../../ui/nudge/nudge-types';\nimport Text from '../../../../ui/text/text';\nimport { EDeviceType } from '../../../../ui/theme/constants';\nimport { CIRCLE_ONBOARDING_ANALYTICS_STEPS as Action } from '../../../enum/circle-onboarding-steps';\nimport { INFINITE_MODE_TEXT } from '../../comps/tables-card/constants';\nimport InfiniteButtonCard from '../../comps/tables-card/infinite-button/infinite-mode-launcher-button';\nimport { SHOW_CLICK_TABLE_NUDGE_AFTER_MS } from './constants';\nimport type { IUseInfiniteTableJourneyProps } from './use-table-infinite-launcher-journey-types';\n\nexport const useTableInfiniteLauncherJourney = ({\n originalTableRef,\n onTableInfiniteModeClick,\n onJourneyComplete,\n}: IUseInfiniteTableJourneyProps) => {\n const journeyId = JOURNEY_ID_STUDENT.CIRCLE_TABLES_INFINTE_JOURNEY;\n\n const { device } = useTheme();\n const isMobile = device === EDeviceType.MOBILE;\n const tooltipTextRenderAs = isMobile ? 'ab3-bold' : 'ab2-bold';\n\n const timerRefs = useRef<ReturnType<typeof setTimeout>[]>([]);\n\n const { nextCoachmark, setJourney, endJourney } = useJourney();\n const { onEvent: trackAnalytics } = useUIContext();\n\n const handleEndJourney = useCallback(() => {\n endJourney(journeyId);\n // Only when User clicked on play\n onTableInfiniteModeClick();\n\n trackAnalytics(PLATFORM_EVENTS_STUDENT.ONBOARDING_STEP_COMPLETED, {\n step: Action.INFINITE_MODE,\n });\n // Reset original table card ref label\n originalTableRef?.current?.stopLabelAnimation();\n onJourneyComplete(journeyId);\n }, [\n endJourney,\n journeyId,\n onJourneyComplete,\n onTableInfiniteModeClick,\n originalTableRef,\n trackAnalytics,\n ]);\n\n const showToolTipAndNudge = useCallback(\n (dealyToShowToolTip: number, delayToShowNudge: number) => {\n nextCoachmark(journeyId, false, dealyToShowToolTip);\n\n trackAnalytics(PLATFORM_EVENTS_STUDENT.ONBOARDING_STEP_VIEWED, {\n step: Action.INFINITE_MODE,\n });\n\n const showNudge = setTimeout(() => {\n clearTimeout(showNudge);\n\n originalTableRef.current?.startLabelAnimation('YELLOW_4');\n if (originalTableRef.current && originalTableRef.current.labelRef.current) {\n originalTableRef.current.labelRef.current.innerText = INFINITE_MODE_TEXT;\n }\n nextCoachmark(journeyId, true);\n }, delayToShowNudge);\n\n timerRefs.current.push(showNudge);\n },\n [journeyId, nextCoachmark, originalTableRef, trackAnalytics],\n );\n\n const startJourney = useCallback(() => {\n if (\n !originalTableRef.current?.segmentedCardWrapperRef.current ||\n !originalTableRef.current?.labelRef.current\n ) {\n return;\n }\n\n const tableCardDims =\n originalTableRef.current?.segmentedCardWrapperRef.current.getBoundingClientRect();\n\n // USER ON TABLE CARD\n setJourney(journeyId, [\n {\n originalElementToHighlightRef: originalTableRef.current.segmentedCardWrapperRef,\n\n type: IndicatorType.TOOLTIP,\n elementToHighlight: <></>,\n indicator: {\n position: 'top',\n backgroundColor: 'YELLOW_4',\n width: 260,\n tooltipItem: (\n <FlexView>\n <Text $renderAs={tooltipTextRenderAs}>\n Challenge yourself in Infinity Mode! Break records and climb the leaderboard.\n </Text>\n </FlexView>\n ),\n tooltipXCoOrdinates: tableCardDims.width / 2,\n tooltipYCoOrdinates: -(1 * tableCardDims.height) / 3,\n } as IArrowTooltipProps,\n },\n {\n originalElementToHighlightRef: originalTableRef.current.infiniteButtonRef,\n\n type: IndicatorType.NUDGE,\n indicator: {\n nudge: 'click',\n nudgePointerX: 0,\n nudgePointerY: 10,\n } as INudgeProps,\n elementToHighlight: <InfiniteButtonCard onClick={handleEndJourney} />,\n },\n ]);\n showToolTipAndNudge(0, SHOW_CLICK_TABLE_NUDGE_AFTER_MS);\n }, [\n handleEndJourney,\n journeyId,\n originalTableRef,\n setJourney,\n showToolTipAndNudge,\n tooltipTextRenderAs,\n ]);\n\n // Cleanup on unmount\n useEffect(() => {\n return () => {\n timerRefs.current.forEach(timer => clearTimeout(timer));\n timerRefs.current = [];\n };\n }, [journeyId]);\n\n return {\n startJourney,\n };\n};\n"],"names":["useTableInfiniteLauncherJourney","originalTableRef","onTableInfiniteModeClick","onJourneyComplete","journeyId","JOURNEY_ID_STUDENT","device","useTheme","tooltipTextRenderAs","EDeviceType","timerRefs","useRef","nextCoachmark","setJourney","endJourney","useJourney","trackAnalytics","useUIContext","handleEndJourney","useCallback","PLATFORM_EVENTS_STUDENT","Action","_a","showToolTipAndNudge","dealyToShowToolTip","delayToShowNudge","showNudge","INFINITE_MODE_TEXT","startJourney","_b","tableCardDims","_c","IndicatorType","jsx","Fragment","FlexView","Text","InfiniteButtonCard","SHOW_CLICK_TABLE_NUDGE_AFTER_MS","useEffect","timer"],"mappings":";;;;;;;;;;;;;;;AAmBO,MAAMA,IAAkC,CAAC;AAAA,EAC9C,kBAAAC;AAAA,EACA,0BAAAC;AAAA,EACA,mBAAAC;AACF,MAAqC;AACnC,QAAMC,IAAYC,EAAmB,+BAE/B,EAAE,QAAAC,MAAWC,KAEbC,IADWF,MAAWG,EAAY,SACD,aAAa,YAE9CC,IAAYC,EAAwC,CAAA,CAAE,GAEtD,EAAE,eAAAC,GAAe,YAAAC,GAAY,YAAAC,MAAeC,EAAW,GACvD,EAAE,SAASC,EAAe,IAAIC,EAAa,GAE3CC,IAAmBC,EAAY,MAAM;;AACzC,IAAAL,EAAWV,CAAS,GAEKF,KAEzBc,EAAeI,EAAwB,2BAA2B;AAAA,MAChE,MAAMC,EAAO;AAAA,IAAA,CACd,IAEDC,IAAArB,KAAA,gBAAAA,EAAkB,YAAlB,QAAAqB,EAA2B,sBAC3BnB,EAAkBC,CAAS;AAAA,EAAA,GAC1B;AAAA,IACDU;AAAA,IACAV;AAAA,IACAD;A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;AAAA,QACE,+BAA+B7B,EAAiB,QAAQ;AAAA,QAExD,MAAM+B,EAAc;AAAA,QACpB,WAAW;AAAA,UACT,OAAO;AAAA,UACP,eAAe;AAAA,UACf,eAAe;AAAA,QACjB;AAAA,QACA,oBAAoB,gBAAAC,EAACI,GAAmB,EAAA,SAASnB,EAAkB,CAAA;AAAA,MACrE;AAAA,IAAA,CACD,GACDK,EAAoB,GAAGe,CAA+B;AAAA,EAAA,GACrD;AAAA,IACDpB;AAAA,IACAd;AAAA,IACAH;AAAA,IACAY;AAAA,IACAU;AAAA,IACAf;AAAA,EAAA,CACD;AAGD,SAAA+B,EAAU,MACD,MAAM;AACX,IAAA7B,EAAU,QAAQ,QAAQ,CAAS8B,MAAA,aAAaA,CAAK,CAAC,GACtD9B,EAAU,UAAU;EAAC,GAEtB,CAACN,CAAS,CAAC,GAEP;AAAA,IACL,cAAAwB;AAAA,EAAA;AAEJ;"}
|
package/dist/features/circle-games/game-launcher-v2/hooks/use-table-launcher-journey/constants.js
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
const _ = 500, E = 1500, A = 3e3, T = 3100, I = 100, L = 3e3;
|
|
2
|
+
export {
|
|
3
|
+
A as SHOW_CLICK_TABLE_NUDGE_AFTER_MS,
|
|
4
|
+
_ as SHOW_INITIAL_COACHMARK_AFTER_MS,
|
|
5
|
+
E as SHOW_INITIAL_TOOLTIP_AFTER_MS,
|
|
6
|
+
L as SHOW_PICK_A_LEVEL_NUDGE_AFTER_MS,
|
|
7
|
+
I as SHOW_PICK_A_LEVEL_TOOLTIP_AFTER_MS,
|
|
8
|
+
T as START_ANIMATING_CLONED_ELEM
|
|
9
|
+
};
|
|
10
|
+
//# sourceMappingURL=constants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.js","sources":["../../../../../../src/features/circle-games/game-launcher-v2/hooks/use-table-launcher-journey/constants.ts"],"sourcesContent":["export const SHOW_INITIAL_COACHMARK_AFTER_MS = 500;\nexport const SHOW_INITIAL_TOOLTIP_AFTER_MS = 1500;\n\nexport const SHOW_CLICK_TABLE_NUDGE_AFTER_MS = 3000;\nexport const START_ANIMATING_CLONED_ELEM = SHOW_CLICK_TABLE_NUDGE_AFTER_MS + 100;\n\nexport const SHOW_PICK_A_LEVEL_TOOLTIP_AFTER_MS = 100;\nexport const SHOW_PICK_A_LEVEL_NUDGE_AFTER_MS = 3000;\n"],"names":["SHOW_INITIAL_COACHMARK_AFTER_MS","SHOW_INITIAL_TOOLTIP_AFTER_MS","SHOW_CLICK_TABLE_NUDGE_AFTER_MS","START_ANIMATING_CLONED_ELEM","SHOW_PICK_A_LEVEL_TOOLTIP_AFTER_MS","SHOW_PICK_A_LEVEL_NUDGE_AFTER_MS"],"mappings":"AAAO,MAAMA,IAAkC,KAClCC,IAAgC,MAEhCC,IAAkC,KAClCC,IAA8B,MAE9BC,IAAqC,KACrCC,IAAmC;"}
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
import { jsx as n, Fragment as H } from "react/jsx-runtime";
|
|
2
|
+
import { useRef as k, useCallback as C, useEffect as R } from "react";
|
|
3
|
+
import { useTheme as U } from "styled-components";
|
|
4
|
+
import { PLATFORM_EVENTS_STUDENT as D } from "../../../../analytics-events/platform-events-student.js";
|
|
5
|
+
import { JOURNEY_ID_STUDENT as v } from "../../../../journey/journey-id/journey-id-student.js";
|
|
6
|
+
import { IndicatorType as L } from "../../../../journey/use-journey/constants.js";
|
|
7
|
+
import { useJourney as J } from "../../../../journey/use-journey/use-journey.js";
|
|
8
|
+
import { useUIContext as V } from "../../../../ui/context/context.js";
|
|
9
|
+
import M from "../../../../ui/layout/flex-view.js";
|
|
10
|
+
import O from "../../../../ui/text/text.js";
|
|
11
|
+
import { EDeviceType as b } from "../../../../ui/theme/constants.js";
|
|
12
|
+
import { CIRCLE_ONBOARDING_ANALYTICS_STEPS as B } from "../../../enum/circle-onboarding-steps.js";
|
|
13
|
+
import { TablesCard as Y } from "../../comps/tables-card/tables-card.js";
|
|
14
|
+
import { SHOW_PICK_A_LEVEL_TOOLTIP_AFTER_MS as w, SHOW_PICK_A_LEVEL_NUDGE_AFTER_MS as x, START_ANIMATING_CLONED_ELEM as $, SHOW_INITIAL_COACHMARK_AFTER_MS as X, SHOW_INITIAL_TOOLTIP_AFTER_MS as K } from "./constants.js";
|
|
15
|
+
const mt = ({
|
|
16
|
+
originalTableRef: t,
|
|
17
|
+
onTableSegmentClick: T,
|
|
18
|
+
onJourneyComplete: P,
|
|
19
|
+
onNextJourney: S
|
|
20
|
+
}) => {
|
|
21
|
+
const e = v.CIRCLE_TABLES_INTRO_JOURNEY, { device: G } = U(), d = G === b.MOBILE, E = d ? "ab3-bold" : "ab2-bold", A = k(null), I = k([]), { nextCoachmark: s, setJourney: g, addCoachmark: i, endJourney: N } = J(), { onEvent: h } = V(), _ = C(
|
|
22
|
+
(r) => {
|
|
23
|
+
var o, c;
|
|
24
|
+
N(e), r && T(r), h(D.ONBOARDING_STEP_COMPLETED, {
|
|
25
|
+
step: B.TABLES
|
|
26
|
+
}), (o = t == null ? void 0 : t.current) == null || o.setLabelVisiblity(!0), (c = t == null ? void 0 : t.current) == null || c.stopLabelAnimation(), P(e);
|
|
27
|
+
},
|
|
28
|
+
[
|
|
29
|
+
N,
|
|
30
|
+
e,
|
|
31
|
+
P,
|
|
32
|
+
T,
|
|
33
|
+
t,
|
|
34
|
+
h
|
|
35
|
+
]
|
|
36
|
+
), W = C(() => {
|
|
37
|
+
_(), S();
|
|
38
|
+
}, [_, S]), f = C(
|
|
39
|
+
(r, o) => {
|
|
40
|
+
var u, p, a, l;
|
|
41
|
+
if (!((u = t.current) != null && u.segmentedCardWrapperRef.current) || !((p = t.current) != null && p.labelRef.current))
|
|
42
|
+
return;
|
|
43
|
+
(a = t == null ? void 0 : t.current) == null || a.setLabelVisiblity(!1);
|
|
44
|
+
const c = (l = t.current) == null ? void 0 : l.segmentedCardWrapperRef.current.getBoundingClientRect();
|
|
45
|
+
i(e, {
|
|
46
|
+
originalElementToHighlightRef: t.current.segmentedCardWrapperRef,
|
|
47
|
+
type: L.TOOLTIP,
|
|
48
|
+
elementToHighlight: /* @__PURE__ */ n(
|
|
49
|
+
Y,
|
|
50
|
+
{
|
|
51
|
+
ref: A,
|
|
52
|
+
defaultTable: o,
|
|
53
|
+
label: r.label,
|
|
54
|
+
data: r.data,
|
|
55
|
+
onPress: _,
|
|
56
|
+
onGoBackFromTableLevel: W
|
|
57
|
+
}
|
|
58
|
+
),
|
|
59
|
+
indicator: {
|
|
60
|
+
position: "bottom",
|
|
61
|
+
backgroundColor: "YELLOW_4",
|
|
62
|
+
width: 236,
|
|
63
|
+
tooltipItem: /* @__PURE__ */ n(M, { children: /* @__PURE__ */ n(O, { $renderAs: E, children: "Each table has 3 levels—clear them and earn 3 stars!" }) }),
|
|
64
|
+
tooltipXCoOrdinates: 0,
|
|
65
|
+
tooltipYCoOrdinates: 30
|
|
66
|
+
}
|
|
67
|
+
}), i(e, {
|
|
68
|
+
originalElementToHighlightRef: t.current.segmentedCardWrapperRef,
|
|
69
|
+
type: L.NUDGE,
|
|
70
|
+
indicator: {
|
|
71
|
+
nudge: "click",
|
|
72
|
+
content: !d && /* @__PURE__ */ n(O, { $renderAs: "ab1", $color: "WHITE", children: "Pick a level" }),
|
|
73
|
+
nudgePointerX: c.width / 2 + 50,
|
|
74
|
+
nudgePointerY: c.height * 0.4
|
|
75
|
+
},
|
|
76
|
+
elementToHighlight: /* @__PURE__ */ n(H, {})
|
|
77
|
+
}), s(e, !1, w), s(e, !0, x);
|
|
78
|
+
const m = setTimeout(() => {
|
|
79
|
+
var y;
|
|
80
|
+
clearTimeout(m), (y = A.current) == null || y.startLabelAnimation("YELLOW_4");
|
|
81
|
+
}, $);
|
|
82
|
+
I.current.push(m);
|
|
83
|
+
},
|
|
84
|
+
[
|
|
85
|
+
i,
|
|
86
|
+
W,
|
|
87
|
+
_,
|
|
88
|
+
d,
|
|
89
|
+
e,
|
|
90
|
+
s,
|
|
91
|
+
t,
|
|
92
|
+
E
|
|
93
|
+
]
|
|
94
|
+
), F = C(
|
|
95
|
+
(r) => {
|
|
96
|
+
var c, m, u, p, a;
|
|
97
|
+
if (!((m = (c = t.current) == null ? void 0 : c.segmentedCardWrapperRef) != null && m.current) || !((p = (u = t.current) == null ? void 0 : u.labelRef) != null && p.current))
|
|
98
|
+
return;
|
|
99
|
+
const o = (a = t.current) == null ? void 0 : a.segmentedCardWrapperRef.current.getBoundingClientRect();
|
|
100
|
+
h(D.ONBOARDING_STEP_VIEWED, {
|
|
101
|
+
step: B.TABLES
|
|
102
|
+
}), g(e, [
|
|
103
|
+
{
|
|
104
|
+
originalElementToHighlightRef: t.current.segmentedCardWrapperRef,
|
|
105
|
+
type: L.TOOLTIP,
|
|
106
|
+
elementToHighlight: /* @__PURE__ */ n(H, {}),
|
|
107
|
+
indicator: {
|
|
108
|
+
position: "top",
|
|
109
|
+
backgroundColor: "YELLOW_4",
|
|
110
|
+
width: 264,
|
|
111
|
+
tooltipItem: /* @__PURE__ */ n(M, { children: /* @__PURE__ */ n(O, { $renderAs: E, children: "Get faster at multiplication! Practice everyday and become a Tables champ." }) }),
|
|
112
|
+
tooltipXCoOrdinates: o.width / 2,
|
|
113
|
+
tooltipYCoOrdinates: 15
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
]), s(e, !1, X), i(e, {
|
|
117
|
+
originalElementToHighlightRef: t.current.segmentedCardWrapperRef,
|
|
118
|
+
type: L.NUDGE,
|
|
119
|
+
indicator: {
|
|
120
|
+
nudge: "click",
|
|
121
|
+
content: !d && /* @__PURE__ */ n(O, { $renderAs: "ab1", $color: "WHITE", children: "Pick a table to start" }),
|
|
122
|
+
nudgePointerX: o.width / 2 + 50,
|
|
123
|
+
nudgePointerY: o.height / 2
|
|
124
|
+
},
|
|
125
|
+
elementToHighlight: /* @__PURE__ */ n(
|
|
126
|
+
Y,
|
|
127
|
+
{
|
|
128
|
+
ref: A,
|
|
129
|
+
label: r.label,
|
|
130
|
+
data: r.data,
|
|
131
|
+
onPress: () => {
|
|
132
|
+
},
|
|
133
|
+
onPressTableSegment: (l) => f(r, l)
|
|
134
|
+
}
|
|
135
|
+
)
|
|
136
|
+
}), s(e, !0, K);
|
|
137
|
+
},
|
|
138
|
+
[
|
|
139
|
+
i,
|
|
140
|
+
f,
|
|
141
|
+
d,
|
|
142
|
+
e,
|
|
143
|
+
s,
|
|
144
|
+
t,
|
|
145
|
+
g,
|
|
146
|
+
E,
|
|
147
|
+
h
|
|
148
|
+
]
|
|
149
|
+
);
|
|
150
|
+
return R(() => () => {
|
|
151
|
+
I.current.forEach((r) => clearTimeout(r)), I.current = [];
|
|
152
|
+
}, [e]), {
|
|
153
|
+
startJourney: F
|
|
154
|
+
};
|
|
155
|
+
};
|
|
156
|
+
export {
|
|
157
|
+
mt as useTableLauncherJourney
|
|
158
|
+
};
|
|
159
|
+
//# sourceMappingURL=use-table-launcher-journey.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-table-launcher-journey.js","sources":["../../../../../../src/features/circle-games/game-launcher-v2/hooks/use-table-launcher-journey/use-table-launcher-journey.tsx"],"sourcesContent":["import { useCallback, useEffect, useRef } from 'react';\nimport { useTheme } from 'styled-components';\n\nimport { PLATFORM_EVENTS_STUDENT } from '../../../../analytics-events/platform-events-student';\nimport { JOURNEY_ID_STUDENT } from '../../../../journey/journey-id/journey-id-student';\nimport { IndicatorType } from '../../../../journey/use-journey/constants';\nimport { useJourney } from '../../../../journey/use-journey/use-journey';\nimport type { IArrowTooltipProps } from '../../../../ui/arrow-tooltip/arrow-tooltip-types';\nimport { useUIContext } from '../../../../ui/context/context';\nimport FlexView from '../../../../ui/layout/flex-view';\nimport type { INudgeProps } from '../../../../ui/nudge/nudge-types';\nimport Text from '../../../../ui/text/text';\nimport { EDeviceType } from '../../../../ui/theme/constants';\nimport { CIRCLE_ONBOARDING_ANALYTICS_STEPS as Action } from '../../../enum/circle-onboarding-steps';\nimport { TablesCard } from '../../comps/tables-card/tables-card';\nimport type { ITableCardRef, ITableDetails } from '../../comps/tables-card/tables-card-types';\nimport type {\n ITableInfo,\n ITables,\n} from '../../dal/use-get-circle-home-details-dal/use-get-circle-home-dal-types';\nimport {\n SHOW_PICK_A_LEVEL_NUDGE_AFTER_MS,\n SHOW_PICK_A_LEVEL_TOOLTIP_AFTER_MS,\n SHOW_INITIAL_COACHMARK_AFTER_MS,\n START_ANIMATING_CLONED_ELEM,\n SHOW_INITIAL_TOOLTIP_AFTER_MS,\n} from './constants';\nimport type { IUseTableJourneyProps } from './use-table-launcher-journey-types';\n\nexport const useTableLauncherJourney = ({\n originalTableRef,\n onTableSegmentClick,\n onJourneyComplete,\n onNextJourney,\n}: IUseTableJourneyProps) => {\n const journeyId = JOURNEY_ID_STUDENT.CIRCLE_TABLES_INTRO_JOURNEY;\n\n const { device } = useTheme();\n const isMobile = device === EDeviceType.MOBILE;\n const tooltipTextRenderAs = isMobile ? 'ab3-bold' : 'ab2-bold';\n\n const highlightedTableRef = useRef<ITableCardRef>(null);\n\n const timerRefs = useRef<ReturnType<typeof setTimeout>[]>([]);\n\n const { nextCoachmark, setJourney, addCoachmark, endJourney } = useJourney();\n const { onEvent: trackAnalytics } = useUIContext();\n\n const handleEndJourney = useCallback(\n (tableDetails?: ITableDetails) => {\n endJourney(journeyId);\n // Only when User clicked on play\n if (tableDetails) {\n onTableSegmentClick(tableDetails);\n }\n trackAnalytics(PLATFORM_EVENTS_STUDENT.ONBOARDING_STEP_COMPLETED, {\n step: Action.TABLES,\n });\n\n // Reset original table card ref label\n originalTableRef?.current?.setLabelVisiblity(true);\n originalTableRef?.current?.stopLabelAnimation();\n onJourneyComplete(journeyId);\n },\n [\n endJourney,\n journeyId,\n onJourneyComplete,\n onTableSegmentClick,\n originalTableRef,\n trackAnalytics,\n ],\n );\n\n const handleContinueJourney = useCallback(() => {\n handleEndJourney();\n onNextJourney();\n }, [handleEndJourney, onNextJourney]);\n\n const handleTableSegmentClick = useCallback(\n (launcherData: ITables, tableData: ITableInfo) => {\n if (\n !originalTableRef.current?.segmentedCardWrapperRef.current ||\n !originalTableRef.current?.labelRef.current\n ) {\n return;\n }\n\n originalTableRef?.current?.setLabelVisiblity(false);\n const tableCardDims =\n originalTableRef.current?.segmentedCardWrapperRef.current.getBoundingClientRect();\n\n addCoachmark(journeyId, {\n originalElementToHighlightRef: originalTableRef.current.segmentedCardWrapperRef,\n\n type: IndicatorType.TOOLTIP,\n elementToHighlight: (\n <TablesCard\n ref={highlightedTableRef}\n defaultTable={tableData}\n label={launcherData.label}\n data={launcherData.data}\n onPress={handleEndJourney}\n onGoBackFromTableLevel={handleContinueJourney}\n />\n ),\n indicator: {\n position: 'bottom',\n backgroundColor: 'YELLOW_4',\n width: 236,\n tooltipItem: (\n <FlexView>\n <Text $renderAs={tooltipTextRenderAs}>\n Each table has 3 levels—clear them and earn 3 stars!\n </Text>\n </FlexView>\n ),\n tooltipXCoOrdinates: 0,\n tooltipYCoOrdinates: 30,\n } as IArrowTooltipProps,\n });\n\n addCoachmark(journeyId, {\n originalElementToHighlightRef: originalTableRef.current.segmentedCardWrapperRef,\n\n type: IndicatorType.NUDGE,\n indicator: {\n nudge: 'click',\n content: !isMobile && (\n <Text $renderAs=\"ab1\" $color=\"WHITE\">\n Pick a level\n </Text>\n ),\n nudgePointerX: tableCardDims.width / 2 + 50,\n nudgePointerY: tableCardDims.height * 0.4,\n } as INudgeProps,\n elementToHighlight: <></>,\n });\n\n nextCoachmark(journeyId, false, SHOW_PICK_A_LEVEL_TOOLTIP_AFTER_MS); // Show coachmark => Each table has 3... and Hide the previous two\n nextCoachmark(journeyId, true, SHOW_PICK_A_LEVEL_NUDGE_AFTER_MS); // Show nudge => Pick a level\n\n const startAnimationOnLabelAgain = setTimeout(() => {\n clearTimeout(startAnimationOnLabelAgain);\n highlightedTableRef.current?.startLabelAnimation('YELLOW_4');\n }, START_ANIMATING_CLONED_ELEM);\n\n timerRefs.current.push(startAnimationOnLabelAgain);\n },\n [\n addCoachmark,\n handleContinueJourney,\n handleEndJourney,\n isMobile,\n journeyId,\n nextCoachmark,\n originalTableRef,\n tooltipTextRenderAs,\n ],\n );\n const startJourney = useCallback(\n (tablesData: ITables) => {\n if (\n !originalTableRef.current?.segmentedCardWrapperRef?.current ||\n !originalTableRef.current?.labelRef?.current\n ) {\n return;\n }\n\n const tableCardDims =\n originalTableRef.current?.segmentedCardWrapperRef.current.getBoundingClientRect();\n\n trackAnalytics(PLATFORM_EVENTS_STUDENT.ONBOARDING_STEP_VIEWED, {\n step: Action.TABLES,\n });\n\n setJourney(journeyId, [\n {\n originalElementToHighlightRef: originalTableRef.current.segmentedCardWrapperRef,\n\n type: IndicatorType.TOOLTIP,\n elementToHighlight: <></>,\n indicator: {\n position: 'top',\n backgroundColor: 'YELLOW_4',\n width: 264,\n tooltipItem: (\n <FlexView>\n <Text $renderAs={tooltipTextRenderAs}>\n Get faster at multiplication! Practice everyday and become a Tables champ.\n </Text>\n </FlexView>\n ),\n tooltipXCoOrdinates: tableCardDims.width / 2,\n tooltipYCoOrdinates: 15,\n } as IArrowTooltipProps,\n },\n ]);\n\n nextCoachmark(journeyId, false, SHOW_INITIAL_COACHMARK_AFTER_MS);\n\n addCoachmark(journeyId, {\n originalElementToHighlightRef: originalTableRef.current.segmentedCardWrapperRef,\n\n type: IndicatorType.NUDGE,\n indicator: {\n nudge: 'click',\n content: !isMobile && (\n <Text $renderAs=\"ab1\" $color=\"WHITE\">\n {'Pick a table to start'}\n </Text>\n ),\n nudgePointerX: tableCardDims.width / 2 + 50,\n nudgePointerY: tableCardDims.height / 2,\n } as INudgeProps,\n elementToHighlight: (\n <TablesCard\n ref={highlightedTableRef}\n label={tablesData.label}\n data={tablesData.data}\n onPress={() => {}}\n onPressTableSegment={tableInfo => handleTableSegmentClick(tablesData, tableInfo)}\n />\n ),\n });\n\n nextCoachmark(journeyId, true, SHOW_INITIAL_TOOLTIP_AFTER_MS);\n },\n [\n addCoachmark,\n handleTableSegmentClick,\n isMobile,\n journeyId,\n nextCoachmark,\n originalTableRef,\n setJourney,\n tooltipTextRenderAs,\n trackAnalytics,\n ],\n );\n\n // Cleanup on unmount\n useEffect(() => {\n return () => {\n timerRefs.current.forEach(timer => clearTimeout(timer));\n timerRefs.current = [];\n };\n }, [journeyId]);\n\n return {\n startJourney,\n };\n};\n"],"names":["useTableLauncherJourney","originalTableRef","onTableSegmentClick","onJourneyComplete","onNextJourney","journeyId","JOURNEY_ID_STUDENT","device","useTheme","isMobile","EDeviceType","tooltipTextRenderAs","highlightedTableRef","useRef","timerRefs","nextCoachmark","setJourney","addCoachmark","endJourney","useJourney","trackAnalytics","useUIContext","handleEndJourney","useCallback","tableDetails","PLATFORM_EVENTS_STUDENT","Action","_a","_b","handleContinueJourney","handleTableSegmentClick","launcherData","tableData","_c","tableCardDims","_d","IndicatorType","jsx","TablesCard","FlexView","Text","Fragment","SHOW_PICK_A_LEVEL_TOOLTIP_AFTER_MS","SHOW_PICK_A_LEVEL_NUDGE_AFTER_MS","startAnimationOnLabelAgain","START_ANIMATING_CLONED_ELEM","startJourney","tablesData","_e","SHOW_INITIAL_COACHMARK_AFTER_MS","tableInfo","SHOW_INITIAL_TOOLTIP_AFTER_MS","useEffect","timer"],"mappings":";;;;;;;;;;;;;;AA6BO,MAAMA,KAA0B,CAAC;AAAA,EACtC,kBAAAC;AAAA,EACA,qBAAAC;AAAA,EACA,mBAAAC;AAAA,EACA,eAAAC;AACF,MAA6B;AAC3B,QAAMC,IAAYC,EAAmB,6BAE/B,EAAE,QAAAC,MAAWC,KACbC,IAAWF,MAAWG,EAAY,QAClCC,IAAsBF,IAAW,aAAa,YAE9CG,IAAsBC,EAAsB,IAAI,GAEhDC,IAAYD,EAAwC,CAAA,CAAE,GAEtD,EAAE,eAAAE,GAAe,YAAAC,GAAY,cAAAC,GAAc,YAAAC,EAAA,IAAeC,KAC1D,EAAE,SAASC,EAAe,IAAIC,EAAa,GAE3CC,IAAmBC;AA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