@cuemath/leap 3.5.21 → 3.5.22
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/assets/line-icons/icons/change-icon.js +41 -0
- package/dist/assets/line-icons/icons/change-icon.js.map +1 -0
- package/dist/features/trial-session/api/course-stream.js.map +1 -1
- package/dist/features/trial-session/comps/confirmation-modal/confirmation-modal-styled.js +70 -0
- package/dist/features/trial-session/comps/confirmation-modal/confirmation-modal-styled.js.map +1 -0
- package/dist/features/trial-session/comps/confirmation-modal/confirmation-modal.js +65 -0
- package/dist/features/trial-session/comps/confirmation-modal/confirmation-modal.js.map +1 -0
- package/dist/features/trial-session/comps/confirmation-modal/hooks/use-confirmation-modal.js +43 -0
- package/dist/features/trial-session/comps/confirmation-modal/hooks/use-confirmation-modal.js.map +1 -0
- package/dist/features/trial-session/comps/student-feedback/student-feedback.js +90 -71
- package/dist/features/trial-session/comps/student-feedback/student-feedback.js.map +1 -1
- package/dist/features/trial-session/comps/worksheet/worksheet.js +36 -23
- package/dist/features/trial-session/comps/worksheet/worksheet.js.map +1 -1
- package/dist/features/trial-session/hooks/use-trial-session-navigation.js +26 -25
- package/dist/features/trial-session/hooks/use-trial-session-navigation.js.map +1 -1
- package/dist/features/trial-session/left-panel/index.js +37 -34
- package/dist/features/trial-session/left-panel/index.js.map +1 -1
- package/dist/features/trial-session/left-panel/left-panel-styled.js +7 -4
- package/dist/features/trial-session/left-panel/left-panel-styled.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 +77 -74
- package/dist/features/trial-session/trial-session-view.js.map +1 -1
- package/dist/features/ui/theme/button.js +17 -0
- package/dist/features/ui/theme/button.js.map +1 -1
- package/dist/index.d.ts +29 -24
- package/dist/index.js +735 -733
- package/dist/index.js.map +1 -1
- package/package.json +2 -3
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { jsxs as o, jsx as l } from "react/jsx-runtime";
|
|
2
|
+
const C = (e) => /* @__PURE__ */ o(
|
|
3
|
+
"svg",
|
|
4
|
+
{
|
|
5
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
6
|
+
width: "24",
|
|
7
|
+
height: "24",
|
|
8
|
+
viewBox: "0 0 24 24",
|
|
9
|
+
fill: "none",
|
|
10
|
+
...e,
|
|
11
|
+
children: [
|
|
12
|
+
/* @__PURE__ */ l(
|
|
13
|
+
"path",
|
|
14
|
+
{
|
|
15
|
+
fillRule: "evenodd",
|
|
16
|
+
clipRule: "evenodd",
|
|
17
|
+
d: "M9.02871 1.71387C9.02871 4.46573 11.0498 6.59958 13.4287 6.59958V7.79958C11.6238 7.79958 10.0456 6.88395 9.02871 5.4782L9.02871 20.8569H7.82871L7.82871 5.4782C6.81178 6.88395 5.2336 7.79958 3.42871 7.79958L3.42871 6.59958C5.80763 6.59958 7.82871 4.46573 7.82871 1.71387L9.02871 1.71387Z",
|
|
18
|
+
fill: "currentColor"
|
|
19
|
+
}
|
|
20
|
+
),
|
|
21
|
+
/* @__PURE__ */ l(
|
|
22
|
+
"path",
|
|
23
|
+
{
|
|
24
|
+
d: "M23.1166 10.933C20.3647 10.933 18.2309 12.9541 18.2309 15.333H17.0309C17.0309 13.5282 17.9465 11.95 19.3523 10.933V9.73305C17.9465 8.71612 17.0309 7.13793 17.0309 5.33305L18.2309 5.33305C18.2309 7.71196 20.3647 9.73305 23.1166 9.73305V10.933Z",
|
|
25
|
+
fill: "currentColor"
|
|
26
|
+
}
|
|
27
|
+
),
|
|
28
|
+
/* @__PURE__ */ l(
|
|
29
|
+
"path",
|
|
30
|
+
{
|
|
31
|
+
d: "M20.1922 10.7838C17.5048 10.9905 14.633 11.9213 12.4922 13.5954C10.3711 15.2542 8.96862 17.6355 9.12807 20.8251L7.84403 20.8887C7.66078 17.2214 9.30024 14.4595 11.7003 12.5826C14.0809 10.721 17.2096 9.72327 20.0935 9.5014L20.1922 10.7838Z",
|
|
32
|
+
fill: "currentColor"
|
|
33
|
+
}
|
|
34
|
+
)
|
|
35
|
+
]
|
|
36
|
+
}
|
|
37
|
+
), r = C;
|
|
38
|
+
export {
|
|
39
|
+
r as default
|
|
40
|
+
};
|
|
41
|
+
//# sourceMappingURL=change-icon.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"change-icon.js","sources":["../../../../src/assets/line-icons/icons/change-icon.tsx"],"sourcesContent":["import { type FC, type SVGProps } from 'react';\n\nconst ChangeIcon: FC<SVGProps<SVGSVGElement>> = props => {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n {...props}\n >\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M9.02871 1.71387C9.02871 4.46573 11.0498 6.59958 13.4287 6.59958V7.79958C11.6238 7.79958 10.0456 6.88395 9.02871 5.4782L9.02871 20.8569H7.82871L7.82871 5.4782C6.81178 6.88395 5.2336 7.79958 3.42871 7.79958L3.42871 6.59958C5.80763 6.59958 7.82871 4.46573 7.82871 1.71387L9.02871 1.71387Z\"\n fill=\"currentColor\"\n />\n <path\n d=\"M23.1166 10.933C20.3647 10.933 18.2309 12.9541 18.2309 15.333H17.0309C17.0309 13.5282 17.9465 11.95 19.3523 10.933V9.73305C17.9465 8.71612 17.0309 7.13793 17.0309 5.33305L18.2309 5.33305C18.2309 7.71196 20.3647 9.73305 23.1166 9.73305V10.933Z\"\n fill=\"currentColor\"\n />\n <path\n d=\"M20.1922 10.7838C17.5048 10.9905 14.633 11.9213 12.4922 13.5954C10.3711 15.2542 8.96862 17.6355 9.12807 20.8251L7.84403 20.8887C7.66078 17.2214 9.30024 14.4595 11.7003 12.5826C14.0809 10.721 17.2096 9.72327 20.0935 9.5014L20.1922 10.7838Z\"\n fill=\"currentColor\"\n />\n </svg>\n );\n};\n\nexport default ChangeIcon;\n"],"names":["ChangeIcon","props","jsxs","jsx","ChangeIcon$1"],"mappings":";AAEA,MAAMA,IAA0C,CAASC,MAErD,gBAAAC;AAAA,EAAC;AAAA,EAAA;AAAA,IACC,OAAM;AAAA,IACN,OAAM;AAAA,IACN,QAAO;AAAA,IACP,SAAQ;AAAA,IACR,MAAK;AAAA,IACJ,GAAGD;AAAA,IAEJ,UAAA;AAAA,MAAA,gBAAAE;AAAA,QAAC;AAAA,QAAA;AAAA,UACC,UAAS;AAAA,UACT,UAAS;AAAA,UACT,GAAE;AAAA,UACF,MAAK;AAAA,QAAA;AAAA,MACP;AAAA,MACA,gBAAAA;AAAA,QAAC;AAAA,QAAA;AAAA,UACC,GAAE;AAAA,UACF,MAAK;AAAA,QAAA;AAAA,MACP;AAAA,MACA,gBAAAA;AAAA,QAAC;AAAA,QAAA;AAAA,UACC,GAAE;AAAA,UACF,MAAK;AAAA,QAAA;AAAA,MACP;AAAA,IAAA;AAAA,EAAA;AAAA,GAKNC,IAAeJ;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"course-stream.js","sources":["../../../../src/features/trial-session/api/course-stream.ts"],"sourcesContent":["import { createPostAPI } from '@cuemath/rest-api';\n\nimport { BASE_URL_V1 } from '../../../constants/api';\nimport type { TPreferenceSchema } from '../trial-session-types';\n\ntype TPreferencesBody = {\n preferences: TPreferenceSchema[];\n};\n\ntype TPreferencesMeta = {\n stream: string;\n studentId: string;\n};\n\nconst { usePost: usePostStudentPreferences } = createPostAPI<\n { id: string },\n TPreferencesBody,\n TPreferencesMeta\n>({\n getURL: (_, { studentId, stream }) =>\n `${BASE_URL_V1}/students/${studentId}/course-streams/${stream}/preferences/`,\n});\n\nexport { usePostStudentPreferences };\n"],"names":["usePostStudentPreferences","createPostAPI","_","studentId","stream","BASE_URL_V1"],"mappings":";;
|
|
1
|
+
{"version":3,"file":"course-stream.js","sources":["../../../../src/features/trial-session/api/course-stream.ts"],"sourcesContent":["import { createPostAPI } from '@cuemath/rest-api';\n\nimport { BASE_URL_V1 } from '../../../constants/api';\nimport type { TPreferenceSchema } from '../trial-session-types';\n\ntype TPreferencesBody = {\n preferences: TPreferenceSchema[];\n grade?: string;\n};\n\ntype TPreferencesMeta = {\n stream: string;\n studentId: string;\n};\n\nconst { usePost: usePostStudentPreferences } = createPostAPI<\n { id: string },\n TPreferencesBody,\n TPreferencesMeta\n>({\n getURL: (_, { studentId, stream }) =>\n `${BASE_URL_V1}/students/${studentId}/course-streams/${stream}/preferences/`,\n});\n\nexport { usePostStudentPreferences };\n"],"names":["usePostStudentPreferences","createPostAPI","_","studentId","stream","BASE_URL_V1"],"mappings":";;AAeA,MAAM,EAAE,SAASA,EAA0B,IAAIC,EAI7C;AAAA,EACA,QAAQ,CAACC,GAAG,EAAE,WAAAC,GAAW,QAAAC,EAAA,MACvB,GAAGC,CAAW,aAAaF,CAAS,mBAAmBC,CAAM;AACjE,CAAC;"}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import o from "styled-components";
|
|
2
|
+
import a from "../../../ui/layout/flex-view.js";
|
|
3
|
+
const i = o(a)(
|
|
4
|
+
({ $isClosing: t }) => `
|
|
5
|
+
position: absolute;
|
|
6
|
+
top: 0;
|
|
7
|
+
bottom: 0;
|
|
8
|
+
right: 0;
|
|
9
|
+
left: 0;
|
|
10
|
+
z-index: 1;
|
|
11
|
+
backdrop-filter: blur(40px);
|
|
12
|
+
animation: ${t ? "backdropFadeOut" : "backdropFadeIn"} 0.2s ease-out forwards;
|
|
13
|
+
|
|
14
|
+
@keyframes backdropFadeIn {
|
|
15
|
+
from {
|
|
16
|
+
opacity: 0;
|
|
17
|
+
}
|
|
18
|
+
to {
|
|
19
|
+
opacity: 1;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
@keyframes backdropFadeOut {
|
|
24
|
+
from {
|
|
25
|
+
opacity: 1;
|
|
26
|
+
}
|
|
27
|
+
to {
|
|
28
|
+
opacity: 0;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
`
|
|
32
|
+
), s = o(a)(
|
|
33
|
+
({ $isClosing: t }) => `
|
|
34
|
+
width: 100%;
|
|
35
|
+
height: max-content;
|
|
36
|
+
overflow: auto;
|
|
37
|
+
position: fixed;
|
|
38
|
+
left: 0;
|
|
39
|
+
right: 0;
|
|
40
|
+
bottom: 0;
|
|
41
|
+
animation: ${t ? "slideOut" : "slideIn"} 0.3s forwards;
|
|
42
|
+
|
|
43
|
+
@keyframes slideIn {
|
|
44
|
+
from {
|
|
45
|
+
transform: translateY(100%);
|
|
46
|
+
opacity: 0;
|
|
47
|
+
}
|
|
48
|
+
to {
|
|
49
|
+
transform: translateY(0%);
|
|
50
|
+
opacity: 1;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
@keyframes slideOut {
|
|
55
|
+
from {
|
|
56
|
+
transform: translateY(0%);
|
|
57
|
+
opacity: 1;
|
|
58
|
+
}
|
|
59
|
+
to {
|
|
60
|
+
transform: translateY(100%);
|
|
61
|
+
opacity: 0;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
`
|
|
65
|
+
);
|
|
66
|
+
export {
|
|
67
|
+
i as Container,
|
|
68
|
+
s as ModalWrapper
|
|
69
|
+
};
|
|
70
|
+
//# sourceMappingURL=confirmation-modal-styled.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"confirmation-modal-styled.js","sources":["../../../../../src/features/trial-session/comps/confirmation-modal/confirmation-modal-styled.ts"],"sourcesContent":["import styled from 'styled-components';\nimport FlexView from '../../../ui/layout/flex-view';\n\nconst Container = styled(FlexView)<{ $isClosing: boolean }>(\n ({ $isClosing }) => `\n position: absolute;\n top: 0;\n bottom: 0;\n right: 0;\n left: 0;\n z-index: 1;\n backdrop-filter: blur(40px);\n animation: ${$isClosing ? 'backdropFadeOut' : 'backdropFadeIn'} 0.2s ease-out forwards;\n\n @keyframes backdropFadeIn {\n from {\n opacity: 0;\n }\n to {\n opacity: 1;\n }\n }\n\n @keyframes backdropFadeOut {\n from {\n opacity: 1;\n }\n to {\n opacity: 0;\n }\n }\n`,\n);\n\nconst ModalWrapper = styled(FlexView)<{ $isClosing?: boolean }>(\n ({ $isClosing }) => `\n width: 100%;\n height: max-content;\n overflow: auto;\n position: fixed;\n left: 0;\n right: 0;\n bottom: 0;\n animation: ${$isClosing ? 'slideOut' : 'slideIn'} 0.3s forwards;\n\n @keyframes slideIn {\n from {\n transform: translateY(100%);\n opacity: 0;\n }\n to {\n transform: translateY(0%);\n opacity: 1;\n }\n }\n\n @keyframes slideOut {\n from {\n transform: translateY(0%);\n opacity: 1;\n }\n to {\n transform: translateY(100%);\n opacity: 0;\n }\n }\n `,\n);\n\nexport { Container, ModalWrapper };\n"],"names":["Container","styled","FlexView","$isClosing","ModalWrapper"],"mappings":";;AAGM,MAAAA,IAAYC,EAAOC,CAAQ;AAAA,EAC/B,CAAC,EAAE,YAAAC,EAAA,MAAiB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,eAQPA,IAAa,oBAAoB,gBAAgB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAoBhE,GAEMC,IAAeH,EAAOC,CAAQ;AAAA,EAClC,CAAC,EAAE,YAAAC,EAAA,MAAiB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,iBAQLA,IAAa,aAAa,SAAS;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAwBpD;"}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { jsx as o, jsxs as r } from "react/jsx-runtime";
|
|
2
|
+
import { memo as f } from "react";
|
|
3
|
+
import { Container as p, ModalWrapper as C } from "./confirmation-modal-styled.js";
|
|
4
|
+
import u from "../../../ui/layout/flex-view.js";
|
|
5
|
+
import x from "../../../ui/text/text.js";
|
|
6
|
+
import n from "../../../ui/buttons/button/button.js";
|
|
7
|
+
import $ from "./hooks/use-confirmation-modal.js";
|
|
8
|
+
import { useTrialSessionContext as h } from "../../context/use-trial-session-context.js";
|
|
9
|
+
const g = f(() => {
|
|
10
|
+
const { formData: i } = h(), { modalConfig: a, openModal: l } = $(), { confirmationModalActive: e } = i || {}, {
|
|
11
|
+
title: t,
|
|
12
|
+
cancelText: m = "Cancel",
|
|
13
|
+
confirmText: s = "Confirm",
|
|
14
|
+
onCancel: c,
|
|
15
|
+
onConfirm: d
|
|
16
|
+
} = a || {};
|
|
17
|
+
return l ? /* @__PURE__ */ o(
|
|
18
|
+
p,
|
|
19
|
+
{
|
|
20
|
+
$background: "BLACK_T_38",
|
|
21
|
+
$flexDirection: "column-reverse",
|
|
22
|
+
$isClosing: !e,
|
|
23
|
+
children: /* @__PURE__ */ r(
|
|
24
|
+
C,
|
|
25
|
+
{
|
|
26
|
+
$background: "WHITE",
|
|
27
|
+
$gapX: 1.5,
|
|
28
|
+
$gutterX: 1.5,
|
|
29
|
+
$flexGapX: 1.5,
|
|
30
|
+
$isClosing: !e,
|
|
31
|
+
children: [
|
|
32
|
+
/* @__PURE__ */ o(x, { $renderAs: "ab1-bold", children: t }),
|
|
33
|
+
/* @__PURE__ */ r(u, { $flexGapX: 1, children: [
|
|
34
|
+
/* @__PURE__ */ o(
|
|
35
|
+
n,
|
|
36
|
+
{
|
|
37
|
+
renderAs: "white-danger",
|
|
38
|
+
size: "small",
|
|
39
|
+
label: s,
|
|
40
|
+
shape: "square",
|
|
41
|
+
onClick: d
|
|
42
|
+
}
|
|
43
|
+
),
|
|
44
|
+
/* @__PURE__ */ o(
|
|
45
|
+
n,
|
|
46
|
+
{
|
|
47
|
+
renderAs: "secondary",
|
|
48
|
+
size: "small",
|
|
49
|
+
label: m,
|
|
50
|
+
shape: "square",
|
|
51
|
+
onClick: c
|
|
52
|
+
}
|
|
53
|
+
)
|
|
54
|
+
] })
|
|
55
|
+
]
|
|
56
|
+
}
|
|
57
|
+
)
|
|
58
|
+
}
|
|
59
|
+
) : null;
|
|
60
|
+
});
|
|
61
|
+
g.displayName = "TrialConfirmationModal";
|
|
62
|
+
export {
|
|
63
|
+
g as default
|
|
64
|
+
};
|
|
65
|
+
//# sourceMappingURL=confirmation-modal.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"confirmation-modal.js","sources":["../../../../../src/features/trial-session/comps/confirmation-modal/confirmation-modal.tsx"],"sourcesContent":["import { memo } from 'react';\nimport * as Styled from './confirmation-modal-styled';\nimport FlexView from '../../../ui/layout/flex-view';\nimport Text from '../../../ui/text/text';\nimport Button from '../../../ui/buttons/button/button';\nimport useConfirmationModal from './hooks/use-confirmation-modal';\nimport { useTrialSessionContext } from '../../context/use-trial-session-context';\n\nconst ConfirmationModal = memo(() => {\n const { formData } = useTrialSessionContext();\n const { modalConfig, openModal } = useConfirmationModal();\n\n const { confirmationModalActive } = formData || {};\n const {\n title,\n cancelText = 'Cancel',\n confirmText = 'Confirm',\n onCancel: handleCancel,\n onConfirm: handleConfirm,\n } = modalConfig || {};\n\n if (!openModal) return null;\n\n return (\n <Styled.Container\n $background=\"BLACK_T_38\"\n $flexDirection=\"column-reverse\"\n $isClosing={!confirmationModalActive}\n >\n <Styled.ModalWrapper\n $background=\"WHITE\"\n $gapX={1.5}\n $gutterX={1.5}\n $flexGapX={1.5}\n $isClosing={!confirmationModalActive}\n >\n <Text $renderAs=\"ab1-bold\">{title}</Text>\n <FlexView $flexGapX={1}>\n <Button\n renderAs=\"white-danger\"\n size=\"small\"\n label={confirmText}\n shape=\"square\"\n onClick={handleConfirm}\n />\n <Button\n renderAs=\"secondary\"\n size=\"small\"\n label={cancelText}\n shape=\"square\"\n onClick={handleCancel}\n />\n </FlexView>\n </Styled.ModalWrapper>\n </Styled.Container>\n );\n});\n\nConfirmationModal.displayName = 'TrialConfirmationModal';\n\nexport default ConfirmationModal;\n"],"names":["ConfirmationModal","memo","formData","useTrialSessionContext","modalConfig","openModal","useConfirmationModal","confirmationModalActive","title","cancelText","confirmText","handleCancel","handleConfirm","jsx","Styled.Container","jsxs","Styled.ModalWrapper","Text","FlexView","Button"],"mappings":";;;;;;;;AAQM,MAAAA,IAAoBC,EAAK,MAAM;AAC7B,QAAA,EAAE,UAAAC,MAAaC,KACf,EAAE,aAAAC,GAAa,WAAAC,EAAU,IAAIC,EAAqB,GAElD,EAAE,yBAAAC,EAAA,IAA4BL,KAAY,IAC1C;AAAA,IACJ,OAAAM;AAAA,IACA,YAAAC,IAAa;AAAA,IACb,aAAAC,IAAc;AAAA,IACd,UAAUC;AAAA,IACV,WAAWC;AAAA,EAAA,IACTR,KAAe,CAAA;AAEf,SAACC,IAGH,gBAAAQ;AAAA,IAACC;AAAAA,IAAA;AAAA,MACC,aAAY;AAAA,MACZ,gBAAe;AAAA,MACf,YAAY,CAACP;AAAA,MAEb,UAAA,gBAAAQ;AAAA,QAACC;AAAAA,QAAA;AAAA,UACC,aAAY;AAAA,UACZ,OAAO;AAAA,UACP,UAAU;AAAA,UACV,WAAW;AAAA,UACX,YAAY,CAACT;AAAA,UAEb,UAAA;AAAA,YAAC,gBAAAM,EAAAI,GAAA,EAAK,WAAU,YAAY,UAAMT,GAAA;AAAA,YAClC,gBAAAO,EAACG,GAAS,EAAA,WAAW,GACnB,UAAA;AAAA,cAAA,gBAAAL;AAAA,gBAACM;AAAA,gBAAA;AAAA,kBACC,UAAS;AAAA,kBACT,MAAK;AAAA,kBACL,OAAOT;AAAA,kBACP,OAAM;AAAA,kBACN,SAASE;AAAA,gBAAA;AAAA,cACX;AAAA,cACA,gBAAAC;AAAA,gBAACM;AAAA,gBAAA;AAAA,kBACC,UAAS;AAAA,kBACT,MAAK;AAAA,kBACL,OAAOV;AAAA,kBACP,OAAM;AAAA,kBACN,SAASE;AAAA,gBAAA;AAAA,cACX;AAAA,YAAA,GACF;AAAA,UAAA;AAAA,QAAA;AAAA,MACF;AAAA,IAAA;AAAA,EAAA,IAhCmB;AAmCzB,CAAC;AAEDX,EAAkB,cAAc;"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { useState as E, useRef as M, useCallback as s, useMemo as T, useEffect as f } from "react";
|
|
2
|
+
import { useTrialSessionContext as g } from "../../../context/use-trial-session-context.js";
|
|
3
|
+
import { TrialPageId as i } from "../../../trial-session-constants.js";
|
|
4
|
+
const p = 500, h = () => {
|
|
5
|
+
const [m, l] = E(!1), { slideConfig: d, formData: C, updateSlideConfig: t } = g(), { id: o } = d, { confirmationModalActive: a } = C || {}, e = M(null), n = s(() => {
|
|
6
|
+
e.current && clearTimeout(e.current), e.current = setTimeout(() => {
|
|
7
|
+
l(!1), e.current = null;
|
|
8
|
+
}, p);
|
|
9
|
+
}, []), c = s(() => {
|
|
10
|
+
switch (o) {
|
|
11
|
+
case i.LEARNING_WORKSHEET:
|
|
12
|
+
t({
|
|
13
|
+
id: i.LEARNING_LEVEL,
|
|
14
|
+
confirmationModalActive: !1,
|
|
15
|
+
resetAttempt: !0
|
|
16
|
+
}), n();
|
|
17
|
+
break;
|
|
18
|
+
default:
|
|
19
|
+
return null;
|
|
20
|
+
}
|
|
21
|
+
}, [o, t, n]), u = s(() => {
|
|
22
|
+
t({ confirmationModalActive: !1 }), n();
|
|
23
|
+
}, [t, n]), A = T(
|
|
24
|
+
() => ({
|
|
25
|
+
[i.LEARNING_WORKSHEET]: {
|
|
26
|
+
title: "Changing the session level will reset current progress. Are you sure?",
|
|
27
|
+
confirmText: "Yes, change session level",
|
|
28
|
+
onConfirm: c,
|
|
29
|
+
onCancel: u
|
|
30
|
+
}
|
|
31
|
+
}),
|
|
32
|
+
[u, c]
|
|
33
|
+
), r = o ? A[o] : void 0;
|
|
34
|
+
return f(() => {
|
|
35
|
+
a && r && l(!0);
|
|
36
|
+
}, [a, r]), f(() => () => {
|
|
37
|
+
e.current && clearTimeout(e.current);
|
|
38
|
+
}, []), { modalConfig: r, openModal: m };
|
|
39
|
+
};
|
|
40
|
+
export {
|
|
41
|
+
h as default
|
|
42
|
+
};
|
|
43
|
+
//# sourceMappingURL=use-confirmation-modal.js.map
|
package/dist/features/trial-session/comps/confirmation-modal/hooks/use-confirmation-modal.js.map
ADDED
|
@@ -0,0 +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';\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, updateSlideConfig } = useTrialSessionContext();\n const { id } = slideConfig;\n const { confirmationModalActive } = formData || {};\n const timeoutRef = useRef<NodeJS.Timeout | null>(null);\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: TrialPageId.LEARNING_LEVEL,\n confirmationModalActive: false,\n resetAttempt: true,\n });\n closeModal();\n break;\n default:\n return null;\n }\n }, [id, updateSlideConfig, 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: 'Changing the session level will reset current progress. Are you sure?',\n confirmText: 'Yes, change session level',\n onConfirm: handleConfirm,\n onCancel: handleCancel,\n },\n }),\n [handleCancel, handleConfirm],\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","updateSlideConfig","useTrialSessionContext","id","confirmationModalActive","timeoutRef","useRef","closeModal","useCallback","handleConfirm","TrialPageId","handleCancel","modalConfigs","useMemo","modalConfig","useEffect"],"mappings":";;;AAIA,MAAMA,IAAwB,KAexBC,IAAuB,MAAgC;AAC3D,QAAM,CAACC,GAAWC,CAAY,IAAIC,EAAS,EAAK,GAC1C,EAAE,aAAAC,GAAa,UAAAC,GAAU,mBAAAC,MAAsBC,EAAuB,GACtE,EAAE,IAAAC,EAAO,IAAAJ,GACT,EAAE,yBAAAK,EAAA,IAA4BJ,KAAY,IAC1CK,IAAaC,EAA8B,IAAI,GAE/CC,IAAaC,EAAY,MAAM;AACnC,IAAIH,EAAW,WACb,aAAaA,EAAW,OAAO,GAGtBA,EAAA,UAAU,WAAW,MAAM;AACpC,MAAAR,EAAa,EAAK,GAClBQ,EAAW,UAAU;AAAA,OACpBX,CAAqB;AAAA,EAC1B,GAAG,CAAE,CAAA,GAECe,IAAgBD,EAAY,MAAM;AACtC,YAAQL,GAAI;AAAA,MACV,KAAKO,EAAY;AACG,QAAAT,EAAA;AAAA,UAChB,IAAIS,EAAY;AAAA,UAChB,yBAAyB;AAAA,UACzB,cAAc;AAAA,QAAA,CACf,GACUH;AACX;AAAA,MACF;AACS,eAAA;AAAA,IACX;AAAA,EACC,GAAA,CAACJ,GAAIF,GAAmBM,CAAU,CAAC,GAEhCI,IAAeH,EAAY,MAAM;AACnB,IAAAP,EAAA,EAAE,yBAAyB,GAAA,CAAO,GACzCM;EAAA,GACV,CAACN,GAAmBM,CAAU,CAAC,GAE5BK,IAAuEC;AAAA,IAC3E,OAAO;AAAA,MACL,CAACH,EAAY,kBAAkB,GAAG;AAAA,QAChC,OAAO;AAAA,QACP,aAAa;AAAA,QACb,WAAWD;AAAA,QACX,UAAUE;AAAA,MACZ;AAAA,IAAA;AAAA,IAEF,CAACA,GAAcF,CAAa;AAAA,EAAA,GAGxBK,IAAcX,IAAKS,EAAaT,CAAE,IAAI;AAE5C,SAAAY,EAAU,MAAM;AACV,IAAAX,KAA2BU,KAAajB,EAAa,EAAI;AAAA,EAAA,GAC5D,CAACO,GAAyBU,CAAW,CAAC,GAEzCC,EAAU,MACD,MAAM;AACX,IAAIV,EAAW,WACb,aAAaA,EAAW,OAAO;AAAA,EACjC,GAED,CAAE,CAAA,GAEE,EAAE,aAAAS,GAAa,WAAAlB;AACxB;"}
|
|
@@ -1,52 +1,58 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { memo as
|
|
1
|
+
import { jsxs as i, jsx as e, Fragment as D } from "react/jsx-runtime";
|
|
2
|
+
import { memo as G, useMemo as C, useCallback as E, useEffect as W } from "react";
|
|
3
3
|
import { ILLUSTRATIONS as _ } from "../../../../assets/illustrations/illustrations.js";
|
|
4
|
-
import { LOTTIE as
|
|
5
|
-
import { COURSE_STREAMS as
|
|
6
|
-
import { getPreferencesFromConfig as
|
|
7
|
-
import
|
|
8
|
-
import
|
|
4
|
+
import { LOTTIE as X } from "../../../../assets/lottie/lottie.js";
|
|
5
|
+
import { COURSE_STREAMS as $, PREFERENCE_CATEGORY as b } from "../../../milestone/constants.js";
|
|
6
|
+
import { getGradesFromConfig as y, getPreferencesFromConfig as A } from "../../../milestone/create/milestone-create-helpers.js";
|
|
7
|
+
import d from "../../../ui/image/image.js";
|
|
8
|
+
import z from "../../../ui/layout/flex-view.js";
|
|
9
9
|
import K from "../../../ui/lottie-animation/lottie-animation.js";
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import { useTrialSessionContext as
|
|
13
|
-
import { TrialPageId as
|
|
14
|
-
import
|
|
15
|
-
import { studentLevels as
|
|
16
|
-
import { Container as
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
10
|
+
import M from "../../../ui/separator/separator.js";
|
|
11
|
+
import m from "../../../ui/text/text.js";
|
|
12
|
+
import { useTrialSessionContext as j } from "../../context/use-trial-session-context.js";
|
|
13
|
+
import { TrialPageId as U } from "../../trial-session-constants.js";
|
|
14
|
+
import V from "../slide-header/index.js";
|
|
15
|
+
import { studentLevels as q, PREFERENCE_CODE_MAP as Y } from "./student-feedback-constants.js";
|
|
16
|
+
import { Container as J, FeedbackWrapper as Q, BalloonWrapper as Z, Feedback as ee, InlineText as te } from "./student-feedback-styled.js";
|
|
17
|
+
import oe from "../../../ui/inputs/select-input/select-input.js";
|
|
18
|
+
const _e = G(function() {
|
|
19
|
+
const { slideConfig: S, formData: I, milestoneConfig: n, updateSlideConfig: l, updateButtonState: p } = j(), { id: k } = S || {}, { grade: a, personalizedLevel: f = [], personalizedPosition: g = [] } = I || {}, t = k === U.STUDENT_LEVEL, h = t ? g.length > 0 : f.length > 0, w = y(n), x = C(
|
|
20
|
+
() => A(n, {
|
|
21
|
+
grade: a ?? "",
|
|
22
|
+
courseStream: $.MATH,
|
|
23
|
+
preferenceCategory: b.LEVEL
|
|
23
24
|
}),
|
|
24
|
-
[
|
|
25
|
-
),
|
|
26
|
-
() =>
|
|
27
|
-
grade:
|
|
28
|
-
courseStream:
|
|
29
|
-
preferenceCategory:
|
|
25
|
+
[a, n]
|
|
26
|
+
), N = C(
|
|
27
|
+
() => A(n, {
|
|
28
|
+
grade: a ?? "",
|
|
29
|
+
courseStream: $.MATH,
|
|
30
|
+
preferenceCategory: b.POSITION
|
|
30
31
|
}),
|
|
31
|
-
[
|
|
32
|
-
),
|
|
33
|
-
(
|
|
34
|
-
|
|
35
|
-
personalizedPosition: [i],
|
|
36
|
-
personalizedLevel: [U[i]]
|
|
37
|
-
} : { personalizedLevel: [i] };
|
|
38
|
-
m(n);
|
|
32
|
+
[a, n]
|
|
33
|
+
), c = t ? N : x, B = E(
|
|
34
|
+
(o) => {
|
|
35
|
+
l({ grade: o });
|
|
39
36
|
},
|
|
40
|
-
[
|
|
37
|
+
[l]
|
|
38
|
+
), O = E(
|
|
39
|
+
(o) => {
|
|
40
|
+
const s = t ? {
|
|
41
|
+
personalizedPosition: [o],
|
|
42
|
+
personalizedLevel: [Y[o]]
|
|
43
|
+
} : { personalizedLevel: [o] };
|
|
44
|
+
l(s);
|
|
45
|
+
},
|
|
46
|
+
[t, l]
|
|
41
47
|
);
|
|
42
|
-
return
|
|
48
|
+
return W(() => {
|
|
43
49
|
p("right", { isDisabled: !h, isLoading: !1 });
|
|
44
|
-
}, [h, p]), /* @__PURE__ */
|
|
45
|
-
/* @__PURE__ */ e(
|
|
46
|
-
/* @__PURE__ */ e(
|
|
47
|
-
/* @__PURE__ */
|
|
48
|
-
/* @__PURE__ */
|
|
49
|
-
|
|
50
|
+
}, [h, p]), /* @__PURE__ */ i(J, { children: [
|
|
51
|
+
/* @__PURE__ */ e(M, { height: 60 }),
|
|
52
|
+
/* @__PURE__ */ e(V, {}),
|
|
53
|
+
/* @__PURE__ */ i(Q, { $flexGapX: 1, $gapX: 2.25, $gutterX: 3.125, children: [
|
|
54
|
+
/* @__PURE__ */ i(
|
|
55
|
+
Z,
|
|
50
56
|
{
|
|
51
57
|
$flexDirection: "row",
|
|
52
58
|
$justifyContent: "space-between",
|
|
@@ -54,7 +60,7 @@ const Te = P(function() {
|
|
|
54
60
|
$gutterX: 0.75,
|
|
55
61
|
children: [
|
|
56
62
|
/* @__PURE__ */ e(
|
|
57
|
-
|
|
63
|
+
d,
|
|
58
64
|
{
|
|
59
65
|
withLoader: !0,
|
|
60
66
|
src: _.GREEN_BALLOON,
|
|
@@ -64,7 +70,7 @@ const Te = P(function() {
|
|
|
64
70
|
}
|
|
65
71
|
),
|
|
66
72
|
/* @__PURE__ */ e(
|
|
67
|
-
|
|
73
|
+
d,
|
|
68
74
|
{
|
|
69
75
|
withLoader: !0,
|
|
70
76
|
src: _.GREEN_BALLOON,
|
|
@@ -76,70 +82,83 @@ const Te = P(function() {
|
|
|
76
82
|
]
|
|
77
83
|
}
|
|
78
84
|
),
|
|
79
|
-
|
|
85
|
+
t ? null : /* @__PURE__ */ e(
|
|
86
|
+
oe,
|
|
87
|
+
{
|
|
88
|
+
renderAs: "primary",
|
|
89
|
+
value: a,
|
|
90
|
+
options: w,
|
|
91
|
+
shape: "curved",
|
|
92
|
+
size: "small",
|
|
93
|
+
onChange: B,
|
|
94
|
+
theme: "dark",
|
|
95
|
+
width: 107
|
|
96
|
+
}
|
|
97
|
+
),
|
|
98
|
+
!!(c && c.length > 0) && c.map((o) => {
|
|
80
99
|
var L;
|
|
81
|
-
const { id:
|
|
100
|
+
const { id: s, label: u, lottie: T, description: F } = o, { title: R, description: v, icon: H } = q[u.toLowerCase()] || {}, r = (L = t ? g : f) == null ? void 0 : L.includes(s), P = {
|
|
82
101
|
loop: !1,
|
|
83
|
-
autoplay:
|
|
102
|
+
autoplay: r
|
|
84
103
|
};
|
|
85
|
-
return /* @__PURE__ */
|
|
86
|
-
|
|
104
|
+
return /* @__PURE__ */ i(
|
|
105
|
+
ee,
|
|
87
106
|
{
|
|
88
107
|
$flexDirection: "row",
|
|
89
108
|
$alignItems: "center",
|
|
90
109
|
$justifyContent: "flex-start",
|
|
91
110
|
$flexGapX: 1.25,
|
|
92
|
-
onClick: () =>
|
|
111
|
+
onClick: () => O(s),
|
|
93
112
|
$gutterX: 0.75,
|
|
94
113
|
$gapX: 1,
|
|
95
|
-
$background:
|
|
114
|
+
$background: r ? "BLACK_T_87" : "WHITE_1",
|
|
96
115
|
$borderColor: "BLACK_T_87",
|
|
97
116
|
children: [
|
|
98
|
-
|
|
117
|
+
T ? /* @__PURE__ */ e(
|
|
99
118
|
K,
|
|
100
119
|
{
|
|
101
|
-
src:
|
|
120
|
+
src: X[T],
|
|
102
121
|
height: 64,
|
|
103
122
|
width: 64,
|
|
104
|
-
settings:
|
|
123
|
+
settings: P
|
|
105
124
|
}
|
|
106
|
-
) : /* @__PURE__ */ e(
|
|
107
|
-
/* @__PURE__ */ e(
|
|
125
|
+
) : /* @__PURE__ */ e(d, { withLoader: !0, src: H, height: 64, width: 64, alt: "icon" }),
|
|
126
|
+
/* @__PURE__ */ e(z, { $flex: 1, children: t ? /* @__PURE__ */ i(D, { children: [
|
|
108
127
|
/* @__PURE__ */ e(
|
|
109
|
-
|
|
128
|
+
m,
|
|
110
129
|
{
|
|
111
130
|
className: "feedback-title",
|
|
112
131
|
$renderAs: "ac3-black",
|
|
113
|
-
$color:
|
|
114
|
-
children:
|
|
132
|
+
$color: r ? "WHITE_T_87" : "BLACK_T_87",
|
|
133
|
+
children: u
|
|
115
134
|
}
|
|
116
135
|
),
|
|
117
136
|
/* @__PURE__ */ e(
|
|
118
|
-
|
|
137
|
+
m,
|
|
119
138
|
{
|
|
120
139
|
className: "feedback-desc",
|
|
121
140
|
$renderAs: "ab2",
|
|
122
|
-
$color:
|
|
123
|
-
children:
|
|
141
|
+
$color: r ? "WHITE_T_87" : "BLACK_T_87",
|
|
142
|
+
children: F
|
|
124
143
|
}
|
|
125
144
|
)
|
|
126
|
-
] }) : /* @__PURE__ */
|
|
127
|
-
|
|
145
|
+
] }) : /* @__PURE__ */ i(
|
|
146
|
+
m,
|
|
128
147
|
{
|
|
129
148
|
className: "feedback-title",
|
|
130
149
|
$renderAs: "ac3-black",
|
|
131
|
-
$color:
|
|
150
|
+
$color: r ? "WHITE_T_87" : "BLACK_T_87",
|
|
132
151
|
children: [
|
|
133
|
-
|
|
152
|
+
R,
|
|
134
153
|
":",
|
|
135
154
|
" ",
|
|
136
155
|
/* @__PURE__ */ e(
|
|
137
|
-
|
|
156
|
+
te,
|
|
138
157
|
{
|
|
139
158
|
className: "feedback-desc",
|
|
140
159
|
$renderAs: "ab2",
|
|
141
|
-
$color:
|
|
142
|
-
children:
|
|
160
|
+
$color: r ? "WHITE_T_60" : "BLACK_T_60",
|
|
161
|
+
children: v
|
|
143
162
|
}
|
|
144
163
|
)
|
|
145
164
|
]
|
|
@@ -147,13 +166,13 @@ const Te = P(function() {
|
|
|
147
166
|
) })
|
|
148
167
|
]
|
|
149
168
|
},
|
|
150
|
-
|
|
169
|
+
s
|
|
151
170
|
);
|
|
152
171
|
})
|
|
153
172
|
] })
|
|
154
173
|
] });
|
|
155
174
|
});
|
|
156
175
|
export {
|
|
157
|
-
|
|
176
|
+
_e as default
|
|
158
177
|
};
|
|
159
178
|
//# sourceMappingURL=student-feedback.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"student-feedback.js","sources":["../../../../../src/features/trial-session/comps/student-feedback/student-feedback.tsx"],"sourcesContent":["import { memo, useCallback, useEffect, useMemo } from 'react';\n\nimport { ILLUSTRATIONS } from '../../../../assets/illustrations/illustrations';\nimport { LOTTIE } from '../../../../assets/lottie/lottie';\nimport { COURSE_STREAMS, PREFERENCE_CATEGORY } from '../../../milestone/constants';\nimport { getPreferencesFromConfig } from '../../../milestone/create/milestone-create-helpers';\nimport Image from '../../../ui/image/image';\nimport FlexView from '../../../ui/layout/flex-view';\nimport LottieAnimation from '../../../ui/lottie-animation/lottie-animation';\nimport Separator from '../../../ui/separator/separator';\nimport Text from '../../../ui/text/text';\nimport { useTrialSessionContext } from '../../context/use-trial-session-context';\nimport { TrialPageId } from '../../trial-session-constants';\nimport SlideHeader from '../slide-header';\nimport { PREFERENCE_CODE_MAP, studentLevels } from './student-feedback-constants';\nimport * as Styled from './student-feedback-styled';\n\nconst StudentFeedback = memo(function StudentFeedback() {\n const { slideConfig, formData, milestoneConfig, updateSlideConfig, updateButtonState } =\n useTrialSessionContext();\n\n const { id: slideId } = slideConfig || {};\n const { grade, personalizedLevel = [], personalizedPosition = [] } = formData || {};\n const isStudentLevel = slideId === TrialPageId.STUDENT_LEVEL;\n const hasRequiredFields = Boolean(\n isStudentLevel ? personalizedPosition.length > 0 : personalizedLevel.length > 0,\n );\n\n const levelList = useMemo(\n () =>\n getPreferencesFromConfig(milestoneConfig, {\n grade: grade ?? '',\n courseStream: COURSE_STREAMS.MATH,\n preferenceCategory: PREFERENCE_CATEGORY.LEVEL,\n }),\n [grade, milestoneConfig],\n );\n\n const positionList = useMemo(\n () =>\n getPreferencesFromConfig(milestoneConfig, {\n grade: grade ?? '',\n courseStream: COURSE_STREAMS.MATH,\n preferenceCategory: PREFERENCE_CATEGORY.POSITION,\n }),\n [grade, milestoneConfig],\n );\n\n const studentOptions = isStudentLevel ? positionList : levelList;\n\n const handleClick = useCallback(\n (id: string) => {\n const configToUpdate = isStudentLevel\n ? {\n personalizedPosition: [id],\n personalizedLevel: [PREFERENCE_CODE_MAP[id as keyof typeof PREFERENCE_CODE_MAP]],\n }\n : { personalizedLevel: [id] };\n\n updateSlideConfig(configToUpdate);\n },\n [isStudentLevel, updateSlideConfig],\n );\n\n useEffect(() => {\n updateButtonState('right', { isDisabled: !hasRequiredFields, isLoading: false });\n }, [hasRequiredFields, updateButtonState]);\n\n return (\n <Styled.Container>\n <Separator height={60} />\n <SlideHeader />\n <Styled.FeedbackWrapper $flexGapX={1} $gapX={2.25} $gutterX={3.125}>\n <Styled.BalloonWrapper\n $flexDirection=\"row\"\n $justifyContent=\"space-between\"\n $alignItems=\"center\"\n $gutterX={0.75}\n >\n <Image\n withLoader\n src={ILLUSTRATIONS.GREEN_BALLOON}\n width={28}\n height={34}\n alt=\"balloon\"\n />\n <Image\n withLoader\n src={ILLUSTRATIONS.GREEN_BALLOON}\n width={28}\n height={34}\n alt=\"balloon\"\n />\n </Styled.BalloonWrapper>\n {Boolean(studentOptions && studentOptions.length > 0) &&\n studentOptions.map(level => {\n const { id, label, lottie, description: levelDescription } = level;\n const { title, description, icon } = studentLevels[label.toLowerCase()] || {};\n const isSelected = (\n isStudentLevel ? personalizedPosition : personalizedLevel\n )?.includes(id);\n\n const animationSettings = {\n loop: false,\n autoplay: isSelected,\n };\n\n return (\n <Styled.Feedback\n key={id}\n $flexDirection=\"row\"\n $alignItems=\"center\"\n $justifyContent=\"flex-start\"\n $flexGapX={1.25}\n onClick={() => handleClick(id)}\n $gutterX={0.75}\n $gapX={1}\n $background={isSelected ? 'BLACK_T_87' : 'WHITE_1'}\n $borderColor=\"BLACK_T_87\"\n >\n {lottie ? (\n <LottieAnimation\n src={LOTTIE[lottie]}\n height={64}\n width={64}\n settings={animationSettings}\n />\n ) : (\n <Image withLoader src={icon} height={64} width={64} alt=\"icon\" />\n )}\n <FlexView $flex={1}>\n {isStudentLevel ? (\n <>\n <Text\n className=\"feedback-title\"\n $renderAs=\"ac3-black\"\n $color={isSelected ? 'WHITE_T_87' : 'BLACK_T_87'}\n >\n {label}\n </Text>\n <Text\n className=\"feedback-desc\"\n $renderAs=\"ab2\"\n $color={isSelected ? 'WHITE_T_87' : 'BLACK_T_87'}\n >\n {levelDescription}\n </Text>\n </>\n ) : (\n <Text\n className=\"feedback-title\"\n $renderAs=\"ac3-black\"\n $color={isSelected ? 'WHITE_T_87' : 'BLACK_T_87'}\n >\n {title}:{' '}\n <Styled.InlineText\n className=\"feedback-desc\"\n $renderAs=\"ab2\"\n $color={isSelected ? 'WHITE_T_60' : 'BLACK_T_60'}\n >\n {description}\n </Styled.InlineText>\n </Text>\n )}\n </FlexView>\n </Styled.Feedback>\n );\n })}\n </Styled.FeedbackWrapper>\n </Styled.Container>\n );\n});\n\nexport default StudentFeedback;\n"],"names":["StudentFeedback","memo","slideConfig","formData","milestoneConfig","updateSlideConfig","updateButtonState","useTrialSessionContext","slideId","grade","personalizedLevel","personalizedPosition","isStudentLevel","TrialPageId","hasRequiredFields","levelList","useMemo","getPreferencesFromConfig","COURSE_STREAMS","PREFERENCE_CATEGORY","positionList","studentOptions","handleClick","useCallback","id","configToUpdate","PREFERENCE_CODE_MAP","useEffect","jsxs","Styled.Container","jsx","Separator","SlideHeader","Styled.FeedbackWrapper","Styled.BalloonWrapper","Image","ILLUSTRATIONS","level","label","lottie","levelDescription","title","description","icon","studentLevels","isSelected","_a","animationSettings","Styled.Feedback","LottieAnimation","LOTTIE","FlexView","Fragment","Text","Styled.InlineText"],"mappings":";;;;;;;;;;;;;;;;AAiBM,MAAAA,KAAkBC,EAAK,WAA2B;AACtD,QAAM,EAAE,aAAAC,GAAa,UAAAC,GAAU,iBAAAC,GAAiB,mBAAAC,GAAmB,mBAAAC,EAAA,IACjEC,KAEI,EAAE,IAAIC,MAAYN,KAAe,CAAA,GACjC,EAAE,OAAAO,GAAO,mBAAAC,IAAoB,CAAC,GAAG,sBAAAC,IAAuB,GAAO,IAAAR,KAAY,IAC3ES,IAAiBJ,MAAYK,EAAY,eACzCC,IACJF,IAAiBD,EAAqB,SAAS,IAAID,EAAkB,SAAS,GAG1EK,IAAYC;AAAA,IAChB,MACEC,EAAyBb,GAAiB;AAAA,MACxC,OAAOK,KAAS;AAAA,MAChB,cAAcS,EAAe;AAAA,MAC7B,oBAAoBC,EAAoB;AAAA,IAAA,CACzC;AAAA,IACH,CAACV,GAAOL,CAAe;AAAA,EAAA,GAGnBgB,IAAeJ;AAAA,IACnB,MACEC,EAAyBb,GAAiB;AAAA,MACxC,OAAOK,KAAS;AAAA,MAChB,cAAcS,EAAe;AAAA,MAC7B,oBAAoBC,EAAoB;AAAA,IAAA,CACzC;AAAA,IACH,CAACV,GAAOL,CAAe;AAAA,EAAA,GAGnBiB,IAAiBT,IAAiBQ,IAAeL,GAEjDO,IAAcC;AAAA,IAClB,CAACC,MAAe;AACd,YAAMC,IAAiBb,IACnB;AAAA,QACE,sBAAsB,CAACY,CAA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,WAAU;AAAA,kBACV,QAAQR,IAAa,eAAe;AAAA,kBAEnC,UAAA;AAAA,oBAAAJ;AAAA,oBAAM;AAAA,oBAAE;AAAA,oBACT,gBAAAX;AAAA,sBAACwB;AAAAA,sBAAA;AAAA,wBACC,WAAU;AAAA,wBACV,WAAU;AAAA,wBACV,QAAQT,IAAa,eAAe;AAAA,wBAEnC,UAAAH;AAAA,sBAAA;AAAA,oBACH;AAAA,kBAAA;AAAA,gBAAA;AAAA,cAAA,GAGN;AAAA,YAAA;AAAA,UAAA;AAAA,UAvDKlB;AAAA,QAAA;AAAA,MAwDP,CAEH;AAAA,IAAA,GACL;AAAA,EACF,EAAA,CAAA;AAEJ,CAAC;"}
|
|
1
|
+
{"version":3,"file":"student-feedback.js","sources":["../../../../../src/features/trial-session/comps/student-feedback/student-feedback.tsx"],"sourcesContent":["import { memo, useCallback, useEffect, useMemo } from 'react';\n\nimport { ILLUSTRATIONS } from '../../../../assets/illustrations/illustrations';\nimport { LOTTIE } from '../../../../assets/lottie/lottie';\nimport { COURSE_STREAMS, PREFERENCE_CATEGORY } from '../../../milestone/constants';\nimport {\n getGradesFromConfig,\n getPreferencesFromConfig,\n} from '../../../milestone/create/milestone-create-helpers';\nimport Image from '../../../ui/image/image';\nimport FlexView from '../../../ui/layout/flex-view';\nimport LottieAnimation from '../../../ui/lottie-animation/lottie-animation';\nimport Separator from '../../../ui/separator/separator';\nimport Text from '../../../ui/text/text';\nimport { useTrialSessionContext } from '../../context/use-trial-session-context';\nimport { TrialPageId } from '../../trial-session-constants';\nimport SlideHeader from '../slide-header';\nimport { PREFERENCE_CODE_MAP, studentLevels } from './student-feedback-constants';\nimport * as Styled from './student-feedback-styled';\nimport SelectInput from '../../../ui/inputs/select-input/select-input';\n\nconst StudentFeedback = memo(function StudentFeedback() {\n const { slideConfig, formData, milestoneConfig, updateSlideConfig, updateButtonState } =\n useTrialSessionContext();\n\n const { id: slideId } = slideConfig || {};\n const { grade, personalizedLevel = [], personalizedPosition = [] } = formData || {};\n const isStudentLevel = slideId === TrialPageId.STUDENT_LEVEL;\n const hasRequiredFields = Boolean(\n isStudentLevel ? personalizedPosition.length > 0 : personalizedLevel.length > 0,\n );\n\n const grades = getGradesFromConfig(milestoneConfig);\n\n const levelList = useMemo(\n () =>\n getPreferencesFromConfig(milestoneConfig, {\n grade: grade ?? '',\n courseStream: COURSE_STREAMS.MATH,\n preferenceCategory: PREFERENCE_CATEGORY.LEVEL,\n }),\n [grade, milestoneConfig],\n );\n\n const positionList = useMemo(\n () =>\n getPreferencesFromConfig(milestoneConfig, {\n grade: grade ?? '',\n courseStream: COURSE_STREAMS.MATH,\n preferenceCategory: PREFERENCE_CATEGORY.POSITION,\n }),\n [grade, milestoneConfig],\n );\n\n const studentOptions = isStudentLevel ? positionList : levelList;\n\n const onGradeChange = useCallback(\n (value: string) => {\n updateSlideConfig({ grade: value });\n },\n [updateSlideConfig],\n );\n\n const handleClick = useCallback(\n (id: string) => {\n const configToUpdate = isStudentLevel\n ? {\n personalizedPosition: [id],\n personalizedLevel: [PREFERENCE_CODE_MAP[id as keyof typeof PREFERENCE_CODE_MAP]],\n }\n : { personalizedLevel: [id] };\n\n updateSlideConfig(configToUpdate);\n },\n [isStudentLevel, updateSlideConfig],\n );\n\n useEffect(() => {\n updateButtonState('right', { isDisabled: !hasRequiredFields, isLoading: false });\n }, [hasRequiredFields, updateButtonState]);\n\n return (\n <Styled.Container>\n <Separator height={60} />\n <SlideHeader />\n <Styled.FeedbackWrapper $flexGapX={1} $gapX={2.25} $gutterX={3.125}>\n <Styled.BalloonWrapper\n $flexDirection=\"row\"\n $justifyContent=\"space-between\"\n $alignItems=\"center\"\n $gutterX={0.75}\n >\n <Image\n withLoader\n src={ILLUSTRATIONS.GREEN_BALLOON}\n width={28}\n height={34}\n alt=\"balloon\"\n />\n <Image\n withLoader\n src={ILLUSTRATIONS.GREEN_BALLOON}\n width={28}\n height={34}\n alt=\"balloon\"\n />\n </Styled.BalloonWrapper>\n {isStudentLevel ? null : (\n <SelectInput\n renderAs=\"primary\"\n value={grade}\n options={grades}\n shape=\"curved\"\n size=\"small\"\n onChange={onGradeChange}\n theme=\"dark\"\n width={107}\n />\n )}\n {Boolean(studentOptions && studentOptions.length > 0) &&\n studentOptions.map(level => {\n const { id, label, lottie, description: levelDescription } = level;\n const { title, description, icon } = studentLevels[label.toLowerCase()] || {};\n const isSelected = (\n isStudentLevel ? personalizedPosition : personalizedLevel\n )?.includes(id);\n\n const animationSettings = {\n loop: false,\n autoplay: isSelected,\n };\n\n return (\n <Styled.Feedback\n key={id}\n $flexDirection=\"row\"\n $alignItems=\"center\"\n $justifyContent=\"flex-start\"\n $flexGapX={1.25}\n onClick={() => handleClick(id)}\n $gutterX={0.75}\n $gapX={1}\n $background={isSelected ? 'BLACK_T_87' : 'WHITE_1'}\n $borderColor=\"BLACK_T_87\"\n >\n {lottie ? (\n <LottieAnimation\n src={LOTTIE[lottie]}\n height={64}\n width={64}\n settings={animationSettings}\n />\n ) : (\n <Image withLoader src={icon} height={64} width={64} alt=\"icon\" />\n )}\n <FlexView $flex={1}>\n {isStudentLevel ? (\n <>\n <Text\n className=\"feedback-title\"\n $renderAs=\"ac3-black\"\n $color={isSelected ? 'WHITE_T_87' : 'BLACK_T_87'}\n >\n {label}\n </Text>\n <Text\n className=\"feedback-desc\"\n $renderAs=\"ab2\"\n $color={isSelected ? 'WHITE_T_87' : 'BLACK_T_87'}\n >\n {levelDescription}\n </Text>\n </>\n ) : (\n <Text\n className=\"feedback-title\"\n $renderAs=\"ac3-black\"\n $color={isSelected ? 'WHITE_T_87' : 'BLACK_T_87'}\n >\n {title}:{' '}\n <Styled.InlineText\n className=\"feedback-desc\"\n $renderAs=\"ab2\"\n $color={isSelected ? 'WHITE_T_60' : 'BLACK_T_60'}\n >\n {description}\n </Styled.InlineText>\n </Text>\n )}\n </FlexView>\n </Styled.Feedback>\n );\n })}\n </Styled.FeedbackWrapper>\n </Styled.Container>\n );\n});\n\nexport default StudentFeedback;\n"],"names":["StudentFeedback","memo","slideConfig","formData","milestoneConfig","updateSlideConfig","updateButtonState","useTrialSessionContext","slideId","grade","personalizedLevel","personalizedPosition","isStudentLevel","TrialPageId","hasRequiredFields","grades","getGradesFromConfig","levelList","useMemo","getPreferencesFromConfig","COURSE_STREAMS","PREFERENCE_CATEGORY","positionList","studentOptions","onGradeChange","useCallback","value","handleClick","id","configToUpdate","PREFERENCE_CODE_MAP","useEffect","jsxs","Styled.Container","jsx","Separator","SlideHeader","Styled.FeedbackWrapper","Styled.BalloonWrapper","Image","ILLUSTRATIONS","SelectInput","level","label","lottie","levelDescription","title","description","icon","studentLevels","isSelected","_a","animationSettings","Styled.Feedback","LottieAnimation","LOTTIE","FlexView","Fragment","Text","Styled.InlineText"],"mappings":";;;;;;;;;;;;;;;;;AAqBM,MAAAA,KAAkBC,EAAK,WAA2B;AACtD,QAAM,EAAE,aAAAC,GAAa,UAAAC,GAAU,iBAAAC,GAAiB,mBAAAC,GAAmB,mBAAAC,EAAA,IACjEC,KAEI,EAAE,IAAIC,MAAYN,KAAe,CAAA,GACjC,EAAE,OAAAO,GAAO,mBAAAC,IAAoB,CAAC,GAAG,sBAAAC,IAAuB,GAAO,IAAAR,KAAY,IAC3ES,IAAiBJ,MAAYK,EAAY,eACzCC,IACJF,IAAiBD,EAAqB,SAAS,IAAID,EAAkB,SAAS,GAG1EK,IAASC,EAAoBZ,CAAe,GAE5Ca,IAAYC;AAAA,IAChB,MACEC,EAAyBf,GAAiB;AAAA,MACxC,OAAOK,KAAS;AAAA,MAChB,cAAcW,EAAe;AAAA,MAC7B,oBAAoBC,EAAoB;AAAA,IAAA,CACzC;AAAA,IACH,CAACZ,GAAOL,CAAe;AAAA,EAAA,GAGnBkB,IAAeJ;AAAA,IACnB,MACEC,EAAyBf,GAAiB;AAAA,MACxC,OAAOK,KAAS;AAAA,MAChB,cAAcW,EAAe;AAAA,MAC7B,oBAAoBC,EAAoB;AAAA,IAAA,CACzC;AAAA,IACH,CAACZ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AA,cAEhE,gBAAAd,EAAAsB,GAAA,EAAS,OAAO,GACd,cAEG,gBAAAxB,EAAAyB,GAAA,EAAA,UAAA;AAAA,gBAAA,gBAAAvB;AAAA,kBAACwB;AAAA,kBAAA;AAAA,oBACC,WAAU;AAAA,oBACV,WAAU;AAAA,oBACV,QAAQR,IAAa,eAAe;AAAA,oBAEnC,UAAAP;AAAA,kBAAA;AAAA,gBACH;AAAA,gBACA,gBAAAT;AAAA,kBAACwB;AAAA,kBAAA;AAAA,oBACC,WAAU;AAAA,oBACV,WAAU;AAAA,oBACV,QAAQR,IAAa,eAAe;AAAA,oBAEnC,UAAAL;AAAA,kBAAA;AAAA,gBACH;AAAA,cAAA,EAAA,CACF,IAEA,gBAAAb;AAAA,gBAAC0B;AAAA,gBAAA;AAAA,kBACC,WAAU;AAAA,kBACV,WAAU;AAAA,kBACV,QAAQR,IAAa,eAAe;AAAA,kBAEnC,UAAA;AAAA,oBAAAJ;AAAA,oBAAM;AAAA,oBAAE;AAAA,oBACT,gBAAAZ;AAAA,sBAACyB;AAAAA,sBAAA;AAAA,wBACC,WAAU;AAAA,wBACV,WAAU;AAAA,wBACV,QAAQT,IAAa,eAAe;AAAA,wBAEnC,UAAAH;AAAA,sBAAA;AAAA,oBACH;AAAA,kBAAA;AAAA,gBAAA;AAAA,cAAA,GAGN;AAAA,YAAA;AAAA,UAAA;AAAA,UAvDKnB;AAAA,QAAA;AAAA,MAwDP,CAEH;AAAA,IAAA,GACL;AAAA,EACF,EAAA,CAAA;AAEJ,CAAC;"}
|
|
@@ -1,30 +1,43 @@
|
|
|
1
1
|
import { jsx as u } from "react/jsx-runtime";
|
|
2
|
-
import { useState as
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import { useResumeTrialWorksheet as
|
|
6
|
-
import { useTrialSessionContext as
|
|
7
|
-
const
|
|
8
|
-
const { isTeacher:
|
|
9
|
-
if (
|
|
2
|
+
import { useState as p, useCallback as D, useEffect as E } from "react";
|
|
3
|
+
import N from "../../../ui/error/error.js";
|
|
4
|
+
import W from "../../../ui/loader/app-loader/app-loader.js";
|
|
5
|
+
import { useResumeTrialWorksheet as b } from "../../api/trial-nodes.js";
|
|
6
|
+
import { useTrialSessionContext as j } from "../../context/use-trial-session-context.js";
|
|
7
|
+
const q = () => {
|
|
8
|
+
const { isTeacher: r, studentId: s, worksheet: n, formData: l, updateSlideConfig: h, trialHomeData: _ } = j(), [g, i] = p(!1), [a, y] = p(!1), { resetAttempt: e } = l || {}, { demo_info: I } = _, { region_data: C, course: c } = I || {}, { opportunity_country: d = "US" } = C || {}, P = (S, f) => {
|
|
9
|
+
if (S && i(!0), f) {
|
|
10
10
|
const {
|
|
11
|
-
user_node_id:
|
|
12
|
-
node_id:
|
|
13
|
-
user_attempt_id:
|
|
14
|
-
node_type:
|
|
15
|
-
} =
|
|
16
|
-
|
|
11
|
+
user_node_id: T,
|
|
12
|
+
node_id: k,
|
|
13
|
+
user_attempt_id: A,
|
|
14
|
+
node_type: x
|
|
15
|
+
} = f;
|
|
16
|
+
y(!0), h({ userNodeId: T, nodeId: k, attemptId: A, nodeType: x, resetAttempt: !1 });
|
|
17
17
|
}
|
|
18
|
-
}, { patch:
|
|
19
|
-
onComplete:
|
|
20
|
-
}),
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
18
|
+
}, { patch: m, isProcessing: t } = b({
|
|
19
|
+
onComplete: P
|
|
20
|
+
}), o = D(() => {
|
|
21
|
+
r && !t && !a && (i(!1), m(s, {
|
|
22
|
+
country_code: d,
|
|
23
|
+
course: c,
|
|
24
|
+
reset_attempt: e === void 0 || e
|
|
25
|
+
}));
|
|
26
|
+
}, [
|
|
27
|
+
d,
|
|
28
|
+
c,
|
|
29
|
+
r,
|
|
30
|
+
m,
|
|
31
|
+
s,
|
|
32
|
+
e,
|
|
33
|
+
t,
|
|
34
|
+
a
|
|
35
|
+
]);
|
|
36
|
+
return E(() => {
|
|
37
|
+
o();
|
|
38
|
+
}, [o]), g ? /* @__PURE__ */ u(N, { height: "100%", onTryAgain: o }) : t || !n ? /* @__PURE__ */ u(W, { height: "100%" }) : n;
|
|
26
39
|
};
|
|
27
40
|
export {
|
|
28
|
-
|
|
41
|
+
q as default
|
|
29
42
|
};
|
|
30
43
|
//# sourceMappingURL=worksheet.js.map
|