@cuemath/leap 3.5.63-gg2 → 3.5.64-as1
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.
|
@@ -3,10 +3,10 @@ import { memo as F, useMemo as G, useState as j, useRef as _, useCallback as w,
|
|
|
3
3
|
import U from "../../assets/line-icons/icons/closed-eye.js";
|
|
4
4
|
import y from "../chapters-v2/comps/node-card/node-card-tags.js";
|
|
5
5
|
import { getNodeTypeBasedBgImage as V } from "../chapters-v2/utils/index.js";
|
|
6
|
-
import { getNodeCardBasedIcon as
|
|
7
|
-
import
|
|
6
|
+
import { getNodeCardBasedIcon as Y } from "../chapters-v2/utils/node-card-utils.js";
|
|
7
|
+
import Z from "../math-fit/math-fit-card/math-fit-card.js";
|
|
8
8
|
import q from "../puzzles/comps/puzzle-card.js";
|
|
9
|
-
import
|
|
9
|
+
import p from "../ui/arrow-tooltip/arrow-tooltip.js";
|
|
10
10
|
import c from "../ui/layout/flex-view.js";
|
|
11
11
|
import J from "../ui/lottie-animation/lottie-animation.js";
|
|
12
12
|
import Q from "./card-title.js";
|
|
@@ -18,26 +18,26 @@ const ae = { renderer: "canvas", autoplay: !1 }, le = ({
|
|
|
18
18
|
isInQueue: k,
|
|
19
19
|
nodeData: i,
|
|
20
20
|
studentContainerRef: h,
|
|
21
|
-
subHeader:
|
|
21
|
+
subHeader: b,
|
|
22
22
|
userType: n,
|
|
23
23
|
isMilestone: d = !1,
|
|
24
24
|
puzzleHWCardRef: x,
|
|
25
|
-
entityType:
|
|
25
|
+
entityType: v,
|
|
26
26
|
state: t,
|
|
27
|
-
score:
|
|
27
|
+
score: N,
|
|
28
28
|
imageUrl: f,
|
|
29
|
-
mathFitCardRef:
|
|
29
|
+
mathFitCardRef: O
|
|
30
30
|
}) => {
|
|
31
31
|
const {
|
|
32
32
|
node_type: r,
|
|
33
|
-
accuracy:
|
|
33
|
+
accuracy: C,
|
|
34
34
|
due_date_ts: o,
|
|
35
35
|
image_hue: s,
|
|
36
36
|
card_header: z = "",
|
|
37
|
-
unlocked_on_ts:
|
|
37
|
+
unlocked_on_ts: u,
|
|
38
38
|
course_type: D,
|
|
39
39
|
title: H
|
|
40
|
-
} = i, L = r === "PUZZLE_CARD", $ =
|
|
40
|
+
} = i, L = r === "PUZZLE_CARD", $ = v === ee.MATHFIT_TEST, g = n === "STUDENT" && t === "LOCKED", I = t === "LOCKED" || n === "TEACHER" && t !== "COMPLETED" && t !== "EXPIRED", S = G(() => t === "LOCKED" ? $ ? "Take test after class" : "Not available to student" : "You’ll be able to review the test after your student submits it", [t, $]), [X, R] = j(!1), m = _(null), B = V(r), T = _(null), { lottie: P } = Y(r), W = w(() => {
|
|
41
41
|
var a;
|
|
42
42
|
(a = T.current) == null || a.play();
|
|
43
43
|
}, []), M = w(() => {
|
|
@@ -45,9 +45,9 @@ const ae = { renderer: "canvas", autoplay: !1 }, le = ({
|
|
|
45
45
|
(a = T.current) == null || a.stop();
|
|
46
46
|
}, []);
|
|
47
47
|
return K(() => {
|
|
48
|
-
|
|
48
|
+
m.current && m.current.scrollHeight > m.current.clientHeight && R(!0);
|
|
49
49
|
}, []), L ? /* @__PURE__ */ e(
|
|
50
|
-
|
|
50
|
+
p,
|
|
51
51
|
{
|
|
52
52
|
renderAs: "primary",
|
|
53
53
|
tooltipItem: "Solve puzzle after class",
|
|
@@ -77,17 +77,17 @@ const ae = { renderer: "canvas", autoplay: !1 }, le = ({
|
|
|
77
77
|
{
|
|
78
78
|
nodeType: r,
|
|
79
79
|
state: t,
|
|
80
|
-
accuracy:
|
|
80
|
+
accuracy: C,
|
|
81
81
|
dueDateTs: o,
|
|
82
82
|
isStudent: n === "STUDENT",
|
|
83
83
|
isMilestone: d
|
|
84
84
|
}
|
|
85
85
|
),
|
|
86
|
-
!d && o &&
|
|
86
|
+
!d && o && u && /* @__PURE__ */ e(
|
|
87
87
|
A,
|
|
88
88
|
{
|
|
89
89
|
dueDate: o * 1e3,
|
|
90
|
-
unlockedOn:
|
|
90
|
+
unlockedOn: u * 1e3,
|
|
91
91
|
progressBg: `${s || "ORANGE"}_5`
|
|
92
92
|
}
|
|
93
93
|
)
|
|
@@ -96,23 +96,24 @@ const ae = { renderer: "canvas", autoplay: !1 }, le = ({
|
|
|
96
96
|
) })
|
|
97
97
|
}
|
|
98
98
|
) : $ ? /* @__PURE__ */ e(
|
|
99
|
-
|
|
99
|
+
p,
|
|
100
100
|
{
|
|
101
101
|
renderAs: "primary",
|
|
102
102
|
tooltipItem: S,
|
|
103
103
|
position: "bottom",
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
104
|
+
widthX: 13,
|
|
105
|
+
hidden: !I,
|
|
106
|
+
children: /* @__PURE__ */ e("div", { ref: O, children: /* @__PURE__ */ e(
|
|
107
|
+
Z,
|
|
107
108
|
{
|
|
108
|
-
score:
|
|
109
|
+
score: N,
|
|
109
110
|
dueDateTs: i.due_date_ts,
|
|
110
111
|
nodeType: "DYNAMIC",
|
|
111
112
|
state: t,
|
|
112
|
-
subHeader:
|
|
113
|
+
subHeader: b,
|
|
113
114
|
unlockedOnTs: i == null ? void 0 : i.unlocked_on_ts,
|
|
114
115
|
userType: n,
|
|
115
|
-
isMathFitDisabled:
|
|
116
|
+
isMathFitDisabled: I,
|
|
116
117
|
isMilestone: d,
|
|
117
118
|
studentContainerRef: h
|
|
118
119
|
}
|
|
@@ -155,7 +156,7 @@ const ae = { renderer: "canvas", autoplay: !1 }, le = ({
|
|
|
155
156
|
),
|
|
156
157
|
/* @__PURE__ */ e(Q, { cardHeader: z, nodeType: r, courseType: D }),
|
|
157
158
|
k && /* @__PURE__ */ e(
|
|
158
|
-
|
|
159
|
+
p,
|
|
159
160
|
{
|
|
160
161
|
renderAs: "primary",
|
|
161
162
|
tooltipItem: "Not visible to student",
|
|
@@ -173,23 +174,23 @@ const ae = { renderer: "canvas", autoplay: !1 }, le = ({
|
|
|
173
174
|
{
|
|
174
175
|
nodeType: r,
|
|
175
176
|
state: t,
|
|
176
|
-
accuracy:
|
|
177
|
+
accuracy: C,
|
|
177
178
|
dueDateTs: o,
|
|
178
179
|
isStudent: n === "STUDENT",
|
|
179
180
|
isMilestone: d
|
|
180
181
|
}
|
|
181
182
|
),
|
|
182
|
-
!d && o &&
|
|
183
|
+
!d && o && u && /* @__PURE__ */ e(
|
|
183
184
|
A,
|
|
184
185
|
{
|
|
185
186
|
dueDate: o * 1e3,
|
|
186
|
-
unlockedOn:
|
|
187
|
+
unlockedOn: u * 1e3,
|
|
187
188
|
progressBg: `${s || "ORANGE"}_4`
|
|
188
189
|
}
|
|
189
190
|
),
|
|
190
191
|
/* @__PURE__ */ l(c, { $gutterX: 0.75, $gapX: 1, $flexRowGapX: 0.5, $background: "WHITE", children: [
|
|
191
192
|
/* @__PURE__ */ e(
|
|
192
|
-
|
|
193
|
+
p,
|
|
193
194
|
{
|
|
194
195
|
renderAs: "primary",
|
|
195
196
|
position: "bottom",
|
|
@@ -198,7 +199,7 @@ const ae = { renderer: "canvas", autoplay: !1 }, le = ({
|
|
|
198
199
|
hidden: !X,
|
|
199
200
|
parentWidth: "auto",
|
|
200
201
|
zIndex: 6,
|
|
201
|
-
children: /* @__PURE__ */ e(c, { $heightX: 2.5, children: /* @__PURE__ */ e(de, { ref:
|
|
202
|
+
children: /* @__PURE__ */ e(c, { $heightX: 2.5, children: /* @__PURE__ */ e(de, { ref: m, $renderAs: "ab3", children: E }) })
|
|
202
203
|
}
|
|
203
204
|
),
|
|
204
205
|
/* @__PURE__ */ l(
|
|
@@ -209,7 +210,7 @@ const ae = { renderer: "canvas", autoplay: !1 }, le = ({
|
|
|
209
210
|
$alignItems: "center",
|
|
210
211
|
$justifyContent: "space-between",
|
|
211
212
|
children: [
|
|
212
|
-
/* @__PURE__ */ e(se, { $renderAs: "ub3", $color: "BLACK_T_60", children:
|
|
213
|
+
/* @__PURE__ */ e(se, { $renderAs: "ub3", $color: "BLACK_T_60", children: b }),
|
|
213
214
|
/* @__PURE__ */ e(c, { $width: 32 })
|
|
214
215
|
]
|
|
215
216
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"homework-card-view.js","sources":["../../../src/features/homework/homework-card-view.tsx"],"sourcesContent":["import { memo, useCallback, useLayoutEffect, useMemo, useRef, useState, type FC } from 'react';\n\nimport ClosedEyeIcon from '../../assets/line-icons/icons/closed-eye';\nimport NodeCardTags from '../chapters-v2/comps/node-card/node-card-tags';\nimport type { INodeDataProps, TSheetStates } from '../chapters-v2/comps/node-card/node-card-types';\nimport { getNodeTypeBasedBgImage } from '../chapters-v2/utils';\nimport { getNodeCardBasedIcon } from '../chapters-v2/utils/node-card-utils';\nimport MathFitCard from '../math-fit/math-fit-card/math-fit-card';\nimport PuzzleCard from '../puzzles/comps/puzzle-card';\nimport ArrowTooltip from '../ui/arrow-tooltip/arrow-tooltip';\nimport FlexView from '../ui/layout/flex-view';\nimport LottieAnimation from '../ui/lottie-animation/lottie-animation';\nimport type { ILottieAnimationRef } from '../ui/lottie-animation/types';\nimport type { TUserTypes } from '../ui/types';\nimport CardTitle from './card-title';\nimport { EHWCardListEntityType } from './hw-card-list/hw-card-list-types';\nimport NodeProgress from './node-progress';\nimport * as Styled from './styles';\n\nconst renderSettings = { renderer: 'canvas', autoplay: false };\n\ninterface IHomeworkCardViewProps {\n header: string;\n isInQueue?: boolean;\n nodeData: INodeDataProps;\n studentContainerRef: React.RefObject<HTMLDivElement>;\n subHeader: string;\n userType: TUserTypes;\n isMilestone?: boolean;\n puzzleHWCardRef?: React.RefObject<HTMLDivElement>;\n mathFitCardRef?: React.RefObject<HTMLDivElement>;\n entityType?: EHWCardListEntityType;\n state: TSheetStates;\n score: number | null;\n imageUrl?: string;\n}\n\nconst HomeworkView: FC<IHomeworkCardViewProps> = ({\n header,\n isInQueue,\n nodeData,\n studentContainerRef,\n subHeader,\n userType,\n isMilestone = false,\n puzzleHWCardRef,\n entityType,\n state,\n score,\n imageUrl,\n mathFitCardRef,\n}) => {\n const {\n node_type: nodeType,\n accuracy,\n due_date_ts: dueDateTs,\n image_hue: imageHue,\n card_header: cardHeader = '',\n unlocked_on_ts: unlockedOnTs,\n course_type: courseType,\n title,\n } = nodeData;\n const isPuzzleCard = nodeType === 'PUZZLE_CARD';\n const isMathFitCard = entityType === EHWCardListEntityType.MATHFIT_TEST;\n const isPuzzleDisabled = userType === 'STUDENT' && state === 'LOCKED';\n const isMathFitDisabled =\n state === 'LOCKED' || (userType === 'TEACHER' && state !== 'COMPLETED' && state !== 'EXPIRED');\n\n const tooltipText = useMemo(() => {\n if (state === 'LOCKED') {\n if (isMathFitCard) return 'Take test after class';\n\n return 'Not available to student';\n }\n\n return 'Sheet is not completed yet';\n }, [state, isMathFitCard]);\n\n const [showTitleTooltip, setShowTitleTooltip] = useState(false);\n const titleTextRef = useRef<HTMLDivElement>(null);\n const bgImage = getNodeTypeBasedBgImage(nodeType);\n const animationRef = useRef<ILottieAnimationRef | null>(null);\n const { lottie: nodeCardLottie } = getNodeCardBasedIcon(nodeType);\n\n const handleOnMouseEnter = useCallback(() => {\n animationRef.current?.play();\n }, []);\n\n const handleOnMouseLeave = useCallback(() => {\n animationRef.current?.stop();\n }, []);\n\n useLayoutEffect(() => {\n if (\n titleTextRef.current &&\n titleTextRef.current.scrollHeight > titleTextRef.current.clientHeight\n ) {\n setShowTitleTooltip(true);\n }\n }, []);\n\n if (isPuzzleCard) {\n return (\n <ArrowTooltip\n renderAs=\"primary\"\n tooltipItem=\"Solve puzzle after class\"\n position=\"bottom\"\n hidden={!isPuzzleDisabled}\n >\n <div ref={puzzleHWCardRef}>\n <Styled.PuzzleCardWrapper\n ref={studentContainerRef}\n $position=\"relative\"\n $background={`${imageHue}_2`}\n $disabled={isPuzzleDisabled}\n >\n <PuzzleCard\n imageHue={imageHue}\n imageUrl={imageUrl ?? ''}\n title={title}\n width={126}\n height={159}\n disabled={isPuzzleDisabled}\n />\n\n <NodeCardTags\n nodeType={nodeType}\n state={state}\n accuracy={accuracy}\n dueDateTs={dueDateTs}\n isStudent={userType === 'STUDENT'}\n isMilestone={isMilestone}\n />\n {!isMilestone && dueDateTs && unlockedOnTs && (\n <NodeProgress\n dueDate={dueDateTs * 1000}\n unlockedOn={unlockedOnTs * 1000}\n progressBg={`${imageHue || 'ORANGE'}_5`}\n />\n )}\n </Styled.PuzzleCardWrapper>\n </div>\n </ArrowTooltip>\n );\n }\n\n // MathFit Assessment Card\n if (isMathFitCard) {\n return (\n <ArrowTooltip\n renderAs=\"primary\"\n tooltipItem={tooltipText}\n position=\"bottom\"\n hidden={!isMathFitDisabled}\n >\n <div ref={mathFitCardRef}>\n <MathFitCard\n score={score}\n dueDateTs={nodeData.due_date_ts}\n nodeType=\"DYNAMIC\"\n state={state}\n subHeader={subHeader}\n unlockedOnTs={nodeData?.unlocked_on_ts}\n userType={userType}\n isMathFitDisabled={isMathFitDisabled}\n isMilestone={isMilestone}\n studentContainerRef={studentContainerRef}\n />\n </div>\n </ArrowTooltip>\n );\n }\n\n return (\n <FlexView\n ref={studentContainerRef}\n $widthX={12.38}\n $position=\"relative\"\n $background={`${imageHue || 'ORANGE'}_2`}\n onMouseEnter={handleOnMouseEnter}\n onMouseLeave={handleOnMouseLeave}\n >\n <Styled.CardWrapper\n $flexDirection=\"row\"\n $alignItems=\"center\"\n $width=\"100%\"\n $heightX={3.5}\n $bgImage={bgImage}\n $gutterX={0.78125}\n $flexGap={8.5}\n $position=\"relative\"\n >\n <Styled.IconWrapper\n $width={31}\n $height={31}\n $borderRadiusX={2}\n $background=\"WHITE_1\"\n $position=\"relative\"\n $alignItems=\"center\"\n $justifyContent=\"center\"\n >\n <LottieAnimation src={nodeCardLottie} ref={animationRef} settings={renderSettings} />\n </Styled.IconWrapper>\n <CardTitle cardHeader={cardHeader} nodeType={nodeType} courseType={courseType} />\n {isInQueue && (\n <ArrowTooltip\n renderAs=\"primary\"\n tooltipItem=\"Not visible to student\"\n position=\"bottom\"\n zIndex={6}\n >\n <ClosedEyeIcon />\n </ArrowTooltip>\n )}\n {!!imageUrl && (\n <Styled.BannerImageWrapper>\n <Styled.BannerImage src={imageUrl} alt=\"Chapter image\" />\n </Styled.BannerImageWrapper>\n )}\n </Styled.CardWrapper>\n <NodeCardTags\n nodeType={nodeType}\n state={state}\n accuracy={accuracy}\n dueDateTs={dueDateTs}\n isStudent={userType === 'STUDENT'}\n isMilestone={isMilestone}\n />\n {!isMilestone && dueDateTs && unlockedOnTs && (\n <NodeProgress\n dueDate={dueDateTs * 1000}\n unlockedOn={unlockedOnTs * 1000}\n progressBg={`${imageHue || 'ORANGE'}_4`}\n />\n )}\n <FlexView $gutterX={0.75} $gapX={1} $flexRowGapX={0.5} $background=\"WHITE\">\n <ArrowTooltip\n renderAs=\"primary\"\n position=\"bottom\"\n tooltipItem={header}\n width={300}\n hidden={!showTitleTooltip}\n parentWidth=\"auto\"\n zIndex={6}\n >\n <FlexView $heightX={2.5}>\n <Styled.HeaderText ref={titleTextRef} $renderAs=\"ab3\">\n {header}\n </Styled.HeaderText>\n </FlexView>\n </ArrowTooltip>\n <FlexView\n $flexDirection=\"row\"\n $heightX={1.25}\n $alignItems=\"center\"\n $justifyContent=\"space-between\"\n >\n <Styled.SubHeaderText $renderAs=\"ub3\" $color=\"BLACK_T_60\">\n {subHeader}\n </Styled.SubHeaderText>\n <FlexView $width={32} />\n </FlexView>\n </FlexView>\n </FlexView>\n );\n};\n\nexport default memo(HomeworkView);\n"],"names":["renderSettings","HomeworkView","header","isInQueue","nodeData","studentContainerRef","subHeader","userType","isMilestone","puzzleHWCardRef","entityType","state","score","imageUrl","mathFitCardRef","nodeType","accuracy","dueDateTs","imageHue","cardHeader","unlockedOnTs","courseType","title","isPuzzleCard","isMathFitCard","EHWCardListEntityType","isPuzzleDisabled","isMathFitDisabled","tooltipText","useMemo","showTitleTooltip","setShowTitleTooltip","useState","titleTextRef","useRef","bgImage","getNodeTypeBasedBgImage","animationRef","nodeCardLottie","getNodeCardBasedIcon","handleOnMouseEnter","useCallback","_a","handleOnMouseLeave","useLayoutEffect","jsx","ArrowTooltip","jsxs","Styled.PuzzleCardWrapper","PuzzleCard","NodeCardTags","NodeProgress","MathFitCard","FlexView","Styled.CardWrapper","Styled.IconWrapper","LottieAnimation","CardTitle","ClosedEyeIcon","Styled.BannerImageWrapper","Styled.BannerImage","Styled.HeaderText","Styled.SubHeaderText","HomeworkCardView","memo"],"mappings":";;;;;;;;;;;;;;;AAmBA,MAAMA,KAAiB,EAAE,UAAU,UAAU,UAAU,GAAM,GAkBvDC,KAA2C,CAAC;AAAA,EAChD,QAAAC;AAAA,EACA,WAAAC;AAAA,EACA,UAAAC;AAAA,EACA,qBAAAC;AAAA,EACA,WAAAC;AAAA,EACA,UAAAC;AAAA,EACA,aAAAC,IAAc;AAAA,EACd,iBAAAC;AAAA,EACA,YAAAC;AAAA,EACA,OAAAC;AAAA,EACA,OAAAC;AAAA,EACA,UAAAC;AAAA,EACA,gBAAAC;AACF,MAAM;AACE,QAAA;AAAA,IACJ,WAAWC;AAAA,IACX,UAAAC;AAAA,IACA,aAAaC;AAAA,IACb,WAAWC;AAAA,IACX,aAAaC,IAAa;AAAA,IAC1B,gBAAgBC;AAAA,IAChB,aAAaC;AAAA,IACb,OAAAC;AAAA,EACE,IAAAlB,GACEmB,IAAeR,MAAa,eAC5BS,IAAgBd,MAAee,GAAsB,cACrDC,IAAmBnB,MAAa,aAAaI,MAAU,UACvDgB,IACJhB,MAAU,YAAaJ,MAAa,aAAaI,MAAU,eAAeA,MAAU,WAEhFiB,IAAcC,EAAQ,MACtBlB,MAAU,WACRa,IAAsB,0BAEnB,6BAGF,8BACN,CAACb,GAAOa,CAAa,CAAC,GAEnB,CAACM,GAAkBC,CAAmB,IAAIC,EAAS,EAAK,GACxDC,IAAeC,EAAuB,IAAI,GAC1CC,IAAUC,EAAwBrB,CAAQ,GAC1CsB,IAAeH,EAAmC,IAAI,GACtD,EAAE,QAAQI,EAAe,IAAIC,EAAqBxB,CAAQ,GAE1DyB,IAAqBC,EAAY,MAAM;;AA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,UACF;AAAA,UACA,gBAAAc;AAAA,YAACM;AAAA,YAAA;AAAA,cACC,gBAAe;AAAA,cACf,UAAU;AAAA,cACV,aAAY;AAAA,cACZ,iBAAgB;AAAA,cAEhB,UAAA;AAAA,gBAAA,gBAAAR,EAACiB,IAAA,EAAqB,WAAU,OAAM,QAAO,cAC1C,UACHxD,GAAA;AAAA,gBACA,gBAAAuC,EAACQ,GAAS,EAAA,QAAQ,GAAI,CAAA;AAAA,cAAA;AAAA,YAAA;AAAA,UACxB;AAAA,QAAA,GACF;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAGN,GAEeU,KAAAC,EAAK/D,EAAY;"}
|
|
1
|
+
{"version":3,"file":"homework-card-view.js","sources":["../../../src/features/homework/homework-card-view.tsx"],"sourcesContent":["import { memo, useCallback, useLayoutEffect, useMemo, useRef, useState, type FC } from 'react';\n\nimport ClosedEyeIcon from '../../assets/line-icons/icons/closed-eye';\nimport NodeCardTags from '../chapters-v2/comps/node-card/node-card-tags';\nimport type { INodeDataProps, TSheetStates } from '../chapters-v2/comps/node-card/node-card-types';\nimport { getNodeTypeBasedBgImage } from '../chapters-v2/utils';\nimport { getNodeCardBasedIcon } from '../chapters-v2/utils/node-card-utils';\nimport MathFitCard from '../math-fit/math-fit-card/math-fit-card';\nimport PuzzleCard from '../puzzles/comps/puzzle-card';\nimport ArrowTooltip from '../ui/arrow-tooltip/arrow-tooltip';\nimport FlexView from '../ui/layout/flex-view';\nimport LottieAnimation from '../ui/lottie-animation/lottie-animation';\nimport type { ILottieAnimationRef } from '../ui/lottie-animation/types';\nimport type { TUserTypes } from '../ui/types';\nimport CardTitle from './card-title';\nimport { EHWCardListEntityType } from './hw-card-list/hw-card-list-types';\nimport NodeProgress from './node-progress';\nimport * as Styled from './styles';\n\nconst renderSettings = { renderer: 'canvas', autoplay: false };\n\ninterface IHomeworkCardViewProps {\n header: string;\n isInQueue?: boolean;\n nodeData: INodeDataProps;\n studentContainerRef: React.RefObject<HTMLDivElement>;\n subHeader: string;\n userType: TUserTypes;\n isMilestone?: boolean;\n puzzleHWCardRef?: React.RefObject<HTMLDivElement>;\n mathFitCardRef?: React.RefObject<HTMLDivElement>;\n entityType?: EHWCardListEntityType;\n state: TSheetStates;\n score: number | null;\n imageUrl?: string;\n}\n\nconst HomeworkView: FC<IHomeworkCardViewProps> = ({\n header,\n isInQueue,\n nodeData,\n studentContainerRef,\n subHeader,\n userType,\n isMilestone = false,\n puzzleHWCardRef,\n entityType,\n state,\n score,\n imageUrl,\n mathFitCardRef,\n}) => {\n const {\n node_type: nodeType,\n accuracy,\n due_date_ts: dueDateTs,\n image_hue: imageHue,\n card_header: cardHeader = '',\n unlocked_on_ts: unlockedOnTs,\n course_type: courseType,\n title,\n } = nodeData;\n const isPuzzleCard = nodeType === 'PUZZLE_CARD';\n const isMathFitCard = entityType === EHWCardListEntityType.MATHFIT_TEST;\n const isPuzzleDisabled = userType === 'STUDENT' && state === 'LOCKED';\n const isMathFitDisabled =\n state === 'LOCKED' || (userType === 'TEACHER' && state !== 'COMPLETED' && state !== 'EXPIRED');\n\n const tooltipText = useMemo(() => {\n if (state === 'LOCKED') {\n if (isMathFitCard) return 'Take test after class';\n\n return 'Not available to student';\n }\n\n return `You’ll be able to review the test after your student submits it`;\n }, [state, isMathFitCard]);\n\n const [showTitleTooltip, setShowTitleTooltip] = useState(false);\n const titleTextRef = useRef<HTMLDivElement>(null);\n const bgImage = getNodeTypeBasedBgImage(nodeType);\n const animationRef = useRef<ILottieAnimationRef | null>(null);\n const { lottie: nodeCardLottie } = getNodeCardBasedIcon(nodeType);\n\n const handleOnMouseEnter = useCallback(() => {\n animationRef.current?.play();\n }, []);\n\n const handleOnMouseLeave = useCallback(() => {\n animationRef.current?.stop();\n }, []);\n\n useLayoutEffect(() => {\n if (\n titleTextRef.current &&\n titleTextRef.current.scrollHeight > titleTextRef.current.clientHeight\n ) {\n setShowTitleTooltip(true);\n }\n }, []);\n\n if (isPuzzleCard) {\n return (\n <ArrowTooltip\n renderAs=\"primary\"\n tooltipItem=\"Solve puzzle after class\"\n position=\"bottom\"\n hidden={!isPuzzleDisabled}\n >\n <div ref={puzzleHWCardRef}>\n <Styled.PuzzleCardWrapper\n ref={studentContainerRef}\n $position=\"relative\"\n $background={`${imageHue}_2`}\n $disabled={isPuzzleDisabled}\n >\n <PuzzleCard\n imageHue={imageHue}\n imageUrl={imageUrl ?? ''}\n title={title}\n width={126}\n height={159}\n disabled={isPuzzleDisabled}\n />\n\n <NodeCardTags\n nodeType={nodeType}\n state={state}\n accuracy={accuracy}\n dueDateTs={dueDateTs}\n isStudent={userType === 'STUDENT'}\n isMilestone={isMilestone}\n />\n {!isMilestone && dueDateTs && unlockedOnTs && (\n <NodeProgress\n dueDate={dueDateTs * 1000}\n unlockedOn={unlockedOnTs * 1000}\n progressBg={`${imageHue || 'ORANGE'}_5`}\n />\n )}\n </Styled.PuzzleCardWrapper>\n </div>\n </ArrowTooltip>\n );\n }\n\n // MathFit Assessment Card\n if (isMathFitCard) {\n return (\n <ArrowTooltip\n renderAs=\"primary\"\n tooltipItem={tooltipText}\n position=\"bottom\"\n widthX={13}\n hidden={!isMathFitDisabled}\n >\n <div ref={mathFitCardRef}>\n <MathFitCard\n score={score}\n dueDateTs={nodeData.due_date_ts}\n nodeType=\"DYNAMIC\"\n state={state}\n subHeader={subHeader}\n unlockedOnTs={nodeData?.unlocked_on_ts}\n userType={userType}\n isMathFitDisabled={isMathFitDisabled}\n isMilestone={isMilestone}\n studentContainerRef={studentContainerRef}\n />\n </div>\n </ArrowTooltip>\n );\n }\n\n return (\n <FlexView\n ref={studentContainerRef}\n $widthX={12.38}\n $position=\"relative\"\n $background={`${imageHue || 'ORANGE'}_2`}\n onMouseEnter={handleOnMouseEnter}\n onMouseLeave={handleOnMouseLeave}\n >\n <Styled.CardWrapper\n $flexDirection=\"row\"\n $alignItems=\"center\"\n $width=\"100%\"\n $heightX={3.5}\n $bgImage={bgImage}\n $gutterX={0.78125}\n $flexGap={8.5}\n $position=\"relative\"\n >\n <Styled.IconWrapper\n $width={31}\n $height={31}\n $borderRadiusX={2}\n $background=\"WHITE_1\"\n $position=\"relative\"\n $alignItems=\"center\"\n $justifyContent=\"center\"\n >\n <LottieAnimation src={nodeCardLottie} ref={animationRef} settings={renderSettings} />\n </Styled.IconWrapper>\n <CardTitle cardHeader={cardHeader} nodeType={nodeType} courseType={courseType} />\n {isInQueue && (\n <ArrowTooltip\n renderAs=\"primary\"\n tooltipItem=\"Not visible to student\"\n position=\"bottom\"\n zIndex={6}\n >\n <ClosedEyeIcon />\n </ArrowTooltip>\n )}\n {!!imageUrl && (\n <Styled.BannerImageWrapper>\n <Styled.BannerImage src={imageUrl} alt=\"Chapter image\" />\n </Styled.BannerImageWrapper>\n )}\n </Styled.CardWrapper>\n <NodeCardTags\n nodeType={nodeType}\n state={state}\n accuracy={accuracy}\n dueDateTs={dueDateTs}\n isStudent={userType === 'STUDENT'}\n isMilestone={isMilestone}\n />\n {!isMilestone && dueDateTs && unlockedOnTs && (\n <NodeProgress\n dueDate={dueDateTs * 1000}\n unlockedOn={unlockedOnTs * 1000}\n progressBg={`${imageHue || 'ORANGE'}_4`}\n />\n )}\n <FlexView $gutterX={0.75} $gapX={1} $flexRowGapX={0.5} $background=\"WHITE\">\n <ArrowTooltip\n renderAs=\"primary\"\n position=\"bottom\"\n tooltipItem={header}\n width={300}\n hidden={!showTitleTooltip}\n parentWidth=\"auto\"\n zIndex={6}\n >\n <FlexView $heightX={2.5}>\n <Styled.HeaderText ref={titleTextRef} $renderAs=\"ab3\">\n {header}\n </Styled.HeaderText>\n </FlexView>\n </ArrowTooltip>\n <FlexView\n $flexDirection=\"row\"\n $heightX={1.25}\n $alignItems=\"center\"\n $justifyContent=\"space-between\"\n >\n <Styled.SubHeaderText $renderAs=\"ub3\" $color=\"BLACK_T_60\">\n {subHeader}\n </Styled.SubHeaderText>\n <FlexView $width={32} />\n </FlexView>\n </FlexView>\n </FlexView>\n );\n};\n\nexport default memo(HomeworkView);\n"],"names":["renderSettings","HomeworkView","header","isInQueue","nodeData","studentContainerRef","subHeader","userType","isMilestone","puzzleHWCardRef","entityType","state","score","imageUrl","mathFitCardRef","nodeType","accuracy","dueDateTs","imageHue","cardHeader","unlockedOnTs","courseType","title","isPuzzleCard","isMathFitCard","EHWCardListEntityType","isPuzzleDisabled","isMathFitDisabled","tooltipText","useMemo","showTitleTooltip","setShowTitleTooltip","useState","titleTextRef","useRef","bgImage","getNodeTypeBasedBgImage","animationRef","nodeCardLottie","getNodeCardBasedIcon","handleOnMouseEnter","useCallback","_a","handleOnMouseLeave","useLayoutEffect","jsx","ArrowTooltip","jsxs","Styled.PuzzleCardWrapper","PuzzleCard","NodeCardTags","NodeProgress","MathFitCard","FlexView","Styled.CardWrapper","Styled.IconWrapper","LottieAnimation","CardTitle","ClosedEyeIcon","Styled.BannerImageWrapper","Styled.BannerImage","Styled.HeaderText","Styled.SubHeaderText","HomeworkCardView","memo"],"mappings":";;;;;;;;;;;;;;;AAmBA,MAAMA,KAAiB,EAAE,UAAU,UAAU,UAAU,GAAM,GAkBvDC,KAA2C,CAAC;AAAA,EAChD,QAAAC;AAAA,EACA,WAAAC;AAAA,EACA,UAAAC;AAAA,EACA,qBAAAC;AAAA,EACA,WAAAC;AAAA,EACA,UAAAC;AAAA,EACA,aAAAC,IAAc;AAAA,EACd,iBAAAC;AAAA,EACA,YAAAC;AAAA,EACA,OAAAC;AAAA,EACA,OAAAC;AAAA,EACA,UAAAC;AAAA,EACA,gBAAAC;AACF,MAAM;AACE,QAAA;AAAA,IACJ,WAAWC;AAAA,IACX,UAAAC;AAAA,IACA,aAAaC;AAAA,IACb,WAAWC;AAAA,IACX,aAAaC,IAAa;AAAA,IAC1B,gBAAgBC;AAAA,IAChB,aAAaC;AAAA,IACb,OAAAC;AAAA,EACE,IAAAlB,GACEmB,IAAeR,MAAa,eAC5BS,IAAgBd,MAAee,GAAsB,cACrDC,IAAmBnB,MAAa,aAAaI,MAAU,UACvDgB,IAC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AAS,UAAU,MAAM,OAAO,GAAG,cAAc,KAAK,aAAY,SACjE,UAAA;AAAA,UAAA,gBAAAR;AAAA,YAACC;AAAA,YAAA;AAAA,cACC,UAAS;AAAA,cACT,UAAS;AAAA,cACT,aAAa5C;AAAA,cACb,OAAO;AAAA,cACP,QAAQ,CAAC4B;AAAA,cACT,aAAY;AAAA,cACZ,QAAQ;AAAA,cAER,UAAC,gBAAAe,EAAAQ,GAAA,EAAS,UAAU,KAClB,UAAC,gBAAAR,EAAAgB,IAAA,EAAkB,KAAK5B,GAAc,WAAU,OAC7C,YACH,CAAA,GACF;AAAA,YAAA;AAAA,UACF;AAAA,UACA,gBAAAc;AAAA,YAACM;AAAA,YAAA;AAAA,cACC,gBAAe;AAAA,cACf,UAAU;AAAA,cACV,aAAY;AAAA,cACZ,iBAAgB;AAAA,cAEhB,UAAA;AAAA,gBAAA,gBAAAR,EAACiB,IAAA,EAAqB,WAAU,OAAM,QAAO,cAC1C,UACHxD,GAAA;AAAA,gBACA,gBAAAuC,EAACQ,GAAS,EAAA,QAAQ,GAAI,CAAA;AAAA,cAAA;AAAA,YAAA;AAAA,UACxB;AAAA,QAAA,GACF;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAGN,GAEeU,KAAAC,EAAK/D,EAAY;"}
|
|
@@ -17,7 +17,9 @@ const f = ({
|
|
|
17
17
|
if (a)
|
|
18
18
|
return r || t ? {
|
|
19
19
|
analyticsLabel: c.HOMEWORK_ATTEMPTED,
|
|
20
|
+
// mixpanel
|
|
20
21
|
analyticsProps: { student_id: o, node_type: i, homework_id: e }
|
|
22
|
+
//
|
|
21
23
|
} : {
|
|
22
24
|
analyticsLabel: "homework-student-menu",
|
|
23
25
|
analyticsProps: { student_id: o, node_type: i, homework_id: e }
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sources":["../../../src/features/homework/utils.ts"],"sourcesContent":["import type { TNodeTypes } from '../chapters-v2/comps/node-card/node-card-types';\nimport { TESTS_CREATION_ANALYTICS_EVENTS } from '../milestone/milestone-tests/tests-creation/tests-creation-analytics-events';\nimport { NODE_TYPE } from '../sheets/constants/sheet';\nimport { HOMEWORK_ANALYTICS_EVENTS } from './homework-analytics-events';\nimport type { IHomeworkDetails } from './hw-card-list/api/get-homeworks';\nimport { EHWCardListEntityType } from './hw-card-list/hw-card-list-types';\n\ninterface IGetCardAnalyticProps {\n canResume: boolean;\n canStart: boolean;\n homeworkId?: string;\n isHomeWork: boolean;\n isStudent: boolean;\n milestoneId?: string;\n nodeType: TNodeTypes;\n studentId: string;\n userNodeId: string | null;\n}\n\nconst getCardAnalyticProps = ({\n canResume,\n canStart,\n homeworkId,\n isHomeWork,\n isStudent,\n milestoneId,\n nodeType,\n studentId,\n userNodeId,\n}: IGetCardAnalyticProps) => {\n if (isStudent) {\n if (isHomeWork) {\n if (canStart || canResume) {\n return {\n analyticsLabel: HOMEWORK_ANALYTICS_EVENTS.HOMEWORK_ATTEMPTED
|
|
1
|
+
{"version":3,"file":"utils.js","sources":["../../../src/features/homework/utils.ts"],"sourcesContent":["import type { TNodeTypes } from '../chapters-v2/comps/node-card/node-card-types';\nimport { TESTS_CREATION_ANALYTICS_EVENTS } from '../milestone/milestone-tests/tests-creation/tests-creation-analytics-events';\nimport { NODE_TYPE } from '../sheets/constants/sheet';\nimport { HOMEWORK_ANALYTICS_EVENTS } from './homework-analytics-events';\nimport type { IHomeworkDetails } from './hw-card-list/api/get-homeworks';\nimport { EHWCardListEntityType } from './hw-card-list/hw-card-list-types';\n\ninterface IGetCardAnalyticProps {\n canResume: boolean;\n canStart: boolean;\n homeworkId?: string;\n isHomeWork: boolean;\n isStudent: boolean;\n milestoneId?: string;\n nodeType: TNodeTypes;\n studentId: string;\n userNodeId: string | null;\n}\n\nconst getCardAnalyticProps = ({\n canResume,\n canStart,\n homeworkId,\n isHomeWork,\n isStudent,\n milestoneId,\n nodeType,\n studentId,\n userNodeId,\n}: IGetCardAnalyticProps) => {\n if (isStudent) {\n if (isHomeWork) {\n if (canStart || canResume) {\n return {\n analyticsLabel: HOMEWORK_ANALYTICS_EVENTS.HOMEWORK_ATTEMPTED, // mixpanel \n analyticsProps: { student_id: studentId, node_type: nodeType, homework_id: homeworkId }, // \n };\n }\n\n return {\n analyticsLabel: 'homework-student-menu',\n analyticsProps: { student_id: studentId, node_type: nodeType, homework_id: homeworkId },\n };\n }\n\n if (canStart || canResume) {\n return {\n analyticsLabel:\n nodeType === NODE_TYPE.DYNAMIC\n ? TESTS_CREATION_ANALYTICS_EVENTS.CUSTOM_TEST_ATTEMPTED\n : 'node-attempted',\n analyticsProps: {\n student_id: studentId,\n node_type: nodeType,\n user_node_id: userNodeId,\n milestone_id: milestoneId,\n can_start: canStart,\n can_resume: canResume,\n },\n };\n }\n }\n\n if (isHomeWork) {\n return {\n analyticsLabel: 'homework-card-teacher',\n analyticsProps: { student_id: studentId, node_type: nodeType },\n };\n }\n\n return {\n analyticsLabel: 'goals-card-teacher',\n analyticsProps: { student_id: studentId, node_type: nodeType },\n };\n};\n\nconst getPuzzleCardData = (hwDetails?: IHomeworkDetails) => {\n if (!hwDetails) {\n return undefined;\n }\n\n const { assigned_homeworks: assignedHomework } = hwDetails;\n\n return assignedHomework.find(homework => homework.sheets[0]?.node_type === NODE_TYPE.PUZZLE_CARD);\n};\n\nconst getMathFitCardData = (hwDetails?: IHomeworkDetails) => {\n if (!hwDetails) {\n return undefined;\n }\n\n const { assigned_homeworks: assignedHomework } = hwDetails;\n\n return assignedHomework.find(\n homework => homework.entity_type === EHWCardListEntityType.MATHFIT_TEST,\n );\n};\n\nexport { getCardAnalyticProps, getPuzzleCardData, getMathFitCardData };\n"],"names":["getCardAnalyticProps","canResume","canStart","homeworkId","isHomeWork","isStudent","milestoneId","nodeType","studentId","userNodeId","HOMEWORK_ANALYTICS_EVENTS","NODE_TYPE","TESTS_CREATION_ANALYTICS_EVENTS","getPuzzleCardData","hwDetails","assignedHomework","homework","_a","getMathFitCardData","EHWCardListEntityType"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