@cuemath/leap 3.5.67-link2 → 3.5.67-link4
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/milestone/create/api/milestone-config.js.map +1 -1
- package/dist/features/parent-dashboard/hooks/use-student-profile-summary-data.js.map +1 -1
- package/dist/features/trial-session/comps/school-goals/school-goals-view.js.map +1 -1
- package/dist/features/trial-session/comps/session-overview/session-overview-utils.js.map +1 -1
- package/dist/features/trial-session/comps/student-info/student-info.js +15 -15
- package/dist/features/trial-session/comps/student-info/student-info.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.js +34 -53
- package/dist/features/trial-session/comps/topic-selection/topic-selection.js.map +1 -1
- package/dist/features/trial-session/context/trial-session-context.js +5 -5
- package/dist/features/trial-session/context/trial-session-context.js.map +1 -1
- package/dist/features/trial-session/hooks/use-trial-session-navigation.js +148 -152
- package/dist/features/trial-session/hooks/use-trial-session-navigation.js.map +1 -1
- package/dist/features/trial-session/trial-session-constants.js +26 -17
- 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/index.d.ts +8 -3
- package/dist/index.js +284 -282
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"milestone-config.js","sources":["../../../../../src/features/milestone/create/api/milestone-config.ts"],"sourcesContent":["import { createGetAPI } from '@cuemath/rest-api';\n\nimport { BASE_URL_V3 } from '../../../../constants/api';\nimport { stringify } from '../../../../helpers/query-string';\nimport type { IMilestoneConfig } from '../milestone-create-types';\n\nconst { useGet: useGetMileStoneConfig } = createGetAPI<\n IMilestoneConfig,\n { demo_type?:
|
|
1
|
+
{"version":3,"file":"milestone-config.js","sources":["../../../../../src/features/milestone/create/api/milestone-config.ts"],"sourcesContent":["import { createGetAPI } from '@cuemath/rest-api';\n\nimport { BASE_URL_V3 } from '../../../../constants/api';\nimport { stringify } from '../../../../helpers/query-string';\nimport type { IMilestoneConfig } from '../milestone-create-types';\nimport { type DemoType } from '../../../trial-session/trial-session-constants';\n\nconst { useGet: useGetMileStoneConfig } = createGetAPI<\n IMilestoneConfig,\n { demo_type?: DemoType } | undefined\n>({\n getURL: (_, query) => `${BASE_URL_V3}/milestone/config/${query ? `?${stringify(query)}` : ''}`,\n});\n\nexport { useGetMileStoneConfig };\n"],"names":["useGetMileStoneConfig","createGetAPI","_","query","BASE_URL_V3","stringify"],"mappings":";;;AAOA,MAAM,EAAE,QAAQA,EAAsB,IAAIC,EAGxC;AAAA,EACA,QAAQ,CAACC,GAAGC,MAAU,GAAGC,CAAW,qBAAqBD,IAAQ,IAAIE,EAAUF,CAAK,CAAC,KAAK,EAAE;AAC9F,CAAC;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-student-profile-summary-data.js","sources":["../../../../src/features/parent-dashboard/hooks/use-student-profile-summary-data.ts"],"sourcesContent":["import { useCallback, useEffect, useMemo } from 'react';\n\nimport { useGetMileStoneConfig } from '../../milestone/create/api/milestone-config';\nimport { useStudentProfileSummaryGet } from '../api/get-student-profile-summary';\nimport { getLearningProfileSummary } from '../modals/student-profile-summary/student-profile-summary-helpers';\n\nconst DEFAULT_DEMO_TYPE = { demo_type: 'TRIAL_V3'
|
|
1
|
+
{"version":3,"file":"use-student-profile-summary-data.js","sources":["../../../../src/features/parent-dashboard/hooks/use-student-profile-summary-data.ts"],"sourcesContent":["import { useCallback, useEffect, useMemo } from 'react';\n\nimport { useGetMileStoneConfig } from '../../milestone/create/api/milestone-config';\nimport { useStudentProfileSummaryGet } from '../api/get-student-profile-summary';\nimport { getLearningProfileSummary } from '../modals/student-profile-summary/student-profile-summary-helpers';\nimport { type DemoType } from '../../trial-session/trial-session-constants';\n\nconst DEFAULT_DEMO_TYPE = { demo_type: 'TRIAL_V3' as DemoType };\n\nconst useStudentProfileSummaryData = (studentId: string) => {\n const { get: getStudentProfileSummary, data: summaryData } =\n useStudentProfileSummaryGet(studentId);\n\n const { get: getMilestoneConfig, data: milestoneConfigData } = useGetMileStoneConfig(\n studentId,\n DEFAULT_DEMO_TYPE,\n );\n\n const fetchSummaryData = useCallback(() => {\n getStudentProfileSummary(studentId);\n getMilestoneConfig(studentId, DEFAULT_DEMO_TYPE);\n }, [getStudentProfileSummary, studentId, getMilestoneConfig]);\n\n useEffect(() => {\n fetchSummaryData();\n }, [fetchSummaryData]);\n\n const summaryInfo = useMemo(() => {\n return getLearningProfileSummary(milestoneConfigData, summaryData);\n }, [milestoneConfigData, summaryData]);\n\n const result = useMemo(\n () => ({ summaryInfo, fetchSummaryData }),\n [summaryInfo, fetchSummaryData],\n );\n\n return result;\n};\n\nexport default useStudentProfileSummaryData;\n"],"names":["DEFAULT_DEMO_TYPE","useStudentProfileSummaryData","studentId","getStudentProfileSummary","summaryData","useStudentProfileSummaryGet","getMilestoneConfig","milestoneConfigData","useGetMileStoneConfig","fetchSummaryData","useCallback","useEffect","summaryInfo","useMemo","getLearningProfileSummary"],"mappings":";;;;AAOA,MAAMA,IAAoB,EAAE,WAAW,cAEjCC,IAA+B,CAACC,MAAsB;AAC1D,QAAM,EAAE,KAAKC,GAA0B,MAAMC,MAC3CC,EAA4BH,CAAS,GAEjC,EAAE,KAAKI,GAAoB,MAAMC,EAAwB,IAAAC;AAAA,IAC7DN;AAAA,IACAF;AAAA,EAAA,GAGIS,IAAmBC,EAAY,MAAM;AACzC,IAAAP,EAAyBD,CAAS,GAClCI,EAAmBJ,GAAWF,CAAiB;AAAA,EAC9C,GAAA,CAACG,GAA0BD,GAAWI,CAAkB,CAAC;AAE5D,EAAAK,EAAU,MAAM;AACG,IAAAF;EAAA,GAChB,CAACA,CAAgB,CAAC;AAEf,QAAAG,IAAcC,EAAQ,MACnBC,EAA0BP,GAAqBH,CAAW,GAChE,CAACG,GAAqBH,CAAW,CAAC;AAO9B,SALQS;AAAA,IACb,OAAO,EAAE,aAAAD,GAAa,kBAAAH;IACtB,CAACG,GAAaH,CAAgB;AAAA,EAAA;AAIlC;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"school-goals-view.js","sources":["../../../../../src/features/trial-session/comps/school-goals/school-goals-view.tsx"],"sourcesContent":["import type { ChangeEvent } from 'react';\n\nimport * as Styled from './school-goals-styled';\nimport FlexView from '../../../ui/layout/flex-view';\nimport Image from '../../../ui/image/image';\nimport SearchableSelectInput from '../../../ui/inputs/searchable-select-input/searchable-select-input';\nimport SelectInput from '../../../ui/inputs/select-input/select-input';\nimport Separator from '../../../ui/separator/separator';\nimport SlideHeader from '../slide-header';\nimport TextInput from '../../../ui/inputs/text-input/text-input';\nimport type { IButtonState } from '../../trial-session-types';\nimport type { ISectionOption } from '../../../ui/section-list/section-list-types';\nimport type { ISelectOption } from '../../../ui/inputs/base-select-input/base-select-input-types';\nimport type { TCurriculumStandardOption } from '../../../milestone/create/milestone-create-types';\nimport { GIF } from '../../../../assets/gif/gif';\n\ninterface ISchoolGoals {\n header?: string;\n name?: string;\n grade?: string;\n curriculum?: string;\n grades: ISelectOption<string>[];\n demoType:
|
|
1
|
+
{"version":3,"file":"school-goals-view.js","sources":["../../../../../src/features/trial-session/comps/school-goals/school-goals-view.tsx"],"sourcesContent":["import type { ChangeEvent } from 'react';\n\nimport * as Styled from './school-goals-styled';\nimport FlexView from '../../../ui/layout/flex-view';\nimport Image from '../../../ui/image/image';\nimport SearchableSelectInput from '../../../ui/inputs/searchable-select-input/searchable-select-input';\nimport SelectInput from '../../../ui/inputs/select-input/select-input';\nimport Separator from '../../../ui/separator/separator';\nimport SlideHeader from '../slide-header';\nimport TextInput from '../../../ui/inputs/text-input/text-input';\nimport type { IButtonState } from '../../trial-session-types';\nimport type { ISectionOption } from '../../../ui/section-list/section-list-types';\nimport type { ISelectOption } from '../../../ui/inputs/base-select-input/base-select-input-types';\nimport type { TCurriculumStandardOption } from '../../../milestone/create/milestone-create-types';\nimport { GIF } from '../../../../assets/gif/gif';\nimport { type DemoType } from '../../trial-session-constants';\n\ninterface ISchoolGoals {\n header?: string;\n name?: string;\n grade?: string;\n curriculum?: string;\n grades: ISelectOption<string>[];\n demoType: DemoType;\n curriculumStandards: ISectionOption<TCurriculumStandardOption>[];\n goalsList: ISelectOption<string>[];\n selectedGoal?: string;\n numberInNameError?: boolean;\n buttonState: { left: IButtonState; right: IButtonState };\n onNameChange: (event: ChangeEvent<HTMLInputElement>) => void;\n onGradeChange: (value: string) => void;\n onCurriculumChange: (value: string) => void;\n onGoalChange: (value: string, option: ISelectOption<string | number>) => void;\n}\n\nconst SchoolGoalsView = (props: ISchoolGoals) => {\n const {\n name,\n grade,\n grades,\n demoType,\n goalsList,\n curriculum,\n buttonState,\n selectedGoal,\n numberInNameError,\n curriculumStandards,\n onNameChange,\n onGoalChange,\n onGradeChange,\n onCurriculumChange,\n } = props;\n\n const {\n right: { isLoading = false },\n } = buttonState || {};\n\n return (\n <Styled.Container>\n <Separator height={60} />\n <SlideHeader />\n <Styled.ContentWrapper $readOnly={isLoading} $flexDirection=\"row\" $justifyContent=\"center\">\n <Styled.ImageWrapper>\n <Image withLoader height={402} width={302} src={GIF.SCHOOL_SUCCESS} className=\"image\" />\n </Styled.ImageWrapper>\n <Styled.InputContainer\n $flexGap={24}\n $justifyContent=\"center\"\n $background=\"PURPLE_1\"\n $borderColor=\"BLACK_1\"\n $gapX={2.5}\n $gutterX={2.5}\n >\n <FlexView $flexDirection=\"row\" $flexColumnGapX={1.5}>\n {demoType === 'TRIAL_V3' ? (\n <TextInput\n renderAs=\"primary\"\n label=\"Name\"\n value={name}\n type=\"text\"\n name=\"name\"\n shape=\"borderLess\"\n onChange={onNameChange}\n width=\"100%\"\n isTransparent\n errorMessage={numberInNameError ? 'Please enter a valid name' : undefined}\n />\n ) : null}\n <SelectInput\n renderAs=\"primary\"\n label=\"Grade\"\n value={grade}\n options={grades}\n shape=\"borderLess\"\n onChange={onGradeChange}\n theme=\"dark\"\n widthX={10}\n isTransparent\n />\n </FlexView>\n <SelectInput\n renderAs=\"primary\"\n label=\"Curriculum\"\n value={curriculum}\n options={curriculumStandards}\n disabled={!grade}\n shape=\"borderLess\"\n renderOptionsAs=\"section-list\"\n theme=\"dark\"\n onChange={onCurriculumChange}\n isTransparent\n />\n <SearchableSelectInput\n renderAs=\"primary\"\n label=\"Goal\"\n value={selectedGoal}\n options={goalsList}\n shape=\"borderLess\"\n theme=\"dark\"\n onChange={onGoalChange}\n isTransparent\n disabled={!grade || !curriculum}\n />\n </Styled.InputContainer>\n </Styled.ContentWrapper>\n </Styled.Container>\n );\n};\n\nexport default SchoolGoalsView;\n"],"names":["SchoolGoalsView","props","name","grade","grades","demoType","goalsList","curriculum","buttonState","selectedGoal","numberInNameError","curriculumStandards","onNameChange","onGoalChange","onGradeChange","onCurriculumChange","isLoading","jsxs","Styled.Container","jsx","Separator","SlideHeader","Styled.ContentWrapper","Styled.ImageWrapper","Image","GIF","Styled.InputContainer","FlexView","TextInput","SelectInput","SearchableSelectInput"],"mappings":";;;;;;;;;;AAmCM,MAAAA,IAAkB,CAACC,MAAwB;AACzC,QAAA;AAAA,IACJ,MAAAC;AAAA,IACA,OAAAC;AAAA,IACA,QAAAC;AAAA,IACA,UAAAC;AAAA,IACA,WAAAC;AAAA,IACA,YAAAC;AAAA,IACA,aAAAC;AAAA,IACA,cAAAC;AAAA,IACA,mBAAAC;AAAA,IACA,qBAAAC;AAAA,IACA,cAAAC;AAAA,IACA,cAAAC;AAAA,IACA,eAAAC;AAAA,IACA,oBAAAC;AAAA,EACE,IAAAd,GAEE;AAAA,IACJ,OAAO,EAAE,WAAAe,IAAY,GAAM;AAAA,EAAA,IACzBR,KAAe,CAAA;AAGjB,SAAA,gBAAAS,EAACC,GAAA,EACC,UAAA;AAAA,IAAC,gBAAAC,EAAAC,GAAA,EAAU,QAAQ,GAAI,CAAA;AA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BAAgB;AAAA,gBAChB,OAAM;AAAA,gBACN,UAAUY;AAAA,gBACV,eAAa;AAAA,cAAA;AAAA,YACf;AAAA,YACA,gBAAAI;AAAA,cAACW;AAAA,cAAA;AAAA,gBACC,UAAS;AAAA,gBACT,OAAM;AAAA,gBACN,OAAOrB;AAAA,gBACP,SAASH;AAAA,gBACT,OAAM;AAAA,gBACN,OAAM;AAAA,gBACN,UAAUO;AAAA,gBACV,eAAa;AAAA,gBACb,UAAU,CAACV,KAAS,CAACI;AAAA,cAAA;AAAA,YACvB;AAAA,UAAA;AAAA,QAAA;AAAA,MACF;AAAA,IAAA,GACF;AAAA,EACF,EAAA,CAAA;AAEJ;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"session-overview-utils.js","sources":["../../../../../src/features/trial-session/comps/session-overview/session-overview-utils.tsx"],"sourcesContent":["import { GIF } from '../../../../assets/gif/gif';\nimport { TrialPageId } from '../../trial-session-constants';\n\ntype TSessionItem = {\n title: string;\n image: string;\n period?: string;\n archived?: boolean;\n};\n\nconst sessionOverview = [\n {\n title: 'Your goals',\n period: '10 min',\n image: GIF.YOUR_GOALS,\n },\n {\n title: 'learning session',\n period: '30 min',\n image: GIF.LEARNING_SESSION,\n },\n {\n title: 'way forward',\n period: '15 min',\n image: GIF.WAY_FORWARD,\n },\n];\n\nconst sessionOverviewV3 = [\n {\n title: 'Personalize \\nthe session',\n period: '5 min',\n image: GIF.YOUR_GOALS,\n },\n {\n title: 'Interactive \\nLearning',\n period: '40 min',\n image: GIF.LEARNING_SESSION,\n },\n {\n title: 'way \\nforward',\n period: '15 min',\n image: GIF.WAY_FORWARD,\n },\n];\n\nconst sessionSummary = [\n {\n title: 'Your goals',\n image: GIF.YOUR_GOALS,\n archived: true,\n },\n {\n title: 'learning session',\n image: GIF.LEARNING_SESSION,\n archived: true,\n },\n {\n title: 'way forward',\n image: GIF.WAY_FORWARD,\n archived: true,\n },\n];\n\nexport const getSessionConfig = (pageId: TrialPageId, demoType:
|
|
1
|
+
{"version":3,"file":"session-overview-utils.js","sources":["../../../../../src/features/trial-session/comps/session-overview/session-overview-utils.tsx"],"sourcesContent":["import { GIF } from '../../../../assets/gif/gif';\nimport { type DemoType, TrialPageId } from '../../trial-session-constants';\n\ntype TSessionItem = {\n title: string;\n image: string;\n period?: string;\n archived?: boolean;\n};\n\nconst sessionOverview = [\n {\n title: 'Your goals',\n period: '10 min',\n image: GIF.YOUR_GOALS,\n },\n {\n title: 'learning session',\n period: '30 min',\n image: GIF.LEARNING_SESSION,\n },\n {\n title: 'way forward',\n period: '15 min',\n image: GIF.WAY_FORWARD,\n },\n];\n\nconst sessionOverviewV3 = [\n {\n title: 'Personalize \\nthe session',\n period: '5 min',\n image: GIF.YOUR_GOALS,\n },\n {\n title: 'Interactive \\nLearning',\n period: '40 min',\n image: GIF.LEARNING_SESSION,\n },\n {\n title: 'way \\nforward',\n period: '15 min',\n image: GIF.WAY_FORWARD,\n },\n];\n\nconst sessionSummary = [\n {\n title: 'Your goals',\n image: GIF.YOUR_GOALS,\n archived: true,\n },\n {\n title: 'learning session',\n image: GIF.LEARNING_SESSION,\n archived: true,\n },\n {\n title: 'way forward',\n image: GIF.WAY_FORWARD,\n archived: true,\n },\n];\n\nexport const getSessionConfig = (pageId: TrialPageId, demoType: DemoType) => {\n if (!pageId) return;\n\n const sessions: Partial<Record<TrialPageId, TSessionItem[]>> = {\n [TrialPageId.SESSION_OVERVIEW]: demoType === 'TRIAL_V3' ? sessionOverview : sessionOverviewV3,\n [TrialPageId.SESSION_SUMMARY]: sessionSummary,\n };\n\n return sessions[pageId];\n};\n"],"names":["sessionOverview","GIF","sessionOverviewV3","sessionSummary","getSessionConfig","pageId","demoType","TrialPageId"],"mappings":";;AAUA,MAAMA,IAAkB;AAAA,EACtB;AAAA,IACE,OAAO;AAAA,IACP,QAAQ;AAAA,IACR,OAAOC,EAAI;AAAA,EACb;AAAA,EACA;AAAA,IACE,OAAO;AAAA,IACP,QAAQ;AAAA,IACR,OAAOA,EAAI;AAAA,EACb;AAAA,EACA;AAAA,IACE,OAAO;AAAA,IACP,QAAQ;AAAA,IACR,OAAOA,EAAI;AAAA,EACb;AACF,GAEMC,IAAoB;AAAA,EACxB;AAAA,IACE,OAAO;AAAA;AAAA,IACP,QAAQ;AAAA,IACR,OAAOD,EAAI;AAAA,EACb;AAAA,EACA;AAAA,IACE,OAAO;AAAA;AAAA,IACP,QAAQ;AAAA,IACR,OAAOA,EAAI;AAAA,EACb;AAAA,EACA;AAAA,IACE,OAAO;AAAA;AAAA,IACP,QAAQ;AAAA,IACR,OAAOA,EAAI;AAAA,EACb;AACF,GAEME,IAAiB;AAAA,EACrB;AAAA,IACE,OAAO;AAAA,IACP,OAAOF,EAAI;AAAA,IACX,UAAU;AAAA,EACZ;AAAA,EACA;AAAA,IACE,OAAO;AAAA,IACP,OAAOA,EAAI;AAAA,IACX,UAAU;AAAA,EACZ;AAAA,EACA;AAAA,IACE,OAAO;AAAA,IACP,OAAOA,EAAI;AAAA,IACX,UAAU;AAAA,EACZ;AACF,GAEaG,IAAmB,CAACC,GAAqBC,MAC/CD,IAE0D;AAAA,EAC7D,CAACE,EAAY,gBAAgB,GAAGD,MAAa,aAAaN,IAAkBE;AAAA,EAC5E,CAACK,EAAY,eAAe,GAAGJ;AAAA,EAGjBE,CAAM,IAPT;"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsxs as m, jsx as e } from "react/jsx-runtime";
|
|
2
|
-
import { memo as D, useMemo as B, useCallback as d, useEffect as
|
|
2
|
+
import { memo as D, useMemo as B, useCallback as d, useEffect as h } from "react";
|
|
3
3
|
import { getGradesFromConfig as E } from "../../../milestone/create/milestone-create-helpers.js";
|
|
4
4
|
import G from "../../../ui/image/image.js";
|
|
5
5
|
import C from "../../../ui/inputs/select-input/select-input.js";
|
|
@@ -17,33 +17,33 @@ const se = D(function() {
|
|
|
17
17
|
const {
|
|
18
18
|
formData: b,
|
|
19
19
|
milestoneConfig: I,
|
|
20
|
-
trialTopics:
|
|
20
|
+
trialTopics: i,
|
|
21
21
|
trialHomeData: T,
|
|
22
|
-
updateSlideConfig:
|
|
22
|
+
updateSlideConfig: o,
|
|
23
23
|
updateButtonState: u,
|
|
24
|
-
onRemoveOptionalSlides:
|
|
25
|
-
} = H(), { name: p, grade:
|
|
24
|
+
onRemoveOptionalSlides: a
|
|
25
|
+
} = H(), { name: p, grade: r, course: t, studentProfile: $, numberInNameError: x } = b || {}, { dummyProfileImageIndex: y } = $ || {}, { demo_info: _ } = T, { region_data: w } = _, { opportunity_country: c = "US" } = w || {}, S = E(I), L = F(y), s = M(Number(r)), g = !!(p && r && (!(s.length > 0) || t)), f = B(() => i ? q(i, { countryCode: c, grade: r, course: t }) : [], [c, t, r, i]), v = d(
|
|
26
26
|
(n) => {
|
|
27
|
-
|
|
27
|
+
o({
|
|
28
28
|
name: n.target.value,
|
|
29
29
|
numberInNameError: !1
|
|
30
30
|
});
|
|
31
31
|
},
|
|
32
|
-
[
|
|
32
|
+
[o]
|
|
33
33
|
), A = d(
|
|
34
34
|
(n) => {
|
|
35
|
-
|
|
35
|
+
o({ grade: n, course: "" });
|
|
36
36
|
},
|
|
37
|
-
[
|
|
37
|
+
[o]
|
|
38
38
|
), N = d(
|
|
39
39
|
(n) => {
|
|
40
|
-
|
|
40
|
+
o({ course: n });
|
|
41
41
|
},
|
|
42
|
-
[
|
|
42
|
+
[o]
|
|
43
43
|
);
|
|
44
|
-
return
|
|
45
|
-
|
|
46
|
-
}, [
|
|
44
|
+
return h(() => {
|
|
45
|
+
r && t && (a == null || a(void 0, void 0, f.length === 0));
|
|
46
|
+
}, [f.length, r, t, a]), h(() => {
|
|
47
47
|
u("right", { isDisabled: !g, isLoading: !1 });
|
|
48
48
|
}, [g, u]), /* @__PURE__ */ m(l, { $justifyContent: "center", $alignItems: "center", children: [
|
|
49
49
|
/* @__PURE__ */ e(k, { height: 60 }),
|
|
@@ -87,7 +87,7 @@ const se = D(function() {
|
|
|
87
87
|
{
|
|
88
88
|
renderAs: "primary",
|
|
89
89
|
label: "Grade",
|
|
90
|
-
value:
|
|
90
|
+
value: r,
|
|
91
91
|
options: S,
|
|
92
92
|
shape: "borderLess",
|
|
93
93
|
onChange: A,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"student-info.js","sources":["../../../../../src/features/trial-session/comps/student-info/student-info.tsx"],"sourcesContent":["import { memo, useCallback, useEffect, useMemo, type InputHTMLAttributes } from 'react';\n\nimport { getGradesFromConfig } from '../../../milestone/create/milestone-create-helpers';\nimport Image from '../../../ui/image/image';\nimport SelectInput from '../../../ui/inputs/select-input/select-input';\nimport TextInput from '../../../ui/inputs/text-input/text-input';\nimport Separator from '../../../ui/separator/separator';\nimport { useTrialSessionContext } from '../../context/use-trial-session-context';\nimport SlideHeader from '../slide-header';\nimport * as Styled from './student-info-styled';\nimport FlexView from '../../../ui/layout/flex-view';\nimport { getDummyProfileImage } from '../student-profile/student-profile-utils';\nimport { RIGHT_PANEL_CONTENT_WIDTH } from '../../trial-session-constants';\nimport { getCourseOptions } from './student-info-helpers';\nimport { getTopicsToShow } from '../topic-selection/topic-selection-helpers';\n\nconst StudentInformation = memo(function StudentInformation() {\n const {\n formData,\n milestoneConfig,\n trialTopics,\n trialHomeData,\n updateSlideConfig,\n updateButtonState,\n onRemoveOptionalSlides,\n } = useTrialSessionContext();\n\n const { name, grade, course, studentProfile, numberInNameError } = formData || {};\n const { dummyProfileImageIndex } = studentProfile || {};\n const { demo_info: demoInfo } = trialHomeData;\n const { region_data: regionData } = demoInfo;\n const { opportunity_country: countryCode = 'US' } = regionData || {};\n\n const grades = getGradesFromConfig(milestoneConfig);\n const dummyProfileImage = getDummyProfileImage(dummyProfileImageIndex);\n const courses = getCourseOptions(Number(grade));\n const hasRequiredFields = Boolean(name && grade && (courses.length > 0 ? course : true));\n\n const topicsToShow = useMemo(() => {\n if (!trialTopics) return [];\n\n return getTopicsToShow(trialTopics, { countryCode, grade, course });\n }, [countryCode, course, grade, trialTopics]);\n\n const handleNameChange = useCallback<\n NonNullable<InputHTMLAttributes<HTMLInputElement>['onChange']>\n >(\n event => {\n updateSlideConfig({\n name: event.target.value,\n numberInNameError: false,\n });\n },\n [updateSlideConfig],\n );\n\n const handleGradeChange = useCallback(\n (value: string) => {\n updateSlideConfig({ grade: value, course: '' });\n },\n [updateSlideConfig],\n );\n\n const handleCourseChange = useCallback(\n (value: string) => {\n updateSlideConfig({ course: value });\n },\n [updateSlideConfig],\n );\n\n useEffect(() => {\n onRemoveOptionalSlides?.(undefined, undefined, topicsToShow.length === 0);\n
|
|
1
|
+
{"version":3,"file":"student-info.js","sources":["../../../../../src/features/trial-session/comps/student-info/student-info.tsx"],"sourcesContent":["import { memo, useCallback, useEffect, useMemo, type InputHTMLAttributes } from 'react';\n\nimport { getGradesFromConfig } from '../../../milestone/create/milestone-create-helpers';\nimport Image from '../../../ui/image/image';\nimport SelectInput from '../../../ui/inputs/select-input/select-input';\nimport TextInput from '../../../ui/inputs/text-input/text-input';\nimport Separator from '../../../ui/separator/separator';\nimport { useTrialSessionContext } from '../../context/use-trial-session-context';\nimport SlideHeader from '../slide-header';\nimport * as Styled from './student-info-styled';\nimport FlexView from '../../../ui/layout/flex-view';\nimport { getDummyProfileImage } from '../student-profile/student-profile-utils';\nimport { RIGHT_PANEL_CONTENT_WIDTH } from '../../trial-session-constants';\nimport { getCourseOptions } from './student-info-helpers';\nimport { getTopicsToShow } from '../topic-selection/topic-selection-helpers';\n\nconst StudentInformation = memo(function StudentInformation() {\n const {\n formData,\n milestoneConfig,\n trialTopics,\n trialHomeData,\n updateSlideConfig,\n updateButtonState,\n onRemoveOptionalSlides,\n } = useTrialSessionContext();\n\n const { name, grade, course, studentProfile, numberInNameError } = formData || {};\n const { dummyProfileImageIndex } = studentProfile || {};\n const { demo_info: demoInfo } = trialHomeData;\n const { region_data: regionData } = demoInfo;\n const { opportunity_country: countryCode = 'US' } = regionData || {};\n\n const grades = getGradesFromConfig(milestoneConfig);\n const dummyProfileImage = getDummyProfileImage(dummyProfileImageIndex);\n const courses = getCourseOptions(Number(grade));\n const hasRequiredFields = Boolean(name && grade && (courses.length > 0 ? course : true));\n\n const topicsToShow = useMemo(() => {\n if (!trialTopics) return [];\n\n return getTopicsToShow(trialTopics, { countryCode, grade, course });\n }, [countryCode, course, grade, trialTopics]);\n\n const handleNameChange = useCallback<\n NonNullable<InputHTMLAttributes<HTMLInputElement>['onChange']>\n >(\n event => {\n updateSlideConfig({\n name: event.target.value,\n numberInNameError: false,\n });\n },\n [updateSlideConfig],\n );\n\n const handleGradeChange = useCallback(\n (value: string) => {\n updateSlideConfig({ grade: value, course: '' });\n },\n [updateSlideConfig],\n );\n\n const handleCourseChange = useCallback(\n (value: string) => {\n updateSlideConfig({ course: value });\n },\n [updateSlideConfig],\n );\n\n useEffect(() => {\n if (grade && course) {\n onRemoveOptionalSlides?.(undefined, undefined, topicsToShow.length === 0);\n }\n }, [topicsToShow.length, grade, course, onRemoveOptionalSlides]);\n\n useEffect(() => {\n updateButtonState('right', { isDisabled: !hasRequiredFields, isLoading: false });\n }, [hasRequiredFields, updateButtonState]);\n\n return (\n <FlexView $justifyContent=\"center\" $alignItems=\"center\">\n <Separator height={60} />\n <SlideHeader marginBottom={100} />\n <FlexView\n $position=\"relative\"\n $width={RIGHT_PANEL_CONTENT_WIDTH - 100}\n $flexDirection=\"row\"\n $alignItems=\"center\"\n $flexGapX={2}\n $gutterX={1.5}\n $gapX={3.125}\n $background=\"WHITE_2\"\n $borderColor=\"BLACK_T_87\"\n $borderRadiusX={0.5}\n >\n <Styled.AbsoluteImage />\n <Image withLoader height={200} width={200} src={dummyProfileImage} borderColor=\"BLACK_1\" />\n\n <FlexView $flexGap={16}>\n <TextInput\n renderAs=\"primary\"\n label=\"Name\"\n placeholder=\"Student name\"\n value={name}\n type=\"text\"\n name=\"name\"\n shape=\"borderLess\"\n onChange={handleNameChange}\n width=\"216px\"\n isTransparent\n stickyLabel\n errorMessage={numberInNameError ? 'Please enter a valid name' : undefined}\n />\n <SelectInput\n renderAs=\"primary\"\n label=\"Grade\"\n value={grade}\n options={grades}\n shape=\"borderLess\"\n onChange={handleGradeChange}\n theme=\"dark\"\n widthX={10}\n isTransparent\n />\n {courses.length > 0 ? (\n <SelectInput\n width=\"216px\"\n renderAs=\"primary\"\n label=\"Course\"\n value={course}\n options={courses}\n shape=\"borderLess\"\n onChange={handleCourseChange}\n theme=\"dark\"\n isTransparent\n />\n ) : null}\n </FlexView>\n\n <Styled.MetaTextWrapper\n $renderAs=\"ub3-bold\"\n color=\"BLACK_T_60\"\n $align=\"right\"\n $width=\"100%\"\n >\n We’ll solve questions from the selected grade\n </Styled.MetaTextWrapper>\n </FlexView>\n </FlexView>\n );\n});\n\nexport default StudentInformation;\n"],"names":["StudentInformation","memo","formData","milestoneConfig","trialTopics","trialHomeData","updateSlideConfig","updateButtonState","onRemoveOptionalSlides","useTrialSessionContext","name","grade","course","studentProfile","numberInNameError","dummyProfileImageIndex","demoInfo","regionData","countryCode","grades","getGradesFromConfig","dummyProfileImage","getDummyProfileImage","courses","getCourseOptions","hasRequiredFields","topicsToShow","useMemo","getTopicsToShow","handleNameChange","useCallback","event","handleGradeChange","value","handleCourseChange","useEffect","jsxs","FlexView","jsx","Separator","SlideHeader","RIGHT_PANEL_CONTENT_WIDTH","Styled.AbsoluteImage","Image","TextInput","SelectInput","Styled.MetaTextWrapper"],"mappings":";;;;;;;;;;;;;;;AAgBM,MAAAA,KAAqBC,EAAK,WAA8B;AACtD,QAAA;AAAA,IACJ,UAAAC;AAAA,IACA,iBAAAC;AAAA,IACA,aAAAC;AAAA,IACA,eAAAC;AAAA,IACA,mBAAAC;AAAA,IACA,mBAAAC;AAAA,IACA,wBAAAC;AAAA,MACEC,EAAuB,GAErB,EAAE,MAAAC,GAAM,OAAAC,GAAO,QAAAC,GAAQ,gBAAAC,GAAgB,mBAAAC,EAAkB,IAAIZ,KAAY,IACzE,EAAE,wBAAAa,EAAA,IAA2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AA,cAACO;AAAA,cAAA;AAAA,gBACC,OAAM;AAAA,gBACN,UAAS;AAAA,gBACT,OAAM;AAAA,gBACN,OAAOjC;AAAA,gBACP,SAASW;AAAA,gBACT,OAAM;AAAA,gBACN,UAAUW;AAAA,gBACV,OAAM;AAAA,gBACN,eAAa;AAAA,cAAA;AAAA,YAAA,IAEb;AAAA,UAAA,GACN;AAAA,UAEA,gBAAAI;AAAA,YAACQ;AAAAA,YAAA;AAAA,cACC,WAAU;AAAA,cACV,OAAM;AAAA,cACN,QAAO;AAAA,cACP,QAAO;AAAA,cACR,UAAA;AAAA,YAAA;AAAA,UAED;AAAA,QAAA;AAAA,MAAA;AAAA,IACF;AAAA,EACF,EAAA,CAAA;AAEJ,CAAC;"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { jsxs as l, jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import { memo as m, useCallback as p } from "react";
|
|
3
|
+
import { TopicWrapper as a, CheckIcon as s } from "./topic-selection-styled.js";
|
|
4
|
+
import d from "../../../ui/image/image.js";
|
|
5
|
+
import h from "../../../ui/text/text.js";
|
|
6
|
+
import { MAXIMUM_TOPICS_TO_SELECT as _ } from "../../trial-session-constants.js";
|
|
7
|
+
const T = m((r) => {
|
|
8
|
+
const { topic: e, selectedTopics: i, onClick: c } = r, t = i.includes(e.topic_name), n = p(() => {
|
|
9
|
+
c(e.topic_name);
|
|
10
|
+
}, [c, e.topic_name]);
|
|
11
|
+
return /* @__PURE__ */ l(
|
|
12
|
+
a,
|
|
13
|
+
{
|
|
14
|
+
$width: 200,
|
|
15
|
+
$height: 200,
|
|
16
|
+
$flexDirection: "column",
|
|
17
|
+
$alignItems: "center",
|
|
18
|
+
$justifyContent: "center",
|
|
19
|
+
$borderColor: t ? "BLACK" : "BLACK_T_38",
|
|
20
|
+
$background: t ? "WHITE_4" : "WHITE",
|
|
21
|
+
$flexGap: 2,
|
|
22
|
+
$position: "relative",
|
|
23
|
+
$selected: t,
|
|
24
|
+
$preventSelection: !t && i.length >= _,
|
|
25
|
+
onClick: n,
|
|
26
|
+
children: [
|
|
27
|
+
t ? /* @__PURE__ */ o(s, { color: "WHITE", height: 20, width: 20 }) : null,
|
|
28
|
+
/* @__PURE__ */ o(d, { width: 88, height: 88, src: e.topic_image_url, alt: e.topic_name }),
|
|
29
|
+
/* @__PURE__ */ o(h, { $renderAs: "ab2", children: e.topic_name })
|
|
30
|
+
]
|
|
31
|
+
},
|
|
32
|
+
e.topic_name
|
|
33
|
+
);
|
|
34
|
+
});
|
|
35
|
+
T.displayName = "TopicItem";
|
|
36
|
+
export {
|
|
37
|
+
T as default
|
|
38
|
+
};
|
|
39
|
+
//# sourceMappingURL=topic-item.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"topic-item.js","sources":["../../../../../src/features/trial-session/comps/topic-selection/topic-item.tsx"],"sourcesContent":["import { type FC, memo, useCallback } from 'react';\n\nimport * as Styled from './topic-selection-styled';\nimport Image from '../../../ui/image/image';\nimport Text from '../../../ui/text/text';\nimport { MAXIMUM_TOPICS_TO_SELECT } from '../../trial-session-constants';\nimport { type ITopicItemProps } from './topic-selection-types';\n\nconst TopicItem: FC<ITopicItemProps> = memo(props => {\n const { topic, selectedTopics, onClick } = props;\n const isSelected = selectedTopics.includes(topic.topic_name);\n\n const handleClick = useCallback(() => {\n onClick(topic.topic_name);\n }, [onClick, 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}\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\nTopicItem.displayName = 'TopicItem';\n\nexport default TopicItem;\n"],"names":["TopicItem","memo","props","topic","selectedTopics","onClick","isSelected","handleClick","useCallback","jsxs","Styled.TopicWrapper","MAXIMUM_TOPICS_TO_SELECT","jsx","Styled.CheckIcon","Image","Text"],"mappings":";;;;;;AAQM,MAAAA,IAAiCC,EAAK,CAASC,MAAA;AACnD,QAAM,EAAE,OAAAC,GAAO,gBAAAC,GAAgB,SAAAC,EAAA,IAAYH,GACrCI,IAAaF,EAAe,SAASD,EAAM,UAAU,GAErDI,IAAcC,EAAY,MAAM;AACpC,IAAAH,EAAQF,EAAM,UAAU;AAAA,EACvB,GAAA,CAACE,GAASF,EAAM,UAAU,CAAC;AAG5B,SAAA,gBAAAM;AAAA,IAACC;AAAAA,IAAA;AAAA,MAEC,QAAQ;AAAA,MACR,SAAS;AAAA,MACT,gBAAe;AAAA,MACf,aAAY;AAAA,MACZ,iBAAgB;AAAA,MAChB,cAAcJ,IAAa,UAAU;AAAA,MACrC,aAAaA,IAAa,YAAY;AAAA,MACtC,UAAU;AAAA,MACV,WAAU;AAAA,MACV,WAAWA;AAAA,MACX,mBAAmB,CAACA,KAAcF,EAAe,UAAUO;AAAA,MAC3D,SAASJ;AAAA,MAER,UAAA;AAAA,QAAaD,IAAA,gBAAAM,EAACC,GAAA,EAAiB,OAAM,SAAQ,QAAQ,IAAI,OAAO,GAAA,CAAI,IAAK;AAAA,QAC1E,gBAAAD,EAACE,GAAM,EAAA,OAAO,IAAI,QAAQ,IAAI,KAAKX,EAAM,iBAAiB,KAAKA,EAAM,WAAY,CAAA;AAAA,QAChF,gBAAAS,EAAAG,GAAA,EAAK,WAAU,OAAO,YAAM,YAAW;AAAA,MAAA;AAAA,IAAA;AAAA,IAhBnCZ,EAAM;AAAA,EAAA;AAmBjB,CAAC;AAEDH,EAAU,cAAc;"}
|
|
@@ -1,67 +1,48 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { memo as
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import { MAXIMUM_TOPICS_TO_SELECT as
|
|
7
|
-
import {
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
const o = t.includes(e), C = o ? t.filter((S) => S !== e) : [...t, e];
|
|
16
|
-
!o && t.length >= n || c({ selectedTopics: C });
|
|
1
|
+
import { jsxs as I, jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import { memo as x, useMemo as y, useCallback as $, useEffect as D } from "react";
|
|
3
|
+
import d from "../../../ui/layout/flex-view.js";
|
|
4
|
+
import w from "../../../ui/separator/separator.js";
|
|
5
|
+
import E from "../slide-header/index.js";
|
|
6
|
+
import { MAXIMUM_TOPICS_TO_SELECT as p, RIGHT_PANEL_CONTENT_WIDTH as j } from "../../trial-session-constants.js";
|
|
7
|
+
import { useTrialSessionContext as H } from "../../context/use-trial-session-context.js";
|
|
8
|
+
import { getTopicsToShow as M } from "./topic-selection-helpers.js";
|
|
9
|
+
import N from "./topic-item.js";
|
|
10
|
+
const k = x(() => {
|
|
11
|
+
const { formData: f, trialHomeData: u, trialTopics: r, updateSlideConfig: i, updateButtonState: n } = H(), { grade: s, course: c, selectedTopics: e = [] } = f || {}, { demo_info: T } = u, { region_data: S } = T, { opportunity_country: a = "US" } = S || {}, l = e.length === p, g = y(() => r ? M(r, { countryCode: a, grade: s, course: c }) : [], [a, c, s, r]), h = $(
|
|
12
|
+
(o) => {
|
|
13
|
+
const m = e.includes(o), C = m ? e.filter((_) => _ !== o) : [...e, o];
|
|
14
|
+
!m && e.length >= p || i({ selectedTopics: C });
|
|
17
15
|
},
|
|
18
|
-
[
|
|
16
|
+
[e, i]
|
|
19
17
|
);
|
|
20
|
-
return
|
|
21
|
-
|
|
22
|
-
}, [
|
|
23
|
-
/* @__PURE__ */
|
|
24
|
-
/* @__PURE__ */
|
|
25
|
-
/* @__PURE__ */
|
|
26
|
-
|
|
18
|
+
return D(() => {
|
|
19
|
+
n("right", { isDisabled: !l, isLoading: !1 });
|
|
20
|
+
}, [l, n]), /* @__PURE__ */ I(d, { $justifyContent: "center", $alignItems: "center", children: [
|
|
21
|
+
/* @__PURE__ */ t(w, { height: 60 }),
|
|
22
|
+
/* @__PURE__ */ t(E, {}),
|
|
23
|
+
/* @__PURE__ */ t(
|
|
24
|
+
d,
|
|
27
25
|
{
|
|
28
|
-
$width:
|
|
26
|
+
$width: j - 100,
|
|
29
27
|
$justifyContent: "center",
|
|
30
28
|
$alignItems: "center",
|
|
31
29
|
$flexDirection: "row",
|
|
32
30
|
$flexWrap: !0,
|
|
33
|
-
children:
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
$justifyContent: "center",
|
|
43
|
-
$borderColor: o ? "BLACK" : "BLACK_T_38",
|
|
44
|
-
$background: o ? "WHITE_4" : "WHITE",
|
|
45
|
-
$flexGap: 2,
|
|
46
|
-
$position: "relative",
|
|
47
|
-
$selected: o,
|
|
48
|
-
$preventSelection: !o && t.length >= n,
|
|
49
|
-
onClick: () => $(e.topic_name),
|
|
50
|
-
children: [
|
|
51
|
-
o ? /* @__PURE__ */ r(W, { color: "WHITE", height: 20, width: 20 }) : null,
|
|
52
|
-
/* @__PURE__ */ r(b, { width: 88, height: 88, src: e.topic_image_url, alt: e.topic_name }),
|
|
53
|
-
/* @__PURE__ */ r(j, { $renderAs: "ab2", children: e.topic_name })
|
|
54
|
-
]
|
|
55
|
-
},
|
|
56
|
-
e.topic_name
|
|
57
|
-
);
|
|
58
|
-
})
|
|
31
|
+
children: g.map((o) => /* @__PURE__ */ t(
|
|
32
|
+
N,
|
|
33
|
+
{
|
|
34
|
+
selectedTopics: e,
|
|
35
|
+
topic: o,
|
|
36
|
+
onClick: h
|
|
37
|
+
},
|
|
38
|
+
o.topic_name
|
|
39
|
+
))
|
|
59
40
|
}
|
|
60
41
|
)
|
|
61
42
|
] });
|
|
62
43
|
});
|
|
63
|
-
|
|
44
|
+
k.displayName = "TopicSelection";
|
|
64
45
|
export {
|
|
65
|
-
|
|
46
|
+
k as default
|
|
66
47
|
};
|
|
67
48
|
//# sourceMappingURL=topic-selection.js.map
|
|
@@ -1 +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
|
|
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 { useTrialSessionContext } from '../../context/use-trial-session-context';\nimport { getTopicsToShow } from './topic-selection-helpers';\nimport TopicItem from './topic-item';\n\nconst TopicSelection = memo(() => {\n const { formData, trialHomeData, trialTopics, updateSlideConfig, updateButtonState } =\n useTrialSessionContext();\n const { grade, 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 hasRequiredFields = Boolean(selectedTopics.length === MAXIMUM_TOPICS_TO_SELECT);\n\n const topicsToShow = useMemo(() => {\n if (!trialTopics) return [];\n\n return getTopicsToShow(trialTopics, { countryCode, grade, course });\n }, [countryCode, course, grade, trialTopics]);\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 updateButtonState('right', { isDisabled: !hasRequiredFields, isLoading: false });\n }, [hasRequiredFields, updateButtonState]);\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 <TopicItem\n key={topic.topic_name}\n selectedTopics={selectedTopics}\n topic={topic}\n onClick={handleClick}\n />\n ))}\n </FlexView>\n </FlexView>\n );\n});\n\nTopicSelection.displayName = 'TopicSelection';\n\nexport default TopicSelection;\n"],"names":["TopicSelection","memo","formData","trialHomeData","trialTopics","updateSlideConfig","updateButtonState","useTrialSessionContext","grade","course","selectedTopics","demoInfo","regionData","countryCode","hasRequiredFields","MAXIMUM_TOPICS_TO_SELECT","topicsToShow","useMemo","getTopicsToShow","handleClick","useCallback","topicTitle","isAlreadySelected","updatedTopics","topic","useEffect","jsxs","FlexView","jsx","Separator","SlideHeader","RIGHT_PANEL_CONTENT_WIDTH","TopicItem"],"mappings":";;;;;;;;;AAUM,MAAAA,IAAiBC,EAAK,MAAM;AAChC,QAAM,EAAE,UAAAC,GAAU,eAAAC,GAAe,aAAAC,GAAa,mBAAAC,GAAmB,mBAAAC,EAAA,IAC/DC,KACI,EAAE,OAAAC,GAAO,QAA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AAA,YACA,SAASL;AAAA,UAAA;AAAA,UAHJK,EAAM;AAAA,QAAA,CAKd;AAAA,MAAA;AAAA,IACH;AAAA,EACF,EAAA,CAAA;AAEJ,CAAC;AAEDxB,EAAe,cAAc;"}
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { createContext as e } from "react";
|
|
2
|
-
import {
|
|
3
|
-
const
|
|
2
|
+
import { DemoType as t, DEFAULT_BUTTON_STATE as o } from "../trial-session-constants.js";
|
|
3
|
+
const i = e({
|
|
4
4
|
isTeacher: !1,
|
|
5
5
|
slideConfig: {},
|
|
6
6
|
formData: void 0,
|
|
7
|
-
demoType:
|
|
7
|
+
demoType: t.TRIAL_V3,
|
|
8
8
|
teacherClassroomId: "",
|
|
9
9
|
milestoneConfig: {},
|
|
10
10
|
updateSlideConfig: () => {
|
|
11
11
|
},
|
|
12
|
-
buttonState:
|
|
12
|
+
buttonState: o,
|
|
13
13
|
updateButtonState: () => {
|
|
14
14
|
},
|
|
15
15
|
teacherId: "",
|
|
@@ -26,6 +26,6 @@ const s = e({
|
|
|
26
26
|
classDuration: 0
|
|
27
27
|
});
|
|
28
28
|
export {
|
|
29
|
-
|
|
29
|
+
i as default
|
|
30
30
|
};
|
|
31
31
|
//# sourceMappingURL=trial-session-context.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"trial-session-context.js","sources":["../../../../src/features/trial-session/context/trial-session-context.tsx"],"sourcesContent":["import { createContext } from 'react';\n\nimport type { IMilestoneConfig } from '../../milestone/create/milestone-create-types';\nimport type { ITrialCircleGameParams } from '../comps/trial-circle-game/trial-circle-game-types';\nimport { DEFAULT_BUTTON_STATE } from '../trial-session-constants';\nimport type {\n IClassTimeAlertConfig,\n ISlide,\n ITrialHomeData,\n ITrialSessionContext,\n} from '../trial-session-types';\n\nconst TrialSessionContext = createContext<ITrialSessionContext>({\n isTeacher: false,\n slideConfig: {} as ISlide,\n formData: undefined,\n demoType:
|
|
1
|
+
{"version":3,"file":"trial-session-context.js","sources":["../../../../src/features/trial-session/context/trial-session-context.tsx"],"sourcesContent":["import { createContext } from 'react';\n\nimport type { IMilestoneConfig } from '../../milestone/create/milestone-create-types';\nimport type { ITrialCircleGameParams } from '../comps/trial-circle-game/trial-circle-game-types';\nimport { DEFAULT_BUTTON_STATE, DemoType } from '../trial-session-constants';\nimport type {\n IClassTimeAlertConfig,\n ISlide,\n ITrialHomeData,\n ITrialSessionContext,\n} from '../trial-session-types';\n\nconst TrialSessionContext = createContext<ITrialSessionContext>({\n isTeacher: false,\n slideConfig: {} as ISlide,\n formData: undefined,\n demoType: DemoType.TRIAL_V3,\n teacherClassroomId: '',\n milestoneConfig: {} as IMilestoneConfig,\n updateSlideConfig: () => undefined,\n buttonState: DEFAULT_BUTTON_STATE,\n updateButtonState: () => undefined,\n teacherId: '',\n studentId: '',\n trialHomeData: {} as ITrialHomeData,\n openEndClassModal: () => undefined,\n studentAbsentInClass: false,\n circleGames: {} as ITrialCircleGameParams,\n trialGameUrl: '',\n handleInfoMessage: () => undefined,\n classTimeAlertConfig: {} as IClassTimeAlertConfig,\n classDuration: 0,\n});\n\nexport default TrialSessionContext;\n"],"names":["TrialSessionContext","createContext","DemoType","DEFAULT_BUTTON_STATE"],"mappings":";;AAYA,MAAMA,IAAsBC,EAAoC;AAAA,EAC9D,WAAW;AAAA,EACX,aAAa,CAAC;AAAA,EACd,UAAU;AAAA,EACV,UAAUC,EAAS;AAAA,EACnB,oBAAoB;AAAA,EACpB,iBAAiB,CAAC;AAAA,EAClB,mBAAmB,MAAM;AAAA;AAAA,EACzB,aAAaC;AAAA,EACb,mBAAmB,MAAM;AAAA;AAAA,EACzB,WAAW;AAAA,EACX,WAAW;AAAA,EACX,eAAe,CAAC;AAAA,EAChB,mBAAmB,MAAM;AAAA;AAAA,EACzB,sBAAsB;AAAA,EACtB,aAAa,CAAC;AAAA,EACd,cAAc;AAAA,EACd,mBAAmB,MAAM;AAAA;AAAA,EACzB,sBAAsB,CAAC;AAAA,EACvB,eAAe;AACjB,CAAC;"}
|