@cuemath/leap 3.2.30-aa5 → 3.2.30-aa6
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.
|
@@ -1,86 +1,87 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { memo as
|
|
3
|
-
import { useGetEligibleJourneysViaRoute as
|
|
1
|
+
import { jsxs as p, jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import { memo as L, useMemo as i, useRef as U, useCallback as P } from "react";
|
|
3
|
+
import { useGetEligibleJourneysViaRoute as q } from "../../journey/hooks/use-get-eligible-journeys-via-route.js";
|
|
4
4
|
import { JOURNEY_ID_TEACHER as E } from "../../journey/journey-id/journey-id-teacher.js";
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import { getWorksheetHeaderLayout as
|
|
5
|
+
import J from "../../ui/layout/flex-view.js";
|
|
6
|
+
import O from "../../ui/text/text.js";
|
|
7
|
+
import Z from "../worksheet/worksheet-container.js";
|
|
8
|
+
import { getWorksheetHeaderLayout as B } from "../worksheet/worksheet-helpers.js";
|
|
9
9
|
import G from "./hooks/use-worksheet-layout.js";
|
|
10
|
-
import { WorksheetPageWrapper as M, HeaderWrapper as V, Header as v, StyledBackIcon as z, HeaderTitleWrapper as
|
|
11
|
-
const
|
|
10
|
+
import { WorksheetPageWrapper as M, HeaderWrapper as V, Header as v, StyledBackIcon as z, HeaderTitleWrapper as D } from "./worksheet-preview-styled.js";
|
|
11
|
+
const Y = [
|
|
12
12
|
"SAT_ENGLISH_ASSESSMENT",
|
|
13
13
|
"SAT_MATH_ASSESSMENT"
|
|
14
|
-
],
|
|
14
|
+
], ne = L((f) => {
|
|
15
15
|
const {
|
|
16
16
|
studentId: a,
|
|
17
|
-
userType:
|
|
17
|
+
userType: l,
|
|
18
18
|
activityReference: t,
|
|
19
19
|
worksheet: g,
|
|
20
20
|
action: n,
|
|
21
21
|
nodeType: e,
|
|
22
|
-
worksheetName:
|
|
23
|
-
showNudgeBanner:
|
|
22
|
+
worksheetName: d,
|
|
23
|
+
showNudgeBanner: c,
|
|
24
24
|
markedAsCompleted: k,
|
|
25
|
-
imageHue:
|
|
25
|
+
imageHue: u,
|
|
26
26
|
onWorksheetLoaded: T,
|
|
27
27
|
onWorksheetErrored: A,
|
|
28
28
|
openQuestionFeedbackModal: _,
|
|
29
29
|
onBackIconClick: r,
|
|
30
|
-
isLessonV3Enabled: W
|
|
31
|
-
|
|
30
|
+
isLessonV3Enabled: W,
|
|
31
|
+
canShowActionBar: N
|
|
32
|
+
} = f, { signed_request: R, questions_signed_request: w } = g, m = i(() => e === "PUZZLE_CARD", [e]), s = i(() => t === "test", [t]), y = i(() => Y.includes(e), [e]), C = U(() => null), h = s ? !1 : N, $ = q([
|
|
32
33
|
E.PUZZLE_UNASSIGN_JOURNEY
|
|
33
|
-
]),
|
|
34
|
-
userType:
|
|
34
|
+
]), I = G({
|
|
35
|
+
userType: l,
|
|
35
36
|
nodeType: e,
|
|
36
37
|
isSATAssessment: y,
|
|
37
|
-
showNudgeBanner:
|
|
38
|
+
showNudgeBanner: c,
|
|
38
39
|
topOffset: 56,
|
|
39
|
-
imageHue:
|
|
40
|
-
}),
|
|
40
|
+
imageHue: u
|
|
41
|
+
}), b = P(() => {
|
|
41
42
|
r == null || r();
|
|
42
|
-
}, [r]), { bgColor:
|
|
43
|
-
isPuzzleWorksheet:
|
|
43
|
+
}, [r]), { bgColor: H, borderColor: x, textColor: S } = B({
|
|
44
|
+
isPuzzleWorksheet: m && h,
|
|
44
45
|
isTestWorksheet: s,
|
|
45
|
-
imageHue:
|
|
46
|
+
imageHue: u
|
|
46
47
|
});
|
|
47
|
-
return /* @__PURE__ */
|
|
48
|
-
/* @__PURE__ */ o(V, { children: /* @__PURE__ */
|
|
48
|
+
return /* @__PURE__ */ p(M, { children: [
|
|
49
|
+
/* @__PURE__ */ o(V, { children: /* @__PURE__ */ p(
|
|
49
50
|
v,
|
|
50
51
|
{
|
|
51
52
|
$flexDirection: "row",
|
|
52
53
|
$alignItems: "center",
|
|
53
54
|
$justifyContent: s ? "flex-start" : "center",
|
|
54
|
-
$background:
|
|
55
|
+
$background: H,
|
|
55
56
|
$height: 56,
|
|
56
57
|
$gutterX: 1,
|
|
57
58
|
$flexGapX: 1,
|
|
58
|
-
$borderColor:
|
|
59
|
+
$borderColor: x,
|
|
59
60
|
children: [
|
|
60
|
-
r && /* @__PURE__ */ o(z, { $color:
|
|
61
|
+
r && /* @__PURE__ */ o(z, { $color: S ?? "WHITE", onClick: b }),
|
|
61
62
|
/* @__PURE__ */ o(
|
|
62
|
-
|
|
63
|
+
D,
|
|
63
64
|
{
|
|
64
|
-
$alignItems: s && !
|
|
65
|
-
children: /* @__PURE__ */ o(
|
|
65
|
+
$alignItems: s && !m ? "flex-start" : "center",
|
|
66
|
+
children: /* @__PURE__ */ o(O, { $renderAs: "body1", $color: S, children: d || t })
|
|
66
67
|
}
|
|
67
68
|
)
|
|
68
69
|
]
|
|
69
70
|
}
|
|
70
71
|
) }),
|
|
71
|
-
/* @__PURE__ */ o(
|
|
72
|
-
|
|
72
|
+
/* @__PURE__ */ o(J, { $alignItems: "center", children: /* @__PURE__ */ o(
|
|
73
|
+
Z,
|
|
73
74
|
{
|
|
74
|
-
userType:
|
|
75
|
+
userType: l ?? (n === "review" ? "TEACHER" : "STUDENT"),
|
|
75
76
|
worksheetCompleted: n === "review",
|
|
76
|
-
worksheetName:
|
|
77
|
-
itemsSignedRequest:
|
|
78
|
-
questionsSignedRequest:
|
|
77
|
+
worksheetName: d || t,
|
|
78
|
+
itemsSignedRequest: R,
|
|
79
|
+
questionsSignedRequest: w,
|
|
79
80
|
studentId: a,
|
|
80
|
-
layout:
|
|
81
|
+
layout: I,
|
|
81
82
|
canShowActionBar: h,
|
|
82
83
|
loggerRef: C,
|
|
83
|
-
showNudgeBanner:
|
|
84
|
+
showNudgeBanner: c,
|
|
84
85
|
markedAsCompleted: k,
|
|
85
86
|
onLoaded: T,
|
|
86
87
|
onErrored: A,
|
|
@@ -95,6 +96,6 @@ const D = [
|
|
|
95
96
|
] });
|
|
96
97
|
});
|
|
97
98
|
export {
|
|
98
|
-
|
|
99
|
+
ne as default
|
|
99
100
|
};
|
|
100
101
|
//# 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 { useGetEligibleJourneysViaRoute } from '../../journey/hooks/use-get-eligible-journeys-via-route';\nimport { JOURNEY_ID_TEACHER } from '../../journey/journey-id/journey-id-teacher';\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 action,\n nodeType,\n worksheetName,\n showNudgeBanner,\n markedAsCompleted,\n imageHue,\n onWorksheetLoaded,\n onWorksheetErrored,\n openQuestionFeedbackModal,\n onBackIconClick,\n isLessonV3Enabled,\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 =
|
|
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 { useGetEligibleJourneysViaRoute } from '../../journey/hooks/use-get-eligible-journeys-via-route';\nimport { JOURNEY_ID_TEACHER } from '../../journey/journey-id/journey-id-teacher';\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 action,\n nodeType,\n worksheetName,\n showNudgeBanner,\n markedAsCompleted,\n imageHue,\n onWorksheetLoaded,\n onWorksheetErrored,\n openQuestionFeedbackModal,\n onBackIconClick,\n isLessonV3Enabled,\n canShowActionBar,\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 const eligibleJourneyIds = useGetEligibleJourneysViaRoute([\n JOURNEY_ID_TEACHER.PUZZLE_UNASSIGN_JOURNEY,\n ]);\n\n const layout = useWorksheetLayout({\n userType,\n nodeType,\n isSATAssessment,\n showNudgeBanner,\n topOffset: 56,\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 ?? (action === 'review' ? 'TEACHER' : 'STUDENT')}\n worksheetCompleted={action === '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={action}\n isLessonV3Enabled={isLessonV3Enabled}\n canStartJourney={eligibleJourneyIds.includes(JOURNEY_ID_TEACHER.PUZZLE_UNASSIGN_JOURNEY)}\n />\n </FlexView>\n </Styled.WorksheetPageWrapper>\n );\n});\n\nexport default PreviewWorksheetView;\n"],"names":["SAT_WORKSHEET_TYPES","PreviewWorksheetView","memo","props","studentId","userType","activityReference","worksheet","action","nodeType","worksheetName","showNudgeBanner","markedAsCompleted","imageHue","onWorksheetLoaded","onWorksheetErrored","openQuestionFeedbackModal","onBackIconClick","isLessonV3Enabled","canShowActionBar","signedRequest","questionsSignedRequest","isPuzzleWorksheet","useMemo","isTestWorksheet","isSATAssessment","loggerRef","useRef","isActionBarVisible","eligibleJourneyIds","useGetEligibleJourneysViaRoute","JOURNEY_ID_TEACHER","layout","useWorksheetLayout","handleOnBackIconClick","useCallback","bgColor","borderColor","textColor","getWorksheetHeaderLayout","jsxs","Styled.WorksheetPageWrapper","jsx","Styled.HeaderWrapper","Styled.Header","Styled.StyledBackIcon","Styled.HeaderTitleWrapper","Text","FlexView","WorksheetContainer"],"mappings":";;;;;;;;;;AAeA,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,QAAAC;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,EACE,IAAAhB,GACE,EAAE,gBAAgBiB,GAAe,0BAA0BC,MAC/Dd,GAEIe,IAAoBC,EAAQ,MAAMd,MAAa,eAAe,CAACA,CAAQ,CAAC,GACxEe,IAAkBD,EAAQ,MAAMjB,MAAsB,QAAQ,CAACA,CAAiB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