@cuemath/leap 3.2.18 → 3.2.19-beta-0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/illustrations/illustrations.js +6 -5
- package/dist/assets/illustrations/illustrations.js.map +1 -1
- package/dist/assets/lottie/lottie.js +5 -0
- package/dist/assets/lottie/lottie.js.map +1 -1
- package/dist/features/analytics-events/platform-events-student.js +2 -1
- package/dist/features/analytics-events/platform-events-student.js.map +1 -1
- package/dist/features/analytics-events/platform-events-teacher.js +6 -4
- package/dist/features/analytics-events/platform-events-teacher.js.map +1 -1
- package/dist/features/analytics-events/whitelist-events.js +10 -8
- 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 +7 -4
- package/dist/features/communication/pub-sub/constants.js.map +1 -1
- package/dist/features/homework/homework-card-view.js +85 -97
- package/dist/features/homework/homework-card-view.js.map +1 -1
- package/dist/features/homework/homework-card.js +44 -42
- package/dist/features/homework/homework-card.js.map +1 -1
- package/dist/features/homework/hw-card-list/hw-card-list-view.js +31 -29
- 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 +54 -48
- package/dist/features/homework/hw-card-list/hw-card-list.js.map +1 -1
- package/dist/features/homework/utils.js +33 -27
- package/dist/features/homework/utils.js.map +1 -1
- package/dist/features/journey/hooks/use-home-page-journey/tooltip-item.js +17 -11
- package/dist/features/journey/hooks/use-home-page-journey/tooltip-item.js.map +1 -1
- package/dist/features/journey/hooks/use-puzzles-journey/use-puzzle-assigned.js +72 -0
- package/dist/features/journey/hooks/use-puzzles-journey/use-puzzle-assigned.js.map +1 -0
- package/dist/features/journey/hooks/use-puzzles-journey/use-puzzle-attempt-journey.js +59 -0
- package/dist/features/journey/hooks/use-puzzles-journey/use-puzzle-attempt-journey.js.map +1 -0
- package/dist/features/journey/hooks/use-puzzles-journey/use-puzzle-dashboard-journey.js +63 -0
- package/dist/features/journey/hooks/use-puzzles-journey/use-puzzle-dashboard-journey.js.map +1 -0
- package/dist/features/journey/hooks/use-puzzles-journey/use-puzzle-intro-journey.js +67 -0
- package/dist/features/journey/hooks/use-puzzles-journey/use-puzzle-intro-journey.js.map +1 -0
- package/dist/features/journey/hooks/use-puzzles-journey/use-puzzle-progress-journey.js +70 -0
- package/dist/features/journey/hooks/use-puzzles-journey/use-puzzle-progress-journey.js.map +1 -0
- package/dist/features/journey/hooks/use-puzzles-journey/use-puzzle-review-journey.js +59 -0
- package/dist/features/journey/hooks/use-puzzles-journey/use-puzzle-review-journey.js.map +1 -0
- package/dist/features/journey/hooks/use-puzzles-journey/use-puzzle-unassign-journey.js +59 -0
- package/dist/features/journey/hooks/use-puzzles-journey/use-puzzle-unassign-journey.js.map +1 -0
- package/dist/features/journey/hooks/use-puzzles-journey/use-teacher-puzzle-assigned-journey.js +70 -0
- package/dist/features/journey/hooks/use-puzzles-journey/use-teacher-puzzle-assigned-journey.js.map +1 -0
- 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/api/puzzle-dashboard.js +10 -0
- package/dist/features/puzzles/api/puzzle-dashboard.js.map +1 -0
- package/dist/features/puzzles/app/puzzle-app-styled.js +10 -6
- package/dist/features/puzzles/app/puzzle-app-styled.js.map +1 -1
- package/dist/features/puzzles/comps/puzzle-card-styled.js +24 -69
- package/dist/features/puzzles/comps/puzzle-card-styled.js.map +1 -1
- package/dist/features/puzzles/comps/puzzle-card.js +79 -30
- package/dist/features/puzzles/comps/puzzle-card.js.map +1 -1
- package/dist/features/puzzles/constants/puzzle-container.js +8 -0
- package/dist/features/puzzles/constants/puzzle-container.js.map +1 -0
- package/dist/features/puzzles/puzzle-analytics-events.js +11 -0
- package/dist/features/puzzles/puzzle-analytics-events.js.map +1 -0
- package/dist/features/puzzles/puzzle-container/puzzle-container-styled.js +55 -25
- package/dist/features/puzzles/puzzle-container/puzzle-container-styled.js.map +1 -1
- package/dist/features/puzzles/puzzle-container/puzzle-container-view.js +55 -0
- package/dist/features/puzzles/puzzle-container/puzzle-container-view.js.map +1 -0
- package/dist/features/puzzles/puzzle-container/puzzle-container.js +100 -107
- package/dist/features/puzzles/puzzle-container/puzzle-container.js.map +1 -1
- package/dist/features/puzzles/puzzle-dashboard/puzzle-dashboard-styled.js +37 -0
- package/dist/features/puzzles/puzzle-dashboard/puzzle-dashboard-styled.js.map +1 -0
- package/dist/features/puzzles/puzzle-dashboard/puzzle-dashboard.js +110 -0
- package/dist/features/puzzles/puzzle-dashboard/puzzle-dashboard.js.map +1 -0
- 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 +28 -13
- package/dist/features/puzzles/utils/puzzle-pattern.js.map +1 -1
- package/dist/features/worksheet/worksheet/hooks/use-worksheet-journey.js +28 -0
- package/dist/features/worksheet/worksheet/hooks/use-worksheet-journey.js.map +1 -0
- package/dist/features/worksheet/worksheet/worksheet-helpers.js +20 -19
- package/dist/features/worksheet/worksheet/worksheet-helpers.js.map +1 -1
- package/dist/features/worksheet/worksheet/worksheet-question/learnosity-question.js +16 -12
- package/dist/features/worksheet/worksheet/worksheet-question/learnosity-question.js.map +1 -1
- package/dist/features/worksheet/worksheet/worksheet-question/worksheet-question-styled.js +101 -47
- package/dist/features/worksheet/worksheet/worksheet-question/worksheet-question-styled.js.map +1 -1
- package/dist/features/worksheet/worksheet/worksheet-question/worksheet-question.js +149 -146
- 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 +242 -207
- 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 +307 -313
- 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 +44 -35
- package/dist/features/worksheet/worksheet-preview/worksheet-preview.js.map +1 -1
- package/dist/index.d.ts +87 -4
- package/dist/index.js +326 -316
- package/dist/index.js.map +1 -1
- package/dist/static/puzzle-blue-lottie.7017e2e8.json +1 -0
- package/dist/static/puzzle-blue-lottie.bf64ebc5.json +12760 -0
- package/dist/static/puzzle-dashboard-banner.b7956519.svg +1 -0
- package/dist/static/puzzle-green-lottie.1da90698.json +1 -0
- package/dist/static/puzzle-orange-lottie.cfcf3724.json +1 -0
- package/dist/static/puzzle-pattern-blue.abff0164.svg +1 -0
- package/dist/static/puzzle-pattern-green.b8ba1840.svg +1 -0
- package/dist/static/puzzle-pattern-orange.3f5a17ff.svg +1 -0
- package/dist/static/puzzle-pattern-purple.14b09759.svg +1 -0
- package/dist/static/puzzle-pattern-yellow.50917fab.svg +1 -0
- package/dist/static/puzzle-purple-lottie.e70de110.json +9860 -0
- package/dist/static/puzzle-yellow-lottie.275b5cf4.json +1 -0
- package/package.json +1 -1
- package/dist/static/puzzle-pattern-blue.f4bea1ee.svg +0 -1
- package/dist/static/puzzle-pattern-green.c9f84bbc.svg +0 -1
- package/dist/static/puzzle-pattern-orange.3da09665.svg +0 -1
- package/dist/static/puzzle-pattern-purple.5fb5a319.svg +0 -1
- package/dist/static/puzzle-pattern-yellow.aadbf457.svg +0 -1
@@ -1,130 +1,118 @@
|
|
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 B, useState as L, useRef as b, useCallback as w, useLayoutEffect as R } from "react";
|
3
|
+
import W from "../../assets/line-icons/icons/closed-eye.js";
|
4
|
+
import I from "../chapters-v2/comps/node-card/node-card-tags.js";
|
5
|
+
import { getNodeTypeBasedBgImage as P } from "../chapters-v2/utils/index.js";
|
6
|
+
import { getNodeCardBasedIcon as U } 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
|
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";
|
8
|
+
import g from "../ui/arrow-tooltip/arrow-tooltip.js";
|
9
|
+
import a from "../ui/layout/flex-view.js";
|
10
|
+
import j from "../ui/lottie-animation/lottie-animation.js";
|
11
|
+
import V from "./card-title.js";
|
12
|
+
import _ from "./node-progress.js";
|
13
|
+
import { PuzzleCardWrapper as K, CardWrapper as Z, IconWrapper as F, BannerImageWrapper as M, BannerImage as q, HeaderText as J, SubHeaderText as Q } from "./styles.js";
|
15
14
|
const Y = { renderer: "canvas", autoplay: !1 }, ee = ({
|
16
|
-
header:
|
17
|
-
isInQueue:
|
18
|
-
nodeData:
|
19
|
-
studentContainerRef:
|
20
|
-
subHeader:
|
15
|
+
header: h,
|
16
|
+
isInQueue: C,
|
17
|
+
nodeData: E,
|
18
|
+
studentContainerRef: $,
|
19
|
+
subHeader: x,
|
21
20
|
userType: c,
|
22
|
-
isMilestone: d = !1
|
21
|
+
isMilestone: d = !1,
|
22
|
+
puzzleHWCardRef: y
|
23
23
|
}) => {
|
24
24
|
const {
|
25
|
-
node_type:
|
25
|
+
node_type: t,
|
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: r,
|
29
|
+
image_url: p,
|
30
|
+
image_hue: o,
|
31
|
+
card_header: z = "",
|
32
|
+
unlocked_on_ts: s,
|
33
33
|
course_type: A,
|
34
34
|
title: k
|
35
|
-
} =
|
36
|
-
var
|
37
|
-
(
|
38
|
-
}, []),
|
39
|
-
var
|
40
|
-
(
|
35
|
+
} = E, D = t === "PUZZLE_CARD", T = c === "STUDENT" && m === "LOCKED", [N, v] = L(!1), l = b(null), H = P(t), u = b(null), { lottie: S } = U(t), O = w(() => {
|
36
|
+
var i;
|
37
|
+
(i = u.current) == null || i.play();
|
38
|
+
}, []), X = w(() => {
|
39
|
+
var i;
|
40
|
+
(i = u.current) == null || i.stop();
|
41
41
|
}, []);
|
42
42
|
return R(() => {
|
43
|
-
|
43
|
+
l.current && l.current.scrollHeight > l.current.clientHeight && v(!0);
|
44
44
|
}, []), D ? /* @__PURE__ */ e(
|
45
|
-
|
45
|
+
g,
|
46
46
|
{
|
47
47
|
renderAs: "primary",
|
48
48
|
tooltipItem: "Solve puzzle after class",
|
49
49
|
position: "bottom",
|
50
|
-
hidden: !
|
51
|
-
children: /* @__PURE__ */ n(
|
52
|
-
|
50
|
+
hidden: !T,
|
51
|
+
children: /* @__PURE__ */ e("div", { ref: y, children: /* @__PURE__ */ n(
|
52
|
+
K,
|
53
53
|
{
|
54
|
-
ref:
|
54
|
+
ref: $,
|
55
55
|
$position: "relative",
|
56
|
-
$background: `${
|
57
|
-
$disabled:
|
56
|
+
$background: `${o}_2`,
|
57
|
+
$disabled: T,
|
58
58
|
children: [
|
59
|
-
/* @__PURE__ */ e(
|
59
|
+
/* @__PURE__ */ e(
|
60
60
|
G,
|
61
61
|
{
|
62
|
-
imageHue:
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
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
|
-
] })
|
62
|
+
imageHue: o,
|
63
|
+
imageUrl: p ?? "",
|
64
|
+
title: k,
|
65
|
+
width: 126,
|
66
|
+
height: 159
|
79
67
|
}
|
80
|
-
)
|
68
|
+
),
|
81
69
|
/* @__PURE__ */ e(
|
82
|
-
|
70
|
+
I,
|
83
71
|
{
|
84
|
-
nodeType:
|
72
|
+
nodeType: t,
|
85
73
|
state: m,
|
86
74
|
accuracy: f,
|
87
|
-
dueDateTs:
|
75
|
+
dueDateTs: r,
|
88
76
|
isStudent: c === "STUDENT",
|
89
77
|
isMilestone: d
|
90
78
|
}
|
91
79
|
),
|
92
|
-
!d &&
|
93
|
-
|
80
|
+
!d && r && s && /* @__PURE__ */ e(
|
81
|
+
_,
|
94
82
|
{
|
95
|
-
dueDate:
|
96
|
-
unlockedOn:
|
97
|
-
progressBg: `${
|
83
|
+
dueDate: r * 1e3,
|
84
|
+
unlockedOn: s * 1e3,
|
85
|
+
progressBg: `${o || "ORANGE"}_5`
|
98
86
|
}
|
99
87
|
)
|
100
88
|
]
|
101
89
|
}
|
102
|
-
)
|
90
|
+
) })
|
103
91
|
}
|
104
92
|
) : /* @__PURE__ */ n(
|
105
|
-
|
93
|
+
a,
|
106
94
|
{
|
107
|
-
ref:
|
95
|
+
ref: $,
|
108
96
|
$widthX: 12.38,
|
109
97
|
$position: "relative",
|
110
|
-
$background: `${
|
111
|
-
onMouseEnter:
|
112
|
-
onMouseLeave:
|
98
|
+
$background: `${o || "ORANGE"}_2`,
|
99
|
+
onMouseEnter: O,
|
100
|
+
onMouseLeave: X,
|
113
101
|
children: [
|
114
102
|
/* @__PURE__ */ n(
|
115
|
-
|
103
|
+
Z,
|
116
104
|
{
|
117
105
|
$flexDirection: "row",
|
118
106
|
$alignItems: "center",
|
119
107
|
$width: "100%",
|
120
108
|
$heightX: 3.5,
|
121
|
-
$bgImage:
|
109
|
+
$bgImage: H,
|
122
110
|
$gutterX: 0.78125,
|
123
111
|
$flexGap: 8.5,
|
124
112
|
$position: "relative",
|
125
113
|
children: [
|
126
114
|
/* @__PURE__ */ e(
|
127
|
-
|
115
|
+
F,
|
128
116
|
{
|
129
117
|
$width: 31,
|
130
118
|
$height: 31,
|
@@ -133,67 +121,67 @@ const Y = { renderer: "canvas", autoplay: !1 }, ee = ({
|
|
133
121
|
$position: "relative",
|
134
122
|
$alignItems: "center",
|
135
123
|
$justifyContent: "center",
|
136
|
-
children: /* @__PURE__ */ e(
|
124
|
+
children: /* @__PURE__ */ e(j, { src: S, ref: u, settings: Y })
|
137
125
|
}
|
138
126
|
),
|
139
|
-
/* @__PURE__ */ e(
|
140
|
-
|
141
|
-
|
127
|
+
/* @__PURE__ */ e(V, { cardHeader: z, nodeType: t, courseType: A }),
|
128
|
+
C && /* @__PURE__ */ e(
|
129
|
+
g,
|
142
130
|
{
|
143
131
|
renderAs: "primary",
|
144
132
|
tooltipItem: "Not visible to student",
|
145
133
|
position: "bottom",
|
146
134
|
zIndex: 6,
|
147
|
-
children: /* @__PURE__ */ e(
|
135
|
+
children: /* @__PURE__ */ e(W, {})
|
148
136
|
}
|
149
137
|
),
|
150
|
-
!!
|
138
|
+
!!p && /* @__PURE__ */ e(M, { children: /* @__PURE__ */ e(q, { src: p, alt: "Chapter image" }) })
|
151
139
|
]
|
152
140
|
}
|
153
141
|
),
|
154
142
|
/* @__PURE__ */ e(
|
155
|
-
|
143
|
+
I,
|
156
144
|
{
|
157
|
-
nodeType:
|
145
|
+
nodeType: t,
|
158
146
|
state: m,
|
159
147
|
accuracy: f,
|
160
|
-
dueDateTs:
|
148
|
+
dueDateTs: r,
|
161
149
|
isStudent: c === "STUDENT",
|
162
150
|
isMilestone: d
|
163
151
|
}
|
164
152
|
),
|
165
|
-
!d &&
|
166
|
-
|
153
|
+
!d && r && s && /* @__PURE__ */ e(
|
154
|
+
_,
|
167
155
|
{
|
168
|
-
dueDate:
|
169
|
-
unlockedOn:
|
170
|
-
progressBg: `${
|
156
|
+
dueDate: r * 1e3,
|
157
|
+
unlockedOn: s * 1e3,
|
158
|
+
progressBg: `${o || "ORANGE"}_4`
|
171
159
|
}
|
172
160
|
),
|
173
|
-
/* @__PURE__ */ n(
|
161
|
+
/* @__PURE__ */ n(a, { $gutterX: 0.75, $gapX: 1, $flexRowGapX: 0.5, $background: "WHITE", children: [
|
174
162
|
/* @__PURE__ */ e(
|
175
|
-
|
163
|
+
g,
|
176
164
|
{
|
177
165
|
renderAs: "primary",
|
178
166
|
position: "bottom",
|
179
|
-
tooltipItem:
|
167
|
+
tooltipItem: h,
|
180
168
|
width: 300,
|
181
169
|
hidden: !N,
|
182
170
|
parentWidth: "auto",
|
183
171
|
zIndex: 6,
|
184
|
-
children: /* @__PURE__ */ e(
|
172
|
+
children: /* @__PURE__ */ e(a, { $heightX: 2.5, children: /* @__PURE__ */ e(J, { ref: l, $renderAs: "ab3", children: h }) })
|
185
173
|
}
|
186
174
|
),
|
187
175
|
/* @__PURE__ */ n(
|
188
|
-
|
176
|
+
a,
|
189
177
|
{
|
190
178
|
$flexDirection: "row",
|
191
179
|
$heightX: 1.25,
|
192
180
|
$alignItems: "center",
|
193
181
|
$justifyContent: "space-between",
|
194
182
|
children: [
|
195
|
-
/* @__PURE__ */ e(Q, { $renderAs: "ub3", $color: "BLACK_T_60", children:
|
196
|
-
/* @__PURE__ */ e(
|
183
|
+
/* @__PURE__ */ e(Q, { $renderAs: "ub3", $color: "BLACK_T_60", children: x }),
|
184
|
+
/* @__PURE__ */ e(a, { $width: 32 })
|
197
185
|
]
|
198
186
|
}
|
199
187
|
)
|
@@ -201,8 +189,8 @@ const Y = { renderer: "canvas", autoplay: !1 }, ee = ({
|
|
201
189
|
]
|
202
190
|
}
|
203
191
|
);
|
204
|
-
},
|
192
|
+
}, ge = B(ee);
|
205
193
|
export {
|
206
|
-
|
194
|
+
ge as default
|
207
195
|
};
|
208
196
|
//# 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 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,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AEF,gBAAAwB,EAACE,KAAS,UAAU,MAAM,OAAO,GAAG,cAAc,KAAK,aAAY,SACjE,UAAA;AAAA,UAAA,gBAAAJ;AAAA,YAACC;AAAA,YAAA;AAAA,cACC,UAAS;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
|
+
{"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","ClosedEy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AA,gBAAAP;AAAA,YAACC;AAAA,YAAA;AAAA,cACC,UAAS;AAAA,cACT,UAAS;AAAA,cACT,aAAapC;AAAA,cACb,OAAO;AAAA,cACP,QAAQ,CAACoB;AAAA,cACT,aAAY;AAAA,cACZ,QAAQ;AAAA,cAER,UAAC,gBAAAe,EAAAO,GAAA,EAAS,UAAU,KAClB,UAAC,gBAAAP,EAAAe,GAAA,EAAkB,KAAK3B,GAAc,WAAU,OAC7C,YACH,CAAA,GACF;AAAA,YAAA;AAAA,UACF;AAAA,UACA,gBAAAc;AAAA,YAACK;AAAA,YAAA;AAAA,cACC,gBAAe;AAAA,cACf,UAAU;AAAA,cACV,aAAY;AAAA,cACZ,iBAAgB;AAAA,cAEhB,UAAA;AAAA,gBAAA,gBAAAP,EAACgB,GAAA,EAAqB,WAAU,OAAM,QAAO,cAC1C,UACH/C,GAAA;AAAA,gBACA,gBAAA+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,18 +1,18 @@
|
|
1
1
|
import { jsxs as x, jsx as t } from "react/jsx-runtime";
|
2
|
-
import { memo as
|
2
|
+
import { memo as ie, useRef as L, useCallback as w, useMemo as ne } from "react";
|
3
3
|
import P from "../../assets/line-icons/icons/eye2.js";
|
4
|
-
import
|
5
|
-
import
|
4
|
+
import ce from "../../assets/line-icons/icons/home2.js";
|
5
|
+
import oe 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 se from "../ui/buttons/clickable/clickable.js";
|
9
9
|
import j from "../ui/hooks/use-context-menu-click-handler.js";
|
10
|
-
import
|
10
|
+
import ae 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 le from "./homework-card-view.js";
|
13
|
+
import { CardContainer as ue, MenuWrapper as de, CardKebabMenuWrapper as he, BlurContainer as me, BlurFlexView as fe, StyledMinus2Icon as pe } from "./styles.js";
|
14
|
+
import { getCardAnalyticProps as be } from "./utils.js";
|
15
|
+
const we = ({
|
16
16
|
// callbacks
|
17
17
|
nodeData: e,
|
18
18
|
onNodeAttempt: C,
|
@@ -28,23 +28,24 @@ const be = ({
|
|
28
28
|
studentId: I,
|
29
29
|
subHeader: K,
|
30
30
|
userMilestoneId: Z,
|
31
|
-
userType: v
|
31
|
+
userType: v,
|
32
|
+
puzzleHWCardRef: Y
|
32
33
|
}) => {
|
33
34
|
const i = E === "homework", {
|
34
35
|
node_type: m,
|
35
36
|
state: R,
|
36
|
-
permissions:
|
37
|
+
permissions: q,
|
37
38
|
user_node_id: c,
|
38
|
-
user_milestone_id:
|
39
|
+
user_milestone_id: G,
|
39
40
|
homework_id: o
|
40
|
-
} = e, r = Z ||
|
41
|
+
} = e, r = Z || G || "", g = m === "PUZZLE_CARD", J = R === "LOCKED", _ = L(null), M = L(null), { menuVisible: S, onMenuClick: Q } = j(_), { menuVisible: U, onMenuClick: V } = j(M), {
|
41
42
|
can_start: f,
|
42
43
|
can_resume: p,
|
43
44
|
can_review: s,
|
44
|
-
can_unassign:
|
45
|
+
can_unassign: A,
|
45
46
|
can_reset: O,
|
46
|
-
can_assign_as_homework:
|
47
|
-
} =
|
47
|
+
can_assign_as_homework: D
|
48
|
+
} = q, a = v === "STUDENT", b = w(() => {
|
48
49
|
if (s) {
|
49
50
|
if (typeof n != "function")
|
50
51
|
throw new Error("onReview must be a function");
|
@@ -53,7 +54,7 @@ const be = ({
|
|
53
54
|
n(e, r);
|
54
55
|
return;
|
55
56
|
}
|
56
|
-
}, [s, n, c, e, r]),
|
57
|
+
}, [s, n, c, e, r]), N = w(() => {
|
57
58
|
if (f || p) {
|
58
59
|
if (typeof C != "function")
|
59
60
|
throw new Error("onNodeAttempt must be a function");
|
@@ -119,7 +120,7 @@ const be = ({
|
|
119
120
|
y,
|
120
121
|
r
|
121
122
|
]
|
122
|
-
),
|
123
|
+
), ee = [
|
123
124
|
{
|
124
125
|
id: "teacher-card-view",
|
125
126
|
label: s ? "Review" : "View",
|
@@ -130,8 +131,8 @@ const be = ({
|
|
130
131
|
{
|
131
132
|
id: "teacher-card-unassign",
|
132
133
|
label: "Unassign",
|
133
|
-
icon:
|
134
|
-
disabled: i ? m === "MASTERY" : !
|
134
|
+
icon: pe,
|
135
|
+
disabled: i ? m === "MASTERY" : !A,
|
135
136
|
onClick: l
|
136
137
|
},
|
137
138
|
{
|
@@ -144,11 +145,11 @@ const be = ({
|
|
144
145
|
{
|
145
146
|
id: "teacher-card-assign-as-hw",
|
146
147
|
label: "Assign as HW",
|
147
|
-
icon:
|
148
|
-
disabled: !
|
148
|
+
icon: ce,
|
149
|
+
disabled: !D,
|
149
150
|
onClick: l
|
150
151
|
}
|
151
|
-
],
|
152
|
+
], re = [
|
152
153
|
{
|
153
154
|
id: "student-card-view",
|
154
155
|
label: "Review",
|
@@ -163,8 +164,8 @@ const be = ({
|
|
163
164
|
disabled: !O,
|
164
165
|
onClick: l
|
165
166
|
}
|
166
|
-
], T =
|
167
|
-
() =>
|
167
|
+
], T = ne(
|
168
|
+
() => be({
|
168
169
|
canResume: p,
|
169
170
|
canStart: f,
|
170
171
|
homeworkId: o,
|
@@ -186,18 +187,18 @@ const be = ({
|
|
186
187
|
c,
|
187
188
|
r
|
188
189
|
]
|
189
|
-
),
|
190
|
-
return /* @__PURE__ */ x(
|
190
|
+
), te = a && g && J;
|
191
|
+
return /* @__PURE__ */ x(ue, { $position: "relative", $width: "fit-content", children: [
|
191
192
|
/* @__PURE__ */ t(
|
192
|
-
|
193
|
+
se,
|
193
194
|
{
|
194
|
-
onClick: a ?
|
195
|
+
onClick: a ? N : y,
|
195
196
|
label: "homework-card",
|
196
197
|
analyticsLabel: T.analyticsLabel,
|
197
198
|
analyticsProps: T.analyticsProps,
|
198
|
-
disabled:
|
199
|
+
disabled: te,
|
199
200
|
children: /* @__PURE__ */ t(
|
200
|
-
|
201
|
+
le,
|
201
202
|
{
|
202
203
|
header: F,
|
203
204
|
isInQueue: $,
|
@@ -205,7 +206,8 @@ const be = ({
|
|
205
206
|
studentContainerRef: M,
|
206
207
|
subHeader: K,
|
207
208
|
userType: v,
|
208
|
-
isMilestone: E === "milestone"
|
209
|
+
isMilestone: E === "milestone",
|
210
|
+
puzzleHWCardRef: Y
|
209
211
|
}
|
210
212
|
)
|
211
213
|
}
|
@@ -214,13 +216,13 @@ const be = ({
|
|
214
216
|
z,
|
215
217
|
{
|
216
218
|
$width: 200,
|
217
|
-
options:
|
219
|
+
options: re,
|
218
220
|
triggerRef: M,
|
219
|
-
visible:
|
221
|
+
visible: U,
|
220
222
|
shouldOpenOnRight: !1
|
221
223
|
}
|
222
224
|
),
|
223
|
-
!a && !g && /* @__PURE__ */ x(
|
225
|
+
!a && !g && /* @__PURE__ */ x(de, { $position: "absolute", $width: "fit-content", $borderRadiusX: 2, children: [
|
224
226
|
/* @__PURE__ */ t(
|
225
227
|
H,
|
226
228
|
{
|
@@ -231,13 +233,13 @@ const be = ({
|
|
231
233
|
parentWidth: "100%",
|
232
234
|
hidden: S || R !== "WAIT_FOR_REVIEW" && i,
|
233
235
|
children: /* @__PURE__ */ t(
|
234
|
-
|
236
|
+
he,
|
235
237
|
{
|
236
238
|
$alignItems: "center",
|
237
239
|
$justifyContent: "center",
|
238
240
|
ref: _,
|
239
|
-
onClick:
|
240
|
-
children: /* @__PURE__ */ t(
|
241
|
+
onClick: Q,
|
242
|
+
children: /* @__PURE__ */ t(oe, { width: 16, height: 16 })
|
241
243
|
}
|
242
244
|
)
|
243
245
|
}
|
@@ -245,7 +247,7 @@ const be = ({
|
|
245
247
|
/* @__PURE__ */ t(
|
246
248
|
z,
|
247
249
|
{
|
248
|
-
options:
|
250
|
+
options: ee,
|
249
251
|
triggerRef: _,
|
250
252
|
visible: S,
|
251
253
|
shouldOpenOnRight: B,
|
@@ -253,10 +255,10 @@ const be = ({
|
|
253
255
|
}
|
254
256
|
)
|
255
257
|
] }),
|
256
|
-
$ && /* @__PURE__ */ t(
|
258
|
+
$ && /* @__PURE__ */ t(me, { $background: "WHITE_5", children: /* @__PURE__ */ t(fe, { $heightX: 1, $widthX: 6, children: /* @__PURE__ */ t(H, { renderAs: "primary", tooltipItem: "Not visible to student", position: "bottom", children: /* @__PURE__ */ t(ae, { $heightX: 1, $widthX: 6 }) }) }) })
|
257
259
|
] });
|
258
|
-
},
|
260
|
+
}, Te = ie(we);
|
259
261
|
export {
|
260
|
-
|
262
|
+
Te as default
|
261
263
|
};
|
262
264
|
//# 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}\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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AiB,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,mBAAAlB;AAAA,UACA,QAAQ;AAAA,QAAA;AAAA,MACV;AAAA,IAAA,GACF;AAAA,IAEDF,KACC,gBAAAiD,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,GAAKvE,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 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,IAA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