@cuemath/leap 3.3.8 → 3.3.9-pzd-beta-0.1
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/worksheet/worksheet-preview/hooks/use-worksheet-layout.js +28 -26
- package/dist/features/worksheet/worksheet-preview/hooks/use-worksheet-layout.js.map +1 -1
- package/dist/features/worksheet/worksheet-preview/worksheet-preview-view.js +10 -9
- package/dist/features/worksheet/worksheet-preview/worksheet-preview-view.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/package.json +1 -1
|
@@ -1,15 +1,16 @@
|
|
|
1
|
-
import { useMemo as
|
|
2
|
-
import { QUESTIONS_GAP as n, WORKSHEET_NUDGE_BANNER_HEIGHT as
|
|
3
|
-
const
|
|
1
|
+
import { useMemo as L } from "react";
|
|
2
|
+
import { QUESTIONS_GAP as n, WORKSHEET_NUDGE_BANNER_HEIGHT as e, TOP_NAVIGATION_HEIGHT as D } from "../../worksheet/constants.js";
|
|
3
|
+
const h = ({
|
|
4
4
|
userType: c,
|
|
5
5
|
nodeType: t,
|
|
6
|
-
isSATAssessment:
|
|
7
|
-
showNudgeBanner:
|
|
8
|
-
topOffset:
|
|
9
|
-
imageHue: E
|
|
6
|
+
isSATAssessment: r,
|
|
7
|
+
showNudgeBanner: N,
|
|
8
|
+
topOffset: o,
|
|
9
|
+
imageHue: E,
|
|
10
|
+
mode: R
|
|
10
11
|
}) => {
|
|
11
|
-
const
|
|
12
|
-
if (
|
|
12
|
+
const a = t === "PUZZLE_CARD", I = L(() => {
|
|
13
|
+
if (r) return "bottom";
|
|
13
14
|
switch (t) {
|
|
14
15
|
case "PUZZLE_CARD":
|
|
15
16
|
case "TRIAL_DIAGNOSTIC":
|
|
@@ -20,39 +21,40 @@ const e = ({
|
|
|
20
21
|
default:
|
|
21
22
|
return "top";
|
|
22
23
|
}
|
|
23
|
-
}, [
|
|
24
|
-
return
|
|
24
|
+
}, [r, t]), _ = I === "top" ? D : 0, i = `calc(100vh - ${o + _ + n * 2}px)`, u = `calc(100vh - ${o + _ + n}px)`, A = N ? o + e : o;
|
|
25
|
+
return L(
|
|
25
26
|
() => ({
|
|
26
|
-
containerStyle:
|
|
27
|
+
containerStyle: r || a ? "none" : "card",
|
|
27
28
|
//* The width of the container is set based on the user type and whether it is a SAT assessment
|
|
28
29
|
//* For Puzzle sheets, on student side we are showing a header with 800px fixed width.
|
|
29
|
-
containerWidth:
|
|
30
|
+
containerWidth: r ? "1024px" : c === "TEACHER" ? "960px" : "824px",
|
|
30
31
|
actionBar: "bottom",
|
|
31
|
-
topOffset:
|
|
32
|
+
topOffset: A,
|
|
32
33
|
navigationBar: I,
|
|
33
|
-
questionsScrollable: !(
|
|
34
|
-
minQuestionHeight:
|
|
34
|
+
questionsScrollable: !(r || t === "TRIAL_DIAGNOSTIC" || t === "TRIAL_BASIC" || t === "TRIAL_INTERMEDIATE" || t === "TRIAL_ADVANCED"),
|
|
35
|
+
minQuestionHeight: i,
|
|
35
36
|
minSummaryHeight: u,
|
|
36
|
-
renderSideBar: c === "TEACHER" && !
|
|
37
|
-
renderQuestionHeader: !
|
|
37
|
+
renderSideBar: c === "TEACHER" && (!r || a && R === "preview"),
|
|
38
|
+
renderQuestionHeader: !a,
|
|
38
39
|
imageHue: E,
|
|
39
|
-
background:
|
|
40
|
-
questionPadding:
|
|
40
|
+
background: r || a ? "none" : "paper",
|
|
41
|
+
questionPadding: a ? 0 : n
|
|
41
42
|
}),
|
|
42
43
|
[
|
|
43
|
-
o,
|
|
44
44
|
r,
|
|
45
|
+
a,
|
|
45
46
|
c,
|
|
46
|
-
|
|
47
|
+
A,
|
|
47
48
|
I,
|
|
48
49
|
t,
|
|
49
|
-
|
|
50
|
+
i,
|
|
50
51
|
u,
|
|
51
|
-
E
|
|
52
|
+
E,
|
|
53
|
+
R
|
|
52
54
|
]
|
|
53
55
|
);
|
|
54
|
-
},
|
|
56
|
+
}, l = h;
|
|
55
57
|
export {
|
|
56
|
-
|
|
58
|
+
l as default
|
|
57
59
|
};
|
|
58
60
|
//# sourceMappingURL=use-worksheet-layout.js.map
|
|
@@ -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
|
|
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 { IWorksheetContainerProps, 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 mode?: IWorksheetContainerProps['mode'];\n }): IWorksheetProps['layout'];\n}\n\nconst useWorksheetLayout: IUseWorksheetLayout = ({\n userType,\n nodeType,\n isSATAssessment,\n showNudgeBanner,\n topOffset,\n imageHue,\n mode,\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:\n userType === 'TEACHER' && (!isSATAssessment || (isPuzzleSheet && mode === 'preview')),\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 mode,\n ],\n );\n};\n\nexport default useWorksheetLayout;\n"],"names":["useWorksheetLayout","userType","nodeType","isSATAssessment","showNudgeBanner","topOffset","imageHue","mode","isPuzzleSheet","navigationBar","useMemo","navHeight","TOP_NAVIGATION_HEIGHT","minQuestionHeight","QUESTIONS_GAP","minSummaryHe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AAA,MACAP;AAAA,MACAe;AAAA,MACAP;AAAA,MACAP;AAAA,MACAW;AAAA,MACAE;AAAA,MACAT;AAAA,MACAC;AAAA,IACF;AAAA,EAAA;AAEJ,GAEAW,IAAelB;"}
|
|
@@ -26,20 +26,21 @@ const G = [
|
|
|
26
26
|
onBackIconClick: r,
|
|
27
27
|
isLessonV3Enabled: W,
|
|
28
28
|
canShowActionBar: w,
|
|
29
|
-
mode:
|
|
29
|
+
mode: s,
|
|
30
30
|
actionBarRightElement: $
|
|
31
|
-
} = f, { signed_request: C, questions_signed_request: x } = k, u = i(() => e === "PUZZLE_CARD", [e]),
|
|
31
|
+
} = f, { signed_request: C, questions_signed_request: x } = k, u = i(() => e === "PUZZLE_CARD", [e]), n = i(() => t === "test", [t]), y = i(() => G.includes(e), [e]), H = L(() => null), h = n ? !1 : w, R = z({
|
|
32
32
|
userType: d,
|
|
33
33
|
nodeType: e,
|
|
34
34
|
isSATAssessment: y,
|
|
35
35
|
showNudgeBanner: c,
|
|
36
36
|
topOffset: 56,
|
|
37
|
-
imageHue: m
|
|
37
|
+
imageHue: m,
|
|
38
|
+
mode: s
|
|
38
39
|
}), _ = N(() => {
|
|
39
40
|
r == null || r();
|
|
40
41
|
}, [r]), { bgColor: b, borderColor: I, textColor: p } = v({
|
|
41
42
|
isPuzzleWorksheet: u && h,
|
|
42
|
-
isTestWorksheet:
|
|
43
|
+
isTestWorksheet: n,
|
|
43
44
|
imageHue: m
|
|
44
45
|
});
|
|
45
46
|
return /* @__PURE__ */ S(V, { children: [
|
|
@@ -48,7 +49,7 @@ const G = [
|
|
|
48
49
|
{
|
|
49
50
|
$flexDirection: "row",
|
|
50
51
|
$alignItems: "center",
|
|
51
|
-
$justifyContent:
|
|
52
|
+
$justifyContent: n ? "flex-start" : "center",
|
|
52
53
|
$background: b,
|
|
53
54
|
$height: 56,
|
|
54
55
|
$gutterX: 1,
|
|
@@ -59,7 +60,7 @@ const G = [
|
|
|
59
60
|
/* @__PURE__ */ o(
|
|
60
61
|
F,
|
|
61
62
|
{
|
|
62
|
-
$alignItems:
|
|
63
|
+
$alignItems: n && !u ? "flex-start" : "center",
|
|
63
64
|
children: /* @__PURE__ */ o(P, { $renderAs: "body1", $color: p, children: l || t })
|
|
64
65
|
}
|
|
65
66
|
)
|
|
@@ -69,8 +70,8 @@ const G = [
|
|
|
69
70
|
/* @__PURE__ */ o(B, { $alignItems: "center", children: /* @__PURE__ */ o(
|
|
70
71
|
M,
|
|
71
72
|
{
|
|
72
|
-
userType: d ?? (
|
|
73
|
-
worksheetCompleted:
|
|
73
|
+
userType: d ?? (s === "review" ? "TEACHER" : "STUDENT"),
|
|
74
|
+
worksheetCompleted: s === "review",
|
|
74
75
|
worksheetName: l || t,
|
|
75
76
|
itemsSignedRequest: C,
|
|
76
77
|
questionsSignedRequest: x,
|
|
@@ -85,7 +86,7 @@ const G = [
|
|
|
85
86
|
userId: a,
|
|
86
87
|
openQuestionFeedbackModal: A,
|
|
87
88
|
nodeType: e,
|
|
88
|
-
mode:
|
|
89
|
+
mode: s,
|
|
89
90
|
isLessonV3Enabled: W,
|
|
90
91
|
actionBarRightElement: $
|
|
91
92
|
}
|
|
@@ -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: 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 ?? (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","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,EACE,IAAAjB,GACE,EAAE,gBAAgBkB,GAAe,0BAA0BC,MAC/Df,GAEIgB,IAAoBC,EAAQ,MAAMhB,MAAa,eAAe,CAACA,CAAQ,CAAC,GACxEiB,IAAkBD,EAAQ,MAAMlB,MAAsB,QAAQ,CAACA,CAAiB,CAAC,GACjFoB,IAAkBF,EAAQ,MAAMxB,EAAoB,SAASQ,CAAQ,GAAG,CAACA,CAAQ,CAAC,GAClFmB,IAAYC,EAAO,MAAM,IAAI,GAC7BC,IAAqBJ,IAAkB,KAAQP,GAE/CY,IAASC,EAAmB;AAAA,IAChC,UAAA1B;AAAA,IACA,UAAAG;AAAA,IACA,iBAAAkB;AAAA,IACA,iBAAAhB;AAAA,IACA,WAAW;AAAA,IACX,UAAAE;AAAA,EAAA,CACD,
|
|
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: 56,\n imageHue,\n mode,\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","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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