@cuemath/leap 3.5.64 → 3.5.66-link0
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/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/milestone/create/api/milestone-config.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/sheets/constants/sheet.js +1 -0
- package/dist/features/sheets/constants/sheet.js.map +1 -1
- package/dist/features/timeline/daily-timeline/daily-timeline.js +40 -40
- package/dist/features/timeline/daily-timeline/daily-timeline.js.map +1 -1
- package/dist/features/timeline/monthly-timeline/monthly-report/monthly-report-types.js +1 -1
- package/dist/features/timeline/monthly-timeline/monthly-report/monthly-report-types.js.map +1 -1
- package/dist/features/timeline/monthly-timeline/monthly-timeline-styled.js +8 -5
- package/dist/features/timeline/monthly-timeline/monthly-timeline-styled.js.map +1 -1
- package/dist/features/timeline/monthly-timeline/monthly-timeline.js +35 -35
- package/dist/features/timeline/monthly-timeline/monthly-timeline.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 -27
- 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 +61 -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 +113 -78
- 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-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 +84 -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 +2 -0
- package/dist/features/trial-session/context/trial-session-context.js.map +1 -1
- package/dist/features/trial-session/helper.js +70 -64
- package/dist/features/trial-session/helper.js.map +1 -1
- package/dist/features/trial-session/hooks/use-trial-session-navigation.js +190 -158
- 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 +22 -18
- 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 +82 -77
- package/dist/features/trial-session/trial-session-view.js.map +1 -1
- package/dist/features/trial-session/trial-session.js +38 -38
- 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-behavior-helper.js +51 -32
- package/dist/features/worksheet/worksheet/worksheet-behavior-helper.js.map +1 -1
- package/dist/features/worksheet/worksheet/worksheet-helpers.js +38 -37
- package/dist/features/worksheet/worksheet/worksheet-helpers.js.map +1 -1
- package/dist/features/worksheet/worksheet/worksheet-store/helpers/get-computed-properties.js +36 -35
- package/dist/features/worksheet/worksheet/worksheet-store/helpers/get-computed-properties.js.map +1 -1
- package/dist/features/worksheet/worksheet/worksheet-store/helpers/get-questions-from-items.js +61 -58
- package/dist/features/worksheet/worksheet/worksheet-store/helpers/get-questions-from-items.js.map +1 -1
- package/dist/features/worksheet/worksheet/worksheet-types.js.map +1 -1
- package/dist/features/worksheet/worksheet-preview/hooks/use-worksheet-layout.js +32 -30
- package/dist/features/worksheet/worksheet-preview/hooks/use-worksheet-layout.js.map +1 -1
- package/dist/index.d.ts +12 -6
- package/dist/index.js +148 -150
- package/dist/index.js.map +1 -1
- package/dist/node_modules/uuid/dist/esm-browser/regex.js +5 -0
- package/dist/node_modules/uuid/dist/esm-browser/regex.js.map +1 -0
- package/dist/node_modules/uuid/dist/esm-browser/rng.js +2 -3
- package/dist/node_modules/uuid/dist/esm-browser/rng.js.map +1 -1
- package/dist/node_modules/uuid/dist/esm-browser/stringify.js +10 -6
- package/dist/node_modules/uuid/dist/esm-browser/stringify.js.map +1 -1
- package/dist/node_modules/uuid/dist/esm-browser/v4.js +9 -12
- package/dist/node_modules/uuid/dist/esm-browser/v4.js.map +1 -1
- package/dist/node_modules/uuid/dist/esm-browser/validate.js +8 -0
- package/dist/node_modules/uuid/dist/esm-browser/validate.js.map +1 -0
- package/dist/types/models/worksheet.js +1 -1
- package/dist/types/models/worksheet.js.map +1 -1
- package/package.json +1 -1
- package/dist/features/sheets/utils/is-v3-worksheet.js +0 -55
- package/dist/features/sheets/utils/is-v3-worksheet.js.map +0 -1
- package/dist/node_modules/uuid/dist/esm-browser/native.js +0 -7
- package/dist/node_modules/uuid/dist/esm-browser/native.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"student-profile.js","sources":["../../../../../src/features/trial-session/comps/student-profile/student-profile.tsx"],"sourcesContent":["import { memo, useCallback, useEffect, useMemo } from 'react';\n\nimport { ILLUSTRATIONS } from '../../../../assets/illustrations/illustrations';\nimport { GOAL_CATEGORY } from '../../../milestone/constants';\nimport type { TGoalCategory } from '../../../milestone/create/milestone-create-types';\nimport Error from '../../../ui/error/error';\nimport Image from '../../../ui/image/image';\nimport FlexView from '../../../ui/layout/flex-view';\nimport AppLoader from '../../../ui/loader/app-loader/app-loader';\nimport Separator from '../../../ui/separator/separator';\nimport Text from '../../../ui/text/text';\nimport type { TColorNames } from '../../../ui/types';\nimport {\n useGetStudentProfileSummary,\n type IGetStudentProfileSummaryQuery,\n} from '../../api/student-profile-summary';\nimport { useTrialSessionContext } from '../../context/use-trial-session-context';\nimport { getFormattedStudentPersonalizedPreference } from '../../helper';\nimport SlideHeader from '../slide-header';\nimport { GOAL_MAPPING } from './constant';\nimport StudentProfileHighlights from './student-profile-highlights/student-profile-highlights';\nimport * as Styled from './student-profile-styled';\nimport { getDummyProfileImage, getMilestoneGoalName } from './student-profile-utils';\n\ntype TProfileHighlight = {\n illustration: string;\n background: TColorNames;\n title: string;\n description: string | string[];\n};\n\nconst StudentProfile = memo(function StudentProfile() {\n const {\n isTeacher,\n studentId,\n formData,\n slideConfig,\n milestoneConfig,\n updateSlideConfig,\n updateButtonState,\n } = useTrialSessionContext();\n const { showProfileHighlights } = slideConfig;\n\n const {\n name,\n goals = [],\n studentProfile,\n personalizedObjectives = [],\n personalizedPosition = [],\n } = formData || {};\n const { dummyProfileImageIndex, profileSummary } = studentProfile || {};\n const dummyProfileImage = getDummyProfileImage(dummyProfileImageIndex);\n\n const payload = useMemo<IGetStudentProfileSummaryQuery | null>(() => {\n if (goals && goals.length > 0) {\n return {\n school_success_goal: getMilestoneGoalName(goals, GOAL_CATEGORY.SCHOOL_SUCCESS),\n test_prep_goal: getMilestoneGoalName(goals, GOAL_CATEGORY.TEST_PREP),\n };\n }\n\n return null;\n }, [goals]);\n\n const {\n get: getStudentProfileSummary,\n data,\n isProcessing,\n isProcessed,\n isProcessingFailed,\n } = useGetStudentProfileSummary();\n const { profile_summary: studentProfileSummary } = data || {};\n\n const fetchData = useCallback(() => {\n if (payload) {\n getStudentProfileSummary(studentId, payload);\n }\n }, [getStudentProfileSummary, payload, studentId]);\n\n useEffect(() => {\n updateButtonState('right', { isDisabled: isProcessing, isLoading: false });\n }, [isProcessing, updateButtonState]);\n\n useEffect(() => {\n if (isTeacher && !studentProfile && !showProfileHighlights) {\n fetchData();\n }\n }, [fetchData, isTeacher, studentProfile, showProfileHighlights]);\n\n useEffect(() => {\n if (isTeacher && isProcessed && !showProfileHighlights) {\n updateSlideConfig({\n studentProfile: {\n profileSummary: studentProfileSummary || '',\n dummyProfileImageIndex: Math.floor(Math.random() * 6),\n },\n });\n }\n }, [isProcessed, isTeacher, showProfileHighlights, studentProfileSummary, updateSlideConfig]);\n\n const profileHighlights: TProfileHighlight[] = useMemo(\n () => [\n {\n title: 'Student Level',\n description: `Catching up: ${getFormattedStudentPersonalizedPreference(\n milestoneConfig,\n personalizedPosition,\n ).map(objectives => objectives.preference_description)}`,\n illustration: ILLUSTRATIONS.KNOWLEDGE_BLUE,\n background: 'BLUE_1',\n },\n {\n illustration: ILLUSTRATIONS.ARROW_BOARD_GREEN,\n background: 'GREEN_1',\n title: 'Goals',\n description: getFormattedStudentPersonalizedPreference(\n milestoneConfig,\n personalizedObjectives,\n ).map(objectives => objectives.preference_name),\n },\n {\n illustration: ILLUSTRATIONS.BOOK_CHECKED_PURPLE,\n background: 'PURPLE_1',\n title: 'Learning Plan',\n description: goals.map(\n goal => `${GOAL_MAPPING[goal.goal_category as TGoalCategory]}: ${goal.milestone_name}`,\n ),\n },\n ],\n [goals, milestoneConfig, personalizedObjectives, personalizedPosition],\n );\n\n if (isProcessingFailed) {\n return <Error height=\"70vh\" onTryAgain={fetchData} />;\n }\n\n if (isProcessing || (!studentProfile && !showProfileHighlights)) {\n return <AppLoader height=\"100vh\" />;\n }\n\n return (\n <Styled.Container>\n <Separator height={60} />\n <SlideHeader marginBottom={showProfileHighlights ? 50 : 100} />\n {showProfileHighlights ? (\n <Styled.ContentWrapper $width={650}>\n <StudentProfileHighlights profileHighlights={profileHighlights} />\n <Separator height={16} />\n <Text $renderAs=\"ub3\" $color=\"BLACK_T_60\" $align=\"center\">\n We can always revisit this later\n </Text>\n </Styled.ContentWrapper>\n ) : (\n <Styled.ContentWrapper $widthX={46.875}>\n <Styled.AbsoluteImage />\n <FlexView\n $width=\"100%\"\n $heightX={21.875}\n $flexDirection=\"row\"\n $alignItems=\"center\"\n $flexGapX={1.5}\n $gutterX={1.5}\n $background=\"WHITE_2\"\n $borderColor=\"BLACK_T_87\"\n $borderRadiusX={0.5}\n >\n <Styled.ImageWrapper>\n <Image withLoader height={200} width={200} src={dummyProfileImage} />\n </Styled.ImageWrapper>\n <FlexView $flexGap={16}>\n <Text $renderAs=\"ac2-black\">{name}</Text>\n <Text $renderAs=\"ab1\">{profileSummary || ''}</Text>\n </FlexView>\n </FlexView>\n </Styled.ContentWrapper>\n )}\n </Styled.Container>\n );\n});\n\nexport default StudentProfile;\n"],"names":["StudentProfile","memo","isTeacher","studentId","formData","slideConfig","milestoneConfig","updateSlideConfig","updateButtonState","useTrialSessionContext","showProfileHighlights","name","goals","studentProfile","personalizedObjectives","personalizedPosition","dummyProfileImageIndex","profileSummary","dummyProfileImage","getDummyProfileImage","payload","useMemo","getMilestoneGoalName","GOAL_CATEGORY","getStudentProfileSummary","data","isProcessing","isProcessed","isProcessingFailed","useGetStudentProfileSummary","studentProfileSummary","fetchData","useCallback","useEffect","profileHighlights","getFormattedStudentPersonalizedPreference","objectives","ILLUSTRATIONS","goal","GOAL_MAPPING","jsx","Error","AppLoader","jsxs","Styled.Container","Separator","SlideHeader","Styled.ContentWrapper","StudentProfileHighlights","Text","Styled.AbsoluteImage","FlexView","Styled.ImageWrapper","Image"],"mappings":";;;;;;;;;;;;;;;;;;AA+BM,MAAAA,KAAiBC,EAAK,WAA0B;AAC9C,QAAA;AAAA,IACJ,WAAAC;AAAA,IACA,WAAAC;AAAA,IACA,UAAAC;AAAA,IACA,aAAAC;AAAA,IACA,iBAAAC;AAAA,IACA,mBAAAC;AAAA,IACA,mBAAAC;AAAA,MACEC,EAAuB,GACrB,EAAE,uBAAAC,EAA0B,IAAAL,GAE5B;AAAA,IACJ,MAAAM;AAAA,IACA,OAAAC,IAAQ,CAAC;AAAA,IACT,gBAAAC;AAAA,IACA,wBAAAC,IAAyB,CAAC;AAAA,IAC1B,sBAAAC,IAAuB,CAAC;AAAA,EAAA,IACtBX,KAAY,CAAA,GACV,EAAE,wBAAAY,GAAwB,gBAAAC,MAAmBJ,KAAkB,CAAA,GAC/DK,IAAoBC,EAAqBH,CAAsB,GAE/DI,IAAUC,EAA+C,MACzDT,KAASA,EAAM,SAAS,IACnB;AAAA,IACL,qBAAqBU,EAAqBV,GAAOW,EAAc,cAAc;AAAA,IAC7E,gBAAgBD,EAAqBV,GAAOW,EAAc,SAAS;AAAA,EAAA,IAIhE,MACN,CAACX,CAAK,CAAC,GAEJ;AAAA,IACJ,KAAKY;AAAA,IACL,MAAAC;AAAA,IACA,cAAAC;AAAA,IACA,aAAAC;AAAA,IACA,oBAAAC;AAAA,MACEC,EAA4B,GAC1B,EAAE,iBAAiBC,MAA0BL,KAAQ,CAAA,GAErDM,IAAYC,EAAY,MAAM;AAClC,IAAIZ,KACFI,EAAyBrB,GAAWiB,CAAO;AAAA,EAE5C,GAAA,CAACI,GAA0BJ,GAASjB,CAAS,CAAC;AAEjD,EAAA8B,EAAU,MAAM;AACd,IAAA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AA,UAAA;AAAA,QAAA;AAAA,MACF;AAAA,IAAA,GACF;AAAA,EAEJ,EAAA,CAAA;AAEJ,CAAC;"}
|
|
1
|
+
{"version":3,"file":"student-profile.js","sources":["../../../../../src/features/trial-session/comps/student-profile/student-profile.tsx"],"sourcesContent":["import { memo, useCallback, useEffect, useMemo } from 'react';\n\nimport { ILLUSTRATIONS } from '../../../../assets/illustrations/illustrations';\nimport { GOAL_CATEGORY } from '../../../milestone/constants';\nimport type { TGoalCategory } from '../../../milestone/create/milestone-create-types';\nimport Error from '../../../ui/error/error';\nimport Image from '../../../ui/image/image';\nimport FlexView from '../../../ui/layout/flex-view';\nimport AppLoader from '../../../ui/loader/app-loader/app-loader';\nimport Separator from '../../../ui/separator/separator';\nimport Text from '../../../ui/text/text';\nimport type { TColorNames } from '../../../ui/types';\nimport {\n useGetStudentProfileSummary,\n type IGetStudentProfileSummaryQuery,\n} from '../../api/student-profile-summary';\nimport { useTrialSessionContext } from '../../context/use-trial-session-context';\nimport { getFormattedStudentPersonalizedPreference } from '../../helper';\nimport SlideHeader from '../slide-header';\nimport { GOAL_MAPPING } from './constant';\nimport StudentProfileHighlights from './student-profile-highlights/student-profile-highlights';\nimport * as Styled from './student-profile-styled';\nimport { getDummyProfileImage, getMilestoneGoalName } from './student-profile-utils';\nimport { RIGHT_PANEL_CONTENT_WIDTH } from '../../trial-session-constants';\n\ntype TProfileHighlight = {\n illustration: string;\n background: TColorNames;\n title: string;\n description: string | string[];\n};\n\nconst StudentProfile = memo(function StudentProfile() {\n const {\n isTeacher,\n studentId,\n formData,\n slideConfig,\n milestoneConfig,\n updateSlideConfig,\n updateButtonState,\n } = useTrialSessionContext();\n const { showProfileHighlights } = slideConfig;\n\n const {\n name,\n goals = [],\n studentProfile,\n personalizedObjectives = [],\n personalizedPosition = [],\n } = formData || {};\n const { dummyProfileImageIndex, profileSummary } = studentProfile || {};\n const dummyProfileImage = getDummyProfileImage(dummyProfileImageIndex);\n\n const payload = useMemo<IGetStudentProfileSummaryQuery | null>(() => {\n if (goals && goals.length > 0) {\n return {\n school_success_goal: getMilestoneGoalName(goals, GOAL_CATEGORY.SCHOOL_SUCCESS),\n test_prep_goal: getMilestoneGoalName(goals, GOAL_CATEGORY.TEST_PREP),\n };\n }\n\n return null;\n }, [goals]);\n\n const {\n get: getStudentProfileSummary,\n data,\n isProcessing,\n isProcessed,\n isProcessingFailed,\n } = useGetStudentProfileSummary();\n const { profile_summary: studentProfileSummary } = data || {};\n\n const fetchData = useCallback(() => {\n if (payload) {\n getStudentProfileSummary(studentId, payload);\n }\n }, [getStudentProfileSummary, payload, studentId]);\n\n useEffect(() => {\n updateButtonState('right', { isDisabled: isProcessing, isLoading: false });\n }, [isProcessing, updateButtonState]);\n\n useEffect(() => {\n if (isTeacher && !studentProfile && !showProfileHighlights) {\n fetchData();\n }\n }, [fetchData, isTeacher, studentProfile, showProfileHighlights]);\n\n useEffect(() => {\n if (isTeacher && isProcessed && !showProfileHighlights) {\n updateSlideConfig({\n studentProfile: {\n profileSummary: studentProfileSummary || '',\n dummyProfileImageIndex: Math.floor(Math.random() * 6),\n },\n });\n }\n }, [isProcessed, isTeacher, showProfileHighlights, studentProfileSummary, updateSlideConfig]);\n\n const profileHighlights: TProfileHighlight[] = useMemo(\n () => [\n {\n title: 'Student Level',\n description: `Catching up: ${getFormattedStudentPersonalizedPreference(\n milestoneConfig,\n personalizedPosition,\n ).map(objectives => objectives.preference_description)}`,\n illustration: ILLUSTRATIONS.KNOWLEDGE_BLUE,\n background: 'BLUE_1',\n },\n {\n illustration: ILLUSTRATIONS.ARROW_BOARD_GREEN,\n background: 'GREEN_1',\n title: 'Goals',\n description: getFormattedStudentPersonalizedPreference(\n milestoneConfig,\n personalizedObjectives,\n ).map(objectives => objectives.preference_name),\n },\n {\n illustration: ILLUSTRATIONS.BOOK_CHECKED_PURPLE,\n background: 'PURPLE_1',\n title: 'Learning Plan',\n description: goals.map(\n goal => `${GOAL_MAPPING[goal.goal_category as TGoalCategory]}: ${goal.milestone_name}`,\n ),\n },\n ],\n [goals, milestoneConfig, personalizedObjectives, personalizedPosition],\n );\n\n if (isProcessingFailed) {\n return <Error height=\"70vh\" onTryAgain={fetchData} />;\n }\n\n if (isProcessing || (!studentProfile && !showProfileHighlights)) {\n return <AppLoader height=\"100vh\" />;\n }\n\n return (\n <Styled.Container>\n <Separator height={60} />\n <SlideHeader marginBottom={showProfileHighlights ? 50 : 100} />\n {showProfileHighlights ? (\n <Styled.ContentWrapper $width={RIGHT_PANEL_CONTENT_WIDTH - 100}>\n <StudentProfileHighlights profileHighlights={profileHighlights} />\n <Separator height={16} />\n <Text $renderAs=\"ub3\" $color=\"BLACK_T_60\" $align=\"center\">\n We can always revisit this later\n </Text>\n </Styled.ContentWrapper>\n ) : (\n <Styled.ContentWrapper $width={RIGHT_PANEL_CONTENT_WIDTH}>\n <Styled.AbsoluteImage />\n <FlexView\n $width=\"100%\"\n $heightX={21.875}\n $flexDirection=\"row\"\n $alignItems=\"center\"\n $flexGapX={1.5}\n $gutterX={1.5}\n $background=\"WHITE_2\"\n $borderColor=\"BLACK_T_87\"\n $borderRadiusX={0.5}\n >\n <Styled.ImageWrapper>\n <Image withLoader height={200} width={200} src={dummyProfileImage} />\n </Styled.ImageWrapper>\n <FlexView $flexGap={16}>\n <Text $renderAs=\"ac2-black\">{name}</Text>\n <Text $renderAs=\"ab1\">{profileSummary || ''}</Text>\n </FlexView>\n </FlexView>\n </Styled.ContentWrapper>\n )}\n </Styled.Container>\n );\n});\n\nexport default StudentProfile;\n"],"names":["StudentProfile","memo","isTeacher","studentId","formData","slideConfig","milestoneConfig","updateSlideConfig","updateButtonState","useTrialSessionContext","showProfileHighlights","name","goals","studentProfile","personalizedObjectives","personalizedPosition","dummyProfileImageIndex","profileSummary","dummyProfileImage","getDummyProfileImage","payload","useMemo","getMilestoneGoalName","GOAL_CATEGORY","getStudentProfileSummary","data","isProcessing","isProcessed","isProcessingFailed","useGetStudentProfileSummary","studentProfileSummary","fetchData","useCallback","useEffect","profileHighlights","getFormattedStudentPersonalizedPreference","objectives","ILLUSTRATIONS","goal","GOAL_MAPPING","jsx","Error","AppLoader","jsxs","Styled.Container","Separator","SlideHeader","Styled.ContentWrapper","RIGHT_PANEL_CONTENT_WIDTH","StudentProfileHighlights","Text","Styled.AbsoluteImage","FlexView","Styled.ImageWrapper","Image"],"mappings":";;;;;;;;;;;;;;;;;;;AAgCM,MAAAA,KAAiBC,EAAK,WAA0B;AAC9C,QAAA;AAAA,IACJ,WAAAC;AAAA,IACA,WAAAC;AAAA,IACA,UAAAC;AAAA,IACA,aAAAC;AAAA,IACA,iBAAAC;AAAA,IACA,mBAAAC;AAAA,IACA,mBAAAC;AAAA,MACEC,EAAuB,GACrB,EAAE,uBAAAC,EAA0B,IAAAL,GAE5B;AAAA,IACJ,MAAAM;AAAA,IACA,OAAAC,IAAQ,CAAC;AAAA,IACT,gBAAAC;AAAA,IACA,wBAAAC,IAAyB,CAAC;AAAA,IAC1B,sBAAAC,IAAuB,CAAC;AAAA,EAAA,IACtBX,KAAY,CAAA,GACV,EAAE,wBAAAY,GAAwB,gBAAAC,MAAmBJ,KAAkB,CAAA,GAC/DK,IAAoBC,EAAqBH,CAAsB,GAE/DI,IAAUC,EAA+C,MACzDT,KAASA,EAAM,SAAS,IACnB;AAAA,IACL,qBAAqBU,EAAqBV,GAAOW,EAAc,cAAc;AAAA,IAC7E,gBAAgBD,EAAqBV,GAAOW,EAAc,SAAS;AAAA,EAAA,IAIhE,MACN,CAACX,CAAK,CAAC,GAEJ;AAAA,IACJ,KAAKY;AAAA,IACL,MAAAC;AAAA,IACA,cAAAC;AAAA,IACA,aAAAC;AAAA,IACA,oBAAAC;AAAA,MACEC,EAA4B,GAC1B,EAAE,iBAAiBC,MAA0BL,KAAQ,CAAA,GAErDM,IAAYC,EAAY,MAAM;AAClC,IAAIZ,KACFI,EAAyBrB,GAAWiB,CAAO;AAAA,EAE5C,GAAA,CAACI,GAA0BJ,GAASjB,CAAS,CAA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AU,OAAO,eAAkB,IAAG;AAAA,YAAA,GAC9C;AAAA,UAAA;AAAA,QAAA;AAAA,MACF;AAAA,IAAA,GACF;AAAA,EAEJ,EAAA,CAAA;AAEJ,CAAC;"}
|
|
@@ -1,20 +1,21 @@
|
|
|
1
1
|
import { jsx as r, jsxs as i } from "react/jsx-runtime";
|
|
2
|
-
import { memo as
|
|
3
|
-
import
|
|
2
|
+
import { memo as m } from "react";
|
|
3
|
+
import n from "../../../ui/separator/separator.js";
|
|
4
4
|
import { useTrialSessionContext as f } from "../../context/use-trial-session-context.js";
|
|
5
5
|
import a from "../communication-slide/index.js";
|
|
6
6
|
import p from "../slide-header/index.js";
|
|
7
7
|
import { Container as c, ContentWrapper as h } from "./teacher-intro-styled.js";
|
|
8
8
|
import s from "./teacher-profile/teacher-profile.js";
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
9
|
+
import { RIGHT_PANEL_CONTENT_WIDTH as l } from "../../trial-session-constants.js";
|
|
10
|
+
const N = m(function() {
|
|
11
|
+
const { slideConfig: o } = f(), { renderAVIn: e, teacher_profile: t } = o || {};
|
|
12
|
+
return e === "right" ? /* @__PURE__ */ r(a, {}) : /* @__PURE__ */ i(c, { children: [
|
|
13
|
+
/* @__PURE__ */ r(n, { height: 60 }),
|
|
13
14
|
/* @__PURE__ */ r(p, {}),
|
|
14
|
-
/* @__PURE__ */ r(h, { $width:
|
|
15
|
+
/* @__PURE__ */ r(h, { $width: l, children: /* @__PURE__ */ r(s, { teacherProfile: t }) })
|
|
15
16
|
] });
|
|
16
17
|
});
|
|
17
18
|
export {
|
|
18
|
-
|
|
19
|
+
N as default
|
|
19
20
|
};
|
|
20
21
|
//# sourceMappingURL=teacher-intro.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"teacher-intro.js","sources":["../../../../../src/features/trial-session/comps/teacher-intro/teacher-intro.tsx"],"sourcesContent":["import { memo } from 'react';\n\nimport Separator from '../../../ui/separator/separator';\nimport { useTrialSessionContext } from '../../context/use-trial-session-context';\nimport CommunicationSlide from '../communication-slide';\nimport SlideHeader from '../slide-header';\nimport * as Styled from './teacher-intro-styled';\nimport TeacherProfile from './teacher-profile/teacher-profile';\n\nconst TeacherIntro = memo(function TeacherIntro() {\n const { slideConfig } = useTrialSessionContext();\n const { renderAVIn, teacher_profile: teacherProfile } = slideConfig || {};\n\n if (renderAVIn === 'right') return <CommunicationSlide />;\n\n return (\n <Styled.Container>\n <Separator height={60} />\n <SlideHeader />\n <Styled.ContentWrapper $width={
|
|
1
|
+
{"version":3,"file":"teacher-intro.js","sources":["../../../../../src/features/trial-session/comps/teacher-intro/teacher-intro.tsx"],"sourcesContent":["import { memo } from 'react';\n\nimport Separator from '../../../ui/separator/separator';\nimport { useTrialSessionContext } from '../../context/use-trial-session-context';\nimport CommunicationSlide from '../communication-slide';\nimport SlideHeader from '../slide-header';\nimport * as Styled from './teacher-intro-styled';\nimport TeacherProfile from './teacher-profile/teacher-profile';\nimport { RIGHT_PANEL_CONTENT_WIDTH } from '../../trial-session-constants';\n\nconst TeacherIntro = memo(function TeacherIntro() {\n const { slideConfig } = useTrialSessionContext();\n const { renderAVIn, teacher_profile: teacherProfile } = slideConfig || {};\n\n if (renderAVIn === 'right') return <CommunicationSlide />;\n\n return (\n <Styled.Container>\n <Separator height={60} />\n <SlideHeader />\n <Styled.ContentWrapper $width={RIGHT_PANEL_CONTENT_WIDTH}>\n <TeacherProfile teacherProfile={teacherProfile} />\n </Styled.ContentWrapper>\n </Styled.Container>\n );\n});\n\nexport default TeacherIntro;\n"],"names":["TeacherIntro","memo","slideConfig","useTrialSessionContext","renderAVIn","teacherProfile","jsx","CommunicationSlide","jsxs","Styled.Container","Separator","SlideHeader","Styled.ContentWrapper","RIGHT_PANEL_CONTENT_WIDTH","TeacherProfile"],"mappings":";;;;;;;;;AAUM,MAAAA,IAAeC,EAAK,WAAwB;AAC1C,QAAA,EAAE,aAAAC,MAAgBC,KAClB,EAAE,YAAAC,GAAY,iBAAiBC,EAAe,IAAIH,KAAe,CAAA;AAEvE,SAAIE,MAAe,UAAgB,gBAAAE,EAACC,GAAmB,CAAA,CAAA,IAGrD,gBAAAC,EAACC,GAAA,EACC,UAAA;AAAA,IAAC,gBAAAH,EAAAI,GAAA,EAAU,QAAQ,GAAI,CAAA;AAAA,sBACtBC,GAAY,EAAA;AAAA,IACb,gBAAAL,EAACM,GAAA,EAAsB,QAAQC,GAC7B,UAAA,gBAAAP,EAACQ,GAAe,EAAA,gBAAAT,EAAgC,CAAA,GAClD;AAAA,EACF,EAAA,CAAA;AAEJ,CAAC;"}
|
|
@@ -1,34 +1,26 @@
|
|
|
1
|
-
import
|
|
1
|
+
import t from "styled-components";
|
|
2
2
|
import r from "../../../ui/layout/flex-view.js";
|
|
3
|
-
const
|
|
4
|
-
|
|
5
|
-
height: 100%;
|
|
6
|
-
`, p = o(r)`
|
|
7
|
-
width: 750px;
|
|
8
|
-
margin: auto;
|
|
9
|
-
`, a = o.div(
|
|
10
|
-
({ theme: t }) => `
|
|
3
|
+
const l = t.div(
|
|
4
|
+
({ theme: o }) => `
|
|
11
5
|
position: relative;
|
|
12
|
-
width: ${
|
|
13
|
-
height: ${
|
|
14
|
-
border: 1px solid ${
|
|
6
|
+
width: ${o.layout.gutter * 18.75}px;
|
|
7
|
+
height: ${o.layout.gutter * 25}px;
|
|
8
|
+
border: 1px solid ${o.colors.BLACK_1};
|
|
15
9
|
overflow: hidden;
|
|
16
10
|
.image {
|
|
17
11
|
position: absolute;
|
|
18
|
-
top: -${
|
|
19
|
-
left: -${
|
|
12
|
+
top: -${o.layout.gutter * 0.15625}px;
|
|
13
|
+
left: -${o.layout.gutter * 0.125}px;
|
|
20
14
|
right: 0;
|
|
21
15
|
bottom: 0;
|
|
22
16
|
}
|
|
23
17
|
`
|
|
24
|
-
),
|
|
18
|
+
), p = t(r)`
|
|
25
19
|
flex-grow: 1;
|
|
26
20
|
border-left: none;
|
|
27
21
|
`;
|
|
28
22
|
export {
|
|
29
|
-
|
|
30
|
-
p as
|
|
31
|
-
a as ImageWrapper,
|
|
32
|
-
l as InputContainer
|
|
23
|
+
l as ImageWrapper,
|
|
24
|
+
p as InputContainer
|
|
33
25
|
};
|
|
34
26
|
//# sourceMappingURL=test-prep-styled.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"test-prep-styled.js","sources":["../../../../../src/features/trial-session/comps/test-prep/test-prep-styled.tsx"],"sourcesContent":["import styled from 'styled-components';\n\nimport FlexView from '../../../ui/layout/flex-view';\n\nconst
|
|
1
|
+
{"version":3,"file":"test-prep-styled.js","sources":["../../../../../src/features/trial-session/comps/test-prep/test-prep-styled.tsx"],"sourcesContent":["import styled from 'styled-components';\n\nimport FlexView from '../../../ui/layout/flex-view';\n\nconst ImageWrapper = styled.div(\n ({ theme }) => `\n position: relative;\n width: ${theme.layout.gutter * 18.75}px;\n height: ${theme.layout.gutter * 25}px;\n border: 1px solid ${theme.colors.BLACK_1};\n overflow: hidden;\n .image {\n position: absolute;\n top: -${theme.layout.gutter * 0.15625}px;\n left: -${theme.layout.gutter * 0.125}px;\n right: 0;\n bottom: 0;\n }\n`,\n);\n\nconst InputContainer = styled(FlexView)`\n flex-grow: 1;\n border-left: none;\n`;\n\nexport { ImageWrapper, InputContainer };\n"],"names":["ImageWrapper","styled","theme","InputContainer","FlexView"],"mappings":";;AAIA,MAAMA,IAAeC,EAAO;AAAA,EAC1B,CAAC,EAAE,OAAAC,EAAA,MAAY;AAAA;AAAA,WAENA,EAAM,OAAO,SAAS,KAAK;AAAA,YAC1BA,EAAM,OAAO,SAAS,EAAE;AAAA,sBACdA,EAAM,OAAO,OAAO;AAAA;AAAA;AAAA;AAAA,YAI9BA,EAAM,OAAO,SAAS,OAAO;AAAA,aAC5BA,EAAM,OAAO,SAAS,KAAK;AAAA;AAAA;AAAA;AAAA;AAKxC,GAEMC,IAAiBF,EAAOG,CAAQ;AAAA;AAAA;AAAA;"}
|
|
@@ -1,46 +1,48 @@
|
|
|
1
1
|
import { jsxs as d, jsx as e } from "react/jsx-runtime";
|
|
2
|
-
import { memo as
|
|
2
|
+
import { memo as G, useMemo as I, useCallback as A } from "react";
|
|
3
3
|
import { GIF as L } from "../../../../assets/gif/gif.js";
|
|
4
4
|
import { GOAL_CATEGORY as n } from "../../../milestone/constants.js";
|
|
5
5
|
import { getGoalsFromConfig as x } from "../../../milestone/create/milestone-create-helpers.js";
|
|
6
|
-
import
|
|
7
|
-
import
|
|
6
|
+
import D from "../../../ui/image/image.js";
|
|
7
|
+
import R from "../../../ui/inputs/searchable-select-input/searchable-select-input.js";
|
|
8
8
|
import f from "../../../ui/separator/separator.js";
|
|
9
|
-
import
|
|
10
|
-
import { epochTimestampAfterOneYear as
|
|
9
|
+
import j from "../../../ui/text/text.js";
|
|
10
|
+
import { epochTimestampAfterOneYear as w } from "../../../utils/utils.js";
|
|
11
11
|
import { useTrialSessionContext as k } from "../../context/use-trial-session-context.js";
|
|
12
|
-
import { isPLASource as
|
|
13
|
-
import
|
|
14
|
-
import {
|
|
15
|
-
|
|
16
|
-
|
|
12
|
+
import { isPLASource as F, updateGoalInFormData as H } from "../../helper.js";
|
|
13
|
+
import N from "../slide-header/index.js";
|
|
14
|
+
import { ImageWrapper as O, InputContainer as X } from "./test-prep-styled.js";
|
|
15
|
+
import { RIGHT_PANEL_CONTENT_WIDTH as B } from "../../trial-session-constants.js";
|
|
16
|
+
import g from "../../../ui/layout/flex-view.js";
|
|
17
|
+
const ae = G(function() {
|
|
18
|
+
const { milestoneConfig: a, formData: u, updateSlideConfig: i, trialHomeData: h } = k(), { demo_info: T, intel_student: t, student: _ } = h, { enrollment_type: s } = _ || {}, { stream: m, region_data: C } = T || {}, { opportunity_country: l = "US" } = C || {}, { grade: c, goals: o } = u || {}, p = F(t == null ? void 0 : t.source), P = I(
|
|
17
19
|
() => x(a, {
|
|
18
20
|
countryCode: l,
|
|
19
|
-
grade:
|
|
21
|
+
grade: c ?? "",
|
|
20
22
|
goalCategory: n.TEST_PREP,
|
|
21
23
|
courseStream: m,
|
|
22
24
|
enrollmentType: s
|
|
23
25
|
}),
|
|
24
|
-
[l, s,
|
|
25
|
-
), { goal_code: S } = (o == null ? void 0 : o.find((r) => r.goal_category === n.TEST_PREP)) ?? {},
|
|
26
|
-
(r,
|
|
27
|
-
const { label: y } =
|
|
26
|
+
[l, s, c, a, m]
|
|
27
|
+
), { goal_code: S } = (o == null ? void 0 : o.find((r) => r.goal_category === n.TEST_PREP)) ?? {}, $ = A(
|
|
28
|
+
(r, E) => {
|
|
29
|
+
const { label: y } = E, b = H(o, n.TEST_PREP, {
|
|
28
30
|
goal_code: r,
|
|
29
31
|
milestone_name: y,
|
|
30
|
-
milestone_date_ts:
|
|
31
|
-
publish:
|
|
32
|
+
milestone_date_ts: w(),
|
|
33
|
+
publish: p
|
|
32
34
|
});
|
|
33
|
-
i({ goals:
|
|
35
|
+
i({ goals: b });
|
|
34
36
|
},
|
|
35
|
-
[o,
|
|
37
|
+
[o, p, i]
|
|
36
38
|
);
|
|
37
|
-
return /* @__PURE__ */ d(
|
|
39
|
+
return /* @__PURE__ */ d(g, { $justifyContent: "center", $alignItems: "center", children: [
|
|
38
40
|
/* @__PURE__ */ e(f, { height: 60 }),
|
|
39
|
-
/* @__PURE__ */ e(
|
|
40
|
-
/* @__PURE__ */ d(
|
|
41
|
-
/* @__PURE__ */ e(
|
|
41
|
+
/* @__PURE__ */ e(N, {}),
|
|
42
|
+
/* @__PURE__ */ d(g, { $width: B, $flexDirection: "row", $justifyContent: "center", children: [
|
|
43
|
+
/* @__PURE__ */ e(O, { children: /* @__PURE__ */ e(D, { withLoader: !0, height: 402, width: 302, src: L.TEST_PREP, className: "image" }) }),
|
|
42
44
|
/* @__PURE__ */ e(
|
|
43
|
-
|
|
45
|
+
X,
|
|
44
46
|
{
|
|
45
47
|
$flexGap: 40,
|
|
46
48
|
$justifyContent: "center",
|
|
@@ -49,15 +51,15 @@ const re = $(function() {
|
|
|
49
51
|
$gapX: 2.5,
|
|
50
52
|
$gutterX: 2.5,
|
|
51
53
|
children: /* @__PURE__ */ e(
|
|
52
|
-
|
|
54
|
+
R,
|
|
53
55
|
{
|
|
54
56
|
renderAs: "primary",
|
|
55
57
|
label: "Select a Test",
|
|
56
58
|
value: S,
|
|
57
|
-
options:
|
|
59
|
+
options: P,
|
|
58
60
|
shape: "borderLess",
|
|
59
61
|
theme: "dark",
|
|
60
|
-
onChange:
|
|
62
|
+
onChange: $,
|
|
61
63
|
isTransparent: !0
|
|
62
64
|
}
|
|
63
65
|
)
|
|
@@ -65,10 +67,10 @@ const re = $(function() {
|
|
|
65
67
|
)
|
|
66
68
|
] }),
|
|
67
69
|
/* @__PURE__ */ e(f, { heightX: 1 }),
|
|
68
|
-
/* @__PURE__ */ e(
|
|
70
|
+
/* @__PURE__ */ e(j, { $renderAs: "ub3", $align: "center", children: "This is optional and can be skipped." })
|
|
69
71
|
] });
|
|
70
72
|
});
|
|
71
73
|
export {
|
|
72
|
-
|
|
74
|
+
ae as default
|
|
73
75
|
};
|
|
74
76
|
//# sourceMappingURL=test-prep.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"test-prep.js","sources":["../../../../../src/features/trial-session/comps/test-prep/test-prep.tsx"],"sourcesContent":["import { memo, useCallback, useMemo } from 'react';\n\nimport { GIF } from '../../../../assets/gif/gif';\nimport { GOAL_CATEGORY } from '../../../milestone/constants';\nimport { getGoalsFromConfig } from '../../../milestone/create/milestone-create-helpers';\nimport Image from '../../../ui/image/image';\nimport type { ISelectOption } from '../../../ui/inputs/base-select-input/base-select-input-types';\nimport SearchableSelectInput from '../../../ui/inputs/searchable-select-input/searchable-select-input';\nimport Separator from '../../../ui/separator/separator';\nimport Text from '../../../ui/text/text';\nimport { epochTimestampAfterOneYear } from '../../../utils/utils';\nimport { useTrialSessionContext } from '../../context/use-trial-session-context';\nimport { isPLASource, updateGoalInFormData } from '../../helper';\nimport SlideHeader from '../slide-header';\nimport * as Styled from './test-prep-styled';\n\nconst TestPrep = memo(function TestPrep() {\n const { milestoneConfig, formData, updateSlideConfig, trialHomeData } = useTrialSessionContext();\n\n const { demo_info: demoInfo, intel_student: intelStudent, student } = trialHomeData;\n const { enrollment_type: enrollmentType } = student || {};\n const { stream, region_data: regionData } = demoInfo || {};\n const { opportunity_country: countryCode = 'US' } = regionData || {};\n const { grade, goals } = formData || {};\n const isPLA = isPLASource(intelStudent?.source);\n\n const goalsList = useMemo(\n () =>\n getGoalsFromConfig(milestoneConfig, {\n countryCode,\n grade: grade ?? '',\n goalCategory: GOAL_CATEGORY.TEST_PREP,\n courseStream: stream,\n enrollmentType: enrollmentType,\n }),\n [countryCode, enrollmentType, grade, milestoneConfig, stream],\n );\n\n const { goal_code: selectedGoal } =\n goals?.find(goal => goal.goal_category === GOAL_CATEGORY.TEST_PREP) ?? {};\n\n const handleGoalChange = useCallback(\n (value: string, option: ISelectOption<string | number>) => {\n const { label } = option;\n\n const updatedGoals = updateGoalInFormData(goals, GOAL_CATEGORY.TEST_PREP, {\n goal_code: value,\n milestone_name: label,\n milestone_date_ts: epochTimestampAfterOneYear(),\n publish: isPLA,\n });\n\n updateSlideConfig({ goals: updatedGoals });\n },\n [goals, isPLA, updateSlideConfig],\n );\n\n return (\n <
|
|
1
|
+
{"version":3,"file":"test-prep.js","sources":["../../../../../src/features/trial-session/comps/test-prep/test-prep.tsx"],"sourcesContent":["import { memo, useCallback, useMemo } from 'react';\n\nimport { GIF } from '../../../../assets/gif/gif';\nimport { GOAL_CATEGORY } from '../../../milestone/constants';\nimport { getGoalsFromConfig } from '../../../milestone/create/milestone-create-helpers';\nimport Image from '../../../ui/image/image';\nimport type { ISelectOption } from '../../../ui/inputs/base-select-input/base-select-input-types';\nimport SearchableSelectInput from '../../../ui/inputs/searchable-select-input/searchable-select-input';\nimport Separator from '../../../ui/separator/separator';\nimport Text from '../../../ui/text/text';\nimport { epochTimestampAfterOneYear } from '../../../utils/utils';\nimport { useTrialSessionContext } from '../../context/use-trial-session-context';\nimport { isPLASource, updateGoalInFormData } from '../../helper';\nimport SlideHeader from '../slide-header';\nimport * as Styled from './test-prep-styled';\nimport { RIGHT_PANEL_CONTENT_WIDTH } from '../../trial-session-constants';\nimport FlexView from '../../../ui/layout/flex-view';\n\nconst TestPrep = memo(function TestPrep() {\n const { milestoneConfig, formData, updateSlideConfig, trialHomeData } = useTrialSessionContext();\n\n const { demo_info: demoInfo, intel_student: intelStudent, student } = trialHomeData;\n const { enrollment_type: enrollmentType } = student || {};\n const { stream, region_data: regionData } = demoInfo || {};\n const { opportunity_country: countryCode = 'US' } = regionData || {};\n const { grade, goals } = formData || {};\n const isPLA = isPLASource(intelStudent?.source);\n\n const goalsList = useMemo(\n () =>\n getGoalsFromConfig(milestoneConfig, {\n countryCode,\n grade: grade ?? '',\n goalCategory: GOAL_CATEGORY.TEST_PREP,\n courseStream: stream,\n enrollmentType: enrollmentType,\n }),\n [countryCode, enrollmentType, grade, milestoneConfig, stream],\n );\n\n const { goal_code: selectedGoal } =\n goals?.find(goal => goal.goal_category === GOAL_CATEGORY.TEST_PREP) ?? {};\n\n const handleGoalChange = useCallback(\n (value: string, option: ISelectOption<string | number>) => {\n const { label } = option;\n\n const updatedGoals = updateGoalInFormData(goals, GOAL_CATEGORY.TEST_PREP, {\n goal_code: value,\n milestone_name: label,\n milestone_date_ts: epochTimestampAfterOneYear(),\n publish: isPLA,\n });\n\n updateSlideConfig({ goals: updatedGoals });\n },\n [goals, isPLA, updateSlideConfig],\n );\n\n return (\n <FlexView $justifyContent=\"center\" $alignItems=\"center\">\n <Separator height={60} />\n <SlideHeader />\n <FlexView $width={RIGHT_PANEL_CONTENT_WIDTH} $flexDirection=\"row\" $justifyContent=\"center\">\n <Styled.ImageWrapper>\n <Image withLoader height={402} width={302} src={GIF.TEST_PREP} className=\"image\" />\n </Styled.ImageWrapper>\n <Styled.InputContainer\n $flexGap={40}\n $justifyContent=\"center\"\n $background=\"BLUE_1\"\n $borderColor=\"BLACK_1\"\n $gapX={2.5}\n $gutterX={2.5}\n >\n <SearchableSelectInput\n renderAs=\"primary\"\n label=\"Select a Test\"\n value={selectedGoal}\n options={goalsList}\n shape=\"borderLess\"\n theme=\"dark\"\n onChange={handleGoalChange}\n isTransparent\n />\n </Styled.InputContainer>\n </FlexView>\n <Separator heightX={1} />\n <Text $renderAs=\"ub3\" $align=\"center\">\n This is optional and can be skipped.\n </Text>\n </FlexView>\n );\n});\n\nexport default TestPrep;\n"],"names":["TestPrep","memo","milestoneConfig","formData","updateSlideConfig","trialHomeData","useTrialSessionContext","demoInfo","intelStudent","student","enrollmentType","stream","regionData","countryCode","grade","goals","isPLA","isPLASource","goalsList","useMemo","getGoalsFromConfig","GOAL_CATEGORY","selectedGoal","goal","handleGoalChange","useCallback","value","option","label","updatedGoals","updateGoalInFormData","epochTimestampAfterOneYear","jsxs","FlexView","jsx","Separator","SlideHeader","RIGHT_PANEL_CONTENT_WIDTH","Styled.ImageWrapper","Image","GIF","Styled.InputContainer","SearchableSelectInput","Text"],"mappings":";;;;;;;;;;;;;;;;AAkBM,MAAAA,KAAWC,EAAK,WAAoB;AACxC,QAAM,EAAE,iBAAAC,GAAiB,UAAAC,GAAU,mBAAAC,GAAmB,eAAAC,EAAA,IAAkBC,KAElE,EAAE,WAAWC,GAAU,eAAeC,GAAc,SAAAC,EAAY,IAAAJ,GAChE,EAAE,iBAAiBK,MAAmBD,KAAW,CAAA,GACjD,EAAE,QAAAE,GAAQ,aAAaC,EAAW,IAAIL,KAAY,CAAA,GAClD,EAAE,qBAAqBM,IAAc,KAAK,IAAID,KAAc,CAAA,GAC5D,EAAE,OAAAE,GAAO,OAAAC,MAAUZ,KAAY,CAAA,GAC/Ba,IAAQC,EAAYT,KAAA,gBAAAA,EAAc,MAAM,GAExCU,IAAYC;AAAA,IAChB,MACEC,EAAmBlB,GAAiB;AAAA,MAClC,aAAAW;AAAA,MACA,OAAOC,KAAS;AAAA,MAChB,cAAcO,EAAc;AAAA,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AA,cACT,OAAM;AAAA,cACN,OAAM;AAAA,cACN,UAAUM;AAAA,cACV,eAAa;AAAA,YAAA;AAAA,UACf;AAAA,QAAA;AAAA,MACF;AAAA,IAAA,GACF;AAAA,IACA,gBAAAU,EAACC,GAAU,EAAA,SAAS,EAAG,CAAA;AAAA,sBACtBQ,GAAK,EAAA,WAAU,OAAM,QAAO,UAAS,UAEtC,wCAAA;AAAA,EACF,EAAA,CAAA;AAEJ,CAAC;"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import t from "styled-components";
|
|
2
|
+
import a from "../../../ui/layout/flex-view.js";
|
|
3
|
+
import s from "../../../../assets/line-icons/icons/check2.js";
|
|
4
|
+
const p = t(a)(
|
|
5
|
+
({ theme: o, $selected: n, $preventSelection: r }) => `
|
|
6
|
+
cursor: pointer;
|
|
7
|
+
transition: all 0.3s ease-in-out;
|
|
8
|
+
&:hover{
|
|
9
|
+
background-color: ${r ? "" : o.colors.WHITE_4};
|
|
10
|
+
}
|
|
11
|
+
&:nth-child(1) {
|
|
12
|
+
transform: none;
|
|
13
|
+
}
|
|
14
|
+
&:nth-child(2) {
|
|
15
|
+
transform: translateX(-1px);
|
|
16
|
+
}
|
|
17
|
+
&:nth-child(3) {
|
|
18
|
+
transform: translateX(-2px);
|
|
19
|
+
}
|
|
20
|
+
&:nth-child(4) {
|
|
21
|
+
transform: translateY(-1px);
|
|
22
|
+
}
|
|
23
|
+
&:nth-child(5) {
|
|
24
|
+
transform: translate(-1px, -1px);
|
|
25
|
+
}
|
|
26
|
+
${n ? "z-index:1;" : ""}
|
|
27
|
+
${r ? "cursor: not-allowed;" : ""}
|
|
28
|
+
`
|
|
29
|
+
), e = t(s)(
|
|
30
|
+
({ theme: o }) => `
|
|
31
|
+
position: absolute;
|
|
32
|
+
top: 12px;
|
|
33
|
+
right: 12px;
|
|
34
|
+
border-radius: 20px;
|
|
35
|
+
background-color: ${o.colors.BLACK};
|
|
36
|
+
`
|
|
37
|
+
);
|
|
38
|
+
export {
|
|
39
|
+
e as CheckIcon,
|
|
40
|
+
p as TopicWrapper
|
|
41
|
+
};
|
|
42
|
+
//# sourceMappingURL=topic-selection-styled.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"topic-selection-styled.js","sources":["../../../../../src/features/trial-session/comps/topic-selection/topic-selection-styled.tsx"],"sourcesContent":["import styled from 'styled-components';\n\nimport FlexView from '../../../ui/layout/flex-view';\nimport Check2Icon from '../../../../assets/line-icons/icons/check2';\n\nconst TopicWrapper = styled(FlexView)<{ $selected: boolean; $preventSelection: boolean }>(\n ({ theme, $selected, $preventSelection }) => `\n cursor: pointer;\n transition: all 0.3s ease-in-out;\n &:hover{\n background-color: ${$preventSelection ? '' : theme.colors.WHITE_4};\n }\n &:nth-child(1) {\n transform: none;\n }\n &:nth-child(2) {\n transform: translateX(-1px);\n }\n &:nth-child(3) {\n transform: translateX(-2px);\n }\n &:nth-child(4) {\n transform: translateY(-1px);\n }\n &:nth-child(5) {\n transform: translate(-1px, -1px);\n }\n ${$selected ? 'z-index:1;' : ''}\n ${$preventSelection ? 'cursor: not-allowed;' : ''}\n`,\n);\n\nconst CheckIcon = styled(Check2Icon)(\n ({ theme }) => `\n position: absolute;\n top: 12px;\n right: 12px;\n border-radius: 20px;\n background-color: ${theme.colors.BLACK};\n`,\n);\n\nexport { TopicWrapper, CheckIcon };\n"],"names":["TopicWrapper","styled","FlexView","theme","$selected","$preventSelection","CheckIcon","Check2Icon"],"mappings":";;;AAKM,MAAAA,IAAeC,EAAOC,CAAQ;AAAA,EAClC,CAAC,EAAE,OAAAC,GAAO,WAAAC,GAAW,mBAAAC,EAAwB,MAAA;AAAA;AAAA;AAAA;AAAA,wBAIvBA,IAAoB,KAAKF,EAAM,OAAO,OAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAiBjEC,IAAY,eAAe,EAAE;AAAA,IAC7BC,IAAoB,yBAAyB,EAAE;AAAA;AAEnD,GAEMC,IAAYL,EAAOM,CAAU;AAAA,EACjC,CAAC,EAAE,OAAAJ,EAAA,MAAY;AAAA;AAAA;AAAA;AAAA;AAAA,sBAKKA,EAAM,OAAO,KAAK;AAAA;AAExC;"}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { jsx as r, jsxs as g } from "react/jsx-runtime";
|
|
2
|
+
import { memo as H, useMemo as W, useCallback as T, useEffect as _ } from "react";
|
|
3
|
+
import $ from "../../../ui/layout/flex-view.js";
|
|
4
|
+
import b from "../../../ui/separator/separator.js";
|
|
5
|
+
import v from "../slide-header/index.js";
|
|
6
|
+
import { MAXIMUM_TOPICS_TO_SELECT as l, RIGHT_PANEL_CONTENT_WIDTH as L } from "../../trial-session-constants.js";
|
|
7
|
+
import { TopicWrapper as j, CheckIcon as k } from "./topic-selection-styled.js";
|
|
8
|
+
import N from "../../../ui/image/image.js";
|
|
9
|
+
import P from "../../../ui/text/text.js";
|
|
10
|
+
import { useGetTrialTopics as B } from "../../api/trial-topics.js";
|
|
11
|
+
import M from "../../../ui/loader/app-loader/app-loader.js";
|
|
12
|
+
import F from "../../../ui/error/error.js";
|
|
13
|
+
import { useTrialSessionContext as G } from "../../context/use-trial-session-context.js";
|
|
14
|
+
const O = H(() => {
|
|
15
|
+
const { formData: C, trialHomeData: S, updateSlideConfig: m, updateButtonState: d } = G(), { grade: c = 2, course: n, selectedTopics: o = [] } = C || {}, { demo_info: I } = S, { region_data: y } = I, { opportunity_country: p = "US" } = y || {}, {
|
|
16
|
+
get: f,
|
|
17
|
+
data: i,
|
|
18
|
+
isProcessed: u,
|
|
19
|
+
isProcessing: x,
|
|
20
|
+
isProcessingFailed: A
|
|
21
|
+
} = B("trial-v3-topics"), h = o.length === l, E = W(() => {
|
|
22
|
+
var s;
|
|
23
|
+
if (!i || !c) return [];
|
|
24
|
+
const e = ((s = i == null ? void 0 : i[p]) == null ? void 0 : s[Number(c)]) ?? {}, t = n && e[n] ? e[n] : e.default;
|
|
25
|
+
return Array.isArray(t) ? t : [];
|
|
26
|
+
}, [p, n, c, i]), a = T(() => {
|
|
27
|
+
u || f("trial-v3-topics");
|
|
28
|
+
}, [f, u]), D = T(
|
|
29
|
+
(e) => {
|
|
30
|
+
const t = o.includes(e), s = t ? o.filter((w) => w !== e) : [...o, e];
|
|
31
|
+
!t && o.length >= l || m({ selectedTopics: s });
|
|
32
|
+
},
|
|
33
|
+
[o, m]
|
|
34
|
+
);
|
|
35
|
+
return _(() => {
|
|
36
|
+
a();
|
|
37
|
+
}, [a]), _(() => {
|
|
38
|
+
d("right", { isDisabled: !h, isLoading: !1 });
|
|
39
|
+
}, [h, d]), A ? /* @__PURE__ */ r(F, { height: "100vh", onTryAgain: a }) : x || !i ? /* @__PURE__ */ r(M, { height: "100vh" }) : /* @__PURE__ */ g($, { $justifyContent: "center", $alignItems: "center", children: [
|
|
40
|
+
/* @__PURE__ */ r(b, { height: 60 }),
|
|
41
|
+
/* @__PURE__ */ r(v, {}),
|
|
42
|
+
/* @__PURE__ */ r(
|
|
43
|
+
$,
|
|
44
|
+
{
|
|
45
|
+
$width: L - 100,
|
|
46
|
+
$justifyContent: "center",
|
|
47
|
+
$alignItems: "center",
|
|
48
|
+
$flexDirection: "row",
|
|
49
|
+
$flexWrap: !0,
|
|
50
|
+
children: E.map((e) => {
|
|
51
|
+
const t = o.includes(e.topic_name);
|
|
52
|
+
return /* @__PURE__ */ g(
|
|
53
|
+
j,
|
|
54
|
+
{
|
|
55
|
+
$width: 200,
|
|
56
|
+
$height: 200,
|
|
57
|
+
$flexDirection: "column",
|
|
58
|
+
$alignItems: "center",
|
|
59
|
+
$justifyContent: "center",
|
|
60
|
+
$borderColor: t ? "BLACK" : "BLACK_T_38",
|
|
61
|
+
$background: t ? "WHITE_4" : "WHITE",
|
|
62
|
+
$flexGap: 2,
|
|
63
|
+
$position: "relative",
|
|
64
|
+
$selected: t,
|
|
65
|
+
$preventSelection: !t && o.length >= l,
|
|
66
|
+
onClick: () => D(e.topic_name),
|
|
67
|
+
children: [
|
|
68
|
+
t ? /* @__PURE__ */ r(k, { color: "WHITE", height: 20, width: 20 }) : null,
|
|
69
|
+
/* @__PURE__ */ r(N, { width: 88, height: 88, src: e.topic_image_url, alt: e.topic_name }),
|
|
70
|
+
/* @__PURE__ */ r(P, { $renderAs: "ab2", children: e.topic_name })
|
|
71
|
+
]
|
|
72
|
+
},
|
|
73
|
+
e.topic_name
|
|
74
|
+
);
|
|
75
|
+
})
|
|
76
|
+
}
|
|
77
|
+
)
|
|
78
|
+
] });
|
|
79
|
+
});
|
|
80
|
+
O.displayName = "TopicSelection";
|
|
81
|
+
export {
|
|
82
|
+
O as default
|
|
83
|
+
};
|
|
84
|
+
//# sourceMappingURL=topic-selection.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"topic-selection.js","sources":["../../../../../src/features/trial-session/comps/topic-selection/topic-selection.tsx"],"sourcesContent":["import { memo, useCallback, useEffect, useMemo } from 'react';\n\nimport FlexView from '../../../ui/layout/flex-view';\nimport Separator from '../../../ui/separator/separator';\nimport SlideHeader from '../slide-header';\nimport { MAXIMUM_TOPICS_TO_SELECT, RIGHT_PANEL_CONTENT_WIDTH } from '../../trial-session-constants';\nimport * as Styled from './topic-selection-styled';\nimport Image from '../../../ui/image/image';\nimport Text from '../../../ui/text/text';\nimport { useGetTrialTopics } from '../../api/trial-topics';\nimport AppLoader from '../../../ui/loader/app-loader/app-loader';\nimport Error from '../../../ui/error/error';\nimport { useTrialSessionContext } from '../../context/use-trial-session-context';\n\nconst TopicSelection = memo(() => {\n const { formData, trialHomeData, updateSlideConfig, updateButtonState } =\n useTrialSessionContext();\n const { grade = 2, course, selectedTopics = [] } = formData || {};\n const { demo_info: demoInfo } = trialHomeData;\n const { region_data: regionData } = demoInfo;\n const { opportunity_country: countryCode = 'US' } = regionData || {};\n\n const {\n get: getTrialTopics,\n data: trialTopics,\n isProcessed,\n isProcessing,\n isProcessingFailed,\n } = useGetTrialTopics('trial-v3-topics');\n const hasRequiredFields = Boolean(selectedTopics.length === MAXIMUM_TOPICS_TO_SELECT);\n\n const topicsToShow = useMemo(() => {\n if (!trialTopics || !grade) return [];\n\n const topicsWithCourse = trialTopics?.[countryCode]?.[Number(grade)] ?? {};\n const topics =\n course && topicsWithCourse[course] ? topicsWithCourse[course] : topicsWithCourse['default'];\n\n return Array.isArray(topics) ? topics : [];\n }, [countryCode, course, grade, trialTopics]);\n\n const fetchData = useCallback(() => {\n if (!isProcessed) {\n getTrialTopics('trial-v3-topics');\n }\n }, [getTrialTopics, isProcessed]);\n\n const handleClick = useCallback(\n (topicTitle: string) => {\n const isAlreadySelected = selectedTopics.includes(topicTitle);\n const updatedTopics = isAlreadySelected\n ? selectedTopics.filter(topic => topic !== topicTitle)\n : [...selectedTopics, topicTitle];\n\n if (!isAlreadySelected && selectedTopics.length >= MAXIMUM_TOPICS_TO_SELECT) return;\n\n updateSlideConfig({ selectedTopics: updatedTopics });\n },\n [selectedTopics, updateSlideConfig],\n );\n\n useEffect(() => {\n fetchData();\n }, [fetchData]);\n\n useEffect(() => {\n updateButtonState('right', { isDisabled: !hasRequiredFields, isLoading: false });\n }, [hasRequiredFields, updateButtonState]);\n\n if (isProcessingFailed) return <Error height=\"100vh\" onTryAgain={fetchData} />;\n\n if (isProcessing || !trialTopics) return <AppLoader height=\"100vh\" />;\n\n return (\n <FlexView $justifyContent=\"center\" $alignItems=\"center\">\n <Separator height={60} />\n <SlideHeader />\n <FlexView\n $width={RIGHT_PANEL_CONTENT_WIDTH - 100}\n $justifyContent=\"center\"\n $alignItems=\"center\"\n $flexDirection=\"row\"\n $flexWrap\n >\n {topicsToShow.map(topic => {\n const isSelected = selectedTopics.includes(topic.topic_name);\n\n return (\n <Styled.TopicWrapper\n key={topic.topic_name}\n $width={200}\n $height={200}\n $flexDirection=\"column\"\n $alignItems=\"center\"\n $justifyContent=\"center\"\n $borderColor={isSelected ? 'BLACK' : 'BLACK_T_38'}\n $background={isSelected ? 'WHITE_4' : 'WHITE'}\n $flexGap={2}\n $position=\"relative\"\n $selected={isSelected}\n $preventSelection={!isSelected && selectedTopics.length >= MAXIMUM_TOPICS_TO_SELECT}\n onClick={() => handleClick(topic.topic_name)}\n >\n {isSelected ? <Styled.CheckIcon color=\"WHITE\" height={20} width={20} /> : null}\n <Image width={88} height={88} src={topic.topic_image_url} alt={topic.topic_name} />\n <Text $renderAs=\"ab2\">{topic.topic_name}</Text>\n </Styled.TopicWrapper>\n );\n })}\n </FlexView>\n </FlexView>\n );\n});\n\nTopicSelection.displayName = 'TopicSelection';\n\nexport default TopicSelection;\n"],"names":["TopicSelection","memo","formData","trialHomeData","updateSlideConfig","updateButtonState","useTrialSessionContext","grade","course","selectedTopics","demoInfo","regionData","countryCode","getTrialTopics","trialTopics","isProcessed","isProcessing","isProcessingFailed","useGetTrialTopics","hasRequiredFields","MAXIMUM_TOPICS_TO_SELECT","topicsToShow","useMemo","topicsWithCourse","_a","topics","fetchData","useCallback","handleClick","topicTitle","isAlreadySelected","updatedTopics","topic","useEffect","jsx","Error","AppLoader","jsxs","FlexView","Separator","SlideHeader","RIGHT_PANEL_CONTENT_WIDTH","isSelected","Styled.TopicWrapper","Styled.CheckIcon","Image","Text"],"mappings":";;;;;;;;;;;;;AAcM,MAAAA,IAAiBC,EAAK,MAAM;AAChC,QAAM,EAAE,UAAAC,GAAU,eAAAC,GAAe,mBAAAC,GAAmB,mBAAAC,EAAA,IAClDC,KACI,EAAE,OAAAC,IAAQ,GAAG,QAAAC,GAAQ,gBAAAC,IAAiB,GAAO,IAAAP,KAAY,IACzD,EAAE,WAAWQ,EAAa,IAAAP,GAC1B,EAAE,aAAaQ,EAAe,IAAAD,GAC9B,EAAE,qBAAqBE,IAAc,KAAK,IAAID,KAAc,CAAA,GAE5D;AAAA,IACJ,KAAKE;AAAA,IACL,MAAMC;AAAA,IACN,aAAAC;AAAA,IACA,cAAAC;AAAA,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out/flex-view.js";
|
|
3
|
+
const p = o.div`
|
|
4
|
+
width: 100%;
|
|
5
|
+
height: 100%;
|
|
6
|
+
overflow: auto;
|
|
7
|
+
`, i = o(t)(
|
|
8
|
+
({ theme: r }) => `
|
|
9
|
+
border-radius: ${r.layout.gutter * 0.5}px ${r.layout.gutter * 0.5}px 0 0;
|
|
10
|
+
box-shadow: 0 0px 12px 0 rgba(0, 0, 0, 0.15);
|
|
11
|
+
margin: auto;
|
|
12
|
+
`
|
|
13
|
+
), d = o(t)`
|
|
14
|
+
overflow: hidden;
|
|
15
|
+
`;
|
|
16
|
+
export {
|
|
17
|
+
p as Container,
|
|
18
|
+
d as CueCanvasWrapper,
|
|
19
|
+
i as ToolbarWrapper
|
|
20
|
+
};
|
|
21
|
+
//# sourceMappingURL=whiteboard-styled.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"whiteboard-styled.js","sources":["../../../../../src/features/trial-session/comps/whiteboard/whiteboard-styled.ts"],"sourcesContent":["import styled from 'styled-components';\n\nimport FlexView from '../../../ui/layout/flex-view';\n\nconst Container = styled.div`\n width: 100%;\n height: 100%;\n overflow: auto;\n`;\n\nconst ToolbarWrapper = styled(FlexView)(\n ({ theme }) => `\n border-radius: ${theme.layout.gutter * 0.5}px ${theme.layout.gutter * 0.5}px 0 0;\n box-shadow: 0 0px 12px 0 rgba(0, 0, 0, 0.15);\n margin: auto;\n`,\n);\n\nconst CueCanvasWrapper = styled(FlexView)`\n overflow: hidden;\n`;\n\nexport { Container, ToolbarWrapper, CueCanvasWrapper };\n"],"names":["Container","styled","ToolbarWrapper","FlexView","theme","CueCanvasWrapper"],"mappings":";;AAIA,MAAMA,IAAYC,EAAO;AAAA;AAAA;AAAA;AAAA,GAMnBC,IAAiBD,EAAOE,CAAQ;AAAA,EACpC,CAAC,EAAE,OAAAC,EAAA,MAAY;AAAA,mBACEA,EAAM,OAAO,SAAS,GAAG,MAAMA,EAAM,OAAO,SAAS,GAAG;AAAA;AAAA;AAAA;AAI3E,GAEMC,IAAmBJ,EAAOE,CAAQ;AAAA;AAAA;"}
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import { jsxs as T, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { memo as H, useState as U, useCallback as i } from "react";
|
|
3
|
+
import y from "../../../cue-canvas/cue-canvas.js";
|
|
4
|
+
import W from "../../../cue-canvas/cue-canvas-provider.js";
|
|
5
|
+
import c from "../../../ui/layout/flex-view.js";
|
|
6
|
+
import x from "../../../cue-canvas/sidebar/sidebar.js";
|
|
7
|
+
import B from "../../../cue-canvas/toolbar/toolbar.js";
|
|
8
|
+
import O from "../../../cue-canvas/bottombar/homework-controls.js";
|
|
9
|
+
import K from "../../../worksheet/learnosity-preloader/learnosity-preloader.js";
|
|
10
|
+
import { LEARNOSITY_QUESTIONS_API as j, LEARNOSITY_QUESTIONS_API_FALLBACK as D } from "../../../worksheet/worksheet/stories/worksheet-story-container.js";
|
|
11
|
+
import { useUIContext as G } from "../../../ui/context/context.js";
|
|
12
|
+
import { useTrialSessionContext as Y } from "../../context/use-trial-session-context.js";
|
|
13
|
+
import { USER_TYPE as I } from "../../../timeline/daily-timeline/daily-timeline-types.js";
|
|
14
|
+
import { Container as F, CueCanvasWrapper as M, ToolbarWrapper as Q } from "./whiteboard-styled.js";
|
|
15
|
+
import X from "../slide-header/index.js";
|
|
16
|
+
import v from "../../../ui/separator/separator.js";
|
|
17
|
+
import { RIGHT_PANEL_CONTENT_WIDTH as E } from "../../trial-session-constants.js";
|
|
18
|
+
import q from "../../../cue-canvas/hooks/use-canvas-sync-broker.js";
|
|
19
|
+
const V = 455, Ce = H(function() {
|
|
20
|
+
const { isTeacher: r, teacherId: l, studentId: g, teacherClassroomId: s } = Y(), [w, h] = U(), { onEvent: m } = G(), u = `trial_whiteboard_${s}`, S = `whiteboard_${s}_${l}`, a = r ? I.TEACHER : I.STUDENT, p = r ? "teacherPublished" : "studentPublished", b = r ? "studentPublished" : "teacherPublished", n = s === "teacherClassroomId", C = i(
|
|
21
|
+
(o, t) => {
|
|
22
|
+
m(o, t ?? {});
|
|
23
|
+
},
|
|
24
|
+
[m]
|
|
25
|
+
), _ = i(
|
|
26
|
+
(o) => {
|
|
27
|
+
h((t) => ({
|
|
28
|
+
...t ?? {},
|
|
29
|
+
...o
|
|
30
|
+
}));
|
|
31
|
+
},
|
|
32
|
+
[h]
|
|
33
|
+
), A = i(
|
|
34
|
+
(o) => {
|
|
35
|
+
const t = new CustomEvent(p, {
|
|
36
|
+
detail: { data: o }
|
|
37
|
+
});
|
|
38
|
+
return window.dispatchEvent(t), !0;
|
|
39
|
+
},
|
|
40
|
+
[p]
|
|
41
|
+
), $ = i(
|
|
42
|
+
(o, t) => {
|
|
43
|
+
window.addEventListener(b, (f) => {
|
|
44
|
+
const R = f;
|
|
45
|
+
console.log("Attaching callback for question with id & callback", o, t), t(R.detail.data.eventPayload);
|
|
46
|
+
});
|
|
47
|
+
},
|
|
48
|
+
[b]
|
|
49
|
+
), {
|
|
50
|
+
publishStrokes: P,
|
|
51
|
+
initialStrokesData: d,
|
|
52
|
+
registerCallback: k,
|
|
53
|
+
channelMetadata: L,
|
|
54
|
+
setChannelMetadata: N
|
|
55
|
+
} = q(S, C, void 0, "whiteboard");
|
|
56
|
+
return /* @__PURE__ */ T(F, { children: [
|
|
57
|
+
/* @__PURE__ */ e(v, { height: 60 }),
|
|
58
|
+
/* @__PURE__ */ e(X, {}),
|
|
59
|
+
/* @__PURE__ */ e(
|
|
60
|
+
K,
|
|
61
|
+
{
|
|
62
|
+
apiURL: j,
|
|
63
|
+
fallbackAPIURL: D,
|
|
64
|
+
logger: C,
|
|
65
|
+
children: /* @__PURE__ */ e(W, { userType: a, renderAs: "whiteboard", children: /* @__PURE__ */ e(c, { $alignItems: "center", $justifyContent: "center", children: /* @__PURE__ */ T(M, { hidden: !0, $background: "WHITE", $borderColor: "BLACK", children: [
|
|
66
|
+
/* @__PURE__ */ e(c, { $position: "absolute", $gutterX: 0.5, $gapX: 0.5, children: /* @__PURE__ */ e(x, {}) }),
|
|
67
|
+
/* @__PURE__ */ e(
|
|
68
|
+
y,
|
|
69
|
+
{
|
|
70
|
+
canvasId: u,
|
|
71
|
+
userId: r ? l : g,
|
|
72
|
+
width: E,
|
|
73
|
+
height: V,
|
|
74
|
+
canScribble: !0,
|
|
75
|
+
canRender: !0,
|
|
76
|
+
appended: !0,
|
|
77
|
+
onPublish: n ? A : P,
|
|
78
|
+
onSubscribe: n ? $ : k,
|
|
79
|
+
initialData: d == null ? void 0 : d[u],
|
|
80
|
+
userType: a,
|
|
81
|
+
renderAs: "whiteboard",
|
|
82
|
+
canvasConfig: n ? w : L,
|
|
83
|
+
updateCanvasConfig: n ? _ : N
|
|
84
|
+
},
|
|
85
|
+
`${a}-whiteboard`
|
|
86
|
+
),
|
|
87
|
+
/* @__PURE__ */ e(c, { $width: "100%", $height: 1, $background: "BLACK_T_08" }),
|
|
88
|
+
/* @__PURE__ */ e(v, { height: 2 }),
|
|
89
|
+
/* @__PURE__ */ e(Q, { $borderColor: "BLACK_T_08", children: /* @__PURE__ */ e(B, { userType: a, renderAs: "whiteboard", withGutter: !1 }) }),
|
|
90
|
+
/* @__PURE__ */ e(O, { width: E })
|
|
91
|
+
] }) }) })
|
|
92
|
+
}
|
|
93
|
+
)
|
|
94
|
+
] });
|
|
95
|
+
});
|
|
96
|
+
export {
|
|
97
|
+
Ce as default
|
|
98
|
+
};
|
|
99
|
+
//# sourceMappingURL=whiteboard.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"whiteboard.js","sources":["../../../../../src/features/trial-session/comps/whiteboard/whiteboard.tsx"],"sourcesContent":["import { type FC, memo, useCallback, useState } from 'react';\n\nimport CueCanvas from '../../../cue-canvas/cue-canvas';\nimport CueCanvasProvider from '../../../cue-canvas/cue-canvas-provider';\nimport FlexView from '../../../ui/layout/flex-view';\nimport Sidebar from '../../../cue-canvas/sidebar/sidebar';\nimport type {\n IActionData,\n ICanvasUpdateConfig,\n IPublishData,\n} from '../../../cue-canvas/types/cue-canvas';\nimport Toolbar from '../../../cue-canvas/toolbar/toolbar';\nimport HomeworkControls from '../../../cue-canvas/bottombar/homework-controls';\nimport LearnosityPreloader from '../../../worksheet/learnosity-preloader/learnosity-preloader';\nimport {\n LEARNOSITY_QUESTIONS_API,\n LEARNOSITY_QUESTIONS_API_FALLBACK,\n} from '../../../worksheet/worksheet/stories/worksheet-story-container';\nimport { useUIContext } from '../../../ui/context/context';\nimport { useTrialSessionContext } from '../../context/use-trial-session-context';\nimport { USER_TYPE } from '../../../timeline/daily-timeline/daily-timeline-types';\nimport * as Styled from './whiteboard-styled';\nimport SlideHeader from '../slide-header';\nimport Separator from '../../../ui/separator/separator';\nimport { RIGHT_PANEL_CONTENT_WIDTH } from '../../trial-session-constants';\nimport useCanvasSyncBroker from '../../../cue-canvas/hooks/use-canvas-sync-broker';\n\nconst WHITEBOARD_HEIGHT = 455;\n\ninterface IEventData {\n data: {\n eventPayload: IActionData;\n };\n}\n\nconst Whiteboard: FC = memo(function Whiteboard() {\n const { isTeacher, teacherId, studentId, teacherClassroomId } = useTrialSessionContext();\n const [canvasConfig, setCanvasConfig] = useState<ICanvasUpdateConfig>();\n const { onEvent: trackEvent } = useUIContext();\n\n const canvasId = `trial_whiteboard_${teacherClassroomId}`;\n const channelId = `whiteboard_${teacherClassroomId}_${teacherId}`;\n const userType = isTeacher ? USER_TYPE.TEACHER : USER_TYPE.STUDENT;\n const publishName = isTeacher ? 'teacherPublished' : 'studentPublished';\n const subscribeName = isTeacher ? 'studentPublished' : 'teacherPublished';\n const isTestClass = teacherClassroomId === 'teacherClassroomId';\n\n const logger = useCallback(\n (eventName: string, data?: Record<string, unknown>) => {\n const payload = data ?? {};\n\n trackEvent(eventName, payload);\n },\n [trackEvent],\n );\n\n const handleUpdateConfig = useCallback(\n (data: ICanvasUpdateConfig) => {\n setCanvasConfig(prevConfig => ({\n ...(prevConfig ?? {}),\n ...data,\n }));\n },\n [setCanvasConfig],\n );\n\n const onPublishStroke = useCallback(\n (data: IPublishData) => {\n const event = new CustomEvent(publishName, {\n detail: { data },\n });\n\n window.dispatchEvent(event);\n\n return true;\n },\n [publishName],\n );\n\n const onReceiveStroke = useCallback(\n (id: string, cb: (data: IActionData) => void) => {\n window.addEventListener(subscribeName, event => {\n const customEvent = event as CustomEvent<IEventData>;\n\n // eslint-disable-next-line no-console\n console.log('Attaching callback for question with id & callback', id, cb);\n\n cb(customEvent.detail.data.eventPayload);\n });\n },\n [subscribeName],\n );\n\n const {\n publishStrokes,\n initialStrokesData,\n registerCallback,\n channelMetadata,\n setChannelMetadata,\n } = useCanvasSyncBroker(channelId, logger, undefined, 'whiteboard');\n\n return (\n <Styled.Container>\n <Separator height={60} />\n <SlideHeader />\n <LearnosityPreloader\n apiURL={LEARNOSITY_QUESTIONS_API}\n fallbackAPIURL={LEARNOSITY_QUESTIONS_API_FALLBACK}\n logger={logger}\n >\n <CueCanvasProvider userType={userType} renderAs=\"whiteboard\">\n <FlexView $alignItems=\"center\" $justifyContent=\"center\">\n <Styled.CueCanvasWrapper hidden $background=\"WHITE\" $borderColor=\"BLACK\">\n <FlexView $position=\"absolute\" $gutterX={0.5} $gapX={0.5}>\n <Sidebar />\n </FlexView>\n <CueCanvas\n key={`${userType}-whiteboard`}\n canvasId={canvasId}\n userId={isTeacher ? teacherId : studentId}\n width={RIGHT_PANEL_CONTENT_WIDTH}\n height={WHITEBOARD_HEIGHT}\n canScribble\n canRender\n appended\n onPublish={isTestClass ? onPublishStroke : publishStrokes}\n onSubscribe={isTestClass ? onReceiveStroke : registerCallback}\n initialData={initialStrokesData?.[canvasId]}\n userType={userType}\n renderAs=\"whiteboard\"\n canvasConfig={isTestClass ? canvasConfig : channelMetadata}\n updateCanvasConfig={isTestClass ? handleUpdateConfig : setChannelMetadata}\n />\n <FlexView $width=\"100%\" $height={1} $background=\"BLACK_T_08\" />\n <Separator height={2} />\n <Styled.ToolbarWrapper $borderColor=\"BLACK_T_08\">\n <Toolbar userType={userType} renderAs=\"whiteboard\" withGutter={false} />\n </Styled.ToolbarWrapper>\n <HomeworkControls width={RIGHT_PANEL_CONTENT_WIDTH} />\n </Styled.CueCanvasWrapper>\n </FlexView>\n </CueCanvasProvider>\n </LearnosityPreloader>\n </Styled.Container>\n );\n});\n\nexport default Whiteboard;\n"],"names":["WHITEBOARD_HEIGHT","Whiteboard","memo","isTeacher","teacherId","studentId","teacherClassroomId","useTrialSessionContext","canvasConfig","setCanvasConfig","useState","trackEvent","useUIContext","canvasId","channelId","userType","USER_TYPE","publishName","subscribeName","isTestClass","logger","useCallback","eventName","data","handleUpdateConfig","prevConfig","onPublishStroke","event","onReceiveStroke","id","cb","customEvent","publishStrokes","initialStrokesData","registerCallback","channelMetadata","setChannelMetadata","useCanvasSyncBroker","jsxs","Styled.Container","jsx","Separator","SlideHeader","LearnosityPreloader","LEARNOSITY_QUESTIONS_API","LEARNOSITY_QUESTIONS_API_FALLBACK","CueCanvasProvider","FlexView","Styled.CueCanvasWrapper","Sidebar","CueCanvas","RIGHT_PANEL_CONTENT_WIDTH","Styled.ToolbarWrapper","Toolbar","HomeworkControls"],"mappings":";;;;;;;;;;;;;;;;;;AA2BA,MAAMA,IAAoB,KAQpBC,KAAiBC,EAAK,WAAsB;AAChD,QAAM,EAAE,WAAAC,GAAW,WAAAC,GAAW,WAAAC,GAAW,oBAAAC,EAAA,IAAuBC,KAC1D,CAACC,GAAcC,CAAe,IAAIC,EAA8B,GAChE,EAAE,SAASC,EAAW,IAAIC,EAAa,GAEvCC,IAAW,oBAAoBP,CAAkB,IACjDQ,IAAY,cAAcR,CAAkB,IAAIF,CAAS,IACzDW,IAAWZ,IAAYa,EAAU,UAAUA,EAAU,SACrDC,IAAcd,IAAY,qBAAqB,oBAC/Ce,IAAgBf,IAAY,qBAAqB,oBACjDgB,IAAcb,MAAuB,sBAErCc,IAASC;AAAA,IACb,CAACC,GAAmBC,MAAmC;AAGrD,MAAA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