@cuemath/leap 2.9.4-as5 → 2.9.4-as6

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.
Files changed (20) hide show
  1. package/dist/features/chapters-v2/chapter-details/chapter-banner/chapter-banner.js +2 -2
  2. package/dist/features/chapters-v2/chapter-details/chapter-banner/chapter-banner.js.map +1 -1
  3. package/dist/features/chapters-v2/comps/node-card/student-actions/student-actions.js +61 -61
  4. package/dist/features/chapters-v2/comps/node-card/student-actions/student-actions.js.map +1 -1
  5. package/dist/features/chapters-v2/comps/node-card/teacher-actions/teacher-actions.js +62 -62
  6. package/dist/features/chapters-v2/comps/node-card/teacher-actions/teacher-actions.js.map +1 -1
  7. package/dist/features/homework/hw-card-list/hw-card-list.js +3 -4
  8. package/dist/features/homework/hw-card-list/hw-card-list.js.map +1 -1
  9. package/dist/features/journey/hooks/use-home-page-journey.js +34 -34
  10. package/dist/features/journey/hooks/use-home-page-journey.js.map +1 -1
  11. package/dist/features/journey/use-journey/journey-context-provider.js +48 -48
  12. package/dist/features/journey/use-journey/journey-context-provider.js.map +1 -1
  13. package/dist/features/milestone/milestone-list-container/milestone-list/milestone-list.js +43 -43
  14. package/dist/features/milestone/milestone-list-container/milestone-list/milestone-list.js.map +1 -1
  15. package/dist/features/milestone/milestone-list-container/milestone-list-container.js +116 -115
  16. package/dist/features/milestone/milestone-list-container/milestone-list-container.js.map +1 -1
  17. package/dist/features/milestone/milestone-resources/resources-assign/resources-assign.js +8 -8
  18. package/dist/features/milestone/milestone-resources/resources-assign/resources-assign.js.map +1 -1
  19. package/dist/index.d.ts +4 -6
  20. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"journey-context-provider.js","sources":["../../../../src/features/journey/use-journey/journey-context-provider.tsx"],"sourcesContent":["/* eslint-disable no-console */\nimport type { TJourneyId } from '../journey-id/journey-id-types';\nimport type {\n ICoachmarkProps,\n IJourneyContext,\n IJourneyProviderProps,\n} from './journey-context-types';\nimport type { FC } from 'react';\n\nimport { createContext, useCallback, useEffect, useMemo, useRef, useState } from 'react';\n\nimport { Coachmark } from '../comps/coachmark/coachmark';\nimport { useGetUserJourney, usePostUserJourney } from '../user-journey-api/user-journey-api';\nimport * as S from './journey-styled';\n\nexport const JourneyContext = createContext<IJourneyContext | null>(null);\n\nexport const JourneyProvider: FC<IJourneyProviderProps> = ({ children, appId, userId }) => {\n const [isJourneyBlurred, setIsJourneyBlurred] = useState<boolean>(false);\n const [userCompletedJourneyIds, setUserCompletedJourneyIds] = useState<TJourneyId[] | null>(null);\n const [coachmarkList, setCoachmarkList] = useState<ICoachmarkProps[]>([]);\n const [isJourneyActive, setIsJourneyActive] = useState(false);\n const currentIndex = useRef(-1);\n const currentJourneyId = useRef<TJourneyId | undefined>();\n const timerRefs = useRef<ReturnType<typeof setTimeout>[]>([]);\n\n const { post: postJourneyCompletion } = usePostUserJourney();\n const { data: userCompletedJourneys = null, get: getJourneyProgress } = useGetUserJourney();\n\n const setJourney = useCallback(\n (id: TJourneyId, coachmarks: ICoachmarkProps[]) => {\n if (coachmarkList.length > 0) {\n console.error(\n `setJourney: Other Journey is already active, Current Journey: ${currentJourneyId.current}, New Journey Request: ${id}`,\n );\n\n return;\n }\n setIsJourneyActive(true);\n currentJourneyId.current = id;\n currentIndex.current = -1;\n setCoachmarkList([...coachmarks]);\n },\n [coachmarkList.length],\n );\n\n const clearJourney = useCallback(() => {\n // Clear all timers\n timerRefs.current.forEach(timer => {\n clearTimeout(timer);\n });\n timerRefs.current = [];\n currentJourneyId.current = undefined;\n currentIndex.current = -1;\n setCoachmarkList([]);\n setIsJourneyActive(false);\n }, []);\n\n const endJourney = useCallback(\n (journeyId: TJourneyId) => {\n clearJourney();\n setUserCompletedJourneyIds(prev => {\n if (prev && !prev.includes(journeyId)) {\n return [...prev, journeyId];\n }\n\n return prev;\n });\n // fire the API (doesn’t block the UI)\n postJourneyCompletion({\n app_id: appId,\n user_id: userId,\n journey_id: journeyId,\n journey_status: 'COMPLETED',\n });\n },\n [appId, clearJourney, postJourneyCompletion, userId],\n );\n\n const addCoachmark = useCallback((id: TJourneyId, coachmark: ICoachmarkProps) => {\n if (!currentJourneyId.current || id !== currentJourneyId.current) {\n console.error(\n currentJourneyId.current\n ? `A Journey is already active, Current Journey: ${currentJourneyId.current}, New Journey Request: ${id}`\n : `addCoachmark was called before setJourney and Journey ID is undefined`,\n );\n\n return;\n }\n\n setCoachmarkList(prev => [...prev, coachmark]);\n }, []);\n\n const nextCoachmark = useCallback(\n (\n id: TJourneyId,\n keepPrevActive: boolean = false,\n delayInMs: number = 0,\n shouldBlurNextJourney: boolean = false,\n ) => {\n if (!currentJourneyId.current || id !== currentJourneyId.current) {\n console.error(\n currentJourneyId.current\n ? `nextCoachmark was called before setJourney`\n : `A Journey is already active, Current Journey: ${currentJourneyId.current}, New Journey Request: ${id}`,\n );\n\n return;\n }\n\n setIsJourneyBlurred(shouldBlurNextJourney);\n\n if (delayInMs !== 0) {\n // If delay is not 0, we will hide all them coachmarks and reveal only after the delay\n setCoachmarkList(prevList => {\n return prevList.map((item: ICoachmarkProps) => {\n return { ...item, isActive: false };\n });\n });\n }\n\n const timer = setTimeout(() => {\n clearTimeout(timer);\n const currIndex = currentIndex.current + 1;\n\n setCoachmarkList(prevList => {\n // Finish onboarding\n if (currIndex >= prevList.length || prevList.length === 0) {\n clearJourney();\n\n return [];\n }\n\n currentIndex.current = currIndex;\n const updatedCoachmarkList = [...prevList];\n\n (updatedCoachmarkList[currIndex] as ICoachmarkProps).isActive = true;\n\n if (currIndex > 0) {\n (updatedCoachmarkList[currIndex - 1] as ICoachmarkProps).isActive = keepPrevActive;\n }\n\n return updatedCoachmarkList;\n });\n }, delayInMs);\n\n timerRefs.current.push(timer);\n },\n [clearJourney],\n );\n\n const memoizedContextValue: IJourneyContext = useMemo(\n () => ({\n nextCoachmark,\n setJourney,\n addCoachmark,\n clearJourney,\n endJourney,\n coachmarks: coachmarkList,\n userCompletedJourneyIds,\n isJourneyActive,\n }),\n [\n nextCoachmark,\n setJourney,\n addCoachmark,\n clearJourney,\n endJourney,\n coachmarkList,\n userCompletedJourneyIds,\n isJourneyActive,\n ],\n );\n\n // Get the initial state of incompleteJourneys\n useEffect(() => {\n if (appId && userId) {\n getJourneyProgress(userId, {\n app_id: appId,\n user_id: userId,\n journey_status: 'COMPLETED',\n });\n }\n }, [appId, getJourneyProgress, userId]);\n\n // Set the data to context state initially\n useEffect(() => {\n if (userCompletedJourneys) {\n const completedUserJourneysIds = userCompletedJourneys.map(journey => journey.journey_id);\n\n setUserCompletedJourneyIds(completedUserJourneysIds);\n }\n }, [userCompletedJourneys]);\n\n return (\n <JourneyContext.Provider value={memoizedContextValue}>\n {isJourneyActive && (\n <S.Overlay\n about=\"journey-overlay\"\n isJourneyBlurred={isJourneyBlurred}\n data-testid={currentJourneyId.current}\n >\n {coachmarkList.map((coachmark, index) => (\n <Coachmark key={`coachmark-${index}`} coachmark={coachmark} />\n ))}\n </S.Overlay>\n )}\n {children}\n </JourneyContext.Provider>\n );\n};\n"],"names":["JourneyContext","createContext","JourneyProvider","children","appId","userId","isJourneyBlurred","setIsJourneyBlurred","useState","userCompletedJourneyIds","setUserCompletedJourneyIds","coachmarkList","setCoachmarkList","isJourneyActive","setIsJourneyActive","currentIndex","useRef","currentJourneyId","timerRefs","postJourneyCompletion","usePostUserJourney","userCompletedJourneys","getJourneyProgress","useGetUserJourney","setJourney","useCallback","id","coachmarks","clearJourney","timer","endJourney","journeyId","prev","addCoachmark","coachmark","nextCoachmark","keepPrevActive","delayInMs","shouldBlurNextJourney","prevList","item","currIndex","updatedCoachmarkList","memoizedContextValue","useMemo","useEffect","completedUserJourneysIds","journey","jsxs","jsx","S.Overlay","index","Coachmark"],"mappings":";;;;;AAea,MAAAA,IAAiBC,EAAsC,IAAI,GAE3DC,IAA6C,CAAC,EAAE,UAAAC,GAAU,OAAAC,GAAO,QAAAC,QAAa;AACzF,QAAM,CAACC,GAAkBC,CAAmB,I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e,IAAwCC;AAAA,IAC5C,OAAO;AAAA,MACL,eAAAT;AAAA,MACA,YAAAX;AAAA,MACA,cAAAS;AAAA,MACA,cAAAL;AAAA,MACA,YAAAE;AAAA,MACA,YAAYnB;AAAA,MACZ,yBAAAF;AAAA,MACA,iBAAAI;AAAA,IAAA;AAAA,IAEF;AAAA,MACEsB;AAAA,MACAX;AAAA,MACAS;AAAA,MACAL;AAAA,MACAE;AAAA,MACAnB;AAAA,MACAF;AAAA,MACAI;AAAA,IACF;AAAA,EAAA;AAIF,SAAAgC,EAAU,MAAM;AACd,IAAIzC,KAASC,KACXiB,EAAmBjB,GAAQ;AAAA,MACzB,QAAQD;AAAA,MACR,SAASC;AAAA,MACT,gBAAgB;AAAA,IAAA,CACjB;AAAA,EAEF,GAAA,CAACD,GAAOkB,GAAoBjB,CAAM,CAAC,GAGtCwC,EAAU,MAAM;AACd,QAAIxB,GAAuB;AACzB,YAAMyB,IAA2BzB,EAAsB,IAAI,CAAA0B,MAAWA,EAAQ,UAAU;AAExF,MAAArC,EAA2BoC,CAAwB;AAAA,IACrD;AAAA,EAAA,GACC,CAACzB,CAAqB,CAAC,GAGvB,gBAAA2B,EAAAhD,EAAe,UAAf,EAAwB,OAAO2C,GAC7B,UAAA;AAAA,IACC9B,KAAA,gBAAAoC;AAAA,MAACC;AAAAA,MAAA;AAAA,QACC,OAAM;AAAA,QACN,kBAAA5C;AAAA,QACA,eAAaW,EAAiB;AAAA,QAE7B,UAAAN,EAAc,IAAI,CAACuB,GAAWiB,MAC5B,gBAAAF,EAAAG,GAAA,EAAqC,WAAAlB,EAAtB,GAAA,aAAaiB,CAAK,EAA0B,CAC7D;AAAA,MAAA;AAAA,IACH;AAAA,IAEDhD;AAAA,EACH,EAAA,CAAA;AAEJ;"}
