@cuemath/leap 3.1.22-beta-0.1 → 3.1.22-beta-0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/features/chapters/chapter/chapter.js +86 -95
- package/dist/features/chapters/chapter/chapter.js.map +1 -1
- package/dist/features/milestone/milestone-list-container/milestone-list/milestone-list.js +90 -80
- package/dist/features/milestone/milestone-list-container/milestone-list/milestone-list.js.map +1 -1
- package/dist/features/milestone/milestone-list-container/milestone-list/no-active-milestone/no-active-milestone.js +44 -34
- package/dist/features/milestone/milestone-list-container/milestone-list/no-active-milestone/no-active-milestone.js.map +1 -1
- package/package.json +1 -1
@@ -1,116 +1,107 @@
|
|
1
1
|
import { jsxs as g, jsx as e } from "react/jsx-runtime";
|
2
|
-
import { memo as F, useCallback as
|
2
|
+
import { memo as F, useCallback as C } from "react";
|
3
3
|
import { ILLUSTRATIONS as O } from "../../../assets/illustrations/illustrations.js";
|
4
|
-
import
|
5
|
-
import
|
6
|
-
import
|
7
|
-
import
|
8
|
-
import
|
9
|
-
import { ContentWrapper as
|
10
|
-
const
|
11
|
-
({ name:
|
4
|
+
import _ from "../../ui/layout/flex-view.js";
|
5
|
+
import U from "../../ui/separator/separator.js";
|
6
|
+
import H from "./comps/chapter-banner/chapter-banner.js";
|
7
|
+
import M from "./comps/core-lessons/core-lessons.js";
|
8
|
+
import Q from "./comps/supplementary-resources/supplementary-resources.js";
|
9
|
+
import { ContentWrapper as W, LoaderWrapper as X } from "./styled.js";
|
10
|
+
const j = F(
|
11
|
+
({ name: S, sheets_data: $, user_type: n, loading: a, ...k }) => {
|
12
12
|
const {
|
13
13
|
user_chapter_progress: s,
|
14
14
|
is_defocused: r,
|
15
15
|
image_url: w,
|
16
16
|
image_hue: i,
|
17
17
|
teacherId: x,
|
18
|
-
onCreateExtraPractice:
|
18
|
+
onCreateExtraPractice: t,
|
19
19
|
onStart: p,
|
20
20
|
onResume: m,
|
21
|
-
onReattempt:
|
22
|
-
onPreview:
|
21
|
+
onReattempt: l,
|
22
|
+
onPreview: c,
|
23
23
|
onReview: u,
|
24
24
|
onReset: h,
|
25
25
|
onChangeLocation: d,
|
26
26
|
onMarkAsFamiliar: f,
|
27
|
-
onUnlock:
|
28
|
-
onMarkRelevant:
|
29
|
-
onMarkIrrelevant:
|
30
|
-
onUnAssignSheet:
|
31
|
-
onLearningPlanFAQClick:
|
32
|
-
} =
|
27
|
+
onUnlock: L,
|
28
|
+
onMarkRelevant: P,
|
29
|
+
onMarkIrrelevant: E,
|
30
|
+
onUnAssignSheet: I,
|
31
|
+
onLearningPlanFAQClick: o
|
32
|
+
} = k, {
|
33
33
|
lessons: R,
|
34
|
-
supplementary_sheets_group_sort_order:
|
35
|
-
supplementary_sheets_grouped:
|
36
|
-
} =
|
37
|
-
if (typeof t != "function")
|
38
|
-
throw new Error("onLearningPlanFAQClick must be a function");
|
39
|
-
t();
|
40
|
-
}, [t]), v = _(() => {
|
34
|
+
supplementary_sheets_group_sort_order: y,
|
35
|
+
supplementary_sheets_grouped: A
|
36
|
+
} = $, b = C(() => {
|
41
37
|
if (typeof o != "function")
|
42
|
-
throw new Error("
|
38
|
+
throw new Error("onLearningPlanFAQClick must be a function");
|
43
39
|
o();
|
44
|
-
}, [o])
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
/* @__PURE__ */ e(H, { height: 1 })
|
108
|
-
] })
|
109
|
-
]
|
110
|
-
}
|
111
|
-
);
|
40
|
+
}, [o]), v = C(() => {
|
41
|
+
if (typeof t != "function")
|
42
|
+
throw new Error("onCreateExtraPractice must be a function");
|
43
|
+
t();
|
44
|
+
}, [t]);
|
45
|
+
return /* @__PURE__ */ g(W, { $disablePointerEvents: a, $alignItems: "center", $width: "100%", children: [
|
46
|
+
a && /* @__PURE__ */ e(X, { children: /* @__PURE__ */ e("img", { src: O.LOADER_1, alt: "loader" }) }),
|
47
|
+
/* @__PURE__ */ e(
|
48
|
+
H,
|
49
|
+
{
|
50
|
+
name: S,
|
51
|
+
userChapterProgress: s,
|
52
|
+
isDefocused: r,
|
53
|
+
imageUrl: w,
|
54
|
+
backgroundColor: `${i}_1`
|
55
|
+
}
|
56
|
+
),
|
57
|
+
/* @__PURE__ */ e(_, { $widthX: 47.5, $flexGapX: 2, children: /* @__PURE__ */ e(
|
58
|
+
M,
|
59
|
+
{
|
60
|
+
userType: n,
|
61
|
+
lessons: R,
|
62
|
+
userChapterProgress: s,
|
63
|
+
isDefocused: r,
|
64
|
+
lessonItemColorHue: i,
|
65
|
+
handleOnLearningPlanFAQClick: b,
|
66
|
+
onChangeLocation: d,
|
67
|
+
onPreview: c,
|
68
|
+
onReset: h,
|
69
|
+
onReview: u,
|
70
|
+
onStart: p,
|
71
|
+
onReattempt: l,
|
72
|
+
onResume: m,
|
73
|
+
onMarkAsFamiliar: f,
|
74
|
+
onMarkIrrelevant: E,
|
75
|
+
onMarkRelevant: P
|
76
|
+
}
|
77
|
+
) }),
|
78
|
+
/* @__PURE__ */ g(_, { $width: "100%", $flexGapX: 2, $background: "WHITE_3", $alignItems: "center", children: [
|
79
|
+
/* @__PURE__ */ e(
|
80
|
+
Q,
|
81
|
+
{
|
82
|
+
userType: n,
|
83
|
+
teacherId: x,
|
84
|
+
groupedSupplementarySheets: A,
|
85
|
+
groupedSupplementarySheetsSortOrder: y,
|
86
|
+
isDefocused: r,
|
87
|
+
handleOnCreateExtraPractice: v,
|
88
|
+
onChangeLocation: d,
|
89
|
+
onPreview: c,
|
90
|
+
onReset: h,
|
91
|
+
onReview: u,
|
92
|
+
onStart: p,
|
93
|
+
onReattempt: l,
|
94
|
+
onResume: m,
|
95
|
+
onMarkAsFamiliar: f,
|
96
|
+
onUnlock: L,
|
97
|
+
onUnAssignSheet: I
|
98
|
+
}
|
99
|
+
),
|
100
|
+
/* @__PURE__ */ e(U, { height: 1 })
|
101
|
+
] })
|
102
|
+
] });
|
112
103
|
}
|
113
|
-
), K =
|
104
|
+
), K = j;
|
114
105
|
export {
|
115
106
|
K as default
|
116
107
|
};
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"chapter.js","sources":["../../../../src/features/chapters/chapter/chapter.tsx"],"sourcesContent":["import type { IChapterProps } from './chapter-types';\n\nimport { useCallback, type FC, memo } from 'react';\n\nimport { ILLUSTRATIONS } from '../../../assets/illustrations/illustrations';\nimport FlexView from '../../ui/layout/flex-view';\nimport Separator from '../../ui/separator/separator';\nimport ChapterBanner from './comps/chapter-banner/chapter-banner';\nimport CoreLessons from './comps/core-lessons/core-lessons';\nimport SupplementaryResources from './comps/supplementary-resources/supplementary-resources';\nimport * as Styled from './styled';\n\nconst Chapter: FC<IChapterProps> = memo(\n ({ name, sheets_data: sheetData, user_type: userType, loading, ...restChapterProps }) => {\n const {\n user_chapter_progress: userChapterProgress,\n is_defocused: isDefocused,\n image_url: imageUrl,\n image_hue: imageHue,\n teacherId,\n onCreateExtraPractice,\n onStart,\n onResume,\n onReattempt,\n onPreview,\n onReview,\n onReset,\n onChangeLocation,\n onMarkAsFamiliar,\n onUnlock,\n onMarkRelevant,\n onMarkIrrelevant,\n onUnAssignSheet,\n onLearningPlanFAQClick,\n } = restChapterProps;\n\n const {\n lessons,\n supplementary_sheets_group_sort_order: groupedSupplementarySheetsSortOrder,\n supplementary_sheets_grouped: groupedSupplementarySheets,\n } = sheetData;\n\n const handleOnLearningPlanFAQClick = useCallback(() => {\n if (typeof onLearningPlanFAQClick !== 'function') {\n throw new Error('onLearningPlanFAQClick must be a function');\n }\n\n onLearningPlanFAQClick();\n }, [onLearningPlanFAQClick]);\n\n const handleOnCreateExtraPractice = useCallback(() => {\n if (typeof onCreateExtraPractice !== 'function') {\n throw new Error('onCreateExtraPractice must be a function');\n }\n\n onCreateExtraPractice();\n }, [onCreateExtraPractice]);\n\n return (\n <Styled.ContentWrapper
|
1
|
+
{"version":3,"file":"chapter.js","sources":["../../../../src/features/chapters/chapter/chapter.tsx"],"sourcesContent":["import type { IChapterProps } from './chapter-types';\n\nimport { useCallback, type FC, memo } from 'react';\n\nimport { ILLUSTRATIONS } from '../../../assets/illustrations/illustrations';\nimport FlexView from '../../ui/layout/flex-view';\nimport Separator from '../../ui/separator/separator';\nimport ChapterBanner from './comps/chapter-banner/chapter-banner';\nimport CoreLessons from './comps/core-lessons/core-lessons';\nimport SupplementaryResources from './comps/supplementary-resources/supplementary-resources';\nimport * as Styled from './styled';\n\nconst Chapter: FC<IChapterProps> = memo(\n ({ name, sheets_data: sheetData, user_type: userType, loading, ...restChapterProps }) => {\n const {\n user_chapter_progress: userChapterProgress,\n is_defocused: isDefocused,\n image_url: imageUrl,\n image_hue: imageHue,\n teacherId,\n onCreateExtraPractice,\n onStart,\n onResume,\n onReattempt,\n onPreview,\n onReview,\n onReset,\n onChangeLocation,\n onMarkAsFamiliar,\n onUnlock,\n onMarkRelevant,\n onMarkIrrelevant,\n onUnAssignSheet,\n onLearningPlanFAQClick,\n } = restChapterProps;\n\n const {\n lessons,\n supplementary_sheets_group_sort_order: groupedSupplementarySheetsSortOrder,\n supplementary_sheets_grouped: groupedSupplementarySheets,\n } = sheetData;\n\n const handleOnLearningPlanFAQClick = useCallback(() => {\n if (typeof onLearningPlanFAQClick !== 'function') {\n throw new Error('onLearningPlanFAQClick must be a function');\n }\n\n onLearningPlanFAQClick();\n }, [onLearningPlanFAQClick]);\n\n const handleOnCreateExtraPractice = useCallback(() => {\n if (typeof onCreateExtraPractice !== 'function') {\n throw new Error('onCreateExtraPractice must be a function');\n }\n\n onCreateExtraPractice();\n }, [onCreateExtraPractice]);\n\n return (\n <Styled.ContentWrapper $disablePointerEvents={loading} $alignItems=\"center\" $width=\"100%\">\n {loading && (\n <Styled.LoaderWrapper>\n <img src={ILLUSTRATIONS.LOADER_1} alt=\"loader\" />\n </Styled.LoaderWrapper>\n )}\n\n <ChapterBanner\n name={name}\n userChapterProgress={userChapterProgress}\n isDefocused={isDefocused}\n imageUrl={imageUrl}\n backgroundColor={`${imageHue}_1`}\n />\n <FlexView $widthX={47.5} $flexGapX={2}>\n <CoreLessons\n userType={userType}\n lessons={lessons}\n userChapterProgress={userChapterProgress}\n isDefocused={isDefocused}\n lessonItemColorHue={imageHue}\n handleOnLearningPlanFAQClick={handleOnLearningPlanFAQClick}\n onChangeLocation={onChangeLocation}\n onPreview={onPreview}\n onReset={onReset}\n onReview={onReview}\n onStart={onStart}\n onReattempt={onReattempt}\n onResume={onResume}\n onMarkAsFamiliar={onMarkAsFamiliar}\n onMarkIrrelevant={onMarkIrrelevant}\n onMarkRelevant={onMarkRelevant}\n />\n </FlexView>\n\n <FlexView $width=\"100%\" $flexGapX={2} $background=\"WHITE_3\" $alignItems=\"center\">\n <SupplementaryResources\n userType={userType}\n teacherId={teacherId}\n groupedSupplementarySheets={groupedSupplementarySheets}\n groupedSupplementarySheetsSortOrder={groupedSupplementarySheetsSortOrder}\n isDefocused={isDefocused}\n handleOnCreateExtraPractice={handleOnCreateExtraPractice}\n onChangeLocation={onChangeLocation}\n onPreview={onPreview}\n onReset={onReset}\n onReview={onReview}\n onStart={onStart}\n onReattempt={onReattempt}\n onResume={onResume}\n onMarkAsFamiliar={onMarkAsFamiliar}\n onUnlock={onUnlock}\n onUnAssignSheet={onUnAssignSheet}\n />\n\n <Separator height={1} />\n </FlexView>\n </Styled.ContentWrapper>\n );\n },\n);\n\nexport default Chapter;\n"],"names":["Chapter","memo","name","sheetData","userType","loading","restChapterProps","userChapterProgress","isDefocused","imageUrl","imageHue","teacherId","onCreateExtraPractice","onStart","onResume","onReattempt","onPreview","onReview","onReset","onChangeLocation","onMarkAsFamiliar","onUnlock","onMarkRelevant","onMarkIrrelevant","onUnAssignSheet","onLearningPlanFAQClick","lessons","groupedSupplementarySheetsSortOrder","groupedSupplementarySheets","handleOnLearningPlanFAQClick","useCallback","handleOnCreateExtraPractice","jsxs","Styled.ContentWrapper","jsx","Styled.LoaderWrapper","ILLUSTRATIONS","ChapterBanner","FlexView","CoreLessons","SupplementaryResources","Separator","Chapter$1"],"mappings":";;;;;;;;;AAYA,MAAMA,IAA6BC;AAAA,EACjC,CAAC,EAAE,MAAAC,GAAM,aAAaC,GAAW,WAAWC,GAAU,SAAAC,GAAS,GAAGC,QAAuB;AACjF,UAAA;AAAA,MACJ,uBAAuBC;AAAA,MACvB,cAAcC;AAAA,MACd,WAAWC;AAAA,MACX,WAAWC;AAAA,MACX,WAAAC;AAAA,MACA,uBAAAC;AAAA,MACA,SAAAC;AAAA,MACA,UAAAC;AAAA,MACA,aAAAC;AAAA,MACA,WAAAC;AAAA,MACA,UAAAC;AAAA,MACA,SAAAC;AAAA,MACA,kBAAAC;AAAA,MACA,kBAAAC;AAAA,MACA,UAAAC;AAAA,MACA,gBAAAC;AAAA,MACA,kBAAAC;AAAA,MACA,iBAAAC;AAAA,MACA,wBAAAC;AAAA,IACE,IAAAnB,GAEE;AAAA,MACJ,SAAAoB;AAAA,MACA,uCAAuCC;AAAA,MACvC,8BAA8BC;AAAA,IAC5B,IAAAzB,GAEE0B,IAA+BC,EAAY,MAAM;AACjD,UAAA,OAAOL,KAA2B;AAC9B,cAAA,IAAI,MAAM,2CAA2C;AAGtC,MAAAA;IAAA,GACtB,CAACA,CAAsB,CAAC,GAErBM,IAA8BD,EAAY,MAAM;AAChD,UAAA,OAAOlB,KAA0B;AAC7B,cAAA,IAAI,MAAM,0CAA0C;AAGtC,MAAAA;IAAA,GACrB,CAACA,CAAqB,CAAC;AAGxB,WAAA,gBAAAoB,EAACC,GAAA,EAAsB,uBAAuB5B,GAAS,aAAY,UAAS,QAAO,QAChF,UAAA;AAAA,MACCA,KAAA,gBAAA6B,EAACC,GAAA,EACC,UAAA,gBAAAD,EAAC,OAAI,EAAA,KAAKE,EAAc,UAAU,KAAI,SAAA,CAAS,EACjD,CAAA;AAAA,MAGF,gBAAAF;AAAA,QAACG;AAAA,QAAA;AAAA,UACC,MAAAnC;AAAA,UACA,qBAAAK;AAAA,UACA,aAAAC;AAAA,UACA,UAAAC;AAAA,UACA,iBAAiB,GAAGC,CAAQ;AAAA,QAAA;AAAA,MAC9B;AAAA,MACC,gBAAAwB,EAAAI,GAAA,EAAS,SAAS,MAAM,WAAW,GAClC,UAAA,gBAAAJ;AAAA,QAACK;AAAA,QAAA;AAAA,UACC,UAAAnC;AAAA,UACA,SAAAsB;AAAA,UACA,qBAAAnB;AAAA,UACA,aAAAC;AAAA,UACA,oBAAoBE;AAAA,UACpB,8BAAAmB;AAAA,UACA,kBAAAV;AAAA,UACA,WAAAH;AAAA,UACA,SAAAE;AAAA,UACA,UAAAD;AAAA,UACA,SAAAJ;AAAA,UACA,aAAAE;AAAA,UACA,UAAAD;AAAA,UACA,kBAAAM;AAAA,UACA,kBAAAG;AAAA,UACA,gBAAAD;AAAA,QAAA;AAAA,MAAA,GAEJ;AAAA,MAEA,gBAAAU,EAACM,KAAS,QAAO,QAAO,WAAW,GAAG,aAAY,WAAU,aAAY,UACtE,UAAA;AAAA,QAAA,gBAAAJ;AAAA,UAACM;AAAA,UAAA;AAAA,YACC,UAAApC;AAAA,YACA,WAAAO;AAAA,YACA,4BAAAiB;AAAA,YACA,qCAAAD;AAAA,YACA,aAAAnB;AAAA,YACA,6BAAAuB;AAAA,YACA,kBAAAZ;AAAA,YACA,WAAAH;AAAA,YACA,SAAAE;AAAA,YACA,UAAAD;AAAA,YACA,SAAAJ;AAAA,YACA,aAAAE;AAAA,YACA,UAAAD;AAAA,YACA,kBAAAM;AAAA,YACA,UAAAC;AAAA,YACA,iBAAAG;AAAA,UAAA;AAAA,QACF;AAAA,QAEA,gBAAAU,EAACO,GAAU,EAAA,QAAQ,EAAG,CAAA;AAAA,MAAA,GACxB;AAAA,IACF,EAAA,CAAA;AAAA,EAEJ;AACF,GAEAC,IAAe1C;"}
|
@@ -1,136 +1,146 @@
|
|
1
|
-
import { jsxs as
|
2
|
-
import Q, { memo as Y, useCallback as
|
1
|
+
import { jsxs as i, Fragment as K, jsx as e } from "react/jsx-runtime";
|
2
|
+
import Q, { memo as Y, useCallback as f } from "react";
|
3
3
|
import Z from "../../../hooks/use-lazy-ref.js";
|
4
|
+
import ee from "../../../ui/arrow-tooltip/arrow-tooltip.js";
|
4
5
|
import h from "../../../ui/buttons/text-button/text-button.js";
|
5
|
-
import
|
6
|
-
import
|
7
|
-
import
|
8
|
-
import
|
9
|
-
import
|
6
|
+
import m from "../../../ui/layout/flex-view.js";
|
7
|
+
import te from "../../../ui/separator/separator.js";
|
8
|
+
import oe from "../../../ui/text/text.js";
|
9
|
+
import ne from "./milestone-widget/milestone-widget.js";
|
10
|
+
import re from "./no-active-milestone/no-active-milestone.js";
|
10
11
|
import ie from "../../../../node_modules/uuid/dist/esm-browser/v4.js";
|
11
|
-
const
|
12
|
-
({ milestones:
|
12
|
+
const ge = Y(
|
13
|
+
({ milestones: t, studentId: A, milestoneType: s, ...u }) => {
|
13
14
|
const {
|
14
|
-
canCreatePlan:
|
15
|
+
canCreatePlan: a,
|
15
16
|
isClassOngoing: g,
|
16
17
|
isFiltersAdded: C,
|
17
18
|
isStudentPresent: M,
|
18
19
|
onAddChapter: T,
|
19
20
|
onAddOutcome: n,
|
20
|
-
onChapterClick:
|
21
|
-
onCreatePlan:
|
22
|
-
onDelete:
|
23
|
-
onDraftPublish:
|
24
|
-
onEdit:
|
25
|
-
onCreateMilestoneTest:
|
26
|
-
onNodeAttempt:
|
21
|
+
onChapterClick: v,
|
22
|
+
onCreatePlan: r,
|
23
|
+
onDelete: w,
|
24
|
+
onDraftPublish: N,
|
25
|
+
onEdit: b,
|
26
|
+
onCreateMilestoneTest: R,
|
27
|
+
onNodeAttempt: x,
|
27
28
|
onNodeView: D,
|
28
29
|
onNodeReview: $,
|
29
|
-
onNodeReattempt:
|
30
|
-
onNodeReset:
|
31
|
-
onNodeUnassign:
|
30
|
+
onNodeReattempt: I,
|
31
|
+
onNodeReset: P,
|
32
|
+
onNodeUnassign: F,
|
32
33
|
onAssignResources: k,
|
33
34
|
onTestPreview: E,
|
34
35
|
onTestReview: S,
|
35
|
-
onTestStart:
|
36
|
-
activeMilestoneId:
|
37
|
-
activeTabId:
|
38
|
-
onWidgetTabSelection:
|
36
|
+
onTestStart: j,
|
37
|
+
activeMilestoneId: y,
|
38
|
+
activeTabId: G,
|
39
|
+
onWidgetTabSelection: V,
|
39
40
|
studentName: c,
|
40
|
-
teacherName:
|
41
|
-
parentName:
|
42
|
-
userType:
|
43
|
-
courseStream:
|
41
|
+
teacherName: _,
|
42
|
+
parentName: z,
|
43
|
+
userType: l,
|
44
|
+
courseStream: B,
|
44
45
|
onNodeAssignAsHomework: H
|
45
|
-
} =
|
46
|
-
|
47
|
-
}, [
|
46
|
+
} = u, d = s === "ACTIVE", L = s === "DRAFT", p = Z(ie), O = f(() => {
|
47
|
+
r == null || r(p);
|
48
|
+
}, [r, p]), W = f(() => {
|
48
49
|
n == null || n();
|
49
50
|
}, [n]);
|
50
|
-
if (!
|
51
|
-
const X =
|
52
|
-
(
|
53
|
-
), U =
|
54
|
-
(
|
51
|
+
if (!t) return null;
|
52
|
+
const X = t.some(
|
53
|
+
(o) => o.milestone_state === "ACTIVE"
|
54
|
+
), U = t.some(
|
55
|
+
(o) => o.milestone_state === "DRAFT"
|
55
56
|
);
|
56
|
-
return /* @__PURE__ */
|
57
|
-
|
58
|
-
|
57
|
+
return /* @__PURE__ */ i(K, { children: [
|
58
|
+
d && !X && /* @__PURE__ */ e(m, { $marginBottom: 40, children: /* @__PURE__ */ e(
|
59
|
+
re,
|
59
60
|
{
|
60
|
-
canCreatePlan:
|
61
|
+
canCreatePlan: a,
|
61
62
|
isDraftMilestonePresent: U,
|
62
63
|
isFiltersAdded: C,
|
63
|
-
onCreatePlan:
|
64
|
+
onCreatePlan: r,
|
64
65
|
studentName: c,
|
65
|
-
userType:
|
66
|
+
userType: l
|
66
67
|
}
|
67
68
|
) }),
|
68
|
-
|
69
|
-
/* @__PURE__ */
|
69
|
+
d && /* @__PURE__ */ i(m, { $flexDirection: "row", $justifyContent: "space-between", $marginBottom: 16, children: [
|
70
|
+
/* @__PURE__ */ i(oe, { $renderAs: "ac4", children: [
|
70
71
|
"Goals (",
|
71
|
-
|
72
|
+
t.length,
|
72
73
|
")"
|
73
74
|
] }),
|
74
|
-
|
75
|
-
/* @__PURE__ */
|
76
|
-
|
75
|
+
l === "TEACHER" && /* @__PURE__ */ i(m, { $flexDirection: "row", $flexGapX: 1, children: [
|
76
|
+
/* @__PURE__ */ e(
|
77
|
+
ee,
|
77
78
|
{
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
79
|
+
renderAs: "primary",
|
80
|
+
tooltipItem: "Goals can only be added for students who have joined the class",
|
81
|
+
hidden: a,
|
82
|
+
position: "bottom",
|
83
|
+
children: /* @__PURE__ */ e(
|
84
|
+
h,
|
85
|
+
{
|
86
|
+
label: "Create Goal",
|
87
|
+
size: "small",
|
88
|
+
onClick: O,
|
89
|
+
disabled: !a
|
90
|
+
}
|
91
|
+
)
|
82
92
|
}
|
83
93
|
),
|
84
|
-
/* @__PURE__ */
|
94
|
+
/* @__PURE__ */ e(h, { label: "Add Milestone", size: "small", onClick: W })
|
85
95
|
] })
|
86
96
|
] }),
|
87
|
-
|
88
|
-
const { id: J } =
|
89
|
-
return /* @__PURE__ */
|
90
|
-
/* @__PURE__ */
|
91
|
-
|
97
|
+
t.map((o, q) => {
|
98
|
+
const { id: J } = o;
|
99
|
+
return /* @__PURE__ */ i(Q.Fragment, { children: [
|
100
|
+
/* @__PURE__ */ e(
|
101
|
+
ne,
|
92
102
|
{
|
93
|
-
milestone:
|
94
|
-
studentId:
|
103
|
+
milestone: o,
|
104
|
+
studentId: A,
|
95
105
|
studentName: c,
|
96
|
-
parentName:
|
97
|
-
teacherName:
|
98
|
-
userType:
|
106
|
+
parentName: z,
|
107
|
+
teacherName: _,
|
108
|
+
userType: l,
|
99
109
|
onAddOutcome: n,
|
100
|
-
onChapterClick:
|
101
|
-
isMilestoneActive:
|
110
|
+
onChapterClick: v,
|
111
|
+
isMilestoneActive: d || L,
|
102
112
|
milestoneType: s,
|
103
|
-
onEdit:
|
104
|
-
onCreateMilestoneTest:
|
113
|
+
onEdit: b,
|
114
|
+
onCreateMilestoneTest: R,
|
105
115
|
onAddChapter: T,
|
106
|
-
onDelete:
|
107
|
-
onDraftPublish:
|
116
|
+
onDelete: w,
|
117
|
+
onDraftPublish: N,
|
108
118
|
isClassOngoing: g,
|
109
119
|
isStudentPresent: M,
|
110
120
|
onAssignResources: k,
|
111
|
-
onNodeAttempt:
|
121
|
+
onNodeAttempt: x,
|
112
122
|
onNodeView: D,
|
113
123
|
onNodeReview: $,
|
114
|
-
onNodeReattempt:
|
115
|
-
onNodeReset:
|
116
|
-
onNodeUnassign:
|
124
|
+
onNodeReattempt: I,
|
125
|
+
onNodeReset: P,
|
126
|
+
onNodeUnassign: F,
|
117
127
|
onNodeAssignAsHomework: H,
|
118
128
|
onTestPreview: E,
|
119
129
|
onTestReview: S,
|
120
|
-
onTestStart:
|
121
|
-
courseStream:
|
122
|
-
activeMilestoneId:
|
123
|
-
activeTabId:
|
124
|
-
onWidgetTabSelection:
|
130
|
+
onTestStart: j,
|
131
|
+
courseStream: B,
|
132
|
+
activeMilestoneId: y,
|
133
|
+
activeTabId: G,
|
134
|
+
onWidgetTabSelection: V
|
125
135
|
}
|
126
136
|
),
|
127
|
-
q !==
|
137
|
+
q !== t.length - 1 && /* @__PURE__ */ e(te, { heightX: 2 })
|
128
138
|
] }, `milestone=${J}`);
|
129
139
|
})
|
130
140
|
] });
|
131
141
|
}
|
132
142
|
);
|
133
143
|
export {
|
134
|
-
|
144
|
+
ge as default
|
135
145
|
};
|
136
146
|
//# sourceMappingURL=milestone-list.js.map
|
package/dist/features/milestone/milestone-list-container/milestone-list/milestone-list.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"milestone-list.js","sources":["../../../../../src/features/milestone/milestone-list-container/milestone-list/milestone-list.tsx"],"sourcesContent":["import type { IMilestoneListProps } from './milestone-list-types';\n\nimport React, { memo, useCallback } from 'react';\nimport { v4 as uuidv4 } from 'uuid';\n\nimport useLazyRef from '../../../hooks/use-lazy-ref';\nimport TextButton from '../../../ui/buttons/text-button/text-button';\nimport FlexView from '../../../ui/layout/flex-view';\nimport Separator from '../../../ui/separator/separator';\nimport Text from '../../../ui/text/text';\nimport MilestoneWidget from './milestone-widget/milestone-widget';\nimport NoActiveMilestone from './no-active-milestone/no-active-milestone';\n\nconst MilestoneList: React.FC<IMilestoneListProps> = memo(\n ({ milestones, studentId, milestoneType, ...restMilestoneListProps }) => {\n const {\n canCreatePlan,\n isClassOngoing,\n isFiltersAdded,\n isStudentPresent,\n onAddChapter,\n onAddOutcome,\n onChapterClick,\n onCreatePlan,\n onDelete,\n onDraftPublish,\n onEdit,\n onCreateMilestoneTest,\n onNodeAttempt,\n onNodeView,\n onNodeReview,\n onNodeReattempt,\n onNodeReset,\n onNodeUnassign,\n onAssignResources,\n onTestPreview,\n onTestReview,\n onTestStart,\n activeMilestoneId,\n activeTabId,\n onWidgetTabSelection,\n studentName,\n teacherName,\n parentName,\n userType,\n courseStream,\n onNodeAssignAsHomework,\n } = restMilestoneListProps;\n\n const isMilestoneActive = milestoneType === 'ACTIVE';\n const isDraftMilestone = milestoneType === 'DRAFT';\n const temporaryMilestoneId = useLazyRef(uuidv4);\n\n const handleCreatePlan = useCallback(() => {\n onCreatePlan?.(temporaryMilestoneId);\n }, [onCreatePlan, temporaryMilestoneId]);\n\n const handleOnAddOutcome = useCallback(() => {\n onAddOutcome?.();\n }, [onAddOutcome]);\n\n if (!milestones) return null;\n\n const activeMilestonePresent = milestones.some(\n milestone => milestone.milestone_state === 'ACTIVE',\n );\n const draftMilestonePresent = milestones.some(\n milestone => milestone.milestone_state === 'DRAFT',\n );\n\n return (\n <>\n {isMilestoneActive && !activeMilestonePresent && (\n <FlexView $marginBottom={40}>\n <NoActiveMilestone\n canCreatePlan={canCreatePlan}\n isDraftMilestonePresent={draftMilestonePresent}\n isFiltersAdded={isFiltersAdded}\n onCreatePlan={onCreatePlan}\n studentName={studentName}\n userType={userType}\n />\n </FlexView>\n )}\n\n {isMilestoneActive && (\n <FlexView $flexDirection=\"row\" $justifyContent=\"space-between\" $marginBottom={16}>\n <Text $renderAs=\"ac4\">Goals ({milestones.length})</Text>\n\n {userType === 'TEACHER' && (\n <FlexView $flexDirection=\"row\" $flexGapX={1}>\n <TextButton\n
|
1
|
+
{"version":3,"file":"milestone-list.js","sources":["../../../../../src/features/milestone/milestone-list-container/milestone-list/milestone-list.tsx"],"sourcesContent":["import type { IMilestoneListProps } from './milestone-list-types';\n\nimport React, { memo, useCallback } from 'react';\nimport { v4 as uuidv4 } from 'uuid';\n\nimport useLazyRef from '../../../hooks/use-lazy-ref';\nimport ArrowTooltip from '../../../ui/arrow-tooltip/arrow-tooltip';\nimport TextButton from '../../../ui/buttons/text-button/text-button';\nimport FlexView from '../../../ui/layout/flex-view';\nimport Separator from '../../../ui/separator/separator';\nimport Text from '../../../ui/text/text';\nimport MilestoneWidget from './milestone-widget/milestone-widget';\nimport NoActiveMilestone from './no-active-milestone/no-active-milestone';\n\nconst MilestoneList: React.FC<IMilestoneListProps> = memo(\n ({ milestones, studentId, milestoneType, ...restMilestoneListProps }) => {\n const {\n canCreatePlan,\n isClassOngoing,\n isFiltersAdded,\n isStudentPresent,\n onAddChapter,\n onAddOutcome,\n onChapterClick,\n onCreatePlan,\n onDelete,\n onDraftPublish,\n onEdit,\n onCreateMilestoneTest,\n onNodeAttempt,\n onNodeView,\n onNodeReview,\n onNodeReattempt,\n onNodeReset,\n onNodeUnassign,\n onAssignResources,\n onTestPreview,\n onTestReview,\n onTestStart,\n activeMilestoneId,\n activeTabId,\n onWidgetTabSelection,\n studentName,\n teacherName,\n parentName,\n userType,\n courseStream,\n onNodeAssignAsHomework,\n } = restMilestoneListProps;\n\n const isMilestoneActive = milestoneType === 'ACTIVE';\n const isDraftMilestone = milestoneType === 'DRAFT';\n const temporaryMilestoneId = useLazyRef(uuidv4);\n\n const handleCreatePlan = useCallback(() => {\n onCreatePlan?.(temporaryMilestoneId);\n }, [onCreatePlan, temporaryMilestoneId]);\n\n const handleOnAddOutcome = useCallback(() => {\n onAddOutcome?.();\n }, [onAddOutcome]);\n\n if (!milestones) return null;\n\n const activeMilestonePresent = milestones.some(\n milestone => milestone.milestone_state === 'ACTIVE',\n );\n const draftMilestonePresent = milestones.some(\n milestone => milestone.milestone_state === 'DRAFT',\n );\n\n return (\n <>\n {isMilestoneActive && !activeMilestonePresent && (\n <FlexView $marginBottom={40}>\n <NoActiveMilestone\n canCreatePlan={canCreatePlan}\n isDraftMilestonePresent={draftMilestonePresent}\n isFiltersAdded={isFiltersAdded}\n onCreatePlan={onCreatePlan}\n studentName={studentName}\n userType={userType}\n />\n </FlexView>\n )}\n\n {isMilestoneActive && (\n <FlexView $flexDirection=\"row\" $justifyContent=\"space-between\" $marginBottom={16}>\n <Text $renderAs=\"ac4\">Goals ({milestones.length})</Text>\n\n {userType === 'TEACHER' && (\n <FlexView $flexDirection=\"row\" $flexGapX={1}>\n <ArrowTooltip\n renderAs=\"primary\"\n tooltipItem=\"Goals can only be added for students who have joined the class\"\n hidden={canCreatePlan}\n position=\"bottom\"\n >\n <TextButton\n label=\"Create Goal\"\n size=\"small\"\n onClick={handleCreatePlan}\n disabled={!canCreatePlan}\n />\n </ArrowTooltip>\n <TextButton label=\"Add Milestone\" size=\"small\" onClick={handleOnAddOutcome} />\n </FlexView>\n )}\n </FlexView>\n )}\n\n {milestones.map((milestone, idx) => {\n const { id: milestoneId } = milestone;\n\n return (\n <React.Fragment key={`milestone=${milestoneId}`}>\n <MilestoneWidget\n milestone={milestone}\n studentId={studentId}\n studentName={studentName}\n parentName={parentName}\n teacherName={teacherName}\n userType={userType}\n onAddOutcome={onAddOutcome}\n onChapterClick={onChapterClick}\n isMilestoneActive={isMilestoneActive || isDraftMilestone}\n milestoneType={milestoneType}\n onEdit={onEdit}\n onCreateMilestoneTest={onCreateMilestoneTest}\n onAddChapter={onAddChapter}\n onDelete={onDelete}\n onDraftPublish={onDraftPublish}\n isClassOngoing={isClassOngoing}\n isStudentPresent={isStudentPresent}\n onAssignResources={onAssignResources}\n onNodeAttempt={onNodeAttempt}\n onNodeView={onNodeView}\n onNodeReview={onNodeReview}\n onNodeReattempt={onNodeReattempt}\n onNodeReset={onNodeReset}\n onNodeUnassign={onNodeUnassign}\n onNodeAssignAsHomework={onNodeAssignAsHomework}\n onTestPreview={onTestPreview}\n onTestReview={onTestReview}\n onTestStart={onTestStart}\n courseStream={courseStream}\n activeMilestoneId={activeMilestoneId}\n activeTabId={activeTabId}\n onWidgetTabSelection={onWidgetTabSelection}\n />\n {idx !== milestones.length - 1 && <Separator heightX={2} />}\n </React.Fragment>\n );\n })}\n </>\n );\n },\n);\n\nexport default MilestoneList;\n"],"names":["MilestoneList","memo","milestones","studentId","milestoneType","restMilestoneListProps","canCreatePlan","isClassOngoing","isFiltersAdded","isStudentPresent","onAddChapter","onAddOutcome","onChapterClick","onCreatePlan","onDelete","onDraftPublish","onEdit","onCreateMilestoneTest","onNodeAttempt","onNodeView","onNodeReview","onNodeReattempt","onNodeReset","onNodeUnassign","onAssignResources","onTestPreview","onTestReview","onTestStart","activeMilestoneId","activeTabId","onWidgetTabSelection","studentName","teacherName","parentName","userType","courseStream","onNodeAssignAsHomework","isMilestoneActive","isDraftMilestone","temporaryMilestoneId","useLazyRef","uuidv4","handleCreatePlan","useCallback","handleOnAddOutcome","activeMilestonePresent","milestone","draftMilestonePresent","jsxs","Fragment","jsx","FlexView","NoActiveMilestone","Text","ArrowTooltip","TextButton","idx","milestoneId","React","MilestoneWidget","Separator"],"mappings":"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"}
|
@@ -1,28 +1,29 @@
|
|
1
|
-
import { jsxs as
|
1
|
+
import { jsxs as a, jsx as e } from "react/jsx-runtime";
|
2
2
|
import { memo as f, useCallback as h } from "react";
|
3
3
|
import $ from "styled-components";
|
4
|
-
import { ILLUSTRATIONS as
|
5
|
-
import
|
6
|
-
import
|
7
|
-
import
|
8
|
-
import
|
9
|
-
import
|
10
|
-
import {
|
11
|
-
import
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
4
|
+
import { ILLUSTRATIONS as b } from "../../../../../assets/illustrations/illustrations.js";
|
5
|
+
import u from "../../../../hooks/use-lazy-ref.js";
|
6
|
+
import w from "../../../../ui/arrow-tooltip/arrow-tooltip.js";
|
7
|
+
import A from "../../../../ui/buttons/button/button.js";
|
8
|
+
import g from "../../../../ui/image/image.js";
|
9
|
+
import d from "../../../../ui/layout/flex-view.js";
|
10
|
+
import { getNoMilestoneTitle as x } from "../../../create/utils/index.js";
|
11
|
+
import { StyledText as y } from "./no-active-milestone-styled.js";
|
12
|
+
import T from "../../../../../node_modules/uuid/dist/esm-browser/v4.js";
|
13
|
+
const I = $.span`
|
14
|
+
display: ${({ shouldShow: o }) => o ? "block" : "none"};
|
15
|
+
`, W = f(
|
16
|
+
({ userType: o, studentName: s, isDraftMilestonePresent: r, ...m }) => {
|
17
|
+
const { canCreatePlan: i, onCreatePlan: t, isFiltersAdded: l } = m, n = u(T), p = h(() => {
|
18
|
+
t == null || t(n);
|
19
|
+
}, [t, n]), c = x(
|
19
20
|
l,
|
20
|
-
|
21
|
-
|
22
|
-
|
21
|
+
r,
|
22
|
+
s,
|
23
|
+
o
|
23
24
|
);
|
24
|
-
return /* @__PURE__ */
|
25
|
-
|
25
|
+
return /* @__PURE__ */ a(
|
26
|
+
d,
|
26
27
|
{
|
27
28
|
$flexDirection: "row",
|
28
29
|
$gapX: 1.5,
|
@@ -33,26 +34,35 @@ const T = $.span`
|
|
33
34
|
$justifyContent: "space-between",
|
34
35
|
$alignItems: "center",
|
35
36
|
children: [
|
36
|
-
/* @__PURE__ */
|
37
|
-
/* @__PURE__ */
|
38
|
-
|
39
|
-
|
37
|
+
/* @__PURE__ */ a(d, { $flexGapX: 1, children: [
|
38
|
+
/* @__PURE__ */ e(y, { $renderAs: "ab2", $widthX: 19.5, children: c }),
|
39
|
+
o === "TEACHER" && /* @__PURE__ */ e(I, { shouldShow: !l, children: !r && /* @__PURE__ */ e(
|
40
|
+
w,
|
40
41
|
{
|
41
|
-
renderAs: "
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
42
|
+
renderAs: "primary",
|
43
|
+
tooltipItem: "Goals can only be added for students who have joined the class",
|
44
|
+
hidden: i,
|
45
|
+
position: "bottom",
|
46
|
+
children: /* @__PURE__ */ e(
|
47
|
+
A,
|
48
|
+
{
|
49
|
+
renderAs: "secondary",
|
50
|
+
size: "small",
|
51
|
+
label: "Add a Goal",
|
52
|
+
onClick: p,
|
53
|
+
disabled: !i
|
54
|
+
}
|
55
|
+
)
|
46
56
|
}
|
47
57
|
) })
|
48
58
|
] }),
|
49
|
-
/* @__PURE__ */
|
50
|
-
|
59
|
+
/* @__PURE__ */ e(
|
60
|
+
g,
|
51
61
|
{
|
52
62
|
withLoader: !1,
|
53
63
|
width: 240,
|
54
64
|
height: 100,
|
55
|
-
src:
|
65
|
+
src: b.PUZZLE_STUDENT,
|
56
66
|
alt: "learning-planner"
|
57
67
|
}
|
58
68
|
)
|
@@ -62,6 +72,6 @@ const T = $.span`
|
|
62
72
|
}
|
63
73
|
);
|
64
74
|
export {
|
65
|
-
|
75
|
+
W as default
|
66
76
|
};
|
67
77
|
//# sourceMappingURL=no-active-milestone.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"no-active-milestone.js","sources":["../../../../../../src/features/milestone/milestone-list-container/milestone-list/no-active-milestone/no-active-milestone.tsx"],"sourcesContent":["import type { INoActiveMilestoneProps } from './no-active-milestone-types';\n\nimport { useCallback, type FC, memo } from 'react';\nimport styled from 'styled-components';\nimport { v4 as uuidv4 } from 'uuid';\n\nimport { ILLUSTRATIONS } from '../../../../../assets/illustrations/illustrations';\nimport useLazyRef from '../../../../hooks/use-lazy-ref';\nimport Button from '../../../../ui/buttons/button/button';\nimport Image from '../../../../ui/image/image';\nimport FlexView from '../../../../ui/layout/flex-view';\nimport { getNoMilestoneTitle } from '../../../create/utils';\nimport * as Styled from './no-active-milestone-styled';\n\nconst ButtonWrapper = styled.span<{ shouldShow: boolean }>`\n display: ${({ shouldShow }) => (shouldShow ? 'block' : 'none')};\n`;\n\nconst NoActiveMilestone: FC<INoActiveMilestoneProps> = memo(\n ({ userType, studentName, isDraftMilestonePresent, ...restNoActiveMilestoneProps }) => {\n const { canCreatePlan, onCreatePlan, isFiltersAdded } = restNoActiveMilestoneProps;\n const temporaryMilestoneId = useLazyRef(uuidv4);\n\n const handleCreatePlan = useCallback(() => {\n onCreatePlan?.(temporaryMilestoneId);\n }, [onCreatePlan, temporaryMilestoneId]);\n\n const title = getNoMilestoneTitle(\n isFiltersAdded,\n isDraftMilestonePresent,\n studentName,\n userType,\n );\n\n return (\n <FlexView\n $flexDirection=\"row\"\n $gapX={1.5}\n $gutterX={1.5}\n $borderColor=\"WHITE_4\"\n $background=\"YELLOW_1\"\n $flexGapX={1}\n $justifyContent=\"space-between\"\n $alignItems=\"center\"\n >\n <FlexView $flexGapX={1}>\n <Styled.StyledText $renderAs=\"ab2\" $widthX={19.5}>\n {title}\n </Styled.StyledText>\n\n {userType === 'TEACHER' && (\n <ButtonWrapper shouldShow={!isFiltersAdded}>\n {!isDraftMilestonePresent && (\n <
|
1
|
+
{"version":3,"file":"no-active-milestone.js","sources":["../../../../../../src/features/milestone/milestone-list-container/milestone-list/no-active-milestone/no-active-milestone.tsx"],"sourcesContent":["import type { INoActiveMilestoneProps } from './no-active-milestone-types';\n\nimport { useCallback, type FC, memo } from 'react';\nimport styled from 'styled-components';\nimport { v4 as uuidv4 } from 'uuid';\n\nimport { ILLUSTRATIONS } from '../../../../../assets/illustrations/illustrations';\nimport useLazyRef from '../../../../hooks/use-lazy-ref';\nimport ArrowTooltip from '../../../../ui/arrow-tooltip/arrow-tooltip';\nimport Button from '../../../../ui/buttons/button/button';\nimport Image from '../../../../ui/image/image';\nimport FlexView from '../../../../ui/layout/flex-view';\nimport { getNoMilestoneTitle } from '../../../create/utils';\nimport * as Styled from './no-active-milestone-styled';\n\nconst ButtonWrapper = styled.span<{ shouldShow: boolean }>`\n display: ${({ shouldShow }) => (shouldShow ? 'block' : 'none')};\n`;\n\nconst NoActiveMilestone: FC<INoActiveMilestoneProps> = memo(\n ({ userType, studentName, isDraftMilestonePresent, ...restNoActiveMilestoneProps }) => {\n const { canCreatePlan, onCreatePlan, isFiltersAdded } = restNoActiveMilestoneProps;\n const temporaryMilestoneId = useLazyRef(uuidv4);\n\n const handleCreatePlan = useCallback(() => {\n onCreatePlan?.(temporaryMilestoneId);\n }, [onCreatePlan, temporaryMilestoneId]);\n\n const title = getNoMilestoneTitle(\n isFiltersAdded,\n isDraftMilestonePresent,\n studentName,\n userType,\n );\n\n return (\n <FlexView\n $flexDirection=\"row\"\n $gapX={1.5}\n $gutterX={1.5}\n $borderColor=\"WHITE_4\"\n $background=\"YELLOW_1\"\n $flexGapX={1}\n $justifyContent=\"space-between\"\n $alignItems=\"center\"\n >\n <FlexView $flexGapX={1}>\n <Styled.StyledText $renderAs=\"ab2\" $widthX={19.5}>\n {title}\n </Styled.StyledText>\n\n {userType === 'TEACHER' && (\n <ButtonWrapper shouldShow={!isFiltersAdded}>\n {!isDraftMilestonePresent && (\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 <Button\n renderAs=\"secondary\"\n size=\"small\"\n label=\"Add a Goal\"\n onClick={handleCreatePlan}\n disabled={!canCreatePlan}\n />\n </ArrowTooltip>\n )}\n </ButtonWrapper>\n )}\n </FlexView>\n\n <Image\n withLoader={false}\n width={240}\n height={100}\n src={ILLUSTRATIONS.PUZZLE_STUDENT}\n alt=\"learning-planner\"\n />\n </FlexView>\n );\n },\n);\n\nexport default NoActiveMilestone;\n"],"names":["ButtonWrapper","styled","shouldShow","NoActiveMilestone","memo","userType","studentName","isDraftMilestonePresent","restNoActiveMilestoneProps","canCreatePlan","onCreatePlan","isFiltersAdded","temporaryMilestoneId","useLazyRef","uuidv4","handleCreatePlan","useCallback","title","getNoMilestoneTitle","jsxs","FlexView","jsx","Styled.StyledText","ArrowTooltip","Button","Image","ILLUSTRATIONS"],"mappings":";;;;;;;;;;;;AAeA,MAAMA,IAAgBC,EAAO;AAAA,aAChB,CAAC,EAAE,YAAAC,EAAA,MAAkBA,IAAa,UAAU,MAAO;AAAA,GAG1DC,IAAiDC;AAAA,EACrD,CAAC,EAAE,UAAAC,GAAU,aAAAC,GAAa,yBAAAC,GAAyB,GAAGC,QAAiC;AACrF,UAAM,EAAE,eAAAC,GAAe,cAAAC,GAAc,gBAAAC,EAAA,IAAmBH,GAClDI,IAAuBC,EAAWC,CAAM,GAExCC,IAAmBC,EAAY,MAAM;AACzC,MAAAN,KAAA,QAAAA,EAAeE;AAAA,IAAoB,GAClC,CAACF,GAAcE,CAAoB,CAAC,GAEjCK,IAAQC;AAAA,MACZP;AAAA,MACAJ;AAAA,MACAD;AAAA,MACAD;AAAA,IAAA;AAIA,WAAA,gBAAAc;AAAA,MAACC;AAAA,MAAA;AAAA,QACC,gBAAe;AAAA,QACf,OAAO;AAAA,QACP,UAAU;AAAA,QACV,cAAa;AAAA,QACb,aAAY;AAAA,QACZ,WAAW;AAAA,QACX,iBAAgB;AAAA,QAChB,aAAY;AAAA,QAEZ,UAAA;AAAA,UAAC,gBAAAD,EAAAC,GAAA,EAAS,WAAW,GACnB,UAAA;AAAA,YAAA,gBAAAC,EAACC,GAAA,EAAkB,WAAU,OAAM,SAAS,MACzC,UACHL,GAAA;AAAA,YAECZ,MAAa,aACX,gBAAAgB,EAAArB,GAAA,EAAc,YAAY,CAACW,GACzB,WAACJ,KACA,gBAAAc;AAAA,cAACE;AAAA,cAAA;AAAA,gBACC,UAAS;AAAA,gBACT,aAAY;AAAA,gBACZ,QAAQd;AAAA,gBACR,UAAS;AAAA,gBAET,UAAA,gBAAAY;AAAA,kBAACG;AAAA,kBAAA;AAAA,oBACC,UAAS;AAAA,oBACT,MAAK;AAAA,oBACL,OAAM;AAAA,oBACN,SAAST;AAAA,oBACT,UAAU,CAACN;AAAA,kBAAA;AAAA,gBACb;AAAA,cAAA;AAAA,YAAA,GAGN;AAAA,UAAA,GAEJ;AAAA,UAEA,gBAAAY;AAAA,YAACI;AAAA,YAAA;AAAA,cACC,YAAY;AAAA,cACZ,OAAO;AAAA,cACP,QAAQ;AAAA,cACR,KAAKC,EAAc;AAAA,cACnB,KAAI;AAAA,YAAA;AAAA,UACN;AAAA,QAAA;AAAA,MAAA;AAAA,IAAA;AAAA,EAGN;AACF;"}
|