@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.
@@ -1,116 +1,107 @@
1
1
  import { jsxs as g, jsx as e } from "react/jsx-runtime";
2
- import { memo as F, useCallback as _ } from "react";
2
+ import { memo as F, useCallback as C } from "react";
3
3
  import { ILLUSTRATIONS as O } from "../../../assets/illustrations/illustrations.js";
4
- import C from "../../ui/layout/flex-view.js";
5
- import H from "../../ui/separator/separator.js";
6
- import U from "./comps/chapter-banner/chapter-banner.js";
7
- import W from "./comps/core-lessons/core-lessons.js";
8
- import M from "./comps/supplementary-resources/supplementary-resources.js";
9
- import { ContentWrapper as Q, LoaderWrapper as T } from "./styled.js";
10
- const X = F(
11
- ({ name: $, sheets_data: k, user_type: n, loading: a, ...S }) => {
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: o,
18
+ onCreateExtraPractice: t,
19
19
  onStart: p,
20
20
  onResume: m,
21
- onReattempt: c,
22
- onPreview: l,
21
+ onReattempt: l,
22
+ onPreview: c,
23
23
  onReview: u,
24
24
  onReset: h,
25
25
  onChangeLocation: d,
26
26
  onMarkAsFamiliar: f,
27
- onUnlock: E,
28
- onMarkRelevant: I,
29
- onMarkIrrelevant: L,
30
- onUnAssignSheet: P,
31
- onLearningPlanFAQClick: t
32
- } = S, {
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: b,
35
- supplementary_sheets_grouped: y
36
- } = k, A = _(() => {
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("onCreateExtraPractice must be a function");
38
+ throw new Error("onLearningPlanFAQClick must be a function");
43
39
  o();
44
- }, [o]);
45
- return /* @__PURE__ */ g(
46
- Q,
47
- {
48
- $disablePointerEvents: a,
49
- $alignItems: "center",
50
- $width: "100%",
51
- $background: "WHITE_4",
52
- children: [
53
- a && /* @__PURE__ */ e(T, { children: /* @__PURE__ */ e("img", { src: O.LOADER_1, alt: "loader" }) }),
54
- /* @__PURE__ */ e(
55
- U,
56
- {
57
- name: $,
58
- userChapterProgress: s,
59
- isDefocused: r,
60
- imageUrl: w,
61
- backgroundColor: `${i}_1`
62
- }
63
- ),
64
- /* @__PURE__ */ e(C, { $widthX: 47.5, $flexGapX: 2, children: /* @__PURE__ */ e(
65
- W,
66
- {
67
- userType: n,
68
- lessons: R,
69
- userChapterProgress: s,
70
- isDefocused: r,
71
- lessonItemColorHue: i,
72
- handleOnLearningPlanFAQClick: A,
73
- onChangeLocation: d,
74
- onPreview: l,
75
- onReset: h,
76
- onReview: u,
77
- onStart: p,
78
- onReattempt: c,
79
- onResume: m,
80
- onMarkAsFamiliar: f,
81
- onMarkIrrelevant: L,
82
- onMarkRelevant: I
83
- }
84
- ) }),
85
- /* @__PURE__ */ g(C, { $width: "100%", $flexGapX: 2, $background: "WHITE_3", $alignItems: "center", children: [
86
- /* @__PURE__ */ e(
87
- M,
88
- {
89
- userType: n,
90
- teacherId: x,
91
- groupedSupplementarySheets: y,
92
- groupedSupplementarySheetsSortOrder: b,
93
- isDefocused: r,
94
- handleOnCreateExtraPractice: v,
95
- onChangeLocation: d,
96
- onPreview: l,
97
- onReset: h,
98
- onReview: u,
99
- onStart: p,
100
- onReattempt: c,
101
- onResume: m,
102
- onMarkAsFamiliar: f,
103
- onUnlock: E,
104
- onUnAssignSheet: P
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 = X;
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\n $disablePointerEvents={loading}\n $alignItems=\"center\"\n $width=\"100%\"\n $background=\"WHITE_4\"\n >\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,KAA0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A,kBAAAZ;AAAA,gBACA,WAAAH;AAAA,gBACA,SAAAE;AAAA,gBACA,UAAAD;AAAA,gBACA,SAAAJ;AAAA,gBACA,aAAAE;AAAA,gBACA,UAAAD;AAAA,gBACA,kBAAAM;AAAA,gBACA,UAAAC;AAAA,gBACA,iBAAAG;AAAA,cAAA;AAAA,YACF;AAAA,YAEA,gBAAAU,EAACO,GAAU,EAAA,QAAQ,EAAG,CAAA;AAAA,UAAA,GACxB;AAAA,QAAA;AAAA,MAAA;AAAA,IAAA;AAAA,EAGN;AACF,GAEAC,IAAe1C;"}
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,OAAO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A,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 r, Fragment as K, jsx as o } from "react/jsx-runtime";
2
- import Q, { memo as Y, useCallback as p } from "react";
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 d from "../../../ui/layout/flex-view.js";
6
- import ee from "../../../ui/separator/separator.js";
7
- import te from "../../../ui/text/text.js";
8
- import oe from "./milestone-widget/milestone-widget.js";
9
- import ne from "./no-active-milestone/no-active-milestone.js";
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 ue = Y(
12
- ({ milestones: e, studentId: u, milestoneType: s, ...A }) => {
12
+ const ge = Y(
13
+ ({ milestones: t, studentId: A, milestoneType: s, ...u }) => {
13
14
  const {
14
- canCreatePlan: m,
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: N,
21
- onCreatePlan: i,
22
- onDelete: v,
23
- onDraftPublish: R,
24
- onEdit: w,
25
- onCreateMilestoneTest: x,
26
- onNodeAttempt: b,
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: P,
30
- onNodeReset: F,
31
- onNodeUnassign: I,
30
+ onNodeReattempt: I,
31
+ onNodeReset: P,
32
+ onNodeUnassign: F,
32
33
  onAssignResources: k,
33
34
  onTestPreview: E,
34
35
  onTestReview: S,
35
- onTestStart: V,
36
- activeMilestoneId: _,
37
- activeTabId: j,
38
- onWidgetTabSelection: z,
36
+ onTestStart: j,
37
+ activeMilestoneId: y,
38
+ activeTabId: G,
39
+ onWidgetTabSelection: V,
39
40
  studentName: c,
40
- teacherName: B,
41
- parentName: G,
42
- userType: a,
43
- courseStream: y,
41
+ teacherName: _,
42
+ parentName: z,
43
+ userType: l,
44
+ courseStream: B,
44
45
  onNodeAssignAsHomework: H
45
- } = A, l = s === "ACTIVE", L = s === "DRAFT", f = Z(ie), O = p(() => {
46
- i == null || i(f);
47
- }, [i, f]), W = p(() => {
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 (!e) return null;
51
- const X = e.some(
52
- (t) => t.milestone_state === "ACTIVE"
53
- ), U = e.some(
54
- (t) => t.milestone_state === "DRAFT"
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__ */ r(K, { children: [
57
- l && !X && /* @__PURE__ */ o(d, { $marginBottom: 40, children: /* @__PURE__ */ o(
58
- ne,
57
+ return /* @__PURE__ */ i(K, { children: [
58
+ d && !X && /* @__PURE__ */ e(m, { $marginBottom: 40, children: /* @__PURE__ */ e(
59
+ re,
59
60
  {
60
- canCreatePlan: m,
61
+ canCreatePlan: a,
61
62
  isDraftMilestonePresent: U,
62
63
  isFiltersAdded: C,
63
- onCreatePlan: i,
64
+ onCreatePlan: r,
64
65
  studentName: c,
65
- userType: a
66
+ userType: l
66
67
  }
67
68
  ) }),
68
- l && /* @__PURE__ */ r(d, { $flexDirection: "row", $justifyContent: "space-between", $marginBottom: 16, children: [
69
- /* @__PURE__ */ r(te, { $renderAs: "ac4", children: [
69
+ d && /* @__PURE__ */ i(m, { $flexDirection: "row", $justifyContent: "space-between", $marginBottom: 16, children: [
70
+ /* @__PURE__ */ i(oe, { $renderAs: "ac4", children: [
70
71
  "Goals (",
71
- e.length,
72
+ t.length,
72
73
  ")"
73
74
  ] }),
74
- a === "TEACHER" && /* @__PURE__ */ r(d, { $flexDirection: "row", $flexGapX: 1, children: [
75
- /* @__PURE__ */ o(
76
- h,
75
+ l === "TEACHER" && /* @__PURE__ */ i(m, { $flexDirection: "row", $flexGapX: 1, children: [
76
+ /* @__PURE__ */ e(
77
+ ee,
77
78
  {
78
- label: "Create Goal",
79
- size: "small",
80
- onClick: O,
81
- disabled: !m
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__ */ o(h, { label: "Add Milestone", size: "small", onClick: W })
94
+ /* @__PURE__ */ e(h, { label: "Add Milestone", size: "small", onClick: W })
85
95
  ] })
86
96
  ] }),
87
- e.map((t, q) => {
88
- const { id: J } = t;
89
- return /* @__PURE__ */ r(Q.Fragment, { children: [
90
- /* @__PURE__ */ o(
91
- oe,
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: t,
94
- studentId: u,
103
+ milestone: o,
104
+ studentId: A,
95
105
  studentName: c,
96
- parentName: G,
97
- teacherName: B,
98
- userType: a,
106
+ parentName: z,
107
+ teacherName: _,
108
+ userType: l,
99
109
  onAddOutcome: n,
100
- onChapterClick: N,
101
- isMilestoneActive: l || L,
110
+ onChapterClick: v,
111
+ isMilestoneActive: d || L,
102
112
  milestoneType: s,
103
- onEdit: w,
104
- onCreateMilestoneTest: x,
113
+ onEdit: b,
114
+ onCreateMilestoneTest: R,
105
115
  onAddChapter: T,
106
- onDelete: v,
107
- onDraftPublish: R,
116
+ onDelete: w,
117
+ onDraftPublish: N,
108
118
  isClassOngoing: g,
109
119
  isStudentPresent: M,
110
120
  onAssignResources: k,
111
- onNodeAttempt: b,
121
+ onNodeAttempt: x,
112
122
  onNodeView: D,
113
123
  onNodeReview: $,
114
- onNodeReattempt: P,
115
- onNodeReset: F,
116
- onNodeUnassign: I,
124
+ onNodeReattempt: I,
125
+ onNodeReset: P,
126
+ onNodeUnassign: F,
117
127
  onNodeAssignAsHomework: H,
118
128
  onTestPreview: E,
119
129
  onTestReview: S,
120
- onTestStart: V,
121
- courseStream: y,
122
- activeMilestoneId: _,
123
- activeTabId: j,
124
- onWidgetTabSelection: z
130
+ onTestStart: j,
131
+ courseStream: B,
132
+ activeMilestoneId: y,
133
+ activeTabId: G,
134
+ onWidgetTabSelection: V
125
135
  }
126
136
  ),
127
- q !== e.length - 1 && /* @__PURE__ */ o(ee, { heightX: 2 })
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
- ue as default
144
+ ge as default
135
145
  };
136
146
  //# sourceMappingURL=milestone-list.js.map
@@ -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 label=\"Create Goal\"\n size=\"small\"\n onClick={handleCreatePlan}\n disabled={!canCreatePlan}\n />\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","TextButton","idx","milestoneId","React","MilestoneWidget","Separator"],"mappings":";;;;;;;;;;AAaA,MAAMA,KAA+CC;AAAA,EACnD,CAAC,EAAE,YAAAC,GAAY,WAAAC,GAAW,eAAAC,GAAe,GAAGC,QAA6B;AACjE,UAAA;AAAA,MACJ,eAAAC;AAAA,MACA,gBAAAC;AAAA,MACA,gBAAAC;AAAA,MACA,kBAAAC;AAAA,MACA,cAAAC;AAAA,MACA,cAAAC;AAAA,MACA,gBAAAC;AAAA,MACA,cAAAC;AAAA,MACA,UAAAC;AAAA,MACA,gBAAAC;AAAA,MACA,QAAAC;AAAA,MACA,uBAAAC;AAAA,MACA,eAAAC;AAAA,MACA,YAAAC;AAAA,MACA,cAAAC;AAAA,MACA,iBAAAC;AAAA,MACA,aAAAC;AAAA,MACA,gBAAAC;AAAA,MACA,mBAAAC;AAAA,MACA,eAAAC;AAAA,MACA,cAAAC;AAAA,MACA,aAAAC;AAAA,MACA,mBAAAC;AAAA,MACA,aAAAC;AAAA,MACA,sBAAAC;AAAA,MACA,aAAAC;AAAA,MACA,aAAAC;AAAA,MACA,YAAAC;AAAA,MACA,UAAAC;AAAA,MACA,cAAAC;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A,YAAA;AAAA,UACb;AAAA,4BACCgD,GAAW,EAAA,OAAM,iBAAgB,MAAK,SAAQ,SAASV,GAAoB;AAAA,QAAA,GAC9E;AAAA,MAAA,GAEJ;AAAA,MAGD1C,EAAW,IAAI,CAAC4C,GAAWS,MAAQ;AAC5B,cAAA,EAAE,IAAIC,EAAgB,IAAAV;AAG1B,eAAA,gBAAAE,EAACS,EAAM,UAAN,EACC,UAAA;AAAA,UAAA,gBAAAP;AAAA,YAACQ;AAAA,YAAA;AAAA,cACC,WAAAZ;AAAA,cACA,WAAA3C;AAAA,cACA,aAAA4B;AAAA,cACA,YAAAE;AAAA,cACA,aAAAD;AAAA,cACA,UAAAE;AAAA,cACA,cAAAvB;AAAA,cACA,gBAAAC;AAAA,cACA,mBAAmByB,KAAqBC;AAAA,cACxC,eAAAlC;AAAA,cACA,QAAAY;AAAA,cACA,uBAAAC;AAAA,cACA,cAAAP;AAAA,cACA,UAAAI;AAAA,cACA,gBAAAC;AAAA,cACA,gBAAAR;AAAA,cACA,kBAAAE;AAAA,cACA,mBAAAe;AAAA,cACA,eAAAN;AAAA,cACA,YAAAC;AAAA,cACA,cAAAC;AAAA,cACA,iBAAAC;AAAA,cACA,aAAAC;AAAA,cACA,gBAAAC;AAAA,cACA,wBAAAa;AAAA,cACA,eAAAX;AAAA,cACA,cAAAC;AAAA,cACA,aAAAC;AAAA,cACA,cAAAQ;AAAA,cACA,mBAAAP;AAAA,cACA,aAAAC;AAAA,cACA,sBAAAC;AAAA,YAAA;AAAA,UACF;AAAA,UACCyB,MAAQrD,EAAW,SAAS,KAAM,gBAAAgD,EAAAS,IAAA,EAAU,SAAS,GAAG;AAAA,QAnCtC,EAAA,GAAA,aAAaH,CAAW,EAoC7C;AAAA,MAAA,CAEH;AAAA,IACH,EAAA,CAAA;AAAA,EAEJ;AACF;"}
1
+ {"version":3,"file":"milestone-list.js","sources":["../../../../../src/features/milestone/milestone-list-container/milestone-list/milestone-list.tsx"],"sourcesContent":["import type { IMilestoneListProps } from './milestone-list-types';\n\nimport React, { memo, useCallback } from 'react';\nimport { v4 as uuidv4 } from 'uuid';\n\nimport useLazyRef from '../../../hooks/use-lazy-ref';\nimport ArrowTooltip from '../../../ui/arrow-tooltip/arrow-tooltip';\nimport TextButton from '../../../ui/buttons/text-button/text-button';\nimport FlexView from '../../../ui/layout/flex-view';\nimport Separator from '../../../ui/separator/separator';\nimport Text from '../../../ui/text/text';\nimport MilestoneWidget from './milestone-widget/milestone-widget';\nimport NoActiveMilestone from './no-active-milestone/no-active-milestone';\n\nconst MilestoneList: React.FC<IMilestoneListProps> = memo(\n ({ milestones, studentId, milestoneType, ...restMilestoneListProps }) => {\n const {\n canCreatePlan,\n isClassOngoing,\n isFiltersAdded,\n isStudentPresent,\n onAddChapter,\n onAddOutcome,\n onChapterClick,\n onCreatePlan,\n onDelete,\n onDraftPublish,\n onEdit,\n onCreateMilestoneTest,\n onNodeAttempt,\n onNodeView,\n onNodeReview,\n onNodeReattempt,\n onNodeReset,\n onNodeUnassign,\n onAssignResources,\n onTestPreview,\n onTestReview,\n onTestStart,\n activeMilestoneId,\n activeTabId,\n onWidgetTabSelection,\n studentName,\n teacherName,\n parentName,\n userType,\n courseStream,\n onNodeAssignAsHomework,\n } = restMilestoneListProps;\n\n const isMilestoneActive = milestoneType === 'ACTIVE';\n const isDraftMilestone = milestoneType === 'DRAFT';\n const temporaryMilestoneId = useLazyRef(uuidv4);\n\n const handleCreatePlan = useCallback(() => {\n onCreatePlan?.(temporaryMilestoneId);\n }, [onCreatePlan, temporaryMilestoneId]);\n\n const handleOnAddOutcome = useCallback(() => {\n onAddOutcome?.();\n }, [onAddOutcome]);\n\n if (!milestones) return null;\n\n const activeMilestonePresent = milestones.some(\n milestone => milestone.milestone_state === 'ACTIVE',\n );\n const draftMilestonePresent = milestones.some(\n milestone => milestone.milestone_state === 'DRAFT',\n );\n\n return (\n <>\n {isMilestoneActive && !activeMilestonePresent && (\n <FlexView $marginBottom={40}>\n <NoActiveMilestone\n canCreatePlan={canCreatePlan}\n isDraftMilestonePresent={draftMilestonePresent}\n isFiltersAdded={isFiltersAdded}\n onCreatePlan={onCreatePlan}\n studentName={studentName}\n userType={userType}\n />\n </FlexView>\n )}\n\n {isMilestoneActive && (\n <FlexView $flexDirection=\"row\" $justifyContent=\"space-between\" $marginBottom={16}>\n <Text $renderAs=\"ac4\">Goals ({milestones.length})</Text>\n\n {userType === 'TEACHER' && (\n <FlexView $flexDirection=\"row\" $flexGapX={1}>\n <ArrowTooltip\n renderAs=\"primary\"\n tooltipItem=\"Goals can only be added for students who have joined the class\"\n hidden={canCreatePlan}\n position=\"bottom\"\n >\n <TextButton\n label=\"Create Goal\"\n size=\"small\"\n onClick={handleCreatePlan}\n disabled={!canCreatePlan}\n />\n </ArrowTooltip>\n <TextButton label=\"Add Milestone\" size=\"small\" onClick={handleOnAddOutcome} />\n </FlexView>\n )}\n </FlexView>\n )}\n\n {milestones.map((milestone, idx) => {\n const { id: milestoneId } = milestone;\n\n return (\n <React.Fragment key={`milestone=${milestoneId}`}>\n <MilestoneWidget\n milestone={milestone}\n studentId={studentId}\n studentName={studentName}\n parentName={parentName}\n teacherName={teacherName}\n userType={userType}\n onAddOutcome={onAddOutcome}\n onChapterClick={onChapterClick}\n isMilestoneActive={isMilestoneActive || isDraftMilestone}\n milestoneType={milestoneType}\n onEdit={onEdit}\n onCreateMilestoneTest={onCreateMilestoneTest}\n onAddChapter={onAddChapter}\n onDelete={onDelete}\n onDraftPublish={onDraftPublish}\n isClassOngoing={isClassOngoing}\n isStudentPresent={isStudentPresent}\n onAssignResources={onAssignResources}\n onNodeAttempt={onNodeAttempt}\n onNodeView={onNodeView}\n onNodeReview={onNodeReview}\n onNodeReattempt={onNodeReattempt}\n onNodeReset={onNodeReset}\n onNodeUnassign={onNodeUnassign}\n onNodeAssignAsHomework={onNodeAssignAsHomework}\n onTestPreview={onTestPreview}\n onTestReview={onTestReview}\n onTestStart={onTestStart}\n courseStream={courseStream}\n activeMilestoneId={activeMilestoneId}\n activeTabId={activeTabId}\n onWidgetTabSelection={onWidgetTabSelection}\n />\n {idx !== milestones.length - 1 && <Separator heightX={2} />}\n </React.Fragment>\n );\n })}\n </>\n );\n },\n);\n\nexport default MilestoneList;\n"],"names":["MilestoneList","memo","milestones","studentId","milestoneType","restMilestoneListProps","canCreatePlan","isClassOngoing","isFiltersAdded","isStudentPresent","onAddChapter","onAddOutcome","onChapterClick","onCreatePlan","onDelete","onDraftPublish","onEdit","onCreateMilestoneTest","onNodeAttempt","onNodeView","onNodeReview","onNodeReattempt","onNodeReset","onNodeUnassign","onAssignResources","onTestPreview","onTestReview","onTestStart","activeMilestoneId","activeTabId","onWidgetTabSelection","studentName","teacherName","parentName","userType","courseStream","onNodeAssignAsHomework","isMilestoneActive","isDraftMilestone","temporaryMilestoneId","useLazyRef","uuidv4","handleCreatePlan","useCallback","handleOnAddOutcome","activeMilestonePresent","milestone","draftMilestonePresent","jsxs","Fragment","jsx","FlexView","NoActiveMilestone","Text","ArrowTooltip","TextButton","idx","milestoneId","React","MilestoneWidget","Separator"],"mappings":";;;;;;;;;;;AAcA,MAAMA,KAA+CC;AAAA,EACnD,CAAC,EAAE,YAAAC,GAAY,WAAAC,GAAW,eAAAC,GAAe,GAAGC,QAA6B;AACjE,UAAA;AAAA,MACJ,eAAAC;AAAA,MACA,gBAAAC;AAAA,MACA,gBAAAC;AAAA,MACA,kBAAAC;AAAA,MACA,cAAAC;AAAA,MACA,cAAAC;AAAA,MACA,gBAAAC;AAAA,MACA,cAAAC;AAAA,MACA,UAAAC;AAAA,MACA,gBAAAC;AAAA,MACA,QAAAC;AAAA,MACA,uBAAAC;AAAA,MACA,eAAAC;AAAA,MACA,YAAAC;AAAA,MACA,cAAAC;AAAA,MACA,iBAAAC;AAAA,MACA,aAAAC;AAAA,MACA,gBAAAC;AAAA,MACA,mBAAAC;AAAA,MACA,eAAAC;AAAA,MACA,cAAAC;AAAA,MACA,aAAAC;AAAA,MACA,mBAAAC;AAAA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AQtD,EAAW,SAAS,KAAM,gBAAAgD,EAAAU,IAAA,EAAU,SAAS,GAAG;AAAA,QAnCtC,EAAA,GAAA,aAAaH,CAAW,EAoC7C;AAAA,MAAA,CAEH;AAAA,IACH,EAAA,CAAA;AAAA,EAEJ;AACF;"}
@@ -1,28 +1,29 @@
1
- import { jsxs as n, jsx as r } from "react/jsx-runtime";
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 u } from "../../../../../assets/illustrations/illustrations.js";
5
- import b from "../../../../hooks/use-lazy-ref.js";
6
- import g from "../../../../ui/buttons/button/button.js";
7
- import x from "../../../../ui/image/image.js";
8
- import a from "../../../../ui/layout/flex-view.js";
9
- import { getNoMilestoneTitle as w } from "../../../create/utils/index.js";
10
- import { StyledText as A } from "./no-active-milestone-styled.js";
11
- import L from "../../../../../node_modules/uuid/dist/esm-browser/v4.js";
12
- const T = $.span`
13
- display: ${({ shouldShow: e }) => e ? "block" : "none"};
14
- `, U = f(
15
- ({ userType: e, studentName: m, isDraftMilestonePresent: t, ...s }) => {
16
- const { canCreatePlan: d, onCreatePlan: o, isFiltersAdded: l } = s, i = b(L), c = h(() => {
17
- o == null || o(i);
18
- }, [o, i]), p = w(
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
- t,
21
- m,
22
- e
21
+ r,
22
+ s,
23
+ o
23
24
  );
24
- return /* @__PURE__ */ n(
25
- a,
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__ */ n(a, { $flexGapX: 1, children: [
37
- /* @__PURE__ */ r(A, { $renderAs: "ab2", $widthX: 19.5, children: p }),
38
- e === "TEACHER" && /* @__PURE__ */ r(T, { shouldShow: !l, children: !t && /* @__PURE__ */ r(
39
- g,
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: "secondary",
42
- size: "small",
43
- label: "Add a Goal",
44
- onClick: c,
45
- disabled: !d
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__ */ r(
50
- x,
59
+ /* @__PURE__ */ e(
60
+ g,
51
61
  {
52
62
  withLoader: !1,
53
63
  width: 240,
54
64
  height: 100,
55
- src: u.PUZZLE_STUDENT,
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
- U as default
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 <Button\n renderAs=\"secondary\"\n size=\"small\"\n label=\"Add a Goal\"\n onClick={handleCreatePlan}\n disabled={!canCreatePlan}\n />\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","Button","Image","ILLUSTRATIONS"],"mappings":";;;;;;;;;;;AAcA,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,MAAK;AAAA,gBACL,OAAM;AAAA,gBACN,SAASR;AAAA,gBACT,UAAU,CAACN;AAAA,cAAA;AAAA,YAAA,GAGjB;AAAA,UAAA,GAEJ;AAAA,UAEA,gBAAAY;AAAA,YAACG;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;"}
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":";;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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;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cuemath/leap",
3
- "version": "3.1.22-beta-0.1",
3
+ "version": "3.1.22-beta-0.3",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "dist"