@cuemath/leap 3.5.50 → 3.5.51-as10
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/illustrations/illustrations.js +4 -0
- package/dist/assets/illustrations/illustrations.js.map +1 -1
- package/dist/features/chapters-v2/comps/node-card/node-card-styled.js +27 -31
- package/dist/features/chapters-v2/comps/node-card/node-card-styled.js.map +1 -1
- package/dist/features/chapters-v2/comps/node-card/node-card-tags.js +21 -13
- package/dist/features/chapters-v2/comps/node-card/node-card-tags.js.map +1 -1
- package/dist/features/chapters-v2/constants/node-constants.js +1 -1
- package/dist/features/chapters-v2/constants/node-constants.js.map +1 -1
- package/dist/features/chapters-v2/utils/node-card-utils.js +86 -79
- package/dist/features/chapters-v2/utils/node-card-utils.js.map +1 -1
- package/dist/features/homework/homework-card-view.js +125 -98
- package/dist/features/homework/homework-card-view.js.map +1 -1
- package/dist/features/homework/homework-card.js +196 -161
- 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-types.js +5 -0
- package/dist/features/homework/hw-card-list/hw-card-list-types.js.map +1 -0
- package/dist/features/homework/hw-card-list/hw-card-list-view.js +96 -86
- package/dist/features/homework/hw-card-list/hw-card-list-view.js.map +1 -1
- package/dist/features/homework/hw-card-list/hw-card-list.js +45 -43
- package/dist/features/homework/hw-card-list/hw-card-list.js.map +1 -1
- package/dist/features/homework/styles.js +0 -1
- package/dist/features/homework/styles.js.map +1 -1
- package/dist/features/homework/utils.js +18 -15
- package/dist/features/homework/utils.js.map +1 -1
- package/dist/features/journey/hooks/use-home-page-journey/home-page-homeworks-mock.js +325 -201
- package/dist/features/journey/hooks/use-home-page-journey/home-page-homeworks-mock.js.map +1 -1
- package/dist/features/journey/hooks/use-home-page-journey/use-home-page-journey.js +59 -56
- package/dist/features/journey/hooks/use-home-page-journey/use-home-page-journey.js.map +1 -1
- package/dist/features/journey/hooks/use-puzzles-journey/use-puzzle-assigned.js +17 -15
- package/dist/features/journey/hooks/use-puzzles-journey/use-puzzle-assigned.js.map +1 -1
- package/dist/features/math-fit/api/get-mathfit-assessment.js +10 -0
- package/dist/features/math-fit/api/get-mathfit-assessment.js.map +1 -0
- package/dist/features/math-fit/math-fit/math-fit.js +37 -0
- package/dist/features/math-fit/math-fit/math-fit.js.map +1 -0
- package/dist/features/math-fit/math-fit-card/math-fit-card-styled.js +22 -0
- package/dist/features/math-fit/math-fit-card/math-fit-card-styled.js.map +1 -0
- package/dist/features/math-fit/math-fit-card/math-fit-card.js +80 -0
- package/dist/features/math-fit/math-fit-card/math-fit-card.js.map +1 -0
- package/dist/features/math-fit/math-fit-overview/comps/section-card/section-card-styled.js +24 -0
- package/dist/features/math-fit/math-fit-overview/comps/section-card/section-card-styled.js.map +1 -0
- package/dist/features/math-fit/math-fit-overview/comps/section-card/section-card-types.js +5 -0
- package/dist/features/math-fit/math-fit-overview/comps/section-card/section-card-types.js.map +1 -0
- package/dist/features/math-fit/math-fit-overview/comps/section-card/section-card.js +99 -0
- package/dist/features/math-fit/math-fit-overview/comps/section-card/section-card.js.map +1 -0
- package/dist/features/math-fit/math-fit-overview/comps/stat-item/stat-item-styled.js +9 -0
- package/dist/features/math-fit/math-fit-overview/comps/stat-item/stat-item-styled.js.map +1 -0
- package/dist/features/math-fit/math-fit-overview/comps/stat-item/stat-item.js +26 -0
- package/dist/features/math-fit/math-fit-overview/comps/stat-item/stat-item.js.map +1 -0
- package/dist/features/math-fit/math-fit-overview/math-fit-overview-helpers.js +63 -0
- package/dist/features/math-fit/math-fit-overview/math-fit-overview-helpers.js.map +1 -0
- package/dist/features/math-fit/math-fit-overview/math-fit-overview-styled.js +9 -0
- package/dist/features/math-fit/math-fit-overview/math-fit-overview-styled.js.map +1 -0
- package/dist/features/math-fit/math-fit-overview/math-fit-overview-types.js +7 -0
- package/dist/features/math-fit/math-fit-overview/math-fit-overview-types.js.map +1 -0
- package/dist/features/math-fit/math-fit-overview/math-fit-overview.js +71 -0
- package/dist/features/math-fit/math-fit-overview/math-fit-overview.js.map +1 -0
- package/dist/features/math-fit/math-fit-report/comps/report-header/report-header-styled.js +38 -0
- package/dist/features/math-fit/math-fit-report/comps/report-header/report-header-styled.js.map +1 -0
- package/dist/features/math-fit/math-fit-report/comps/report-header/report-header.js +58 -0
- package/dist/features/math-fit/math-fit-report/comps/report-header/report-header.js.map +1 -0
- package/dist/features/math-fit/math-fit-report/comps/score-badge/score-badge-styled.js +28 -0
- package/dist/features/math-fit/math-fit-report/comps/score-badge/score-badge-styled.js.map +1 -0
- package/dist/features/math-fit/math-fit-report/comps/score-badge/score-badge.js +30 -0
- package/dist/features/math-fit/math-fit-report/comps/score-badge/score-badge.js.map +1 -0
- package/dist/features/math-fit/math-fit-report/comps/score-section/score-section-styled.js +9 -0
- package/dist/features/math-fit/math-fit-report/comps/score-section/score-section-styled.js.map +1 -0
- package/dist/features/math-fit/math-fit-report/comps/score-section/score-section.js +82 -0
- package/dist/features/math-fit/math-fit-report/comps/score-section/score-section.js.map +1 -0
- package/dist/features/math-fit/math-fit-report/math-fit-report-helpers.js +42 -0
- package/dist/features/math-fit/math-fit-report/math-fit-report-helpers.js.map +1 -0
- package/dist/features/math-fit/math-fit-report/math-fit-report.js +68 -0
- package/dist/features/math-fit/math-fit-report/math-fit-report.js.map +1 -0
- package/dist/features/milestone/milestone-list-container/api/get-tests-list.js +1 -1
- package/dist/features/milestone/milestone-list-container/api/get-tests-list.js.map +1 -1
- package/dist/features/milestone/milestone-list-container/milestone-list/milestone-list.js +38 -36
- 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/milestone-tabs/milestone-tabs.js +57 -55
- package/dist/features/milestone/milestone-list-container/milestone-list/milestone-widget/milestone-tabs/milestone-tabs.js.map +1 -1
- package/dist/features/milestone/milestone-list-container/milestone-list/milestone-widget/milestone-widget.js +59 -57
- package/dist/features/milestone/milestone-list-container/milestone-list/milestone-widget/milestone-widget.js.map +1 -1
- package/dist/features/milestone/milestone-list-container/milestone-list-container.js +54 -52
- package/dist/features/milestone/milestone-list-container/milestone-list-container.js.map +1 -1
- package/dist/features/milestone/milestone-tests/test-list-v2/test-list-container.js +39 -37
- package/dist/features/milestone/milestone-tests/test-list-v2/test-list-container.js.map +1 -1
- package/dist/features/milestone/milestone-tests/test-list-v2/test-list-view.js +48 -56
- 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 +27 -23
- package/dist/features/sheet-v2/resource-list/resource-list.js.map +1 -1
- package/dist/index.d.ts +132 -7
- package/dist/index.js +131 -121
- package/dist/index.js.map +1 -1
- package/dist/static/clock-green.020570d3.svg +1 -0
- package/dist/static/math-fit-bg.4bfa3244.svg +1 -0
- package/dist/static/math-fit-card-bg.20c826bb.svg +1 -0
- package/dist/static/question-mark-blue.b6a7f37d.svg +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { jsxs as t, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { memo as x, useCallback as I, Fragment as A } from "react";
|
|
3
|
+
import S from "../../../../ui/buttons/button/button.js";
|
|
4
|
+
import r from "../../../../ui/layout/flex-view.js";
|
|
5
|
+
import n from "../../../../ui/text/text.js";
|
|
6
|
+
import w from "../score-badge/score-badge.js";
|
|
7
|
+
import { Divider as B } from "./score-section-styled.js";
|
|
8
|
+
import f from "../../../../ui/separator/separator.js";
|
|
9
|
+
import { getQuestionStatusBgColor as _ } from "../../math-fit-report-helpers.js";
|
|
10
|
+
import { EQuestionState as h } from "../../../math-fit-overview/math-fit-overview-types.js";
|
|
11
|
+
const F = x(function({
|
|
12
|
+
section: l,
|
|
13
|
+
sheet: m,
|
|
14
|
+
onReviewSection: c
|
|
15
|
+
}) {
|
|
16
|
+
const {
|
|
17
|
+
title: p,
|
|
18
|
+
score: s,
|
|
19
|
+
scoreChange: g,
|
|
20
|
+
sessionId: d,
|
|
21
|
+
isIncomplete: o = !1,
|
|
22
|
+
sectionNumber: b,
|
|
23
|
+
topics: $
|
|
24
|
+
} = l, u = I(() => {
|
|
25
|
+
!o && l.sheet && c && c(m, d);
|
|
26
|
+
}, [o, c, l.sheet, m, d]);
|
|
27
|
+
return /* @__PURE__ */ t(r, { children: [
|
|
28
|
+
/* @__PURE__ */ t(r, { $flexDirection: "row", $alignItems: "center", children: [
|
|
29
|
+
/* @__PURE__ */ t(n, { $renderAs: "ab2-bold", $color: "BLACK_1", children: [
|
|
30
|
+
p,
|
|
31
|
+
":"
|
|
32
|
+
] }),
|
|
33
|
+
/* @__PURE__ */ e(f, { width: 4 }),
|
|
34
|
+
o ? /* @__PURE__ */ e(r, { $gutter: 3, $gap: 2.5, $background: "BLACK_5", children: /* @__PURE__ */ e(n, { $renderAs: "ab4-bold", $color: "WHITE", children: "INCOMPLETE" }) }) : s && /* @__PURE__ */ e(w, { score: s, maxScore: 10, scoreChange: g })
|
|
35
|
+
] }),
|
|
36
|
+
/* @__PURE__ */ e(r, { $flexRowGapX: 0.5, $gapX: 0.75, children: $.map((a, C) => /* @__PURE__ */ t(A, { children: [
|
|
37
|
+
/* @__PURE__ */ t(r, { $flexDirection: "row", $justifyContent: "space-between", $alignItems: "center", children: [
|
|
38
|
+
/* @__PURE__ */ e(n, { $renderAs: "ub2", $color: o ? "BLACK_T_38" : "BLACK_1", children: a.name }),
|
|
39
|
+
/* @__PURE__ */ e(r, { $flexGapX: 0.5, $flexDirection: "row", children: a.miniGoal.items.map((i) => /* @__PURE__ */ e(
|
|
40
|
+
r,
|
|
41
|
+
{
|
|
42
|
+
$widthX: 1.25,
|
|
43
|
+
$heightX: 1.25,
|
|
44
|
+
$alignItems: "center",
|
|
45
|
+
$justifyContent: "center",
|
|
46
|
+
$borderRadiusX: 2,
|
|
47
|
+
$background: _(
|
|
48
|
+
o ? h.SKIPPED : i.state
|
|
49
|
+
),
|
|
50
|
+
children: /* @__PURE__ */ e(
|
|
51
|
+
n,
|
|
52
|
+
{
|
|
53
|
+
$renderAs: "ub3",
|
|
54
|
+
$color: i.state === h.SKIPPED ? "BLACK_T_38" : "WHITE",
|
|
55
|
+
children: i.order
|
|
56
|
+
}
|
|
57
|
+
)
|
|
58
|
+
},
|
|
59
|
+
i.item_reference
|
|
60
|
+
)) })
|
|
61
|
+
] }),
|
|
62
|
+
C !== $.length - 1 && /* @__PURE__ */ e(B, {})
|
|
63
|
+
] }, a.name)) }),
|
|
64
|
+
/* @__PURE__ */ t(r, { $alignItems: "center", children: [
|
|
65
|
+
/* @__PURE__ */ e(f, { heightX: 0.75 }),
|
|
66
|
+
/* @__PURE__ */ e(
|
|
67
|
+
S,
|
|
68
|
+
{
|
|
69
|
+
label: `Review Section ${b}`,
|
|
70
|
+
renderAs: o ? "secondary" : "primary",
|
|
71
|
+
size: "small",
|
|
72
|
+
onClick: u,
|
|
73
|
+
disabled: o
|
|
74
|
+
}
|
|
75
|
+
)
|
|
76
|
+
] })
|
|
77
|
+
] });
|
|
78
|
+
});
|
|
79
|
+
export {
|
|
80
|
+
F as default
|
|
81
|
+
};
|
|
82
|
+
//# sourceMappingURL=score-section.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"score-section.js","sources":["../../../../../../src/features/math-fit/math-fit-report/comps/score-section/score-section.tsx"],"sourcesContent":["import { Fragment, memo, useCallback, type FC } from 'react';\n\nimport Button from '../../../../ui/buttons/button/button';\nimport FlexView from '../../../../ui/layout/flex-view';\nimport Text from '../../../../ui/text/text';\nimport ScoreBadge from '../score-badge/score-badge';\nimport type { IScoreSectionProps } from './score-section-types';\nimport * as Styled from './score-section-styled';\nimport Separator from '../../../../ui/separator/separator';\nimport { getQuestionStatusBgColor } from '../../math-fit-report-helpers';\nimport { EQuestionState } from '../../../math-fit-overview/math-fit-overview-types';\n\nconst ScoreSection: FC<IScoreSectionProps> = memo(function ScoreSection({\n section,\n sheet,\n onReviewSection,\n}) {\n const {\n title,\n score,\n scoreChange,\n sessionId,\n isIncomplete = false,\n sectionNumber,\n topics,\n } = section;\n const onClickReview = useCallback(() => {\n if (!isIncomplete && section.sheet && onReviewSection) {\n onReviewSection(sheet, sessionId);\n }\n }, [isIncomplete, onReviewSection, section.sheet, sheet, sessionId]);\n\n return (\n <FlexView>\n <FlexView $flexDirection=\"row\" $alignItems=\"center\">\n <Text $renderAs=\"ab2-bold\" $color=\"BLACK_1\">\n {title}:\n </Text>\n <Separator width={4} />\n {isIncomplete ? (\n <FlexView $gutter={3} $gap={2.5} $background=\"BLACK_5\">\n <Text $renderAs=\"ab4-bold\" $color=\"WHITE\">\n INCOMPLETE\n </Text>\n </FlexView>\n ) : (\n score && <ScoreBadge score={score} maxScore={10} scoreChange={scoreChange} />\n )}\n </FlexView>\n <FlexView $flexRowGapX={0.5} $gapX={0.75}>\n {topics.map((topic, index) => (\n <Fragment key={topic.name}>\n <FlexView $flexDirection=\"row\" $justifyContent=\"space-between\" $alignItems=\"center\">\n <Text $renderAs=\"ub2\" $color={isIncomplete ? 'BLACK_T_38' : 'BLACK_1'}>\n {topic.name}\n </Text>\n <FlexView $flexGapX={0.5} $flexDirection=\"row\">\n {topic.miniGoal.items.map(question => (\n <FlexView\n key={question.item_reference}\n $widthX={1.25}\n $heightX={1.25}\n $alignItems=\"center\"\n $justifyContent=\"center\"\n $borderRadiusX={2}\n $background={getQuestionStatusBgColor(\n isIncomplete ? EQuestionState.SKIPPED : question.state,\n )}\n >\n <Text\n $renderAs=\"ub3\"\n $color={question.state === EQuestionState.SKIPPED ? 'BLACK_T_38' : 'WHITE'}\n >\n {question.order}\n </Text>\n </FlexView>\n ))}\n </FlexView>\n </FlexView>\n {index !== topics.length - 1 && <Styled.Divider />}\n </Fragment>\n ))}\n </FlexView>\n <FlexView $alignItems=\"center\">\n <Separator heightX={0.75} />\n <Button\n label={`Review Section ${sectionNumber}`}\n renderAs={isIncomplete ? 'secondary' : 'primary'}\n size=\"small\"\n onClick={onClickReview}\n disabled={isIncomplete}\n />\n </FlexView>\n </FlexView>\n );\n});\n\nexport default ScoreSection;\n"],"names":["ScoreSection","memo","section","sheet","onReviewSection","title","score","scoreChange","sessionId","isIncomplete","sectionNumber","topics","onClickReview","useCallback","FlexView","jsxs","Text","jsx","Separator","ScoreBadge","topic","index","Fragment","question","getQuestionStatusBgColor","EQuestionState","Styled.Divider","Button"],"mappings":";;;;;;;;;;AAYM,MAAAA,IAAuCC,EAAK,SAAsB;AAAA,EACtE,SAAAC;AAAA,EACA,OAAAC;AAAA,EACA,iBAAAC;AACF,GAAG;AACK,QAAA;AAAA,IACJ,OAAAC;AAAA,IACA,OAAAC;AAAA,IACA,aAAAC;AAAA,IACA,WAAAC;AAAA,IACA,cAAAC,IAAe;AAAA,IACf,eAAAC;AAAA,IACA,QAAAC;AAAA,EACE,IAAAT,GACEU,IAAgBC,EAAY,MAAM;AACtC,IAAI,CAACJ,KAAgBP,EAAQ,SAASE,KACpCA,EAAgBD,GAAOK,CAAS;AAAA,EAClC,GACC,CAACC,GAAcL,GAAiBF,EAAQ,OAAOC,GAAOK,CAAS,CAAC;AAEnE,2BACGM,GACC,EAAA,UAAA;AAAA,IAAA,gBAAAC,EAACD,GAAS,EAAA,gBAAe,OAAM,aAAY,UACzC,UAAA;AAAA,MAAA,gBAAAC,EAACC,GAAK,EAAA,WAAU,YAAW,QAAO,WAC/B,UAAA;AAAA,QAAAX;AAAA,QAAM;AAAA,MAAA,GACT;AAAA,MACA,gBAAAY,EAACC,GAAU,EAAA,OAAO,EAAG,CAAA;AAAA,MACpBT,IACE,gBAAAQ,EAAAH,GAAA,EAAS,SAAS,GAAG,MAAM,KAAK,aAAY,WAC3C,UAAA,gBAAAG,EAACD,GAAK,EAAA,WAAU,YAAW,QAAO,SAAQ,UAE1C,aAAA,CAAA,EACF,CAAA,IAEAV,uBAAUa,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CAAa;AAAA,UACtC,UAAUD,IAAe,cAAc;AAAA,UACvC,MAAK;AAAA,UACL,SAASG;AAAA,UACT,UAAUH;AAAA,QAAA;AAAA,MACZ;AAAA,IAAA,GACF;AAAA,EACF,EAAA,CAAA;AAEJ,CAAC;"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { EQuestionState as t } from "../math-fit-overview/math-fit-overview-types.js";
|
|
2
|
+
const m = [
|
|
3
|
+
{ label: "Correct", state: t.CORRECT },
|
|
4
|
+
{ label: "Incorrect", state: t.INCORRECT },
|
|
5
|
+
{ label: "Not Attempted", state: t.SKIPPED }
|
|
6
|
+
], C = (r) => r.map((e, o) => {
|
|
7
|
+
const s = e.summary, a = !s, c = s ? Object.entries(s).map(([, n]) => ({
|
|
8
|
+
name: n.description,
|
|
9
|
+
miniGoal: n
|
|
10
|
+
})) : [];
|
|
11
|
+
return {
|
|
12
|
+
title: e.sheet.title,
|
|
13
|
+
score: a ? void 0 : e.score,
|
|
14
|
+
scoreChange: e.previous_score && e.score ? e.score - e.previous_score : void 0,
|
|
15
|
+
isIncomplete: a,
|
|
16
|
+
sectionNumber: o + 1,
|
|
17
|
+
topics: c,
|
|
18
|
+
sheet: e.sheet,
|
|
19
|
+
sessionId: e.id
|
|
20
|
+
};
|
|
21
|
+
}), l = (r) => {
|
|
22
|
+
switch (r) {
|
|
23
|
+
case t.CORRECT:
|
|
24
|
+
return "GREEN_5";
|
|
25
|
+
case t.INCORRECT:
|
|
26
|
+
return "RED";
|
|
27
|
+
case t.SKIPPED:
|
|
28
|
+
return "BLACK_T_08";
|
|
29
|
+
default:
|
|
30
|
+
return "BLACK_T_08";
|
|
31
|
+
}
|
|
32
|
+
}, p = (r) => {
|
|
33
|
+
const e = new Date(r * 1e3), o = e.toLocaleDateString("en-US", { month: "short" }).toUpperCase(), s = e.getFullYear();
|
|
34
|
+
return `${o} ${s}`;
|
|
35
|
+
};
|
|
36
|
+
export {
|
|
37
|
+
m as LEGEND_ITEMS,
|
|
38
|
+
p as formatTestDate,
|
|
39
|
+
l as getQuestionStatusBgColor,
|
|
40
|
+
C as transformSectionsToReportData
|
|
41
|
+
};
|
|
42
|
+
//# sourceMappingURL=math-fit-report-helpers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"math-fit-report-helpers.js","sources":["../../../../src/features/math-fit/math-fit-report/math-fit-report-helpers.ts"],"sourcesContent":["import { type TColorNames } from '../../ui/types';\nimport { EQuestionState, type IMathFitSection } from '../math-fit-overview/math-fit-overview-types';\nimport { type ITransformedSection } from './math-fit-report-types';\n\nexport const LEGEND_ITEMS = [\n { label: 'Correct', state: EQuestionState.CORRECT },\n { label: 'Incorrect', state: EQuestionState.INCORRECT },\n { label: 'Not Attempted', state: EQuestionState.SKIPPED },\n];\n\nexport const transformSectionsToReportData = (\n sections: IMathFitSection[],\n): ITransformedSection[] => {\n return sections.map((section, index) => {\n const summary = section.summary;\n const isIncomplete = !summary;\n\n const topics = summary\n ? Object.entries(summary).map(([, miniGoal]) => ({\n name: miniGoal.description,\n miniGoal,\n }))\n : [];\n\n return {\n title: section.sheet.title,\n score: isIncomplete ? undefined : section.score,\n scoreChange:\n section.previous_score && section.score\n ? section.score - section.previous_score\n : undefined,\n isIncomplete,\n sectionNumber: index + 1,\n topics,\n sheet: section.sheet,\n sessionId: section.id,\n };\n });\n};\n\nexport const getQuestionStatusBgColor = (state: EQuestionState): TColorNames => {\n switch (state) {\n case EQuestionState.CORRECT:\n return 'GREEN_5';\n case EQuestionState.INCORRECT:\n return 'RED';\n case EQuestionState.SKIPPED:\n return 'BLACK_T_08';\n default:\n return 'BLACK_T_08';\n }\n};\n\nexport const formatTestDate = (timestamp: number): string => {\n const date = new Date(timestamp * 1000);\n const month = date.toLocaleDateString('en-US', { month: 'short' }).toUpperCase();\n const year = date.getFullYear();\n\n return `${month} ${year}`;\n};\n"],"names":["LEGEND_ITEMS","EQuestionState","transformSectionsToReportData","sections","section","index","summary","isIncomplete","topics","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
+
import { jsxs as n, jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { memo as a, useMemo as s } from "react";
|
|
3
|
+
import o from "../../ui/layout/flex-view.js";
|
|
4
|
+
import i from "../../ui/text/text.js";
|
|
5
|
+
import g from "./comps/report-header/report-header.js";
|
|
6
|
+
import d from "./comps/score-section/score-section.js";
|
|
7
|
+
import { transformSectionsToReportData as f, LEGEND_ITEMS as x, getQuestionStatusBgColor as _ } from "./math-fit-report-helpers.js";
|
|
8
|
+
const b = a(function({
|
|
9
|
+
data: e,
|
|
10
|
+
onReviewClick: l,
|
|
11
|
+
studentName: $,
|
|
12
|
+
userType: m,
|
|
13
|
+
onBack: p
|
|
14
|
+
}) {
|
|
15
|
+
const c = s(() => f(e.sections), [e.sections]), h = s(() => {
|
|
16
|
+
if (e.previous_score && e.score)
|
|
17
|
+
return e.score - e.previous_score;
|
|
18
|
+
}, [e.score, e.previous_score]);
|
|
19
|
+
return /* @__PURE__ */ n(o, { $background: "BLACK_T_04", children: [
|
|
20
|
+
/* @__PURE__ */ r(
|
|
21
|
+
g,
|
|
22
|
+
{
|
|
23
|
+
score: e.score ?? 0,
|
|
24
|
+
maxScore: 10,
|
|
25
|
+
scoreChange: h,
|
|
26
|
+
createdOnTs: e.created_on_ts,
|
|
27
|
+
studentName: $,
|
|
28
|
+
userType: m,
|
|
29
|
+
onBack: p
|
|
30
|
+
}
|
|
31
|
+
),
|
|
32
|
+
c.map((t, u) => /* @__PURE__ */ n(o, { $background: "WHITE", children: [
|
|
33
|
+
/* @__PURE__ */ r(o, { $gapX: 1.5, $gutterX: 1.25, children: /* @__PURE__ */ r(d, { section: t, onReviewSection: l, sheet: t.sheet }) }),
|
|
34
|
+
u !== c.length - 1 && /* @__PURE__ */ r(o, { $height: 1, $background: "BLACK_T_08" })
|
|
35
|
+
] }, t.title)),
|
|
36
|
+
/* @__PURE__ */ n(o, { $gutterX: 1, $flexColumnGapX: 1, $gapX: 1, $flexRowGapX: 2, $alignItems: "center", children: [
|
|
37
|
+
/* @__PURE__ */ r(o, { $flexDirection: "row", $flexColumnGapX: 1, $alignItems: "center", children: x.map((t) => /* @__PURE__ */ n(
|
|
38
|
+
o,
|
|
39
|
+
{
|
|
40
|
+
$flexDirection: "row",
|
|
41
|
+
$flexColumnGapX: 0.25,
|
|
42
|
+
$alignItems: "center",
|
|
43
|
+
children: [
|
|
44
|
+
/* @__PURE__ */ r(i, { $renderAs: "ub3", $color: "BLACK_T_60", children: t.label }),
|
|
45
|
+
/* @__PURE__ */ r(
|
|
46
|
+
o,
|
|
47
|
+
{
|
|
48
|
+
$width: 10,
|
|
49
|
+
$height: 10,
|
|
50
|
+
$borderRadiusX: 1,
|
|
51
|
+
$background: _(t.state)
|
|
52
|
+
}
|
|
53
|
+
)
|
|
54
|
+
]
|
|
55
|
+
},
|
|
56
|
+
t.label
|
|
57
|
+
)) }),
|
|
58
|
+
/* @__PURE__ */ n(o, { $flexRowGapX: 0.25, $marginBottomX: 0.5, $alignItems: "center", children: [
|
|
59
|
+
/* @__PURE__ */ r(i, { $renderAs: "ub3-bold", $color: "BLACK_1", children: "Keep Up the Great Work! 🚀" }),
|
|
60
|
+
/* @__PURE__ */ r(i, { $renderAs: "ub3", $color: "BLACK_1", children: "You’re getting stronger at MathFit each day. See you next month!" })
|
|
61
|
+
] })
|
|
62
|
+
] })
|
|
63
|
+
] });
|
|
64
|
+
}), G = b;
|
|
65
|
+
export {
|
|
66
|
+
G as default
|
|
67
|
+
};
|
|
68
|
+
//# sourceMappingURL=math-fit-report.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"math-fit-report.js","sources":["../../../../src/features/math-fit/math-fit-report/math-fit-report.tsx"],"sourcesContent":["import { memo, useMemo, type FC } from 'react';\n\nimport FlexView from '../../ui/layout/flex-view';\nimport Text from '../../ui/text/text';\nimport ReportHeader from './comps/report-header/report-header';\nimport ScoreSection from './comps/score-section/score-section';\nimport {\n getQuestionStatusBgColor,\n LEGEND_ITEMS,\n transformSectionsToReportData,\n} from './math-fit-report-helpers';\nimport type { IMathFitReportProps } from './math-fit-report-types';\n\nconst MathFitReport: FC<IMathFitReportProps> = memo(function MathFitReport({\n data,\n onReviewClick,\n studentName,\n userType,\n onBack,\n}) {\n const sectionData = useMemo(() => transformSectionsToReportData(data.sections), [data.sections]);\n\n const scoreChange = useMemo(() => {\n if (data.previous_score && data.score) {\n return data.score - data.previous_score;\n }\n\n return undefined;\n }, [data.score, data.previous_score]);\n\n return (\n <FlexView $background=\"BLACK_T_04\">\n <ReportHeader\n score={data.score ?? 0}\n maxScore={10}\n scoreChange={scoreChange}\n createdOnTs={data.created_on_ts}\n studentName={studentName}\n userType={userType}\n onBack={onBack}\n />\n\n {sectionData.map((section, index) => (\n <FlexView key={section.title} $background=\"WHITE\">\n <FlexView $gapX={1.5} $gutterX={1.25}>\n <ScoreSection section={section} onReviewSection={onReviewClick} sheet={section.sheet} />\n </FlexView>\n {index !== sectionData.length - 1 && <FlexView $height={1} $background=\"BLACK_T_08\" />}\n </FlexView>\n ))}\n\n <FlexView $gutterX={1} $flexColumnGapX={1} $gapX={1} $flexRowGapX={2} $alignItems=\"center\">\n <FlexView $flexDirection=\"row\" $flexColumnGapX={1} $alignItems=\"center\">\n {LEGEND_ITEMS.map(item => (\n <FlexView\n key={item.label}\n $flexDirection=\"row\"\n $flexColumnGapX={0.25}\n $alignItems=\"center\"\n >\n <Text $renderAs=\"ub3\" $color=\"BLACK_T_60\">\n {item.label}\n </Text>\n <FlexView\n $width={10}\n $height={10}\n $borderRadiusX={1}\n $background={getQuestionStatusBgColor(item.state)}\n />\n </FlexView>\n ))}\n </FlexView>\n <FlexView $flexRowGapX={0.25} $marginBottomX={0.5} $alignItems=\"center\">\n <Text $renderAs=\"ub3-bold\" $color=\"BLACK_1\">\n Keep Up the Great Work! 🚀\n </Text>\n <Text $renderAs=\"ub3\" $color=\"BLACK_1\">\n You’re getting stronger at MathFit each day. See you next month!\n </Text>\n </FlexView>\n </FlexView>\n </FlexView>\n );\n});\n\nexport default MathFitReport;\n"],"names":["MathFitReport","memo","data","onReviewClick","studentName","userType","onBack","sectionData","useMemo","transformSectionsToReportData","scoreChange","jsxs","FlexView","jsx","ReportHeader","section","index","ScoreSection","LEGEND_ITEMS","item","Text","getQuestionStatusBgColor","MathFitReport$1"],"mappings":";;;;;;;AAaA,MAAMA,IAAyCC,EAAK,SAAuB;AAAA,EACzE,MAAAC;AAAA,EACA,eAAAC;AAAA,EACA,aAAAC;AAAA,EACA,UAAAC;AAAA,EACA,QAAAC;AACF,GAAG;AACK,QAAAC,IAAcC,EAAQ,MAAMC,EAA8BP,EAAK,QAAQ,GAAG,CAACA,EAAK,QAAQ,CAAC,GAEzFQ,IAAcF,EAAQ,MAAM;AAC5B,QAAAN,EAAK,kBAAkBA,EAAK;AACvB,aAAAA,EAAK,QAAQA,EAAK;AAAA,KAI1B,CAACA,EAAK,OAAOA,EAAK,cAAc,CAAC;AAGlC,SAAA,gBAAAS,EAACC,GAAS,EAAA,aAAY,cACpB,UAAA;AAAA,IAAA,gBAAAC;AAAA,MAACC;AAAA,MAAA;AAAA,QACC,OAAOZ,EAAK,SAAS;AAAA,QACrB,UAAU;AAAA,QACV,aAAAQ;AAAA,QACA,aAAaR,EAAK;AAAA,QAClB,aAAAE;AAAA,QACA,UAAAC;AAAA,QACA,QAAAC;AAAA,MAAA;AAAA,IACF;AAAA,IAECC,EAAY,IAAI,CAACQ,GAASC,MACxB,gBAAAL,EAAAC,GAAA,EAA6B,aAAY,SACxC,UAAA;AAAA,MAAA,gBAAAC,EAACD,GAAS,EAAA,OAAO,KAAK,UAAU,MAC9B,UAAA,gBAAAC,EAACI,GAAa,EAAA,SAAAF,GAAkB,iBAAiBZ,GAAe,OAAOY,EAAQ,MAAO,CAAA,GACxF;AAAA,MACCC,MAAUT,EAAY,SAAS,uBAAMK,GAAS,EAAA,SAAS,GAAG,aAAY,aAAa,CAAA;AAAA,IAAA,KAJvEG,EAAQ,KAKvB,CACD;AAAA,IAED,gBAAAJ,EAACC,GAAS,EAAA,UAAU,GAAG,iBAAiB,GAAG,OAAO,GAAG,cAAc,GAAG,aAAY,UAChF,UAAA;AAAA,MAAC,gBAAAC,EAAAD,GAAA,EAAS,gBAAe,OAAM,iBAAiB,GAAG,aAAY,UAC5D,UAAaM,EAAA,IAAI,CAChBC,MAAA,gBAAAR;AAAA,QAACC;AAAA,QAAA;AAAA,UAEC,gBAAe;AAAA,UACf,iBAAiB;AAAA,UACjB,aAAY;AAAA,UAEZ,UAAA;AAAA,YAAA,gBAAAC,EAACO,KAAK,WAAU,OAAM,QAAO,cAC1B,YAAK,OACR;AAAA,YACA,gBAAAP;AAAA,cAACD;AAAA,cAAA;AAAA,gBACC,QAAQ;AAAA,gBACR,SAAS;AAAA,gBACT,gBAAgB;AAAA,gBAChB,aAAaS,EAAyBF,EAAK,KAAK;AAAA,cAAA;AAAA,YAClD;AAAA,UAAA;AAAA,QAAA;AAAA,QAbKA,EAAK;AAAA,MAeb,CAAA,GACH;AAAA,wBACCP,GAAS,EAAA,cAAc,MAAM,gBAAgB,KAAK,aAAY,UAC7D,UAAA;AAAA,QAAA,gBAAAC,EAACO,GAAK,EAAA,WAAU,YAAW,QAAO,WAAU,UAE5C,8BAAA;AAAA,0BACCA,GAAK,EAAA,WAAU,OAAM,QAAO,WAAU,UAEvC,oEAAA;AAAA,MAAA,GACF;AAAA,IAAA,GACF;AAAA,EACF,EAAA,CAAA;AAEJ,CAAC,GAEDE,IAAetB;"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createGetAPI as s } from "@cuemath/rest-api";
|
|
2
|
-
import {
|
|
2
|
+
import { BASE_URL_V3_2 as a } from "../../../../constants/api.js";
|
|
3
3
|
const { useGet: l, invalidate: m } = s({
|
|
4
4
|
getURL: (e, r, { studentId: t }) => `${a}/users/${t}/user-milestone/${e}/tests`
|
|
5
5
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-tests-list.js","sources":["../../../../../src/features/milestone/milestone-list-container/api/get-tests-list.ts"],"sourcesContent":["import { createGetAPI } from '@cuemath/rest-api';\n\nimport {
|
|
1
|
+
{"version":3,"file":"get-tests-list.js","sources":["../../../../../src/features/milestone/milestone-list-container/api/get-tests-list.ts"],"sourcesContent":["import { createGetAPI } from '@cuemath/rest-api';\n\nimport { BASE_URL_V3_2 } from '../../../../constants/api';\nimport type {\n INodeDataProps,\n TSheetStates,\n} from '../../../chapters-v2/comps/node-card/node-card-types';\nimport { type HW_CARD_LIST_ENTITY_TYPE } from '../../../homework/hw-card-list/hw-card-list-types';\n\nexport interface ITestListItem {\n entity_type: HW_CARD_LIST_ENTITY_TYPE;\n entity_id: string;\n score: number | null;\n id: string;\n state: TSheetStates;\n user_milestone_id: string;\n subtext: string;\n sheets: INodeDataProps[];\n}\n\n//* Home page test help data.\nconst { useGet: useGetTestHelpData, invalidate: invalidateTestHelpData } = createGetAPI<\n ITestListItem[],\n void,\n {\n studentId: string;\n }\n>({\n getURL: (userMilestoneId, _, { studentId }) =>\n `${BASE_URL_V3_2}/users/${studentId}/user-milestone/${userMilestoneId}/tests`,\n});\n\nexport { useGetTestHelpData, invalidateTestHelpData };\n"],"names":["useGetTestHelpData","invalidateTestHelpData","createGetAPI","userMilestoneId","_","studentId","BASE_URL_V3_2"],"mappings":";;AAqBA,MAAM,EAAE,QAAQA,GAAoB,YAAYC,EAAA,IAA2BC,EAMzE;AAAA,EACA,QAAQ,CAACC,GAAiBC,GAAG,EAAE,WAAAC,EAAA,MAC7B,GAAGC,CAAa,UAAUD,CAAS,mBAAmBF,CAAe;AACzE,CAAC;"}
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { jsxs as r, Fragment as
|
|
2
|
-
import { memo as
|
|
3
|
-
import
|
|
4
|
-
import
|
|
1
|
+
import { jsxs as r, Fragment as Y, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { memo as Z, useCallback as f, Fragment as ee } from "react";
|
|
3
|
+
import te from "../../../hooks/use-lazy-ref.js";
|
|
4
|
+
import oe from "../../../ui/arrow-tooltip/arrow-tooltip.js";
|
|
5
5
|
import h from "../../../ui/buttons/text-button/text-button.js";
|
|
6
6
|
import m from "../../../ui/layout/flex-view.js";
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
const
|
|
7
|
+
import ne from "../../../ui/separator/separator.js";
|
|
8
|
+
import ie from "../../../ui/text/text.js";
|
|
9
|
+
import re from "./milestone-widget/milestone-widget.js";
|
|
10
|
+
import se from "./no-active-milestone/no-active-milestone.js";
|
|
11
|
+
import ae from "../../../../node_modules/uuid/dist/esm-browser/v4.js";
|
|
12
|
+
const Te = Z(function({
|
|
13
13
|
milestones: t,
|
|
14
14
|
studentId: A,
|
|
15
15
|
milestoneType: s,
|
|
@@ -34,8 +34,8 @@ const Me = Y(function({
|
|
|
34
34
|
onNodeReattempt: F,
|
|
35
35
|
onNodeReset: I,
|
|
36
36
|
onNodeUnassign: P,
|
|
37
|
-
onAssignResources:
|
|
38
|
-
onTestPreview:
|
|
37
|
+
onAssignResources: k,
|
|
38
|
+
onTestPreview: S,
|
|
39
39
|
onTestReview: E,
|
|
40
40
|
onTestStart: j,
|
|
41
41
|
activeMilestoneId: y,
|
|
@@ -47,22 +47,23 @@ const Me = Y(function({
|
|
|
47
47
|
userType: l,
|
|
48
48
|
courseStream: L,
|
|
49
49
|
isTrialSession: H,
|
|
50
|
-
onNodeAssignAsHomework: O
|
|
51
|
-
|
|
50
|
+
onNodeAssignAsHomework: O,
|
|
51
|
+
onMathFitClick: W
|
|
52
|
+
} = u, d = s === "ACTIVE", X = s === "DRAFT", p = te(ae), _ = f(() => {
|
|
52
53
|
i == null || i(p);
|
|
53
|
-
}, [i, p]),
|
|
54
|
+
}, [i, p]), U = f(() => {
|
|
54
55
|
n == null || n();
|
|
55
56
|
}, [n]);
|
|
56
57
|
if (!t) return null;
|
|
57
|
-
const
|
|
58
|
+
const q = t.some(
|
|
58
59
|
(o) => o.milestone_state === "ACTIVE"
|
|
59
|
-
),
|
|
60
|
-
return /* @__PURE__ */ r(
|
|
61
|
-
d && !
|
|
62
|
-
|
|
60
|
+
), J = t.some((o) => o.milestone_state === "DRAFT");
|
|
61
|
+
return /* @__PURE__ */ r(Y, { children: [
|
|
62
|
+
d && !q && /* @__PURE__ */ e(m, { $marginBottom: 40, children: /* @__PURE__ */ e(
|
|
63
|
+
se,
|
|
63
64
|
{
|
|
64
65
|
canCreatePlan: a,
|
|
65
|
-
isDraftMilestonePresent:
|
|
66
|
+
isDraftMilestonePresent: J,
|
|
66
67
|
isFiltersAdded: C,
|
|
67
68
|
onCreatePlan: i,
|
|
68
69
|
studentName: c,
|
|
@@ -70,14 +71,14 @@ const Me = Y(function({
|
|
|
70
71
|
}
|
|
71
72
|
) }),
|
|
72
73
|
d && /* @__PURE__ */ r(m, { $flexDirection: "row", $justifyContent: "space-between", $marginBottom: 16, children: [
|
|
73
|
-
/* @__PURE__ */ r(
|
|
74
|
+
/* @__PURE__ */ r(ie, { $renderAs: "ac4", children: [
|
|
74
75
|
"Goals (",
|
|
75
76
|
t.length,
|
|
76
77
|
")"
|
|
77
78
|
] }),
|
|
78
79
|
l === "TEACHER" && /* @__PURE__ */ r(m, { $flexDirection: "row", $flexGapX: 1, children: [
|
|
79
80
|
/* @__PURE__ */ e(
|
|
80
|
-
|
|
81
|
+
oe,
|
|
81
82
|
{
|
|
82
83
|
renderAs: "primary",
|
|
83
84
|
tooltipItem: "Goals can only be added for students who have joined the class",
|
|
@@ -88,20 +89,20 @@ const Me = Y(function({
|
|
|
88
89
|
{
|
|
89
90
|
label: "Create Goal",
|
|
90
91
|
size: "small",
|
|
91
|
-
onClick:
|
|
92
|
+
onClick: _,
|
|
92
93
|
disabled: !a
|
|
93
94
|
}
|
|
94
95
|
)
|
|
95
96
|
}
|
|
96
97
|
),
|
|
97
|
-
/* @__PURE__ */ e(h, { label: "Add Milestone", size: "small", onClick:
|
|
98
|
+
/* @__PURE__ */ e(h, { label: "Add Milestone", size: "small", onClick: U })
|
|
98
99
|
] })
|
|
99
100
|
] }),
|
|
100
|
-
t.map((o,
|
|
101
|
-
const { id:
|
|
102
|
-
return /* @__PURE__ */ r(
|
|
101
|
+
t.map((o, K) => {
|
|
102
|
+
const { id: Q } = o;
|
|
103
|
+
return /* @__PURE__ */ r(ee, { children: [
|
|
103
104
|
/* @__PURE__ */ e(
|
|
104
|
-
|
|
105
|
+
re,
|
|
105
106
|
{
|
|
106
107
|
milestone: o,
|
|
107
108
|
studentId: A,
|
|
@@ -111,7 +112,7 @@ const Me = Y(function({
|
|
|
111
112
|
userType: l,
|
|
112
113
|
onAddOutcome: n,
|
|
113
114
|
onChapterClick: v,
|
|
114
|
-
isMilestoneActive: d ||
|
|
115
|
+
isMilestoneActive: d || X,
|
|
115
116
|
milestoneType: s,
|
|
116
117
|
onEdit: b,
|
|
117
118
|
onCreateMilestoneTest: x,
|
|
@@ -120,7 +121,7 @@ const Me = Y(function({
|
|
|
120
121
|
onDraftPublish: N,
|
|
121
122
|
isClassOngoing: g,
|
|
122
123
|
isStudentPresent: M,
|
|
123
|
-
onAssignResources:
|
|
124
|
+
onAssignResources: k,
|
|
124
125
|
onNodeAttempt: R,
|
|
125
126
|
onNodeView: $,
|
|
126
127
|
onNodeReview: D,
|
|
@@ -128,22 +129,23 @@ const Me = Y(function({
|
|
|
128
129
|
onNodeReset: I,
|
|
129
130
|
onNodeUnassign: P,
|
|
130
131
|
onNodeAssignAsHomework: O,
|
|
131
|
-
onTestPreview:
|
|
132
|
+
onTestPreview: S,
|
|
132
133
|
onTestReview: E,
|
|
133
134
|
onTestStart: j,
|
|
134
135
|
courseStream: L,
|
|
135
136
|
activeMilestoneId: y,
|
|
136
137
|
activeTabId: G,
|
|
137
138
|
onWidgetTabSelection: V,
|
|
138
|
-
isTrialSession: H
|
|
139
|
+
isTrialSession: H,
|
|
140
|
+
onMathFitClick: W
|
|
139
141
|
}
|
|
140
142
|
),
|
|
141
|
-
|
|
142
|
-
] }, `milestone=${
|
|
143
|
+
K !== t.length - 1 && /* @__PURE__ */ e(ne, { heightX: 2 })
|
|
144
|
+
] }, `milestone=${Q}`);
|
|
143
145
|
})
|
|
144
146
|
] });
|
|
145
147
|
});
|
|
146
148
|
export {
|
|
147
|
-
|
|
149
|
+
Te as default
|
|
148
150
|
};
|
|
149
151
|
//# sourceMappingURL=milestone-list.js.map
|
package/dist/features/milestone/milestone-list-container/milestone-list/milestone-list.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"milestone-list.js","sources":["../../../../../src/features/milestone/milestone-list-container/milestone-list/milestone-list.tsx"],"sourcesContent":["import { memo, useCallback, Fragment, type FC } from 'react';\nimport { v4 as uuidv4 } from 'uuid';\n\nimport useLazyRef from '../../../hooks/use-lazy-ref';\nimport ArrowTooltip from '../../../ui/arrow-tooltip/arrow-tooltip';\nimport TextButton from '../../../ui/buttons/text-button/text-button';\nimport FlexView from '../../../ui/layout/flex-view';\nimport Separator from '../../../ui/separator/separator';\nimport Text from '../../../ui/text/text';\nimport type { IMilestoneListProps } from './milestone-list-types';\nimport MilestoneWidget from './milestone-widget/milestone-widget';\nimport NoActiveMilestone from './no-active-milestone/no-active-milestone';\n\nconst MilestoneList: FC<IMilestoneListProps> = memo(function MilestoneList({\n milestones,\n studentId,\n milestoneType,\n ...restMilestoneListProps\n}) {\n const {\n canCreatePlan,\n isClassOngoing,\n isFiltersAdded,\n isStudentPresent,\n onAddChapter,\n onAddOutcome,\n onChapterClick,\n onCreatePlan,\n onDelete,\n onDraftPublish,\n onEdit,\n onCreateMilestoneTest,\n onNodeAttempt,\n onNodeView,\n onNodeReview,\n onNodeReattempt,\n onNodeReset,\n onNodeUnassign,\n onAssignResources,\n onTestPreview,\n onTestReview,\n onTestStart,\n activeMilestoneId,\n activeTabId,\n onWidgetTabSelection,\n studentName,\n teacherName,\n parentName,\n userType,\n courseStream,\n isTrialSession,\n onNodeAssignAsHomework,\n } = restMilestoneListProps;\n\n const isMilestoneActive = milestoneType === 'ACTIVE';\n const isDraftMilestone = milestoneType === 'DRAFT';\n const temporaryMilestoneId = useLazyRef(uuidv4);\n\n const handleCreatePlan = useCallback(() => {\n onCreatePlan?.(temporaryMilestoneId);\n }, [onCreatePlan, temporaryMilestoneId]);\n\n const handleOnAddOutcome = useCallback(() => {\n onAddOutcome?.();\n }, [onAddOutcome]);\n\n if (!milestones) return null;\n\n const activeMilestonePresent = milestones.some(\n milestone => milestone.milestone_state === 'ACTIVE',\n );\n const draftMilestonePresent = milestones.some(milestone => milestone.milestone_state === 'DRAFT');\n\n return (\n <>\n {isMilestoneActive && !activeMilestonePresent && (\n <FlexView $marginBottom={40}>\n <NoActiveMilestone\n canCreatePlan={canCreatePlan}\n isDraftMilestonePresent={draftMilestonePresent}\n isFiltersAdded={isFiltersAdded}\n onCreatePlan={onCreatePlan}\n studentName={studentName}\n userType={userType}\n />\n </FlexView>\n )}\n\n {isMilestoneActive && (\n <FlexView $flexDirection=\"row\" $justifyContent=\"space-between\" $marginBottom={16}>\n <Text $renderAs=\"ac4\">Goals ({milestones.length})</Text>\n\n {userType === 'TEACHER' && (\n <FlexView $flexDirection=\"row\" $flexGapX={1}>\n <ArrowTooltip\n renderAs=\"primary\"\n tooltipItem=\"Goals can only be added for students who have joined the class\"\n hidden={canCreatePlan}\n position=\"bottom\"\n >\n <TextButton\n label=\"Create Goal\"\n size=\"small\"\n onClick={handleCreatePlan}\n disabled={!canCreatePlan}\n />\n </ArrowTooltip>\n <TextButton label=\"Add Milestone\" size=\"small\" onClick={handleOnAddOutcome} />\n </FlexView>\n )}\n </FlexView>\n )}\n\n {milestones.map((milestone, idx) => {\n const { id: milestoneId } = milestone;\n\n return (\n <Fragment key={`milestone=${milestoneId}`}>\n <MilestoneWidget\n milestone={milestone}\n studentId={studentId}\n studentName={studentName}\n parentName={parentName}\n teacherName={teacherName}\n userType={userType}\n onAddOutcome={onAddOutcome}\n onChapterClick={onChapterClick}\n isMilestoneActive={isMilestoneActive || isDraftMilestone}\n milestoneType={milestoneType}\n onEdit={onEdit}\n onCreateMilestoneTest={onCreateMilestoneTest}\n onAddChapter={onAddChapter}\n onDelete={onDelete}\n onDraftPublish={onDraftPublish}\n isClassOngoing={isClassOngoing}\n isStudentPresent={isStudentPresent}\n onAssignResources={onAssignResources}\n onNodeAttempt={onNodeAttempt}\n onNodeView={onNodeView}\n onNodeReview={onNodeReview}\n onNodeReattempt={onNodeReattempt}\n onNodeReset={onNodeReset}\n onNodeUnassign={onNodeUnassign}\n onNodeAssignAsHomework={onNodeAssignAsHomework}\n onTestPreview={onTestPreview}\n onTestReview={onTestReview}\n onTestStart={onTestStart}\n courseStream={courseStream}\n activeMilestoneId={activeMilestoneId}\n activeTabId={activeTabId}\n onWidgetTabSelection={onWidgetTabSelection}\n isTrialSession={isTrialSession}\n />\n {idx !== milestones.length - 1 && <Separator heightX={2} />}\n </Fragment>\n );\n })}\n </>\n );\n});\n\nexport default MilestoneList;\n"],"names":["MilestoneList","memo","milestones","studentId","milestoneType","restMilestoneListProps","canCreatePlan","isClassOngoing","isFiltersAdded","isStudentPresent","onAddChapter","onAddOutcome","onChapterClick","onCreatePlan","onDelete","onDraftPublish","onEdit","onCreateMilestoneTest","onNodeAttempt","onNodeView","onNodeReview","onNodeReattempt","onNodeReset","onNodeUnassign","onAssignResources","onTestPreview","onTestReview","onTestStart","activeMilestoneId","activeTabId","onWidgetTabSelection","studentName","teacherName","parentName","userType","courseStream","isTrialSession","onNodeAssignAsHomework","isMilestoneActive","isDraftMilestone","temporaryMilestoneId","useLazyRef","uuidv4","handleCreatePlan","useCallback","handleOnAddOutcome","activeMilestonePresent","milestone","draftMilestonePresent","jsxs","Fragment","jsx","FlexView","NoActiveMilestone","Text","ArrowTooltip","TextButton","idx","milestoneId","MilestoneWidget","Separator"],"mappings":";;;;;;;;;;;AAaM,MAAAA,KAAyCC,EAAK,SAAuB;AAAA,EACzE,YAAAC;AAAA,EACA,WAAAC;AAAA,EACA,eAAAC;AAAA,EACA,GAAGC;AACL,GAAG;AACK,QAAA;AAAA,IACJ,eAAAC;AAAA,IACA,gBAAAC;AAAA,IACA,gBAAAC;AAAA,IACA,kBAAAC;AAAA,IACA,cAAAC;AAAA,IACA,cAAAC;AAAA,IACA,gBAAAC;AAAA,IACA,cAAAC;AAAA,IACA,UAAAC;AAAA,IACA,gBAAAC;AAAA,IACA,QAAAC;AAAA,IACA,uBAAAC;AAAA,IACA,eAAAC;AAAA,IACA,YAAAC;AAAA,IACA,cAAAC;AAAA,IACA,iBAAAC;AAAA,IACA,aAAAC;AAAA,IACA,gBAAAC;AAAA,IACA,mBAAAC;AAAA,IACA,eAAAC;AAAA,IACA,cAAAC;AAAA,IACA,aAAAC;AAAA,IACA,mBAAAC;AAAA,IACA,aAAAC;AAAA,IACA,sBAAAC;AAAA,IACA,aAAAC;AAAA,IACA,aAAAC;AAAA,IACA,YAAAC;AAAA,IACA,UAAAC;AAAA,IACA,cAAAC;AAAA,IACA,gBAAAC;AAAA,IACA,wBAAAC;AAAA,EACE,
|
|
1
|
+
{"version":3,"file":"milestone-list.js","sources":["../../../../../src/features/milestone/milestone-list-container/milestone-list/milestone-list.tsx"],"sourcesContent":["import { memo, useCallback, Fragment, type FC } from 'react';\nimport { v4 as uuidv4 } from 'uuid';\n\nimport useLazyRef from '../../../hooks/use-lazy-ref';\nimport ArrowTooltip from '../../../ui/arrow-tooltip/arrow-tooltip';\nimport TextButton from '../../../ui/buttons/text-button/text-button';\nimport FlexView from '../../../ui/layout/flex-view';\nimport Separator from '../../../ui/separator/separator';\nimport Text from '../../../ui/text/text';\nimport type { IMilestoneListProps } from './milestone-list-types';\nimport MilestoneWidget from './milestone-widget/milestone-widget';\nimport NoActiveMilestone from './no-active-milestone/no-active-milestone';\n\nconst MilestoneList: FC<IMilestoneListProps> = memo(function MilestoneList({\n milestones,\n studentId,\n milestoneType,\n ...restMilestoneListProps\n}) {\n const {\n canCreatePlan,\n isClassOngoing,\n isFiltersAdded,\n isStudentPresent,\n onAddChapter,\n onAddOutcome,\n onChapterClick,\n onCreatePlan,\n onDelete,\n onDraftPublish,\n onEdit,\n onCreateMilestoneTest,\n onNodeAttempt,\n onNodeView,\n onNodeReview,\n onNodeReattempt,\n onNodeReset,\n onNodeUnassign,\n onAssignResources,\n onTestPreview,\n onTestReview,\n onTestStart,\n activeMilestoneId,\n activeTabId,\n onWidgetTabSelection,\n studentName,\n teacherName,\n parentName,\n userType,\n courseStream,\n isTrialSession,\n onNodeAssignAsHomework,\n onMathFitClick,\n } = restMilestoneListProps;\n\n const isMilestoneActive = milestoneType === 'ACTIVE';\n const isDraftMilestone = milestoneType === 'DRAFT';\n const temporaryMilestoneId = useLazyRef(uuidv4);\n\n const handleCreatePlan = useCallback(() => {\n onCreatePlan?.(temporaryMilestoneId);\n }, [onCreatePlan, temporaryMilestoneId]);\n\n const handleOnAddOutcome = useCallback(() => {\n onAddOutcome?.();\n }, [onAddOutcome]);\n\n if (!milestones) return null;\n\n const activeMilestonePresent = milestones.some(\n milestone => milestone.milestone_state === 'ACTIVE',\n );\n const draftMilestonePresent = milestones.some(milestone => milestone.milestone_state === 'DRAFT');\n\n return (\n <>\n {isMilestoneActive && !activeMilestonePresent && (\n <FlexView $marginBottom={40}>\n <NoActiveMilestone\n canCreatePlan={canCreatePlan}\n isDraftMilestonePresent={draftMilestonePresent}\n isFiltersAdded={isFiltersAdded}\n onCreatePlan={onCreatePlan}\n studentName={studentName}\n userType={userType}\n />\n </FlexView>\n )}\n\n {isMilestoneActive && (\n <FlexView $flexDirection=\"row\" $justifyContent=\"space-between\" $marginBottom={16}>\n <Text $renderAs=\"ac4\">Goals ({milestones.length})</Text>\n\n {userType === 'TEACHER' && (\n <FlexView $flexDirection=\"row\" $flexGapX={1}>\n <ArrowTooltip\n renderAs=\"primary\"\n tooltipItem=\"Goals can only be added for students who have joined the class\"\n hidden={canCreatePlan}\n position=\"bottom\"\n >\n <TextButton\n label=\"Create Goal\"\n size=\"small\"\n onClick={handleCreatePlan}\n disabled={!canCreatePlan}\n />\n </ArrowTooltip>\n <TextButton label=\"Add Milestone\" size=\"small\" onClick={handleOnAddOutcome} />\n </FlexView>\n )}\n </FlexView>\n )}\n\n {milestones.map((milestone, idx) => {\n const { id: milestoneId } = milestone;\n\n return (\n <Fragment key={`milestone=${milestoneId}`}>\n <MilestoneWidget\n milestone={milestone}\n studentId={studentId}\n studentName={studentName}\n parentName={parentName}\n teacherName={teacherName}\n userType={userType}\n onAddOutcome={onAddOutcome}\n onChapterClick={onChapterClick}\n isMilestoneActive={isMilestoneActive || isDraftMilestone}\n milestoneType={milestoneType}\n onEdit={onEdit}\n onCreateMilestoneTest={onCreateMilestoneTest}\n onAddChapter={onAddChapter}\n onDelete={onDelete}\n onDraftPublish={onDraftPublish}\n isClassOngoing={isClassOngoing}\n isStudentPresent={isStudentPresent}\n onAssignResources={onAssignResources}\n onNodeAttempt={onNodeAttempt}\n onNodeView={onNodeView}\n onNodeReview={onNodeReview}\n onNodeReattempt={onNodeReattempt}\n onNodeReset={onNodeReset}\n onNodeUnassign={onNodeUnassign}\n onNodeAssignAsHomework={onNodeAssignAsHomework}\n onTestPreview={onTestPreview}\n onTestReview={onTestReview}\n onTestStart={onTestStart}\n courseStream={courseStream}\n activeMilestoneId={activeMilestoneId}\n activeTabId={activeTabId}\n onWidgetTabSelection={onWidgetTabSelection}\n isTrialSession={isTrialSession}\n onMathFitClick={onMathFitClick}\n />\n {idx !== milestones.length - 1 && <Separator heightX={2} />}\n </Fragment>\n );\n })}\n </>\n );\n});\n\nexport default MilestoneList;\n"],"names":["MilestoneList","memo","milestones","studentId","milestoneType","restMilestoneListProps","canCreatePlan","isClassOngoing","isFiltersAdded","isStudentPresent","onAddChapter","onAddOutcome","onChapterClick","onCreatePlan","onDelete","onDraftPublish","onEdit","onCreateMilestoneTest","onNodeAttempt","onNodeView","onNodeReview","onNodeReattempt","onNodeReset","onNodeUnassign","onAssignResources","onTestPreview","onTestReview","onTestStart","activeMilestoneId","activeTabId","onWidgetTabSelection","studentName","teacherName","parentName","userType","courseStream","isTrialSession","onNodeAssignAsHomework","onMathFitClick","isMilestoneActive","isDraftMilestone","temporaryMilestoneId","useLazyRef","uuidv4","handleCreatePlan","useCallback","handleOnAddOutcome","activeMilestonePresent","milestone","draftMilestonePresent","jsxs","Fragment","jsx","FlexView","NoActiveMilestone","Text","ArrowTooltip","TextButton","idx","milestoneId","MilestoneWidget","Separator"],"mappings":";;;;;;;;;;;AAaM,MAAAA,KAAyCC,EAAK,SAAuB;AAAA,EACzE,YAAAC;AAAA,EACA,WAAAC;AAAA,EACA,eAAAC;AAAA,EACA,GAAGC;AACL,GAAG;AACK,QAAA;AAAA,IACJ,eAAAC;AAAA,IACA,gBAAAC;AAAA,IACA,gBAAAC;AAAA,IACA,kBAAAC;AAAA,IACA,cAAAC;AAAA,IACA,cAAAC;AAAA,IACA,gBAAAC;AAAA,IACA,cAAAC;AAAA,IACA,UAAAC;AAAA,IACA,gBAAAC;AAAA,IACA,QAAAC;AAAA,IACA,uBAAAC;AAAA,IACA,eAAAC;AAAA,IACA,YAAAC;AAAA,IACA,cAAAC;AAAA,IACA,iBAAAC;AAAA,IACA,aAAAC;AAAA,IACA,gBAAAC;AAAA,IACA,mBAAAC;AAAA,IACA,eAAAC;AAAA,IACA,cAAAC;AAAA,IACA,aAAAC;AAAA,IACA,mBAAAC;AAAA,IACA,aAAAC;AAAA,IACA,sBAAAC;AAAA,IACA,aAAAC;AAAA,IACA,aAAAC;AAAA,IACA,YAAAC;AAAA,IACA,UAAAC;AAAA,IACA,cAAAC;AAAA,IACA,gBAAAC;AAAA,IACA,wBAAAC;AAAA,IACA,gBAAAC;AAAA,EACE,IAAAjC,GAEEkC,IAAoBnC,MAAkB,UACtCoC,IAAmBpC,MAAkB,SACrCqC,IAAuBC,GAAWC,EAAM,GAExCC,IAAmBC,EAAY,MAAM;AACzC,IAAAhC,KAAA,QAAAA,EAA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