@cuemath/leap 3.3.31 → 3.3.32-j2
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/auth/pla-signup/pla-analytics-events.js +7 -1
- package/dist/features/auth/pla-signup/pla-analytics-events.js.map +1 -1
- package/dist/features/auth/signup/circular-step-wrapper/circular-step-wrapper.js.map +1 -1
- package/dist/features/auth/signup/custom-input-field/custom-input-field.js +8 -8
- package/dist/features/auth/signup/custom-input-field/custom-input-field.js.map +1 -1
- package/dist/features/milestone/create/milestone-create-helpers.js +13 -7
- package/dist/features/milestone/create/milestone-create-helpers.js.map +1 -1
- package/dist/features/student-username/add/add-student-username-constants.js +6 -0
- package/dist/features/student-username/add/add-student-username-constants.js.map +1 -0
- package/dist/features/student-username/add/add-student-username-helpers.js +6 -0
- package/dist/features/student-username/add/add-student-username-helpers.js.map +1 -0
- package/dist/features/student-username/add/add-student-username-styled.js +10 -0
- package/dist/features/student-username/add/add-student-username-styled.js.map +1 -0
- package/dist/features/student-username/add/add-student-username.js +78 -0
- package/dist/features/student-username/add/add-student-username.js.map +1 -0
- package/dist/features/student-username/add/api/update-username.js +9 -0
- package/dist/features/student-username/add/api/update-username.js.map +1 -0
- package/dist/features/student-username/add/api/username-availability.js +10 -0
- package/dist/features/student-username/add/api/username-availability.js.map +1 -0
- package/dist/features/student-username/add/hooks/use-check-username-availability.js +41 -0
- package/dist/features/student-username/add/hooks/use-check-username-availability.js.map +1 -0
- package/dist/features/trial-session/api/teacher-availability.js +9 -0
- package/dist/features/trial-session/api/teacher-availability.js.map +1 -0
- package/dist/features/trial-session/comps/class-preference/class-preference.js +61 -49
- package/dist/features/trial-session/comps/class-preference/class-preference.js.map +1 -1
- package/dist/features/trial-session/comps/class-preference/helpers.js +28 -0
- package/dist/features/trial-session/comps/class-preference/helpers.js.map +1 -0
- package/dist/features/trial-session/comps/navigation-bar/index.js +25 -25
- package/dist/features/trial-session/comps/navigation-bar/index.js.map +1 -1
- package/dist/features/trial-session/comps/school-goals/school-goals.js +55 -53
- package/dist/features/trial-session/comps/school-goals/school-goals.js.map +1 -1
- package/dist/features/trial-session/comps/session-report/session-report.js +15 -15
- package/dist/features/trial-session/comps/session-report/session-report.js.map +1 -1
- package/dist/features/trial-session/comps/student-enrichment/student-enrichment.js +44 -43
- package/dist/features/trial-session/comps/student-enrichment/student-enrichment.js.map +1 -1
- package/dist/features/trial-session/comps/student-feedback/student-feedback-constants.js +5 -0
- package/dist/features/trial-session/comps/student-feedback/student-feedback-constants.js.map +1 -1
- package/dist/features/trial-session/comps/student-feedback/student-feedback.js +96 -51
- package/dist/features/trial-session/comps/student-feedback/student-feedback.js.map +1 -1
- package/dist/features/trial-session/comps/student-profile/student-profile.js +70 -63
- package/dist/features/trial-session/comps/student-profile/student-profile.js.map +1 -1
- package/dist/features/trial-session/comps/test-prep/test-prep.js +40 -39
- package/dist/features/trial-session/comps/test-prep/test-prep.js.map +1 -1
- package/dist/features/trial-session/helper.js +69 -53
- package/dist/features/trial-session/helper.js.map +1 -1
- package/dist/features/trial-session/hooks/use-slide-config-update.js +49 -0
- package/dist/features/trial-session/hooks/use-slide-config-update.js.map +1 -0
- package/dist/features/trial-session/hooks/use-trial-session-navigation.js +150 -130
- package/dist/features/trial-session/hooks/use-trial-session-navigation.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 +103 -112
- package/dist/features/trial-session/trial-session-view.js.map +1 -1
- package/dist/features/ui/accordion/accordion-items/accordion-items.js +13 -13
- package/dist/features/ui/accordion/accordion-items/accordion-items.js.map +1 -1
- package/dist/features/utils/utils.js +1 -1
- package/dist/features/utils/utils.js.map +1 -1
- package/dist/index.d.ts +20 -4
- package/dist/index.js +32 -30
- package/dist/index.js.map +1 -1
- package/dist/node_modules/decode-uri-component/index.js.map +1 -0
- package/dist/node_modules/query-string/base.js +1 -1
- package/dist/node_modules/uuid/dist/esm-browser/native.js +7 -0
- package/dist/node_modules/uuid/dist/esm-browser/native.js.map +1 -0
- package/dist/node_modules/uuid/dist/esm-browser/rng.js +3 -2
- package/dist/node_modules/uuid/dist/esm-browser/rng.js.map +1 -1
- package/dist/node_modules/uuid/dist/esm-browser/stringify.js +6 -10
- package/dist/node_modules/uuid/dist/esm-browser/stringify.js.map +1 -1
- package/dist/node_modules/uuid/dist/esm-browser/v4.js +12 -9
- package/dist/node_modules/uuid/dist/esm-browser/v4.js.map +1 -1
- package/package.json +3 -2
- package/dist/node_modules/query-string/node_modules/decode-uri-component/index.js.map +0 -1
- package/dist/node_modules/uuid/dist/esm-browser/regex.js +0 -5
- package/dist/node_modules/uuid/dist/esm-browser/regex.js.map +0 -1
- package/dist/node_modules/uuid/dist/esm-browser/validate.js +0 -8
- package/dist/node_modules/uuid/dist/esm-browser/validate.js.map +0 -1
- /package/dist/node_modules/{query-string/node_modules/decode-uri-component → decode-uri-component}/index.js +0 -0
|
@@ -1,187 +1,207 @@
|
|
|
1
|
-
import { useCallback as
|
|
2
|
-
import { COURSE_STREAMS as
|
|
3
|
-
import { useMilestoneBulkPost as
|
|
4
|
-
import { usePostStudentPreferences as
|
|
5
|
-
import { usePatchStudentInformation as
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import
|
|
11
|
-
|
|
1
|
+
import { useCallback as u, useEffect as ee } from "react";
|
|
2
|
+
import { COURSE_STREAMS as te } from "../../milestone/constants.js";
|
|
3
|
+
import { useMilestoneBulkPost as oe } from "../../milestone/create/api/milestone-bulk.js";
|
|
4
|
+
import { usePostStudentPreferences as se } from "../api/course-stream.js";
|
|
5
|
+
import { usePatchStudentInformation as ae } from "../api/student-information.js";
|
|
6
|
+
import { usePostTeacherAvailability as ne } from "../api/teacher-availability.js";
|
|
7
|
+
import { usePatchTrialHome as re } from "../api/trial-home.js";
|
|
8
|
+
import { useTrialSessionContext as ie } from "../context/use-trial-session-context.js";
|
|
9
|
+
import { getFormattedPreferences as w, getWeekdayAndStartTimeFromPreference as ce, getFormattedStudentPersonalizedPreference as le } from "../helper.js";
|
|
10
|
+
import { DEFAULT_BUTTON_STATE as p, TrialPageId as t } from "../trial-session-constants.js";
|
|
11
|
+
import K from "../../../node_modules/uuid/dist/esm-browser/v4.js";
|
|
12
|
+
const ge = () => {
|
|
12
13
|
const {
|
|
13
|
-
updateSlideConfig:
|
|
14
|
-
slideConfig:
|
|
15
|
-
formData:
|
|
14
|
+
updateSlideConfig: a,
|
|
15
|
+
slideConfig: V,
|
|
16
|
+
formData: W,
|
|
16
17
|
updateButtonState: n,
|
|
17
18
|
teacherId: l,
|
|
18
|
-
studentId:
|
|
19
|
-
milestoneConfig:
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
19
|
+
studentId: d,
|
|
20
|
+
milestoneConfig: b,
|
|
21
|
+
handleInfoMessage: P,
|
|
22
|
+
onTrialInformationUpdate: S,
|
|
23
|
+
trialHomeData: Z,
|
|
24
|
+
worksheetNavigationPanel: g
|
|
25
|
+
} = ie(), { nextPage: j, id: m } = V || {}, { demo_info: q } = Z, { stream: A, region_data: J } = q, { opportunity_country: T = "US" } = J || {}, { pageId: i } = j || {}, {
|
|
26
|
+
name: f,
|
|
27
|
+
grade: _,
|
|
28
|
+
goals: R,
|
|
27
29
|
curriculum: E,
|
|
28
|
-
studentTimezone:
|
|
29
|
-
preferences:
|
|
30
|
-
personalizedLevel:
|
|
31
|
-
personalizedFocus:
|
|
32
|
-
personalizedBehaviors:
|
|
33
|
-
personalizedObjectives:
|
|
34
|
-
|
|
30
|
+
studentTimezone: I = "Asia/Calcutta",
|
|
31
|
+
preferences: N = [],
|
|
32
|
+
personalizedLevel: v = [],
|
|
33
|
+
personalizedFocus: k = [],
|
|
34
|
+
personalizedBehaviors: y = [],
|
|
35
|
+
personalizedObjectives: D = [],
|
|
36
|
+
personalizedPosition: O = []
|
|
37
|
+
} = W || {}, c = u(() => {
|
|
35
38
|
n("both", {
|
|
36
39
|
left: { isDisabled: !0, isLoading: !1 },
|
|
37
40
|
right: { isDisabled: !0, isLoading: !0 }
|
|
38
41
|
});
|
|
39
|
-
}, [n]),
|
|
42
|
+
}, [n]), L = (o) => {
|
|
40
43
|
if (!o) {
|
|
41
|
-
const
|
|
42
|
-
(i ===
|
|
44
|
+
const e = {};
|
|
45
|
+
(i === t.CIRCLE_GAME || i === t.CIRCLE_PUZZLE || i === t.CIRCLE_SKILL) && (e.matchmakingId = K(), e.showCircleGameScreen = !0), a({ id: i, ...e });
|
|
43
46
|
}
|
|
44
|
-
n("both",
|
|
45
|
-
}, { patch:
|
|
46
|
-
onComplete:
|
|
47
|
-
}), { post:
|
|
48
|
-
onComplete:
|
|
49
|
-
}), { post:
|
|
50
|
-
onComplete:
|
|
51
|
-
}),
|
|
52
|
-
const
|
|
47
|
+
n("both", p), m === t.LEARNING_LEVEL && (S == null || S());
|
|
48
|
+
}, { patch: Q } = re({ onComplete: L }), { patch: G } = ae({
|
|
49
|
+
onComplete: L
|
|
50
|
+
}), { post: z } = oe({
|
|
51
|
+
onComplete: L
|
|
52
|
+
}), { post: x } = se({
|
|
53
|
+
onComplete: L
|
|
54
|
+
}), X = (o, e) => {
|
|
55
|
+
const r = (e == null ? void 0 : e.filter((s) => !s.is_available)) ?? [];
|
|
56
|
+
if (r.length > 0) {
|
|
57
|
+
const s = r.map(($) => $.reason).join(`
|
|
58
|
+
`);
|
|
59
|
+
P == null || P({ message: s, position: "bottom" }), n("both", p);
|
|
60
|
+
return;
|
|
61
|
+
}
|
|
62
|
+
const h = w(N, I);
|
|
63
|
+
h.length > 0 ? Q("trial-v3-patch", {
|
|
64
|
+
action: "UPDATE_DEMO",
|
|
65
|
+
action_data: {
|
|
66
|
+
trial_details: {
|
|
67
|
+
selected_regular_slots: h
|
|
68
|
+
}
|
|
69
|
+
},
|
|
70
|
+
teacher_id: l,
|
|
71
|
+
student_id: d
|
|
72
|
+
}) : n("both", p);
|
|
73
|
+
}, { post: F } = ne({
|
|
74
|
+
onComplete: X
|
|
75
|
+
}), M = u(() => {
|
|
76
|
+
var s;
|
|
77
|
+
const [o, e] = ((s = f == null ? void 0 : f.trim()) == null ? void 0 : s.split(" ")) || [], r = {
|
|
53
78
|
first_name: o,
|
|
54
|
-
last_name:
|
|
55
|
-
grade:
|
|
79
|
+
last_name: e,
|
|
80
|
+
grade: _,
|
|
56
81
|
board: E,
|
|
57
82
|
demo_type: "TRIAL_V3",
|
|
58
83
|
teacher_id: l,
|
|
59
|
-
country_alpha_2:
|
|
84
|
+
country_alpha_2: T
|
|
60
85
|
};
|
|
61
|
-
/\d/.test(
|
|
86
|
+
/\d/.test(f || "") ? a({ numberInNameError: !0 }) : (c(), G(d, r));
|
|
62
87
|
}, [
|
|
63
|
-
|
|
64
|
-
|
|
88
|
+
f,
|
|
89
|
+
_,
|
|
65
90
|
E,
|
|
66
91
|
l,
|
|
67
|
-
|
|
92
|
+
T,
|
|
68
93
|
c,
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
]),
|
|
73
|
-
const o =
|
|
94
|
+
a,
|
|
95
|
+
G,
|
|
96
|
+
d
|
|
97
|
+
]), U = u(() => {
|
|
98
|
+
const o = w(N, I), e = ce(o);
|
|
74
99
|
if (o.length > 0) {
|
|
75
|
-
const
|
|
76
|
-
trial_details: {
|
|
77
|
-
selected_regular_slots: o
|
|
78
|
-
}
|
|
79
|
-
};
|
|
80
|
-
c(), k("trial-v3-patch", {
|
|
81
|
-
action: "UPDATE_DEMO",
|
|
82
|
-
action_data: t,
|
|
100
|
+
const r = {
|
|
83
101
|
teacher_id: l,
|
|
84
|
-
|
|
85
|
-
}
|
|
102
|
+
session_list: e
|
|
103
|
+
};
|
|
104
|
+
c(), F(r);
|
|
86
105
|
} else
|
|
87
|
-
|
|
106
|
+
a({ id: i }), n("both", p);
|
|
88
107
|
}, [
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
c,
|
|
92
|
-
k,
|
|
108
|
+
N,
|
|
109
|
+
I,
|
|
93
110
|
l,
|
|
111
|
+
F,
|
|
112
|
+
c,
|
|
94
113
|
a,
|
|
95
|
-
s,
|
|
96
114
|
i,
|
|
97
115
|
n
|
|
98
|
-
]),
|
|
116
|
+
]), B = u(() => {
|
|
99
117
|
const o = {
|
|
100
|
-
course_stream:
|
|
101
|
-
grade:
|
|
118
|
+
course_stream: A,
|
|
119
|
+
grade: _,
|
|
102
120
|
teacher_id: l,
|
|
103
121
|
board: E,
|
|
104
|
-
goals:
|
|
122
|
+
goals: R
|
|
105
123
|
};
|
|
106
|
-
c(),
|
|
107
|
-
studentId:
|
|
124
|
+
c(), z(o, {
|
|
125
|
+
studentId: d
|
|
108
126
|
});
|
|
109
127
|
}, [
|
|
110
128
|
E,
|
|
111
129
|
c,
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
130
|
+
R,
|
|
131
|
+
_,
|
|
132
|
+
z,
|
|
133
|
+
A,
|
|
134
|
+
d,
|
|
117
135
|
l
|
|
118
|
-
]),
|
|
119
|
-
const
|
|
120
|
-
...
|
|
121
|
-
...
|
|
122
|
-
...
|
|
123
|
-
...
|
|
124
|
-
|
|
125
|
-
|
|
136
|
+
]), H = u(() => {
|
|
137
|
+
const e = { preferences: le(b, [
|
|
138
|
+
...v,
|
|
139
|
+
...k,
|
|
140
|
+
...y,
|
|
141
|
+
...D,
|
|
142
|
+
...O
|
|
143
|
+
]) }, r = { stream: te.MATH, studentId: d };
|
|
144
|
+
c(), x(e, r);
|
|
126
145
|
}, [
|
|
127
|
-
c,
|
|
128
|
-
N,
|
|
129
|
-
O,
|
|
130
146
|
b,
|
|
131
|
-
A,
|
|
132
|
-
M,
|
|
133
147
|
v,
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
148
|
+
k,
|
|
149
|
+
y,
|
|
150
|
+
D,
|
|
151
|
+
O,
|
|
152
|
+
d,
|
|
153
|
+
c,
|
|
154
|
+
x
|
|
155
|
+
]), C = u(
|
|
156
|
+
(o, e) => {
|
|
157
|
+
if (!a) return;
|
|
158
|
+
const r = m === t.STUDENT_PROFILE, h = m === t.LEARNING_PLAN, s = {};
|
|
159
|
+
if ((e === t.CIRCLE_GAME || e === t.CIRCLE_PUZZLE || e === t.CIRCLE_SKILL) && (s.matchmakingId = K(), s.showCircleGameScreen = !0), o === "prev" && (a({
|
|
160
|
+
id: e,
|
|
161
|
+
...r && { studentProfile: void 0 },
|
|
162
|
+
...h && {
|
|
143
163
|
chapterId: void 0
|
|
144
164
|
},
|
|
145
|
-
...
|
|
146
|
-
}), n("both",
|
|
147
|
-
switch (
|
|
148
|
-
case
|
|
149
|
-
case
|
|
150
|
-
|
|
165
|
+
...s
|
|
166
|
+
}), n("both", p)), o === "next")
|
|
167
|
+
switch (m) {
|
|
168
|
+
case t.STUDENT_INFORMATION:
|
|
169
|
+
case t.SCHOOL_GOALS:
|
|
170
|
+
M();
|
|
151
171
|
break;
|
|
152
|
-
case
|
|
153
|
-
|
|
172
|
+
case t.LEARNING_WORKSHEET:
|
|
173
|
+
B();
|
|
154
174
|
break;
|
|
155
|
-
case
|
|
156
|
-
|
|
175
|
+
case t.CLASS_PREFERENCE:
|
|
176
|
+
U();
|
|
157
177
|
break;
|
|
158
|
-
case
|
|
159
|
-
|
|
178
|
+
case t.LEARNING_LEVEL:
|
|
179
|
+
H();
|
|
160
180
|
break;
|
|
161
|
-
case
|
|
162
|
-
|
|
181
|
+
case t.LEARNING_PLAN:
|
|
182
|
+
a({ id: e, chapterId: void 0, ...s });
|
|
163
183
|
break;
|
|
164
184
|
default:
|
|
165
|
-
|
|
185
|
+
a({ id: e, ...s }), n("both", p);
|
|
166
186
|
}
|
|
167
187
|
},
|
|
168
188
|
[
|
|
169
|
-
|
|
170
|
-
|
|
189
|
+
a,
|
|
190
|
+
m,
|
|
171
191
|
n,
|
|
192
|
+
M,
|
|
193
|
+
B,
|
|
172
194
|
U,
|
|
173
|
-
|
|
174
|
-
x,
|
|
175
|
-
z
|
|
195
|
+
H
|
|
176
196
|
]
|
|
177
|
-
),
|
|
178
|
-
!
|
|
179
|
-
}, [
|
|
180
|
-
return
|
|
181
|
-
|
|
182
|
-
}, [
|
|
197
|
+
), Y = u(() => {
|
|
198
|
+
!g && m === t.LEARNING_WORKSHEET && C("next", i);
|
|
199
|
+
}, [m, C, i, g]);
|
|
200
|
+
return ee(() => {
|
|
201
|
+
Y();
|
|
202
|
+
}, [g]), { handleNavigation: C };
|
|
183
203
|
};
|
|
184
204
|
export {
|
|
185
|
-
|
|
205
|
+
ge as useTrialSessionNavigation
|
|
186
206
|
};
|
|
187
207
|
//# sourceMappingURL=use-trial-session-navigation.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-trial-session-navigation.js","sources":["../../../../src/features/trial-session/hooks/use-trial-session-navigation.ts"],"sourcesContent":["import type { ITrialSessionFormFields } from '../trial-session-types';\n\nimport { useCallback, useEffect } from 'react';\nimport { v4 as uuidv4 } from 'uuid';\n\nimport { COURSE_STREAMS } from '../../milestone/constants';\nimport { useMilestoneBulkPost } from '../../milestone/create/api/milestone-bulk';\nimport { usePostStudentPreferences } from '../api/course-stream';\nimport { usePatchStudentInformation } from '../api/student-information';\nimport { usePatchTrialHome } from '../api/trial-home';\nimport { useTrialSessionContext } from '../context/use-trial-session-context';\nimport { getFormattedPreferences, getFormattedStudentPersonalizedPreference } from '../helper';\nimport { DEFAULT_BUTTON_STATE, TrialPageId } from '../trial-session-constants';\n\nconst useTrialSessionNavigation = () => {\n const {\n updateSlideConfig,\n slideConfig,\n formData,\n updateButtonState,\n teacherId,\n studentId,\n milestoneConfig,\n onTrialInformationUpdate,\n trialHomeData,\n worksheetNavigationPanel,\n } = useTrialSessionContext();\n const { nextPage, id: currentPageId } = slideConfig || {};\n const { demo_info: demoInfo } = trialHomeData;\n const { stream, region_data: regionData } = demoInfo;\n const { opportunity_country: countryCode = 'US' } = regionData || {};\n const { pageId: nextPageId } = nextPage || {};\n const {\n name,\n grade,\n goals,\n curriculum,\n studentTimezone,\n preferences = [],\n personalizedLevel = [],\n personalizedFocus = [],\n personalizedBehaviors = [],\n personalizedObjectives = [],\n } = formData || {};\n\n const disableNavButtons = useCallback(() => {\n updateButtonState('both', {\n left: { isDisabled: true, isLoading: false },\n right: { isDisabled: true, isLoading: true },\n });\n }, [updateButtonState]);\n\n const onAcknowledge = (errorMessage: string | null) => {\n if (!errorMessage) {\n const overrides: Partial<ITrialSessionFormFields> = {};\n\n if (\n nextPageId === TrialPageId.CIRCLE_GAME ||\n nextPageId === TrialPageId.CIRCLE_PUZZLE ||\n nextPageId === TrialPageId.CIRCLE_SKILL\n ) {\n overrides.matchmakingId = uuidv4();\n overrides.showCircleGameScreen = true;\n }\n\n updateSlideConfig({ id: nextPageId, ...overrides });\n }\n updateButtonState('both', DEFAULT_BUTTON_STATE);\n\n if (\n currentPageId === TrialPageId.STUDENT_INFORMATION ||\n currentPageId === TrialPageId.SCHOOL_GOALS\n ) {\n //TODO: remove TrialPageId.STUDENT_INFORMATION\n onTrialInformationUpdate?.();\n }\n };\n\n // API specifications\n const { patch: patchTrialSession } = usePatchTrialHome({ onComplete: onAcknowledge });\n const { patch: patchStudentInformation } = usePatchStudentInformation({\n onComplete: onAcknowledge,\n });\n const { post: postMilestoneBulk } = useMilestoneBulkPost({\n onComplete: onAcknowledge,\n });\n const { post: postStudentPreferences } = usePostStudentPreferences({\n onComplete: onAcknowledge,\n });\n\n // Function to call API and updates states\n const handleStudentInformation = useCallback(() => {\n const [firstName, lastName] = name?.split(' ') || [];\n const payload = {\n first_name: firstName,\n last_name: lastName,\n grade,\n board: curriculum,\n demo_type: 'TRIAL_V3',\n teacher_id: teacherId,\n country_alpha_2: countryCode,\n };\n const isNumberExistsInName = /\\d/.test(name || '');\n\n if (isNumberExistsInName) {\n updateSlideConfig({ numberInNameError: true });\n } else {\n disableNavButtons();\n patchStudentInformation(studentId, payload);\n }\n }, [\n name,\n grade,\n curriculum,\n teacherId,\n countryCode,\n disableNavButtons,\n updateSlideConfig,\n patchStudentInformation,\n studentId,\n ]);\n\n const handleClassPreferences = useCallback(() => {\n const selectedRegularSlots = getFormattedPreferences(preferences, studentTimezone);\n\n if (selectedRegularSlots.length > 0) {\n const actionData = {\n trial_details: {\n selected_regular_slots: selectedRegularSlots,\n },\n };\n\n disableNavButtons();\n patchTrialSession('trial-v3-patch', {\n action: 'UPDATE_DEMO',\n action_data: actionData,\n teacher_id: teacherId,\n student_id: studentId,\n });\n } else {\n updateSlideConfig({ id: nextPageId });\n updateButtonState('both', DEFAULT_BUTTON_STATE);\n }\n }, [\n preferences,\n studentTimezone,\n disableNavButtons,\n patchTrialSession,\n teacherId,\n studentId,\n updateSlideConfig,\n nextPageId,\n updateButtonState,\n ]);\n\n const handleMileStoneBulkPost = useCallback(() => {\n const payload = {\n course_stream: stream,\n grade,\n teacher_id: teacherId,\n board: curriculum,\n goals,\n };\n\n disableNavButtons();\n postMilestoneBulk(payload, {\n studentId,\n });\n }, [\n curriculum,\n disableNavButtons,\n goals,\n grade,\n postMilestoneBulk,\n stream,\n studentId,\n teacherId,\n ]);\n\n const handleStudentPreferencesPatch = useCallback(() => {\n const personalizedPreferences = getFormattedStudentPersonalizedPreference(milestoneConfig, [\n ...personalizedLevel,\n ...personalizedFocus,\n ...personalizedBehaviors,\n ...personalizedObjectives,\n ]);\n\n const payload = { preferences: personalizedPreferences };\n const meta = { stream: COURSE_STREAMS.MATH, studentId };\n\n disableNavButtons();\n postStudentPreferences(payload, meta);\n }, [\n disableNavButtons,\n milestoneConfig,\n personalizedBehaviors,\n personalizedFocus,\n personalizedLevel,\n postStudentPreferences,\n personalizedObjectives,\n studentId,\n ]);\n\n // Navigation logic\n const handleNavigation = useCallback(\n (dir: string, id?: string) => {\n if (!updateSlideConfig) return;\n\n const isStudentProfilePage = currentPageId === TrialPageId.STUDENT_PROFILE;\n const isLearningPlanSlide = currentPageId === TrialPageId.LEARNING_PLAN;\n const overrides: Partial<ITrialSessionFormFields> = {};\n\n if (\n id === TrialPageId.CIRCLE_GAME ||\n id === TrialPageId.CIRCLE_PUZZLE ||\n id === TrialPageId.CIRCLE_SKILL\n ) {\n overrides.matchmakingId = uuidv4();\n overrides.showCircleGameScreen = true;\n }\n\n if (dir === 'prev') {\n updateSlideConfig({\n id,\n ...(isStudentProfilePage && { studentProfile: undefined }),\n ...(isLearningPlanSlide && {\n chapterId: undefined,\n }),\n ...overrides,\n });\n updateButtonState('both', DEFAULT_BUTTON_STATE);\n }\n\n if (dir === 'next') {\n switch (currentPageId) {\n //TODO: remove STUDENT_INFORMATION\n case TrialPageId.STUDENT_INFORMATION:\n case TrialPageId.SCHOOL_GOALS:\n handleStudentInformation();\n break;\n case TrialPageId.LEARNING_WORKSHEET:\n handleMileStoneBulkPost();\n break;\n case TrialPageId.CLASS_PREFERENCE:\n handleClassPreferences();\n break;\n case TrialPageId.LEARNING_LEVEL:\n handleStudentPreferencesPatch();\n break;\n case TrialPageId.LEARNING_PLAN:\n updateSlideConfig({ id, chapterId: undefined, ...overrides });\n break;\n default: {\n updateSlideConfig({ id, ...overrides });\n updateButtonState('both', DEFAULT_BUTTON_STATE);\n }\n }\n }\n },\n [\n updateSlideConfig,\n currentPageId,\n updateButtonState,\n handleStudentInformation,\n handleMileStoneBulkPost,\n handleClassPreferences,\n handleStudentPreferencesPatch,\n ],\n );\n\n const sessionWorksheetNavigation = useCallback(() => {\n if (!worksheetNavigationPanel && currentPageId === TrialPageId.LEARNING_WORKSHEET) {\n handleNavigation('next', nextPageId);\n }\n }, [currentPageId, handleNavigation, nextPageId, worksheetNavigationPanel]);\n\n useEffect(() => {\n sessionWorksheetNavigation();\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [worksheetNavigationPanel]);\n\n return { handleNavigation };\n};\n\nexport { useTrialSessionNavigation };\n"],"names":["useTrialSessionNavigation","updateSlideConfig","slideConfig","formData","updateButtonState","teacherId","studentId","milestoneConfig","onTrialInformationUpdate","trialHomeData","worksheetNavigationPanel","useTrialSessionContext","nextPage","currentPageId","demoInfo","stream","regionData","countryCode","nextPageId","name","grade","goals","curriculum","studentTimezone","preferences","personalizedLevel","personalizedFocus","personalizedBehaviors","personalizedObjectives","disableNavButtons","useCallback","onAcknowledge","errorMessage","overrides","TrialPageId","uuidv4","DEFAULT_BUTTON_STATE","patchTrialSession","usePatchTrialHome","patchStudentInformation","usePatchStudentInformation","postMilestoneBulk","useMilestoneBulkPost","postStudentPreferences","usePostStudentPreferences","handleStudentInformation","firstName","lastName","payload","handleClassPreferences","selectedRegularSlots","getFormattedPreferences","actionData","handleMileStoneBulkPost","handleStudentPreferencesPatch","getFormattedStudentPersonalizedPreference","meta","COURSE_STREAMS","handleNavigation","dir","id","isStudentProfilePage","isLearningPlanSlide","sessionWorksheetNavigation","useEffect"],"mappings":";;;;;;;;;;AAcA,MAAMA,KAA4B,MAAM;AAChC,QAAA;AAAA,IACJ,mBAAAC;AAAA,IACA,aAAAC;AAAA,IACA,UAAAC;AAAA,IACA,mBAAAC;AAAA,IACA,WAAAC;AAAA,IACA,WAAAC;AAAA,IACA,iBAAAC;AAAA,IACA,0BAAAC;AAAA,IACA,eAAAC;AAAA,IACA,0BAAAC;AAAA,MACEC,GAAuB,GACrB,EAAE,UAAAC,GAAU,IAAIC,EAAc,IAAIX,KAAe,CAAA,GACjD,EAAE,WAAWY,EAAa,IAAAL,GAC1B,EAAE,QAAAM,GAAQ,aAAaC,EAAA,IAAeF,GACtC,EAAE,qBAAqBG,IAAc,KAAK,IAAID,KAAc,CAAA,GAC5D,EAAE,QAAQE,MAAeN,KAAY,CAAA,GACrC;AAAA,IACJ,MAAAO;AAAA,IACA,OAAAC;AAAA,IACA,OAAAC;AAAA,IACA,YAAAC;AAAA,IACA,iBAAAC;AAAA,IACA,aAAAC,I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AoB;AAC9B;AAAA,UACF,KAAKpB,EAAY;AACf,YAAAjC,EAAkB,EAAE,IAAA2D,GAAI,WAAW,QAAW,GAAG3B,GAAW;AAC5D;AAAA,UACF;AACE,YAAAhC,EAAkB,EAAE,IAAA2D,GAAI,GAAG3B,EAAW,CAAA,GACtC7B,EAAkB,QAAQgC,CAAoB;AAAA,QAElD;AAAA,IAEJ;AAAA,IACA;AAAA,MACEnC;AAAA,MACAY;AAAA,MACAT;AAAA,MACAyC;AAAA,MACAQ;AAAA,MACAJ;AAAA,MACAK;AAAA,IACF;AAAA,EAAA,GAGIS,IAA6BjC,EAAY,MAAM;AACnD,IAAI,CAACpB,KAA4BG,MAAkBqB,EAAY,sBAC7DwB,EAAiB,QAAQxC,CAAU;AAAA,KAEpC,CAACL,GAAe6C,GAAkBxC,GAAYR,CAAwB,CAAC;AAE1E,SAAAsD,EAAU,MAAM;AACa,IAAAD;EAAA,GAE1B,CAACrD,CAAwB,CAAC,GAEtB,EAAE,kBAAAgD,EAAiB;AAC5B;"}
|
|
1
|
+
{"version":3,"file":"use-trial-session-navigation.js","sources":["../../../../src/features/trial-session/hooks/use-trial-session-navigation.ts"],"sourcesContent":["import type { TTeacherAvailabilityResponse } from '../api/teacher-availability';\nimport type { ITrialSessionFormFields } from '../trial-session-types';\n\nimport { useCallback, useEffect } from 'react';\nimport { v4 as uuidv4 } from 'uuid';\n\nimport { COURSE_STREAMS } from '../../milestone/constants';\nimport { useMilestoneBulkPost } from '../../milestone/create/api/milestone-bulk';\nimport { usePostStudentPreferences } from '../api/course-stream';\nimport { usePatchStudentInformation } from '../api/student-information';\nimport { usePostTeacherAvailability } from '../api/teacher-availability';\nimport { usePatchTrialHome } from '../api/trial-home';\nimport { useTrialSessionContext } from '../context/use-trial-session-context';\nimport {\n getFormattedPreferences,\n getFormattedStudentPersonalizedPreference,\n getWeekdayAndStartTimeFromPreference,\n} from '../helper';\nimport { DEFAULT_BUTTON_STATE, TrialPageId } from '../trial-session-constants';\n\nconst useTrialSessionNavigation = () => {\n const {\n updateSlideConfig,\n slideConfig,\n formData,\n updateButtonState,\n teacherId,\n studentId,\n milestoneConfig,\n handleInfoMessage,\n onTrialInformationUpdate,\n trialHomeData,\n worksheetNavigationPanel,\n } = useTrialSessionContext();\n const { nextPage, id: currentPageId } = slideConfig || {};\n const { demo_info: demoInfo } = trialHomeData;\n const { stream, region_data: regionData } = demoInfo;\n const { opportunity_country: countryCode = 'US' } = regionData || {};\n const { pageId: nextPageId } = nextPage || {};\n const {\n name,\n grade,\n goals,\n curriculum,\n studentTimezone = 'Asia/Calcutta',\n preferences = [],\n personalizedLevel = [],\n personalizedFocus = [],\n personalizedBehaviors = [],\n personalizedObjectives = [],\n personalizedPosition = [],\n } = formData || {};\n\n const disableNavButtons = useCallback(() => {\n updateButtonState('both', {\n left: { isDisabled: true, isLoading: false },\n right: { isDisabled: true, isLoading: true },\n });\n }, [updateButtonState]);\n\n const onAcknowledge = (errorMessage: string | null) => {\n if (!errorMessage) {\n const overrides: Partial<ITrialSessionFormFields> = {};\n\n if (\n nextPageId === TrialPageId.CIRCLE_GAME ||\n nextPageId === TrialPageId.CIRCLE_PUZZLE ||\n nextPageId === TrialPageId.CIRCLE_SKILL\n ) {\n overrides.matchmakingId = uuidv4();\n overrides.showCircleGameScreen = true;\n }\n\n updateSlideConfig({ id: nextPageId, ...overrides });\n }\n updateButtonState('both', DEFAULT_BUTTON_STATE);\n\n if (currentPageId === TrialPageId.LEARNING_LEVEL) {\n onTrialInformationUpdate?.();\n }\n };\n\n // API specifications\n const { patch: patchTrialSession } = usePatchTrialHome({ onComplete: onAcknowledge });\n const { patch: patchStudentInformation } = usePatchStudentInformation({\n onComplete: onAcknowledge,\n });\n const { post: postMilestoneBulk } = useMilestoneBulkPost({\n onComplete: onAcknowledge,\n });\n const { post: postStudentPreferences } = usePostStudentPreferences({\n onComplete: onAcknowledge,\n });\n\n const onTeacherAvailabilityValidate = (_: string | null, data?: TTeacherAvailabilityResponse) => {\n const notAvailable = data?.filter(item => !item.is_available) ?? [];\n\n if (notAvailable.length > 0) {\n const reason = notAvailable.map(item => item.reason).join('\\n');\n\n handleInfoMessage?.({ message: reason, position: 'bottom' });\n updateButtonState('both', DEFAULT_BUTTON_STATE);\n\n return;\n }\n\n const selectedRegularSlots = getFormattedPreferences(preferences, studentTimezone);\n\n if (selectedRegularSlots.length > 0) {\n const actionData = {\n trial_details: {\n selected_regular_slots: selectedRegularSlots,\n },\n };\n\n patchTrialSession('trial-v3-patch', {\n action: 'UPDATE_DEMO',\n action_data: actionData,\n teacher_id: teacherId,\n student_id: studentId,\n });\n } else updateButtonState('both', DEFAULT_BUTTON_STATE);\n };\n\n const { post: postTeacherAvailability } = usePostTeacherAvailability({\n onComplete: onTeacherAvailabilityValidate,\n });\n\n // Function to call API and updates states\n const handleStudentInformation = useCallback(() => {\n const [firstName, lastName] = name?.trim()?.split(' ') || [];\n const payload = {\n first_name: firstName,\n last_name: lastName,\n grade,\n board: curriculum,\n demo_type: 'TRIAL_V3',\n teacher_id: teacherId,\n country_alpha_2: countryCode,\n };\n const isNumberExistsInName = /\\d/.test(name || '');\n\n if (isNumberExistsInName) {\n updateSlideConfig({ numberInNameError: true });\n } else {\n disableNavButtons();\n patchStudentInformation(studentId, payload);\n }\n }, [\n name,\n grade,\n curriculum,\n teacherId,\n countryCode,\n disableNavButtons,\n updateSlideConfig,\n patchStudentInformation,\n studentId,\n ]);\n\n const handleClassPreferences = useCallback(() => {\n const selectedRegularSlots = getFormattedPreferences(preferences, studentTimezone);\n const sessionList = getWeekdayAndStartTimeFromPreference(selectedRegularSlots);\n\n if (selectedRegularSlots.length > 0) {\n const availabilityPayload = {\n teacher_id: teacherId,\n session_list: sessionList,\n };\n\n disableNavButtons();\n postTeacherAvailability(availabilityPayload);\n } else {\n updateSlideConfig({ id: nextPageId });\n updateButtonState('both', DEFAULT_BUTTON_STATE);\n }\n }, [\n preferences,\n studentTimezone,\n teacherId,\n postTeacherAvailability,\n disableNavButtons,\n updateSlideConfig,\n nextPageId,\n updateButtonState,\n ]);\n\n const handleMileStoneBulkPost = useCallback(() => {\n const payload = {\n course_stream: stream,\n grade,\n teacher_id: teacherId,\n board: curriculum,\n goals,\n };\n\n disableNavButtons();\n postMilestoneBulk(payload, {\n studentId,\n });\n }, [\n curriculum,\n disableNavButtons,\n goals,\n grade,\n postMilestoneBulk,\n stream,\n studentId,\n teacherId,\n ]);\n\n const handleStudentPreferencesPatch = useCallback(() => {\n const personalizedPreferences = getFormattedStudentPersonalizedPreference(milestoneConfig, [\n ...personalizedLevel,\n ...personalizedFocus,\n ...personalizedBehaviors,\n ...personalizedObjectives,\n ...personalizedPosition,\n ]);\n\n const payload = { preferences: personalizedPreferences };\n const meta = { stream: COURSE_STREAMS.MATH, studentId };\n\n disableNavButtons();\n postStudentPreferences(payload, meta);\n }, [\n milestoneConfig,\n personalizedLevel,\n personalizedFocus,\n personalizedBehaviors,\n personalizedObjectives,\n personalizedPosition,\n studentId,\n disableNavButtons,\n postStudentPreferences,\n ]);\n\n // Navigation logic\n const handleNavigation = useCallback(\n (dir: string, id?: string) => {\n if (!updateSlideConfig) return;\n\n const isStudentProfilePage = currentPageId === TrialPageId.STUDENT_PROFILE;\n const isLearningPlanSlide = currentPageId === TrialPageId.LEARNING_PLAN;\n const overrides: Partial<ITrialSessionFormFields> = {};\n\n if (\n id === TrialPageId.CIRCLE_GAME ||\n id === TrialPageId.CIRCLE_PUZZLE ||\n id === TrialPageId.CIRCLE_SKILL\n ) {\n overrides.matchmakingId = uuidv4();\n overrides.showCircleGameScreen = true;\n }\n\n if (dir === 'prev') {\n updateSlideConfig({\n id,\n ...(isStudentProfilePage && { studentProfile: undefined }),\n ...(isLearningPlanSlide && {\n chapterId: undefined,\n }),\n ...overrides,\n });\n updateButtonState('both', DEFAULT_BUTTON_STATE);\n }\n\n if (dir === 'next') {\n switch (currentPageId) {\n //TODO: remove STUDENT_INFORMATION\n case TrialPageId.STUDENT_INFORMATION:\n case TrialPageId.SCHOOL_GOALS:\n handleStudentInformation();\n break;\n case TrialPageId.LEARNING_WORKSHEET:\n handleMileStoneBulkPost();\n break;\n case TrialPageId.CLASS_PREFERENCE:\n handleClassPreferences();\n break;\n case TrialPageId.LEARNING_LEVEL:\n handleStudentPreferencesPatch();\n break;\n case TrialPageId.LEARNING_PLAN:\n updateSlideConfig({ id, chapterId: undefined, ...overrides });\n break;\n default: {\n updateSlideConfig({ id, ...overrides });\n updateButtonState('both', DEFAULT_BUTTON_STATE);\n }\n }\n }\n },\n [\n updateSlideConfig,\n currentPageId,\n updateButtonState,\n handleStudentInformation,\n handleMileStoneBulkPost,\n handleClassPreferences,\n handleStudentPreferencesPatch,\n ],\n );\n\n const sessionWorksheetNavigation = useCallback(() => {\n if (!worksheetNavigationPanel && currentPageId === TrialPageId.LEARNING_WORKSHEET) {\n handleNavigation('next', nextPageId);\n }\n }, [currentPageId, handleNavigation, nextPageId, worksheetNavigationPanel]);\n\n useEffect(() => {\n sessionWorksheetNavigation();\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [worksheetNavigationPanel]);\n\n return { handleNavigation };\n};\n\nexport { useTrialSessionNavigation };\n"],"names":["useTrialSessionNavigation","updateSlideConfig","slideConfig","formData","updateButtonState","teacherId","studentId","milestoneConfig","handleInfoMessage","onTrialInformationUpdate","trialHomeData","worksheetNavigationPanel","useTrialSessionContext","nextPage","currentPageId","demoInfo","stream","regionData","countryCode","nextPageId","name","grade","goals","curriculum","studentTimezone","preferences","personalizedLevel","personalizedFocus","personalizedBehaviors","personalizedObjectives","personalizedPosition","disableNavButtons","useCallback","onAcknowledge","errorMessage","overrides","TrialPageId","uuidv4","DEFAULT_BUTTON_STATE","patchTrialSession","usePatchTrialHome","patchStudentInformation","usePatchStudentInformation","postMilestoneBulk","useMilestoneBulkPost","postStudentPreferences","usePostStudentPreferences","onTeacherAvailabilityValidate","_","data","notAvailable","item","reason","selectedRegularSlots","getFormattedPreferences","postTeacherAvailability","usePostTeacherAvailability","handleStudentInformation","firstName","lastName","_a","payload","handleClassPreferences","sessionList","getWeekdayAndStartTimeFromPreference","availabilityPayload","handleMileStoneBulkPost","handleStudentPreferencesPatch","getFormattedStudentPersonalizedPreference","meta","COURSE_STREAMS","handleNavigation","dir","id","isStudentProfilePage","isLearningPlanSlide","sessionWorksheetNavigation","useEffect"],"mappings":";;;;;;;;;;;AAoBA,MAAMA,KAA4B,MAAM;AAChC,QAAA;AAAA,IACJ,mBAAAC;AAAA,IACA,aAAAC;AAAA,IACA,UAAAC;AAAA,IACA,mBAAAC;AAAA,IACA,WAAAC;AAAA,IACA,WAAAC;AAAA,IACA,iBAAAC;AAAA,IACA,mBAAAC;AAAA,IACA,0BAAAC;AAAA,IACA,eAAAC;AAAA,IACA,0BAAAC;AAAA,MACEC,GAAuB,GACrB,EAAE,UAAAC,GAAU,IAAIC,EAAc,IAAIZ,KAAe,CAAA,GACjD,EAAE,WAAWa,EAAa,IAAAL,GAC1B,EAAE,QAAAM,GAAQ,aAAaC,EAAA,IAAeF,GACtC,EAAE,qBAAqBG,IAAc,KAAK,IAAID,KAAc,CAAA,GAC5D,EAAE,QAAQE,MAAeN,KAAY,CAAA,GACrC;AAAA,IACJ,MAAAO;AAAA,IACA,OAAAC;AAAA,IACA,OAAAC;AAAA,IACA,YAAAC;AAAA,IACA,iBAAAC,IAAkB;AAAA,IAClB,aAAAC,IAAc,CAAC;AAAA,IACf,mBAAAC,IAAoB,CAAC;AAAA,IACrB,mBAAAC,IAAoB,CAAC;AAAA,IACrB,uBAAAC,IAAwB,CAAC;AAAA,IACzB,wBAAAC,IAAyB,CAAC;AAAA,IAC1B,sBAAAC,IAAuB,CAAC;AAAA,EAAA,IACtB3B,KAAY,CAAA,GAEV4B,IAAoBC,EAAY,MAAM;AAC1C,IAAA5B,EAAkB,QAAQ;AAAA,MACxB,MAAM,EAAE,YAAY,IAAM,WAAW,GAAM;AAAA,MAC3C,OAAO,EAAE,YAAY,IAAM,WAAW,GAAK;AAAA,IAAA,CAC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IC,KAAuB;AAAA,UACzB,WAAW;AAAA,QACb;AAAA,QACA,GAAGxC;AAAA,MAAA,CACJ,GACD/B,EAAkB,QAAQkC,CAAoB,IAG5CkC,MAAQ;AACV,gBAAQ1D,GAAe;AAAA,UAErB,KAAKsB,EAAY;AAAA,UACjB,KAAKA,EAAY;AACU,YAAAqB;AACzB;AAAA,UACF,KAAKrB,EAAY;AACS,YAAA8B;AACxB;AAAA,UACF,KAAK9B,EAAY;AACQ,YAAA0B;AACvB;AAAA,UACF,KAAK1B,EAAY;AACe,YAAA+B;AAC9B;AAAA,UACF,KAAK/B,EAAY;AACf,YAAAnC,EAAkB,EAAE,IAAAwE,GAAI,WAAW,QAAW,GAAGtC,GAAW;AAC5D;AAAA,UACF;AACE,YAAAlC,EAAkB,EAAE,IAAAwE,GAAI,GAAGtC,EAAW,CAAA,GACtC/B,EAAkB,QAAQkC,CAAoB;AAAA,QAElD;AAAA,IAEJ;AAAA,IACA;AAAA,MACErC;AAAA,MACAa;AAAA,MACAV;AAAA,MACAqD;AAAA,MACAS;AAAA,MACAJ;AAAA,MACAK;AAAA,IACF;AAAA,EAAA,GAGIS,IAA6B5C,EAAY,MAAM;AACnD,IAAI,CAACrB,KAA4BG,MAAkBsB,EAAY,sBAC7DmC,EAAiB,QAAQpD,CAAU;AAAA,KAEpC,CAACL,GAAeyD,GAAkBpD,GAAYR,CAAwB,CAAC;AAE1E,SAAAkE,GAAU,MAAM;AACa,IAAAD;EAAA,GAE1B,CAACjE,CAAwB,CAAC,GAEtB,EAAE,kBAAA4D,EAAiB;AAC5B;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"trial-session-types.js","sources":["../../../src/features/trial-session/trial-session-types.ts"],"sourcesContent":["import type { TNodeTypes } from '../../types/models/worksheet';\nimport type { IInfoMessage } from '../circle-games/games/web-view/web-view-types';\nimport type {\n IMilestoneConfig,\n TCourseStream,\n TPreferenceCategory,\n} from '../milestone/create/milestone-create-types';\nimport type { IAvatarLayer } from '../ui/avatar/avatar-types';\nimport type { TUserTypes } from '../ui/types';\nimport type { TPreference } from './comps/class-preference/class-preference-types';\nimport type {\n ITrialCircleConfig,\n ITrialCircleGameParams,\n} from './comps/trial-circle-game/trial-circle-game-types';\nimport type { TrialPageId } from './trial-session-constants';\nimport type { Dispatch, ReactElement, SetStateAction } from 'react';\n\nexport type { TSessionReportData as TSessionReport } from './comps/session-report/session-report-types';\n\nexport type TSlideId = TrialPageId;\n\nexport type TRegionData = {\n opportunity_country: string;\n};\n\nexport type TPreferenceSchema = {\n preference_code: string;\n preference_name: string;\n preference_category: TPreferenceCategory;\n};\n\nexport enum EClassTimeAlertLevel {\n FIVE_MIN = '5min',\n FIFTEEN_MIN = '15min',\n}\ninterface IButtonConfig {\n buttonLabel: string;\n pageId: string;\n}\n\nexport interface ISolution {\n media?: string;\n media_type?: 'image' | 'video';\n text?: string;\n}\n\nexport type TDegreeInformation = {\n degree_name?: string;\n field_of_study?: string;\n degree_code?: string;\n};\n\nexport interface ITeacherProfileDetails {\n lower_grade: string;\n higher_grade: string;\n header_image: string;\n years_of_experience: number;\n number_of_students_taught: number;\n countries: string[];\n degree: TDegreeInformation;\n first_name: string;\n last_name: string;\n teacher_profile_url?: string;\n}\n\nexport interface ISlide {\n id: TrialPageId;\n renderAs: 'split' | 'full';\n renderAVIn: 'left' | 'right';\n header: string;\n subHeader?: string;\n prevPage?: IButtonConfig;\n nextPage?: IButtonConfig;\n cues?: string[];\n dos?: string[];\n donts?: string[];\n navigationLabel?: string;\n slideTag?: string;\n teacher_profile?: ITeacherProfileDetails;\n solutions?: ISolution[];\n enableSessionPerk?: boolean;\n showProfileHighlights?: boolean;\n}\n\nexport interface TGoals {\n goal_code?: string;\n milestone_date_ts?: number;\n goal_category?: string;\n milestone_name?: string;\n publish?: boolean;\n}\n\nexport interface ITrialSessionFormFields {\n id: string;\n name?: string;\n grade?: string;\n curriculum?: string;\n goals?: TGoals[];\n studentProfile?: {\n profileSummary?: string;\n dummyProfileImageIndex?: number;\n summaryFetched?: boolean;\n summaryFetchFailed?: boolean;\n };\n userNodeId?: string;\n nodeId?: string;\n nodeType?: TNodeTypes;\n attemptId?: string;\n preferences?: TPreference[];\n personalizedLevel?: string[];\n personalizedFocus?: string[];\n personalizedBehaviors?: string[];\n personalizedObjectives?: string[];\n isCircleGamePlayed?: boolean;\n isCirclePuzzleSolved?: boolean;\n isCircleSkillCompleted?: boolean;\n studentTimezone?: string;\n showCircleGameScreen?: boolean;\n accuracyStr?: string;\n totalTimeTaken?: number;\n chapterId?: string;\n matchmakingId?: string;\n numberInNameError?: boolean;\n}\n\nexport interface IButtonState {\n isDisabled: boolean;\n isLoading: boolean;\n}\n\nexport interface ITrialHomeData {\n pages: ISlide[];\n demo_info: {\n student_classroom_id: string;\n stream: TCourseStream;\n region_data: TRegionData;\n course?: string;\n };\n parent: {\n name: string;\n };\n student: {\n grade: string;\n name: string;\n circle_username: string;\n user_avatar: IAvatarLayer[];\n };\n teacher: {\n name: string;\n circle_username: string;\n user_avatar: IAvatarLayer[];\n };\n circle_trial_game_config: ITrialCircleConfig;\n}\n\nexport interface IClassTimeAlertConfig {\n alertLevel: EClassTimeAlertLevel | null;\n isVisible: boolean;\n onComplete: () => void;\n}\n\nexport interface ITrialSessionProps {\n classStartedOn?: Date;\n height?: string | number;\n userType: TUserTypes;\n studentId: string;\n teacherId: string;\n teacherClassroomId: string;\n teacherPanel?: ReactElement;\n studentPanel?: ReactElement;\n formData?: ITrialSessionFormFields;\n onFormDataChange?: Dispatch<SetStateAction<ITrialSessionFormFields | undefined>>;\n worksheet?: ReactElement;\n worksheetNavigationPanel?: ReactElement;\n questionsRatingPanel?: ReactElement;\n studentAbsentInClass?: boolean;\n openEndClassModal?: () => void;\n trialGameUrl: string;\n handleInfoMessage: (message: IInfoMessage) => void;\n classTimeAlertConfig?: IClassTimeAlertConfig;\n classDuration?: number;\n}\n\nexport interface ITrialSessionContext\n extends Pick<\n ITrialSessionProps,\n | 'classStartedOn'\n | 'formData'\n | 'teacherPanel'\n | 'studentId'\n | 'teacherId'\n | 'studentPanel'\n | 'worksheet'\n | 'worksheetNavigationPanel'\n | 'questionsRatingPanel'\n | 'openEndClassModal'\n | 'studentAbsentInClass'\n | 'classDuration'\n | 'classTimeAlertConfig'\n > {\n buttonState: { left: IButtonState; right: IButtonState };\n isTeacher: boolean;\n milestoneConfig: IMilestoneConfig;\n slideConfig: ISlide;\n updateButtonState: (\n btnNavDir: 'left' | 'right' | 'both',\n currentState: IButtonState | { left: IButtonState; right: IButtonState },\n ) => void;\n updateSlideConfig: (config: Partial<ITrialSessionFormFields>) => void;\n trialHomeData: ITrialHomeData;\n onTrialInformationUpdate?: () => void;\n circleGames: ITrialCircleGameParams;\n trialGameUrl: string;\n handleInfoMessage: (message: IInfoMessage) => void;\n onRemoveOptionalSlides?: (grade?: string) => void;\n}\n\nexport interface ITrialSessionViewProps extends ITrialSessionProps {\n trialHomeData: ITrialHomeData;\n milestoneConfig: IMilestoneConfig;\n studentTimezone?: string;\n onStudentTimezoneUpdate?: () => void;\n onTrialInformationUpdate?: () => void;\n handleInfoMessage: (message: IInfoMessage) => void;\n onRemoveOptionalSlides?: (grade?: string) => void;\n}\n"],"names":["EClassTimeAlertLevel"],"mappings":"AA+BY,IAAAA,sBAAAA,OACVA,EAAA,WAAW,QACXA,EAAA,cAAc,SAFJA,IAAAA,KAAA,CAAA,CAAA;"}
|
|
1
|
+
{"version":3,"file":"trial-session-types.js","sources":["../../../src/features/trial-session/trial-session-types.ts"],"sourcesContent":["import type { TNodeTypes } from '../../types/models/worksheet';\nimport type { IInfoMessage } from '../circle-games/games/web-view/web-view-types';\nimport type {\n IMilestoneConfig,\n TCourseStream,\n TPreferenceCategory,\n} from '../milestone/create/milestone-create-types';\nimport type { IAvatarLayer } from '../ui/avatar/avatar-types';\nimport type { TUserTypes } from '../ui/types';\nimport type { TPreference } from './comps/class-preference/class-preference-types';\nimport type {\n ITrialCircleConfig,\n ITrialCircleGameParams,\n} from './comps/trial-circle-game/trial-circle-game-types';\nimport type { TrialPageId } from './trial-session-constants';\nimport type { Dispatch, ReactElement, SetStateAction } from 'react';\n\nexport type { TSessionReportData as TSessionReport } from './comps/session-report/session-report-types';\n\nexport type TSlideId = TrialPageId;\n\nexport type TRegionData = {\n opportunity_country: string;\n};\n\nexport type TPreferenceSchema = {\n preference_code: string;\n preference_name: string;\n preference_category: TPreferenceCategory;\n};\n\nexport enum EClassTimeAlertLevel {\n FIVE_MIN = '5min',\n FIFTEEN_MIN = '15min',\n}\ninterface IButtonConfig {\n buttonLabel: string;\n pageId: string;\n}\n\nexport interface ISolution {\n media?: string;\n media_type?: 'image' | 'video';\n text?: string;\n}\n\nexport type TDegreeInformation = {\n degree_name?: string;\n field_of_study?: string;\n degree_code?: string;\n};\n\nexport interface ITeacherProfileDetails {\n lower_grade: string;\n higher_grade: string;\n header_image: string;\n years_of_experience: number;\n number_of_students_taught: number;\n countries: string[];\n degree: TDegreeInformation;\n first_name: string;\n last_name: string;\n teacher_profile_url?: string;\n}\n\nexport interface ISlide {\n id: TrialPageId;\n renderAs: 'split' | 'full';\n renderAVIn: 'left' | 'right';\n header: string;\n subHeader?: string;\n prevPage?: IButtonConfig;\n nextPage?: IButtonConfig;\n cues?: string[];\n dos?: string[];\n donts?: string[];\n navigationLabel?: string;\n slideTag?: string;\n teacher_profile?: ITeacherProfileDetails;\n solutions?: ISolution[];\n enableSessionPerk?: boolean;\n showProfileHighlights?: boolean;\n}\n\nexport interface TGoals {\n goal_code?: string;\n milestone_date_ts?: number;\n goal_category?: string;\n milestone_name?: string;\n publish?: boolean;\n}\n\nexport interface ITrialSessionFormFields {\n id: string;\n name?: string;\n grade?: string;\n curriculum?: string;\n goals?: TGoals[];\n studentProfile?: {\n profileSummary?: string;\n dummyProfileImageIndex?: number;\n summaryFetched?: boolean;\n summaryFetchFailed?: boolean;\n };\n userNodeId?: string;\n nodeId?: string;\n nodeType?: TNodeTypes;\n attemptId?: string;\n preferences?: TPreference[];\n personalizedLevel?: string[];\n personalizedFocus?: string[];\n personalizedBehaviors?: string[];\n personalizedObjectives?: string[];\n personalizedPosition?: string[];\n isCircleGamePlayed?: boolean;\n isCirclePuzzleSolved?: boolean;\n isCircleSkillCompleted?: boolean;\n studentTimezone?: string;\n showCircleGameScreen?: boolean;\n accuracyStr?: string;\n totalTimeTaken?: number;\n chapterId?: string;\n matchmakingId?: string;\n numberInNameError?: boolean;\n}\n\nexport interface IButtonState {\n isDisabled: boolean;\n isLoading: boolean;\n}\n\nexport interface ITrialHomeData {\n pages: ISlide[];\n demo_info: {\n student_classroom_id: string;\n stream: TCourseStream;\n region_data: TRegionData;\n scheduled_start_time: number;\n course?: string;\n };\n parent: {\n name: string;\n };\n student: {\n grade: string;\n name: string;\n circle_username: string;\n user_avatar: IAvatarLayer[];\n };\n teacher: {\n name: string;\n circle_username: string;\n user_avatar: IAvatarLayer[];\n };\n intel_student?: {\n source?: string;\n student_preference?: {\n preferences?: TPreferenceSchema[];\n };\n };\n circle_trial_game_config: ITrialCircleConfig;\n}\n\nexport interface IClassTimeAlertConfig {\n alertLevel: EClassTimeAlertLevel | null;\n isVisible: boolean;\n onComplete: () => void;\n}\n\nexport interface ITrialSessionProps {\n classStartedOn?: Date;\n height?: string | number;\n userType: TUserTypes;\n studentId: string;\n teacherId: string;\n teacherClassroomId: string;\n teacherPanel?: ReactElement;\n studentPanel?: ReactElement;\n formData?: ITrialSessionFormFields;\n onFormDataChange?: Dispatch<SetStateAction<ITrialSessionFormFields | undefined>>;\n worksheet?: ReactElement;\n worksheetNavigationPanel?: ReactElement;\n questionsRatingPanel?: ReactElement;\n studentAbsentInClass?: boolean;\n openEndClassModal?: () => void;\n trialGameUrl: string;\n handleInfoMessage: (message: IInfoMessage) => void;\n classTimeAlertConfig?: IClassTimeAlertConfig;\n classDuration?: number;\n}\n\nexport interface ITrialSessionContext\n extends Pick<\n ITrialSessionProps,\n | 'classStartedOn'\n | 'formData'\n | 'teacherPanel'\n | 'studentId'\n | 'teacherId'\n | 'studentPanel'\n | 'worksheet'\n | 'worksheetNavigationPanel'\n | 'questionsRatingPanel'\n | 'openEndClassModal'\n | 'studentAbsentInClass'\n | 'classDuration'\n | 'classTimeAlertConfig'\n > {\n buttonState: { left: IButtonState; right: IButtonState };\n isTeacher: boolean;\n milestoneConfig: IMilestoneConfig;\n slideConfig: ISlide;\n updateButtonState: (\n btnNavDir: 'left' | 'right' | 'both',\n currentState: IButtonState | { left: IButtonState; right: IButtonState },\n ) => void;\n updateSlideConfig: (config: Partial<ITrialSessionFormFields>) => void;\n trialHomeData: ITrialHomeData;\n onTrialInformationUpdate?: () => void;\n circleGames: ITrialCircleGameParams;\n trialGameUrl: string;\n handleInfoMessage: (message: IInfoMessage) => void;\n onRemoveOptionalSlides?: (grade?: string) => void;\n}\n\nexport interface ITrialSessionViewProps extends ITrialSessionProps {\n trialHomeData: ITrialHomeData;\n milestoneConfig: IMilestoneConfig;\n studentTimezone?: string;\n onStudentTimezoneUpdate?: () => void;\n onTrialInformationUpdate?: () => void;\n handleInfoMessage: (message: IInfoMessage) => void;\n onRemoveOptionalSlides?: (grade?: string) => void;\n}\n"],"names":["EClassTimeAlertLevel"],"mappings":"AA+BY,IAAAA,sBAAAA,OACVA,EAAA,WAAW,QACXA,EAAA,cAAc,SAFJA,IAAAA,KAAA,CAAA,CAAA;"}
|