1
+ {"version":3,"file":"journey-context-provider.js","sources":["../../../../src/features/journey/use-journey/journey-context-provider.tsx"],"sourcesContent":["/* eslint-disable no-console */\nimport type { TJourneyId } from '../journey-id/journey-id-types';\nimport type {\n ICoachmarkProps,\n IJourneyContext,\n IJourneyProviderProps,\n} from './journey-context-types';\nimport type { FC } from 'react';\n\nimport { createContext, useCallback, useEffect, useMemo, useRef, useState } from 'react';\n\nimport { Coachmark } from '../comps/coachmark/coachmark';\nimport { useGetUserJourney, usePostUserJourney } from '../user-journey-api/user-journey-api';\nimport * as S from './journey-styled';\n\nexport const JourneyContext = createContext<IJourneyContext | null>(null);\n\nexport const JourneyProvider: FC<IJourneyProviderProps> = ({ children, appId, userId }) => {\n const [isJourneyBlurred, setIsJourneyBlurred] = useState<boolean>(false);\n const [userCompletedJourneyIds, setUserCompletedJourneyIds] = useState<TJourneyId[] | null>(null);\n const [coachmarkList, setCoachmarkList] = useState<ICoachmarkProps[]>([]);\n const [isJourneyActive, setIsJourneyActive] = useState(false);\n const currentIndex = useRef(-1);\n const currentJourneyId = useRef<TJourneyId | undefined>();\n const timerRefs = useRef<ReturnType<typeof setTimeout>[]>([]);\n\n const { post: postJourneyCompletion } = usePostUserJourney();\n const { data: userCompletedJourneys = null, get: getJourneyProgress } = useGetUserJourney();\n\n const setJourney = useCallback(\n (id: TJourneyId, coachmarks: ICoachmarkProps[], shouldBlueInitialJourney?: boolean) => {\n if (coachmarkList.length > 0) {\n console.error(\n `setJourney: Other Journey is already active, Current Journey: ${currentJourneyId.current}, New Journey Request: ${id}`,\n );\n\n return;\n }\n setIsJourneyActive(true);\n currentJourneyId.current = id;\n currentIndex.current = -1;\n setCoachmarkList([...coachmarks]);\n setIsJourneyBlurred(!!shouldBlueInitialJourney);\n },\n [coachmarkList.length],\n );\n\n const clearJourney = useCallback(() => {\n // Clear all timers\n timerRefs.current.forEach(timer => {\n clearTimeout(timer);\n });\n timerRefs.current = [];\n currentJourneyId.current = undefined;\n currentIndex.current = -1;\n setCoachmarkList([]);\n setIsJourneyActive(false);\n }, []);\n\n const endJourney = useCallback(\n (journeyId: TJourneyId) => {\n clearJourney();\n setUserCompletedJourneyIds(prev => {\n if (prev && !prev.includes(journeyId)) {\n return [...prev, journeyId];\n }\n\n return prev;\n });\n // fire the API (doesn’t block the UI)\n postJourneyCompletion({\n app_id: appId,\n user_id: userId,\n journey_id: journeyId,\n journey_status: 'COMPLETED',\n });\n },\n [appId, clearJourney, postJourneyCompletion, userId],\n );\n\n const addCoachmark = useCallback((id: TJourneyId, coachmark: ICoachmarkProps) => {\n if (!currentJourneyId.current || id !== currentJourneyId.current) {\n console.error(\n currentJourneyId.current\n ? `A Journey is already active, Current Journey: ${currentJourneyId.current}, New Journey Request: ${id}`\n : `addCoachmark was called before setJourney and Journey ID is undefined`,\n );\n\n return;\n }\n\n setCoachmarkList(prev => [...prev, coachmark]);\n }, []);\n\n const nextCoachmark = useCallback(\n (\n id: TJourneyId,\n keepPrevActive: boolean = false,\n delayInMs: number = 0,\n shouldBlurNextJourney: boolean = false,\n ) => {\n if (!currentJourneyId.current || id !== currentJourneyId.current) {\n console.error(\n currentJourneyId.current\n ? `nextCoachmark was called before setJourney`\n : `A Journey is already active, Current Journey: ${currentJourneyId.current}, New Journey Request: ${id}`,\n );\n\n return;\n }\n\n setIsJourneyBlurred(shouldBlurNextJourney);\n\n if (delayInMs !== 0) {\n // If delay is not 0, we will hide all them coachmarks and reveal only after the delay\n setCoachmarkList(prevList => {\n return prevList.map((item: ICoachmarkProps) => {\n return { ...item, isActive: false };\n });\n });\n }\n\n const timer = setTimeout(() => {\n clearTimeout(timer);\n const currIndex = currentIndex.current + 1;\n\n setCoachmarkList(prevList => {\n // Finish onboarding\n if (currIndex >= prevList.length || prevList.length === 0) {\n clearJourney();\n\n return [];\n }\n\n currentIndex.current = currIndex;\n const updatedCoachmarkList = [...prevList];\n\n (updatedCoachmarkList[currIndex] as ICoachmarkProps).isActive = true;\n\n if (currIndex > 0) {\n (updatedCoachmarkList[currIndex - 1] as ICoachmarkProps).isActive = keepPrevActive;\n }\n\n return updatedCoachmarkList;\n });\n }, delayInMs);\n\n timerRefs.current.push(timer);\n },\n [clearJourney],\n );\n\n const memoizedContextValue: IJourneyContext = useMemo(\n () => ({\n nextCoachmark,\n setJourney,\n addCoachmark,\n clearJourney,\n endJourney,\n coachmarks: coachmarkList,\n userCompletedJourneyIds,\n isJourneyActive,\n }),\n [\n nextCoachmark,\n setJourney,\n addCoachmark,\n clearJourney,\n endJourney,\n coachmarkList,\n userCompletedJourneyIds,\n isJourneyActive,\n ],\n );\n\n // Get the initial state of incompleteJourneys\n useEffect(() => {\n if (appId && userId) {\n getJourneyProgress(userId, {\n app_id: appId,\n user_id: userId,\n journey_status: 'COMPLETED',\n });\n }\n }, [appId, getJourneyProgress, userId]);\n\n // Set the data to context state initially\n useEffect(() => {\n if (userCompletedJourneys) {\n const completedUserJourneysIds = userCompletedJourneys.map(journey => journey.journey_id);\n\n setUserCompletedJourneyIds(completedUserJourneysIds);\n }\n }, [userCompletedJourneys]);\n\n return (\n <JourneyContext.Provider value={memoizedContextValue}>\n {isJourneyActive && (\n <S.Overlay\n about=\"journey-overlay\"\n isJourneyBlurred={isJourneyBlurred}\n data-testid={currentJourneyId.current}\n >\n {coachmarkList.map((coachmark, index) => (\n <Coachmark key={`coachmark-${index}`} coachmark={coachmark} />\n ))}\n </S.Overlay>\n )}\n {children}\n </JourneyContext.Provider>\n );\n};\n"],"names":["JourneyContext","createContext","JourneyProvider","children","appId","userId","isJourneyBlurred","setIsJourneyBlurred","useState","userCompletedJourneyIds","setUserCompletedJourneyIds","coachmarkList","setCoachmarkList","isJourneyActive","setIsJourneyActive","currentIndex","useRef","currentJourneyId","timerRefs","postJourneyCompletion","usePostUserJourney","userCompletedJourneys","getJourneyProgress","useGetUserJourney","setJourney","useCallback","id","coachmarks","shouldBlueInitialJourney","clearJourney","timer","endJourney","journeyId","prev","addCoachmark","coachmark","nextCoachmark","keepPrevActive","delayInMs","shouldBlurNextJourney","prevList","item","currIndex","updatedCoachmarkList","memoizedContextValue","useMemo","useEffect","completedUserJourneysIds","journey","jsxs","jsx","S.Overlay","index","Coachmark"],"mappings":";;;;;AAea,MAAAA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jD;AAAA,EACH,EAAA,CAAA;AAEJ;"}
@@ -1,24 +1,24 @@
1
- import { jsxs as t, Fragment as ee, jsx as o } from "react/jsx-runtime";
2
- import te, { memo as ne, useState as oe, useCallback as g } from "react";
1
+ import { jsxs as t, Fragment as ee, jsx as n } from "react/jsx-runtime";
2
+ import te, { memo as ne, useState as oe, useCallback as A } from "react";
3
3
  import ie from "../../../hooks/use-lazy-ref.js";
