@cuemath/leap 3.1.22-beta-0.1 → 3.1.22-beta-0.2

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,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":";;;;;;;;;;;;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;"}
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.2",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "dist"