@cuemath/leap 3.2.19-beta-0.1 → 3.2.19-link.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/illustrations/illustrations.js +6 -6
- package/dist/assets/illustrations/illustrations.js.map +1 -1
- package/dist/assets/line-icons/icons/star3.js +32 -0
- package/dist/assets/line-icons/icons/star3.js.map +1 -0
- package/dist/assets/lottie/lottie.js +0 -5
- package/dist/assets/lottie/lottie.js.map +1 -1
- package/dist/features/analytics-events/platform-events-student.js +1 -2
- package/dist/features/analytics-events/platform-events-student.js.map +1 -1
- package/dist/features/analytics-events/platform-events-teacher.js +4 -6
- package/dist/features/analytics-events/platform-events-teacher.js.map +1 -1
- package/dist/features/analytics-events/whitelist-events.js +8 -10
- package/dist/features/analytics-events/whitelist-events.js.map +1 -1
- package/dist/features/chapters-v2/utils/node-card-utils.js +2 -2
- package/dist/features/chapters-v2/utils/node-card-utils.js.map +1 -1
- package/dist/features/communication/pub-sub/constants.js +4 -7
- package/dist/features/communication/pub-sub/constants.js.map +1 -1
- package/dist/features/homework/homework-card-view.js +97 -85
- package/dist/features/homework/homework-card-view.js.map +1 -1
- package/dist/features/homework/homework-card.js +42 -44
- package/dist/features/homework/homework-card.js.map +1 -1
- package/dist/features/homework/hw-card-list/hw-card-list-view.js +29 -31
- 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 +48 -54
- package/dist/features/homework/hw-card-list/hw-card-list.js.map +1 -1
- package/dist/features/homework/utils.js +27 -33
- package/dist/features/homework/utils.js.map +1 -1
- package/dist/features/journey/hooks/use-home-page-journey/tooltip-item.js +11 -17
- package/dist/features/journey/hooks/use-home-page-journey/tooltip-item.js.map +1 -1
- package/dist/features/journey/journey-id/journey-id-student.js +1 -1
- package/dist/features/journey/journey-id/journey-id-student.js.map +1 -1
- package/dist/features/journey/journey-id/journey-id-teacher.js +2 -2
- package/dist/features/journey/journey-id/journey-id-teacher.js.map +1 -1
- package/dist/features/puzzles/app/puzzle-app-styled.js +6 -10
- package/dist/features/puzzles/app/puzzle-app-styled.js.map +1 -1
- package/dist/features/puzzles/comps/puzzle-card-styled.js +69 -24
- package/dist/features/puzzles/comps/puzzle-card-styled.js.map +1 -1
- package/dist/features/puzzles/comps/puzzle-card.js +30 -79
- package/dist/features/puzzles/comps/puzzle-card.js.map +1 -1
- package/dist/features/puzzles/puzzle-container/puzzle-container-styled.js +25 -55
- package/dist/features/puzzles/puzzle-container/puzzle-container-styled.js.map +1 -1
- package/dist/features/puzzles/puzzle-container/puzzle-container.js +107 -100
- package/dist/features/puzzles/puzzle-container/puzzle-container.js.map +1 -1
- package/dist/features/puzzles/puzzle-feedback-celebration/puzzle-feedback-celebration.js +1 -1
- package/dist/features/puzzles/puzzle-feedback-celebration/puzzle-feedback-celebration.js.map +1 -1
- package/dist/features/puzzles/utils/puzzle-pattern.js +13 -28
- package/dist/features/puzzles/utils/puzzle-pattern.js.map +1 -1
- package/dist/features/trial-session/comps/student-profile/student-profile.js +1 -1
- package/dist/features/trial-session/comps/teacher-intro/teacher-intro-styled.js +7 -50
- package/dist/features/trial-session/comps/teacher-intro/teacher-intro-styled.js.map +1 -1
- package/dist/features/trial-session/comps/teacher-intro/teacher-intro.js +15 -69
- package/dist/features/trial-session/comps/teacher-intro/teacher-intro.js.map +1 -1
- package/dist/features/trial-session/comps/teacher-intro/teacher-profile/teacher-profile-styled.js +49 -0
- package/dist/features/trial-session/comps/teacher-intro/teacher-profile/teacher-profile-styled.js.map +1 -0
- package/dist/features/trial-session/comps/teacher-intro/teacher-profile/teacher-profile.js +64 -0
- package/dist/features/trial-session/comps/teacher-intro/teacher-profile/teacher-profile.js.map +1 -0
- package/dist/features/ui/accordion/accordion-items/accordion-items-styled.js +28 -0
- package/dist/features/ui/accordion/accordion-items/accordion-items-styled.js.map +1 -0
- package/dist/features/ui/accordion/accordion-items/accordion-items.js +83 -0
- package/dist/features/ui/accordion/accordion-items/accordion-items.js.map +1 -0
- package/dist/features/ui/accordion/accordion.js +62 -0
- package/dist/features/ui/accordion/accordion.js.map +1 -0
- package/dist/features/ui/inputs/base-input/base-input.js +11 -11
- package/dist/features/ui/inputs/base-input/base-input.js.map +1 -1
- package/dist/features/ui/inputs/text-input/text-input.js +19 -18
- package/dist/features/ui/inputs/text-input/text-input.js.map +1 -1
- package/dist/features/ui/modals/modal-styled.js +42 -8
- package/dist/features/ui/modals/modal-styled.js.map +1 -1
- package/dist/features/ui/modals/modal.js +37 -27
- package/dist/features/ui/modals/modal.js.map +1 -1
- package/dist/features/ui/text/text.js +31 -29
- package/dist/features/ui/text/text.js.map +1 -1
- package/dist/features/ui/theme/clrs.js +2 -0
- package/dist/features/ui/theme/clrs.js.map +1 -1
- package/dist/features/worksheet/worksheet/worksheet-helpers.js +19 -20
- package/dist/features/worksheet/worksheet/worksheet-helpers.js.map +1 -1
- package/dist/features/worksheet/worksheet/worksheet-question/learnosity-question.js +12 -16
- package/dist/features/worksheet/worksheet/worksheet-question/learnosity-question.js.map +1 -1
- package/dist/features/worksheet/worksheet/worksheet-question/worksheet-question-styled.js +47 -101
- package/dist/features/worksheet/worksheet/worksheet-question/worksheet-question-styled.js.map +1 -1
- package/dist/features/worksheet/worksheet/worksheet-question/worksheet-question.js +146 -149
- package/dist/features/worksheet/worksheet/worksheet-question/worksheet-question.js.map +1 -1
- package/dist/features/worksheet/worksheet/worksheet-questions-controller/worksheet-questions-controller.js +207 -242
- package/dist/features/worksheet/worksheet/worksheet-questions-controller/worksheet-questions-controller.js.map +1 -1
- package/dist/features/worksheet/worksheet/worksheet-styled.js +37 -37
- package/dist/features/worksheet/worksheet/worksheet-styled.js.map +1 -1
- package/dist/features/worksheet/worksheet/worksheet-types.js.map +1 -1
- package/dist/features/worksheet/worksheet/worksheet.js +313 -307
- package/dist/features/worksheet/worksheet/worksheet.js.map +1 -1
- package/dist/features/worksheet/worksheet-preview/hooks/use-worksheet-layout.js +1 -1
- package/dist/features/worksheet/worksheet-preview/hooks/use-worksheet-layout.js.map +1 -1
- package/dist/features/worksheet/worksheet-preview/worksheet-preview.js +35 -44
- package/dist/features/worksheet/worksheet-preview/worksheet-preview.js.map +1 -1
- package/dist/index.d.ts +71 -89
- package/dist/index.js +626 -626
- package/dist/static/puzzle-pattern-blue.f4bea1ee.svg +1 -0
- package/dist/static/puzzle-pattern-green.c9f84bbc.svg +1 -0
- package/dist/static/puzzle-pattern-orange.3da09665.svg +1 -0
- package/dist/static/puzzle-pattern-purple.5fb5a319.svg +1 -0
- package/dist/static/puzzle-pattern-yellow.aadbf457.svg +1 -0
- package/dist/static/stripe-blurple.6abf422f.svg +1 -0
- package/package.json +1 -1
- package/dist/features/journey/hooks/use-puzzles-journey/use-puzzle-assigned.js +0 -72
- package/dist/features/journey/hooks/use-puzzles-journey/use-puzzle-assigned.js.map +0 -1
- package/dist/features/journey/hooks/use-puzzles-journey/use-puzzle-attempt-journey.js +0 -59
- package/dist/features/journey/hooks/use-puzzles-journey/use-puzzle-attempt-journey.js.map +0 -1
- package/dist/features/journey/hooks/use-puzzles-journey/use-puzzle-dashboard-journey.js +0 -63
- package/dist/features/journey/hooks/use-puzzles-journey/use-puzzle-dashboard-journey.js.map +0 -1
- package/dist/features/journey/hooks/use-puzzles-journey/use-puzzle-intro-journey.js +0 -67
- package/dist/features/journey/hooks/use-puzzles-journey/use-puzzle-intro-journey.js.map +0 -1
- package/dist/features/journey/hooks/use-puzzles-journey/use-puzzle-progress-journey.js +0 -70
- package/dist/features/journey/hooks/use-puzzles-journey/use-puzzle-progress-journey.js.map +0 -1
- package/dist/features/journey/hooks/use-puzzles-journey/use-puzzle-review-journey.js +0 -59
- package/dist/features/journey/hooks/use-puzzles-journey/use-puzzle-review-journey.js.map +0 -1
- package/dist/features/journey/hooks/use-puzzles-journey/use-puzzle-unassign-journey.js +0 -59
- package/dist/features/journey/hooks/use-puzzles-journey/use-puzzle-unassign-journey.js.map +0 -1
- package/dist/features/journey/hooks/use-puzzles-journey/use-teacher-puzzle-assigned-journey.js +0 -70
- package/dist/features/journey/hooks/use-puzzles-journey/use-teacher-puzzle-assigned-journey.js.map +0 -1
- package/dist/features/puzzles/api/puzzle-dashboard.js +0 -10
- package/dist/features/puzzles/api/puzzle-dashboard.js.map +0 -1
- package/dist/features/puzzles/constants/puzzle-container.js +0 -8
- package/dist/features/puzzles/constants/puzzle-container.js.map +0 -1
- package/dist/features/puzzles/puzzle-analytics-events.js +0 -11
- package/dist/features/puzzles/puzzle-analytics-events.js.map +0 -1
- package/dist/features/puzzles/puzzle-container/puzzle-container-view.js +0 -55
- package/dist/features/puzzles/puzzle-container/puzzle-container-view.js.map +0 -1
- package/dist/features/puzzles/puzzle-dashboard/puzzle-dashboard-styled.js +0 -37
- package/dist/features/puzzles/puzzle-dashboard/puzzle-dashboard-styled.js.map +0 -1
- package/dist/features/puzzles/puzzle-dashboard/puzzle-dashboard.js +0 -110
- package/dist/features/puzzles/puzzle-dashboard/puzzle-dashboard.js.map +0 -1
- package/dist/features/worksheet/worksheet/hooks/use-worksheet-journey.js +0 -28
- package/dist/features/worksheet/worksheet/hooks/use-worksheet-journey.js.map +0 -1
- package/dist/static/puzzle-blue-lottie.7017e2e8.json +0 -1
- package/dist/static/puzzle-blue-lottie.bf64ebc5.json +0 -12760
- package/dist/static/puzzle-dashboard-banner.b7956519.svg +0 -1
- package/dist/static/puzzle-green-lottie.1da90698.json +0 -1
- package/dist/static/puzzle-orange-lottie.cfcf3724.json +0 -1
- package/dist/static/puzzle-pattern-blue.abff0164.svg +0 -1
- package/dist/static/puzzle-pattern-green.b8ba1840.svg +0 -1
- package/dist/static/puzzle-pattern-orange.3f5a17ff.svg +0 -1
- package/dist/static/puzzle-pattern-purple.14b09759.svg +0 -1
- package/dist/static/puzzle-pattern-yellow.50917fab.svg +0 -1
- package/dist/static/puzzle-purple-lottie.e70de110.json +0 -9860
- package/dist/static/puzzle-yellow-lottie.275b5cf4.json +0 -1
@@ -1,118 +1,130 @@
|
|
1
1
|
import { jsx as e, jsxs as n } from "react/jsx-runtime";
|
2
|
-
import { memo as
|
3
|
-
import
|
4
|
-
import
|
5
|
-
import { getNodeTypeBasedBgImage as
|
6
|
-
import { getNodeCardBasedIcon as
|
2
|
+
import { memo as X, useState as B, useRef as T, useCallback as I, useLayoutEffect as R } from "react";
|
3
|
+
import P from "../../assets/line-icons/icons/closed-eye.js";
|
4
|
+
import b from "../chapters-v2/comps/node-card/node-card-tags.js";
|
5
|
+
import { getNodeTypeBasedBgImage as W } from "../chapters-v2/utils/index.js";
|
6
|
+
import { getNodeCardBasedIcon as j } from "../chapters-v2/utils/node-card-utils.js";
|
7
7
|
import G from "../puzzles/comps/puzzle-card.js";
|
8
|
-
import
|
9
|
-
import
|
10
|
-
import
|
11
|
-
import V from "
|
12
|
-
import
|
13
|
-
import
|
8
|
+
import h from "../ui/arrow-tooltip/arrow-tooltip.js";
|
9
|
+
import U from "../ui/image/image.js";
|
10
|
+
import t from "../ui/layout/flex-view.js";
|
11
|
+
import V from "../ui/lottie-animation/lottie-animation.js";
|
12
|
+
import K from "./card-title.js";
|
13
|
+
import C from "./node-progress.js";
|
14
|
+
import { PuzzleCardWrapper as Z, HeaderText as _, CardWrapper as F, IconWrapper as M, BannerImageWrapper as q, BannerImage as J, SubHeaderText as Q } from "./styles.js";
|
14
15
|
const Y = { renderer: "canvas", autoplay: !1 }, ee = ({
|
15
|
-
header:
|
16
|
-
isInQueue:
|
17
|
-
nodeData:
|
18
|
-
studentContainerRef:
|
19
|
-
subHeader:
|
16
|
+
header: $,
|
17
|
+
isInQueue: y,
|
18
|
+
nodeData: x,
|
19
|
+
studentContainerRef: g,
|
20
|
+
subHeader: z,
|
20
21
|
userType: c,
|
21
|
-
isMilestone: d = !1
|
22
|
-
puzzleHWCardRef: y
|
22
|
+
isMilestone: d = !1
|
23
23
|
}) => {
|
24
24
|
const {
|
25
|
-
node_type:
|
25
|
+
node_type: r,
|
26
26
|
state: m,
|
27
27
|
accuracy: f,
|
28
|
-
due_date_ts:
|
29
|
-
image_url:
|
30
|
-
image_hue:
|
31
|
-
card_header:
|
32
|
-
unlocked_on_ts:
|
28
|
+
due_date_ts: o,
|
29
|
+
image_url: u,
|
30
|
+
image_hue: i,
|
31
|
+
card_header: E = "",
|
32
|
+
unlocked_on_ts: l,
|
33
33
|
course_type: A,
|
34
34
|
title: k
|
35
|
-
} =
|
36
|
-
var
|
37
|
-
(
|
38
|
-
}, []),
|
39
|
-
var
|
40
|
-
(
|
35
|
+
} = x, D = r === "PUZZLE_CARD", w = c === "STUDENT" && m === "LOCKED", [N, H] = B(!1), s = T(null), S = W(r), p = T(null), { lottie: v } = j(r), L = I(() => {
|
36
|
+
var a;
|
37
|
+
(a = p.current) == null || a.play();
|
38
|
+
}, []), O = I(() => {
|
39
|
+
var a;
|
40
|
+
(a = p.current) == null || a.stop();
|
41
41
|
}, []);
|
42
42
|
return R(() => {
|
43
|
-
|
43
|
+
s.current && s.current.scrollHeight > s.current.clientHeight && H(!0);
|
44
44
|
}, []), D ? /* @__PURE__ */ e(
|
45
|
-
|
45
|
+
h,
|
46
46
|
{
|
47
47
|
renderAs: "primary",
|
48
48
|
tooltipItem: "Solve puzzle after class",
|
49
49
|
position: "bottom",
|
50
|
-
hidden: !
|
51
|
-
children: /* @__PURE__ */
|
52
|
-
|
50
|
+
hidden: !w,
|
51
|
+
children: /* @__PURE__ */ n(
|
52
|
+
Z,
|
53
53
|
{
|
54
|
-
ref:
|
54
|
+
ref: g,
|
55
55
|
$position: "relative",
|
56
|
-
$background: `${
|
57
|
-
$disabled:
|
56
|
+
$background: `${i}_2`,
|
57
|
+
$disabled: w,
|
58
58
|
children: [
|
59
|
-
/* @__PURE__ */ e(
|
59
|
+
/* @__PURE__ */ e(t, { $width: 126, $height: 160, $justifyContent: "center", $alignItems: "center", children: /* @__PURE__ */ e(
|
60
60
|
G,
|
61
61
|
{
|
62
|
-
imageHue:
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
62
|
+
imageHue: i,
|
63
|
+
backgroundColor: `${i}_2`,
|
64
|
+
width: "100%",
|
65
|
+
height: "100%",
|
66
|
+
children: /* @__PURE__ */ n(t, { $justifyContent: "center", $alignItems: "center", $flexGap: 12, children: [
|
67
|
+
/* @__PURE__ */ e(
|
68
|
+
U,
|
69
|
+
{
|
70
|
+
src: u ?? "",
|
71
|
+
width: 68,
|
72
|
+
height: 68,
|
73
|
+
withLoader: !1,
|
74
|
+
alt: "Puzzle"
|
75
|
+
}
|
76
|
+
),
|
77
|
+
/* @__PURE__ */ e(_, { $renderAs: "ab3", $align: "center", $width: "80%", children: k })
|
78
|
+
] })
|
67
79
|
}
|
68
|
-
),
|
80
|
+
) }),
|
69
81
|
/* @__PURE__ */ e(
|
70
|
-
|
82
|
+
b,
|
71
83
|
{
|
72
|
-
nodeType:
|
84
|
+
nodeType: r,
|
73
85
|
state: m,
|
74
86
|
accuracy: f,
|
75
|
-
dueDateTs:
|
87
|
+
dueDateTs: o,
|
76
88
|
isStudent: c === "STUDENT",
|
77
89
|
isMilestone: d
|
78
90
|
}
|
79
91
|
),
|
80
|
-
!d &&
|
81
|
-
|
92
|
+
!d && o && l && /* @__PURE__ */ e(
|
93
|
+
C,
|
82
94
|
{
|
83
|
-
dueDate:
|
84
|
-
unlockedOn:
|
85
|
-
progressBg: `${
|
95
|
+
dueDate: o * 1e3,
|
96
|
+
unlockedOn: l * 1e3,
|
97
|
+
progressBg: `${i || "ORANGE"}_5`
|
86
98
|
}
|
87
99
|
)
|
88
100
|
]
|
89
101
|
}
|
90
|
-
)
|
102
|
+
)
|
91
103
|
}
|
92
104
|
) : /* @__PURE__ */ n(
|
93
|
-
|
105
|
+
t,
|
94
106
|
{
|
95
|
-
ref:
|
107
|
+
ref: g,
|
96
108
|
$widthX: 12.38,
|
97
109
|
$position: "relative",
|
98
|
-
$background: `${
|
99
|
-
onMouseEnter:
|
100
|
-
onMouseLeave:
|
110
|
+
$background: `${i || "ORANGE"}_2`,
|
111
|
+
onMouseEnter: L,
|
112
|
+
onMouseLeave: O,
|
101
113
|
children: [
|
102
114
|
/* @__PURE__ */ n(
|
103
|
-
|
115
|
+
F,
|
104
116
|
{
|
105
117
|
$flexDirection: "row",
|
106
118
|
$alignItems: "center",
|
107
119
|
$width: "100%",
|
108
120
|
$heightX: 3.5,
|
109
|
-
$bgImage:
|
121
|
+
$bgImage: S,
|
110
122
|
$gutterX: 0.78125,
|
111
123
|
$flexGap: 8.5,
|
112
124
|
$position: "relative",
|
113
125
|
children: [
|
114
126
|
/* @__PURE__ */ e(
|
115
|
-
|
127
|
+
M,
|
116
128
|
{
|
117
129
|
$width: 31,
|
118
130
|
$height: 31,
|
@@ -121,67 +133,67 @@ const Y = { renderer: "canvas", autoplay: !1 }, ee = ({
|
|
121
133
|
$position: "relative",
|
122
134
|
$alignItems: "center",
|
123
135
|
$justifyContent: "center",
|
124
|
-
children: /* @__PURE__ */ e(
|
136
|
+
children: /* @__PURE__ */ e(V, { src: v, ref: p, settings: Y })
|
125
137
|
}
|
126
138
|
),
|
127
|
-
/* @__PURE__ */ e(
|
128
|
-
|
129
|
-
|
139
|
+
/* @__PURE__ */ e(K, { cardHeader: E, nodeType: r, courseType: A }),
|
140
|
+
y && /* @__PURE__ */ e(
|
141
|
+
h,
|
130
142
|
{
|
131
143
|
renderAs: "primary",
|
132
144
|
tooltipItem: "Not visible to student",
|
133
145
|
position: "bottom",
|
134
146
|
zIndex: 6,
|
135
|
-
children: /* @__PURE__ */ e(
|
147
|
+
children: /* @__PURE__ */ e(P, {})
|
136
148
|
}
|
137
149
|
),
|
138
|
-
!!
|
150
|
+
!!u && /* @__PURE__ */ e(q, { children: /* @__PURE__ */ e(J, { src: u, alt: "Chapter image" }) })
|
139
151
|
]
|
140
152
|
}
|
141
153
|
),
|
142
154
|
/* @__PURE__ */ e(
|
143
|
-
|
155
|
+
b,
|
144
156
|
{
|
145
|
-
nodeType:
|
157
|
+
nodeType: r,
|
146
158
|
state: m,
|
147
159
|
accuracy: f,
|
148
|
-
dueDateTs:
|
160
|
+
dueDateTs: o,
|
149
161
|
isStudent: c === "STUDENT",
|
150
162
|
isMilestone: d
|
151
163
|
}
|
152
164
|
),
|
153
|
-
!d &&
|
154
|
-
|
165
|
+
!d && o && l && /* @__PURE__ */ e(
|
166
|
+
C,
|
155
167
|
{
|
156
|
-
dueDate:
|
157
|
-
unlockedOn:
|
158
|
-
progressBg: `${
|
168
|
+
dueDate: o * 1e3,
|
169
|
+
unlockedOn: l * 1e3,
|
170
|
+
progressBg: `${i || "ORANGE"}_4`
|
159
171
|
}
|
160
172
|
),
|
161
|
-
/* @__PURE__ */ n(
|
173
|
+
/* @__PURE__ */ n(t, { $gutterX: 0.75, $gapX: 1, $flexRowGapX: 0.5, $background: "WHITE", children: [
|
162
174
|
/* @__PURE__ */ e(
|
163
|
-
|
175
|
+
h,
|
164
176
|
{
|
165
177
|
renderAs: "primary",
|
166
178
|
position: "bottom",
|
167
|
-
tooltipItem:
|
179
|
+
tooltipItem: $,
|
168
180
|
width: 300,
|
169
181
|
hidden: !N,
|
170
182
|
parentWidth: "auto",
|
171
183
|
zIndex: 6,
|
172
|
-
children: /* @__PURE__ */ e(
|
184
|
+
children: /* @__PURE__ */ e(t, { $heightX: 2.5, children: /* @__PURE__ */ e(_, { ref: s, $renderAs: "ab3", children: $ }) })
|
173
185
|
}
|
174
186
|
),
|
175
187
|
/* @__PURE__ */ n(
|
176
|
-
|
188
|
+
t,
|
177
189
|
{
|
178
190
|
$flexDirection: "row",
|
179
191
|
$heightX: 1.25,
|
180
192
|
$alignItems: "center",
|
181
193
|
$justifyContent: "space-between",
|
182
194
|
children: [
|
183
|
-
/* @__PURE__ */ e(Q, { $renderAs: "ub3", $color: "BLACK_T_60", children:
|
184
|
-
/* @__PURE__ */ e(
|
195
|
+
/* @__PURE__ */ e(Q, { $renderAs: "ub3", $color: "BLACK_T_60", children: z }),
|
196
|
+
/* @__PURE__ */ e(t, { $width: 32 })
|
185
197
|
]
|
186
198
|
}
|
187
199
|
)
|
@@ -189,8 +201,8 @@ const Y = { renderer: "canvas", autoplay: !1 }, ee = ({
|
|
189
201
|
]
|
190
202
|
}
|
191
203
|
);
|
192
|
-
},
|
204
|
+
}, $e = X(ee);
|
193
205
|
export {
|
194
|
-
|
206
|
+
$e as default
|
195
207
|
};
|
196
208
|
//# sourceMappingURL=homework-card-view.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"homework-card-view.js","sources":["../../../src/features/homework/homework-card-view.tsx"],"sourcesContent":["import type { INodeDataProps } from '../chapters-v2/comps/node-card/node-card-types';\nimport type { ILottieAnimationRef } from '../ui/lottie-animation/types';\nimport type { TUserTypes } from '../ui/types';\nimport type { FC } from 'react';\n\nimport { memo, useCallback, useLayoutEffect, useRef, useState } from 'react';\n\nimport ClosedEyeIcon from '../../assets/line-icons/icons/closed-eye';\nimport NodeCardTags from '../chapters-v2/comps/node-card/node-card-tags';\nimport { getNodeTypeBasedBgImage } from '../chapters-v2/utils';\nimport { getNodeCardBasedIcon } from '../chapters-v2/utils/node-card-utils';\nimport PuzzleCard from '../puzzles/comps/puzzle-card';\nimport ArrowTooltip from '../ui/arrow-tooltip/arrow-tooltip';\nimport FlexView from '../ui/layout/flex-view';\nimport LottieAnimation from '../ui/lottie-animation/lottie-animation';\nimport CardTitle from './card-title';\nimport NodeProgress from './node-progress';\nimport * as Styled from './styles';\n\nconst renderSettings = { renderer: 'canvas', autoplay: false };\n\ninterface IHomeworkCardViewProps {\n header: string;\n isInQueue?: boolean;\n nodeData: INodeDataProps;\n studentContainerRef: React.RefObject<HTMLDivElement>;\n subHeader: string;\n userType: TUserTypes;\n isMilestone?: boolean;\n puzzleHWCardRef?: React.RefObject<HTMLDivElement>;\n}\n\nconst HomeworkView: FC<IHomeworkCardViewProps> = ({\n header,\n isInQueue,\n nodeData,\n studentContainerRef,\n subHeader,\n userType,\n isMilestone = false,\n puzzleHWCardRef,\n}) => {\n const {\n node_type: nodeType,\n state,\n accuracy,\n due_date_ts: dueDateTs,\n image_url: imageUrl,\n image_hue: imageHue,\n card_header: cardHeader = '',\n unlocked_on_ts: unlockedOnTs,\n course_type: courseType,\n title,\n } = nodeData;\n const isPuzzleCard = nodeType === 'PUZZLE_CARD';\n const isPuzzleDisabled = userType === 'STUDENT' && state === 'LOCKED';\n\n const [showTitleTooltip, setShowTitleTooltip] = useState(false);\n const titleTextRef = useRef<HTMLDivElement>(null);\n const bgImage = getNodeTypeBasedBgImage(nodeType);\n const animationRef = useRef<ILottieAnimationRef | null>(null);\n const { lottie: nodeCardLottie } = getNodeCardBasedIcon(nodeType);\n\n const handleOnMouseEnter = useCallback(() => {\n animationRef.current?.play();\n }, []);\n\n const handleOnMouseLeave = useCallback(() => {\n animationRef.current?.stop();\n }, []);\n\n useLayoutEffect(() => {\n if (\n titleTextRef.current &&\n titleTextRef.current.scrollHeight > titleTextRef.current.clientHeight\n ) {\n setShowTitleTooltip(true);\n }\n }, []);\n\n if (isPuzzleCard) {\n return (\n <ArrowTooltip\n renderAs=\"primary\"\n tooltipItem=\"Solve puzzle after class\"\n position=\"bottom\"\n hidden={!isPuzzleDisabled}\n >\n <div ref={puzzleHWCardRef}>\n <Styled.PuzzleCardWrapper\n ref={studentContainerRef}\n $position=\"relative\"\n $background={`${imageHue}_2`}\n $disabled={isPuzzleDisabled}\n >\n <PuzzleCard\n imageHue={imageHue}\n imageUrl={imageUrl ?? ''}\n title={title}\n width={126}\n height={159}\n />\n\n <NodeCardTags\n nodeType={nodeType}\n state={state}\n accuracy={accuracy}\n dueDateTs={dueDateTs}\n isStudent={userType === 'STUDENT'}\n isMilestone={isMilestone}\n />\n {!isMilestone && dueDateTs && unlockedOnTs && (\n <NodeProgress\n dueDate={dueDateTs * 1000}\n unlockedOn={unlockedOnTs * 1000}\n progressBg={`${imageHue || 'ORANGE'}_5`}\n />\n )}\n </Styled.PuzzleCardWrapper>\n </div>\n </ArrowTooltip>\n );\n }\n\n return (\n <FlexView\n ref={studentContainerRef}\n $widthX={12.38}\n $position=\"relative\"\n $background={`${imageHue || 'ORANGE'}_2`}\n onMouseEnter={handleOnMouseEnter}\n onMouseLeave={handleOnMouseLeave}\n >\n <Styled.CardWrapper\n $flexDirection=\"row\"\n $alignItems=\"center\"\n $width=\"100%\"\n $heightX={3.5}\n $bgImage={bgImage}\n $gutterX={0.78125}\n $flexGap={8.5}\n $position=\"relative\"\n >\n <Styled.IconWrapper\n $width={31}\n $height={31}\n $borderRadiusX={2}\n $background=\"WHITE_1\"\n $position=\"relative\"\n $alignItems=\"center\"\n $justifyContent=\"center\"\n >\n <LottieAnimation src={nodeCardLottie} ref={animationRef} settings={renderSettings} />\n </Styled.IconWrapper>\n <CardTitle cardHeader={cardHeader} nodeType={nodeType} courseType={courseType} />\n {isInQueue && (\n <ArrowTooltip\n renderAs=\"primary\"\n tooltipItem=\"Not visible to student\"\n position=\"bottom\"\n zIndex={6}\n >\n <ClosedEyeIcon />\n </ArrowTooltip>\n )}\n {!!imageUrl && (\n <Styled.BannerImageWrapper>\n <Styled.BannerImage src={imageUrl} alt=\"Chapter image\" />\n </Styled.BannerImageWrapper>\n )}\n </Styled.CardWrapper>\n <NodeCardTags\n nodeType={nodeType}\n state={state}\n accuracy={accuracy}\n dueDateTs={dueDateTs}\n isStudent={userType === 'STUDENT'}\n isMilestone={isMilestone}\n />\n {!isMilestone && dueDateTs && unlockedOnTs && (\n <NodeProgress\n dueDate={dueDateTs * 1000}\n unlockedOn={unlockedOnTs * 1000}\n progressBg={`${imageHue || 'ORANGE'}_4`}\n />\n )}\n <FlexView $gutterX={0.75} $gapX={1} $flexRowGapX={0.5} $background=\"WHITE\">\n <ArrowTooltip\n renderAs=\"primary\"\n position=\"bottom\"\n tooltipItem={header}\n width={300}\n hidden={!showTitleTooltip}\n parentWidth=\"auto\"\n zIndex={6}\n >\n <FlexView $heightX={2.5}>\n <Styled.HeaderText ref={titleTextRef} $renderAs=\"ab3\">\n {header}\n </Styled.HeaderText>\n </FlexView>\n </ArrowTooltip>\n <FlexView\n $flexDirection=\"row\"\n $heightX={1.25}\n $alignItems=\"center\"\n $justifyContent=\"space-between\"\n >\n <Styled.SubHeaderText $renderAs=\"ub3\" $color=\"BLACK_T_60\">\n {subHeader}\n </Styled.SubHeaderText>\n <FlexView $width={32} />\n </FlexView>\n </FlexView>\n </FlexView>\n );\n};\n\nexport default memo(HomeworkView);\n"],"names":["renderSettings","HomeworkView","header","isInQueue","nodeData","studentContainerRef","subHeader","userType","isMilestone","puzzleHWCardRef","nodeType","state","accuracy","dueDateTs","imageUrl","imageHue","cardHeader","unlockedOnTs","courseType","title","isPuzzleCard","isPuzzleDisabled","showTitleTooltip","setShowTitleTooltip","useState","titleTextRef","useRef","bgImage","getNodeTypeBasedBgImage","animationRef","nodeCardLottie","getNodeCardBasedIcon","handleOnMouseEnter","useCallback","_a","handleOnMouseLeave","useLayoutEffect","jsx","ArrowTooltip","jsxs","Styled.PuzzleCardWrapper","PuzzleCard","NodeCardTags","NodeProgress","FlexView","Styled.CardWrapper","Styled.IconWrapper","LottieAnimation","CardTitle","ClosedEyeIcon","Styled.BannerImageWrapper","Styled.BannerImage","Styled.HeaderText","Styled.SubHeaderText","HomeworkCardView","memo"],"mappings":";;;;;;;;;;;;;AAmBA,MAAMA,IAAiB,EAAE,UAAU,UAAU,UAAU,GAAM,GAavDC,KAA2C,CAAC;AAAA,EAChD,QAAAC;AAAA,EACA,WAAAC;AAAA,EACA,UAAAC;AAAA,EACA,qBAAAC;AAAA,EACA,WAAAC;AAAA,EACA,UAAAC;AAAA,EACA,aAAAC,IAAc;AAAA,EACd,iBAAAC;AACF,MAAM;AACE,QAAA;AAAA,IACJ,WAAWC;AAAA,IACX,OAAAC;AAAA,IACA,UAAAC;AAAA,IACA,aAAaC;AAAA,IACb,WAAWC;AAAA,IACX,WAAWC;AAAA,IACX,aAAaC,IAAa;AAAA,IAC1B,gBAAgBC;AAAA,IAChB,aAAaC;AAAA,IACb,OAAAC;AAAA,EACE,IA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AAA+B,EAACO,GAAS,EAAA,QAAQ,GAAI,CAAA;AAAA,cAAA;AAAA,YAAA;AAAA,UACxB;AAAA,QAAA,GACF;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAGN,GAEeU,KAAAC,EAAKtD,EAAY;"}
|
1
|
+
{"version":3,"file":"homework-card-view.js","sources":["../../../src/features/homework/homework-card-view.tsx"],"sourcesContent":["import type { INodeDataProps } from '../chapters-v2/comps/node-card/node-card-types';\nimport type { ILottieAnimationRef } from '../ui/lottie-animation/types';\nimport type { TUserTypes } from '../ui/types';\nimport type { FC } from 'react';\n\nimport { memo, useCallback, useLayoutEffect, useRef, useState } from 'react';\n\nimport ClosedEyeIcon from '../../assets/line-icons/icons/closed-eye';\nimport NodeCardTags from '../chapters-v2/comps/node-card/node-card-tags';\nimport { getNodeTypeBasedBgImage } from '../chapters-v2/utils';\nimport { getNodeCardBasedIcon } from '../chapters-v2/utils/node-card-utils';\nimport PuzzleCard from '../puzzles/comps/puzzle-card';\nimport ArrowTooltip from '../ui/arrow-tooltip/arrow-tooltip';\nimport Image from '../ui/image/image';\nimport FlexView from '../ui/layout/flex-view';\nimport LottieAnimation from '../ui/lottie-animation/lottie-animation';\nimport CardTitle from './card-title';\nimport NodeProgress from './node-progress';\nimport * as Styled from './styles';\n\nconst renderSettings = { renderer: 'canvas', autoplay: false };\n\ninterface IHomeworkCardViewProps {\n header: string;\n isInQueue?: boolean;\n nodeData: INodeDataProps;\n studentContainerRef: React.RefObject<HTMLDivElement>;\n subHeader: string;\n userType: TUserTypes;\n isMilestone?: boolean;\n}\n\nconst HomeworkView: FC<IHomeworkCardViewProps> = ({\n header,\n isInQueue,\n nodeData,\n studentContainerRef,\n subHeader,\n userType,\n isMilestone = false,\n}) => {\n const {\n node_type: nodeType,\n state,\n accuracy,\n due_date_ts: dueDateTs,\n image_url: imageUrl,\n image_hue: imageHue,\n card_header: cardHeader = '',\n unlocked_on_ts: unlockedOnTs,\n course_type: courseType,\n title,\n } = nodeData;\n const isPuzzleCard = nodeType === 'PUZZLE_CARD';\n const isPuzzleDisabled = userType === 'STUDENT' && state === 'LOCKED';\n\n const [showTitleTooltip, setShowTitleTooltip] = useState(false);\n const titleTextRef = useRef<HTMLDivElement>(null);\n const bgImage = getNodeTypeBasedBgImage(nodeType);\n const animationRef = useRef<ILottieAnimationRef | null>(null);\n const { lottie: nodeCardLottie } = getNodeCardBasedIcon(nodeType);\n\n const handleOnMouseEnter = useCallback(() => {\n animationRef.current?.play();\n }, []);\n\n const handleOnMouseLeave = useCallback(() => {\n animationRef.current?.stop();\n }, []);\n\n useLayoutEffect(() => {\n if (\n titleTextRef.current &&\n titleTextRef.current.scrollHeight > titleTextRef.current.clientHeight\n ) {\n setShowTitleTooltip(true);\n }\n }, []);\n\n if (isPuzzleCard) {\n return (\n <ArrowTooltip\n renderAs=\"primary\"\n tooltipItem=\"Solve puzzle after class\"\n position=\"bottom\"\n hidden={!isPuzzleDisabled}\n >\n <Styled.PuzzleCardWrapper\n ref={studentContainerRef}\n $position=\"relative\"\n $background={`${imageHue}_2`}\n $disabled={isPuzzleDisabled}\n >\n <FlexView $width={126} $height={160} $justifyContent=\"center\" $alignItems=\"center\">\n <PuzzleCard\n imageHue={imageHue}\n backgroundColor={`${imageHue}_2`}\n width=\"100%\"\n height=\"100%\"\n >\n <FlexView $justifyContent=\"center\" $alignItems=\"center\" $flexGap={12}>\n <Image\n src={imageUrl ?? ''}\n width={68}\n height={68}\n withLoader={false}\n alt=\"Puzzle\"\n />\n\n <Styled.HeaderText $renderAs=\"ab3\" $align=\"center\" $width=\"80%\">\n {title}\n </Styled.HeaderText>\n </FlexView>\n </PuzzleCard>\n </FlexView>\n\n <NodeCardTags\n nodeType={nodeType}\n state={state}\n accuracy={accuracy}\n dueDateTs={dueDateTs}\n isStudent={userType === 'STUDENT'}\n isMilestone={isMilestone}\n />\n {!isMilestone && dueDateTs && unlockedOnTs && (\n <NodeProgress\n dueDate={dueDateTs * 1000}\n unlockedOn={unlockedOnTs * 1000}\n progressBg={`${imageHue || 'ORANGE'}_5`}\n />\n )}\n </Styled.PuzzleCardWrapper>\n </ArrowTooltip>\n );\n }\n\n return (\n <FlexView\n ref={studentContainerRef}\n $widthX={12.38}\n $position=\"relative\"\n $background={`${imageHue || 'ORANGE'}_2`}\n onMouseEnter={handleOnMouseEnter}\n onMouseLeave={handleOnMouseLeave}\n >\n <Styled.CardWrapper\n $flexDirection=\"row\"\n $alignItems=\"center\"\n $width=\"100%\"\n $heightX={3.5}\n $bgImage={bgImage}\n $gutterX={0.78125}\n $flexGap={8.5}\n $position=\"relative\"\n >\n <Styled.IconWrapper\n $width={31}\n $height={31}\n $borderRadiusX={2}\n $background=\"WHITE_1\"\n $position=\"relative\"\n $alignItems=\"center\"\n $justifyContent=\"center\"\n >\n <LottieAnimation src={nodeCardLottie} ref={animationRef} settings={renderSettings} />\n </Styled.IconWrapper>\n <CardTitle cardHeader={cardHeader} nodeType={nodeType} courseType={courseType} />\n {isInQueue && (\n <ArrowTooltip\n renderAs=\"primary\"\n tooltipItem=\"Not visible to student\"\n position=\"bottom\"\n zIndex={6}\n >\n <ClosedEyeIcon />\n </ArrowTooltip>\n )}\n {!!imageUrl && (\n <Styled.BannerImageWrapper>\n <Styled.BannerImage src={imageUrl} alt=\"Chapter image\" />\n </Styled.BannerImageWrapper>\n )}\n </Styled.CardWrapper>\n <NodeCardTags\n nodeType={nodeType}\n state={state}\n accuracy={accuracy}\n dueDateTs={dueDateTs}\n isStudent={userType === 'STUDENT'}\n isMilestone={isMilestone}\n />\n {!isMilestone && dueDateTs && unlockedOnTs && (\n <NodeProgress\n dueDate={dueDateTs * 1000}\n unlockedOn={unlockedOnTs * 1000}\n progressBg={`${imageHue || 'ORANGE'}_4`}\n />\n )}\n <FlexView $gutterX={0.75} $gapX={1} $flexRowGapX={0.5} $background=\"WHITE\">\n <ArrowTooltip\n renderAs=\"primary\"\n position=\"bottom\"\n tooltipItem={header}\n width={300}\n hidden={!showTitleTooltip}\n parentWidth=\"auto\"\n zIndex={6}\n >\n <FlexView $heightX={2.5}>\n <Styled.HeaderText ref={titleTextRef} $renderAs=\"ab3\">\n {header}\n </Styled.HeaderText>\n </FlexView>\n </ArrowTooltip>\n <FlexView\n $flexDirection=\"row\"\n $heightX={1.25}\n $alignItems=\"center\"\n $justifyContent=\"space-between\"\n >\n <Styled.SubHeaderText $renderAs=\"ub3\" $color=\"BLACK_T_60\">\n {subHeader}\n </Styled.SubHeaderText>\n <FlexView $width={32} />\n </FlexView>\n </FlexView>\n </FlexView>\n );\n};\n\nexport default memo(HomeworkView);\n"],"names":["renderSettings","HomeworkView","header","isInQueue","nodeData","studentContainerRef","subHeader","userType","isMilestone","nodeType","state","accuracy","dueDateTs","imageUrl","imageHue","cardHeader","unlockedOnTs","courseType","title","isPuzzleCard","isPuzzleDisabled","showTitleTooltip","setShowTitleTooltip","useState","titleTextRef","useRef","bgImage","getNodeTypeBasedBgImage","animationRef","nodeCardLottie","getNodeCardBasedIcon","handleOnMouseEnter","useCallback","_a","handleOnMouseLeave","useLayoutEffect","jsx","ArrowTooltip","jsxs","Styled.PuzzleCardWrapper","FlexView","PuzzleCard","Image","Styled.HeaderText","NodeCardTags","NodeProgress","Styled.CardWrapper","Styled.IconWrapper","LottieAnimation","CardTitle","ClosedEyeIcon","Styled.BannerImageWrapper","Styled.BannerImage","Styled.SubHeaderText","HomeworkView$1","memo"],"mappings":";;;;;;;;;;;;;;AAoBA,MAAMA,IAAiB,EAAE,UAAU,UAAU,UAAU,GAAM,GAYvDC,KAA2C,CAAC;AAAA,EAChD,QAAAC;AAAA,EACA,WAAAC;AAAA,EACA,UAAAC;AAAA,EACA,qBAAAC;AAAA,EACA,WAAAC;AAAA,EACA,UAAAC;AAAA,EACA,aAAAC,IAAc;AAChB,MAAM;AACE,QAAA;AAAA,IACJ,WAAWC;AAAA,IACX,OAAAC;AAAA,IACA,UAAAC;AAAA,IACA,aAAaC;AAAA,IACb,WAAWC;AAAA,IACX,WAAWC;A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AS;AAAA,cACT,UAAS;AAAA,cACT,aAAanC;AAAA,cACb,OAAO;AAAA,cACP,QAAQ,CAACmB;AAAA,cACT,aAAY;AAAA,cACZ,QAAQ;AAAA,cAER,UAAC,gBAAAe,EAAAI,GAAA,EAAS,UAAU,KAClB,UAAC,gBAAAJ,EAAAO,GAAA,EAAkB,KAAKnB,GAAc,WAAU,OAC7C,YACH,CAAA,GACF;AAAA,YAAA;AAAA,UACF;AAAA,UACA,gBAAAc;AAAA,YAACE;AAAA,YAAA;AAAA,cACC,gBAAe;AAAA,cACf,UAAU;AAAA,cACV,aAAY;AAAA,cACZ,iBAAgB;AAAA,cAEhB,UAAA;AAAA,gBAAA,gBAAAJ,EAACiB,GAAA,EAAqB,WAAU,OAAM,QAAO,cAC1C,UACH/C,GAAA;AAAA,gBACA,gBAAA8B,EAACI,GAAS,EAAA,QAAQ,GAAI,CAAA;AAAA,cAAA;AAAA,YAAA;AAAA,UACxB;AAAA,QAAA,GACF;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAGN,GAEec,KAAAC,EAAKtD,EAAY;"}
|
@@ -1,18 +1,18 @@
|
|
1
1
|
import { jsxs as x, jsx as t } from "react/jsx-runtime";
|
2
|
-
import { memo as
|
2
|
+
import { memo as te, useRef as L, useCallback as w, useMemo as ie } from "react";
|
3
3
|
import P from "../../assets/line-icons/icons/eye2.js";
|
4
|
-
import
|
5
|
-
import
|
4
|
+
import ne from "../../assets/line-icons/icons/home2.js";
|
5
|
+
import ce from "../../assets/line-icons/icons/more-vertical.js";
|
6
6
|
import X from "../../assets/line-icons/icons/redo.js";
|
7
7
|
import H from "../ui/arrow-tooltip/arrow-tooltip.js";
|
8
|
-
import
|
8
|
+
import oe from "../ui/buttons/clickable/clickable.js";
|
9
9
|
import j from "../ui/hooks/use-context-menu-click-handler.js";
|
10
|
-
import
|
10
|
+
import se from "../ui/layout/flex-view.js";
|
11
11
|
import z from "./card-menu-options.js";
|
12
|
-
import
|
13
|
-
import { CardContainer as
|
14
|
-
import { getCardAnalyticProps as
|
15
|
-
const
|
12
|
+
import ae from "./homework-card-view.js";
|
13
|
+
import { CardContainer as le, MenuWrapper as ue, CardKebabMenuWrapper as de, BlurContainer as he, BlurFlexView as me, StyledMinus2Icon as fe } from "./styles.js";
|
14
|
+
import { getCardAnalyticProps as pe } from "./utils.js";
|
15
|
+
const be = ({
|
16
16
|
// callbacks
|
17
17
|
nodeData: e,
|
18
18
|
onNodeAttempt: C,
|
@@ -28,24 +28,23 @@ const we = ({
|
|
28
28
|
studentId: I,
|
29
29
|
subHeader: K,
|
30
30
|
userMilestoneId: Z,
|
31
|
-
userType: v
|
32
|
-
puzzleHWCardRef: Y
|
31
|
+
userType: v
|
33
32
|
}) => {
|
34
33
|
const i = E === "homework", {
|
35
34
|
node_type: m,
|
36
35
|
state: R,
|
37
|
-
permissions:
|
36
|
+
permissions: Y,
|
38
37
|
user_node_id: c,
|
39
|
-
user_milestone_id:
|
38
|
+
user_milestone_id: q,
|
40
39
|
homework_id: o
|
41
|
-
} = e, r = Z ||
|
40
|
+
} = e, r = Z || q || "", g = m === "PUZZLE_CARD", G = R === "LOCKED", _ = L(null), M = L(null), { menuVisible: S, onMenuClick: J } = j(_), { menuVisible: Q, onMenuClick: V } = j(M), {
|
42
41
|
can_start: f,
|
43
42
|
can_resume: p,
|
44
43
|
can_review: s,
|
45
|
-
can_unassign:
|
44
|
+
can_unassign: U,
|
46
45
|
can_reset: O,
|
47
|
-
can_assign_as_homework:
|
48
|
-
} =
|
46
|
+
can_assign_as_homework: A
|
47
|
+
} = Y, a = v === "STUDENT", b = w(() => {
|
49
48
|
if (s) {
|
50
49
|
if (typeof n != "function")
|
51
50
|
throw new Error("onReview must be a function");
|
@@ -54,7 +53,7 @@ const we = ({
|
|
54
53
|
n(e, r);
|
55
54
|
return;
|
56
55
|
}
|
57
|
-
}, [s, n, c, e, r]),
|
56
|
+
}, [s, n, c, e, r]), D = w(() => {
|
58
57
|
if (f || p) {
|
59
58
|
if (typeof C != "function")
|
60
59
|
throw new Error("onNodeAttempt must be a function");
|
@@ -120,7 +119,7 @@ const we = ({
|
|
120
119
|
y,
|
121
120
|
r
|
122
121
|
]
|
123
|
-
),
|
122
|
+
), N = [
|
124
123
|
{
|
125
124
|
id: "teacher-card-view",
|
126
125
|
label: s ? "Review" : "View",
|
@@ -131,8 +130,8 @@ const we = ({
|
|
131
130
|
{
|
132
131
|
id: "teacher-card-unassign",
|
133
132
|
label: "Unassign",
|
134
|
-
icon:
|
135
|
-
disabled: i ? m === "MASTERY" : !
|
133
|
+
icon: fe,
|
134
|
+
disabled: i ? m === "MASTERY" : !U,
|
136
135
|
onClick: l
|
137
136
|
},
|
138
137
|
{
|
@@ -145,11 +144,11 @@ const we = ({
|
|
145
144
|
{
|
146
145
|
id: "teacher-card-assign-as-hw",
|
147
146
|
label: "Assign as HW",
|
148
|
-
icon:
|
149
|
-
disabled: !
|
147
|
+
icon: ne,
|
148
|
+
disabled: !A,
|
150
149
|
onClick: l
|
151
150
|
}
|
152
|
-
],
|
151
|
+
], ee = [
|
153
152
|
{
|
154
153
|
id: "student-card-view",
|
155
154
|
label: "Review",
|
@@ -164,8 +163,8 @@ const we = ({
|
|
164
163
|
disabled: !O,
|
165
164
|
onClick: l
|
166
165
|
}
|
167
|
-
], T =
|
168
|
-
() =>
|
166
|
+
], T = ie(
|
167
|
+
() => pe({
|
169
168
|
canResume: p,
|
170
169
|
canStart: f,
|
171
170
|
homeworkId: o,
|
@@ -187,18 +186,18 @@ const we = ({
|
|
187
186
|
c,
|
188
187
|
r
|
189
188
|
]
|
190
|
-
),
|
191
|
-
return /* @__PURE__ */ x(
|
189
|
+
), re = a && g && G;
|
190
|
+
return /* @__PURE__ */ x(le, { $position: "relative", $width: "fit-content", children: [
|
192
191
|
/* @__PURE__ */ t(
|
193
|
-
|
192
|
+
oe,
|
194
193
|
{
|
195
|
-
onClick: a ?
|
194
|
+
onClick: a ? D : y,
|
196
195
|
label: "homework-card",
|
197
196
|
analyticsLabel: T.analyticsLabel,
|
198
197
|
analyticsProps: T.analyticsProps,
|
199
|
-
disabled:
|
198
|
+
disabled: re,
|
200
199
|
children: /* @__PURE__ */ t(
|
201
|
-
|
200
|
+
ae,
|
202
201
|
{
|
203
202
|
header: F,
|
204
203
|
isInQueue: $,
|
@@ -206,8 +205,7 @@ const we = ({
|
|
206
205
|
studentContainerRef: M,
|
207
206
|
subHeader: K,
|
208
207
|
userType: v,
|
209
|
-
isMilestone: E === "milestone"
|
210
|
-
puzzleHWCardRef: Y
|
208
|
+
isMilestone: E === "milestone"
|
211
209
|
}
|
212
210
|
)
|
213
211
|
}
|
@@ -216,13 +214,13 @@ const we = ({
|
|
216
214
|
z,
|
217
215
|
{
|
218
216
|
$width: 200,
|
219
|
-
options:
|
217
|
+
options: ee,
|
220
218
|
triggerRef: M,
|
221
|
-
visible:
|
219
|
+
visible: Q,
|
222
220
|
shouldOpenOnRight: !1
|
223
221
|
}
|
224
222
|
),
|
225
|
-
!a && !g && /* @__PURE__ */ x(
|
223
|
+
!a && !g && /* @__PURE__ */ x(ue, { $position: "absolute", $width: "fit-content", $borderRadiusX: 2, children: [
|
226
224
|
/* @__PURE__ */ t(
|
227
225
|
H,
|
228
226
|
{
|
@@ -233,13 +231,13 @@ const we = ({
|
|
233
231
|
parentWidth: "100%",
|
234
232
|
hidden: S || R !== "WAIT_FOR_REVIEW" && i,
|
235
233
|
children: /* @__PURE__ */ t(
|
236
|
-
|
234
|
+
de,
|
237
235
|
{
|
238
236
|
$alignItems: "center",
|
239
237
|
$justifyContent: "center",
|
240
238
|
ref: _,
|
241
|
-
onClick:
|
242
|
-
children: /* @__PURE__ */ t(
|
239
|
+
onClick: J,
|
240
|
+
children: /* @__PURE__ */ t(ce, { width: 16, height: 16 })
|
243
241
|
}
|
244
242
|
)
|
245
243
|
}
|
@@ -247,7 +245,7 @@ const we = ({
|
|
247
245
|
/* @__PURE__ */ t(
|
248
246
|
z,
|
249
247
|
{
|
250
|
-
options:
|
248
|
+
options: N,
|
251
249
|
triggerRef: _,
|
252
250
|
visible: S,
|
253
251
|
shouldOpenOnRight: B,
|
@@ -255,10 +253,10 @@ const we = ({
|
|
255
253
|
}
|
256
254
|
)
|
257
255
|
] }),
|
258
|
-
$ && /* @__PURE__ */ t(
|
256
|
+
$ && /* @__PURE__ */ t(he, { $background: "WHITE_5", children: /* @__PURE__ */ t(me, { $heightX: 1, $widthX: 6, children: /* @__PURE__ */ t(H, { renderAs: "primary", tooltipItem: "Not visible to student", position: "bottom", children: /* @__PURE__ */ t(se, { $heightX: 1, $widthX: 6 }) }) }) })
|
259
257
|
] });
|
260
|
-
},
|
258
|
+
}, Oe = te(be);
|
261
259
|
export {
|
262
|
-
|
260
|
+
Oe as default
|
263
261
|
};
|
264
262
|
//# sourceMappingURL=homework-card.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"homework-card.js","sources":["../../../src/features/homework/homework-card.tsx"],"sourcesContent":["import type {\n INodeCardCallbacks,\n INodeDataProps,\n} from '../chapters-v2/comps/node-card/node-card-types';\nimport type { TUserTypes } from '../ui/types';\nimport type { FC } from 'react';\n\nimport React, { memo, useCallback, useMemo, useRef } from 'react';\n\nimport Eye2Icon from '../../assets/line-icons/icons/eye2';\nimport Home2Icon from '../../assets/line-icons/icons/home2';\nimport MoreVerticalIcon from '../../assets/line-icons/icons/more-vertical';\nimport RedoIcon from '../../assets/line-icons/icons/redo';\nimport ArrowTooltip from '../ui/arrow-tooltip/arrow-tooltip';\nimport Clickable from '../ui/buttons/clickable/clickable';\nimport useContextMenuClickHandler from '../ui/hooks/use-context-menu-click-handler';\nimport FlexView from '../ui/layout/flex-view';\nimport CardMenuOptions from './card-menu-options';\nimport HomeworkView from './homework-card-view';\nimport * as Styled from './styles';\nimport { getCardAnalyticProps } from './utils';\n\ninterface IHomeworkCardProps extends INodeCardCallbacks {\n header: string;\n nodeData: INodeDataProps;\n subHeader: string;\n userType: TUserTypes;\n studentId: string;\n userMilestoneId?: string;\n renderAs: 'homework' | 'milestone';\n shouldOpenOnRight: boolean;\n isInQueue?: boolean;\n puzzleHWCardRef?: React.RefObject<HTMLDivElement>;\n}\n\nconst HomeworkCard: FC<IHomeworkCardProps> = ({\n // callbacks\n nodeData,\n onNodeAttempt,\n onNodeReattempt,\n onNodeReview,\n onNodeUnassign,\n onNodeView,\n onNodeAssignAsHomework,\n\n header,\n isInQueue,\n renderAs,\n shouldOpenOnRight,\n studentId,\n subHeader,\n userMilestoneId,\n userType,\n puzzleHWCardRef,\n}) => {\n const isHomeWork = renderAs === 'homework';\n const {\n node_type: nodeType,\n state,\n permissions,\n user_node_id: userNodeId,\n user_milestone_id: nodeDataMilestoneId,\n homework_id: homeworkId,\n } = nodeData;\n\n const milestoneId = userMilestoneId || nodeDataMilestoneId || '';\n const isPuzzleCard = nodeType === 'PUZZLE_CARD';\n const isSheetLocked = state === 'LOCKED';\n\n const teacherContainerRef = useRef<HTMLDivElement>(null) as React.RefObject<HTMLDivElement>;\n const studentContainerRef = useRef<HTMLDivElement>(null) as React.RefObject<HTMLDivElement>;\n const { menuVisible: teacherMenuVisible, onMenuClick: onTeacherMenuClick } =\n useContextMenuClickHandler(teacherContainerRef);\n const { menuVisible: studentMenuVisible, onMenuClick: onStudentMenuClick } =\n useContextMenuClickHandler(studentContainerRef);\n\n const {\n can_start: canStart,\n can_resume: canResume,\n can_review: canReview,\n can_unassign: canUnassign,\n can_reset: canReset,\n can_assign_as_homework: canAssignAsHw,\n } = permissions;\n const isStudent = userType === 'STUDENT';\n\n const onStudentViewSheet = useCallback(() => {\n if (canReview) {\n if (typeof onNodeReview !== 'function') {\n throw new Error('onReview must be a function');\n }\n\n if (!userNodeId) {\n throw new Error('user node id must be present to review the sheet');\n }\n onNodeReview(nodeData, milestoneId);\n\n return;\n }\n }, [canReview, onNodeReview, userNodeId, nodeData, milestoneId]);\n\n const onStudentCardClick = useCallback(() => {\n if (canStart || canResume) {\n if (typeof onNodeAttempt !== 'function') {\n throw new Error('onNodeAttempt must be a function');\n }\n\n onNodeAttempt(nodeData, milestoneId, homeworkId);\n\n return;\n }\n\n if (!isHomeWork) {\n onStudentMenuClick();\n\n return;\n }\n onStudentViewSheet();\n }, [\n canStart,\n canResume,\n isHomeWork,\n onStudentViewSheet,\n onNodeAttempt,\n nodeData,\n milestoneId,\n homeworkId,\n onStudentMenuClick,\n ]);\n\n const onTeacherCardClick = useCallback(() => {\n if (canReview) {\n if (typeof onNodeReview !== 'function') {\n throw new Error('onNodeReview must be a function');\n }\n\n if (!userNodeId) {\n throw new Error('user node id must be present to review the sheet');\n }\n onNodeReview(nodeData, milestoneId, homeworkId);\n\n return;\n }\n\n if (typeof onNodeView !== 'function') {\n throw new Error('onNodeView must be a function');\n }\n\n onNodeView(nodeData, milestoneId);\n }, [canReview, onNodeView, nodeData, milestoneId, onNodeReview, userNodeId, homeworkId]);\n\n const handleOnMenuOptionClick = useCallback(\n (optionId: string) => {\n switch (optionId) {\n case 'teacher-card-view':\n onTeacherCardClick();\n\n return;\n case 'student-card-view':\n onStudentViewSheet();\n\n return;\n case 'teacher-card-unassign':\n onNodeUnassign?.(nodeData, milestoneId);\n\n return;\n case 'student-card-reattempt':\n case 'teacher-card-redo':\n onNodeReattempt?.(nodeData, milestoneId);\n\n return;\n\n case 'teacher-card-assign-as-hw':\n onNodeAssignAsHomework?.(nodeData, milestoneId);\n\n return;\n\n default:\n throw new Error(`No callback function for ${optionId}`);\n }\n },\n [\n nodeData,\n onNodeAssignAsHomework,\n onNodeReattempt,\n onNodeUnassign,\n onStudentViewSheet,\n onTeacherCardClick,\n milestoneId,\n ],\n );\n\n const teacherOptions = [\n {\n id: 'teacher-card-view',\n label: canReview ? 'Review' : 'View',\n icon: Eye2Icon,\n disabled: false,\n onClick: handleOnMenuOptionClick,\n },\n {\n id: 'teacher-card-unassign',\n label: 'Unassign',\n icon: Styled.StyledMinus2Icon,\n disabled: isHomeWork ? nodeType === 'MASTERY' : !canUnassign,\n onClick: handleOnMenuOptionClick,\n },\n {\n id: 'teacher-card-redo',\n label: 'Redo',\n icon: RedoIcon,\n disabled: !canReset,\n onClick: handleOnMenuOptionClick,\n },\n {\n id: 'teacher-card-assign-as-hw',\n label: 'Assign as HW',\n icon: Home2Icon,\n disabled: !canAssignAsHw,\n onClick: handleOnMenuOptionClick,\n },\n ];\n\n const studentOptions = [\n {\n id: 'student-card-view',\n label: 'Review',\n icon: Eye2Icon,\n disabled: !canReview,\n onClick: handleOnMenuOptionClick,\n },\n {\n id: 'student-card-reattempt',\n label: 'Reattempt',\n icon: RedoIcon,\n disabled: !canReset,\n onClick: handleOnMenuOptionClick,\n },\n ];\n\n const analyticsLabel = useMemo(\n () =>\n getCardAnalyticProps({\n canResume,\n canStart,\n homeworkId,\n isHomeWork,\n isStudent,\n milestoneId,\n nodeType,\n studentId,\n userNodeId,\n }),\n [\n isStudent,\n isHomeWork,\n studentId,\n nodeType,\n canStart,\n canResume,\n homeworkId,\n userNodeId,\n milestoneId,\n ],\n );\n\n const isClickableDisabled = isStudent && isPuzzleCard && isSheetLocked;\n\n return (\n <Styled.CardContainer $position=\"relative\" $width=\"fit-content\">\n <Clickable\n onClick={isStudent ? onStudentCardClick : onTeacherCardClick}\n label=\"homework-card\"\n analyticsLabel={analyticsLabel.analyticsLabel}\n analyticsProps={analyticsLabel.analyticsProps}\n disabled={isClickableDisabled}\n >\n <HomeworkView\n header={header}\n isInQueue={isInQueue}\n nodeData={nodeData}\n studentContainerRef={studentContainerRef}\n subHeader={subHeader}\n userType={userType}\n isMilestone={renderAs === 'milestone'}\n puzzleHWCardRef={puzzleHWCardRef}\n />\n </Clickable>\n {isStudent && !isHomeWork && (\n <CardMenuOptions\n $width={200}\n options={studentOptions}\n triggerRef={studentContainerRef}\n visible={studentMenuVisible}\n shouldOpenOnRight={false}\n />\n )}\n {!isStudent && !isPuzzleCard && (\n <Styled.MenuWrapper $position=\"absolute\" $width=\"fit-content\" $borderRadiusX={2}>\n <ArrowTooltip\n renderAs=\"primary\"\n tooltipItem=\"Review\"\n position=\"bottom\"\n zIndex={6}\n parentWidth=\"100%\"\n hidden={teacherMenuVisible || (state !== 'WAIT_FOR_REVIEW' && isHomeWork)}\n >\n <Styled.CardKebabMenuWrapper\n $alignItems=\"center\"\n $justifyContent=\"center\"\n ref={teacherContainerRef}\n onClick={onTeacherMenuClick}\n >\n <MoreVerticalIcon width={16} height={16} />\n </Styled.CardKebabMenuWrapper>\n </ArrowTooltip>\n <CardMenuOptions\n options={teacherOptions}\n triggerRef={teacherContainerRef}\n visible={teacherMenuVisible}\n shouldOpenOnRight={shouldOpenOnRight}\n $width={144}\n />\n </Styled.MenuWrapper>\n )}\n {isInQueue && (\n <Styled.BlurContainer $background=\"WHITE_5\">\n <Styled.BlurFlexView $heightX={1} $widthX={6}>\n <ArrowTooltip renderAs=\"primary\" tooltipItem=\"Not visible to student\" position=\"bottom\">\n <FlexView $heightX={1} $widthX={6} />\n </ArrowTooltip>\n </Styled.BlurFlexView>\n </Styled.BlurContainer>\n )}\n </Styled.CardContainer>\n );\n};\n\nexport default memo(HomeworkCard);\n"],"names":["HomeworkCard","nodeData","onNodeAttempt","onNodeReattempt","onNodeReview","onNodeUnassign","onNodeView","onNodeAssignAsHomework","header","isInQueue","renderAs","shouldOpenOnRight","studentId","subHeader","userMilestoneId","userType","puzzleHWCardRef","isHomeWork","nodeType","state","permissions","userNodeId","nodeDataMilestoneId","homeworkId","milestoneId","isPuzzleCard","isSheetLocked","teacherContainerRef","useRef","studentContainerRef","teacherMenuVisible","onTeacherMenuClick","useContextMenuClickHandler","studentMenuVisible","onStudentMenuClick","canStart","canResume","canReview","canUnassign","canReset","canAssignAsHw","isStudent","onStudentViewSheet","useCallback","onStudentCardClick","onTeacherCardClick","handleOnMenuOptionClick","optionId","teacherOptions","Eye2Icon","Styled.StyledMinus2Icon","RedoIcon","Home2Icon","studentOptions","analyticsLabel","useMemo","getCardAnalyticProps","isClickableDisabled","Styled.CardContainer","jsx","Clickable","HomeworkView","CardMenuOptions","jsxs","Styled.MenuWrapper","ArrowTooltip","Styled.CardKebabMenuWrapper","MoreVerticalIcon","Styled.BlurContainer","Styled.BlurFlexView","FlexView","HomeworkCard$1","memo"],"mappings":";;;;;;;;;;;;;;AAmCA,MAAMA,KAAuC,CAAC;AAAA;AAAA,EAE5C,UAAAC;AAAA,EACA,eAAAC;AAAA,EACA,iBAAAC;AAAA,EACA,cAAAC;AAAA,EACA,gBAAAC;AAAA,EACA,YAAAC;AAAA,EACA,wBAAAC;AAAA,EAEA,QAAAC;AAAA,EACA,WAAAC;AAAA,EACA,UAAAC;AAAA,EACA,mBAAAC;AAAA,EACA,WAAAC;AAAA,EACA,WAAAC;AAAA,EACA,iBAAAC;AAAA,EACA,UAAAC;AAAA,EACA,iBAAAC;AACF,MAAM;AACJ,QAAMC,IAAaP,MAAa,YAC1B;AAAA,IACJ,WAAWQ;AAAA,IACX,OAAAC;AAAA,IACA,aAAAC;AAAA,IACA,cAAcC;AAAA,IACd,mBAAmBC;AAAA,IACnB,aAAaC;AAAA,EACX,IAAAtB,GAEEuB,IAAcV,KAAmBQ,KAAuB,IACxDG,IAAeP,MAAa,eAC5BQ,IAAgBP,MAAU,UAE1BQ,IAAsBC,EAAuB,IAAI,GACjDC,IAAsBD,EAAuB,IAAI,GACjD,EAAE,aAAaE,GAAoB,aAAaC,MACpDC,EAA2BL,CAAmB,GAC1C,EAAE,aAAaM,GAAoB,aAAaC,MACpDF,EAA2BH,CAAmB,GAE1C;AAAA,IACJ,WAAWM;AAAA,IACX,YAAYC;AAAA,IACZ,YAAYC;AAAA,IACZ,cAAcC;AAAA,IACd,WAAWC;AAAA,IACX,wBAAwBC;AAAA,EACtB,IAAApB,GACEqB,IAAY1B,MAAa,WAEzB2B,IAAqBC,EAAY,MAAM;AAC3C,QAAIN,GAAW;AACT,UAAA,OAAOjC,KAAiB;AACpB,cAAA,IAAI,MAAM,6BAA6B;AAG/C,UAAI,CAACiB;AACG,cAAA,IAAI,MAAM,kDAAkD;AAEpE,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,iBAAgB;AAAA,cAChB,KAAKvC;AAAA,cACL,SAASI;AAAA,cAET,UAAC,gBAAA4B,EAAAQ,IAAA,EAAiB,OAAO,IAAI,QAAQ,IAAI;AAAA,YAAA;AAAA,UAC3C;AAAA,QAAA;AAAA,MACF;AAAA,MACA,gBAAAR;AAAA,QAACG;AAAA,QAAA;AAAA,UACC,SAASd;AAAA,UACT,YAAYrB;AAAA,UACZ,SAASG;AAAA,UACT,mBAAAnB;AAAA,UACA,QAAQ;AAAA,QAAA;AAAA,MACV;AAAA,IAAA,GACF;AAAA,IAEDF,KACC,gBAAAkD,EAACS,IAAA,EAAqB,aAAY,WAChC,UAAA,gBAAAT,EAACU,IAAA,EAAoB,UAAU,GAAG,SAAS,GACzC,UAAC,gBAAAV,EAAAM,GAAA,EAAa,UAAS,WAAU,aAAY,0BAAyB,UAAS,UAC7E,UAAA,gBAAAN,EAACW,IAAS,EAAA,UAAU,GAAG,SAAS,EAAG,CAAA,EACrC,CAAA,EACF,CAAA,GACF;AAAA,EAEJ,EAAA,CAAA;AAEJ,GAEeC,KAAAC,GAAKxE,EAAY;"}
|
1
|
+
{"version":3,"file":"homework-card.js","sources":["../../../src/features/homework/homework-card.tsx"],"sourcesContent":["import type {\n INodeCardCallbacks,\n INodeDataProps,\n} from '../chapters-v2/comps/node-card/node-card-types';\nimport type { TUserTypes } from '../ui/types';\nimport type { FC } from 'react';\n\nimport React, { memo, useCallback, useMemo, useRef } from 'react';\n\nimport Eye2Icon from '../../assets/line-icons/icons/eye2';\nimport Home2Icon from '../../assets/line-icons/icons/home2';\nimport MoreVerticalIcon from '../../assets/line-icons/icons/more-vertical';\nimport RedoIcon from '../../assets/line-icons/icons/redo';\nimport ArrowTooltip from '../ui/arrow-tooltip/arrow-tooltip';\nimport Clickable from '../ui/buttons/clickable/clickable';\nimport useContextMenuClickHandler from '../ui/hooks/use-context-menu-click-handler';\nimport FlexView from '../ui/layout/flex-view';\nimport CardMenuOptions from './card-menu-options';\nimport HomeworkView from './homework-card-view';\nimport * as Styled from './styles';\nimport { getCardAnalyticProps } from './utils';\n\ninterface IHomeworkCardProps extends INodeCardCallbacks {\n header: string;\n nodeData: INodeDataProps;\n subHeader: string;\n userType: TUserTypes;\n studentId: string;\n userMilestoneId?: string;\n renderAs: 'homework' | 'milestone';\n shouldOpenOnRight: boolean;\n isInQueue?: boolean;\n}\n\nconst HomeworkCard: FC<IHomeworkCardProps> = ({\n // callbacks\n nodeData,\n onNodeAttempt,\n onNodeReattempt,\n onNodeReview,\n onNodeUnassign,\n onNodeView,\n onNodeAssignAsHomework,\n\n header,\n isInQueue,\n renderAs,\n shouldOpenOnRight,\n studentId,\n subHeader,\n userMilestoneId,\n userType,\n}) => {\n const isHomeWork = renderAs === 'homework';\n const {\n node_type: nodeType,\n state,\n permissions,\n user_node_id: userNodeId,\n user_milestone_id: nodeDataMilestoneId,\n homework_id: homeworkId,\n } = nodeData;\n\n const milestoneId = userMilestoneId || nodeDataMilestoneId || '';\n const isPuzzleCard = nodeType === 'PUZZLE_CARD';\n const isSheetLocked = state === 'LOCKED';\n\n const teacherContainerRef = useRef<HTMLDivElement>(null) as React.RefObject<HTMLDivElement>;\n const studentContainerRef = useRef<HTMLDivElement>(null) as React.RefObject<HTMLDivElement>;\n const { menuVisible: teacherMenuVisible, onMenuClick: onTeacherMenuClick } =\n useContextMenuClickHandler(teacherContainerRef);\n const { menuVisible: studentMenuVisible, onMenuClick: onStudentMenuClick } =\n useContextMenuClickHandler(studentContainerRef);\n\n const {\n can_start: canStart,\n can_resume: canResume,\n can_review: canReview,\n can_unassign: canUnassign,\n can_reset: canReset,\n can_assign_as_homework: canAssignAsHw,\n } = permissions;\n const isStudent = userType === 'STUDENT';\n\n const onStudentViewSheet = useCallback(() => {\n if (canReview) {\n if (typeof onNodeReview !== 'function') {\n throw new Error('onReview must be a function');\n }\n\n if (!userNodeId) {\n throw new Error('user node id must be present to review the sheet');\n }\n onNodeReview(nodeData, milestoneId);\n\n return;\n }\n }, [canReview, onNodeReview, userNodeId, nodeData, milestoneId]);\n\n const onStudentCardClick = useCallback(() => {\n if (canStart || canResume) {\n if (typeof onNodeAttempt !== 'function') {\n throw new Error('onNodeAttempt must be a function');\n }\n\n onNodeAttempt(nodeData, milestoneId, homeworkId);\n\n return;\n }\n\n if (!isHomeWork) {\n onStudentMenuClick();\n\n return;\n }\n onStudentViewSheet();\n }, [\n canStart,\n canResume,\n isHomeWork,\n onStudentViewSheet,\n onNodeAttempt,\n nodeData,\n milestoneId,\n homeworkId,\n onStudentMenuClick,\n ]);\n\n const onTeacherCardClick = useCallback(() => {\n if (canReview) {\n if (typeof onNodeReview !== 'function') {\n throw new Error('onNodeReview must be a function');\n }\n\n if (!userNodeId) {\n throw new Error('user node id must be present to review the sheet');\n }\n onNodeReview(nodeData, milestoneId, homeworkId);\n\n return;\n }\n\n if (typeof onNodeView !== 'function') {\n throw new Error('onNodeView must be a function');\n }\n\n onNodeView(nodeData, milestoneId);\n }, [canReview, onNodeView, nodeData, milestoneId, onNodeReview, userNodeId, homeworkId]);\n\n const handleOnMenuOptionClick = useCallback(\n (optionId: string) => {\n switch (optionId) {\n case 'teacher-card-view':\n onTeacherCardClick();\n\n return;\n case 'student-card-view':\n onStudentViewSheet();\n\n return;\n case 'teacher-card-unassign':\n onNodeUnassign?.(nodeData, milestoneId);\n\n return;\n case 'student-card-reattempt':\n case 'teacher-card-redo':\n onNodeReattempt?.(nodeData, milestoneId);\n\n return;\n\n case 'teacher-card-assign-as-hw':\n onNodeAssignAsHomework?.(nodeData, milestoneId);\n\n return;\n\n default:\n throw new Error(`No callback function for ${optionId}`);\n }\n },\n [\n nodeData,\n onNodeAssignAsHomework,\n onNodeReattempt,\n onNodeUnassign,\n onStudentViewSheet,\n onTeacherCardClick,\n milestoneId,\n ],\n );\n\n const teacherOptions = [\n {\n id: 'teacher-card-view',\n label: canReview ? 'Review' : 'View',\n icon: Eye2Icon,\n disabled: false,\n onClick: handleOnMenuOptionClick,\n },\n {\n id: 'teacher-card-unassign',\n label: 'Unassign',\n icon: Styled.StyledMinus2Icon,\n disabled: isHomeWork ? nodeType === 'MASTERY' : !canUnassign,\n onClick: handleOnMenuOptionClick,\n },\n {\n id: 'teacher-card-redo',\n label: 'Redo',\n icon: RedoIcon,\n disabled: !canReset,\n onClick: handleOnMenuOptionClick,\n },\n {\n id: 'teacher-card-assign-as-hw',\n label: 'Assign as HW',\n icon: Home2Icon,\n disabled: !canAssignAsHw,\n onClick: handleOnMenuOptionClick,\n },\n ];\n\n const studentOptions = [\n {\n id: 'student-card-view',\n label: 'Review',\n icon: Eye2Icon,\n disabled: !canReview,\n onClick: handleOnMenuOptionClick,\n },\n {\n id: 'student-card-reattempt',\n label: 'Reattempt',\n icon: RedoIcon,\n disabled: !canReset,\n onClick: handleOnMenuOptionClick,\n },\n ];\n\n const analyticsLabel = useMemo(\n () =>\n getCardAnalyticProps({\n canResume,\n canStart,\n homeworkId,\n isHomeWork,\n isStudent,\n milestoneId,\n nodeType,\n studentId,\n userNodeId,\n }),\n [\n isStudent,\n isHomeWork,\n studentId,\n nodeType,\n canStart,\n canResume,\n homeworkId,\n userNodeId,\n milestoneId,\n ],\n );\n\n const isClickableDisabled = isStudent && isPuzzleCard && isSheetLocked;\n\n return (\n <Styled.CardContainer $position=\"relative\" $width=\"fit-content\">\n <Clickable\n onClick={isStudent ? onStudentCardClick : onTeacherCardClick}\n label=\"homework-card\"\n analyticsLabel={analyticsLabel.analyticsLabel}\n analyticsProps={analyticsLabel.analyticsProps}\n disabled={isClickableDisabled}\n >\n <HomeworkView\n header={header}\n isInQueue={isInQueue}\n nodeData={nodeData}\n studentContainerRef={studentContainerRef}\n subHeader={subHeader}\n userType={userType}\n isMilestone={renderAs === 'milestone'}\n />\n </Clickable>\n {isStudent && !isHomeWork && (\n <CardMenuOptions\n $width={200}\n options={studentOptions}\n triggerRef={studentContainerRef}\n visible={studentMenuVisible}\n shouldOpenOnRight={false}\n />\n )}\n {!isStudent && !isPuzzleCard && (\n <Styled.MenuWrapper $position=\"absolute\" $width=\"fit-content\" $borderRadiusX={2}>\n <ArrowTooltip\n renderAs=\"primary\"\n tooltipItem=\"Review\"\n position=\"bottom\"\n zIndex={6}\n parentWidth=\"100%\"\n hidden={teacherMenuVisible || (state !== 'WAIT_FOR_REVIEW' && isHomeWork)}\n >\n <Styled.CardKebabMenuWrapper\n $alignItems=\"center\"\n $justifyContent=\"center\"\n ref={teacherContainerRef}\n onClick={onTeacherMenuClick}\n >\n <MoreVerticalIcon width={16} height={16} />\n </Styled.CardKebabMenuWrapper>\n </ArrowTooltip>\n <CardMenuOptions\n options={teacherOptions}\n triggerRef={teacherContainerRef}\n visible={teacherMenuVisible}\n shouldOpenOnRight={shouldOpenOnRight}\n $width={144}\n />\n </Styled.MenuWrapper>\n )}\n {isInQueue && (\n <Styled.BlurContainer $background=\"WHITE_5\">\n <Styled.BlurFlexView $heightX={1} $widthX={6}>\n <ArrowTooltip renderAs=\"primary\" tooltipItem=\"Not visible to student\" position=\"bottom\">\n <FlexView $heightX={1} $widthX={6} />\n </ArrowTooltip>\n </Styled.BlurFlexView>\n </Styled.BlurContainer>\n )}\n </Styled.CardContainer>\n );\n};\n\nexport default memo(HomeworkCard);\n"],"names":["HomeworkCard","nodeData","onNodeAttempt","onNodeReattempt","onNodeReview","onNodeUnassign","onNodeView","onNodeAssignAsHomework","header","isInQueue","renderAs","shouldOpenOnRight","studentId","subHeader","userMilestoneId","userType","isHomeWork","nodeType","state","permissions","userNodeId","nodeDataMilestoneId","homeworkId","milestoneId","isPuzzleCard","isSheetLocked","teacherContainerRef","useRef","studentContainerRef","teacherMenuVisible","onTeacherMenuClick","useContextMenuClickHandler","studentMenuVisible","onStudentMenuClick","canStart","canResume","canReview","canUnassign","canReset","canAssignAsHw","isStudent","onStudentViewSheet","useCallback","onStudentCardClick","onTeacherCardClick","handleOnMenuOptionClick","optionId","teacherOptions","Eye2Icon","Styled.StyledMinus2Icon","RedoIcon","Home2Icon","studentOptions","analyticsLabel","useMemo","getCardAnalyticProps","isClickableDisabled","Styled.CardContainer","jsx","Clickable","HomeworkView","CardMenuOptions","jsxs","Styled.MenuWrapper","ArrowTooltip","Styled.CardKebabMenuWrapper","MoreVerticalIcon","Styled.BlurContainer","Styled.BlurFlexView","FlexView","HomeworkCard$1","memo"],"mappings":";;;;;;;;;;;;;;AAkCA,MAAMA,KAAuC,CAAC;AAAA;AAAA,EAE5C,UAAAC;AAAA,EACA,eAAAC;AAAA,EACA,iBAAAC;AAAA,EACA,cAAAC;AAAA,EACA,gBAAAC;AAAA,EACA,YAAAC;AAAA,EACA,wBAAAC;AAAA,EAEA,QAAAC;AAAA,EACA,WAAAC;AAAA,EACA,UAAAC;AAAA,EACA,mBAAAC;AAAA,EACA,WAAAC;AAAA,EACA,WAAAC;AAAA,EACA,iBAAAC;AAAA,EACA,UAAAC;AACF,MAAM;AACJ,QAAMC,IAAaN,MAAa,YAC1B;AAAA,IACJ,WAAWO;AAAA,IACX,OAAAC;AAAA,IACA,aAAAC;AAAA,IACA,cAAcC;AAAA,IACd,mBAAmBC;AAAA,IACnB,aAAaC;AAAA,EACX,IAAArB,GAEEsB,IAAcT,KAAmBO,KAAuB,IACxDG,IAAeP,MAAa,eAC5BQ,IAAgBP,MAAU,UAE1BQ,IAAsBC,EAAuB,IAAI,GACjDC,IAAsBD,EAAuB,IAAI,GACjD,EAAE,aAAaE,GAAoB,aAAaC,MACpDC,EAA2BL,CAAmB,GAC1C,EAAE,aAAaM,GAAoB,aAAaC,MACpDF,EAA2BH,CAAmB,GAE1C;AAAA,IACJ,WAAWM;AAAA,IACX,YAAYC;AAAA,IACZ,YAAYC;AAAA,IACZ,cAAcC;AAAA,IACd,WAAWC;AAAA,IACX,wBAAwBC;AAAA,EACtB,IAAApB,GACEqB,IAAYzB,MAAa,WAEzB0B,IAAqBC,EAAY,MAAM;AAC3C,QAAIN,GAAW;AACT,UAAA,OAAOhC,KAAiB;AACpB,cAAA,IAAI,MAAM,6BAA6B;AAG/C,UAA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