@cuemath/leap 3.2.15-beta-0.1 → 3.2.15-link.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/illustrations/illustrations.js +6 -1
- package/dist/assets/illustrations/illustrations.js.map +1 -1
- package/dist/assets/line-icons/icons/after-noon.js +34 -0
- package/dist/assets/line-icons/icons/after-noon.js.map +1 -0
- package/dist/assets/line-icons/icons/apple-icon-white.js +42 -0
- package/dist/assets/line-icons/icons/apple-icon-white.js.map +1 -0
- package/dist/assets/line-icons/icons/evening.js +35 -0
- package/dist/assets/line-icons/icons/evening.js.map +1 -0
- package/dist/assets/line-icons/icons/morning.js +35 -0
- package/dist/assets/line-icons/icons/morning.js.map +1 -0
- package/dist/assets/line-icons/icons/star3.js +32 -0
- package/dist/assets/line-icons/icons/star3.js.map +1 -0
- package/dist/assets/lottie/lottie.js +11 -6
- package/dist/assets/lottie/lottie.js.map +1 -1
- package/dist/features/analytics-events/platform-events-student.js +1 -2
- package/dist/features/analytics-events/platform-events-student.js.map +1 -1
- package/dist/features/analytics-events/platform-events-teacher.js +4 -6
- package/dist/features/analytics-events/platform-events-teacher.js.map +1 -1
- package/dist/features/analytics-events/whitelist-events.js +8 -10
- package/dist/features/analytics-events/whitelist-events.js.map +1 -1
- package/dist/features/auth/comps/animated-avatar-message/animated-avatar-message-constants.js +9 -0
- package/dist/features/auth/comps/animated-avatar-message/animated-avatar-message-constants.js.map +1 -0
- package/dist/features/auth/comps/animated-avatar-message/animated-avatar-message-styled.js +65 -0
- package/dist/features/auth/comps/animated-avatar-message/animated-avatar-message-styled.js.map +1 -0
- package/dist/features/auth/comps/animated-avatar-message/animated-avatar-message.js +92 -0
- package/dist/features/auth/comps/animated-avatar-message/animated-avatar-message.js.map +1 -0
- package/dist/features/auth/comps/auth-page-layout/auth-page-layout.js +18 -13
- package/dist/features/auth/comps/auth-page-layout/auth-page-layout.js.map +1 -1
- package/dist/features/auth/comps/linear-progress-bar/linear-progress-bar-styled.js +12 -0
- package/dist/features/auth/comps/linear-progress-bar/linear-progress-bar-styled.js.map +1 -0
- package/dist/features/auth/comps/linear-progress-bar/linear-progress-bar.js +34 -0
- package/dist/features/auth/comps/linear-progress-bar/linear-progress-bar.js.map +1 -0
- package/dist/features/auth/comps/otp-input/otp-input-styled.js +22 -0
- package/dist/features/auth/comps/otp-input/otp-input-styled.js.map +1 -0
- package/dist/features/auth/comps/otp-input/otp-input.js +51 -0
- package/dist/features/auth/comps/otp-input/otp-input.js.map +1 -0
- package/dist/features/auth/comps/pill-button/pill-button-styled.js +44 -0
- package/dist/features/auth/comps/pill-button/pill-button-styled.js.map +1 -0
- package/dist/features/auth/comps/pill-button/pill-button.js +75 -0
- package/dist/features/auth/comps/pill-button/pill-button.js.map +1 -0
- package/dist/features/auth/comps/resend-otp/resend-otp.js +54 -47
- package/dist/features/auth/comps/resend-otp/resend-otp.js.map +1 -1
- package/dist/features/auth/comps/selectable-info-card/selectable-info-card-styled.js +17 -0
- package/dist/features/auth/comps/selectable-info-card/selectable-info-card-styled.js.map +1 -0
- package/dist/features/auth/comps/selectable-info-card/selectable-info-card.js +67 -0
- package/dist/features/auth/comps/selectable-info-card/selectable-info-card.js.map +1 -0
- package/dist/features/auth/comps/tabs/tab-tem/tab-item.js +29 -17
- package/dist/features/auth/comps/tabs/tab-tem/tab-item.js.map +1 -1
- package/dist/features/auth/comps/tabs/tabs-styled.js +22 -10
- package/dist/features/auth/comps/tabs/tabs-styled.js.map +1 -1
- package/dist/features/auth/comps/tabs/tabs.js +5 -5
- package/dist/features/auth/comps/tabs/tabs.js.map +1 -1
- package/dist/features/auth/signup-v2/onboarding-guide/onboarding-guide-constants.js +19 -0
- package/dist/features/auth/signup-v2/onboarding-guide/onboarding-guide-constants.js.map +1 -0
- package/dist/features/auth/signup-v2/onboarding-guide/onboarding-guide-styled.js +32 -0
- package/dist/features/auth/signup-v2/onboarding-guide/onboarding-guide-styled.js.map +1 -0
- package/dist/features/auth/signup-v2/onboarding-guide/onboarding-guide.js +44 -0
- package/dist/features/auth/signup-v2/onboarding-guide/onboarding-guide.js.map +1 -0
- package/dist/features/auth/signup-v2/signup-header/signup-header.js +54 -0
- package/dist/features/auth/signup-v2/signup-header/signup-header.js.map +1 -0
- package/dist/features/auth/signup-v2/signup-options/signup-options.js +83 -0
- package/dist/features/auth/signup-v2/signup-options/signup-options.js.map +1 -0
- package/dist/features/chapters-v2/utils/node-card-utils.js +9 -9
- package/dist/features/chapters-v2/utils/node-card-utils.js.map +1 -1
- package/dist/features/communication/pub-sub/constants.js +4 -7
- package/dist/features/communication/pub-sub/constants.js.map +1 -1
- package/dist/features/homework/homework-card-view.js +97 -85
- package/dist/features/homework/homework-card-view.js.map +1 -1
- package/dist/features/homework/homework-card.js +42 -44
- package/dist/features/homework/homework-card.js.map +1 -1
- package/dist/features/homework/hw-card-list/hw-card-list-view.js +29 -31
- package/dist/features/homework/hw-card-list/hw-card-list-view.js.map +1 -1
- package/dist/features/homework/hw-card-list/hw-card-list.js +50 -57
- package/dist/features/homework/hw-card-list/hw-card-list.js.map +1 -1
- package/dist/features/homework/utils.js +27 -33
- package/dist/features/homework/utils.js.map +1 -1
- package/dist/features/journey/comps/coachmark/coachmark.js +28 -29
- package/dist/features/journey/comps/coachmark/coachmark.js.map +1 -1
- package/dist/features/journey/hooks/use-home-page-journey/tooltip-item.js +11 -17
- package/dist/features/journey/hooks/use-home-page-journey/tooltip-item.js.map +1 -1
- package/dist/features/journey/journey-id/journey-id-student.js +2 -2
- package/dist/features/journey/journey-id/journey-id-student.js.map +1 -1
- package/dist/features/journey/journey-id/journey-id-teacher.js +2 -2
- package/dist/features/journey/journey-id/journey-id-teacher.js.map +1 -1
- package/dist/features/journey/use-journey/journey-context-provider.js +72 -73
- package/dist/features/journey/use-journey/journey-context-provider.js.map +1 -1
- package/dist/features/journey/use-journey/journey-styled.js +4 -6
- package/dist/features/journey/use-journey/journey-styled.js.map +1 -1
- package/dist/features/puzzles/comps/puzzle-card-styled.js +69 -24
- package/dist/features/puzzles/comps/puzzle-card-styled.js.map +1 -1
- package/dist/features/puzzles/comps/puzzle-card.js +30 -64
- package/dist/features/puzzles/comps/puzzle-card.js.map +1 -1
- package/dist/features/puzzles/puzzle-container/puzzle-container-styled.js +25 -55
- package/dist/features/puzzles/puzzle-container/puzzle-container-styled.js.map +1 -1
- package/dist/features/puzzles/puzzle-container/puzzle-container.js +107 -100
- package/dist/features/puzzles/puzzle-container/puzzle-container.js.map +1 -1
- package/dist/features/puzzles/puzzle-feedback-celebration/puzzle-feedback-celebration.js +1 -1
- package/dist/features/puzzles/puzzle-feedback-celebration/puzzle-feedback-celebration.js.map +1 -1
- package/dist/features/puzzles/utils/puzzle-pattern.js +13 -28
- package/dist/features/puzzles/utils/puzzle-pattern.js.map +1 -1
- package/dist/features/trial-session/comps/teacher-intro/teacher-intro-styled.js +7 -50
- package/dist/features/trial-session/comps/teacher-intro/teacher-intro-styled.js.map +1 -1
- package/dist/features/trial-session/comps/teacher-intro/teacher-intro.js +15 -69
- package/dist/features/trial-session/comps/teacher-intro/teacher-intro.js.map +1 -1
- package/dist/features/trial-session/comps/teacher-intro/teacher-profile/teacher-profile-styled.js +49 -0
- package/dist/features/trial-session/comps/teacher-intro/teacher-profile/teacher-profile-styled.js.map +1 -0
- package/dist/features/trial-session/comps/teacher-intro/teacher-profile/teacher-profile.js +64 -0
- package/dist/features/trial-session/comps/teacher-intro/teacher-profile/teacher-profile.js.map +1 -0
- package/dist/features/ui/accordion/accordion-items/accordion-items-styled.js +28 -0
- package/dist/features/ui/accordion/accordion-items/accordion-items-styled.js.map +1 -0
- package/dist/features/ui/accordion/accordion-items/accordion-items.js +83 -0
- package/dist/features/ui/accordion/accordion-items/accordion-items.js.map +1 -0
- package/dist/features/ui/accordion/accordion.js +62 -0
- package/dist/features/ui/accordion/accordion.js.map +1 -0
- package/dist/features/ui/arrow-tooltip/arrow-tooltip-styled.js +60 -12
- package/dist/features/ui/arrow-tooltip/arrow-tooltip-styled.js.map +1 -1
- package/dist/features/ui/arrow-tooltip/arrow-tooltip.js +77 -72
- package/dist/features/ui/arrow-tooltip/arrow-tooltip.js.map +1 -1
- package/dist/features/ui/image/image.js +1 -1
- package/dist/features/ui/image/image.js.map +1 -1
- package/dist/features/ui/inputs/base-input/base-input.js +11 -11
- package/dist/features/ui/inputs/base-input/base-input.js.map +1 -1
- package/dist/features/ui/inputs/checkbox-input/checkbox-input.js +21 -21
- package/dist/features/ui/inputs/checkbox-input/checkbox-input.js.map +1 -1
- package/dist/features/ui/inputs/checkbox-input-list/checkbox-input-list.js +5 -5
- package/dist/features/ui/inputs/checkbox-input-list/checkbox-input-list.js.map +1 -1
- package/dist/features/ui/inputs/text-input/text-input.js +19 -18
- package/dist/features/ui/inputs/text-input/text-input.js.map +1 -1
- package/dist/features/ui/modals/modal-styled.js +43 -8
- package/dist/features/ui/modals/modal-styled.js.map +1 -1
- package/dist/features/ui/modals/modal.js +37 -27
- package/dist/features/ui/modals/modal.js.map +1 -1
- package/dist/features/ui/nudge/nudge-styled.js +7 -14
- package/dist/features/ui/nudge/nudge-styled.js.map +1 -1
- package/dist/features/ui/nudge/nudge.js +12 -13
- package/dist/features/ui/nudge/nudge.js.map +1 -1
- package/dist/features/ui/text/text.js +31 -29
- package/dist/features/ui/text/text.js.map +1 -1
- package/dist/features/ui/theme/button.js +78 -78
- package/dist/features/ui/theme/button.js.map +1 -1
- package/dist/features/worksheet/worksheet/worksheet-helpers.js +73 -75
- package/dist/features/worksheet/worksheet/worksheet-helpers.js.map +1 -1
- package/dist/features/worksheet/worksheet/worksheet-question/learnosity-question.js +25 -29
- package/dist/features/worksheet/worksheet/worksheet-question/learnosity-question.js.map +1 -1
- package/dist/features/worksheet/worksheet/worksheet-question/worksheet-question-styled.js +47 -101
- package/dist/features/worksheet/worksheet/worksheet-question/worksheet-question-styled.js.map +1 -1
- package/dist/features/worksheet/worksheet/worksheet-question/worksheet-question.js +146 -149
- package/dist/features/worksheet/worksheet/worksheet-question/worksheet-question.js.map +1 -1
- package/dist/features/worksheet/worksheet/worksheet-questions-controller/worksheet-questions-controller.js +207 -242
- package/dist/features/worksheet/worksheet/worksheet-questions-controller/worksheet-questions-controller.js.map +1 -1
- package/dist/features/worksheet/worksheet/worksheet-styled.js +37 -37
- package/dist/features/worksheet/worksheet/worksheet-styled.js.map +1 -1
- package/dist/features/worksheet/worksheet/worksheet-types.js.map +1 -1
- package/dist/features/worksheet/worksheet/worksheet.js +313 -307
- package/dist/features/worksheet/worksheet/worksheet.js.map +1 -1
- package/dist/features/worksheet/worksheet-preview/hooks/use-worksheet-layout.js +1 -1
- package/dist/features/worksheet/worksheet-preview/hooks/use-worksheet-layout.js.map +1 -1
- package/dist/features/worksheet/worksheet-preview/worksheet-preview.js +35 -44
- package/dist/features/worksheet/worksheet-preview/worksheet-preview.js.map +1 -1
- package/dist/index.d.ts +155 -105
- package/dist/index.js +536 -520
- package/dist/index.js.map +1 -1
- package/dist/static/animated-avatar.1ad58b1d.json +1 -0
- package/dist/static/animated-avatar.69b07505.json +1 -0
- package/dist/static/animated-avatar.9c560b46.json +1 -0
- package/dist/static/calendar-purple.1a840b41.svg +1 -0
- package/dist/static/flying-disk.c7f6ed39.json +1 -0
- package/dist/static/graduation-cap.3be3340a.json +1 -0
- package/dist/static/handshake.287e7dfb.svg +1 -0
- package/dist/static/light-bulb.c6db0b23.json +1 -0
- package/dist/static/money.332aacf1.svg +1 -0
- package/dist/static/muscle.9bcfb8a7.json +1 -0
- package/dist/static/nudge-tap.5cb30093.json +1057 -0
- package/dist/static/parent-avatar.822c7b9b.svg +1 -0
- package/dist/static/pencil.23df9da0.json +1 -0
- package/dist/static/plus-sign.de6af957.json +1 -0
- package/dist/static/racing-car.2cbf864e.json +1 -0
- package/dist/static/rocket.0a3ccab0.json +1 -0
- package/dist/static/shovel.abeec04c.json +1 -0
- package/dist/static/stripe-blurple.6abf422f.svg +1 -0
- package/dist/static/trustpilot.bd3d79e1.svg +1 -0
- package/package.json +2 -3
- package/dist/assets/line-icons/icons/hint-fill.js +0 -35
- package/dist/assets/line-icons/icons/hint-fill.js.map +0 -1
- package/dist/features/journey/hooks/use-puzzles-journey/use-puzzle-assigned.js +0 -72
- package/dist/features/journey/hooks/use-puzzles-journey/use-puzzle-assigned.js.map +0 -1
- package/dist/features/journey/hooks/use-puzzles-journey/use-puzzle-attempt-journey.js +0 -59
- package/dist/features/journey/hooks/use-puzzles-journey/use-puzzle-attempt-journey.js.map +0 -1
- package/dist/features/journey/hooks/use-puzzles-journey/use-puzzle-dashboard-journey.js +0 -63
- package/dist/features/journey/hooks/use-puzzles-journey/use-puzzle-dashboard-journey.js.map +0 -1
- package/dist/features/journey/hooks/use-puzzles-journey/use-puzzle-intro-journey.js +0 -67
- package/dist/features/journey/hooks/use-puzzles-journey/use-puzzle-intro-journey.js.map +0 -1
- package/dist/features/journey/hooks/use-puzzles-journey/use-puzzle-progress-journey.js +0 -70
- package/dist/features/journey/hooks/use-puzzles-journey/use-puzzle-progress-journey.js.map +0 -1
- package/dist/features/journey/hooks/use-puzzles-journey/use-puzzle-review-journey.js +0 -59
- package/dist/features/journey/hooks/use-puzzles-journey/use-puzzle-review-journey.js.map +0 -1
- package/dist/features/journey/hooks/use-puzzles-journey/use-puzzle-unassign-journey.js +0 -59
- package/dist/features/journey/hooks/use-puzzles-journey/use-puzzle-unassign-journey.js.map +0 -1
- package/dist/features/journey/hooks/use-puzzles-journey/use-teacher-puzzle-assigned-journey.js +0 -70
- package/dist/features/journey/hooks/use-puzzles-journey/use-teacher-puzzle-assigned-journey.js.map +0 -1
- package/dist/features/puzzles/api/puzzle-dashboard.js +0 -10
- package/dist/features/puzzles/api/puzzle-dashboard.js.map +0 -1
- package/dist/features/puzzles/app/puzzle-app-styled.js +0 -81
- package/dist/features/puzzles/app/puzzle-app-styled.js.map +0 -1
- package/dist/features/puzzles/app/puzzle-app-view.js +0 -120
- package/dist/features/puzzles/app/puzzle-app-view.js.map +0 -1
- package/dist/features/puzzles/app/puzzle-app.js +0 -82
- package/dist/features/puzzles/app/puzzle-app.js.map +0 -1
- package/dist/features/puzzles/constants/puzzle-container.js +0 -8
- package/dist/features/puzzles/constants/puzzle-container.js.map +0 -1
- package/dist/features/puzzles/puzzle-analytics-events.js +0 -11
- package/dist/features/puzzles/puzzle-analytics-events.js.map +0 -1
- package/dist/features/puzzles/puzzle-container/puzzle-container-view.js +0 -55
- package/dist/features/puzzles/puzzle-container/puzzle-container-view.js.map +0 -1
- package/dist/features/puzzles/puzzle-dashboard/puzzle-dashboard-styled.js +0 -37
- package/dist/features/puzzles/puzzle-dashboard/puzzle-dashboard-styled.js.map +0 -1
- package/dist/features/puzzles/puzzle-dashboard/puzzle-dashboard.js +0 -110
- package/dist/features/puzzles/puzzle-dashboard/puzzle-dashboard.js.map +0 -1
- package/dist/features/ui/arrow-tooltip/arrow-tooltip-constants.js +0 -6
- package/dist/features/ui/arrow-tooltip/arrow-tooltip-constants.js.map +0 -1
- package/dist/features/ui/arrow-tooltip/comps/tooltip-body-styled.js +0 -63
- package/dist/features/ui/arrow-tooltip/comps/tooltip-body-styled.js.map +0 -1
- package/dist/features/ui/arrow-tooltip/comps/tooltip-body.js +0 -21
- package/dist/features/ui/arrow-tooltip/comps/tooltip-body.js.map +0 -1
- package/dist/features/worksheet/worksheet/hooks/use-worksheet-journey.js +0 -28
- package/dist/features/worksheet/worksheet/hooks/use-worksheet-journey.js.map +0 -1
- package/dist/features/worksheet/worksheet/mocks/activity.js +0 -6
- package/dist/features/worksheet/worksheet/mocks/activity.js.map +0 -1
- package/dist/features/worksheet/worksheet/mocks/behaviors/assessment.js +0 -38
- package/dist/features/worksheet/worksheet/mocks/behaviors/assessment.js.map +0 -1
- package/dist/features/worksheet/worksheet/mocks/behaviors/chapter_assessment.js +0 -38
- package/dist/features/worksheet/worksheet/mocks/behaviors/chapter_assessment.js.map +0 -1
- package/dist/features/worksheet/worksheet/mocks/behaviors/diagnostic.js +0 -38
- package/dist/features/worksheet/worksheet/mocks/behaviors/diagnostic.js.map +0 -1
- package/dist/features/worksheet/worksheet/mocks/behaviors/dynamic.js +0 -38
- package/dist/features/worksheet/worksheet/mocks/behaviors/dynamic.js.map +0 -1
- package/dist/features/worksheet/worksheet/mocks/behaviors/extra_practice.js +0 -38
- package/dist/features/worksheet/worksheet/mocks/behaviors/extra_practice.js.map +0 -1
- package/dist/features/worksheet/worksheet/mocks/behaviors/index.js +0 -95
- package/dist/features/worksheet/worksheet/mocks/behaviors/index.js.map +0 -1
- package/dist/features/worksheet/worksheet/mocks/behaviors/learning-v3.js +0 -38
- package/dist/features/worksheet/worksheet/mocks/behaviors/learning-v3.js.map +0 -1
- package/dist/features/worksheet/worksheet/mocks/behaviors/learning.js +0 -38
- package/dist/features/worksheet/worksheet/mocks/behaviors/learning.js.map +0 -1
- package/dist/features/worksheet/worksheet/mocks/behaviors/legacy.js +0 -38
- package/dist/features/worksheet/worksheet/mocks/behaviors/legacy.js.map +0 -1
- package/dist/features/worksheet/worksheet/mocks/behaviors/level2.js +0 -38
- package/dist/features/worksheet/worksheet/mocks/behaviors/level2.js.map +0 -1
- package/dist/features/worksheet/worksheet/mocks/behaviors/level3.js +0 -38
- package/dist/features/worksheet/worksheet/mocks/behaviors/level3.js.map +0 -1
- package/dist/features/worksheet/worksheet/mocks/behaviors/mastery.js +0 -41
- package/dist/features/worksheet/worksheet/mocks/behaviors/mastery.js.map +0 -1
- package/dist/features/worksheet/worksheet/mocks/behaviors/practice.js +0 -38
- package/dist/features/worksheet/worksheet/mocks/behaviors/practice.js.map +0 -1
- package/dist/features/worksheet/worksheet/mocks/behaviors/puzzle-card.js +0 -41
- package/dist/features/worksheet/worksheet/mocks/behaviors/puzzle-card.js.map +0 -1
- package/dist/features/worksheet/worksheet/mocks/behaviors/puzzle_easy.js +0 -39
- package/dist/features/worksheet/worksheet/mocks/behaviors/puzzle_easy.js.map +0 -1
- package/dist/features/worksheet/worksheet/mocks/behaviors/puzzle_hard.js +0 -39
- package/dist/features/worksheet/worksheet/mocks/behaviors/puzzle_hard.js.map +0 -1
- package/dist/features/worksheet/worksheet/mocks/behaviors/puzzle_medium.js +0 -39
- package/dist/features/worksheet/worksheet/mocks/behaviors/puzzle_medium.js.map +0 -1
- package/dist/features/worksheet/worksheet/mocks/behaviors/recap.js +0 -39
- package/dist/features/worksheet/worksheet/mocks/behaviors/recap.js.map +0 -1
- package/dist/features/worksheet/worksheet/mocks/behaviors/remedial.js +0 -39
- package/dist/features/worksheet/worksheet/mocks/behaviors/remedial.js.map +0 -1
- package/dist/features/worksheet/worksheet/mocks/behaviors/revision.js +0 -38
- package/dist/features/worksheet/worksheet/mocks/behaviors/revision.js.map +0 -1
- package/dist/features/worksheet/worksheet/mocks/behaviors/sat-math-assessment.js +0 -38
- package/dist/features/worksheet/worksheet/mocks/behaviors/sat-math-assessment.js.map +0 -1
- package/dist/features/worksheet/worksheet/mocks/behaviors/sat_english_learning.js +0 -38
- package/dist/features/worksheet/worksheet/mocks/behaviors/sat_english_learning.js.map +0 -1
- package/dist/features/worksheet/worksheet/mocks/behaviors/sat_math_learning.js +0 -38
- package/dist/features/worksheet/worksheet/mocks/behaviors/sat_math_learning.js.map +0 -1
- package/dist/features/worksheet/worksheet/mocks/behaviors/sat_math_recap.js +0 -39
- package/dist/features/worksheet/worksheet/mocks/behaviors/sat_math_recap.js.map +0 -1
- package/dist/features/worksheet/worksheet/mocks/behaviors/target_practice.js +0 -38
- package/dist/features/worksheet/worksheet/mocks/behaviors/target_practice.js.map +0 -1
- package/dist/features/worksheet/worksheet/mocks/behaviors/trial-diagnostic-v2.js +0 -38
- package/dist/features/worksheet/worksheet/mocks/behaviors/trial-diagnostic-v2.js.map +0 -1
- package/dist/features/worksheet/worksheet/mocks/behaviors/trial-diagnostic.js +0 -38
- package/dist/features/worksheet/worksheet/mocks/behaviors/trial-diagnostic.js.map +0 -1
- package/dist/features/worksheet/worksheet/mocks/behaviors/turing_assessment.js +0 -38
- package/dist/features/worksheet/worksheet/mocks/behaviors/turing_assessment.js.map +0 -1
- package/dist/features/worksheet/worksheet/mocks/behaviors/turing_practice.js +0 -38
- package/dist/features/worksheet/worksheet/mocks/behaviors/turing_practice.js.map +0 -1
- package/dist/features/worksheet/worksheet/mocks/signed-requests.js +0 -5
- package/dist/features/worksheet/worksheet/mocks/signed-requests.js.map +0 -1
- package/dist/features/worksheet/worksheet/stories/use-canvas-sync-broker-story.js +0 -57
- package/dist/features/worksheet/worksheet/stories/use-canvas-sync-broker-story.js.map +0 -1
- package/dist/features/worksheet/worksheet/stories/worksheet-story-container.js +0 -231
- package/dist/features/worksheet/worksheet/stories/worksheet-story-container.js.map +0 -1
- package/dist/features/worksheet/worksheet/stories/worksheet-student.js +0 -174
- package/dist/features/worksheet/worksheet/stories/worksheet-student.js.map +0 -1
- package/dist/features/worksheet/worksheet/stories/worksheet-teacher.js +0 -255
- package/dist/features/worksheet/worksheet/stories/worksheet-teacher.js.map +0 -1
- package/dist/static/nudge-tap.0591aef4.json +0 -1
- package/dist/static/puzzle-blue-lottie.7017e2e8.json +0 -1
- package/dist/static/puzzle-blue-lottie.bf64ebc5.json +0 -12760
- package/dist/static/puzzle-dashboard-banner.b7956519.svg +0 -1
- package/dist/static/puzzle-green-lottie.1da90698.json +0 -1
- package/dist/static/puzzle-orange-lottie.cfcf3724.json +0 -1
- package/dist/static/puzzle-purple-lottie.e70de110.json +0 -9860
- package/dist/static/puzzle-yellow-lottie.275b5cf4.json +0 -1
- package/dist/types/models/worksheet.js +0 -5
- package/dist/types/models/worksheet.js.map +0 -1
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"hw-card-list.js","sources":["../../../../src/features/homework/hw-card-list/hw-card-list.tsx"],"sourcesContent":["import 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 type { TUserTypes } from '../../ui/types';\n\nimport React, { memo, useCallback, useEffect } from 'react';\n\nimport {
|
1
|
+
{"version":3,"file":"hw-card-list.js","sources":["../../../../src/features/homework/hw-card-list/hw-card-list.tsx"],"sourcesContent":["import 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 type { TUserTypes } from '../../ui/types';\n\nimport React, { memo, useCallback, useEffect } from 'react';\n\nimport { useJourney } from '../../journey/use-journey/use-journey';\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}\n\nconst HWCardList: React.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}) => {\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 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 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 />\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","getHomeworks","hwDetails","isProcessingFailed","isProcessing","isProcessed","isStale","useGetHomeworks","isJourneyActive","useJourney","useEffect","fetchHomeworks","useCallback","jsx","HwCardListView","hwCardList","memo"],"mappings":";;;;;AAyBA,MAAMA,IAAwC,CAAC;AAAA,EAC7C,UAAAC;AAAA,EACA,WAAAC;AAAA,EACA,QAAAC;AAAA,EACA,aAAAC;AAAA,EACA,eAAAC;AAAA,EACA,eAAAC;AAAA,EACA,YAAAC;AAAA,EACA,cAAAC;AAAA,EACA,cAAAC;AAAA,EACA,gBAAAC;AAAA,EACA,aAAAC;AAAA,EACA,sBAAAC;AAAA,EACA,iBAAAC;AACF,MAAM;AACE,QAAA;AAAA,IACJ,KAAKC;AAAA,IACL,MAAMC;AAAA,IACN,oBAAAC;AAAA,IACA,cAAAC;AAAA,IACA,aAAAC;AAAA,IACA,SAAAC;AAAA,EAAA,IACEC,EAAgBlB,CAAS,GACvB,EAAE,iBAAAmB,MAAoBC;AAE5B,EAAAC,EAAU,MAAM;AACd,IAAIL,KAAeN,KAAwB,CAACS,KAAmBR,KAC7DD,EAAqB,EAAE,WAAAV,GAAW,QAAAC,GAAQ,UAAAF,EAAU,CAAA;AAAA,EACtD,GACC;AAAA,IACDY;AAAA,IACAQ;AAAA,IACAH;AAAA,IACAN;AAAA,IACAT;AAAA,IACAD;AAAA,IACAD;AAAA,EAAA,CACD;AAEK,QAAAuB,IAAiBC,EAAY,MAAM;AACvC,IAAAX,EAAaZ,GAAW,QAAW,EAAE,QAAAC,EAAQ,CAAA;AAAA,EAC5C,GAAA,CAACW,GAAcX,GAAQD,CAAS,CAAC;AAYpC,SAVAqB,EAAU,MAAM;AACV,IAAA,CAACN,KAAgBE,KACJK;EAEhB,GAAA,CAACA,GAAgBP,GAAcE,CAAO,CAAC,GAE1CI,EAAU,MAAM;AACC,IAAAC;EAAA,GACd,CAACA,CAAc,CAAC,GAEfR,IACK,OAIP,gBAAAU,EAAC,OAAI,EAAA,KAAKf,GACR,UAAA,gBAAAe;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,gBAAgBV;AAAA,MAChB,WAAAF;AAAA,MACA,aAAAX;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,IAAA;AAAA,EAEJ,EAAA,CAAA;AAEJ,GAEe0B,IAAAC,EAAK7B,CAAU;"}
|
@@ -1,54 +1,48 @@
|
|
1
1
|
import { TESTS_CREATION_ANALYTICS_EVENTS as l } from "../milestone/milestone-tests/tests-creation/tests-creation-analytics-events.js";
|
2
|
-
import { NODE_TYPE as
|
2
|
+
import { NODE_TYPE as E } from "../sheets/constants/sheet.js";
|
3
3
|
import { HOMEWORK_ANALYTICS_EVENTS as c } from "./homework-analytics-events.js";
|
4
4
|
const y = ({
|
5
|
-
canResume:
|
6
|
-
canStart:
|
7
|
-
homeworkId:
|
8
|
-
isHomeWork:
|
9
|
-
isStudent:
|
10
|
-
milestoneId:
|
11
|
-
nodeType:
|
12
|
-
studentId:
|
13
|
-
userNodeId:
|
5
|
+
canResume: a,
|
6
|
+
canStart: i,
|
7
|
+
homeworkId: e,
|
8
|
+
isHomeWork: _,
|
9
|
+
isStudent: o,
|
10
|
+
milestoneId: n,
|
11
|
+
nodeType: t,
|
12
|
+
studentId: r,
|
13
|
+
userNodeId: s
|
14
14
|
}) => {
|
15
|
-
if (
|
16
|
-
if (
|
17
|
-
return
|
15
|
+
if (o) {
|
16
|
+
if (_)
|
17
|
+
return i || a ? {
|
18
18
|
analyticsLabel: c.HOMEWORK_ATTEMPTED,
|
19
|
-
analyticsProps: { student_id:
|
19
|
+
analyticsProps: { student_id: r, node_type: t, homework_id: e }
|
20
20
|
} : {
|
21
21
|
analyticsLabel: "homework-student-menu",
|
22
|
-
analyticsProps: { student_id:
|
22
|
+
analyticsProps: { student_id: r, node_type: t, homework_id: e }
|
23
23
|
};
|
24
|
-
if (
|
24
|
+
if (i || a)
|
25
25
|
return {
|
26
|
-
analyticsLabel:
|
26
|
+
analyticsLabel: t === E.DYNAMIC ? l.CUSTOM_TEST_ATTEMPTED : "node-attempted",
|
27
27
|
analyticsProps: {
|
28
|
-
student_id:
|
29
|
-
node_type:
|
30
|
-
user_node_id:
|
31
|
-
milestone_id:
|
32
|
-
can_start:
|
33
|
-
can_resume:
|
28
|
+
student_id: r,
|
29
|
+
node_type: t,
|
30
|
+
user_node_id: s,
|
31
|
+
milestone_id: n,
|
32
|
+
can_start: i,
|
33
|
+
can_resume: a
|
34
34
|
}
|
35
35
|
};
|
36
36
|
}
|
37
|
-
return
|
37
|
+
return _ ? {
|
38
38
|
analyticsLabel: "homework-card-teacher",
|
39
|
-
analyticsProps: { student_id:
|
39
|
+
analyticsProps: { student_id: r, node_type: t }
|
40
40
|
} : {
|
41
41
|
analyticsLabel: "goals-card-teacher",
|
42
|
-
analyticsProps: { student_id:
|
42
|
+
analyticsProps: { student_id: r, node_type: t }
|
43
43
|
};
|
44
|
-
}, T = (t) => {
|
45
|
-
if (!t)
|
46
|
-
return;
|
47
|
-
const { assigned_homeworks: e } = t;
|
48
|
-
return e.find((i) => i.node_type === n.PUZZLE_CARD);
|
49
44
|
};
|
50
45
|
export {
|
51
|
-
y as getCardAnalyticProps
|
52
|
-
T as getPuzzleCardData
|
46
|
+
y as getCardAnalyticProps
|
53
47
|
};
|
54
48
|
//# sourceMappingURL=utils.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"utils.js","sources":["../../../src/features/homework/utils.ts"],"sourcesContent":["import type { TNodeTypes } from '../chapters-v2/comps/node-card/node-card-types';\
|
1
|
+
{"version":3,"file":"utils.js","sources":["../../../src/features/homework/utils.ts"],"sourcesContent":["import type { TNodeTypes } from '../chapters-v2/comps/node-card/node-card-types';\n\nimport { TESTS_CREATION_ANALYTICS_EVENTS } from '../milestone/milestone-tests/tests-creation/tests-creation-analytics-events';\nimport { NODE_TYPE } from '../sheets/constants/sheet';\nimport { HOMEWORK_ANALYTICS_EVENTS } from './homework-analytics-events';\n\ninterface IGetCardAnalyticProps {\n canResume: boolean;\n canStart: boolean;\n homeworkId?: string;\n isHomeWork: boolean;\n isStudent: boolean;\n milestoneId?: string;\n nodeType: TNodeTypes;\n studentId: string;\n userNodeId: string | null;\n}\n\nconst getCardAnalyticProps = ({\n canResume,\n canStart,\n homeworkId,\n isHomeWork,\n isStudent,\n milestoneId,\n nodeType,\n studentId,\n userNodeId,\n}: IGetCardAnalyticProps) => {\n if (isStudent) {\n if (isHomeWork) {\n if (canStart || canResume) {\n return {\n analyticsLabel: HOMEWORK_ANALYTICS_EVENTS.HOMEWORK_ATTEMPTED,\n analyticsProps: { student_id: studentId, node_type: nodeType, homework_id: homeworkId },\n };\n }\n\n return {\n analyticsLabel: 'homework-student-menu',\n analyticsProps: { student_id: studentId, node_type: nodeType, homework_id: homeworkId },\n };\n }\n\n if (canStart || canResume) {\n return {\n analyticsLabel:\n nodeType === NODE_TYPE.DYNAMIC\n ? TESTS_CREATION_ANALYTICS_EVENTS.CUSTOM_TEST_ATTEMPTED\n : 'node-attempted',\n analyticsProps: {\n student_id: studentId,\n node_type: nodeType,\n user_node_id: userNodeId,\n milestone_id: milestoneId,\n can_start: canStart,\n can_resume: canResume,\n },\n };\n }\n }\n\n if (isHomeWork) {\n return {\n analyticsLabel: 'homework-card-teacher',\n analyticsProps: { student_id: studentId, node_type: nodeType },\n };\n }\n\n return {\n analyticsLabel: 'goals-card-teacher',\n analyticsProps: { student_id: studentId, node_type: nodeType },\n };\n};\n\nexport { getCardAnalyticProps };\n"],"names":["getCardAnalyticProps","canResume","canStart","homeworkId","isHomeWork","isStudent","milestoneId","nodeType","studentId","userNodeId","HOMEWORK_ANALYTICS_EVENTS","NODE_TYPE","TESTS_CREATION_ANALYTICS_EVENTS"],"mappings":";;;AAkBA,MAAMA,IAAuB,CAAC;AAAA,EAC5B,WAAAC;AAAA,EACA,UAAAC;AAAA,EACA,YAAAC;AAAA,EACA,YAAAC;AAAA,EACA,WAAAC;AAAA,EACA,aAAAC;AAAA,EACA,UAAAC;AAAA,EACA,WAAAC;AAAA,EACA,YAAAC;AACF,MAA6B;AAC3B,MAAIJ,GAAW;AACb,QAAID;AACF,aAAIF,KAAYD,IACP;AAAA,QACL,gBAAgBS,EAA0B;AAAA,QAC1C,gBAAgB,EAAE,YAAYF,GAAW,WAAWD,GAAU,aAAaJ,EAAW;AAAA,MAAA,IAInF;AAAA,QACL,gBAAgB;AAAA,QAChB,gBAAgB,EAAE,YAAYK,GAAW,WAAWD,GAAU,aAAaJ,EAAW;AAAA,MAAA;AAI1F,QAAID,KAAYD;AACP,aAAA;AAAA,QACL,gBACEM,MAAaI,EAAU,UACnBC,EAAgC,wBAChC;AAAA,QACN,gBAAgB;AAAA,UACd,YAAYJ;AAAA,UACZ,WAAWD;AAAA,UACX,cAAcE;AAAA,UACd,cAAcH;AAAA,UACd,WAAWJ;AAAA,UACX,YAAYD;AAAA,QACd;AAAA,MAAA;AAAA,EAGN;AAEA,SAAIG,IACK;AAAA,IACL,gBAAgB;AAAA,IAChB,gBAAgB,EAAE,YAAYI,GAAW,WAAWD,EAAS;AAAA,EAAA,IAI1D;AAAA,IACL,gBAAgB;AAAA,IAChB,gBAAgB,EAAE,YAAYC,GAAW,WAAWD,EAAS;AAAA,EAAA;AAEjE;"}
|
@@ -1,19 +1,18 @@
|
|
1
1
|
import { jsx as i, jsxs as g, Fragment as m } from "react/jsx-runtime";
|
2
2
|
import L from "../../../../node_modules/lodash.throttle/index.js";
|
3
|
-
import { useState as
|
4
|
-
import { useTheme as
|
3
|
+
import { useState as O, useEffect as $, useMemo as p } from "react";
|
4
|
+
import { useTheme as R } from "styled-components";
|
5
5
|
import c from "../../../ui/arrow-tooltip/arrow-tooltip.js";
|
6
|
-
import
|
7
|
-
import A from "../../../ui/
|
8
|
-
import { EDeviceType as X } from "../../../ui/theme/constants.js";
|
6
|
+
import a from "../../../ui/nudge/nudge.js";
|
7
|
+
import { EDeviceType as A } from "../../../ui/theme/constants.js";
|
9
8
|
import { IndicatorType as u } from "../../use-journey/constants.js";
|
10
|
-
import { CoachmarkBody as
|
11
|
-
import { getTooltipXCoordinates as
|
12
|
-
const
|
9
|
+
import { CoachmarkBody as X, ClonedElementWrapper as h } from "./coachmark-styled.js";
|
10
|
+
import { getTooltipXCoordinates as Y } from "./coachmark-utils.js";
|
11
|
+
const V = ({
|
13
12
|
coachmark: e,
|
14
13
|
isInsideScrollView: T
|
15
14
|
}) => {
|
16
|
-
const t = e.originalElementToHighlightRef.current, { device: C, zIndex: I } =
|
15
|
+
const t = e.originalElementToHighlightRef.current, { device: C, zIndex: I } = R(), [v, E] = O(() => {
|
17
16
|
const o = t == null ? void 0 : t.getBoundingClientRect();
|
18
17
|
return {
|
19
18
|
top: ((o == null ? void 0 : o.top) ?? 0) + window.scrollY,
|
@@ -21,32 +20,32 @@ const S = ({
|
|
21
20
|
width: (o == null ? void 0 : o.width) ?? 0,
|
22
21
|
height: (o == null ? void 0 : o.height) ?? 0
|
23
22
|
};
|
24
|
-
}),
|
23
|
+
}), n = L(() => {
|
25
24
|
const o = t == null ? void 0 : t.getBoundingClientRect();
|
26
|
-
o &&
|
25
|
+
o && E({
|
27
26
|
top: o.top + window.scrollY,
|
28
27
|
left: o.left + window.scrollX,
|
29
28
|
width: o.width,
|
30
29
|
height: o.height
|
31
30
|
});
|
32
31
|
}, 100), {
|
33
|
-
top:
|
32
|
+
top: r = 0,
|
34
33
|
left: l = 0,
|
35
|
-
height:
|
34
|
+
height: P = 0,
|
36
35
|
width: b = 0
|
37
|
-
} = T ?
|
38
|
-
|
39
|
-
window.removeEventListener("resize",
|
40
|
-
}), [
|
41
|
-
const
|
36
|
+
} = T ? v : (t == null ? void 0 : t.getBoundingClientRect()) ?? {};
|
37
|
+
$(() => (window.addEventListener("resize", n), window.addEventListener("scroll", n), () => {
|
38
|
+
window.removeEventListener("resize", n), window.removeEventListener("scroll", n);
|
39
|
+
}), [n, t]);
|
40
|
+
const w = C === A.MOBILE, d = I.JOURNEY_OVERLAY, s = p(() => t ? window.getComputedStyle(t).position === "absolute" : !1, [t]), f = p(() => {
|
42
41
|
const o = e.indicator;
|
43
42
|
return {
|
44
|
-
width:
|
43
|
+
width: w ? 246 : 264,
|
45
44
|
// Can be over ridden
|
46
|
-
tooltipXCoOrdinates:
|
45
|
+
tooltipXCoOrdinates: Y(o),
|
47
46
|
zIndex: d + 1,
|
48
47
|
...o,
|
49
|
-
tooltipItem: /* @__PURE__ */ i(
|
48
|
+
tooltipItem: /* @__PURE__ */ i(X, { children: o.tooltipItem }),
|
50
49
|
alwaysVisible: !0,
|
51
50
|
renderAs: "primary",
|
52
51
|
// Deprecate this
|
@@ -56,31 +55,31 @@ const S = ({
|
|
56
55
|
type: u.TOOLTIP,
|
57
56
|
isAnimated: !0
|
58
57
|
};
|
59
|
-
}, [d, e.indicator,
|
58
|
+
}, [d, e.indicator, w]), y = p(() => {
|
60
59
|
const o = e.indicator;
|
61
60
|
return {
|
62
61
|
...o,
|
63
62
|
nudgePointerX: l + (o.nudgePointerX ?? 0),
|
64
|
-
nudgePointerY:
|
63
|
+
nudgePointerY: r + (o.nudgePointerY ?? 0)
|
65
64
|
};
|
66
|
-
}, [e.indicator, l,
|
65
|
+
}, [e.indicator, l, r]);
|
67
66
|
return !t || !e.isActive ? null : e.type === u.TOOLTIP ? s ? /* @__PURE__ */ g(m, { children: [
|
68
67
|
e.elementToHighlight,
|
69
|
-
/* @__PURE__ */ i(h, { $position: "absolute", $top:
|
70
|
-
] }) : /* @__PURE__ */ i(h, { $position: "absolute", $top:
|
68
|
+
/* @__PURE__ */ i(h, { $position: "absolute", $top: r, $left: l, children: /* @__PURE__ */ i(c, { ...f, children: /* @__PURE__ */ i("div", { style: { height: P, width: b } }) }) })
|
69
|
+
] }) : /* @__PURE__ */ i(h, { $position: "absolute", $top: r, $left: l, children: /* @__PURE__ */ i(c, { ...f, children: e.elementToHighlight }) }) : e.type === u.NUDGE ? /* @__PURE__ */ g(m, { children: [
|
71
70
|
/* @__PURE__ */ i(
|
72
71
|
h,
|
73
72
|
{
|
74
|
-
$top: s ? 0 :
|
73
|
+
$top: s ? 0 : r,
|
75
74
|
$left: s ? 0 : l,
|
76
75
|
$position: s ? "relative" : "absolute",
|
77
76
|
children: e.elementToHighlight
|
78
77
|
}
|
79
78
|
),
|
80
|
-
/* @__PURE__ */ i(
|
79
|
+
/* @__PURE__ */ i(a, { zIndex: d + 1, ...y })
|
81
80
|
] }) : null;
|
82
81
|
};
|
83
82
|
export {
|
84
|
-
|
83
|
+
V as Coachmark
|
85
84
|
};
|
86
85
|
//# sourceMappingURL=coachmark.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"coachmark.js","sources":["../../../../../src/features/journey/comps/coachmark/coachmark.tsx"],"sourcesContent":["import type { IArrowTooltipProps } from '../../../ui/arrow-tooltip/arrow-tooltip-types';\nimport type { INudgeProps } from '../../../ui/nudge/nudge-types';\nimport type { ICoachmarkProps } from '../../use-journey/journey-context-types';\n\nimport throttle from 'lodash.throttle';\nimport React, { useEffect, useMemo, useState } from 'react';\nimport { useTheme } from 'styled-components';\n\nimport ArrowTooltip from '../../../ui/arrow-tooltip/arrow-tooltip';\nimport Nudge from '../../../ui/nudge/nudge';\nimport
|
1
|
+
{"version":3,"file":"coachmark.js","sources":["../../../../../src/features/journey/comps/coachmark/coachmark.tsx"],"sourcesContent":["import type { IArrowTooltipProps } from '../../../ui/arrow-tooltip/arrow-tooltip-types';\nimport type { INudgeProps } from '../../../ui/nudge/nudge-types';\nimport type { ICoachmarkProps } from '../../use-journey/journey-context-types';\n\nimport throttle from 'lodash.throttle';\nimport React, { useEffect, useMemo, useState } from 'react';\nimport { useTheme } from 'styled-components';\n\nimport ArrowTooltip from '../../../ui/arrow-tooltip/arrow-tooltip';\nimport Nudge from '../../../ui/nudge/nudge';\nimport { EDeviceType } from '../../../ui/theme/constants';\nimport { IndicatorType } from '../../use-journey/constants';\nimport * as S from './coachmark-styled';\nimport { getTooltipXCoordinates } from './coachmark-utils';\n\nexport const Coachmark: React.FC<{ coachmark: ICoachmarkProps; isInsideScrollView: boolean }> = ({\n coachmark,\n isInsideScrollView,\n}) => {\n const targetElement = coachmark.originalElementToHighlightRef.current;\n const { device, zIndex } = useTheme();\n\n const [position, setPosition] = useState(() => {\n const rect = targetElement?.getBoundingClientRect();\n\n return {\n top: (rect?.top ?? 0) + window.scrollY,\n left: rect?.left ?? 0 + window.scrollX,\n width: rect?.width ?? 0,\n height: rect?.height ?? 0,\n };\n });\n\n const handlePositionChange = throttle(() => {\n const rect = targetElement?.getBoundingClientRect();\n\n if (rect) {\n setPosition({\n top: rect.top + window.scrollY,\n left: rect.left + window.scrollX,\n width: rect.width,\n height: rect.height,\n });\n }\n }, 100);\n\n const {\n top = 0,\n left = 0,\n height = 0,\n width = 0,\n } = isInsideScrollView ? position : targetElement?.getBoundingClientRect() ?? {};\n\n useEffect(() => {\n window.addEventListener('resize', handlePositionChange);\n window.addEventListener('scroll', handlePositionChange);\n\n return () => {\n window.removeEventListener('resize', handlePositionChange);\n window.removeEventListener('scroll', handlePositionChange);\n };\n }, [handlePositionChange, targetElement]);\n\n const isMobile = device === EDeviceType.MOBILE;\n\n const BLUR_OVERLAY_Z_INDEX = zIndex.JOURNEY_OVERLAY;\n\n const isAbsolute = useMemo(() => {\n if (!targetElement) return false;\n\n return window.getComputedStyle(targetElement).position === 'absolute';\n }, [targetElement]);\n\n const tooltipProps = useMemo(() => {\n const arrowToolTipProps = coachmark.indicator as IArrowTooltipProps;\n\n return {\n width: isMobile ? 246 : 264, // Can be over ridden\n tooltipXCoOrdinates: getTooltipXCoordinates(arrowToolTipProps),\n zIndex: BLUR_OVERLAY_Z_INDEX + 1,\n ...arrowToolTipProps,\n tooltipItem: <S.CoachmarkBody>{arrowToolTipProps.tooltipItem}</S.CoachmarkBody>,\n alwaysVisible: true,\n renderAs: 'primary', // Deprecate this\n borderWidth: 1,\n arrowColor: arrowToolTipProps.arrowColor || 'WHITE',\n borderColor: arrowToolTipProps.borderColor || 'WHITE',\n type: IndicatorType.TOOLTIP,\n isAnimated: true,\n } as IArrowTooltipProps;\n }, [BLUR_OVERLAY_Z_INDEX, coachmark.indicator, isMobile]);\n\n const nudgeProps = useMemo(() => {\n const props: INudgeProps = coachmark.indicator as INudgeProps;\n\n return {\n ...props,\n nudgePointerX: left + (props.nudgePointerX ?? 0),\n nudgePointerY: top + (props.nudgePointerY ?? 0),\n };\n }, [coachmark.indicator, left, top]);\n\n if (!targetElement || !coachmark.isActive) {\n return null;\n }\n\n if (coachmark.type === IndicatorType.TOOLTIP) {\n if (isAbsolute) {\n return (\n <>\n {coachmark.elementToHighlight}\n <S.ClonedElementWrapper $position=\"absolute\" $top={top} $left={left}>\n <ArrowTooltip {...tooltipProps}>\n <div style={{ height, width }} />\n </ArrowTooltip>\n </S.ClonedElementWrapper>\n </>\n );\n }\n\n return (\n <S.ClonedElementWrapper $position=\"absolute\" $top={top} $left={left}>\n <ArrowTooltip {...tooltipProps}>{coachmark.elementToHighlight}</ArrowTooltip>\n </S.ClonedElementWrapper>\n );\n }\n\n if (coachmark.type === IndicatorType.NUDGE) {\n return (\n <>\n <S.ClonedElementWrapper\n $top={isAbsolute ? 0 : top}\n $left={isAbsolute ? 0 : left}\n $position={isAbsolute ? 'relative' : 'absolute'}\n >\n {coachmark.elementToHighlight}\n </S.ClonedElementWrapper>\n <Nudge zIndex={BLUR_OVERLAY_Z_INDEX + 1} {...nudgeProps} />\n </>\n );\n }\n\n return null;\n};\n"],"names":["Coachmark","coachmark","isInsideScrollView","targetElement","device","zIndex","useTheme","position","setPosition","useState","rect","handlePositionChange","throttle","top","left","height","width","useEffect","isMobile","EDeviceType","BLUR_OVERLAY_Z_INDEX","isAbsolute","useMemo","tooltipProps","arrowToolTipProps","getTooltipXCoordinates","jsx","S.CoachmarkBody","IndicatorType","nudgeProps","props","jsxs","Fragment","S.ClonedElementWrapper","ArrowTooltip","Nudge"],"mappings":"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"}
|
@@ -1,28 +1,22 @@
|
|
1
|
-
import { jsxs as
|
2
|
-
import { memo as
|
3
|
-
import
|
4
|
-
import
|
5
|
-
import
|
6
|
-
const
|
7
|
-
|
8
|
-
element: r,
|
9
|
-
buttonLabel: t,
|
10
|
-
onButtonClick: m,
|
11
|
-
ctaWidth: i
|
12
|
-
}) => /* @__PURE__ */ l(p, { $flexRowGapX: 0.75, children: [
|
13
|
-
r ? /* @__PURE__ */ o(s, { children: r }) : /* @__PURE__ */ o(a, { $renderAs: "ab2-bold", children: e }),
|
1
|
+
import { jsxs as i, jsx as o, Fragment as l } from "react/jsx-runtime";
|
2
|
+
import { memo as s } from "react";
|
3
|
+
import n from "../../../ui/buttons/button/button.js";
|
4
|
+
import d from "../../../ui/layout/flex-view.js";
|
5
|
+
import p from "../../../ui/text/text.js";
|
6
|
+
const a = ({ text: e, element: r, buttonLabel: t, onButtonClick: m }) => /* @__PURE__ */ i(d, { $flexRowGapX: 0.75, children: [
|
7
|
+
r ? /* @__PURE__ */ o(l, { children: r }) : /* @__PURE__ */ o(p, { $renderAs: "ab2-bold", children: e }),
|
14
8
|
/* @__PURE__ */ o(
|
15
|
-
|
9
|
+
n,
|
16
10
|
{
|
17
11
|
label: t,
|
18
12
|
size: "xsmall",
|
19
|
-
|
13
|
+
widthX: 6,
|
20
14
|
renderAs: "secondary",
|
21
15
|
onClick: m
|
22
16
|
}
|
23
17
|
)
|
24
|
-
] }),
|
18
|
+
] }), w = s(a);
|
25
19
|
export {
|
26
|
-
|
20
|
+
w as default
|
27
21
|
};
|
28
22
|
//# sourceMappingURL=tooltip-item.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"tooltip-item.js","sources":["../../../../../src/features/journey/hooks/use-home-page-journey/tooltip-item.tsx"],"sourcesContent":["import type { JSX } from 'react';\n\nimport { memo } from 'react';\n\nimport Button from '../../../ui/buttons/button/button';\nimport FlexView from '../../../ui/layout/flex-view';\nimport Text from '../../../ui/text/text';\n\ninterface ITooltipItemProps {\n text?: string;\n element?: JSX.Element;\n buttonLabel: string;\n onButtonClick: () => void;\n
|
1
|
+
{"version":3,"file":"tooltip-item.js","sources":["../../../../../src/features/journey/hooks/use-home-page-journey/tooltip-item.tsx"],"sourcesContent":["import type { JSX } from 'react';\n\nimport { memo } from 'react';\n\nimport Button from '../../../ui/buttons/button/button';\nimport FlexView from '../../../ui/layout/flex-view';\nimport Text from '../../../ui/text/text';\n\ninterface ITooltipItemProps {\n text?: string;\n element?: JSX.Element;\n buttonLabel: string;\n onButtonClick: () => void;\n}\n\nconst TooltipItem = ({ text, element, buttonLabel, onButtonClick }: ITooltipItemProps) => (\n <FlexView $flexRowGapX={0.75}>\n {element ? <>{element}</> : <Text $renderAs=\"ab2-bold\">{text}</Text>}\n <Button\n label={buttonLabel}\n size=\"xsmall\"\n widthX={6}\n renderAs=\"secondary\"\n onClick={onButtonClick}\n />\n </FlexView>\n);\n\nexport default memo(TooltipItem);\n"],"names":["TooltipItem","text","element","buttonLabel","onButtonClick","jsxs","FlexView","Text","jsx","Button","TooltipItem$1","memo"],"mappings":";;;;;AAeA,MAAMA,IAAc,CAAC,EAAE,MAAAC,GAAM,SAAAC,GAAS,aAAAC,GAAa,eAAAC,QACjD,gBAAAC,EAACC,GAAS,EAAA,cAAc,MACrB,UAAA;AAAA,EAAAJ,2BAAa,UAAQA,EAAA,CAAA,sBAAOK,GAAK,EAAA,WAAU,YAAY,UAAKN,EAAA,CAAA;AAAA,EAC7D,gBAAAO;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,OAAON;AAAA,MACP,MAAK;AAAA,MACL,QAAQ;AAAA,MACR,UAAS;AAAA,MACT,SAASC;AAAA,IAAA;AAAA,EACX;AAAA,EACF,CAAA,GAGaM,IAAAC,EAAKX,CAAW;"}
|
@@ -1,5 +1,5 @@
|
|
1
|
-
var
|
1
|
+
var E = /* @__PURE__ */ ((R) => (R.CIRCLE_ACTIVITIES_INTRO_JOURNEY = "CIRCLE_ACTIVITIES_INTRO_JOURNEY", R.CIRCLE_LEADERBOARD_INTRO_JOURNEY = "CIRCLE_LEADERBOARD_INTRO_JOURNEY", R.CIRCLE_POINTS_REWARD_JOURNEY = "CIRCLE_POINTS_REWARD_JOURNEY", R.CIRCLE_STREAK_UPDATE_JOURNEY = "CIRCLE_STREAK_UPDATE_JOURNEY", R.CIRCLE_TUTORIAL_JOURNEY = "CIRCLE_TUTORIAL_JOURNEY", R.CIRCLE_TABLES_INTRO_JOURNEY = "CIRCLE_TABLES_INTRO_JOURNEY", R.CIRCLE_TABLES_INFINTE_JOURNEY = "CIRCLE_TABLES_INFINITE_JOURNEY", R.CIRCLE_LESSONS_K_1_INTRO_JOURNEY = "CIRCLE_LESSONS_K_1_INTRO_JOURNEY", R.CIRCLE_STREAK_REDUCTION_JOURNEY = "CIRCLE_STREAK_REDUCTION_JOURNEY", R.HOMEPAGE_JOURNEY = "HOMEPAGE_JOURNEY", R.CHAPTER_PAGE_JOURNEY = "CHAPTER_PAGE_JOURNEY", R.CHALLENGE_ARENA_JOURNEY = "CHALLENGE_ARENA_JOURNEY", R))(E || {});
|
2
2
|
export {
|
3
|
-
|
3
|
+
E as JOURNEY_ID_STUDENT
|
4
4
|
};
|
5
5
|
//# sourceMappingURL=journey-id-student.js.map
|
@@ -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\n // TODO: Deprecate bottom journeys, they are not actually journeys\n
|
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\n // TODO: Deprecate bottom journeys, they are not actually journeys\n CIRCLE_STREAK_REDUCTION_JOURNEY = 'CIRCLE_STREAK_REDUCTION_JOURNEY',\n HOMEPAGE_JOURNEY = 'HOMEPAGE_JOURNEY',\n CHAPTER_PAGE_JOURNEY = 'CHAPTER_PAGE_JOURNEY',\n CHALLENGE_ARENA_JOURNEY = 'CHALLENGE_ARENA_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,oCAGnCA,EAAA,kCAAkC,mCAClCA,EAAA,mBAAmB,oBACnBA,EAAA,uBAAuB,wBACvBA,EAAA,0BAA0B,2BAdhBA,IAAAA,KAAA,CAAA,CAAA;"}
|
@@ -1,5 +1,5 @@
|
|
1
|
-
var
|
1
|
+
var A = /* @__PURE__ */ ((E) => (E.HOMEPAGE_JOURNEY = "HOMEPAGE_JOURNEY", E.CHAPTER_PAGE_JOURNEY = "CHAPTER_PAGE_JOURNEY", E.CHALLENGE_ARENA_JOURNEY = "CHALLENGE_ARENA_JOURNEY", E))(A || {});
|
2
2
|
export {
|
3
|
-
|
3
|
+
A as JOURNEY_ID_TEACHER
|
4
4
|
};
|
5
5
|
//# sourceMappingURL=journey-id-teacher.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"journey-id-teacher.js","sources":["../../../../src/features/journey/journey-id/journey-id-teacher.ts"],"sourcesContent":["export enum JOURNEY_ID_TEACHER {\n HOMEPAGE_JOURNEY = 'HOMEPAGE_JOURNEY',\n CHAPTER_PAGE_JOURNEY = 'CHAPTER_PAGE_JOURNEY',\n CHALLENGE_ARENA_JOURNEY = 'CHALLENGE_ARENA_JOURNEY',\n
|
1
|
+
{"version":3,"file":"journey-id-teacher.js","sources":["../../../../src/features/journey/journey-id/journey-id-teacher.ts"],"sourcesContent":["export enum JOURNEY_ID_TEACHER {\n HOMEPAGE_JOURNEY = 'HOMEPAGE_JOURNEY',\n CHAPTER_PAGE_JOURNEY = 'CHAPTER_PAGE_JOURNEY',\n CHALLENGE_ARENA_JOURNEY = 'CHALLENGE_ARENA_JOURNEY',\n}\n"],"names":["JOURNEY_ID_TEACHER"],"mappings":"AAAY,IAAAA,sBAAAA,OACVA,EAAA,mBAAmB,oBACnBA,EAAA,uBAAuB,wBACvBA,EAAA,0BAA0B,2BAHhBA,IAAAA,KAAA,CAAA,CAAA;"}
|
@@ -1,55 +1,55 @@
|
|
1
|
-
import { jsxs as
|
2
|
-
import { createContext as
|
3
|
-
import { Coachmark as
|
4
|
-
import { usePostUserJourney as
|
5
|
-
import { Overlay as
|
6
|
-
const
|
7
|
-
const [
|
1
|
+
import { jsxs as L, jsx as O } from "react/jsx-runtime";
|
2
|
+
import { createContext as N, useState as c, useRef as v, useCallback as h, useMemo as R, useEffect as T } from "react";
|
3
|
+
import { Coachmark as W } from "../comps/coachmark/coachmark.js";
|
4
|
+
import { usePostUserJourney as M, useGetUserJourney as V } from "../user-journey-api/user-journey-api.js";
|
5
|
+
import { Overlay as G } from "./journey-styled.js";
|
6
|
+
const F = N(null), I = ({ children: b, appId: i, userId: u }) => {
|
7
|
+
const [U, q] = c(!1), [k, p] = c(null), [a, l] = c([]), [f, x] = c(!1), m = v(-1), t = v(void 0), w = v([]), [z, B] = c(!1), [A, D] = c({
|
8
8
|
height: window.innerHeight,
|
9
9
|
width: window.innerWidth
|
10
|
-
}), { post:
|
11
|
-
(e, r, o
|
12
|
-
var
|
13
|
-
if (
|
10
|
+
}), { post: _ } = M(), { data: C = null, get: $ } = V(), E = h(
|
11
|
+
(e, r, o) => {
|
12
|
+
var J, y;
|
13
|
+
if (a.length > 0) {
|
14
14
|
console.error(
|
15
15
|
`setJourney: Other Journey is already active, Current Journey: ${t.current}, New Journey Request: ${e}`
|
16
16
|
);
|
17
17
|
return;
|
18
18
|
}
|
19
|
-
x(!0),
|
20
|
-
r.map((
|
21
|
-
...
|
19
|
+
x(!0), t.current = e, m.current = -1, l(
|
20
|
+
r.map((n) => ({
|
21
|
+
...n,
|
22
22
|
isActive: !1
|
23
23
|
// New coachmarks are inactive by default
|
24
24
|
}))
|
25
|
-
), o && (
|
26
|
-
height: ((
|
27
|
-
width: ((
|
28
|
-
}),
|
25
|
+
), o && (D({
|
26
|
+
height: ((J = o.current) == null ? void 0 : J.clientHeight) || window.innerHeight,
|
27
|
+
width: ((y = o.current) == null ? void 0 : y.clientWidth) || window.innerWidth
|
28
|
+
}), B(!0));
|
29
29
|
},
|
30
|
-
[
|
31
|
-
),
|
32
|
-
|
30
|
+
[a.length]
|
31
|
+
), s = h(() => {
|
32
|
+
w.current.forEach((e) => {
|
33
33
|
clearTimeout(e);
|
34
|
-
}),
|
35
|
-
}, []),
|
34
|
+
}), w.current = [], t.current = void 0, m.current = -1, l([]), x(!1);
|
35
|
+
}, []), P = h(
|
36
36
|
(e) => {
|
37
|
-
|
38
|
-
app_id:
|
39
|
-
user_id:
|
37
|
+
s(), p((r) => r && !r.includes(e) ? [...r, e] : r), _({
|
38
|
+
app_id: i,
|
39
|
+
user_id: u,
|
40
40
|
journey_id: e,
|
41
41
|
journey_status: "COMPLETED"
|
42
42
|
});
|
43
43
|
},
|
44
|
-
[
|
45
|
-
),
|
44
|
+
[i, s, _, u]
|
45
|
+
), S = h((e, r) => {
|
46
46
|
if (!t.current || e !== t.current) {
|
47
47
|
console.error(
|
48
48
|
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"
|
49
49
|
);
|
50
50
|
return;
|
51
51
|
}
|
52
|
-
|
52
|
+
l((o) => [
|
53
53
|
...o,
|
54
54
|
{
|
55
55
|
...r,
|
@@ -57,87 +57,86 @@ const K = W(null), re = ({ children: T, appId: a, userId: c }) => {
|
|
57
57
|
// New coachmarks are inactive by default
|
58
58
|
}
|
59
59
|
]);
|
60
|
-
}, []),
|
61
|
-
(e, r = !1, o = 0,
|
60
|
+
}, []), j = h(
|
61
|
+
(e, r = !1, o = 0, J = !1) => {
|
62
62
|
if (!t.current || e !== t.current) {
|
63
63
|
console.error(
|
64
64
|
t.current ? "nextCoachmark was called before setJourney" : `A Journey is already active, Current Journey: ${t.current}, New Journey Request: ${e}`
|
65
65
|
);
|
66
66
|
return;
|
67
67
|
}
|
68
|
-
|
69
|
-
const
|
70
|
-
clearTimeout(
|
68
|
+
q(J), o !== 0 && l((n) => n.map((d) => ({ ...d, isActive: !1 })));
|
69
|
+
const y = setTimeout(() => {
|
70
|
+
clearTimeout(y);
|
71
71
|
const n = m.current + 1;
|
72
|
-
|
73
|
-
if (n >=
|
74
|
-
return
|
72
|
+
l((d) => {
|
73
|
+
if (n >= d.length || d.length === 0)
|
74
|
+
return s(), [];
|
75
75
|
m.current = n;
|
76
|
-
const g = [...
|
76
|
+
const g = [...d];
|
77
77
|
return g[n].isActive = !0, n > 0 && (g[n - 1].isActive = r), g;
|
78
78
|
});
|
79
79
|
}, o);
|
80
|
-
|
80
|
+
w.current.push(y);
|
81
81
|
},
|
82
|
-
[
|
83
|
-
),
|
82
|
+
[s]
|
83
|
+
), H = R(
|
84
84
|
() => ({
|
85
|
-
nextCoachmark:
|
86
|
-
setJourney:
|
87
|
-
addCoachmark:
|
88
|
-
clearJourney:
|
89
|
-
endJourney:
|
90
|
-
coachmarks:
|
91
|
-
userCompletedJourneyIds:
|
92
|
-
isJourneyActive:
|
85
|
+
nextCoachmark: j,
|
86
|
+
setJourney: E,
|
87
|
+
addCoachmark: S,
|
88
|
+
clearJourney: s,
|
89
|
+
endJourney: P,
|
90
|
+
coachmarks: a,
|
91
|
+
userCompletedJourneyIds: k,
|
92
|
+
isJourneyActive: f
|
93
93
|
}),
|
94
94
|
[
|
95
|
+
j,
|
96
|
+
E,
|
95
97
|
S,
|
96
|
-
|
98
|
+
s,
|
97
99
|
P,
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
v,
|
102
|
-
J
|
100
|
+
a,
|
101
|
+
k,
|
102
|
+
f
|
103
103
|
]
|
104
104
|
);
|
105
|
-
return
|
106
|
-
|
107
|
-
app_id:
|
108
|
-
user_id:
|
105
|
+
return T(() => {
|
106
|
+
i && u && $(u, {
|
107
|
+
app_id: i,
|
108
|
+
user_id: u,
|
109
109
|
journey_status: "COMPLETED"
|
110
110
|
});
|
111
|
-
}, [
|
112
|
-
if (
|
113
|
-
const e =
|
111
|
+
}, [i, $, u]), T(() => {
|
112
|
+
if (C) {
|
113
|
+
const e = C.map((r) => r.journey_id);
|
114
114
|
p(e);
|
115
115
|
}
|
116
|
-
}, [
|
117
|
-
|
118
|
-
|
116
|
+
}, [C]), /* @__PURE__ */ L(F.Provider, { value: H, children: [
|
117
|
+
f && /* @__PURE__ */ O(
|
118
|
+
G,
|
119
119
|
{
|
120
120
|
about: "journey-overlay",
|
121
121
|
height: A.height,
|
122
122
|
width: A.width,
|
123
|
-
$isJourneyBlurred:
|
124
|
-
$isBlockingJourney: b,
|
123
|
+
$isJourneyBlurred: U,
|
125
124
|
"data-testid": t.current,
|
126
|
-
children:
|
127
|
-
|
125
|
+
children: a.map((e, r) => /* @__PURE__ */ O(
|
126
|
+
W,
|
128
127
|
{
|
129
128
|
coachmark: e,
|
130
|
-
isInsideScrollView:
|
129
|
+
isInsideScrollView: z
|
131
130
|
},
|
132
131
|
`coachmark-${r}`
|
133
132
|
))
|
134
133
|
}
|
135
134
|
),
|
136
|
-
|
135
|
+
b
|
137
136
|
] });
|
138
137
|
};
|
139
138
|
export {
|
140
|
-
|
141
|
-
|
139
|
+
F as JourneyContext,
|
140
|
+
I as JourneyProvider
|
142
141
|
};
|
143
142
|
//# sourceMappingURL=journey-context-provider.js.map
|