@cuemath/leap 3.3.12-j2 → 3.3.12-pawar.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/features/auth/comps/pill-button/pill-button.js +19 -19
- package/dist/features/auth/comps/pill-button/pill-button.js.map +1 -1
- package/dist/features/auth/pla-signup/pla-analytics-events.js +4 -5
- package/dist/features/auth/pla-signup/pla-analytics-events.js.map +1 -1
- package/dist/features/parent-dashboard/hooks/use-parent-home-data.js +42 -45
- package/dist/features/parent-dashboard/hooks/use-parent-home-data.js.map +1 -1
- package/dist/features/parent-dashboard/parent-dashboard-types.js +2 -3
- package/dist/features/parent-dashboard/parent-dashboard-types.js.map +1 -1
- package/dist/features/parent-dashboard/parent-dashboard-view.js +127 -139
- package/dist/features/parent-dashboard/parent-dashboard-view.js.map +1 -1
- package/dist/features/trial-session/comps/pla/session-summary/session-summary-constants.js +7 -8
- package/dist/features/trial-session/comps/pla/session-summary/session-summary-constants.js.map +1 -1
- package/dist/features/trial-session/comps/pla/session-summary/session-summary.js +26 -27
- package/dist/features/trial-session/comps/pla/session-summary/session-summary.js.map +1 -1
- package/dist/features/trial-session/comps/session-report/report-information/report-information-styled.js +13 -15
- package/dist/features/trial-session/comps/session-report/report-information/report-information-styled.js.map +1 -1
- package/dist/features/trial-session/comps/session-report/report-information/report-information.js +1 -1
- package/dist/features/trial-session/comps/session-report/report-information/report-information.js.map +1 -1
- package/dist/features/trial-session/comps/worksheet/worksheet.js +22 -22
- package/dist/features/trial-session/comps/worksheet/worksheet.js.map +1 -1
- package/dist/features/trial-session/trial-session-types.js.map +1 -1
- package/dist/features/worksheet/worksheet-preview/dynamic-worksheet-preview/dynamic-worksheet-preview.js +18 -17
- package/dist/features/worksheet/worksheet-preview/dynamic-worksheet-preview/dynamic-worksheet-preview.js.map +1 -1
- package/dist/features/worksheet/worksheet-preview/hooks/use-worksheet-layout.js.map +1 -1
- package/dist/features/worksheet/worksheet-preview/worksheet-preview-view.js +31 -30
- package/dist/features/worksheet/worksheet-preview/worksheet-preview-view.js.map +1 -1
- package/dist/index.d.ts +18 -54
- package/dist/index.js +218 -232
- package/dist/index.js.map +1 -1
- package/dist/node_modules/query-string/base.js +1 -1
- package/dist/node_modules/query-string/node_modules/decode-uri-component/index.js.map +1 -0
- package/dist/node_modules/uuid/dist/esm-browser/regex.js +5 -0
- package/dist/node_modules/uuid/dist/esm-browser/regex.js.map +1 -0
- package/dist/node_modules/uuid/dist/esm-browser/rng.js +2 -3
- package/dist/node_modules/uuid/dist/esm-browser/rng.js.map +1 -1
- package/dist/node_modules/uuid/dist/esm-browser/stringify.js +10 -6
- package/dist/node_modules/uuid/dist/esm-browser/stringify.js.map +1 -1
- package/dist/node_modules/uuid/dist/esm-browser/v4.js +9 -12
- package/dist/node_modules/uuid/dist/esm-browser/v4.js.map +1 -1
- package/dist/node_modules/uuid/dist/esm-browser/validate.js +8 -0
- package/dist/node_modules/uuid/dist/esm-browser/validate.js.map +1 -0
- package/package.json +2 -3
- package/dist/features/parent-dashboard/api/get-student-profile-summary.js +0 -9
- package/dist/features/parent-dashboard/api/get-student-profile-summary.js.map +0 -1
- package/dist/features/parent-dashboard/comps/pla-first-session-introduction/pla-first-session-introduction-styled.js +0 -9
- package/dist/features/parent-dashboard/comps/pla-first-session-introduction/pla-first-session-introduction-styled.js.map +0 -1
- package/dist/features/parent-dashboard/comps/pla-first-session-introduction/pla-first-session-introduction.js +0 -42
- package/dist/features/parent-dashboard/comps/pla-first-session-introduction/pla-first-session-introduction.js.map +0 -1
- package/dist/features/parent-dashboard/hooks/use-student-profile-summary-data.js +0 -20
- package/dist/features/parent-dashboard/hooks/use-student-profile-summary-data.js.map +0 -1
- package/dist/features/parent-dashboard/modals/help-and-support/help-and-support.js +0 -40
- package/dist/features/parent-dashboard/modals/help-and-support/help-and-support.js.map +0 -1
- package/dist/features/parent-dashboard/modals/student-login-info/student-login-info.js +0 -44
- package/dist/features/parent-dashboard/modals/student-login-info/student-login-info.js.map +0 -1
- package/dist/features/parent-dashboard/modals/student-profile-summary/student-profile-summary-helpers.js +0 -32
- package/dist/features/parent-dashboard/modals/student-profile-summary/student-profile-summary-helpers.js.map +0 -1
- package/dist/features/parent-dashboard/modals/student-profile-summary/student-profile-summary-styled.js +0 -13
- package/dist/features/parent-dashboard/modals/student-profile-summary/student-profile-summary-styled.js.map +0 -1
- package/dist/features/parent-dashboard/modals/student-profile-summary/student-profile-summary.js +0 -44
- package/dist/features/parent-dashboard/modals/student-profile-summary/student-profile-summary.js.map +0 -1
- package/dist/features/parent-dashboard/modals/trial-report/trial-report-styled.js +0 -14
- package/dist/features/parent-dashboard/modals/trial-report/trial-report-styled.js.map +0 -1
- package/dist/features/parent-dashboard/modals/trial-report/trial-report.js +0 -28
- package/dist/features/parent-dashboard/modals/trial-report/trial-report.js.map +0 -1
- package/dist/features/parent-dashboard/modals/tutor-change/tutor-change-constants.js +0 -43
- package/dist/features/parent-dashboard/modals/tutor-change/tutor-change-constants.js.map +0 -1
- package/dist/features/parent-dashboard/modals/tutor-change/tutor-change-styled.js +0 -59
- package/dist/features/parent-dashboard/modals/tutor-change/tutor-change-styled.js.map +0 -1
- package/dist/features/parent-dashboard/modals/tutor-change/tutor-change.js +0 -86
- package/dist/features/parent-dashboard/modals/tutor-change/tutor-change.js.map +0 -1
- package/dist/node_modules/decode-uri-component/index.js.map +0 -1
- package/dist/node_modules/uuid/dist/esm-browser/native.js +0 -7
- package/dist/node_modules/uuid/dist/esm-browser/native.js.map +0 -1
- /package/dist/node_modules/{decode-uri-component → query-string/node_modules/decode-uri-component}/index.js +0 -0
|
@@ -1,15 +1,13 @@
|
|
|
1
1
|
import r from "styled-components";
|
|
2
|
-
import
|
|
2
|
+
import t from "../../../../ui/image/image.js";
|
|
3
3
|
import i from "../../../../ui/layout/flex-view.js";
|
|
4
|
-
import
|
|
5
|
-
const
|
|
4
|
+
import e from "../../../../ui/text/text.js";
|
|
5
|
+
const n = r(i)(
|
|
6
6
|
({ theme: o }) => `
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
border-bottom: 1px solid ${o.colors.BLACK_1};
|
|
10
|
-
}
|
|
7
|
+
border-top: 1px solid ${o.colors.BLACK_1};
|
|
8
|
+
border-bottom: 1px solid ${o.colors.BLACK_1};
|
|
11
9
|
`
|
|
12
|
-
),
|
|
10
|
+
), a = r(i)(
|
|
13
11
|
({ theme: o }) => `
|
|
14
12
|
& > div {
|
|
15
13
|
box-sizing: border-box;;
|
|
@@ -20,20 +18,20 @@ const a = r(i)(
|
|
|
20
18
|
}
|
|
21
19
|
}
|
|
22
20
|
`
|
|
23
|
-
),
|
|
21
|
+
), c = r(i)`
|
|
24
22
|
min-height: 88px;
|
|
25
|
-
`,
|
|
23
|
+
`, m = r(e)`
|
|
26
24
|
display: inline;
|
|
27
|
-
`, x = r(
|
|
25
|
+
`, x = r(t)(
|
|
28
26
|
({ $active: o }) => `
|
|
29
27
|
${o ? "" : "filter: grayscale(100%);"}
|
|
30
28
|
`
|
|
31
29
|
);
|
|
32
30
|
export {
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
31
|
+
m as InlineText,
|
|
32
|
+
c as ReportCardWrapper,
|
|
33
|
+
a as ReportWrapper,
|
|
36
34
|
x as TopicImage,
|
|
37
|
-
|
|
35
|
+
n as TopicWrapper
|
|
38
36
|
};
|
|
39
37
|
//# sourceMappingURL=report-information-styled.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"report-information-styled.js","sources":["../../../../../../src/features/trial-session/comps/session-report/report-information/report-information-styled.tsx"],"sourcesContent":["import type { IImageProps } from '../../../../ui/image/image-types';\n\nimport styled from 'styled-components';\n\nimport Image from '../../../../ui/image/image';\nimport FlexView from '../../../../ui/layout/flex-view';\nimport Text from '../../../../ui/text/text';\n\nconst TopicWrapper = styled(FlexView)(\n ({ theme }) => `\n
|
|
1
|
+
{"version":3,"file":"report-information-styled.js","sources":["../../../../../../src/features/trial-session/comps/session-report/report-information/report-information-styled.tsx"],"sourcesContent":["import type { IImageProps } from '../../../../ui/image/image-types';\n\nimport styled from 'styled-components';\n\nimport Image from '../../../../ui/image/image';\nimport FlexView from '../../../../ui/layout/flex-view';\nimport Text from '../../../../ui/text/text';\n\nconst TopicWrapper = styled(FlexView)(\n ({ theme }) => `\n border-top: 1px solid ${theme.colors.BLACK_1};\n border-bottom: 1px solid ${theme.colors.BLACK_1};\n`,\n);\n\nconst ReportWrapper = styled(FlexView)(\n ({ theme }) => `\n & > div {\n box-sizing: border-box;;\n }\n ${theme.mediaQueries.minWidthTablet} {\n & > div:not(:last-child) {\n border-right: 1px solid ${theme.colors.BLACK_1};\n }\n }\n`,\n);\n\nconst ReportCardWrapper = styled(FlexView)`\n min-height: 88px;\n`;\n\nconst InlineText = styled(Text)`\n display: inline;\n`;\n\ninterface ITopicImage extends IImageProps {\n $active: boolean;\n}\n\nconst TopicImage = styled(Image)<ITopicImage>(\n ({ $active }) => `\n ${$active ? '' : 'filter: grayscale(100%);'}\n`,\n);\n\nexport { TopicWrapper, InlineText, ReportWrapper, TopicImage, ReportCardWrapper };\n"],"names":["TopicWrapper","styled","FlexView","theme","ReportWrapper","ReportCardWrapper","InlineText","Text","TopicImage","Image","$active"],"mappings":";;;;AAQM,MAAAA,IAAeC,EAAOC,CAAQ;AAAA,EAClC,CAAC,EAAE,OAAAC,EAAA,MAAY;AAAA,2BACUA,EAAM,OAAO,OAAO;AAAA,8BACjBA,EAAM,OAAO,OAAO;AAAA;AAElD,GAEMC,IAAgBH,EAAOC,CAAQ;AAAA,EACnC,CAAC,EAAE,OAAAC,EAAA,MAAY;AAAA;AAAA;AAAA;AAAA,IAIbA,EAAM,aAAa,cAAc;AAAA;AAAA,gCAELA,EAAM,OAAO,OAAO;AAAA;AAAA;AAAA;AAIpD,GAEME,IAAoBJ,EAAOC,CAAQ;AAAA;AAAA,GAInCI,IAAaL,EAAOM,CAAI;AAAA;AAAA,GAQxBC,IAAaP,EAAOQ,CAAK;AAAA,EAC7B,CAAC,EAAE,SAAAC,EAAA,MAAc;AAAA,IACfA,IAAU,KAAK,0BAA0B;AAAA;AAE7C;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"report-information.js","sources":["../../../../../../src/features/trial-session/comps/session-report/report-information/report-information.tsx"],"sourcesContent":["import type { TSessionReportData } from '../session-report-types';\nimport type { FC } from 'react';\n\nimport { memo, useMemo } from 'react';\nimport { useTheme } from 'styled-components';\n\nimport { ILLUSTRATIONS } from '../../../../../assets/illustrations/illustrations';\nimport { useUIContext } from '../../../../ui/context/context';\nimport Image from '../../../../ui/image/image';\nimport FlexView from '../../../../ui/layout/flex-view';\nimport Separator from '../../../../ui/separator/separator';\nimport Text from '../../../../ui/text/text';\nimport { EDeviceType } from '../../../../ui/theme/constants';\nimport Report404 from '../report-404/report-404';\nimport ReportCard from './report-card';\nimport * as Styled from './report-information-styled';\n\ninterface IReportInformationProps {\n sessionReports: TSessionReportData;\n studentName: string;\n}\n\nconst ReportInformation: FC<IReportInformationProps> = memo(props => {\n const theme = useTheme();\n const isMobile = theme.device <= EDeviceType.MOBILE;\n const { sessionReports, studentName } = props;\n const {\n next_steps: nextSteps,\n topic_data: topicData,\n solved_with_help: solvedWithHelp,\n problems_attempted: problemsAttempted,\n new_concepts_learnt: newConceptsLearnt,\n solved_independently: solvedIndependently,\n default_topic_image_url: defaultTopicImage,\n } = sessionReports || {};\n\n const { onEvent: trackEvent } = useUIContext();\n\n const renderReportsInfoCard = useMemo(() => {\n if (!problemsAttempted) return null;\n\n if (problemsAttempted === solvedIndependently || (!solvedWithHelp && solvedIndependently)) {\n return (\n <>\n <ReportCard title=\"Problems Attempted\" value={problemsAttempted} widthOnMobile=\"50%\" />\n <ReportCard title=\"Solved without help\" value={solvedIndependently} widthOnMobile=\"50%\" />\n <ReportCard\n title=\"Performance\"\n value={`${Math.round((solvedIndependently / problemsAttempted) * 100)}%`}\n />\n </>\n );\n }\n\n if (!solvedWithHelp && !solvedIndependently) {\n return <ReportCard title=\"Problems Attempted\" value={problemsAttempted} />;\n }\n\n if (solvedWithHelp && newConceptsLearnt) {\n return (\n <>\n <ReportCard title=\"Problems Attempted\" value={problemsAttempted} widthOnMobile=\"50%\" />\n <ReportCard title=\"Needed help in\" value={newConceptsLearnt} widthOnMobile=\"50%\" />\n <ReportCard title=\"Improvement shown in\" value={solvedWithHelp} widthOnMobile=\"50%\" />\n <ReportCard\n title=\"Improvement\"\n value={`${Math.round((solvedWithHelp / newConceptsLearnt) * 100)}%`}\n widthOnMobile=\"50%\"\n />\n </>\n );\n }\n\n return null;\n }, [newConceptsLearnt, problemsAttempted, solvedIndependently, solvedWithHelp]);\n\n if (!renderReportsInfoCard) return <Report404 studentName={studentName} />;\n\n return (\n <FlexView\n $borderColor={isMobile ? 'TRANSPARENT' : 'BLACK_1'}\n $gapX={isMobile ? 1 : 0}\n $background={isMobile ? 'BLACK_2' : 'TRANSPARENT'}\n $gutterX={isMobile ? 1 : 0}\n >\n <Styled.ReportWrapper\n $flexWrap={isMobile}\n $flexDirection=\"row\"\n $height={isMobile ? 'auto' : 100}\n $background={isMobile ? 'BLACK_2' : 'YELLOW_1'}\n >\n {renderReportsInfoCard}\n </Styled.ReportWrapper>\n <Styled.TopicWrapper\n $flexDirection={isMobile ? 'column' : 'row'}\n $background={isMobile ? 'BLACK_2' : 'WHITE_1'}\n $flexRowGapX={isMobile ? 1.25 : 0}\n $gapX={isMobile ? 1.5 : 0}\n >\n {topicData &&\n topicData.length > 0 &&\n topicData.map(topic => {\n const {\n topic_name: topicName,\n topic_image: topicImage,\n summary,\n is_attempted: isAttempted,\n } = topic;\n\n if (!topicImage) {\n trackEvent('TOPIC_THUMBNAIL_NOT_AVAILABLE', topic);\n }\n\n return (\n <FlexView\n key={topicName}\n $gap={isMobile ? 0 : 29}\n $gutter={isMobile ? 0 : 20}\n $flex={1}\n $alignItems={isMobile ? 'center' : 'center'}\n $opacity={isAttempted ? 1 : 0.4}\n $flexDirection={isMobile ? 'row' : 'column'}\n $flexColumnGapX={isMobile ? 1 : 0}\n >\n <FlexView>\n <Styled.TopicImage\n $active={!!isAttempted}\n src={topicImage || defaultTopicImage}\n borderRadius={96}\n height={isMobile ? 84 : 96}\n width={isMobile ? 84 : 96}\n alt=\"topic\"\n withLoader\n />\n </FlexView>\n <FlexView $alignItems={isMobile ? 'flex-start' : 'center'} $gapX={1} $flex={1}>\n {!isMobile && <Separator height={12} />}\n <Text\n $renderAs=\"ab2-bold\"\n $align={isMobile ? 'left' : 'center'}\n $color={isMobile ? 'WHITE' : 'BLACK_1'}\n >\n {topicName}\n </Text>\n <Separator height={2} />\n <Text\n $renderAs=\"ub2\"\n $align={isMobile ? 'left' : 'center'}\n $color={isMobile ? 'WHITE' : 'BLACK_1'}\n >\n {summary}\n </Text>\n </FlexView>\n </FlexView>\n );\n })}\n </Styled.TopicWrapper>\n {isMobile && (\n <FlexView $background=\"BLACK_2\">\n <Text $renderAs=\"ac4-black\" $color=\"WHITE_T_60\">\n Next Steps\n </Text>\n <Separator height={4} />\n </FlexView>\n )}\n <FlexView\n $flexDirection=\"row\"\n $background={isMobile ? 'BLACK_2' : 'YELLOW_3'}\n $flexGap={4}\n $alignItems=\"center\"\n $gap={9}\n $gutter={isMobile ? 0 : 8}\n >\n <Image\n src={isMobile ? ILLUSTRATIONS.COMMUNITY_BULB_YELLOW_2 : ILLUSTRATIONS.COMMUNITY_BULB}\n width={isMobile ? 56 : 80}\n height={isMobile ? 56 : 80}\n withLoader\n alt=\"bulb\"\n />\n <FlexView $flex={1}>\n <Text $renderAs=\"ab2-black\" $color={isMobile ? 'WHITE_1' : 'BLACK_1'}>\n {!isMobile && `Next Steps: `}\n <Styled.InlineText\n $renderAs=\"ab2\"\n $renderOnMobileAs=\"ub2\"\n $color={isMobile ? 'WHITE_1' : 'BLACK_1'}\n >\n {nextSteps}\n </Styled.InlineText>\n </Text>\n </FlexView>\n </FlexView>\n {isMobile && <Separator heightX={1} />}\n </FlexView>\n );\n});\n\nReportInformation.displayName = 'ReportInformation';\n\nexport default ReportInformation;\n"],"names":["ReportInformation","memo","props","isMobile","useTheme","EDeviceType","sessionReports","studentName","nextSteps","topicData","solvedWithHelp","problemsAttempted","newConceptsLearnt","solvedIndependently","defaultTopicImage","trackEvent","useUIContext","renderReportsInfoCard","useMemo","jsxs","Fragment","jsx","ReportCard","FlexView","Styled.ReportWrapper","Styled.TopicWrapper","topic","topicName","topicImage","summary","isAttempted","Styled.TopicImage","Separator","Text","Image","ILLUSTRATIONS","Styled.InlineText","Report404","ReportInformation$1"],"mappings":";;;;;;;;;;;;;AAsBA,MAAMA,IAAiDC,EAAK,CAASC,MAAA;AAE7D,QAAAC,IADQC,IACS,UAAUC,EAAY,QACvC,EAAE,gBAAAC,GAAgB,aAAAC,EAAgB,IAAAL,GAClC;AAAA,IACJ,YAAYM;AAAA,IACZ,YAAYC;AAAA,IACZ,kBAAkBC;AAAA,IAClB,oBAAoBC;AAAA,IACpB,qBAAqBC;AAAA,IACrB,sBAAsBC;AAAA,IACtB,yBAAyBC;AAAA,EAAA,IACvBR,KAAkB,CAAA,GAEhB,EAAE,SAASS,EAAW,IAAIC,EAAa,GAEvCC,IAAwBC,EAAQ,MAC/BP,IAEDA,MAAsBE,KAAwB,CAACH,KAAkBG,IAG/D,gBAAAM,EAAAC,GAAA,EAAA,UAAA;AAAA,IAAA,gBAAAC,EAACC,KAAW,OAAM,sBAAqB,OAAOX,GAAmB,eAAc,OAAM;AAAA,sBACpFW,GAAW,EAAA,OAAM,uBAAsB,OAAOT,GAAqB,eAAc,OAAM;AAAA,IACxF,gBAAAQ;AAAA,MAACC;AAAA,MAAA;AAAA,QACC,OAAM;AAAA,QACN,OAAO,GAAG,KAAK,MAAOT,IAAsBF,IAAqB,GAAG,CAAC;AAAA,MAAA;AAAA,IACvE;AAAA,EACF,EAAA,CAAA,IAIA,CAACD,KAAkB,CAACG,IACd,gBAAAQ,EAAAC,GAAA,EAAW,OAAM,sBAAqB,OAAOX,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EAAA,IArHL,gBAAAX,EAACgB,KAAU,aAAA9B,EAA0B,CAAA;AAwH1E,CAAC;AAEDP,EAAkB,cAAc;AAEhC,MAAAsC,IAAetC;"}
|
|
1
|
+
{"version":3,"file":"report-information.js","sources":["../../../../../../src/features/trial-session/comps/session-report/report-information/report-information.tsx"],"sourcesContent":["import type { TSessionReportData } from '../session-report-types';\nimport type { FC } from 'react';\n\nimport { memo, useMemo } from 'react';\nimport { useTheme } from 'styled-components';\n\nimport { ILLUSTRATIONS } from '../../../../../assets/illustrations/illustrations';\nimport { useUIContext } from '../../../../ui/context/context';\nimport Image from '../../../../ui/image/image';\nimport FlexView from '../../../../ui/layout/flex-view';\nimport Separator from '../../../../ui/separator/separator';\nimport Text from '../../../../ui/text/text';\nimport { EDeviceType } from '../../../../ui/theme/constants';\nimport Report404 from '../report-404/report-404';\nimport ReportCard from './report-card';\nimport * as Styled from './report-information-styled';\n\ninterface IReportInformationProps {\n sessionReports: TSessionReportData;\n studentName: string;\n}\n\nconst ReportInformation: FC<IReportInformationProps> = memo(props => {\n const theme = useTheme();\n const isMobile = theme.device <= EDeviceType.MOBILE;\n const { sessionReports, studentName } = props;\n const {\n next_steps: nextSteps,\n topic_data: topicData,\n solved_with_help: solvedWithHelp,\n problems_attempted: problemsAttempted,\n new_concepts_learnt: newConceptsLearnt,\n solved_independently: solvedIndependently,\n default_topic_image_url: defaultTopicImage,\n } = sessionReports || {};\n\n const { onEvent: trackEvent } = useUIContext();\n\n const renderReportsInfoCard = useMemo(() => {\n if (!problemsAttempted) return null;\n\n if (problemsAttempted === solvedIndependently || (!solvedWithHelp && solvedIndependently)) {\n return (\n <>\n <ReportCard title=\"Problems Attempted\" value={problemsAttempted} widthOnMobile=\"50%\" />\n <ReportCard title=\"Solved without help\" value={solvedIndependently} widthOnMobile=\"50%\" />\n <ReportCard\n title=\"Performance\"\n value={`${Math.round((solvedIndependently / problemsAttempted) * 100)}%`}\n />\n </>\n );\n }\n\n if (!solvedWithHelp && !solvedIndependently) {\n return <ReportCard title=\"Problems Attempted\" value={problemsAttempted} />;\n }\n\n if (solvedWithHelp && newConceptsLearnt) {\n return (\n <>\n <ReportCard title=\"Problems Attempted\" value={problemsAttempted} widthOnMobile=\"50%\" />\n <ReportCard title=\"Needed help in\" value={newConceptsLearnt} widthOnMobile=\"50%\" />\n <ReportCard title=\"Improvement shown in\" value={solvedWithHelp} widthOnMobile=\"50%\" />\n <ReportCard\n title=\"Improvement\"\n value={`${Math.round((solvedWithHelp / newConceptsLearnt) * 100)}%`}\n widthOnMobile=\"50%\"\n />\n </>\n );\n }\n\n return null;\n }, [newConceptsLearnt, problemsAttempted, solvedIndependently, solvedWithHelp]);\n\n if (!renderReportsInfoCard) return <Report404 studentName={studentName} />;\n\n return (\n <FlexView\n $borderColor={isMobile ? 'TRANSPARENT' : 'BLACK_1'}\n $gapX={isMobile ? 1 : 0}\n $background={isMobile ? 'BLACK_2' : 'TRANSPARENT'}\n $gutterX={isMobile ? 1 : 0}\n >\n <Styled.ReportWrapper\n $flexWrap={isMobile}\n $flexDirection=\"row\"\n $height={isMobile ? 'auto' : 100}\n $background={isMobile ? 'BLACK_2' : 'YELLOW_1'}\n >\n {renderReportsInfoCard}\n </Styled.ReportWrapper>\n <Styled.TopicWrapper\n $flexDirection={isMobile ? 'column' : 'row'}\n $background={isMobile ? 'BLACK_2' : 'WHITE_1'}\n $flexRowGapX={isMobile ? 1.25 : 0}\n $gapX={isMobile ? 1.5 : 0}\n >\n {topicData &&\n topicData.length > 0 &&\n topicData.map(topic => {\n const {\n topic_name: topicName,\n topic_image: topicImage,\n summary,\n is_attempted: isAttempted,\n } = topic;\n\n if (!topicImage) {\n trackEvent('TOPIC_THUMBNAIL_NOT_AVAILABLE', topic);\n }\n\n return (\n <FlexView\n key={topicName}\n $gap={isMobile ? 0 : 29}\n $gutter={isMobile ? 0 : 20}\n $flex={1}\n $alignItems={isMobile ? 'center' : 'center'}\n $opacity={isAttempted ? 1 : 0.4}\n $flexDirection={isMobile ? 'row' : 'column'}\n $flexColumnGapX={isMobile ? 1 : 0}\n >\n <FlexView>\n <Styled.TopicImage\n $active={!!isAttempted}\n src={topicImage || defaultTopicImage}\n borderRadius={96}\n height={isMobile ? 84 : 96}\n width={isMobile ? 84 : 96}\n alt=\"topic\"\n withLoader\n />\n </FlexView>\n <FlexView $alignItems={isMobile ? 'flex-start' : 'center'} $gapX={1} $flex={1}>\n {!isMobile && <Separator height={12} />}\n <Text\n $renderAs=\"ab2-bold\"\n $align={isMobile ? 'left' : 'center'}\n $color={isMobile ? 'WHITE' : 'BLACK_1'}\n >\n {topicName}\n </Text>\n <Separator height={2} />\n <Text\n $renderAs=\"ub2\"\n $align={isMobile ? 'left' : 'center'}\n $color={isMobile ? 'WHITE' : 'BLACK_1'}\n >\n {summary}\n </Text>\n </FlexView>\n </FlexView>\n );\n })}\n </Styled.TopicWrapper>\n {isMobile && (\n <FlexView $background=\"BLACK_2\">\n <Text $renderAs=\"ac4-black\" $color=\"WHITE_T_60\">\n Next Steps\n </Text>\n <Separator height={4} />\n </FlexView>\n )}\n <FlexView\n $flexDirection=\"row\"\n $background={isMobile ? 'BLACK_2' : 'YELLOW_3'}\n $flexGap={4}\n $alignItems=\"center\"\n $gap={9}\n $gutter={8}\n >\n <Image\n src={isMobile ? ILLUSTRATIONS.COMMUNITY_BULB_YELLOW_2 : ILLUSTRATIONS.COMMUNITY_BULB}\n width={isMobile ? 56 : 80}\n height={isMobile ? 56 : 80}\n withLoader\n alt=\"bulb\"\n />\n <FlexView $flex={1}>\n <Text $renderAs=\"ab2-black\" $color={isMobile ? 'WHITE_1' : 'BLACK_1'}>\n {!isMobile && `Next Steps: `}\n <Styled.InlineText\n $renderAs=\"ab2\"\n $renderOnMobileAs=\"ub2\"\n $color={isMobile ? 'WHITE_1' : 'BLACK_1'}\n >\n {nextSteps}\n </Styled.InlineText>\n </Text>\n </FlexView>\n </FlexView>\n {isMobile && <Separator heightX={1} />}\n </FlexView>\n );\n});\n\nReportInformation.displayName = 'ReportInformation';\n\nexport default ReportInformation;\n"],"names":["ReportInformation","memo","props","isMobile","useTheme","EDeviceType","sessionReports","studentName","nextSteps","topicData","solvedWithHelp","problemsAttempted","newConceptsLearnt","solvedIndependently","defaultTopicImage","trackEvent","useUIContext","renderReportsInfoCard","useMemo","jsxs","Fragment","jsx","ReportCard","FlexView","Styled.ReportWrapper","Styled.TopicWrapper","topic","topicName","topicImage","summary","isAttempted","Styled.TopicImage","Separator","Text","Image","ILLUSTRATIONS","Styled.InlineText","Report404","ReportInformation$1"],"mappings":";;;;;;;;;;;;;AAsBA,MAAMA,IAAiDC,EAAK,CAASC,MAAA;AAE7D,QAAAC,IADQC,IACS,UAAUC,EAAY,QACvC,EAAE,gBAAAC,GAAgB,aAAAC,EAAgB,IAAAL,GAClC;AAAA,IACJ,YAAYM;AAAA,IACZ,YAAYC;AAAA,IACZ,kBAAkBC;AAAA,IAClB,oBAAoBC;AAAA,IACpB,qBAAqBC;AAAA,IACrB,sBAAsBC;AAAA,IACtB,yBAAyBC;AAAA,EAAA,IACvBR,KAAkB,CAAA,GAEhB,EAAE,SAASS,EAAW,IAAIC,EAAa,GAEvCC,IAAwBC,EAAQ,MAC/BP,IAEDA,MAAsBE,KAAwB,CAACH,KAAkBG,IAG/D,gBAAAM,EAAAC,GAAA,EAAA,UAAA;AAAA,IAAA,gBAAAC,EAACC,KAAW,OAAM,sBAAqB,OAAOX,GAAmB,eAAc,OAAM;AAAA,sBACpFW,GAAW,EAAA,OAAM,uBAAsB,OAAOT,GAAqB,eAAc,OAAM;AAAA,IACxF,gBAAAQ;AAAA,MAACC;AAAA,MAAA;AAAA,QACC,OAAM;AAAA,QACN,OAAO,GAAG,KAAK,MAAOT,IAAsBF,IAAqB,GAAG,CAAC;AAAA,MAAA;AAAA,IACvE;AAAA,EACF,EAAA,CAAA,IAIA,CAACD,KAAkB,CAACG,IACd,gBAAAQ,EAAAC,GAAA,EAAW,OAAM,sBAAqB,OAAOX,EAAmB,CAAA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B,KAAU,aAAA9B,EAA0B,CAAA;AAwH1E,CAAC;AAEDP,EAAkB,cAAc;AAEhC,MAAAsC,IAAetC;"}
|
|
@@ -1,30 +1,30 @@
|
|
|
1
1
|
import { jsx as a } 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: o, studentId: t, worksheet: r, updateSlideConfig:
|
|
9
|
-
if (
|
|
2
|
+
import { useState as T, useCallback as k, useEffect as x } from "react";
|
|
3
|
+
import E from "../../../ui/error/error.js";
|
|
4
|
+
import A from "../../../ui/loader/app-loader/app-loader.js";
|
|
5
|
+
import { useResumeTrialWorksheet as D } from "../../api/trial-nodes.js";
|
|
6
|
+
import { useTrialSessionContext as N } from "../../context/use-trial-session-context.js";
|
|
7
|
+
const P = () => {
|
|
8
|
+
const { isTeacher: o, studentId: t, worksheet: r, updateSlideConfig: c, trialHomeData: m } = N(), [f, s] = T(!1), { demo_info: p } = m, { region_data: l, curriculum: n } = p || {}, { opportunity_country: i = "US" } = l || {}, _ = (g, u) => {
|
|
9
|
+
if (g && s(!0), u) {
|
|
10
10
|
const {
|
|
11
|
-
user_node_id:
|
|
12
|
-
node_id:
|
|
13
|
-
user_attempt_id:
|
|
14
|
-
node_type:
|
|
15
|
-
} =
|
|
16
|
-
|
|
11
|
+
user_node_id: y,
|
|
12
|
+
node_id: I,
|
|
13
|
+
user_attempt_id: C,
|
|
14
|
+
node_type: S
|
|
15
|
+
} = u;
|
|
16
|
+
c({ userNodeId: y, nodeId: I, attemptId: C, nodeType: S });
|
|
17
17
|
}
|
|
18
|
-
}, { patch:
|
|
19
|
-
onComplete:
|
|
20
|
-
}), e =
|
|
21
|
-
o && (s(!1),
|
|
22
|
-
}, [n, o,
|
|
23
|
-
return
|
|
18
|
+
}, { patch: d, isProcessing: h } = D({
|
|
19
|
+
onComplete: _
|
|
20
|
+
}), e = k(() => {
|
|
21
|
+
o && (s(!1), d(t, { country_code: i, curriculum: n }));
|
|
22
|
+
}, [i, n, o, d, t]);
|
|
23
|
+
return x(() => {
|
|
24
24
|
e();
|
|
25
|
-
}, [e]), f ? /* @__PURE__ */ a(
|
|
25
|
+
}, [e]), f ? /* @__PURE__ */ a(E, { height: "100%", onTryAgain: e }) : h || !r ? /* @__PURE__ */ a(A, { height: "100%" }) : r;
|
|
26
26
|
};
|
|
27
27
|
export {
|
|
28
|
-
|
|
28
|
+
P as default
|
|
29
29
|
};
|
|
30
30
|
//# sourceMappingURL=worksheet.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"worksheet.js","sources":["../../../../../src/features/trial-session/comps/worksheet/worksheet.tsx"],"sourcesContent":["import type { IResumeWorksheetModel } from '../../../../types/models/worksheet';\nimport type { FC } from 'react';\n\nimport { useCallback, useEffect, useState } from 'react';\n\nimport Error from '../../../ui/error/error';\nimport AppLoader from '../../../ui/loader/app-loader/app-loader';\nimport { useResumeTrialWorksheet } from '../../api/trial-nodes';\nimport { useTrialSessionContext } from '../../context/use-trial-session-context';\n\nconst SessionWorksheet: FC = () => {\n const { isTeacher, studentId, worksheet, updateSlideConfig, trialHomeData } =\n useTrialSessionContext();\n const [isError, setIserror] = useState<boolean>(false);\n\n const { demo_info: demoInfo } = trialHomeData;\n const { region_data: regionData } = demoInfo || {};\n const { opportunity_country: countryCode = 'US' } = regionData || {};\n\n const onComplete = (error: string | null, sheetData?: IResumeWorksheetModel) => {\n if (error) {\n setIserror(true);\n }\n\n if (sheetData) {\n const {\n user_node_id: userNodeId,\n node_id: nodeId,\n user_attempt_id: attemptId,\n node_type: nodeType,\n } = sheetData;\n\n updateSlideConfig({ userNodeId, nodeId, attemptId, nodeType });\n }\n };\n\n const { patch: resumeNode, isProcessing } = useResumeTrialWorksheet({\n onComplete,\n });\n\n const fetchData = useCallback(() => {\n if (isTeacher) {\n setIserror(false);\n resumeNode(studentId, { country_code: countryCode });\n }\n }, [countryCode, isTeacher, resumeNode, studentId]);\n\n useEffect(() => {\n fetchData();\n }, [fetchData]);\n\n if (isError) {\n return <Error height=\"100%\" onTryAgain={fetchData} />;\n }\n\n if (isProcessing || !worksheet) {\n return <AppLoader height=\"100%\" />;\n }\n\n return worksheet;\n};\n\nexport default SessionWorksheet;\n"],"names":["SessionWorksheet","isTeacher","studentId","worksheet","updateSlideConfig","trialHomeData","useTrialSessionContext","isError","setIserror","useState","demoInfo","regionData","countryCode","onComplete","error","sheetData","userNodeId","nodeId","attemptId","nodeType","resumeNode","isProcessing","useResumeTrialWorksheet","fetchData","useCallback","useEffect","jsx","Error","AppLoader"],"mappings":";;;;;;AAUA,MAAMA,IAAuB,MAAM;AACjC,QAAM,EAAE,WAAAC,GAAW,WAAAC,GAAW,WAAAC,GAAW,mBAAAC,GAAmB,eAAAC,EAAA,IAC1DC,KACI,CAACC,GAASC,CAAU,IAAIC,EAAkB,EAAK,GAE/C,EAAE,WAAWC,EAAa,IAAAL,GAC1B,EAAE,aAAaM,
|
|
1
|
+
{"version":3,"file":"worksheet.js","sources":["../../../../../src/features/trial-session/comps/worksheet/worksheet.tsx"],"sourcesContent":["import type { IResumeWorksheetModel } from '../../../../types/models/worksheet';\nimport type { FC } from 'react';\n\nimport { useCallback, useEffect, useState } from 'react';\n\nimport Error from '../../../ui/error/error';\nimport AppLoader from '../../../ui/loader/app-loader/app-loader';\nimport { useResumeTrialWorksheet } from '../../api/trial-nodes';\nimport { useTrialSessionContext } from '../../context/use-trial-session-context';\n\nconst SessionWorksheet: FC = () => {\n const { isTeacher, studentId, worksheet, updateSlideConfig, trialHomeData } =\n useTrialSessionContext();\n const [isError, setIserror] = useState<boolean>(false);\n\n const { demo_info: demoInfo } = trialHomeData;\n const { region_data: regionData, curriculum } = demoInfo || {};\n const { opportunity_country: countryCode = 'US' } = regionData || {};\n\n const onComplete = (error: string | null, sheetData?: IResumeWorksheetModel) => {\n if (error) {\n setIserror(true);\n }\n\n if (sheetData) {\n const {\n user_node_id: userNodeId,\n node_id: nodeId,\n user_attempt_id: attemptId,\n node_type: nodeType,\n } = sheetData;\n\n updateSlideConfig({ userNodeId, nodeId, attemptId, nodeType });\n }\n };\n\n const { patch: resumeNode, isProcessing } = useResumeTrialWorksheet({\n onComplete,\n });\n\n const fetchData = useCallback(() => {\n if (isTeacher) {\n setIserror(false);\n resumeNode(studentId, { country_code: countryCode, curriculum });\n }\n }, [countryCode, curriculum, isTeacher, resumeNode, studentId]);\n\n useEffect(() => {\n fetchData();\n }, [fetchData]);\n\n if (isError) {\n return <Error height=\"100%\" onTryAgain={fetchData} />;\n }\n\n if (isProcessing || !worksheet) {\n return <AppLoader height=\"100%\" />;\n }\n\n return worksheet;\n};\n\nexport default SessionWorksheet;\n"],"names":["SessionWorksheet","isTeacher","studentId","worksheet","updateSlideConfig","trialHomeData","useTrialSessionContext","isError","setIserror","useState","demoInfo","regionData","curriculum","countryCode","onComplete","error","sheetData","userNodeId","nodeId","attemptId","nodeType","resumeNode","isProcessing","useResumeTrialWorksheet","fetchData","useCallback","useEffect","jsx","Error","AppLoader"],"mappings":";;;;;;AAUA,MAAMA,IAAuB,MAAM;AACjC,QAAM,EAAE,WAAAC,GAAW,WAAAC,GAAW,WAAAC,GAAW,mBAAAC,GAAmB,eAAAC,EAAA,IAC1DC,KACI,CAACC,GAASC,CAAU,IAAIC,EAAkB,EAAK,GAE/C,EAAE,WAAWC,EAAa,IAAAL,GAC1B,EAAE,aAAaM,GAAY,YAAAC,EAAW,IAAIF,KAAY,CAAA,GACtD,EAAE,qBAAqBG,IAAc,KAAK,IAAIF,KAAc,CAAA,GAE5DG,IAAa,CAACC,GAAsBC,MAAsC;AAK9E,QAJID,KACFP,EAAW,EAAI,GAGbQ,GAAW;AACP,YAAA;AAAA,QACJ,cAAcC;AAAA,QACd,SAASC;AAAA,QACT,iBAAiBC;AAAA,QACjB,WAAWC;AAAA,MACT,IAAAJ;AAEJ,MAAAZ,EAAkB,EAAE,YAAAa,GAAY,QAAAC,GAAQ,WAAAC,GAAW,UAAAC,EAAU,CAAA;AAAA,IAC/D;AAAA,EAAA,GAGI,EAAE,OAAOC,GAAY,cAAAC,EAAA,IAAiBC,EAAwB;AAAA,IAClE,YAAAT;AAAA,EAAA,CACD,GAEKU,IAAYC,EAAY,MAAM;AAClC,IAAIxB,MACFO,EAAW,EAAK,GAChBa,EAAWnB,GAAW,EAAE,cAAcW,GAAa,YAAAD,EAAY,CAAA;AAAA,EACjE,GACC,CAACC,GAAaD,GAAYX,GAAWoB,GAAYnB,CAAS,CAAC;AAM9D,SAJAwB,EAAU,MAAM;AACJ,IAAAF;EAAA,GACT,CAACA,CAAS,CAAC,GAEVjB,IACM,gBAAAoB,EAAAC,GAAA,EAAM,QAAO,QAAO,YAAYJ,EAAW,CAAA,IAGjDF,KAAgB,CAACnB,IACZ,gBAAAwB,EAACE,GAAU,EAAA,QAAO,OAAO,CAAA,IAG3B1B;AACT;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"trial-session-types.js","sources":["../../../src/features/trial-session/trial-session-types.ts"],"sourcesContent":["import type { TNodeTypes } from '../../types/models/worksheet';\nimport type { IInfoMessage } from '../circle-games/games/web-view/web-view-types';\nimport type {\n IMilestoneConfig,\n TCourseStream,\n TPreferenceCategory,\n} from '../milestone/create/milestone-create-types';\nimport type { IAvatarLayer } from '../ui/avatar/avatar-types';\nimport type { TUserTypes } from '../ui/types';\nimport type { TPreference } from './comps/class-preference/class-preference-types';\nimport type {\n ITrialCircleConfig,\n ITrialCircleGameParams,\n} from './comps/trial-circle-game/trial-circle-game-types';\nimport type { TrialPageId } from './trial-session-constants';\nimport type { Dispatch, ReactElement, SetStateAction } from 'react';\n\nexport type { TSessionReportData as TSessionReport } from './comps/session-report/session-report-types';\n\nexport type TSlideId = TrialPageId;\n\nexport type TRegionData = {\n opportunity_country: string;\n};\n\nexport type TPreferenceSchema = {\n preference_code: string;\n preference_name: string;\n preference_category: TPreferenceCategory;\n};\n\nexport enum EClassTimeAlertLevel {\n FIVE_MIN = '5min',\n FIFTEEN_MIN = '15min',\n}\ninterface IButtonConfig {\n buttonLabel: string;\n pageId: string;\n}\n\nexport interface ISolution {\n media?: string;\n media_type?: 'image' | 'video';\n text?: string;\n}\n\nexport type TDegreeInformation = {\n degree_name?: string;\n field_of_study?: string;\n degree_code?: string;\n};\n\nexport interface ITeacherProfileDetails {\n lower_grade: string;\n higher_grade: string;\n header_image: string;\n years_of_experience: number;\n number_of_students_taught: number;\n countries: string[];\n degree: TDegreeInformation;\n first_name: string;\n last_name: string;\n teacher_profile_url?: string;\n}\n\nexport interface ISlide {\n id: TrialPageId;\n renderAs: 'split' | 'full';\n renderAVIn: 'left' | 'right';\n header: string;\n subHeader?: string;\n prevPage?: IButtonConfig;\n nextPage?: IButtonConfig;\n cues?: string[];\n dos?: string[];\n donts?: string[];\n navigationLabel?: string;\n slideTag?: string;\n teacher_profile?: ITeacherProfileDetails;\n solutions?: ISolution[];\n enableSessionPerk?: boolean;\n showProfileHighlights?: boolean;\n}\n\nexport interface TGoals {\n goal_code?: string;\n milestone_date_ts?: number;\n goal_category?: string;\n milestone_name?: string;\n publish?: boolean;\n}\n\nexport interface ITrialSessionFormFields {\n id: string;\n name?: string;\n grade?: string;\n curriculum?: string;\n goals?: TGoals[];\n studentProfile?: {\n profileSummary?: string;\n dummyProfileImageIndex?: number;\n summaryFetched?: boolean;\n summaryFetchFailed?: boolean;\n };\n userNodeId?: string;\n nodeId?: string;\n nodeType?: TNodeTypes;\n attemptId?: string;\n preferences?: TPreference[];\n personalizedLevel?: string[];\n personalizedFocus?: string[];\n personalizedBehaviors?: string[];\n personalizedObjectives?: string[];\n isCircleGamePlayed?: boolean;\n isCirclePuzzleSolved?: boolean;\n isCircleSkillCompleted?: boolean;\n studentTimezone?: string;\n showCircleGameScreen?: boolean;\n accuracyStr?: string;\n totalTimeTaken?: number;\n chapterId?: string;\n matchmakingId?: string;\n numberInNameError?: boolean;\n}\n\nexport interface IButtonState {\n isDisabled: boolean;\n isLoading: boolean;\n}\n\nexport interface ITrialHomeData {\n pages: ISlide[];\n demo_info: {\n student_classroom_id: string;\n stream: TCourseStream;\n region_data: TRegionData;\n };\n parent: {\n name: string;\n };\n student: {\n grade: string;\n name: string;\n circle_username: string;\n user_avatar: IAvatarLayer[];\n };\n teacher: {\n name: string;\n circle_username: string;\n user_avatar: IAvatarLayer[];\n };\n circle_trial_game_config: ITrialCircleConfig;\n}\n\nexport interface IClassTimeAlertConfig {\n alertLevel: EClassTimeAlertLevel | null;\n isVisible: boolean;\n onComplete: () => void;\n}\n\nexport interface ITrialSessionProps {\n countryCode?: string;\n classStartedOn?: Date;\n height?: string | number;\n userType: TUserTypes;\n studentId: string;\n teacherId: string;\n teacherClassroomId: string;\n teacherPanel?: ReactElement;\n studentPanel?: ReactElement;\n formData?: ITrialSessionFormFields;\n onFormDataChange?: Dispatch<SetStateAction<ITrialSessionFormFields | undefined>>;\n worksheet?: ReactElement;\n worksheetNavigationPanel?: ReactElement;\n questionsRatingPanel?: ReactElement;\n studentAbsentInClass?: boolean;\n openEndClassModal?: () => void;\n trialGameUrl: string;\n handleInfoMessage: (message: IInfoMessage) => void;\n classTimeAlertConfig?: IClassTimeAlertConfig;\n classDuration?: number;\n}\n\nexport interface ITrialSessionContext\n extends Pick<\n ITrialSessionProps,\n | 'classStartedOn'\n | 'formData'\n | 'teacherPanel'\n | 'studentId'\n | 'teacherId'\n | 'studentPanel'\n | 'worksheet'\n | 'worksheetNavigationPanel'\n | 'questionsRatingPanel'\n | 'openEndClassModal'\n | 'studentAbsentInClass'\n | 'classDuration'\n | 'classTimeAlertConfig'\n > {\n buttonState: { left: IButtonState; right: IButtonState };\n isTeacher: boolean;\n milestoneConfig: IMilestoneConfig;\n slideConfig: ISlide;\n updateButtonState: (\n btnNavDir: 'left' | 'right' | 'both',\n currentState: IButtonState | { left: IButtonState; right: IButtonState },\n ) => void;\n updateSlideConfig: (config: Partial<ITrialSessionFormFields>) => void;\n trialHomeData: ITrialHomeData;\n onTrialInformationUpdate?: () => void;\n circleGames: ITrialCircleGameParams;\n trialGameUrl: string;\n handleInfoMessage: (message: IInfoMessage) => void;\n onRemoveOptionalSlides?: (grade?: string) => void;\n}\n\nexport interface ITrialSessionViewProps extends ITrialSessionProps {\n trialHomeData: ITrialHomeData;\n milestoneConfig: IMilestoneConfig;\n studentTimezone?: string;\n onStudentTimezoneUpdate?: () => void;\n onTrialInformationUpdate?: () => void;\n handleInfoMessage: (message: IInfoMessage) => void;\n onRemoveOptionalSlides?: (grade?: string) => void;\n}\n"],"names":["EClassTimeAlertLevel"],"mappings":"AA+BY,IAAAA,sBAAAA,OACVA,EAAA,WAAW,QACXA,EAAA,cAAc,SAFJA,IAAAA,KAAA,CAAA,CAAA;"}
|
|
1
|
+
{"version":3,"file":"trial-session-types.js","sources":["../../../src/features/trial-session/trial-session-types.ts"],"sourcesContent":["import type { TNodeTypes } from '../../types/models/worksheet';\nimport type { IInfoMessage } from '../circle-games/games/web-view/web-view-types';\nimport type {\n IMilestoneConfig,\n TCourseStream,\n TPreferenceCategory,\n} from '../milestone/create/milestone-create-types';\nimport type { IAvatarLayer } from '../ui/avatar/avatar-types';\nimport type { TUserTypes } from '../ui/types';\nimport type { TPreference } from './comps/class-preference/class-preference-types';\nimport type {\n ITrialCircleConfig,\n ITrialCircleGameParams,\n} from './comps/trial-circle-game/trial-circle-game-types';\nimport type { TrialPageId } from './trial-session-constants';\nimport type { Dispatch, ReactElement, SetStateAction } from 'react';\n\nexport type { TSessionReportData as TSessionReport } from './comps/session-report/session-report-types';\n\nexport type TSlideId = TrialPageId;\n\nexport type TRegionData = {\n opportunity_country: string;\n};\n\nexport type TPreferenceSchema = {\n preference_code: string;\n preference_name: string;\n preference_category: TPreferenceCategory;\n};\n\nexport enum EClassTimeAlertLevel {\n FIVE_MIN = '5min',\n FIFTEEN_MIN = '15min',\n}\ninterface IButtonConfig {\n buttonLabel: string;\n pageId: string;\n}\n\nexport interface ISolution {\n media?: string;\n media_type?: 'image' | 'video';\n text?: string;\n}\n\nexport type TDegreeInformation = {\n degree_name?: string;\n field_of_study?: string;\n degree_code?: string;\n};\n\nexport interface ITeacherProfileDetails {\n lower_grade: string;\n higher_grade: string;\n header_image: string;\n years_of_experience: number;\n number_of_students_taught: number;\n countries: string[];\n degree: TDegreeInformation;\n first_name: string;\n last_name: string;\n teacher_profile_url?: string;\n}\n\nexport interface ISlide {\n id: TrialPageId;\n renderAs: 'split' | 'full';\n renderAVIn: 'left' | 'right';\n header: string;\n subHeader?: string;\n prevPage?: IButtonConfig;\n nextPage?: IButtonConfig;\n cues?: string[];\n dos?: string[];\n donts?: string[];\n navigationLabel?: string;\n slideTag?: string;\n teacher_profile?: ITeacherProfileDetails;\n solutions?: ISolution[];\n enableSessionPerk?: boolean;\n showProfileHighlights?: boolean;\n}\n\nexport interface TGoals {\n goal_code?: string;\n milestone_date_ts?: number;\n goal_category?: string;\n milestone_name?: string;\n publish?: boolean;\n}\n\nexport interface ITrialSessionFormFields {\n id: string;\n name?: string;\n grade?: string;\n curriculum?: string;\n goals?: TGoals[];\n studentProfile?: {\n profileSummary?: string;\n dummyProfileImageIndex?: number;\n summaryFetched?: boolean;\n summaryFetchFailed?: boolean;\n };\n userNodeId?: string;\n nodeId?: string;\n nodeType?: TNodeTypes;\n attemptId?: string;\n preferences?: TPreference[];\n personalizedLevel?: string[];\n personalizedFocus?: string[];\n personalizedBehaviors?: string[];\n personalizedObjectives?: string[];\n isCircleGamePlayed?: boolean;\n isCirclePuzzleSolved?: boolean;\n isCircleSkillCompleted?: boolean;\n studentTimezone?: string;\n showCircleGameScreen?: boolean;\n accuracyStr?: string;\n totalTimeTaken?: number;\n chapterId?: string;\n matchmakingId?: string;\n numberInNameError?: boolean;\n}\n\nexport interface IButtonState {\n isDisabled: boolean;\n isLoading: boolean;\n}\n\nexport interface ITrialHomeData {\n pages: ISlide[];\n demo_info: {\n student_classroom_id: string;\n stream: TCourseStream;\n region_data: TRegionData;\n curriculum?: string;\n };\n parent: {\n name: string;\n };\n student: {\n grade: string;\n name: string;\n circle_username: string;\n user_avatar: IAvatarLayer[];\n };\n teacher: {\n name: string;\n circle_username: string;\n user_avatar: IAvatarLayer[];\n };\n circle_trial_game_config: ITrialCircleConfig;\n}\n\nexport interface IClassTimeAlertConfig {\n alertLevel: EClassTimeAlertLevel | null;\n isVisible: boolean;\n onComplete: () => void;\n}\n\nexport interface ITrialSessionProps {\n countryCode?: string;\n classStartedOn?: Date;\n height?: string | number;\n userType: TUserTypes;\n studentId: string;\n teacherId: string;\n teacherClassroomId: string;\n teacherPanel?: ReactElement;\n studentPanel?: ReactElement;\n formData?: ITrialSessionFormFields;\n onFormDataChange?: Dispatch<SetStateAction<ITrialSessionFormFields | undefined>>;\n worksheet?: ReactElement;\n worksheetNavigationPanel?: ReactElement;\n questionsRatingPanel?: ReactElement;\n studentAbsentInClass?: boolean;\n openEndClassModal?: () => void;\n trialGameUrl: string;\n handleInfoMessage: (message: IInfoMessage) => void;\n classTimeAlertConfig?: IClassTimeAlertConfig;\n classDuration?: number;\n}\n\nexport interface ITrialSessionContext\n extends Pick<\n ITrialSessionProps,\n | 'classStartedOn'\n | 'formData'\n | 'teacherPanel'\n | 'studentId'\n | 'teacherId'\n | 'studentPanel'\n | 'worksheet'\n | 'worksheetNavigationPanel'\n | 'questionsRatingPanel'\n | 'openEndClassModal'\n | 'studentAbsentInClass'\n | 'classDuration'\n | 'classTimeAlertConfig'\n > {\n buttonState: { left: IButtonState; right: IButtonState };\n isTeacher: boolean;\n milestoneConfig: IMilestoneConfig;\n slideConfig: ISlide;\n updateButtonState: (\n btnNavDir: 'left' | 'right' | 'both',\n currentState: IButtonState | { left: IButtonState; right: IButtonState },\n ) => void;\n updateSlideConfig: (config: Partial<ITrialSessionFormFields>) => void;\n trialHomeData: ITrialHomeData;\n onTrialInformationUpdate?: () => void;\n circleGames: ITrialCircleGameParams;\n trialGameUrl: string;\n handleInfoMessage: (message: IInfoMessage) => void;\n onRemoveOptionalSlides?: (grade?: string) => void;\n}\n\nexport interface ITrialSessionViewProps extends ITrialSessionProps {\n trialHomeData: ITrialHomeData;\n milestoneConfig: IMilestoneConfig;\n studentTimezone?: string;\n onStudentTimezoneUpdate?: () => void;\n onTrialInformationUpdate?: () => void;\n handleInfoMessage: (message: IInfoMessage) => void;\n onRemoveOptionalSlides?: (grade?: string) => void;\n}\n"],"names":["EClassTimeAlertLevel"],"mappings":"AA+BY,IAAAA,sBAAAA,OACVA,EAAA,WAAW,QACXA,EAAA,cAAc,SAFJA,IAAAA,KAAA,CAAA,CAAA;"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { jsx as
|
|
1
|
+
import { jsx as t, jsxs as P } from "react/jsx-runtime";
|
|
2
2
|
import { memo as z, useMemo as C, useCallback as S, useEffect as $ } from "react";
|
|
3
3
|
import x from "../../../ui/buttons/button/button.js";
|
|
4
4
|
import E from "../../../ui/layout/flex-view.js";
|
|
@@ -7,25 +7,25 @@ import T from "../../../ui/text/text.js";
|
|
|
7
7
|
import { useGetDynamicSheetData as b } from "../api/get-dynamic-sheet.js";
|
|
8
8
|
import B from "../worksheet-preview.js";
|
|
9
9
|
const R = z((r) => {
|
|
10
|
-
const { studentId:
|
|
10
|
+
const { studentId: i, userNodeId: n, studentName: a, onBackIconClick: l, actionBarRightElement: h } = r, { onOpenQuestionFeedbackModal: f } = r, {
|
|
11
11
|
get: m,
|
|
12
|
-
data:
|
|
12
|
+
data: p,
|
|
13
13
|
isProcessing: g,
|
|
14
14
|
isProcessingFailed: y,
|
|
15
|
-
error:
|
|
15
|
+
error: s
|
|
16
16
|
} = b(), {
|
|
17
17
|
items: k = [],
|
|
18
18
|
title: c,
|
|
19
19
|
node_type: d = "DYNAMIC",
|
|
20
20
|
worksheet: w
|
|
21
|
-
} =
|
|
22
|
-
|
|
23
|
-
}, [m,
|
|
21
|
+
} = p || {}, { image_hue: D } = w || {}, u = k.map(({ ref: A }) => A), e = d === "PUZZLE_CARD", v = C(() => e ? `${a} hasn't attempted the puzzle yet` : c, [e, a, c]), o = S(() => {
|
|
22
|
+
i && n && m(n);
|
|
23
|
+
}, [m, i, n]);
|
|
24
24
|
return $(() => {
|
|
25
25
|
o();
|
|
26
|
-
}, [o]), g ? /* @__PURE__ */
|
|
27
|
-
/* @__PURE__ */
|
|
28
|
-
/* @__PURE__ */
|
|
26
|
+
}, [o]), g ? /* @__PURE__ */ t(I, { height: "100%" }) : y ? /* @__PURE__ */ P(E, { $flexGapX: 1.5, $height: "100vh", $justifyContent: "center", $alignItems: "center", children: [
|
|
27
|
+
/* @__PURE__ */ t(T, { $renderAs: "h6", children: (s == null ? void 0 : s.message) || "Oops! Something went wrong. Please try again later." }),
|
|
28
|
+
/* @__PURE__ */ t(
|
|
29
29
|
x,
|
|
30
30
|
{
|
|
31
31
|
widthX: 14,
|
|
@@ -36,26 +36,27 @@ const R = z((r) => {
|
|
|
36
36
|
onClick: o
|
|
37
37
|
}
|
|
38
38
|
)
|
|
39
|
-
] }) : u ? /* @__PURE__ */
|
|
39
|
+
] }) : u ? /* @__PURE__ */ t(
|
|
40
40
|
B,
|
|
41
41
|
{
|
|
42
|
-
activityReference:
|
|
42
|
+
activityReference: e ? "puzzle" : "test",
|
|
43
43
|
nodeType: d,
|
|
44
44
|
userType: "TEACHER",
|
|
45
|
-
studentId:
|
|
45
|
+
studentId: i ?? "student-id",
|
|
46
46
|
isLessonV3Enabled: !1,
|
|
47
|
-
worksheetName:
|
|
47
|
+
worksheetName: v,
|
|
48
48
|
items: u,
|
|
49
49
|
onBackIconClick: l,
|
|
50
50
|
imageHue: D ?? void 0,
|
|
51
51
|
actionBarRightElement: h,
|
|
52
52
|
canShowActionBar: !0,
|
|
53
53
|
mode: "preview",
|
|
54
|
-
openQuestionFeedbackModal:
|
|
54
|
+
openQuestionFeedbackModal: f,
|
|
55
|
+
topOffset: e ? 112 : void 0
|
|
55
56
|
}
|
|
56
57
|
) : null;
|
|
57
|
-
}),
|
|
58
|
+
}), _ = R;
|
|
58
59
|
export {
|
|
59
|
-
|
|
60
|
+
_ as default
|
|
60
61
|
};
|
|
61
62
|
//# sourceMappingURL=dynamic-worksheet-preview.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dynamic-worksheet-preview.js","sources":["../../../../../src/features/worksheet/worksheet-preview/dynamic-worksheet-preview/dynamic-worksheet-preview.tsx"],"sourcesContent":["import type { TNodeTypes } from '../../../../types/models/worksheet';\nimport type { IDynamicWorksheetPreview } from './dynamic-worksheet-types';\nimport type { FC } from 'react';\n\nimport { memo, useCallback, useEffect, useMemo } from 'react';\n\nimport Button from '../../../ui/buttons/button/button';\nimport FlexView from '../../../ui/layout/flex-view';\nimport AppLoader from '../../../ui/loader/app-loader/app-loader';\nimport Text from '../../../ui/text/text';\nimport { useGetDynamicSheetData } from '../api/get-dynamic-sheet';\nimport PreviewWorksheet from '../worksheet-preview';\n\nconst DynamicWorksheetPreview: FC<IDynamicWorksheetPreview> = memo(props => {\n const { studentId, userNodeId, studentName, onBackIconClick, actionBarRightElement } = props;\n const { onOpenQuestionFeedbackModal } = props;\n\n const {\n get: getDynamicSheetData,\n data: dynamicSheetData,\n isProcessing,\n isProcessingFailed,\n error,\n } = useGetDynamicSheetData();\n\n const {\n items: itemsToBeAssigned = [],\n title,\n node_type: nodeType = 'DYNAMIC',\n worksheet,\n } = dynamicSheetData || {};\n const { image_hue: imageHue } = worksheet || {};\n const itemRefs = itemsToBeAssigned.map(({ ref }) => ref);\n\n const isPuzzleSheet = nodeType === 'PUZZLE_CARD';\n\n const worksheetName = useMemo(() => {\n if (isPuzzleSheet) return `${studentName} hasn't attempted the puzzle yet`;\n\n return title;\n }, [isPuzzleSheet, studentName, title]);\n\n const fetchDynamicSheetData = useCallback(() => {\n if (studentId && userNodeId) {\n getDynamicSheetData(userNodeId);\n }\n }, [getDynamicSheetData, studentId, userNodeId]);\n\n useEffect(() => {\n fetchDynamicSheetData();\n }, [fetchDynamicSheetData]);\n\n if (isProcessing) {\n return <AppLoader height=\"100%\" />;\n }\n\n if (isProcessingFailed) {\n return (\n <FlexView $flexGapX={1.5} $height=\"100vh\" $justifyContent=\"center\" $alignItems=\"center\">\n <Text $renderAs=\"h6\">\n {error?.message || 'Oops! Something went wrong. Please try again later.'}\n </Text>\n <Button\n widthX={14}\n size=\"small\"\n shape=\"square\"\n renderAs=\"primary\"\n label=\"Try again\"\n onClick={fetchDynamicSheetData}\n />\n </FlexView>\n );\n }\n\n if (!itemRefs) {\n return null;\n }\n\n return (\n <PreviewWorksheet\n activityReference={isPuzzleSheet ? 'puzzle' : 'test'}\n nodeType={nodeType as TNodeTypes}\n userType=\"TEACHER\"\n studentId={studentId ?? 'student-id'}\n isLessonV3Enabled={false}\n worksheetName={worksheetName}\n items={itemRefs}\n onBackIconClick={onBackIconClick}\n imageHue={imageHue ?? undefined}\n actionBarRightElement={actionBarRightElement}\n canShowActionBar\n mode=\"preview\"\n openQuestionFeedbackModal={onOpenQuestionFeedbackModal}\n />\n );\n});\n\nexport default DynamicWorksheetPreview;\n"],"names":["DynamicWorksheetPreview","memo","props","studentId","userNodeId","studentName","onBackIconClick","actionBarRightElement","onOpenQuestionFeedbackModal","getDynamicSheetData","dynamicSheetData","isProcessing","isProcessingFailed","error","useGetDynamicSheetData","itemsToBeAssigned","title","nodeType","worksheet","imageHue","itemRefs","ref","isPuzzleSheet","worksheetName","useMemo","fetchDynamicSheetData","useCallback","useEffect","jsx","AppLoader","jsxs","FlexView","Text","Button","PreviewWorksheet","DynamicWorksheetPreview$1"],"mappings":";;;;;;;;AAaA,MAAMA,IAAwDC,EAAK,CAASC,MAAA;AAC1E,QAAM,EAAE,WAAAC,GAAW,YAAAC,GAAY,aAAAC,GAAa,iBAAAC,GAAiB,uBAAAC,EAA0B,IAAAL,GACjF,EAAE,6BAAAM,EAAgC,IAAAN,GAElC;AAAA,IACJ,KAAKO;AAAA,IACL,MAAMC;AAAA,IAC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ACnB,eAAAoB;AAAA,MACA,OAAOH;AAAA,MACP,iBAAAd;AAAA,MACA,UAAUa,KAAY;AAAA,MACtB,uBAAAZ;AAAA,MACA,kBAAgB;AAAA,MAChB,MAAK;AAAA,MACL,2BAA2BC;AAAA,IAAA;AAAA,EAAA,
|
|
1
|
+
{"version":3,"file":"dynamic-worksheet-preview.js","sources":["../../../../../src/features/worksheet/worksheet-preview/dynamic-worksheet-preview/dynamic-worksheet-preview.tsx"],"sourcesContent":["import type { TNodeTypes } from '../../../../types/models/worksheet';\nimport type { IDynamicWorksheetPreview } from './dynamic-worksheet-types';\nimport type { FC } from 'react';\n\nimport { memo, useCallback, useEffect, useMemo } from 'react';\n\nimport Button from '../../../ui/buttons/button/button';\nimport FlexView from '../../../ui/layout/flex-view';\nimport AppLoader from '../../../ui/loader/app-loader/app-loader';\nimport Text from '../../../ui/text/text';\nimport { useGetDynamicSheetData } from '../api/get-dynamic-sheet';\nimport PreviewWorksheet from '../worksheet-preview';\n\nconst DynamicWorksheetPreview: FC<IDynamicWorksheetPreview> = memo(props => {\n const { studentId, userNodeId, studentName, onBackIconClick, actionBarRightElement } = props;\n const { onOpenQuestionFeedbackModal } = props;\n\n const {\n get: getDynamicSheetData,\n data: dynamicSheetData,\n isProcessing,\n isProcessingFailed,\n error,\n } = useGetDynamicSheetData();\n\n const {\n items: itemsToBeAssigned = [],\n title,\n node_type: nodeType = 'DYNAMIC',\n worksheet,\n } = dynamicSheetData || {};\n const { image_hue: imageHue } = worksheet || {};\n const itemRefs = itemsToBeAssigned.map(({ ref }) => ref);\n\n const isPuzzleSheet = nodeType === 'PUZZLE_CARD';\n\n const worksheetName = useMemo(() => {\n if (isPuzzleSheet) return `${studentName} hasn't attempted the puzzle yet`;\n\n return title;\n }, [isPuzzleSheet, studentName, title]);\n\n const fetchDynamicSheetData = useCallback(() => {\n if (studentId && userNodeId) {\n getDynamicSheetData(userNodeId);\n }\n }, [getDynamicSheetData, studentId, userNodeId]);\n\n useEffect(() => {\n fetchDynamicSheetData();\n }, [fetchDynamicSheetData]);\n\n if (isProcessing) {\n return <AppLoader height=\"100%\" />;\n }\n\n if (isProcessingFailed) {\n return (\n <FlexView $flexGapX={1.5} $height=\"100vh\" $justifyContent=\"center\" $alignItems=\"center\">\n <Text $renderAs=\"h6\">\n {error?.message || 'Oops! Something went wrong. Please try again later.'}\n </Text>\n <Button\n widthX={14}\n size=\"small\"\n shape=\"square\"\n renderAs=\"primary\"\n label=\"Try again\"\n onClick={fetchDynamicSheetData}\n />\n </FlexView>\n );\n }\n\n if (!itemRefs) {\n return null;\n }\n\n return (\n <PreviewWorksheet\n activityReference={isPuzzleSheet ? 'puzzle' : 'test'}\n nodeType={nodeType as TNodeTypes}\n userType=\"TEACHER\"\n studentId={studentId ?? 'student-id'}\n isLessonV3Enabled={false}\n worksheetName={worksheetName}\n items={itemRefs}\n onBackIconClick={onBackIconClick}\n imageHue={imageHue ?? undefined}\n actionBarRightElement={actionBarRightElement}\n canShowActionBar\n mode=\"preview\"\n openQuestionFeedbackModal={onOpenQuestionFeedbackModal}\n topOffset={isPuzzleSheet ? 112 : undefined}\n />\n );\n});\n\nexport default DynamicWorksheetPreview;\n"],"names":["DynamicWorksheetPreview","memo","props","studentId","userNodeId","studentName","onBackIconClick","actionBarRightElement","onOpenQuestionFeedbackModal","getDynamicSheetData","dynamicSheetData","isProcessing","isProcessingFailed","error","useGetDynamicSheetData","itemsToBeAssigned","title","nodeType","worksheet","imageHue","itemRefs","ref","isPuzzleSheet","worksheetName","useMemo","fetchDynamicSheetData","useCallback","useEffect","jsx","AppLoader","jsxs","FlexView","Text","Button","PreviewWorksheet","DynamicWorksheetPreview$1"],"mappings":";;;;;;;;AAaA,MAAMA,IAAwDC,EAAK,CAASC,MAAA;AAC1E,QAAM,EAAE,WAAAC,GAAW,YAAAC,GAAY,aAAAC,GAAa,iBAAAC,GAAiB,uBAAAC,EAA0B,IAAAL,GACjF,EAAE,6BAAAM,EAAgC,IAAAN,GAElC;AAAA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WAAWd,KAAa;AAAA,MACxB,mBAAmB;AAAA,MACnB,eAAAoB;AAAA,MACA,OAAOH;AAAA,MACP,iBAAAd;AAAA,MACA,UAAUa,KAAY;AAAA,MACtB,uBAAAZ;AAAA,MACA,kBAAgB;AAAA,MAChB,MAAK;AAAA,MACL,2BAA2BC;AAAA,MAC3B,WAAWc,IAAgB,MAAM;AAAA,IAAA;AAAA,EAAA,IAlB5B;AAqBX,CAAC,GAEDa,IAAenC;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-worksheet-layout.js","sources":["../../../../../src/features/worksheet/worksheet-preview/hooks/use-worksheet-layout.ts"],"sourcesContent":["import type { IResumeWorksheetModel } from '../../../../types/models/worksheet';\nimport type { THueNames, TUserTypes } from '../../../ui/types';\nimport type { IWorksheetProps } from '../../worksheet/worksheet-types';\n\nimport { useMemo } from 'react';\n\nimport {\n QUESTIONS_GAP,\n TOP_NAVIGATION_HEIGHT,\n WORKSHEET_NUDGE_BANNER_HEIGHT,\n} from '../../worksheet/constants';\n\ninterface IUseWorksheetLayout {\n (options: {\n userType: TUserTypes;\n nodeType: IResumeWorksheetModel['node_type'];\n isSATAssessment: boolean;\n showNudgeBanner?: boolean;\n topOffset: number;\n imageHue?: THueNames;\n }): IWorksheetProps['layout'];\n}\n\nconst useWorksheetLayout: IUseWorksheetLayout = ({\n userType,\n nodeType,\n isSATAssessment,\n showNudgeBanner,\n topOffset,\n imageHue,\n}) => {\n const isPuzzleSheet = nodeType === 'PUZZLE_CARD';\n\n const navigationBar = useMemo<IWorksheetProps['layout']['navigationBar']>(() => {\n if (isSATAssessment) return 'bottom';\n\n switch (nodeType) {\n case 'PUZZLE_CARD':\n case 'TRIAL_DIAGNOSTIC':\n case 'TRIAL_BASIC':\n case 'TRIAL_INTERMEDIATE':\n case 'TRIAL_ADVANCED':\n return 'none';\n default:\n return 'top';\n }\n }, [isSATAssessment, nodeType]);\n const navHeight = navigationBar === 'top' ? TOP_NAVIGATION_HEIGHT : 0;\n const minQuestionHeight = `calc(100vh - ${topOffset + navHeight + QUESTIONS_GAP * 2}px)`;\n const minSummaryHeight = `calc(100vh - ${topOffset + navHeight + QUESTIONS_GAP}px)`;\n const tOffset = showNudgeBanner ? topOffset + WORKSHEET_NUDGE_BANNER_HEIGHT : topOffset;\n\n return useMemo<IWorksheetProps['layout']>(\n () => ({\n containerStyle: isSATAssessment || isPuzzleSheet ? 'none' : 'card',\n //* The width of the container is set based on the user type and whether it is a SAT assessment\n //* For Puzzle sheets, on student side we are showing a header with 800px fixed width.\n containerWidth: isSATAssessment ? '1024px' : userType === 'TEACHER' ? '960px' : '824px',\n actionBar: 'bottom',\n topOffset: tOffset,\n navigationBar,\n questionsScrollable: !(\n isSATAssessment ||\n nodeType === 'TRIAL_DIAGNOSTIC' ||\n nodeType === 'TRIAL_BASIC' ||\n nodeType === 'TRIAL_INTERMEDIATE' ||\n nodeType === 'TRIAL_ADVANCED'\n ),\n minQuestionHeight,\n minSummaryHeight,\n renderSideBar: userType === 'TEACHER' && !isSATAssessment,\n renderQuestionHeader: !isPuzzleSheet,\n imageHue,\n background: isSATAssessment || isPuzzleSheet ? 'none' : 'paper',\n questionPadding: isPuzzleSheet ? 0 : QUESTIONS_GAP,\n }),\n [\n isSATAssessment,\n isPuzzleSheet,\n userType,\n tOffset,\n navigationBar,\n nodeType,\n minQuestionHeight,\n minSummaryHeight,\n imageHue,\n ],\n );\n};\n\nexport default useWorksheetLayout;\n"],"names":["useWorksheetLayout","userType","nodeType","isSATAssessment","showNudgeBanner","topOffset","imageHue","isPuzzleSheet","navigationBar","useMemo","navHeight","TOP_NAVIGATION_HEIGHT","minQuestionHeight","QUESTIONS_GAP","minSummaryHeight","tOffset","WORKSHEET_NUDGE_BANNER_HEIGHT","useWorksheetLayout$1"],"mappings":";;AAuBA,MAAMA,IAA0C,CAAC;AAAA,EAC/C,UAAAC;AAAA,EACA,UAAAC;AAAA,EACA,iBAAAC;AAAA,EACA,iBAAAC;AAAA,EACA,WAAAC;AAAA,EACA,UAAAC;AACF,MAAM;AACJ,QAAMC,IAAgBL,MAAa,eAE7BM,IAAgBC,EAAoD,MAAM;AAC9E,QAAIN,EAAwB,QAAA;AAE5B,YAAQD,GAAU;AAAA,MAChB,KAAK;AAAA,MACL,KAAK;AAAA,MACL,KAAK;AAAA,MACL,KAAK;AAAA,MACL,KAAK;AACI,eAAA;AAAA,MACT;AACS,eAAA;AAAA,IACX;AAAA,EAAA,GACC,CAACC,GAAiBD,CAAQ,CAAC,
|
|
1
|
+
{"version":3,"file":"use-worksheet-layout.js","sources":["../../../../../src/features/worksheet/worksheet-preview/hooks/use-worksheet-layout.ts"],"sourcesContent":["import type { IResumeWorksheetModel } from '../../../../types/models/worksheet';\nimport type { THueNames, TUserTypes } from '../../../ui/types';\nimport type { IWorksheetProps } from '../../worksheet/worksheet-types';\n\nimport { useMemo } from 'react';\n\nimport {\n QUESTIONS_GAP,\n TOP_NAVIGATION_HEIGHT,\n WORKSHEET_NUDGE_BANNER_HEIGHT,\n} from '../../worksheet/constants';\n\ninterface IUseWorksheetLayout {\n (options: {\n userType: TUserTypes;\n nodeType: IResumeWorksheetModel['node_type'];\n isSATAssessment: boolean;\n showNudgeBanner?: boolean;\n topOffset: number;\n imageHue?: THueNames;\n }): IWorksheetProps['layout'];\n}\n\nconst useWorksheetLayout: IUseWorksheetLayout = ({\n userType,\n nodeType,\n isSATAssessment,\n showNudgeBanner,\n topOffset,\n imageHue,\n}) => {\n const isPuzzleSheet = nodeType === 'PUZZLE_CARD';\n\n const navigationBar = useMemo<IWorksheetProps['layout']['navigationBar']>(() => {\n if (isSATAssessment) return 'bottom';\n\n switch (nodeType) {\n case 'PUZZLE_CARD':\n case 'TRIAL_DIAGNOSTIC':\n case 'TRIAL_BASIC':\n case 'TRIAL_INTERMEDIATE':\n case 'TRIAL_ADVANCED':\n return 'none';\n default:\n return 'top';\n }\n }, [isSATAssessment, nodeType]);\n\n const navHeight = navigationBar === 'top' ? TOP_NAVIGATION_HEIGHT : 0;\n const minQuestionHeight = `calc(100vh - ${topOffset + navHeight + QUESTIONS_GAP * 2}px)`;\n const minSummaryHeight = `calc(100vh - ${topOffset + navHeight + QUESTIONS_GAP}px)`;\n const tOffset = showNudgeBanner ? topOffset + WORKSHEET_NUDGE_BANNER_HEIGHT : topOffset;\n\n return useMemo<IWorksheetProps['layout']>(\n () => ({\n containerStyle: isSATAssessment || isPuzzleSheet ? 'none' : 'card',\n //* The width of the container is set based on the user type and whether it is a SAT assessment\n //* For Puzzle sheets, on student side we are showing a header with 800px fixed width.\n containerWidth: isSATAssessment ? '1024px' : userType === 'TEACHER' ? '960px' : '824px',\n actionBar: 'bottom',\n topOffset: tOffset,\n navigationBar,\n questionsScrollable: !(\n isSATAssessment ||\n nodeType === 'TRIAL_DIAGNOSTIC' ||\n nodeType === 'TRIAL_BASIC' ||\n nodeType === 'TRIAL_INTERMEDIATE' ||\n nodeType === 'TRIAL_ADVANCED'\n ),\n minQuestionHeight,\n minSummaryHeight,\n renderSideBar: userType === 'TEACHER' && !isSATAssessment,\n renderQuestionHeader: !isPuzzleSheet,\n imageHue,\n background: isSATAssessment || isPuzzleSheet ? 'none' : 'paper',\n questionPadding: isPuzzleSheet ? 0 : QUESTIONS_GAP,\n }),\n [\n isSATAssessment,\n isPuzzleSheet,\n userType,\n tOffset,\n navigationBar,\n nodeType,\n minQuestionHeight,\n minSummaryHeight,\n imageHue,\n ],\n );\n};\n\nexport default useWorksheetLayout;\n"],"names":["useWorksheetLayout","userType","nodeType","isSATAssessment","showNudgeBanner","topOffset","imageHue","isPuzzleSheet","navigationBar","useMemo","navHeight","TOP_NAVIGATION_HEIGHT","minQuestionHeight","QUESTIONS_GAP","minSummaryHeight","tOffset","WORKSHEET_NUDGE_BANNER_HEIGHT","useWorksheetLayout$1"],"mappings":";;AAuBA,MAAMA,IAA0C,CAAC;AAAA,EAC/C,UAAAC;AAAA,EACA,UAAAC;AAAA,EACA,iBAAAC;AAAA,EACA,iBAAAC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
2
|
-
import { memo as
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import { getWorksheetHeaderLayout as
|
|
7
|
-
import
|
|
8
|
-
import { WorksheetPageWrapper as
|
|
9
|
-
const
|
|
2
|
+
import { memo as L, useMemo as i, useRef as N, useCallback as B } from "react";
|
|
3
|
+
import P from "../../ui/layout/flex-view.js";
|
|
4
|
+
import M from "../../ui/text/text.js";
|
|
5
|
+
import v from "../worksheet/worksheet-container.js";
|
|
6
|
+
import { getWorksheetHeaderLayout as z } from "../worksheet/worksheet-helpers.js";
|
|
7
|
+
import V from "./hooks/use-worksheet-layout.js";
|
|
8
|
+
import { WorksheetPageWrapper as j, HeaderWrapper as D, Header as O, StyledBackIcon as F, HeaderTitleWrapper as G } from "./worksheet-preview-styled.js";
|
|
9
|
+
const U = [
|
|
10
10
|
"SAT_ENGLISH_ASSESSMENT",
|
|
11
11
|
"SAT_MATH_ASSESSMENT"
|
|
12
|
-
],
|
|
12
|
+
], re = L((f) => {
|
|
13
13
|
const {
|
|
14
14
|
studentId: a,
|
|
15
15
|
userType: d,
|
|
@@ -27,57 +27,58 @@ const G = [
|
|
|
27
27
|
isLessonV3Enabled: W,
|
|
28
28
|
canShowActionBar: w,
|
|
29
29
|
mode: n,
|
|
30
|
-
actionBarRightElement:
|
|
31
|
-
|
|
30
|
+
actionBarRightElement: $,
|
|
31
|
+
topOffset: C = 56
|
|
32
|
+
} = f, { signed_request: x, questions_signed_request: y } = k, u = i(() => e === "PUZZLE_CARD", [e]), s = i(() => t === "test", [t]), H = i(() => U.includes(e), [e]), R = N(() => null), h = s ? !1 : w, _ = V({
|
|
32
33
|
userType: d,
|
|
33
34
|
nodeType: e,
|
|
34
|
-
isSATAssessment:
|
|
35
|
+
isSATAssessment: H,
|
|
35
36
|
showNudgeBanner: c,
|
|
36
|
-
topOffset:
|
|
37
|
+
topOffset: C,
|
|
37
38
|
imageHue: m
|
|
38
|
-
}),
|
|
39
|
+
}), b = B(() => {
|
|
39
40
|
r == null || r();
|
|
40
|
-
}, [r]), { bgColor:
|
|
41
|
+
}, [r]), { bgColor: I, borderColor: q, textColor: p } = z({
|
|
41
42
|
isPuzzleWorksheet: u && h,
|
|
42
43
|
isTestWorksheet: s,
|
|
43
44
|
imageHue: m
|
|
44
45
|
});
|
|
45
|
-
return /* @__PURE__ */ S(
|
|
46
|
-
/* @__PURE__ */ o(
|
|
47
|
-
|
|
46
|
+
return /* @__PURE__ */ S(j, { children: [
|
|
47
|
+
/* @__PURE__ */ o(D, { children: /* @__PURE__ */ S(
|
|
48
|
+
O,
|
|
48
49
|
{
|
|
49
50
|
$flexDirection: "row",
|
|
50
51
|
$alignItems: "center",
|
|
51
52
|
$justifyContent: s ? "flex-start" : "center",
|
|
52
|
-
$background:
|
|
53
|
+
$background: I,
|
|
53
54
|
$height: 56,
|
|
54
55
|
$gutterX: 1,
|
|
55
56
|
$flexGapX: 1,
|
|
56
|
-
$borderColor:
|
|
57
|
+
$borderColor: q,
|
|
57
58
|
children: [
|
|
58
|
-
r && /* @__PURE__ */ o(
|
|
59
|
+
r && /* @__PURE__ */ o(F, { $color: p ?? "WHITE", onClick: b }),
|
|
59
60
|
/* @__PURE__ */ o(
|
|
60
|
-
|
|
61
|
+
G,
|
|
61
62
|
{
|
|
62
63
|
$alignItems: s && !u ? "flex-start" : "center",
|
|
63
|
-
children: /* @__PURE__ */ o(
|
|
64
|
+
children: /* @__PURE__ */ o(M, { $renderAs: "body1", $color: p, children: l || t })
|
|
64
65
|
}
|
|
65
66
|
)
|
|
66
67
|
]
|
|
67
68
|
}
|
|
68
69
|
) }),
|
|
69
|
-
/* @__PURE__ */ o(
|
|
70
|
-
|
|
70
|
+
/* @__PURE__ */ o(P, { $alignItems: "center", children: /* @__PURE__ */ o(
|
|
71
|
+
v,
|
|
71
72
|
{
|
|
72
73
|
userType: d ?? (n === "review" ? "TEACHER" : "STUDENT"),
|
|
73
74
|
worksheetCompleted: n === "review",
|
|
74
75
|
worksheetName: l || t,
|
|
75
|
-
itemsSignedRequest:
|
|
76
|
-
questionsSignedRequest:
|
|
76
|
+
itemsSignedRequest: x,
|
|
77
|
+
questionsSignedRequest: y,
|
|
77
78
|
studentId: a,
|
|
78
|
-
layout:
|
|
79
|
+
layout: _,
|
|
79
80
|
canShowActionBar: h,
|
|
80
|
-
loggerRef:
|
|
81
|
+
loggerRef: R,
|
|
81
82
|
showNudgeBanner: c,
|
|
82
83
|
markedAsCompleted: g,
|
|
83
84
|
onLoaded: T,
|
|
@@ -93,6 +94,6 @@ const G = [
|
|
|
93
94
|
] });
|
|
94
95
|
});
|
|
95
96
|
export {
|
|
96
|
-
|
|
97
|
+
re as default
|
|
97
98
|
};
|
|
98
99
|
//# sourceMappingURL=worksheet-preview-view.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"worksheet-preview-view.js","sources":["../../../../src/features/worksheet/worksheet-preview/worksheet-preview-view.tsx"],"sourcesContent":["import type { IResumeWorksheetModel } from '../../../types/models/worksheet';\nimport type { IPreviewWorksheetViewProps } from './worksheet-preview-types';\nimport type { FC } from 'react';\n\nimport { memo, useCallback, useMemo, useRef } from 'react';\n\nimport FlexView from '../../ui/layout/flex-view';\nimport Text from '../../ui/text/text';\nimport WorksheetContainer from '../worksheet/worksheet-container';\nimport { getWorksheetHeaderLayout } from '../worksheet/worksheet-helpers';\nimport useWorksheetLayout from './hooks/use-worksheet-layout';\nimport * as Styled from './worksheet-preview-styled';\n\nconst SAT_WORKSHEET_TYPES: IResumeWorksheetModel['node_type'][] = [\n 'SAT_ENGLISH_ASSESSMENT',\n 'SAT_MATH_ASSESSMENT',\n];\n\nconst PreviewWorksheetView: FC<IPreviewWorksheetViewProps> = memo(props => {\n const {\n studentId,\n userType,\n activityReference,\n worksheet,\n nodeType,\n worksheetName,\n showNudgeBanner,\n markedAsCompleted,\n imageHue,\n onWorksheetLoaded,\n onWorksheetErrored,\n openQuestionFeedbackModal,\n onBackIconClick,\n isLessonV3Enabled,\n canShowActionBar,\n mode,\n actionBarRightElement,\n } = props;\n const { signed_request: signedRequest, questions_signed_request: questionsSignedRequest } =\n worksheet;\n\n const isPuzzleWorksheet = useMemo(() => nodeType === 'PUZZLE_CARD', [nodeType]);\n const isTestWorksheet = useMemo(() => activityReference === 'test', [activityReference]);\n const isSATAssessment = useMemo(() => SAT_WORKSHEET_TYPES.includes(nodeType), [nodeType]);\n const loggerRef = useRef(() => null);\n const isActionBarVisible = isTestWorksheet ? false : canShowActionBar;\n\n const layout = useWorksheetLayout({\n userType,\n nodeType,\n isSATAssessment,\n showNudgeBanner,\n topOffset
|
|
1
|
+
{"version":3,"file":"worksheet-preview-view.js","sources":["../../../../src/features/worksheet/worksheet-preview/worksheet-preview-view.tsx"],"sourcesContent":["import type { IResumeWorksheetModel } from '../../../types/models/worksheet';\nimport type { IPreviewWorksheetViewProps } from './worksheet-preview-types';\nimport type { FC } from 'react';\n\nimport { memo, useCallback, useMemo, useRef } from 'react';\n\nimport FlexView from '../../ui/layout/flex-view';\nimport Text from '../../ui/text/text';\nimport WorksheetContainer from '../worksheet/worksheet-container';\nimport { getWorksheetHeaderLayout } from '../worksheet/worksheet-helpers';\nimport useWorksheetLayout from './hooks/use-worksheet-layout';\nimport * as Styled from './worksheet-preview-styled';\n\nconst SAT_WORKSHEET_TYPES: IResumeWorksheetModel['node_type'][] = [\n 'SAT_ENGLISH_ASSESSMENT',\n 'SAT_MATH_ASSESSMENT',\n];\n\nconst PreviewWorksheetView: FC<IPreviewWorksheetViewProps> = memo(props => {\n const {\n studentId,\n userType,\n activityReference,\n worksheet,\n nodeType,\n worksheetName,\n showNudgeBanner,\n markedAsCompleted,\n imageHue,\n onWorksheetLoaded,\n onWorksheetErrored,\n openQuestionFeedbackModal,\n onBackIconClick,\n isLessonV3Enabled,\n canShowActionBar,\n mode,\n actionBarRightElement,\n topOffset = 56,\n } = props;\n const { signed_request: signedRequest, questions_signed_request: questionsSignedRequest } =\n worksheet;\n\n const isPuzzleWorksheet = useMemo(() => nodeType === 'PUZZLE_CARD', [nodeType]);\n const isTestWorksheet = useMemo(() => activityReference === 'test', [activityReference]);\n const isSATAssessment = useMemo(() => SAT_WORKSHEET_TYPES.includes(nodeType), [nodeType]);\n const loggerRef = useRef(() => null);\n const isActionBarVisible = isTestWorksheet ? false : canShowActionBar;\n\n const layout = useWorksheetLayout({\n userType,\n nodeType,\n isSATAssessment,\n showNudgeBanner,\n topOffset,\n imageHue,\n });\n\n const handleOnBackIconClick = useCallback(() => {\n onBackIconClick?.();\n }, [onBackIconClick]);\n\n const { bgColor, borderColor, textColor } = getWorksheetHeaderLayout({\n isPuzzleWorksheet: isPuzzleWorksheet && isActionBarVisible,\n isTestWorksheet,\n imageHue,\n });\n\n return (\n <Styled.WorksheetPageWrapper>\n <Styled.HeaderWrapper>\n <Styled.Header\n $flexDirection=\"row\"\n $alignItems=\"center\"\n $justifyContent={isTestWorksheet ? 'flex-start' : 'center'}\n $background={bgColor}\n $height={56}\n $gutterX={1}\n $flexGapX={1}\n $borderColor={borderColor}\n >\n {onBackIconClick && (\n <Styled.StyledBackIcon $color={textColor ?? 'WHITE'} onClick={handleOnBackIconClick} />\n )}\n\n <Styled.HeaderTitleWrapper\n $alignItems={isTestWorksheet && !isPuzzleWorksheet ? 'flex-start' : 'center'}\n >\n <Text $renderAs=\"body1\" $color={textColor}>\n {worksheetName || activityReference}\n </Text>\n </Styled.HeaderTitleWrapper>\n </Styled.Header>\n </Styled.HeaderWrapper>\n\n <FlexView $alignItems=\"center\">\n <WorksheetContainer\n userType={userType ?? (mode === 'review' ? 'TEACHER' : 'STUDENT')}\n worksheetCompleted={mode === 'review'}\n worksheetName={worksheetName || activityReference}\n itemsSignedRequest={signedRequest}\n questionsSignedRequest={questionsSignedRequest}\n studentId={studentId}\n layout={layout}\n canShowActionBar={isActionBarVisible}\n loggerRef={loggerRef}\n showNudgeBanner={showNudgeBanner}\n markedAsCompleted={markedAsCompleted}\n onLoaded={onWorksheetLoaded}\n onErrored={onWorksheetErrored}\n userId={studentId}\n openQuestionFeedbackModal={openQuestionFeedbackModal}\n nodeType={nodeType}\n mode={mode}\n isLessonV3Enabled={isLessonV3Enabled}\n actionBarRightElement={actionBarRightElement}\n />\n </FlexView>\n </Styled.WorksheetPageWrapper>\n );\n});\n\nexport default PreviewWorksheetView;\n"],"names":["SAT_WORKSHEET_TYPES","PreviewWorksheetView","memo","props","studentId","userType","activityReference","worksheet","nodeType","worksheetName","showNudgeBanner","markedAsCompleted","imageHue","onWorksheetLoaded","onWorksheetErrored","openQuestionFeedbackModal","onBackIconClick","isLessonV3Enabled","canShowActionBar","mode","actionBarRightElement","topOffset","signedRequest","questionsSignedRequest","isPuzzleWorksheet","useMemo","isTestWorksheet","isSATAssessment","loggerRef","useRef","isActionBarVisible","layout","useWorksheetLayout","handleOnBackIconClick","useCallback","bgColor","borderColor","textColor","getWorksheetHeaderLayout","jsxs","Styled.WorksheetPageWrapper","jsx","Styled.HeaderWrapper","Styled.Header","Styled.StyledBackIcon","Styled.HeaderTitleWrapper","Text","FlexView","WorksheetContainer"],"mappings":";;;;;;;;AAaA,MAAMA,IAA4D;AAAA,EAChE;AAAA,EACA;AACF,GAEMC,KAAuDC,EAAK,CAASC,MAAA;AACnE,QAAA;AAAA,IACJ,WAAAC;AAAA,IACA,UAAAC;AAAA,IACA,mBAAAC;AAAA,IACA,WAAAC;AAAA,IACA,UAAAC;AAAA,IACA,eAAAC;AAAA,IACA,iBAAAC;AAAA,IACA,mBAAAC;AAAA,IACA,UAAAC;AAAA,IACA,mBAAAC;AAAA,IACA,oBAAAC;AAAA,IACA,2BAAAC;AAAA,IACA,iBAAAC;AAAA,IACA,mBAAAC;AAAA,IACA,kBAAAC;AAAA,IACA,MAAAC;AAAA,IACA,uBAAAC;AAAA,IACA,WAAAC,IAAY;AAAA,EACV,IAAAlB,GACE,EAAE,gBAAgBmB,GAAe,0BAA0BC,MAC/DhB,GAEIiB,IAAoBC,EAAQ,MAAMjB,MAAa,eAA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