@cuemath/leap 2.8.60-beta-0.1 → 2.8.60-gs1
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/bin2.js +7 -8
- package/dist/assets/line-icons/icons/bin2.js.map +1 -1
- package/dist/assets/line-icons/icons/skip-colored.js +43 -0
- package/dist/assets/line-icons/icons/skip-colored.js.map +1 -0
- package/dist/features/chapters/chapters-list/chapter-item/chapter-item.js +1 -1
- package/dist/features/chapters/chapters-list/chapter-item/chapter-item.js.map +1 -1
- package/dist/features/chapters-v2/chapter-details/chapter-details.js +24 -24
- package/dist/features/chapters-v2/chapter-details/chapter-details.js.map +1 -1
- package/dist/features/chapters-v2/comps/node-card/student-actions/student-actions.js +76 -72
- package/dist/features/chapters-v2/comps/node-card/student-actions/student-actions.js.map +1 -1
- package/dist/features/circle-games/game-launcher/comps/segmented-game-card/segmented-game-card.js +62 -75
- package/dist/features/circle-games/game-launcher/comps/segmented-game-card/segmented-game-card.js.map +1 -1
- package/dist/features/circle-games/game-launcher/comps/tables-card/tables-card.js +127 -110
- package/dist/features/circle-games/game-launcher/comps/tables-card/tables-card.js.map +1 -1
- package/dist/features/milestone/create/comps/chapters-selection-step/chapters-selection-step-styled.js +12 -4
- package/dist/features/milestone/create/comps/chapters-selection-step/chapters-selection-step-styled.js.map +1 -1
- package/dist/features/milestone/create/comps/chapters-selection-step/chapters-selection-step.js +128 -105
- package/dist/features/milestone/create/comps/chapters-selection-step/chapters-selection-step.js.map +1 -1
- package/dist/features/milestone/create/milestone-create.js +49 -43
- package/dist/features/milestone/create/milestone-create.js.map +1 -1
- package/dist/features/milestone/edit/comps/edit-milestone-modal/api/get-milestone.js +1 -1
- package/dist/features/milestone/edit/comps/edit-milestone-modal/api/get-milestone.js.map +1 -1
- package/dist/features/milestone/edit/goal-drafts/goal-draft-edit-container.js +42 -40
- package/dist/features/milestone/edit/goal-drafts/goal-draft-edit-container.js.map +1 -1
- package/dist/features/milestone/edit/goal-edit-container.js +64 -62
- package/dist/features/milestone/edit/goal-edit-container.js.map +1 -1
- package/dist/features/milestone/edit/milestone-edit-container.js +54 -52
- package/dist/features/milestone/edit/milestone-edit-container.js.map +1 -1
- package/dist/features/milestone/milestone-list-container/milestone-list/milestone-list.js +61 -52
- 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 +28 -28
- 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 +120 -111
- package/dist/features/milestone/milestone-list-container/milestone-list/milestone-widget/milestone-info.js.map +1 -1
- package/dist/features/milestone/milestone-tests/tests-creation/tests-creation.js +16 -18
- package/dist/features/milestone/milestone-tests/tests-creation/tests-creation.js.map +1 -1
- package/dist/features/ui/lottie-animation/lottie-animation.js +39 -24
- package/dist/features/ui/lottie-animation/lottie-animation.js.map +1 -1
- package/dist/features/ui/theme/button.js +5 -5
- package/dist/features/ui/theme/button.js.map +1 -1
- package/dist/index.d.ts +6 -2
- package/dist/index.js +369 -367
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
@@ -19,8 +19,8 @@ const ue = X(
|
|
19
19
|
studentName: _,
|
20
20
|
teacherName: A,
|
21
21
|
parentName: w,
|
22
|
-
userType:
|
23
|
-
courseStream:
|
22
|
+
userType: I,
|
23
|
+
courseStream: y,
|
24
24
|
outcomes: n,
|
25
25
|
onEdit: G,
|
26
26
|
onDraftPublish: D,
|
@@ -30,124 +30,133 @@ const ue = X(
|
|
30
30
|
milestone_date_ts: b,
|
31
31
|
milestone_state: i,
|
32
32
|
goal_category: l,
|
33
|
-
goal_code:
|
33
|
+
goal_code: g,
|
34
34
|
progress_stat: S
|
35
|
-
} = d, { completed:
|
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
37
|
o.current && o.current.scrollHeight > o.current.clientHeight && O(!0);
|
38
|
-
}, [o]), l ? /* @__PURE__ */ t(
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
38
|
+
}, [o]), l ? /* @__PURE__ */ t(
|
39
|
+
r,
|
40
|
+
{
|
41
|
+
$flexDirection: "row",
|
42
|
+
$justifyContent: "space-between",
|
43
|
+
$alignItems: "flex-start",
|
44
|
+
$flexGapX: 1,
|
45
|
+
children: [
|
46
|
+
/* @__PURE__ */ t(r, { $flexDirection: "row", $flexGapX: 1.5, children: [
|
47
|
+
/* @__PURE__ */ t(
|
48
|
+
r,
|
49
|
+
{
|
50
|
+
$widthX: 4,
|
51
|
+
$heightX: 4,
|
52
|
+
$background: "WHITE_T_38",
|
53
|
+
$position: "relative",
|
54
|
+
$justifyContent: "center",
|
55
|
+
$alignItems: "center",
|
56
|
+
$borderRadiusX: 2,
|
57
|
+
children: [
|
58
|
+
/* @__PURE__ */ t(Z, { width: "64px", height: "64px", children: [
|
59
|
+
/* @__PURE__ */ e(f, { $progress: 0, r: "31", cx: "32", cy: "32" }),
|
60
|
+
/* @__PURE__ */ e(
|
61
|
+
f,
|
62
|
+
{
|
63
|
+
$progressCircle: !0,
|
64
|
+
$progressBackground: "BLACK_1",
|
65
|
+
$progress: a * 2,
|
66
|
+
r: "31",
|
67
|
+
cx: "32",
|
68
|
+
cy: "32"
|
69
|
+
}
|
70
|
+
)
|
71
|
+
] }),
|
72
|
+
/* @__PURE__ */ e(r, { $widthX: 4, $heightX: 4, $justifyContent: "center", $alignItems: "center", children: /* @__PURE__ */ e(
|
73
|
+
v,
|
74
|
+
{
|
75
|
+
src: q[l],
|
76
|
+
withLoader: !0,
|
77
|
+
width: 40,
|
78
|
+
height: 40
|
79
|
+
}
|
80
|
+
) }),
|
81
|
+
a === 100 && /* @__PURE__ */ e(ee, { children: /* @__PURE__ */ e(K, { width: 20, height: 20 }) })
|
82
|
+
]
|
83
|
+
}
|
84
|
+
),
|
85
|
+
/* @__PURE__ */ t(r, { $flexGap: 16, children: [
|
86
|
+
/* @__PURE__ */ t(r, { $flexGap: 4, children: [
|
87
|
+
/* @__PURE__ */ t(r, { $flexDirection: "row", $alignItems: "center", $flexGap: 4, children: [
|
88
|
+
/* @__PURE__ */ e(s, { $renderAs: "ac4-black", $color: N, children: l.split("_").join(" ") }),
|
89
|
+
h && /* @__PURE__ */ e(
|
90
|
+
r,
|
91
|
+
{
|
92
|
+
$flexDirection: "row",
|
93
|
+
$gap: 4,
|
94
|
+
$gutter: 4,
|
95
|
+
$alignItems: "center",
|
96
|
+
$background: R,
|
97
|
+
children: /* @__PURE__ */ e(s, { $renderAs: "ac4", $color: "WHITE", children: "Outcome pending" })
|
98
|
+
}
|
99
|
+
),
|
100
|
+
i === "DRAFT" && /* @__PURE__ */ e(
|
101
|
+
r,
|
102
|
+
{
|
103
|
+
$flexDirection: "row",
|
104
|
+
$gap: 4,
|
105
|
+
$gutter: 4,
|
106
|
+
$alignItems: "center",
|
107
|
+
$background: $,
|
108
|
+
children: /* @__PURE__ */ e(s, { $renderAs: "ac4", children: "Draft" })
|
109
|
+
}
|
110
|
+
)
|
111
|
+
] }),
|
53
112
|
/* @__PURE__ */ e(
|
54
|
-
|
113
|
+
V,
|
55
114
|
{
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
115
|
+
renderAs: "primary",
|
116
|
+
position: "bottom",
|
117
|
+
tooltipItem: m,
|
118
|
+
hidden: !B,
|
119
|
+
children: /* @__PURE__ */ e(
|
120
|
+
te,
|
121
|
+
{
|
122
|
+
ref: o,
|
123
|
+
$renderAs: M ? "ah4" : "ah3",
|
124
|
+
children: m
|
125
|
+
}
|
126
|
+
)
|
62
127
|
}
|
63
|
-
)
|
128
|
+
),
|
129
|
+
i !== "DRAFT" && /* @__PURE__ */ t(s, { $renderAs: "ub3", $color: "BLACK_T_60", children: [
|
130
|
+
a,
|
131
|
+
"% complete",
|
132
|
+
P
|
133
|
+
] })
|
64
134
|
] }),
|
65
|
-
/* @__PURE__ */
|
66
|
-
|
67
|
-
{
|
68
|
-
|
69
|
-
withLoader: !0,
|
70
|
-
width: 40,
|
71
|
-
height: 40
|
72
|
-
}
|
73
|
-
) }),
|
74
|
-
a === 100 && /* @__PURE__ */ e(ee, { children: /* @__PURE__ */ e(K, { width: 20, height: 20 }) })
|
75
|
-
]
|
76
|
-
}
|
77
|
-
),
|
78
|
-
/* @__PURE__ */ t(r, { $flexGap: 16, children: [
|
79
|
-
/* @__PURE__ */ t(r, { $flexGap: 4, children: [
|
80
|
-
/* @__PURE__ */ t(r, { $flexDirection: "row", $alignItems: "center", $flexGap: 4, children: [
|
81
|
-
/* @__PURE__ */ e(s, { $renderAs: "ac4-black", $color: N, children: l.split("_").join(" ") }),
|
82
|
-
h && /* @__PURE__ */ e(
|
83
|
-
r,
|
84
|
-
{
|
85
|
-
$flexDirection: "row",
|
86
|
-
$gap: 4,
|
87
|
-
$gutter: 4,
|
88
|
-
$alignItems: "center",
|
89
|
-
$background: R,
|
90
|
-
children: /* @__PURE__ */ e(s, { $renderAs: "ac4", $color: "WHITE", children: "Outcome pending" })
|
91
|
-
}
|
92
|
-
),
|
93
|
-
i === "DRAFT" && /* @__PURE__ */ e(
|
94
|
-
r,
|
95
|
-
{
|
96
|
-
$flexDirection: "row",
|
97
|
-
$gap: 4,
|
98
|
-
$gutter: 4,
|
99
|
-
$alignItems: "center",
|
100
|
-
$background: $,
|
101
|
-
children: /* @__PURE__ */ e(s, { $renderAs: "ac4", children: "Draft" })
|
102
|
-
}
|
103
|
-
)
|
104
|
-
] }),
|
105
|
-
/* @__PURE__ */ e(
|
106
|
-
V,
|
107
|
-
{
|
108
|
-
renderAs: "primary",
|
109
|
-
position: "bottom",
|
110
|
-
tooltipItem: m,
|
111
|
-
hidden: !B,
|
112
|
-
children: /* @__PURE__ */ e(
|
113
|
-
te,
|
114
|
-
{
|
115
|
-
ref: o,
|
116
|
-
$renderAs: M ? "ah4" : "ah3",
|
117
|
-
children: m
|
118
|
-
}
|
119
|
-
)
|
120
|
-
}
|
121
|
-
),
|
122
|
-
i !== "DRAFT" && /* @__PURE__ */ t(s, { $renderAs: "ub3", $color: "BLACK_T_60", children: [
|
123
|
-
a,
|
124
|
-
"% complete",
|
125
|
-
P
|
135
|
+
n != null && n.length ? /* @__PURE__ */ t(W, { children: [
|
136
|
+
/* @__PURE__ */ e(U, { width: 40, height: 1, background: "BLACK_T_15" }),
|
137
|
+
/* @__PURE__ */ e(re, { outcomes: n })
|
138
|
+
] }) : void 0
|
126
139
|
] })
|
127
140
|
] }),
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
courseStream: I
|
148
|
-
}
|
149
|
-
)
|
150
|
-
] }) : null;
|
141
|
+
I === "TEACHER" && /* @__PURE__ */ e(
|
142
|
+
Y,
|
143
|
+
{
|
144
|
+
milestone: d,
|
145
|
+
studentId: T,
|
146
|
+
studentName: _,
|
147
|
+
teacherName: A ?? "",
|
148
|
+
parentName: w ?? "",
|
149
|
+
onAddOutcome: E,
|
150
|
+
isClassOngoing: !!u,
|
151
|
+
isStudentPresent: !!C,
|
152
|
+
onDraftPublish: D,
|
153
|
+
onEdit: G,
|
154
|
+
courseStream: y
|
155
|
+
}
|
156
|
+
)
|
157
|
+
]
|
158
|
+
}
|
159
|
+
) : null;
|
151
160
|
}
|
152
161
|
);
|
153
162
|
export {
|
@@ -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, total } = 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 $flexDirection=\"row\" $justifyContent=\"space-between\" $flexGapX={1}>\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","FlexView","jsxs","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,aAAAC;AAAA,MACA,YAAAC;AAAA,MACA,UAAAC;AAAA,MACA,cAAAC;AAAA,MACA,UAAAC;AAAA,MACA,QAAAC;AAAA,MACA,gBAAAC;AAAA,MACA,cAAAC;AAAA,IACE,IAAAX,GAEE;AAAA,MACJ,gBAAgBY;AAAA,MAChB,mBAAmBC;AAAA,MACnB,iBAAiBC;AAAA,MACjB,eAAeC;AAAA,MACf,WAAWC;AAAA,MACX,eAAeC;AAAA,IACb,IAAAhB,GAEE,EAAE,WAAAiB,GAAW,OAAAC,EAAU,IAAAF,GACvBG,IAAmBN,MAAmB,mBACtCO,IACJH,IAAY,IAAI,KAAK,OAAOA,IAAYC,KAAS,KAAK,GAAG,IAAI,GAEzDG,IAAeC,EAAuB,IAAI,GAC1C,CAACC,GAAkBC,CAAmB,IAAIC,EAAS,EAAK,GAExD,EAAE,WAAWC,GAAuB,aAAAC,EAAY,IACpDC,EAA+Bd,CAAY,GAEvCe,IAAoBC,EAA6BjB,CAAc,GA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A,oBACC,KAAK3B;AAAA,oBACL,WAAYW,IAAyB,QAAR;AAAA,oBAE5B,UAAArB;AAAA,kBAAA;AAAA,gBACH;AAAA,cAAA;AAAA,YACF;AAAA,YAECE,MAAmB,WAClB,gBAAAyB,EAACQ,KAAK,WAAU,OAAM,QAAO,cAC1B,UAAA;AAAA,cAAA1B;AAAA,cAA6B;AAAA,cAAWc;AAAA,YAAA,GAC3C;AAAA,UAAA,GAEJ;AAAA,UAEC3B,KAAA,QAAAA,EAAU,SAEP,gBAAA+B,EAAAW,GAAA,EAAA,UAAA;AAAA,YAAA,gBAAAT,EAACU,KAAU,OAAO,IAAI,QAAQ,GAAG,YAAW,cAAa;AAAA,YACzD,gBAAAV,EAACW,MAAe,UAAA5C,GAAoB;AAAA,UAAA,EACtC,CAAA,IACE;AAAA,QAAA,GACN;AAAA,MAAA,GACF;AAAA,MAECF,MAAa,aACZ,gBAAAmC;AAAA,QAACY;AAAA,QAAA;AAAA,UACC,WAAApD;AAAA,UACA,WAAAC;AAAA,UACA,aAAAC;AAAA,UACA,aAAaC,KAAe;AAAA,UAC5B,YAAYC,KAAc;AAAA,UAC1B,cAAAM;AAAA,UACA,gBAAgB,EAAQd;AAAA,UACxB,kBAAkB,EAAQC;AAAA,UAC1B,gBAAAY;AAAA,UACA,QAAAD;AAAA,UACA,cAAAF;AAAA,QAAA;AAAA,MACF;AAAA,IAEJ,EAAA,CAAA,IAzHwB;AAAA,EA2H5B;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","Outc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EJ;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,IA5HoB;AAAA,EAgI5B;AACF;"}
|
@@ -17,7 +17,7 @@ const ee = {
|
|
17
17
|
duration: null,
|
18
18
|
chapters: null
|
19
19
|
}, te = G((D) => {
|
20
|
-
const { milestoneId: s, studentId:
|
20
|
+
const { milestoneId: s, studentId: f, testNumber: h, onTestAssign: v, onExit: L, onError: c } = D, [I, x] = _("CHAPTER_SELECTION"), [o, p] = _(ee), [d, A] = _([]), m = i((e) => {
|
21
21
|
x(e);
|
22
22
|
}, []), $ = i(
|
23
23
|
(e, t) => {
|
@@ -35,43 +35,41 @@ const ee = {
|
|
35
35
|
};
|
36
36
|
}), c(
|
37
37
|
"We're experiencing a temporary limitation with the chapters you've selected. Please select alternative chapters and proceed."
|
38
|
-
)), e ? c(e) : t &&
|
38
|
+
)), e ? c(e) : t && A(t);
|
39
39
|
},
|
40
|
-
[c,
|
40
|
+
[c, A, m]
|
41
41
|
), F = i(
|
42
42
|
(e) => {
|
43
43
|
e ? c(e) : v();
|
44
44
|
},
|
45
45
|
[c, v]
|
46
46
|
), {
|
47
|
-
get:
|
47
|
+
get: S,
|
48
48
|
data: H,
|
49
49
|
isProcessing: N,
|
50
50
|
isProcessingFailed: b,
|
51
51
|
error: g
|
52
52
|
} = B(s, {
|
53
|
-
with_plan: !0,
|
54
53
|
with_sheets: !0
|
55
|
-
}), { post:
|
54
|
+
}), { post: w, isProcessing: M } = Y({
|
56
55
|
onComplete: $
|
57
56
|
}), { post: E, isProcessing: R } = J({
|
58
57
|
onComplete: F
|
59
58
|
}), { user_milestone_plan: j } = H || {}, { user_chapters: a } = j || {}, y = i(
|
60
59
|
(e) => {
|
61
|
-
|
60
|
+
w(e);
|
62
61
|
},
|
63
|
-
[
|
62
|
+
[w]
|
64
63
|
), T = i(() => {
|
65
|
-
|
66
|
-
with_plan: !0,
|
64
|
+
S(s, {
|
67
65
|
with_sheets: !0
|
68
66
|
});
|
69
|
-
}, [
|
67
|
+
}, [S, s]), k = i(() => {
|
70
68
|
const { duration: e, difficultyLevel: t, selectedChapters: n } = o;
|
71
69
|
e && t && n && E(
|
72
70
|
{
|
73
71
|
items: d,
|
74
|
-
title: `Test ${
|
72
|
+
title: `Test ${h}`,
|
75
73
|
node_params: {
|
76
74
|
is_timed: !0,
|
77
75
|
sheet_time: e * 60,
|
@@ -79,11 +77,11 @@ const ee = {
|
|
79
77
|
}
|
80
78
|
},
|
81
79
|
{
|
82
|
-
studentId:
|
80
|
+
studentId: f,
|
83
81
|
userMilestoneId: s
|
84
82
|
}
|
85
83
|
);
|
86
|
-
}, [E, o,
|
84
|
+
}, [E, o, f, s, d, h]), P = i(
|
87
85
|
(e, t) => {
|
88
86
|
if (m(e), t) {
|
89
87
|
const { difficultyLevel: n, duration: r } = t;
|
@@ -113,17 +111,17 @@ const ee = {
|
|
113
111
|
onClick: T
|
114
112
|
}
|
115
113
|
)
|
116
|
-
] }) : a ?
|
114
|
+
] }) : a ? I === "PREVIEW" ? /* @__PURE__ */ l(
|
117
115
|
Z,
|
118
116
|
{
|
119
|
-
studentId:
|
117
|
+
studentId: f,
|
120
118
|
items: d,
|
121
|
-
testNumber:
|
119
|
+
testNumber: h,
|
122
120
|
isAssignInProgress: R,
|
123
121
|
onTestStageChange: P,
|
124
122
|
onTestSheetAssign: k
|
125
123
|
}
|
126
|
-
) :
|
124
|
+
) : I === "DIFFICULTY_AND_DURATION_SELECTION" ? /* @__PURE__ */ l(
|
127
125
|
Q,
|
128
126
|
{
|
129
127
|
testFormData: o,
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"tests-creation.js","sources":["../../../../../src/features/milestone/milestone-tests/tests-creation/tests-creation.tsx"],"sourcesContent":["import type { ITestHelpPreviewPayload, ITestHelpPreviewResponse } from './api/preview-test-sheet';\nimport type { ITestFromData, ITestsCreationProps, TTestsStage } from './tests-creation-types';\nimport type { FC } from 'react';\n\nimport { memo, useCallback, useEffect, useState } from 'react';\n\nimport Button from '../../../ui/buttons/button/button';\nimport FlexView from '../../../ui/layout/flex-view';\nimport AppLoader from '../../../ui/loader/app-loader/app-loader';\nimport Text from '../../../ui/text/text';\nimport { useMilestoneGet } from '../../edit/comps/edit-milestone-modal/api/get-milestone';\nimport { usePostTestHelpPreview } from './api/preview-test-sheet';\nimport { usePostTestSheetAssign } from './api/test-sheet-assign';\nimport ChapterSelection from './test-stages/chapter-selection/chapter-selection';\nimport DifficultyAndDurationSelection from './test-stages/difficulty-and-duration-selection/difficulty-and-duration-selection';\nimport TestPreview from './test-stages/test-preview/test-preview';\n\nconst initFormData: ITestFromData = {\n selectedChapters: null,\n difficultyLevel: null,\n title: null,\n duration: null,\n chapters: null,\n};\n\nconst TestsCreation: FC<ITestsCreationProps> = memo(props => {\n const { milestoneId, studentId, testNumber, onTestAssign, onExit, onError } = props;\n\n const [testStage, setTestStage] = useState<TTestsStage>('CHAPTER_SELECTION');\n const [testFormData, setTestFromData] = useState<ITestFromData>(initFormData);\n const [testPreviewItems, setTestPreviewItems] = useState<ITestHelpPreviewResponse[]>([]);\n\n const handleOnTestStageChange = useCallback((nextStage: TTestsStage) => {\n setTestStage(nextStage);\n }, []);\n\n const handleOnTestHelpPreviewComplete = useCallback(\n (errorMessage: string | null, data?: ITestHelpPreviewResponse[]) => {\n if (errorMessage || !data?.length) {\n handleOnTestStageChange('CHAPTER_SELECTION');\n\n setTestFromData(prev => {\n const { chapters, selectedChapters } = prev;\n\n const updatedChapters = chapters?.map(chapter => {\n if (selectedChapters?.includes(chapter.id)) {\n return {\n ...chapter,\n item_bank_enabled: false,\n };\n }\n\n return chapter;\n });\n\n return {\n ...prev,\n chapters: updatedChapters ?? null,\n selectedChapters: null,\n difficultyLevel: null,\n duration: null,\n };\n });\n\n onError(\n `We're experiencing a temporary limitation with the chapters you've selected. Please select alternative chapters and proceed.`,\n );\n }\n\n if (errorMessage) {\n onError(errorMessage);\n } else if (data) {\n setTestPreviewItems(data);\n }\n },\n [onError, setTestPreviewItems, handleOnTestStageChange],\n );\n\n const handleOnTestSheetAssignComplete = useCallback(\n (errorMessage: string | null) => {\n if (errorMessage) {\n onError(errorMessage);\n } else {\n onTestAssign();\n }\n },\n [onError, onTestAssign],\n );\n\n const {\n get: getMilestone,\n data: currentMilestoneData,\n isProcessing: isMilestoneProcessing,\n isProcessingFailed: isMilestoneProcessingFailed,\n error: milestoneGetError,\n } = useMilestoneGet(milestoneId, {\n with_plan: true,\n with_sheets: true,\n });\n\n const { post: postTestHelpPreview, isProcessing: testPreviewIsProcessing } =\n usePostTestHelpPreview({\n onComplete: handleOnTestHelpPreviewComplete,\n });\n\n const { post: postTestSheetAssign, isProcessing: testAssignIsProcessing } =\n usePostTestSheetAssign({\n onComplete: handleOnTestSheetAssignComplete,\n });\n\n const { user_milestone_plan: userMilestonePlan } = currentMilestoneData || {};\n const { user_chapters: userChapters } = userMilestonePlan || {};\n\n const handleOnPostTestHelpPreview = useCallback(\n (data: ITestHelpPreviewPayload) => {\n postTestHelpPreview(data);\n },\n [postTestHelpPreview],\n );\n\n const handleOnGetMilestone = useCallback(() => {\n getMilestone(milestoneId, {\n with_plan: true,\n with_sheets: true,\n });\n }, [getMilestone, milestoneId]);\n\n const handleOnTestSheetAssign = useCallback(() => {\n const { duration, difficultyLevel, selectedChapters } = testFormData;\n\n if (duration && difficultyLevel && selectedChapters) {\n postTestSheetAssign(\n {\n items: testPreviewItems,\n title: `Test ${testNumber}`,\n node_params: {\n is_timed: true,\n sheet_time: duration * 60,\n difficulty_level: difficultyLevel,\n },\n },\n {\n studentId,\n userMilestoneId: milestoneId,\n },\n );\n }\n }, [postTestSheetAssign, testFormData, studentId, milestoneId, testPreviewItems, testNumber]);\n\n const handleOnProceed = useCallback(\n (nextStage: TTestsStage, updatedForm?: ITestFromData) => {\n handleOnTestStageChange(nextStage);\n\n if (updatedForm) {\n const { difficultyLevel, duration } = updatedForm;\n\n setTestFromData(prev => ({ ...prev, ...updatedForm }));\n\n if (nextStage === 'PREVIEW' && difficultyLevel && duration) {\n handleOnPostTestHelpPreview({\n difficulty_level: difficultyLevel,\n duration: duration,\n user_chapter_ids: testFormData.selectedChapters || [],\n });\n }\n }\n },\n [handleOnTestStageChange, handleOnPostTestHelpPreview, testFormData],\n );\n\n useEffect(() => {\n if (milestoneId) {\n handleOnGetMilestone();\n }\n }, [milestoneId, handleOnGetMilestone]);\n\n useEffect(() => {\n if (userChapters && userChapters.length > 0) {\n setTestFromData(prev => ({ ...prev, chapters: userChapters }));\n }\n }, [userChapters]);\n\n if (isMilestoneProcessing || testPreviewIsProcessing) {\n return <AppLoader height=\"100vh\" />;\n }\n\n if (isMilestoneProcessingFailed) {\n return (\n <FlexView $height=\"100vh\" $flexGapX={1.5} $alignItems=\"center\" $justifyContent=\"center\">\n <Text $renderAs=\"h6\">{milestoneGetError?.message || 'Oops! Something went wrong.'}</Text>\n <Button\n widthX={14}\n size=\"small\"\n shape=\"square\"\n renderAs=\"primary\"\n label=\"Try again\"\n onClick={handleOnGetMilestone}\n />\n </FlexView>\n );\n }\n\n if (!userChapters) return null;\n\n if (testStage === 'PREVIEW') {\n return (\n <TestPreview\n studentId={studentId}\n items={testPreviewItems}\n testNumber={testNumber}\n isAssignInProgress={testAssignIsProcessing}\n onTestStageChange={handleOnProceed}\n onTestSheetAssign={handleOnTestSheetAssign}\n />\n );\n }\n\n if (testStage === 'DIFFICULTY_AND_DURATION_SELECTION') {\n return (\n <DifficultyAndDurationSelection\n testFormData={testFormData}\n onTestStageChange={handleOnProceed}\n />\n );\n }\n\n return (\n <ChapterSelection testFormData={testFormData} onProceed={handleOnProceed} onExit={onExit} />\n );\n});\n\nexport default TestsCreation;\n"],"names":["initFormData","TestsCreation","memo","props","milestoneId","studentId","testNumber","onTestAssign","onExit","onError","testStage","setTestStage","useState","testFormData","setTestFromData","testPreviewItems","setTestPreviewItems","handleOnTestStageChange","useCallback","nextStage","handleOnTestHelpPreviewComplete","errorMessage","data","prev","chapters","selectedChapters","updatedChapters","chapter","handleOnTestSheetAssignComplete","getMilestone","currentMilestoneData","isMilestoneProcessing","isMilestoneProcessingFailed","milestoneGetError","useMilestoneGet","postTestHelpPreview","testPreviewIsProcessing","usePostTestHelpPreview","postTestSheetAssign","testAssignIsProcessing","usePostTestSheetAssign","userMilestonePlan","userChapters","handleOnPostTestHelpPreview","handleOnGetMilestone","handleOnTestSheetAssign","duration","difficultyLevel","handleOnProceed","updatedForm","useEffect","jsx","AppLoader","jsxs","FlexView","Text","Button","TestPreview","DifficultyAndDurationSelection","ChapterSelection","TestsCreation$1"],"mappings":";;;;;;;;;;;;AAiBA,MAAMA,KAA8B;AAAA,EAClC,kBAAkB;AAAA,EAClB,iBAAiB;AAAA,EACjB,OAAO;AAAA,EACP,UAAU;AAAA,EACV,UAAU;AACZ,GAEMC,KAAyCC,EAAK,CAASC,MAAA;AAC3D,QAAM,EAAE,aAAAC,GAAa,WAAAC,GAAW,YAAAC,GAAY,cAAAC,GAAc,QAAAC,GAAQ,SAAAC,EAAY,IAAAN,GAExE,CAACO,GAAWC,CAAY,IAAIC,EAAsB,mBAAm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AAWmC,GAAiB,QAAAxC,EAAgB,CAAA,IAzBlE;AA2B5B,CAAC,GAEDoD,KAAe3D;"}
|
1
|
+
{"version":3,"file":"tests-creation.js","sources":["../../../../../src/features/milestone/milestone-tests/tests-creation/tests-creation.tsx"],"sourcesContent":["import type { ITestHelpPreviewPayload, ITestHelpPreviewResponse } from './api/preview-test-sheet';\nimport type { ITestFromData, ITestsCreationProps, TTestsStage } from './tests-creation-types';\nimport type { FC } from 'react';\n\nimport { memo, useCallback, useEffect, useState } from 'react';\n\nimport Button from '../../../ui/buttons/button/button';\nimport FlexView from '../../../ui/layout/flex-view';\nimport AppLoader from '../../../ui/loader/app-loader/app-loader';\nimport Text from '../../../ui/text/text';\nimport { useMilestoneGet } from '../../edit/comps/edit-milestone-modal/api/get-milestone';\nimport { usePostTestHelpPreview } from './api/preview-test-sheet';\nimport { usePostTestSheetAssign } from './api/test-sheet-assign';\nimport ChapterSelection from './test-stages/chapter-selection/chapter-selection';\nimport DifficultyAndDurationSelection from './test-stages/difficulty-and-duration-selection/difficulty-and-duration-selection';\nimport TestPreview from './test-stages/test-preview/test-preview';\n\nconst initFormData: ITestFromData = {\n selectedChapters: null,\n difficultyLevel: null,\n title: null,\n duration: null,\n chapters: null,\n};\n\nconst TestsCreation: FC<ITestsCreationProps> = memo(props => {\n const { milestoneId, studentId, testNumber, onTestAssign, onExit, onError } = props;\n\n const [testStage, setTestStage] = useState<TTestsStage>('CHAPTER_SELECTION');\n const [testFormData, setTestFromData] = useState<ITestFromData>(initFormData);\n const [testPreviewItems, setTestPreviewItems] = useState<ITestHelpPreviewResponse[]>([]);\n\n const handleOnTestStageChange = useCallback((nextStage: TTestsStage) => {\n setTestStage(nextStage);\n }, []);\n\n const handleOnTestHelpPreviewComplete = useCallback(\n (errorMessage: string | null, data?: ITestHelpPreviewResponse[]) => {\n if (errorMessage || !data?.length) {\n handleOnTestStageChange('CHAPTER_SELECTION');\n\n setTestFromData(prev => {\n const { chapters, selectedChapters } = prev;\n\n const updatedChapters = chapters?.map(chapter => {\n if (selectedChapters?.includes(chapter.id)) {\n return {\n ...chapter,\n item_bank_enabled: false,\n };\n }\n\n return chapter;\n });\n\n return {\n ...prev,\n chapters: updatedChapters ?? null,\n selectedChapters: null,\n difficultyLevel: null,\n duration: null,\n };\n });\n\n onError(\n `We're experiencing a temporary limitation with the chapters you've selected. Please select alternative chapters and proceed.`,\n );\n }\n\n if (errorMessage) {\n onError(errorMessage);\n } else if (data) {\n setTestPreviewItems(data);\n }\n },\n [onError, setTestPreviewItems, handleOnTestStageChange],\n );\n\n const handleOnTestSheetAssignComplete = useCallback(\n (errorMessage: string | null) => {\n if (errorMessage) {\n onError(errorMessage);\n } else {\n onTestAssign();\n }\n },\n [onError, onTestAssign],\n );\n\n const {\n get: getMilestone,\n data: currentMilestoneData,\n isProcessing: isMilestoneProcessing,\n isProcessingFailed: isMilestoneProcessingFailed,\n error: milestoneGetError,\n } = useMilestoneGet(milestoneId, {\n with_sheets: true,\n });\n\n const { post: postTestHelpPreview, isProcessing: testPreviewIsProcessing } =\n usePostTestHelpPreview({\n onComplete: handleOnTestHelpPreviewComplete,\n });\n\n const { post: postTestSheetAssign, isProcessing: testAssignIsProcessing } =\n usePostTestSheetAssign({\n onComplete: handleOnTestSheetAssignComplete,\n });\n\n const { user_milestone_plan: userMilestonePlan } = currentMilestoneData || {};\n const { user_chapters: userChapters } = userMilestonePlan || {};\n\n const handleOnPostTestHelpPreview = useCallback(\n (data: ITestHelpPreviewPayload) => {\n postTestHelpPreview(data);\n },\n [postTestHelpPreview],\n );\n\n const handleOnGetMilestone = useCallback(() => {\n getMilestone(milestoneId, {\n with_sheets: true,\n });\n }, [getMilestone, milestoneId]);\n\n const handleOnTestSheetAssign = useCallback(() => {\n const { duration, difficultyLevel, selectedChapters } = testFormData;\n\n if (duration && difficultyLevel && selectedChapters) {\n postTestSheetAssign(\n {\n items: testPreviewItems,\n title: `Test ${testNumber}`,\n node_params: {\n is_timed: true,\n sheet_time: duration * 60,\n difficulty_level: difficultyLevel,\n },\n },\n {\n studentId,\n userMilestoneId: milestoneId,\n },\n );\n }\n }, [postTestSheetAssign, testFormData, studentId, milestoneId, testPreviewItems, testNumber]);\n\n const handleOnProceed = useCallback(\n (nextStage: TTestsStage, updatedForm?: ITestFromData) => {\n handleOnTestStageChange(nextStage);\n\n if (updatedForm) {\n const { difficultyLevel, duration } = updatedForm;\n\n setTestFromData(prev => ({ ...prev, ...updatedForm }));\n\n if (nextStage === 'PREVIEW' && difficultyLevel && duration) {\n handleOnPostTestHelpPreview({\n difficulty_level: difficultyLevel,\n duration: duration,\n user_chapter_ids: testFormData.selectedChapters || [],\n });\n }\n }\n },\n [handleOnTestStageChange, handleOnPostTestHelpPreview, testFormData],\n );\n\n useEffect(() => {\n if (milestoneId) {\n handleOnGetMilestone();\n }\n }, [milestoneId, handleOnGetMilestone]);\n\n useEffect(() => {\n if (userChapters && userChapters.length > 0) {\n setTestFromData(prev => ({ ...prev, chapters: userChapters }));\n }\n }, [userChapters]);\n\n if (isMilestoneProcessing || testPreviewIsProcessing) {\n return <AppLoader height=\"100vh\" />;\n }\n\n if (isMilestoneProcessingFailed) {\n return (\n <FlexView $height=\"100vh\" $flexGapX={1.5} $alignItems=\"center\" $justifyContent=\"center\">\n <Text $renderAs=\"h6\">{milestoneGetError?.message || 'Oops! Something went wrong.'}</Text>\n <Button\n widthX={14}\n size=\"small\"\n shape=\"square\"\n renderAs=\"primary\"\n label=\"Try again\"\n onClick={handleOnGetMilestone}\n />\n </FlexView>\n );\n }\n\n if (!userChapters) return null;\n\n if (testStage === 'PREVIEW') {\n return (\n <TestPreview\n studentId={studentId}\n items={testPreviewItems}\n testNumber={testNumber}\n isAssignInProgress={testAssignIsProcessing}\n onTestStageChange={handleOnProceed}\n onTestSheetAssign={handleOnTestSheetAssign}\n />\n );\n }\n\n if (testStage === 'DIFFICULTY_AND_DURATION_SELECTION') {\n return (\n <DifficultyAndDurationSelection\n testFormData={testFormData}\n onTestStageChange={handleOnProceed}\n />\n );\n }\n\n return (\n <ChapterSelection testFormData={testFormData} onProceed={handleOnProceed} onExit={onExit} />\n );\n});\n\nexport default TestsCreation;\n"],"names":["initFormData","TestsCreation","memo","props","milestoneId","studentId","testNumber","onTestAssign","onExit","onError","testStage","setTestStage","useState","testFormData","setTestFromData","testPreviewItems","setTestPreviewItems","handleOnTestStageChange","useCallback","nextStage","handleOnTestHelpPreviewComplete","errorMessage","data","prev","chapters","selectedChapters","updatedChapters","chapter","handleOnTestSheetAssignComplete","getMilestone","currentMilestoneData","isMilestoneProcessing","isMilestoneProcessingFailed","milestoneGetError","useMilestoneGet","postTestHelpPreview","testPreviewIsProcessing","usePostTestHelpPreview","postTestSheetAssign","testAssignIsProcessing","usePostTestSheetAssign","userMilestonePlan","userChapters","handleOnPostTestHelpPreview","handleOnGetMilestone","handleOnTestSheetAssign","duration","difficultyLevel","handleOnProceed","updatedForm","useEffect","jsx","AppLoader","jsxs","FlexView","Text","Button","TestPreview","DifficultyAndDurationSelection","ChapterSelection","TestsCreation$1"],"mappings":";;;;;;;;;;;;AAiBA,MAAMA,KAA8B;AAAA,EAClC,kBAAkB;AAAA,EAClB,iBAAiB;AAAA,EACjB,OAAO;AAAA,EACP,UAAU;AAAA,EACV,UAAU;AACZ,GAEMC,KAAyCC,EAAK,CAASC,MAAA;AAC3D,QAAM,EAAE,aAAAC,GAAa,WAAAC,GAAW,YAAAC,GAAY,cAAAC,GAAc,QAAAC,GAAQ,SAAAC,EAAY,IAAAN,GAExE,CAACO,GAAWC,CAAY,IAAIC,EAAsB,mBAAmB,GACrE,CAACC,GAAcC,CAAe,IAAIF,EAAwBZ,EAAY,GACtE,CAACe,GAAkBC,CAAmB,IAAIJ,EAAqC,CAAE,CAAA,GAEjFK,IAA0BC,EAAY,CAACC,MAA2B;AACtE,IAAAR,EAAaQ,CAAS;AAAA,EACxB,GAAG,CAAE,CAAA,GAECC,IAAkCF;AAAA,IACtC,CAACG,GAA6BC,MAAsC;AAC9D,OA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Aa,SAAS,KACxC5B,EAAgB,QAAS,EAAE,GAAGS,GAAM,UAAUmB,EAAe,EAAA;AAAA,EAC/D,GACC,CAACA,CAAY,CAAC,GAEbX,KAAyBK,IACpB,gBAAAe,EAACC,GAAU,EAAA,QAAO,QAAQ,CAAA,IAG/BpB,IAEA,gBAAAqB,EAACC,KAAS,SAAQ,SAAQ,WAAW,KAAK,aAAY,UAAS,iBAAgB,UAC7E,UAAA;AAAA,IAAA,gBAAAH,EAACI,GAAK,EAAA,WAAU,MAAM,WAAAtB,KAAA,gBAAAA,EAAmB,YAAW,+BAA8B;AAAA,IAClF,gBAAAkB;AAAA,MAACK;AAAA,MAAA;AAAA,QACC,QAAQ;AAAA,QACR,MAAK;AAAA,QACL,OAAM;AAAA,QACN,UAAS;AAAA,QACT,OAAM;AAAA,QACN,SAASZ;AAAA,MAAA;AAAA,IACX;AAAA,EACF,EAAA,CAAA,IAICF,IAEDhC,MAAc,YAEd,gBAAAyC;AAAA,IAACM;AAAA,IAAA;AAAA,MACC,WAAApD;AAAA,MACA,OAAOU;AAAA,MACP,YAAAT;AAAA,MACA,oBAAoBiC;AAAA,MACpB,mBAAmBS;AAAA,MACnB,mBAAmBH;AAAA,IAAA;AAAA,EAAA,IAKrBnC,MAAc,sCAEd,gBAAAyC;AAAA,IAACO;AAAA,IAAA;AAAA,MACC,cAAA7C;AAAA,MACA,mBAAmBmC;AAAA,IAAA;AAAA,EAAA,IAMtB,gBAAAG,EAAAQ,GAAA,EAAiB,cAAA9C,GAA4B,WAAWmC,GAAiB,QAAAxC,EAAgB,CAAA,IAzBlE;AA2B5B,CAAC,GAEDoD,KAAe3D;"}
|
@@ -1,37 +1,52 @@
|
|
1
|
-
import { jsx as
|
2
|
-
import
|
3
|
-
import { memo as
|
4
|
-
import
|
5
|
-
import { fetchLottie as
|
6
|
-
const
|
7
|
-
const {
|
8
|
-
|
9
|
-
|
1
|
+
import { jsx as L } from "react/jsx-runtime";
|
2
|
+
import w from "lottie-web";
|
3
|
+
import { memo as y, forwardRef as b, useRef as c, useImperativeHandle as A, useEffect as E } from "react";
|
4
|
+
import I from "../layout/flex-view.js";
|
5
|
+
import { fetchLottie as $ } from "./helper.js";
|
6
|
+
const x = b((p, h) => {
|
7
|
+
const {
|
8
|
+
src: s,
|
9
|
+
width: v = "100%",
|
10
|
+
height: g = "100%",
|
11
|
+
settings: u,
|
12
|
+
eventListener: r,
|
13
|
+
onRender: i,
|
14
|
+
animateOnIntersect: o
|
15
|
+
} = p, n = c(null), t = c(null), a = c(null);
|
16
|
+
return A(
|
17
|
+
h,
|
10
18
|
() => ({
|
11
|
-
playSegments: (
|
12
|
-
|
19
|
+
playSegments: (m, e) => {
|
20
|
+
t.current && t.current.playSegments(m, e);
|
13
21
|
}
|
14
22
|
}),
|
15
23
|
[]
|
16
|
-
),
|
24
|
+
), E(() => ((async () => {
|
17
25
|
try {
|
18
|
-
const
|
19
|
-
|
20
|
-
container:
|
21
|
-
animationData:
|
26
|
+
const e = await $(s);
|
27
|
+
n.current && (t.current = w.loadAnimation({
|
28
|
+
container: n.current,
|
29
|
+
animationData: e,
|
22
30
|
renderer: "svg",
|
23
31
|
loop: !0,
|
24
32
|
autoplay: !0,
|
25
|
-
...
|
26
|
-
}),
|
27
|
-
|
28
|
-
|
33
|
+
...u
|
34
|
+
}), o && (a.current = new IntersectionObserver(
|
35
|
+
([l]) => {
|
36
|
+
var f, d;
|
37
|
+
l && l.isIntersecting ? (f = t.current) == null || f.play() : (d = t.current) == null || d.pause();
|
38
|
+
},
|
39
|
+
{ threshold: 0 }
|
40
|
+
), n.current && a.current.observe(n.current)), i == null || i(), r && t.current.addEventListener(r.name, r.callback));
|
41
|
+
} catch (e) {
|
42
|
+
throw Error(`Error loading Lottie animation: ${e}`);
|
29
43
|
}
|
30
44
|
})(), () => {
|
31
|
-
|
32
|
-
|
33
|
-
}), I
|
45
|
+
var e;
|
46
|
+
t.current && (r && t.current.removeEventListener(r.name, r.callback), o && ((e = a.current) == null || e.disconnect()), t.current.destroy());
|
47
|
+
}), [s, r, i, o, u]), /* @__PURE__ */ L(I, { ref: n, $width: v, $height: g });
|
48
|
+
}), F = y(x);
|
34
49
|
export {
|
35
|
-
|
50
|
+
F as default
|
36
51
|
};
|
37
52
|
//# sourceMappingURL=lottie-animation.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"lottie-animation.js","sources":["../../../../src/features/ui/lottie-animation/lottie-animation.tsx"],"sourcesContent":["import type { ILottieAnimationProps, ILottieAnimationRef } from './types';\nimport type { AnimationItem, AnimationSegment } from 'lottie-web';\n\nimport lottie from 'lottie-web';\nimport { forwardRef, memo, useEffect, useImperativeHandle, useRef } from 'react';\n\nimport FlexView from '../layout/flex-view';\nimport { fetchLottie } from './helper';\n\nconst LottieAnimation = forwardRef<ILottieAnimationRef, ILottieAnimationProps>((props, ref) => {\n const {
|
1
|
+
{"version":3,"file":"lottie-animation.js","sources":["../../../../src/features/ui/lottie-animation/lottie-animation.tsx"],"sourcesContent":["import type { ILottieAnimationProps, ILottieAnimationRef } from './types';\nimport type { AnimationItem, AnimationSegment } from 'lottie-web';\n\nimport lottie from 'lottie-web';\nimport { forwardRef, memo, useEffect, useImperativeHandle, useRef } from 'react';\n\nimport FlexView from '../layout/flex-view';\nimport { fetchLottie } from './helper';\n\nconst LottieAnimation = forwardRef<ILottieAnimationRef, ILottieAnimationProps>((props, ref) => {\n const {\n src,\n width = '100%',\n height = '100%',\n settings,\n eventListener,\n onRender,\n animateOnIntersect,\n } = props;\n\n const container = useRef<HTMLDivElement>(null);\n const animationInstance = useRef<AnimationItem | null>(null);\n const intersectionObserver = useRef<IntersectionObserver | null>(null);\n\n useImperativeHandle(\n ref,\n () => ({\n playSegments: (segments: AnimationSegment, forceFlag?: boolean) => {\n if (animationInstance.current) {\n animationInstance.current.playSegments(segments, forceFlag);\n }\n },\n }),\n [],\n );\n\n useEffect(() => {\n const loadAnimation = async () => {\n try {\n const animationData = await fetchLottie(src);\n\n if (container.current) {\n animationInstance.current = lottie.loadAnimation({\n container: container.current,\n animationData,\n renderer: 'svg',\n loop: true,\n autoplay: true,\n ...settings,\n });\n\n if (animateOnIntersect) {\n intersectionObserver.current = new IntersectionObserver(\n ([entry]) => {\n if (entry && entry.isIntersecting) {\n animationInstance.current?.play();\n } else {\n animationInstance.current?.pause();\n }\n },\n { threshold: 0 },\n );\n\n if (container.current) {\n intersectionObserver.current.observe(container.current);\n }\n }\n\n onRender?.();\n if (eventListener) {\n animationInstance.current.addEventListener(eventListener.name, eventListener.callback);\n }\n }\n } catch (error) {\n throw Error(`Error loading Lottie animation: ${error}`);\n }\n };\n\n loadAnimation();\n\n return () => {\n if (animationInstance.current) {\n if (eventListener) {\n animationInstance.current.removeEventListener(eventListener.name, eventListener.callback);\n }\n\n if (animateOnIntersect) {\n intersectionObserver.current?.disconnect();\n }\n animationInstance.current.destroy();\n }\n };\n }, [src, eventListener, onRender, animateOnIntersect, settings]);\n\n return <FlexView ref={container} $width={width} $height={height} />;\n});\n\nexport default memo(LottieAnimation);\n"],"names":["LottieAnimation","forwardRef","props","ref","src","width","height","settings","eventListener","onRender","animateOnIntersect","container","useRef","animationInstance","intersectionObserver","useImperativeHandle","segments","forceFlag","useEffect","animationData","fetchLottie","lottie","entry","_a","_b","error","FlexView","LottieAnimation$1","memo"],"mappings":";;;;;AASA,MAAMA,IAAkBC,EAAuD,CAACC,GAAOC,MAAQ;AACvF,QAAA;AAAA,IACJ,KAAAC;AAAA,IACA,OAAAC,IAAQ;AAAA,IACR,QAAAC,IAAS;AAAA,IACT,UAAAC;AAAA,IACA,eAAAC;AAAA,IACA,UAAAC;AAAA,IACA,oBAAAC;AAAA,EACE,IAAAR,GAEES,IAAYC,EAAuB,IAAI,GACvCC,IAAoBD,EAA6B,IAAI,GACrDE,IAAuBF,EAAoC,IAAI;AAErE,SAAAG;AAAA,IACEZ;AAAA,IACA,OAAO;AAAA,MACL,cAAc,CAACa,GAA4BC,MAAwB;AACjE,QAAIJ,EAAkB,W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: {
|
83
83
|
backgroundColorName: {
|
84
|
-
inactive: "
|
85
|
-
active: "
|
84
|
+
inactive: "RED",
|
85
|
+
active: "BLACK",
|
86
86
|
disabled: "GREY_3"
|
87
87
|
},
|
88
88
|
colorName: {
|
89
|
-
inactive: "
|
89
|
+
inactive: "WHITE",
|
90
90
|
active: "WHITE",
|
91
91
|
disabled: "BLACK"
|
92
92
|
},
|
93
93
|
borderColorName: {
|
94
|
-
inactive: "
|
95
|
-
active: "
|
94
|
+
inactive: "BLACK",
|
95
|
+
active: "BLACK",
|
96
96
|
disabled: "GREY_3"
|
97
97
|
}
|
98
98
|
},
|