@cuemath/leap 2.9.4-as10 → 2.9.4-as13
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-v2/chapter-details/block-sections/block-sections.js +76 -60
- package/dist/features/chapters-v2/chapter-details/block-sections/block-sections.js.map +1 -1
- package/dist/features/chapters-v2/chapter-details/chapter-details-styled.js +2 -3
- package/dist/features/chapters-v2/chapter-details/chapter-details-styled.js.map +1 -1
- package/dist/features/chapters-v2/comps/node-card/node-card-tags.js +11 -11
- package/dist/features/chapters-v2/comps/node-card/node-card-tags.js.map +1 -1
- package/dist/features/chapters-v2/comps/node-card/node-card.js +6 -6
- package/dist/features/chapters-v2/comps/node-card/node-card.js.map +1 -1
- package/dist/features/chapters-v2/comps/node-card/student-actions/student-actions.js +66 -57
- package/dist/features/chapters-v2/comps/node-card/student-actions/student-actions.js.map +1 -1
- package/dist/features/chapters-v2/utils/node-card-utils.js +77 -46
- package/dist/features/chapters-v2/utils/node-card-utils.js.map +1 -1
- package/dist/features/homework/homework-card-view.js +40 -30
- package/dist/features/homework/homework-card-view.js.map +1 -1
- package/dist/features/homework/homework-card.js +32 -31
- package/dist/features/homework/homework-card.js.map +1 -1
- package/dist/features/homework/hw-card-list/hw-card-list-styled.js +15 -23
- package/dist/features/homework/hw-card-list/hw-card-list-styled.js.map +1 -1
- package/dist/features/homework/hw-card-list/hw-card-list.js +134 -154
- 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 +1 -1
- package/dist/features/milestone/milestone-list-container/milestone-list/milestone-list.js.map +1 -1
- package/dist/features/milestone/milestone-list-container/milestone-list-container.js +14 -14
- package/dist/features/milestone/milestone-list-container/milestone-list-container.js.map +1 -1
- package/dist/features/milestone/milestone-resources/resources-assign/api/goal-resource-assign.js +1 -1
- package/dist/features/milestone/milestone-resources/resources-assign/api/goal-resource-assign.js.map +1 -1
- package/dist/features/milestone/milestone-tests/tests-creation/api/test-sheet-assign.js.map +1 -1
- package/dist/features/milestone/milestone-tests/tests-creation/tests-creation.js +39 -38
- package/dist/features/milestone/milestone-tests/tests-creation/tests-creation.js.map +1 -1
- package/package.json +1 -1
@@ -1,45 +1,67 @@
|
|
1
|
-
import { jsx as e, jsxs as
|
2
|
-
import
|
3
|
-
import
|
1
|
+
import { jsx as e, jsxs as I } from "react/jsx-runtime";
|
2
|
+
import p from "../../../assets/line-icons/icons/alarm.js";
|
3
|
+
import f from "../../../assets/line-icons/icons/bulb2.js";
|
4
4
|
import T from "../../../assets/line-icons/icons/check2.js";
|
5
|
-
import
|
6
|
-
import
|
5
|
+
import u from "../../../assets/line-icons/icons/dart.js";
|
6
|
+
import A from "../../../assets/line-icons/icons/exclamation.js";
|
7
7
|
import R from "../../../assets/line-icons/icons/lock2.js";
|
8
|
-
import
|
9
|
-
import
|
10
|
-
import
|
11
|
-
import
|
12
|
-
import
|
8
|
+
import h from "../../../assets/line-icons/icons/play2.js";
|
9
|
+
import D from "../../../assets/line-icons/icons/puzzle.js";
|
10
|
+
import $ from "../../../assets/line-icons/icons/recap.js";
|
11
|
+
import C from "../../../assets/line-icons/icons/status.js";
|
12
|
+
import S from "../../../assets/line-icons/icons/testtube.js";
|
13
13
|
import { LOTTIE as t } from "../../../assets/lottie/lottie.js";
|
14
|
-
import
|
15
|
-
import
|
16
|
-
import
|
14
|
+
import g from "../../ui/layout/flex-view.js";
|
15
|
+
import a from "../../ui/arrow-tooltip/arrow-tooltip.js";
|
16
|
+
import m from "../../ui/text/text.js";
|
17
|
+
import { InProgressIconWrapper as l } from "../comps/node-card/node-card-styled.js";
|
17
18
|
import E from "../comps/tag/tag.js";
|
18
|
-
const
|
19
|
-
if (!
|
20
|
-
return { isOverdue: !1, daysText: "" };
|
21
|
-
const
|
22
|
-
return { isOverdue:
|
23
|
-
},
|
24
|
-
const { isOverdue:
|
25
|
-
if (
|
19
|
+
const P = 60 * 60 * 24, b = ["NOT_STARTED", "IN_PROGRESS"], O = (o) => {
|
20
|
+
if (!o)
|
21
|
+
return { isOverdue: !1, daysText: "", differenceInDays: 0 };
|
22
|
+
const i = Math.floor(Date.now() / 1e3), c = o - i, n = Math.ceil(c / P), s = n < 0, r = n > 0 ? `${Math.abs(n)}D` : "";
|
23
|
+
return { isOverdue: s, daysText: r, differenceInDays: n };
|
24
|
+
}, Y = (o, i, c, n) => {
|
25
|
+
const { isOverdue: s, daysText: r, differenceInDays: d } = O(n);
|
26
|
+
if (s && b.includes(o))
|
26
27
|
return {
|
27
|
-
icon: /* @__PURE__ */ e(
|
28
|
+
icon: /* @__PURE__ */ e(
|
29
|
+
a,
|
30
|
+
{
|
31
|
+
renderAs: "primary",
|
32
|
+
position: "bottom",
|
33
|
+
tooltipItem: "Complete now",
|
34
|
+
zIndex: 10,
|
35
|
+
hidden: !i,
|
36
|
+
parentWidth: "fit-content",
|
37
|
+
children: /* @__PURE__ */ e(g, { $background: "RED", $borderRadius: 16, $gapX: 0.24, $gutterX: 0.5, children: /* @__PURE__ */ e(m, { $renderAs: "ac4-black", $color: "WHITE", children: "OVERDUE" }) })
|
38
|
+
}
|
39
|
+
),
|
28
40
|
top: -10,
|
29
41
|
right: -10
|
30
42
|
};
|
31
|
-
switch (
|
43
|
+
switch (o) {
|
32
44
|
case "NOT_STARTED":
|
33
45
|
return {
|
34
46
|
icon: /* @__PURE__ */ e(
|
35
47
|
a,
|
36
48
|
{
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
children:
|
49
|
+
renderAs: "primary",
|
50
|
+
position: "bottom",
|
51
|
+
tooltipItem: d > 1 ? `${d} days left` : "Complete it today",
|
52
|
+
zIndex: 10,
|
53
|
+
hidden: !i,
|
54
|
+
children: /* @__PURE__ */ e(
|
55
|
+
l,
|
56
|
+
{
|
57
|
+
$flexDirection: "row",
|
58
|
+
$alignItems: "center",
|
59
|
+
$justifyContent: "center",
|
60
|
+
$gutterX: 0.5,
|
61
|
+
$borderRadius: 16,
|
62
|
+
children: r && /* @__PURE__ */ e(m, { $renderAs: "ub3-bold", $color: "WHITE", children: r })
|
63
|
+
}
|
64
|
+
)
|
43
65
|
}
|
44
66
|
),
|
45
67
|
top: 0,
|
@@ -53,17 +75,17 @@ const C = 60 * 60 * 24, P = ["NOT_STARTED", "IN_PROGRESS"], g = (r) => {
|
|
53
75
|
};
|
54
76
|
case "IN_PROGRESS":
|
55
77
|
return {
|
56
|
-
icon: /* @__PURE__ */
|
57
|
-
|
78
|
+
icon: /* @__PURE__ */ I(
|
79
|
+
l,
|
58
80
|
{
|
59
81
|
$flexDirection: "row",
|
60
82
|
$alignItems: "center",
|
61
83
|
$justifyContent: "center",
|
62
|
-
$gutterX:
|
84
|
+
$gutterX: r ? 0.25 : 0,
|
63
85
|
$borderRadius: 16,
|
64
86
|
children: [
|
65
|
-
|
66
|
-
/* @__PURE__ */ e(
|
87
|
+
r && /* @__PURE__ */ e(m, { $renderAs: "ub3-bold", $color: "WHITE", children: r }),
|
88
|
+
/* @__PURE__ */ e(C, {})
|
67
89
|
]
|
68
90
|
}
|
69
91
|
)
|
@@ -82,7 +104,16 @@ const C = 60 * 60 * 24, P = ["NOT_STARTED", "IN_PROGRESS"], g = (r) => {
|
|
82
104
|
};
|
83
105
|
case "WAIT_FOR_REVIEW":
|
84
106
|
return {
|
85
|
-
icon: /* @__PURE__ */ e(
|
107
|
+
icon: /* @__PURE__ */ e(
|
108
|
+
a,
|
109
|
+
{
|
110
|
+
renderAs: "primary",
|
111
|
+
position: "bottom",
|
112
|
+
tooltipItem: i ? "Waiting for teacher to review" : "Needs your review",
|
113
|
+
zIndex: 10,
|
114
|
+
children: /* @__PURE__ */ e(E, { Icon: A })
|
115
|
+
}
|
116
|
+
),
|
86
117
|
top: -10,
|
87
118
|
right: -10
|
88
119
|
};
|
@@ -91,24 +122,24 @@ const C = 60 * 60 * 24, P = ["NOT_STARTED", "IN_PROGRESS"], g = (r) => {
|
|
91
122
|
icon: void 0
|
92
123
|
};
|
93
124
|
}
|
94
|
-
},
|
95
|
-
switch (
|
125
|
+
}, B = (o) => {
|
126
|
+
switch (o) {
|
96
127
|
case "LEARNING":
|
97
128
|
return {
|
98
129
|
lottie: t.LEARN,
|
99
|
-
icon:
|
130
|
+
icon: f
|
100
131
|
};
|
101
132
|
case "RECAP":
|
102
133
|
return {
|
103
134
|
lottie: t.RECAP,
|
104
|
-
icon:
|
135
|
+
icon: $
|
105
136
|
};
|
106
137
|
case "DYNAMIC":
|
107
138
|
case "ASSESSMENT":
|
108
139
|
case "CHAPTER_ASSESSMENT":
|
109
140
|
return {
|
110
141
|
lottie: t.TEST,
|
111
|
-
icon:
|
142
|
+
icon: p
|
112
143
|
};
|
113
144
|
case "PRACTICE":
|
114
145
|
case "EXTRA_PRACTICE":
|
@@ -116,29 +147,29 @@ const C = 60 * 60 * 24, P = ["NOT_STARTED", "IN_PROGRESS"], g = (r) => {
|
|
116
147
|
case "MASTERY":
|
117
148
|
return {
|
118
149
|
lottie: t.PRACTICE,
|
119
|
-
icon:
|
150
|
+
icon: u
|
120
151
|
};
|
121
152
|
case "PUZZLE_EASY":
|
122
153
|
case "PUZZLE_MEDIUM":
|
123
154
|
case "PUZZLE_HARD":
|
124
155
|
return {
|
125
156
|
lottie: t.PUZZLE,
|
126
|
-
icon:
|
157
|
+
icon: D
|
127
158
|
};
|
128
159
|
case "VIDEO":
|
129
160
|
return {
|
130
161
|
lottie: t.VIDEO,
|
131
|
-
icon:
|
162
|
+
icon: h
|
132
163
|
};
|
133
164
|
default:
|
134
165
|
return {
|
135
166
|
lottie: t.PROJECT,
|
136
|
-
icon:
|
167
|
+
icon: S
|
137
168
|
};
|
138
169
|
}
|
139
170
|
};
|
140
171
|
export {
|
141
|
-
|
142
|
-
|
172
|
+
B as getNodeCardBasedIcon,
|
173
|
+
Y as getNodeStateBasedTagInfo
|
143
174
|
};
|
144
175
|
//# sourceMappingURL=node-card-utils.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"node-card-utils.js","sources":["../../../../src/features/chapters-v2/utils/node-card-utils.tsx"],"sourcesContent":["import type { INodeDataProps } from '../comps/node-card/node-card-types';\n\nimport AlarmIcon from '../../../assets/line-icons/icons/alarm';\nimport Bulb2Icon from '../../../assets/line-icons/icons/bulb2';\nimport Check2Icon from '../../../assets/line-icons/icons/check2';\nimport DartIcon from '../../../assets/line-icons/icons/dart';\nimport ExclamationIcon from '../../../assets/line-icons/icons/exclamation';\nimport Lock2Icon from '../../../assets/line-icons/icons/lock2';\nimport Play2Icon from '../../../assets/line-icons/icons/play2';\nimport PuzzleIcon from '../../../assets/line-icons/icons/puzzle';\nimport RecapIcon from '../../../assets/line-icons/icons/recap';\nimport StatusIcon from '../../../assets/line-icons/icons/status';\nimport TestTubeIcon from '../../../assets/line-icons/icons/testtube';\nimport { LOTTIE } from '../../../assets/lottie/lottie';\nimport FlexView from '../..//ui/layout/flex-view';\nimport Text from '../../ui/text/text';\nimport { InProgressIconWrapper } from '../comps/node-card/node-card-styled';\nimport Tag from '../comps/tag/tag';\n\ninterface DueDateInfo {\n isOverdue: boolean;\n daysText: string;\n}\n\nconst SECONDS_PER_DAY = 60 * 60 * 24;\nconst OVERDUE_TAG_STATES: INodeDataProps['state'][] = ['NOT_STARTED', 'IN_PROGRESS'];\n\nconst calculateDueDateInfo = (dueDateTs?: number | null): DueDateInfo => {\n if (!dueDateTs) {\n return { isOverdue: false, daysText: '' };\n }\n\n const currentTimestamp = Math.floor(Date.now() / 1000);\n const differenceInSeconds = dueDateTs - currentTimestamp;\n const differenceInDays = Math.ceil(differenceInSeconds / SECONDS_PER_DAY);\n\n const isOverdue = differenceInDays < 0;\n\n const daysText = differenceInDays > 0 ? `${Math.abs(differenceInDays)}D` : '';\n\n return { isOverdue, daysText };\n};\n\nconst getNodeStateBasedTagInfo = (\n nodeState: INodeDataProps['state'],\n accuracy?: number | null,\n dueDateTs?: number | null,\n) => {\n const { isOverdue, daysText } = calculateDueDateInfo(dueDateTs);\n\n if (isOverdue && OVERDUE_TAG_STATES.includes(nodeState)) {\n return {\n icon: (\n <FlexView $background=\"RED\" $borderRadius={16} $gapX={0.24} $gutterX={0.5}>\n
|
1
|
+
{"version":3,"file":"node-card-utils.js","sources":["../../../../src/features/chapters-v2/utils/node-card-utils.tsx"],"sourcesContent":["import type { INodeDataProps } from '../comps/node-card/node-card-types';\n\nimport AlarmIcon from '../../../assets/line-icons/icons/alarm';\nimport Bulb2Icon from '../../../assets/line-icons/icons/bulb2';\nimport Check2Icon from '../../../assets/line-icons/icons/check2';\nimport DartIcon from '../../../assets/line-icons/icons/dart';\nimport ExclamationIcon from '../../../assets/line-icons/icons/exclamation';\nimport Lock2Icon from '../../../assets/line-icons/icons/lock2';\nimport Play2Icon from '../../../assets/line-icons/icons/play2';\nimport PuzzleIcon from '../../../assets/line-icons/icons/puzzle';\nimport RecapIcon from '../../../assets/line-icons/icons/recap';\nimport StatusIcon from '../../../assets/line-icons/icons/status';\nimport TestTubeIcon from '../../../assets/line-icons/icons/testtube';\nimport { LOTTIE } from '../../../assets/lottie/lottie';\nimport FlexView from '../..//ui/layout/flex-view';\nimport ArrowTooltip from '../../ui/arrow-tooltip/arrow-tooltip';\nimport Text from '../../ui/text/text';\nimport { InProgressIconWrapper } from '../comps/node-card/node-card-styled';\nimport Tag from '../comps/tag/tag';\n\ninterface DueDateInfo {\n isOverdue: boolean;\n daysText: string;\n differenceInDays: number;\n}\n\nconst SECONDS_PER_DAY = 60 * 60 * 24;\nconst OVERDUE_TAG_STATES: INodeDataProps['state'][] = ['NOT_STARTED', 'IN_PROGRESS'];\n\nconst calculateDueDateInfo = (dueDateTs?: number | null): DueDateInfo => {\n if (!dueDateTs) {\n return { isOverdue: false, daysText: '', differenceInDays: 0 };\n }\n\n const currentTimestamp = Math.floor(Date.now() / 1000);\n const differenceInSeconds = dueDateTs - currentTimestamp;\n const differenceInDays = Math.ceil(differenceInSeconds / SECONDS_PER_DAY);\n\n const isOverdue = differenceInDays < 0;\n\n const daysText = differenceInDays > 0 ? `${Math.abs(differenceInDays)}D` : '';\n\n return { isOverdue, daysText, differenceInDays };\n};\n\nconst getNodeStateBasedTagInfo = (\n nodeState: INodeDataProps['state'],\n isStudent: boolean,\n accuracy?: number | null,\n dueDateTs?: number | null,\n) => {\n const { isOverdue, daysText, differenceInDays } = calculateDueDateInfo(dueDateTs);\n\n if (isOverdue && OVERDUE_TAG_STATES.includes(nodeState)) {\n return {\n icon: (\n <ArrowTooltip\n renderAs=\"primary\"\n position=\"bottom\"\n tooltipItem=\"Complete now\"\n zIndex={10}\n hidden={!isStudent}\n parentWidth=\"fit-content\"\n >\n <FlexView $background=\"RED\" $borderRadius={16} $gapX={0.24} $gutterX={0.5}>\n <Text $renderAs=\"ac4-black\" $color=\"WHITE\">\n OVERDUE\n </Text>\n </FlexView>\n </ArrowTooltip>\n ),\n top: -10,\n right: -10,\n };\n }\n\n switch (nodeState) {\n case 'NOT_STARTED':\n return {\n icon: (\n <ArrowTooltip\n renderAs=\"primary\"\n position=\"bottom\"\n tooltipItem={\n differenceInDays > 1 ? `${differenceInDays} days left` : 'Complete it today'\n }\n zIndex={10}\n hidden={!isStudent}\n >\n <InProgressIconWrapper\n $flexDirection=\"row\"\n $alignItems=\"center\"\n $justifyContent=\"center\"\n $gutterX={0.5}\n $borderRadius={16}\n >\n {daysText && (\n <Text $renderAs=\"ub3-bold\" $color=\"WHITE\">\n {daysText}\n </Text>\n )}\n </InProgressIconWrapper>\n </ArrowTooltip>\n ),\n top: 0,\n right: 0,\n };\n case 'LOCKED':\n return {\n icon: <Lock2Icon width={32} height={32} />,\n top: -12,\n right: -12,\n };\n case 'IN_PROGRESS':\n return {\n icon: (\n <InProgressIconWrapper\n $flexDirection=\"row\"\n $alignItems=\"center\"\n $justifyContent=\"center\"\n $gutterX={daysText ? 0.25 : 0}\n $borderRadius={16}\n >\n {daysText && (\n <Text $renderAs=\"ub3-bold\" $color=\"WHITE\">\n {daysText}\n </Text>\n )}\n <StatusIcon />\n </InProgressIconWrapper>\n ),\n };\n case 'COMPLETED':\n return {\n icon: (\n <Tag\n Icon={Check2Icon}\n label={typeof accuracy === 'number' ? `${accuracy}%` : undefined}\n />\n ),\n top: -10,\n right: -10,\n };\n case 'WAIT_FOR_REVIEW':\n return {\n icon: (\n <ArrowTooltip\n renderAs=\"primary\"\n position=\"bottom\"\n tooltipItem={isStudent ? 'Waiting for teacher to review' : 'Needs your review'}\n zIndex={10}\n >\n <Tag Icon={ExclamationIcon} />\n </ArrowTooltip>\n ),\n top: -10,\n right: -10,\n };\n\n default:\n return {\n icon: undefined,\n };\n }\n};\n\nconst getNodeCardBasedIcon = (nodeType: INodeDataProps['node_type']) => {\n switch (nodeType) {\n case 'LEARNING':\n return {\n lottie: LOTTIE.LEARN,\n icon: Bulb2Icon,\n };\n case 'RECAP':\n return {\n lottie: LOTTIE.RECAP,\n icon: RecapIcon,\n };\n case 'DYNAMIC':\n case 'ASSESSMENT':\n case 'CHAPTER_ASSESSMENT':\n return {\n lottie: LOTTIE.TEST,\n icon: AlarmIcon,\n };\n case 'PRACTICE':\n case 'EXTRA_PRACTICE':\n case 'TARGET_PRACTICE':\n case 'MASTERY':\n return {\n lottie: LOTTIE.PRACTICE,\n icon: DartIcon,\n };\n case 'PUZZLE_EASY':\n case 'PUZZLE_MEDIUM':\n case 'PUZZLE_HARD':\n return {\n lottie: LOTTIE.PUZZLE,\n icon: PuzzleIcon,\n };\n case 'VIDEO':\n return {\n lottie: LOTTIE.VIDEO,\n icon: Play2Icon,\n };\n default:\n return {\n lottie: LOTTIE.PROJECT,\n icon: TestTubeIcon,\n };\n }\n};\n\nexport { getNodeStateBasedTagInfo, getNodeCardBasedIcon };\n"],"names":["SECONDS_PER_DAY","OVERDUE_TAG_STATES","calculateDueDateInfo","dueDateTs","currentTimestamp","differenceInSeconds","differenceInDays","isOverdue","daysText","getNodeStateBasedTagInfo","nodeState","isStudent","accuracy","jsx","ArrowTooltip","FlexView","Text","InProgressIconWrapper","Lock2Icon","jsxs","StatusIcon","Tag","Check2Icon","ExclamationIcon","getNodeCardBasedIcon","nodeType","LOTTIE","Bulb2Icon","RecapIcon","AlarmIcon","DartIcon","PuzzleIcon","Play2Icon","TestTubeIcon"],"mappings":"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"}
|
@@ -1,39 +1,40 @@
|
|
1
1
|
import { jsxs as i, jsx as e } from "react/jsx-runtime";
|
2
|
-
import { useState as m, useRef as
|
3
|
-
import
|
4
|
-
import
|
5
|
-
import { getNodeTypeBasedBgImage as
|
6
|
-
import { getNodeCardBasedIcon as
|
2
|
+
import { useState as m, useRef as k, useCallback as p, useLayoutEffect as L } from "react";
|
3
|
+
import B from "../../assets/line-icons/icons/closed-eye.js";
|
4
|
+
import R from "../chapters-v2/comps/node-card/node-card-tags.js";
|
5
|
+
import { getNodeTypeBasedBgImage as v } from "../chapters-v2/utils/index.js";
|
6
|
+
import { getNodeCardBasedIcon as O } from "../chapters-v2/utils/node-card-utils.js";
|
7
7
|
import u from "../ui/arrow-tooltip/arrow-tooltip.js";
|
8
8
|
import r from "../ui/layout/flex-view.js";
|
9
|
-
import
|
10
|
-
import
|
11
|
-
import
|
12
|
-
import { CardWrapper as
|
13
|
-
const
|
9
|
+
import W from "../ui/lottie-animation/lottie-animation.js";
|
10
|
+
import D from "./card-title.js";
|
11
|
+
import S from "./node-progress.js";
|
12
|
+
import { CardWrapper as j, IconWrapper as G, BannerImageWrapper as M, BannerImage as z, HeaderText as U, SubHeaderText as V } from "./styles.js";
|
13
|
+
const ie = ({
|
14
14
|
header: a,
|
15
15
|
isInQueue: h,
|
16
16
|
nodeData: g,
|
17
17
|
studentContainerRef: $,
|
18
|
-
subHeader: f
|
18
|
+
subHeader: f,
|
19
|
+
userType: T
|
19
20
|
}) => {
|
20
21
|
const {
|
21
22
|
node_type: o,
|
22
23
|
state: I,
|
23
|
-
accuracy:
|
24
|
+
accuracy: w,
|
24
25
|
due_date_ts: n,
|
25
26
|
image_url: d,
|
26
27
|
image_hue: s,
|
27
|
-
card_header:
|
28
|
+
card_header: b = "",
|
28
29
|
unlocked_on_ts: c,
|
29
|
-
course_type:
|
30
|
-
} = g, [
|
30
|
+
course_type: _
|
31
|
+
} = g, [x, y] = m(!1), t = k(null), [C, l] = m(!1), A = v(o), { icon: E, lottie: H } = O(o), N = p(() => {
|
31
32
|
l(!0);
|
32
|
-
}, []),
|
33
|
+
}, []), X = p(() => {
|
33
34
|
l(!1);
|
34
35
|
}, []);
|
35
36
|
return L(() => {
|
36
|
-
t.current && t.current.scrollHeight > t.current.clientHeight &&
|
37
|
+
t.current && t.current.scrollHeight > t.current.clientHeight && y(!0);
|
37
38
|
}, [t]), /* @__PURE__ */ i(
|
38
39
|
r,
|
39
40
|
{
|
@@ -41,17 +42,17 @@ const oe = ({
|
|
41
42
|
$widthX: 12.38,
|
42
43
|
$position: "relative",
|
43
44
|
$background: `${s || "ORANGE"}_2`,
|
44
|
-
onMouseEnter:
|
45
|
-
onMouseLeave:
|
45
|
+
onMouseEnter: N,
|
46
|
+
onMouseLeave: X,
|
46
47
|
children: [
|
47
48
|
/* @__PURE__ */ i(
|
48
|
-
|
49
|
+
j,
|
49
50
|
{
|
50
51
|
$flexDirection: "row",
|
51
52
|
$alignItems: "center",
|
52
53
|
$width: "100%",
|
53
54
|
$heightX: 3.5,
|
54
|
-
$bgImage:
|
55
|
+
$bgImage: A,
|
55
56
|
$gutterX: 0.78125,
|
56
57
|
$flexGap: 8.5,
|
57
58
|
$position: "relative",
|
@@ -66,10 +67,10 @@ const oe = ({
|
|
66
67
|
$position: "relative",
|
67
68
|
$alignItems: "center",
|
68
69
|
$justifyContent: "center",
|
69
|
-
children:
|
70
|
+
children: C ? /* @__PURE__ */ e(W, { src: H }) : /* @__PURE__ */ e(E, { width: 20, height: 20 })
|
70
71
|
}
|
71
72
|
),
|
72
|
-
/* @__PURE__ */ e(
|
73
|
+
/* @__PURE__ */ e(D, { cardHeader: b, nodeType: o, courseType: _ }),
|
73
74
|
h && /* @__PURE__ */ e(
|
74
75
|
u,
|
75
76
|
{
|
@@ -77,16 +78,25 @@ const oe = ({
|
|
77
78
|
tooltipItem: "Not visible to student",
|
78
79
|
position: "bottom",
|
79
80
|
zIndex: 6,
|
80
|
-
children: /* @__PURE__ */ e(
|
81
|
+
children: /* @__PURE__ */ e(B, {})
|
81
82
|
}
|
82
83
|
),
|
83
|
-
!!d && /* @__PURE__ */ e(M, { children: /* @__PURE__ */ e(
|
84
|
+
!!d && /* @__PURE__ */ e(M, { children: /* @__PURE__ */ e(z, { src: d, alt: "Chapter image" }) })
|
84
85
|
]
|
85
86
|
}
|
86
87
|
),
|
87
|
-
/* @__PURE__ */ e(
|
88
|
+
/* @__PURE__ */ e(
|
89
|
+
R,
|
90
|
+
{
|
91
|
+
nodeType: o,
|
92
|
+
state: I,
|
93
|
+
accuracy: w,
|
94
|
+
dueDateTs: n,
|
95
|
+
isStudent: T === "STUDENT"
|
96
|
+
}
|
97
|
+
),
|
88
98
|
n && c && /* @__PURE__ */ e(
|
89
|
-
|
99
|
+
S,
|
90
100
|
{
|
91
101
|
dueDate: n * 1e3,
|
92
102
|
unlockedOn: c * 1e3,
|
@@ -101,10 +111,10 @@ const oe = ({
|
|
101
111
|
position: "bottom",
|
102
112
|
tooltipItem: a,
|
103
113
|
width: 300,
|
104
|
-
hidden: !
|
114
|
+
hidden: !x,
|
105
115
|
parentWidth: "auto",
|
106
116
|
zIndex: 6,
|
107
|
-
children: /* @__PURE__ */ e(r, { $heightX: 2.5, children: /* @__PURE__ */ e(
|
117
|
+
children: /* @__PURE__ */ e(r, { $heightX: 2.5, children: /* @__PURE__ */ e(U, { ref: t, $renderAs: "ab3", children: a }) })
|
108
118
|
}
|
109
119
|
),
|
110
120
|
/* @__PURE__ */ i(
|
@@ -126,6 +136,6 @@ const oe = ({
|
|
126
136
|
);
|
127
137
|
};
|
128
138
|
export {
|
129
|
-
|
139
|
+
ie as default
|
130
140
|
};
|
131
141
|
//# 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 { IHomeworkData } from './hw-card-list/api/get-homeworks';\nimport type { FC } from 'react';\n\nimport { 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 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\ninterface IHomeworkCardViewProps {\n header: string;\n isInQueue?: boolean;\n nodeData: INodeDataProps | IHomeworkData;\n studentContainerRef: React.RefObject<HTMLDivElement>;\n subHeader: string;\n}\n\nconst HomeworkView: FC<IHomeworkCardViewProps> = ({\n header,\n isInQueue,\n nodeData,\n studentContainerRef,\n subHeader,\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 } = nodeData;\n const [showTitleTooltip, setShowTitleTooltip] = useState(false);\n const titleTextRef = useRef<HTMLDivElement>(null);\n const [renderLottie, setRenderLottie] = useState(false);\n const bgImage = getNodeTypeBasedBgImage(nodeType);\n const { icon: NodeCardIcon, lottie: nodeCardLottie } = getNodeCardBasedIcon(nodeType);\n\n const handleOnMouseEnter = useCallback(() => {\n setRenderLottie(true);\n }, []);\n\n const handleOnMouseLeave = useCallback(() => {\n setRenderLottie(false);\n }, []);\n\n useLayoutEffect(() => {\n if (\n titleTextRef.current &&\n titleTextRef.current.scrollHeight > titleTextRef.current.clientHeight\n ) {\n setShowTitleTooltip(true);\n }\n }, [titleTextRef]);\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 {renderLottie ? (\n <LottieAnimation src={nodeCardLottie} />\n ) : (\n <NodeCardIcon width={20} height={20} />\n )}\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
|
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 { TUserTypes } from '../ui/types';\nimport type { IHomeworkData } from './hw-card-list/api/get-homeworks';\nimport type { FC } from 'react';\n\nimport { 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 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\ninterface IHomeworkCardViewProps {\n header: string;\n isInQueue?: boolean;\n nodeData: INodeDataProps | IHomeworkData;\n studentContainerRef: React.RefObject<HTMLDivElement>;\n subHeader: string;\n userType: TUserTypes;\n}\n\nconst HomeworkView: FC<IHomeworkCardViewProps> = ({\n header,\n isInQueue,\n nodeData,\n studentContainerRef,\n subHeader,\n userType,\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 } = nodeData;\n const [showTitleTooltip, setShowTitleTooltip] = useState(false);\n const titleTextRef = useRef<HTMLDivElement>(null);\n const [renderLottie, setRenderLottie] = useState(false);\n const bgImage = getNodeTypeBasedBgImage(nodeType);\n const { icon: NodeCardIcon, lottie: nodeCardLottie } = getNodeCardBasedIcon(nodeType);\n\n const handleOnMouseEnter = useCallback(() => {\n setRenderLottie(true);\n }, []);\n\n const handleOnMouseLeave = useCallback(() => {\n setRenderLottie(false);\n }, []);\n\n useLayoutEffect(() => {\n if (\n titleTextRef.current &&\n titleTextRef.current.scrollHeight > titleTextRef.current.clientHeight\n ) {\n setShowTitleTooltip(true);\n }\n }, [titleTextRef]);\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 {renderLottie ? (\n <LottieAnimation src={nodeCardLottie} />\n ) : (\n <NodeCardIcon width={20} height={20} />\n )}\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 />\n {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 HomeworkView;\n"],"names":["HomeworkView","header","isInQueue","nodeData","studentContainerRef","subHeader","userType","nodeType","state","accuracy","dueDateTs","imageUrl","imageHue","cardHeader","unlockedOnTs","courseType","showTitleTooltip","setShowTitleTooltip","useState","titleTextRef","useRef","renderLottie","setRenderLottie","bgImage","getNodeTypeBasedBgImage","NodeCardIcon","nodeCardLottie","getNodeCardBasedIcon","handleOnMouseEnter","useCallback","handleOnMouseLeave","useLayoutEffect","jsxs","FlexView","Styled.CardWrapper","jsx","Styled.IconWrapper","LottieAnimation","CardTitle","ArrowTooltip","ClosedEyeIcon","Styled.BannerImageWrapper","Styled.BannerImage","NodeCardTags","NodeProgress","Styled.HeaderText","Styled.SubHeaderText"],"mappings":"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"}
|
@@ -1,20 +1,20 @@
|
|
1
|
-
import { jsxs as
|
2
|
-
import { memo as q, useRef as
|
3
|
-
import
|
1
|
+
import { jsxs as O, jsx as r } from "react/jsx-runtime";
|
2
|
+
import { memo as q, useRef as R, useCallback as h } from "react";
|
3
|
+
import V from "../../assets/line-icons/icons/eye2.js";
|
4
4
|
import G from "../../assets/line-icons/icons/more-vertical.js";
|
5
5
|
import J from "../../assets/line-icons/icons/redo.js";
|
6
|
-
import
|
6
|
+
import S from "../ui/arrow-tooltip/arrow-tooltip.js";
|
7
7
|
import L from "../ui/buttons/clickable/clickable.js";
|
8
|
-
import
|
8
|
+
import T from "../ui/hooks/use-context-menu-click-handler.js";
|
9
9
|
import P from "../ui/layout/flex-view.js";
|
10
|
-
import
|
10
|
+
import x from "./card-menu-options.js";
|
11
11
|
import Z from "./homework-card-view.js";
|
12
12
|
import { CardContainer as Q, MenuWrapper as U, CardKebabMenuWrapper as D, BlurContainer as N, BlurFlexView as ee, StyledMinus2Icon as re } from "./styles.js";
|
13
13
|
const te = ({
|
14
|
-
header:
|
14
|
+
header: M,
|
15
15
|
nodeData: e,
|
16
|
-
subHeader:
|
17
|
-
userType:
|
16
|
+
subHeader: W,
|
17
|
+
userType: k,
|
18
18
|
userMilestoneId: t,
|
19
19
|
onNodeUnassign: c,
|
20
20
|
onNodeReattempt: s,
|
@@ -23,7 +23,7 @@ const te = ({
|
|
23
23
|
onNodeAttempt: m,
|
24
24
|
renderAs: H,
|
25
25
|
shouldOpenOnRight: X,
|
26
|
-
isInQueue:
|
26
|
+
isInQueue: $
|
27
27
|
}) => {
|
28
28
|
const o = H === "homework", {
|
29
29
|
node_type: A,
|
@@ -31,13 +31,13 @@ const te = ({
|
|
31
31
|
permissions: j,
|
32
32
|
user_node_id: l,
|
33
33
|
user_milestone_id: d
|
34
|
-
} = e, p =
|
35
|
-
can_start:
|
36
|
-
can_resume:
|
34
|
+
} = e, p = R(null), w = R(null), { menuVisible: E, onMenuClick: F } = T(p), { menuVisible: B, onMenuClick: _ } = T(w), {
|
35
|
+
can_start: v,
|
36
|
+
can_resume: g,
|
37
37
|
can_review: n,
|
38
38
|
can_unassign: z,
|
39
39
|
can_reset: K
|
40
|
-
} = j, b =
|
40
|
+
} = j, b = k === "STUDENT", u = h(() => {
|
41
41
|
if (n) {
|
42
42
|
if (typeof i != "function")
|
43
43
|
throw new Error("onReview must be a function");
|
@@ -47,25 +47,25 @@ const te = ({
|
|
47
47
|
return;
|
48
48
|
}
|
49
49
|
}, [n, i, l, e, t]), Y = h(() => {
|
50
|
-
if (
|
50
|
+
if (v || g) {
|
51
51
|
if (typeof m != "function")
|
52
52
|
throw new Error("onNodeAttempt must be a function");
|
53
53
|
m(e);
|
54
54
|
return;
|
55
55
|
}
|
56
56
|
if (!o) {
|
57
|
-
|
57
|
+
_();
|
58
58
|
return;
|
59
59
|
}
|
60
60
|
u();
|
61
61
|
}, [
|
62
|
-
_,
|
63
62
|
v,
|
63
|
+
g,
|
64
64
|
o,
|
65
65
|
u,
|
66
66
|
m,
|
67
67
|
e,
|
68
|
-
|
68
|
+
_
|
69
69
|
]), C = h(() => {
|
70
70
|
if (n) {
|
71
71
|
if (typeof i != "function")
|
@@ -106,7 +106,7 @@ const te = ({
|
|
106
106
|
t
|
107
107
|
]
|
108
108
|
);
|
109
|
-
return /* @__PURE__ */
|
109
|
+
return /* @__PURE__ */ O(Q, { $position: "relative", $width: "fit-content", children: [
|
110
110
|
/* @__PURE__ */ r(
|
111
111
|
L,
|
112
112
|
{
|
@@ -115,24 +115,25 @@ const te = ({
|
|
115
115
|
children: /* @__PURE__ */ r(
|
116
116
|
Z,
|
117
117
|
{
|
118
|
-
header:
|
119
|
-
isInQueue:
|
118
|
+
header: M,
|
119
|
+
isInQueue: $,
|
120
120
|
nodeData: e,
|
121
121
|
studentContainerRef: w,
|
122
|
-
subHeader:
|
122
|
+
subHeader: W,
|
123
|
+
userType: k
|
123
124
|
}
|
124
125
|
)
|
125
126
|
}
|
126
127
|
),
|
127
128
|
b && !o && /* @__PURE__ */ r(
|
128
|
-
|
129
|
+
x,
|
129
130
|
{
|
130
131
|
$width: 200,
|
131
132
|
options: [
|
132
133
|
{
|
133
134
|
id: "student-card-view",
|
134
135
|
label: "Review",
|
135
|
-
icon:
|
136
|
+
icon: V,
|
136
137
|
disabled: !n,
|
137
138
|
onClick: a
|
138
139
|
},
|
@@ -149,16 +150,16 @@ const te = ({
|
|
149
150
|
shouldOpenOnRight: !1
|
150
151
|
}
|
151
152
|
),
|
152
|
-
!b && /* @__PURE__ */
|
153
|
+
!b && /* @__PURE__ */ O(U, { $position: "absolute", $width: "fit-content", $borderRadiusX: 2, children: [
|
153
154
|
/* @__PURE__ */ r(
|
154
|
-
|
155
|
+
S,
|
155
156
|
{
|
156
157
|
renderAs: "primary",
|
157
158
|
tooltipItem: "Review",
|
158
159
|
position: "bottom",
|
159
160
|
zIndex: 6,
|
160
161
|
parentWidth: "100%",
|
161
|
-
hidden:
|
162
|
+
hidden: E || I !== "WAIT_FOR_REVIEW" && o,
|
162
163
|
children: /* @__PURE__ */ r(
|
163
164
|
D,
|
164
165
|
{
|
@@ -172,13 +173,13 @@ const te = ({
|
|
172
173
|
}
|
173
174
|
),
|
174
175
|
/* @__PURE__ */ r(
|
175
|
-
|
176
|
+
x,
|
176
177
|
{
|
177
178
|
options: [
|
178
179
|
{
|
179
180
|
id: "teacher-card-view",
|
180
181
|
label: n ? "Review" : "View",
|
181
|
-
icon:
|
182
|
+
icon: V,
|
182
183
|
disabled: !1,
|
183
184
|
onClick: a
|
184
185
|
},
|
@@ -191,12 +192,12 @@ const te = ({
|
|
191
192
|
}
|
192
193
|
],
|
193
194
|
triggerRef: p,
|
194
|
-
visible:
|
195
|
+
visible: E,
|
195
196
|
shouldOpenOnRight: X
|
196
197
|
}
|
197
198
|
)
|
198
199
|
] }),
|
199
|
-
|
200
|
+
$ && /* @__PURE__ */ r(N, { $background: "WHITE_5", children: /* @__PURE__ */ r(ee, { $heightX: 1, $widthX: 6, children: /* @__PURE__ */ r(S, { renderAs: "primary", tooltipItem: "Not visible to student", position: "bottom", children: /* @__PURE__ */ r(P, { $heightX: 1, $widthX: 6 }) }) }) })
|
200
201
|
] });
|
201
202
|
}, be = q(te);
|
202
203
|
export {
|