@cuemath/leap 3.5.69-as1 → 3.5.69-as3
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/features/analytics-events/platform-events-student.js +1 -1
- package/dist/features/analytics-events/platform-events-student.js.map +1 -1
- package/dist/features/chapters-v2/comps/node-card/node-card-types.js.map +1 -1
- package/dist/features/chapters-v2/constants/node-constants.js +5 -4
- package/dist/features/chapters-v2/constants/node-constants.js.map +1 -1
- package/dist/features/cue-canvas/bottombar/homework-controls.js.map +1 -1
- package/dist/features/cue-canvas/sidebar/sidebar.js +4 -4
- package/dist/features/cue-canvas/sidebar/sidebar.js.map +1 -1
- package/dist/features/cue-canvas/toolbar/toolbar.js +21 -17
- package/dist/features/cue-canvas/toolbar/toolbar.js.map +1 -1
- package/dist/features/cue-canvas/toolbar/whiteboard-toolbar.js +23 -13
- package/dist/features/cue-canvas/toolbar/whiteboard-toolbar.js.map +1 -1
- package/dist/features/homework/homework-card.js +168 -161
- package/dist/features/homework/homework-card.js.map +1 -1
- package/dist/features/homework/hw-card-list/hw-card-list-view.js +96 -95
- package/dist/features/homework/hw-card-list/hw-card-list-view.js.map +1 -1
- package/dist/features/homework/utils.js +65 -41
- package/dist/features/homework/utils.js.map +1 -1
- package/dist/features/journey/hooks/use-home-page-journey/home-page-homeworks-mock.js +10 -5
- package/dist/features/journey/hooks/use-home-page-journey/home-page-homeworks-mock.js.map +1 -1
- package/dist/features/journey/hooks/use-home-page-journey/use-home-page-journey.js +2 -1
- package/dist/features/journey/hooks/use-home-page-journey/use-home-page-journey.js.map +1 -1
- package/dist/features/math-fit/math-fit-overview/math-fit-overview-helpers.js +35 -26
- package/dist/features/math-fit/math-fit-overview/math-fit-overview-helpers.js.map +1 -1
- package/dist/features/math-fit/math-fit-overview/math-fit-overview.js +70 -49
- package/dist/features/math-fit/math-fit-overview/math-fit-overview.js.map +1 -1
- package/dist/features/math-fit/math-fit-report/comps/report-header/report-header.js +4 -4
- package/dist/features/math-fit/math-fit-report/comps/report-header/report-header.js.map +1 -1
- package/dist/features/math-fit/math-fit-report/math-fit-report.js +40 -31
- package/dist/features/math-fit/math-fit-report/math-fit-report.js.map +1 -1
- package/dist/features/math-fit/mathfit-events.js +7 -0
- package/dist/features/math-fit/mathfit-events.js.map +1 -0
- package/dist/features/milestone/create/api/milestone-config.js.map +1 -1
- package/dist/features/milestone/milestone-tests/test-list-v2/test-list-view.js +40 -36
- package/dist/features/milestone/milestone-tests/test-list-v2/test-list-view.js.map +1 -1
- package/dist/features/parent-dashboard/hooks/use-student-profile-summary-data.js.map +1 -1
- package/dist/features/parent-dashboard/modals/trial-report/trial-report.js +1 -1
- package/dist/features/parent-dashboard/modals/trial-report/trial-report.js.map +1 -1
- package/dist/features/sheet-v2/resource-list/resource-list.js +39 -35
- package/dist/features/sheet-v2/resource-list/resource-list.js.map +1 -1
- package/dist/features/trial-session/api/trial-home.js +10 -16
- package/dist/features/trial-session/api/trial-home.js.map +1 -1
- package/dist/features/trial-session/api/trial-session-report.js +16 -0
- package/dist/features/trial-session/api/trial-session-report.js.map +1 -0
- package/dist/features/trial-session/api/trial-topics.js +9 -0
- package/dist/features/trial-session/api/trial-topics.js.map +1 -0
- package/dist/features/trial-session/comps/background-grid/background-grid-utils.js +62 -50
- package/dist/features/trial-session/comps/background-grid/background-grid-utils.js.map +1 -1
- package/dist/features/trial-session/comps/class-preference/class-preference-styled.js +5 -14
- package/dist/features/trial-session/comps/class-preference/class-preference-styled.js.map +1 -1
- package/dist/features/trial-session/comps/class-preference/class-preference.js +55 -53
- package/dist/features/trial-session/comps/class-preference/class-preference.js.map +1 -1
- package/dist/features/trial-session/comps/communication-slide/communication-slide-constants.js +3 -2
- package/dist/features/trial-session/comps/communication-slide/communication-slide-constants.js.map +1 -1
- package/dist/features/trial-session/comps/confirmation-modal/hooks/use-confirmation-modal.js +27 -26
- package/dist/features/trial-session/comps/confirmation-modal/hooks/use-confirmation-modal.js.map +1 -1
- package/dist/features/trial-session/comps/learning-session/learning-session-styled.js +19 -18
- package/dist/features/trial-session/comps/learning-session/learning-session-styled.js.map +1 -1
- package/dist/features/trial-session/comps/learning-session/learning-session.js +34 -43
- package/dist/features/trial-session/comps/learning-session/learning-session.js.map +1 -1
- package/dist/features/trial-session/comps/navigation-bar/index.js +56 -58
- package/dist/features/trial-session/comps/navigation-bar/index.js.map +1 -1
- package/dist/features/trial-session/comps/offering-information/offering-information-constants.js +29 -6
- package/dist/features/trial-session/comps/offering-information/offering-information-constants.js.map +1 -1
- package/dist/features/trial-session/comps/offering-information/offering-information.js +74 -64
- package/dist/features/trial-session/comps/offering-information/offering-information.js.map +1 -1
- package/dist/features/trial-session/comps/school-goals/school-goals-styled.js +10 -9
- package/dist/features/trial-session/comps/school-goals/school-goals-styled.js.map +1 -1
- package/dist/features/trial-session/comps/school-goals/school-goals-view.js +40 -39
- package/dist/features/trial-session/comps/school-goals/school-goals-view.js.map +1 -1
- package/dist/features/trial-session/comps/school-goals/school-goals.js +39 -37
- package/dist/features/trial-session/comps/school-goals/school-goals.js.map +1 -1
- package/dist/features/trial-session/comps/session-insights/session-insights-styled.js +12 -20
- package/dist/features/trial-session/comps/session-insights/session-insights-styled.js.map +1 -1
- package/dist/features/trial-session/comps/session-insights/session-insights.js +64 -63
- package/dist/features/trial-session/comps/session-insights/session-insights.js.map +1 -1
- package/dist/features/trial-session/comps/session-overview/session-overview-styled.js +13 -13
- package/dist/features/trial-session/comps/session-overview/session-overview-styled.js.map +1 -1
- package/dist/features/trial-session/comps/session-overview/session-overview-utils.js +23 -4
- package/dist/features/trial-session/comps/session-overview/session-overview-utils.js.map +1 -1
- package/dist/features/trial-session/comps/session-overview/session-overview.js +20 -20
- package/dist/features/trial-session/comps/session-overview/session-overview.js.map +1 -1
- package/dist/features/trial-session/comps/session-progress-summary/session-progress-summary-styled.js +64 -0
- package/dist/features/trial-session/comps/session-progress-summary/session-progress-summary-styled.js.map +1 -0
- package/dist/features/trial-session/comps/session-progress-summary/session-progress-summary-types.js +5 -0
- package/dist/features/trial-session/comps/session-progress-summary/session-progress-summary-types.js.map +1 -0
- package/dist/features/trial-session/comps/session-progress-summary/session-progress-summary-view.js +135 -0
- package/dist/features/trial-session/comps/session-progress-summary/session-progress-summary-view.js.map +1 -0
- package/dist/features/trial-session/comps/session-progress-summary/session-progress-summary.js +53 -0
- package/dist/features/trial-session/comps/session-progress-summary/session-progress-summary.js.map +1 -0
- package/dist/features/trial-session/comps/session-report/report-404/report-404.js +15 -16
- package/dist/features/trial-session/comps/session-report/report-404/report-404.js.map +1 -1
- package/dist/features/trial-session/comps/session-report/session-report.js +35 -33
- package/dist/features/trial-session/comps/session-report/session-report.js.map +1 -1
- package/dist/features/trial-session/comps/student-enrichment/student-enrichment-styled.js +9 -16
- package/dist/features/trial-session/comps/student-enrichment/student-enrichment-styled.js.map +1 -1
- package/dist/features/trial-session/comps/student-enrichment/student-enrichment.js +39 -37
- package/dist/features/trial-session/comps/student-enrichment/student-enrichment.js.map +1 -1
- package/dist/features/trial-session/comps/student-feedback/student-feedback-styled.js +10 -9
- package/dist/features/trial-session/comps/student-feedback/student-feedback-styled.js.map +1 -1
- package/dist/features/trial-session/comps/student-info/student-info-constants.js +35 -0
- package/dist/features/trial-session/comps/student-info/student-info-constants.js.map +1 -0
- package/dist/features/trial-session/comps/student-info/student-info-helpers.js +12 -0
- package/dist/features/trial-session/comps/student-info/student-info-helpers.js.map +1 -0
- package/dist/features/trial-session/comps/student-info/student-info-styled.js +26 -11
- package/dist/features/trial-session/comps/student-info/student-info-styled.js.map +1 -1
- package/dist/features/trial-session/comps/student-info/student-info.js +121 -75
- package/dist/features/trial-session/comps/student-info/student-info.js.map +1 -1
- package/dist/features/trial-session/comps/student-personalization/student-personalization-styled.js +3 -12
- package/dist/features/trial-session/comps/student-personalization/student-personalization-styled.js.map +1 -1
- package/dist/features/trial-session/comps/student-personalization/student-personalization.js +34 -33
- package/dist/features/trial-session/comps/student-personalization/student-personalization.js.map +1 -1
- package/dist/features/trial-session/comps/student-profile/student-profile.js +45 -44
- package/dist/features/trial-session/comps/student-profile/student-profile.js.map +1 -1
- package/dist/features/trial-session/comps/teacher-intro/teacher-intro.js +9 -8
- package/dist/features/trial-session/comps/teacher-intro/teacher-intro.js.map +1 -1
- package/dist/features/trial-session/comps/test-prep/test-prep-styled.js +11 -19
- package/dist/features/trial-session/comps/test-prep/test-prep-styled.js.map +1 -1
- package/dist/features/trial-session/comps/test-prep/test-prep.js +31 -29
- package/dist/features/trial-session/comps/test-prep/test-prep.js.map +1 -1
- package/dist/features/trial-session/comps/topic-selection/topic-item.js +39 -0
- package/dist/features/trial-session/comps/topic-selection/topic-item.js.map +1 -0
- package/dist/features/trial-session/comps/topic-selection/topic-selection-helpers.js +10 -0
- package/dist/features/trial-session/comps/topic-selection/topic-selection-helpers.js.map +1 -0
- package/dist/features/trial-session/comps/topic-selection/topic-selection-styled.js +42 -0
- package/dist/features/trial-session/comps/topic-selection/topic-selection-styled.js.map +1 -0
- package/dist/features/trial-session/comps/topic-selection/topic-selection.js +48 -0
- package/dist/features/trial-session/comps/topic-selection/topic-selection.js.map +1 -0
- package/dist/features/trial-session/comps/whiteboard/whiteboard-styled.js +21 -0
- package/dist/features/trial-session/comps/whiteboard/whiteboard-styled.js.map +1 -0
- package/dist/features/trial-session/comps/whiteboard/whiteboard.js +99 -0
- package/dist/features/trial-session/comps/whiteboard/whiteboard.js.map +1 -0
- package/dist/features/trial-session/comps/worksheet/worksheet.js +35 -33
- package/dist/features/trial-session/comps/worksheet/worksheet.js.map +1 -1
- package/dist/features/trial-session/context/trial-session-context.js +6 -4
- package/dist/features/trial-session/context/trial-session-context.js.map +1 -1
- package/dist/features/trial-session/helper.js +107 -65
- package/dist/features/trial-session/helper.js.map +1 -1
- package/dist/features/trial-session/hooks/use-trial-session-navigation.js +198 -165
- package/dist/features/trial-session/hooks/use-trial-session-navigation.js.map +1 -1
- package/dist/features/trial-session/right-panel/right-panel-styled.js +8 -8
- package/dist/features/trial-session/right-panel/right-panel-styled.js.map +1 -1
- package/dist/features/trial-session/right-panel/slide-components-map.js +42 -36
- package/dist/features/trial-session/right-panel/slide-components-map.js.map +1 -1
- package/dist/features/trial-session/trial-session-constants.js +29 -16
- package/dist/features/trial-session/trial-session-constants.js.map +1 -1
- package/dist/features/trial-session/trial-session-types.js.map +1 -1
- package/dist/features/trial-session/trial-session-view.js +87 -79
- package/dist/features/trial-session/trial-session-view.js.map +1 -1
- package/dist/features/trial-session/trial-session.js +68 -58
- package/dist/features/trial-session/trial-session.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 +12 -12
- package/dist/features/ui/inputs/checkbox-input-list/checkbox-input-list.js.map +1 -1
- package/dist/features/ui/theme/clrs.js +1 -0
- package/dist/features/ui/theme/clrs.js.map +1 -1
- package/dist/features/worksheet/worksheet/mocks/activity.js +6 -0
- package/dist/features/worksheet/worksheet/mocks/activity.js.map +1 -0
- package/dist/features/worksheet/worksheet/mocks/signed-requests.js +5 -0
- package/dist/features/worksheet/worksheet/mocks/signed-requests.js.map +1 -0
- package/dist/features/worksheet/worksheet/stories/use-canvas-sync-broker-story.js +57 -0
- package/dist/features/worksheet/worksheet/stories/use-canvas-sync-broker-story.js.map +1 -0
- package/dist/features/worksheet/worksheet/stories/worksheet-story-container.js +263 -0
- package/dist/features/worksheet/worksheet/stories/worksheet-story-container.js.map +1 -0
- package/dist/features/worksheet/worksheet/stories/worksheet-student.js +177 -0
- package/dist/features/worksheet/worksheet/stories/worksheet-student.js.map +1 -0
- package/dist/features/worksheet/worksheet/stories/worksheet-teacher.js +268 -0
- package/dist/features/worksheet/worksheet/stories/worksheet-teacher.js.map +1 -0
- package/dist/features/worksheet/worksheet/worksheet-helpers.js +38 -37
- package/dist/features/worksheet/worksheet/worksheet-helpers.js.map +1 -1
- package/dist/index.d.ts +17 -6
- package/dist/index.js +384 -380
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"home-page-homeworks-mock.js","sources":["../../../../../src/features/journey/hooks/use-home-page-journey/home-page-homeworks-mock.ts"],"sourcesContent":["import type { IHomeworkDetails } from '../../../homework/hw-card-list/api/get-homeworks';\nimport { EHWCardListEntityType } from '../../../homework/hw-card-list/hw-card-list-types';\n\nconst now = Math.floor(Date.now() / 1000); // current epoch in seconds\nconst fiveDaysLater = now + 5 * 24 * 60 * 60;\n\nconst HOMEWORK_DETAILS: IHomeworkDetails = {\n assigned_homeworks: [\n // Puzzle Card\n {\n entity_type: EHWCardListEntityType.USER_NODE,\n entity_id: '147520a0-2f62-11f0-876b-da0546594b04',\n user_node_id: '147520a0-2f62-11f0-876b-da0546594b04',\n homework_id: 'ede761ea-347b-11f0-b9d2-5e3c498fca42',\n card_header: 'PUZZLE',\n subtext: 'Puzzle Cards',\n image_hue: 'BLUE',\n state: 'NOT_STARTED',\n due_date_ts: 1748241531,\n position: 0,\n id: 'ede761ea-347b-11f0-b9d2-5e3c498fca42',\n score: null,\n sheets: [\n {\n accuracy: null,\n attempt_location: 'ANY',\n block_id: '23a4e676-7094-11ed-87bc-6ec30f5d70bb',\n card_header: 'PUZZLE',\n chapter_id: '8b0d5af7-3d47-4888-acef-920069c6ae13',\n course_type: 'PROGRAM',\n desmos_calculator_enabled: false,\n due_date_ts: 1748241531,\n image_hue: 'BLUE',\n image_url: 'https://dw7j1ezsvbafb.cloudfront.net/media/chapter-images/Default.jpg',\n is_optional: true,\n is_timed: false,\n is_worksheet_v3: null,\n learnosity_activity_ref: 'CR_G4L1 Sum of Three Cubes',\n marked_as_completed: false,\n node_id: '1de6ac4a-8e41-4446-9a07-a93d5713a2ff',\n node_type: 'PUZZLE_EASY',\n permissions: {\n can_assign_as_homework: false,\n can_change_attempt_location: false,\n can_mark_familiar: false,\n can_reattempt: false,\n can_reset: false,\n can_resume: false,\n can_review: false,\n can_start: true,\n can_teacher_review: false,\n can_unassign: false,\n can_unlock: false,\n can_un_skip: false,\n can_skip: false,\n },\n sheet_statement: 'Yet to start',\n sheet_time: 2400,\n state: 'NOT_STARTED',\n title: 'Sum of Three Cubes',\n total_questions: 0,\n unlocked_on_ts: 1747636731,\n user_attempt_id: null,\n user_node_id: '147520a0-2f62-11f0-876b-da0546594b04',\n worksheet_id: 'c4e1035a-d3e5-11eb-8971-6296551a51ec',\n complete_status: false,\n id: '',\n user_chapter_id: null,\n is_turing: false,\n student_instructions_ref: null,\n instructions_ref: null,\n user_block_id: null,\n user_milestone_id: undefined,\n subtext: null,\n activity_type: null,\n },\n ],\n },\n // Smart Practice (Dynamic)\n {\n entity_type: EHWCardListEntityType.USER_NODE,\n entity_id: 'c2d38bf6-306d-11f0-a23f-126d2a0e16e8',\n user_node_id: 'c2d38bf6-306d-11f0-a23f-126d2a0e16e8',\n homework_id: '50bfb9e6-f984-11ee-bcfc-d6332bd3e75f',\n card_header: 'SMART PRACTICE',\n subtext: '5 Questions · 15 mins',\n image_hue: 'GREEN',\n state: 'NOT_STARTED',\n due_date_ts: fiveDaysLater,\n position: 1,\n score: null,\n id: '50bfb9e6-f984-11ee-bcfc-d6332bd3e75f',\n sheets: [\n {\n accuracy: null,\n attempt_location: 'ANY',\n block_id: '',\n card_header: 'SMART PRACTICE',\n chapter_id: null,\n course_type: 'PROGRAM',\n desmos_calculator_enabled: false,\n due_date_ts: fiveDaysLater,\n image_hue: 'GREEN',\n image_url: null,\n is_optional: false,\n is_timed: false,\n is_worksheet_v3: true,\n learnosity_activity_ref: 'Subtraction-practice-G1W1',\n marked_as_completed: false,\n node_id: 'a0c8b6d4-306c-11f0-a23f-126d2a0e16e8',\n node_type: 'DYNAMIC',\n permissions: {\n can_assign_as_homework: false,\n can_change_attempt_location: false,\n can_mark_familiar: false,\n can_reattempt: false,\n can_reset: false,\n can_resume: false,\n can_review: false,\n can_start: true,\n can_teacher_review: false,\n can_unassign: false,\n can_unlock: false,\n can_un_skip: false,\n can_skip: false,\n },\n sheet_statement: '',\n sheet_time: 900,\n state: 'NOT_STARTED',\n title: 'Smart Practice',\n total_questions: 5,\n unlocked_on_ts: now,\n user_attempt_id: null,\n user_node_id: 'c2d38bf6-306d-11f0-a23f-126d2a0e16e8',\n worksheet_id: 'worksheet-456',\n complete_status: false,\n id: '',\n user_chapter_id: null,\n is_turing: false,\n student_instructions_ref: null,\n instructions_ref: null,\n user_block_id: null,\n user_milestone_id: undefined,\n subtext: null,\n activity_type: null,\n },\n ],\n },\n // MathFit Assessment\n {\n entity_type: EHWCardListEntityType.MATHFIT_TEST,\n entity_id: 'mathfit-assessment-id-456',\n homework_id: 'hw-mathfit-456',\n homework_created_on_ts: now,\n user_milestone_id: null,\n card_header: 'MATHFIT ASSESSMENT',\n id: 'hw-mathfit-456',\n subtext: '25 Questions • 75 mins',\n image_hue: 'PURPLE',\n state: 'NOT_STARTED',\n due_date_ts: fiveDaysLater,\n position: 2,\n score: null,\n sheets: [\n {\n user_node_id: 'mathfit-section1-uuid',\n node_id: 'mathfit-section-1-node',\n worksheet_id: 'mathfit-section-1-ws',\n node_type: 'DYNAMIC',\n course_type: 'MATHFIT',\n title: 'Understanding',\n card_header: 'MATHFIT • SECTION 1',\n subtext: '15 Questions • 45 mins',\n state: 'NOT_STARTED',\n accuracy: null,\n total_questions: 15,\n sheet_time: 2700,\n unlocked_on_ts: now,\n user_attempt_id: null,\n permissions: {\n can_review: false,\n can_start: true,\n can_resume: false,\n can_reattempt: false,\n can_reset: false,\n can_assign_as_homework: false,\n can_teacher_review: false,\n can_unassign: false,\n can_unlock: false,\n can_mark_familiar: false,\n can_change_attempt_location: false,\n can_un_skip: false,\n can_skip: false,\n },\n image_url: null,\n image_hue: 'PURPLE',\n attempt_location: 'ANY',\n block_id: '',\n chapter_id: null,\n complete_status: false,\n desmos_calculator_enabled: false,\n id: 'mathfit-section1-uuid',\n is_optional: false,\n is_timed: true,\n is_worksheet_v3: true,\n is_turing: false,\n learnosity_activity_ref: 'mathfit-section-1-activity',\n marked_as_completed: false,\n sheet_statement: '',\n student_instructions_ref: null,\n instructions_ref: null,\n user_block_id: null,\n user_chapter_id: null,\n user_milestone_id: undefined,\n due_date_ts: fiveDaysLater,\n activity_type: null,\n },\n {\n user_node_id: 'mathfit-section2-uuid',\n node_id: 'mathfit-section-2-node',\n worksheet_id: 'mathfit-section-2-ws',\n node_type: 'DYNAMIC',\n course_type: 'MATHFIT',\n title: 'Application',\n card_header: 'MATHFIT • SECTION 2',\n subtext: '10 Questions • 30 mins',\n state: 'LOCKED',\n accuracy: null,\n total_questions: 10,\n sheet_time: 1800,\n user_attempt_id: null,\n permissions: {\n can_start: false,\n can_review: false,\n can_resume: false,\n can_reattempt: false,\n can_reset: false,\n can_assign_as_homework: false,\n can_teacher_review: false,\n can_unassign: false,\n can_unlock: false,\n can_mark_familiar: false,\n can_change_attempt_location: false,\n can_un_skip: false,\n can_skip: false,\n },\n image_url: null,\n image_hue: 'PURPLE',\n attempt_location: 'ANY',\n block_id: '',\n chapter_id: null,\n complete_status: false,\n desmos_calculator_enabled: false,\n id: 'mathfit-section2-uuid',\n is_optional: false,\n is_timed: true,\n is_worksheet_v3: true,\n is_turing: false,\n learnosity_activity_ref: 'mathfit-section-2-activity',\n marked_as_completed: false,\n sheet_statement: '',\n student_instructions_ref: null,\n instructions_ref: null,\n user_block_id: null,\n user_chapter_id: null,\n user_milestone_id: undefined,\n due_date_ts: fiveDaysLater,\n unlocked_on_ts: null,\n activity_type: null,\n },\n ],\n },\n // Lesson Node\n {\n entity_type: EHWCardListEntityType.USER_NODE,\n entity_id: 'lesson-node-uuid-123',\n user_node_id: 'lesson-node-uuid-123',\n homework_id: 'hw-lesson-123',\n card_header: 'LESSON',\n subtext: '8 Questions · 25 mins',\n image_hue: 'ORANGE',\n state: 'IN_PROGRESS',\n due_date_ts: fiveDaysLater,\n position: 3,\n score: null,\n id: 'hw-lesson-123',\n sheets: [\n {\n accuracy: 50,\n attempt_location: 'ANY',\n block_id: 'block-lesson-123',\n card_header: 'LESSON',\n chapter_id: 'chapter-fractions-101',\n course_type: 'PROGRAM',\n desmos_calculator_enabled: false,\n due_date_ts: fiveDaysLater,\n image_hue: 'ORANGE',\n image_url: 'https://dw7j1ezsvbafb.cloudfront.net/media/chapter-images/fractions.jpg',\n is_optional: false,\n is_timed: false,\n is_worksheet_v3: true,\n learnosity_activity_ref: 'intro-to-fractions-G3W1',\n marked_as_completed: false,\n node_id: 'lesson-node-id-123',\n permissions: {\n can_assign_as_homework: false,\n can_change_attempt_location: false,\n can_mark_familiar: false,\n can_reattempt: false,\n can_reset: false,\n can_resume: true,\n can_review: false,\n can_start: false,\n can_teacher_review: false,\n can_unassign: true,\n can_unlock: false,\n can_un_skip: false,\n can_skip: false,\n },\n sheet_statement: '',\n sheet_time: 1500,\n state: 'IN_PROGRESS',\n title: 'Introduction to Fractions',\n total_questions: 8,\n unlocked_on_ts: now - 86400, // 1 day ago\n user_attempt_id: 'attempt-lesson-123',\n user_node_id: 'lesson-node-uuid-123',\n worksheet_id: 'worksheet-lesson-123',\n complete_status: false,\n id: '',\n user_chapter_id: 'chapter-fractions-101',\n is_turing: false,\n student_instructions_ref: null,\n instructions_ref: null,\n user_block_id: 'block-lesson-123',\n user_milestone_id: undefined,\n node_type: 'REMEDIAL',\n subtext: null,\n activity_type: null,\n },\n ],\n },\n ],\n queued_homeworks: [],\n};\n\nexport { HOMEWORK_DETAILS };\n"],"names":["now","fiveDaysLater","HOMEWORK_DETAILS","EHWCardListEntityType"],"mappings":";AAGA,MAAMA,IAAM,KAAK,MAAM,KAAK,IAAA,IAAQ,GAAI,GAClCC,IAAgBD,IAAM,IAAI,KAAK,KAAK,IAEpCE,IAAqC;AAAA,EACzC,oBAAoB;AAAA;AAAA,IAElB;AAAA,MACE,aAAaC,EAAsB;AAAA,MACnC,WAAW;AAAA,MACX,cAAc;AAAA,MACd,aAAa;AAAA,MACb,aAAa;A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B;AAAA,UAC3B,aAAaA;AAAA,UACb,WAAW;AAAA,UACX,WAAW;AAAA,UACX,aAAa;AAAA,UACb,UAAU;AAAA,UACV,iBAAiB;AAAA,UACjB,yBAAyB;AAAA,UACzB,qBAAqB;AAAA,UACrB,SAAS;AAAA,UACT,aAAa;AAAA,YACX,wBAAwB;AAAA,YACxB,6BAA6B;AAAA,YAC7B,mBAAmB;AAAA,YACnB,eAAe;AAAA,YACf,WAAW;AAAA,YACX,YAAY;AAAA,YACZ,YAAY;AAAA,YACZ,WAAW;AAAA,YACX,oBAAoB;AAAA,YACpB,cAAc;AAAA,YACd,YAAY;AAAA,YACZ,aAAa;AAAA,YACb,UAAU;AAAA,UACZ;AAAA,UACA,iBAAiB;AAAA,UACjB,YAAY;AAAA,UACZ,OAAO;AAAA,UACP,OAAO;AAAA,UACP,iBAAiB;AAAA,UACjB,gBAAgBD,IAAM;AAAA;AAAA,UACtB,iBAAiB;AAAA,UACjB,cAAc;AAAA,UACd,cAAc;AAAA,UACd,iBAAiB;AAAA,UACjB,IAAI;AAAA,UACJ,iBAAiB;AAAA,UACjB,WAAW;AAAA,UACX,0BAA0B;AAAA,UAC1B,kBAAkB;AAAA,UAClB,eAAe;AAAA,UACf,mBAAmB;AAAA,UACnB,WAAW;AAAA,UACX,SAAS;AAAA,UACT,eAAe;AAAA,QACjB;AAAA,MACF;AAAA,IACF;AAAA,EACF;AAAA,EACA,kBAAkB,CAAC;AACrB;"}
|
|
1
|
+
{"version":3,"file":"home-page-homeworks-mock.js","sources":["../../../../../src/features/journey/hooks/use-home-page-journey/home-page-homeworks-mock.ts"],"sourcesContent":["import type { IHomeworkDetails } from '../../../homework/hw-card-list/api/get-homeworks';\nimport { EHWCardListEntityType } from '../../../homework/hw-card-list/hw-card-list-types';\n\nconst now = Math.floor(Date.now() / 1000); // current epoch in seconds\nconst fiveDaysLater = now + 5 * 24 * 60 * 60;\n\nconst HOMEWORK_DETAILS: IHomeworkDetails = {\n assigned_homeworks: [\n // Puzzle Card\n {\n entity_type: EHWCardListEntityType.USER_NODE,\n entity_id: '147520a0-2f62-11f0-876b-da0546594b04',\n user_node_id: '147520a0-2f62-11f0-876b-da0546594b04',\n homework_id: 'ede761ea-347b-11f0-b9d2-5e3c498fca42',\n card_header: 'PUZZLE',\n subtext: 'Puzzle Cards',\n image_hue: 'BLUE',\n state: 'NOT_STARTED',\n due_date_ts: 1748241531,\n position: 0,\n id: 'ede761ea-347b-11f0-b9d2-5e3c498fca42',\n score: null,\n sheets: [\n {\n accuracy: null,\n attempt_location: 'ANY',\n block_id: '23a4e676-7094-11ed-87bc-6ec30f5d70bb',\n card_header: 'PUZZLE',\n chapter_id: '8b0d5af7-3d47-4888-acef-920069c6ae13',\n course_type: 'PROGRAM',\n desmos_calculator_enabled: false,\n due_date_ts: 1748241531,\n image_hue: 'BLUE',\n image_url: 'https://dw7j1ezsvbafb.cloudfront.net/media/chapter-images/Default.jpg',\n is_optional: true,\n is_timed: false,\n is_worksheet_v3: null,\n learnosity_activity_ref: 'CR_G4L1 Sum of Three Cubes',\n marked_as_completed: false,\n node_id: '1de6ac4a-8e41-4446-9a07-a93d5713a2ff',\n node_type: 'PUZZLE_EASY',\n permissions: {\n can_assign_as_homework: false,\n can_change_attempt_location: false,\n can_mark_familiar: false,\n can_reattempt: false,\n can_reset: false,\n can_resume: false,\n can_review: false,\n can_start: true,\n can_teacher_review: false,\n can_unassign: false,\n can_unlock: false,\n can_un_skip: false,\n can_skip: false,\n },\n sheet_statement: 'Yet to start',\n sheet_time: 2400,\n state: 'NOT_STARTED',\n title: 'Sum of Three Cubes',\n total_questions: 0,\n unlocked_on_ts: 1747636731,\n user_attempt_id: null,\n user_node_id: '147520a0-2f62-11f0-876b-da0546594b04',\n worksheet_id: 'c4e1035a-d3e5-11eb-8971-6296551a51ec',\n complete_status: false,\n id: '',\n user_chapter_id: null,\n is_turing: false,\n student_instructions_ref: null,\n instructions_ref: null,\n user_block_id: null,\n user_milestone_id: undefined,\n subtext: null,\n activity_type: null,\n correct_answers: 0,\n },\n ],\n },\n // Smart Practice (Dynamic)\n {\n entity_type: EHWCardListEntityType.USER_NODE,\n entity_id: 'c2d38bf6-306d-11f0-a23f-126d2a0e16e8',\n user_node_id: 'c2d38bf6-306d-11f0-a23f-126d2a0e16e8',\n homework_id: '50bfb9e6-f984-11ee-bcfc-d6332bd3e75f',\n card_header: 'SMART PRACTICE',\n subtext: '5 Questions · 15 mins',\n image_hue: 'GREEN',\n state: 'NOT_STARTED',\n due_date_ts: fiveDaysLater,\n position: 1,\n score: null,\n id: '50bfb9e6-f984-11ee-bcfc-d6332bd3e75f',\n sheets: [\n {\n accuracy: null,\n attempt_location: 'ANY',\n block_id: '',\n card_header: 'SMART PRACTICE',\n chapter_id: null,\n course_type: 'PROGRAM',\n desmos_calculator_enabled: false,\n due_date_ts: fiveDaysLater,\n image_hue: 'GREEN',\n image_url: null,\n is_optional: false,\n is_timed: false,\n is_worksheet_v3: true,\n learnosity_activity_ref: 'Subtraction-practice-G1W1',\n marked_as_completed: false,\n node_id: 'a0c8b6d4-306c-11f0-a23f-126d2a0e16e8',\n node_type: 'DYNAMIC',\n permissions: {\n can_assign_as_homework: false,\n can_change_attempt_location: false,\n can_mark_familiar: false,\n can_reattempt: false,\n can_reset: false,\n can_resume: false,\n can_review: false,\n can_start: true,\n can_teacher_review: false,\n can_unassign: false,\n can_unlock: false,\n can_un_skip: false,\n can_skip: false,\n },\n sheet_statement: '',\n sheet_time: 900,\n state: 'NOT_STARTED',\n title: 'Smart Practice',\n total_questions: 5,\n unlocked_on_ts: now,\n user_attempt_id: null,\n user_node_id: 'c2d38bf6-306d-11f0-a23f-126d2a0e16e8',\n worksheet_id: 'worksheet-456',\n complete_status: false,\n id: '',\n user_chapter_id: null,\n is_turing: false,\n student_instructions_ref: null,\n instructions_ref: null,\n user_block_id: null,\n user_milestone_id: undefined,\n subtext: null,\n activity_type: null,\n correct_answers: 0,\n },\n ],\n },\n // MathFit Assessment\n {\n entity_type: EHWCardListEntityType.MATHFIT_TEST,\n entity_id: 'mathfit-assessment-id-456',\n homework_id: 'hw-mathfit-456',\n homework_created_on_ts: now,\n user_milestone_id: null,\n card_header: 'MATHFIT ASSESSMENT',\n id: 'hw-mathfit-456',\n subtext: '25 Questions • 75 mins',\n image_hue: 'PURPLE',\n state: 'NOT_STARTED',\n due_date_ts: fiveDaysLater,\n position: 2,\n score: null,\n sheets: [\n {\n user_node_id: 'mathfit-section1-uuid',\n node_id: 'mathfit-section-1-node',\n worksheet_id: 'mathfit-section-1-ws',\n node_type: 'DYNAMIC',\n course_type: 'MATHFIT',\n title: 'Understanding',\n card_header: 'MATHFIT • SECTION 1',\n subtext: '15 Questions • 45 mins',\n state: 'NOT_STARTED',\n accuracy: null,\n total_questions: 15,\n sheet_time: 2700,\n unlocked_on_ts: now,\n user_attempt_id: null,\n permissions: {\n can_review: false,\n can_start: true,\n can_resume: false,\n can_reattempt: false,\n can_reset: false,\n can_assign_as_homework: false,\n can_teacher_review: false,\n can_unassign: false,\n can_unlock: false,\n can_mark_familiar: false,\n can_change_attempt_location: false,\n can_un_skip: false,\n can_skip: false,\n },\n image_url: null,\n image_hue: 'PURPLE',\n attempt_location: 'ANY',\n block_id: '',\n chapter_id: null,\n complete_status: false,\n desmos_calculator_enabled: false,\n id: 'mathfit-section1-uuid',\n is_optional: false,\n is_timed: true,\n is_worksheet_v3: true,\n is_turing: false,\n learnosity_activity_ref: 'mathfit-section-1-activity',\n marked_as_completed: false,\n sheet_statement: '',\n student_instructions_ref: null,\n instructions_ref: null,\n user_block_id: null,\n user_chapter_id: null,\n user_milestone_id: undefined,\n due_date_ts: fiveDaysLater,\n activity_type: null,\n correct_answers: 0,\n },\n {\n user_node_id: 'mathfit-section2-uuid',\n node_id: 'mathfit-section-2-node',\n worksheet_id: 'mathfit-section-2-ws',\n node_type: 'DYNAMIC',\n course_type: 'MATHFIT',\n title: 'Application',\n card_header: 'MATHFIT • SECTION 2',\n subtext: '10 Questions • 30 mins',\n state: 'LOCKED',\n accuracy: null,\n total_questions: 10,\n sheet_time: 1800,\n user_attempt_id: null,\n permissions: {\n can_start: false,\n can_review: false,\n can_resume: false,\n can_reattempt: false,\n can_reset: false,\n can_assign_as_homework: false,\n can_teacher_review: false,\n can_unassign: false,\n can_unlock: false,\n can_mark_familiar: false,\n can_change_attempt_location: false,\n can_un_skip: false,\n can_skip: false,\n },\n image_url: null,\n image_hue: 'PURPLE',\n attempt_location: 'ANY',\n block_id: '',\n chapter_id: null,\n complete_status: false,\n desmos_calculator_enabled: false,\n id: 'mathfit-section2-uuid',\n is_optional: false,\n is_timed: true,\n is_worksheet_v3: true,\n is_turing: false,\n learnosity_activity_ref: 'mathfit-section-2-activity',\n marked_as_completed: false,\n sheet_statement: '',\n student_instructions_ref: null,\n instructions_ref: null,\n user_block_id: null,\n user_chapter_id: null,\n user_milestone_id: undefined,\n due_date_ts: fiveDaysLater,\n unlocked_on_ts: null,\n activity_type: null,\n correct_answers: 0,\n },\n ],\n },\n // Lesson Node\n {\n entity_type: EHWCardListEntityType.USER_NODE,\n entity_id: 'lesson-node-uuid-123',\n user_node_id: 'lesson-node-uuid-123',\n homework_id: 'hw-lesson-123',\n card_header: 'LESSON',\n subtext: '8 Questions · 25 mins',\n image_hue: 'ORANGE',\n state: 'IN_PROGRESS',\n due_date_ts: fiveDaysLater,\n position: 3,\n score: null,\n id: 'hw-lesson-123',\n sheets: [\n {\n accuracy: 50,\n attempt_location: 'ANY',\n block_id: 'block-lesson-123',\n card_header: 'LESSON',\n chapter_id: 'chapter-fractions-101',\n course_type: 'PROGRAM',\n desmos_calculator_enabled: false,\n due_date_ts: fiveDaysLater,\n image_hue: 'ORANGE',\n image_url: 'https://dw7j1ezsvbafb.cloudfront.net/media/chapter-images/fractions.jpg',\n is_optional: false,\n is_timed: false,\n is_worksheet_v3: true,\n learnosity_activity_ref: 'intro-to-fractions-G3W1',\n marked_as_completed: false,\n node_id: 'lesson-node-id-123',\n permissions: {\n can_assign_as_homework: false,\n can_change_attempt_location: false,\n can_mark_familiar: false,\n can_reattempt: false,\n can_reset: false,\n can_resume: true,\n can_review: false,\n can_start: false,\n can_teacher_review: false,\n can_unassign: true,\n can_unlock: false,\n can_un_skip: false,\n can_skip: false,\n },\n sheet_statement: '',\n sheet_time: 1500,\n state: 'IN_PROGRESS',\n title: 'Introduction to Fractions',\n total_questions: 8,\n unlocked_on_ts: now - 86400, // 1 day ago\n user_attempt_id: 'attempt-lesson-123',\n user_node_id: 'lesson-node-uuid-123',\n worksheet_id: 'worksheet-lesson-123',\n complete_status: false,\n id: '',\n user_chapter_id: 'chapter-fractions-101',\n is_turing: false,\n student_instructions_ref: null,\n instructions_ref: null,\n user_block_id: 'block-lesson-123',\n user_milestone_id: undefined,\n node_type: 'REMEDIAL',\n subtext: null,\n activity_type: null,\n correct_answers: 0,\n },\n ],\n },\n ],\n queued_homeworks: [],\n};\n\nexport { HOMEWORK_DETAILS };\n"],"names":["now","fiveDaysLater","HOMEWORK_DETAILS","EHWCardListEntityType"],"mappings":";AAGA,MAAMA,IAAM,KAAK,MAAM,KAAK,IAAA,IAAQ,GAAI,GAClCC,IAAgBD,IAAM,IAAI,KAAK,KAAK,IAEpCE,IAAqC;AAAA,EACzC,oBAAoB;AAAA;AAAA,IAElB;AAAA,MACE,aAAaC,EAAsB;AAAA,MACnC,WAAW;AAAA,MACX,cAAc;AAAA,MACd,aAAa;AAAA,MACb,aAAa;AAAA,MACb,SAAS;AAAA,MACT,WAAW;AAAA,MACX,OAAO;AAAA,MACP,aAAa;AAAA,MACb,UAAU;AAAA,MACV,IAAI;AAAA,MACJ,OAAO;AAAA,MACP,QAAQ;AAAA,QACN;AAAA,UACE,UAAU;AAAA,UACV,kBAAkB;AAAA,UAClB,UAAU;AAAA,UACV,aAAa;AAAA,UACb,YAAY;AAAA,UACZ,aAAa;AAAA,UACb,2BAA2B;AAAA,UAC3B,aAAa;AAAA,UACb,WAAW;AAAA,UACX,WAAW;AAAA,UACX,aAAa;AAAA,UAC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f,WAAW;AAAA,YACX,YAAY;AAAA,YACZ,YAAY;AAAA,YACZ,WAAW;AAAA,YACX,oBAAoB;AAAA,YACpB,cAAc;AAAA,YACd,YAAY;AAAA,YACZ,aAAa;AAAA,YACb,UAAU;AAAA,UACZ;AAAA,UACA,iBAAiB;AAAA,UACjB,YAAY;AAAA,UACZ,OAAO;AAAA,UACP,OAAO;AAAA,UACP,iBAAiB;AAAA,UACjB,gBAAgBD,IAAM;AAAA;AAAA,UACtB,iBAAiB;AAAA,UACjB,cAAc;AAAA,UACd,cAAc;AAAA,UACd,iBAAiB;AAAA,UACjB,IAAI;AAAA,UACJ,iBAAiB;AAAA,UACjB,WAAW;AAAA,UACX,0BAA0B;AAAA,UAC1B,kBAAkB;AAAA,UAClB,eAAe;AAAA,UACf,mBAAmB;AAAA,UACnB,WAAW;AAAA,UACX,SAAS;AAAA,UACT,eAAe;AAAA,UACf,iBAAiB;AAAA,QACnB;AAAA,MACF;AAAA,IACF;AAAA,EACF;AAAA,EACA,kBAAkB,CAAC;AACrB;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-home-page-journey.js","sources":["../../../../../src/features/journey/hooks/use-home-page-journey/use-home-page-journey.tsx"],"sourcesContent":["import { useCallback, useEffect, useMemo, useRef } from 'react';\n\nimport type { IChapterDataProps } from '../../../chapters/chapter/chapter-types';\nimport ChapterItem from '../../../chapters/chapters-list/chapter-item/chapter-item';\nimport HomeworkCard from '../../../homework/homework-card';\nimport HwCardListView from '../../../homework/hw-card-list/hw-card-list-view';\nimport type { TCourseStream } from '../../../milestone/create/milestone-create-types';\nimport MilestoneListContainer from '../../../milestone/milestone-list-container/milestone-list-container';\nimport type { IArrowTooltipProps } from '../../../ui/arrow-tooltip/arrow-tooltip-types';\nimport FlexView from '../../../ui/layout/flex-view';\nimport Text from '../../../ui/text/text';\nimport { JOURNEY_ID_STUDENT } from '../../journey-id/journey-id-student';\nimport { IndicatorType } from '../../use-journey/constants';\nimport type { TCoachmarkJourneyProps } from '../../use-journey/journey-context-types';\nimport { useJourney } from '../../use-journey/use-journey';\nimport { HOMEWORK_DETAILS } from './home-page-homeworks-mock';\nimport type { IHomepageStartJourneyProps } from './homepage-journey-types';\nimport { RECENT_CHAPTERS } from './recent-chapters-mock';\nimport { ChaptersWrapper, ELementWrapper } from './styles';\nimport TooltipItem from './tooltip-item';\nimport { type INodeDataProps } from '../../../chapters-v2/comps/node-card/node-card-types';\n\nexport const useHomePageJourney = () => {\n const journeyId = JOURNEY_ID_STUDENT.HOMEPAGE_JOURNEY;\n\n const homepageRef = useRef<HTMLDivElement>(null) as React.RefObject<HTMLDivElement>;\n const homeworkRef = useRef<HTMLDivElement>(null) as React.RefObject<HTMLDivElement>;\n const recentChaptersRef = useRef<HTMLDivElement>(null);\n const timerRefs = useRef<ReturnType<typeof setTimeout>[]>([]);\n const { nextCoachmark, setJourney, endJourney } = useJourney();\n\n const emptyFunction = useCallback(() => null, []);\n\n const handleEndJourney = useCallback(() => {\n endJourney(journeyId);\n document.body.style.overflow = 'unset';\n }, [endJourney, journeyId]);\n\n const handleNextCoachmark = useCallback(() => {\n nextCoachmark(journeyId, false, 0, true);\n }, [nextCoachmark, journeyId]);\n\n const startJourney = useCallback(\n ({ studentId, stream, userType }: IHomepageStartJourneyProps) => {\n const { title = '', subtext = '' } = HOMEWORK_DETAILS.assigned_homeworks[0]?.sheets[0] || {};\n const isStudent = userType === 'STUDENT';\n\n if (!homepageRef?.current || !homeworkRef?.current) {\n return;\n }\n\n const homepageSteps: TCoachmarkJourneyProps[] = [\n {\n originalElementToHighlightRef: homepageRef,\n\n type: IndicatorType.TOOLTIP,\n elementToHighlight: (\n <FlexView\n $flexGapX={2.5}\n $marginBottomX={8}\n $background=\"WHITE\"\n $widthX={47}\n $gutterX={1}\n >\n <HwCardListView\n userType={userType}\n studentId={studentId}\n isHwProcessing={false}\n hwDetails={HOMEWORK_DETAILS}\n onTestStart={emptyFunction}\n onNodeAttempt={emptyFunction}\n onTestPreview={emptyFunction}\n onNodeView={emptyFunction}\n onTestReview={emptyFunction}\n onNodeReview={emptyFunction}\n onNodeUnassign={emptyFunction}\n />\n <FlexView $flexRowGapX={1} ref={recentChaptersRef}>\n <Text $renderAs=\"ac4-black\" $color=\"BLACK_T_60\">\n Recent Chapters ({RECENT_CHAPTERS?.length})\n </Text>\n <ChaptersWrapper>\n {RECENT_CHAPTERS.map((chapter, idx) => (\n <ChapterItem\n key={chapter.id}\n chapter={chapter as unknown as IChapterDataProps}\n onChapterClick={emptyFunction}\n itemIndex={idx}\n />\n ))}\n </ChaptersWrapper>\n </FlexView>\n <MilestoneListContainer\n milestoneType=\"ACTIVE\"\n activeMilestoneId={''}\n activeTabId={''}\n canCreatePlan={false}\n courseStream={stream as TCourseStream}\n isClassOngoing={false}\n isStudentPresent={false}\n parentName={''}\n studentId={studentId}\n studentName={''}\n teacherName={''}\n userType={userType}\n //* Callbacks\n onAddChapter={emptyFunction}\n onAddOutcome={emptyFunction}\n onChapterClick={emptyFunction}\n onCreatePlan={emptyFunction}\n onDelete={emptyFunction}\n onDraftPublish={emptyFunction}\n onEdit={emptyFunction}\n onExpandPastMilestones={emptyFunction}\n onNodeView={emptyFunction}\n onNodeReview={emptyFunction}\n onWidgetTabSelection={emptyFunction}\n //* Resource callbacks\n onAssignResources={emptyFunction}\n onNodeReset={emptyFunction}\n onNodeUnassign={emptyFunction}\n //* Tests callbacks\n onCreateMilestoneTest={emptyFunction}\n onTestPreview={emptyFunction}\n onTestReview={emptyFunction}\n />\n </FlexView>\n ),\n indicator: {\n position: 'top',\n tooltipXCoOrdinates: 0,\n tooltipYCoOrdinates: 0,\n backgroundColor: 'BLUE_4',\n borderColor: 'BLACK',\n arrowColor: 'BLACK',\n arrowSize: 12,\n width: 264,\n tooltipItem: (\n <TooltipItem\n text={`Welcome to the all new ${isStudent ? 'learning' : 'tutoring'} homepage.`}\n buttonLabel=\"Next\"\n onButtonClick={handleNextCoachmark}\n />\n ),\n } as IArrowTooltipProps,\n },\n {\n originalElementToHighlightRef: homeworkRef,\n elementToHighlight: (\n <ELementWrapper>\n <HwCardListView\n userType={userType}\n studentId={studentId}\n isHwProcessing={false}\n hwDetails={HOMEWORK_DETAILS}\n onTestStart={emptyFunction}\n onNodeAttempt={emptyFunction}\n onTestPreview={emptyFunction}\n onNodeView={emptyFunction}\n onTestReview={emptyFunction}\n onNodeReview={emptyFunction}\n onNodeUnassign={emptyFunction}\n />\n </ELementWrapper>\n ),\n type: IndicatorType.TOOLTIP,\n indicator: {\n position: 'top',\n tooltipXCoOrdinates: -197,\n tooltipYCoOrdinates: -12,\n arrowXCoOrdinates: -110,\n backgroundColor: 'GREEN_4',\n borderColor: 'BLACK',\n arrowColor: 'BLACK',\n width: 264,\n arrowSize: 12,\n tooltipItem: (\n <TooltipItem\n text={`Homework is now easy to access and easy to ${\n isStudent ? 'complete' : 'review'\n }!`}\n buttonLabel=\"Next\"\n onButtonClick={handleNextCoachmark}\n />\n ),\n } as IArrowTooltipProps,\n },\n {\n originalElementToHighlightRef: homeworkRef,\n elementToHighlight: (\n <ELementWrapper>\n <HomeworkCard\n isInQueue={false}\n userType={userType}\n header={title}\n subHeader={subtext || ''}\n nodeData={HOMEWORK_DETAILS.assigned_homeworks[0]?.sheets[0] as INodeDataProps}\n renderAs=\"homework\"\n studentId={studentId}\n shouldOpenOnRight={false}\n entityId=\"\"\n state=\"IN_PROGRESS\"\n score={null}\n />\n </ELementWrapper>\n ),\n type: IndicatorType.TOOLTIP,\n indicator: {\n position: 'top',\n tooltipXCoOrdinates: -35,\n tooltipYCoOrdinates: -7,\n backgroundColor: 'PURPLE_4',\n borderColor: 'BLACK',\n arrowColor: 'BLACK',\n arrowXCoOrdinates: -97,\n arrowSize: 12,\n width: 264,\n tooltipItem: (\n <TooltipItem\n text=\"Track homework status and their due dates.\"\n buttonLabel=\"Next\"\n onButtonClick={handleNextCoachmark}\n />\n ),\n } as IArrowTooltipProps,\n },\n {\n originalElementToHighlightRef: homepageRef,\n elementToHighlight: (\n <ELementWrapper>\n <FlexView $flexRowGapX={1}>\n <Text $renderAs=\"ac4-black\" $color=\"BLACK_T_60\">\n Recent Chapters ({RECENT_CHAPTERS?.length})\n </Text>\n <ChaptersWrapper>\n {RECENT_CHAPTERS.map((chapter, idx) => (\n <ChapterItem\n key={chapter.id}\n chapter={chapter as unknown as IChapterDataProps}\n onChapterClick={emptyFunction}\n itemIndex={idx}\n />\n ))}\n </ChaptersWrapper>\n </FlexView>\n </ELementWrapper>\n ),\n type: IndicatorType.TOOLTIP,\n indicator: {\n position: 'top',\n tooltipXCoOrdinates: -200,\n tooltipYCoOrdinates: -10,\n backgroundColor: 'YELLOW_4',\n borderColor: 'BLACK',\n arrowColor: 'BLACK',\n arrowXCoOrdinates: -97,\n arrowSize: 12,\n width: 264,\n tooltipItem: (\n <TooltipItem\n text=\"Access all your recent chapters in one place.\"\n buttonLabel=\"Got it\"\n onButtonClick={handleEndJourney}\n />\n ),\n } as IArrowTooltipProps,\n },\n ];\n\n setJourney(journeyId, homepageSteps);\n\n const delayBeforeStart = setTimeout(() => {\n clearTimeout(delayBeforeStart);\n if (userType === 'STUDENT') {\n window.scrollTo(0, 0);\n } else {\n document.getElementById('tab-content-container')?.scrollTo(0, 0);\n }\n document.body.style.overflow = 'hidden';\n handleNextCoachmark();\n }, 200);\n\n timerRefs.current.push(delayBeforeStart); // Store to cleanup later\n },\n [handleEndJourney, emptyFunction, handleNextCoachmark, journeyId, setJourney],\n );\n\n const data = useMemo(\n () => ({\n homepageRef,\n homeworkRef,\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 }, []);\n\n return data;\n};\n"],"names":["useHomePageJourney","journeyId","JOURNEY_ID_STUDENT","homepageRef","useRef","homeworkRef","recentChaptersRef","timerRefs","nextCoachmark","setJourney","endJourney","useJourney","emptyFunction","useCallback","handleEndJourney","handleNextCoachmark","startJourney","studentId","stream","userType","title","subtext","_a","HOMEWORK_DETAILS","isStudent","homepageSteps","IndicatorType","jsxs","FlexView","jsx","HwCardListView","Text","_b","RECENT_CHAPTERS","ChaptersWrapper","chapter","idx","ChapterItem","MilestoneListContainer","TooltipItem","ELementWrapper","HomeworkCard","_c","_d","delayBeforeStart","data","useMemo","useEffect","timer"],"mappings":";;;;;;;;;;;;;;;AAsBO,MAAMA,KAAqB,MAAM;AACtC,QAAMC,IAAYC,EAAmB,kBAE/BC,IAAcC,EAAuB,IAAI,GACzCC,IAAcD,EAAuB,IAAI,GACzCE,IAAoBF,EAAuB,IAAI,GAC/CG,IAAYH,EAAwC,CAAA,CAAE,GACtD,EAAE,eAAAI,GAAe,YAAAC,GAAY,YAAAC,MAAeC,EAAW,GAEvDC,IAAgBC,EAAY,MAAM,MAAM,CAAE,CAAA,GAE1CC,IAAmBD,EAAY,MAAM;AACzC,IAAAH,EAAWT,CAAS,GACX,SAAA,KAAK,MAAM,WAAW;AAAA,EAAA,GAC9B,CAACS,GAAYT,CAAS,CAAC,GAEpBc,IAAsBF,EAAY,MAAM;AAC9B,IAAAL,EAAAP,GAAW,IAAO,GAAG,EAAI;AAAA,EAAA,GACtC,CAACO,GAAeP,CAAS,CAAC,GAEvBe,IAAeH;AAAA,IACnB,CAAC,EAAE,WAAAI,GAAW,QAAAC,GAAQ,UAAAC,QAA2C;;AAC/D,YAAM,EAAE,OAAAC,IAAQ,IAAI,SAAAC,IAAU,GAAG,MAAIC,IAAAC,EAAiB,mBAAmB,CAAC,MAArC,gBAAAD,EAAwC,OAAO,OAAM,CAAA,GACpFE,IAAYL,MAAa;AAE/B,UAAI,EAAChB,KAAA,QAAAA,EAAa,YAAW,EAACE,KAAA,QAAAA,EAAa;AACzC;AAGF,YAAMoB,IAA0C;AAAA,QAC9C;AAAA,UACE,+BAA+BtB;AAAA,UAE/B,MAAMuB,EAAc;AAAA,UACpB,oBACE,gBAAAC;AAAA,YAACC;AAAA,YAAA;AAA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K,CAAC,GACtDzC,EAAU,UAAU;EAAC,GAEtB,CAAE,CAAA,GAEEsC;AACT;"}
|
|
1
|
+
{"version":3,"file":"use-home-page-journey.js","sources":["../../../../../src/features/journey/hooks/use-home-page-journey/use-home-page-journey.tsx"],"sourcesContent":["import { useCallback, useEffect, useMemo, useRef } from 'react';\n\nimport type { IChapterDataProps } from '../../../chapters/chapter/chapter-types';\nimport ChapterItem from '../../../chapters/chapters-list/chapter-item/chapter-item';\nimport HomeworkCard from '../../../homework/homework-card';\nimport HwCardListView from '../../../homework/hw-card-list/hw-card-list-view';\nimport type { TCourseStream } from '../../../milestone/create/milestone-create-types';\nimport MilestoneListContainer from '../../../milestone/milestone-list-container/milestone-list-container';\nimport type { IArrowTooltipProps } from '../../../ui/arrow-tooltip/arrow-tooltip-types';\nimport FlexView from '../../../ui/layout/flex-view';\nimport Text from '../../../ui/text/text';\nimport { JOURNEY_ID_STUDENT } from '../../journey-id/journey-id-student';\nimport { IndicatorType } from '../../use-journey/constants';\nimport type { TCoachmarkJourneyProps } from '../../use-journey/journey-context-types';\nimport { useJourney } from '../../use-journey/use-journey';\nimport { HOMEWORK_DETAILS } from './home-page-homeworks-mock';\nimport type { IHomepageStartJourneyProps } from './homepage-journey-types';\nimport { RECENT_CHAPTERS } from './recent-chapters-mock';\nimport { ChaptersWrapper, ELementWrapper } from './styles';\nimport TooltipItem from './tooltip-item';\nimport { type INodeDataProps } from '../../../chapters-v2/comps/node-card/node-card-types';\n\nexport const useHomePageJourney = () => {\n const journeyId = JOURNEY_ID_STUDENT.HOMEPAGE_JOURNEY;\n\n const homepageRef = useRef<HTMLDivElement>(null) as React.RefObject<HTMLDivElement>;\n const homeworkRef = useRef<HTMLDivElement>(null) as React.RefObject<HTMLDivElement>;\n const recentChaptersRef = useRef<HTMLDivElement>(null);\n const timerRefs = useRef<ReturnType<typeof setTimeout>[]>([]);\n const { nextCoachmark, setJourney, endJourney } = useJourney();\n\n const emptyFunction = useCallback(() => null, []);\n\n const handleEndJourney = useCallback(() => {\n endJourney(journeyId);\n document.body.style.overflow = 'unset';\n }, [endJourney, journeyId]);\n\n const handleNextCoachmark = useCallback(() => {\n nextCoachmark(journeyId, false, 0, true);\n }, [nextCoachmark, journeyId]);\n\n const startJourney = useCallback(\n ({ studentId, stream, userType }: IHomepageStartJourneyProps) => {\n const { title = '', subtext = '' } = HOMEWORK_DETAILS.assigned_homeworks[0]?.sheets[0] || {};\n const isStudent = userType === 'STUDENT';\n\n if (!homepageRef?.current || !homeworkRef?.current) {\n return;\n }\n\n const homepageSteps: TCoachmarkJourneyProps[] = [\n {\n originalElementToHighlightRef: homepageRef,\n\n type: IndicatorType.TOOLTIP,\n elementToHighlight: (\n <FlexView\n $flexGapX={2.5}\n $marginBottomX={8}\n $background=\"WHITE\"\n $widthX={47}\n $gutterX={1}\n >\n <HwCardListView\n userType={userType}\n studentId={studentId}\n isHwProcessing={false}\n hwDetails={HOMEWORK_DETAILS}\n onTestStart={emptyFunction}\n onNodeAttempt={emptyFunction}\n onTestPreview={emptyFunction}\n onNodeView={emptyFunction}\n onTestReview={emptyFunction}\n onNodeReview={emptyFunction}\n onNodeUnassign={emptyFunction}\n />\n <FlexView $flexRowGapX={1} ref={recentChaptersRef}>\n <Text $renderAs=\"ac4-black\" $color=\"BLACK_T_60\">\n Recent Chapters ({RECENT_CHAPTERS?.length})\n </Text>\n <ChaptersWrapper>\n {RECENT_CHAPTERS.map((chapter, idx) => (\n <ChapterItem\n key={chapter.id}\n chapter={chapter as unknown as IChapterDataProps}\n onChapterClick={emptyFunction}\n itemIndex={idx}\n />\n ))}\n </ChaptersWrapper>\n </FlexView>\n <MilestoneListContainer\n milestoneType=\"ACTIVE\"\n activeMilestoneId={''}\n activeTabId={''}\n canCreatePlan={false}\n courseStream={stream as TCourseStream}\n isClassOngoing={false}\n isStudentPresent={false}\n parentName={''}\n studentId={studentId}\n studentName={''}\n teacherName={''}\n userType={userType}\n //* Callbacks\n onAddChapter={emptyFunction}\n onAddOutcome={emptyFunction}\n onChapterClick={emptyFunction}\n onCreatePlan={emptyFunction}\n onDelete={emptyFunction}\n onDraftPublish={emptyFunction}\n onEdit={emptyFunction}\n onExpandPastMilestones={emptyFunction}\n onNodeView={emptyFunction}\n onNodeReview={emptyFunction}\n onWidgetTabSelection={emptyFunction}\n //* Resource callbacks\n onAssignResources={emptyFunction}\n onNodeReset={emptyFunction}\n onNodeUnassign={emptyFunction}\n //* Tests callbacks\n onCreateMilestoneTest={emptyFunction}\n onTestPreview={emptyFunction}\n onTestReview={emptyFunction}\n />\n </FlexView>\n ),\n indicator: {\n position: 'top',\n tooltipXCoOrdinates: 0,\n tooltipYCoOrdinates: 0,\n backgroundColor: 'BLUE_4',\n borderColor: 'BLACK',\n arrowColor: 'BLACK',\n arrowSize: 12,\n width: 264,\n tooltipItem: (\n <TooltipItem\n text={`Welcome to the all new ${isStudent ? 'learning' : 'tutoring'} homepage.`}\n buttonLabel=\"Next\"\n onButtonClick={handleNextCoachmark}\n />\n ),\n } as IArrowTooltipProps,\n },\n {\n originalElementToHighlightRef: homeworkRef,\n elementToHighlight: (\n <ELementWrapper>\n <HwCardListView\n userType={userType}\n studentId={studentId}\n isHwProcessing={false}\n hwDetails={HOMEWORK_DETAILS}\n onTestStart={emptyFunction}\n onNodeAttempt={emptyFunction}\n onTestPreview={emptyFunction}\n onNodeView={emptyFunction}\n onTestReview={emptyFunction}\n onNodeReview={emptyFunction}\n onNodeUnassign={emptyFunction}\n />\n </ELementWrapper>\n ),\n type: IndicatorType.TOOLTIP,\n indicator: {\n position: 'top',\n tooltipXCoOrdinates: -197,\n tooltipYCoOrdinates: -12,\n arrowXCoOrdinates: -110,\n backgroundColor: 'GREEN_4',\n borderColor: 'BLACK',\n arrowColor: 'BLACK',\n width: 264,\n arrowSize: 12,\n tooltipItem: (\n <TooltipItem\n text={`Homework is now easy to access and easy to ${\n isStudent ? 'complete' : 'review'\n }!`}\n buttonLabel=\"Next\"\n onButtonClick={handleNextCoachmark}\n />\n ),\n } as IArrowTooltipProps,\n },\n {\n originalElementToHighlightRef: homeworkRef,\n elementToHighlight: (\n <ELementWrapper>\n <HomeworkCard\n isInQueue={false}\n userType={userType}\n header={title}\n subHeader={subtext || ''}\n nodeData={HOMEWORK_DETAILS.assigned_homeworks[0]?.sheets[0] as INodeDataProps}\n renderAs=\"homework\"\n studentId={studentId}\n shouldOpenOnRight={false}\n entityId=\"\"\n state=\"IN_PROGRESS\"\n score={null}\n totalQuestions={10}\n />\n </ELementWrapper>\n ),\n type: IndicatorType.TOOLTIP,\n indicator: {\n position: 'top',\n tooltipXCoOrdinates: -35,\n tooltipYCoOrdinates: -7,\n backgroundColor: 'PURPLE_4',\n borderColor: 'BLACK',\n arrowColor: 'BLACK',\n arrowXCoOrdinates: -97,\n arrowSize: 12,\n width: 264,\n tooltipItem: (\n <TooltipItem\n text=\"Track homework status and their due dates.\"\n buttonLabel=\"Next\"\n onButtonClick={handleNextCoachmark}\n />\n ),\n } as IArrowTooltipProps,\n },\n {\n originalElementToHighlightRef: homepageRef,\n elementToHighlight: (\n <ELementWrapper>\n <FlexView $flexRowGapX={1}>\n <Text $renderAs=\"ac4-black\" $color=\"BLACK_T_60\">\n Recent Chapters ({RECENT_CHAPTERS?.length})\n </Text>\n <ChaptersWrapper>\n {RECENT_CHAPTERS.map((chapter, idx) => (\n <ChapterItem\n key={chapter.id}\n chapter={chapter as unknown as IChapterDataProps}\n onChapterClick={emptyFunction}\n itemIndex={idx}\n />\n ))}\n </ChaptersWrapper>\n </FlexView>\n </ELementWrapper>\n ),\n type: IndicatorType.TOOLTIP,\n indicator: {\n position: 'top',\n tooltipXCoOrdinates: -200,\n tooltipYCoOrdinates: -10,\n backgroundColor: 'YELLOW_4',\n borderColor: 'BLACK',\n arrowColor: 'BLACK',\n arrowXCoOrdinates: -97,\n arrowSize: 12,\n width: 264,\n tooltipItem: (\n <TooltipItem\n text=\"Access all your recent chapters in one place.\"\n buttonLabel=\"Got it\"\n onButtonClick={handleEndJourney}\n />\n ),\n } as IArrowTooltipProps,\n },\n ];\n\n setJourney(journeyId, homepageSteps);\n\n const delayBeforeStart = setTimeout(() => {\n clearTimeout(delayBeforeStart);\n if (userType === 'STUDENT') {\n window.scrollTo(0, 0);\n } else {\n document.getElementById('tab-content-container')?.scrollTo(0, 0);\n }\n document.body.style.overflow = 'hidden';\n handleNextCoachmark();\n }, 200);\n\n timerRefs.current.push(delayBeforeStart); // Store to cleanup later\n },\n [handleEndJourney, emptyFunction, handleNextCoachmark, journeyId, setJourney],\n );\n\n const data = useMemo(\n () => ({\n homepageRef,\n homeworkRef,\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 }, []);\n\n return data;\n};\n"],"names":["useHomePageJourney","journeyId","JOURNEY_ID_STUDENT","homepageRef","useRef","homeworkRef","recentChaptersRef","timerRefs","nextCoachmark","setJourney","endJourney","useJourney","emptyFunction","useCallback","handleEndJourney","handleNextCoachmark","startJourney","studentId","stream","userType","title","subtext","_a","HOMEWORK_DETAILS","isStudent","homepageSteps","IndicatorType","jsxs","FlexView","jsx","HwCardListView","Text","_b","RECENT_CHAPTERS","ChaptersWrapper","chapter","idx","ChapterItem","MilestoneListContainer","TooltipItem","ELementWrapper","HomeworkCard","_c","_d","delayBeforeStart","data","useMemo","useEffect","timer"],"mappings":";;;;;;;;;;;;;;;AAsBO,MAAMA,KAAqB,MAAM;AACtC,QAAMC,IAAYC,EAAmB,kBAE/BC,IAAcC,EAAuB,IAAI,GACzCC,IAAcD,EAAuB,IAAI,GACzCE,IAAoBF,EAAuB,IAAI,GAC/CG,IAAYH,EAAwC,CAAA,CAAE,GACtD,EAAE,eAAAI,GAAe,YAAAC,GAAY,YAAAC,MAAeC,EAAW,GAEvDC,IAAgBC,EAAY,MAAM,MAAM,CAAE,CAAA,GAE1CC,IAAmBD,EAAY,MAAM;AACzC,IAAAH,EAAWT,CAA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ezB;AAAA,cAAA;AAAA,YACjB;AAAA,UAEJ;AAAA,QACF;AAAA,MAAA;AAGF,MAAAL,EAAWR,GAAWwB,CAAa;AAE7B,YAAAmB,IAAmB,WAAW,MAAM;;AACxC,qBAAaA,CAAgB,GACzBzB,MAAa,YACR,OAAA,SAAS,GAAG,CAAC,KAEpBG,IAAA,SAAS,eAAe,uBAAuB,MAA/C,QAAAA,EAAkD,SAAS,GAAG,IAEvD,SAAA,KAAK,MAAM,WAAW,UACXP;SACnB,GAAG;AAEI,MAAAR,EAAA,QAAQ,KAAKqC,CAAgB;AAAA,IACzC;AAAA,IACA,CAAC9B,GAAkBF,GAAeG,GAAqBd,GAAWQ,CAAU;AAAA,EAAA,GAGxEoC,IAAOC;AAAA,IACX,OAAO;AAAA,MACL,aAAA3C;AAAA,MACA,aAAAE;AAAA,MACA,cAAAW;AAAA,IAAA;AAAA,IAEF,CAACA,CAAY;AAAA,EAAA;AAIf,SAAA+B,EAAU,MACD,MAAM;AACX,IAAAxC,EAAU,QAAQ,QAAQ,CAASyC,MAAA,aAAaA,CAAK,CAAC,GACtDzC,EAAU,UAAU;EAAC,GAEtB,CAAE,CAAA,GAEEsC;AACT;"}
|
|
@@ -1,65 +1,74 @@
|
|
|
1
|
-
import { NODE_CARD_STATES as
|
|
2
|
-
import { ESectionStatus as
|
|
3
|
-
import { ESectionCardVariant as
|
|
4
|
-
const
|
|
5
|
-
[
|
|
1
|
+
import { NODE_CARD_STATES as u } from "../../chapters-v2/constants/node-constants.js";
|
|
2
|
+
import { ESectionStatus as r } from "./math-fit-overview-types.js";
|
|
3
|
+
import { ESectionCardVariant as a } from "./comps/section-card/section-card-types.js";
|
|
4
|
+
const S = 1e3 * 60 * 60, f = {
|
|
5
|
+
[r.COMPLETED]: {
|
|
6
6
|
backgroundColor: "GREEN_2",
|
|
7
7
|
cardBackgroundColor: "GREEN_1",
|
|
8
8
|
cardBorderColor: "GREEN_4",
|
|
9
|
-
cardVariant:
|
|
9
|
+
cardVariant: a.COMPLETED,
|
|
10
10
|
textColor: "BLACK_T_60"
|
|
11
11
|
},
|
|
12
|
-
[
|
|
12
|
+
[r.ACTIVE]: {
|
|
13
13
|
backgroundColor: "YELLOW_1",
|
|
14
14
|
cardBackgroundColor: "YELLOW_1",
|
|
15
15
|
cardBorderColor: "BLACK_1",
|
|
16
|
-
cardVariant:
|
|
16
|
+
cardVariant: a.ACTIVE,
|
|
17
17
|
textColor: "BLACK_1"
|
|
18
18
|
},
|
|
19
|
-
[
|
|
19
|
+
[r.LOCKED]: {
|
|
20
20
|
backgroundColor: "BLACK_T_08",
|
|
21
21
|
cardBackgroundColor: "WHITE_1",
|
|
22
22
|
cardBorderColor: "BLACK_T_08",
|
|
23
|
-
cardVariant:
|
|
23
|
+
cardVariant: a.DISABLED,
|
|
24
24
|
textColor: "BLACK_T_38"
|
|
25
25
|
}
|
|
26
26
|
}, l = (e) => e.find(
|
|
27
|
-
(t) => t.sheet.state ===
|
|
27
|
+
(t) => t.sheet.state === u.NOT_STARTED || t.sheet.state === u.IN_PROGRESS
|
|
28
28
|
), L = (e) => {
|
|
29
29
|
const t = e * 1e3 - Date.now();
|
|
30
30
|
if (t <= 0) return;
|
|
31
|
-
const
|
|
32
|
-
return
|
|
33
|
-
},
|
|
31
|
+
const o = Math.floor(t / S), c = Math.floor(o / 24), n = Math.floor(t / (1e3 * 60));
|
|
32
|
+
return o < 1 ? { value: n, unit: "minutes" } : c < 1 ? { value: o, unit: "hours" } : { value: c, unit: "days" };
|
|
33
|
+
}, D = (e) => {
|
|
34
34
|
const { sheet: t } = e;
|
|
35
35
|
switch (t.state) {
|
|
36
36
|
case "LOCKED":
|
|
37
|
-
return
|
|
37
|
+
return r.LOCKED;
|
|
38
38
|
case "COMPLETED":
|
|
39
|
-
return
|
|
39
|
+
return r.COMPLETED;
|
|
40
40
|
case "IN_PROGRESS":
|
|
41
|
-
return
|
|
41
|
+
return r.ACTIVE;
|
|
42
42
|
default:
|
|
43
|
-
return
|
|
43
|
+
return r.ACTIVE;
|
|
44
44
|
}
|
|
45
45
|
}, B = (e) => {
|
|
46
46
|
const t = l(e);
|
|
47
|
-
return t ? `${t.sheet.state ===
|
|
47
|
+
return t ? `${t.sheet.state === u.IN_PROGRESS ? "Resume" : "Start"} Section ${t.section_number}` : "Start Section";
|
|
48
48
|
}, R = (e) => {
|
|
49
49
|
const t = l(e);
|
|
50
50
|
if (!t) return null;
|
|
51
|
-
const
|
|
52
|
-
if (!
|
|
53
|
-
const { value:
|
|
54
|
-
return [
|
|
55
|
-
},
|
|
51
|
+
const o = e.findIndex((i) => i.id === t.id) === 0, c = e.some((i) => i.sheet.state === r.COMPLETED), n = t.sheet.due_date_ts, s = n && L(n);
|
|
52
|
+
if (!s) return null;
|
|
53
|
+
const { value: d, unit: _ } = s, C = _.slice(0, -1), E = `${d} ${d === 1 ? C : _}`;
|
|
54
|
+
return [o && !c ? `Do each section whenever it suits you, within ${E}` : `Start Section ${t.section_number} now, or later within ${E}`, "Questions come from what you just learned"];
|
|
55
|
+
}, g = (e) => f[e], I = (e) => {
|
|
56
|
+
const { sections: t, user_id: o, id: c } = e, n = {
|
|
57
|
+
student_id: o,
|
|
58
|
+
mathfit_id: c
|
|
59
|
+
};
|
|
60
|
+
return t.forEach((s) => {
|
|
61
|
+
n[`section_${s.section_number}_score`] = s.score, n[`section_${s.section_number}_state`] = s.sheet.state;
|
|
62
|
+
}), n;
|
|
63
|
+
};
|
|
56
64
|
export {
|
|
57
65
|
f as SECTION_STATUS_CONFIG,
|
|
58
66
|
L as calculateTimeLeft,
|
|
59
67
|
l as findActiveSection,
|
|
60
68
|
R as getBeforeYouStartText,
|
|
61
|
-
I as
|
|
69
|
+
I as getSectionAnalyticsProps,
|
|
70
|
+
g as getSectionStatusConfig,
|
|
62
71
|
B as getStartButtonText,
|
|
63
|
-
|
|
72
|
+
D as mapSectionStatus
|
|
64
73
|
};
|
|
65
74
|
//# sourceMappingURL=math-fit-overview-helpers.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"math-fit-overview-helpers.js","sources":["../../../../src/features/math-fit/math-fit-overview/math-fit-overview-helpers.ts"],"sourcesContent":["import { NODE_CARD_STATES } from '../../chapters-v2/constants/node-constants';\nimport {
|
|
1
|
+
{"version":3,"file":"math-fit-overview-helpers.js","sources":["../../../../src/features/math-fit/math-fit-overview/math-fit-overview-helpers.ts"],"sourcesContent":["import { NODE_CARD_STATES } from '../../chapters-v2/constants/node-constants';\nimport {\n type IMathFitSection,\n ESectionStatus,\n type ITimeLeft,\n type IMathFitAssessmentResponse,\n} from './math-fit-overview-types';\nimport { ESectionCardVariant } from './comps/section-card/section-card-types';\nimport { type TColorNames } from '../../ui/types';\n\ntype TSectionStatusConfig = {\n backgroundColor: TColorNames;\n cardBackgroundColor: TColorNames;\n cardBorderColor: TColorNames;\n cardVariant: ESectionCardVariant;\n textColor: TColorNames;\n};\n\ntype TSectionStatusConfigMap = {\n [key in ESectionStatus]: TSectionStatusConfig;\n};\n\nconst MS_PER_HOUR = 1000 * 60 * 60;\n\nexport const SECTION_STATUS_CONFIG: TSectionStatusConfigMap = {\n [ESectionStatus.COMPLETED]: {\n backgroundColor: 'GREEN_2',\n cardBackgroundColor: 'GREEN_1',\n cardBorderColor: 'GREEN_4',\n cardVariant: ESectionCardVariant.COMPLETED,\n textColor: 'BLACK_T_60',\n },\n [ESectionStatus.ACTIVE]: {\n backgroundColor: 'YELLOW_1',\n cardBackgroundColor: 'YELLOW_1',\n cardBorderColor: 'BLACK_1',\n cardVariant: ESectionCardVariant.ACTIVE,\n textColor: 'BLACK_1',\n },\n [ESectionStatus.LOCKED]: {\n backgroundColor: 'BLACK_T_08',\n cardBackgroundColor: 'WHITE_1',\n cardBorderColor: 'BLACK_T_08',\n cardVariant: ESectionCardVariant.DISABLED,\n textColor: 'BLACK_T_38',\n },\n};\n\nexport const findActiveSection = (sections: IMathFitSection[]) =>\n sections.find(\n s =>\n s.sheet.state === NODE_CARD_STATES.NOT_STARTED ||\n s.sheet.state === NODE_CARD_STATES.IN_PROGRESS,\n );\n\nexport const calculateTimeLeft = (dueDateTs: number): ITimeLeft | undefined => {\n const timeLeftMs = dueDateTs * 1000 - Date.now();\n\n if (timeLeftMs <= 0) return undefined;\n\n const hoursLeft = Math.floor(timeLeftMs / MS_PER_HOUR);\n const daysLeft = Math.floor(hoursLeft / 24);\n const minutesLeft = Math.floor(timeLeftMs / (1000 * 60));\n\n if (hoursLeft < 1) {\n return { value: minutesLeft, unit: 'minutes' };\n }\n\n if (daysLeft < 1) {\n return { value: hoursLeft, unit: 'hours' };\n }\n\n return { value: daysLeft, unit: 'days' };\n};\n\nexport const mapSectionStatus = (section: IMathFitSection): ESectionStatus => {\n const { sheet } = section;\n\n switch (sheet.state) {\n case 'LOCKED':\n return ESectionStatus.LOCKED;\n case 'COMPLETED':\n return ESectionStatus.COMPLETED;\n case 'IN_PROGRESS':\n return ESectionStatus.ACTIVE;\n default:\n return ESectionStatus.ACTIVE;\n }\n};\n\nexport const getStartButtonText = (sections: IMathFitSection[]): string => {\n const activeSection = findActiveSection(sections);\n\n if (!activeSection) return 'Start Section';\n\n const action = activeSection.sheet.state === NODE_CARD_STATES.IN_PROGRESS ? 'Resume' : 'Start';\n\n return `${action} Section ${activeSection.section_number}`;\n};\n\nexport const getBeforeYouStartText = (sections: IMathFitSection[]): string[] | null => {\n const activeSection = findActiveSection(sections);\n\n if (!activeSection) return null;\n\n const isFirstSection = sections.findIndex(s => s.id === activeSection.id) === 0;\n const hasCompletedSections = sections.some(s => s.sheet.state === ESectionStatus.COMPLETED);\n const activeSectionDueDate = activeSection.sheet.due_date_ts;\n const calculatedTimeLeft = activeSectionDueDate && calculateTimeLeft(activeSectionDueDate);\n\n if (!calculatedTimeLeft) return null;\n\n const { value, unit } = calculatedTimeLeft;\n const singularUnit = unit.slice(0, -1); // Remove 's' from end\n const displayUnit = value === 1 ? singularUnit : unit;\n const timeLeftText = `${value} ${displayUnit}`;\n\n const firstLine =\n isFirstSection && !hasCompletedSections\n ? `Do each section whenever it suits you, within ${timeLeftText}`\n : `Start Section ${activeSection.section_number} now, or later within ${timeLeftText}`;\n\n return [firstLine, 'Questions come from what you just learned'];\n};\n\nexport const getSectionStatusConfig = (status: ESectionStatus) => SECTION_STATUS_CONFIG[status];\n\nexport const getSectionAnalyticsProps = (data: IMathFitAssessmentResponse) => {\n const { sections, user_id, id: mathfit_id } = data;\n const props = {\n student_id: user_id,\n mathfit_id,\n } as Record<string, number | string>;\n\n sections.forEach((section: IMathFitSection) => {\n props[`section_${section.section_number}_score`] = section.score;\n props[`section_${section.section_number}_state`] = section.sheet.state;\n });\n\n return props;\n};\n"],"names":["MS_PER_HOUR","SECTION_STATUS_CONFIG","ESectionStatus","ESectionCardVariant","findActiveSection","sections","s","NODE_CARD_STATES","calculateTimeLeft","dueDateTs","timeLeftMs","hoursLeft","daysLeft","minutesLeft","mapSectionStatus","section","sheet","getStartButtonText","activeSection","getBeforeYouStartText","isFirstSection","hasCompletedSections","activeSectionDueDate","calculatedTimeLeft","value","unit","singularUnit","timeLeftText","getSectionStatusConfig","status","getSectionAnalyticsProps","data","user_id","mathfit_id","props"],"mappings":";;;AAsBA,MAAMA,IAAc,MAAO,KAAK,IAEnBC,IAAiD;AAAA,EAC5D,CAACC,EAAe,SAAS,GAAG;AAAA,IAC1B,iBAAiB;AAAA,IACjB,qBAAqB;AAAA,IACrB,iBAAiB;AAAA,IACjB,aAAaC,EAAoB;AAAA,IACjC,WAAW;AAAA,EACb;AAAA,EACA,CAACD,EAAe,MAAM,GAAG;AAAA,IACvB,iBAAiB;AAAA,IACjB,qBAAqB;AAAA,IACrB,iBAAiB;AAAA,IACjB,aAAaC,EAAoB;AAAA,IACjC,WAAW;AAAA,EACb;AAAA,EACA,CAACD,EAAe,MAAM,GAAG;AAAA,IACvB,iBAAiB;AAAA,IACjB,qBAAqB;AAAA,IACrB,iBAAiB;AAAA,IACjB,aAAaC,EAAoB;AAAA,IACjC,WAAW;AAAA,EACb;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,KAAwBd,EAAkBc,CAAoB;AAErF,MAAA,CAACC,EAA2B,QAAA;AAE1B,QAAA,EAAE,OAAAC,GAAO,MAAAC,EAAS,IAAAF,GAClBG,IAAeD,EAAK,MAAM,GAAG,EAAE,GAE/BE,IAAe,GAAGH,CAAK,IADTA,MAAU,IAAIE,IAAeD,CACL;AAOrC,SAAA,CAJLL,KAAkB,CAACC,IACf,iDAAiDM,CAAY,KAC7D,iBAAiBT,EAAc,cAAc,yBAAyBS,CAAY,IAErE,2CAA2C;AAChE,GAEaC,IAAyB,CAACC,MAA2B5B,EAAsB4B,CAAM,GAEjFC,IAA2B,CAACC,MAAqC;AAC5E,QAAM,EAAE,UAAA1B,GAAU,SAAA2B,GAAS,IAAIC,MAAeF,GACxCG,IAAQ;AAAA,IACZ,YAAYF;AAAA,IACZ,YAAAC;AAAA,EAAA;AAGO,SAAA5B,EAAA,QAAQ,CAACU,MAA6B;AAC7C,IAAAmB,EAAM,WAAWnB,EAAQ,cAAc,QAAQ,IAAIA,EAAQ,OAC3DmB,EAAM,WAAWnB,EAAQ,cAAc,QAAQ,IAAIA,EAAQ,MAAM;AAAA,EAAA,CAClE,GAEMmB;AACT;"}
|
|
@@ -1,64 +1,85 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { memo as
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import { findActiveSection as
|
|
9
|
-
import { CountdownBadge as
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
1
|
+
import { jsxs as c, Fragment as M, jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import { memo as O, useMemo as s, useCallback as k, useEffect as w } from "react";
|
|
3
|
+
import I from "../../ui/buttons/button/button.js";
|
|
4
|
+
import n from "../../ui/layout/flex-view.js";
|
|
5
|
+
import X from "../../ui/separator/separator.js";
|
|
6
|
+
import a from "../../ui/text/text.js";
|
|
7
|
+
import D from "./comps/section-card/section-card.js";
|
|
8
|
+
import { findActiveSection as R, getStartButtonText as N, getBeforeYouStartText as U, getSectionAnalyticsProps as G, mapSectionStatus as K, calculateTimeLeft as Y } from "./math-fit-overview-helpers.js";
|
|
9
|
+
import { CountdownBadge as j } from "./math-fit-overview-styled.js";
|
|
10
|
+
import { MATHFIT_ANALYTICS_EVENTS as d } from "../mathfit-events.js";
|
|
11
|
+
import { NODE_CARD_STATES as H } from "../../chapters-v2/constants/node-constants.js";
|
|
12
|
+
import { useUIContext as P } from "../../ui/context/context.js";
|
|
13
|
+
const q = O(function({
|
|
14
|
+
data: l,
|
|
15
|
+
onResume: m,
|
|
16
|
+
onDoLater: v
|
|
14
17
|
}) {
|
|
15
|
-
var
|
|
16
|
-
const { sections: r } =
|
|
17
|
-
if (!
|
|
18
|
-
const
|
|
19
|
-
if (!
|
|
20
|
-
const { value:
|
|
21
|
-
return `${
|
|
22
|
-
}, [
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
18
|
+
var C, E;
|
|
19
|
+
const { sections: r, user_id: $ } = l, u = (E = (C = r[0]) == null ? void 0 : C.sheet) == null ? void 0 : E.due_date_ts, { onEvent: _ } = P(), f = s(() => {
|
|
20
|
+
if (!u) return;
|
|
21
|
+
const e = Y(u);
|
|
22
|
+
if (!e) return;
|
|
23
|
+
const { value: i, unit: x } = e, F = x.slice(0, -1);
|
|
24
|
+
return `${i} ${i === 1 ? F : x} left`;
|
|
25
|
+
}, [u]), o = s(() => R(r), [r]), h = s(() => N(r), [r]), T = s(() => U(r), [r]), { sheet: L, section_number: p } = o || {}, { state: g, total_questions: A, correct_answers: S } = L || {}, b = s(
|
|
26
|
+
() => g === H.IN_PROGRESS ? d.MATHFIT_SECTION_RESUMED : d.MATHFIT_SECTION_STARTED,
|
|
27
|
+
[g]
|
|
28
|
+
), B = s(
|
|
29
|
+
() => ({
|
|
30
|
+
total_questions: A,
|
|
31
|
+
correct_answers: S,
|
|
32
|
+
student_id: $,
|
|
33
|
+
section_type: `L${p}`
|
|
34
|
+
}),
|
|
35
|
+
[p, S, A, $]
|
|
36
|
+
), y = k(() => {
|
|
37
|
+
o && m(o.sheet, o.id);
|
|
38
|
+
}, [o, m]);
|
|
39
|
+
return w(() => {
|
|
40
|
+
_(
|
|
41
|
+
d.MATHFIT_LANDING_PAGE_VIEWED,
|
|
42
|
+
G(l)
|
|
43
|
+
);
|
|
44
|
+
}, [l, _]), /* @__PURE__ */ c(M, { children: [
|
|
45
|
+
/* @__PURE__ */ t(n, { $gutterX: 1.5, $gapX: 0.75, $background: "BLACK_T_04", children: /* @__PURE__ */ t(a, { $renderAs: "ac4", $color: "BLACK_1", children: "TEST STRUCTURE" }) }),
|
|
46
|
+
/* @__PURE__ */ t(n, { $gutterX: 1, $gapX: 1.5, $flexGapX: 1, children: r.map((e, i) => /* @__PURE__ */ t(
|
|
47
|
+
D,
|
|
29
48
|
{
|
|
30
|
-
title: `Section ${
|
|
31
|
-
questionsCount:
|
|
32
|
-
timeInMinutes:
|
|
33
|
-
status:
|
|
34
|
-
showDivider:
|
|
49
|
+
title: `Section ${e.section_number} - ${e.sheet.title}`,
|
|
50
|
+
questionsCount: e.sheet.total_questions || 0,
|
|
51
|
+
timeInMinutes: e.sheet.sheet_time ? e.sheet.sheet_time / 60 : 0,
|
|
52
|
+
status: K(e),
|
|
53
|
+
showDivider: i < r.length - 1
|
|
35
54
|
},
|
|
36
|
-
|
|
55
|
+
e.id
|
|
37
56
|
)) }),
|
|
38
|
-
/* @__PURE__ */
|
|
39
|
-
|
|
40
|
-
/* @__PURE__ */
|
|
41
|
-
/* @__PURE__ */
|
|
57
|
+
/* @__PURE__ */ t(X, { heightX: 1 }),
|
|
58
|
+
!!T && /* @__PURE__ */ c(n, { children: [
|
|
59
|
+
/* @__PURE__ */ t(n, { $gutterX: 1.5, $gapX: 0.75, $background: "BLACK_T_04", children: /* @__PURE__ */ t(a, { $renderAs: "ac4", $color: "BLACK_1", children: "BEFORE YOU START" }) }),
|
|
60
|
+
/* @__PURE__ */ t(n, { $gutterX: 2.5, $gapX: 1, $flexRowGapX: 0.5, children: T.map((e, i) => /* @__PURE__ */ t("li", { children: /* @__PURE__ */ t(a, { $renderAs: "ub2", $color: "BLACK_1", children: e }) }, i)) })
|
|
42
61
|
] }),
|
|
43
|
-
/* @__PURE__ */
|
|
44
|
-
/* @__PURE__ */
|
|
45
|
-
|
|
62
|
+
/* @__PURE__ */ t(X, { heightX: 2.5 }),
|
|
63
|
+
/* @__PURE__ */ c(
|
|
64
|
+
n,
|
|
46
65
|
{
|
|
47
66
|
$flexDirection: "row",
|
|
48
67
|
$justifyContent: "center",
|
|
49
68
|
$alignItems: "flex-end",
|
|
50
69
|
$flexColumnGapX: 1,
|
|
51
70
|
children: [
|
|
52
|
-
/* @__PURE__ */
|
|
53
|
-
/* @__PURE__ */
|
|
54
|
-
!!
|
|
55
|
-
!!
|
|
56
|
-
|
|
71
|
+
/* @__PURE__ */ t(I, { label: "I'll do it later", renderAs: "secondary", size: "regular", onClick: v }),
|
|
72
|
+
/* @__PURE__ */ c(n, { $alignItems: "center", $justifyContent: "center", children: [
|
|
73
|
+
!!f && /* @__PURE__ */ t(j, { $background: "YELLOW_1", $gapX: 0.35, $gutterX: 0.5, children: /* @__PURE__ */ t(a, { $renderAs: "ac5-black", $color: "BLACK_T_60", children: f }) }),
|
|
74
|
+
!!h && /* @__PURE__ */ t(
|
|
75
|
+
I,
|
|
57
76
|
{
|
|
58
|
-
|
|
77
|
+
analyticsLabel: b,
|
|
78
|
+
analyticsProps: B,
|
|
79
|
+
label: h,
|
|
59
80
|
renderAs: "primary",
|
|
60
81
|
size: "regular",
|
|
61
|
-
onClick:
|
|
82
|
+
onClick: y,
|
|
62
83
|
disabled: !o
|
|
63
84
|
}
|
|
64
85
|
)
|
|
@@ -67,8 +88,8 @@ const K = A(function({
|
|
|
67
88
|
}
|
|
68
89
|
)
|
|
69
90
|
] });
|
|
70
|
-
}),
|
|
91
|
+
}), at = q;
|
|
71
92
|
export {
|
|
72
|
-
|
|
93
|
+
at as default
|
|
73
94
|
};
|
|
74
95
|
//# sourceMappingURL=math-fit-overview.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"math-fit-overview.js","sources":["../../../../src/features/math-fit/math-fit-overview/math-fit-overview.tsx"],"sourcesContent":["import { memo, useCallback, useMemo, type FC } from 'react';\n\nimport Button from '../../ui/buttons/button/button';\nimport FlexView from '../../ui/layout/flex-view';\nimport Separator from '../../ui/separator/separator';\nimport Text from '../../ui/text/text';\nimport SectionCard from './comps/section-card/section-card';\nimport {\n calculateTimeLeft,\n findActiveSection,\n getBeforeYouStartText,\n getStartButtonText,\n mapSectionStatus,\n} from './math-fit-overview-helpers';\nimport { type IMathFitOverviewProps } from './math-fit-overview-types';\nimport * as Styled from './math-fit-overview-styled';\n\nconst MathFitOverview: FC<IMathFitOverviewProps> = memo(function MathFitOverview({\n data,\n onResume,\n onDoLater,\n}) {\n const { sections } = data;\n\n const dueDateTS = sections[0]?.sheet?.due_date_ts;\n\n const timeleftText = useMemo(() => {\n if (!dueDateTS) return undefined;\n\n const timeLeft = calculateTimeLeft(dueDateTS);\n\n if (!timeLeft) return undefined;\n\n const { value, unit } = timeLeft;\n const singularUnit = unit.slice(0, -1); // Remove 's' from end\n const displayUnit = value === 1 ? singularUnit : unit;\n\n return `${value} ${displayUnit} left`;\n }, [dueDateTS]);\n\n const activeSection = useMemo(() => findActiveSection(sections), [sections]);\n const startButtonText = useMemo(() => getStartButtonText(sections), [sections]);\n const beforeYouStartText = useMemo(() => getBeforeYouStartText(sections), [sections]);\n\n const handleStartClick = useCallback(() => {\n if (activeSection) {\n onResume(activeSection.sheet, activeSection.id);\n }\n }, [activeSection, onResume]);\n\n return (\n <>\n <FlexView $gutterX={1.5} $gapX={0.75} $background=\"BLACK_T_04\">\n <Text $renderAs=\"ac4\" $color=\"BLACK_1\">\n TEST STRUCTURE\n </Text>\n </FlexView>\n <FlexView $gutterX={1} $gapX={1.5} $flexGapX={1}>\n {sections.map((section, index) => (\n <SectionCard\n key={section.id}\n title={`Section ${section.section_number} - ${section.sheet.title}`}\n questionsCount={section.sheet.total_questions || 0}\n timeInMinutes={section.sheet.sheet_time ? section.sheet.sheet_time / 60 : 0}\n status={mapSectionStatus(section)}\n showDivider={index < sections.length - 1}\n />\n ))}\n </FlexView>\n <Separator heightX={1} />\n {!!beforeYouStartText && (\n <FlexView>\n <FlexView $gutterX={1.5} $gapX={0.75} $background=\"BLACK_T_04\">\n <Text $renderAs=\"ac4\" $color=\"BLACK_1\">\n BEFORE YOU START\n </Text>\n </FlexView>\n <FlexView $gutterX={2.5} $gapX={1} $flexRowGapX={0.5}>\n {beforeYouStartText.map((item, index) => (\n <li key={index}>\n <Text $renderAs=\"ub2\" $color=\"BLACK_1\">\n {item}\n </Text>\n </li>\n ))}\n </FlexView>\n </FlexView>\n )}\n <Separator heightX={2.5} />\n <FlexView\n $flexDirection=\"row\"\n $justifyContent=\"center\"\n $alignItems=\"flex-end\"\n $flexColumnGapX={1}\n >\n <Button label=\"I'll do it later\" renderAs=\"secondary\" size=\"regular\" onClick={onDoLater} />\n <FlexView $alignItems=\"center\" $justifyContent=\"center\">\n {!!timeleftText && (\n <Styled.CountdownBadge $background=\"YELLOW_1\" $gapX={0.35} $gutterX={0.5}>\n <Text $renderAs=\"ac5-black\" $color=\"BLACK_T_60\">\n {timeleftText}\n </Text>\n </Styled.CountdownBadge>\n )}\n {!!startButtonText && (\n <Button\n label={startButtonText}\n renderAs=\"primary\"\n size=\"regular\"\n onClick={handleStartClick}\n disabled={!activeSection}\n />\n )}\n </FlexView>\n </FlexView>\n </>\n );\n});\n\nexport default MathFitOverview;\n"],"names":["MathFitOverview","memo","data","onResume","onDoLater","sections","dueDateTS","_b","_a","timeleftText","useMemo","timeLeft","calculateTimeLeft","value","unit","singularUnit","activeSection","findActiveSection","startButtonText","getStartButtonText","beforeYouStartText","getBeforeYouStartText","handleStartClick","useCallback","jsxs","Fragment","jsx","FlexView","Text","section","index","SectionCard","mapSectionStatus","Separator","item","Button","Styled.CountdownBadge","MathFitOverview$1"],"mappings":"
|
|
1
|
+
{"version":3,"file":"math-fit-overview.js","sources":["../../../../src/features/math-fit/math-fit-overview/math-fit-overview.tsx"],"sourcesContent":["import { memo, useCallback, useEffect, useMemo, type FC } from 'react';\n\nimport Button from '../../ui/buttons/button/button';\nimport FlexView from '../../ui/layout/flex-view';\nimport Separator from '../../ui/separator/separator';\nimport Text from '../../ui/text/text';\nimport SectionCard from './comps/section-card/section-card';\nimport {\n calculateTimeLeft,\n findActiveSection,\n getBeforeYouStartText,\n getSectionAnalyticsProps,\n getStartButtonText,\n mapSectionStatus,\n} from './math-fit-overview-helpers';\nimport { type IMathFitOverviewProps } from './math-fit-overview-types';\nimport * as Styled from './math-fit-overview-styled';\nimport { MATHFIT_ANALYTICS_EVENTS } from '../mathfit-events';\nimport { NODE_CARD_STATES } from '../../chapters-v2/constants/node-constants';\nimport { useUIContext } from '../../ui/context/context';\n\nconst MathFitOverview: FC<IMathFitOverviewProps> = memo(function MathFitOverview({\n data,\n onResume,\n onDoLater,\n}) {\n const { sections, user_id } = data;\n\n const dueDateTS = sections[0]?.sheet?.due_date_ts;\n const { onEvent: trackEvent } = useUIContext();\n\n const timeleftText = useMemo(() => {\n if (!dueDateTS) return undefined;\n\n const timeLeft = calculateTimeLeft(dueDateTS);\n\n if (!timeLeft) return undefined;\n\n const { value, unit } = timeLeft;\n const singularUnit = unit.slice(0, -1); // Remove 's' from end\n const displayUnit = value === 1 ? singularUnit : unit;\n\n return `${value} ${displayUnit} left`;\n }, [dueDateTS]);\n\n const activeSection = useMemo(() => findActiveSection(sections), [sections]);\n const startButtonText = useMemo(() => getStartButtonText(sections), [sections]);\n const beforeYouStartText = useMemo(() => getBeforeYouStartText(sections), [sections]);\n\n const { sheet, section_number } = activeSection || {};\n const { state, total_questions, correct_answers } = sheet || {};\n\n const analyticsLabel = useMemo(\n () =>\n state === NODE_CARD_STATES.IN_PROGRESS\n ? MATHFIT_ANALYTICS_EVENTS.MATHFIT_SECTION_RESUMED\n : MATHFIT_ANALYTICS_EVENTS.MATHFIT_SECTION_STARTED,\n [state],\n );\n const analyticsProps = useMemo(\n () => ({\n total_questions,\n correct_answers,\n student_id: user_id,\n section_type: `L${section_number}`,\n }),\n [section_number, correct_answers, total_questions, user_id],\n );\n\n const handleStartClick = useCallback(() => {\n if (activeSection) {\n onResume(activeSection.sheet, activeSection.id);\n }\n }, [activeSection, onResume]);\n\n useEffect(() => {\n trackEvent(\n MATHFIT_ANALYTICS_EVENTS.MATHFIT_LANDING_PAGE_VIEWED,\n getSectionAnalyticsProps(data),\n );\n }, [data, trackEvent]);\n\n return (\n <>\n <FlexView $gutterX={1.5} $gapX={0.75} $background=\"BLACK_T_04\">\n <Text $renderAs=\"ac4\" $color=\"BLACK_1\">\n TEST STRUCTURE\n </Text>\n </FlexView>\n <FlexView $gutterX={1} $gapX={1.5} $flexGapX={1}>\n {sections.map((section, index) => (\n <SectionCard\n key={section.id}\n title={`Section ${section.section_number} - ${section.sheet.title}`}\n questionsCount={section.sheet.total_questions || 0}\n timeInMinutes={section.sheet.sheet_time ? section.sheet.sheet_time / 60 : 0}\n status={mapSectionStatus(section)}\n showDivider={index < sections.length - 1}\n />\n ))}\n </FlexView>\n <Separator heightX={1} />\n {!!beforeYouStartText && (\n <FlexView>\n <FlexView $gutterX={1.5} $gapX={0.75} $background=\"BLACK_T_04\">\n <Text $renderAs=\"ac4\" $color=\"BLACK_1\">\n BEFORE YOU START\n </Text>\n </FlexView>\n <FlexView $gutterX={2.5} $gapX={1} $flexRowGapX={0.5}>\n {beforeYouStartText.map((item, index) => (\n <li key={index}>\n <Text $renderAs=\"ub2\" $color=\"BLACK_1\">\n {item}\n </Text>\n </li>\n ))}\n </FlexView>\n </FlexView>\n )}\n <Separator heightX={2.5} />\n <FlexView\n $flexDirection=\"row\"\n $justifyContent=\"center\"\n $alignItems=\"flex-end\"\n $flexColumnGapX={1}\n >\n <Button label=\"I'll do it later\" renderAs=\"secondary\" size=\"regular\" onClick={onDoLater} />\n <FlexView $alignItems=\"center\" $justifyContent=\"center\">\n {!!timeleftText && (\n <Styled.CountdownBadge $background=\"YELLOW_1\" $gapX={0.35} $gutterX={0.5}>\n <Text $renderAs=\"ac5-black\" $color=\"BLACK_T_60\">\n {timeleftText}\n </Text>\n </Styled.CountdownBadge>\n )}\n {!!startButtonText && (\n <Button\n analyticsLabel={analyticsLabel}\n analyticsProps={analyticsProps}\n label={startButtonText}\n renderAs=\"primary\"\n size=\"regular\"\n onClick={handleStartClick}\n disabled={!activeSection}\n />\n )}\n </FlexView>\n </FlexView>\n </>\n );\n});\n\nexport default MathFitOverview;\n"],"names":["MathFitOverview","memo","data","onResume","onDoLater","sections","user_id","dueDateTS","_b","_a","trackEvent","useUIContext","timeleftText","useMemo","timeLeft","calculateTimeLeft","value","unit","singularUnit","activeSection","findActiveSection","startButtonText","getStartButtonText","beforeYouStartText","getBeforeYouStartText","sheet","section_number","state","total_questions","correct_answers","analyticsLabel","NODE_CARD_STATES","MATHFIT_ANALYTICS_EVENTS","analyticsProps","handleStartClick","useCallback","useEffect","getSectionAnalyticsProps","jsxs","Fragment","jsx","FlexView","Text","section","index","SectionCard","mapSectionStatus","Separator","item","Button","Styled.CountdownBadge","MathFitOverview$1"],"mappings":";;;;;;;;;;;;AAqBA,MAAMA,IAA6CC,EAAK,SAAyB;AAAA,EAC/E,MAAAC;AAAA,EACA,UAAAC;AAAA,EACA,WAAAC;AACF,GAAG;;AACK,QAAA,EAAE,UAAAC,GAAU,SAAAC,EAAY,IAAAJ,GAExBK,KAAYC,KAAAC,IAAAJ,EAAS,CAAC,MAAV,gBAAAI,EAAa,UAAb,gBAAAD,EAAoB,aAChC,EAAE,SAASE,EAAW,IAAIC,EAAa,GAEvCC,IAAeC,EAAQ,MAAM;AAC7B,QAAA,CAACN,EAAkB;AAEjB,UAAAO,IA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AAA,MAAA;AAAA,QACC,gBAAe;AAAA,QACf,iBAAgB;AAAA,QAChB,aAAY;AAAA,QACZ,iBAAiB;AAAA,QAEjB,UAAA;AAAA,UAAC,gBAAAD,EAAAS,GAAA,EAAO,OAAM,oBAAmB,UAAS,aAAY,MAAK,WAAU,SAAS7C,EAAW,CAAA;AAAA,UACxF,gBAAAkC,EAAAG,GAAA,EAAS,aAAY,UAAS,iBAAgB,UAC5C,UAAA;AAAA,YAAA,CAAC,CAAC7B,KACD,gBAAA4B,EAACU,GAAA,EAAsB,aAAY,YAAW,OAAO,MAAM,UAAU,KACnE,4BAACR,GAAK,EAAA,WAAU,aAAY,QAAO,cAChC,YACH,CAAA,GACF;AAAA,YAED,CAAC,CAACrB,KACD,gBAAAmB;AAAA,cAACS;AAAA,cAAA;AAAA,gBACC,gBAAAnB;AAAA,gBACA,gBAAAG;AAAA,gBACA,OAAOZ;AAAA,gBACP,UAAS;AAAA,gBACT,MAAK;AAAA,gBACL,SAASa;AAAA,gBACT,UAAU,CAACf;AAAA,cAAA;AAAA,YACb;AAAA,UAAA,GAEJ;AAAA,QAAA;AAAA,MAAA;AAAA,IACF;AAAA,EACF,EAAA,CAAA;AAEJ,CAAC,GAEDgC,KAAenD;"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsxs as t, jsx as r } from "react/jsx-runtime";
|
|
2
|
-
import { memo as
|
|
2
|
+
import { memo as p, useMemo as h } from "react";
|
|
3
3
|
import n from "../../../../ui/text/text.js";
|
|
4
4
|
import g from "../score-badge/score-badge.js";
|
|
5
5
|
import { IS_APP_RUNNING_IN_RN as o } from "../../../../../constants/app-config.js";
|
|
@@ -8,7 +8,7 @@ import { formatTestDate as $ } from "../../math-fit-report-helpers.js";
|
|
|
8
8
|
import _ from "../../../../../assets/line-icons/icons/back2.js";
|
|
9
9
|
import x from "../../../../ui/buttons/icon-button/icon-button.js";
|
|
10
10
|
import { HeaderContainer as A, BackButtonContainer as C, BackButtonWrapper as I } from "./report-header-styled.js";
|
|
11
|
-
const P =
|
|
11
|
+
const P = p(function({
|
|
12
12
|
createdOnTs: a,
|
|
13
13
|
maxScore: i,
|
|
14
14
|
score: d,
|
|
@@ -19,12 +19,12 @@ const P = u(function({
|
|
|
19
19
|
compactView: e = !1,
|
|
20
20
|
showGreeting: f = !0
|
|
21
21
|
}) {
|
|
22
|
-
const
|
|
22
|
+
const u = h(() => e ? 5 : o ? 9.6 : 11.75, [e]);
|
|
23
23
|
return /* @__PURE__ */ t(
|
|
24
24
|
A,
|
|
25
25
|
{
|
|
26
26
|
$background: "BLUE_4",
|
|
27
|
-
$heightX:
|
|
27
|
+
$heightX: u,
|
|
28
28
|
$gapX: 1.5,
|
|
29
29
|
$gutterX: 1.5,
|
|
30
30
|
$justifyContent: e ? "center" : "flex-end",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"report-header.js","sources":["../../../../../../src/features/math-fit/math-fit-report/comps/report-header/report-header.tsx"],"sourcesContent":["import { memo, useMemo, type FC } from 'react';\nimport Text from '../../../../ui/text/text';\nimport ScoreBadge from '../score-badge/score-badge';\nimport type { IReportHeaderProps } from './report-header-types';\nimport { IS_APP_RUNNING_IN_RN } from '../../../../../constants/app-config';\nimport Separator from '../../../../ui/separator/separator';\nimport { formatTestDate } from '../../math-fit-report-helpers';\nimport Back2Icon from '../../../../../assets/line-icons/icons/back2';\nimport IconButton from '../../../../ui/buttons/icon-button/icon-button';\nimport * as Styled from './report-header-styled';\n\nconst ReportHeader: FC<IReportHeaderProps> = memo(function ReportHeader({\n createdOnTs,\n maxScore,\n score,\n scoreChange,\n studentName,\n userType,\n onBack,\n compactView = false,\n showGreeting = true,\n}) {\n const headerHeight = useMemo(() => {\n if (
|
|
1
|
+
{"version":3,"file":"report-header.js","sources":["../../../../../../src/features/math-fit/math-fit-report/comps/report-header/report-header.tsx"],"sourcesContent":["import { memo, useMemo, type FC } from 'react';\n\nimport Text from '../../../../ui/text/text';\nimport ScoreBadge from '../score-badge/score-badge';\nimport type { IReportHeaderProps } from './report-header-types';\nimport { IS_APP_RUNNING_IN_RN } from '../../../../../constants/app-config';\nimport Separator from '../../../../ui/separator/separator';\nimport { formatTestDate } from '../../math-fit-report-helpers';\nimport Back2Icon from '../../../../../assets/line-icons/icons/back2';\nimport IconButton from '../../../../ui/buttons/icon-button/icon-button';\nimport * as Styled from './report-header-styled';\n\nconst ReportHeader: FC<IReportHeaderProps> = memo(function ReportHeader({\n createdOnTs,\n maxScore,\n score,\n scoreChange,\n studentName,\n userType,\n onBack,\n compactView = false,\n showGreeting = true,\n}) {\n const headerHeight = useMemo(() => {\n if (compactView) {\n return 5;\n }\n\n if (IS_APP_RUNNING_IN_RN) {\n return 9.6;\n }\n\n return 11.75;\n }, [compactView]);\n\n const justifyContent = compactView ? 'center' : 'flex-end';\n const dateTextVariant = IS_APP_RUNNING_IN_RN || compactView ? 'ac5' : 'ac4';\n const renderScoreBadgeAsMobile = !!(IS_APP_RUNNING_IN_RN || compactView);\n\n return (\n <Styled.HeaderContainer\n $background=\"BLUE_4\"\n $heightX={headerHeight}\n $gapX={1.5}\n $gutterX={1.5}\n $justifyContent={justifyContent}\n $position=\"relative\"\n >\n {userType === 'TEACHER' && (\n <Styled.BackButtonContainer $height=\"100%\">\n <Styled.BackButtonWrapper>\n <IconButton\n Icon={Back2Icon}\n renderAs=\"secondary-gray\"\n analyticsLabel=\"chapter_page_exit\"\n size=\"xsmall\"\n onClick={onBack}\n />\n </Styled.BackButtonWrapper>\n </Styled.BackButtonContainer>\n )}\n {showGreeting && (\n <Text $renderAs=\"ab1-bold\" $color=\"BLACK_1\">\n Well done, {studentName || ''}!\n </Text>\n )}\n <Separator heightX={0.5} />\n <ScoreBadge\n score={score}\n maxScore={maxScore}\n scoreChange={scoreChange}\n renderInHeader\n renderInMobile={renderScoreBadgeAsMobile}\n />\n <Text $renderAs={dateTextVariant} $color=\"BLACK_T_60\">\n TEST Score • {formatTestDate(createdOnTs)}\n </Text>\n </Styled.HeaderContainer>\n );\n});\n\nexport default ReportHeader;\n"],"names":["ReportHeader","memo","createdOnTs","maxScore","score","scoreChange","studentName","userType","onBack","compactView","showGreeting","headerHeight","useMemo","IS_APP_RUNNING_IN_RN","jsxs","Styled.HeaderContainer","jsx","Styled.BackButtonContainer","Styled.BackButtonWrapper","IconButton","Back2Icon","Text","Separator","ScoreBadge","formatTestDate"],"mappings":";;;;;;;;;;AAYM,MAAAA,IAAuCC,EAAK,SAAsB;AAAA,EACtE,aAAAC;AAAA,EACA,UAAAC;AAAA,EACA,OAAAC;AAAA,EACA,aAAAC;AAAA,EACA,aAAAC;AAAA,EACA,UAAAC;AAAA,EACA,QAAAC;AAAA,EACA,aAAAC,IAAc;AAAA,EACd,cAAAC,IAAe;AACjB,GAAG;AACK,QAAAC,IAAeC,EAAQ,MACvBH,IACK,IAGLI,IACK,MAGF,OACN,CAACJ,CAAW,CAAC;AAOd,SAAA,gBAAAK;AAAA,IAACC;AAAAA,IAAA;AAAA,MACC,aAAY;AAAA,MACZ,UAAUJ;AAAA,MACV,OAAO;AAAA,MACP,UAAU;AAAA,MACV,iBAVmBF,IAAc,WAAW;AAAA,MAW5C,WAAU;AAAA,MAET,UAAA;AAAA,QAAaF,MAAA,aACX,gBAAAS,EAAAC,GAAA,EAA2B,SAAQ,QAClC,UAAA,gBAAAD,EAACE,GAAA,EACC,UAAA,gBAAAF;AAAA,UAACG;AAAA,UAAA;AAAA,YACC,MAAMC;AAAA,YACN,UAAS;AAAA,YACT,gBAAe;AAAA,YACf,MAAK;AAAA,YACL,SAASZ;AAAA,UAAA;AAAA,WAEb,EACF,CAAA;AAAA,QAEDE,KACE,gBAAAI,EAAAO,GAAA,EAAK,WAAU,YAAW,QAAO,WAAU,UAAA;AAAA,UAAA;AAAA,UAC9Bf,KAAe;AAAA,UAAG;AAAA,QAAA,GAChC;AAAA,QAEF,gBAAAU,EAACM,GAAU,EAAA,SAAS,IAAK,CAAA;AAAA,QACzB,gBAAAN;AAAA,UAACO;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