@cuemath/leap 2.8.61-as2 → 2.8.61-as4
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/line-icons/icons/chevron-left.js.map +1 -1
- package/dist/features/chapters/chapters-list/chapter-item/chapter-item-styled.js +20 -19
- package/dist/features/chapters/chapters-list/chapter-item/chapter-item-styled.js.map +1 -1
- package/dist/features/chapters-v2/comps/node-card/teacher-actions/teacher-actions.js +55 -56
- package/dist/features/chapters-v2/comps/node-card/teacher-actions/teacher-actions.js.map +1 -1
- package/dist/features/chapters-v2/constants/node-constants.js +0 -1
- package/dist/features/chapters-v2/constants/node-constants.js.map +1 -1
- package/dist/features/chapters-v2/utils/node-card-utils.js +57 -41
- package/dist/features/chapters-v2/utils/node-card-utils.js.map +1 -1
- package/dist/features/homework/card-menu-options.js +34 -44
- package/dist/features/homework/card-menu-options.js.map +1 -1
- package/dist/features/homework/homework-card.js +148 -148
- package/dist/features/homework/homework-card.js.map +1 -1
- package/dist/features/homework/hw-card-list/api/get-homeworks.js +1 -1
- package/dist/features/homework/hw-card-list/api/get-homeworks.js.map +1 -1
- package/dist/features/homework/hw-card-list/hw-card-list-styled.js +34 -0
- package/dist/features/homework/hw-card-list/hw-card-list-styled.js.map +1 -0
- package/dist/features/homework/hw-card-list/hw-card-list.js +142 -97
- package/dist/features/homework/hw-card-list/hw-card-list.js.map +1 -1
- package/dist/features/homework/styles.js +16 -24
- package/dist/features/homework/styles.js.map +1 -1
- package/dist/features/milestone/milestone-tests/test-list-v2/test-list-view.js +16 -15
- package/dist/features/milestone/milestone-tests/test-list-v2/test-list-view.js.map +1 -1
- package/dist/features/sheet-v2/resource-list/resource-list.js +11 -10
- package/dist/features/sheet-v2/resource-list/resource-list.js.map +1 -1
- package/dist/index.d.ts +4 -1
- package/package.json +1 -1
@@ -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 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 <Text $renderAs=\"ac4-black\" $color=\"WHITE\">\n OVERDUE\n </Text>\n </FlexView>\n ),\n top: -10,\n right: -10,\n };\n }\n\n switch (nodeState) {\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.
|
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 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 <Text $renderAs=\"ac4-black\" $color=\"WHITE\">\n OVERDUE\n </Text>\n </FlexView>\n ),\n top: -10,\n right: -10,\n };\n }\n\n switch (nodeState) {\n case 'NOT_STARTED':\n return {\n icon: (\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 ),\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: <Tag Icon={ExclamationIcon} />,\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 Bulb2Icon;\n case 'RECAP':\n return RecapIcon;\n case 'DYNAMIC':\n case 'ASSESSMENT':\n case 'CHAPTER_ASSESSMENT':\n return AlarmIcon;\n case 'PRACTICE':\n case 'EXTRA_PRACTICE':\n case 'TARGET_PRACTICE':\n case 'MASTERY':\n return DartIcon;\n case 'PUZZLE_EASY':\n case 'PUZZLE_MEDIUM':\n case 'PUZZLE_HARD':\n return PuzzleIcon;\n case 'VIDEO':\n return Play2Icon;\n\n default:\n return TestTubeIcon;\n }\n};\n\nexport { getNodeStateBasedTagInfo, getNodeCardBasedIcon };\n"],"names":["SECONDS_PER_DAY","OVERDUE_TAG_STATES","calculateDueDateInfo","dueDateTs","currentTimestamp","differenceInSeconds","differenceInDays","isOverdue","daysText","getNodeStateBasedTagInfo","nodeState","accuracy","jsx","FlexView","Text","InProgressIconWrapper","Lock2Icon","jsxs","StatusIcon","Tag","Check2Icon","ExclamationIcon","getNodeCardBasedIcon","nodeType","Bulb2Icon","RecapIcon","AlarmIcon","DartIcon","PuzzleIcon","Play2Icon","TestTubeIcon"],"mappings":"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"}
|
@@ -1,48 +1,38 @@
|
|
1
|
-
import { jsx as o, jsxs as
|
2
|
-
import { memo as
|
3
|
-
import
|
4
|
-
import
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
$
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
children: [
|
35
|
-
/* @__PURE__ */ o(r, { width: 20, height: 20 }),
|
36
|
-
/* @__PURE__ */ o(O, { $renderAs: "ub3", $color: "WHITE", children: l })
|
37
|
-
]
|
38
|
-
},
|
39
|
-
t
|
40
|
-
) }, t))
|
41
|
-
}
|
42
|
-
) }) : null;
|
43
|
-
}
|
1
|
+
import { jsx as o, jsxs as c } from "react/jsx-runtime";
|
2
|
+
import { memo as m } from "react";
|
3
|
+
import u from "../ui/buttons/clickable/clickable.js";
|
4
|
+
import { CardMenuOptionsWrapper as h, CardOptionWrapper as s, OptionText as d } from "./styles.js";
|
5
|
+
const b = m(
|
6
|
+
({ options: t, shouldOpenOnRight: i, visible: n, $width: l }) => n ? /* @__PURE__ */ o(
|
7
|
+
h,
|
8
|
+
{
|
9
|
+
$visible: n,
|
10
|
+
$background: "BLACK_2",
|
11
|
+
$borderColor: "WHITE_T_38",
|
12
|
+
$gapX: 0.5,
|
13
|
+
$width: l,
|
14
|
+
$shouldopenonright: i,
|
15
|
+
children: t.map(({ icon: p, label: a, id: r, onClick: $, disabled: e }) => /* @__PURE__ */ o(u, { onClick: () => e ? null : $(r), label: r, children: /* @__PURE__ */ c(
|
16
|
+
s,
|
17
|
+
{
|
18
|
+
$flexDirection: "row",
|
19
|
+
$alignItems: "center",
|
20
|
+
$flexGap: 8,
|
21
|
+
$gapX: 0.5,
|
22
|
+
$gutterX: 1,
|
23
|
+
$opacity: e ? 0.5 : 1,
|
24
|
+
$disabled: e,
|
25
|
+
children: [
|
26
|
+
/* @__PURE__ */ o(p, { width: 20, height: 20 }),
|
27
|
+
/* @__PURE__ */ o(d, { $renderAs: "ub3", $color: "WHITE", children: a })
|
28
|
+
]
|
29
|
+
},
|
30
|
+
r
|
31
|
+
) }, r))
|
32
|
+
}
|
33
|
+
) : null
|
44
34
|
);
|
45
35
|
export {
|
46
|
-
|
36
|
+
b as default
|
47
37
|
};
|
48
38
|
//# sourceMappingURL=card-menu-options.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"card-menu-options.js","sources":["../../../src/features/homework/card-menu-options.tsx"],"sourcesContent":["import type { FC, SVGProps } from 'react';\n\nimport { memo
|
1
|
+
{"version":3,"file":"card-menu-options.js","sources":["../../../src/features/homework/card-menu-options.tsx"],"sourcesContent":["import type { FC, SVGProps } from 'react';\n\nimport { memo } from 'react';\n\nimport Clickable from '../ui/buttons/clickable/clickable';\nimport * as Styled from './styles';\n\ninterface ICardMenuOption {\n id: string;\n label: string;\n icon: FC<SVGProps<SVGSVGElement>>;\n onClick: (id: string) => void;\n disabled: boolean;\n}\n\ninterface ICardMenuOptionsProps {\n $width?: string | number;\n options: ICardMenuOption[];\n triggerRef: React.RefObject<HTMLElement>;\n visible: boolean;\n shouldOpenOnRight: boolean;\n}\n\nconst CardMenuOptions: FC<ICardMenuOptionsProps> = memo(\n ({ options, shouldOpenOnRight, visible, $width }) => {\n if (!visible) return null;\n\n return (\n <Styled.CardMenuOptionsWrapper\n $visible={visible}\n $background=\"BLACK_2\"\n $borderColor=\"WHITE_T_38\"\n $gapX={0.5}\n $width={$width}\n $shouldopenonright={shouldOpenOnRight}\n >\n {options.map(({ icon: OptionIcon, label, id, onClick, disabled }) => (\n <Clickable onClick={() => (!disabled ? onClick(id) : null)} label={id} key={id}>\n <Styled.CardOptionWrapper\n $flexDirection=\"row\"\n $alignItems=\"center\"\n $flexGap={8}\n $gapX={0.5}\n $gutterX={1}\n $opacity={disabled ? 0.5 : 1}\n $disabled={disabled}\n key={id}\n >\n <OptionIcon width={20} height={20} />\n <Styled.OptionText $renderAs=\"ub3\" $color=\"WHITE\">\n {label}\n </Styled.OptionText>\n </Styled.CardOptionWrapper>\n </Clickable>\n ))}\n </Styled.CardMenuOptionsWrapper>\n );\n },\n);\n\nexport default CardMenuOptions;\n"],"names":["CardMenuOptions","memo","options","shouldOpenOnRight","visible","$width","jsx","Styled.CardMenuOptionsWrapper","OptionIcon","label","id","onClick","disabled","Clickable","jsxs","Styled.CardOptionWrapper","Styled.OptionText"],"mappings":";;;;AAuBA,MAAMA,IAA6CC;AAAA,EACjD,CAAC,EAAE,SAAAC,GAAS,mBAAAC,GAAmB,SAAAC,GAAS,QAAAC,QACjCD,IAGH,gBAAAE;AAAA,IAACC;AAAAA,IAAA;AAAA,MACC,UAAUH;AAAA,MACV,aAAY;AAAA,MACZ,cAAa;AAAA,MACb,OAAO;AAAA,MACP,QAAAC;AAAA,MACA,oBAAoBF;AAAA,MAEnB,UAAAD,EAAQ,IAAI,CAAC,EAAE,MAAMM,GAAY,OAAAC,GAAO,IAAAC,GAAI,SAAAC,GAAS,UAAAC,0BACnDC,GAAU,EAAA,SAAS,MAAQD,IAAyB,OAAdD,EAAQD,CAAE,GAAW,OAAOA,GACjE,UAAA,gBAAAI;AAAA,QAACC;AAAAA,QAAA;AAAA,UACC,gBAAe;AAAA,UACf,aAAY;AAAA,UACZ,UAAU;AAAA,UACV,OAAO;AAAA,UACP,UAAU;AAAA,UACV,UAAUH,IAAW,MAAM;AAAA,UAC3B,WAAWA;AAAA,UAGX,UAAA;AAAA,YAAA,gBAAAN,EAACE,GAAW,EAAA,OAAO,IAAI,QAAQ,IAAI;AAAA,YACnC,gBAAAF,EAACU,GAAA,EAAkB,WAAU,OAAM,QAAO,SACvC,UACHP,GAAA;AAAA,UAAA;AAAA,QAAA;AAAA,QALKC;AAAA,MAAA,EAMP,GAf0EA,CAgB5E,CACD;AAAA,IAAA;AAAA,EAAA,IA7BgB;AAiCzB;"}
|
@@ -1,66 +1,67 @@
|
|
1
|
-
import { jsxs as
|
2
|
-
import { memo as te, useRef as
|
3
|
-
import
|
1
|
+
import { jsxs as o, jsx as e } from "react/jsx-runtime";
|
2
|
+
import { memo as te, useRef as _, useState as ie, useLayoutEffect as ne, useCallback as y } from "react";
|
3
|
+
import V from "../../assets/line-icons/icons/eye2.js";
|
4
4
|
import oe from "../../assets/line-icons/icons/more-vertical.js";
|
5
5
|
import ce from "../../assets/line-icons/icons/redo.js";
|
6
6
|
import ae from "../chapters-v2/comps/node-card/node-card-tags.js";
|
7
7
|
import { getNodeTypeBasedBgImage as se } from "../chapters-v2/utils/index.js";
|
8
8
|
import { getNodeCardBasedIcon as le } from "../chapters-v2/utils/node-card-utils.js";
|
9
|
-
import
|
9
|
+
import B from "../ui/arrow-tooltip/arrow-tooltip.js";
|
10
10
|
import ue from "../ui/buttons/clickable/clickable.js";
|
11
|
-
import
|
11
|
+
import M from "../ui/hooks/use-context-menu-click-handler.js";
|
12
12
|
import d from "../ui/layout/flex-view.js";
|
13
13
|
import de from "../ui/text/text.js";
|
14
|
-
import
|
14
|
+
import j from "./card-menu-options.js";
|
15
15
|
import he from "./node-progress.js";
|
16
|
-
import { CardContainer as me, CardWrapper as fe, IconWrapper as pe, BannerImageWrapper as we, BannerImage as
|
16
|
+
import { CardContainer as me, CardWrapper as fe, IconWrapper as pe, BannerImageWrapper as we, BannerImage as ge, HeaderText as $e, SubHeaderText as be, MenuWrapper as Ce, CardKebabMenuWrapper as ke, StyledMinus2Icon as Te } from "./styles.js";
|
17
17
|
const _e = ({
|
18
|
-
header:
|
18
|
+
header: x,
|
19
19
|
nodeData: r,
|
20
|
-
subHeader:
|
21
|
-
userType:
|
20
|
+
subHeader: G,
|
21
|
+
userType: K,
|
22
22
|
userMilestoneId: t,
|
23
23
|
onNodeUnassign: c,
|
24
24
|
onNodeReattempt: a,
|
25
25
|
onNodeView: h,
|
26
26
|
onNodeReview: i,
|
27
27
|
onNodeAttempt: m,
|
28
|
-
renderAs:
|
28
|
+
renderAs: L,
|
29
|
+
shouldOpenOnRight: z
|
29
30
|
}) => {
|
30
|
-
const s =
|
31
|
+
const s = L === "homework", {
|
31
32
|
node_type: f,
|
32
33
|
state: F,
|
33
|
-
accuracy:
|
34
|
+
accuracy: P,
|
34
35
|
due_date_ts: p,
|
35
|
-
image_url:
|
36
|
-
image_hue:
|
37
|
-
card_header:
|
38
|
-
permissions:
|
36
|
+
image_url: E,
|
37
|
+
image_hue: I,
|
38
|
+
card_header: q = "",
|
39
|
+
permissions: J,
|
39
40
|
user_node_id: l,
|
40
|
-
unlocked_on_ts:
|
41
|
-
} = r,
|
42
|
-
can_start:
|
43
|
-
can_resume:
|
44
|
-
can_review:
|
45
|
-
can_teacher_review:
|
41
|
+
unlocked_on_ts: v
|
42
|
+
} = r, Q = se(f), H = le(f), w = _(null), g = _(null), n = _(null), { menuVisible: O, onMenuClick: Y } = M(w), { menuVisible: Z, onMenuClick: R } = M(g), [U, D] = ie(!1), {
|
43
|
+
can_start: W,
|
44
|
+
can_resume: S,
|
45
|
+
can_review: $,
|
46
|
+
can_teacher_review: X,
|
46
47
|
can_unassign: N,
|
47
|
-
can_reset:
|
48
|
-
} =
|
48
|
+
can_reset: b
|
49
|
+
} = J, C = K === "STUDENT";
|
49
50
|
ne(() => {
|
50
|
-
|
51
|
-
}, [
|
52
|
-
const
|
53
|
-
if (
|
51
|
+
n.current && n.current.scrollHeight > n.current.clientHeight && D(!0);
|
52
|
+
}, [n]);
|
53
|
+
const k = y(() => {
|
54
|
+
if (W || S) {
|
54
55
|
if (typeof m != "function")
|
55
56
|
throw new Error("onNodeAttempt must be a function");
|
56
57
|
m(r);
|
57
58
|
return;
|
58
59
|
}
|
59
|
-
if (
|
60
|
-
|
60
|
+
if (b && !s) {
|
61
|
+
R();
|
61
62
|
return;
|
62
63
|
}
|
63
|
-
if (
|
64
|
+
if ($) {
|
64
65
|
if (typeof i != "function")
|
65
66
|
throw new Error("onReview must be a function");
|
66
67
|
if (!l)
|
@@ -69,37 +70,37 @@ const _e = ({
|
|
69
70
|
return;
|
70
71
|
}
|
71
72
|
}, [
|
72
|
-
|
73
|
-
|
74
|
-
|
73
|
+
W,
|
74
|
+
S,
|
75
|
+
b,
|
75
76
|
s,
|
76
|
-
|
77
|
+
$,
|
77
78
|
m,
|
78
79
|
r,
|
79
|
-
|
80
|
+
R,
|
80
81
|
i,
|
81
82
|
l,
|
82
83
|
t
|
83
|
-
]),
|
84
|
-
if (
|
84
|
+
]), T = y(() => {
|
85
|
+
if (X) {
|
85
86
|
if (typeof i != "function")
|
86
|
-
throw new Error("
|
87
|
+
throw new Error("onNodeReview must be a function");
|
87
88
|
if (!l)
|
88
89
|
throw new Error("user node id must be present to review the sheet");
|
89
90
|
i(r, t);
|
90
91
|
return;
|
91
92
|
}
|
92
93
|
if (typeof h != "function")
|
93
|
-
throw new Error("
|
94
|
+
throw new Error("onNodeView must be a function");
|
94
95
|
h(r, t);
|
95
|
-
}, [
|
96
|
-
(
|
97
|
-
switch (
|
96
|
+
}, [X, t, r, i, h, l]), u = y(
|
97
|
+
(A) => {
|
98
|
+
switch (A) {
|
98
99
|
case "teacher-card-view":
|
99
|
-
|
100
|
+
T();
|
100
101
|
return;
|
101
102
|
case "student-card-click":
|
102
|
-
|
103
|
+
k();
|
103
104
|
return;
|
104
105
|
case "teacher-card-unassign":
|
105
106
|
c == null || c(r, t);
|
@@ -108,15 +109,15 @@ const _e = ({
|
|
108
109
|
a == null || a(r, t);
|
109
110
|
return;
|
110
111
|
default:
|
111
|
-
throw new Error(`No callback function for ${
|
112
|
+
throw new Error(`No callback function for ${A}`);
|
112
113
|
}
|
113
114
|
},
|
114
|
-
[r, a, c,
|
115
|
+
[r, a, c, k, T, t]
|
115
116
|
), ee = [
|
116
117
|
{
|
117
118
|
id: "teacher-card-view",
|
118
119
|
label: "View",
|
119
|
-
icon:
|
120
|
+
icon: V,
|
120
121
|
disabled: !1,
|
121
122
|
onClick: u
|
122
123
|
},
|
@@ -131,142 +132,141 @@ const _e = ({
|
|
131
132
|
{
|
132
133
|
id: "student-card-click",
|
133
134
|
label: "Review",
|
134
|
-
icon:
|
135
|
-
disabled:
|
135
|
+
icon: V,
|
136
|
+
disabled: !$,
|
136
137
|
onClick: u
|
137
138
|
},
|
138
139
|
{
|
139
140
|
id: "student-card-reattempt",
|
140
141
|
label: "Reattempt",
|
141
142
|
icon: ce,
|
142
|
-
disabled: !
|
143
|
+
disabled: !b,
|
143
144
|
onClick: u
|
144
145
|
}
|
145
146
|
];
|
146
|
-
return /* @__PURE__ */
|
147
|
-
/* @__PURE__ */
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
147
|
+
return /* @__PURE__ */ o(me, { $position: "relative", $width: "fit-content", children: [
|
148
|
+
/* @__PURE__ */ e(ue, { onClick: C ? k : T, label: "homework-card", children: /* @__PURE__ */ o(
|
149
|
+
d,
|
150
|
+
{
|
151
|
+
ref: g,
|
152
|
+
$widthX: 12.38,
|
153
|
+
$position: "relative",
|
154
|
+
$background: `${I || "ORANGE"}_2`,
|
155
|
+
children: [
|
156
|
+
/* @__PURE__ */ o(
|
157
|
+
fe,
|
158
|
+
{
|
159
|
+
$flexDirection: "row",
|
160
|
+
$alignItems: "center",
|
161
|
+
$width: "100%",
|
162
|
+
$heightX: 3.5,
|
163
|
+
$bgImage: Q,
|
164
|
+
$gutterX: 0.78125,
|
165
|
+
$flexGap: 8.5,
|
166
|
+
$position: "relative",
|
167
|
+
children: [
|
168
|
+
/* @__PURE__ */ e(
|
169
|
+
pe,
|
170
|
+
{
|
171
|
+
$width: 31,
|
172
|
+
$height: 31,
|
173
|
+
$borderRadiusX: 2,
|
174
|
+
$background: "WHITE_1",
|
175
|
+
$position: "relative",
|
176
|
+
$alignItems: "center",
|
177
|
+
$justifyContent: "center",
|
178
|
+
children: H && /* @__PURE__ */ e(H, { width: 20, height: 20 })
|
179
|
+
}
|
180
|
+
),
|
181
|
+
/* @__PURE__ */ e(de, { $renderAs: "ac4-black", children: q }),
|
182
|
+
!!E && /* @__PURE__ */ e(we, { children: /* @__PURE__ */ e(ge, { src: E, alt: "Chapter image" }) })
|
183
|
+
]
|
184
|
+
}
|
185
|
+
),
|
186
|
+
/* @__PURE__ */ e(
|
187
|
+
ae,
|
188
|
+
{
|
189
|
+
nodeType: f,
|
190
|
+
state: F,
|
191
|
+
accuracy: P,
|
192
|
+
dueDateTs: p
|
193
|
+
}
|
194
|
+
),
|
195
|
+
p && v && /* @__PURE__ */ e(
|
196
|
+
he,
|
197
|
+
{
|
198
|
+
dueDate: p * 1e3,
|
199
|
+
unlockedOn: v * 1e3,
|
200
|
+
progressBg: `${I || "ORANGE"}_4`
|
201
|
+
}
|
202
|
+
),
|
203
|
+
/* @__PURE__ */ o(d, { $gutterX: 0.75, $gapX: 1, $flexRowGapX: 0.5, $background: "WHITE", children: [
|
186
204
|
/* @__PURE__ */ e(
|
187
|
-
|
205
|
+
B,
|
188
206
|
{
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
207
|
+
renderAs: "primary",
|
208
|
+
position: "bottom",
|
209
|
+
tooltipItem: x,
|
210
|
+
hidden: !U,
|
211
|
+
parentWidth: "auto",
|
212
|
+
children: /* @__PURE__ */ e(d, { $heightX: 2.5, children: /* @__PURE__ */ e($e, { ref: n, $renderAs: "ab3", children: x }) })
|
193
213
|
}
|
194
214
|
),
|
195
|
-
|
196
|
-
|
215
|
+
/* @__PURE__ */ e(
|
216
|
+
d,
|
197
217
|
{
|
198
|
-
|
199
|
-
|
200
|
-
|
218
|
+
$flexDirection: "row",
|
219
|
+
$heightX: 1.25,
|
220
|
+
$alignItems: "center",
|
221
|
+
$justifyContent: "space-between",
|
222
|
+
children: /* @__PURE__ */ e(be, { $renderAs: "ub3", $color: "BLACK_T_60", children: G })
|
201
223
|
}
|
202
|
-
)
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
$flexDirection: "row",
|
219
|
-
$heightX: 1.25,
|
220
|
-
$alignItems: "center",
|
221
|
-
$justifyContent: "space-between",
|
222
|
-
children: /* @__PURE__ */ e(ge, { $renderAs: "ub3", $color: "BLACK_T_60", children: L })
|
223
|
-
}
|
224
|
-
)
|
225
|
-
] })
|
226
|
-
]
|
227
|
-
}
|
228
|
-
),
|
229
|
-
T && !s && /* @__PURE__ */ e(K, { $visible: R, children: /* @__PURE__ */ e(
|
230
|
-
G,
|
231
|
-
{
|
232
|
-
$width: 200,
|
233
|
-
options: re,
|
234
|
-
triggerRef: $,
|
235
|
-
visible: R
|
236
|
-
}
|
237
|
-
) })
|
238
|
-
] }),
|
239
|
-
!T && /* @__PURE__ */ n(Ce, { $position: "absolute", $width: "fit-content", children: [
|
224
|
+
)
|
225
|
+
] })
|
226
|
+
]
|
227
|
+
}
|
228
|
+
) }),
|
229
|
+
C && !s && /* @__PURE__ */ e(
|
230
|
+
j,
|
231
|
+
{
|
232
|
+
$width: 200,
|
233
|
+
options: re,
|
234
|
+
triggerRef: g,
|
235
|
+
visible: Z,
|
236
|
+
shouldOpenOnRight: !1
|
237
|
+
}
|
238
|
+
),
|
239
|
+
!C && /* @__PURE__ */ o(Ce, { $position: "absolute", $width: "fit-content", children: [
|
240
240
|
/* @__PURE__ */ e(
|
241
|
-
|
241
|
+
B,
|
242
242
|
{
|
243
243
|
renderAs: "primary",
|
244
244
|
tooltipItem: "Review",
|
245
245
|
position: "bottom",
|
246
246
|
zIndex: 5,
|
247
247
|
parentWidth: "100%",
|
248
|
-
hidden: !s ||
|
248
|
+
hidden: !s || O,
|
249
249
|
children: /* @__PURE__ */ e(
|
250
250
|
ke,
|
251
251
|
{
|
252
252
|
$alignItems: "center",
|
253
253
|
$justifyContent: "center",
|
254
254
|
ref: w,
|
255
|
-
onClick:
|
255
|
+
onClick: Y,
|
256
256
|
children: /* @__PURE__ */ e(oe, { width: 16, height: 16 })
|
257
257
|
}
|
258
258
|
)
|
259
259
|
}
|
260
260
|
),
|
261
|
-
/* @__PURE__ */ e(
|
262
|
-
|
261
|
+
/* @__PURE__ */ e(
|
262
|
+
j,
|
263
263
|
{
|
264
|
-
$width: "fit-content",
|
265
264
|
options: ee,
|
266
265
|
triggerRef: w,
|
267
|
-
visible:
|
266
|
+
visible: O,
|
267
|
+
shouldOpenOnRight: z
|
268
268
|
}
|
269
|
-
)
|
269
|
+
)
|
270
270
|
] })
|
271
271
|
] });
|
272
272
|
}, Ge = te(_e);
|