@cuemath/leap 2.8.61-as10 → 2.8.61-as11
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.
@@ -1,5 +1,5 @@
|
|
1
1
|
import { jsxs as n, jsx as e } from "react/jsx-runtime";
|
2
|
-
import { memo as ne, useRef as
|
2
|
+
import { memo as ne, useRef as I, useState as oe, useLayoutEffect as ce, useCallback as y } from "react";
|
3
3
|
import M from "../../assets/line-icons/icons/eye2.js";
|
4
4
|
import ae from "../../assets/line-icons/icons/more-vertical.js";
|
5
5
|
import se from "../../assets/line-icons/icons/redo.js";
|
@@ -10,25 +10,25 @@ import j from "../ui/arrow-tooltip/arrow-tooltip.js";
|
|
10
10
|
import he from "../ui/buttons/clickable/clickable.js";
|
11
11
|
import G from "../ui/hooks/use-context-menu-click-handler.js";
|
12
12
|
import o from "../ui/layout/flex-view.js";
|
13
|
-
import
|
13
|
+
import E from "../ui/text/text.js";
|
14
14
|
import K from "./card-menu-options.js";
|
15
15
|
import me from "./node-progress.js";
|
16
16
|
import { CardContainer as fe, CardWrapper as pe, IconWrapper as $e, BannerImageWrapper as we, BannerImage as be, HeaderText as ge, SubHeaderText as Ce, MenuWrapper as ke, CardKebabMenuWrapper as _e, StyledMinus2Icon as Te } from "./styles.js";
|
17
|
-
const
|
17
|
+
const Ie = ({
|
18
18
|
header: x,
|
19
19
|
nodeData: r,
|
20
20
|
subHeader: L,
|
21
|
-
userType:
|
21
|
+
userType: z,
|
22
22
|
userMilestoneId: t,
|
23
23
|
onNodeUnassign: s,
|
24
24
|
onNodeReattempt: l,
|
25
25
|
onNodeView: m,
|
26
26
|
onNodeReview: i,
|
27
27
|
onNodeAttempt: f,
|
28
|
-
renderAs:
|
28
|
+
renderAs: P,
|
29
29
|
shouldOpenOnRight: F
|
30
30
|
}) => {
|
31
|
-
const c =
|
31
|
+
const c = P === "homework", {
|
32
32
|
node_type: d,
|
33
33
|
state: Y,
|
34
34
|
accuracy: q,
|
@@ -40,18 +40,18 @@ const ye = ({
|
|
40
40
|
user_node_id: u,
|
41
41
|
unlocked_on_ts: R,
|
42
42
|
user_milestone_id: $
|
43
|
-
} = r, Z = de(d), A = ue(d), w =
|
43
|
+
} = r, Z = de(d), A = ue(d), w = I(null), b = I(null), a = I(null), { menuVisible: O, onMenuClick: U } = G(w), { menuVisible: D, onMenuClick: S } = G(b), [N, ee] = oe(!1), {
|
44
44
|
can_start: W,
|
45
45
|
can_resume: X,
|
46
46
|
can_review: g,
|
47
47
|
can_teacher_review: B,
|
48
48
|
can_unassign: re,
|
49
49
|
can_reset: C
|
50
|
-
} = Q, k =
|
50
|
+
} = Q, k = z === "STUDENT";
|
51
51
|
ce(() => {
|
52
52
|
a.current && a.current.scrollHeight > a.current.clientHeight && ee(!0);
|
53
53
|
}, [a]);
|
54
|
-
const _ =
|
54
|
+
const _ = y(() => {
|
55
55
|
if (W || X) {
|
56
56
|
if (typeof f != "function")
|
57
57
|
throw new Error("onNodeAttempt must be a function");
|
@@ -82,7 +82,7 @@ const ye = ({
|
|
82
82
|
i,
|
83
83
|
u,
|
84
84
|
t
|
85
|
-
]), T =
|
85
|
+
]), T = y(() => {
|
86
86
|
if (B) {
|
87
87
|
if (typeof i != "function")
|
88
88
|
throw new Error("onNodeReview must be a function");
|
@@ -102,7 +102,7 @@ const ye = ({
|
|
102
102
|
$,
|
103
103
|
m,
|
104
104
|
u
|
105
|
-
]), h =
|
105
|
+
]), h = y(
|
106
106
|
(V) => {
|
107
107
|
switch (V) {
|
108
108
|
case "teacher-card-view":
|
@@ -188,9 +188,9 @@ const ye = ({
|
|
188
188
|
}
|
189
189
|
),
|
190
190
|
d === "MASTERY" ? /* @__PURE__ */ n(o, { children: [
|
191
|
-
/* @__PURE__ */ e(o, { $background: "BLACK_T_60", $width: "fit-content", $gutterX: 0.25, children: /* @__PURE__ */ e(
|
192
|
-
/* @__PURE__ */ e(
|
193
|
-
] }) : /* @__PURE__ */ e(
|
191
|
+
/* @__PURE__ */ e(o, { $background: "BLACK_T_60", $width: "fit-content", $gutterX: 0.25, children: /* @__PURE__ */ e(E, { $color: "WHITE", $renderAs: "ac4-black", children: "Smart" }) }),
|
192
|
+
/* @__PURE__ */ e(E, { $renderAs: "ac4-black", children: "Practice" })
|
193
|
+
] }) : /* @__PURE__ */ e(E, { $renderAs: "ac4-black", children: J }),
|
194
194
|
!!v && /* @__PURE__ */ e(we, { children: /* @__PURE__ */ e(be, { src: v, alt: "Chapter image" }) })
|
195
195
|
]
|
196
196
|
}
|
@@ -221,6 +221,7 @@ const ye = ({
|
|
221
221
|
tooltipItem: x,
|
222
222
|
hidden: !N,
|
223
223
|
parentWidth: "auto",
|
224
|
+
zIndex: 2,
|
224
225
|
children: /* @__PURE__ */ e(o, { $heightX: 2.5, children: /* @__PURE__ */ e(ge, { ref: a, $renderAs: "ab3", children: x }) })
|
225
226
|
}
|
226
227
|
),
|
@@ -281,7 +282,7 @@ const ye = ({
|
|
281
282
|
)
|
282
283
|
] })
|
283
284
|
] });
|
284
|
-
}, Ke = ne(
|
285
|
+
}, Ke = ne(Ie);
|
285
286
|
export {
|
286
287
|
Ke as default
|
287
288
|
};
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"homework-card.js","sources":["../../../src/features/homework/homework-card.tsx"],"sourcesContent":["import type {\n INodeCardCallbacks,\n INodeDataProps,\n} from '../chapters-v2/comps/node-card/node-card-types';\nimport type { TUserTypes } from '../ui/types';\nimport type { IHomeworkData } from './hw-card-list/api/get-homeworks';\n\nimport { memo, useCallback, useLayoutEffect, useRef, useState } from 'react';\n\nimport Eye2Icon from '../../assets/line-icons/icons/eye2';\nimport MoreVerticalIcon from '../../assets/line-icons/icons/more-vertical';\nimport RedoIcon from '../../assets/line-icons/icons/redo';\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 Clickable from '../ui/buttons/clickable/clickable';\nimport useContextMenuClickHandler from '../ui/hooks/use-context-menu-click-handler';\nimport FlexView from '../ui/layout/flex-view';\nimport Text from '../ui/text/text';\nimport CardMenuOptions from './card-menu-options';\nimport NodeProgress from './node-progress';\nimport * as Styled from './styles';\n\ninterface IHomeworkCardProps extends INodeCardCallbacks {\n header: string;\n nodeData: INodeDataProps | IHomeworkData;\n subHeader: string;\n userType: TUserTypes;\n userMilestoneId?: string;\n renderAs: 'homework' | 'milestone';\n shouldOpenOnRight: boolean;\n}\n\nconst HomeworkCard = ({\n header,\n nodeData,\n subHeader,\n userType,\n userMilestoneId,\n onNodeUnassign,\n onNodeReattempt,\n onNodeView,\n onNodeReview,\n onNodeAttempt,\n renderAs,\n shouldOpenOnRight,\n}: IHomeworkCardProps) => {\n const isHomeWork = renderAs === 'homework';\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 permissions,\n user_node_id: userNodeId,\n unlocked_on_ts: unlockedOnTs,\n user_milestone_id: milestoneId,\n } = nodeData;\n const bgImage = getNodeTypeBasedBgImage(nodeType);\n const NodeCardIcon = getNodeCardBasedIcon(nodeType);\n const teacherContainerRef = useRef<HTMLDivElement>(null);\n const studentContainerRef = useRef<HTMLDivElement>(null);\n const titleTextRef = useRef<HTMLDivElement>(null);\n const { menuVisible: teacherMenuVisible, onMenuClick: onTeacherMenuClick } =\n useContextMenuClickHandler(teacherContainerRef);\n const { menuVisible: studentMenuVisible, onMenuClick: onStudentMenuClick } =\n useContextMenuClickHandler(studentContainerRef);\n const [showTitleTooltip, setShowTitleTooltip] = useState(false);\n\n const {\n can_start: canStart,\n can_resume: canResume,\n can_review: canReview,\n can_teacher_review: canTeacherReview,\n can_unassign: canUnassign,\n can_reset: canReset,\n } = permissions;\n const isStudent = userType === 'STUDENT';\n\n useLayoutEffect(() => {\n if (\n titleTextRef.current &&\n titleTextRef.current.scrollHeight > titleTextRef.current.clientHeight\n ) {\n setShowTitleTooltip(true);\n }\n }, [titleTextRef]);\n\n const onStudentView = useCallback(() => {\n if (canStart || canResume) {\n if (typeof onNodeAttempt !== 'function') {\n throw new Error('onNodeAttempt must be a function');\n }\n\n onNodeAttempt(nodeData);\n\n return;\n }\n\n if (canReset && !isHomeWork) {\n onStudentMenuClick();\n\n return;\n }\n\n if (canReview) {\n if (typeof onNodeReview !== 'function') {\n throw new Error('onReview must be a function');\n }\n\n if (!userNodeId) {\n throw new Error('user node id must be present to review the sheet');\n }\n onNodeReview(nodeData, userMilestoneId);\n\n return;\n }\n }, [\n canStart,\n canResume,\n canReset,\n isHomeWork,\n canReview,\n onNodeAttempt,\n nodeData,\n onStudentMenuClick,\n onNodeReview,\n userNodeId,\n userMilestoneId,\n ]);\n\n const onTeacherView = useCallback(() => {\n if (canTeacherReview) {\n if (typeof onNodeReview !== 'function') {\n throw new Error('onNodeReview must be a function');\n }\n\n if (!userNodeId) {\n throw new Error('user node id must be present to review the sheet');\n }\n\n onNodeReview(nodeData, userMilestoneId || milestoneId);\n\n return;\n }\n\n if (typeof onNodeView !== 'function') {\n throw new Error('onNodeView must be a function');\n }\n\n onNodeView(nodeData, userMilestoneId || milestoneId);\n }, [\n canTeacherReview,\n userMilestoneId,\n nodeData,\n onNodeReview,\n milestoneId,\n onNodeView,\n userNodeId,\n ]);\n\n const handleOnMenuOptionClick = useCallback(\n (optionId: string) => {\n switch (optionId) {\n case 'teacher-card-view':\n onTeacherView();\n\n return;\n case 'student-card-click':\n onStudentView();\n\n return;\n case 'teacher-card-unassign':\n onNodeUnassign?.(nodeData, userMilestoneId);\n\n return;\n case 'student-card-reattempt':\n onNodeReattempt?.(nodeData, userMilestoneId);\n\n return;\n default:\n throw new Error(`No callback function for ${optionId}`);\n }\n },\n [nodeData, onNodeReattempt, onNodeUnassign, onStudentView, onTeacherView, userMilestoneId],\n );\n\n const teacherOptions = [\n {\n id: 'teacher-card-view',\n label: 'View',\n icon: Eye2Icon,\n disabled: false,\n onClick: handleOnMenuOptionClick,\n },\n {\n id: 'teacher-card-unassign',\n label: 'Unassign',\n icon: Styled.StyledMinus2Icon,\n disabled: isHomeWork ? false : !canUnassign,\n onClick: handleOnMenuOptionClick,\n },\n ];\n\n const studentOptions = [\n {\n id: 'student-card-click',\n label: 'Review',\n icon: Eye2Icon,\n disabled: !canReview,\n onClick: handleOnMenuOptionClick,\n },\n {\n id: 'student-card-reattempt',\n label: 'Reattempt',\n icon: RedoIcon,\n disabled: !canReset,\n onClick: handleOnMenuOptionClick,\n },\n ];\n\n return (\n <Styled.CardContainer $position=\"relative\" $width=\"fit-content\">\n <Clickable onClick={isStudent ? onStudentView : onTeacherView} label=\"homework-card\">\n <FlexView\n ref={studentContainerRef}\n $widthX={12.38}\n $position=\"relative\"\n $background={`${imageHue || 'ORANGE'}_2`}\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 {NodeCardIcon && <NodeCardIcon width={20} height={20} />}\n </Styled.IconWrapper>\n {nodeType === 'MASTERY' ? (\n <FlexView>\n <FlexView $background=\"BLACK_T_60\" $width=\"fit-content\" $gutterX={0.25}>\n <Text $color=\"WHITE\" $renderAs=\"ac4-black\">\n Smart\n </Text>\n </FlexView>\n <Text $renderAs=\"ac4-black\">Practice</Text>\n </FlexView>\n ) : (\n <Text $renderAs=\"ac4-black\">{cardHeader}</Text>\n )}\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 />\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 hidden={!showTitleTooltip}\n parentWidth=\"auto\"\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>\n </FlexView>\n </FlexView>\n </Clickable>\n {isStudent && !isHomeWork && (\n <CardMenuOptions\n $width={200}\n options={studentOptions}\n triggerRef={studentContainerRef}\n visible={studentMenuVisible}\n shouldOpenOnRight={false}\n />\n )}\n {!isStudent && (\n <Styled.MenuWrapper $position=\"absolute\" $width=\"fit-content\" $borderRadiusX={2}>\n <ArrowTooltip\n renderAs=\"primary\"\n tooltipItem=\"Review\"\n position=\"bottom\"\n zIndex={5}\n parentWidth=\"100%\"\n hidden={!isHomeWork || teacherMenuVisible}\n >\n <Styled.CardKebabMenuWrapper\n $alignItems=\"center\"\n $justifyContent=\"center\"\n ref={teacherContainerRef}\n onClick={onTeacherMenuClick}\n >\n <MoreVerticalIcon width={16} height={16} />\n </Styled.CardKebabMenuWrapper>\n </ArrowTooltip>\n <CardMenuOptions\n options={teacherOptions}\n triggerRef={teacherContainerRef}\n visible={teacherMenuVisible}\n shouldOpenOnRight={shouldOpenOnRight}\n />\n </Styled.MenuWrapper>\n )}\n </Styled.CardContainer>\n );\n};\n\nexport default memo(HomeworkCard);\n"],"names":["HomeworkCard","header","nodeData","subHeader","userType","userMilestoneId","onNodeUnassign","onNodeReattempt","onNodeView","onNodeReview","onNodeAttempt","renderAs","shouldOpenOnRight","isHomeWork","nodeType","state","accuracy","dueDateTs","imageUrl","imageHue","cardHeader","permissions","userNodeId","unlockedOnTs","milestoneId","bgImage","getNodeTypeBasedBgImage","NodeCardIcon","getNodeCardBasedIcon","teacherContainerRef","useRef","studentContainerRef","titleTextRef","teacherMenuVisible","onTeacherMenuClick","useContextMenuClickHandler","studentMenuVisible","onStudentMenuClick","showTitleTooltip","setShowTitleTooltip","useState","canStart","canResume","canReview","canTeacherReview","canUnassign","canReset","isStudent","useLayoutEffect","onStudentView","useCallback","onTeacherView","handleOnMenuOptionClick","optionId","teacherOptions","Eye2Icon","Styled.StyledMinus2Icon","studentOptions","RedoIcon","Styled.CardContainer","jsx","Clickable","jsxs","FlexView","Styled.CardWrapper","Styled.IconWrapper","Text","Styled.BannerImageWrapper","Styled.BannerImage","NodeCardTags","NodeProgress","ArrowTooltip","Styled.HeaderText","Styled.SubHeaderText","CardMenuOptions","Styled.MenuWrapper","Styled.CardKebabMenuWrapper","MoreVerticalIcon","HomeworkCard$1","memo"],"mappings":";;;;;;;;;;;;;;;;AAkCA,MAAMA,KAAe,CAAC;AAAA,EACpB,QAAAC;AAAA,EACA,UAAAC;AAAA,EACA,WAAAC;AAAA,EACA,UAAAC;AAAA,EACA,iBAAAC;AAAA,EACA,gBAAAC;AAAA,EACA,iBAAAC;AAAA,EACA,YAAAC;AAAA,EACA,cAAAC;AAAA,EACA,eAAAC;AAAA,EACA,UAAAC;AAAA,EACA,mBAAAC;AACF,MAA0B;AACxB,QAAMC,IAAaF,MAAa,YAC1B;AAAA,IACJ,WAAWG;AAAA,IACX,OAAAC;AAAA,IACA,UAAAC;AAAA,IACA,aAAaC;AAAA,IACb,WAAWC;AAAA,IACX,WAAWC;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AAM,QAAO,cAC1C,UACHtE,GAAA;AAAA,cAAA;AAAA,YACF;AAAA,UAAA,GACF;AAAA,QAAA;AAAA,MAAA;AAAA,IAAA,GAEJ;AAAA,IACC4C,KAAa,CAAClC,KACb,gBAAA+C;AAAA,MAACc;AAAA,MAAA;AAAA,QACC,QAAQ;AAAA,QACR,SAASjB;AAAA,QACT,YAAY1B;AAAA,QACZ,SAASK;AAAA,QACT,mBAAmB;AAAA,MAAA;AAAA,IACrB;AAAA,IAED,CAACW,KACA,gBAAAe,EAACa,IAAA,EAAmB,WAAU,YAAW,QAAO,eAAc,gBAAgB,GAC5E,UAAA;AAAA,MAAA,gBAAAf;AAAA,QAACW;AAAA,QAAA;AAAA,UACC,UAAS;AAAA,UACT,aAAY;AAAA,UACZ,UAAS;AAAA,UACT,QAAQ;AAAA,UACR,aAAY;AAAA,UACZ,QAAQ,CAAC1D,KAAcoB;AAAA,UAEvB,UAAA,gBAAA2B;AAAA,YAACgB;AAAAA,YAAA;AAAA,cACC,aAAY;AAAA,cACZ,iBAAgB;AAAA,cAChB,KAAK/C;AAAA,cACL,SAASK;AAAA,cAET,UAAC,gBAAA0B,EAAAiB,IAAA,EAAiB,OAAO,IAAI,QAAQ,IAAI;AAAA,YAAA;AAAA,UAC3C;AAAA,QAAA;AAAA,MACF;AAAA,MACA,gBAAAjB;AAAA,QAACc;AAAA,QAAA;AAAA,UACC,SAASpB;AAAA,UACT,YAAYzB;AAAA,UACZ,SAASI;AAAA,UACT,mBAAArB;AAAA,QAAA;AAAA,MACF;AAAA,IAAA,GACF;AAAA,EAEJ,EAAA,CAAA;AAEJ,GAEekE,KAAAC,GAAK/E,EAAY;"}
|
1
|
+
{"version":3,"file":"homework-card.js","sources":["../../../src/features/homework/homework-card.tsx"],"sourcesContent":["import type {\n INodeCardCallbacks,\n INodeDataProps,\n} from '../chapters-v2/comps/node-card/node-card-types';\nimport type { TUserTypes } from '../ui/types';\nimport type { IHomeworkData } from './hw-card-list/api/get-homeworks';\n\nimport { memo, useCallback, useLayoutEffect, useRef, useState } from 'react';\n\nimport Eye2Icon from '../../assets/line-icons/icons/eye2';\nimport MoreVerticalIcon from '../../assets/line-icons/icons/more-vertical';\nimport RedoIcon from '../../assets/line-icons/icons/redo';\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 Clickable from '../ui/buttons/clickable/clickable';\nimport useContextMenuClickHandler from '../ui/hooks/use-context-menu-click-handler';\nimport FlexView from '../ui/layout/flex-view';\nimport Text from '../ui/text/text';\nimport CardMenuOptions from './card-menu-options';\nimport NodeProgress from './node-progress';\nimport * as Styled from './styles';\n\ninterface IHomeworkCardProps extends INodeCardCallbacks {\n header: string;\n nodeData: INodeDataProps | IHomeworkData;\n subHeader: string;\n userType: TUserTypes;\n userMilestoneId?: string;\n renderAs: 'homework' | 'milestone';\n shouldOpenOnRight: boolean;\n}\n\nconst HomeworkCard = ({\n header,\n nodeData,\n subHeader,\n userType,\n userMilestoneId,\n onNodeUnassign,\n onNodeReattempt,\n onNodeView,\n onNodeReview,\n onNodeAttempt,\n renderAs,\n shouldOpenOnRight,\n}: IHomeworkCardProps) => {\n const isHomeWork = renderAs === 'homework';\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 permissions,\n user_node_id: userNodeId,\n unlocked_on_ts: unlockedOnTs,\n user_milestone_id: milestoneId,\n } = nodeData;\n const bgImage = getNodeTypeBasedBgImage(nodeType);\n const NodeCardIcon = getNodeCardBasedIcon(nodeType);\n const teacherContainerRef = useRef<HTMLDivElement>(null);\n const studentContainerRef = useRef<HTMLDivElement>(null);\n const titleTextRef = useRef<HTMLDivElement>(null);\n const { menuVisible: teacherMenuVisible, onMenuClick: onTeacherMenuClick } =\n useContextMenuClickHandler(teacherContainerRef);\n const { menuVisible: studentMenuVisible, onMenuClick: onStudentMenuClick } =\n useContextMenuClickHandler(studentContainerRef);\n const [showTitleTooltip, setShowTitleTooltip] = useState(false);\n\n const {\n can_start: canStart,\n can_resume: canResume,\n can_review: canReview,\n can_teacher_review: canTeacherReview,\n can_unassign: canUnassign,\n can_reset: canReset,\n } = permissions;\n const isStudent = userType === 'STUDENT';\n\n useLayoutEffect(() => {\n if (\n titleTextRef.current &&\n titleTextRef.current.scrollHeight > titleTextRef.current.clientHeight\n ) {\n setShowTitleTooltip(true);\n }\n }, [titleTextRef]);\n\n const onStudentView = useCallback(() => {\n if (canStart || canResume) {\n if (typeof onNodeAttempt !== 'function') {\n throw new Error('onNodeAttempt must be a function');\n }\n\n onNodeAttempt(nodeData);\n\n return;\n }\n\n if (canReset && !isHomeWork) {\n onStudentMenuClick();\n\n return;\n }\n\n if (canReview) {\n if (typeof onNodeReview !== 'function') {\n throw new Error('onReview must be a function');\n }\n\n if (!userNodeId) {\n throw new Error('user node id must be present to review the sheet');\n }\n onNodeReview(nodeData, userMilestoneId);\n\n return;\n }\n }, [\n canStart,\n canResume,\n canReset,\n isHomeWork,\n canReview,\n onNodeAttempt,\n nodeData,\n onStudentMenuClick,\n onNodeReview,\n userNodeId,\n userMilestoneId,\n ]);\n\n const onTeacherView = useCallback(() => {\n if (canTeacherReview) {\n if (typeof onNodeReview !== 'function') {\n throw new Error('onNodeReview must be a function');\n }\n\n if (!userNodeId) {\n throw new Error('user node id must be present to review the sheet');\n }\n\n onNodeReview(nodeData, userMilestoneId || milestoneId);\n\n return;\n }\n\n if (typeof onNodeView !== 'function') {\n throw new Error('onNodeView must be a function');\n }\n\n onNodeView(nodeData, userMilestoneId || milestoneId);\n }, [\n canTeacherReview,\n userMilestoneId,\n nodeData,\n onNodeReview,\n milestoneId,\n onNodeView,\n userNodeId,\n ]);\n\n const handleOnMenuOptionClick = useCallback(\n (optionId: string) => {\n switch (optionId) {\n case 'teacher-card-view':\n onTeacherView();\n\n return;\n case 'student-card-click':\n onStudentView();\n\n return;\n case 'teacher-card-unassign':\n onNodeUnassign?.(nodeData, userMilestoneId);\n\n return;\n case 'student-card-reattempt':\n onNodeReattempt?.(nodeData, userMilestoneId);\n\n return;\n default:\n throw new Error(`No callback function for ${optionId}`);\n }\n },\n [nodeData, onNodeReattempt, onNodeUnassign, onStudentView, onTeacherView, userMilestoneId],\n );\n\n const teacherOptions = [\n {\n id: 'teacher-card-view',\n label: 'View',\n icon: Eye2Icon,\n disabled: false,\n onClick: handleOnMenuOptionClick,\n },\n {\n id: 'teacher-card-unassign',\n label: 'Unassign',\n icon: Styled.StyledMinus2Icon,\n disabled: isHomeWork ? false : !canUnassign,\n onClick: handleOnMenuOptionClick,\n },\n ];\n\n const studentOptions = [\n {\n id: 'student-card-click',\n label: 'Review',\n icon: Eye2Icon,\n disabled: !canReview,\n onClick: handleOnMenuOptionClick,\n },\n {\n id: 'student-card-reattempt',\n label: 'Reattempt',\n icon: RedoIcon,\n disabled: !canReset,\n onClick: handleOnMenuOptionClick,\n },\n ];\n\n return (\n <Styled.CardContainer $position=\"relative\" $width=\"fit-content\">\n <Clickable onClick={isStudent ? onStudentView : onTeacherView} label=\"homework-card\">\n <FlexView\n ref={studentContainerRef}\n $widthX={12.38}\n $position=\"relative\"\n $background={`${imageHue || 'ORANGE'}_2`}\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 {NodeCardIcon && <NodeCardIcon width={20} height={20} />}\n </Styled.IconWrapper>\n {nodeType === 'MASTERY' ? (\n <FlexView>\n <FlexView $background=\"BLACK_T_60\" $width=\"fit-content\" $gutterX={0.25}>\n <Text $color=\"WHITE\" $renderAs=\"ac4-black\">\n Smart\n </Text>\n </FlexView>\n <Text $renderAs=\"ac4-black\">Practice</Text>\n </FlexView>\n ) : (\n <Text $renderAs=\"ac4-black\">{cardHeader}</Text>\n )}\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 />\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 hidden={!showTitleTooltip}\n parentWidth=\"auto\"\n zIndex={2}\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>\n </FlexView>\n </FlexView>\n </Clickable>\n {isStudent && !isHomeWork && (\n <CardMenuOptions\n $width={200}\n options={studentOptions}\n triggerRef={studentContainerRef}\n visible={studentMenuVisible}\n shouldOpenOnRight={false}\n />\n )}\n {!isStudent && (\n <Styled.MenuWrapper $position=\"absolute\" $width=\"fit-content\" $borderRadiusX={2}>\n <ArrowTooltip\n renderAs=\"primary\"\n tooltipItem=\"Review\"\n position=\"bottom\"\n zIndex={5}\n parentWidth=\"100%\"\n hidden={!isHomeWork || teacherMenuVisible}\n >\n <Styled.CardKebabMenuWrapper\n $alignItems=\"center\"\n $justifyContent=\"center\"\n ref={teacherContainerRef}\n onClick={onTeacherMenuClick}\n >\n <MoreVerticalIcon width={16} height={16} />\n </Styled.CardKebabMenuWrapper>\n </ArrowTooltip>\n <CardMenuOptions\n options={teacherOptions}\n triggerRef={teacherContainerRef}\n visible={teacherMenuVisible}\n shouldOpenOnRight={shouldOpenOnRight}\n />\n </Styled.MenuWrapper>\n )}\n </Styled.CardContainer>\n );\n};\n\nexport default memo(HomeworkCard);\n"],"names":["HomeworkCard","header","nodeData","subHeader","userType","userMilestoneId","onNodeUnassign","onNodeReattempt","onNodeView","onNodeReview","onNodeAttempt","renderAs","shouldOpenOnRight","isHomeWork","nodeType","state","accuracy","dueDateTs","imageUrl","imageHue","cardHeader","permissions","userNodeId","unlockedOnTs","milestoneId","bgImage","getNodeTypeBasedBgImage","NodeCardIcon","getNodeCardBasedIcon","teacherContainerRef","useRef","studentContainerRef","titleTextRef","teacherMenuVisible","onTeacherMenuClick","useContextMenuClickHandler","studentMenuVisible","onStudentMenuClick","showTitleTooltip","setShowTitleTooltip","useState","canStart","canResume","canReview","canTeacherReview","canUnassign","canReset","isStudent","useLayoutEffect","onStudentView","useCallback","onTeacherView","handleOnMenuOptionClick","optionId","teacherOptions","Eye2Icon","Styled.StyledMinus2Icon","studentOptions","RedoIcon","Styled.CardContainer","jsx","Clickable","jsxs","FlexView","Styled.CardWrapper","Styled.IconWrapper","Text","Styled.BannerImageWrapper","Styled.BannerImage","NodeCardTags","NodeProgress","ArrowTooltip","Styled.HeaderText","Styled.SubHeaderText","CardMenuOptions","Styled.MenuWrapper","Styled.CardKebabMenuWrapper","MoreVerticalIcon","HomeworkCard$1","memo"],"mappings":";;;;;;;;;;;;;;;;AAkCA,MAAMA,KAAe,CAAC;AAAA,EACpB,QAAAC;AAAA,EACA,UAAAC;AAAA,EACA,WAAAC;AAAA,EACA,UAAAC;A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AAA,UACT,mBAAArB;AAAA,QAAA;AAAA,MACF;AAAA,IAAA,GACF;AAAA,EAEJ,EAAA,CAAA;AAEJ,GAEekE,KAAAC,GAAK/E,EAAY;"}
|
@@ -1,12 +1,12 @@
|
|
1
|
-
import t from "styled-components";
|
1
|
+
import t, { css as i } from "styled-components";
|
2
2
|
import e from "../../ui/layout/flex-view.js";
|
3
|
-
const
|
3
|
+
const s = t(e)`
|
4
4
|
overflow-x: hidden;
|
5
5
|
overflow-y: visible;
|
6
6
|
padding: 16px 0px 92px 0px;
|
7
7
|
margin-bottom: -92px;
|
8
8
|
margin-top: -16px;
|
9
|
-
`,
|
9
|
+
`, l = t(e)`
|
10
10
|
right: ${({ right: o }) => o};
|
11
11
|
left: ${({ left: o }) => o};
|
12
12
|
width: 32px;
|
@@ -18,12 +18,25 @@ const r = t(e)`
|
|
18
18
|
path {
|
19
19
|
fill: ${({ theme: o }) => o.colors.WHITE};
|
20
20
|
}
|
21
|
-
`,
|
22
|
-
({ $disablePointerEvents: o }) => `
|
21
|
+
`, a = t(e)(
|
22
|
+
({ $disablePointerEvents: o, theme: n }) => `
|
23
23
|
position: relative;
|
24
|
-
pointer-events:
|
24
|
+
pointer-events: auto;
|
25
|
+
z-index: 1;
|
26
|
+
${o && i`
|
27
|
+
pointer-events: none;
|
28
|
+
:after {
|
29
|
+
content: '';
|
30
|
+
position: absolute;
|
31
|
+
top: 0;
|
32
|
+
left: 0;
|
33
|
+
right: 0;
|
34
|
+
bottom: 0;
|
35
|
+
background: ${n.colors.GREY_3};
|
36
|
+
}
|
37
|
+
`}
|
25
38
|
`
|
26
|
-
),
|
39
|
+
), c = t(e)`
|
27
40
|
cursor: pointer;
|
28
41
|
height: 100%;
|
29
42
|
right: ${({ right: o }) => o};
|
@@ -32,9 +45,9 @@ const r = t(e)`
|
|
32
45
|
z-index: 5;
|
33
46
|
`;
|
34
47
|
export {
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
48
|
+
a as ContentWrapper,
|
49
|
+
c as HoverZone,
|
50
|
+
l as ScrollButton,
|
51
|
+
s as ScrollContainer
|
39
52
|
};
|
40
53
|
//# sourceMappingURL=hw-card-list-styled.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"hw-card-list-styled.js","sources":["../../../../src/features/homework/hw-card-list/hw-card-list-styled.tsx"],"sourcesContent":["import styled from 'styled-components';\n\nimport FlexView from '../../ui/layout/flex-view';\n\nexport const ScrollContainer = styled(FlexView)`\n overflow-x: hidden;\n overflow-y: visible;\n padding: 16px 0px 92px 0px;\n margin-bottom: -92px;\n margin-top: -16px;\n`;\n\nexport const ScrollButton = styled(FlexView)<{ $visible: boolean; right: string; left: string }>`\n right: ${({ right }) => right};\n left: ${({ left }) => left};\n width: 32px;\n cursor: pointer;\n transition: opacity 0.3s ease-in-out;\n opacity: ${({ $visible }) => ($visible ? 1 : 0)};\n pointer-events: ${({ $visible }) => ($visible ? 'auto' : 'none')};\n z-index: 10;\n path {\n fill: ${({ theme }) => theme.colors.WHITE};\n }\n`;\n\nexport const ContentWrapper = styled(FlexView)<{ $disablePointerEvents: boolean }>(\n ({ $disablePointerEvents }) => `\n position: relative;\n pointer-events: ${$disablePointerEvents
|
1
|
+
{"version":3,"file":"hw-card-list-styled.js","sources":["../../../../src/features/homework/hw-card-list/hw-card-list-styled.tsx"],"sourcesContent":["import styled, { css } from 'styled-components';\n\nimport FlexView from '../../ui/layout/flex-view';\n\nexport const ScrollContainer = styled(FlexView)`\n overflow-x: hidden;\n overflow-y: visible;\n padding: 16px 0px 92px 0px;\n margin-bottom: -92px;\n margin-top: -16px;\n`;\n\nexport const ScrollButton = styled(FlexView)<{ $visible: boolean; right: string; left: string }>`\n right: ${({ right }) => right};\n left: ${({ left }) => left};\n width: 32px;\n cursor: pointer;\n transition: opacity 0.3s ease-in-out;\n opacity: ${({ $visible }) => ($visible ? 1 : 0)};\n pointer-events: ${({ $visible }) => ($visible ? 'auto' : 'none')};\n z-index: 10;\n path {\n fill: ${({ theme }) => theme.colors.WHITE};\n }\n`;\n\nexport const ContentWrapper = styled(FlexView)<{ $disablePointerEvents: boolean }>(\n ({ $disablePointerEvents, theme }) => `\n position: relative;\n pointer-events: auto;\n z-index: 1;\n ${\n $disablePointerEvents &&\n css`\n pointer-events: none;\n :after {\n content: '';\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n background: ${theme.colors.GREY_3};\n }\n `\n }\n `,\n);\n\nexport const HoverZone = styled(FlexView)<{ right: string; left: string }>`\n cursor: pointer;\n height: 100%;\n right: ${({ right }) => right};\n left: ${({ left }) => left};\n pointer-events: all;\n z-index: 5;\n`;\n"],"names":["ScrollContainer","styled","FlexView","ScrollButton","right","left","$visible","theme","ContentWrapper","$disablePointerEvents","css","HoverZone"],"mappings":";;AAIa,MAAAA,IAAkBC,EAAOC,CAAQ;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,GAQjCC,IAAeF,EAAOC,CAAQ;AAAA,WAChC,CAAC,EAAE,OAAAE,EAAM,MAAMA,CAAK;AAAA,UACrB,CAAC,EAAE,MAAAC,EAAK,MAAMA,CAAI;AAAA;AAAA;AAAA;AAAA,aAIf,CAAC,EAAE,UAAAC,EAAA,MAAgBA,IAAW,IAAI,CAAE;AAAA,oBAC7B,CAAC,EAAE,UAAAA,EAAA,MAAgBA,IAAW,SAAS,MAAO;AAAA;AAAA;AAAA,YAGtD,CAAC,EAAE,OAAAC,EAAA,MAAYA,EAAM,OAAO,KAAK;AAAA;AAAA,GAIhCC,IAAiBP,EAAOC,CAAQ;AAAA,EAC3C,CAAC,EAAE,uBAAAO,GAAuB,OAAAF,EAAA,MAAY;AAAA;AAAA;AAAA;AAAA,MAKlCE,KACAC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,wBASkBH,EAAM,OAAO,MAAM;AAAA;AAAA,OAGvC;AAAA;AAEJ,GAEaI,IAAYV,EAAOC,CAAQ;AAAA;AAAA;AAAA,WAG7B,CAAC,EAAE,OAAAE,EAAM,MAAMA,CAAK;AAAA,UACrB,CAAC,EAAE,MAAAC,EAAK,MAAMA,CAAI;AAAA;AAAA;AAAA;"}
|