@cuemath/leap 2.8.61-as13 → 2.8.61-as16

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.
Files changed (29) hide show
  1. package/dist/assets/line-icons/icons/closed-eye.js +23 -0
  2. package/dist/assets/line-icons/icons/closed-eye.js.map +1 -0
  3. package/dist/features/chapters-v2/comps/node-card/student-actions/student-actions.js +39 -39
  4. package/dist/features/chapters-v2/comps/node-card/student-actions/student-actions.js.map +1 -1
  5. package/dist/features/chapters-v2/comps/node-card/teacher-actions/teacher-actions.js +83 -81
  6. package/dist/features/chapters-v2/comps/node-card/teacher-actions/teacher-actions.js.map +1 -1
  7. package/dist/features/chapters-v2/constants/node-constants.js.map +1 -1
  8. package/dist/features/homework/card-title.js +21 -0
  9. package/dist/features/homework/card-title.js.map +1 -0
  10. package/dist/features/homework/homework-card-view.js +133 -0
  11. package/dist/features/homework/homework-card-view.js.map +1 -0
  12. package/dist/features/homework/homework-card.js +153 -243
  13. package/dist/features/homework/homework-card.js.map +1 -1
  14. package/dist/features/homework/hw-card-list/hw-card-list-styled.js +38 -20
  15. package/dist/features/homework/hw-card-list/hw-card-list-styled.js.map +1 -1
  16. package/dist/features/homework/hw-card-list/hw-card-list.js +105 -89
  17. package/dist/features/homework/hw-card-list/hw-card-list.js.map +1 -1
  18. package/dist/features/homework/styles.js +31 -18
  19. package/dist/features/homework/styles.js.map +1 -1
  20. package/dist/features/milestone/milestone-list-container/milestone-list/milestone-widget/milestone-info.js +51 -52
  21. package/dist/features/milestone/milestone-list-container/milestone-list/milestone-widget/milestone-info.js.map +1 -1
  22. package/dist/features/milestone/milestone-list-container/milestone-list/milestone-widget/milestone-tabs/milestone-tabs.js +36 -35
  23. package/dist/features/milestone/milestone-list-container/milestone-list/milestone-widget/milestone-tabs/milestone-tabs.js.map +1 -1
  24. package/dist/features/milestone/milestone-tests/test-list-v2/test-list-view.js +33 -32
  25. package/dist/features/milestone/milestone-tests/test-list-v2/test-list-view.js.map +1 -1
  26. package/dist/features/sheet-v2/resource-list/resource-list.js +25 -37
  27. package/dist/features/sheet-v2/resource-list/resource-list.js.map +1 -1
  28. package/dist/index.d.ts +13 -0
  29. package/package.json +1 -1
