@cuemath/leap 3.2.30 → 3.2.32
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/homework/homework-card-view.js +21 -20
- package/dist/features/homework/homework-card-view.js.map +1 -1
- package/dist/features/homework/styles.js +6 -7
- package/dist/features/homework/styles.js.map +1 -1
- package/dist/features/milestone/milestone-list-container/milestone-list/milestone-list.js +48 -46
- package/dist/features/milestone/milestone-list-container/milestone-list/milestone-list.js.map +1 -1
- package/dist/features/milestone/milestone-list-container/milestone-list/milestone-widget/goals/goal-action-ctas.js +39 -38
- package/dist/features/milestone/milestone-list-container/milestone-list/milestone-widget/goals/goal-action-ctas.js.map +1 -1
- package/dist/features/milestone/milestone-list-container/milestone-list/milestone-widget/milestone-info.js +43 -41
- package/dist/features/milestone/milestone-list-container/milestone-list/milestone-widget/milestone-info.js.map +1 -1
- package/dist/features/milestone/milestone-list-container/milestone-list/milestone-widget/milestone-widget.js +61 -59
- package/dist/features/milestone/milestone-list-container/milestone-list/milestone-widget/milestone-widget.js.map +1 -1
- package/dist/features/milestone/milestone-list-container/milestone-list-container.js +91 -89
- package/dist/features/milestone/milestone-list-container/milestone-list-container.js.map +1 -1
- package/dist/features/puzzles/comps/puzzle-card-styled.js +6 -5
- package/dist/features/puzzles/comps/puzzle-card-styled.js.map +1 -1
- package/dist/features/puzzles/comps/puzzle-card.js +33 -31
- package/dist/features/puzzles/comps/puzzle-card.js.map +1 -1
- package/dist/features/trial-session/comps/learning-plan/index.js +22 -21
- package/dist/features/trial-session/comps/learning-plan/index.js.map +1 -1
- package/dist/index.d.ts +2 -0
- package/package.json +1 -1
- package/dist/features/chapters/api/chapter.js +0 -10
- package/dist/features/chapters/api/chapter.js.map +0 -1
|
@@ -5,17 +5,17 @@ import I from "../chapters-v2/comps/node-card/node-card-tags.js";
|
|
|
5
5
|
import { getNodeTypeBasedBgImage as P } from "../chapters-v2/utils/index.js";
|
|
6
6
|
import { getNodeCardBasedIcon as U } from "../chapters-v2/utils/node-card-utils.js";
|
|
7
7
|
import G from "../puzzles/comps/puzzle-card.js";
|
|
8
|
-
import
|
|
8
|
+
import h from "../ui/arrow-tooltip/arrow-tooltip.js";
|
|
9
9
|
import a from "../ui/layout/flex-view.js";
|
|
10
10
|
import j from "../ui/lottie-animation/lottie-animation.js";
|
|
11
11
|
import V from "./card-title.js";
|
|
12
12
|
import _ from "./node-progress.js";
|
|
13
13
|
import { PuzzleCardWrapper as K, CardWrapper as Z, IconWrapper as F, BannerImageWrapper as M, BannerImage as q, HeaderText as J, SubHeaderText as Q } from "./styles.js";
|
|
14
14
|
const Y = { renderer: "canvas", autoplay: !1 }, ee = ({
|
|
15
|
-
header:
|
|
15
|
+
header: $,
|
|
16
16
|
isInQueue: C,
|
|
17
17
|
nodeData: E,
|
|
18
|
-
studentContainerRef:
|
|
18
|
+
studentContainerRef: f,
|
|
19
19
|
subHeader: x,
|
|
20
20
|
userType: c,
|
|
21
21
|
isMilestone: d = !1,
|
|
@@ -24,7 +24,7 @@ const Y = { renderer: "canvas", autoplay: !1 }, ee = ({
|
|
|
24
24
|
const {
|
|
25
25
|
node_type: t,
|
|
26
26
|
state: m,
|
|
27
|
-
accuracy:
|
|
27
|
+
accuracy: T,
|
|
28
28
|
due_date_ts: r,
|
|
29
29
|
image_url: p,
|
|
30
30
|
image_hue: o,
|
|
@@ -32,29 +32,29 @@ const Y = { renderer: "canvas", autoplay: !1 }, ee = ({
|
|
|
32
32
|
unlocked_on_ts: s,
|
|
33
33
|
course_type: A,
|
|
34
34
|
title: k
|
|
35
|
-
} = E, D = t === "PUZZLE_CARD",
|
|
35
|
+
} = E, D = t === "PUZZLE_CARD", u = c === "STUDENT" && m === "LOCKED", [N, v] = L(!1), l = b(null), H = P(t), g = b(null), { lottie: S } = U(t), O = w(() => {
|
|
36
36
|
var i;
|
|
37
|
-
(i =
|
|
37
|
+
(i = g.current) == null || i.play();
|
|
38
38
|
}, []), X = w(() => {
|
|
39
39
|
var i;
|
|
40
|
-
(i =
|
|
40
|
+
(i = g.current) == null || i.stop();
|
|
41
41
|
}, []);
|
|
42
42
|
return R(() => {
|
|
43
43
|
l.current && l.current.scrollHeight > l.current.clientHeight && v(!0);
|
|
44
44
|
}, []), D ? /* @__PURE__ */ e(
|
|
45
|
-
|
|
45
|
+
h,
|
|
46
46
|
{
|
|
47
47
|
renderAs: "primary",
|
|
48
48
|
tooltipItem: "Solve puzzle after class",
|
|
49
49
|
position: "bottom",
|
|
50
|
-
hidden: !
|
|
50
|
+
hidden: !u,
|
|
51
51
|
children: /* @__PURE__ */ e("div", { ref: y, children: /* @__PURE__ */ n(
|
|
52
52
|
K,
|
|
53
53
|
{
|
|
54
|
-
ref:
|
|
54
|
+
ref: f,
|
|
55
55
|
$position: "relative",
|
|
56
56
|
$background: `${o}_2`,
|
|
57
|
-
$disabled:
|
|
57
|
+
$disabled: u,
|
|
58
58
|
children: [
|
|
59
59
|
/* @__PURE__ */ e(
|
|
60
60
|
G,
|
|
@@ -63,7 +63,8 @@ const Y = { renderer: "canvas", autoplay: !1 }, ee = ({
|
|
|
63
63
|
imageUrl: p ?? "",
|
|
64
64
|
title: k,
|
|
65
65
|
width: 126,
|
|
66
|
-
height: 159
|
|
66
|
+
height: 159,
|
|
67
|
+
disabled: u
|
|
67
68
|
}
|
|
68
69
|
),
|
|
69
70
|
/* @__PURE__ */ e(
|
|
@@ -71,7 +72,7 @@ const Y = { renderer: "canvas", autoplay: !1 }, ee = ({
|
|
|
71
72
|
{
|
|
72
73
|
nodeType: t,
|
|
73
74
|
state: m,
|
|
74
|
-
accuracy:
|
|
75
|
+
accuracy: T,
|
|
75
76
|
dueDateTs: r,
|
|
76
77
|
isStudent: c === "STUDENT",
|
|
77
78
|
isMilestone: d
|
|
@@ -92,7 +93,7 @@ const Y = { renderer: "canvas", autoplay: !1 }, ee = ({
|
|
|
92
93
|
) : /* @__PURE__ */ n(
|
|
93
94
|
a,
|
|
94
95
|
{
|
|
95
|
-
ref:
|
|
96
|
+
ref: f,
|
|
96
97
|
$widthX: 12.38,
|
|
97
98
|
$position: "relative",
|
|
98
99
|
$background: `${o || "ORANGE"}_2`,
|
|
@@ -121,12 +122,12 @@ const Y = { renderer: "canvas", autoplay: !1 }, ee = ({
|
|
|
121
122
|
$position: "relative",
|
|
122
123
|
$alignItems: "center",
|
|
123
124
|
$justifyContent: "center",
|
|
124
|
-
children: /* @__PURE__ */ e(j, { src: S, ref:
|
|
125
|
+
children: /* @__PURE__ */ e(j, { src: S, ref: g, settings: Y })
|
|
125
126
|
}
|
|
126
127
|
),
|
|
127
128
|
/* @__PURE__ */ e(V, { cardHeader: z, nodeType: t, courseType: A }),
|
|
128
129
|
C && /* @__PURE__ */ e(
|
|
129
|
-
|
|
130
|
+
h,
|
|
130
131
|
{
|
|
131
132
|
renderAs: "primary",
|
|
132
133
|
tooltipItem: "Not visible to student",
|
|
@@ -144,7 +145,7 @@ const Y = { renderer: "canvas", autoplay: !1 }, ee = ({
|
|
|
144
145
|
{
|
|
145
146
|
nodeType: t,
|
|
146
147
|
state: m,
|
|
147
|
-
accuracy:
|
|
148
|
+
accuracy: T,
|
|
148
149
|
dueDateTs: r,
|
|
149
150
|
isStudent: c === "STUDENT",
|
|
150
151
|
isMilestone: d
|
|
@@ -160,16 +161,16 @@ const Y = { renderer: "canvas", autoplay: !1 }, ee = ({
|
|
|
160
161
|
),
|
|
161
162
|
/* @__PURE__ */ n(a, { $gutterX: 0.75, $gapX: 1, $flexRowGapX: 0.5, $background: "WHITE", children: [
|
|
162
163
|
/* @__PURE__ */ e(
|
|
163
|
-
|
|
164
|
+
h,
|
|
164
165
|
{
|
|
165
166
|
renderAs: "primary",
|
|
166
167
|
position: "bottom",
|
|
167
|
-
tooltipItem:
|
|
168
|
+
tooltipItem: $,
|
|
168
169
|
width: 300,
|
|
169
170
|
hidden: !N,
|
|
170
171
|
parentWidth: "auto",
|
|
171
172
|
zIndex: 6,
|
|
172
|
-
children: /* @__PURE__ */ e(a, { $heightX: 2.5, children: /* @__PURE__ */ e(J, { ref: l, $renderAs: "ab3", children:
|
|
173
|
+
children: /* @__PURE__ */ e(a, { $heightX: 2.5, children: /* @__PURE__ */ e(J, { ref: l, $renderAs: "ab3", children: $ }) })
|
|
173
174
|
}
|
|
174
175
|
),
|
|
175
176
|
/* @__PURE__ */ n(
|
|
@@ -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 { ILottieAnimationRef } from '../ui/lottie-animation/types';\nimport type { TUserTypes } from '../ui/types';\nimport type { FC } from 'react';\n\nimport { memo, 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 PuzzleCard from '../puzzles/comps/puzzle-card';\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\nconst renderSettings = { renderer: 'canvas', autoplay: false };\n\ninterface IHomeworkCardViewProps {\n header: string;\n isInQueue?: boolean;\n nodeData: INodeDataProps;\n studentContainerRef: React.RefObject<HTMLDivElement>;\n subHeader: string;\n userType: TUserTypes;\n isMilestone?: boolean;\n puzzleHWCardRef?: React.RefObject<HTMLDivElement>;\n}\n\nconst HomeworkView: FC<IHomeworkCardViewProps> = ({\n header,\n isInQueue,\n nodeData,\n studentContainerRef,\n subHeader,\n userType,\n isMilestone = false,\n puzzleHWCardRef,\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 title,\n } = nodeData;\n const isPuzzleCard = nodeType === 'PUZZLE_CARD';\n const isPuzzleDisabled = userType === 'STUDENT' && state === 'LOCKED';\n\n const [showTitleTooltip, setShowTitleTooltip] = useState(false);\n const titleTextRef = useRef<HTMLDivElement>(null);\n const bgImage = getNodeTypeBasedBgImage(nodeType);\n const animationRef = useRef<ILottieAnimationRef | null>(null);\n const { lottie: nodeCardLottie } = getNodeCardBasedIcon(nodeType);\n\n const handleOnMouseEnter = useCallback(() => {\n animationRef.current?.play();\n }, []);\n\n const handleOnMouseLeave = useCallback(() => {\n animationRef.current?.stop();\n }, []);\n\n useLayoutEffect(() => {\n if (\n titleTextRef.current &&\n titleTextRef.current.scrollHeight > titleTextRef.current.clientHeight\n ) {\n setShowTitleTooltip(true);\n }\n }, []);\n\n if (isPuzzleCard) {\n return (\n <ArrowTooltip\n renderAs=\"primary\"\n tooltipItem=\"Solve puzzle after class\"\n position=\"bottom\"\n hidden={!isPuzzleDisabled}\n >\n <div ref={puzzleHWCardRef}>\n <Styled.PuzzleCardWrapper\n ref={studentContainerRef}\n $position=\"relative\"\n $background={`${imageHue}_2`}\n $disabled={isPuzzleDisabled}\n >\n <PuzzleCard\n imageHue={imageHue}\n imageUrl={imageUrl ?? ''}\n title={title}\n width={126}\n height={159}\n />\n\n <NodeCardTags\n nodeType={nodeType}\n state={state}\n accuracy={accuracy}\n dueDateTs={dueDateTs}\n isStudent={userType === 'STUDENT'}\n isMilestone={isMilestone}\n />\n {!isMilestone && dueDateTs && unlockedOnTs && (\n <NodeProgress\n dueDate={dueDateTs * 1000}\n unlockedOn={unlockedOnTs * 1000}\n progressBg={`${imageHue || 'ORANGE'}_5`}\n />\n )}\n </Styled.PuzzleCardWrapper>\n </div>\n </ArrowTooltip>\n );\n }\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 <LottieAnimation src={nodeCardLottie} ref={animationRef} settings={renderSettings} />\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 isMilestone={isMilestone}\n />\n {!isMilestone && 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 memo(HomeworkView);\n"],"names":["renderSettings","HomeworkView","header","isInQueue","nodeData","studentContainerRef","subHeader","userType","isMilestone","puzzleHWCardRef","nodeType","state","accuracy","dueDateTs","imageUrl","imageHue","cardHeader","unlockedOnTs","courseType","title","isPuzzleCard","isPuzzleDisabled","showTitleTooltip","setShowTitleTooltip","useState","titleTextRef","useRef","bgImage","getNodeTypeBasedBgImage","animationRef","nodeCardLottie","getNodeCardBasedIcon","handleOnMouseEnter","useCallback","_a","handleOnMouseLeave","useLayoutEffect","jsx","ArrowTooltip","jsxs","Styled.PuzzleCardWrapper","PuzzleCard","NodeCardTags","NodeProgress","FlexView","Styled.CardWrapper","Styled.IconWrapper","LottieAnimation","CardTitle","ClosedEyeIcon","Styled.BannerImageWrapper","Styled.BannerImage","Styled.HeaderText","Styled.SubHeaderText","HomeworkCardView","memo"],"mappings":";;;;;;;;;;;;;AAmBA,MAAMA,IAAiB,EAAE,UAAU,UAAU,UAAU,GAAM,GAavDC,KAA2C,CAAC;AAAA,EAChD,QAAAC;AAAA,EACA,WAAAC;AAAA,EACA,UAAAC;AAAA,EACA,qBAAAC;AAAA,EACA,WAAAC;AAAA,EACA,UAAAC;AAAA,EACA,aAAAC,IAAc;AAAA,EACd,iBAAAC;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,IACb,OAAAC;AAAA,EACE,IAAAf,GACEgB,IAAeV,MA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AA,QAAQ,GAAI,CAAA;AAAA,cAAA;AAAA,YAAA;AAAA,UACxB;AAAA,QAAA,GACF;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAGN,GAEeU,KAAAC,EAAKtD,EAAY;"}
|
|
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 { ILottieAnimationRef } from '../ui/lottie-animation/types';\nimport type { TUserTypes } from '../ui/types';\nimport type { FC } from 'react';\n\nimport { memo, 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 PuzzleCard from '../puzzles/comps/puzzle-card';\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\nconst renderSettings = { renderer: 'canvas', autoplay: false };\n\ninterface IHomeworkCardViewProps {\n header: string;\n isInQueue?: boolean;\n nodeData: INodeDataProps;\n studentContainerRef: React.RefObject<HTMLDivElement>;\n subHeader: string;\n userType: TUserTypes;\n isMilestone?: boolean;\n puzzleHWCardRef?: React.RefObject<HTMLDivElement>;\n}\n\nconst HomeworkView: FC<IHomeworkCardViewProps> = ({\n header,\n isInQueue,\n nodeData,\n studentContainerRef,\n subHeader,\n userType,\n isMilestone = false,\n puzzleHWCardRef,\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 title,\n } = nodeData;\n const isPuzzleCard = nodeType === 'PUZZLE_CARD';\n const isPuzzleDisabled = userType === 'STUDENT' && state === 'LOCKED';\n\n const [showTitleTooltip, setShowTitleTooltip] = useState(false);\n const titleTextRef = useRef<HTMLDivElement>(null);\n const bgImage = getNodeTypeBasedBgImage(nodeType);\n const animationRef = useRef<ILottieAnimationRef | null>(null);\n const { lottie: nodeCardLottie } = getNodeCardBasedIcon(nodeType);\n\n const handleOnMouseEnter = useCallback(() => {\n animationRef.current?.play();\n }, []);\n\n const handleOnMouseLeave = useCallback(() => {\n animationRef.current?.stop();\n }, []);\n\n useLayoutEffect(() => {\n if (\n titleTextRef.current &&\n titleTextRef.current.scrollHeight > titleTextRef.current.clientHeight\n ) {\n setShowTitleTooltip(true);\n }\n }, []);\n\n if (isPuzzleCard) {\n return (\n <ArrowTooltip\n renderAs=\"primary\"\n tooltipItem=\"Solve puzzle after class\"\n position=\"bottom\"\n hidden={!isPuzzleDisabled}\n >\n <div ref={puzzleHWCardRef}>\n <Styled.PuzzleCardWrapper\n ref={studentContainerRef}\n $position=\"relative\"\n $background={`${imageHue}_2`}\n $disabled={isPuzzleDisabled}\n >\n <PuzzleCard\n imageHue={imageHue}\n imageUrl={imageUrl ?? ''}\n title={title}\n width={126}\n height={159}\n disabled={isPuzzleDisabled}\n />\n\n <NodeCardTags\n nodeType={nodeType}\n state={state}\n accuracy={accuracy}\n dueDateTs={dueDateTs}\n isStudent={userType === 'STUDENT'}\n isMilestone={isMilestone}\n />\n {!isMilestone && dueDateTs && unlockedOnTs && (\n <NodeProgress\n dueDate={dueDateTs * 1000}\n unlockedOn={unlockedOnTs * 1000}\n progressBg={`${imageHue || 'ORANGE'}_5`}\n />\n )}\n </Styled.PuzzleCardWrapper>\n </div>\n </ArrowTooltip>\n );\n }\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 <LottieAnimation src={nodeCardLottie} ref={animationRef} settings={renderSettings} />\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 isMilestone={isMilestone}\n />\n {!isMilestone && 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 memo(HomeworkView);\n"],"names":["renderSettings","HomeworkView","header","isInQueue","nodeData","studentContainerRef","subHeader","userType","isMilestone","puzzleHWCardRef","nodeType","state","accuracy","dueDateTs","imageUrl","imageHue","cardHeader","unlockedOnTs","courseType","title","isPuzzleCard","isPuzzleDisabled","showTitleTooltip","setShowTitleTooltip","useState","titleTextRef","useRef","bgImage","getNodeTypeBasedBgImage","animationRef","nodeCardLottie","getNodeCardBasedIcon","handleOnMouseEnter","useCallback","_a","handleOnMouseLeave","useLayoutEffect","jsx","ArrowTooltip","jsxs","Styled.PuzzleCardWrapper","PuzzleCard","NodeCardTags","NodeProgress","FlexView","Styled.CardWrapper","Styled.IconWrapper","LottieAnimation","CardTitle","ClosedEyeIcon","Styled.BannerImageWrapper","Styled.BannerImage","Styled.HeaderText","Styled.SubHeaderText","HomeworkCardView","memo"],"mappings":";;;;;;;;;;;;;AAmBA,MAAMA,IAAiB,EAAE,UAAU,UAAU,UAAU,GAAM,GAavDC,KAA2C,CAAC;AAAA,EAChD,QAAAC;AAAA,EACA,WAAAC;AAAA,EACA,UAAAC;AAAA,EACA,qBAAAC;AAAA,EACA,WAAAC;AAAA,EACA,UAAAC;AAAA,EACA,aAAAC,IAAc;AAAA,EACd,iBAAAC;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,IACb,OAAAC;AAAA,EACE,IAAAf,GACEgB,IAAeV,MAAa,eAC5BW,IAAmBd,MAAa,aAAaI,MAAU,UAEvD,CAACW,GAAkBC,CAAmB,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AAA,UACxB;AAAA,QAAA,GACF;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAGN,GAEeU,KAAAC,EAAKtD,EAAY;"}
|
|
@@ -2,7 +2,7 @@ import r from "styled-components";
|
|
|
2
2
|
import n from "../../assets/line-icons/icons/minus2.js";
|
|
3
3
|
import e from "../ui/layout/flex-view.js";
|
|
4
4
|
import i from "../ui/text/text.js";
|
|
5
|
-
const
|
|
5
|
+
const c = r(e)(({ theme: o }) => `
|
|
6
6
|
cursor: pointer;
|
|
7
7
|
width: 24px;
|
|
8
8
|
height: 24px;
|
|
@@ -108,27 +108,26 @@ const k = r(e)`
|
|
|
108
108
|
width: 100%;
|
|
109
109
|
height: 100%;
|
|
110
110
|
opacity: 0.5;
|
|
111
|
-
`,
|
|
111
|
+
`, C = r(e)`
|
|
112
112
|
position: absolute;
|
|
113
113
|
right: 42px;
|
|
114
114
|
top: 24px;
|
|
115
|
-
`,
|
|
116
|
-
opacity: 0.5;
|
|
115
|
+
`, $ = r(e)(({ $disabled: o }) => o ? `
|
|
117
116
|
cursor: not-allowed;
|
|
118
117
|
` : "cursor: pointer");
|
|
119
118
|
export {
|
|
120
119
|
f as BannerImage,
|
|
121
120
|
h as BannerImageWrapper,
|
|
122
121
|
v as BlurContainer,
|
|
123
|
-
|
|
122
|
+
C as BlurFlexView,
|
|
124
123
|
x as CardContainer,
|
|
125
|
-
|
|
124
|
+
c as CardKebabMenuWrapper,
|
|
126
125
|
u as CardMenuOptionsWrapper,
|
|
127
126
|
b as CardWrapper,
|
|
128
127
|
m as HeaderText,
|
|
129
128
|
w as IconWrapper,
|
|
130
129
|
k as MenuWrapper,
|
|
131
|
-
|
|
130
|
+
$ as PuzzleCardWrapper,
|
|
132
131
|
g as StyledMinus2Icon,
|
|
133
132
|
d as SubHeaderText
|
|
134
133
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styles.js","sources":["../../../src/features/homework/styles.ts"],"sourcesContent":["import styled from 'styled-components';\n\nimport Minus2Icon from '../../assets/line-icons/icons/minus2';\nimport FlexView from '../ui/layout/flex-view';\nimport Text from '../ui/text/text';\n\ninterface ICardWrapperProps {\n $bgImage: string;\n}\ninterface ICardOptionsMenuWrapperProps {\n $visible: boolean;\n $shouldopenonright: boolean;\n}\n\nexport const CardKebabMenuWrapper = styled(FlexView)(({ theme }) => {\n return `\n cursor: pointer;\n width: 24px;\n height: 24px;\n \n \n &:hover {\n border-radius: 50%;\n background: ${theme.colors.WHITE_5}; \n }\n `;\n});\n\nexport const SubHeaderText = styled(Text)`\n display: -webkit-box;\n -webkit-line-clamp: 1;\n -webkit-box-orient: vertical;\n overflow: hidden;\n text-overflow: ellipsis;\n`;\n\nexport const CardMenuOptionsWrapper = styled(FlexView)<ICardOptionsMenuWrapperProps>(({\n $shouldopenonright,\n $visible,\n}) => {\n return `\n cursor: pointer;\n position: absolute;\n z-index: 6;\n top: calc(100% + 4px);\n right: ${$shouldopenonright ? 0 : 'auto'};\n transform-origin: top;\n transform: scaleY(${$visible ? 1 : 0});\n opacity: ${$visible ? 1 : 0};\n transition: transform 0.2s ease-in-out, opacity 0.2s ease-in-out;\n box-shadow: 0px 6px 12px 0px rgba(0, 0, 0, 0.4);\n z-index: 10;\n `;\n});\n\nexport const CardContainer = styled(FlexView)`\n border: 1px solid ${({ theme }) => theme.colors.BLACK_T_15};\n border-top-width: 2px;\n &:hover {\n border: 1px solid ${({ theme }) => theme.colors.BLACK};\n border-top-width: 2px;\n }\n`;\n\nexport const CardWrapper = styled(FlexView)<ICardWrapperProps>(({ $bgImage }) => {\n if ($bgImage) {\n return `\n background-image: url(${$bgImage});\n background-repeat: no-repeat;\n background-size: cover;\n background-position: center;\n overflow: hidden;\n `;\n }\n\n return 'overflow: hidden;';\n});\n\nexport const IconWrapper = styled(FlexView)`\n display: flex;\n align-items: center;\n justify-content: center;\n`;\n\nexport const BannerImageWrapper = styled(FlexView)`\n position: absolute;\n right: -18px;\n top: -4px;\n`;\n\nexport const BannerImage = styled.img(({ theme }) => {\n const { gutter } = theme.layout;\n\n return `\n border: 1px solid ${theme.colors.BLACK_T_15};\n width: ${gutter * 4}px;\n height: ${gutter * 4}px;\n border-radius: 50%;\n `;\n});\n\nexport const StyledMinus2Icon = styled(Minus2Icon)`\n path {\n stroke: ${({ theme }) => theme.colors.WHITE};\n }\n`;\n\nexport const HeaderText = styled(Text)`\n display: -webkit-box;\n -webkit-line-clamp: 2;\n -webkit-box-orient: vertical;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: break-spaces;\n`;\n\ninterface ICardOptionWrapperProps {\n $disabled?: boolean;\n}\ninterface ICardOptionsProps {\n $top: number;\n $left: number;\n}\n\nexport const CardOptions = styled(FlexView)<ICardOptionsProps>``;\n\nexport const CardOptionWrapper = styled(FlexView)<ICardOptionWrapperProps>(({\n theme,\n $disabled,\n}) => {\n return `\n cursor: ${$disabled ? 'not-allowed' : 'pointer'};\n \n &:hover {\n background: ${$disabled ? 'transparent' : theme.colors.BLACK};\n };\n \n path {\n fill: ${theme.colors.WHITE_1};\n }\n `;\n});\n\nexport const OptionText = styled(Text)`\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n`;\n\nexport const MenuWrapper = styled(FlexView)`\n position: absolute;\n z-index: 6;\n top: calc(100% - 36px);\n right: 12px;\n transform-origin: top;\n transform: scaleY(1);\n`;\n\nexport const BlurContainer = styled(FlexView)`\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n opacity: 0.5;\n`;\n\nexport const BlurFlexView = styled(FlexView)`\n position: absolute;\n right: 42px;\n top: 24px;\n`;\n\nexport const PuzzleCardWrapper = styled(FlexView)<{ $disabled?: boolean }>(({ $disabled }) => {\n if ($disabled)\n return `\n
|
|
1
|
+
{"version":3,"file":"styles.js","sources":["../../../src/features/homework/styles.ts"],"sourcesContent":["import styled from 'styled-components';\n\nimport Minus2Icon from '../../assets/line-icons/icons/minus2';\nimport FlexView from '../ui/layout/flex-view';\nimport Text from '../ui/text/text';\n\ninterface ICardWrapperProps {\n $bgImage: string;\n}\ninterface ICardOptionsMenuWrapperProps {\n $visible: boolean;\n $shouldopenonright: boolean;\n}\n\nexport const CardKebabMenuWrapper = styled(FlexView)(({ theme }) => {\n return `\n cursor: pointer;\n width: 24px;\n height: 24px;\n \n \n &:hover {\n border-radius: 50%;\n background: ${theme.colors.WHITE_5}; \n }\n `;\n});\n\nexport const SubHeaderText = styled(Text)`\n display: -webkit-box;\n -webkit-line-clamp: 1;\n -webkit-box-orient: vertical;\n overflow: hidden;\n text-overflow: ellipsis;\n`;\n\nexport const CardMenuOptionsWrapper = styled(FlexView)<ICardOptionsMenuWrapperProps>(({\n $shouldopenonright,\n $visible,\n}) => {\n return `\n cursor: pointer;\n position: absolute;\n z-index: 6;\n top: calc(100% + 4px);\n right: ${$shouldopenonright ? 0 : 'auto'};\n transform-origin: top;\n transform: scaleY(${$visible ? 1 : 0});\n opacity: ${$visible ? 1 : 0};\n transition: transform 0.2s ease-in-out, opacity 0.2s ease-in-out;\n box-shadow: 0px 6px 12px 0px rgba(0, 0, 0, 0.4);\n z-index: 10;\n `;\n});\n\nexport const CardContainer = styled(FlexView)`\n border: 1px solid ${({ theme }) => theme.colors.BLACK_T_15};\n border-top-width: 2px;\n &:hover {\n border: 1px solid ${({ theme }) => theme.colors.BLACK};\n border-top-width: 2px;\n }\n`;\n\nexport const CardWrapper = styled(FlexView)<ICardWrapperProps>(({ $bgImage }) => {\n if ($bgImage) {\n return `\n background-image: url(${$bgImage});\n background-repeat: no-repeat;\n background-size: cover;\n background-position: center;\n overflow: hidden;\n `;\n }\n\n return 'overflow: hidden;';\n});\n\nexport const IconWrapper = styled(FlexView)`\n display: flex;\n align-items: center;\n justify-content: center;\n`;\n\nexport const BannerImageWrapper = styled(FlexView)`\n position: absolute;\n right: -18px;\n top: -4px;\n`;\n\nexport const BannerImage = styled.img(({ theme }) => {\n const { gutter } = theme.layout;\n\n return `\n border: 1px solid ${theme.colors.BLACK_T_15};\n width: ${gutter * 4}px;\n height: ${gutter * 4}px;\n border-radius: 50%;\n `;\n});\n\nexport const StyledMinus2Icon = styled(Minus2Icon)`\n path {\n stroke: ${({ theme }) => theme.colors.WHITE};\n }\n`;\n\nexport const HeaderText = styled(Text)`\n display: -webkit-box;\n -webkit-line-clamp: 2;\n -webkit-box-orient: vertical;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: break-spaces;\n`;\n\ninterface ICardOptionWrapperProps {\n $disabled?: boolean;\n}\ninterface ICardOptionsProps {\n $top: number;\n $left: number;\n}\n\nexport const CardOptions = styled(FlexView)<ICardOptionsProps>``;\n\nexport const CardOptionWrapper = styled(FlexView)<ICardOptionWrapperProps>(({\n theme,\n $disabled,\n}) => {\n return `\n cursor: ${$disabled ? 'not-allowed' : 'pointer'};\n \n &:hover {\n background: ${$disabled ? 'transparent' : theme.colors.BLACK};\n };\n \n path {\n fill: ${theme.colors.WHITE_1};\n }\n `;\n});\n\nexport const OptionText = styled(Text)`\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n`;\n\nexport const MenuWrapper = styled(FlexView)`\n position: absolute;\n z-index: 6;\n top: calc(100% - 36px);\n right: 12px;\n transform-origin: top;\n transform: scaleY(1);\n`;\n\nexport const BlurContainer = styled(FlexView)`\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n opacity: 0.5;\n`;\n\nexport const BlurFlexView = styled(FlexView)`\n position: absolute;\n right: 42px;\n top: 24px;\n`;\n\nexport const PuzzleCardWrapper = styled(FlexView)<{ $disabled?: boolean }>(({ $disabled }) => {\n if ($disabled)\n return `\n cursor: not-allowed;\n `;\n\n return 'cursor: pointer';\n});\n"],"names":["CardKebabMenuWrapper","styled","FlexView","theme","SubHeaderText","Text","CardMenuOptionsWrapper","$shouldopenonright","$visible","CardContainer","CardWrapper","$bgImage","IconWrapper","BannerImageWrapper","BannerImage","gutter","StyledMinus2Icon","Minus2Icon","HeaderText","$disabled","MenuWrapper","BlurContain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AAAd,EAAA,MAAYA,EAAM,OAAO,KAAK;AAAA;AAAA,GAIlCe,IAAajB,EAAOI,CAAI;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAiBVJ,EAAOC,CAAQ;AAETD,EAAOC,CAAQ,EAA2B,CAAC;AAAA,EAC1E,OAAAC;AAAA,EACA,WAAAgB;AACF,MACS;AAAA,cACKA,IAAY,gBAAgB,SAAS;AAAA;AAAA;AAAA,oBAG/BA,IAAY,gBAAgBhB,EAAM,OAAO,KAAK;AAAA;AAAA;AAAA;AAAA,cAIpDA,EAAM,OAAO,OAAO;AAAA;AAAA,GAGjC;AAEyBF,EAAOI,CAAI;AAAA;AAAA;AAAA;AAAA;AAMxB,MAAAe,IAAcnB,EAAOC,CAAQ;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,GAS7BmB,IAAgBpB,EAAOC,CAAQ;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,GAS/BoB,IAAerB,EAAOC,CAAQ;AAAA;AAAA;AAAA;AAAA,GAM9BqB,IAAoBtB,EAAOC,CAAQ,EAA2B,CAAC,EAAE,WAAAiB,QACxEA,IACK;AAAA;AAAA,QAIF,iBACR;"}
|
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
1
|
+
import { jsxs as r, Fragment as Q, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import Y, { memo as Z, useCallback as f } from "react";
|
|
3
|
+
import ee from "../../../hooks/use-lazy-ref.js";
|
|
4
|
+
import te from "../../../ui/arrow-tooltip/arrow-tooltip.js";
|
|
5
5
|
import h from "../../../ui/buttons/text-button/text-button.js";
|
|
6
6
|
import m from "../../../ui/layout/flex-view.js";
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
7
|
+
import oe from "../../../ui/separator/separator.js";
|
|
8
|
+
import ne from "../../../ui/text/text.js";
|
|
9
|
+
import ie from "./milestone-widget/milestone-widget.js";
|
|
10
10
|
import re from "./no-active-milestone/no-active-milestone.js";
|
|
11
|
-
import
|
|
12
|
-
const
|
|
11
|
+
import se from "../../../../node_modules/uuid/dist/esm-browser/v4.js";
|
|
12
|
+
const Ce = Z(
|
|
13
13
|
({ milestones: t, studentId: A, milestoneType: s, ...u }) => {
|
|
14
14
|
const {
|
|
15
15
|
canCreatePlan: a,
|
|
16
16
|
isClassOngoing: g,
|
|
17
17
|
isFiltersAdded: C,
|
|
18
|
-
isStudentPresent:
|
|
19
|
-
onAddChapter:
|
|
18
|
+
isStudentPresent: T,
|
|
19
|
+
onAddChapter: M,
|
|
20
20
|
onAddOutcome: n,
|
|
21
21
|
onChapterClick: v,
|
|
22
|
-
onCreatePlan:
|
|
22
|
+
onCreatePlan: i,
|
|
23
23
|
onDelete: w,
|
|
24
24
|
onDraftPublish: N,
|
|
25
25
|
onEdit: b,
|
|
@@ -30,9 +30,9 @@ const ge = Y(
|
|
|
30
30
|
onNodeReattempt: I,
|
|
31
31
|
onNodeReset: P,
|
|
32
32
|
onNodeUnassign: F,
|
|
33
|
-
onAssignResources:
|
|
34
|
-
onTestPreview:
|
|
35
|
-
onTestReview:
|
|
33
|
+
onAssignResources: S,
|
|
34
|
+
onTestPreview: k,
|
|
35
|
+
onTestReview: E,
|
|
36
36
|
onTestStart: j,
|
|
37
37
|
activeMilestoneId: y,
|
|
38
38
|
activeTabId: G,
|
|
@@ -42,39 +42,40 @@ const ge = Y(
|
|
|
42
42
|
parentName: z,
|
|
43
43
|
userType: l,
|
|
44
44
|
courseStream: B,
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
45
|
+
isTrialSession: H,
|
|
46
|
+
onNodeAssignAsHomework: L
|
|
47
|
+
} = u, d = s === "ACTIVE", O = s === "DRAFT", p = ee(se), W = f(() => {
|
|
48
|
+
i == null || i(p);
|
|
49
|
+
}, [i, p]), X = f(() => {
|
|
49
50
|
n == null || n();
|
|
50
51
|
}, [n]);
|
|
51
52
|
if (!t) return null;
|
|
52
|
-
const
|
|
53
|
+
const U = t.some(
|
|
53
54
|
(o) => o.milestone_state === "ACTIVE"
|
|
54
|
-
),
|
|
55
|
+
), q = t.some(
|
|
55
56
|
(o) => o.milestone_state === "DRAFT"
|
|
56
57
|
);
|
|
57
|
-
return /* @__PURE__ */
|
|
58
|
-
d && !
|
|
58
|
+
return /* @__PURE__ */ r(Q, { children: [
|
|
59
|
+
d && !U && /* @__PURE__ */ e(m, { $marginBottom: 40, children: /* @__PURE__ */ e(
|
|
59
60
|
re,
|
|
60
61
|
{
|
|
61
62
|
canCreatePlan: a,
|
|
62
|
-
isDraftMilestonePresent:
|
|
63
|
+
isDraftMilestonePresent: q,
|
|
63
64
|
isFiltersAdded: C,
|
|
64
|
-
onCreatePlan:
|
|
65
|
+
onCreatePlan: i,
|
|
65
66
|
studentName: c,
|
|
66
67
|
userType: l
|
|
67
68
|
}
|
|
68
69
|
) }),
|
|
69
|
-
d && /* @__PURE__ */
|
|
70
|
-
/* @__PURE__ */
|
|
70
|
+
d && /* @__PURE__ */ r(m, { $flexDirection: "row", $justifyContent: "space-between", $marginBottom: 16, children: [
|
|
71
|
+
/* @__PURE__ */ r(ne, { $renderAs: "ac4", children: [
|
|
71
72
|
"Goals (",
|
|
72
73
|
t.length,
|
|
73
74
|
")"
|
|
74
75
|
] }),
|
|
75
|
-
l === "TEACHER" && /* @__PURE__ */
|
|
76
|
+
l === "TEACHER" && /* @__PURE__ */ r(m, { $flexDirection: "row", $flexGapX: 1, children: [
|
|
76
77
|
/* @__PURE__ */ e(
|
|
77
|
-
|
|
78
|
+
te,
|
|
78
79
|
{
|
|
79
80
|
renderAs: "primary",
|
|
80
81
|
tooltipItem: "Goals can only be added for students who have joined the class",
|
|
@@ -85,20 +86,20 @@ const ge = Y(
|
|
|
85
86
|
{
|
|
86
87
|
label: "Create Goal",
|
|
87
88
|
size: "small",
|
|
88
|
-
onClick:
|
|
89
|
+
onClick: W,
|
|
89
90
|
disabled: !a
|
|
90
91
|
}
|
|
91
92
|
)
|
|
92
93
|
}
|
|
93
94
|
),
|
|
94
|
-
/* @__PURE__ */ e(h, { label: "Add Milestone", size: "small", onClick:
|
|
95
|
+
/* @__PURE__ */ e(h, { label: "Add Milestone", size: "small", onClick: X })
|
|
95
96
|
] })
|
|
96
97
|
] }),
|
|
97
|
-
t.map((o,
|
|
98
|
-
const { id:
|
|
99
|
-
return /* @__PURE__ */
|
|
98
|
+
t.map((o, J) => {
|
|
99
|
+
const { id: K } = o;
|
|
100
|
+
return /* @__PURE__ */ r(Y.Fragment, { children: [
|
|
100
101
|
/* @__PURE__ */ e(
|
|
101
|
-
|
|
102
|
+
ie,
|
|
102
103
|
{
|
|
103
104
|
milestone: o,
|
|
104
105
|
studentId: A,
|
|
@@ -108,39 +109,40 @@ const ge = Y(
|
|
|
108
109
|
userType: l,
|
|
109
110
|
onAddOutcome: n,
|
|
110
111
|
onChapterClick: v,
|
|
111
|
-
isMilestoneActive: d ||
|
|
112
|
+
isMilestoneActive: d || O,
|
|
112
113
|
milestoneType: s,
|
|
113
114
|
onEdit: b,
|
|
114
115
|
onCreateMilestoneTest: R,
|
|
115
|
-
onAddChapter:
|
|
116
|
+
onAddChapter: M,
|
|
116
117
|
onDelete: w,
|
|
117
118
|
onDraftPublish: N,
|
|
118
119
|
isClassOngoing: g,
|
|
119
|
-
isStudentPresent:
|
|
120
|
-
onAssignResources:
|
|
120
|
+
isStudentPresent: T,
|
|
121
|
+
onAssignResources: S,
|
|
121
122
|
onNodeAttempt: x,
|
|
122
123
|
onNodeView: D,
|
|
123
124
|
onNodeReview: $,
|
|
124
125
|
onNodeReattempt: I,
|
|
125
126
|
onNodeReset: P,
|
|
126
127
|
onNodeUnassign: F,
|
|
127
|
-
onNodeAssignAsHomework:
|
|
128
|
-
onTestPreview:
|
|
129
|
-
onTestReview:
|
|
128
|
+
onNodeAssignAsHomework: L,
|
|
129
|
+
onTestPreview: k,
|
|
130
|
+
onTestReview: E,
|
|
130
131
|
onTestStart: j,
|
|
131
132
|
courseStream: B,
|
|
132
133
|
activeMilestoneId: y,
|
|
133
134
|
activeTabId: G,
|
|
134
|
-
onWidgetTabSelection: V
|
|
135
|
+
onWidgetTabSelection: V,
|
|
136
|
+
isTrialSession: H
|
|
135
137
|
}
|
|
136
138
|
),
|
|
137
|
-
|
|
138
|
-
] }, `milestone=${
|
|
139
|
+
J !== t.length - 1 && /* @__PURE__ */ e(oe, { heightX: 2 })
|
|
140
|
+
] }, `milestone=${K}`);
|
|
139
141
|
})
|
|
140
142
|
] });
|
|
141
143
|
}
|
|
142
144
|
);
|
|
143
145
|
export {
|
|
144
|
-
|
|
146
|
+
Ce as default
|
|
145
147
|
};
|
|
146
148
|
//# sourceMappingURL=milestone-list.js.map
|
package/dist/features/milestone/milestone-list-container/milestone-list/milestone-list.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"milestone-list.js","sources":["../../../../../src/features/milestone/milestone-list-container/milestone-list/milestone-list.tsx"],"sourcesContent":["import type { IMilestoneListProps } from './milestone-list-types';\n\nimport React, { memo, useCallback } from 'react';\nimport { v4 as uuidv4 } from 'uuid';\n\nimport useLazyRef from '../../../hooks/use-lazy-ref';\nimport ArrowTooltip from '../../../ui/arrow-tooltip/arrow-tooltip';\nimport TextButton from '../../../ui/buttons/text-button/text-button';\nimport FlexView from '../../../ui/layout/flex-view';\nimport Separator from '../../../ui/separator/separator';\nimport Text from '../../../ui/text/text';\nimport MilestoneWidget from './milestone-widget/milestone-widget';\nimport NoActiveMilestone from './no-active-milestone/no-active-milestone';\n\nconst MilestoneList: React.FC<IMilestoneListProps> = memo(\n ({ milestones, studentId, milestoneType, ...restMilestoneListProps }) => {\n const {\n canCreatePlan,\n isClassOngoing,\n isFiltersAdded,\n isStudentPresent,\n onAddChapter,\n onAddOutcome,\n onChapterClick,\n onCreatePlan,\n onDelete,\n onDraftPublish,\n onEdit,\n onCreateMilestoneTest,\n onNodeAttempt,\n onNodeView,\n onNodeReview,\n onNodeReattempt,\n onNodeReset,\n onNodeUnassign,\n onAssignResources,\n onTestPreview,\n onTestReview,\n onTestStart,\n activeMilestoneId,\n activeTabId,\n onWidgetTabSelection,\n studentName,\n teacherName,\n parentName,\n userType,\n courseStream,\n onNodeAssignAsHomework,\n } = restMilestoneListProps;\n\n const isMilestoneActive = milestoneType === 'ACTIVE';\n const isDraftMilestone = milestoneType === 'DRAFT';\n const temporaryMilestoneId = useLazyRef(uuidv4);\n\n const handleCreatePlan = useCallback(() => {\n onCreatePlan?.(temporaryMilestoneId);\n }, [onCreatePlan, temporaryMilestoneId]);\n\n const handleOnAddOutcome = useCallback(() => {\n onAddOutcome?.();\n }, [onAddOutcome]);\n\n if (!milestones) return null;\n\n const activeMilestonePresent = milestones.some(\n milestone => milestone.milestone_state === 'ACTIVE',\n );\n const draftMilestonePresent = milestones.some(\n milestone => milestone.milestone_state === 'DRAFT',\n );\n\n return (\n <>\n {isMilestoneActive && !activeMilestonePresent && (\n <FlexView $marginBottom={40}>\n <NoActiveMilestone\n canCreatePlan={canCreatePlan}\n isDraftMilestonePresent={draftMilestonePresent}\n isFiltersAdded={isFiltersAdded}\n onCreatePlan={onCreatePlan}\n studentName={studentName}\n userType={userType}\n />\n </FlexView>\n )}\n\n {isMilestoneActive && (\n <FlexView $flexDirection=\"row\" $justifyContent=\"space-between\" $marginBottom={16}>\n <Text $renderAs=\"ac4\">Goals ({milestones.length})</Text>\n\n {userType === 'TEACHER' && (\n <FlexView $flexDirection=\"row\" $flexGapX={1}>\n <ArrowTooltip\n renderAs=\"primary\"\n tooltipItem=\"Goals can only be added for students who have joined the class\"\n hidden={canCreatePlan}\n position=\"bottom\"\n >\n <TextButton\n label=\"Create Goal\"\n size=\"small\"\n onClick={handleCreatePlan}\n disabled={!canCreatePlan}\n />\n </ArrowTooltip>\n <TextButton label=\"Add Milestone\" size=\"small\" onClick={handleOnAddOutcome} />\n </FlexView>\n )}\n </FlexView>\n )}\n\n {milestones.map((milestone, idx) => {\n const { id: milestoneId } = milestone;\n\n return (\n <React.Fragment key={`milestone=${milestoneId}`}>\n <MilestoneWidget\n milestone={milestone}\n studentId={studentId}\n studentName={studentName}\n parentName={parentName}\n teacherName={teacherName}\n userType={userType}\n onAddOutcome={onAddOutcome}\n onChapterClick={onChapterClick}\n isMilestoneActive={isMilestoneActive || isDraftMilestone}\n milestoneType={milestoneType}\n onEdit={onEdit}\n onCreateMilestoneTest={onCreateMilestoneTest}\n onAddChapter={onAddChapter}\n onDelete={onDelete}\n onDraftPublish={onDraftPublish}\n isClassOngoing={isClassOngoing}\n isStudentPresent={isStudentPresent}\n onAssignResources={onAssignResources}\n onNodeAttempt={onNodeAttempt}\n onNodeView={onNodeView}\n onNodeReview={onNodeReview}\n onNodeReattempt={onNodeReattempt}\n onNodeReset={onNodeReset}\n onNodeUnassign={onNodeUnassign}\n onNodeAssignAsHomework={onNodeAssignAsHomework}\n onTestPreview={onTestPreview}\n onTestReview={onTestReview}\n onTestStart={onTestStart}\n courseStream={courseStream}\n activeMilestoneId={activeMilestoneId}\n activeTabId={activeTabId}\n onWidgetTabSelection={onWidgetTabSelection}\n />\n {idx !== milestones.length - 1 && <Separator heightX={2} />}\n </React.Fragment>\n );\n })}\n </>\n );\n },\n);\n\nexport default MilestoneList;\n"],"names":["MilestoneList","memo","milestones","studentId","milestoneType","restMilestoneListProps","canCreatePlan","isClassOngoing","isFiltersAdded","isStudentPresent","onAddChapter","onAddOutcome","onChapterClick","onCreatePlan","onDelete","onDraftPublish","onEdit","onCreateMilestoneTest","onNodeAttempt","onNodeView","onNodeReview","onNodeReattempt","onNodeReset","onNodeUnassign","onAssignResources","onTestPreview","onTestReview","onTestStart","activeMilestoneId","activeTabId","onWidgetTabSelection","studentName","teacherName","parentName","userType","courseStream","onNodeAssignAsHomework","isMilestoneActive","isDraftMilestone","temporaryMilestoneId","useLazyRef","uuidv4","handleCreatePlan","useCallback","handleOnAddOutcome","activeMilestonePresent","milestone","draftMilestonePresent","jsxs","Fragment","jsx","FlexView","NoActiveMilestone","Text","ArrowTooltip","TextButton","idx","milestoneId","React","MilestoneWidget","Separator"],"mappings":";;;;;;;;;;;AAcA,MAAMA,KAA+CC;AAAA,EACnD,CAAC,EAAE,YAAAC,GAAY,WAAAC,GAAW,eAAAC,GAAe,GAAGC,QAA6B;AACjE,UAAA;AAAA,MACJ,eAAAC;AAAA,MACA,gBAAAC;AAAA,MACA,gBAAAC;AAAA,MACA,kBAAAC;AAAA,MACA,cAAAC;AAAA,MACA,cAAAC;AAAA,MACA,gBAAAC;AAAA,MACA,cAAAC;AAAA,MACA,UAAAC;AAAA,MACA,gBAAAC;AAAA,MACA,QAAAC;AAAA,MACA,uBAAAC;AAAA,MACA,eAAAC;AAAA,MACA,YAAAC;AAAA,MACA,cAAAC;AAAA,MACA,iBAAAC;AAAA,MACA,aAAAC;AAAA,MACA,gBAAAC;AAAA,MACA,mBAAAC;AAAA,MACA,eAAAC;AAAA,MACA,cAAAC;AAAA,MACA,aAAAC;AAAA,MACA,mBAAAC;AAAA,MACA,aAAAC;AAAA,MACA,sBAAAC;AAAA,MACA,aAAAC;AAAA,MACA,aAAAC;AAAA,MACA,YAAAC;AAAA,MACA,UAAAC;AAAA,MACA,cAAAC;AAAA,MACA,wBAAAC;AAAA,IACE,
|
|
1
|
+
{"version":3,"file":"milestone-list.js","sources":["../../../../../src/features/milestone/milestone-list-container/milestone-list/milestone-list.tsx"],"sourcesContent":["import type { IMilestoneListProps } from './milestone-list-types';\n\nimport React, { memo, useCallback } from 'react';\nimport { v4 as uuidv4 } from 'uuid';\n\nimport useLazyRef from '../../../hooks/use-lazy-ref';\nimport ArrowTooltip from '../../../ui/arrow-tooltip/arrow-tooltip';\nimport TextButton from '../../../ui/buttons/text-button/text-button';\nimport FlexView from '../../../ui/layout/flex-view';\nimport Separator from '../../../ui/separator/separator';\nimport Text from '../../../ui/text/text';\nimport MilestoneWidget from './milestone-widget/milestone-widget';\nimport NoActiveMilestone from './no-active-milestone/no-active-milestone';\n\nconst MilestoneList: React.FC<IMilestoneListProps> = memo(\n ({ milestones, studentId, milestoneType, ...restMilestoneListProps }) => {\n const {\n canCreatePlan,\n isClassOngoing,\n isFiltersAdded,\n isStudentPresent,\n onAddChapter,\n onAddOutcome,\n onChapterClick,\n onCreatePlan,\n onDelete,\n onDraftPublish,\n onEdit,\n onCreateMilestoneTest,\n onNodeAttempt,\n onNodeView,\n onNodeReview,\n onNodeReattempt,\n onNodeReset,\n onNodeUnassign,\n onAssignResources,\n onTestPreview,\n onTestReview,\n onTestStart,\n activeMilestoneId,\n activeTabId,\n onWidgetTabSelection,\n studentName,\n teacherName,\n parentName,\n userType,\n courseStream,\n isTrialSession,\n onNodeAssignAsHomework,\n } = restMilestoneListProps;\n\n const isMilestoneActive = milestoneType === 'ACTIVE';\n const isDraftMilestone = milestoneType === 'DRAFT';\n const temporaryMilestoneId = useLazyRef(uuidv4);\n\n const handleCreatePlan = useCallback(() => {\n onCreatePlan?.(temporaryMilestoneId);\n }, [onCreatePlan, temporaryMilestoneId]);\n\n const handleOnAddOutcome = useCallback(() => {\n onAddOutcome?.();\n }, [onAddOutcome]);\n\n if (!milestones) return null;\n\n const activeMilestonePresent = milestones.some(\n milestone => milestone.milestone_state === 'ACTIVE',\n );\n const draftMilestonePresent = milestones.some(\n milestone => milestone.milestone_state === 'DRAFT',\n );\n\n return (\n <>\n {isMilestoneActive && !activeMilestonePresent && (\n <FlexView $marginBottom={40}>\n <NoActiveMilestone\n canCreatePlan={canCreatePlan}\n isDraftMilestonePresent={draftMilestonePresent}\n isFiltersAdded={isFiltersAdded}\n onCreatePlan={onCreatePlan}\n studentName={studentName}\n userType={userType}\n />\n </FlexView>\n )}\n\n {isMilestoneActive && (\n <FlexView $flexDirection=\"row\" $justifyContent=\"space-between\" $marginBottom={16}>\n <Text $renderAs=\"ac4\">Goals ({milestones.length})</Text>\n\n {userType === 'TEACHER' && (\n <FlexView $flexDirection=\"row\" $flexGapX={1}>\n <ArrowTooltip\n renderAs=\"primary\"\n tooltipItem=\"Goals can only be added for students who have joined the class\"\n hidden={canCreatePlan}\n position=\"bottom\"\n >\n <TextButton\n label=\"Create Goal\"\n size=\"small\"\n onClick={handleCreatePlan}\n disabled={!canCreatePlan}\n />\n </ArrowTooltip>\n <TextButton label=\"Add Milestone\" size=\"small\" onClick={handleOnAddOutcome} />\n </FlexView>\n )}\n </FlexView>\n )}\n\n {milestones.map((milestone, idx) => {\n const { id: milestoneId } = milestone;\n\n return (\n <React.Fragment key={`milestone=${milestoneId}`}>\n <MilestoneWidget\n milestone={milestone}\n studentId={studentId}\n studentName={studentName}\n parentName={parentName}\n teacherName={teacherName}\n userType={userType}\n onAddOutcome={onAddOutcome}\n onChapterClick={onChapterClick}\n isMilestoneActive={isMilestoneActive || isDraftMilestone}\n milestoneType={milestoneType}\n onEdit={onEdit}\n onCreateMilestoneTest={onCreateMilestoneTest}\n onAddChapter={onAddChapter}\n onDelete={onDelete}\n onDraftPublish={onDraftPublish}\n isClassOngoing={isClassOngoing}\n isStudentPresent={isStudentPresent}\n onAssignResources={onAssignResources}\n onNodeAttempt={onNodeAttempt}\n onNodeView={onNodeView}\n onNodeReview={onNodeReview}\n onNodeReattempt={onNodeReattempt}\n onNodeReset={onNodeReset}\n onNodeUnassign={onNodeUnassign}\n onNodeAssignAsHomework={onNodeAssignAsHomework}\n onTestPreview={onTestPreview}\n onTestReview={onTestReview}\n onTestStart={onTestStart}\n courseStream={courseStream}\n activeMilestoneId={activeMilestoneId}\n activeTabId={activeTabId}\n onWidgetTabSelection={onWidgetTabSelection}\n isTrialSession={isTrialSession}\n />\n {idx !== milestones.length - 1 && <Separator heightX={2} />}\n </React.Fragment>\n );\n })}\n </>\n );\n },\n);\n\nexport default MilestoneList;\n"],"names":["MilestoneList","memo","milestones","studentId","milestoneType","restMilestoneListProps","canCreatePlan","isClassOngoing","isFiltersAdded","isStudentPresent","onAddChapter","onAddOutcome","onChapterClick","onCreatePlan","onDelete","onDraftPublish","onEdit","onCreateMilestoneTest","onNodeAttempt","onNodeView","onNodeReview","onNodeReattempt","onNodeReset","onNodeUnassign","onAssignResources","onTestPreview","onTestReview","onTestStart","activeMilestoneId","activeTabId","onWidgetTabSelection","studentName","teacherName","parentName","userType","courseStream","isTrialSession","onNodeAssignAsHomework","isMilestoneActive","isDraftMilestone","temporaryMilestoneId","useLazyRef","uuidv4","handleCreatePlan","useCallback","handleOnAddOutcome","activeMilestonePresent","milestone","draftMilestonePresent","jsxs","Fragment","jsx","FlexView","NoActiveMilestone","Text","ArrowTooltip","TextButton","idx","milestoneId","React","MilestoneWidget","Separator"],"mappings":";;;;;;;;;;;AAcA,MAAMA,KAA+CC;AAAA,EACnD,CAAC,EAAE,YAAAC,GAAY,WAAAC,GAAW,eAAAC,GAAe,GAAGC,QAA6B;AACjE,UAAA;AAAA,MACJ,eAAAC;AAAA,MACA,gBAAAC;AAAA,MACA,gBAAAC;AAAA,MACA,kBAAAC;AAAA,MACA,cAAAC;AAAA,MACA,cAAAC;AAAA,MACA,gBAAAC;AAAA,MACA,cAAAC;AAAA,MACA,UAAAC;AAAA,MACA,gBAAAC;AAAA,MACA,QAAAC;AAAA,MACA,uBAAAC;AAAA,MACA,eAAAC;AAAA,MACA,YAAAC;AAAA,MACA,cAAAC;AAAA,MACA,iBAAAC;AAAA,MACA,aAAAC;AAAA,MACA,gBAAAC;AAAA,MACA,mBAAAC;AAAA,MACA,eAAAC;AAAA,MACA,cAAAC;AAAA,MACA,aAAAC;AAAA,MACA,mBAAAC;AAAA,MACA,aAAAC;AAAA,MACA,sBAAAC;AAAA,MACA,aAAAC;AAAA,MACA,aAAAC;AAAA,MACA,YAAAC;AAAA,MACA,UAAAC;AAAA,MACA,cAAAC;AAAA,MACA,gBAAAC;AAAA,MACA,wBAAAC;AAAA,IACE,IAAAhC,GAEEiC,IAAoBlC,MAAkB,UACtCmC,IAAmBnC,MAAkB,SACrCoC,IAAuBC,GAAWC,EAAM,GAEx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