4
4
  import u from "../../../ui/buttons/text-button/text-button.js";
5
- import c from "../../../ui/layout/flex-view.js";
5
+ import s from "../../../ui/layout/flex-view.js";
6
6
  import C from "../../../ui/text/text.js";
7
- import se from "./milestone-widget/milestone-widget.js";
8
- import { StyledDownIcon as re } from "./milestone-widget/milestone-widget-styled.js";
7
+ import re from "./milestone-widget/milestone-widget.js";
8
+ import { StyledDownIcon as se } from "./milestone-widget/milestone-widget-styled.js";
9
9
  import ae from "./no-active-milestone/no-active-milestone.js";
10
10
  import le from "../../../../node_modules/uuid/dist/esm-browser/v4.js";
11
11
  const Me = ne(
12
- ({ milestones: e, studentId: M, milestoneType: r, ...x }) => {
13
- const [a, N] = oe(!1), {
12
+ ({ milestones: e, studentId: M, milestoneType: a, ...x }) => {
13
+ const [l, $] = oe(!1), {
14
14
  canCreatePlan: m,
15
- isClassOngoing: T,
16
- isFiltersAdded: $,
15
+ isClassOngoing: N,
16
+ isFiltersAdded: T,
17
17
  isStudentPresent: I,
18
18
  onAddChapter: v,
19
19
  onAddOutcome: i,
20
20
  onChapterClick: w,
21
- onCreatePlan: s,
21
+ onCreatePlan: r,
22
22
  onDelete: E,
23
23
  onDraftPublish: R,
24
24
  onEdit: D,
@@ -28,9 +28,9 @@ const Me = ne(
28
28
  onNodeView: S,
29
29
  onNodeReview: F,
30
30
  onNodeReattempt: k,
31
- onNodeReset: V,
32
- onNodeUnassign: j,
33
- onAssignResources: B,
31
+ onNodeReset: B,
32
+ onNodeUnassign: V,
33
+ onAssignResources: j,
34
34
  onTestPreview: G,
35
35
  onTestReview: L,
36
36
  onTestStart: O,
@@ -42,39 +42,39 @@ const Me = ne(
42
42
  parentName: U,
43
43
  userType: d,
44
44
  courseStream: W
45
- } = x, l = r === "ACTIVE", h = r === "DRAFT", A = ie(le), H = g(() => {
46
- s == null || s(A);
47
- }, [s, A]), q = () => {
48
- !a && f && f(), N(!a);
49
- }, J = g(() => {
45
+ } = x, c = a === "ACTIVE", h = a === "DRAFT", g = ie(le), H = A(() => {
46
+ r == null || r(g);
47
+ }, [r, g]), q = () => {
48
+ !l && f && f(), $(!l);
49
+ }, J = A(() => {
50
50
  i == null || i();
51
51
  }, [i]);
52
52
  if (!e) return null;
53
53
  const K = e.some(
54
- (n) => n.milestone_state === "ACTIVE"
54
+ (o) => o.milestone_state === "ACTIVE"
55
55
  ), Q = e.some(
56
- (n) => n.milestone_state === "DRAFT"
56
+ (o) => o.milestone_state === "DRAFT"
57
57
  );
58
58
  return /* @__PURE__ */ t(ee, { children: [
59
- l && !K && /* @__PURE__ */ o(
59
+ c && !K && /* @__PURE__ */ n(s, { $marginBottom: 32, children: /* @__PURE__ */ n(
60
60
  ae,
61
61
  {
62
62
  canCreatePlan: m,
63
63
  isDraftMilestonePresent: Q,
64
- isFiltersAdded: $,
65
- onCreatePlan: s,
64
+ isFiltersAdded: T,
65
+ onCreatePlan: r,
66
66
  studentName: p,
67
67
  userType: d
68
68
  }
69
- ),
70
- l && /* @__PURE__ */ t(c, { $flexDirection: "row", $justifyContent: "space-between", $marginBottom: 10, children: [
69
+ ) }),
70
+ c && /* @__PURE__ */ t(s, { $flexDirection: "row", $justifyContent: "space-between", $marginBottom: 10, children: [
71
71
  /* @__PURE__ */ t(C, { $renderAs: "ac4", children: [
72
72
  "Goals (",
73
73
  e.length,
74
74
  ")"
75
75
  ] }),
76
- d === "TEACHER" && /* @__PURE__ */ t(c, { $flexDirection: "row", $flexGapX: 1, children: [
77
- /* @__PURE__ */ o(
76
+ d === "TEACHER" && /* @__PURE__ */ t(s, { $flexDirection: "row", $flexGapX: 1, children: [
77
+ /* @__PURE__ */ n(
78
78
  u,
79
79
  {
80
80
  label: "Create Goal",
@@ -83,11 +83,11 @@ const Me = ne(
83
83
  disabled: !m
84
84
  }
85
85
  ),
86
- /* @__PURE__ */ o(u, { label: "Add Milestone", size: "small", onClick: J })
86
+ /* @__PURE__ */ n(u, { label: "Add Milestone", size: "small", onClick: J })
87
87
  ] })
88
88
  ] }),
89
- r === "INACTIVE" && !!e.length && /* @__PURE__ */ t(
90
- c,
89
+ a === "INACTIVE" && !!e.length && /* @__PURE__ */ t(
90
+ s,
91
91
  {
92
92
  $flexDirection: "row",
93
93
  $alignItems: "center",
@@ -99,17 +99,17 @@ const Me = ne(
99
99
  e.length,
100
100
  ")"
101
101
  ] }),
102
- /* @__PURE__ */ o(re, { onClick: q, $expanded: a })
102
+ /* @__PURE__ */ n(se, { onClick: q, $expanded: l })
103
103
  ]
104
104
  }
105
105
  ),
106
- (h || l || a) && e.map((n, Y) => {
107
- const { id: Z } = n;
106
+ (h || c || l) && e.map((o, Y) => {
107
+ const { id: Z } = o;
108
108
  return /* @__PURE__ */ t(te.Fragment, { children: [
109
- /* @__PURE__ */ o(
110
- se,
109
+ /* @__PURE__ */ n(
110
+ re,
111
111
  {
112
- milestone: n,
112
+ milestone: o,
113
113
  studentId: M,
114
114
  studentName: p,
115
115
  parentName: U,
@@ -117,22 +117,22 @@ const Me = ne(
117
117
  userType: d,
118
118
  onAddOutcome: i,
119
119
  onChapterClick: w,
120
- isMilestoneActive: l || h,
121
- milestoneType: r,
120
+ isMilestoneActive: c || h,
121
+ milestoneType: a,
122
122
  onEdit: D,
123
123
  onCreateMilestoneTest: P,
124
124
  onAddChapter: v,
125
125
  onDelete: E,
126
126
  onDraftPublish: R,
127
- isClassOngoing: T,
127
+ isClassOngoing: N,
128
128
  isStudentPresent: I,
129
- onAssignResources: B,
129
+ onAssignResources: j,
130
130
  onNodeAttempt: b,
131
131
  onNodeView: S,
132
132
  onNodeReview: F,
133
133
  onNodeReattempt: k,
134
- onNodeReset: V,
135
- onNodeUnassign: j,
134
+ onNodeReset: B,
135
+ onNodeUnassign: V,
136
136
  onTestPreview: G,
137
137
  onTestReview: L,
138
138
  onTestStart: O,
@@ -142,7 +142,7 @@ const Me = ne(
142
142
  onWidgetTabSelection: z
143
143
  }
144
144
  ),
145
- Y !== e.length - 1 && /* @__PURE__ */ o(c, { $heightX: 2 })
145
+ Y !== e.length - 1 && /* @__PURE__ */ n(s, { $heightX: 2 })
146
146
  ] }, `milestone=${Z}`);
147
147
  })
148
148
  ] });
@@ -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, useState } 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 Text from '../../../ui/text/text';\nimport MilestoneWidget from './milestone-widget/milestone-widget';\nimport { StyledDownIcon } from './milestone-widget/milestone-widget-styled';\nimport NoActiveMilestone from './no-active-milestone/no-active-milestone';\n\nconst MilestoneList: React.FC<IMilestoneListProps> = memo(\n ({ milestones, studentId, milestoneType, ...restMilestoneListProps }) => {\n const [expandInactiveMilestones, setExpandInactiveMilestones] = useState(false);\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 onExpandPastMilestones,\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 } = 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 toggleExpand = () => {\n if (!expandInactiveMilestones && onExpandPastMilestones) {\n onExpandPastMilestones();\n }\n setExpandInactiveMilestones(!expandInactiveMilestones);\n };\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 <NoActiveMilestone\n canCreatePlan={canCreatePlan}\n isDraftMilestonePresent={draftMilestonePresent}\n isFiltersAdded={isFiltersAdded}\n onCreatePlan={onCreatePlan}\n studentName={studentName}\n userType={userType}\n />\n )}\n\n {isMilestoneActive && (\n <FlexView $flexDirection=\"row\" $justifyContent=\"space-between\" $marginBottom={10}>\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 {milestoneType === 'INACTIVE' && Boolean(milestones.length) && (\n <FlexView\n $flexDirection=\"row\"\n $alignItems=\"center\"\n $justifyContent=\"space-between\"\n $marginBottomX={1}\n >\n <Text $renderAs=\"ac4\">PAST LEARNING PLANS & OUTCOMES ({milestones.length})</Text>\n <StyledDownIcon onClick={toggleExpand} $expanded={expandInactiveMilestones} />\n </FlexView>\n )}\n\n {(isDraftMilestone || isMilestoneActive || expandInactiveMilestones) &&\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 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 && <FlexView $heightX={2} />}\n </React.Fragment>\n );\n })}\n </>\n );\n },\n);\n\nexport default MilestoneList;\n"],"names":["MilestoneList","memo","milestones","studentId","milestoneType","restMilestoneListProps","expandInactiveMilestones","setExpandInactiveMilestones","useState","canCreatePlan","isClassOngoing","isFiltersAdded","isStudentPresent","onAddChapter","onAddOutcome","onChapterClick","onCreatePlan","onDelete","onDraftPublish","onEdit","onExpandPastMilestones","onCreateMilestoneTest","onNodeAttempt","onNodeView","onNodeReview","onNodeReattempt","onNodeReset","onNodeUnassign","onAssignResources","onTestPreview","onTestReview","onTestStart","activeMilestoneId","activeTabId","onWidgetTabSelection","studentName","teacherName","parentName","userType","courseStream","isMilestoneActive","isDraftMilestone","temporaryMilestoneId","useLazyRef","uuidv4","handleCreatePlan","useCallback","toggleExpand","handleOnAddOutcome","activeMilestonePresent","milestone","draftMilestonePresent","jsxs","Fragment","jsx","NoActiveMilestone","FlexView","Text","TextButton","StyledDownIcon","idx","milestoneId","React","MilestoneWidget"],"mappings":";;;;;;;;;;AAaA,MAAMA,KAA+CC;AAAA,EACnD,CAAC,EAAE,YAAAC,GAAY,WAAAC,GAAW,eAAAC,GAAe,GAAGC,QAA6B;AACvE,UAAM,CAACC,GAA0BC,CAA2B,IAAIC,GAAS,EAAK,GACxE;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,wBAAAC;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;AAAA,IACE,IAAAlC,GAEEmC,IAAoBpC,MAAkB,UACtCqC,IAAmBrC,MAAkB,SACrCsC,IAAuBC,GAAWC,EAAM,GAExCC,IAAmBC,EAAY,MAAM;AACzC,MAAA9B,KAAA,QAAAA,EAAe0B;AAAA,IAAoB,GAClC,CAAC1B,GAAc0B,CAAoB,CAAC,GAEjCK,IAAe,MAAM;AACrB,MAAA,CAACzC,KAA4Bc,KACRA,KAEzBb,EAA4B,CAACD,CAAwB;AAAA,IAAA,GAGjD0C,IAAqBF,EAAY,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F;"}
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, useState } 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 Text from '../../../ui/text/text';\nimport MilestoneWidget from './milestone-widget/milestone-widget';\nimport { StyledDownIcon } from './milestone-widget/milestone-widget-styled';\nimport NoActiveMilestone from './no-active-milestone/no-active-milestone';\n\nconst MilestoneList: React.FC<IMilestoneListProps> = memo(\n ({ milestones, studentId, milestoneType, ...restMilestoneListProps }) => {\n const [expandInactiveMilestones, setExpandInactiveMilestones] = useState(false);\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 onExpandPastMilestones,\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 } = 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 toggleExpand = () => {\n if (!expandInactiveMilestones && onExpandPastMilestones) {\n onExpandPastMilestones();\n }\n setExpandInactiveMilestones(!expandInactiveMilestones);\n };\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={32}>\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={10}>\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 {milestoneType === 'INACTIVE' && Boolean(milestones.length) && (\n <FlexView\n $flexDirection=\"row\"\n $alignItems=\"center\"\n $justifyContent=\"space-between\"\n $marginBottomX={1}\n >\n <Text $renderAs=\"ac4\">PAST LEARNING PLANS & OUTCOMES ({milestones.length})</Text>\n <StyledDownIcon onClick={toggleExpand} $expanded={expandInactiveMilestones} />\n </FlexView>\n )}\n\n {(isDraftMilestone || isMilestoneActive || expandInactiveMilestones) &&\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 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 && <FlexView $heightX={2} />}\n </React.Fragment>\n );\n })}\n </>\n );\n },\n);\n\nexport default MilestoneList;\n"],"names":["MilestoneList","memo","milestones","studentId","milestoneType","restMilestoneListProps","expandInactiveMilestones","setExpandInactiveMilestones","useState","canCreatePlan","isClassOngoing","isFiltersAdded","isStudentPresent","onAddChapter","onAddOutcome","onChapterClick","onCreatePlan","onDelete","onDraftPublish","onEdit","onExpandPastMilestones","onCreateMilestoneTest","onNodeAttempt","onNodeView","onNodeReview","onNodeReattempt","onNodeReset","onNodeUnassign","onAssignResources","onTestPreview","onTestReview","onTestStart","activeMilestoneId","activeTabId","onWidgetTabSelection","studentName","teacherName","parentName","userType","courseStream","isMilestoneActive","isDraftMilestone","temporaryMilestoneId","useLazyRef","uuidv4","handleCreatePlan","useCallback","toggleExpand","handleOnAddOutcome","activeMilestonePresent","milestone","draftMilestonePresent","jsxs","Fragment","jsx","FlexView","NoActiveMilestone","Text","TextButton","StyledDownIcon","idx","milestoneId","React","MilestoneWidget"],"mappings":";;;;;;;;;;AAaA,MAAMA,KAA+CC;AAAA,EACnD,CAAC,EAAE,YAAAC,GAAY,WAAAC,GAAW,eAAAC,GAAe,GAAGC,QAA6B;AACvE,UAAM,CAACC,GAA0BC,CAA2B,IAAIC,GAAS,EAAK,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W,IAAI,CAACgD,GAAWU,MAAQ;AAC3B,cAAA,EAAE,IAAIC,EAAgB,IAAAX;AAG1B,eAAA,gBAAAE,EAACU,GAAM,UAAN,EACC,UAAA;AAAA,UAAA,gBAAAR;AAAA,YAACS;AAAA,YAAA;AAAA,cACC,WAAAb;AAAA,cACA,WAAA/C;AAAA,cACA,aAAAgC;AAAA,cACA,YAAAE;AAAA,cACA,aAAAD;AAAA,cACA,UAAAE;AAAA,cACA,cAAAxB;AAAA,cACA,gBAAAC;AAAA,cACA,mBAAmByB,KAAqBC;AAAA,cACxC,eAAArC;AAAA,cACA,QAAAe;AAAA,cACA,uBAAAE;AAAA,cACA,cAAAR;AAAA,cACA,UAAAI;AAAA,cACA,gBAAAC;AAAA,cACA,gBAAAR;AAAA,cACA,kBAAAE;AAAA,cACA,mBAAAgB;AAAA,cACA,eAAAN;AAAA,cACA,YAAAC;AAAA,cACA,cAAAC;AAAA,cACA,iBAAAC;AAAA,cACA,aAAAC;AAAA,cACA,gBAAAC;AAAA,cACA,eAAAE;AAAA,cACA,cAAAC;AAAA,cACA,aAAAC;AAAA,cACA,cAAAQ;AAAA,cACA,mBAAAP;AAAA,cACA,aAAAC;AAAA,cACA,sBAAAC;AAAA,YAAA;AAAA,UACF;AAAA,UACC0B,MAAQ1D,EAAW,SAAS,KAAM,gBAAAoD,EAAAC,GAAA,EAAS,UAAU,GAAG;AAAA,QAlCtC,EAAA,GAAA,aAAaM,CAAW,EAmC7C;AAAA,MAAA,CAEH;AAAA,IACL,EAAA,CAAA;AAAA,EAEJ;AACF;"}
@@ -1,81 +1,82 @@
1
- import { jsx as E, jsxs as O, Fragment as re } from "react/jsx-runtime";
2
- import { h as ae } from "../../../node_modules/humanize-plus/dist/humanize.js";
3
- import { memo as Ee, useMemo as le, useState as R, useCallback as Se, useEffect as p } from "react";
4
- import { ILLUSTRATIONS as me } from "../../../assets/illustrations/illustrations.js";
1
+ import { jsx as E, jsxs as u, Fragment as ae } from "react/jsx-runtime";
2
+ import { h as Ee } from "../../../node_modules/humanize-plus/dist/humanize.js";
3
+ import { memo as le, useMemo as Se, useState as R, useCallback as me, useEffect as p } from "react";
4
+ import { ILLUSTRATIONS as ce } from "../../../assets/illustrations/illustrations.js";
5
5
  import { EVENTS as e } from "../../communication/pub-sub/constants.js";
6
- import { useInClassActionListener as ce } from "../../communication/pub-sub/hooks.js";
6
+ import { useInClassActionListener as Te } from "../../communication/pub-sub/hooks.js";
7
+ import { invalidateHomeworks as f } from "../../homework/hw-card-list/api/get-homeworks.js";
7
8
  import de from "../../ui/separator/separator.js";
8
- import { invalidateMilestoneResources as Te } from "./api/get-milestone-resources.js";
9
- import { useGetAllMilestonesdata as Ae, invalidateMilestonesData as _e } from "./api/get-milestones.js";
10
- import { invalidateTestHelpData as Ne } from "./api/get-tests-list.js";
11
- import De from "./filter-milestones.js";
9
+ import { invalidateMilestoneResources as Ae } from "./api/get-milestone-resources.js";
10
+ import { useGetAllMilestonesdata as _e, invalidateMilestonesData as Ne } from "./api/get-milestones.js";
11
+ import { invalidateTestHelpData as De } from "./api/get-tests-list.js";
12
+ import Me from "./filter-milestones.js";
12
13
  import Ie from "./milestone-list/milestone-list.js";
13
- import Me from "./milestone-list/milestone-loader/milestone-loader.js";
14
- import { ContentWrapper as Le, LoaderWrapper as ue } from "./styled.js";
15
- const Ce = (d) => {
16
- _e(d);
17
- }, Oe = Ee(
18
- ({ studentName: d, studentId: T, studentClassroomId: f, ...h }) => {
14
+ import Le from "./milestone-list/milestone-loader/milestone-loader.js";
15
+ import { ContentWrapper as Ce, LoaderWrapper as Oe } from "./styled.js";
16
+ const ue = (d) => {
17
+ Ne(d);
18
+ }, Re = le(
19
+ ({ studentName: d, studentId: l, studentClassroomId: h, ...P }) => {
19
20
  const {
20
- milestoneType: o,
21
+ milestoneType: s,
21
22
  isStudentPresent: N,
22
- isClassOngoing: P,
23
+ isClassOngoing: v,
23
24
  userType: A,
24
- canCreatePlan: v,
25
- teacherName: G,
26
- parentName: U,
25
+ canCreatePlan: G,
26
+ teacherName: U,
27
+ parentName: g,
27
28
  courseStream: _,
28
- activeMilestoneId: g,
29
- activeTabId: F,
29
+ activeMilestoneId: F,
30
+ activeTabId: w,
30
31
  onExpandPastMilestones: V,
31
- onAddOutcome: w,
32
- onChapterClick: x,
33
- onEdit: b,
34
- onCreateMilestoneTest: y,
35
- onDraftPublish: H,
36
- onAddChapter: k,
37
- onCreatePlan: K,
38
- onDelete: W,
39
- onAssignResources: j,
40
- onNodeAttempt: X,
41
- onNodeView: $,
42
- onNodeReview: q,
43
- onNodeReattempt: z,
44
- onNodeReset: B,
45
- onNodeUnassign: J,
46
- onTestPreview: Q,
47
- onTestReview: Y,
48
- onTestStart: Z,
49
- onWidgetTabSelection: ee
50
- } = h, n = le(
32
+ onAddOutcome: x,
33
+ onChapterClick: b,
34
+ onEdit: y,
35
+ onCreateMilestoneTest: H,
36
+ onDraftPublish: k,
37
+ onAddChapter: K,
38
+ onCreatePlan: W,
39
+ onDelete: j,
40
+ onAssignResources: X,
41
+ onNodeAttempt: $,
42
+ onNodeView: q,
43
+ onNodeReview: z,
44
+ onNodeReattempt: B,
45
+ onNodeReset: J,
46
+ onNodeUnassign: Q,
47
+ onTestPreview: Y,
48
+ onTestReview: Z,
49
+ onTestStart: ee,
50
+ onWidgetTabSelection: te
51
+ } = P, n = Se(
51
52
  () => ({
52
- milestone_state_group: o === "ACTIVE" ? A === "TEACHER" ? "LIVE" : "STUDENT_LIVE" : o,
53
+ milestone_state_group: s === "ACTIVE" ? A === "TEACHER" ? "LIVE" : "STUDENT_LIVE" : s,
53
54
  course_stream: _,
54
- student_id: T
55
+ student_id: l
55
56
  }),
56
- [o, _, T, A]
57
+ [s, _, l, A]
57
58
  ), {
58
59
  data: t,
59
- getAll: S,
60
+ getAll: m,
60
61
  isStale: D,
61
- isProcessing: l
62
- } = Ae(n), [I, M] = R(), [L, u] = R(!1), te = Se(
63
- (m) => {
64
- const { searchText: i, selectedBoard: r, selectedGrade: a } = m || {};
65
- (i || r || a) && u(!0);
66
- const c = t == null ? void 0 : t.filter((s) => {
67
- const { milestone_name: oe, board: ne, grade: ie } = s || {};
68
- return (i ? oe.toLowerCase().includes(i.toLowerCase()) : !0) && (r ? ne === r : !0) && (a ? ie === a : !0);
62
+ isProcessing: S
63
+ } = _e(n), [M, I] = R(), [L, C] = R(!1), oe = me(
64
+ (c) => {
65
+ const { searchText: i, selectedBoard: r, selectedGrade: a } = c || {};
66
+ (i || r || a) && C(!0);
67
+ const T = t == null ? void 0 : t.filter((o) => {
68
+ const { milestone_name: ne, board: ie, grade: re } = o || {};
69
+ return (i ? ne.toLowerCase().includes(i.toLowerCase()) : !0) && (r ? ie === r : !0) && (a ? re === a : !0);
69
70
  });
70
- M(c);
71
+ I(T);
71
72
  },
72
73
  [t]
73
74
  ), se = () => {
74
- u(!1), M(void 0);
75
+ C(!1), I(void 0);
75
76
  };
76
- if (ce(
77
+ if (Te(
77
78
  {
78
- studentClassroomId: f,
79
+ studentClassroomId: h,
79
80
  actions: [
80
81
  [e.CHAPTER_UPDATED],
81
82
  [e.LESSONS_MARKED_AS_FAMILIAR],
@@ -98,41 +99,41 @@ const Ce = (d) => {
98
99
  [e.PAST_MILESTONE_OUTCOME_ADDED],
99
100
  [e.MILESTONE_TEST_ASSIGNED]
100
101
  ],
101
- callback: (m) => {
102
- var a, c;
103
- const i = (a = m.find(
104
- (s) => s.eventName === e.MILESTONE_RESOURCE_ASSIGNED || e.MILESTONE_RESOURCE_UNASSIGNED
105
- )) == null ? void 0 : a.eventPayload, r = (c = m.find(
106
- (s) => s.eventName === e.MILESTONE_TEST_ASSIGNED
107
- )) == null ? void 0 : c.eventPayload;
102
+ callback: (c) => {
103
+ var a, T;
104
+ const i = (a = c.find(
105
+ (o) => o.eventName === e.MILESTONE_RESOURCE_ASSIGNED || e.MILESTONE_RESOURCE_UNASSIGNED
106
+ )) == null ? void 0 : a.eventPayload, r = (T = c.find(
107
+ (o) => o.eventName === e.MILESTONE_TEST_ASSIGNED
108
+ )) == null ? void 0 : T.eventPayload;
108
109
  if (i) {
109
- const { milestoneId: s } = i || {};
110
- Te(s);
110
+ const { milestoneId: o } = i || {};
111
+ f(l), Ae(o);
111
112
  }
112
113
  if (r) {
113
- const { milestoneId: s } = r;
114
- Ne(s);
114
+ const { milestoneId: o } = r;
115
+ f(l), De(o);
115
116
  }
116
- Ce(n);
117
+ ue(n);
117
118
  }
118
119
  },
119
- (o === "ACTIVE" || o === "INACTIVE") && N
120
+ (s === "ACTIVE" || s === "INACTIVE") && N
120
121
  ), p(() => {
121
- S(n);
122
- }, [S, n]), p(() => {
123
- !l && D && S(n);
124
- }, [S, n, D, l]), l && !t)
125
- return /* @__PURE__ */ E(Me, { numMilestones: 2 });
126
- const C = o === "ACTIVE" && t && t.length > 6;
127
- return /* @__PURE__ */ O(Le, { $disablePointerEvents: l, children: [
128
- l && /* @__PURE__ */ E(ue, { children: /* @__PURE__ */ E("img", { src: me.LOADER_1, alt: "loading" }) }),
129
- C && /* @__PURE__ */ O(re, { children: [
122
+ m(n);
123
+ }, [m, n]), p(() => {
124
+ !S && D && m(n);
125
+ }, [m, n, D, S]), S && !t)
126
+ return /* @__PURE__ */ E(Le, { numMilestones: 2 });
127
+ const O = s === "ACTIVE" && t && t.length > 6;
128
+ return /* @__PURE__ */ u(Ce, { $disablePointerEvents: S, children: [
129
+ S && /* @__PURE__ */ E(Oe, { children: /* @__PURE__ */ E("img", { src: ce.LOADER_1, alt: "loading" }) }),
130
+ O && /* @__PURE__ */ u(ae, { children: [
130
131
  /* @__PURE__ */ E(
131
- De,
132
+ Me,
132
133
  {
133
- filteredMilestones: I,
134
+ filteredMilestones: M,
134
135
  milestones: t,
135
- handleFilterMilestones: te,
136
+ handleFilterMilestones: oe,
136
137
  handleClearFilter: se
137
138
  }
138
139
  ),
@@ -141,47 +142,47 @@ const Ce = (d) => {
141
142
  /* @__PURE__ */ E(
142
143
  Ie,
143
144
  {
144
- showFilters: !!C,
145
- canCreatePlan: v,
146
- isClassOngoing: P,
145
+ showFilters: !!O,
146
+ canCreatePlan: G,
147
+ isClassOngoing: v,
147
148
  isFiltersAdded: L,
148
149
  isStudentPresent: N,
149
- milestoneType: o,
150
- milestones: L ? I : t,
151
- onAddChapter: k,
152
- onAddOutcome: w,
153
- onChapterClick: x,
154
- onCreatePlan: K,
155
- onDelete: W,
156
- onDraftPublish: H,
157
- onEdit: b,
150
+ milestoneType: s,
151
+ milestones: L ? M : t,
152
+ onAddChapter: K,
153
+ onAddOutcome: x,
154
+ onChapterClick: b,
155
+ onCreatePlan: W,
156
+ onDelete: j,
157
+ onDraftPublish: k,
158
+ onEdit: y,
158
159
  onExpandPastMilestones: V,
159
- onCreateMilestoneTest: y,
160
- onAssignResources: j,
161
- onTestPreview: Q,
162
- onTestReview: Y,
163
- onTestStart: Z,
164
- onNodeAttempt: X,
165
- onNodeView: $,
166
- onNodeReview: q,
167
- onNodeReattempt: z,
168
- onNodeReset: B,
169
- onNodeUnassign: J,
170
- activeMilestoneId: g,
171
- activeTabId: F,
172
- onWidgetTabSelection: ee,
173
- studentId: T,
174
- studentName: ae.titleCase(d),
175
- teacherName: G,
176
- parentName: U,
160
+ onCreateMilestoneTest: H,
161
+ onAssignResources: X,
162
+ onTestPreview: Y,
163
+ onTestReview: Z,
164
+ onTestStart: ee,
165
+ onNodeAttempt: $,
166
+ onNodeView: q,
167
+ onNodeReview: z,
168
+ onNodeReattempt: B,
169
+ onNodeReset: J,
170
+ onNodeUnassign: Q,
171
+ activeMilestoneId: F,
172
+ activeTabId: w,
173
+ onWidgetTabSelection: te,
174
+ studentId: l,
175
+ studentName: Ee.titleCase(d),
176
+ teacherName: U,
177
+ parentName: g,
177
178
  userType: A,
178
179
  courseStream: _
179
180
  }
180
181
  )
181
182
  ] });
182
183
  }
183
- ), Ke = Oe;
184
+ ), je = Re;
184
185
  export {
185
- Ke as default
186
+ je as default
186
187
  };
187
188
  //# sourceMappingURL=milestone-list-container.js.map