@cuemath/leap 3.5.50 → 3.5.51-as10
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/assets/illustrations/illustrations.js +4 -0
- package/dist/assets/illustrations/illustrations.js.map +1 -1
- package/dist/features/chapters-v2/comps/node-card/node-card-styled.js +27 -31
- package/dist/features/chapters-v2/comps/node-card/node-card-styled.js.map +1 -1
- package/dist/features/chapters-v2/comps/node-card/node-card-tags.js +21 -13
- package/dist/features/chapters-v2/comps/node-card/node-card-tags.js.map +1 -1
- package/dist/features/chapters-v2/constants/node-constants.js +1 -1
- package/dist/features/chapters-v2/constants/node-constants.js.map +1 -1
- package/dist/features/chapters-v2/utils/node-card-utils.js +86 -79
- package/dist/features/chapters-v2/utils/node-card-utils.js.map +1 -1
- package/dist/features/homework/homework-card-view.js +125 -98
- package/dist/features/homework/homework-card-view.js.map +1 -1
- package/dist/features/homework/homework-card.js +196 -161
- package/dist/features/homework/homework-card.js.map +1 -1
- package/dist/features/homework/hw-card-list/api/get-homeworks.js +1 -1
- package/dist/features/homework/hw-card-list/api/get-homeworks.js.map +1 -1
- package/dist/features/homework/hw-card-list/hw-card-list-types.js +5 -0
- package/dist/features/homework/hw-card-list/hw-card-list-types.js.map +1 -0
- package/dist/features/homework/hw-card-list/hw-card-list-view.js +96 -86
- package/dist/features/homework/hw-card-list/hw-card-list-view.js.map +1 -1
- package/dist/features/homework/hw-card-list/hw-card-list.js +45 -43
- package/dist/features/homework/hw-card-list/hw-card-list.js.map +1 -1
- package/dist/features/homework/styles.js +0 -1
- package/dist/features/homework/styles.js.map +1 -1
- package/dist/features/homework/utils.js +18 -15
- package/dist/features/homework/utils.js.map +1 -1
- package/dist/features/journey/hooks/use-home-page-journey/home-page-homeworks-mock.js +325 -201
- package/dist/features/journey/hooks/use-home-page-journey/home-page-homeworks-mock.js.map +1 -1
- package/dist/features/journey/hooks/use-home-page-journey/use-home-page-journey.js +59 -56
- package/dist/features/journey/hooks/use-home-page-journey/use-home-page-journey.js.map +1 -1
- package/dist/features/journey/hooks/use-puzzles-journey/use-puzzle-assigned.js +17 -15
- package/dist/features/journey/hooks/use-puzzles-journey/use-puzzle-assigned.js.map +1 -1
- package/dist/features/math-fit/api/get-mathfit-assessment.js +10 -0
- package/dist/features/math-fit/api/get-mathfit-assessment.js.map +1 -0
- package/dist/features/math-fit/math-fit/math-fit.js +37 -0
- package/dist/features/math-fit/math-fit/math-fit.js.map +1 -0
- package/dist/features/math-fit/math-fit-card/math-fit-card-styled.js +22 -0
- package/dist/features/math-fit/math-fit-card/math-fit-card-styled.js.map +1 -0
- package/dist/features/math-fit/math-fit-card/math-fit-card.js +80 -0
- package/dist/features/math-fit/math-fit-card/math-fit-card.js.map +1 -0
- package/dist/features/math-fit/math-fit-overview/comps/section-card/section-card-styled.js +24 -0
- package/dist/features/math-fit/math-fit-overview/comps/section-card/section-card-styled.js.map +1 -0
- package/dist/features/math-fit/math-fit-overview/comps/section-card/section-card-types.js +5 -0
- package/dist/features/math-fit/math-fit-overview/comps/section-card/section-card-types.js.map +1 -0
- package/dist/features/math-fit/math-fit-overview/comps/section-card/section-card.js +99 -0
- package/dist/features/math-fit/math-fit-overview/comps/section-card/section-card.js.map +1 -0
- package/dist/features/math-fit/math-fit-overview/comps/stat-item/stat-item-styled.js +9 -0
- package/dist/features/math-fit/math-fit-overview/comps/stat-item/stat-item-styled.js.map +1 -0
- package/dist/features/math-fit/math-fit-overview/comps/stat-item/stat-item.js +26 -0
- package/dist/features/math-fit/math-fit-overview/comps/stat-item/stat-item.js.map +1 -0
- package/dist/features/math-fit/math-fit-overview/math-fit-overview-helpers.js +63 -0
- package/dist/features/math-fit/math-fit-overview/math-fit-overview-helpers.js.map +1 -0
- package/dist/features/math-fit/math-fit-overview/math-fit-overview-styled.js +9 -0
- package/dist/features/math-fit/math-fit-overview/math-fit-overview-styled.js.map +1 -0
- package/dist/features/math-fit/math-fit-overview/math-fit-overview-types.js +7 -0
- package/dist/features/math-fit/math-fit-overview/math-fit-overview-types.js.map +1 -0
- package/dist/features/math-fit/math-fit-overview/math-fit-overview.js +71 -0
- package/dist/features/math-fit/math-fit-overview/math-fit-overview.js.map +1 -0
- package/dist/features/math-fit/math-fit-report/comps/report-header/report-header-styled.js +38 -0
- package/dist/features/math-fit/math-fit-report/comps/report-header/report-header-styled.js.map +1 -0
- package/dist/features/math-fit/math-fit-report/comps/report-header/report-header.js +58 -0
- package/dist/features/math-fit/math-fit-report/comps/report-header/report-header.js.map +1 -0
- package/dist/features/math-fit/math-fit-report/comps/score-badge/score-badge-styled.js +28 -0
- package/dist/features/math-fit/math-fit-report/comps/score-badge/score-badge-styled.js.map +1 -0
- package/dist/features/math-fit/math-fit-report/comps/score-badge/score-badge.js +30 -0
- package/dist/features/math-fit/math-fit-report/comps/score-badge/score-badge.js.map +1 -0
- package/dist/features/math-fit/math-fit-report/comps/score-section/score-section-styled.js +9 -0
- package/dist/features/math-fit/math-fit-report/comps/score-section/score-section-styled.js.map +1 -0
- package/dist/features/math-fit/math-fit-report/comps/score-section/score-section.js +82 -0
- package/dist/features/math-fit/math-fit-report/comps/score-section/score-section.js.map +1 -0
- package/dist/features/math-fit/math-fit-report/math-fit-report-helpers.js +42 -0
- package/dist/features/math-fit/math-fit-report/math-fit-report-helpers.js.map +1 -0
- package/dist/features/math-fit/math-fit-report/math-fit-report.js +68 -0
- package/dist/features/math-fit/math-fit-report/math-fit-report.js.map +1 -0
- package/dist/features/milestone/milestone-list-container/api/get-tests-list.js +1 -1
- package/dist/features/milestone/milestone-list-container/api/get-tests-list.js.map +1 -1
- package/dist/features/milestone/milestone-list-container/milestone-list/milestone-list.js +38 -36
- package/dist/features/milestone/milestone-list-container/milestone-list/milestone-list.js.map +1 -1
- package/dist/features/milestone/milestone-list-container/milestone-list/milestone-widget/milestone-tabs/milestone-tabs.js +57 -55
- package/dist/features/milestone/milestone-list-container/milestone-list/milestone-widget/milestone-tabs/milestone-tabs.js.map +1 -1
- package/dist/features/milestone/milestone-list-container/milestone-list/milestone-widget/milestone-widget.js +59 -57
- package/dist/features/milestone/milestone-list-container/milestone-list/milestone-widget/milestone-widget.js.map +1 -1
- package/dist/features/milestone/milestone-list-container/milestone-list-container.js +54 -52
- package/dist/features/milestone/milestone-list-container/milestone-list-container.js.map +1 -1
- package/dist/features/milestone/milestone-tests/test-list-v2/test-list-container.js +39 -37
- package/dist/features/milestone/milestone-tests/test-list-v2/test-list-container.js.map +1 -1
- package/dist/features/milestone/milestone-tests/test-list-v2/test-list-view.js +48 -56
- package/dist/features/milestone/milestone-tests/test-list-v2/test-list-view.js.map +1 -1
- package/dist/features/sheet-v2/resource-list/resource-list.js +27 -23
- package/dist/features/sheet-v2/resource-list/resource-list.js.map +1 -1
- package/dist/index.d.ts +132 -7
- package/dist/index.js +131 -121
- package/dist/index.js.map +1 -1
- package/dist/static/clock-green.020570d3.svg +1 -0
- package/dist/static/math-fit-bg.4bfa3244.svg +1 -0
- package/dist/static/math-fit-card-bg.20c826bb.svg +1 -0
- package/dist/static/question-mark-blue.b6a7f37d.svg +1 -0
- package/package.json +1 -1
|
@@ -1,32 +1,32 @@
|
|
|
1
1
|
import { jsxs as d, jsx as o } from "react/jsx-runtime";
|
|
2
|
-
import { useRef as c, useCallback as m, useMemo as
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
2
|
+
import { useRef as c, useCallback as m, useMemo as U, useEffect as J } from "react";
|
|
3
|
+
import y from "../../../chapters/chapters-list/chapter-item/chapter-item.js";
|
|
4
|
+
import G from "../../../homework/homework-card.js";
|
|
5
|
+
import H from "../../../homework/hw-card-list/hw-card-list-view.js";
|
|
6
|
+
import M from "../../../milestone/milestone-list-container/milestone-list-container.js";
|
|
7
7
|
import T from "../../../ui/layout/flex-view.js";
|
|
8
|
-
import
|
|
9
|
-
import { JOURNEY_ID_STUDENT as
|
|
8
|
+
import S from "../../../ui/text/text.js";
|
|
9
|
+
import { JOURNEY_ID_STUDENT as W } from "../../journey-id/journey-id-student.js";
|
|
10
10
|
import { IndicatorType as p } from "../../use-journey/constants.js";
|
|
11
|
-
import { useJourney as
|
|
12
|
-
import { HOMEWORK_DETAILS as
|
|
13
|
-
import { RECENT_CHAPTERS as
|
|
14
|
-
import { ChaptersWrapper as
|
|
11
|
+
import { useJourney as Y } from "../../use-journey/use-journey.js";
|
|
12
|
+
import { HOMEWORK_DETAILS as h } from "./home-page-homeworks-mock.js";
|
|
13
|
+
import { RECENT_CHAPTERS as C } from "./recent-chapters-mock.js";
|
|
14
|
+
import { ChaptersWrapper as B, ELementWrapper as f } from "./styles.js";
|
|
15
15
|
import u from "./tooltip-item.js";
|
|
16
|
-
const
|
|
17
|
-
const
|
|
18
|
-
b(
|
|
19
|
-
}, [b,
|
|
20
|
-
E(
|
|
21
|
-
}, [E,
|
|
22
|
-
({ studentId: a, stream:
|
|
23
|
-
var A, x;
|
|
24
|
-
const { title:
|
|
25
|
-
if (!(
|
|
16
|
+
const se = () => {
|
|
17
|
+
const n = W.HOMEPAGE_JOURNEY, r = c(null), i = c(null), _ = c(null), w = c([]), { nextCoachmark: E, setJourney: O, endJourney: b } = Y(), e = m(() => null, []), N = m(() => {
|
|
18
|
+
b(n), document.body.style.overflow = "unset";
|
|
19
|
+
}, [b, n]), s = m(() => {
|
|
20
|
+
E(n, !1, 0, !0);
|
|
21
|
+
}, [E, n]), R = m(
|
|
22
|
+
({ studentId: a, stream: X, userType: l }) => {
|
|
23
|
+
var A, x, I, P;
|
|
24
|
+
const { title: $ = "", subtext: K = "" } = ((A = h.assigned_homeworks[0]) == null ? void 0 : A.sheets[0]) || {}, L = l === "STUDENT";
|
|
25
|
+
if (!(r != null && r.current) || !(i != null && i.current))
|
|
26
26
|
return;
|
|
27
|
-
const
|
|
27
|
+
const D = [
|
|
28
28
|
{
|
|
29
|
-
originalElementToHighlightRef:
|
|
29
|
+
originalElementToHighlightRef: r,
|
|
30
30
|
type: p.TOOLTIP,
|
|
31
31
|
elementToHighlight: /* @__PURE__ */ d(
|
|
32
32
|
T,
|
|
@@ -38,12 +38,12 @@ const ae = () => {
|
|
|
38
38
|
$gutterX: 1,
|
|
39
39
|
children: [
|
|
40
40
|
/* @__PURE__ */ o(
|
|
41
|
-
|
|
41
|
+
H,
|
|
42
42
|
{
|
|
43
43
|
userType: l,
|
|
44
44
|
studentId: a,
|
|
45
45
|
isHwProcessing: !1,
|
|
46
|
-
hwDetails:
|
|
46
|
+
hwDetails: h,
|
|
47
47
|
onTestStart: e,
|
|
48
48
|
onNodeAttempt: e,
|
|
49
49
|
onTestPreview: e,
|
|
@@ -53,14 +53,14 @@ const ae = () => {
|
|
|
53
53
|
onNodeUnassign: e
|
|
54
54
|
}
|
|
55
55
|
),
|
|
56
|
-
/* @__PURE__ */ d(T, { $flexRowGapX: 1, ref:
|
|
57
|
-
/* @__PURE__ */ d(
|
|
56
|
+
/* @__PURE__ */ d(T, { $flexRowGapX: 1, ref: _, children: [
|
|
57
|
+
/* @__PURE__ */ d(S, { $renderAs: "ac4-black", $color: "BLACK_T_60", children: [
|
|
58
58
|
"Recent Chapters (",
|
|
59
|
-
(
|
|
59
|
+
(x = C) == null ? void 0 : x.length,
|
|
60
60
|
")"
|
|
61
61
|
] }),
|
|
62
|
-
/* @__PURE__ */ o(
|
|
63
|
-
|
|
62
|
+
/* @__PURE__ */ o(B, { children: C.map((t, g) => /* @__PURE__ */ o(
|
|
63
|
+
y,
|
|
64
64
|
{
|
|
65
65
|
chapter: t,
|
|
66
66
|
onChapterClick: e,
|
|
@@ -70,13 +70,13 @@ const ae = () => {
|
|
|
70
70
|
)) })
|
|
71
71
|
] }),
|
|
72
72
|
/* @__PURE__ */ o(
|
|
73
|
-
|
|
73
|
+
M,
|
|
74
74
|
{
|
|
75
75
|
milestoneType: "ACTIVE",
|
|
76
76
|
activeMilestoneId: "",
|
|
77
77
|
activeTabId: "",
|
|
78
78
|
canCreatePlan: !1,
|
|
79
|
-
courseStream:
|
|
79
|
+
courseStream: X,
|
|
80
80
|
isClassOngoing: !1,
|
|
81
81
|
isStudentPresent: !1,
|
|
82
82
|
parentName: "",
|
|
@@ -118,7 +118,7 @@ const ae = () => {
|
|
|
118
118
|
tooltipItem: /* @__PURE__ */ o(
|
|
119
119
|
u,
|
|
120
120
|
{
|
|
121
|
-
text: `Welcome to the all new ${
|
|
121
|
+
text: `Welcome to the all new ${L ? "learning" : "tutoring"} homepage.`,
|
|
122
122
|
buttonLabel: "Next",
|
|
123
123
|
onButtonClick: s
|
|
124
124
|
}
|
|
@@ -128,12 +128,12 @@ const ae = () => {
|
|
|
128
128
|
{
|
|
129
129
|
originalElementToHighlightRef: i,
|
|
130
130
|
elementToHighlight: /* @__PURE__ */ o(f, { children: /* @__PURE__ */ o(
|
|
131
|
-
|
|
131
|
+
H,
|
|
132
132
|
{
|
|
133
133
|
userType: l,
|
|
134
134
|
studentId: a,
|
|
135
135
|
isHwProcessing: !1,
|
|
136
|
-
hwDetails:
|
|
136
|
+
hwDetails: h,
|
|
137
137
|
onTestStart: e,
|
|
138
138
|
onNodeAttempt: e,
|
|
139
139
|
onTestPreview: e,
|
|
@@ -157,7 +157,7 @@ const ae = () => {
|
|
|
157
157
|
tooltipItem: /* @__PURE__ */ o(
|
|
158
158
|
u,
|
|
159
159
|
{
|
|
160
|
-
text: `Homework is now easy to access and easy to ${
|
|
160
|
+
text: `Homework is now easy to access and easy to ${L ? "complete" : "review"}!`,
|
|
161
161
|
buttonLabel: "Next",
|
|
162
162
|
onButtonClick: s
|
|
163
163
|
}
|
|
@@ -167,16 +167,19 @@ const ae = () => {
|
|
|
167
167
|
{
|
|
168
168
|
originalElementToHighlightRef: i,
|
|
169
169
|
elementToHighlight: /* @__PURE__ */ o(f, { children: /* @__PURE__ */ o(
|
|
170
|
-
|
|
170
|
+
G,
|
|
171
171
|
{
|
|
172
172
|
isInQueue: !1,
|
|
173
173
|
userType: l,
|
|
174
|
-
header:
|
|
175
|
-
subHeader:
|
|
176
|
-
nodeData:
|
|
174
|
+
header: $,
|
|
175
|
+
subHeader: K || "",
|
|
176
|
+
nodeData: (I = h.assigned_homeworks[0]) == null ? void 0 : I.sheets[0],
|
|
177
177
|
renderAs: "homework",
|
|
178
178
|
studentId: a,
|
|
179
|
-
shouldOpenOnRight: !1
|
|
179
|
+
shouldOpenOnRight: !1,
|
|
180
|
+
entityId: "",
|
|
181
|
+
state: "IN_PROGRESS",
|
|
182
|
+
score: null
|
|
180
183
|
}
|
|
181
184
|
) }),
|
|
182
185
|
type: p.TOOLTIP,
|
|
@@ -201,15 +204,15 @@ const ae = () => {
|
|
|
201
204
|
}
|
|
202
205
|
},
|
|
203
206
|
{
|
|
204
|
-
originalElementToHighlightRef:
|
|
207
|
+
originalElementToHighlightRef: r,
|
|
205
208
|
elementToHighlight: /* @__PURE__ */ o(f, { children: /* @__PURE__ */ d(T, { $flexRowGapX: 1, children: [
|
|
206
|
-
/* @__PURE__ */ d(
|
|
209
|
+
/* @__PURE__ */ d(S, { $renderAs: "ac4-black", $color: "BLACK_T_60", children: [
|
|
207
210
|
"Recent Chapters (",
|
|
208
|
-
(
|
|
211
|
+
(P = C) == null ? void 0 : P.length,
|
|
209
212
|
")"
|
|
210
213
|
] }),
|
|
211
|
-
/* @__PURE__ */ o(
|
|
212
|
-
|
|
214
|
+
/* @__PURE__ */ o(B, { children: C.map((t, g) => /* @__PURE__ */ o(
|
|
215
|
+
y,
|
|
213
216
|
{
|
|
214
217
|
chapter: t,
|
|
215
218
|
onChapterClick: e,
|
|
@@ -234,33 +237,33 @@ const ae = () => {
|
|
|
234
237
|
{
|
|
235
238
|
text: "Access all your recent chapters in one place.",
|
|
236
239
|
buttonLabel: "Got it",
|
|
237
|
-
onButtonClick:
|
|
240
|
+
onButtonClick: N
|
|
238
241
|
}
|
|
239
242
|
)
|
|
240
243
|
}
|
|
241
244
|
}
|
|
242
245
|
];
|
|
243
|
-
O(
|
|
246
|
+
O(n, D);
|
|
244
247
|
const k = setTimeout(() => {
|
|
245
248
|
var t;
|
|
246
249
|
clearTimeout(k), l === "STUDENT" ? window.scrollTo(0, 0) : (t = document.getElementById("tab-content-container")) == null || t.scrollTo(0, 0), document.body.style.overflow = "hidden", s();
|
|
247
250
|
}, 200);
|
|
248
251
|
w.current.push(k);
|
|
249
252
|
},
|
|
250
|
-
[
|
|
251
|
-
),
|
|
253
|
+
[N, e, s, n, O]
|
|
254
|
+
), v = U(
|
|
252
255
|
() => ({
|
|
253
|
-
homepageRef:
|
|
256
|
+
homepageRef: r,
|
|
254
257
|
homeworkRef: i,
|
|
255
|
-
startJourney:
|
|
258
|
+
startJourney: R
|
|
256
259
|
}),
|
|
257
|
-
[
|
|
260
|
+
[R]
|
|
258
261
|
);
|
|
259
|
-
return
|
|
262
|
+
return J(() => () => {
|
|
260
263
|
w.current.forEach((a) => clearTimeout(a)), w.current = [];
|
|
261
|
-
}, []),
|
|
264
|
+
}, []), v;
|
|
262
265
|
};
|
|
263
266
|
export {
|
|
264
|
-
|
|
267
|
+
se as useHomePageJourney
|
|
265
268
|
};
|
|
266
269
|
//# 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/use-home-page-journey.tsx"],"sourcesContent":["import { useCallback, useEffect, useMemo, useRef } from 'react';\n\nimport type { INodeDataProps } from '../../../chapters-v2/comps/node-card/node-card-types';\nimport type { IChapterDataProps } from '../../../chapters/chapter/chapter-types';\nimport ChapterItem from '../../../chapters/chapters-list/chapter-item/chapter-item';\nimport HomeworkCard from '../../../homework/homework-card';\nimport HwCardListView from '../../../homework/hw-card-list/hw-card-list-view';\nimport type { TCourseStream } from '../../../milestone/create/milestone-create-types';\nimport MilestoneListContainer from '../../../milestone/milestone-list-container/milestone-list-container';\nimport type { IArrowTooltipProps } from '../../../ui/arrow-tooltip/arrow-tooltip-types';\nimport FlexView from '../../../ui/layout/flex-view';\nimport Text from '../../../ui/text/text';\nimport { JOURNEY_ID_STUDENT } from '../../journey-id/journey-id-student';\nimport { IndicatorType } from '../../use-journey/constants';\nimport type { TCoachmarkJourneyProps } from '../../use-journey/journey-context-types';\nimport { useJourney } from '../../use-journey/use-journey';\nimport { HOMEWORK_DETAILS } from './home-page-homeworks-mock';\nimport type { IHomepageStartJourneyProps } from './homepage-journey-types';\nimport { RECENT_CHAPTERS } from './recent-chapters-mock';\nimport { ChaptersWrapper, ELementWrapper } from './styles';\nimport TooltipItem from './tooltip-item';\n\nexport const useHomePageJourney = () => {\n const journeyId = JOURNEY_ID_STUDENT.HOMEPAGE_JOURNEY;\n\n const homepageRef = useRef<HTMLDivElement>(null) as React.RefObject<HTMLDivElement>;\n const homeworkRef = useRef<HTMLDivElement>(null) as React.RefObject<HTMLDivElement>;\n const recentChaptersRef = useRef<HTMLDivElement>(null);\n const timerRefs = useRef<ReturnType<typeof setTimeout>[]>([]);\n const { nextCoachmark, setJourney, endJourney } = useJourney();\n\n const emptyFunction = useCallback(() => null, []);\n\n const handleEndJourney = useCallback(() => {\n endJourney(journeyId);\n document.body.style.overflow = 'unset';\n }, [endJourney, journeyId]);\n\n const handleNextCoachmark = useCallback(() => {\n nextCoachmark(journeyId, false, 0, true);\n }, [nextCoachmark, journeyId]);\n\n const startJourney = useCallback(\n ({ studentId, stream, userType }: IHomepageStartJourneyProps) => {\n const { title = '', subtext = '' } = HOMEWORK_DETAILS.assigned_homeworks[0] || {};\n const isStudent = userType === 'STUDENT';\n\n if (!homepageRef?.current || !homeworkRef?.current) {\n return;\n }\n\n const homepageSteps: TCoachmarkJourneyProps[] = [\n {\n originalElementToHighlightRef: homepageRef,\n\n type: IndicatorType.TOOLTIP,\n elementToHighlight: (\n <FlexView\n $flexGapX={2.5}\n $marginBottomX={8}\n $background=\"WHITE\"\n $widthX={47}\n $gutterX={1}\n >\n <HwCardListView\n userType={userType}\n studentId={studentId}\n isHwProcessing={false}\n hwDetails={HOMEWORK_DETAILS}\n onTestStart={emptyFunction}\n onNodeAttempt={emptyFunction}\n onTestPreview={emptyFunction}\n onNodeView={emptyFunction}\n onTestReview={emptyFunction}\n onNodeReview={emptyFunction}\n onNodeUnassign={emptyFunction}\n />\n <FlexView $flexRowGapX={1} ref={recentChaptersRef}>\n <Text $renderAs=\"ac4-black\" $color=\"BLACK_T_60\">\n Recent Chapters ({RECENT_CHAPTERS?.length})\n </Text>\n <ChaptersWrapper>\n {RECENT_CHAPTERS.map((chapter, idx) => (\n <ChapterItem\n key={chapter.id}\n chapter={chapter as unknown as IChapterDataProps}\n onChapterClick={emptyFunction}\n itemIndex={idx}\n />\n ))}\n </ChaptersWrapper>\n </FlexView>\n <MilestoneListContainer\n milestoneType=\"ACTIVE\"\n activeMilestoneId={''}\n activeTabId={''}\n canCreatePlan={false}\n courseStream={stream as TCourseStream}\n isClassOngoing={false}\n isStudentPresent={false}\n parentName={''}\n studentId={studentId}\n studentName={''}\n teacherName={''}\n userType={userType}\n //* Callbacks\n onAddChapter={emptyFunction}\n onAddOutcome={emptyFunction}\n onChapterClick={emptyFunction}\n onCreatePlan={emptyFunction}\n onDelete={emptyFunction}\n onDraftPublish={emptyFunction}\n onEdit={emptyFunction}\n onExpandPastMilestones={emptyFunction}\n onNodeView={emptyFunction}\n onNodeReview={emptyFunction}\n onWidgetTabSelection={emptyFunction}\n //* Resource callbacks\n onAssignResources={emptyFunction}\n onNodeReset={emptyFunction}\n onNodeUnassign={emptyFunction}\n //* Tests callbacks\n onCreateMilestoneTest={emptyFunction}\n onTestPreview={emptyFunction}\n onTestReview={emptyFunction}\n />\n </FlexView>\n ),\n indicator: {\n position: 'top',\n tooltipXCoOrdinates: 0,\n tooltipYCoOrdinates: 0,\n backgroundColor: 'BLUE_4',\n borderColor: 'BLACK',\n arrowColor: 'BLACK',\n arrowSize: 12,\n width: 264,\n tooltipItem: (\n <TooltipItem\n text={`Welcome to the all new ${isStudent ? 'learning' : 'tutoring'} homepage.`}\n buttonLabel=\"Next\"\n onButtonClick={handleNextCoachmark}\n />\n ),\n } as IArrowTooltipProps,\n },\n {\n originalElementToHighlightRef: homeworkRef,\n elementToHighlight: (\n <ELementWrapper>\n <HwCardListView\n userType={userType}\n studentId={studentId}\n isHwProcessing={false}\n hwDetails={HOMEWORK_DETAILS}\n onTestStart={emptyFunction}\n onNodeAttempt={emptyFunction}\n onTestPreview={emptyFunction}\n onNodeView={emptyFunction}\n onTestReview={emptyFunction}\n onNodeReview={emptyFunction}\n onNodeUnassign={emptyFunction}\n />\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 <TooltipItem\n text={`Homework is now easy to access and easy to ${\n isStudent ? 'complete' : 'review'\n }!`}\n buttonLabel=\"Next\"\n onButtonClick={handleNextCoachmark}\n />\n ),\n } as IArrowTooltipProps,\n },\n {\n originalElementToHighlightRef: homeworkRef,\n elementToHighlight: (\n <ELementWrapper>\n <HomeworkCard\n isInQueue={false}\n userType={userType}\n header={title}\n subHeader={subtext || ''}\n nodeData={HOMEWORK_DETAILS.assigned_homeworks[0] as INodeDataProps}\n renderAs=\"homework\"\n studentId={studentId}\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 <TooltipItem\n text=\"Track homework status and their due dates.\"\n buttonLabel=\"Next\"\n onButtonClick={handleNextCoachmark}\n />\n ),\n } as IArrowTooltipProps,\n },\n {\n originalElementToHighlightRef: homepageRef,\n elementToHighlight: (\n <ELementWrapper>\n <FlexView $flexRowGapX={1}>\n <Text $renderAs=\"ac4-black\" $color=\"BLACK_T_60\">\n Recent Chapters ({RECENT_CHAPTERS?.length})\n </Text>\n <ChaptersWrapper>\n {RECENT_CHAPTERS.map((chapter, idx) => (\n <ChapterItem\n key={chapter.id}\n chapter={chapter as unknown as IChapterDataProps}\n onChapterClick={emptyFunction}\n itemIndex={idx}\n />\n ))}\n </ChaptersWrapper>\n </FlexView>\n </ELementWrapper>\n ),\n type: IndicatorType.TOOLTIP,\n indicator: {\n position: 'top',\n tooltipXCoOrdinates: -200,\n tooltipYCoOrdinates: -10,\n backgroundColor: 'YELLOW_4',\n borderColor: 'BLACK',\n arrowColor: 'BLACK',\n arrowXCoOrdinates: -97,\n arrowSize: 12,\n width: 264,\n tooltipItem: (\n <TooltipItem\n text=\"Access all your recent chapters in one place.\"\n buttonLabel=\"Got it\"\n onButtonClick={handleEndJourney}\n />\n ),\n } as IArrowTooltipProps,\n },\n ];\n\n setJourney(journeyId, homepageSteps);\n\n const delayBeforeStart = setTimeout(() => {\n clearTimeout(delayBeforeStart);\n if (userType === 'STUDENT') {\n window.scrollTo(0, 0);\n } else {\n document.getElementById('tab-content-container')?.scrollTo(0, 0);\n }\n document.body.style.overflow = 'hidden';\n handleNextCoachmark();\n }, 200);\n\n timerRefs.current.push(delayBeforeStart); // Store to cleanup later\n },\n [handleEndJourney, emptyFunction, handleNextCoachmark, journeyId, setJourney],\n );\n\n const data = useMemo(\n () => ({\n homepageRef,\n homeworkRef,\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","recentChaptersRef","timerRefs","nextCoachmark","setJourney","endJourney","useJourney","emptyFunction","useCallback","handleEndJourney","handleNextCoachmark","startJourney","studentId","stream","userType","title","subtext","HOMEWORK_DETAILS","isStudent","homepageSteps","IndicatorType","jsxs","FlexView","jsx","HwCardListView","Text","_a","RECENT_CHAPTERS","ChaptersWrapper","chapter","idx","ChapterItem","MilestoneListContainer","TooltipItem","ELementWrapper","HomeworkCard","_b","delayBeforeStart","data","useMemo","useEffect","timer"],"mappings":";;;;;;;;;;;;;;;AAsBO,MAAMA,KAAqB,MAAM;AACtC,QAAMC,IAAYC,EAAmB,kBAE/BC,IAAcC,EAAuB,IAAI,GACzCC,IAAcD,EAAuB,IAAI,GACzCE,IAAoBF,EAAuB,IAAI,GAC/CG,IAAYH,EAAwC,CAAA,CAAE,GACtD,EAAE,eAAAI,GAAe,YAAAC,GAAY,YAAAC,MAAeC,EAAW,GAEvDC,IAAgBC,EAAY,MAAM,MAAM,CAAE,CAAA,GAE1CC,IAAmBD,EAAY,MAAM;AACzC,IAAAH,EAAWT,CAAS,GACX,SAAA,KAAK,MAAM,WAAW;AAAA,EAAA,GAC9B,CAACS,GAAYT,CAAS,CAAC,GAEpBc,IAAsBF,EAAY,MAAM;AAC9B,IAAAL,EAAAP,GAAW,IAAO,GAAG,EAAI;AAAA,EAAA,GACtC,CAACO,GAAeP,CAAS,CAAC,GAEvBe,IAAeH;AAAA,IACnB,CAAC,EAAE,WAAAI,GAAW,QAAAC,GAAQ,UAAAC,QAA2C;;AACzD,YAAA,EAAE,OAAAC,IAAQ,IAAI,SAAAC,IAAU,OAAOC,EAAiB,mBAAmB,CAAC,KAAK,IACzEC,IAAYJ,MAAa;AAE/B,UAAI,EAAChB,KAAA,QAAAA,EAAa,YAAW,EAACE,KAAA,QAAAA,EAAa;AACzC;AAGF,YAAMmB,IAA0C;AAAA,QAC9C;AAAA,UACE,+BAA+BrB;AAAA,UAE/B,MAAMsB,EAAc;AAAA,UACpB,oBACE,gBAAAC;AAAA,YAACC;AAAA,YAAA;AAAA,cACC,WAAW;AAAA,cACX,gBAAgB;AAAA,cAChB,aAAY;AAAA,cACZ,SAAS;AAAA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;AAAA,cAAA;AAAA,cAHND,EAAQ;AAAA,YAKhB,CAAA,GACH;AAAA,UAAA,EAAA,CACF,EACF,CAAA;AAAA,UAEF,MAAMT,EAAc;AAAA,UACpB,WAAW;AAAA,YACT,UAAU;AAAA,YACV,qBAAqB;AAAA,YACrB,qBAAqB;AAAA,YACrB,iBAAiB;AAAA,YACjB,aAAa;AAAA,YACb,YAAY;AAAA,YACZ,mBAAmB;AAAA,YACnB,WAAW;AAAA,YACX,OAAO;AAAA,YACP,aACE,gBAAAG;AAAA,cAACU;AAAA,cAAA;AAAA,gBACC,MAAK;AAAA,gBACL,aAAY;AAAA,gBACZ,eAAexB;AAAA,cAAA;AAAA,YACjB;AAAA,UAEJ;AAAA,QACF;AAAA,MAAA;AAGF,MAAAL,EAAWR,GAAWuB,CAAa;AAE7B,YAAAkB,IAAmB,WAAW,MAAM;;AACxC,qBAAaA,CAAgB,GACzBvB,MAAa,YACR,OAAA,SAAS,GAAG,CAAC,KAEpBY,IAAA,SAAS,eAAe,uBAAuB,MAA/C,QAAAA,EAAkD,SAAS,GAAG,IAEvD,SAAA,KAAK,MAAM,WAAW,UACXhB;SACnB,GAAG;AAEI,MAAAR,EAAA,QAAQ,KAAKmC,CAAgB;AAAA,IACzC;AAAA,IACA,CAAC5B,GAAkBF,GAAeG,GAAqBd,GAAWQ,CAAU;AAAA,EAAA,GAGxEkC,IAAOC;AAAA,IACX,OAAO;AAAA,MACL,aAAAzC;AAAA,MACA,aAAAE;AAAA,MACA,cAAAW;AAAA,IAAA;AAAA,IAEF,CAACA,CAAY;AAAA,EAAA;AAIf,SAAA6B,EAAU,MACD,MAAM;AACX,IAAAtC,EAAU,QAAQ,QAAQ,CAASuC,MAAA,aAAaA,CAAK,CAAC,GACtDvC,EAAU,UAAU;EAAC,GAEtB,CAAE,CAAA,GAEEoC;AACT;"}
|
|
1
|
+
{"version":3,"file":"use-home-page-journey.js","sources":["../../../../../src/features/journey/hooks/use-home-page-journey/use-home-page-journey.tsx"],"sourcesContent":["import { useCallback, useEffect, useMemo, useRef } from 'react';\n\nimport type { IChapterDataProps } from '../../../chapters/chapter/chapter-types';\nimport ChapterItem from '../../../chapters/chapters-list/chapter-item/chapter-item';\nimport HomeworkCard from '../../../homework/homework-card';\nimport HwCardListView from '../../../homework/hw-card-list/hw-card-list-view';\nimport type { TCourseStream } from '../../../milestone/create/milestone-create-types';\nimport MilestoneListContainer from '../../../milestone/milestone-list-container/milestone-list-container';\nimport type { IArrowTooltipProps } from '../../../ui/arrow-tooltip/arrow-tooltip-types';\nimport FlexView from '../../../ui/layout/flex-view';\nimport Text from '../../../ui/text/text';\nimport { JOURNEY_ID_STUDENT } from '../../journey-id/journey-id-student';\nimport { IndicatorType } from '../../use-journey/constants';\nimport type { TCoachmarkJourneyProps } from '../../use-journey/journey-context-types';\nimport { useJourney } from '../../use-journey/use-journey';\nimport { HOMEWORK_DETAILS } from './home-page-homeworks-mock';\nimport type { IHomepageStartJourneyProps } from './homepage-journey-types';\nimport { RECENT_CHAPTERS } from './recent-chapters-mock';\nimport { ChaptersWrapper, ELementWrapper } from './styles';\nimport TooltipItem from './tooltip-item';\nimport { type INodeDataProps } from '../../../chapters-v2/comps/node-card/node-card-types';\n\nexport const useHomePageJourney = () => {\n const journeyId = JOURNEY_ID_STUDENT.HOMEPAGE_JOURNEY;\n\n const homepageRef = useRef<HTMLDivElement>(null) as React.RefObject<HTMLDivElement>;\n const homeworkRef = useRef<HTMLDivElement>(null) as React.RefObject<HTMLDivElement>;\n const recentChaptersRef = useRef<HTMLDivElement>(null);\n const timerRefs = useRef<ReturnType<typeof setTimeout>[]>([]);\n const { nextCoachmark, setJourney, endJourney } = useJourney();\n\n const emptyFunction = useCallback(() => null, []);\n\n const handleEndJourney = useCallback(() => {\n endJourney(journeyId);\n document.body.style.overflow = 'unset';\n }, [endJourney, journeyId]);\n\n const handleNextCoachmark = useCallback(() => {\n nextCoachmark(journeyId, false, 0, true);\n }, [nextCoachmark, journeyId]);\n\n const startJourney = useCallback(\n ({ studentId, stream, userType }: IHomepageStartJourneyProps) => {\n const { title = '', subtext = '' } = HOMEWORK_DETAILS.assigned_homeworks[0]?.sheets[0] || {};\n const isStudent = userType === 'STUDENT';\n\n if (!homepageRef?.current || !homeworkRef?.current) {\n return;\n }\n\n const homepageSteps: TCoachmarkJourneyProps[] = [\n {\n originalElementToHighlightRef: homepageRef,\n\n type: IndicatorType.TOOLTIP,\n elementToHighlight: (\n <FlexView\n $flexGapX={2.5}\n $marginBottomX={8}\n $background=\"WHITE\"\n $widthX={47}\n $gutterX={1}\n >\n <HwCardListView\n userType={userType}\n studentId={studentId}\n isHwProcessing={false}\n hwDetails={HOMEWORK_DETAILS}\n onTestStart={emptyFunction}\n onNodeAttempt={emptyFunction}\n onTestPreview={emptyFunction}\n onNodeView={emptyFunction}\n onTestReview={emptyFunction}\n onNodeReview={emptyFunction}\n onNodeUnassign={emptyFunction}\n />\n <FlexView $flexRowGapX={1} ref={recentChaptersRef}>\n <Text $renderAs=\"ac4-black\" $color=\"BLACK_T_60\">\n Recent Chapters ({RECENT_CHAPTERS?.length})\n </Text>\n <ChaptersWrapper>\n {RECENT_CHAPTERS.map((chapter, idx) => (\n <ChapterItem\n key={chapter.id}\n chapter={chapter as unknown as IChapterDataProps}\n onChapterClick={emptyFunction}\n itemIndex={idx}\n />\n ))}\n </ChaptersWrapper>\n </FlexView>\n <MilestoneListContainer\n milestoneType=\"ACTIVE\"\n activeMilestoneId={''}\n activeTabId={''}\n canCreatePlan={false}\n courseStream={stream as TCourseStream}\n isClassOngoing={false}\n isStudentPresent={false}\n parentName={''}\n studentId={studentId}\n studentName={''}\n teacherName={''}\n userType={userType}\n //* Callbacks\n onAddChapter={emptyFunction}\n onAddOutcome={emptyFunction}\n onChapterClick={emptyFunction}\n onCreatePlan={emptyFunction}\n onDelete={emptyFunction}\n onDraftPublish={emptyFunction}\n onEdit={emptyFunction}\n onExpandPastMilestones={emptyFunction}\n onNodeView={emptyFunction}\n onNodeReview={emptyFunction}\n onWidgetTabSelection={emptyFunction}\n //* Resource callbacks\n onAssignResources={emptyFunction}\n onNodeReset={emptyFunction}\n onNodeUnassign={emptyFunction}\n //* Tests callbacks\n onCreateMilestoneTest={emptyFunction}\n onTestPreview={emptyFunction}\n onTestReview={emptyFunction}\n />\n </FlexView>\n ),\n indicator: {\n position: 'top',\n tooltipXCoOrdinates: 0,\n tooltipYCoOrdinates: 0,\n backgroundColor: 'BLUE_4',\n borderColor: 'BLACK',\n arrowColor: 'BLACK',\n arrowSize: 12,\n width: 264,\n tooltipItem: (\n <TooltipItem\n text={`Welcome to the all new ${isStudent ? 'learning' : 'tutoring'} homepage.`}\n buttonLabel=\"Next\"\n onButtonClick={handleNextCoachmark}\n />\n ),\n } as IArrowTooltipProps,\n },\n {\n originalElementToHighlightRef: homeworkRef,\n elementToHighlight: (\n <ELementWrapper>\n <HwCardListView\n userType={userType}\n studentId={studentId}\n isHwProcessing={false}\n hwDetails={HOMEWORK_DETAILS}\n onTestStart={emptyFunction}\n onNodeAttempt={emptyFunction}\n onTestPreview={emptyFunction}\n onNodeView={emptyFunction}\n onTestReview={emptyFunction}\n onNodeReview={emptyFunction}\n onNodeUnassign={emptyFunction}\n />\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 <TooltipItem\n text={`Homework is now easy to access and easy to ${\n isStudent ? 'complete' : 'review'\n }!`}\n buttonLabel=\"Next\"\n onButtonClick={handleNextCoachmark}\n />\n ),\n } as IArrowTooltipProps,\n },\n {\n originalElementToHighlightRef: homeworkRef,\n elementToHighlight: (\n <ELementWrapper>\n <HomeworkCard\n isInQueue={false}\n userType={userType}\n header={title}\n subHeader={subtext || ''}\n nodeData={HOMEWORK_DETAILS.assigned_homeworks[0]?.sheets[0] as INodeDataProps}\n renderAs=\"homework\"\n studentId={studentId}\n shouldOpenOnRight={false}\n entityId=\"\"\n state=\"IN_PROGRESS\"\n score={null}\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 <TooltipItem\n text=\"Track homework status and their due dates.\"\n buttonLabel=\"Next\"\n onButtonClick={handleNextCoachmark}\n />\n ),\n } as IArrowTooltipProps,\n },\n {\n originalElementToHighlightRef: homepageRef,\n elementToHighlight: (\n <ELementWrapper>\n <FlexView $flexRowGapX={1}>\n <Text $renderAs=\"ac4-black\" $color=\"BLACK_T_60\">\n Recent Chapters ({RECENT_CHAPTERS?.length})\n </Text>\n <ChaptersWrapper>\n {RECENT_CHAPTERS.map((chapter, idx) => (\n <ChapterItem\n key={chapter.id}\n chapter={chapter as unknown as IChapterDataProps}\n onChapterClick={emptyFunction}\n itemIndex={idx}\n />\n ))}\n </ChaptersWrapper>\n </FlexView>\n </ELementWrapper>\n ),\n type: IndicatorType.TOOLTIP,\n indicator: {\n position: 'top',\n tooltipXCoOrdinates: -200,\n tooltipYCoOrdinates: -10,\n backgroundColor: 'YELLOW_4',\n borderColor: 'BLACK',\n arrowColor: 'BLACK',\n arrowXCoOrdinates: -97,\n arrowSize: 12,\n width: 264,\n tooltipItem: (\n <TooltipItem\n text=\"Access all your recent chapters in one place.\"\n buttonLabel=\"Got it\"\n onButtonClick={handleEndJourney}\n />\n ),\n } as IArrowTooltipProps,\n },\n ];\n\n setJourney(journeyId, homepageSteps);\n\n const delayBeforeStart = setTimeout(() => {\n clearTimeout(delayBeforeStart);\n if (userType === 'STUDENT') {\n window.scrollTo(0, 0);\n } else {\n document.getElementById('tab-content-container')?.scrollTo(0, 0);\n }\n document.body.style.overflow = 'hidden';\n handleNextCoachmark();\n }, 200);\n\n timerRefs.current.push(delayBeforeStart); // Store to cleanup later\n },\n [handleEndJourney, emptyFunction, handleNextCoachmark, journeyId, setJourney],\n );\n\n const data = useMemo(\n () => ({\n homepageRef,\n homeworkRef,\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","recentChaptersRef","timerRefs","nextCoachmark","setJourney","endJourney","useJourney","emptyFunction","useCallback","handleEndJourney","handleNextCoachmark","startJourney","studentId","stream","userType","title","subtext","_a","HOMEWORK_DETAILS","isStudent","homepageSteps","IndicatorType","jsxs","FlexView","jsx","HwCardListView","Text","_b","RECENT_CHAPTERS","ChaptersWrapper","chapter","idx","ChapterItem","MilestoneListContainer","TooltipItem","ELementWrapper","HomeworkCard","_c","_d","delayBeforeStart","data","useMemo","useEffect","timer"],"mappings":";;;;;;;;;;;;;;;AAsBO,MAAMA,KAAqB,MAAM;AACtC,QAAMC,IAAYC,EAAmB,kBAE/BC,IAAcC,EAAuB,IAAI,GACzCC,IAAcD,EAAuB,IAAI,GACzCE,IAAoBF,EAAuB,IAAI,GAC/CG,IAAYH,EAAwC,CAAA,CAAE,GACtD,EAAE,eAAAI,GAAe,YAAAC,GAAY,YAAAC,MAAeC,EAAW,GAEvDC,IAAgBC,EAAY,MAAM,MAAM,CAAE,CAAA,GAE1CC,IAAmBD,EAAY,MAAM;AACzC,IAAAH,EAAWT,CAAS,GACX,SAAA,KAAK,MAAM,WAAW;AAAA,EAAA,GAC9B,CAACS,GAAYT,CAAS,CAAC,GAEpBc,IAAsBF,EAAY,MAAM;AAC9B,IAAAL,EAAAP,GAAW,IAAO,GAAG,EAAI;AAAA,EAAA,GACtC,CAACO,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AAC,KAEpBG,IAAA,SAAS,eAAe,uBAAuB,MAA/C,QAAAA,EAAkD,SAAS,GAAG,IAEvD,SAAA,KAAK,MAAM,WAAW,UACXP;SACnB,GAAG;AAEI,MAAAR,EAAA,QAAQ,KAAKqC,CAAgB;AAAA,IACzC;AAAA,IACA,CAAC9B,GAAkBF,GAAeG,GAAqBd,GAAWQ,CAAU;AAAA,EAAA,GAGxEoC,IAAOC;AAAA,IACX,OAAO;AAAA,MACL,aAAA3C;AAAA,MACA,aAAAE;AAAA,MACA,cAAAW;AAAA,IAAA;AAAA,IAEF,CAACA,CAAY;AAAA,EAAA;AAIf,SAAA+B,EAAU,MACD,MAAM;AACX,IAAAxC,EAAU,QAAQ,QAAQ,CAASyC,MAAA,aAAaA,CAAK,CAAC,GACtDzC,EAAU,UAAU;EAAC,GAEtB,CAAE,CAAA,GAEEsC;AACT;"}
|
|
@@ -2,16 +2,16 @@ import { jsx as t } from "react/jsx-runtime";
|
|
|
2
2
|
import { useRef as r, useCallback as n, useMemo as h } from "react";
|
|
3
3
|
import C from "../../../homework/homework-card-view.js";
|
|
4
4
|
import T from "../../../ui/layout/flex-view.js";
|
|
5
|
-
import { JOURNEY_ID_STUDENT as
|
|
6
|
-
import { IndicatorType as
|
|
5
|
+
import { JOURNEY_ID_STUDENT as E } from "../../journey-id/journey-id-student.js";
|
|
6
|
+
import { IndicatorType as w } from "../../use-journey/constants.js";
|
|
7
7
|
import { useJourney as b } from "../../use-journey/use-journey.js";
|
|
8
|
-
import
|
|
9
|
-
const
|
|
10
|
-
const e =
|
|
11
|
-
|
|
12
|
-
}, [e,
|
|
13
|
-
document.body.style.overflow = "unset",
|
|
14
|
-
}, [
|
|
8
|
+
import N from "../use-home-page-journey/tooltip-item.js";
|
|
9
|
+
const _ = () => {
|
|
10
|
+
const e = E.PUZZLE_ASSIGNED_JOURNEY, d = r(null), o = r(null), p = r([]), { setJourney: s, endJourney: i, nextCoachmark: a } = b(), l = n(() => {
|
|
11
|
+
a(e, !1, 0, !1);
|
|
12
|
+
}, [e, a]), u = n(() => {
|
|
13
|
+
document.body.style.overflow = "unset", i(e);
|
|
14
|
+
}, [i, e]), m = n(
|
|
15
15
|
(f) => {
|
|
16
16
|
if (!(o != null && o.current))
|
|
17
17
|
return;
|
|
@@ -25,10 +25,12 @@ const z = () => {
|
|
|
25
25
|
subHeader: "",
|
|
26
26
|
userType: "STUDENT",
|
|
27
27
|
nodeData: f,
|
|
28
|
+
state: "IN_PROGRESS",
|
|
29
|
+
score: 8,
|
|
28
30
|
studentContainerRef: d
|
|
29
31
|
}
|
|
30
32
|
) }),
|
|
31
|
-
type:
|
|
33
|
+
type: w.TOOLTIP,
|
|
32
34
|
indicator: {
|
|
33
35
|
renderAs: "primary",
|
|
34
36
|
tooltipXCoOrdinates: 66,
|
|
@@ -39,7 +41,7 @@ const z = () => {
|
|
|
39
41
|
borderColor: "BLACK",
|
|
40
42
|
arrowColor: "BLACK",
|
|
41
43
|
tooltipItem: /* @__PURE__ */ t(
|
|
42
|
-
|
|
44
|
+
N,
|
|
43
45
|
{
|
|
44
46
|
text: "New Puzzle assigned! Click here to view.",
|
|
45
47
|
buttonLabel: "Got it",
|
|
@@ -50,13 +52,13 @@ const z = () => {
|
|
|
50
52
|
isActive: !1
|
|
51
53
|
}
|
|
52
54
|
];
|
|
53
|
-
|
|
55
|
+
s(e, y);
|
|
54
56
|
const c = setTimeout(() => {
|
|
55
|
-
clearTimeout(c), document.body.style.overflow = "hidden",
|
|
57
|
+
clearTimeout(c), document.body.style.overflow = "hidden", l();
|
|
56
58
|
}, 500);
|
|
57
59
|
p.current.push(c);
|
|
58
60
|
},
|
|
59
|
-
[u,
|
|
61
|
+
[u, l, e, s]
|
|
60
62
|
);
|
|
61
63
|
return h(
|
|
62
64
|
() => ({
|
|
@@ -67,6 +69,6 @@ const z = () => {
|
|
|
67
69
|
);
|
|
68
70
|
};
|
|
69
71
|
export {
|
|
70
|
-
|
|
72
|
+
_ as usePuzzleAssignedJourney
|
|
71
73
|
};
|
|
72
74
|
//# sourceMappingURL=use-puzzle-assigned.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-puzzle-assigned.js","sources":["../../../../../src/features/journey/hooks/use-puzzles-journey/use-puzzle-assigned.tsx"],"sourcesContent":["import { useCallback, useMemo, useRef, type RefObject } from 'react';\n\nimport type { INodeDataProps } from '../../../chapters-v2/comps/node-card/node-card-types';\nimport HomeworkCardView from '../../../homework/homework-card-view';\nimport type { IArrowTooltipProps } from '../../../ui/arrow-tooltip/arrow-tooltip-types';\nimport FlexView from '../../../ui/layout/flex-view';\nimport { JOURNEY_ID_STUDENT } from '../../journey-id/journey-id-student';\nimport { IndicatorType } from '../../use-journey/constants';\nimport type { ICoachmarkProps } from '../../use-journey/journey-context-types';\nimport { useJourney } from '../../use-journey/use-journey';\nimport TooltipItem from '../use-home-page-journey/tooltip-item';\n\nconst usePuzzleAssignedJourney = () => {\n const journeyId = JOURNEY_ID_STUDENT.PUZZLE_ASSIGNED_JOURNEY;\n\n const studentContainerRef = useRef<HTMLDivElement>(null) as RefObject<HTMLDivElement>;\n const puzzleHWCardRef = useRef<HTMLDivElement>(null) as RefObject<HTMLDivElement>;\n const timerRefs = useRef<ReturnType<typeof setTimeout>[]>([]);\n\n const { setJourney, endJourney, nextCoachmark } = useJourney();\n\n const handleNextCoachMark = useCallback(() => {\n nextCoachmark(journeyId, false, 0, false);\n }, [journeyId, nextCoachmark]);\n\n const handleEndJourney = useCallback(() => {\n document.body.style.overflow = 'unset';\n endJourney(journeyId);\n }, [endJourney, journeyId]);\n\n const startJourney = useCallback(\n (nodeData: INodeDataProps) => {\n if (!puzzleHWCardRef?.current) {\n return;\n }\n\n const puzzleAttemptSteps: ICoachmarkProps[] = [\n {\n originalElementToHighlightRef: puzzleHWCardRef,\n elementToHighlight: (\n <FlexView>\n <HomeworkCardView\n header=\"\"\n subHeader=\"\"\n userType=\"STUDENT\"\n nodeData={nodeData}\n studentContainerRef={studentContainerRef}\n />\n </FlexView>\n ),\n type: IndicatorType.TOOLTIP,\n indicator: {\n renderAs: 'primary',\n tooltipXCoOrdinates: 66,\n arrowSize: 12,\n arrowXCoOrdinates: -100,\n position: 'bottom',\n backgroundColor: 'GREEN_4',\n borderColor: 'BLACK',\n arrowColor: 'BLACK',\n tooltipItem: (\n <TooltipItem\n text=\"New Puzzle assigned! Click here to view.\"\n buttonLabel=\"Got it\"\n onButtonClick={handleEndJourney}\n />\n ),\n } as IArrowTooltipProps,\n isActive: false,\n },\n ];\n\n setJourney(journeyId, puzzleAttemptSteps);\n\n const delayBeforeStart = setTimeout(() => {\n clearTimeout(delayBeforeStart);\n document.body.style.overflow = 'hidden';\n handleNextCoachMark();\n }, 500);\n\n timerRefs.current.push(delayBeforeStart);\n },\n [handleEndJourney, handleNextCoachMark, journeyId, setJourney],\n );\n\n const data = useMemo(\n () => ({\n puzzleHWCardRef,\n startJourney,\n }),\n [startJourney],\n );\n\n return data;\n};\n\nexport { usePuzzleAssignedJourney };\n"],"names":["usePuzzleAssignedJourney","journeyId","JOURNEY_ID_STUDENT","studentContainerRef","useRef","puzzleHWCardRef","timerRefs","setJourney","endJourney","nextCoachmark","useJourney","handleNextCoachMark","useCallback","handleEndJourney","startJourney","nodeData","puzzleAttemptSteps","FlexView","jsx","HomeworkCardView","IndicatorType","TooltipItem","delayBeforeStart","useMemo"],"mappings":";;;;;;;;AAYA,MAAMA,IAA2B,MAAM;AACrC,QAAMC,IAAYC,EAAmB,yBAE/BC,IAAsBC,EAAuB,IAAI,GACjDC,IAAkBD,EAAuB,IAAI,GAC7CE,IAAYF,EAAwC,CAAA,CAAE,GAEtD,EAAE,YAAAG,GAAY,YAAAC,GAAY,eAAAC,MAAkBC,EAAW,GAEvDC,IAAsBC,EAAY,MAAM;AAC9B,IAAAH,EAAAR,GAAW,IAAO,GAAG,EAAK;AAAA,EAAA,GACvC,CAACA,GAAWQ,CAAa,CAAC,GAEvBI,IAAmBD,EAAY,MAAM;AAChC,a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hooks/use-puzzles-journey/use-puzzle-assigned.tsx"],"sourcesContent":["import { useCallback, useMemo, useRef, type RefObject } from 'react';\n\nimport type { INodeDataProps } from '../../../chapters-v2/comps/node-card/node-card-types';\nimport HomeworkCardView from '../../../homework/homework-card-view';\nimport type { IArrowTooltipProps } from '../../../ui/arrow-tooltip/arrow-tooltip-types';\nimport FlexView from '../../../ui/layout/flex-view';\nimport { JOURNEY_ID_STUDENT } from '../../journey-id/journey-id-student';\nimport { IndicatorType } from '../../use-journey/constants';\nimport type { ICoachmarkProps } from '../../use-journey/journey-context-types';\nimport { useJourney } from '../../use-journey/use-journey';\nimport TooltipItem from '../use-home-page-journey/tooltip-item';\n\nconst usePuzzleAssignedJourney = () => {\n const journeyId = JOURNEY_ID_STUDENT.PUZZLE_ASSIGNED_JOURNEY;\n\n const studentContainerRef = useRef<HTMLDivElement>(null) as RefObject<HTMLDivElement>;\n const puzzleHWCardRef = useRef<HTMLDivElement>(null) as RefObject<HTMLDivElement>;\n const timerRefs = useRef<ReturnType<typeof setTimeout>[]>([]);\n\n const { setJourney, endJourney, nextCoachmark } = useJourney();\n\n const handleNextCoachMark = useCallback(() => {\n nextCoachmark(journeyId, false, 0, false);\n }, [journeyId, nextCoachmark]);\n\n const handleEndJourney = useCallback(() => {\n document.body.style.overflow = 'unset';\n endJourney(journeyId);\n }, [endJourney, journeyId]);\n\n const startJourney = useCallback(\n (nodeData: INodeDataProps) => {\n if (!puzzleHWCardRef?.current) {\n return;\n }\n\n const puzzleAttemptSteps: ICoachmarkProps[] = [\n {\n originalElementToHighlightRef: puzzleHWCardRef,\n elementToHighlight: (\n <FlexView>\n <HomeworkCardView\n header=\"\"\n subHeader=\"\"\n userType=\"STUDENT\"\n nodeData={nodeData}\n state=\"IN_PROGRESS\"\n score={8}\n studentContainerRef={studentContainerRef}\n />\n </FlexView>\n ),\n type: IndicatorType.TOOLTIP,\n indicator: {\n renderAs: 'primary',\n tooltipXCoOrdinates: 66,\n arrowSize: 12,\n arrowXCoOrdinates: -100,\n position: 'bottom',\n backgroundColor: 'GREEN_4',\n borderColor: 'BLACK',\n arrowColor: 'BLACK',\n tooltipItem: (\n <TooltipItem\n text=\"New Puzzle assigned! Click here to view.\"\n buttonLabel=\"Got it\"\n onButtonClick={handleEndJourney}\n />\n ),\n } as IArrowTooltipProps,\n isActive: false,\n },\n ];\n\n setJourney(journeyId, puzzleAttemptSteps);\n\n const delayBeforeStart = setTimeout(() => {\n clearTimeout(delayBeforeStart);\n document.body.style.overflow = 'hidden';\n handleNextCoachMark();\n }, 500);\n\n timerRefs.current.push(delayBeforeStart);\n },\n [handleEndJourney, handleNextCoachMark, journeyId, setJourney],\n );\n\n const data = useMemo(\n () => ({\n puzzleHWCardRef,\n startJourney,\n }),\n [startJourney],\n );\n\n return data;\n};\n\nexport { usePuzzleAssignedJourney };\n"],"names":["usePuzzleAssignedJourney","journeyId","JOURNEY_ID_STUDENT","studentContainerRef","useRef","puzzleHWCardRef","timerRefs","setJourney","endJourney","nextCoachmark","useJourney","handleNextCoachMark","useCallback","handleEndJourney","startJourney","nodeData","puzzleAttemptSteps","FlexView","jsx","HomeworkCardView","IndicatorType","TooltipItem","delayBeforeStart","useMemo"],"mappings":";;;;;;;;AAYA,MAAMA,IAA2B,MAAM;AACrC,QAAMC,IAAYC,EAAmB,yBAE/BC,IAAsBC,EAAuB,IAAI,GACjDC,IAAkBD,EAAuB,IAAI,GAC7CE,IAAYF,EAAwC,CAAA,CAAE,GAEtD,EAAE,YAAAG,GAAY,YAAAC,GAAY,eAAAC,MAAkBC,EAAW,GAEvDC,IAAsBC,EAAY,MAAM;AAC9B,IAAAH,EAAAR,GAAW,IAAO,GAAG,EAAK;AAAA,EAAA,GACvC,CAACA,GAAWQ,CAAa,CAAC,GAEvBI,IAAmBD,EAAY,MAAM;AAChC,aAAA,KAAK,MAAM,WAAW,SAC/BJ,EAAWP,CAAS;AAAA,EAAA,GACnB,CAACO,GAAYP,CAAS,CAAC,GAEpBa,IAAeF;AAAA,IACnB,CAACG,MAA6B;AACxB,UAAA,EAACV,KAAA,QAAAA,EAAiB;AACpB;AAGF,YAAMW,IAAwC;AAAA,QAC5C;AAAA,UACE,+BAA+BX;AAAA,UAC/B,sCACGY,GACC,EAAA,UAAA,gBAAAC;AAAA,YAACC;AAAA,YAAA;AAAA,cACC,QAAO;AAAA,cACP,WAAU;AAAA,cACV,UAAS;AAAA,cACT,UAAAJ;AAAA,cACA,OAAM;AAAA,cACN,OAAO;AAAA,cACP,qBAAAZ;AAAA,YAAA;AAAA,UAAA,GAEJ;AAAA,UAEF,MAAMiB,EAAc;AAAA,UACpB,WAAW;AAAA,YACT,UAAU;AAAA,YACV,qBAAqB;AAAA,YACrB,WAAW;AAAA,YACX,mBAAmB;AAAA,YACnB,UAAU;AAAA,YACV,iBAAiB;AAAA,YACjB,aAAa;AAAA,YACb,YAAY;AAAA,YACZ,aACE,gBAAAF;AAAA,cAACG;AAAA,cAAA;AAAA,gBACC,MAAK;AAAA,gBACL,aAAY;AAAA,gBACZ,eAAeR;AAAA,cAAA;AAAA,YACjB;AAAA,UAEJ;AAAA,UACA,UAAU;AAAA,QACZ;AAAA,MAAA;AAGF,MAAAN,EAAWN,GAAWe,CAAkB;AAElC,YAAAM,IAAmB,WAAW,MAAM;AACxC,qBAAaA,CAAgB,GACpB,SAAA,KAAK,MAAM,WAAW,UACXX;SACnB,GAAG;AAEI,MAAAL,EAAA,QAAQ,KAAKgB,CAAgB;AAAA,IACzC;AAAA,IACA,CAACT,GAAkBF,GAAqBV,GAAWM,CAAU;AAAA,EAAA;AAWxD,SARMgB;AAAA,IACX,OAAO;AAAA,MACL,iBAAAlB;AAAA,MACA,cAAAS;AAAA,IAAA;AAAA,IAEF,CAACA,CAAY;AAAA,EAAA;AAIjB;"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { createGetAPI as s } from "@cuemath/rest-api";
|
|
2
|
+
import { BASE_URL_V3 as i } from "../../../constants/api.js";
|
|
3
|
+
const { useGet: o, invalidate: n } = s({
|
|
4
|
+
getURL: (t, a, { mathfitTestId: e }) => `${i}/users/${t}/mathfit-tests/${e}`
|
|
5
|
+
});
|
|
6
|
+
export {
|
|
7
|
+
n as invalidateMathFitAssessment,
|
|
8
|
+
o as useGetMathFitAssessment
|
|
9
|
+
};
|
|
10
|
+
//# sourceMappingURL=get-mathfit-assessment.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-mathfit-assessment.js","sources":["../../../../src/features/math-fit/api/get-mathfit-assessment.ts"],"sourcesContent":["import { createGetAPI } from '@cuemath/rest-api';\n\nimport { type IMathFitAssessmentResponse } from '../math-fit-overview/math-fit-overview-types';\nimport { BASE_URL_V3 } from '../../../constants/api';\n\nconst { useGet: useGetMathFitAssessment, invalidate: invalidateMathFitAssessment } = createGetAPI<\n IMathFitAssessmentResponse,\n void,\n { mathfitTestId: string }\n>({\n getURL: (userId, _, { mathfitTestId }) =>\n `${BASE_URL_V3}/users/${userId}/mathfit-tests/${mathfitTestId}`,\n});\n\nexport { useGetMathFitAssessment, invalidateMathFitAssessment };\n"],"names":["useGetMathFitAssessment","invalidateMathFitAssessment","createGetAPI","userId","_","mathfitTestId","BASE_URL_V3"],"mappings":";;AAKA,MAAM,EAAE,QAAQA,GAAyB,YAAYC,EAAA,IAAgCC,EAInF;AAAA,EACA,QAAQ,CAACC,GAAQC,GAAG,EAAE,eAAAC,EACpB,MAAA,GAAGC,CAAW,UAAUH,CAAM,kBAAkBE,CAAa;AACjE,CAAC;"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { memo as F, useCallback as M, useEffect as T } from "react";
|
|
3
|
+
import d from "../../ui/loader/app-loader/app-loader.js";
|
|
4
|
+
import { useGetMathFitAssessment as g } from "../api/get-mathfit-assessment.js";
|
|
5
|
+
import { EMATHFIT_TEST_STATE as m } from "../math-fit-overview/math-fit-overview-types.js";
|
|
6
|
+
import l from "../math-fit-overview/math-fit-overview.js";
|
|
7
|
+
import v from "../math-fit-report/math-fit-report.js";
|
|
8
|
+
import A from "../../ui/error/error.js";
|
|
9
|
+
const P = F(function({
|
|
10
|
+
mathfitTestId: i,
|
|
11
|
+
userId: e,
|
|
12
|
+
onResumeClick: n,
|
|
13
|
+
onReviewClick: f,
|
|
14
|
+
onDoLater: s,
|
|
15
|
+
studentName: c,
|
|
16
|
+
userType: h
|
|
17
|
+
}) {
|
|
18
|
+
const { get: a, data: t, isProcessing: p, isProcessed: u, isProcessingFailed: E } = g(), o = M(() => {
|
|
19
|
+
a(e, void 0, { mathfitTestId: i });
|
|
20
|
+
}, [a, e, i]);
|
|
21
|
+
return T(() => {
|
|
22
|
+
o();
|
|
23
|
+
}, [o]), p ? /* @__PURE__ */ r(d, { height: "100dvh" }) : E || u && !t ? /* @__PURE__ */ r(A, { onTryAgain: o, height: "100dvh" }) : t ? t.state === m.COMPLETED || t.state === m.EXPIRED ? /* @__PURE__ */ r(
|
|
24
|
+
v,
|
|
25
|
+
{
|
|
26
|
+
data: t,
|
|
27
|
+
onReviewClick: f,
|
|
28
|
+
studentName: c,
|
|
29
|
+
userType: h,
|
|
30
|
+
onBack: s
|
|
31
|
+
}
|
|
32
|
+
) : /* @__PURE__ */ r(l, { data: t, onResumeClick: n, onDoLater: s }) : null;
|
|
33
|
+
}), j = P;
|
|
34
|
+
export {
|
|
35
|
+
j as default
|
|
36
|
+
};
|
|
37
|
+
//# sourceMappingURL=math-fit.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"math-fit.js","sources":["../../../../src/features/math-fit/math-fit/math-fit.tsx"],"sourcesContent":["import { memo, useCallback, useEffect, type FC } from 'react';\n\nimport AppLoader from '../../ui/loader/app-loader/app-loader';\nimport { useGetMathFitAssessment } from '../api/get-mathfit-assessment';\nimport {\n EMATHFIT_TEST_STATE,\n type IMathFitProps,\n} from '../math-fit-overview/math-fit-overview-types';\nimport MathFitOverview from '../math-fit-overview/math-fit-overview';\nimport MathFitReport from '../math-fit-report/math-fit-report';\nimport Error from '../../ui/error/error';\n\nconst MathFit: FC<IMathFitProps> = memo(function MathFit({\n mathfitTestId,\n userId,\n onResumeClick,\n onReviewClick,\n onDoLater,\n studentName,\n userType,\n}) {\n const { get, data, isProcessing, isProcessed, isProcessingFailed } = useGetMathFitAssessment();\n\n const fetchData = useCallback(() => {\n get(userId, undefined, { mathfitTestId });\n }, [get, userId, mathfitTestId]);\n\n useEffect(() => {\n fetchData();\n }, [fetchData]);\n\n if (isProcessing) {\n return <AppLoader height=\"100dvh\" />;\n }\n\n if (isProcessingFailed || (isProcessed && !data)) {\n return <Error onTryAgain={fetchData} height=\"100dvh\" />;\n }\n\n if (!data) return null;\n\n if (data.state === EMATHFIT_TEST_STATE.COMPLETED || data.state === EMATHFIT_TEST_STATE.EXPIRED) {\n return (\n <MathFitReport\n data={data}\n onReviewClick={onReviewClick}\n studentName={studentName}\n userType={userType}\n onBack={onDoLater}\n />\n );\n }\n\n return <MathFitOverview data={data} onResumeClick={onResumeClick} onDoLater={onDoLater} />;\n});\n\nexport default MathFit;\n"],"names":["MathFit","memo","mathfitTestId","userId","onResumeClick","onReviewClick","onDoLater","studentName","userType","get","data","isProcessing","isProcessed","isProcessingFailed","useGetMathFitAssessment","fetchData","useCallback","useEffect","jsx","AppLoader","Error","EMATHFIT_TEST_STATE","MathFitReport","MathFitOverview","MathFit$1"],"mappings":";;;;;;;;AAYA,MAAMA,IAA6BC,EAAK,SAAiB;AAAA,EACvD,eAAAC;AAAA,EACA,QAAAC;AAAA,EACA,eAAAC;AAAA,EACA,eAAAC;AAAA,EACA,WAAAC;AAAA,EACA,aAAAC;AAAA,EACA,UAAAC;AACF,GAAG;AACD,QAAM,EAAE,KAAAC,GAAK,MAAAC,GAAM,cAAAC,GAAc,aAAAC,GAAa,oBAAAC,EAAA,IAAuBC,KAE/DC,IAAYC,EAAY,MAAM;AAClC,IAAAP,EAAIN,GAAQ,QAAW,EAAE,eAAAD,EAAe,CAAA;AAAA,EACvC,GAAA,CAACO,GAAKN,GAAQD,CAAa,CAAC;AAM/B,SAJAe,EAAU,MAAM;AACJ,IAAAF;EAAA,GACT,CAACA,CAAS,CAAC,GAEVJ,IACK,gBAAAO,EAACC,GAAU,EAAA,QAAO,SAAS,CAAA,IAGhCN,KAAuBD,KAAe,CAACF,IACjC,gBAAAQ,EAAAE,GAAA,EAAM,YAAYL,GAAW,QAAO,SAAS,CAAA,IAGlDL,IAEDA,EAAK,UAAUW,EAAoB,aAAaX,EAAK,UAAUW,EAAoB,UAEnF,gBAAAH;AAAA,IAACI;AAAA,IAAA;AAAA,MACC,MAAAZ;AAAA,MACA,eAAAL;AAAA,MACA,aAAAE;AAAA,MACA,UAAAC;AAAA,MACA,QAAQF;AAAA,IAAA;AAAA,EAAA,IAKN,gBAAAY,EAAAK,GAAA,EAAgB,MAAAb,GAAY,eAAAN,GAA8B,WAAAE,EAAsB,CAAA,IAdtE;AAepB,CAAC,GAEDkB,IAAexB;"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import e from "styled-components";
|
|
2
|
+
import n from "../../ui/layout/flex-view.js";
|
|
3
|
+
const i = e(n)(({
|
|
4
|
+
$bgImage: o,
|
|
5
|
+
$disabled: r,
|
|
6
|
+
$expired: t
|
|
7
|
+
}) => o ? `
|
|
8
|
+
background-image: url(${o});
|
|
9
|
+
background-repeat: no-repeat;
|
|
10
|
+
background-size: cover;
|
|
11
|
+
background-position: center;
|
|
12
|
+
cursor: ${r ? "not-allowed" : "pointer"};
|
|
13
|
+
opacity: ${r ? 0.5 : 1};
|
|
14
|
+
filter: ${t ? "grayscale(1)" : "none"};
|
|
15
|
+
` : `
|
|
16
|
+
cursor: ${r ? "not-allowed" : "pointer"};
|
|
17
|
+
opacity: ${r ? 0.5 : 1};
|
|
18
|
+
`);
|
|
19
|
+
export {
|
|
20
|
+
i as MathFitCardContainer
|
|
21
|
+
};
|
|
22
|
+
//# sourceMappingURL=math-fit-card-styled.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"math-fit-card-styled.js","sources":["../../../../src/features/math-fit/math-fit-card/math-fit-card-styled.tsx"],"sourcesContent":["import styled from 'styled-components';\n\nimport FlexView from '../../ui/layout/flex-view';\n\ninterface IMathFitCardContainerProps {\n $bgImage: string;\n $disabled: boolean;\n $expired: boolean;\n}\n\nexport const MathFitCardContainer = styled(FlexView)<IMathFitCardContainerProps>(({\n $bgImage,\n $disabled,\n $expired,\n}) => {\n if ($bgImage) {\n return `\n background-image: url(${$bgImage});\n background-repeat: no-repeat;\n background-size: cover;\n background-position: center;\n cursor: ${$disabled ? 'not-allowed' : 'pointer'};\n opacity: ${$disabled ? 0.5 : 1};\n filter: ${$expired ? 'grayscale(1)' : 'none'};\n `;\n }\n\n return `\n cursor: ${$disabled ? 'not-allowed' : 'pointer'};\n opacity: ${$disabled ? 0.5 : 1};\n `;\n});\n"],"names":["MathFitCardContainer","styled","FlexView","$bgImage","$disabled","$expired"],"mappings":";;AAUO,MAAMA,IAAuBC,EAAOC,CAAQ,EAA8B,CAAC;AAAA,EAChF,UAAAC;AAAA,EACA,WAAAC;AAAA,EACA,UAAAC;AACF,MACMF,IACK;AAAA,8BACmBA,CAAQ;AAAA;AAAA;AAAA;AAAA,gBAItBC,IAAY,gBAAgB,SAAS;AAAA,iBACpCA,IAAY,MAAM,CAAC;AAAA,gBACpBC,IAAW,iBAAiB,MAAM;AAAA,QAIzC;AAAA,cACKD,IAAY,gBAAgB,SAAS;AAAA,eACpCA,IAAY,MAAM,CAAC;AAAA,GAEjC;"}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { jsx as r, jsxs as m } from "react/jsx-runtime";
|
|
2
|
+
import { memo as C } from "react";
|
|
3
|
+
import u from "../../chapters-v2/comps/node-card/node-card-tags.js";
|
|
4
|
+
import T from "../../homework/node-progress.js";
|
|
5
|
+
import A from "../../ui/arrow-tooltip/arrow-tooltip.js";
|
|
6
|
+
import _ from "../../ui/layout/flex-view.js";
|
|
7
|
+
import n from "../../ui/separator/separator.js";
|
|
8
|
+
import a from "../../ui/text/text.js";
|
|
9
|
+
import { MathFitCardContainer as x } from "./math-fit-card-styled.js";
|
|
10
|
+
import { ILLUSTRATIONS as E } from "../../../assets/illustrations/illustrations.js";
|
|
11
|
+
const F = C(function({
|
|
12
|
+
dueDateTs: o,
|
|
13
|
+
isMathFitDisabled: t = !1,
|
|
14
|
+
tooltipText: h = "",
|
|
15
|
+
isMilestone: s = !1,
|
|
16
|
+
nodeType: p,
|
|
17
|
+
state: e,
|
|
18
|
+
subHeader: c,
|
|
19
|
+
unlockedOnTs: i,
|
|
20
|
+
userType: f,
|
|
21
|
+
score: l,
|
|
22
|
+
studentContainerRef: $
|
|
23
|
+
}) {
|
|
24
|
+
const g = o && i, d = e === "EXPIRED";
|
|
25
|
+
return /* @__PURE__ */ r(
|
|
26
|
+
A,
|
|
27
|
+
{
|
|
28
|
+
renderAs: "primary",
|
|
29
|
+
tooltipItem: h,
|
|
30
|
+
position: "bottom",
|
|
31
|
+
hidden: !t,
|
|
32
|
+
children: /* @__PURE__ */ m(
|
|
33
|
+
x,
|
|
34
|
+
{
|
|
35
|
+
ref: $,
|
|
36
|
+
$widthX: 12.38,
|
|
37
|
+
$position: "relative",
|
|
38
|
+
$background: d ? "WHITE_4" : "BLUE_4",
|
|
39
|
+
$bgImage: E.MATH_FIT_CARD_BG,
|
|
40
|
+
$height: 159,
|
|
41
|
+
$gutterX: 0.78125,
|
|
42
|
+
$disabled: t,
|
|
43
|
+
$expired: d,
|
|
44
|
+
children: [
|
|
45
|
+
/* @__PURE__ */ r(
|
|
46
|
+
u,
|
|
47
|
+
{
|
|
48
|
+
nodeType: p,
|
|
49
|
+
state: e,
|
|
50
|
+
accuracy: l ?? 0,
|
|
51
|
+
dueDateTs: o,
|
|
52
|
+
isStudent: f === "STUDENT",
|
|
53
|
+
isMilestone: s,
|
|
54
|
+
isMathFitCard: !0
|
|
55
|
+
}
|
|
56
|
+
),
|
|
57
|
+
g && /* @__PURE__ */ r(
|
|
58
|
+
T,
|
|
59
|
+
{
|
|
60
|
+
dueDate: o * 1e3,
|
|
61
|
+
unlockedOn: i * 1e3,
|
|
62
|
+
progressBg: "BLUE_2"
|
|
63
|
+
}
|
|
64
|
+
),
|
|
65
|
+
/* @__PURE__ */ m(_, { $justifyContent: "flex-end", $height: "100%", children: [
|
|
66
|
+
/* @__PURE__ */ r(a, { $renderAs: "ac4", $color: "BLACK_1", children: "MathFit TEST" }),
|
|
67
|
+
/* @__PURE__ */ r(n, { heightX: 0.5 }),
|
|
68
|
+
/* @__PURE__ */ r(a, { $renderAs: "ub3", $color: "BLACK_T_60", $width: "100%", children: c }),
|
|
69
|
+
/* @__PURE__ */ r(n, { heightX: 0.75 })
|
|
70
|
+
] })
|
|
71
|
+
]
|
|
72
|
+
}
|
|
73
|
+
)
|
|
74
|
+
}
|
|
75
|
+
);
|
|
76
|
+
}), y = F;
|
|
77
|
+
export {
|
|
78
|
+
y as default
|
|
79
|
+
};
|
|
80
|
+
//# sourceMappingURL=math-fit-card.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"math-fit-card.js","sources":["../../../../src/features/math-fit/math-fit-card/math-fit-card.tsx"],"sourcesContent":["import { memo, type FC } from 'react';\n\nimport NodeCardTags from '../../chapters-v2/comps/node-card/node-card-tags';\nimport NodeProgress from '../../homework/node-progress';\nimport ArrowTooltip from '../../ui/arrow-tooltip/arrow-tooltip';\nimport FlexView from '../../ui/layout/flex-view';\nimport Separator from '../../ui/separator/separator';\nimport Text from '../../ui/text/text';\nimport type { IMathFitCardProps } from './math-fit-card-types';\nimport * as Styled from './math-fit-card-styled';\nimport { ILLUSTRATIONS } from '../../../assets/illustrations/illustrations';\n\nconst MathFitCard: FC<IMathFitCardProps> = memo(function MathFitCard({\n dueDateTs,\n isMathFitDisabled = false,\n tooltipText = '',\n isMilestone = false,\n nodeType,\n state,\n subHeader,\n unlockedOnTs,\n userType,\n score,\n studentContainerRef,\n}) {\n const shouldShowProgress = dueDateTs && unlockedOnTs;\n const isExpired = state === 'EXPIRED';\n\n return (\n <ArrowTooltip\n renderAs=\"primary\"\n tooltipItem={tooltipText}\n position=\"bottom\"\n hidden={!isMathFitDisabled}\n >\n <Styled.MathFitCardContainer\n ref={studentContainerRef}\n $widthX={12.38}\n $position=\"relative\"\n $background={isExpired ? 'WHITE_4' : 'BLUE_4'}\n $bgImage={ILLUSTRATIONS.MATH_FIT_CARD_BG}\n $height={159}\n $gutterX={0.78125}\n $disabled={isMathFitDisabled}\n $expired={isExpired}\n >\n <NodeCardTags\n nodeType={nodeType}\n state={state}\n accuracy={score ?? 0}\n dueDateTs={dueDateTs}\n isStudent={userType === 'STUDENT'}\n isMilestone={isMilestone}\n isMathFitCard\n />\n {shouldShowProgress && (\n <NodeProgress\n dueDate={dueDateTs * 1000}\n unlockedOn={unlockedOnTs * 1000}\n progressBg=\"BLUE_2\"\n />\n )}\n <FlexView $justifyContent=\"flex-end\" $height=\"100%\">\n <Text $renderAs=\"ac4\" $color=\"BLACK_1\">\n MathFit TEST\n </Text>\n <Separator heightX={0.5} />\n <Text $renderAs=\"ub3\" $color=\"BLACK_T_60\" $width=\"100%\">\n {subHeader}\n </Text>\n <Separator heightX={0.75} />\n </FlexView>\n </Styled.MathFitCardContainer>\n </ArrowTooltip>\n );\n});\n\nexport default MathFitCard;\n"],"names":["MathFitCard","memo","dueDateTs","isMathFitDisabled","tooltipText","isMilestone","nodeType","state","subHeader","unlockedOnTs","userType","score","studentContainerRef","shouldShowProgress","isExpired","jsx","ArrowTooltip","jsxs","Styled.MathFitCardContainer","ILLUSTRATIONS","NodeCardTags","NodeProgress","FlexView","Text","Separator","MathFitCard$1"],"mappings":";;;;;;;;;;AAYA,MAAMA,IAAqCC,EAAK,SAAqB;AAAA,EACnE,WAAAC;AAAA,EACA,mBAAAC,IAAoB;AAAA,EACpB,aAAAC,IAAc;AAAA,EACd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AAAA,cACA,gBAAAO,EAACS,GAAU,EAAA,SAAS,KAAM,CAAA;AAAA,YAAA,GAC5B;AAAA,UAAA;AAAA,QAAA;AAAA,MACF;AAAA,IAAA;AAAA,EAAA;AAGN,CAAC,GAEDC,IAAezB;"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import t from "styled-components";
|
|
2
|
+
import o from "../../../../ui/layout/flex-view.js";
|
|
3
|
+
const l = t(o)`
|
|
4
|
+
margin-left: 12px;
|
|
5
|
+
`, p = t(o)`
|
|
6
|
+
margin-left: -12px;
|
|
7
|
+
`, s = t.div(({ theme: i }) => {
|
|
8
|
+
const { colors: e } = i;
|
|
9
|
+
return `
|
|
10
|
+
position: absolute;
|
|
11
|
+
height: 100%;
|
|
12
|
+
left:0;
|
|
13
|
+
top: calc(50% + 8px);
|
|
14
|
+
z-index: 0;
|
|
15
|
+
width: 1px;
|
|
16
|
+
background: ${e.BLACK_T_15};
|
|
17
|
+
`;
|
|
18
|
+
});
|
|
19
|
+
export {
|
|
20
|
+
l as Container,
|
|
21
|
+
s as Divider,
|
|
22
|
+
p as StatusColumn
|
|
23
|
+
};
|
|
24
|
+
//# sourceMappingURL=section-card-styled.js.map
|