@cuemath/leap 4.1.7-link.1 → 4.1.7
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/fraud-detection/api/report-fraudulent-login.js +9 -0
- package/dist/features/fraud-detection/api/report-fraudulent-login.js.map +1 -0
- package/dist/features/fraud-detection/hooks/use-report-fraud.js +57 -51
- package/dist/features/fraud-detection/hooks/use-report-fraud.js.map +1 -1
- package/dist/features/trial-session/comps/class-preference/helpers.js +11 -11
- package/dist/features/trial-session/comps/class-preference/helpers.js.map +1 -1
- package/dist/features/trial-session/comps/confirmation-modal/hooks/use-confirmation-modal.js +27 -32
- package/dist/features/trial-session/comps/confirmation-modal/hooks/use-confirmation-modal.js.map +1 -1
- package/dist/features/trial-session/comps/cue-tips/tips/index.js +12 -12
- package/dist/features/trial-session/comps/cue-tips/tips/index.js.map +1 -1
- package/dist/features/trial-session/comps/session-overview/session-overview-styled.js +1 -1
- package/dist/features/trial-session/comps/session-overview/session-overview-styled.js.map +1 -1
- package/dist/features/trial-session/comps/student-feedback/student-feedback-styled.js +27 -9
- package/dist/features/trial-session/comps/student-feedback/student-feedback-styled.js.map +1 -1
- package/dist/features/trial-session/comps/student-feedback/student-feedback.js +136 -67
- package/dist/features/trial-session/comps/student-feedback/student-feedback.js.map +1 -1
- package/dist/features/trial-session/comps/student-info/student-info.js +65 -62
- package/dist/features/trial-session/comps/student-info/student-info.js.map +1 -1
- package/dist/features/trial-session/comps/topic-selection/topic-selection.js +29 -112
- package/dist/features/trial-session/comps/topic-selection/topic-selection.js.map +1 -1
- package/dist/features/trial-session/helper.js +109 -101
- package/dist/features/trial-session/helper.js.map +1 -1
- package/dist/features/trial-session/left-panel/index.js +10 -9
- package/dist/features/trial-session/left-panel/index.js.map +1 -1
- package/dist/features/trial-session/trial-session-types.js.map +1 -1
- package/dist/features/trial-session/trial-session.js +42 -41
- package/dist/features/trial-session/trial-session.js.map +1 -1
- package/dist/index.d.ts +0 -5
- package/dist/index.js +314 -316
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/dist/features/trial-session/comps/student-feedback/student-feedback-option/student-feedback-option-styled.js +0 -24
- package/dist/features/trial-session/comps/student-feedback/student-feedback-option/student-feedback-option-styled.js.map +0 -1
- package/dist/features/trial-session/comps/student-feedback/student-feedback-option/student-feedback-option.js +0 -89
- package/dist/features/trial-session/comps/student-feedback/student-feedback-option/student-feedback-option.js.map +0 -1
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { createPostAPI as t } from "@cuemath/rest-api";
|
|
2
|
+
import { BASE_URL_V1 as r } from "../../../constants/api.js";
|
|
3
|
+
const { usePost: u } = t({
|
|
4
|
+
getURL: ({ student_classroom_id: o }) => `${r}/student-classrooms/${o}/report-fraudulent-login`
|
|
5
|
+
});
|
|
6
|
+
export {
|
|
7
|
+
u as useReportFraudulentLogin
|
|
8
|
+
};
|
|
9
|
+
//# sourceMappingURL=report-fraudulent-login.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"report-fraudulent-login.js","sources":["../../../../src/features/fraud-detection/api/report-fraudulent-login.ts"],"sourcesContent":["import { createPostAPI } from '@cuemath/rest-api';\n\nimport { BASE_URL_V1 } from '../../../constants/api';\nimport { type IReportFraudulentLoginPayload } from '../hooks/report-fraud-types';\n\nexport const { usePost: useReportFraudulentLogin } = createPostAPI<\n null,\n IReportFraudulentLoginPayload\n>({\n getURL: ({ student_classroom_id }: { student_classroom_id: string }) =>\n `${BASE_URL_V1}/student-classrooms/${student_classroom_id}/report-fraudulent-login`,\n});\n"],"names":["useReportFraudulentLogin","createPostAPI","student_classroom_id","BASE_URL_V1"],"mappings":";;AAKO,MAAM,EAAE,SAASA,EAAyB,IAAIC,EAGnD;AAAA,EACA,QAAQ,CAAC,EAAE,sBAAAC,QACT,GAAGC,CAAW,uBAAuBD,CAAoB;AAC7D,CAAC;"}
|
|
@@ -1,83 +1,89 @@
|
|
|
1
1
|
import { useState as S, useCallback as c, useEffect as T } from "react";
|
|
2
|
-
import { useLocalPeer as
|
|
2
|
+
import { useLocalPeer as $, useRemotePeers as U, useCaptureMediaStreamImage as L } from "@cuemath/av";
|
|
3
3
|
import { useUIContext as N } from "../../ui/context/context.js";
|
|
4
|
-
import { base64ToFile as
|
|
5
|
-
import { FRAUD_DETECTION_ANALYTICS_EVENTS as
|
|
6
|
-
import
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
4
|
+
import { base64ToFile as l } from "../fraud-alert-modal/fraud-alert-modal-helpers.js";
|
|
5
|
+
import { FRAUD_DETECTION_ANALYTICS_EVENTS as k } from "./report-fraud-analytics.js";
|
|
6
|
+
import v from "../../hooks/use-s3-helper/use-s3-helper.js";
|
|
7
|
+
import { useReportFraudulentLogin as w } from "../api/report-fraudulent-login.js";
|
|
8
|
+
const y = { type: "class_fraud_login" }, b = ({
|
|
9
|
+
teacherId: a,
|
|
10
|
+
studentId: i,
|
|
11
|
+
studentClassroomId: o,
|
|
12
|
+
teacherClassroomId: r,
|
|
13
|
+
classStartTs: _,
|
|
13
14
|
studentName: m
|
|
14
15
|
}) => {
|
|
15
|
-
const { onEvent:
|
|
16
|
-
studentId:
|
|
17
|
-
query:
|
|
18
|
-
}), E = c(
|
|
19
|
-
(
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
class_start_ts: new Date(o * 1e3),
|
|
24
|
-
teacher_id: n,
|
|
25
|
-
student_id: t,
|
|
26
|
-
student_classroom_id: u,
|
|
16
|
+
const { onEvent: u } = N(), [f, p] = S(!1), e = $(), t = U().find((n) => n.userId === a), s = L(), g = v({
|
|
17
|
+
studentId: i,
|
|
18
|
+
query: y
|
|
19
|
+
}), { post: E } = w(), d = c(
|
|
20
|
+
(n) => {
|
|
21
|
+
u(k.FRAUD_LOGIN_TEACHER_ENTERED_CLASS_AS_STUDENT, {
|
|
22
|
+
student_classroom_id: o,
|
|
23
|
+
student_id: i,
|
|
27
24
|
student_name: m,
|
|
28
|
-
teacher_classroom_id:
|
|
25
|
+
teacher_classroom_id: r,
|
|
26
|
+
teacher_id: a,
|
|
27
|
+
teacher_url: n[0] || "",
|
|
28
|
+
student_url: n[1] || "",
|
|
29
|
+
class_start_ts: new Date(_ * 1e3)
|
|
30
|
+
}), E({
|
|
31
|
+
student_classroom_id: o,
|
|
32
|
+
teacher_s3_url: n[0] || "",
|
|
33
|
+
student_s3_url: n[1] || ""
|
|
29
34
|
});
|
|
30
35
|
},
|
|
31
36
|
[
|
|
32
|
-
|
|
33
|
-
r,
|
|
37
|
+
_,
|
|
34
38
|
u,
|
|
35
|
-
|
|
39
|
+
E,
|
|
40
|
+
o,
|
|
41
|
+
i,
|
|
36
42
|
m,
|
|
37
|
-
|
|
38
|
-
|
|
43
|
+
r,
|
|
44
|
+
a
|
|
39
45
|
]
|
|
40
|
-
),
|
|
41
|
-
|
|
42
|
-
}, [
|
|
46
|
+
), F = c(() => {
|
|
47
|
+
u("fraud_detection_images_failed", { classStartTs: _, teacherId: a, studentId: i });
|
|
48
|
+
}, [_, u, i, a]);
|
|
43
49
|
return T(() => {
|
|
44
|
-
if (!f || !(
|
|
50
|
+
if (!f || !(t != null && t.id) || !(e != null && e.id))
|
|
45
51
|
return;
|
|
46
|
-
const { image:
|
|
47
|
-
!
|
|
52
|
+
const { image: n } = s(t == null ? void 0 : t.id, "camera"), { image: D } = s(e == null ? void 0 : e.id, "camera"), R = l(n, `teacher-${Date.now()}.png`), A = l(D, `student-${Date.now()}.png`);
|
|
53
|
+
!R || !A || (g({
|
|
48
54
|
fileKey: "media/class_fraud_login/",
|
|
49
|
-
onSuccess:
|
|
50
|
-
onError:
|
|
55
|
+
onSuccess: d,
|
|
56
|
+
onError: F,
|
|
51
57
|
images: [
|
|
52
58
|
{
|
|
53
|
-
file:
|
|
54
|
-
name: `teacher_${
|
|
59
|
+
file: R,
|
|
60
|
+
name: `teacher_${r}_${a}`,
|
|
55
61
|
url: ""
|
|
56
62
|
},
|
|
57
63
|
{
|
|
58
64
|
file: A,
|
|
59
|
-
name: `student_${
|
|
65
|
+
name: `student_${o}_${i}`,
|
|
60
66
|
url: ""
|
|
61
67
|
}
|
|
62
68
|
]
|
|
63
|
-
}),
|
|
69
|
+
}), p(!1));
|
|
64
70
|
}, [
|
|
65
71
|
f,
|
|
66
72
|
s,
|
|
67
73
|
e == null ? void 0 : e.id,
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
74
|
+
F,
|
|
75
|
+
d,
|
|
76
|
+
t == null ? void 0 : t.id,
|
|
77
|
+
o,
|
|
78
|
+
i,
|
|
79
|
+
r,
|
|
80
|
+
a,
|
|
81
|
+
g
|
|
76
82
|
]), c(() => {
|
|
77
|
-
|
|
83
|
+
p(!0);
|
|
78
84
|
}, []);
|
|
79
|
-
},
|
|
85
|
+
}, K = b;
|
|
80
86
|
export {
|
|
81
|
-
|
|
87
|
+
K as default
|
|
82
88
|
};
|
|
83
89
|
//# sourceMappingURL=use-report-fraud.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-report-fraud.js","sources":["../../../../src/features/fraud-detection/hooks/use-report-fraud.ts"],"sourcesContent":["import { useCallback, useEffect, useState } from 'react';\n\nimport { useCaptureMediaStreamImage, useLocalPeer, useRemotePeers } from '@cuemath/av';\n\nimport { useUIContext } from '../../ui/context/context';\nimport { base64ToFile } from '../fraud-alert-modal/fraud-alert-modal-helpers';\nimport { type IUseFraudAlertProps } from './report-fraud-types';\nimport { FRAUD_DETECTION_ANALYTICS_EVENTS } from './report-fraud-analytics';\nimport useS3ImageUploadHelper from '../../hooks/use-s3-helper/use-s3-helper';\n\nconst QUERY = { type: 'class_fraud_login' };\n\nconst useReportFraud = ({\n teacherId,\n studentId,\n studentClassroomId,\n teacherClassroomId,\n classStartTs,\n studentName,\n}: IUseFraudAlertProps) => {\n const { onEvent } = useUIContext();\n\n const [canTrackEvent, setCanTrackEvent] = useState(false);\n const localpeer = useLocalPeer();\n const remotePeer = useRemotePeers().find(peer => peer.userId === teacherId);\n const captureMediaStreamImage = useCaptureMediaStreamImage();\n const uploadImages = useS3ImageUploadHelper({\n studentId,\n query: QUERY,\n });\n const onSuccess = useCallback(\n (urls: string[]) => {\n onEvent(FRAUD_DETECTION_ANALYTICS_EVENTS.FRAUD_LOGIN_TEACHER_ENTERED_CLASS_AS_STUDENT, {\n teacher_url: urls[0],\n student_url: urls[1],\n class_start_ts: new Date(classStartTs * 1000),\n
|
|
1
|
+
{"version":3,"file":"use-report-fraud.js","sources":["../../../../src/features/fraud-detection/hooks/use-report-fraud.ts"],"sourcesContent":["import { useCallback, useEffect, useState } from 'react';\n\nimport { useCaptureMediaStreamImage, useLocalPeer, useRemotePeers } from '@cuemath/av';\n\nimport { useUIContext } from '../../ui/context/context';\nimport { base64ToFile } from '../fraud-alert-modal/fraud-alert-modal-helpers';\nimport { type IUseFraudAlertProps } from './report-fraud-types';\nimport { FRAUD_DETECTION_ANALYTICS_EVENTS } from './report-fraud-analytics';\nimport useS3ImageUploadHelper from '../../hooks/use-s3-helper/use-s3-helper';\nimport { useReportFraudulentLogin } from '../api/report-fraudulent-login';\n\nconst QUERY = { type: 'class_fraud_login' };\n\nconst useReportFraud = ({\n teacherId,\n studentId,\n studentClassroomId,\n teacherClassroomId,\n classStartTs,\n studentName,\n}: IUseFraudAlertProps) => {\n const { onEvent } = useUIContext();\n\n const [canTrackEvent, setCanTrackEvent] = useState(false);\n const localpeer = useLocalPeer();\n const remotePeer = useRemotePeers().find(peer => peer.userId === teacherId);\n const captureMediaStreamImage = useCaptureMediaStreamImage();\n const uploadImages = useS3ImageUploadHelper({\n studentId,\n query: QUERY,\n });\n const { post: reportFraud } = useReportFraudulentLogin();\n const onSuccess = useCallback(\n (urls: string[]) => {\n onEvent(FRAUD_DETECTION_ANALYTICS_EVENTS.FRAUD_LOGIN_TEACHER_ENTERED_CLASS_AS_STUDENT, {\n student_classroom_id: studentClassroomId,\n student_id: studentId,\n student_name: studentName,\n teacher_classroom_id: teacherClassroomId,\n teacher_id: teacherId,\n teacher_url: urls[0] || '',\n student_url: urls[1] || '',\n class_start_ts: new Date(classStartTs * 1000),\n });\n\n reportFraud({\n student_classroom_id: studentClassroomId,\n teacher_s3_url: urls[0] || '',\n student_s3_url: urls[1] || '',\n });\n },\n [\n classStartTs,\n onEvent,\n reportFraud,\n studentClassroomId,\n studentId,\n studentName,\n teacherClassroomId,\n teacherId,\n ],\n );\n\n const onError = useCallback(() => {\n onEvent('fraud_detection_images_failed', { classStartTs, teacherId, studentId });\n }, [classStartTs, onEvent, studentId, teacherId]);\n\n useEffect(() => {\n if (!canTrackEvent || !remotePeer?.id || !localpeer?.id) {\n return;\n }\n\n const { image: teacherImage } = captureMediaStreamImage(remotePeer?.id, 'camera');\n const { image: studentImage } = captureMediaStreamImage(localpeer?.id, 'camera');\n const teacherFile = base64ToFile(teacherImage, `teacher-${Date.now()}.png`);\n const studentFile = base64ToFile(studentImage, `student-${Date.now()}.png`);\n\n if (!teacherFile || !studentFile) {\n return;\n }\n\n uploadImages({\n fileKey: `media/class_fraud_login/`,\n onSuccess,\n onError,\n images: [\n {\n file: teacherFile,\n name: `teacher_${teacherClassroomId}_${teacherId}`,\n url: '',\n },\n {\n file: studentFile,\n name: `student_${studentClassroomId}_${studentId}`,\n url: '',\n },\n ],\n });\n\n setCanTrackEvent(false);\n }, [\n canTrackEvent,\n captureMediaStreamImage,\n localpeer?.id,\n onError,\n onSuccess,\n remotePeer?.id,\n studentClassroomId,\n studentId,\n teacherClassroomId,\n teacherId,\n uploadImages,\n ]);\n\n const captureAndReportFraudImages = useCallback(() => {\n setCanTrackEvent(true);\n }, []);\n\n return captureAndReportFraudImages;\n};\n\nexport default useReportFraud;\n"],"names":["QUERY","useReportFraud","teacherId","studentId","studentClassroomId","teacherClassroomId","classStartTs","studentName","onEvent","useUIContext","canTrackEvent","setCanTrackEvent","useState","localpeer","useLocalPeer","remotePeer","useRemotePeers","peer","captureMediaStreamImage","useCaptureMediaStreamImage","uploadImages","useS3ImageUploadHelper","reportFraud","useReportFraudulentLogin","onSuccess","useCallback","urls","FRAUD_DETECTION_ANALYTICS_EVENTS","onError","useEffect","teacherImage","studentImage","teacherFile","base64ToFile","studentFile","useReportFraud$1"],"mappings":";;;;;;;AAWA,MAAMA,IAAQ,EAAE,MAAM,uBAEhBC,IAAiB,CAAC;AAAA,EACtB,WAAAC;AAAA,EACA,WAAAC;AAAA,EACA,oBAAAC;AAAA,EACA,oBAAAC;AAAA,EACA,cAAAC;AAAA,EACA,aAAAC;AACF,MAA2B;AACnB,QAAA,EAAE,SAAAC,MAAYC,KAEd,CAACC,GAAeC,CAAgB,IAAIC,EAAS,EAAK,GAClDC,IAAYC,KACZC,IAAaC,EAAe,EAAE,KAAK,CAAQC,MAAAA,EAAK,WAAWf,CAAS,GACpEgB,IAA0BC,KAC1BC,IAAeC,EAAuB;AAAA,IAC1C,WAAAlB;AAAA,IACA,OAAOH;AAAA,EAAA,CACR,GACK,EAAE,MAAMsB,EAAY,IAAIC,EAAyB,GACjDC,IAAYC;AAAA,IAChB,CAACC,MAAmB;AAClB,MAAAlB,EAAQmB,EAAiC,8CAA8C;AAAA,QACrF,sBAAsBvB;AAAA,QACtB,YAAYD;AAAA,QACZ,cAAcI;AAAA,QACd,sBAAsBF;AAAA,QACtB,YAAYH;AAAA,QACZ,aAAawB,EAAK,CAAC,KAAK;AAAA,QACxB,aAAaA,EAAK,CAAC,KAAK;AAAA,QACxB,gBAAgB,IAAI,KAAKpB,IAAe,GAAI;AAAA,MAAA,CAC7C,GAEWgB,EAAA;AAAA,QACV,sBAAsBlB;AAAA,QACtB,gBAAgBsB,EAAK,CAAC,KAAK;AAAA,QAC3B,gBAAgBA,EAAK,CAAC,KAAK;AAAA,MAAA,CAC5B;AAAA,IACH;AAAA,IACA;AAAA,MACEpB;AAAA,MACAE;AAAA,MACAc;AAAA,MACAlB;AAAA,MACAD;AAAA,MACAI;AAAA,MACAF;AAAA,MACAH;AAAA,IACF;AAAA,EAAA,GAGI0B,IAAUH,EAAY,MAAM;AAChC,IAAAjB,EAAQ,iCAAiC,EAAE,cAAAF,GAAc,WAAAJ,GAAW,WAAAC,EAAW,CAAA;AAAA,KAC9E,CAACG,GAAcE,GAASL,GAAWD,CAAS,CAAC;AAEhD,SAAA2B,EAAU,MAAM;AACd,QAAI,CAACnB,KAAiB,EAACK,KAAA,QAAAA,EAAY,OAAM,EAACF,KAAA,QAAAA,EAAW;AACnD;AAGF,UAAM,EAAE,OAAOiB,MAAiBZ,EAAwBH,KAAA,gBAAAA,EAAY,IAAI,QAAQ,GAC1E,EAAE,OAAOgB,MAAiBb,EAAwBL,KAAA,gBAAAA,EAAW,IAAI,QAAQ,GACzEmB,IAAcC,EAAaH,GAAc,WAAW,KAAK,IAAA,CAAK,MAAM,GACpEI,IAAcD,EAAaF,GAAc,WAAW,KAAK,IAAA,CAAK,MAAM;AAEtE,IAAA,CAACC,KAAe,CAACE,MAIRd,EAAA;AAAA,MACX,SAAS;AAAA,MACT,WAAAI;AAAA,MACA,SAAAI;AAAA,MACA,QAAQ;AAAA,QACN;AAAA,UACE,MAAMI;AAAA,UACN,MAAM,WAAW3B,CAAkB,IAAIH,CAAS;AAAA,UAChD,KAAK;AAAA,QACP;AAAA,QACA;AAAA,UACE,MAAMgC;AAAA,UACN,MAAM,WAAW9B,CAAkB,IAAID,CAAS;AAAA,UAChD,KAAK;AAAA,QACP;AAAA,MACF;AAAA,IAAA,CACD,GAEDQ,EAAiB,EAAK;AAAA,EAAA,GACrB;AAAA,IACDD;AAAA,IACAQ;AAAA,IACAL,KAAA,gBAAAA,EAAW;AAAA,IACXe;AAAA,IACAJ;AAAA,IACAT,KAAA,gBAAAA,EAAY;AAAA,IACZX;AAAA,IACAD;AAAA,IACAE;AAAA,IACAH;AAAA,IACAkB;AAAA,EAAA,CACD,GAEmCK,EAAY,MAAM;AACpD,IAAAd,EAAiB,EAAI;AAAA,EACvB,GAAG,CAAE,CAAA;AAGP,GAEAwB,IAAelC;"}
|
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
const m = (
|
|
2
|
-
let
|
|
3
|
-
const
|
|
4
|
-
return
|
|
5
|
-
roundedHour:
|
|
1
|
+
const m = (o, n) => {
|
|
2
|
+
let r = typeof o == "string" ? parseInt(o, 10) : o, t = typeof n == "string" ? parseInt(n, 10) : n;
|
|
3
|
+
const a = t % 15;
|
|
4
|
+
return a >= 8 ? (t += 15 - a, t === 60 && (t = 0, r += 1, r === 24 && (r = 0))) : t -= a, {
|
|
5
|
+
roundedHour: r.toString().padStart(2, "0"),
|
|
6
6
|
roundedMinute: t.toString().padStart(2, "0")
|
|
7
7
|
};
|
|
8
|
-
}, c = (
|
|
9
|
-
const
|
|
8
|
+
}, c = (o, n) => {
|
|
9
|
+
const r = new Date(o), t = {
|
|
10
10
|
weekday: "long",
|
|
11
11
|
hour: "2-digit",
|
|
12
12
|
minute: "2-digit",
|
|
13
13
|
hour12: !0,
|
|
14
14
|
timeZone: n
|
|
15
|
-
}, p = new Intl.DateTimeFormat("en-US", t).formatToParts(
|
|
16
|
-
let
|
|
15
|
+
}, p = new Intl.DateTimeFormat("en-US", t).formatToParts(r);
|
|
16
|
+
let i = "", d = "", u = "", s = "";
|
|
17
17
|
for (const e of p)
|
|
18
|
-
e.type === "weekday" && (
|
|
18
|
+
e.type === "weekday" && (i = e.value), e.type === "hour" && (d = e.value), e.type === "minute" && (u = e.value), e.type === "dayPeriod" && (s = e.value);
|
|
19
19
|
const { roundedHour: f, roundedMinute: l } = m(d, u);
|
|
20
20
|
return {
|
|
21
|
-
day:
|
|
21
|
+
day: i,
|
|
22
22
|
time: `${f}:${l} ${s}`
|
|
23
23
|
};
|
|
24
24
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helpers.js","sources":["../../../../../src/features/trial-session/comps/class-preference/helpers.ts"],"sourcesContent":["/**\n * Rounds a given hour and minute to the nearest 15-minute interval.\n * @param hour string or number\n * @param minute string or number\n * @returns { roundedHour: string, roundedMinute: string }\n */\nconst roundToNearest15Min = (\n hour: string | number,\n minute: string | number,\n): { roundedHour: string; roundedMinute: string } => {\n let h = typeof hour === 'string' ? parseInt(hour, 10) : hour;\n let m = typeof minute === 'string' ? parseInt(minute, 10) : minute;\n // Round down to nearest 15\n const remainder = m % 15;\n\n if (remainder >= 8) {\n m += 15 - remainder;\n if (m === 60) {\n m = 0;\n h += 1;\n if (h === 24) h = 0;\n }\n } else {\n m -= remainder;\n }\n\n return {\n roundedHour: h.toString(),\n roundedMinute: m.toString().padStart(2, '0'),\n };\n};\n\n/**\n * Extracts day and time in 'hh:mm AM/PM' format from epoch and timezone.\n * @param epoch Epoch timestamp (number)\n * @param timezone IANA timezone string (e.g., 'Asia/Kolkata')\n * @returns { day: string, time: string }\n */\nconst extractDayAndTimeFromEpoch = (\n epoch: number,\n timezone: string,\n): { day: string; time: string } => {\n // Use Intl.DateTimeFormat for timezone conversion\n const date = new Date(epoch);\n const options: Intl.DateTimeFormatOptions = {\n weekday: 'long',\n hour: '2-digit',\n minute: '2-digit',\n hour12: true,\n timeZone: timezone,\n };\n const formatter = new Intl.DateTimeFormat('en-US', options);\n const parts = formatter.formatToParts(date);\n let day = '';\n let hour = '';\n let minute = '';\n let period = '';\n\n for (const part of parts) {\n if (part.type === 'weekday') day = part.value;\n\n if (part.type === 'hour') hour = part.value;\n\n if (part.type === 'minute') minute = part.value;\n\n if (part.type === 'dayPeriod') period = part.value;\n }\n const { roundedHour, roundedMinute } = roundToNearest15Min(hour, minute);\n\n return {\n day,\n time: `${roundedHour}:${roundedMinute} ${period}`,\n };\n};\n\nexport { extractDayAndTimeFromEpoch };\n"],"names":["roundToNearest15Min","hour","minute","h","m","remainder","extractDayAndTimeFromEpoch","epoch","timezone","date","options","parts","day","period","part","roundedHour","roundedMinute"],"mappings":"AAMA,MAAMA,IAAsB,CAC1BC,GACAC,MACmD;AACnD,MAAIC,IAAI,OAAOF,KAAS,WAAW,SAASA,GAAM,EAAE,IAAIA,GACpDG,IAAI,OAAOF,KAAW,WAAW,SAASA,GAAQ,EAAE,IAAIA;AAE5D,QAAMG,IAAYD,IAAI;AAEtB,SAAIC,KAAa,KACfD,KAAK,KAAKC,GACND,MAAM,OACJA,IAAA,GACCD,KAAA,GACDA,MAAM,OAAQA,IAAA,OAGfC,KAAAC,GAGA;AAAA,IACL,aAAaF,EAAE,SAAS;AAAA,
|
|
1
|
+
{"version":3,"file":"helpers.js","sources":["../../../../../src/features/trial-session/comps/class-preference/helpers.ts"],"sourcesContent":["/**\n * Rounds a given hour and minute to the nearest 15-minute interval.\n * @param hour string or number\n * @param minute string or number\n * @returns { roundedHour: string, roundedMinute: string }\n */\nconst roundToNearest15Min = (\n hour: string | number,\n minute: string | number,\n): { roundedHour: string; roundedMinute: string } => {\n let h = typeof hour === 'string' ? parseInt(hour, 10) : hour;\n let m = typeof minute === 'string' ? parseInt(minute, 10) : minute;\n // Round down to nearest 15\n const remainder = m % 15;\n\n if (remainder >= 8) {\n m += 15 - remainder;\n if (m === 60) {\n m = 0;\n h += 1;\n if (h === 24) h = 0;\n }\n } else {\n m -= remainder;\n }\n\n return {\n roundedHour: h.toString().padStart(2, '0'),\n roundedMinute: m.toString().padStart(2, '0'),\n };\n};\n\n/**\n * Extracts day and time in 'hh:mm AM/PM' format from epoch and timezone.\n * @param epoch Epoch timestamp (number)\n * @param timezone IANA timezone string (e.g., 'Asia/Kolkata')\n * @returns { day: string, time: string }\n */\nconst extractDayAndTimeFromEpoch = (\n epoch: number,\n timezone: string,\n): { day: string; time: string } => {\n // Use Intl.DateTimeFormat for timezone conversion\n const date = new Date(epoch);\n const options: Intl.DateTimeFormatOptions = {\n weekday: 'long',\n hour: '2-digit',\n minute: '2-digit',\n hour12: true,\n timeZone: timezone,\n };\n const formatter = new Intl.DateTimeFormat('en-US', options);\n const parts = formatter.formatToParts(date);\n let day = '';\n let hour = '';\n let minute = '';\n let period = '';\n\n for (const part of parts) {\n if (part.type === 'weekday') day = part.value;\n\n if (part.type === 'hour') hour = part.value;\n\n if (part.type === 'minute') minute = part.value;\n\n if (part.type === 'dayPeriod') period = part.value;\n }\n const { roundedHour, roundedMinute } = roundToNearest15Min(hour, minute);\n\n return {\n day,\n time: `${roundedHour}:${roundedMinute} ${period}`,\n };\n};\n\nexport { extractDayAndTimeFromEpoch };\n"],"names":["roundToNearest15Min","hour","minute","h","m","remainder","extractDayAndTimeFromEpoch","epoch","timezone","date","options","parts","day","period","part","roundedHour","roundedMinute"],"mappings":"AAMA,MAAMA,IAAsB,CAC1BC,GACAC,MACmD;AACnD,MAAIC,IAAI,OAAOF,KAAS,WAAW,SAASA,GAAM,EAAE,IAAIA,GACpDG,IAAI,OAAOF,KAAW,WAAW,SAASA,GAAQ,EAAE,IAAIA;AAE5D,QAAMG,IAAYD,IAAI;AAEtB,SAAIC,KAAa,KACfD,KAAK,KAAKC,GACND,MAAM,OACJA,IAAA,GACCD,KAAA,GACDA,MAAM,OAAQA,IAAA,OAGfC,KAAAC,GAGA;AAAA,IACL,aAAaF,EAAE,SAAA,EAAW,SAAS,GAAG,GAAG;AAAA,IACzC,eAAeC,EAAE,SAAA,EAAW,SAAS,GAAG,GAAG;AAAA,EAAA;AAE/C,GAQME,IAA6B,CACjCC,GACAC,MACkC;AAE5B,QAAAC,IAAO,IAAI,KAAKF,CAAK,GACrBG,IAAsC;AAAA,IAC1C,SAAS;AAAA,IACT,MAAM;AAAA,IACN,QAAQ;AAAA,IACR,QAAQ;AAAA,IACR,UAAUF;AAAA,EAAA,GAGNG,IADY,IAAI,KAAK,eAAe,SAASD,CAAO,EAClC,cAAcD,CAAI;AAC1C,MAAIG,IAAM,IACNX,IAAO,IACPC,IAAS,IACTW,IAAS;AAEb,aAAWC,KAAQH;AACjB,IAAIG,EAAK,SAAS,cAAWF,IAAME,EAAK,QAEpCA,EAAK,SAAS,WAAQb,IAAOa,EAAK,QAElCA,EAAK,SAAS,aAAUZ,IAASY,EAAK,QAEtCA,EAAK,SAAS,gBAAaD,IAASC,EAAK;AAE/C,QAAM,EAAE,aAAAC,GAAa,eAAAC,EAAA,IAAkBhB,EAAoBC,GAAMC,CAAM;AAEhE,SAAA;AAAA,IACL,KAAAU;AAAA,IACA,MAAM,GAAGG,CAAW,IAAIC,CAAa,IAAIH,CAAM;AAAA,EAAA;AAEnD;"}
|
package/dist/features/trial-session/comps/confirmation-modal/hooks/use-confirmation-modal.js
CHANGED
|
@@ -1,47 +1,42 @@
|
|
|
1
|
-
import { useState as
|
|
2
|
-
import { useTrialSessionContext as
|
|
3
|
-
import { TrialPageId as
|
|
4
|
-
const
|
|
5
|
-
const [
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
},
|
|
9
|
-
}, []),
|
|
10
|
-
switch (
|
|
11
|
-
case
|
|
12
|
-
|
|
13
|
-
id: o ?
|
|
1
|
+
import { useState as h, useRef as C, useCallback as l, useMemo as N, useEffect as d } from "react";
|
|
2
|
+
import { useTrialSessionContext as E } from "../../../context/use-trial-session-context.js";
|
|
3
|
+
import { TrialPageId as r } from "../../../trial-session-constants.js";
|
|
4
|
+
const M = 500, O = () => {
|
|
5
|
+
const [m, a] = h(!1), { slideConfig: T, formData: p, demoType: A, updateSlideConfig: t } = E(), { id: s } = T, { confirmationModalActive: c } = p || {}, e = C(null), o = A === "TRIAL_V3", n = l(() => {
|
|
6
|
+
e.current && clearTimeout(e.current), e.current = setTimeout(() => {
|
|
7
|
+
a(!1), e.current = null;
|
|
8
|
+
}, M);
|
|
9
|
+
}, []), u = l(() => {
|
|
10
|
+
switch (s) {
|
|
11
|
+
case r.LEARNING_WORKSHEET:
|
|
12
|
+
t({
|
|
13
|
+
id: o ? r.LEARNING_LEVEL : r.STUDENT_INFORMATION,
|
|
14
14
|
confirmationModalActive: !1,
|
|
15
15
|
resetAttempt: !0,
|
|
16
16
|
selectedTopics: void 0
|
|
17
|
-
}), n
|
|
18
|
-
slideToUpdate: {
|
|
19
|
-
slideId: o ? e.LEARNING_LEVEL : e.TOPIC_SELECTION,
|
|
20
|
-
newNextPage: { buttonLabel: "Questions", pageId: e.LEARNING_WORKSHEET }
|
|
21
|
-
}
|
|
22
|
-
}), i();
|
|
17
|
+
}), n();
|
|
23
18
|
break;
|
|
24
19
|
default:
|
|
25
20
|
return null;
|
|
26
21
|
}
|
|
27
|
-
}, [
|
|
28
|
-
|
|
29
|
-
}, [
|
|
22
|
+
}, [s, t, o, n]), f = l(() => {
|
|
23
|
+
t({ confirmationModalActive: !1 }), n();
|
|
24
|
+
}, [t, n]), g = N(
|
|
30
25
|
() => ({
|
|
31
|
-
[
|
|
26
|
+
[r.LEARNING_WORKSHEET]: {
|
|
32
27
|
title: o ? "Changing the session level will reset current progress. Are you sure?" : "You will lose the current progress. Do you still wish to change the grade, level, or chapters for the session?",
|
|
33
28
|
confirmText: o ? "Yes, change session level" : "Yes, reset",
|
|
34
|
-
onConfirm:
|
|
35
|
-
onCancel:
|
|
29
|
+
onConfirm: u,
|
|
30
|
+
onCancel: f
|
|
36
31
|
}
|
|
37
32
|
}),
|
|
38
|
-
[
|
|
39
|
-
),
|
|
40
|
-
return
|
|
41
|
-
|
|
42
|
-
}, [
|
|
43
|
-
|
|
44
|
-
}, []), { modalConfig:
|
|
33
|
+
[f, u, o]
|
|
34
|
+
), i = s ? g[s] : void 0;
|
|
35
|
+
return d(() => {
|
|
36
|
+
c && i && a(!0);
|
|
37
|
+
}, [c, i]), d(() => () => {
|
|
38
|
+
e.current && clearTimeout(e.current);
|
|
39
|
+
}, []), { modalConfig: i, openModal: m };
|
|
45
40
|
};
|
|
46
41
|
export {
|
|
47
42
|
O as default
|
package/dist/features/trial-session/comps/confirmation-modal/hooks/use-confirmation-modal.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-confirmation-modal.js","sources":["../../../../../../src/features/trial-session/comps/confirmation-modal/hooks/use-confirmation-modal.ts"],"sourcesContent":["import { useCallback, useEffect, useMemo, useRef, useState } from 'react';\n\nimport { useTrialSessionContext } from '../../../context/use-trial-session-context';\nimport { TrialPageId } from '../../../trial-session-constants';\n\nconst ANIMATION_DURATION_MS = 500;\n\ninterface IConfirmationModalConfig {\n title: string;\n confirmText?: string;\n cancelText?: string;\n onConfirm: () => void;\n onCancel: () => void;\n}\n\ninterface IConfirmationModalReturn {\n modalConfig: IConfirmationModalConfig | undefined;\n openModal: boolean;\n}\n\nconst useConfirmationModal = (): IConfirmationModalReturn => {\n const [openModal, setOpenModal] = useState(false);\n const { slideConfig, formData, demoType, updateSlideConfig
|
|
1
|
+
{"version":3,"file":"use-confirmation-modal.js","sources":["../../../../../../src/features/trial-session/comps/confirmation-modal/hooks/use-confirmation-modal.ts"],"sourcesContent":["import { useCallback, useEffect, useMemo, useRef, useState } from 'react';\n\nimport { useTrialSessionContext } from '../../../context/use-trial-session-context';\nimport { TrialPageId } from '../../../trial-session-constants';\n\nconst ANIMATION_DURATION_MS = 500;\n\ninterface IConfirmationModalConfig {\n title: string;\n confirmText?: string;\n cancelText?: string;\n onConfirm: () => void;\n onCancel: () => void;\n}\n\ninterface IConfirmationModalReturn {\n modalConfig: IConfirmationModalConfig | undefined;\n openModal: boolean;\n}\n\nconst useConfirmationModal = (): IConfirmationModalReturn => {\n const [openModal, setOpenModal] = useState(false);\n const { slideConfig, formData, demoType, updateSlideConfig } = useTrialSessionContext();\n const { id } = slideConfig;\n const { confirmationModalActive } = formData || {};\n const timeoutRef = useRef<NodeJS.Timeout | null>(null);\n const isTrialV3 = demoType === 'TRIAL_V3';\n\n const closeModal = useCallback(() => {\n if (timeoutRef.current) {\n clearTimeout(timeoutRef.current);\n }\n\n timeoutRef.current = setTimeout(() => {\n setOpenModal(false);\n timeoutRef.current = null;\n }, ANIMATION_DURATION_MS);\n }, []);\n\n const handleConfirm = useCallback(() => {\n switch (id) {\n case TrialPageId.LEARNING_WORKSHEET:\n updateSlideConfig({\n id: isTrialV3 ? TrialPageId.LEARNING_LEVEL : TrialPageId.STUDENT_INFORMATION,\n confirmationModalActive: false,\n resetAttempt: true,\n selectedTopics: undefined,\n });\n closeModal();\n break;\n default:\n return null;\n }\n }, [id, updateSlideConfig, isTrialV3, closeModal]);\n\n const handleCancel = useCallback(() => {\n updateSlideConfig({ confirmationModalActive: false });\n closeModal();\n }, [updateSlideConfig, closeModal]);\n\n const modalConfigs: Partial<Record<TrialPageId, IConfirmationModalConfig>> = useMemo(\n () => ({\n [TrialPageId.LEARNING_WORKSHEET]: {\n title: isTrialV3\n ? 'Changing the session level will reset current progress. Are you sure?'\n : 'You will lose the current progress. Do you still wish to change the grade, level, or chapters for the session?',\n confirmText: isTrialV3 ? 'Yes, change session level' : 'Yes, reset',\n onConfirm: handleConfirm,\n onCancel: handleCancel,\n },\n }),\n [handleCancel, handleConfirm, isTrialV3],\n );\n\n const modalConfig = id ? modalConfigs[id] : undefined;\n\n useEffect(() => {\n if (confirmationModalActive && modalConfig) setOpenModal(true);\n }, [confirmationModalActive, modalConfig]);\n\n useEffect(() => {\n return () => {\n if (timeoutRef.current) {\n clearTimeout(timeoutRef.current);\n }\n };\n }, []);\n\n return { modalConfig, openModal };\n};\n\nexport default useConfirmationModal;\n"],"names":["ANIMATION_DURATION_MS","useConfirmationModal","openModal","setOpenModal","useState","slideConfig","formData","demoType","updateSlideConfig","useTrialSessionContext","id","confirmationModalActive","timeoutRef","useRef","isTrialV3","closeModal","useCallback","handleConfirm","TrialPageId","handleCancel","modalConfigs","useMemo","modalConfig","useEffect"],"mappings":";;;AAKA,MAAMA,IAAwB,KAexBC,IAAuB,MAAgC;AAC3D,QAAM,CAACC,GAAWC,CAAY,IAAIC,EAAS,EAAK,GAC1C,EAAE,aAAAC,GAAa,UAAAC,GAAU,UAAAC,GAAU,mBAAAC,EAAA,IAAsBC,KACzD,EAAE,IAAAC,EAAO,IAAAL,GACT,EAAE,yBAAAM,EAAA,IAA4BL,KAAY,IAC1CM,IAAaC,EAA8B,IAAI,GAC/CC,IAAYP,MAAa,YAEzBQ,IAAaC,EAAY,MAAM;AACnC,IAAIJ,EAAW,WACb,aAAaA,EAAW,OAAO,GAGtBA,EAAA,UAAU,WAAW,MAAM;AACpC,MAAAT,EAAa,EAAK,GAClBS,EAAW,UAAU;AAAA,OACpBZ,CAAqB;AAAA,EAC1B,GAAG,CAAE,CAAA,GAECiB,IAAgBD,EAAY,MAAM;AACtC,YAAQN,GAAI;AAAA,MACV,KAAKQ,EAAY;AACG,QAAAV,EAAA;AAAA,UAChB,IAAIM,IAAYI,EAAY,iBAAiBA,EAAY;AAAA,UACzD,yBAAyB;AAAA,UACzB,cAAc;AAAA,UACd,gBAAgB;AAAA,QAAA,CACjB,GACUH;AACX;AAAA,MACF;AACS,eAAA;AAAA,IACX;AAAA,KACC,CAACL,GAAIF,GAAmBM,GAAWC,CAAU,CAAC,GAE3CI,IAAeH,EAAY,MAAM;AACnB,IAAAR,EAAA,EAAE,yBAAyB,GAAA,CAAO,GACzCO;EAAA,GACV,CAACP,GAAmBO,CAAU,CAAC,GAE5BK,IAAuEC;AAAA,IAC3E,OAAO;AAAA,MACL,CAACH,EAAY,kBAAkB,GAAG;AAAA,QAChC,OAAOJ,IACH,0EACA;AAAA,QACJ,aAAaA,IAAY,8BAA8B;AAAA,QACvD,WAAWG;AAAA,QACX,UAAUE;AAAA,MACZ;AAAA,IAAA;AAAA,IAEF,CAACA,GAAcF,GAAeH,CAAS;AAAA,EAAA,GAGnCQ,IAAcZ,IAAKU,EAAaV,CAAE,IAAI;AAE5C,SAAAa,EAAU,MAAM;AACV,IAAAZ,KAA2BW,KAAanB,EAAa,EAAI;AAAA,EAAA,GAC5D,CAACQ,GAAyBW,CAAW,CAAC,GAEzCC,EAAU,MACD,MAAM;AACX,IAAIX,EAAW,WACb,aAAaA,EAAW,OAAO;AAAA,EACjC,GAED,CAAE,CAAA,GAEE,EAAE,aAAAU,GAAa,WAAApB;AACxB;"}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { jsxs as t, jsx as r } from "react/jsx-runtime";
|
|
2
2
|
import i from "../../../../ui/layout/flex-view.js";
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import { TipContainer as
|
|
6
|
-
const
|
|
7
|
-
/* @__PURE__ */ r(
|
|
8
|
-
/* @__PURE__ */ r(
|
|
9
|
-
/* @__PURE__ */ t(
|
|
3
|
+
import s from "../../../../ui/separator/separator.js";
|
|
4
|
+
import a from "../../../../ui/text/text.js";
|
|
5
|
+
import { TipContainer as c, CheckIcon as f, TipText as n, CrossIcon as p } from "./tips-styled.js";
|
|
6
|
+
const u = ({ dos: o, donts: l }) => /* @__PURE__ */ t(i, { children: [
|
|
7
|
+
/* @__PURE__ */ r(a, { $renderAs: "ac4", $color: "REAL_BLACK_60", children: "Tips" }),
|
|
8
|
+
/* @__PURE__ */ r(s, { height: 8 }),
|
|
9
|
+
/* @__PURE__ */ t(c, { $flexDirection: "column", $flexGap: 8, children: [
|
|
10
10
|
o.map((e) => /* @__PURE__ */ t(
|
|
11
11
|
i,
|
|
12
12
|
{
|
|
@@ -15,13 +15,13 @@ const m = ({ dos: o, donts: s }) => /* @__PURE__ */ t(i, { children: [
|
|
|
15
15
|
$alignItems: "start",
|
|
16
16
|
$flexGap: 8,
|
|
17
17
|
children: [
|
|
18
|
-
/* @__PURE__ */ r(
|
|
18
|
+
/* @__PURE__ */ r(f, {}),
|
|
19
19
|
/* @__PURE__ */ r(n, { $renderAs: "ub3", children: e })
|
|
20
20
|
]
|
|
21
21
|
},
|
|
22
22
|
e
|
|
23
23
|
)),
|
|
24
|
-
|
|
24
|
+
l.map((e) => /* @__PURE__ */ t(
|
|
25
25
|
i,
|
|
26
26
|
{
|
|
27
27
|
$flexDirection: "row",
|
|
@@ -29,15 +29,15 @@ const m = ({ dos: o, donts: s }) => /* @__PURE__ */ t(i, { children: [
|
|
|
29
29
|
$alignItems: "start",
|
|
30
30
|
$flexGap: 8,
|
|
31
31
|
children: [
|
|
32
|
-
/* @__PURE__ */ r(
|
|
32
|
+
/* @__PURE__ */ r(p, {}),
|
|
33
33
|
/* @__PURE__ */ r(n, { $renderAs: "ub3", children: e })
|
|
34
34
|
]
|
|
35
35
|
},
|
|
36
36
|
e
|
|
37
37
|
))
|
|
38
38
|
] })
|
|
39
|
-
] })
|
|
39
|
+
] });
|
|
40
40
|
export {
|
|
41
|
-
|
|
41
|
+
u as default
|
|
42
42
|
};
|
|
43
43
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../../../src/features/trial-session/comps/cue-tips/tips/index.tsx"],"sourcesContent":["import type { FC } from 'react';\n\nimport FlexView from '../../../../ui/layout/flex-view';\nimport Separator from '../../../../ui/separator/separator';\nimport Text from '../../../../ui/text/text';\nimport * as Styled from './tips-styled';\n\nconst Tips: FC<{ dos: string[]; donts: string[] }> = ({ dos, donts }) => {\n return (\n <FlexView>\n <Text $renderAs=\"ac4\" $color=\"REAL_BLACK_60\">\n Tips\n </Text>\n <Separator height={8} />\n <Styled.TipContainer $flexDirection=\"column\" $flexGap={8}>\n {dos.map(doText => {\n return (\n <FlexView\n key={doText}\n $flexDirection=\"row\"\n $justifyContent=\"flex-start\"\n $alignItems=\"start\"\n $flexGap={8}\n >\n <Styled.CheckIcon />\n <Styled.TipText $renderAs=\"ub3\">{doText}</Styled.TipText>\n </FlexView>\n );\n })}\n {donts.map(dontText => {\n return (\n <FlexView\n key={dontText}\n $flexDirection=\"row\"\n $justifyContent=\"flex-start\"\n $alignItems=\"start\"\n $flexGap={8}\n >\n <Styled.CrossIcon />\n <Styled.TipText $renderAs=\"ub3\">{dontText}</Styled.TipText>\n </FlexView>\n );\n })}\n </Styled.TipContainer>\n </FlexView>\n );\n};\n\nexport default Tips;\n"],"names":["Tips","dos","donts","FlexView","jsx","Text","Separator","Styled.TipContainer","doText","jsxs","Styled.CheckIcon","Styled.TipText","dontText","Styled.CrossIcon"
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../../../src/features/trial-session/comps/cue-tips/tips/index.tsx"],"sourcesContent":["import type { FC } from 'react';\n\nimport FlexView from '../../../../ui/layout/flex-view';\nimport Separator from '../../../../ui/separator/separator';\nimport Text from '../../../../ui/text/text';\nimport * as Styled from './tips-styled';\n\nconst Tips: FC<{ dos: string[]; donts: string[] }> = ({ dos, donts }) => {\n return (\n <FlexView>\n <Text $renderAs=\"ac4\" $color=\"REAL_BLACK_60\">\n Tips\n </Text>\n <Separator height={8} />\n <Styled.TipContainer $flexDirection=\"column\" $flexGap={8}>\n {dos.map(doText => {\n return (\n <FlexView\n key={doText}\n $flexDirection=\"row\"\n $justifyContent=\"flex-start\"\n $alignItems=\"start\"\n $flexGap={8}\n >\n <Styled.CheckIcon />\n <Styled.TipText $renderAs=\"ub3\">{doText}</Styled.TipText>\n </FlexView>\n );\n })}\n {donts.map(dontText => {\n return (\n <FlexView\n key={dontText}\n $flexDirection=\"row\"\n $justifyContent=\"flex-start\"\n $alignItems=\"start\"\n $flexGap={8}\n >\n <Styled.CrossIcon />\n <Styled.TipText $renderAs=\"ub3\">{dontText}</Styled.TipText>\n </FlexView>\n );\n })}\n </Styled.TipContainer>\n </FlexView>\n );\n};\n\nexport default Tips;\n"],"names":["Tips","dos","donts","FlexView","jsx","Text","Separator","Styled.TipContainer","doText","jsxs","Styled.CheckIcon","Styled.TipText","dontText","Styled.CrossIcon"],"mappings":";;;;;AAOA,MAAMA,IAA+C,CAAC,EAAE,KAAAC,GAAK,OAAAC,0BAExDC,GACC,EAAA,UAAA;AAAA,EAAA,gBAAAC,EAACC,GAAK,EAAA,WAAU,OAAM,QAAO,iBAAgB,UAE7C,QAAA;AAAA,EACA,gBAAAD,EAACE,GAAU,EAAA,QAAQ,EAAG,CAAA;AAAA,oBACrBC,GAAA,EAAoB,gBAAe,UAAS,UAAU,GACpD,UAAA;AAAA,IAAAN,EAAI,IAAI,CAAUO,MAEf,gBAAAC;AAAA,MAACN;AAAA,MAAA;AAAA,QAEC,gBAAe;AAAA,QACf,iBAAgB;AAAA,QAChB,aAAY;AAAA,QACZ,UAAU;AAAA,QAEV,UAAA;AAAA,UAAC,gBAAAC,EAAAM,GAAA,EAAiB;AAAA,4BACjBC,GAAA,EAAe,WAAU,OAAO,UAAOH,GAAA;AAAA,QAAA;AAAA,MAAA;AAAA,MAPnCA;AAAA,IAAA,CAUV;AAAA,IACAN,EAAM,IAAI,CAAYU,MAEnB,gBAAAH;AAAA,MAACN;AAAA,MAAA;AAAA,QAEC,gBAAe;AAAA,QACf,iBAAgB;AAAA,QAChB,aAAY;AAAA,QACZ,UAAU;AAAA,QAEV,UAAA;AAAA,UAAC,gBAAAC,EAAAS,GAAA,EAAiB;AAAA,4BACjBF,GAAA,EAAe,WAAU,OAAO,UAASC,GAAA;AAAA,QAAA;AAAA,MAAA;AAAA,MAPrCA;AAAA,IAAA,CAUV;AAAA,EAAA,GACH;AACF,EAAA,CAAA;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"session-overview-styled.js","sources":["../../../../../src/features/trial-session/comps/session-overview/session-overview-styled.tsx"],"sourcesContent":["import styled from 'styled-components';\n\nimport { RIGHT_PANEL_CONTENT_WIDTH } from '../../trial-session-constants';\n\ntype TSessionGoal = {\n $bgImage: string;\n};\n\nconst Container = styled.div`\n width: 100%;\n height: 100%;\n`;\n\nconst GoalsWrapper = styled.div(({ theme }) => {\n const { BLACK_T_87 } = theme.colors;\n\n return `\n width: ${RIGHT_PANEL_CONTENT_WIDTH - 100}px;\n margin: auto;\n border: 1px solid ${BLACK_T_87};\n & > *:not(:last-child) {\n border-bottom: 1px solid ${BLACK_T_87};\n }\n .period-text {\n margin-left:
|
|
1
|
+
{"version":3,"file":"session-overview-styled.js","sources":["../../../../../src/features/trial-session/comps/session-overview/session-overview-styled.tsx"],"sourcesContent":["import styled from 'styled-components';\n\nimport { RIGHT_PANEL_CONTENT_WIDTH } from '../../trial-session-constants';\n\ntype TSessionGoal = {\n $bgImage: string;\n};\n\nconst Container = styled.div`\n width: 100%;\n height: 100%;\n`;\n\nconst GoalsWrapper = styled.div(({ theme }) => {\n const { BLACK_T_87 } = theme.colors;\n\n return `\n width: ${RIGHT_PANEL_CONTENT_WIDTH - 100}px;\n margin: auto;\n border: 1px solid ${BLACK_T_87};\n & > *:not(:last-child) {\n border-bottom: 1px solid ${BLACK_T_87};\n }\n .period-text {\n margin-left: 23px;\n }\n `;\n});\n\nconst Goal = styled.div<TSessionGoal>(({ theme, $bgImage }) => {\n const { gutter } = theme.layout;\n\n return `\n width: 100%;\n padding: ${gutter * 2.5}px ${gutter}px;\n background-image: url(${$bgImage});\n background-repeat: no-repeat;\n background-position: right, center;\n background-size: cover;\n `;\n});\n\nexport { Container, GoalsWrapper, Goal };\n"],"names":["Container","styled","GoalsWrapper","theme","BLACK_T_87","RIGHT_PANEL_CONTENT_WIDTH","Goal","$bgImage","gutter"],"mappings":";;AAQA,MAAMA,IAAYC,EAAO;AAAA;AAAA;AAAA,GAKnBC,IAAeD,EAAO,IAAI,CAAC,EAAE,OAAAE,QAAY;AACvC,QAAA,EAAE,YAAAC,EAAW,IAAID,EAAM;AAEtB,SAAA;AAAA,aACIE,IAA4B,GAAG;AAAA;AAAA,wBAEpBD,CAAU;AAAA;AAAA,iCAEDA,CAAU;AAAA;AAAA;AAAA;AAAA;AAAA;AAM3C,CAAC,GAEKE,IAAOL,EAAO,IAAkB,CAAC,EAAE,OAAAE,GAAO,UAAAI,QAAe;AACvD,QAAA,EAAE,QAAAC,EAAO,IAAIL,EAAM;AAElB,SAAA;AAAA;AAAA,eAEMK,IAAS,GAAG,MAAMA,CAAM;AAAA,4BACXD,CAAQ;AAAA;AAAA;AAAA;AAAA;AAKpC,CAAC;"}
|
|
@@ -1,20 +1,34 @@
|
|
|
1
1
|
import r from "styled-components";
|
|
2
2
|
import e from "../../../ui/layout/flex-view.js";
|
|
3
|
-
import
|
|
4
|
-
|
|
3
|
+
import n from "../../../ui/text/text.js";
|
|
4
|
+
import { RIGHT_PANEL_CONTENT_WIDTH as l } from "../../trial-session-constants.js";
|
|
5
|
+
const d = r.div`
|
|
5
6
|
width: 100%;
|
|
6
7
|
height: 100%;
|
|
7
8
|
overflow: auto;
|
|
8
|
-
`,
|
|
9
|
+
`, u = r(e)(({ theme: o }) => {
|
|
9
10
|
const { GREEN_1: t, GREEN_4: i } = o.colors;
|
|
10
11
|
return `
|
|
11
|
-
width: ${
|
|
12
|
+
width: ${l - 100}px;
|
|
12
13
|
margin: auto;
|
|
13
14
|
background-color: ${t};
|
|
14
15
|
border: 1px solid ${i};
|
|
15
16
|
position: relative;
|
|
16
17
|
`;
|
|
17
|
-
}),
|
|
18
|
+
}), T = r(e)(({ theme: o }) => `
|
|
19
|
+
cursor: pointer;
|
|
20
|
+
transition: all 0.2s ease-in-out;
|
|
21
|
+
&:hover {
|
|
22
|
+
background-color: ${o.colors.BLACK_T_87};
|
|
23
|
+
|
|
24
|
+
.feedback-title {
|
|
25
|
+
color: ${o.colors.WHITE_T_87};
|
|
26
|
+
}
|
|
27
|
+
.feedback-desc {
|
|
28
|
+
color: ${o.colors.WHITE_T_60};
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
`), _ = r(e)(({ theme: o }) => {
|
|
18
32
|
const { gutter: t } = o.layout;
|
|
19
33
|
return `
|
|
20
34
|
width: 100%;
|
|
@@ -22,10 +36,14 @@ const s = r.div`
|
|
|
22
36
|
left: 0;
|
|
23
37
|
top: -${t * 0.75}px;
|
|
24
38
|
`;
|
|
25
|
-
})
|
|
39
|
+
}), b = r(n)`
|
|
40
|
+
display: inline;
|
|
41
|
+
`;
|
|
26
42
|
export {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
43
|
+
_ as BalloonWrapper,
|
|
44
|
+
d as Container,
|
|
45
|
+
T as Feedback,
|
|
46
|
+
u as FeedbackWrapper,
|
|
47
|
+
b as InlineText
|
|
30
48
|
};
|
|
31
49
|
//# sourceMappingURL=student-feedback-styled.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"student-feedback-styled.js","sources":["../../../../../src/features/trial-session/comps/student-feedback/student-feedback-styled.tsx"],"sourcesContent":["import styled from 'styled-components';\n\nimport FlexView from '../../../ui/layout/flex-view';\nimport { RIGHT_PANEL_CONTENT_WIDTH } from '../../trial-session-constants';\n\nconst Container = styled.div`\n width: 100%;\n height: 100%;\n overflow: auto;\n`;\n\nconst FeedbackWrapper = styled(FlexView)(({ theme }) => {\n const { GREEN_1, GREEN_4 } = theme.colors;\n\n return `\n width: ${RIGHT_PANEL_CONTENT_WIDTH - 100}px;\n margin: auto;\n background-color: ${GREEN_1};\n border: 1px solid ${GREEN_4};\n position: relative;\n`;\n});\n\nconst BalloonWrapper = styled(FlexView)(({ theme }) => {\n const { gutter } = theme.layout;\n\n return `\n width: 100%;\n position: absolute;\n left: 0;\n top: -${gutter * 0.75}px;\n `;\n});\n\nexport { Container, FeedbackWrapper, BalloonWrapper };\n"],"names":["Container","styled","FeedbackWrapper","FlexView","theme","GREEN_1","GREEN_4","RIGHT_PANEL_CONTENT_WIDTH","BalloonWrapper","gutter"],"mappings":"
|
|
1
|
+
{"version":3,"file":"student-feedback-styled.js","sources":["../../../../../src/features/trial-session/comps/student-feedback/student-feedback-styled.tsx"],"sourcesContent":["import styled from 'styled-components';\n\nimport FlexView from '../../../ui/layout/flex-view';\nimport Text from '../../../ui/text/text';\nimport { RIGHT_PANEL_CONTENT_WIDTH } from '../../trial-session-constants';\n\nconst Container = styled.div`\n width: 100%;\n height: 100%;\n overflow: auto;\n`;\n\nconst FeedbackWrapper = styled(FlexView)(({ theme }) => {\n const { GREEN_1, GREEN_4 } = theme.colors;\n\n return `\n width: ${RIGHT_PANEL_CONTENT_WIDTH - 100}px;\n margin: auto;\n background-color: ${GREEN_1};\n border: 1px solid ${GREEN_4};\n position: relative;\n`;\n});\n\nconst Feedback = styled(FlexView)(({ theme }) => {\n return `\n cursor: pointer;\n transition: all 0.2s ease-in-out;\n &:hover {\n background-color: ${theme.colors.BLACK_T_87};\n \n .feedback-title {\n color: ${theme.colors.WHITE_T_87};\n }\n .feedback-desc {\n color: ${theme.colors.WHITE_T_60};\n }\n }\n `;\n});\n\nconst BalloonWrapper = styled(FlexView)(({ theme }) => {\n const { gutter } = theme.layout;\n\n return `\n width: 100%;\n position: absolute;\n left: 0;\n top: -${gutter * 0.75}px;\n `;\n});\n\nconst InlineText = styled(Text)`\n display: inline;\n`;\n\nexport { Container, FeedbackWrapper, Feedback, BalloonWrapper, InlineText };\n"],"names":["Container","styled","FeedbackWrapper","FlexView","theme","GREEN_1","GREEN_4","RIGHT_PANEL_CONTENT_WIDTH","Feedback","BalloonWrapper","gutter","InlineText","Text"],"mappings":";;;;AAMA,MAAMA,IAAYC,EAAO;AAAA;AAAA;AAAA;AAAA,GAMnBC,IAAkBD,EAAOE,CAAQ,EAAE,CAAC,EAAE,OAAAC,QAAY;AACtD,QAAM,EAAE,SAAAC,GAAS,SAAAC,MAAYF,EAAM;AAE5B,SAAA;AAAA,WACEG,IAA4B,GAAG;AAAA;AAAA,sBAEpBF,CAAO;AAAA,sBACPC,CAAO;AAAA;AAAA;AAG7B,CAAC,GAEKE,IAAWP,EAAOE,CAAQ,EAAE,CAAC,EAAE,OAAAC,QAC5B;AAAA;AAAA;AAAA;AAAA,0BAIiBA,EAAM,OAAO,UAAU;AAAA;AAAA;AAAA,iBAGhCA,EAAM,OAAO,UAAU;AAAA;AAAA;AAAA,iBAGvBA,EAAM,OAAO,UAAU;AAAA;AAAA;AAAA,GAIvC,GAEKK,IAAiBR,EAAOE,CAAQ,EAAE,CAAC,EAAE,OAAAC,QAAY;AAC/C,QAAA,EAAE,QAAAM,EAAO,IAAIN,EAAM;AAElB,SAAA;AAAA;AAAA;AAAA;AAAA,YAIGM,IAAS,IAAI;AAAA;AAEzB,CAAC,GAEKC,IAAaV,EAAOW,CAAI;AAAA;AAAA;"}
|