@@ -0,0 +1,21 @@
1
+ import { jsxs as t, jsx as r } from "react/jsx-runtime";
2
+ import c from "../ui/layout/flex-view.js";
3
+ import e from "../ui/text/text.js";
4
+ const a = ({
5
+ cardHeader: n,
6
+ nodeType: l,
7
+ courseType: i
8
+ }) => l === "MASTERY" ? /* @__PURE__ */ t(c, { children: [
9
+ /* @__PURE__ */ r(c, { $background: "BLACK_T_60", $width: "fit-content", $gutterX: 0.25, children: /* @__PURE__ */ r(e, { $color: "WHITE", $renderAs: "ac4-black", children: "Smart" }) }),
10
+ /* @__PURE__ */ r(e, { $renderAs: "ac4-black", children: "Practice" })
11
+ ] }) : i === "REMEDIAL" ? /* @__PURE__ */ t(c, { children: [
12
+ /* @__PURE__ */ r(c, { $background: "BLACK_T_60", $width: "fit-content", $gutterX: 0.25, children: /* @__PURE__ */ r(e, { $color: "WHITE", $renderAs: "ac4-black", children: "EXTRA" }) }),
13
+ /* @__PURE__ */ r(e, { $renderAs: "ac4-black", children: n })
14
+ ] }) : i === "EXAM" ? /* @__PURE__ */ t(c, { children: [
15
+ /* @__PURE__ */ r(c, { $background: "BLACK_T_60", $width: "fit-content", $gutterX: 0.25, children: /* @__PURE__ */ r(e, { $color: "WHITE", $renderAs: "ac4-black", children: "CUSTOM" }) }),
16
+ /* @__PURE__ */ r(e, { $renderAs: "ac4-black", children: n })
17
+ ] }) : /* @__PURE__ */ r(e, { $renderAs: "ac4-black", children: n });
18
+ export {
19
+ a as default
20
+ };
21
+ //# sourceMappingURL=card-title.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"card-title.js","sources":["../../../src/features/homework/card-title.tsx"],"sourcesContent":["import type { TCourseType, TNodeTypes } from '../chapters-v2/comps/node-card/node-card-types';\n\nimport FlexView from '../ui/layout/flex-view';\nimport Text from '../ui/text/text';\n\nconst CardTitle = ({\n cardHeader,\n nodeType,\n courseType,\n}: {\n cardHeader: string;\n nodeType: TNodeTypes;\n courseType: TCourseType;\n}) => {\n if (nodeType === 'MASTERY') {\n return (\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 }\n\n if (courseType === 'REMEDIAL') {\n return (\n <FlexView>\n <FlexView $background=\"BLACK_T_60\" $width=\"fit-content\" $gutterX={0.25}>\n <Text $color=\"WHITE\" $renderAs=\"ac4-black\">\n EXTRA\n </Text>\n </FlexView>\n <Text $renderAs=\"ac4-black\">{cardHeader}</Text>\n </FlexView>\n );\n }\n\n if (courseType === 'EXAM') {\n return (\n <FlexView>\n <FlexView $background=\"BLACK_T_60\" $width=\"fit-content\" $gutterX={0.25}>\n <Text $color=\"WHITE\" $renderAs=\"ac4-black\">\n CUSTOM\n </Text>\n </FlexView>\n <Text $renderAs=\"ac4-black\">{cardHeader}</Text>\n </FlexView>\n );\n }\n\n return <Text $renderAs=\"ac4-black\">{cardHeader}</Text>;\n};\n\nexport default CardTitle;\n"],"names":["CardTitle","cardHeader","nodeType","courseType","FlexView","jsx","Text"],"mappings":";;;AAKA,MAAMA,IAAY,CAAC;AAAA,EACjB,YAAAC;AAAA,EACA,UAAAC;AAAA,EACA,YAAAC;AACF,MAKMD,MAAa,8BAEZE,GACC,EAAA,UAAA;AAAA,EAAA,gBAAAC,EAACD,GAAS,EAAA,aAAY,cAAa,QAAO,eAAc,UAAU,MAChE,UAAC,gBAAAC,EAAAC,GAAA,EAAK,QAAO,SAAQ,WAAU,aAAY,kBAE3C,CAAA,GACF;AAAA,EACC,gBAAAD,EAAAC,GAAA,EAAK,WAAU,aAAY,UAAQ,YAAA;AACtC,EAAA,CAAA,IAIAH,MAAe,+BAEdC,GACC,EAAA,UAAA;AAAA,EAAA,gBAAAC,EAACD,GAAS,EAAA,aAAY,cAAa,QAAO,eAAc,UAAU,MAChE,UAAC,gBAAAC,EAAAC,GAAA,EAAK,QAAO,SAAQ,WAAU,aAAY,kBAE3C,CAAA,GACF;AAAA,EACC,gBAAAD,EAAAC,GAAA,EAAK,WAAU,aAAa,UAAWL,GAAA;AAC1C,EAAA,CAAA,IAIAE,MAAe,2BAEdC,GACC,EAAA,UAAA;AAAA,EAAA,gBAAAC,EAACD,GAAS,EAAA,aAAY,cAAa,QAAO,eAAc,UAAU,MAChE,UAAC,gBAAAC,EAAAC,GAAA,EAAK,QAAO,SAAQ,WAAU,aAAY,mBAE3C,CAAA,GACF;AAAA,EACC,gBAAAD,EAAAC,GAAA,EAAK,WAAU,aAAa,UAAWL,GAAA;AAC1C,EAAA,CAAA,IAII,gBAAAI,EAAAC,GAAA,EAAK,WAAU,aAAa,UAAWL,EAAA,CAAA;"}
@@ -0,0 +1,133 @@
1
+ import { jsxs as i, jsx as e } from "react/jsx-runtime";
2
+ import { useState as p, useRef as L, useCallback as u, useLayoutEffect as N } 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
+ import h from "../ui/arrow-tooltip/arrow-tooltip.js";
8
+ import r from "../ui/layout/flex-view.js";
9
+ import W from "../ui/lottie-animation/lottie-animation.js";
10
+ import j from "../ui/text/text.js";
11
+ import D from "./card-title.js";
12
+ import G from "./node-progress.js";
13
+ import { CardWrapper as M, IconWrapper as S, BannerImageWrapper as z, BannerImage as V, HeaderText as F, SubHeaderText as K } from "./styles.js";
14
+ const ae = ({
15
+ header: a,
16
+ isInQueue: g,
17
+ nodeData: $,
18
+ studentContainerRef: f,
19
+ subHeader: T,
20
+ isHomeWork: I
21
+ }) => {
22
+ const {
23
+ node_type: o,
24
+ state: w,
25
+ accuracy: b,
26
+ due_date_ts: n,
27
+ image_url: d,
28
+ image_hue: s,
29
+ card_header: c = "",
30
+ unlocked_on_ts: l,
31
+ course_type: x
32
+ } = $, [_, y] = p(!1), t = L(null), [C, m] = p(!1), A = v(o), { icon: k, lottie: H } = O(o), X = u(() => {
33
+ m(!0);
34
+ }, []), E = u(() => {
35
+ m(!1);
36
+ }, []);
37
+ return N(() => {
38
+ t.current && t.current.scrollHeight > t.current.clientHeight && y(!0);
39
+ }, [t]), /* @__PURE__ */ i(
40
+ r,
41
+ {
42
+ ref: f,
43
+ $widthX: 12.38,
44
+ $position: "relative",
45
+ $background: `${s || "ORANGE"}_2`,
46
+ onMouseEnter: X,
47
+ onMouseLeave: E,
48
+ children: [
49
+ /* @__PURE__ */ i(
50
+ M,
51
+ {
52
+ $flexDirection: "row",
53
+ $alignItems: "center",
54
+ $width: "100%",
55
+ $heightX: 3.5,
56
+ $bgImage: A,
57
+ $gutterX: 0.78125,
58
+ $flexGap: 8.5,
59
+ $position: "relative",
60
+ children: [
61
+ /* @__PURE__ */ e(
62
+ S,
63
+ {
64
+ $width: 31,
65
+ $height: 31,
66
+ $borderRadiusX: 2,
67
+ $background: "WHITE_1",
68
+ $position: "relative",
69
+ $alignItems: "center",
70
+ $justifyContent: "center",
71
+ children: C ? /* @__PURE__ */ e(W, { src: H }) : /* @__PURE__ */ e(k, { width: 20, height: 20 })
72
+ }
73
+ ),
74
+ I ? /* @__PURE__ */ e(D, { cardHeader: c, nodeType: o, courseType: x }) : /* @__PURE__ */ e(j, { $renderAs: "ac4-black", children: c }),
75
+ g && /* @__PURE__ */ e(
76
+ h,
77
+ {
78
+ renderAs: "primary",
79
+ tooltipItem: "Not visible to student",
80
+ position: "bottom",
81
+ zIndex: 6,
82
+ children: /* @__PURE__ */ e(B, {})
83
+ }
84
+ ),
85
+ !!d && /* @__PURE__ */ e(z, { children: /* @__PURE__ */ e(V, { src: d, alt: "Chapter image" }) })
86
+ ]
87
+ }
88
+ ),
89
+ /* @__PURE__ */ e(R, { nodeType: o, state: w, accuracy: b, dueDateTs: n }),
90
+ n && l && /* @__PURE__ */ e(
91
+ G,
92
+ {
93
+ dueDate: n * 1e3,
94
+ unlockedOn: l * 1e3,
95
+ progressBg: `${s || "ORANGE"}_4`
96
+ }
97
+ ),
98
+ /* @__PURE__ */ i(r, { $gutterX: 0.75, $gapX: 1, $flexRowGapX: 0.5, $background: "WHITE", children: [
99
+ /* @__PURE__ */ e(
100
+ h,
101
+ {
102
+ renderAs: "primary",
103
+ position: "bottom",
104
+ tooltipItem: a,
105
+ width: 300,
106
+ hidden: !_,
107
+ parentWidth: "auto",
108
+ zIndex: 6,
109
+ children: /* @__PURE__ */ e(r, { $heightX: 2.5, children: /* @__PURE__ */ e(F, { ref: t, $renderAs: "ab3", children: a }) })
110
+ }
111
+ ),
112
+ /* @__PURE__ */ i(
113
+ r,
114
+ {
115
+ $flexDirection: "row",
116
+ $heightX: 1.25,
117
+ $alignItems: "center",
118
+ $justifyContent: "space-between",
119
+ children: [
120
+ /* @__PURE__ */ e(K, { $renderAs: "ub3", $color: "BLACK_T_60", children: T }),
121
+ /* @__PURE__ */ e(r, { $width: 32 })
122
+ ]
123
+ }
124
+ )
125
+ ] })
126
+ ]
127
+ }
128
+ );
129
+ };
130
+ export {
131
+ ae as default
132
+ };
133
+ //# sourceMappingURL=homework-card-view.js.map
@@ -0,0 +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 Text from '../ui/text/text';\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 isHomeWork: boolean;\n}\n\nconst HomeworkView: FC<IHomeworkCardViewProps> = ({\n header,\n isInQueue,\n nodeData,\n studentContainerRef,\n subHeader,\n isHomeWork,\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 {isHomeWork ? (\n <CardTitle cardHeader={cardHeader} nodeType={nodeType} courseType={courseType} />\n ) : (\n <Text $renderAs=\"ac4-black\">{cardHeader}</Text>\n )}\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 nodeType={nodeType} state={state} accuracy={accuracy} dueDateTs={dueDateTs} />\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","isHomeWork","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","Text","ArrowTooltip","ClosedEyeIcon","Styled.BannerImageWrapper","Styled.BannerImage","NodeCardTags","NodeProgress","Styled.HeaderText","Styled.SubHeaderText"],"mappings":";;;;;;;;;;;;;AA2BA,MAAMA,KAA2C,CAAC;AAAA,EAChD,QAAAC;AAAA,EACA,WAAAC;AAAA,EACA,UAAAC;AAAA,EACA,qBAAAC;AAAA,EACA,WAAAC;AAAA,EACA,YAAAC;AACF,MAAM;AACE,QAAA;AAAA,IACJ,WAAWC;AAAA,IACX,OAAAC;AAAA,IACA,UAAAC;AAAA,IACA,aAAaC;AAAA,IACb,WAAWC;AAAA,IACX,WAAWC;AAAA,IACX,aAAaC,IAAa;AAAA,IAC1B,gBAAgBC;AAAA,IAChB,aAAaC;AAAA,EACX,IAAAZ,GACE,CAACa,GAAkBC,CAAmB,IAAIC,EAAS,EAAK,GACxDC,IAAeC,EAAuB,IAAI,GAC1C,CAACC,GAAcC,CAAe,IAAIJ,EAAS,EAAK,GAChDK,IAAUC,EAAwBjB,CAAQ,GAC1C,EAAE,MAAMkB,GAAc,QAAQC,MAAmBC,EAAqBpB,CAAQ,GAE9EqB,IAAqBC,EAAY,MAAM;AAC3C,IAAAP,EAAgB,EAAI;AAAA,EACtB,GAAG,CAAE,CAAA,GAECQ,IAAqB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A;AAAA,UACxB;AAAA,QAAA,GACF;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAGN;"}
@@ -1,296 +1,206 @@
1
- import { jsxs as i, jsx as e } from "react/jsx-runtime";
2
- import { memo as de, useState as B, useRef as I, useLayoutEffect as ue, useCallback as s } from "react";
3
- import V from "../../assets/line-icons/icons/eye2.js";
4
- import he from "../../assets/line-icons/icons/more-vertical.js";
5
- import me from "../../assets/line-icons/icons/redo.js";
6
- import fe from "../chapters-v2/comps/node-card/node-card-tags.js";
7
- import { getNodeTypeBasedBgImage as pe } from "../chapters-v2/utils/index.js";
8
- import { getNodeCardBasedIcon as $e } from "../chapters-v2/utils/node-card-utils.js";
9
- import j from "../ui/arrow-tooltip/arrow-tooltip.js";
10
- import we from "../ui/buttons/clickable/clickable.js";
11
- import G from "../ui/hooks/use-context-menu-click-handler.js";
12
- import o from "../ui/layout/flex-view.js";
13
- import be from "../ui/lottie-animation/lottie-animation.js";
14
- import y from "../ui/text/text.js";
15
- import K from "./card-menu-options.js";
16
- import ge from "./node-progress.js";
17
- import { CardContainer as Ce, CardWrapper as ke, IconWrapper as _e, BannerImageWrapper as Te, BannerImage as Ee, HeaderText as Ie, SubHeaderText as ye, MenuWrapper as ve, CardKebabMenuWrapper as xe, StyledMinus2Icon as Re } from "./styles.js";
18
- const Ae = ({
19
- header: v,
20
- nodeData: r,
21
- subHeader: z,
22
- userType: P,
1
+ import { jsxs as g, jsx as r } from "react/jsx-runtime";
2
+ import { memo as q, useRef as O, useCallback as h } from "react";
3
+ import R from "../../assets/line-icons/icons/eye2.js";
4
+ import G from "../../assets/line-icons/icons/more-vertical.js";
5
+ import J from "../../assets/line-icons/icons/redo.js";
6
+ import V from "../ui/arrow-tooltip/arrow-tooltip.js";
7
+ import L from "../ui/buttons/clickable/clickable.js";
8
+ import S from "../ui/hooks/use-context-menu-click-handler.js";
9
+ import P from "../ui/layout/flex-view.js";
10
+ import T from "./card-menu-options.js";
11
+ import Z from "./homework-card-view.js";
12
+ import { CardContainer as Q, MenuWrapper as U, CardKebabMenuWrapper as D, BlurContainer as N, BlurFlexView as ee, StyledMinus2Icon as re } from "./styles.js";
13
+ const te = ({
14
+ header: x,
15
+ nodeData: e,
16
+ subHeader: M,
17
+ userType: W,
23
18
  userMilestoneId: t,
24
- onNodeUnassign: l,
25
- onNodeReattempt: d,
19
+ onNodeUnassign: c,
20
+ onNodeReattempt: s,
26
21
  onNodeView: f,
27
- onNodeReview: n,
28
- onNodeAttempt: p,
29
- renderAs: F,
30
- shouldOpenOnRight: Y
22
+ onNodeReview: i,
23
+ onNodeAttempt: m,
24
+ renderAs: H,
25
+ shouldOpenOnRight: X,
26
+ isInQueue: k
31
27
  }) => {
32
- const c = F === "homework", {
33
- node_type: u,
34
- state: q,
35
- accuracy: J,
36
- due_date_ts: $,
37
- image_url: x,
38
- image_hue: R,
39
- card_header: Q = "",
40
- permissions: Z,
41
- user_node_id: h,
42
- unlocked_on_ts: A,
43
- user_milestone_id: w
44
- } = r, [U, H] = B(!1), D = pe(u), { icon: N, lottie: ee } = $e(u), b = I(null), g = I(null), a = I(null), { menuVisible: O, onMenuClick: re } = G(b), { menuVisible: te, onMenuClick: M } = G(g), [ne, ie] = B(!1), {
45
- can_start: S,
46
- can_resume: W,
47
- can_review: C,
48
- can_teacher_review: X,
49
- can_unassign: oe,
50
- can_reset: k
51
- } = Z, _ = P === "STUDENT";
52
- ue(() => {
53
- a.current && a.current.scrollHeight > a.current.clientHeight && ie(!0);
54
- }, [a]);
55
- const T = s(() => {
56
- if (S || W) {
57
- if (typeof p != "function")
58
- throw new Error("onNodeAttempt must be a function");
59
- p(r);
28
+ const n = H === "homework", {
29
+ node_type: A,
30
+ state: I,
31
+ permissions: j,
32
+ user_node_id: l,
33
+ user_milestone_id: d
34
+ } = e, p = O(null), w = O(null), { menuVisible: $, onMenuClick: F } = S(p), { menuVisible: B, onMenuClick: E } = S(w), {
35
+ can_start: _,
36
+ can_resume: v,
37
+ can_review: o,
38
+ can_unassign: z,
39
+ can_reset: K
40
+ } = j, b = W === "STUDENT", u = h(() => {
41
+ if (o) {
42
+ if (typeof i != "function")
43
+ throw new Error("onReview must be a function");
44
+ if (!l)
45
+ throw new Error("user node id must be present to review the sheet");
46
+ i(e, t);
60
47
  return;
61
48
  }
62
- if (k && !c) {
63
- M();
49
+ }, [o, i, l, e, t]), Y = h(() => {
50
+ if (_ || v) {
51
+ if (typeof m != "function")
52
+ throw new Error("onNodeAttempt must be a function");
53
+ m(e);
64
54
  return;
65
55
  }
66
- if (C) {
67
- if (typeof n != "function")
68
- throw new Error("onReview must be a function");
69
- if (!h)
70
- throw new Error("user node id must be present to review the sheet");
71
- n(r, t);
56
+ if (!n) {
57
+ E();
72
58
  return;
73
59
  }
60
+ u();
74
61
  }, [
75
- S,
76
- W,
77
- k,
78
- c,
79
- C,
80
- p,
81
- r,
82
- M,
62
+ _,
63
+ v,
83
64
  n,
84
- h,
85
- t
86
- ]), E = s(() => {
87
- if (X) {
88
- if (typeof n != "function")
65
+ u,
66
+ m,
67
+ e,
68
+ E
69
+ ]), C = h(() => {
70
+ if (o) {
71
+ if (typeof i != "function")
89
72
  throw new Error("onNodeReview must be a function");
90
- if (!h)
73
+ if (!l)
91
74
  throw new Error("user node id must be present to review the sheet");
92
- n(r, t || w);
75
+ i(e, t || d);
93
76
  return;
94
77
  }
95
78
  if (typeof f != "function")
96
79
  throw new Error("onNodeView must be a function");
97
- f(r, t || w);
98
- }, [
99
- X,
100
- t,
101
- r,
102
- n,
103
- w,
104
- f,
105
- h
106
- ]), m = s(
107
- (L) => {
108
- switch (L) {
80
+ f(e, t || d);
81
+ }, [o, t, e, i, d, f, l]), a = h(
82
+ (y) => {
83
+ switch (y) {
109
84
  case "teacher-card-view":
110
- E();
85
+ C();
111
86
  return;
112
- case "student-card-click":
113
- T();
87
+ case "student-card-view":
88
+ u();
114
89
  return;
115
90
  case "teacher-card-unassign":
116
- l == null || l(r, t);
91
+ c == null || c(e, t);
117
92
  return;
118
93
  case "student-card-reattempt":
119
- d == null || d(r, t);
94
+ s == null || s(e, t);
120
95
  return;
121
96
  default:
122
- throw new Error(`No callback function for ${L}`);
97
+ throw new Error(`No callback function for ${y}`);
123
98
  }
124
99
  },
125
- [r, d, l, T, E, t]
126
- ), ce = s(() => {
127
- H(!0);
128
- }, []), ae = s(() => {
129
- H(!1);
130
- }, []), se = [
131
- {
132
- id: "teacher-card-view",
133
- label: "View",
134
- icon: V,
135
- disabled: !1,
136
- onClick: m
137
- },
138
- {
139
- id: "teacher-card-unassign",
140
- label: "Unassign",
141
- icon: Re,
142
- disabled: c ? !1 : !oe,
143
- onClick: m
144
- }
145
- ], le = [
146
- {
147
- id: "student-card-click",
148
- label: "Review",
149
- icon: V,
150
- disabled: !C,
151
- onClick: m
152
- },
153
- {
154
- id: "student-card-reattempt",
155
- label: "Reattempt",
156
- icon: me,
157
- disabled: !k,
158
- onClick: m
159
- }
160
- ];
161
- return /* @__PURE__ */ i(Ce, { $position: "relative", $width: "fit-content", children: [
162
- /* @__PURE__ */ e(we, { onClick: _ ? T : E, label: "homework-card", children: /* @__PURE__ */ i(
163
- o,
100
+ [
101
+ e,
102
+ s,
103
+ c,
104
+ u,
105
+ C,
106
+ t
107
+ ]
108
+ );
109
+ return /* @__PURE__ */ g(Q, { $position: "relative", $width: "fit-content", children: [
110
+ /* @__PURE__ */ r(
111
+ L,
164
112
  {
165
- ref: g,
166
- $widthX: 12.38,
167
- $position: "relative",
168
- $background: `${R || "ORANGE"}_2`,
169
- onMouseEnter: ce,
170
- onMouseLeave: ae,
171
- children: [
172
- /* @__PURE__ */ i(
173
- ke,
174
- {
175
- $flexDirection: "row",
176
- $alignItems: "center",
177
- $width: "100%",
178
- $heightX: 3.5,
179
- $bgImage: D,
180
- $gutterX: 0.78125,
181
- $flexGap: 8.5,
182
- $position: "relative",
183
- children: [
184
- /* @__PURE__ */ e(
185
- _e,
186
- {
187
- $width: 31,
188
- $height: 31,
189
- $borderRadiusX: 2,
190
- $background: "WHITE_1",
191
- $position: "relative",
192
- $alignItems: "center",
193
- $justifyContent: "center",
194
- children: U ? /* @__PURE__ */ e(be, { src: ee }) : /* @__PURE__ */ e(N, { width: 20, height: 20 })
195
- }
196
- ),
197
- u === "MASTERY" ? /* @__PURE__ */ i(o, { children: [
198
- /* @__PURE__ */ e(o, { $background: "BLACK_T_60", $width: "fit-content", $gutterX: 0.25, children: /* @__PURE__ */ e(y, { $color: "WHITE", $renderAs: "ac4-black", children: "Smart" }) }),
199
- /* @__PURE__ */ e(y, { $renderAs: "ac4-black", children: "Practice" })
200
- ] }) : /* @__PURE__ */ e(y, { $renderAs: "ac4-black", children: Q }),
201
- !!x && /* @__PURE__ */ e(Te, { children: /* @__PURE__ */ e(Ee, { src: x, alt: "Chapter image" }) })
202
- ]
203
- }
204
- ),
205
- /* @__PURE__ */ e(
206
- fe,
207
- {
208
- nodeType: u,
209
- state: q,
210
- accuracy: J,
211
- dueDateTs: $
212
- }
213
- ),
214
- $ && A && /* @__PURE__ */ e(
215
- ge,
216
- {
217
- dueDate: $ * 1e3,
218
- unlockedOn: A * 1e3,
219
- progressBg: `${R || "ORANGE"}_4`
220
- }
221
- ),
222
- /* @__PURE__ */ i(o, { $gutterX: 0.75, $gapX: 1, $flexRowGapX: 0.5, $background: "WHITE", children: [
223
- /* @__PURE__ */ e(
224
- j,
225
- {
226
- renderAs: "primary",
227
- position: "bottom",
228
- tooltipItem: v,
229
- hidden: !ne,
230
- parentWidth: "auto",
231
- zIndex: 2,
232
- children: /* @__PURE__ */ e(o, { $heightX: 2.5, children: /* @__PURE__ */ e(Ie, { ref: a, $renderAs: "ab3", children: v }) })
233
- }
234
- ),
235
- /* @__PURE__ */ e(
236
- o,
237
- {
238
- $flexDirection: "row",
239
- $heightX: 1.25,
240
- $alignItems: "center",
241
- $justifyContent: "space-between",
242
- children: /* @__PURE__ */ e(ye, { $renderAs: "ub3", $color: "BLACK_T_60", children: z })
243
- }
244
- )
245
- ] })
246
- ]
113
+ onClick: b ? Y : C,
114
+ label: "homework-card",
115
+ children: /* @__PURE__ */ r(
116
+ Z,
117
+ {
118
+ header: x,
119
+ isInQueue: k,
120
+ nodeData: e,
121
+ studentContainerRef: w,
122
+ subHeader: M,
123
+ isHomeWork: n
124
+ }
125
+ )
247
126
  }
248
- ) }),
249
- _ && !c && /* @__PURE__ */ e(
250
- K,
127
+ ),
128
+ b && !n && /* @__PURE__ */ r(
129
+ T,
251
130
  {
252
131
  $width: 200,
253
- options: le,
254
- triggerRef: g,
255
- visible: te,
132
+ options: [
133
+ {
134
+ id: "student-card-view",
135
+ label: "Review",
136
+ icon: R,
137
+ disabled: !o,
138
+ onClick: a
139
+ },
140
+ {
141
+ id: "student-card-reattempt",
142
+ label: "Reattempt",
143
+ icon: J,
144
+ disabled: !K,
145
+ onClick: a
146
+ }
147
+ ],
148
+ triggerRef: w,
149
+ visible: B,
256
150
  shouldOpenOnRight: !1
257
151
  }
258
152
  ),
259
- !_ && /* @__PURE__ */ i(ve, { $position: "absolute", $width: "fit-content", $borderRadiusX: 2, children: [
260
- /* @__PURE__ */ e(
261
- j,
153
+ !b && /* @__PURE__ */ g(U, { $position: "absolute", $width: "fit-content", $borderRadiusX: 2, children: [
154
+ /* @__PURE__ */ r(
155
+ V,
262
156
  {
263
157
  renderAs: "primary",
264
158
  tooltipItem: "Review",
265
159
  position: "bottom",
266
- zIndex: 5,
160
+ zIndex: 6,
267
161
  parentWidth: "100%",
268
- hidden: !c || O,
269
- children: /* @__PURE__ */ e(
270
- xe,
162
+ hidden: $ || I !== "WAIT_FOR_REVIEW" && n,
163
+ children: /* @__PURE__ */ r(
164
+ D,
271
165
  {
272
166
  $alignItems: "center",
273
167
  $justifyContent: "center",
274
- ref: b,
275
- onClick: re,
276
- children: /* @__PURE__ */ e(he, { width: 16, height: 16 })
168
+ ref: p,
169
+ onClick: F,
170
+ children: /* @__PURE__ */ r(G, { width: 16, height: 16 })
277
171
  }
278
172
  )
279
173
  }
280
174
  ),
281
- /* @__PURE__ */ e(
282
- K,
175
+ /* @__PURE__ */ r(
176
+ T,
283
177
  {
284
- options: se,
285
- triggerRef: b,
286
- visible: O,
287
- shouldOpenOnRight: Y
178
+ options: [
179
+ {
180
+ id: "teacher-card-view",
181
+ label: o ? "Review" : "View",
182
+ icon: R,
183
+ disabled: !1,
184
+ onClick: a
185
+ },
186
+ {
187
+ id: "teacher-card-unassign",
188
+ label: "Unassign",
189
+ icon: re,
190
+ disabled: n ? A === "MASTERY" : !z,
191
+ onClick: a
192
+ }
193
+ ],
194
+ triggerRef: p,
195
+ visible: $,
196
+ shouldOpenOnRight: X
288
197
  }
289
198
  )
290
- ] })
199
+ ] }),
200
+ k && /* @__PURE__ */ r(N, { $background: "WHITE_5", children: /* @__PURE__ */ r(ee, { $heightX: 1, $widthX: 6, children: /* @__PURE__ */ r(V, { renderAs: "primary", tooltipItem: "Not visible to student", position: "bottom", children: /* @__PURE__ */ r(P, { $heightX: 1, $widthX: 6 }) }) }) })
291
201
  ] });
292
- }, Je = de(Ae);
202
+ }, be = q(te);
293
203
  export {
294
- Je as default
204
+ be as default
295
205
  };
296
206
  //# sourceMappingURL=homework-card.js.map