@cuemath/leap 2.9.9-as1 → 2.9.9-as2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/features/chapters/chapters-list/chapter-item/chapter-item.js +5 -5
- package/dist/features/chapters/chapters-list/chapter-item/chapter-item.js.map +1 -1
- package/dist/features/chapters-v2/chapter-details/block-sections/block-section-view.js +1 -1
- package/dist/features/chapters-v2/chapter-details/block-sections/block-section-view.js.map +1 -1
- package/dist/features/chapters-v2/chapter-details/block-sections/block-sections-styled.js +16 -7
- package/dist/features/chapters-v2/chapter-details/block-sections/block-sections-styled.js.map +1 -1
- package/dist/features/chapters-v2/chapter-details/block-sections/block-sections.js +57 -64
- package/dist/features/chapters-v2/chapter-details/block-sections/block-sections.js.map +1 -1
- package/dist/features/chapters-v2/comps/node-card/node-card-tags.js +8 -8
- package/dist/features/chapters-v2/comps/node-card/node-card-tags.js.map +1 -1
- package/dist/features/chapters-v2/comps/node-card/node-menu-options/node-menu-option.js +31 -0
- package/dist/features/chapters-v2/comps/node-card/node-menu-options/node-menu-option.js.map +1 -0
- package/dist/features/chapters-v2/comps/node-card/node-menu-options/node-menu-options.js +6 -28
- package/dist/features/chapters-v2/comps/node-card/node-menu-options/node-menu-options.js.map +1 -1
- package/dist/features/chapters-v2/comps/node-card/student-actions/student-actions.js +100 -91
- package/dist/features/chapters-v2/comps/node-card/student-actions/student-actions.js.map +1 -1
- package/dist/features/chapters-v2/comps/node-card/teacher-actions/teacher-actions.js +94 -92
- package/dist/features/chapters-v2/comps/node-card/teacher-actions/teacher-actions.js.map +1 -1
- package/dist/features/chapters-v2/comps/tag/tag.js +2 -2
- package/dist/features/chapters-v2/comps/tag/tag.js.map +1 -1
- package/dist/features/chapters-v2/utils/index.js +2 -5
- package/dist/features/chapters-v2/utils/index.js.map +1 -1
- package/dist/features/homework/card-menu-option.js +28 -0
- package/dist/features/homework/card-menu-option.js.map +1 -0
- package/dist/features/homework/card-menu-options.js +12 -28
- package/dist/features/homework/card-menu-options.js.map +1 -1
- package/dist/features/homework/card-title.js +10 -9
- package/dist/features/homework/card-title.js.map +1 -1
- package/dist/features/homework/homework-card-view.js +51 -49
- package/dist/features/homework/homework-card-view.js.map +1 -1
- package/dist/features/homework/hw-card-list/hw-card-list.js +78 -72
- package/dist/features/homework/hw-card-list/hw-card-list.js.map +1 -1
- package/dist/features/milestone/milestone-list-container/milestone-list/milestone-list.js +32 -31
- package/dist/features/milestone/milestone-list-container/milestone-list/milestone-list.js.map +1 -1
- package/dist/features/milestone/milestone-list-container/milestone-list/milestone-widget/milestone-info.js +14 -14
- package/dist/features/milestone/milestone-list-container/milestone-list/milestone-widget/milestone-info.js.map +1 -1
- package/dist/features/milestone/milestone-list-container/milestone-list/milestone-widget/outcome/outcome-styled.js +2 -6
- package/dist/features/milestone/milestone-list-container/milestone-list/milestone-widget/outcome/outcome-styled.js.map +1 -1
- package/dist/features/milestone/milestone-tests/test-list-v2/test-list-view.js +30 -29
- package/dist/features/milestone/milestone-tests/test-list-v2/test-list-view.js.map +1 -1
- package/dist/features/ui/lottie-animation/lottie-animation.js +19 -13
- package/dist/features/ui/lottie-animation/lottie-animation.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/package.json +1 -1
@@ -1,126 +1,128 @@
|
|
1
|
-
import { jsx as e, jsxs as
|
2
|
-
import { memo as
|
3
|
-
import
|
4
|
-
import
|
5
|
-
import
|
6
|
-
import
|
7
|
-
import
|
8
|
-
import
|
9
|
-
import { BLOCK_TYPE as
|
10
|
-
import { NODE_CARD_STATES as
|
11
|
-
import { getNodeTypeBasedBgImage as
|
12
|
-
import { getNodeCardBasedIcon as
|
13
|
-
import
|
14
|
-
import { NodeCardContainer as
|
15
|
-
import
|
16
|
-
import
|
17
|
-
const
|
1
|
+
import { jsx as e, jsxs as m } from "react/jsx-runtime";
|
2
|
+
import { memo as j, useRef as z, useCallback as l } from "react";
|
3
|
+
import Y from "../../../../../assets/line-icons/icons/eye2.js";
|
4
|
+
import Z from "../../../../../assets/line-icons/icons/redo.js";
|
5
|
+
import q from "../../../../ui/arrow-tooltip/arrow-tooltip.js";
|
6
|
+
import F from "../../../../ui/context-menu/context-menu.js";
|
7
|
+
import J from "../../../../ui/lottie-animation/lottie-animation.js";
|
8
|
+
import Q from "../../../../ui/text/text.js";
|
9
|
+
import { BLOCK_TYPE as U } from "../../../constants/block-constants.js";
|
10
|
+
import { NODE_CARD_STATES as C } from "../../../constants/node-constants.js";
|
11
|
+
import { getNodeTypeBasedBgImage as V } from "../../../utils/index.js";
|
12
|
+
import { getNodeCardBasedIcon as ee } from "../../../utils/node-card-utils.js";
|
13
|
+
import te from "../border-path-animation.js";
|
14
|
+
import { NodeCardContainer as oe, NodeCardInfoWrapper as re, IconWrapper as ne, StyledImportantIcon as ae, NodeCardContentWrapper as ie, NodeCardTitle as se } from "../node-card-styled.js";
|
15
|
+
import ce from "../node-card-tags.js";
|
16
|
+
import de from "../node-menu-options/node-menu-options.js";
|
17
|
+
const me = { renderer: "canvas", autoplay: !1 }, Ee = j((b) => {
|
18
18
|
const {
|
19
19
|
nodeData: t,
|
20
20
|
imageHue: A,
|
21
|
-
blockType:
|
22
|
-
onNodeAttempt:
|
23
|
-
onNodeReattempt:
|
24
|
-
onNodeReview:
|
21
|
+
blockType: T,
|
22
|
+
onNodeAttempt: a,
|
23
|
+
onNodeReattempt: i,
|
24
|
+
onNodeReview: s,
|
25
25
|
onNodeView: o,
|
26
|
-
isStudent:
|
26
|
+
isStudent: E
|
27
27
|
} = b, {
|
28
|
-
accuracy:
|
29
|
-
attempt_location:
|
30
|
-
node_type:
|
31
|
-
card_header:
|
32
|
-
title:
|
28
|
+
accuracy: y,
|
29
|
+
attempt_location: L,
|
30
|
+
node_type: p,
|
31
|
+
card_header: R,
|
32
|
+
title: w,
|
33
33
|
state: c,
|
34
|
-
is_optional:
|
35
|
-
sheet_statement:
|
36
|
-
permissions:
|
37
|
-
marked_as_completed:
|
34
|
+
is_optional: $,
|
35
|
+
sheet_statement: g,
|
36
|
+
permissions: x,
|
37
|
+
marked_as_completed: d
|
38
38
|
} = t, {
|
39
|
-
can_review:
|
40
|
-
can_start:
|
41
|
-
can_resume:
|
39
|
+
can_review: _,
|
40
|
+
can_start: u,
|
41
|
+
can_resume: f,
|
42
42
|
can_reset: I
|
43
|
-
} =
|
44
|
-
(
|
45
|
-
switch (
|
43
|
+
} = x, B = T === U.GOAL, n = c === C.LOCKED, N = c === C.NOT_STARTED, v = c === C.IN_PROGRESS, M = L === "INCLASS", W = u || f, O = !$ && (v || N), k = !W && (I || _), h = z(null), D = V(p), { lottie: G } = ee(p), S = l(
|
44
|
+
(r) => {
|
45
|
+
switch (r) {
|
46
46
|
case "node-card-review":
|
47
|
-
|
47
|
+
d ? o == null || o(t) : s == null || s(t);
|
48
48
|
return;
|
49
49
|
case "node-card-reattempt":
|
50
|
-
|
50
|
+
i == null || i(t);
|
51
51
|
return;
|
52
52
|
default:
|
53
|
-
throw new Error(`No callback function for ${
|
53
|
+
throw new Error(`No callback function for ${r}`);
|
54
54
|
}
|
55
55
|
},
|
56
|
-
[t,
|
57
|
-
),
|
58
|
-
|
56
|
+
[t, i, s, o, d]
|
57
|
+
), H = l(() => {
|
58
|
+
k || n || (u || f ? a == null || a(t) : d && (o == null || o(t)));
|
59
59
|
}, [
|
60
|
-
|
61
|
-
|
60
|
+
f,
|
61
|
+
u,
|
62
62
|
t,
|
63
|
-
|
63
|
+
a,
|
64
64
|
o,
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
]),
|
69
|
-
r
|
70
|
-
|
71
|
-
|
72
|
-
|
65
|
+
k,
|
66
|
+
n,
|
67
|
+
d
|
68
|
+
]), K = l(() => {
|
69
|
+
var r;
|
70
|
+
n || (r = h.current) == null || r.play();
|
71
|
+
}, [n]), P = l(() => {
|
72
|
+
var r;
|
73
|
+
(r = h.current) == null || r.stop();
|
74
|
+
}, []), X = [
|
73
75
|
{
|
74
76
|
id: "node-card-review",
|
75
77
|
label: "Review",
|
76
|
-
icon:
|
77
|
-
disabled: !
|
78
|
-
onClick:
|
78
|
+
icon: Y,
|
79
|
+
disabled: !_,
|
80
|
+
onClick: S
|
79
81
|
},
|
80
82
|
{
|
81
83
|
id: "node-card-reattempt",
|
82
84
|
label: "Reattempt",
|
83
|
-
icon:
|
85
|
+
icon: Z,
|
84
86
|
disabled: !I,
|
85
|
-
onClick:
|
87
|
+
onClick: S
|
86
88
|
}
|
87
89
|
];
|
88
90
|
return /* @__PURE__ */ e(
|
89
|
-
|
91
|
+
F,
|
90
92
|
{
|
91
93
|
targetElement: /* @__PURE__ */ e(
|
92
|
-
|
94
|
+
oe,
|
93
95
|
{
|
94
|
-
$showOutline: !
|
96
|
+
$showOutline: !O,
|
95
97
|
$background: `${A}_2`,
|
96
|
-
$disabled:
|
97
|
-
onClick:
|
98
|
-
onMouseEnter:
|
99
|
-
onMouseLeave:
|
100
|
-
children: /* @__PURE__ */
|
101
|
-
|
98
|
+
$disabled: n,
|
99
|
+
onClick: H,
|
100
|
+
onMouseEnter: K,
|
101
|
+
onMouseLeave: P,
|
102
|
+
children: /* @__PURE__ */ m(
|
103
|
+
q,
|
102
104
|
{
|
103
105
|
renderAs: "primary",
|
104
|
-
tooltipItem:
|
106
|
+
tooltipItem: g,
|
105
107
|
position: "bottom",
|
106
108
|
zIndex: 5,
|
107
|
-
hidden:
|
109
|
+
hidden: !g,
|
108
110
|
parentWidth: "100%",
|
109
111
|
widthX: 11.25,
|
110
112
|
children: [
|
111
|
-
/* @__PURE__ */
|
112
|
-
|
113
|
+
/* @__PURE__ */ m(
|
114
|
+
re,
|
113
115
|
{
|
114
116
|
$flexDirection: "row",
|
115
117
|
$alignItems: "center",
|
116
118
|
$heightX: 3.5,
|
117
|
-
$bgImage:
|
119
|
+
$bgImage: D,
|
118
120
|
$gutterX: 0.78125,
|
119
121
|
$flexGap: 8.5,
|
120
|
-
$opacity:
|
122
|
+
$opacity: n ? 0.5 : 1,
|
121
123
|
children: [
|
122
|
-
/* @__PURE__ */
|
123
|
-
|
124
|
+
/* @__PURE__ */ m(
|
125
|
+
ne,
|
124
126
|
{
|
125
127
|
$width: 31,
|
126
128
|
$height: 31,
|
@@ -129,36 +131,43 @@ const we = Y((b) => {
|
|
129
131
|
$alignItems: "center",
|
130
132
|
$justifyContent: "center",
|
131
133
|
children: [
|
132
|
-
|
133
|
-
|
134
|
+
/* @__PURE__ */ e(
|
135
|
+
J,
|
136
|
+
{
|
137
|
+
src: G,
|
138
|
+
ref: h,
|
139
|
+
settings: me
|
140
|
+
}
|
141
|
+
),
|
142
|
+
!$ && /* @__PURE__ */ e(ae, {})
|
134
143
|
]
|
135
144
|
}
|
136
145
|
),
|
137
|
-
/* @__PURE__ */
|
138
|
-
|
146
|
+
/* @__PURE__ */ m(Q, { $renderAs: "ac4-black", $color: "BLACK", children: [
|
147
|
+
R,
|
139
148
|
" ",
|
140
149
|
M && "• CW"
|
141
150
|
] }),
|
142
|
-
|
151
|
+
O && /* @__PURE__ */ e(te, {})
|
143
152
|
]
|
144
153
|
}
|
145
154
|
),
|
146
155
|
/* @__PURE__ */ e(
|
147
|
-
|
156
|
+
ce,
|
148
157
|
{
|
149
|
-
nodeType:
|
158
|
+
nodeType: p,
|
150
159
|
state: c,
|
151
|
-
accuracy:
|
152
|
-
isStudent:
|
160
|
+
accuracy: y,
|
161
|
+
isStudent: E
|
153
162
|
}
|
154
163
|
),
|
155
|
-
!
|
156
|
-
|
164
|
+
!B && /* @__PURE__ */ e(ie, { $background: "WHITE_1", $heightX: 4, children: /* @__PURE__ */ e(
|
165
|
+
se,
|
157
166
|
{
|
158
167
|
$renderAs: "ab3",
|
159
168
|
$color: "BLACK_1",
|
160
|
-
$opacity:
|
161
|
-
children:
|
169
|
+
$opacity: n ? 0.5 : 1,
|
170
|
+
children: w
|
162
171
|
}
|
163
172
|
) })
|
164
173
|
]
|
@@ -170,11 +179,11 @@ const we = Y((b) => {
|
|
170
179
|
menuWidth: "100%",
|
171
180
|
menuZIndex: 6,
|
172
181
|
menuOffset: 2,
|
173
|
-
menuElement: /* @__PURE__ */ e(
|
182
|
+
menuElement: /* @__PURE__ */ e(de, { options: X })
|
174
183
|
}
|
175
184
|
);
|
176
185
|
});
|
177
186
|
export {
|
178
|
-
|
187
|
+
Ee as default
|
179
188
|
};
|
180
189
|
//# sourceMappingURL=student-actions.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"student-actions.js","sources":["../../../../../../src/features/chapters-v2/comps/node-card/student-actions/student-actions.tsx"],"sourcesContent":["import type { INodeCardProps } from '../node-card-types';\nimport type { INodeMenuOption } from '../node-menu-options/node-menu-options-types';\n\nimport { memo, useCallback, useState, type FC } from 'react';\n\nimport Eye2Icon from '../../../../../assets/line-icons/icons/eye2';\nimport RedoIcon from '../../../../../assets/line-icons/icons/redo';\nimport ArrowTooltip from '../../../../ui/arrow-tooltip/arrow-tooltip';\nimport ContextMenu from '../../../../ui/context-menu/context-menu';\nimport LottieAnimation from '../../../../ui/lottie-animation/lottie-animation';\nimport Text from '../../../../ui/text/text';\nimport { BLOCK_TYPE } from '../../../constants/block-constants';\nimport { NODE_CARD_STATES } from '../../../constants/node-constants';\nimport { getNodeTypeBasedBgImage } from '../../../utils';\nimport { getNodeCardBasedIcon } from '../../../utils/node-card-utils';\nimport BorderPathAnimation from '../border-path-animation';\nimport * as Styled from '../node-card-styled';\nimport NodeCardTags from '../node-card-tags';\nimport NodeMenuOptions from '../node-menu-options/node-menu-options';\n\nconst StudentActions: FC<Omit<INodeCardProps, 'userType'>> = memo(props => {\n const {\n nodeData,\n imageHue,\n blockType,\n onNodeAttempt,\n onNodeReattempt,\n onNodeReview,\n onNodeView,\n isStudent,\n } = props;\n const {\n accuracy,\n attempt_location: attemptLocation,\n node_type: nodeType,\n card_header: cardHeader,\n title,\n state,\n is_optional: isOptional,\n sheet_statement: sheetStatement,\n permissions,\n marked_as_completed: teacherMarkedAsCompleted,\n } = nodeData;\n\n const {\n can_review: canReview,\n can_start: canStart,\n can_resume: canResume,\n can_reset: canReset,\n } = permissions;\n\n const isGoalBlock = blockType === BLOCK_TYPE.GOAL;\n const sheetLocked = state === NODE_CARD_STATES.LOCKED;\n const sheetNotStarted = state === NODE_CARD_STATES.NOT_STARTED;\n const sheetInProgress = state === NODE_CARD_STATES.IN_PROGRESS;\n const inClassSheet = attemptLocation === 'INCLASS';\n const canStartOrResume = canStart || canResume;\n\n const showCardAnimation = !isOptional && (sheetInProgress || sheetNotStarted);\n const renderOptions = !canStartOrResume && (canReset || canReview);\n\n const [renderLottie, setRenderLottie] = useState(false);\n const nodeBgImage = getNodeTypeBasedBgImage(nodeType);\n const { icon: NodeCardIcon, lottie: nodeCardLottie } = getNodeCardBasedIcon(nodeType);\n\n const handleOnMenuOptionClick = useCallback(\n (optionId: string) => {\n switch (optionId) {\n case 'node-card-review':\n teacherMarkedAsCompleted ? onNodeView?.(nodeData) : onNodeReview?.(nodeData);\n\n return;\n\n case 'node-card-reattempt':\n onNodeReattempt?.(nodeData);\n\n return;\n\n default:\n throw new Error(`No callback function for ${optionId}`);\n }\n },\n [nodeData, onNodeReattempt, onNodeReview, onNodeView, teacherMarkedAsCompleted],\n );\n\n const handleOnNodeCardClick = useCallback(() => {\n if (renderOptions || sheetLocked) return;\n\n if (canStart || canResume) {\n onNodeAttempt?.(nodeData);\n } else if (teacherMarkedAsCompleted) {\n onNodeView?.(nodeData);\n }\n }, [\n canResume,\n canStart,\n nodeData,\n onNodeAttempt,\n onNodeView,\n renderOptions,\n sheetLocked,\n teacherMarkedAsCompleted,\n ]);\n\n const handleOnMouseEnter = useCallback(() => {\n if (sheetLocked) return;\n setRenderLottie(true);\n }, [sheetLocked]);\n\n const handleOnMouseLeave = useCallback(() => {\n setRenderLottie(false);\n }, []);\n\n const menuOptions: INodeMenuOption[] = [\n {\n id: 'node-card-review',\n label: 'Review',\n icon: Eye2Icon,\n disabled: !canReview,\n onClick: handleOnMenuOptionClick,\n },\n {\n id: 'node-card-reattempt',\n label: 'Reattempt',\n icon: RedoIcon,\n disabled: !canReset,\n onClick: handleOnMenuOptionClick,\n },\n ];\n\n return (\n <ContextMenu\n targetElement={\n <Styled.NodeCardContainer\n $showOutline={!showCardAnimation}\n $background={`${imageHue}_2`}\n $disabled={sheetLocked}\n onClick={handleOnNodeCardClick}\n onMouseEnter={handleOnMouseEnter}\n onMouseLeave={handleOnMouseLeave}\n >\n <ArrowTooltip\n renderAs=\"primary\"\n tooltipItem={sheetStatement}\n position=\"bottom\"\n zIndex={5}\n hidden={!sheetStatement}\n parentWidth=\"100%\"\n widthX={11.25}\n >\n <Styled.NodeCardInfoWrapper\n $flexDirection=\"row\"\n $alignItems=\"center\"\n $heightX={3.5}\n $bgImage={nodeBgImage}\n $gutterX={0.78125}\n $flexGap={8.5}\n $opacity={sheetLocked ? 0.5 : 1}\n >\n <Styled.IconWrapper\n $width={31}\n $height={31}\n $background=\"WHITE_1\"\n $position=\"relative\"\n $alignItems=\"center\"\n $justifyContent=\"center\"\n >\n {renderLottie ? (\n <LottieAnimation src={nodeCardLottie} />\n ) : (\n <NodeCardIcon width={20} height={20} />\n )}\n {!isOptional && <Styled.StyledImportantIcon />}\n </Styled.IconWrapper>\n\n <Text $renderAs=\"ac4-black\" $color=\"BLACK\">\n {cardHeader} {inClassSheet && `• CW`}\n </Text>\n\n {showCardAnimation && <BorderPathAnimation />}\n </Styled.NodeCardInfoWrapper>\n\n <NodeCardTags\n nodeType={nodeType}\n state={state}\n accuracy={accuracy}\n isStudent={isStudent}\n />\n\n {!isGoalBlock && (\n <Styled.NodeCardContentWrapper $background=\"WHITE_1\" $heightX={4}>\n <Styled.NodeCardTitle\n $renderAs=\"ab3\"\n $color=\"BLACK_1\"\n $opacity={sheetLocked ? 0.5 : 1}\n >\n {title}\n </Styled.NodeCardTitle>\n </Styled.NodeCardContentWrapper>\n )}\n </ArrowTooltip>\n </Styled.NodeCardContainer>\n }\n startLeft\n menuWidth=\"100%\"\n menuZIndex={6}\n menuOffset={2}\n menuElement={<>{renderOptions ? <NodeMenuOptions options={menuOptions} /> : undefined}</>}\n />\n );\n});\n\nexport default StudentActions;\n"],"names":["StudentActions","memo","props","nodeData","imageHue","blockType","onNodeAttempt","onNodeReattempt","onNodeReview","onNodeView","isStudent","accuracy","attemptLocation","nodeType","cardHeader","title","state","isOptional","sheetStatement","permissions","teacherMarkedAsCompleted","canReview","canStart","canResume","canReset","isGoalBlock","BLOCK_TYPE","sheetLocked","NODE_CARD_STATES","sheetNotStarted","sheetInProgress","inClassSheet","canStartOrResume","showCardAnimation","renderOptions","renderLottie","setRenderLottie","useState","nodeBgImage","getNodeTypeBasedBgImage","NodeCardIcon","nodeCardLottie","getNodeCardBasedIcon","handleOnMenuOptionClick","useCallback","optionId","handleOnNodeCardClick","handleOnMouseEnter","handleOnMouseLeave","menuOptions","Eye2Icon","RedoIcon","jsx","ContextMenu","Styled.NodeCardContainer","jsxs","ArrowTooltip","Styled.NodeCardInfoWrapper","Styled.IconWrapper","LottieAnimation","Styled.StyledImportantIcon","Text","BorderPathAnimation","NodeCardTags","Styled.NodeCardContentWrapper","Styled.NodeCardTitle","NodeMenuOptions"],"mappings":";;;;;;;;;;;;;;;;AAoBM,MAAAA,KAAuDC,EAAK,CAASC,MAAA;AACnE,QAAA;AAAA,IACJ,UAAAC;AAAA,IACA,UAAAC;AAAA,IACA,WAAAC;AAAA,IACA,eAAAC;AAAA,IACA,iBAAAC;AAAA,IACA,cAAAC;AAAA,IACA,YAAAC;AAAA,IACA,WAAAC;AAAA,EACE,IAAAR,GACE;AAAA,IACJ,UAAAS;AAAA,IACA,kBAAkBC;AAAA,IAClB,WAAWC;AAAA,IACX,aAAaC;AAAA,IACb,OAAAC;AAAA,IACA,OAAAC;AAAA,IACA,aAAaC;AAAA,IACb,iBAAiBC;AAAA,IACjB,aAAAC;AAAA,IACA,qBAAqBC;AAAA,EACnB,IAAAjB,GAEE;AAAA,IACJ,YAAYkB;AAAA,IACZ,WAAWC;AAAA,IACX,YAA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ACvB,KAAe,gBAAAmC,EAAAQ,IAAA,EAA2B;AAAA,0BAAA;AAAA,wBAAA;AAAA,sBAC9C;AAAA,sBAEC,gBAAAL,EAAAM,IAAA,EAAK,WAAU,aAAY,QAAO,SAChC,UAAA;AAAA,wBAAA/C;AAAA,wBAAW;AAAA,wBAAEiB,KAAgB;AAAA,sBAAA,GAChC;AAAA,sBAECE,uBAAsB6B,IAAoB,EAAA;AAAA,oBAAA;AAAA,kBAAA;AAAA,gBAC7C;AAAA,gBAEA,gBAAAV;AAAA,kBAACW;AAAA,kBAAA;AAAA,oBACC,UAAAlD;AAAA,oBACA,OAAAG;AAAA,oBACA,UAAAL;AAAA,oBACA,WAAAD;AAAA,kBAAA;AAAA,gBACF;AAAA,gBAEC,CAACe,KACC,gBAAA2B,EAAAY,IAAA,EAA8B,aAAY,WAAU,UAAU,GAC7D,UAAA,gBAAAZ;AAAA,kBAACa;AAAAA,kBAAA;AAAA,oBACC,WAAU;AAAA,oBACV,QAAO;AAAA,oBACP,UAAUtC,IAAc,MAAM;AAAA,oBAE7B,UAAAZ;AAAA,kBAAA;AAAA,gBAAA,GAEL;AAAA,cAAA;AAAA,YAAA;AAAA,UAEJ;AAAA,QAAA;AAAA,MACF;AAAA,MAEF,WAAS;AAAA,MACT,WAAU;AAAA,MACV,YAAY;AAAA,MACZ,YAAY;AAAA,MACZ,oCAAgB,UAAgBmB,IAAA,gBAAAkB,EAACc,MAAgB,SAASjB,EAAa,CAAA,IAAK,OAAU,CAAA;AAAA,IAAA;AAAA,EAAA;AAG5F,CAAC;"}
|
1
|
+
{"version":3,"file":"student-actions.js","sources":["../../../../../../src/features/chapters-v2/comps/node-card/student-actions/student-actions.tsx"],"sourcesContent":["import type { ILottieAnimationRef } from '../../../../ui/lottie-animation/types';\nimport type { INodeCardProps } from '../node-card-types';\nimport type { INodeMenuOption } from '../node-menu-options/node-menu-options-types';\n\nimport { memo, useCallback, useRef, type FC } from 'react';\n\nimport Eye2Icon from '../../../../../assets/line-icons/icons/eye2';\nimport RedoIcon from '../../../../../assets/line-icons/icons/redo';\nimport ArrowTooltip from '../../../../ui/arrow-tooltip/arrow-tooltip';\nimport ContextMenu from '../../../../ui/context-menu/context-menu';\nimport LottieAnimation from '../../../../ui/lottie-animation/lottie-animation';\nimport Text from '../../../../ui/text/text';\nimport { BLOCK_TYPE } from '../../../constants/block-constants';\nimport { NODE_CARD_STATES } from '../../../constants/node-constants';\nimport { getNodeTypeBasedBgImage } from '../../../utils';\nimport { getNodeCardBasedIcon } from '../../../utils/node-card-utils';\nimport BorderPathAnimation from '../border-path-animation';\nimport * as Styled from '../node-card-styled';\nimport NodeCardTags from '../node-card-tags';\nimport NodeMenuOptions from '../node-menu-options/node-menu-options';\n\nconst renderSettings = { renderer: 'canvas', autoplay: false };\n\nconst StudentActions: FC<Omit<INodeCardProps, 'userType'>> = memo(props => {\n const {\n nodeData,\n imageHue,\n blockType,\n onNodeAttempt,\n onNodeReattempt,\n onNodeReview,\n onNodeView,\n isStudent,\n } = props;\n const {\n accuracy,\n attempt_location: attemptLocation,\n node_type: nodeType,\n card_header: cardHeader,\n title,\n state,\n is_optional: isOptional,\n sheet_statement: sheetStatement,\n permissions,\n marked_as_completed: teacherMarkedAsCompleted,\n } = nodeData;\n const {\n can_review: canReview,\n can_start: canStart,\n can_resume: canResume,\n can_reset: canReset,\n } = permissions;\n\n const isGoalBlock = blockType === BLOCK_TYPE.GOAL;\n const sheetLocked = state === NODE_CARD_STATES.LOCKED;\n const sheetNotStarted = state === NODE_CARD_STATES.NOT_STARTED;\n const sheetInProgress = state === NODE_CARD_STATES.IN_PROGRESS;\n const inClassSheet = attemptLocation === 'INCLASS';\n const canStartOrResume = canStart || canResume;\n\n const showCardAnimation = !isOptional && (sheetInProgress || sheetNotStarted);\n const renderOptions = !canStartOrResume && (canReset || canReview);\n const animationRef = useRef<ILottieAnimationRef | null>(null);\n const nodeBgImage = getNodeTypeBasedBgImage(nodeType);\n const { lottie: nodeCardLottie } = getNodeCardBasedIcon(nodeType);\n\n const handleOnMenuOptionClick = useCallback(\n (optionId: string) => {\n switch (optionId) {\n case 'node-card-review':\n teacherMarkedAsCompleted ? onNodeView?.(nodeData) : onNodeReview?.(nodeData);\n\n return;\n\n case 'node-card-reattempt':\n onNodeReattempt?.(nodeData);\n\n return;\n\n default:\n throw new Error(`No callback function for ${optionId}`);\n }\n },\n [nodeData, onNodeReattempt, onNodeReview, onNodeView, teacherMarkedAsCompleted],\n );\n\n const handleOnNodeCardClick = useCallback(() => {\n if (renderOptions || sheetLocked) return;\n\n if (canStart || canResume) {\n onNodeAttempt?.(nodeData);\n } else if (teacherMarkedAsCompleted) {\n onNodeView?.(nodeData);\n }\n }, [\n canResume,\n canStart,\n nodeData,\n onNodeAttempt,\n onNodeView,\n renderOptions,\n sheetLocked,\n teacherMarkedAsCompleted,\n ]);\n\n const handleOnMouseEnter = useCallback(() => {\n if (sheetLocked) return;\n animationRef.current?.play();\n }, [sheetLocked]);\n\n const handleOnMouseLeave = useCallback(() => {\n animationRef.current?.stop();\n }, []);\n\n const menuOptions: INodeMenuOption[] = [\n {\n id: 'node-card-review',\n label: 'Review',\n icon: Eye2Icon,\n disabled: !canReview,\n onClick: handleOnMenuOptionClick,\n },\n {\n id: 'node-card-reattempt',\n label: 'Reattempt',\n icon: RedoIcon,\n disabled: !canReset,\n onClick: handleOnMenuOptionClick,\n },\n ];\n\n return (\n <ContextMenu\n targetElement={\n <Styled.NodeCardContainer\n $showOutline={!showCardAnimation}\n $background={`${imageHue}_2`}\n $disabled={sheetLocked}\n onClick={handleOnNodeCardClick}\n onMouseEnter={handleOnMouseEnter}\n onMouseLeave={handleOnMouseLeave}\n >\n <ArrowTooltip\n renderAs=\"primary\"\n tooltipItem={sheetStatement}\n position=\"bottom\"\n zIndex={5}\n hidden={!sheetStatement}\n parentWidth=\"100%\"\n widthX={11.25}\n >\n <Styled.NodeCardInfoWrapper\n $flexDirection=\"row\"\n $alignItems=\"center\"\n $heightX={3.5}\n $bgImage={nodeBgImage}\n $gutterX={0.78125}\n $flexGap={8.5}\n $opacity={sheetLocked ? 0.5 : 1}\n >\n <Styled.IconWrapper\n $width={31}\n $height={31}\n $background=\"WHITE_1\"\n $position=\"relative\"\n $alignItems=\"center\"\n $justifyContent=\"center\"\n >\n <LottieAnimation\n src={nodeCardLottie}\n ref={animationRef}\n settings={renderSettings}\n />\n {!isOptional && <Styled.StyledImportantIcon />}\n </Styled.IconWrapper>\n\n <Text $renderAs=\"ac4-black\" $color=\"BLACK\">\n {cardHeader} {inClassSheet && `• CW`}\n </Text>\n\n {showCardAnimation && <BorderPathAnimation />}\n </Styled.NodeCardInfoWrapper>\n\n <NodeCardTags\n nodeType={nodeType}\n state={state}\n accuracy={accuracy}\n isStudent={isStudent}\n />\n\n {!isGoalBlock && (\n <Styled.NodeCardContentWrapper $background=\"WHITE_1\" $heightX={4}>\n <Styled.NodeCardTitle\n $renderAs=\"ab3\"\n $color=\"BLACK_1\"\n $opacity={sheetLocked ? 0.5 : 1}\n >\n {title}\n </Styled.NodeCardTitle>\n </Styled.NodeCardContentWrapper>\n )}\n </ArrowTooltip>\n </Styled.NodeCardContainer>\n }\n startLeft\n menuWidth=\"100%\"\n menuZIndex={6}\n menuOffset={2}\n menuElement={<NodeMenuOptions options={menuOptions} />}\n />\n );\n});\n\nexport default StudentActions;\n"],"names":["renderSettings","StudentActions","memo","props","nodeData","imageHue","blockType","onNodeAttempt","onNodeReattempt","onNodeReview","onNodeView","isStudent","accuracy","attemptLocation","nodeType","cardHeader","title","state","isOptional","sheetStatement","permissions","teacherMarkedAsCompleted","canReview","canStart","canResume","canReset","isGoalBlock","BLOCK_TYPE","sheetLocked","NODE_CARD_STATES","sheetNotStarted","sheetInProgress","inClassSheet","canStartOrResume","showCardAnimation","renderOptions","animationRef","useRef","nodeBgImage","getNodeTypeBasedBgImage","nodeCardLottie","getNodeCardBasedIcon","handleOnMenuOptionClick","useCallback","optionId","handleOnNodeCardClick","handleOnMouseEnter","_a","handleOnMouseLeave","menuOptions","Eye2Icon","RedoIcon","jsx","ContextMenu","Styled.NodeCardContainer","jsxs","ArrowTooltip","Styled.NodeCardInfoWrapper","Styled.IconWrapper","LottieAnimation","Styled.StyledImportantIcon","Text","BorderPathAnimation","NodeCardTags","Styled.NodeCardContentWrapper","Styled.NodeCardTitle","NodeMenuOptions"],"mappings":";;;;;;;;;;;;;;;;AAqBA,MAAMA,KAAiB,EAAE,UAAU,UAAU,UAAU,GAAM,GAEvDC,KAAuDC,EAAK,CAASC,MAAA;AACnE,QAAA;AAAA,IACJ,UAAAC;AAAA,IACA,UAAAC;AAAA,IACA,WAAAC;AAAA,IACA,eAAAC;AAAA,IACA,iBAAAC;AAAA,IACA,cAAAC;AAAA,IACA,YAAAC;AAAA,IACA,WAAAC;AAAA,EACE,IAAAR,GACE;AAAA,IACJ,UAAAS;AAAA,IACA,kBAAkBC;AAAA,IAClB,WAAWC;AAAA,IACX,aAAaC;AAAA,IACb,OAAAC;AAAA,IACA,OAAAC;AAAA,IACA,aAAaC;AAAA,IACb,iBAAiBC;AAAA,IACjB,aAAAC;AAAA,IACA,qBAAqBC;AAAA,EACnB,IAAAjB,GACE;AAAA,IACJ,YAAYkB;AAAA,IACZ,WAAWC;AAAA,IACX,YAAYC;AAAA,IACZ,WAAWC;AAAA,EACT,IAAAL,GAEEM,IAAcpB,MAAcqB,EAAW,MACvCC,IAAcX,MAAUY,EAAiB,QACzCC,IAAkBb,MAAUY,EAAiB,aAC7CE,IAAkBd,MAAUY,EAAiB,aAC7CG,IAAenB,MAAoB,WACnCoB,IAAmBV,KAAYC,GAE/BU,IAAoB,CAAChB,MAAea,KAAmBD,IACvDK,IAAgB,CAACF,MAAqBR,KAAYH,IAClDc,IAAeC,EAAmC,IAAI,GACtDC,IAAcC,EAAwBzB,CAAQ,GAC9C,EAAE,QAAQ0B,EAAe,IAAIC,GAAqB3B,CAAQ,GAE1D4B,IAA0BC;AAAA,IAC9B,CAACC,MAAqB;AACpB,cAAQA,GAA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AAD;AAAA,kBAAA;AAAA,gBACF;AAAA,gBAEC,CAACe,KACC,gBAAA0B,EAAAY,IAAA,EAA8B,aAAY,WAAU,UAAU,GAC7D,UAAA,gBAAAZ;AAAA,kBAACa;AAAAA,kBAAA;AAAA,oBACC,WAAU;AAAA,oBACV,QAAO;AAAA,oBACP,UAAUrC,IAAc,MAAM;AAAA,oBAE7B,UAAAZ;AAAA,kBAAA;AAAA,gBAAA,GAEL;AAAA,cAAA;AAAA,YAAA;AAAA,UAEJ;AAAA,QAAA;AAAA,MACF;AAAA,MAEF,WAAS;AAAA,MACT,WAAU;AAAA,MACV,YAAY;AAAA,MACZ,YAAY;AAAA,MACZ,aAAa,gBAAAoC,EAACc,IAAgB,EAAA,SAASjB,EAAa,CAAA;AAAA,IAAA;AAAA,EAAA;AAG1D,CAAC;"}
|
@@ -1,123 +1,125 @@
|
|
1
1
|
import { jsxs as o, jsx as e } from "react/jsx-runtime";
|
2
|
-
import { memo as U,
|
3
|
-
import
|
4
|
-
import
|
5
|
-
import
|
6
|
-
import
|
7
|
-
import
|
8
|
-
import
|
9
|
-
import
|
10
|
-
import
|
11
|
-
import
|
12
|
-
import { BLOCK_TYPE as
|
13
|
-
import { NODE_CARD_STATES as
|
14
|
-
import { getNodeTypeBasedBgImage as
|
15
|
-
import { getNodeCardBasedIcon as
|
16
|
-
import
|
17
|
-
import { NodeCardContainer as
|
18
|
-
import
|
19
|
-
import
|
20
|
-
const { ASSIGN_AS_HW:
|
2
|
+
import { memo as U, useRef as O, useCallback as $ } from "react";
|
3
|
+
import Y from "../../../../../assets/line-icons/icons/check2.js";
|
4
|
+
import q from "../../../../../assets/line-icons/icons/eye2.js";
|
5
|
+
import J from "../../../../../assets/line-icons/icons/home2.js";
|
6
|
+
import T from "../../../../../assets/line-icons/icons/more-vertical.js";
|
7
|
+
import N from "../../../../ui/arrow-tooltip/arrow-tooltip.js";
|
8
|
+
import Q from "../../../../ui/hooks/use-context-menu-click-handler.js";
|
9
|
+
import V from "../../../../ui/layout/flex-view.js";
|
10
|
+
import Z from "../../../../ui/lottie-animation/lottie-animation.js";
|
11
|
+
import D from "../../../../ui/text/text.js";
|
12
|
+
import { BLOCK_TYPE as ee } from "../../../constants/block-constants.js";
|
13
|
+
import { NODE_CARD_STATES as C, TEACHER_MENU_LABELS as te } from "../../../constants/node-constants.js";
|
14
|
+
import { getNodeTypeBasedBgImage as re } from "../../../utils/index.js";
|
15
|
+
import { getNodeCardBasedIcon as ne } from "../../../utils/node-card-utils.js";
|
16
|
+
import oe from "../border-path-animation.js";
|
17
|
+
import { NodeCardContainer as ie, NodeCardInfoWrapper as ae, IconWrapper as ce, StyledImportantIcon as se, NodeKebabMenuWrapper as y, NodeCardContentWrapper as le, NodeCardTitle as me, NodeMenuOptionsWrapper as de } from "../node-card-styled.js";
|
18
|
+
import pe from "../node-card-tags.js";
|
19
|
+
import he from "../node-menu-options/node-menu-options.js";
|
20
|
+
const fe = { renderer: "canvas", autoplay: !1 }, { ASSIGN_AS_HW: ue, REVIEW: $e, VIEW: Ce, MARK_AS_DONE: _e } = te, Re = U(
|
21
21
|
({
|
22
|
-
nodeData:
|
22
|
+
nodeData: r,
|
23
23
|
imageHue: A,
|
24
|
-
blockType:
|
25
|
-
isSkipped:
|
24
|
+
blockType: x,
|
25
|
+
isSkipped: _,
|
26
26
|
onNodeAttemptLocationChange: i,
|
27
|
-
onNodeMarkAsDone:
|
28
|
-
onNodeView:
|
29
|
-
onNodeReview:
|
27
|
+
onNodeMarkAsDone: a,
|
28
|
+
onNodeView: c,
|
29
|
+
onNodeReview: s
|
30
30
|
}) => {
|
31
|
-
const
|
32
|
-
accuracy:
|
33
|
-
attempt_location:
|
31
|
+
const m = O(null), { menuVisible: W, onMenuClick: I } = Q(m), {
|
32
|
+
accuracy: w,
|
33
|
+
attempt_location: B,
|
34
34
|
node_type: d,
|
35
|
-
card_header:
|
35
|
+
card_header: L,
|
36
36
|
title: M,
|
37
|
-
state:
|
38
|
-
is_optional:
|
39
|
-
sheet_statement:
|
37
|
+
state: l,
|
38
|
+
is_optional: g,
|
39
|
+
sheet_statement: b,
|
40
40
|
permissions: H,
|
41
|
-
user_attempt_id:
|
42
|
-
} =
|
43
|
-
can_change_attempt_location:
|
44
|
-
can_mark_familiar:
|
45
|
-
can_review:
|
46
|
-
} = H,
|
47
|
-
(
|
48
|
-
switch (
|
41
|
+
user_attempt_id: p
|
42
|
+
} = r, { lottie: G } = ne(d), h = O(null), {
|
43
|
+
can_change_attempt_location: K,
|
44
|
+
can_mark_familiar: R,
|
45
|
+
can_review: f
|
46
|
+
} = H, E = x === ee.GOAL, n = l === C.LOCKED, j = l === C.NOT_STARTED, v = l === C.IN_PROGRESS, S = B === "INCLASS", k = !g && (v || j), P = re(d), u = $(
|
47
|
+
(t) => {
|
48
|
+
switch (t) {
|
49
49
|
case "node-card-view":
|
50
|
-
|
50
|
+
f && p ? s == null || s(r) : c == null || c(r);
|
51
51
|
return;
|
52
52
|
case "node-card-assign-as-hw":
|
53
|
-
i == null || i(
|
53
|
+
i == null || i(r);
|
54
54
|
return;
|
55
55
|
case "node-card-mark-as-done":
|
56
|
-
|
56
|
+
a == null || a(r);
|
57
57
|
return;
|
58
58
|
default:
|
59
|
-
throw new Error(`No callback function for ${
|
59
|
+
throw new Error(`No callback function for ${t}`);
|
60
60
|
}
|
61
61
|
},
|
62
62
|
[
|
63
|
-
|
64
|
-
|
63
|
+
f,
|
64
|
+
r,
|
65
65
|
i,
|
66
|
-
n,
|
67
|
-
c,
|
68
66
|
a,
|
69
|
-
|
67
|
+
s,
|
68
|
+
c,
|
69
|
+
p
|
70
70
|
]
|
71
|
-
),
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
71
|
+
), X = $(() => {
|
72
|
+
var t;
|
73
|
+
n || (t = h.current) == null || t.play();
|
74
|
+
}, [n]), F = $(() => {
|
75
|
+
var t;
|
76
|
+
(t = h.current) == null || t.stop();
|
77
|
+
}, []), z = [
|
76
78
|
{
|
77
79
|
id: "node-card-view",
|
78
|
-
label:
|
79
|
-
icon:
|
80
|
+
label: f && p ? $e : Ce,
|
81
|
+
icon: q,
|
80
82
|
disabled: !1,
|
81
|
-
onClick:
|
83
|
+
onClick: u
|
82
84
|
},
|
83
85
|
{
|
84
86
|
id: "node-card-assign-as-hw",
|
85
|
-
label:
|
86
|
-
icon:
|
87
|
-
disabled: !
|
88
|
-
onClick:
|
87
|
+
label: ue,
|
88
|
+
icon: J,
|
89
|
+
disabled: !K || !S,
|
90
|
+
onClick: u
|
89
91
|
},
|
90
92
|
{
|
91
93
|
id: "node-card-mark-as-done",
|
92
|
-
label:
|
93
|
-
icon:
|
94
|
-
disabled: !
|
95
|
-
onClick:
|
94
|
+
label: _e,
|
95
|
+
icon: Y,
|
96
|
+
disabled: !R,
|
97
|
+
onClick: u
|
96
98
|
}
|
97
99
|
];
|
98
100
|
return /* @__PURE__ */ o(
|
99
|
-
|
101
|
+
ie,
|
100
102
|
{
|
101
|
-
$showOutline: !
|
102
|
-
$isSheetLocked:
|
103
|
+
$showOutline: !k,
|
104
|
+
$isSheetLocked: n,
|
103
105
|
$background: `${A}_2`,
|
104
|
-
$disabled:
|
105
|
-
onMouseEnter:
|
106
|
-
onMouseLeave:
|
106
|
+
$disabled: !!_,
|
107
|
+
onMouseEnter: X,
|
108
|
+
onMouseLeave: F,
|
107
109
|
children: [
|
108
110
|
/* @__PURE__ */ o(
|
109
|
-
|
111
|
+
N,
|
110
112
|
{
|
111
113
|
renderAs: "primary",
|
112
|
-
tooltipItem:
|
114
|
+
tooltipItem: b,
|
113
115
|
position: "bottom",
|
114
116
|
zIndex: 5,
|
115
|
-
hidden: !
|
117
|
+
hidden: !b,
|
116
118
|
parentWidth: "100%",
|
117
119
|
widthX: 11.25,
|
118
120
|
children: [
|
119
121
|
/* @__PURE__ */ o(
|
120
|
-
|
122
|
+
ae,
|
121
123
|
{
|
122
124
|
$flexDirection: "row",
|
123
125
|
$alignItems: "center",
|
@@ -128,7 +130,7 @@ const { ASSIGN_AS_HW: Ce, REVIEW: _e, VIEW: Ie, MARK_AS_DONE: ge } = ie, Pe = U(
|
|
128
130
|
$flexGap: 8.5,
|
129
131
|
children: [
|
130
132
|
/* @__PURE__ */ o(
|
131
|
-
|
133
|
+
ce,
|
132
134
|
{
|
133
135
|
$width: 31,
|
134
136
|
$height: 31,
|
@@ -136,26 +138,26 @@ const { ASSIGN_AS_HW: Ce, REVIEW: _e, VIEW: Ie, MARK_AS_DONE: ge } = ie, Pe = U(
|
|
136
138
|
$position: "relative",
|
137
139
|
$alignItems: "center",
|
138
140
|
$justifyContent: "center",
|
139
|
-
$opacity:
|
141
|
+
$opacity: n ? 0.5 : 1,
|
140
142
|
children: [
|
141
|
-
|
142
|
-
!
|
143
|
+
/* @__PURE__ */ e(Z, { src: G, ref: h, settings: fe }),
|
144
|
+
!g && /* @__PURE__ */ e(se, {})
|
143
145
|
]
|
144
146
|
}
|
145
147
|
),
|
146
|
-
/* @__PURE__ */ o(
|
147
|
-
|
148
|
+
/* @__PURE__ */ o(D, { $renderAs: "ac4-black", $color: "BLACK", $opacity: n ? 0.5 : 1, children: [
|
149
|
+
L,
|
148
150
|
" ",
|
149
|
-
|
151
|
+
S && "• CW"
|
150
152
|
] }),
|
151
|
-
/* @__PURE__ */ e(
|
152
|
-
|
153
|
+
/* @__PURE__ */ e(V, { className: "context-menu", children: E && /* @__PURE__ */ e(y, { ref: m, onClick: I, children: /* @__PURE__ */ e(T, { width: 16, height: 16 }) }) }),
|
154
|
+
k && !_ && /* @__PURE__ */ e(oe, {})
|
153
155
|
]
|
154
156
|
}
|
155
157
|
),
|
156
|
-
/* @__PURE__ */ e(
|
157
|
-
!
|
158
|
-
|
158
|
+
/* @__PURE__ */ e(pe, { nodeType: d, state: l, accuracy: w }),
|
159
|
+
!E && /* @__PURE__ */ o(
|
160
|
+
le,
|
159
161
|
{
|
160
162
|
$flexDirection: "row",
|
161
163
|
$alignItems: "center",
|
@@ -165,28 +167,28 @@ const { ASSIGN_AS_HW: Ce, REVIEW: _e, VIEW: Ie, MARK_AS_DONE: ge } = ie, Pe = U(
|
|
165
167
|
$justifyContent: "space-between",
|
166
168
|
children: [
|
167
169
|
/* @__PURE__ */ e(
|
168
|
-
|
170
|
+
me,
|
169
171
|
{
|
170
172
|
$renderAs: "ab3",
|
171
173
|
$color: "BLACK_1",
|
172
|
-
$opacity:
|
174
|
+
$opacity: n ? 0.5 : 1,
|
173
175
|
children: M
|
174
176
|
}
|
175
177
|
),
|
176
|
-
/* @__PURE__ */ e(
|
178
|
+
/* @__PURE__ */ e(y, { ref: m, onClick: I, children: /* @__PURE__ */ e(T, { width: 16, height: 16 }) })
|
177
179
|
]
|
178
180
|
}
|
179
181
|
)
|
180
182
|
]
|
181
183
|
}
|
182
184
|
),
|
183
|
-
/* @__PURE__ */ e(
|
185
|
+
/* @__PURE__ */ e(de, { $visible: W, children: /* @__PURE__ */ e(he, { options: z }) })
|
184
186
|
]
|
185
187
|
}
|
186
188
|
);
|
187
189
|
}
|
188
190
|
);
|
189
191
|
export {
|
190
|
-
|
192
|
+
Re as default
|
191
193
|
};
|
192
194
|
//# sourceMappingURL=teacher-actions.js.map
|