@cuemath/leap 2.9.4-as3 → 2.9.4-as4
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/homework/hw-card-list/hw-card-list.js +87 -78
- package/dist/features/homework/hw-card-list/hw-card-list.js.map +1 -1
- package/dist/features/journey/hooks/use-home-page-journey.js +54 -54
- package/dist/features/journey/hooks/use-home-page-journey.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/package.json +1 -1
@@ -1,55 +1,64 @@
|
|
1
1
|
import { jsxs as c, jsx as o } from "react/jsx-runtime";
|
2
|
-
import { useRef as
|
3
|
-
import
|
4
|
-
import
|
5
|
-
import { useJourney as
|
6
|
-
import { getTopicsFromItems as
|
2
|
+
import { useRef as re, useState as u, useEffect as h, useCallback as n } from "react";
|
3
|
+
import ne from "../../../assets/line-icons/icons/chevron-left.js";
|
4
|
+
import ie from "../../../assets/line-icons/icons/chevron-right.js";
|
5
|
+
import { useJourney as le } from "../../journey/use-journey/use-journey.js";
|
6
|
+
import { getTopicsFromItems as ce } from "../../milestone/milestone-tests/tests-list/test-sheets-list/test-sheet-item/test-sheet-item-utils.js";
|
7
7
|
import $ from "../../ui/layout/flex-view.js";
|
8
8
|
import L from "../../ui/text/text.js";
|
9
|
-
import
|
10
|
-
import { useGetHomeworks as
|
11
|
-
import { ContentWrapper as
|
12
|
-
const
|
9
|
+
import se from "../homework-card.js";
|
10
|
+
import { useGetHomeworks as he } from "./api/get-homeworks.js";
|
11
|
+
import { ContentWrapper as fe, HoverZone as A, ScrollButton as x, ScrollContainer as ae, QueueWrapper as de, QueueText as ue } from "./hw-card-list-styled.js";
|
12
|
+
const $e = ({
|
13
13
|
userType: g = "STUDENT",
|
14
14
|
studentId: s,
|
15
15
|
stream: f,
|
16
|
-
onTestStart:
|
17
|
-
onNodeAttempt:
|
18
|
-
onTestPreview:
|
19
|
-
onNodeView:
|
20
|
-
onTestReview:
|
21
|
-
onNodeReview:
|
22
|
-
onNodeUnassign:
|
23
|
-
homeworkRef:
|
24
|
-
individualHomeworkRef:
|
25
|
-
startHomePageJourney: m
|
16
|
+
onTestStart: E,
|
17
|
+
onNodeAttempt: S,
|
18
|
+
onTestPreview: T,
|
19
|
+
onNodeView: I,
|
20
|
+
onTestReview: B,
|
21
|
+
onNodeReview: W,
|
22
|
+
onNodeUnassign: N,
|
23
|
+
homeworkRef: j,
|
24
|
+
individualHomeworkRef: y,
|
25
|
+
startHomePageJourney: m,
|
26
|
+
canStartJourney: k
|
26
27
|
}) => {
|
27
|
-
const r =
|
28
|
-
get:
|
28
|
+
const r = re(null), [K, b] = u(!1), [M, H] = u(!1), [F, G] = u(!1), [X, Q] = u(!0), {
|
29
|
+
get: _,
|
29
30
|
data: e,
|
30
|
-
isProcessingFailed:
|
31
|
+
isProcessingFailed: O,
|
31
32
|
isProcessing: p,
|
32
|
-
isStale:
|
33
|
-
} =
|
33
|
+
isStale: R
|
34
|
+
} = he(s), { isJourneyActive: v } = le();
|
34
35
|
h(() => {
|
35
|
-
e != null && e.length && m && !v && m({ hwDetails: e, studentId: s, stream: f, userType: g });
|
36
|
-
}, [
|
37
|
-
|
36
|
+
e != null && e.length && m && !v && k && m({ hwDetails: e, studentId: s, stream: f, userType: g });
|
37
|
+
}, [
|
38
|
+
k,
|
39
|
+
e,
|
40
|
+
v,
|
41
|
+
m,
|
42
|
+
f,
|
43
|
+
s,
|
44
|
+
g
|
45
|
+
]);
|
46
|
+
const V = n(() => {
|
38
47
|
r.current && r.current.scrollBy({ left: -200, behavior: "smooth" });
|
39
|
-
}, []), V = n(() => {
|
40
|
-
r.current && r.current.scrollBy({ left: 200, behavior: "smooth" });
|
41
48
|
}, []), z = n(() => {
|
42
|
-
|
49
|
+
r.current && r.current.scrollBy({ left: 200, behavior: "smooth" });
|
43
50
|
}, []), P = n(() => {
|
44
|
-
k(!1);
|
45
|
-
}, []), U = n(() => {
|
46
51
|
b(!0);
|
47
|
-
}, []),
|
52
|
+
}, []), U = n(() => {
|
48
53
|
b(!1);
|
54
|
+
}, []), Y = n(() => {
|
55
|
+
H(!0);
|
56
|
+
}, []), Z = n(() => {
|
57
|
+
H(!1);
|
49
58
|
}, []), i = n(() => {
|
50
59
|
if (r.current) {
|
51
60
|
const { scrollLeft: t, scrollWidth: l, clientWidth: C } = r.current;
|
52
|
-
|
61
|
+
G(t > 10), Q(t < l - C - 10);
|
53
62
|
}
|
54
63
|
}, []);
|
55
64
|
h(() => {
|
@@ -62,14 +71,14 @@ const ue = ({
|
|
62
71
|
i();
|
63
72
|
}, [e, i]);
|
64
73
|
const a = n(() => {
|
65
|
-
|
66
|
-
}, [
|
74
|
+
_(s, void 0, { stream: f });
|
75
|
+
}, [_, f, s]);
|
67
76
|
h(() => {
|
68
|
-
!p &&
|
69
|
-
}, [a, p,
|
77
|
+
!p && R && a();
|
78
|
+
}, [a, p, R]), h(() => {
|
70
79
|
a();
|
71
80
|
}, [a]);
|
72
|
-
const
|
81
|
+
const q = ((e == null ? void 0 : e.filter((t) => t.state === "WAIT_FOR_REVIEW")) || []).length;
|
73
82
|
return e && e.length === 0 ? /* @__PURE__ */ c($, { $flexRowGapX: 1, children: [
|
74
83
|
/* @__PURE__ */ c(L, { $renderAs: "ac4-black", $color: "BLACK_T_60", children: [
|
75
84
|
"Homework (",
|
@@ -77,102 +86,102 @@ const ue = ({
|
|
77
86
|
")"
|
78
87
|
] }),
|
79
88
|
/* @__PURE__ */ o(L, { $renderAs: "ab2", $color: "BLACK_T_60", children: "No Homework assigned yet" })
|
80
|
-
] }) :
|
89
|
+
] }) : O ? null : /* @__PURE__ */ c(fe, { ref: j, $flexRowGapX: 1, $disablePointerEvents: p, children: [
|
81
90
|
!v && /* @__PURE__ */ c(L, { $renderAs: "ac4-black", $color: "BLACK_T_60", children: [
|
82
91
|
"Homework (",
|
83
|
-
|
92
|
+
q,
|
84
93
|
"/",
|
85
94
|
e == null ? void 0 : e.length,
|
86
95
|
")"
|
87
96
|
] }),
|
88
97
|
/* @__PURE__ */ c($, { $position: "relative", onMouseEnter: i, children: [
|
89
|
-
|
90
|
-
|
98
|
+
F && /* @__PURE__ */ o(
|
99
|
+
A,
|
91
100
|
{
|
92
101
|
$position: "absolute",
|
93
102
|
$width: "60px",
|
94
103
|
left: "0",
|
95
104
|
right: "auto",
|
96
|
-
onMouseEnter:
|
97
|
-
onMouseLeave:
|
105
|
+
onMouseEnter: P,
|
106
|
+
onMouseLeave: U,
|
98
107
|
children: /* @__PURE__ */ o(
|
99
|
-
|
108
|
+
x,
|
100
109
|
{
|
101
110
|
$position: "absolute",
|
102
111
|
$background: "BLACK_T_60",
|
103
112
|
$justifyContent: "center",
|
104
113
|
$alignItems: "center",
|
105
114
|
$height: "100%",
|
106
|
-
onClick:
|
107
|
-
$visible:
|
115
|
+
onClick: V,
|
116
|
+
$visible: K,
|
108
117
|
left: "0px",
|
109
118
|
right: "auto",
|
110
|
-
children: /* @__PURE__ */ o(
|
119
|
+
children: /* @__PURE__ */ o(ne, { width: 24, height: 24 })
|
111
120
|
}
|
112
121
|
)
|
113
122
|
},
|
114
123
|
"left-hover-zone"
|
115
124
|
),
|
116
|
-
/* @__PURE__ */ o(
|
125
|
+
/* @__PURE__ */ o(ae, { ref: r, children: /* @__PURE__ */ o($, { $flexDirection: "row", $flexGapX: 1, children: e == null ? void 0 : e.map((t, l) => {
|
117
126
|
const {
|
118
127
|
items: C,
|
119
|
-
node_id:
|
120
|
-
worksheet_id:
|
121
|
-
node_type:
|
122
|
-
title:
|
123
|
-
subtext:
|
124
|
-
} = t,
|
128
|
+
node_id: w,
|
129
|
+
worksheet_id: J,
|
130
|
+
node_type: D,
|
131
|
+
title: ee,
|
132
|
+
subtext: oe
|
133
|
+
} = t, te = ce(C).join(", "), d = D === "DYNAMIC";
|
125
134
|
return /* @__PURE__ */ c(
|
126
135
|
$,
|
127
136
|
{
|
128
|
-
ref: l === 0 ?
|
137
|
+
ref: l === 0 ? y : void 0,
|
129
138
|
$flexDirection: "row",
|
130
139
|
$flexGapX: 1,
|
131
140
|
children: [
|
132
141
|
e.length > 10 && l === 10 && /* @__PURE__ */ o(
|
133
|
-
|
142
|
+
de,
|
134
143
|
{
|
135
144
|
$widthX: 9.5,
|
136
145
|
$background: "BLACK_4",
|
137
146
|
$justifyContent: "center",
|
138
147
|
$gutter: 4,
|
139
148
|
$gap: 8,
|
140
|
-
children: /* @__PURE__ */ o(
|
149
|
+
children: /* @__PURE__ */ o(ue, { $renderAs: "ac3", $color: "WHITE", children: "In Queue" })
|
141
150
|
}
|
142
151
|
),
|
143
152
|
/* @__PURE__ */ o(
|
144
|
-
|
153
|
+
se,
|
145
154
|
{
|
146
155
|
isInQueue: e.length > 10 && l > 9,
|
147
156
|
userType: g,
|
148
|
-
header: d ?
|
149
|
-
subHeader:
|
157
|
+
header: d ? te : ee,
|
158
|
+
subHeader: oe || "",
|
150
159
|
nodeData: t,
|
151
160
|
renderAs: "homework",
|
152
|
-
onNodeAttempt: d ?
|
161
|
+
onNodeAttempt: d ? E : S,
|
153
162
|
shouldOpenOnRight: e.length > 3 && l === e.length - 1,
|
154
|
-
onNodeView: d ?
|
155
|
-
onNodeReview: d ?
|
156
|
-
onNodeUnassign:
|
163
|
+
onNodeView: d ? T : I,
|
164
|
+
onNodeReview: d ? B : W,
|
165
|
+
onNodeUnassign: N
|
157
166
|
},
|
158
|
-
`${
|
167
|
+
`${J}_${w}_${l}`
|
159
168
|
)
|
160
169
|
]
|
161
170
|
},
|
162
|
-
|
171
|
+
w
|
163
172
|
);
|
164
173
|
}) }) }),
|
165
|
-
|
166
|
-
|
174
|
+
X && /* @__PURE__ */ o(
|
175
|
+
A,
|
167
176
|
{
|
168
177
|
$position: "absolute",
|
169
178
|
$width: "60px",
|
170
179
|
right: "0",
|
171
180
|
left: "auto",
|
172
|
-
onMouseEnter:
|
173
|
-
onMouseLeave:
|
181
|
+
onMouseEnter: Y,
|
182
|
+
onMouseLeave: Z,
|
174
183
|
children: /* @__PURE__ */ o(
|
175
|
-
|
184
|
+
x,
|
176
185
|
{
|
177
186
|
$position: "absolute",
|
178
187
|
$width: "60px",
|
@@ -180,11 +189,11 @@ const ue = ({
|
|
180
189
|
$background: "BLACK_T_60",
|
181
190
|
$justifyContent: "center",
|
182
191
|
$alignItems: "center",
|
183
|
-
onClick:
|
184
|
-
$visible:
|
192
|
+
onClick: z,
|
193
|
+
$visible: M,
|
185
194
|
left: "auto",
|
186
195
|
right: "0px",
|
187
|
-
children: /* @__PURE__ */ o(
|
196
|
+
children: /* @__PURE__ */ o(ie, { width: 24, height: 24 })
|
188
197
|
}
|
189
198
|
)
|
190
199
|
},
|
@@ -192,8 +201,8 @@ const ue = ({
|
|
192
201
|
)
|
193
202
|
] })
|
194
203
|
] });
|
195
|
-
},
|
204
|
+
}, Ae = $e;
|
196
205
|
export {
|
197
|
-
|
206
|
+
Ae as default
|
198
207
|
};
|
199
208
|
//# sourceMappingURL=hw-card-list.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"hw-card-list.js","sources":["../../../../src/features/homework/hw-card-list/hw-card-list.tsx"],"sourcesContent":["import type {\n INodeCardCallbacks,\n INodeDataProps,\n} from '../../chapters-v2/comps/node-card/node-card-types';\nimport type { IHomepageStartJourneyProps } from '../../journey/types/homepage-journey-types';\nimport type { TUserTypes } from '../../ui/types';\n\nimport React, { useCallback, useEffect, useRef, useState } from 'react';\n\nimport ChevronLeftIcon from '../../../assets/line-icons/icons/chevron-left';\nimport ChevronRightIcon from '../../../assets/line-icons/icons/chevron-right';\nimport { useJourney } from '../../journey/use-journey/use-journey';\nimport { getTopicsFromItems } from '../../milestone/milestone-tests/tests-list/test-sheets-list/test-sheet-item/test-sheet-item-utils';\nimport FlexView from '../../ui/layout/flex-view';\nimport Text from '../../ui/text/text';\nimport HomeworkCard from '../homework-card';\nimport { useGetHomeworks } from './api/get-homeworks';\nimport * as Styled from './hw-card-list-styled';\n\ninterface HWCardListProps extends INodeCardCallbacks {\n userType: TUserTypes;\n studentId: string;\n stream: string;\n onTestPreview?: (sheetData: INodeDataProps, milestoneId?: string) => void;\n onTestStart?: (sheetData: INodeDataProps) => void;\n onTestReview?: (sheetData: INodeDataProps, milestoneId?: string) => void;\n homeworkRef?: React.RefObject<HTMLDivElement>;\n individualHomeworkRef?: React.RefObject<HTMLDivElement>;\n startHomePageJourney?: ({\n hwDetails,\n studentId,\n stream,\n userType,\n }: IHomepageStartJourneyProps) => void;\n}\n\nconst HWCardList: React.FC<HWCardListProps> = ({\n userType = 'STUDENT',\n studentId,\n stream,\n onTestStart,\n onNodeAttempt,\n onTestPreview,\n onNodeView,\n onTestReview,\n onNodeReview,\n onNodeUnassign,\n homeworkRef,\n individualHomeworkRef,\n startHomePageJourney,\n}) => {\n const scrollRef = useRef<HTMLDivElement>(null);\n const [isLeftHovered, setIsLeftHovered] = useState(false);\n const [isRightHovered, setIsRightHovered] = useState(false);\n const [canScrollLeft, setCanScrollLeft] = useState(false);\n const [canScrollRight, setCanScrollRight] = useState(true);\n const {\n get: getHomeworks,\n data: hwDetails,\n isProcessingFailed,\n isProcessing,\n isStale,\n } = useGetHomeworks(studentId);\n const { isJourneyActive } = useJourney();\n\n useEffect(() => {\n if (hwDetails?.length && startHomePageJourney && !isJourneyActive) {\n startHomePageJourney({ hwDetails, studentId, stream, userType });\n }\n }, [hwDetails, isJourneyActive, startHomePageJourney, stream, studentId, userType]);\n\n const handleScrollLeft = useCallback(() => {\n if (scrollRef.current) {\n scrollRef.current.scrollBy({ left: -200, behavior: 'smooth' });\n }\n }, []);\n\n const handleScrollRight = useCallback(() => {\n if (scrollRef.current) {\n scrollRef.current.scrollBy({ left: 200, behavior: 'smooth' });\n }\n }, []);\n\n const handleLeftHoverEnter = useCallback(() => {\n setIsLeftHovered(true);\n }, []);\n\n const handleLeftHoverLeave = useCallback(() => {\n setIsLeftHovered(false);\n }, []);\n\n const handleRightHoverEnter = useCallback(() => {\n setIsRightHovered(true);\n }, []);\n\n const handleRightHoverLeave = useCallback(() => {\n setIsRightHovered(false);\n }, []);\n\n const checkScrollPosition = useCallback(() => {\n if (scrollRef.current) {\n const { scrollLeft, scrollWidth, clientWidth } = scrollRef.current;\n\n setCanScrollLeft(scrollLeft > 10);\n setCanScrollRight(scrollLeft < scrollWidth - clientWidth - 10);\n }\n }, []);\n\n useEffect(() => {\n const scrollElement = scrollRef.current;\n\n if (scrollElement) {\n scrollElement.addEventListener('scroll', checkScrollPosition);\n checkScrollPosition();\n\n return () => {\n scrollElement.removeEventListener('scroll', checkScrollPosition);\n };\n }\n }, [checkScrollPosition]);\n\n // Also check when content changes\n useEffect(() => {\n checkScrollPosition();\n }, [hwDetails, checkScrollPosition]);\n\n const fetchHomeworks = useCallback(() => {\n getHomeworks(studentId, undefined, { stream });\n }, [getHomeworks, stream, studentId]);\n\n useEffect(() => {\n if (!isProcessing && isStale) {\n fetchHomeworks();\n }\n }, [fetchHomeworks, isProcessing, isStale]);\n\n useEffect(() => {\n fetchHomeworks();\n }, [fetchHomeworks]);\n\n const waitForReviewSheets = (hwDetails?.filter(sheet => sheet.state === 'WAIT_FOR_REVIEW') || [])\n .length;\n\n if (hwDetails && hwDetails.length === 0) {\n return (\n <FlexView $flexRowGapX={1}>\n <Text $renderAs=\"ac4-black\" $color=\"BLACK_T_60\">\n Homework ({hwDetails?.length})\n </Text>\n <Text $renderAs=\"ab2\" $color=\"BLACK_T_60\">\n No Homework assigned yet\n </Text>\n </FlexView>\n );\n }\n\n if (isProcessingFailed) {\n return null;\n }\n\n return (\n <Styled.ContentWrapper ref={homeworkRef} $flexRowGapX={1} $disablePointerEvents={isProcessing}>\n {!isJourneyActive && (\n <Text $renderAs=\"ac4-black\" $color=\"BLACK_T_60\">\n Homework ({waitForReviewSheets}/{hwDetails?.length})\n </Text>\n )}\n <FlexView $position=\"relative\" onMouseEnter={checkScrollPosition}>\n {/* Left hover zone */}\n {canScrollLeft && (\n <Styled.HoverZone\n key=\"left-hover-zone\"\n $position=\"absolute\"\n $width=\"60px\"\n left=\"0\"\n right=\"auto\"\n onMouseEnter={handleLeftHoverEnter}\n onMouseLeave={handleLeftHoverLeave}\n >\n {/* Left scroll button - only visible when hovered */}\n <Styled.ScrollButton\n $position=\"absolute\"\n $background=\"BLACK_T_60\"\n $justifyContent=\"center\"\n $alignItems=\"center\"\n $height=\"100%\"\n onClick={handleScrollLeft}\n $visible={isLeftHovered}\n left=\"0px\"\n right=\"auto\"\n >\n <ChevronLeftIcon width={24} height={24} />\n </Styled.ScrollButton>\n </Styled.HoverZone>\n )}\n\n <Styled.ScrollContainer ref={scrollRef}>\n <FlexView $flexDirection=\"row\" $flexGapX={1}>\n {hwDetails?.map((sheet, idx) => {\n const {\n items,\n node_id: nodeId,\n worksheet_id: worksheetId,\n node_type: nodeType,\n title,\n subtext,\n } = sheet;\n const topics = getTopicsFromItems(items);\n const testChapterName = topics.join(', ');\n const isDynamicSheet = nodeType === 'DYNAMIC';\n\n return (\n <FlexView\n ref={idx === 0 ? individualHomeworkRef : undefined}\n key={nodeId}\n $flexDirection=\"row\"\n $flexGapX={1}\n >\n {hwDetails.length > 10 && idx === 10 && (\n <Styled.QueueWrapper\n $widthX={9.5}\n $background=\"BLACK_4\"\n $justifyContent=\"center\"\n $gutter={4}\n $gap={8}\n >\n <Styled.QueueText $renderAs=\"ac3\" $color=\"WHITE\">\n In Queue\n </Styled.QueueText>\n </Styled.QueueWrapper>\n )}\n <HomeworkCard\n isInQueue={hwDetails.length > 10 && idx > 9}\n key={`${worksheetId}_${nodeId}_${idx}`}\n userType={userType}\n header={isDynamicSheet ? testChapterName : title}\n subHeader={subtext || ''}\n nodeData={sheet}\n renderAs=\"homework\"\n onNodeAttempt={isDynamicSheet ? onTestStart : onNodeAttempt}\n shouldOpenOnRight={hwDetails.length > 3 && idx === hwDetails.length - 1}\n onNodeView={isDynamicSheet ? onTestPreview : onNodeView}\n onNodeReview={isDynamicSheet ? onTestReview : onNodeReview}\n onNodeUnassign={onNodeUnassign}\n />\n </FlexView>\n );\n })}\n </FlexView>\n </Styled.ScrollContainer>\n\n {/* Right hover zone */}\n {canScrollRight && (\n <Styled.HoverZone\n key=\"right-hover-zone\"\n $position=\"absolute\"\n $width=\"60px\"\n right=\"0\"\n left=\"auto\"\n onMouseEnter={handleRightHoverEnter}\n onMouseLeave={handleRightHoverLeave}\n >\n {/* Right scroll button - only visible when hovered */}\n <Styled.ScrollButton\n $position=\"absolute\"\n $width=\"60px\"\n $height=\"100%\"\n $background=\"BLACK_T_60\"\n $justifyContent=\"center\"\n $alignItems=\"center\"\n onClick={handleScrollRight}\n $visible={isRightHovered}\n left=\"auto\"\n right=\"0px\"\n >\n <ChevronRightIcon width={24} height={24} />\n </Styled.ScrollButton>\n </Styled.HoverZone>\n )}\n </FlexView>\n </Styled.ContentWrapper>\n );\n};\n\nexport default HWCardList;\n"],"names":["HWCardList","userType","studentId","stream","onTestStart","onNodeAttempt","onTestPreview","onNodeView","onTestReview","onNodeReview","onNodeUnassign","homeworkRef","individualHomeworkRef","startHomePageJourney","scrollRef","useRef","isLeftHovered","setIsLeftHovered","useState","isRightHovered","setIsRightHovered","canScrollLeft","setCanScrollLeft","canScrollRight","setCanScrollRight","getHomeworks","hwDetails","isProcessingFailed","isProcessing","isStale","useGetHomeworks","isJourneyActive","useJourney","useEffect","handleScrollLeft","useCallback","handleScrollRight","handleLeftHoverEnter","handleLeftHoverLeave","handleRightHoverEnter","handleRightHoverLeave","checkScrollPosition","scrollLeft","scrollWidth","clientWidth","scrollElement","fetchHomeworks","waitForReviewSheets","sheet","jsxs","FlexView","Text","Styled.ContentWrapper","jsx","Styled.HoverZone","Styled.ScrollButton","ChevronLeftIcon","Styled.ScrollContainer","idx","items","nodeId","worksheetId","nodeType","title","subtext","testChapterName","getTopicsFromItems","isDynamicSheet","Styled.QueueWrapper","Styled.QueueText","HomeworkCard","ChevronRightIcon","HWCardList$1"],"mappings":";;;;;;;;;;;AAoCA,MAAMA,KAAwC,CAAC;AAAA,EAC7C,UAAAC,IAAW;AAAA,EACX,WAAAC;A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AAA;AAAA,UA9BKE;AAAA,QAAA;AAAA,MA+BP,IAGN,EACF,CAAA;AAAA,MAGCrC,KACC,gBAAA8B;AAAA,QAACC;AAAAA,QAAA;AAAA,UAEC,WAAU;AAAA,UACV,QAAO;AAAA,UACP,OAAM;AAAA,UACN,MAAK;AAAA,UACL,cAAcf;AAAA,UACd,cAAcC;AAAA,UAGd,UAAA,gBAAAa;AAAA,YAACE;AAAAA,YAAA;AAAA,cACC,WAAU;AAAA,cACV,QAAO;AAAA,cACP,SAAQ;AAAA,cACR,aAAY;AAAA,cACZ,iBAAgB;AAAA,cAChB,aAAY;AAAA,cACZ,SAASnB;AAAA,cACT,UAAUjB;AAAA,cACV,MAAK;AAAA,cACL,OAAM;AAAA,cAEN,UAAC,gBAAAkC,EAAAkB,IAAA,EAAiB,OAAO,IAAI,QAAQ,IAAI;AAAA,YAAA;AAAA,UAC3C;AAAA,QAAA;AAAA,QAtBI;AAAA,MAuBN;AAAA,IAAA,GAEJ;AAAA,EACF,EAAA,CAAA;AAEJ,GAEAC,KAAexE;"}
|
1
|
+
{"version":3,"file":"hw-card-list.js","sources":["../../../../src/features/homework/hw-card-list/hw-card-list.tsx"],"sourcesContent":["import type {\n INodeCardCallbacks,\n INodeDataProps,\n} from '../../chapters-v2/comps/node-card/node-card-types';\nimport type { IHomepageStartJourneyProps } from '../../journey/types/homepage-journey-types';\nimport type { TUserTypes } from '../../ui/types';\n\nimport React, { useCallback, useEffect, useRef, useState } from 'react';\n\nimport ChevronLeftIcon from '../../../assets/line-icons/icons/chevron-left';\nimport ChevronRightIcon from '../../../assets/line-icons/icons/chevron-right';\nimport { useJourney } from '../../journey/use-journey/use-journey';\nimport { getTopicsFromItems } from '../../milestone/milestone-tests/tests-list/test-sheets-list/test-sheet-item/test-sheet-item-utils';\nimport FlexView from '../../ui/layout/flex-view';\nimport Text from '../../ui/text/text';\nimport HomeworkCard from '../homework-card';\nimport { useGetHomeworks } from './api/get-homeworks';\nimport * as Styled from './hw-card-list-styled';\n\ninterface HWCardListProps extends INodeCardCallbacks {\n userType: TUserTypes;\n studentId: string;\n stream: string;\n onTestPreview?: (sheetData: INodeDataProps, milestoneId?: string) => void;\n onTestStart?: (sheetData: INodeDataProps) => void;\n onTestReview?: (sheetData: INodeDataProps, milestoneId?: string) => void;\n homeworkRef?: React.RefObject<HTMLDivElement>;\n individualHomeworkRef?: React.RefObject<HTMLDivElement>;\n startHomePageJourney?: ({\n hwDetails,\n studentId,\n stream,\n userType,\n }: IHomepageStartJourneyProps) => void;\n canStartJourney?: boolean;\n}\n\nconst HWCardList: React.FC<HWCardListProps> = ({\n userType = 'STUDENT',\n studentId,\n stream,\n onTestStart,\n onNodeAttempt,\n onTestPreview,\n onNodeView,\n onTestReview,\n onNodeReview,\n onNodeUnassign,\n homeworkRef,\n individualHomeworkRef,\n startHomePageJourney,\n canStartJourney,\n}) => {\n const scrollRef = useRef<HTMLDivElement>(null);\n const [isLeftHovered, setIsLeftHovered] = useState(false);\n const [isRightHovered, setIsRightHovered] = useState(false);\n const [canScrollLeft, setCanScrollLeft] = useState(false);\n const [canScrollRight, setCanScrollRight] = useState(true);\n const {\n get: getHomeworks,\n data: hwDetails,\n isProcessingFailed,\n isProcessing,\n isStale,\n } = useGetHomeworks(studentId);\n const { isJourneyActive } = useJourney();\n\n useEffect(() => {\n if (hwDetails?.length && startHomePageJourney && !isJourneyActive && canStartJourney) {\n startHomePageJourney({ hwDetails, studentId, stream, userType });\n }\n }, [\n canStartJourney,\n hwDetails,\n isJourneyActive,\n startHomePageJourney,\n stream,\n studentId,\n userType,\n ]);\n\n const handleScrollLeft = useCallback(() => {\n if (scrollRef.current) {\n scrollRef.current.scrollBy({ left: -200, behavior: 'smooth' });\n }\n }, []);\n\n const handleScrollRight = useCallback(() => {\n if (scrollRef.current) {\n scrollRef.current.scrollBy({ left: 200, behavior: 'smooth' });\n }\n }, []);\n\n const handleLeftHoverEnter = useCallback(() => {\n setIsLeftHovered(true);\n }, []);\n\n const handleLeftHoverLeave = useCallback(() => {\n setIsLeftHovered(false);\n }, []);\n\n const handleRightHoverEnter = useCallback(() => {\n setIsRightHovered(true);\n }, []);\n\n const handleRightHoverLeave = useCallback(() => {\n setIsRightHovered(false);\n }, []);\n\n const checkScrollPosition = useCallback(() => {\n if (scrollRef.current) {\n const { scrollLeft, scrollWidth, clientWidth } = scrollRef.current;\n\n setCanScrollLeft(scrollLeft > 10);\n setCanScrollRight(scrollLeft < scrollWidth - clientWidth - 10);\n }\n }, []);\n\n useEffect(() => {\n const scrollElement = scrollRef.current;\n\n if (scrollElement) {\n scrollElement.addEventListener('scroll', checkScrollPosition);\n checkScrollPosition();\n\n return () => {\n scrollElement.removeEventListener('scroll', checkScrollPosition);\n };\n }\n }, [checkScrollPosition]);\n\n // Also check when content changes\n useEffect(() => {\n checkScrollPosition();\n }, [hwDetails, checkScrollPosition]);\n\n const fetchHomeworks = useCallback(() => {\n getHomeworks(studentId, undefined, { stream });\n }, [getHomeworks, stream, studentId]);\n\n useEffect(() => {\n if (!isProcessing && isStale) {\n fetchHomeworks();\n }\n }, [fetchHomeworks, isProcessing, isStale]);\n\n useEffect(() => {\n fetchHomeworks();\n }, [fetchHomeworks]);\n\n const waitForReviewSheets = (hwDetails?.filter(sheet => sheet.state === 'WAIT_FOR_REVIEW') || [])\n .length;\n\n if (hwDetails && hwDetails.length === 0) {\n return (\n <FlexView $flexRowGapX={1}>\n <Text $renderAs=\"ac4-black\" $color=\"BLACK_T_60\">\n Homework ({hwDetails?.length})\n </Text>\n <Text $renderAs=\"ab2\" $color=\"BLACK_T_60\">\n No Homework assigned yet\n </Text>\n </FlexView>\n );\n }\n\n if (isProcessingFailed) {\n return null;\n }\n\n return (\n <Styled.ContentWrapper ref={homeworkRef} $flexRowGapX={1} $disablePointerEvents={isProcessing}>\n {!isJourneyActive && (\n <Text $renderAs=\"ac4-black\" $color=\"BLACK_T_60\">\n Homework ({waitForReviewSheets}/{hwDetails?.length})\n </Text>\n )}\n <FlexView $position=\"relative\" onMouseEnter={checkScrollPosition}>\n {/* Left hover zone */}\n {canScrollLeft && (\n <Styled.HoverZone\n key=\"left-hover-zone\"\n $position=\"absolute\"\n $width=\"60px\"\n left=\"0\"\n right=\"auto\"\n onMouseEnter={handleLeftHoverEnter}\n onMouseLeave={handleLeftHoverLeave}\n >\n {/* Left scroll button - only visible when hovered */}\n <Styled.ScrollButton\n $position=\"absolute\"\n $background=\"BLACK_T_60\"\n $justifyContent=\"center\"\n $alignItems=\"center\"\n $height=\"100%\"\n onClick={handleScrollLeft}\n $visible={isLeftHovered}\n left=\"0px\"\n right=\"auto\"\n >\n <ChevronLeftIcon width={24} height={24} />\n </Styled.ScrollButton>\n </Styled.HoverZone>\n )}\n\n <Styled.ScrollContainer ref={scrollRef}>\n <FlexView $flexDirection=\"row\" $flexGapX={1}>\n {hwDetails?.map((sheet, idx) => {\n const {\n items,\n node_id: nodeId,\n worksheet_id: worksheetId,\n node_type: nodeType,\n title,\n subtext,\n } = sheet;\n const topics = getTopicsFromItems(items);\n const testChapterName = topics.join(', ');\n const isDynamicSheet = nodeType === 'DYNAMIC';\n\n return (\n <FlexView\n ref={idx === 0 ? individualHomeworkRef : undefined}\n key={nodeId}\n $flexDirection=\"row\"\n $flexGapX={1}\n >\n {hwDetails.length > 10 && idx === 10 && (\n <Styled.QueueWrapper\n $widthX={9.5}\n $background=\"BLACK_4\"\n $justifyContent=\"center\"\n $gutter={4}\n $gap={8}\n >\n <Styled.QueueText $renderAs=\"ac3\" $color=\"WHITE\">\n In Queue\n </Styled.QueueText>\n </Styled.QueueWrapper>\n )}\n <HomeworkCard\n isInQueue={hwDetails.length > 10 && idx > 9}\n key={`${worksheetId}_${nodeId}_${idx}`}\n userType={userType}\n header={isDynamicSheet ? testChapterName : title}\n subHeader={subtext || ''}\n nodeData={sheet}\n renderAs=\"homework\"\n onNodeAttempt={isDynamicSheet ? onTestStart : onNodeAttempt}\n shouldOpenOnRight={hwDetails.length > 3 && idx === hwDetails.length - 1}\n onNodeView={isDynamicSheet ? onTestPreview : onNodeView}\n onNodeReview={isDynamicSheet ? onTestReview : onNodeReview}\n onNodeUnassign={onNodeUnassign}\n />\n </FlexView>\n );\n })}\n </FlexView>\n </Styled.ScrollContainer>\n\n {/* Right hover zone */}\n {canScrollRight && (\n <Styled.HoverZone\n key=\"right-hover-zone\"\n $position=\"absolute\"\n $width=\"60px\"\n right=\"0\"\n left=\"auto\"\n onMouseEnter={handleRightHoverEnter}\n onMouseLeave={handleRightHoverLeave}\n >\n {/* Right scroll button - only visible when hovered */}\n <Styled.ScrollButton\n $position=\"absolute\"\n $width=\"60px\"\n $height=\"100%\"\n $background=\"BLACK_T_60\"\n $justifyContent=\"center\"\n $alignItems=\"center\"\n onClick={handleScrollRight}\n $visible={isRightHovered}\n left=\"auto\"\n right=\"0px\"\n >\n <ChevronRightIcon width={24} height={24} />\n </Styled.ScrollButton>\n </Styled.HoverZone>\n )}\n </FlexView>\n </Styled.ContentWrapper>\n );\n};\n\nexport default HWCardList;\n"],"names":["HWCardList","userType","studentId","stream","onTestStart","onNodeAttempt","onTestPreview","onNodeView","onTestReview","onNodeReview","onNodeUnassign","homeworkRef","individualHomeworkRef","startHomePageJourney","canStartJourney","scrollRef","useRef","isLeftHovered","setIsLeftHovered","useState","isRightHovered","setIsRightHovered","canScrollLeft","setCanScrollLeft","canScrollRight","setCanScrollRight","getHomeworks","hwDetails","isProcessingFailed","isProcessing","isStale","useGetHomeworks","isJourneyActive","useJourney","useEffect","handleScrollLeft","useCallback","handleScrollRight","handleLeftHoverEnter","handleLeftHoverLeave","handleRightHoverEnter","handleRightHoverLeave","checkScrollPosition","scrollLeft","scrollWidth","clientWidth","scrollElement","fetchHomeworks","waitForReviewSheets","sheet","jsxs","FlexView","Text","Styled.ContentWrapper","jsx","Styled.HoverZone","Styled.ScrollButton","ChevronLeftIcon","Styled.ScrollContainer","idx","items","nodeId","worksheetId","nodeType","title","subtext","testChapterName","getTopicsFromItems","isDynamicSheet","Styled.QueueWrapper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,SAAS;AAAA,kBACtE,YAAYyC,IAAiB9D,IAAgBC;AAAA,kBAC7C,cAAc6D,IAAiB5D,IAAeC;AAAA,kBAC9C,gBAAAC;AAAA,gBAAA;AAAA,gBAVK,GAAGoD,CAAW,IAAID,CAAM,IAAIF,CAAG;AAAA,cAWtC;AAAA,YAAA;AAAA,UAAA;AAAA,UA9BKE;AAAA,QAAA;AAAA,MA+BP,IAGN,EACF,CAAA;AAAA,MAGCrC,KACC,gBAAA8B;AAAA,QAACC;AAAAA,QAAA;AAAA,UAEC,WAAU;AAAA,UACV,QAAO;AAAA,UACP,OAAM;AAAA,UACN,MAAK;AAAA,UACL,cAAcf;AAAA,UACd,cAAcC;AAAA,UAGd,UAAA,gBAAAa;AAAA,YAACE;AAAAA,YAAA;AAAA,cACC,WAAU;AAAA,cACV,QAAO;AAAA,cACP,SAAQ;AAAA,cACR,aAAY;AAAA,cACZ,iBAAgB;AAAA,cAChB,aAAY;AAAA,cACZ,SAASnB;AAAA,cACT,UAAUjB;AAAA,cACV,MAAK;AAAA,cACL,OAAM;AAAA,cAEN,UAAC,gBAAAkC,EAAAkB,IAAA,EAAiB,OAAO,IAAI,QAAQ,IAAI;AAAA,YAAA;AAAA,UAC3C;AAAA,QAAA;AAAA,QAtBI;AAAA,MAuBN;AAAA,IAAA,GAEJ;AAAA,EACF,EAAA,CAAA;AAEJ,GAEAC,KAAezE;"}
|
@@ -1,43 +1,43 @@
|
|
1
|
-
import { jsx as e, jsxs as
|
2
|
-
import { useRef as a, useCallback as
|
3
|
-
import
|
4
|
-
import
|
5
|
-
import { getTopicsFromItems as
|
1
|
+
import { jsx as e, jsxs as h, Fragment as P } from "react/jsx-runtime";
|
2
|
+
import { useRef as a, useCallback as L, useMemo as Y, useEffect as _ } from "react";
|
3
|
+
import $ from "../../homework/homework-card.js";
|
4
|
+
import J from "../../homework/hw-card-list/hw-card-list.js";
|
5
|
+
import { getTopicsFromItems as U } from "../../milestone/milestone-tests/tests-list/test-sheets-list/test-sheet-item/test-sheet-item-utils.js";
|
6
6
|
import z from "../../recent-chapters/recent-chapters.js";
|
7
|
-
import
|
7
|
+
import u from "../../ui/buttons/button/button.js";
|
8
8
|
import s from "../../ui/layout/flex-view.js";
|
9
|
-
import
|
10
|
-
import { ELementWrapper as
|
11
|
-
import { JOURNEY_ID_STUDENT as
|
12
|
-
import { IndicatorType as
|
9
|
+
import C from "../../ui/text/text.js";
|
10
|
+
import { ELementWrapper as H } from "../comps/coachmark/coachmark-styled.js";
|
11
|
+
import { JOURNEY_ID_STUDENT as O } from "../journey-id/journey-id-student.js";
|
12
|
+
import { IndicatorType as f } from "../use-journey/constants.js";
|
13
13
|
import { useJourney as K } from "../use-journey/use-journey.js";
|
14
|
-
const
|
15
|
-
const o =
|
14
|
+
const ie = () => {
|
15
|
+
const o = O.HOMEPAGE_JOURNEY, i = a(null), n = a(null), l = a(null), c = a(null), g = a([]), { nextCoachmark: t, setJourney: A, endJourney: w, addCoachmark: E } = K(), y = L(
|
16
16
|
(r, d, m) => {
|
17
|
-
c.current ? (
|
17
|
+
c.current ? (E(O.HOMEPAGE_JOURNEY, {
|
18
18
|
originalElementToHighlightRef: c,
|
19
19
|
elementToHighlight: /* @__PURE__ */ e(s, { $widthX: 45, children: /* @__PURE__ */ e(
|
20
20
|
z,
|
21
21
|
{
|
22
22
|
studentId: r,
|
23
23
|
courseStream: m,
|
24
|
-
userType: d,
|
24
|
+
userType: d ? "STUDENT" : "TEACHER",
|
25
25
|
onChapterClick: () => null
|
26
26
|
}
|
27
27
|
) }),
|
28
28
|
isActive: !1,
|
29
|
-
type:
|
29
|
+
type: f.TOOLTIP,
|
30
30
|
indicator: {
|
31
|
-
tooltipItem: /* @__PURE__ */
|
32
|
-
/* @__PURE__ */ e(
|
31
|
+
tooltipItem: /* @__PURE__ */ h(s, { $flexRowGapX: 0.75, $justifyContent: "flex-start", children: [
|
32
|
+
/* @__PURE__ */ e(C, { $renderAs: "ab2-bold", children: "Access all your recent chapters in one place." }),
|
33
33
|
/* @__PURE__ */ e(
|
34
|
-
|
34
|
+
u,
|
35
35
|
{
|
36
36
|
label: "Got it",
|
37
37
|
size: "xsmall",
|
38
38
|
widthX: 6,
|
39
39
|
renderAs: "secondary",
|
40
|
-
onClick: () =>
|
40
|
+
onClick: () => w(O.HOMEPAGE_JOURNEY)
|
41
41
|
}
|
42
42
|
)
|
43
43
|
] }),
|
@@ -52,33 +52,33 @@ const re = () => {
|
|
52
52
|
arrowSize: 12,
|
53
53
|
width: 264
|
54
54
|
}
|
55
|
-
}), t(o, !1, 0, !0)) :
|
55
|
+
}), t(o, !1, 0, !0)) : w(o);
|
56
56
|
},
|
57
|
-
[t, o,
|
58
|
-
),
|
59
|
-
({ hwDetails: r, studentId: d, stream: m, userType:
|
60
|
-
const { items:
|
57
|
+
[t, o, E, w]
|
58
|
+
), b = L(
|
59
|
+
({ hwDetails: r, studentId: d, stream: m, userType: T }) => {
|
60
|
+
const { items: k, node_type: X, title: I, subtext: N } = r[0], S = U(k).join(", "), B = X === "DYNAMIC", p = T === "STUDENT";
|
61
61
|
if (!(i != null && i.current) || !(n != null && n.current) || !(l != null && l.current))
|
62
62
|
return;
|
63
63
|
const G = [
|
64
64
|
{
|
65
65
|
originalElementToHighlightRef: i,
|
66
66
|
isActive: !1,
|
67
|
-
type:
|
67
|
+
type: f.TOOLTIP,
|
68
68
|
elementToHighlight: /* @__PURE__ */ e(P, {}),
|
69
69
|
indicator: {
|
70
70
|
position: "left",
|
71
71
|
tooltipXCoOrdinates: 0,
|
72
|
-
tooltipYCoOrdinates: 100,
|
72
|
+
tooltipYCoOrdinates: p ? 100 : 0,
|
73
73
|
backgroundColor: "BLUE_4",
|
74
74
|
borderColor: "BLACK",
|
75
75
|
arrowColor: "BLACK",
|
76
76
|
arrowSize: 12,
|
77
77
|
width: 264,
|
78
|
-
tooltipItem: /* @__PURE__ */
|
79
|
-
/* @__PURE__ */ e(
|
78
|
+
tooltipItem: /* @__PURE__ */ h(s, { $flexRowGapX: 0.75, children: [
|
79
|
+
/* @__PURE__ */ e(C, { $renderAs: "ab2-bold", children: p ? "Welcome to the all new learning homepage." : "Welcome to the all new tutoring homepage." }),
|
80
80
|
/* @__PURE__ */ e(
|
81
|
-
|
81
|
+
u,
|
82
82
|
{
|
83
83
|
label: "Next",
|
84
84
|
size: "xsmall",
|
@@ -92,8 +92,8 @@ const re = () => {
|
|
92
92
|
},
|
93
93
|
{
|
94
94
|
originalElementToHighlightRef: n,
|
95
|
-
elementToHighlight: /* @__PURE__ */ e(
|
96
|
-
type:
|
95
|
+
elementToHighlight: /* @__PURE__ */ e(H, { children: /* @__PURE__ */ e(J, { userType: T, studentId: d, stream: m }) }),
|
96
|
+
type: f.TOOLTIP,
|
97
97
|
indicator: {
|
98
98
|
position: "top",
|
99
99
|
tooltipXCoOrdinates: -197,
|
@@ -104,10 +104,10 @@ const re = () => {
|
|
104
104
|
arrowColor: "BLACK",
|
105
105
|
width: 264,
|
106
106
|
arrowSize: 12,
|
107
|
-
tooltipItem: /* @__PURE__ */
|
108
|
-
/* @__PURE__ */ e(
|
107
|
+
tooltipItem: /* @__PURE__ */ h(s, { $flexRowGapX: 0.75, children: [
|
108
|
+
/* @__PURE__ */ e(C, { $renderAs: "ab2-bold", children: p ? "Homework is now easy to access and easy to complete!" : "Homework is now easy to access and easy to review!" }),
|
109
109
|
/* @__PURE__ */ e(
|
110
|
-
|
110
|
+
u,
|
111
111
|
{
|
112
112
|
label: "Next",
|
113
113
|
size: "xsmall",
|
@@ -122,19 +122,19 @@ const re = () => {
|
|
122
122
|
},
|
123
123
|
{
|
124
124
|
originalElementToHighlightRef: l,
|
125
|
-
elementToHighlight: /* @__PURE__ */ e(
|
126
|
-
|
125
|
+
elementToHighlight: /* @__PURE__ */ e(H, { children: /* @__PURE__ */ e(
|
126
|
+
$,
|
127
127
|
{
|
128
128
|
isInQueue: !1,
|
129
|
-
userType:
|
130
|
-
header:
|
131
|
-
subHeader:
|
129
|
+
userType: T,
|
130
|
+
header: B ? S : I,
|
131
|
+
subHeader: N || "",
|
132
132
|
nodeData: r[0],
|
133
133
|
renderAs: "homework",
|
134
134
|
shouldOpenOnRight: !1
|
135
135
|
}
|
136
136
|
) }),
|
137
|
-
type:
|
137
|
+
type: f.TOOLTIP,
|
138
138
|
indicator: {
|
139
139
|
position: "top",
|
140
140
|
tooltipXCoOrdinates: -35,
|
@@ -145,16 +145,16 @@ const re = () => {
|
|
145
145
|
arrowXCoOrdinates: -97,
|
146
146
|
arrowSize: 12,
|
147
147
|
width: 264,
|
148
|
-
tooltipItem: /* @__PURE__ */
|
149
|
-
/* @__PURE__ */ e(
|
148
|
+
tooltipItem: /* @__PURE__ */ h(s, { $flexRowGapX: 0.75, children: [
|
149
|
+
/* @__PURE__ */ e(C, { $renderAs: "ab2-bold", children: "Track homework status and their due dates." }),
|
150
150
|
/* @__PURE__ */ e(
|
151
|
-
|
151
|
+
u,
|
152
152
|
{
|
153
153
|
label: c.current ? "Next" : "Got it",
|
154
154
|
size: "xsmall",
|
155
155
|
widthX: 6,
|
156
156
|
renderAs: "secondary",
|
157
|
-
onClick: () =>
|
157
|
+
onClick: () => y(d, p, m)
|
158
158
|
}
|
159
159
|
)
|
160
160
|
] })
|
@@ -163,27 +163,27 @@ const re = () => {
|
|
163
163
|
}
|
164
164
|
];
|
165
165
|
A(o, G);
|
166
|
-
const
|
167
|
-
clearTimeout(
|
166
|
+
const x = setTimeout(() => {
|
167
|
+
clearTimeout(x), t(o);
|
168
168
|
}, 200);
|
169
|
-
|
169
|
+
g.current.push(x);
|
170
170
|
},
|
171
|
-
[A, o, t,
|
172
|
-
), R =
|
171
|
+
[A, o, t, y]
|
172
|
+
), R = Y(
|
173
173
|
() => ({
|
174
174
|
homepageRef: i,
|
175
175
|
homeworkRef: n,
|
176
176
|
individualHomeworkRef: l,
|
177
177
|
recentChaptersRef: c,
|
178
|
-
startJourney:
|
178
|
+
startJourney: b
|
179
179
|
}),
|
180
|
-
[
|
180
|
+
[b]
|
181
181
|
);
|
182
|
-
return
|
183
|
-
|
182
|
+
return _(() => () => {
|
183
|
+
g.current.forEach((r) => clearTimeout(r)), g.current = [];
|
184
184
|
}, []), R;
|
185
185
|
};
|
186
186
|
export {
|
187
|
-
|
187
|
+
ie as useHomePageJourney
|
188
188
|
};
|
189
189
|
//# sourceMappingURL=use-home-page-journey.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"use-home-page-journey.js","sources":["../../../../src/features/journey/hooks/use-home-page-journey.tsx"],"sourcesContent":["import type { IHomeworkData } from '../../homework/hw-card-list/api/get-homeworks';\nimport type { TCourseStream } from '../../milestone/create/milestone-create-types';\nimport type { IArrowTooltipProps } from '../../ui/arrow-tooltip/arrow-tooltip-types';\nimport type { TUserTypes } from '../../ui/types';\nimport type { IHomepageStartJourneyProps } from '../types/homepage-journey-types';\nimport type { ICoachmarkProps } from '../use-journey/journey-context-types';\n\nimport { useCallback, useEffect, useMemo, useRef } from 'react';\n\nimport HomeworkCard from '../../homework/homework-card';\nimport HWCardList from '../../homework/hw-card-list/hw-card-list';\nimport { getTopicsFromItems } from '../../milestone/milestone-tests/tests-list/test-sheets-list/test-sheet-item/test-sheet-item-utils';\nimport RecentChapters from '../../recent-chapters/recent-chapters';\nimport Button from '../../ui/buttons/button/button';\nimport FlexView from '../../ui/layout/flex-view';\nimport Text from '../../ui/text/text';\nimport { ELementWrapper } from '../comps/coachmark/coachmark-styled';\nimport { JOURNEY_ID_STUDENT } from '../journey-id/journey-id-student';\nimport { IndicatorType } from '../use-journey/constants';\nimport { useJourney } from '../use-journey/use-journey';\n\nexport const useHomePageJourney = () => {\n const journeyId = JOURNEY_ID_STUDENT.HOMEPAGE_JOURNEY;\n\n const homepageRef = useRef<HTMLDivElement>(null);\n const homeworkRef = useRef<HTMLDivElement>(null);\n const individualHomeworkRef = useRef<HTMLDivElement>(null);\n const recentChaptersRef = useRef<HTMLDivElement>(null);\n const timerRefs = useRef<ReturnType<typeof setTimeout>[]>([]);\n const { nextCoachmark, setJourney, endJourney, addCoachmark } = useJourney();\n\n const handleLastStep = useCallback(\n (userId: string, userType: TUserTypes, courseValue: string) => {\n if (recentChaptersRef.current) {\n addCoachmark(JOURNEY_ID_STUDENT.HOMEPAGE_JOURNEY, {\n originalElementToHighlightRef: recentChaptersRef,\n elementToHighlight: (\n <FlexView $widthX={45}>\n <RecentChapters\n studentId={userId}\n courseStream={courseValue as TCourseStream}\n userType={userType}\n onChapterClick={() => null}\n />\n </FlexView>\n ),\n isActive: false,\n type: IndicatorType.TOOLTIP,\n indicator: {\n tooltipItem: (\n <FlexView $flexRowGapX={0.75} $justifyContent=\"flex-start\">\n <Text $renderAs=\"ab2-bold\">Access all your recent chapters in one place.</Text>\n <Button\n label=\"Got it\"\n size=\"xsmall\"\n widthX={6}\n renderAs=\"secondary\"\n onClick={() => endJourney(JOURNEY_ID_STUDENT.HOMEPAGE_JOURNEY)}\n />\n </FlexView>\n ),\n position: 'top',\n renderAs: 'primary',\n tooltipXCoOrdinates: -227,\n tooltipYCoOrdinates: 12,\n arrowXCoOrdinates: -110,\n backgroundColor: 'YELLOW_4',\n borderColor: 'BLACK',\n arrowColor: 'BLACK',\n arrowSize: 12,\n width: 264,\n } as IArrowTooltipProps,\n });\n nextCoachmark(journeyId, false, 0, true);\n } else {\n endJourney(journeyId);\n }\n },\n [nextCoachmark, journeyId, addCoachmark, endJourney],\n );\n\n const startJourney = useCallback(\n ({ hwDetails, studentId, stream, userType }: IHomepageStartJourneyProps) => {\n const { items, node_type: nodeType, title, subtext } = hwDetails[0] as IHomeworkData;\n const topics = getTopicsFromItems(items);\n const testChapterName = topics.join(', ');\n const isDynamicSheet = nodeType === 'DYNAMIC';\n\n if (!homepageRef?.current || !homeworkRef?.current || !individualHomeworkRef?.current) {\n return;\n }\n\n const homepageSteps: ICoachmarkProps[] = [\n {\n originalElementToHighlightRef: homepageRef,\n isActive: false,\n type: IndicatorType.TOOLTIP,\n elementToHighlight: <></>,\n indicator: {\n position: 'left',\n tooltipXCoOrdinates: 0,\n tooltipYCoOrdinates: 100,\n backgroundColor: 'BLUE_4',\n borderColor: 'BLACK',\n arrowColor: 'BLACK',\n arrowSize: 12,\n width: 264,\n tooltipItem: (\n <FlexView $flexRowGapX={0.75}>\n <Text $renderAs=\"ab2-bold\">Welcome to the all new tutoring homepage.</Text>\n <Button\n label=\"Next\"\n size=\"xsmall\"\n widthX={6}\n renderAs=\"secondary\"\n onClick={() => nextCoachmark(journeyId, false, 0, true)}\n />\n </FlexView>\n ),\n } as IArrowTooltipProps,\n },\n {\n originalElementToHighlightRef: homeworkRef,\n elementToHighlight: (\n <ELementWrapper>\n <HWCardList userType={userType} studentId={studentId} stream={stream} />\n </ELementWrapper>\n ),\n type: IndicatorType.TOOLTIP,\n indicator: {\n position: 'top',\n tooltipXCoOrdinates: -197,\n tooltipYCoOrdinates: -12,\n arrowXCoOrdinates: -110,\n backgroundColor: 'GREEN_4',\n borderColor: 'BLACK',\n arrowColor: 'BLACK',\n width: 264,\n arrowSize: 12,\n tooltipItem: (\n <FlexView $flexRowGapX={0.75}>\n <Text $renderAs=\"ab2-bold\">\n Homework is now easy to access and easy to complete!\n </Text>\n <Button\n label=\"Next\"\n size=\"xsmall\"\n widthX={6}\n renderAs=\"secondary\"\n onClick={() => nextCoachmark(journeyId, false, 0, true)}\n />\n </FlexView>\n ),\n } as IArrowTooltipProps,\n isActive: false,\n },\n {\n originalElementToHighlightRef: individualHomeworkRef,\n elementToHighlight: (\n <ELementWrapper>\n <HomeworkCard\n isInQueue={false}\n userType={userType}\n header={isDynamicSheet ? testChapterName : title}\n subHeader={subtext || ''}\n nodeData={hwDetails[0] as IHomeworkData}\n renderAs=\"homework\"\n shouldOpenOnRight={false}\n />\n </ELementWrapper>\n ),\n type: IndicatorType.TOOLTIP,\n indicator: {\n position: 'top',\n tooltipXCoOrdinates: -35,\n tooltipYCoOrdinates: -7,\n backgroundColor: 'PURPLE_4',\n borderColor: 'BLACK',\n arrowColor: 'BLACK',\n arrowXCoOrdinates: -97,\n arrowSize: 12,\n width: 264,\n tooltipItem: (\n <FlexView $flexRowGapX={0.75}>\n <Text $renderAs=\"ab2-bold\">Track homework status and their due dates.</Text>\n <Button\n label={recentChaptersRef.current ? 'Next' : 'Got it'}\n size=\"xsmall\"\n widthX={6}\n renderAs=\"secondary\"\n onClick={() => handleLastStep(studentId, userType, stream)}\n />\n </FlexView>\n ),\n } as IArrowTooltipProps,\n isActive: false,\n },\n ];\n\n setJourney(journeyId, homepageSteps);\n\n const delayBeforeStart = setTimeout(() => {\n clearTimeout(delayBeforeStart);\n nextCoachmark(journeyId);\n }, 200);\n\n timerRefs.current.push(delayBeforeStart); // Store to cleanup later\n },\n [setJourney, journeyId, nextCoachmark, handleLastStep],\n );\n\n const data = useMemo(\n () => ({\n homepageRef,\n homeworkRef,\n individualHomeworkRef,\n recentChaptersRef,\n startJourney,\n }),\n [startJourney],\n );\n\n // Cleanup on unmount\n useEffect(() => {\n return () => {\n timerRefs.current.forEach(timer => clearTimeout(timer));\n timerRefs.current = [];\n };\n }, []);\n\n return data;\n};\n"],"names":["useHomePageJourney","journeyId","JOURNEY_ID_STUDENT","homepageRef","useRef","homeworkRef","individualHomeworkRef","recentChaptersRef","timerRefs","nextCoachmark","setJourney","endJourney","addCoachmark","useJourney","handleLastStep","useCallback","userId","userType","courseValue","jsx","FlexView","RecentChapters","IndicatorType","jsxs","Text","Button","startJourney","hwDetails","studentId","stream","items","nodeType","title","subtext","testChapterName","getTopicsFromItems","isDynamicSheet","homepageSteps","Fragment","ELementWrapper","HWCardList","HomeworkCard","delayBeforeStart","data","useMemo","useEffect","timer"],"mappings":";;;;;;;;;;;;;AAqBO,MAAMA,KAAqB,MAAM;AACtC,QAAMC,IAAYC,EAAmB,kBAE/BC,IAAcC,EAAuB,IAAI,GACzCC,IAAcD,EAAuB,IAAI,GACzCE,IAAwBF,EAAuB,IAAI,GACnDG,IAAoBH,EAAuB,IAAI,GAC/CI,IAAYJ,EAAwC,CAAA,CAAE,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BAC5C,MAAK;AAAA,kBACL,QAAQ;AAAA,kBACR,UAAS;AAAA,kBACT,SAAS,MAAMO,EAAec,GAAWX,GAAUY,CAAM;AAAA,gBAAA;AAAA,cAC3D;AAAA,YAAA,GACF;AAAA,UAEJ;AAAA,UACA,UAAU;AAAA,QACZ;AAAA,MAAA;AAGF,MAAAnB,EAAWT,GAAWoC,CAAa;AAE7B,YAAAK,IAAmB,WAAW,MAAM;AACxC,qBAAaA,CAAgB,GAC7BjC,EAAcR,CAAS;AAAA,SACtB,GAAG;AAEI,MAAAO,EAAA,QAAQ,KAAKkC,CAAgB;AAAA,IACzC;AAAA,IACA,CAAChC,GAAYT,GAAWQ,GAAeK,CAAc;AAAA,EAAA,GAGjD6B,IAAOC;AAAA,IACX,OAAO;AAAA,MACL,aAAAzC;AAAA,MACA,aAAAE;AAAA,MACA,uBAAAC;AAAA,MACA,mBAAAC;AAAA,MACA,cAAAmB;AAAA,IAAA;AAAA,IAEF,CAACA,CAAY;AAAA,EAAA;AAIf,SAAAmB,EAAU,MACD,MAAM;AACX,IAAArC,EAAU,QAAQ,QAAQ,CAASsC,MAAA,aAAaA,CAAK,CAAC,GACtDtC,EAAU,UAAU;EAAC,GAEtB,CAAE,CAAA,GAEEmC;AACT;"}
|
1
|
+
{"version":3,"file":"use-home-page-journey.js","sources":["../../../../src/features/journey/hooks/use-home-page-journey.tsx"],"sourcesContent":["import type { IHomeworkData } from '../../homework/hw-card-list/api/get-homeworks';\nimport type { TCourseStream } from '../../milestone/create/milestone-create-types';\nimport type { IArrowTooltipProps } from '../../ui/arrow-tooltip/arrow-tooltip-types';\nimport type { IHomepageStartJourneyProps } from '../types/homepage-journey-types';\nimport type { ICoachmarkProps } from '../use-journey/journey-context-types';\n\nimport { useCallback, useEffect, useMemo, useRef } from 'react';\n\nimport HomeworkCard from '../../homework/homework-card';\nimport HWCardList from '../../homework/hw-card-list/hw-card-list';\nimport { getTopicsFromItems } from '../../milestone/milestone-tests/tests-list/test-sheets-list/test-sheet-item/test-sheet-item-utils';\nimport RecentChapters from '../../recent-chapters/recent-chapters';\nimport Button from '../../ui/buttons/button/button';\nimport FlexView from '../../ui/layout/flex-view';\nimport Text from '../../ui/text/text';\nimport { ELementWrapper } from '../comps/coachmark/coachmark-styled';\nimport { JOURNEY_ID_STUDENT } from '../journey-id/journey-id-student';\nimport { IndicatorType } from '../use-journey/constants';\nimport { useJourney } from '../use-journey/use-journey';\n\nexport const useHomePageJourney = () => {\n const journeyId = JOURNEY_ID_STUDENT.HOMEPAGE_JOURNEY;\n\n const homepageRef = useRef<HTMLDivElement>(null);\n const homeworkRef = useRef<HTMLDivElement>(null);\n const individualHomeworkRef = useRef<HTMLDivElement>(null);\n const recentChaptersRef = useRef<HTMLDivElement>(null);\n const timerRefs = useRef<ReturnType<typeof setTimeout>[]>([]);\n const { nextCoachmark, setJourney, endJourney, addCoachmark } = useJourney();\n\n const handleLastStep = useCallback(\n (userId: string, isStudent: boolean, courseValue: string) => {\n if (recentChaptersRef.current) {\n addCoachmark(JOURNEY_ID_STUDENT.HOMEPAGE_JOURNEY, {\n originalElementToHighlightRef: recentChaptersRef,\n elementToHighlight: (\n <FlexView $widthX={45}>\n <RecentChapters\n studentId={userId}\n courseStream={courseValue as TCourseStream}\n userType={isStudent ? 'STUDENT' : 'TEACHER'}\n onChapterClick={() => null}\n />\n </FlexView>\n ),\n isActive: false,\n type: IndicatorType.TOOLTIP,\n indicator: {\n tooltipItem: (\n <FlexView $flexRowGapX={0.75} $justifyContent=\"flex-start\">\n <Text $renderAs=\"ab2-bold\">Access all your recent chapters in one place.</Text>\n <Button\n label=\"Got it\"\n size=\"xsmall\"\n widthX={6}\n renderAs=\"secondary\"\n onClick={() => endJourney(JOURNEY_ID_STUDENT.HOMEPAGE_JOURNEY)}\n />\n </FlexView>\n ),\n position: 'top',\n renderAs: 'primary',\n tooltipXCoOrdinates: -227,\n tooltipYCoOrdinates: 12,\n arrowXCoOrdinates: -110,\n backgroundColor: 'YELLOW_4',\n borderColor: 'BLACK',\n arrowColor: 'BLACK',\n arrowSize: 12,\n width: 264,\n } as IArrowTooltipProps,\n });\n nextCoachmark(journeyId, false, 0, true);\n } else {\n endJourney(journeyId);\n }\n },\n [nextCoachmark, journeyId, addCoachmark, endJourney],\n );\n\n const startJourney = useCallback(\n ({ hwDetails, studentId, stream, userType }: IHomepageStartJourneyProps) => {\n const { items, node_type: nodeType, title, subtext } = hwDetails[0] as IHomeworkData;\n const topics = getTopicsFromItems(items);\n const testChapterName = topics.join(', ');\n const isDynamicSheet = nodeType === 'DYNAMIC';\n const isStudent = userType === 'STUDENT';\n\n if (!homepageRef?.current || !homeworkRef?.current || !individualHomeworkRef?.current) {\n return;\n }\n\n const homepageSteps: ICoachmarkProps[] = [\n {\n originalElementToHighlightRef: homepageRef,\n isActive: false,\n type: IndicatorType.TOOLTIP,\n elementToHighlight: <></>,\n indicator: {\n position: 'left',\n tooltipXCoOrdinates: 0,\n tooltipYCoOrdinates: isStudent ? 100 : 0,\n backgroundColor: 'BLUE_4',\n borderColor: 'BLACK',\n arrowColor: 'BLACK',\n arrowSize: 12,\n width: 264,\n tooltipItem: (\n <FlexView $flexRowGapX={0.75}>\n <Text $renderAs=\"ab2-bold\">\n {isStudent\n ? 'Welcome to the all new learning homepage.'\n : 'Welcome to the all new tutoring homepage.'}\n </Text>\n <Button\n label=\"Next\"\n size=\"xsmall\"\n widthX={6}\n renderAs=\"secondary\"\n onClick={() => nextCoachmark(journeyId, false, 0, true)}\n />\n </FlexView>\n ),\n } as IArrowTooltipProps,\n },\n {\n originalElementToHighlightRef: homeworkRef,\n elementToHighlight: (\n <ELementWrapper>\n <HWCardList userType={userType} studentId={studentId} stream={stream} />\n </ELementWrapper>\n ),\n type: IndicatorType.TOOLTIP,\n indicator: {\n position: 'top',\n tooltipXCoOrdinates: -197,\n tooltipYCoOrdinates: -12,\n arrowXCoOrdinates: -110,\n backgroundColor: 'GREEN_4',\n borderColor: 'BLACK',\n arrowColor: 'BLACK',\n width: 264,\n arrowSize: 12,\n tooltipItem: (\n <FlexView $flexRowGapX={0.75}>\n <Text $renderAs=\"ab2-bold\">\n {isStudent\n ? 'Homework is now easy to access and easy to complete!'\n : 'Homework is now easy to access and easy to review!'}\n </Text>\n <Button\n label=\"Next\"\n size=\"xsmall\"\n widthX={6}\n renderAs=\"secondary\"\n onClick={() => nextCoachmark(journeyId, false, 0, true)}\n />\n </FlexView>\n ),\n } as IArrowTooltipProps,\n isActive: false,\n },\n {\n originalElementToHighlightRef: individualHomeworkRef,\n elementToHighlight: (\n <ELementWrapper>\n <HomeworkCard\n isInQueue={false}\n userType={userType}\n header={isDynamicSheet ? testChapterName : title}\n subHeader={subtext || ''}\n nodeData={hwDetails[0] as IHomeworkData}\n renderAs=\"homework\"\n shouldOpenOnRight={false}\n />\n </ELementWrapper>\n ),\n type: IndicatorType.TOOLTIP,\n indicator: {\n position: 'top',\n tooltipXCoOrdinates: -35,\n tooltipYCoOrdinates: -7,\n backgroundColor: 'PURPLE_4',\n borderColor: 'BLACK',\n arrowColor: 'BLACK',\n arrowXCoOrdinates: -97,\n arrowSize: 12,\n width: 264,\n tooltipItem: (\n <FlexView $flexRowGapX={0.75}>\n <Text $renderAs=\"ab2-bold\">Track homework status and their due dates.</Text>\n <Button\n label={recentChaptersRef.current ? 'Next' : 'Got it'}\n size=\"xsmall\"\n widthX={6}\n renderAs=\"secondary\"\n onClick={() => handleLastStep(studentId, isStudent, stream)}\n />\n </FlexView>\n ),\n } as IArrowTooltipProps,\n isActive: false,\n },\n ];\n\n setJourney(journeyId, homepageSteps);\n\n const delayBeforeStart = setTimeout(() => {\n clearTimeout(delayBeforeStart);\n nextCoachmark(journeyId);\n }, 200);\n\n timerRefs.current.push(delayBeforeStart); // Store to cleanup later\n },\n [setJourney, journeyId, nextCoachmark, handleLastStep],\n );\n\n const data = useMemo(\n () => ({\n homepageRef,\n homeworkRef,\n individualHomeworkRef,\n recentChaptersRef,\n startJourney,\n }),\n [startJourney],\n );\n\n // Cleanup on unmount\n useEffect(() => {\n return () => {\n timerRefs.current.forEach(timer => clearTimeout(timer));\n timerRefs.current = [];\n };\n }, []);\n\n return data;\n};\n"],"names":["useHomePageJourney","journeyId","JOURNEY_ID_STUDENT","homepageRef","useRef","homeworkRef","individualHomeworkRef","recentChaptersRef","timerRefs","nextCoachmark","setJourney","endJourney","addCoachmark","useJourney","handleLastStep","useCallback","userId","isStudent","courseValue","jsx","FlexView","RecentChapters","IndicatorType","jsxs","Text","Button","startJourney","hwDetails","studentId","stream","userType","items","nodeType","title","subtext","testChapterName","getTopicsFromItems","isDynamicSheet","homepageSteps","Fragment","ELementWrapper","HWCardList","HomeworkCard","delayBeforeStart","data","useMemo","useEffect","timer"],"mappings":";;;;;;;;;;;;;AAoBO,MAAMA,KAAqB,MAAM;AACtC,QAAMC,IAAYC,EAAmB,kBAE/BC,IAAcC,EAAuB,IAAI,GACzCC,IAAcD,EAAuB,IAAI,GACzCE,IAAwBF,EAAuB,IAAI,GACnDG,IAAoBH,EAAuB,IAAI,GAC/CI,IAAYJ,EAAwC,CAAA,CAAE,GACtD,EAAE,eAAAK,GAAe,YAAAC,GAAY,YAAAC,GAAY,cAAAC,EAAA,IAAiBC,KAE1DC,IAAiBC;AAAA,IACrB,CAACC,GAAgBC,GAAoBC,MAAwB;AAC3D,MAAIX,EAAkB,WACpBK,EAAaV,EAAmB,kBAAkB;AAAA,QAChD,+BAA+BK;AAAA,QAC/B,oBACE,gBAAAY,EAACC,GAAS,EAAA,SAAS,IACjB,UAAA,gBAAAD;AAAA,UAACE;AAAA,UAAA;AAAA,YACC,WAAWL;AAAA,YACX,cAAcE;AAAA,YACd,UAAUD,IAAY,YAAY;AAAA,YAClC,gBAAgB,MAAM;AAAA,UAAA;AAAA,QAAA,GAE1B;AAAA,QAEF,UAAU;AAAA,QACV,MAAMK,EAAc;AAAA,QACpB,WAAW;AAAA,UACT,aACG,gBAAAC,EAAAH,GAAA,EAAS,cAAc,MAAM,iBAAgB,cAC5C,UA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AAAA,MACA,aAAAE;AAAA,MACA,uBAAAC;AAAA,MACA,mBAAAC;AAAA,MACA,cAAAmB;AAAA,IAAA;AAAA,IAEF,CAACA,CAAY;AAAA,EAAA;AAIf,SAAAoB,EAAU,MACD,MAAM;AACX,IAAAtC,EAAU,QAAQ,QAAQ,CAASuC,MAAA,aAAaA,CAAK,CAAC,GACtDvC,EAAU,UAAU;EAAC,GAEtB,CAAE,CAAA,GAEEoC;AACT;"}
|
package/dist/index.d.ts
CHANGED
@@ -507,6 +507,7 @@ declare interface HWCardListProps extends INodeCardCallbacks {
|
|
507
507
|
homeworkRef?: React_2.RefObject<HTMLDivElement>;
|
508
508
|
individualHomeworkRef?: React_2.RefObject<HTMLDivElement>;
|
509
509
|
startHomePageJourney?: ({ hwDetails, studentId, stream, userType, }: IHomepageStartJourneyProps) => void;
|
510
|
+
canStartJourney?: boolean;
|
510
511
|
}
|
511
512
|
|
512
513
|
declare interface IAccordionSectionProps {
|