@cuemath/leap 2.8.61-as17 → 2.8.61-as2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/line-icons/icons/chevron-left.js.map +1 -1
- package/dist/assets/line-icons/icons/recap.js +3 -3
- package/dist/assets/line-icons/icons/recap.js.map +1 -1
- package/dist/assets/lottie/lottie.js +1 -9
- package/dist/assets/lottie/lottie.js.map +1 -1
- package/dist/features/chapters/chapters-list/chapter-item/chapter-item-styled.js +19 -20
- package/dist/features/chapters/chapters-list/chapter-item/chapter-item-styled.js.map +1 -1
- package/dist/features/chapters-v2/chapter-details/block-sections/block-section-view.js +25 -25
- package/dist/features/chapters-v2/chapter-details/block-sections/block-section-view.js.map +1 -1
- package/dist/features/chapters-v2/chapter-details/block-sections/block-sections.js +28 -32
- package/dist/features/chapters-v2/chapter-details/block-sections/block-sections.js.map +1 -1
- package/dist/features/chapters-v2/comps/node-card/student-actions/student-actions.js +78 -85
- package/dist/features/chapters-v2/comps/node-card/student-actions/student-actions.js.map +1 -1
- package/dist/features/chapters-v2/comps/node-card/teacher-actions/teacher-actions.js +90 -98
- package/dist/features/chapters-v2/comps/node-card/teacher-actions/teacher-actions.js.map +1 -1
- package/dist/features/chapters-v2/constants/node-constants.js +1 -0
- package/dist/features/chapters-v2/constants/node-constants.js.map +1 -1
- package/dist/features/chapters-v2/utils/node-card-utils.js +39 -77
- package/dist/features/chapters-v2/utils/node-card-utils.js.map +1 -1
- package/dist/features/communication/pub-sub/constants.js +2 -5
- package/dist/features/communication/pub-sub/constants.js.map +1 -1
- package/dist/features/homework/card-menu-options.js +44 -34
- package/dist/features/homework/card-menu-options.js.map +1 -1
- package/dist/features/homework/homework-card.js +227 -157
- package/dist/features/homework/homework-card.js.map +1 -1
- package/dist/features/homework/hw-card-list/api/get-homeworks.js +1 -1
- package/dist/features/homework/hw-card-list/api/get-homeworks.js.map +1 -1
- package/dist/features/homework/hw-card-list/hw-card-list.js +99 -176
- package/dist/features/homework/hw-card-list/hw-card-list.js.map +1 -1
- package/dist/features/homework/styles.js +31 -36
- package/dist/features/homework/styles.js.map +1 -1
- package/dist/features/milestone/milestone-list-container/milestone-list/milestone-widget/milestone-info.js +49 -48
- 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-tabs/milestone-tabs.js +35 -36
- package/dist/features/milestone/milestone-list-container/milestone-list/milestone-widget/milestone-tabs/milestone-tabs.js.map +1 -1
- package/dist/features/milestone/milestone-tests/test-list-v2/test-list-view.js +38 -40
- package/dist/features/milestone/milestone-tests/test-list-v2/test-list-view.js.map +1 -1
- package/dist/features/sheet-v2/resource-list/resource-list.js +36 -25
- package/dist/features/sheet-v2/resource-list/resource-list.js.map +1 -1
- package/dist/index.d.ts +2 -40
- package/dist/index.js +379 -381
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/dist/assets/line-icons/icons/closed-eye.js +0 -23
- package/dist/assets/line-icons/icons/closed-eye.js.map +0 -1
- package/dist/features/homework/card-title.js +0 -21
- package/dist/features/homework/card-title.js.map +0 -1
- package/dist/features/homework/homework-card-view.js +0 -133
- package/dist/features/homework/homework-card-view.js.map +0 -1
- package/dist/features/homework/hw-card-list/hw-card-list-styled.js +0 -71
- package/dist/features/homework/hw-card-list/hw-card-list-styled.js.map +0 -1
- package/dist/static/competitive-arena.b9c40801.json +0 -1
- package/dist/static/learn.71b13323.json +0 -1
- package/dist/static/practice.158dd488.json +0 -1
- package/dist/static/project.eb665827.json +0 -1
- package/dist/static/puzzle.b298c7e4.json +0 -1
- package/dist/static/recap.0dd2c1e2.json +0 -1
- package/dist/static/test.803d6036.json +0 -1
- package/dist/static/video.b41451e2.json +0 -1
@@ -1,7 +1,7 @@
|
|
1
1
|
import { jsxs as t, jsx as e, Fragment as W } from "react/jsx-runtime";
|
2
2
|
import { memo as X, useRef as j, useState as H, useMemo as L, useLayoutEffect as F } from "react";
|
3
|
-
import
|
4
|
-
import
|
3
|
+
import K from "../../../../../assets/line-icons/icons/check2.js";
|
4
|
+
import V from "../../../../ui/arrow-tooltip/arrow-tooltip.js";
|
5
5
|
import v from "../../../../ui/image/image.js";
|
6
6
|
import r from "../../../../ui/layout/flex-view.js";
|
7
7
|
import U from "../../../../ui/separator/separator.js";
|
@@ -9,38 +9,38 @@ import s from "../../../../ui/text/text.js";
|
|
9
9
|
import Y from "./goals/goal-action-ctas.js";
|
10
10
|
import { GOAL_CATEGORY_BASED_IMAGES as q } from "./milestone-constants.js";
|
11
11
|
import { getRemainingDaysToCompleteGoal as z, getGoalCategoryBasedColorTheme as J, getMilestoneWidgetStatusInfo as Q } from "./milestone-utils.js";
|
12
|
-
import { ChapterProgressSVG as Z, ChapterProgressSVGCircle as
|
12
|
+
import { ChapterProgressSVG as Z, ChapterProgressSVGCircle as f, StyledCheckIconWrapper as ee, MilestoneTitle as te } from "./milestone-widget-styled.js";
|
13
13
|
import re from "./outcome/outcome.js";
|
14
14
|
const ue = X(
|
15
|
-
({ isClassOngoing:
|
15
|
+
({ isClassOngoing: u, isStudentPresent: C, isExpanded: oe, ...x }) => {
|
16
16
|
const {
|
17
|
-
milestone:
|
18
|
-
studentId:
|
17
|
+
milestone: d,
|
18
|
+
studentId: T,
|
19
19
|
studentName: _,
|
20
|
-
teacherName:
|
20
|
+
teacherName: A,
|
21
21
|
parentName: w,
|
22
|
-
userType:
|
23
|
-
courseStream:
|
24
|
-
outcomes:
|
25
|
-
onEdit:
|
26
|
-
onDraftPublish:
|
27
|
-
onAddOutcome:
|
22
|
+
userType: I,
|
23
|
+
courseStream: y,
|
24
|
+
outcomes: n,
|
25
|
+
onEdit: G,
|
26
|
+
onDraftPublish: D,
|
27
|
+
onAddOutcome: E
|
28
28
|
} = x, {
|
29
|
-
milestone_name:
|
30
|
-
milestone_date_ts:
|
31
|
-
milestone_state:
|
29
|
+
milestone_name: m,
|
30
|
+
milestone_date_ts: b,
|
31
|
+
milestone_state: i,
|
32
32
|
goal_category: l,
|
33
|
-
goal_code:
|
34
|
-
progress_stat:
|
35
|
-
} =
|
33
|
+
goal_code: g,
|
34
|
+
progress_stat: S
|
35
|
+
} = d, { completed: p = 0, total: k = 0 } = S || {}, h = i === "OUTCOME_PENDING", a = p > 0 ? Math.floor((p / k || 1) * 100) : 0, o = j(null), [B, O] = H(!1), { textColor: N, borderColor: $ } = J(l), c = Q(i), R = (h ? c == null ? void 0 : c.progressBackgroundColor : $) || "WHITE_5", M = L(() => typeof g == "string", [g]), P = z(b);
|
36
36
|
return F(() => {
|
37
|
-
|
38
|
-
}, [
|
37
|
+
o.current && o.current.scrollHeight > o.current.clientHeight && O(!0);
|
38
|
+
}, [o]), l ? /* @__PURE__ */ t(
|
39
39
|
r,
|
40
40
|
{
|
41
41
|
$flexDirection: "row",
|
42
42
|
$justifyContent: "space-between",
|
43
|
-
$alignItems: "
|
43
|
+
$alignItems: "flex-start",
|
44
44
|
$flexGapX: 1,
|
45
45
|
children: [
|
46
46
|
/* @__PURE__ */ t(r, { $flexDirection: "row", $flexGapX: 1.5, children: [
|
@@ -56,13 +56,13 @@ const ue = X(
|
|
56
56
|
$borderRadiusX: 2,
|
57
57
|
children: [
|
58
58
|
/* @__PURE__ */ t(Z, { width: "64px", height: "64px", children: [
|
59
|
-
/* @__PURE__ */ e(
|
59
|
+
/* @__PURE__ */ e(f, { $progress: 0, r: "31", cx: "32", cy: "32" }),
|
60
60
|
/* @__PURE__ */ e(
|
61
|
-
|
61
|
+
f,
|
62
62
|
{
|
63
63
|
$progressCircle: !0,
|
64
64
|
$progressBackground: "BLACK_1",
|
65
|
-
$progress:
|
65
|
+
$progress: a * 2,
|
66
66
|
r: "31",
|
67
67
|
cx: "32",
|
68
68
|
cy: "32"
|
@@ -78,7 +78,7 @@ const ue = X(
|
|
78
78
|
height: 40
|
79
79
|
}
|
80
80
|
) }),
|
81
|
-
|
81
|
+
a === 100 && /* @__PURE__ */ e(ee, { children: /* @__PURE__ */ e(K, { width: 20, height: 20 }) })
|
82
82
|
]
|
83
83
|
}
|
84
84
|
),
|
@@ -86,7 +86,7 @@ const ue = X(
|
|
86
86
|
/* @__PURE__ */ t(r, { $flexGap: 4, children: [
|
87
87
|
/* @__PURE__ */ t(r, { $flexDirection: "row", $alignItems: "center", $flexGap: 4, children: [
|
88
88
|
/* @__PURE__ */ e(s, { $renderAs: "ac4-black", $color: N, children: l.split("_").join(" ") }),
|
89
|
-
|
89
|
+
h && /* @__PURE__ */ e(
|
90
90
|
r,
|
91
91
|
{
|
92
92
|
$flexDirection: "row",
|
@@ -97,60 +97,61 @@ const ue = X(
|
|
97
97
|
children: /* @__PURE__ */ e(s, { $renderAs: "ac4", $color: "WHITE", children: "Outcome pending" })
|
98
98
|
}
|
99
99
|
),
|
100
|
-
|
100
|
+
i === "DRAFT" && /* @__PURE__ */ e(
|
101
101
|
r,
|
102
102
|
{
|
103
103
|
$flexDirection: "row",
|
104
104
|
$gap: 4,
|
105
105
|
$gutter: 4,
|
106
106
|
$alignItems: "center",
|
107
|
-
$background:
|
107
|
+
$background: $,
|
108
108
|
children: /* @__PURE__ */ e(s, { $renderAs: "ac4", children: "Draft" })
|
109
109
|
}
|
110
110
|
)
|
111
111
|
] }),
|
112
112
|
/* @__PURE__ */ e(
|
113
|
-
|
113
|
+
V,
|
114
114
|
{
|
115
115
|
renderAs: "primary",
|
116
116
|
position: "bottom",
|
117
|
-
tooltipItem:
|
117
|
+
tooltipItem: m,
|
118
118
|
hidden: !B,
|
119
119
|
children: /* @__PURE__ */ e(
|
120
120
|
te,
|
121
121
|
{
|
122
|
-
ref:
|
122
|
+
ref: o,
|
123
123
|
$renderAs: M ? "ah4" : "ah3",
|
124
|
-
children:
|
124
|
+
children: m
|
125
125
|
}
|
126
126
|
)
|
127
127
|
}
|
128
128
|
),
|
129
|
-
|
130
|
-
|
131
|
-
|
129
|
+
i !== "DRAFT" && /* @__PURE__ */ t(s, { $renderAs: "ub3", $color: "BLACK_T_60", children: [
|
130
|
+
a,
|
131
|
+
"% complete",
|
132
|
+
P
|
132
133
|
] })
|
133
134
|
] }),
|
134
|
-
|
135
|
+
n != null && n.length ? /* @__PURE__ */ t(W, { children: [
|
135
136
|
/* @__PURE__ */ e(U, { width: 40, height: 1, background: "BLACK_T_15" }),
|
136
|
-
/* @__PURE__ */ e(re, { outcomes:
|
137
|
+
/* @__PURE__ */ e(re, { outcomes: n })
|
137
138
|
] }) : void 0
|
138
139
|
] })
|
139
140
|
] }),
|
140
|
-
|
141
|
+
I === "TEACHER" && /* @__PURE__ */ e(
|
141
142
|
Y,
|
142
143
|
{
|
143
|
-
milestone:
|
144
|
-
studentId:
|
144
|
+
milestone: d,
|
145
|
+
studentId: T,
|
145
146
|
studentName: _,
|
146
|
-
teacherName:
|
147
|
+
teacherName: A ?? "",
|
147
148
|
parentName: w ?? "",
|
148
|
-
onAddOutcome:
|
149
|
-
isClassOngoing: !!
|
150
|
-
isStudentPresent: !!
|
151
|
-
onDraftPublish:
|
152
|
-
onEdit:
|
153
|
-
courseStream:
|
149
|
+
onAddOutcome: E,
|
150
|
+
isClassOngoing: !!u,
|
151
|
+
isStudentPresent: !!C,
|
152
|
+
onDraftPublish: D,
|
153
|
+
onEdit: G,
|
154
|
+
courseStream: y
|
154
155
|
}
|
155
156
|
)
|
156
157
|
]
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"milestone-info.js","sources":["../../../../../../src/features/milestone/milestone-list-container/milestone-list/milestone-widget/milestone-info.tsx"],"sourcesContent":["import type { IMileStoneInfoWrapperProps } from './milestone-widget-types';\n\nimport React, { memo, useLayoutEffect, useMemo, useRef, useState } from 'react';\n\nimport Check2Icon from '../../../../../assets/line-icons/icons/check2';\nimport ArrowTooltip from '../../../../ui/arrow-tooltip/arrow-tooltip';\nimport Image from '../../../../ui/image/image';\nimport FlexView from '../../../../ui/layout/flex-view';\nimport Separator from '../../../../ui/separator/separator';\nimport Text from '../../../../ui/text/text';\nimport GoalActionCtas from './goals/goal-action-ctas';\nimport { GOAL_CATEGORY_BASED_IMAGES } from './milestone-constants';\nimport {\n getGoalCategoryBasedColorTheme,\n getMilestoneWidgetStatusInfo,\n getRemainingDaysToCompleteGoal,\n} from './milestone-utils';\nimport * as Styled from './milestone-widget-styled';\nimport OutcomeWrapper from './outcome/outcome';\n\nconst MilestoneInfoWrapper: React.FC<IMileStoneInfoWrapperProps> = memo(\n ({ isClassOngoing, isStudentPresent, isExpanded, ...restMilestoneInfoWrapperProps }) => {\n const {\n milestone,\n studentId,\n studentName,\n teacherName,\n parentName,\n userType,\n courseStream,\n outcomes,\n onEdit,\n onDraftPublish,\n onAddOutcome,\n } = restMilestoneInfoWrapperProps;\n\n const {\n milestone_name: milestoneName,\n milestone_date_ts: dueDate,\n milestone_state: milestoneState,\n goal_category: goalCategory,\n goal_code: goalCode,\n progress_stat: progressStat,\n } = milestone;\n\n const { completed = 0, total = 0 } = progressStat || {};\n const isOutcomePending = milestoneState === 'OUTCOME_PENDING';\n const progressCompletionPercentage =\n completed > 0 ? Math.floor((completed / total || 1) * 100) : 0;\n\n const titleTextRef = useRef<HTMLDivElement>(null);\n const [showTitleTooltip, setShowTitleTooltip] = useState(false);\n\n const { textColor: goalCategoryTextColor, borderColor } =\n getGoalCategoryBasedColorTheme(goalCategory);\n\n const outcomeStatusInfo = getMilestoneWidgetStatusInfo(milestoneState);\n const backgroundColor =\n (isOutcomePending ? outcomeStatusInfo?.progressBackgroundColor : borderColor) || 'WHITE_5';\n\n const isGoalCreation = useMemo(() => typeof goalCode === 'string', [goalCode]);\n const remainingDays = getRemainingDaysToCompleteGoal(dueDate);\n\n useLayoutEffect(() => {\n if (\n titleTextRef.current &&\n titleTextRef.current.scrollHeight > titleTextRef.current.clientHeight\n ) {\n setShowTitleTooltip(true);\n }\n }, [titleTextRef]);\n\n if (!goalCategory) return null;\n\n return (\n <FlexView\n $flexDirection=\"row\"\n $justifyContent=\"space-between\"\n $alignItems=\"center\"\n $flexGapX={1}\n >\n <FlexView $flexDirection=\"row\" $flexGapX={1.5}>\n <FlexView\n $widthX={4}\n $heightX={4}\n $background=\"WHITE_T_38\"\n $position=\"relative\"\n $justifyContent=\"center\"\n $alignItems=\"center\"\n $borderRadiusX={2}\n >\n <Styled.ChapterProgressSVG width=\"64px\" height=\"64px\">\n <Styled.ChapterProgressSVGCircle $progress={0} r=\"31\" cx=\"32\" cy=\"32\" />\n <Styled.ChapterProgressSVGCircle\n $progressCircle\n $progressBackground=\"BLACK_1\"\n $progress={progressCompletionPercentage * 2}\n r=\"31\"\n cx=\"32\"\n cy=\"32\"\n />\n </Styled.ChapterProgressSVG>\n\n <FlexView $widthX={4} $heightX={4} $justifyContent=\"center\" $alignItems=\"center\">\n <Image\n src={GOAL_CATEGORY_BASED_IMAGES[goalCategory]}\n withLoader\n width={40}\n height={40}\n />\n </FlexView>\n\n {progressCompletionPercentage === 100 && (\n <Styled.StyledCheckIconWrapper>\n <Check2Icon width={20} height={20} />\n </Styled.StyledCheckIconWrapper>\n )}\n </FlexView>\n\n <FlexView $flexGap={16}>\n <FlexView $flexGap={4}>\n <FlexView $flexDirection=\"row\" $alignItems=\"center\" $flexGap={4}>\n <Text $renderAs=\"ac4-black\" $color={goalCategoryTextColor}>\n {goalCategory.split('_').join(' ')}\n </Text>\n\n {isOutcomePending && (\n <FlexView\n $flexDirection=\"row\"\n $gap={4}\n $gutter={4}\n $alignItems=\"center\"\n $background={backgroundColor}\n >\n <Text $renderAs=\"ac4\" $color=\"WHITE\">\n Outcome pending\n </Text>\n </FlexView>\n )}\n\n {milestoneState === 'DRAFT' && (\n <FlexView\n $flexDirection=\"row\"\n $gap={4}\n $gutter={4}\n $alignItems=\"center\"\n $background={borderColor}\n >\n <Text $renderAs=\"ac4\">Draft</Text>\n </FlexView>\n )}\n </FlexView>\n\n <ArrowTooltip\n renderAs=\"primary\"\n position=\"bottom\"\n tooltipItem={milestoneName}\n hidden={!showTitleTooltip}\n >\n <Styled.MilestoneTitle\n ref={titleTextRef}\n $renderAs={!isGoalCreation ? 'ah3' : 'ah4'}\n >\n {milestoneName}\n </Styled.MilestoneTitle>\n </ArrowTooltip>\n\n {milestoneState !== 'DRAFT' && (\n <Text $renderAs=\"ub3\" $color=\"BLACK_T_60\">\n {!!total && `${progressCompletionPercentage}% complete`}\n {!!total && milestoneState === 'ACTIVE' && remainingDays}\n </Text>\n )}\n </FlexView>\n\n {outcomes?.length ? (\n <>\n <Separator width={40} height={1} background=\"BLACK_T_15\" />\n <OutcomeWrapper outcomes={outcomes} />\n </>\n ) : undefined}\n </FlexView>\n </FlexView>\n\n {userType === 'TEACHER' && (\n <GoalActionCtas\n milestone={milestone}\n studentId={studentId}\n studentName={studentName}\n teacherName={teacherName ?? ''}\n parentName={parentName ?? ''}\n onAddOutcome={onAddOutcome}\n isClassOngoing={Boolean(isClassOngoing)}\n isStudentPresent={Boolean(isStudentPresent)}\n onDraftPublish={onDraftPublish}\n onEdit={onEdit}\n courseStream={courseStream}\n />\n )}\n </FlexView>\n );\n },\n);\n\nexport default MilestoneInfoWrapper;\n"],"names":["MilestoneInfoWrapper","memo","isClassOngoing","isStudentPresent","isExpanded","restMilestoneInfoWrapperProps","milestone","studentId","studentName","teacherName","parentName","userType","courseStream","outcomes","onEdit","onDraftPublish","onAddOutcome","milestoneName","dueDate","milestoneState","goalCategory","goalCode","progressStat","completed","total","isOutcomePending","progressCompletionPercentage","titleTextRef","useRef","showTitleTooltip","setShowTitleTooltip","useState","goalCategoryTextColor","borderColor","getGoalCategoryBasedColorTheme","outcomeStatusInfo","getMilestoneWidgetStatusInfo","backgroundColor","isGoalCreation","useMemo","remainingDays","getRemainingDaysToCompleteGoal","useLayoutEffect","jsxs","FlexView","Styled.ChapterProgressSVG","jsx","Styled.ChapterProgressSVGCircle","Image","GOAL_CATEGORY_BASED_IMAGES","Styled.StyledCheckIconWrapper","Check2Icon","Text","ArrowTooltip","Styled.MilestoneTitle","Fragment","Separator","OutcomeWrapper","GoalActionCtas"],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A,gBAAA,GAC7C;AAAA,cAAA,GAEJ;AAAA,cAEC3B,KAAA,QAAAA,EAAU,SAEP,gBAAA8B,EAAAY,GAAA,EAAA,UAAA;AAAA,gBAAA,gBAAAT,EAACU,KAAU,OAAO,IAAI,QAAQ,GAAG,YAAW,cAAa;AAAA,gBACzD,gBAAAV,EAACW,MAAe,UAAA5C,GAAoB;AAAA,cAAA,EACtC,CAAA,IACE;AAAA,YAAA,GACN;AAAA,UAAA,GACF;AAAA,UAECF,MAAa,aACZ,gBAAAmC;AAAA,YAACY;AAAA,YAAA;AAAA,cACC,WAAApD;AAAA,cACA,WAAAC;AAAA,cACA,aAAAC;AAAA,cACA,aAAaC,KAAe;AAAA,cAC5B,YAAYC,KAAc;AAAA,cAC1B,cAAAM;AAAA,cACA,gBAAgB,EAAQd;AAAA,cACxB,kBAAkB,EAAQC;AAAA,cAC1B,gBAAAY;AAAA,cACA,QAAAD;AAAA,cACA,cAAAF;AAAA,YAAA;AAAA,UACF;AAAA,QAAA;AAAA,MAAA;AAAA,IAAA,IA7HoB;AAAA,EAiI5B;AACF;"}
|
1
|
+
{"version":3,"file":"milestone-info.js","sources":["../../../../../../src/features/milestone/milestone-list-container/milestone-list/milestone-widget/milestone-info.tsx"],"sourcesContent":["import type { IMileStoneInfoWrapperProps } from './milestone-widget-types';\n\nimport React, { memo, useLayoutEffect, useMemo, useRef, useState } from 'react';\n\nimport Check2Icon from '../../../../../assets/line-icons/icons/check2';\nimport ArrowTooltip from '../../../../ui/arrow-tooltip/arrow-tooltip';\nimport Image from '../../../../ui/image/image';\nimport FlexView from '../../../../ui/layout/flex-view';\nimport Separator from '../../../../ui/separator/separator';\nimport Text from '../../../../ui/text/text';\nimport GoalActionCtas from './goals/goal-action-ctas';\nimport { GOAL_CATEGORY_BASED_IMAGES } from './milestone-constants';\nimport {\n getGoalCategoryBasedColorTheme,\n getMilestoneWidgetStatusInfo,\n getRemainingDaysToCompleteGoal,\n} from './milestone-utils';\nimport * as Styled from './milestone-widget-styled';\nimport OutcomeWrapper from './outcome/outcome';\n\nconst MilestoneInfoWrapper: React.FC<IMileStoneInfoWrapperProps> = memo(\n ({ isClassOngoing, isStudentPresent, isExpanded, ...restMilestoneInfoWrapperProps }) => {\n const {\n milestone,\n studentId,\n studentName,\n teacherName,\n parentName,\n userType,\n courseStream,\n outcomes,\n onEdit,\n onDraftPublish,\n onAddOutcome,\n } = restMilestoneInfoWrapperProps;\n\n const {\n milestone_name: milestoneName,\n milestone_date_ts: dueDate,\n milestone_state: milestoneState,\n goal_category: goalCategory,\n goal_code: goalCode,\n progress_stat: progressStat,\n } = milestone;\n\n const { completed = 0, total = 0 } = progressStat || {};\n const isOutcomePending = milestoneState === 'OUTCOME_PENDING';\n const progressCompletionPercentage =\n completed > 0 ? Math.floor((completed / total || 1) * 100) : 0;\n\n const titleTextRef = useRef<HTMLDivElement>(null);\n const [showTitleTooltip, setShowTitleTooltip] = useState(false);\n\n const { textColor: goalCategoryTextColor, borderColor } =\n getGoalCategoryBasedColorTheme(goalCategory);\n\n const outcomeStatusInfo = getMilestoneWidgetStatusInfo(milestoneState);\n const backgroundColor =\n (isOutcomePending ? outcomeStatusInfo?.progressBackgroundColor : borderColor) || 'WHITE_5';\n\n const isGoalCreation = useMemo(() => typeof goalCode === 'string', [goalCode]);\n const remainingDays = getRemainingDaysToCompleteGoal(dueDate);\n\n useLayoutEffect(() => {\n if (\n titleTextRef.current &&\n titleTextRef.current.scrollHeight > titleTextRef.current.clientHeight\n ) {\n setShowTitleTooltip(true);\n }\n }, [titleTextRef]);\n\n if (!goalCategory) return null;\n\n return (\n <FlexView\n $flexDirection=\"row\"\n $justifyContent=\"space-between\"\n $alignItems=\"flex-start\"\n $flexGapX={1}\n >\n <FlexView $flexDirection=\"row\" $flexGapX={1.5}>\n <FlexView\n $widthX={4}\n $heightX={4}\n $background=\"WHITE_T_38\"\n $position=\"relative\"\n $justifyContent=\"center\"\n $alignItems=\"center\"\n $borderRadiusX={2}\n >\n <Styled.ChapterProgressSVG width=\"64px\" height=\"64px\">\n <Styled.ChapterProgressSVGCircle $progress={0} r=\"31\" cx=\"32\" cy=\"32\" />\n <Styled.ChapterProgressSVGCircle\n $progressCircle\n $progressBackground=\"BLACK_1\"\n $progress={progressCompletionPercentage * 2}\n r=\"31\"\n cx=\"32\"\n cy=\"32\"\n />\n </Styled.ChapterProgressSVG>\n\n <FlexView $widthX={4} $heightX={4} $justifyContent=\"center\" $alignItems=\"center\">\n <Image\n src={GOAL_CATEGORY_BASED_IMAGES[goalCategory]}\n withLoader\n width={40}\n height={40}\n />\n </FlexView>\n\n {progressCompletionPercentage === 100 && (\n <Styled.StyledCheckIconWrapper>\n <Check2Icon width={20} height={20} />\n </Styled.StyledCheckIconWrapper>\n )}\n </FlexView>\n\n <FlexView $flexGap={16}>\n <FlexView $flexGap={4}>\n <FlexView $flexDirection=\"row\" $alignItems=\"center\" $flexGap={4}>\n <Text $renderAs=\"ac4-black\" $color={goalCategoryTextColor}>\n {goalCategory.split('_').join(' ')}\n </Text>\n\n {isOutcomePending && (\n <FlexView\n $flexDirection=\"row\"\n $gap={4}\n $gutter={4}\n $alignItems=\"center\"\n $background={backgroundColor}\n >\n <Text $renderAs=\"ac4\" $color=\"WHITE\">\n Outcome pending\n </Text>\n </FlexView>\n )}\n\n {milestoneState === 'DRAFT' && (\n <FlexView\n $flexDirection=\"row\"\n $gap={4}\n $gutter={4}\n $alignItems=\"center\"\n $background={borderColor}\n >\n <Text $renderAs=\"ac4\">Draft</Text>\n </FlexView>\n )}\n </FlexView>\n\n <ArrowTooltip\n renderAs=\"primary\"\n position=\"bottom\"\n tooltipItem={milestoneName}\n hidden={!showTitleTooltip}\n >\n <Styled.MilestoneTitle\n ref={titleTextRef}\n $renderAs={!isGoalCreation ? 'ah3' : 'ah4'}\n >\n {milestoneName}\n </Styled.MilestoneTitle>\n </ArrowTooltip>\n\n {milestoneState !== 'DRAFT' && (\n <Text $renderAs=\"ub3\" $color=\"BLACK_T_60\">\n {progressCompletionPercentage}% complete{remainingDays}\n </Text>\n )}\n </FlexView>\n\n {outcomes?.length ? (\n <>\n <Separator width={40} height={1} background=\"BLACK_T_15\" />\n <OutcomeWrapper outcomes={outcomes} />\n </>\n ) : undefined}\n </FlexView>\n </FlexView>\n\n {userType === 'TEACHER' && (\n <GoalActionCtas\n milestone={milestone}\n studentId={studentId}\n studentName={studentName}\n teacherName={teacherName ?? ''}\n parentName={parentName ?? ''}\n onAddOutcome={onAddOutcome}\n isClassOngoing={Boolean(isClassOngoing)}\n isStudentPresent={Boolean(isStudentPresent)}\n onDraftPublish={onDraftPublish}\n onEdit={onEdit}\n courseStream={courseStream}\n />\n )}\n </FlexView>\n );\n },\n);\n\nexport default MilestoneInfoWrapper;\n"],"names":["MilestoneInfoWrapper","memo","isClassOngoing","isStudentPresent","isExpanded","restMilestoneInfoWrapperProps","milestone","studentId","studentName","teacherName","parentName","userType","courseStream","outcomes","onEdit","onDraftPublish","onAddOutcome","milestoneName","dueDate","milestoneState","goalCategory","goalCode","progressStat","completed","total","isOutcomePending","progressCompletionPercentage","titleTextRef","useRef","showTitleTooltip","setShowTitleTooltip","useState","goalCategoryTextColor","borderColor","getGoalCategoryBasedColorTheme","outcomeStatusInfo","getMilestoneWidgetStatusInfo","backgroundColor","isGoalCreation","useMemo","remainingDays","getRemainingDaysToCompleteGoal","useLayoutEffect","jsxs","FlexView","Styled.ChapterProgressSVG","jsx","Styled.ChapterProgressSVGCircle","Image","GOAL_CATEGORY_BASED_IMAGES","Styled.StyledCheckIconWrapper","Check2Icon","Text","ArrowTooltip","Styled.MilestoneTitle","Fragment","Separator","OutcomeWrapper","GoalActionCtas"],"mappings":";;;;;;;;;;;;;AAoBA,MAAMA,KAA6DC;AAAA,EACjE,CAAC,EAAE,gBAAAC,GAAgB,kBAAAC,GAAkB,YAAAC,IAAY,GAAGC,QAAoC;AAChF,UAAA;AAAA,MACJ,WAAAC;AAAA,MACA,WAAAC;AAAA,MACA,aAAAC;AAAA,MACA,aA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AAAA,YAAA,GACN;AAAA,UAAA,GACF;AAAA,UAECF,MAAa,aACZ,gBAAAmC;AAAA,YAACY;AAAA,YAAA;AAAA,cACC,WAAApD;AAAA,cACA,WAAAC;AAAA,cACA,aAAAC;AAAA,cACA,aAAaC,KAAe;AAAA,cAC5B,YAAYC,KAAc;AAAA,cAC1B,cAAAM;AAAA,cACA,gBAAgB,EAAQd;AAAA,cACxB,kBAAkB,EAAQC;AAAA,cAC1B,gBAAAY;AAAA,cACA,QAAAD;AAAA,cACA,cAAAF;AAAA,YAAA;AAAA,UACF;AAAA,QAAA;AAAA,MAAA;AAAA,IAAA,IA5HoB;AAAA,EAgI5B;AACF;"}
|
@@ -8,37 +8,37 @@ import Y from "../../../../milestone-tests/test-list-v2/test-list-container.js";
|
|
8
8
|
import { getGoalCategoryBasedColorTheme as Z } from "../milestone-utils.js";
|
9
9
|
import { NoPlanCardWrapper as ee, TabsWrapper as te, TabsText as oe, TabComponentWrapper as se } from "./milestone-tabs-styled.js";
|
10
10
|
const be = V((h) => {
|
11
|
-
var
|
11
|
+
var g;
|
12
12
|
const {
|
13
|
-
goalCategory:
|
13
|
+
goalCategory: N,
|
14
14
|
isDraftMilestone: r,
|
15
|
-
isGoalCreation:
|
15
|
+
isGoalCreation: A,
|
16
16
|
isMilestoneActive: l,
|
17
17
|
userMilestoneId: e,
|
18
18
|
chapters: c,
|
19
19
|
userType: d,
|
20
20
|
canUpdatePlan: m,
|
21
21
|
studentId: u,
|
22
|
-
milestoneState:
|
23
|
-
milestonePermissions:
|
22
|
+
milestoneState: I,
|
23
|
+
milestonePermissions: R,
|
24
24
|
activeMilestoneId: p,
|
25
|
-
activeTabId:
|
25
|
+
activeTabId: $
|
26
26
|
} = h, {
|
27
|
-
onAddChapter:
|
28
|
-
onAssignResources:
|
29
|
-
onChapterClick:
|
30
|
-
onCreateMilestoneTest:
|
31
|
-
onNodeAttempt:
|
32
|
-
onNodeView:
|
33
|
-
onNodeReview:
|
34
|
-
onNodeReattempt:
|
27
|
+
onAddChapter: k,
|
28
|
+
onAssignResources: M,
|
29
|
+
onChapterClick: x,
|
30
|
+
onCreateMilestoneTest: P,
|
31
|
+
onNodeAttempt: U,
|
32
|
+
onNodeView: j,
|
33
|
+
onNodeReview: w,
|
34
|
+
onNodeReattempt: E,
|
35
35
|
onNodeReset: S,
|
36
36
|
onNodeUnassign: W,
|
37
37
|
onTestPreview: _,
|
38
38
|
onTestReview: y,
|
39
39
|
onTestStart: B,
|
40
40
|
onWidgetTabSelection: a
|
41
|
-
} = h, { visible_tabs:
|
41
|
+
} = h, { visible_tabs: C } = R, { onEvent: T } = J(), { backgroundColor: D } = Z(N, r), b = {
|
42
42
|
chapters: {
|
43
43
|
label: "Chapters",
|
44
44
|
component: /* @__PURE__ */ t(
|
@@ -47,10 +47,10 @@ const be = V((h) => {
|
|
47
47
|
milestoneId: e,
|
48
48
|
chapters: c,
|
49
49
|
userType: d,
|
50
|
-
isGoalCreation:
|
51
|
-
onChapterClick:
|
52
|
-
onAddChapter:
|
53
|
-
canUpdatePlan: !!(
|
50
|
+
isGoalCreation: A,
|
51
|
+
onChapterClick: x,
|
52
|
+
onAddChapter: k,
|
53
|
+
canUpdatePlan: !!(I !== "DRAFT" && m),
|
54
54
|
isMilestoneActive: l
|
55
55
|
}
|
56
56
|
)
|
@@ -67,8 +67,7 @@ const be = V((h) => {
|
|
67
67
|
userMilestoneId: e,
|
68
68
|
userType: d,
|
69
69
|
canUpdatePlan: m,
|
70
|
-
onCreateMilestoneTest:
|
71
|
-
onNodeReattempt: C,
|
70
|
+
onCreateMilestoneTest: P,
|
72
71
|
onTestPreview: _,
|
73
72
|
onTestStart: B,
|
74
73
|
onTestReview: y
|
@@ -86,41 +85,41 @@ const be = V((h) => {
|
|
86
85
|
canUpdatePlan: m,
|
87
86
|
studentId: u,
|
88
87
|
userType: d,
|
89
|
-
onAssignResources:
|
90
|
-
onNodeAttempt:
|
91
|
-
onNodeView:
|
92
|
-
onNodeReview:
|
93
|
-
onNodeReattempt:
|
88
|
+
onAssignResources: M,
|
89
|
+
onNodeAttempt: U,
|
90
|
+
onNodeView: j,
|
91
|
+
onNodeReview: w,
|
92
|
+
onNodeReattempt: E,
|
94
93
|
onNodeReset: S,
|
95
94
|
onNodeUnassign: W
|
96
95
|
}
|
97
96
|
)
|
98
97
|
}
|
99
|
-
}, s = (
|
100
|
-
([o]) => (
|
98
|
+
}, s = (C ?? []).length === 0 ? Object.entries(b) : Object.entries(b).filter(
|
99
|
+
([o]) => (C ?? []).includes(o.toUpperCase())
|
101
100
|
), [i, F] = X(
|
102
|
-
e === p ?
|
101
|
+
e === p ? $ : ((g = s == null ? void 0 : s[0]) == null ? void 0 : g[0]) || "chapters"
|
103
102
|
), G = q(
|
104
103
|
(o, n) => {
|
105
104
|
if (p === e && o === i) return null;
|
106
|
-
F(o), a == null || a(e, o),
|
105
|
+
F(o), a == null || a(e, o), T("clicked", {
|
107
106
|
cta: n,
|
108
107
|
milestone_id: e
|
109
108
|
});
|
110
109
|
},
|
111
|
-
[p, e, i, a,
|
110
|
+
[p, e, i, a, T]
|
112
111
|
);
|
113
112
|
return r && c.length === 0 ? /* @__PURE__ */ t(ee, { $gutterX: 2, $background: "WHITE_3", children: /* @__PURE__ */ t(K, { $renderAs: "ab2", $color: "RED", children: "No chapter has been assigned" }) }) : /* @__PURE__ */ L(H, { children: [
|
114
113
|
/* @__PURE__ */ t(te, { $backgroundColor: D, $frames: s.length, children: s.map((o) => {
|
115
|
-
const [n, O] = o, { label:
|
114
|
+
const [n, O] = o, { label: f } = O, v = n === i;
|
116
115
|
return /* @__PURE__ */ t(
|
117
116
|
oe,
|
118
117
|
{
|
119
|
-
$renderAs:
|
118
|
+
$renderAs: v ? "ub3-bold" : "ub3",
|
120
119
|
$align: "center",
|
121
|
-
$selected:
|
122
|
-
onClick: () => G(n,
|
123
|
-
children:
|
120
|
+
$selected: v,
|
121
|
+
onClick: () => G(n, f),
|
122
|
+
children: f
|
124
123
|
},
|
125
124
|
n
|
126
125
|
);
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"milestone-tabs.js","sources":["../../../../../../../src/features/milestone/milestone-list-container/milestone-list/milestone-widget/milestone-tabs/milestone-tabs.tsx"],"sourcesContent":["import type { IMilestoneTabConfig, IMilestoneTabsProps } from './milestone-tabs-types';\nimport type { FC } from 'react';\n\nimport { memo, useCallback, useState } from 'react';\n\nimport ChaptersList from '../../../../../chapters/chapters-list/chapters-list';\nimport { useUIContext } from '../../../../../ui/context/context';\nimport Text from '../../../../../ui/text/text';\nimport MilestoneWidgetResources from '../../../../milestone-resources/resources-list/resources-list';\nimport MilestoneTestsList from '../../../../milestone-tests/test-list-v2/test-list-container';\nimport { getGoalCategoryBasedColorTheme } from '../milestone-utils';\nimport * as Styled from './milestone-tabs-styled';\n\nconst MilestoneTabs: FC<IMilestoneTabsProps> = memo(props => {\n const {\n goalCategory,\n isDraftMilestone,\n isGoalCreation,\n isMilestoneActive,\n userMilestoneId,\n chapters,\n userType,\n canUpdatePlan,\n studentId,\n milestoneState,\n milestonePermissions,\n activeMilestoneId,\n activeTabId,\n } = props;\n const {\n onAddChapter,\n onAssignResources,\n onChapterClick,\n onCreateMilestoneTest,\n onNodeAttempt,\n onNodeView,\n onNodeReview,\n onNodeReattempt,\n onNodeReset,\n onNodeUnassign,\n onTestPreview,\n onTestReview,\n onTestStart,\n onWidgetTabSelection,\n } = props;\n const { visible_tabs: visibleTabs } = milestonePermissions;\n const { onEvent: trackEvent } = useUIContext();\n\n const { backgroundColor } = getGoalCategoryBasedColorTheme(goalCategory, isDraftMilestone);\n\n const TAB_CONFIG: IMilestoneTabConfig = {\n chapters: {\n label: 'Chapters',\n component: (\n <ChaptersList\n milestoneId={userMilestoneId}\n chapters={chapters}\n userType={userType}\n isGoalCreation={isGoalCreation}\n onChapterClick={onChapterClick}\n onAddChapter={onAddChapter}\n canUpdatePlan={Boolean(milestoneState !== 'DRAFT' && canUpdatePlan)}\n isMilestoneActive={isMilestoneActive}\n />\n ),\n },\n tests: {\n label: 'Tests',\n component: (\n <MilestoneTestsList\n isDraftMilestone={isDraftMilestone}\n isChaptersAvailable={chapters.length > 0}\n isMilestoneActive={isMilestoneActive}\n studentId={studentId}\n userMilestoneId={userMilestoneId}\n userType={userType}\n canUpdatePlan={canUpdatePlan}\n onCreateMilestoneTest={onCreateMilestoneTest}\n
|
1
|
+
{"version":3,"file":"milestone-tabs.js","sources":["../../../../../../../src/features/milestone/milestone-list-container/milestone-list/milestone-widget/milestone-tabs/milestone-tabs.tsx"],"sourcesContent":["import type { IMilestoneTabConfig, IMilestoneTabsProps } from './milestone-tabs-types';\nimport type { FC } from 'react';\n\nimport { memo, useCallback, useState } from 'react';\n\nimport ChaptersList from '../../../../../chapters/chapters-list/chapters-list';\nimport { useUIContext } from '../../../../../ui/context/context';\nimport Text from '../../../../../ui/text/text';\nimport MilestoneWidgetResources from '../../../../milestone-resources/resources-list/resources-list';\nimport MilestoneTestsList from '../../../../milestone-tests/test-list-v2/test-list-container';\nimport { getGoalCategoryBasedColorTheme } from '../milestone-utils';\nimport * as Styled from './milestone-tabs-styled';\n\nconst MilestoneTabs: FC<IMilestoneTabsProps> = memo(props => {\n const {\n goalCategory,\n isDraftMilestone,\n isGoalCreation,\n isMilestoneActive,\n userMilestoneId,\n chapters,\n userType,\n canUpdatePlan,\n studentId,\n milestoneState,\n milestonePermissions,\n activeMilestoneId,\n activeTabId,\n } = props;\n const {\n onAddChapter,\n onAssignResources,\n onChapterClick,\n onCreateMilestoneTest,\n onNodeAttempt,\n onNodeView,\n onNodeReview,\n onNodeReattempt,\n onNodeReset,\n onNodeUnassign,\n onTestPreview,\n onTestReview,\n onTestStart,\n onWidgetTabSelection,\n } = props;\n const { visible_tabs: visibleTabs } = milestonePermissions;\n const { onEvent: trackEvent } = useUIContext();\n\n const { backgroundColor } = getGoalCategoryBasedColorTheme(goalCategory, isDraftMilestone);\n\n const TAB_CONFIG: IMilestoneTabConfig = {\n chapters: {\n label: 'Chapters',\n component: (\n <ChaptersList\n milestoneId={userMilestoneId}\n chapters={chapters}\n userType={userType}\n isGoalCreation={isGoalCreation}\n onChapterClick={onChapterClick}\n onAddChapter={onAddChapter}\n canUpdatePlan={Boolean(milestoneState !== 'DRAFT' && canUpdatePlan)}\n isMilestoneActive={isMilestoneActive}\n />\n ),\n },\n tests: {\n label: 'Tests',\n component: (\n <MilestoneTestsList\n isDraftMilestone={isDraftMilestone}\n isChaptersAvailable={chapters.length > 0}\n isMilestoneActive={isMilestoneActive}\n studentId={studentId}\n userMilestoneId={userMilestoneId}\n userType={userType}\n canUpdatePlan={canUpdatePlan}\n onCreateMilestoneTest={onCreateMilestoneTest}\n onTestPreview={onTestPreview}\n onTestStart={onTestStart}\n onTestReview={onTestReview}\n />\n ),\n },\n resources: {\n label: 'Resources',\n component: (\n <MilestoneWidgetResources\n isDraftMilestone={isDraftMilestone}\n isMilestoneActive={isMilestoneActive}\n userMilestoneId={userMilestoneId}\n canUpdatePlan={canUpdatePlan}\n studentId={studentId}\n userType={userType}\n onAssignResources={onAssignResources}\n onNodeAttempt={onNodeAttempt}\n onNodeView={onNodeView}\n onNodeReview={onNodeReview}\n onNodeReattempt={onNodeReattempt}\n onNodeReset={onNodeReset}\n onNodeUnassign={onNodeUnassign}\n />\n ),\n },\n };\n\n const filteredTabConfig =\n (visibleTabs ?? []).length === 0\n ? Object.entries(TAB_CONFIG)\n : Object.entries(TAB_CONFIG).filter(([tabName]) =>\n (visibleTabs ?? []).includes(tabName.toUpperCase()),\n );\n const [selectedTabName, setSelectedTabName] = useState(\n userMilestoneId === activeMilestoneId ? activeTabId : filteredTabConfig?.[0]?.[0] || 'chapters',\n );\n\n const handleTabChange = useCallback(\n (tabName: keyof IMilestoneTabConfig, ctaLabel: string) => {\n if (activeMilestoneId === userMilestoneId && tabName === selectedTabName) return null;\n\n setSelectedTabName(tabName);\n\n onWidgetTabSelection?.(userMilestoneId, tabName);\n\n trackEvent('clicked', {\n cta: ctaLabel,\n milestone_id: userMilestoneId,\n });\n },\n [activeMilestoneId, userMilestoneId, selectedTabName, onWidgetTabSelection, trackEvent],\n );\n\n if (isDraftMilestone && chapters.length === 0) {\n return (\n <Styled.NoPlanCardWrapper $gutterX={2} $background=\"WHITE_3\">\n <Text $renderAs=\"ab2\" $color=\"RED\">\n No chapter has been assigned\n </Text>\n </Styled.NoPlanCardWrapper>\n );\n }\n\n return (\n <>\n <Styled.TabsWrapper $backgroundColor={backgroundColor} $frames={filteredTabConfig.length}>\n {filteredTabConfig.map(tabConfig => {\n const [tabName, tabInfo] = tabConfig;\n const { label } = tabInfo;\n const isSelected = tabName === selectedTabName;\n\n return (\n <Styled.TabsText\n $renderAs={isSelected ? 'ub3-bold' : 'ub3'}\n $align=\"center\"\n key={tabName}\n $selected={isSelected}\n onClick={() => handleTabChange(tabName as keyof IMilestoneTabConfig, label)}\n >\n {label}\n </Styled.TabsText>\n );\n })}\n </Styled.TabsWrapper>\n\n <Styled.TabComponentWrapper>\n {TAB_CONFIG[selectedTabName as keyof typeof TAB_CONFIG].component}\n </Styled.TabComponentWrapper>\n </>\n );\n});\n\nexport default MilestoneTabs;\n"],"names":["MilestoneTabs","memo","props","goalCategory","isDraftMilestone","isGoalCreation","isMilestoneActive","userMilestoneId","chapters","userType","canUpdatePlan","studentId","milestoneState","milestonePermissions","activeMilestoneId","activeTabId","onAddChapter","onAssignResources","onChapterClick","onCreateMilestoneTest","onNodeAttempt","onNodeView","onNodeReview","onNodeReattempt","onNodeReset","onNodeUnassign","onTestPreview","onTestReview","onTestStart","onWidgetTabSelection","visibleTabs","trackEvent","useUIContext","backgroundColor","getGoalCategoryBasedColorTheme","TAB_CONFIG","jsx","ChaptersList","MilestoneTestsList","MilestoneWidgetResources","filteredTabConfig","tabName","selectedTabName","setSelectedTabName","useState","_a","handleTabChange","useCallback","ctaLabel","Styled.NoPlanCardWrapper","Text","jsxs","Fragment","Styled.TabsWrapper","tabConfig","tabInfo","label","isSelected","Styled.TabsText","Styled.TabComponentWr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AS,WAAW,IAEvC,gBAAA4B,EAAAa,IAAA,EAAyB,UAAU,GAAG,aAAY,WACjD,UAAA,gBAAAb,EAACc,KAAK,WAAU,OAAM,QAAO,OAAM,0CAEnC,EACF,CAAA,IAMA,gBAAAC,EAAAC,GAAA,EAAA,UAAA;AAAA,IAAC,gBAAAhB,EAAAiB,IAAA,EAAmB,kBAAkBpB,GAAiB,SAASO,EAAkB,QAC/E,UAAkBA,EAAA,IAAI,CAAac,MAAA;AAC5B,YAAA,CAACb,GAASc,CAAO,IAAID,GACrB,EAAE,OAAAE,EAAU,IAAAD,GACZE,IAAahB,MAAYC;AAG7B,aAAA,gBAAAN;AAAA,QAACsB;AAAAA,QAAA;AAAA,UACC,WAAWD,IAAa,aAAa;AAAA,UACrC,QAAO;AAAA,UAEP,WAAWA;AAAA,UACX,SAAS,MAAMX,EAAgBL,GAAsCe,CAAK;AAAA,UAEzE,UAAAA;AAAA,QAAA;AAAA,QAJIf;AAAA,MAAA;AAAA,IAOV,CAAA,GACH;AAAA,sBAECkB,IAAA,EACE,UAAWxB,EAAAO,CAA0C,EAAE,WAC1D;AAAA,EACF,EAAA,CAAA;AAEJ,CAAC;"}
|
@@ -1,73 +1,71 @@
|
|
1
|
-
import { jsxs as
|
2
|
-
import { h as
|
3
|
-
import { memo as
|
4
|
-
import
|
5
|
-
import
|
6
|
-
import
|
7
|
-
import
|
8
|
-
import { MILESTONE_WIDGET_MIN_HEIGHT as
|
9
|
-
import { TESTS_CREATION_ANALYTICS_EVENTS as
|
10
|
-
import { TestSheetItemWrapper as
|
11
|
-
const
|
1
|
+
import { jsxs as E, jsx as t } from "react/jsx-runtime";
|
2
|
+
import { h as $ } from "../../../../node_modules/humanize-plus/dist/humanize.js";
|
3
|
+
import { memo as C } from "react";
|
4
|
+
import S from "../../../../assets/line-icons/icons/plus2.js";
|
5
|
+
import A from "../../../homework/homework-card.js";
|
6
|
+
import N from "../../../ui/buttons/icon-button/icon-button.js";
|
7
|
+
import w from "../../../ui/layout/flex-view.js";
|
8
|
+
import { MILESTONE_WIDGET_MIN_HEIGHT as x } from "../../constants.js";
|
9
|
+
import { TESTS_CREATION_ANALYTICS_EVENTS as y } from "../tests-creation/tests-creation-analytics-events.js";
|
10
|
+
import { TestSheetItemWrapper as b, IconContainer as j, IconButtonCover as H } from "./test-list-view-styled.js";
|
11
|
+
const M = (e) => {
|
12
12
|
const o = /* @__PURE__ */ new Set();
|
13
13
|
return e == null || e.forEach((r) => {
|
14
14
|
o.add(r.chapter_name);
|
15
15
|
}), Array.from(o).join(", ");
|
16
|
-
},
|
16
|
+
}, G = C(
|
17
17
|
({
|
18
18
|
milestoneId: e,
|
19
19
|
studentId: o,
|
20
20
|
sheets: r,
|
21
21
|
userType: i,
|
22
|
-
onCreateNewTest:
|
23
|
-
isMilestoneActive:
|
24
|
-
canUpdatedPlan:
|
25
|
-
...
|
26
|
-
}) => /* @__PURE__ */
|
27
|
-
|
22
|
+
onCreateNewTest: a,
|
23
|
+
isMilestoneActive: m,
|
24
|
+
canUpdatedPlan: c,
|
25
|
+
...d
|
26
|
+
}) => /* @__PURE__ */ E(
|
27
|
+
w,
|
28
28
|
{
|
29
|
-
$height:
|
29
|
+
$height: x,
|
30
30
|
$position: "relative",
|
31
31
|
$justifyContent: "space-between",
|
32
32
|
children: [
|
33
|
-
/* @__PURE__ */ t(
|
33
|
+
/* @__PURE__ */ t(b, { children: r.map((s, p) => {
|
34
34
|
const {
|
35
|
-
items:
|
36
|
-
node_id:
|
37
|
-
sheet_time:
|
35
|
+
items: l,
|
36
|
+
node_id: h,
|
37
|
+
sheet_time: T,
|
38
38
|
total_questions: n,
|
39
|
-
worksheet_id:
|
40
|
-
|
41
|
-
} = s, f = Math.ceil((h || 0) / 60), I = R(p), E = _ ? `${f} Mins` : "", $ = `${n ? `${n} ${S.pluralize(n, "Question")}` : ""} ${E}`;
|
39
|
+
worksheet_id: f
|
40
|
+
} = s, u = Math.ceil((T || 0) / 60), I = M(l), _ = `${typeof n == "number" ? `${n} ${$.pluralize(n, "Question")}, ` : ""}${u} Mins`;
|
42
41
|
return /* @__PURE__ */ t(
|
43
|
-
|
42
|
+
A,
|
44
43
|
{
|
45
44
|
userType: i,
|
46
45
|
header: I,
|
47
|
-
subHeader:
|
46
|
+
subHeader: _,
|
48
47
|
nodeData: s,
|
49
48
|
renderAs: "milestone",
|
50
|
-
|
51
|
-
...l
|
49
|
+
...d
|
52
50
|
},
|
53
|
-
`${
|
51
|
+
`${f}_${h}_${p}`
|
54
52
|
);
|
55
53
|
}) }),
|
56
|
-
i === "TEACHER" &&
|
57
|
-
|
54
|
+
i === "TEACHER" && c && /* @__PURE__ */ t(
|
55
|
+
j,
|
58
56
|
{
|
59
57
|
$flexDirection: "row",
|
60
58
|
$justifyContent: "flex-end",
|
61
59
|
$gapX: 1,
|
62
60
|
$gutterX: 1,
|
63
|
-
children: /* @__PURE__ */ t(
|
64
|
-
|
61
|
+
children: /* @__PURE__ */ t(H, { children: /* @__PURE__ */ t(
|
62
|
+
N,
|
65
63
|
{
|
66
|
-
Icon:
|
64
|
+
Icon: S,
|
67
65
|
renderAs: "secondary",
|
68
|
-
analyticsLabel:
|
69
|
-
onClick:
|
70
|
-
disabled: !
|
66
|
+
analyticsLabel: y.CUSTOM_TEST_CREATION_STARTED,
|
67
|
+
onClick: a,
|
68
|
+
disabled: !m,
|
71
69
|
analyticsProps: {
|
72
70
|
milestone_id: e
|
73
71
|
}
|
@@ -80,6 +78,6 @@ const R = (e) => {
|
|
80
78
|
)
|
81
79
|
);
|
82
80
|
export {
|
83
|
-
|
81
|
+
G as default
|
84
82
|
};
|
85
83
|
//# sourceMappingURL=test-list-view.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"test-list-view.js","sources":["../../../../../src/features/milestone/milestone-tests/test-list-v2/test-list-view.tsx"],"sourcesContent":["import type { TNodeDataTestItemsDataProps } from '../../../chapters-v2/comps/node-card/node-card-types';\nimport type { ITestSheetsList } from './types';\nimport type { FC } from 'react';\n\nimport { pluralize } from 'humanize-plus';\nimport { memo } from 'react';\n\nimport Plus2Icon from '../../../../assets/line-icons/icons/plus2';\nimport HomeworkCard from '../../../homework/homework-card';\nimport IconButton from '../../../ui/buttons/icon-button/icon-button';\nimport FlexView from '../../../ui/layout/flex-view';\nimport { MILESTONE_WIDGET_MIN_HEIGHT } from '../../constants';\nimport { TESTS_CREATION_ANALYTICS_EVENTS } from '../tests-creation/tests-creation-analytics-events';\nimport * as Styled from './test-list-view-styled';\n\nconst getTopicNameFromItems = (items?: TNodeDataTestItemsDataProps[]) => {\n const topics = new Set<string>();\n\n items?.forEach(item => {\n topics.add(item.chapter_name);\n });\n\n return Array.from(topics).join(', ');\n};\n\nconst TestSheetsList: FC<ITestSheetsList> = memo(\n ({\n milestoneId,\n studentId,\n sheets,\n userType,\n onCreateNewTest,\n isMilestoneActive,\n canUpdatedPlan,\n ...sheetCallbacks\n }) => {\n return (\n <FlexView\n $height={MILESTONE_WIDGET_MIN_HEIGHT}\n $position=\"relative\"\n $justifyContent=\"space-between\"\n >\n <Styled.TestSheetItemWrapper>\n {sheets.map((sheet, idx) => {\n const {\n items,\n node_id: nodeId,\n sheet_time: sheetTime,\n total_questions: totalQuestions,\n worksheet_id: worksheetId,\n
|
1
|
+
{"version":3,"file":"test-list-view.js","sources":["../../../../../src/features/milestone/milestone-tests/test-list-v2/test-list-view.tsx"],"sourcesContent":["import type { TNodeDataTestItemsDataProps } from '../../../chapters-v2/comps/node-card/node-card-types';\nimport type { ITestSheetsList } from './types';\nimport type { FC } from 'react';\n\nimport { pluralize } from 'humanize-plus';\nimport { memo } from 'react';\n\nimport Plus2Icon from '../../../../assets/line-icons/icons/plus2';\nimport HomeworkCard from '../../../homework/homework-card';\nimport IconButton from '../../../ui/buttons/icon-button/icon-button';\nimport FlexView from '../../../ui/layout/flex-view';\nimport { MILESTONE_WIDGET_MIN_HEIGHT } from '../../constants';\nimport { TESTS_CREATION_ANALYTICS_EVENTS } from '../tests-creation/tests-creation-analytics-events';\nimport * as Styled from './test-list-view-styled';\n\nconst getTopicNameFromItems = (items?: TNodeDataTestItemsDataProps[]) => {\n const topics = new Set<string>();\n\n items?.forEach(item => {\n topics.add(item.chapter_name);\n });\n\n return Array.from(topics).join(', ');\n};\n\nconst TestSheetsList: FC<ITestSheetsList> = memo(\n ({\n milestoneId,\n studentId,\n sheets,\n userType,\n onCreateNewTest,\n isMilestoneActive,\n canUpdatedPlan,\n ...sheetCallbacks\n }) => {\n return (\n <FlexView\n $height={MILESTONE_WIDGET_MIN_HEIGHT}\n $position=\"relative\"\n $justifyContent=\"space-between\"\n >\n <Styled.TestSheetItemWrapper>\n {sheets.map((sheet, idx) => {\n const {\n items,\n node_id: nodeId,\n sheet_time: sheetTime,\n total_questions: totalQuestions,\n worksheet_id: worksheetId,\n } = sheet;\n const totalSheetTime = Math.ceil((sheetTime || 0) / 60);\n const testChapterName = getTopicNameFromItems(items);\n const subHeader = `${\n typeof totalQuestions === 'number'\n ? `${totalQuestions} ${pluralize(totalQuestions, 'Question')}, `\n : ''\n }${totalSheetTime} Mins`;\n\n return (\n <HomeworkCard\n key={`${worksheetId}_${nodeId}_${idx}`}\n userType={userType}\n header={testChapterName}\n subHeader={subHeader}\n nodeData={sheet}\n renderAs=\"milestone\"\n {...sheetCallbacks}\n />\n );\n })}\n </Styled.TestSheetItemWrapper>\n\n {userType === 'TEACHER' && canUpdatedPlan && (\n <Styled.IconContainer\n $flexDirection=\"row\"\n $justifyContent=\"flex-end\"\n $gapX={1}\n $gutterX={1}\n >\n <Styled.IconButtonCover>\n <IconButton\n Icon={Plus2Icon}\n renderAs=\"secondary\"\n analyticsLabel={TESTS_CREATION_ANALYTICS_EVENTS.CUSTOM_TEST_CREATION_STARTED}\n onClick={onCreateNewTest}\n disabled={!isMilestoneActive}\n analyticsProps={{\n milestone_id: milestoneId,\n }}\n />\n </Styled.IconButtonCover>\n </Styled.IconContainer>\n )}\n </FlexView>\n );\n },\n);\n\nexport default TestSheetsList;\n"],"names":["getTopicNameFromItems","items","topics","item","TestSheetsList","memo","milestoneId","studentId","sheets","userType","onCreateNewTest","isMilestoneActive","canUpdatedPlan","sheetCallbacks","jsxs","FlexView","MILESTONE_WIDGET_MIN_HEIGHT","jsx","Styled.TestSheetItemWrapper","sheet","idx","nodeId","sheetTime","totalQuestions","worksheetId","totalSheetTime","testChapterName","subHeader","pluralize","HomeworkCard","Styled.IconContainer","Styled.IconButtonCover","IconButton","Plus2Icon","TESTS_CREATION_ANALYTICS_EVENTS"],"mappings":";;;;;;;;;;AAeA,MAAMA,IAAwB,CAACC,MAA0C;AACjE,QAAAC,wBAAa;AAEnB,SAAAD,KAAA,QAAAA,EAAO,QAAQ,CAAQE,MAAA;AACd,IAAAD,EAAA,IAAIC,EAAK,YAAY;AAAA,EAAA,IAGvB,MAAM,KAAKD,CAAM,EAAE,KAAK,IAAI;AACrC,GAEME,IAAsCC;AAAA,EAC1C,CAAC;AAAA,IACC,aAAAC;AAAA,IACA,WAAAC;AAAA,IACA,QAAAC;AAAA,IACA,UAAAC;AAAA,IACA,iBAAAC;AAAA,IACA,mBAAAC;AAAA,IACA,gBAAAC;AAAA,IACA,GAAGC;AAAA,EAAA,MAGD,gBAAAC;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,SAASC;AAAA,MACT,WAAU;AAAA,MACV,iBAAgB;AAAA,MAEhB,UAAA;AAAA,QAAA,gBAAAC,EAACC,GAAA,EACE,YAAO,IAAI,CAACC,GAAOC,MAAQ;AACpB,gBAAA;AAAA,YACJ,OAAAnB;AAAA,YACA,SAASoB;AAAA,YACT,YAAYC;AAAA,YACZ,iBAAiBC;AAAA,YACjB,cAAcC;AAAA,UACZ,IAAAL,GACEM,IAAiB,KAAK,MAAMH,KAAa,KAAK,EAAE,GAChDI,IAAkB1B,EAAsBC,CAAK,GAC7C0B,IAAY,GAChB,OAAOJ,KAAmB,WACtB,GAAGA,CAAc,IAAIK,EAAA,UAAUL,GAAgB,UAAU,CAAC,OAC1D,EACN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