@cuemath/leap 3.5.4-as4 → 3.5.4-as5

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,110 +1,108 @@
1
1
  import { jsx as e, jsxs as s } from "react/jsx-runtime";
2
- import { memo as G, useMemo as x, useState as B, useRef as U, useCallback as Z, useEffect as p } from "react";
3
- import { ILLUSTRATIONS as J } from "../../../assets/illustrations/illustrations.js";
4
- import { Loader as Q } from "../../ui/buttons/button/button-styled.js";
5
- import ee from "../../ui/error/error.js";
2
+ import { memo as G, useMemo as v, useState as x, useRef as U, useCallback as Z, useEffect as $ } from "react";
3
+ import { ILLUSTRATIONS as q } from "../../../assets/illustrations/illustrations.js";
4
+ import { Loader as J } from "../../ui/buttons/button/button-styled.js";
5
+ import Q from "../../ui/error/error.js";
6
6
  import u from "../../ui/layout/flex-view.js";
7
- import te from "../../ui/loader/app-loader/app-loader.js";
8
- import l from "../../ui/separator/separator.js";
9
- import re from "../../ui/simple-accordian/accordion.js";
10
- import E from "../../ui/text/text.js";
11
- import { useDailyTimelineGet as oe } from "../api/use-daily-timeline-get.js";
12
- import { getTimelineCardIcon as ie, getDayMonthYear as N, monthImageMap as ne } from "../comps/accordion-item/utils.js";
13
- import ae from "./daily-timeline-items/daily-timeline-items.js";
14
- import { ScrollWrapper as se, DailyTimelineContainer as le, YearWrapper as me, MonthImageWrapper as ce, DailyItems as he, DailyTimelineItemsContainer as fe } from "./daily-timeline-styled.js";
15
- import { parseISO as O } from "../../../node_modules/date-fns/parseISO.js";
16
- import { isLastDayOfMonth as de } from "../../../node_modules/date-fns/isLastDayOfMonth.js";
17
- const ge = G(
18
- ({ userType: X, studentId: m, courseStreams: $, onPuzzlesClick: j, onReviewClick: k, scrollAreaHeight: K }) => {
19
- const y = x(() => Intl.DateTimeFormat().resolvedOptions().timeZone, []), [T, L] = B([]), [c, C] = B(!1), _ = U(null), R = x(() => ie("NO_ACTIVITY"), []), {
7
+ import ee from "../../ui/loader/app-loader/app-loader.js";
8
+ import m from "../../ui/separator/separator.js";
9
+ import te from "../../ui/simple-accordian/accordion.js";
10
+ import N from "../../ui/text/text.js";
11
+ import { useDailyTimelineGet as re } from "../api/use-daily-timeline-get.js";
12
+ import { getTimelineCardIcon as oe, getDayMonthYear as O, monthImageMap as ie } from "../comps/accordion-item/utils.js";
13
+ import ne from "./daily-timeline-items/daily-timeline-items.js";
14
+ import { ScrollWrapper as ae, DailyTimelineContainer as le, YearWrapper as se, MonthImageWrapper as me, DailyItems as ce, DailyTimelineItemsContainer as he } from "./daily-timeline-styled.js";
15
+ import { parseISO as B } from "../../../node_modules/date-fns/parseISO.js";
16
+ import { isLastDayOfMonth as fe } from "../../../node_modules/date-fns/isLastDayOfMonth.js";
17
+ const de = G(
18
+ ({ userType: c, studentId: h, courseStreams: a, onPuzzlesClick: X, onReviewClick: j, scrollAreaHeight: k }) => {
19
+ const T = v(() => Intl.DateTimeFormat().resolvedOptions().timeZone, []), [y, L] = x([]), [f, C] = x(!1), _ = U(null), K = v(() => oe("NO_ACTIVITY"), []), {
20
20
  get: A,
21
21
  data: r,
22
- isProcessingFailed: Y,
23
- isProcessing: w
24
- } = oe(m), { user_logs: h } = r || {}, n = Z(
25
- (t = 1, i = !1) => {
26
- i && C(!0), A(m, {
22
+ isProcessingFailed: R,
23
+ isProcessing: Y
24
+ } = re(h), { user_logs: d } = r ?? {}, i = Z(
25
+ (t = 1, o = !1) => {
26
+ o && C(!0), A(h, {
27
27
  page: t,
28
28
  size: 10,
29
- timezone: y,
30
- course_stream: $
29
+ timezone: T,
30
+ course_stream: c === "TEACHER" ? a : []
31
31
  });
32
32
  },
33
- [A, m, y, $]
33
+ [A, h, T, c, a]
34
34
  );
35
- return p(() => {
36
- r && (r.curr_page === 1 ? L(h || []) : (L((t) => [...t, ...h || []]), C(!1)));
37
- }, [r, h]), p(() => {
38
- n(1, !1);
39
- }, [n]), p(() => {
35
+ return $(() => {
36
+ r && (r.curr_page === 1 ? L(d ?? []) : (L((t) => [...t, ...d ?? []]), C(!1)));
37
+ }, [r, d]), $(() => {
38
+ i(1, !1);
39
+ }, [i]), $(() => {
40
40
  const t = _.current;
41
41
  if (!t) return;
42
- const i = () => {
43
- r != null && r.next_page && !c && t.scrollTop + t.clientHeight >= t.scrollHeight - 100 && n(r.next_page, !0);
42
+ const o = () => {
43
+ r != null && r.next_page && !f && t.scrollTop + t.clientHeight >= t.scrollHeight - 100 && i(r.next_page, !0);
44
44
  };
45
- return t.addEventListener("scroll", i), () => {
46
- t.removeEventListener("scroll", i);
45
+ return t.addEventListener("scroll", o), () => {
46
+ t.removeEventListener("scroll", o);
47
47
  };
48
- }, [r, c, n]), Y ? /* @__PURE__ */ e(ee, { height: "70vh", onTryAgain: () => n(1, !1) }) : w && !T.length ? /* @__PURE__ */ e(u, { $alignItems: "center", $justifyContent: "center", $height: "100%", children: /* @__PURE__ */ e(te, { width: "100%", height: "100%" }) }) : /* @__PURE__ */ e(
49
- se,
48
+ }, [r, f, i]), R ? /* @__PURE__ */ e(Q, { height: "70vh", onTryAgain: () => i(1, !1) }) : Y && !y.length ? /* @__PURE__ */ e(u, { $alignItems: "center", $justifyContent: "center", $height: "100%", children: /* @__PURE__ */ e(ee, { width: "100%", height: "100%" }) }) : /* @__PURE__ */ e(
49
+ ae,
50
50
  {
51
51
  ref: _,
52
- $height: K,
52
+ $height: k,
53
53
  $alignItems: "center",
54
54
  children: /* @__PURE__ */ s(le, { children: [
55
- T.map((t, i) => {
56
- const { daily_logs: a, from_date: D, to_date: I } = t;
57
- if (a) {
58
- const z = O(D), S = O(I), {
59
- day: M,
60
- month: F,
61
- monthName: P
62
- } = N(z), {
55
+ y.map((t, o) => {
56
+ const { daily_logs: l, from_date: D, to_date: I } = t;
57
+ if (l) {
58
+ const z = B(D), M = B(I), {
63
59
  day: b,
64
- month: f,
65
- year: W,
66
- monthName: H
67
- } = N(S), d = de(S), v = d && f === 12 && b === 31, g = Array.from(
68
- new Set(a.map((o) => o.course_stream).filter(Boolean))
69
- ), V = g.includes("CIRCLE") ? g.length > 2 : g.length > 1;
60
+ month: w,
61
+ monthName: F
62
+ } = O(z), {
63
+ day: E,
64
+ month: g,
65
+ year: H,
66
+ monthName: P
67
+ } = O(M), p = fe(M), S = p && g === 12 && E === 31, W = !!(a && a.length > 1);
70
68
  return /* @__PURE__ */ s(u, { children: [
71
- v && /* @__PURE__ */ s(me, { $gutterX: 1, children: [
72
- /* @__PURE__ */ e(l, { heightX: 1 }),
73
- /* @__PURE__ */ e(E, { $renderAs: "ac4-black", $color: "BLACK_T_60", children: W })
69
+ S && /* @__PURE__ */ s(se, { $gutterX: 1, children: [
70
+ /* @__PURE__ */ e(m, { heightX: 1 }),
71
+ /* @__PURE__ */ e(N, { $renderAs: "ac4-black", $color: "BLACK_T_60", children: H })
74
72
  ] }),
75
- d && f && /* @__PURE__ */ e(
76
- ce,
73
+ p && g && /* @__PURE__ */ e(
74
+ me,
77
75
  {
78
76
  $heightX: 15.36,
79
- $isLastYear: v,
80
- $img: ne[String(F).padStart(2, "0")]
77
+ $isLastYear: S,
78
+ $img: ie[String(w).padStart(2, "0")]
81
79
  }
82
80
  ),
83
- /* @__PURE__ */ s(he, { $gutterX: 1, $addedmonthbreak: !!(d && f), children: [
84
- /* @__PURE__ */ e(l, { heightX: 1 }),
85
- /* @__PURE__ */ e(E, { $renderAs: "ac4-black", $color: "BLACK_T_60", children: D === I ? `${M} ${P}` : `${M} - ${b} ${H}` }),
86
- /* @__PURE__ */ e(l, { heightX: 1 }),
81
+ /* @__PURE__ */ s(ce, { $gutterX: 1, $addedmonthbreak: !!(p && g), children: [
82
+ /* @__PURE__ */ e(m, { heightX: 1 }),
83
+ /* @__PURE__ */ e(N, { $renderAs: "ac4-black", $color: "BLACK_T_60", children: D === I ? `${b} ${F}` : `${b} - ${E} ${P}` }),
84
+ /* @__PURE__ */ e(m, { heightX: 1 }),
87
85
  /* @__PURE__ */ e(
88
- fe,
86
+ he,
89
87
  {
90
- $borderBottomColor: a.length > 0 ? "BLACK" : "BLACK_T_04",
91
- children: a.length > 0 ? a.map((o, q) => /* @__PURE__ */ e(
92
- ae,
88
+ $borderBottomColor: l.length > 0 ? "BLACK" : "BLACK_T_04",
89
+ children: l.length > 0 ? l.map((n, V) => /* @__PURE__ */ e(
90
+ ne,
93
91
  {
94
- type: o.type,
95
- summary: o.summary || "",
96
- courseStream: o.course_stream || void 0,
97
- cards: o.cards,
98
- onPuzzleClick: j,
99
- onReviewClick: k,
100
- userType: X,
101
- shouldShowTag: V && o.course_stream !== "CIRCLE"
92
+ type: n.type,
93
+ summary: n.summary || "",
94
+ courseStream: n.course_stream || void 0,
95
+ cards: n.cards,
96
+ onPuzzleClick: X,
97
+ onReviewClick: j,
98
+ userType: c,
99
+ shouldShowTag: W && n.course_stream !== "CIRCLE"
102
100
  },
103
- `timeline-${q}`
101
+ `timeline-${V}`
104
102
  )) : /* @__PURE__ */ e(
105
- re,
103
+ te,
106
104
  {
107
- icon: R,
105
+ icon: K,
108
106
  title: "No Activity",
109
107
  defaultExpanded: !1,
110
108
  $borderColor: "BLACK_T_04",
@@ -113,18 +111,18 @@ const ge = G(
113
111
  )
114
112
  }
115
113
  ),
116
- /* @__PURE__ */ e(l, { heightX: 1 })
114
+ /* @__PURE__ */ e(m, { heightX: 1 })
117
115
  ] })
118
- ] }, `timeline-entry-${i}`);
116
+ ] }, `timeline-entry-${o}`);
119
117
  }
120
118
  }),
121
- c && /* @__PURE__ */ e(u, { $alignItems: "center", $justifyContent: "center", $height: "100%", children: /* @__PURE__ */ e(Q, { src: J.LOADER, alt: "Loader", $size: "large" }) })
119
+ f && /* @__PURE__ */ e(u, { $alignItems: "center", $justifyContent: "center", $height: "100%", children: /* @__PURE__ */ e(J, { src: q.LOADER, alt: "Loader", $size: "large" }) })
122
120
  ] })
123
121
  }
124
122
  );
125
123
  }
126
- ), Be = ge;
124
+ ), ve = de;
127
125
  export {
128
- Be as default
126
+ ve as default
129
127
  };
130
128
  //# sourceMappingURL=daily-timeline.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"daily-timeline.js","sources":["../../../../src/features/timeline/daily-timeline/daily-timeline.tsx"],"sourcesContent":["import { isLastDayOfMonth, parseISO } from 'date-fns';\nimport { memo, useCallback, useEffect, useMemo, useRef, useState, type FC } from 'react';\n\nimport { ILLUSTRATIONS } from '../../../assets/illustrations/illustrations';\nimport { Loader } from '../../ui/buttons/button/button-styled';\nimport Error from '../../ui/error/error';\nimport FlexView from '../../ui/layout/flex-view';\nimport AppLoader from '../../ui/loader/app-loader/app-loader';\nimport Separator from '../../ui/separator/separator';\nimport Accordion from '../../ui/simple-accordian/accordion';\nimport Text from '../../ui/text/text';\nimport { type TimelineData, useDailyTimelineGet } from '../api/use-daily-timeline-get';\nimport { getDayMonthYear, getTimelineCardIcon, monthImageMap } from '../comps/accordion-item/utils';\nimport DailyTimelineItems from './daily-timeline-items/daily-timeline-items';\nimport * as Styled from './daily-timeline-styled';\nimport { type DailyTimelineProps } from './daily-timeline-types';\n\nconst DailyTimeline: FC<DailyTimelineProps> = memo(\n ({ userType, studentId, courseStreams, onPuzzlesClick, onReviewClick, scrollAreaHeight }) => {\n const timezone = useMemo(() => Intl.DateTimeFormat().resolvedOptions().timeZone, []);\n const [allTimelineData, setAllTimelineData] = useState<TimelineData[]>([]);\n const [isLoadingMore, setIsLoadingMore] = useState(false);\n const scrollContainerRef = useRef<HTMLDivElement>(null);\n const NoActivityIcon = useMemo(() => getTimelineCardIcon('NO_ACTIVITY'), []);\n const {\n get: getTimeline,\n data: timelineData,\n isProcessingFailed,\n isProcessing,\n } = useDailyTimelineGet(studentId);\n const { user_logs: userLogs } = timelineData || {};\n\n const fetchTimeline = useCallback(\n (page = 1, append = false) => {\n if (append) {\n setIsLoadingMore(true);\n }\n\n getTimeline(studentId, {\n page,\n size: 10,\n timezone,\n course_stream: courseStreams,\n });\n },\n [getTimeline, studentId, timezone, courseStreams],\n );\n\n useEffect(() => {\n if (timelineData) {\n if (timelineData.curr_page === 1) {\n setAllTimelineData(userLogs || []);\n } else {\n setAllTimelineData(prev => [...prev, ...(userLogs || [])]);\n setIsLoadingMore(false);\n }\n }\n }, [timelineData, userLogs]);\n\n useEffect(() => {\n fetchTimeline(1, false);\n }, [fetchTimeline]);\n\n useEffect(() => {\n const container = scrollContainerRef.current;\n\n if (!container) return;\n\n const handleScroll = () => {\n if (\n timelineData?.next_page &&\n !isLoadingMore &&\n container.scrollTop + container.clientHeight >= container.scrollHeight - 100\n ) {\n fetchTimeline(timelineData.next_page, true);\n }\n };\n\n container.addEventListener('scroll', handleScroll);\n\n return () => {\n container.removeEventListener('scroll', handleScroll);\n };\n }, [timelineData, isLoadingMore, fetchTimeline]);\n\n if (isProcessingFailed) {\n return <Error height=\"70vh\" onTryAgain={() => fetchTimeline(1, false)} />;\n }\n\n if (isProcessing && !allTimelineData.length) {\n return (\n <FlexView $alignItems=\"center\" $justifyContent=\"center\" $height=\"100%\">\n <AppLoader width=\"100%\" height=\"100%\" />\n </FlexView>\n );\n }\n\n return (\n <Styled.ScrollWrapper\n ref={scrollContainerRef}\n $height={scrollAreaHeight}\n $alignItems=\"center\"\n >\n <Styled.DailyTimelineContainer>\n {allTimelineData.map((entry, index) => {\n const { daily_logs: dailyLogs, from_date: fromDate, to_date: toDate } = entry;\n\n if (dailyLogs) {\n const fromDateObj = parseISO(fromDate);\n const toDateObj = parseISO(toDate);\n\n const {\n day: fromDay,\n month: fromMonth,\n monthName: fromMonthName,\n } = getDayMonthYear(fromDateObj);\n\n const {\n day: toDay,\n month: toMonth,\n year: toYear,\n monthName: toMonthName,\n } = getDayMonthYear(toDateObj);\n\n const isLast = isLastDayOfMonth(toDateObj);\n const isLastYear = isLast && toMonth === 12 && toDay === 31;\n const uniqueCourseStreams = Array.from(\n new Set(dailyLogs.map(log => log.course_stream).filter(Boolean)),\n );\n const shouldShowTag = uniqueCourseStreams.includes('CIRCLE')\n ? uniqueCourseStreams.length > 2\n : uniqueCourseStreams.length > 1;\n\n return (\n <FlexView key={`timeline-entry-${index}`}>\n {isLastYear && (\n <Styled.YearWrapper $gutterX={1}>\n <Separator heightX={1} />\n <Text $renderAs=\"ac4-black\" $color=\"BLACK_T_60\">\n {toYear}\n </Text>\n </Styled.YearWrapper>\n )}\n {isLast && toMonth && (\n <Styled.MonthImageWrapper\n $heightX={15.36}\n $isLastYear={isLastYear}\n $img={\n monthImageMap[\n String(fromMonth).padStart(2, '0') as keyof typeof monthImageMap\n ]\n }\n />\n )}\n <Styled.DailyItems $gutterX={1} $addedmonthbreak={!!(isLast && toMonth)}>\n <Separator heightX={1} />\n <Text $renderAs=\"ac4-black\" $color=\"BLACK_T_60\">\n {fromDate === toDate\n ? `${fromDay} ${fromMonthName}`\n : `${fromDay} - ${toDay} ${toMonthName}`}\n </Text>\n <Separator heightX={1} />\n <Styled.DailyTimelineItemsContainer\n $borderBottomColor={dailyLogs.length > 0 ? 'BLACK' : 'BLACK_T_04'}\n >\n {dailyLogs.length > 0 ? (\n dailyLogs.map((log, logIndex) => (\n <DailyTimelineItems\n key={`timeline-${logIndex}`}\n type={log.type}\n summary={log.summary || ''}\n courseStream={log.course_stream || undefined}\n cards={log.cards}\n onPuzzleClick={onPuzzlesClick}\n onReviewClick={onReviewClick}\n userType={userType}\n shouldShowTag={shouldShowTag && log.course_stream !== 'CIRCLE'}\n />\n ))\n ) : (\n <Accordion\n icon={NoActivityIcon}\n title=\"No Activity\"\n defaultExpanded={false}\n $borderColor=\"BLACK_T_04\"\n $backgroundColor=\"BLACK_T_15\"\n />\n )}\n </Styled.DailyTimelineItemsContainer>\n <Separator heightX={1} />\n </Styled.DailyItems>\n </FlexView>\n );\n }\n })}\n\n {isLoadingMore && (\n <FlexView $alignItems=\"center\" $justifyContent=\"center\" $height=\"100%\">\n <Loader src={ILLUSTRATIONS.LOADER} alt=\"Loader\" $size=\"large\" />\n </FlexView>\n )}\n </Styled.DailyTimelineContainer>\n </Styled.ScrollWrapper>\n );\n },\n);\n\nexport default DailyTimeline;\n"],"names":["DailyTimeline","memo","userType","studentId","courseStreams","onPuzzlesClick","onReviewClick","scrollAreaHeight","timezone","useMemo","allTimelineData","setAllTimelineData","useState","isLoadingMore","setIsLoadingMore","scrollContainerRef","useRef","NoActivityIcon","getTimelineCardIcon","getTimeline","timelineData","isProcessingFailed","isProcessing","useDailyTimelineGet","userLogs","fetchTimeline","useCallback","page","append","useEffect","prev","container","handleScroll","jsx","Error","FlexView","AppLoader","Styled.ScrollWrapper","jsxs","Styled.DailyTimelineContainer","entry","index","dailyLogs","fromDate","toDate","fromDateObj","parseISO","toDateObj","fromDay","fromMonth","fromMonthName","getDayMonthYear","toDay","toMonth","toYear","toMonthName","isLast","isLastDayOfMonth","isLastYear","uniqueCourseStreams","log","shouldShowTag","Styled.YearWrapper","Separator","Text","Styled.MonthImageWrapper","monthImageMap","Styled.DailyItems","Styled.DailyTimelineItemsContainer","logIndex","DailyTimelineItems","Accordion","Loader","ILLUSTRATIONS","DailyTimeline$1"],"mappings":";;;;;;;;;;;;;;;;AAiBA,MAAMA,KAAwCC;AAAA,EAC5C,CAAC,EAAE,UAAAC,GAAU,WAAAC,GAAW,eAAAC,GAAe,gBAAAC,GAAgB,eAAAC,GAAe,kBAAAC,QAAuB;AACrF,UAAAC,IAAWC,EAAQ,MAAM,KAAK,iBAAiB,gBAAgB,EAAE,UAAU,CAAA,CAAE,GAC7E,CAACC,GAAiBC,CAAkB,IAAIC,EAAyB,CAAE,CAAA,GACnE,CAACC,GAAeC,CAAgB,IAAIF,EAAS,EAAK,GAClDG,IAAqBC,EAAuB,IAAI,GAChDC,IAAiBR,EAAQ,MAAMS,GAAoB,aAAa,GAAG,CAAA,CAAE,GACrE;AAAA,MACJ,KAAKC;AAAA,MACL,MAAMC;AAAA,MACN,oBAAAC;AAAA,MACA,cAAAC;AAAA,IAAA,IACEC,GAAoBpB,CAAS,GAC3B,EAAE,WAAWqB,MAAaJ,KAAgB,CAAA,GAE1CK,IAAgBC;AAAA,MACpB,CA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AAA,CACD;AAAA,UAEA5B,KACE,gBAAAoB,EAAAE,GAAA,EAAS,aAAY,UAAS,iBAAgB,UAAS,SAAQ,QAC9D,UAAC,gBAAAF,EAAAuC,GAAA,EAAO,KAAKC,EAAc,QAAQ,KAAI,UAAS,OAAM,QAAQ,CAAA,GAChE;AAAA,QAAA,GAEJ;AAAA,MAAA;AAAA,IAAA;AAAA,EAGN;AACF,GAEAC,KAAe1E;"}
1
+ {"version":3,"file":"daily-timeline.js","sources":["../../../../src/features/timeline/daily-timeline/daily-timeline.tsx"],"sourcesContent":["import { isLastDayOfMonth, parseISO } from 'date-fns';\nimport { memo, useCallback, useEffect, useMemo, useRef, useState, type FC } from 'react';\n\nimport { ILLUSTRATIONS } from '../../../assets/illustrations/illustrations';\nimport { Loader } from '../../ui/buttons/button/button-styled';\nimport Error from '../../ui/error/error';\nimport FlexView from '../../ui/layout/flex-view';\nimport AppLoader from '../../ui/loader/app-loader/app-loader';\nimport Separator from '../../ui/separator/separator';\nimport Accordion from '../../ui/simple-accordian/accordion';\nimport Text from '../../ui/text/text';\nimport { type TimelineData, useDailyTimelineGet } from '../api/use-daily-timeline-get';\nimport { getDayMonthYear, getTimelineCardIcon, monthImageMap } from '../comps/accordion-item/utils';\nimport DailyTimelineItems from './daily-timeline-items/daily-timeline-items';\nimport * as Styled from './daily-timeline-styled';\nimport { type DailyTimelineProps } from './daily-timeline-types';\n\nconst DailyTimeline: FC<DailyTimelineProps> = memo(\n ({ userType, studentId, courseStreams, onPuzzlesClick, onReviewClick, scrollAreaHeight }) => {\n const timezone = useMemo(() => Intl.DateTimeFormat().resolvedOptions().timeZone, []);\n const [allTimelineData, setAllTimelineData] = useState<TimelineData[]>([]);\n const [isLoadingMore, setIsLoadingMore] = useState(false);\n const scrollContainerRef = useRef<HTMLDivElement>(null);\n const NoActivityIcon = useMemo(() => getTimelineCardIcon('NO_ACTIVITY'), []);\n const {\n get: getTimeline,\n data: timelineData,\n isProcessingFailed,\n isProcessing,\n } = useDailyTimelineGet(studentId);\n const { user_logs: userLogs } = timelineData ?? {};\n\n const fetchTimeline = useCallback(\n (page = 1, append = false) => {\n if (append) {\n setIsLoadingMore(true);\n }\n\n getTimeline(studentId, {\n page,\n size: 10,\n timezone,\n course_stream: userType === 'TEACHER' ? courseStreams : [],\n });\n },\n [getTimeline, studentId, timezone, userType, courseStreams],\n );\n\n useEffect(() => {\n if (timelineData) {\n if (timelineData.curr_page === 1) {\n setAllTimelineData(userLogs ?? []);\n } else {\n setAllTimelineData(prev => [...prev, ...(userLogs ?? [])]);\n setIsLoadingMore(false);\n }\n }\n }, [timelineData, userLogs]);\n\n useEffect(() => {\n fetchTimeline(1, false);\n }, [fetchTimeline]);\n\n useEffect(() => {\n const container = scrollContainerRef.current;\n\n if (!container) return;\n\n const handleScroll = () => {\n if (\n timelineData?.next_page &&\n !isLoadingMore &&\n container.scrollTop + container.clientHeight >= container.scrollHeight - 100\n ) {\n fetchTimeline(timelineData.next_page, true);\n }\n };\n\n container.addEventListener('scroll', handleScroll);\n\n return () => {\n container.removeEventListener('scroll', handleScroll);\n };\n }, [timelineData, isLoadingMore, fetchTimeline]);\n\n if (isProcessingFailed) {\n return <Error height=\"70vh\" onTryAgain={() => fetchTimeline(1, false)} />;\n }\n\n if (isProcessing && !allTimelineData.length) {\n return (\n <FlexView $alignItems=\"center\" $justifyContent=\"center\" $height=\"100%\">\n <AppLoader width=\"100%\" height=\"100%\" />\n </FlexView>\n );\n }\n\n return (\n <Styled.ScrollWrapper\n ref={scrollContainerRef}\n $height={scrollAreaHeight}\n $alignItems=\"center\"\n >\n <Styled.DailyTimelineContainer>\n {allTimelineData.map((entry, index) => {\n const { daily_logs: dailyLogs, from_date: fromDate, to_date: toDate } = entry;\n\n if (dailyLogs) {\n const fromDateObj = parseISO(fromDate);\n const toDateObj = parseISO(toDate);\n\n const {\n day: fromDay,\n month: fromMonth,\n monthName: fromMonthName,\n } = getDayMonthYear(fromDateObj);\n\n const {\n day: toDay,\n month: toMonth,\n year: toYear,\n monthName: toMonthName,\n } = getDayMonthYear(toDateObj);\n\n const isLast = isLastDayOfMonth(toDateObj);\n const isLastYear = isLast && toMonth === 12 && toDay === 31;\n const shouldShowTag = !!(courseStreams && courseStreams.length > 1);\n\n return (\n <FlexView key={`timeline-entry-${index}`}>\n {isLastYear && (\n <Styled.YearWrapper $gutterX={1}>\n <Separator heightX={1} />\n <Text $renderAs=\"ac4-black\" $color=\"BLACK_T_60\">\n {toYear}\n </Text>\n </Styled.YearWrapper>\n )}\n {isLast && toMonth && (\n <Styled.MonthImageWrapper\n $heightX={15.36}\n $isLastYear={isLastYear}\n $img={\n monthImageMap[\n String(fromMonth).padStart(2, '0') as keyof typeof monthImageMap\n ]\n }\n />\n )}\n <Styled.DailyItems $gutterX={1} $addedmonthbreak={!!(isLast && toMonth)}>\n <Separator heightX={1} />\n <Text $renderAs=\"ac4-black\" $color=\"BLACK_T_60\">\n {fromDate === toDate\n ? `${fromDay} ${fromMonthName}`\n : `${fromDay} - ${toDay} ${toMonthName}`}\n </Text>\n <Separator heightX={1} />\n <Styled.DailyTimelineItemsContainer\n $borderBottomColor={dailyLogs.length > 0 ? 'BLACK' : 'BLACK_T_04'}\n >\n {dailyLogs.length > 0 ? (\n dailyLogs.map((log, logIndex) => (\n <DailyTimelineItems\n key={`timeline-${logIndex}`}\n type={log.type}\n summary={log.summary || ''}\n courseStream={log.course_stream || undefined}\n cards={log.cards}\n onPuzzleClick={onPuzzlesClick}\n onReviewClick={onReviewClick}\n userType={userType}\n shouldShowTag={shouldShowTag && log.course_stream !== 'CIRCLE'}\n />\n ))\n ) : (\n <Accordion\n icon={NoActivityIcon}\n title=\"No Activity\"\n defaultExpanded={false}\n $borderColor=\"BLACK_T_04\"\n $backgroundColor=\"BLACK_T_15\"\n />\n )}\n </Styled.DailyTimelineItemsContainer>\n <Separator heightX={1} />\n </Styled.DailyItems>\n </FlexView>\n );\n }\n })}\n\n {isLoadingMore && (\n <FlexView $alignItems=\"center\" $justifyContent=\"center\" $height=\"100%\">\n <Loader src={ILLUSTRATIONS.LOADER} alt=\"Loader\" $size=\"large\" />\n </FlexView>\n )}\n </Styled.DailyTimelineContainer>\n </Styled.ScrollWrapper>\n );\n },\n);\n\nexport default DailyTimeline;\n"],"names":["DailyTimeline","memo","userType","studentId","courseStreams","onPuzzlesClick","onReviewClick","scrollAreaHeight","timezone","useMemo","allTimelineData","setAllTimelineData","useState","isLoadingMore","setIsLoadingMore","scrollContainerRef","useRef","NoActivityIcon","getTimelineCardIcon","getTimeline","timelineData","isProcessingFailed","isProcessing","useDailyTimelineGet","userLogs","fetchTimeline","useCallback","page","append","useEffect","prev","container","handleScroll","jsx","Error","FlexView","AppLoader","Styled.ScrollWrapper","jsxs","Styled.DailyTimelineContainer","entry","index","dailyLogs","fromDate","toDate","fromDateObj","parseISO","toDateObj","fromDay","fromMonth","fromMonthName","getDayMonthYear","toDay","toMonth","toYear","toMonthName","isLast","isLastDayOfMonth","isLastYear","shouldShowTag","Styled.YearWrapper","Separator","Text","Styled.MonthImageWrapper","monthImageMap","Styled.DailyItems","Styled.DailyTimelineItemsContainer","log","logIndex","DailyTimelineItems","Accordion","Loader","ILLUSTRATIONS","DailyTimeline$1"],"mappings":";;;;;;;;;;;;;;;;AAiBA,MAAMA,KAAwCC;AAAA,EAC5C,CAAC,EAAE,UAAAC,GAAU,WAAAC,GAAW,eAAAC,GAAe,gBAAAC,GAAgB,eAAAC,GAAe,kBAAAC,QAAuB;AACrF,UAAAC,IAAWC,EAAQ,MAAM,KAAK,iBAAiB,gBAAgB,EAAE,UAAU,CAAA,CAAE,GAC7E,CAACC,GAAiBC,CAAkB,IAAIC,EAAyB,CAAE,CAAA,GACnE,CAACC,GAAeC,CAAgB,IAAIF,EAAS,EAAK,GAClDG,IAAqBC,EAAuB,IAAI,GAChDC,IAAiBR,EAAQ,MAAMS,GAAoB,aAAa,GAAG,CAAA,CAAE,GACrE;AAAA,MACJ,KAAKC;AAAA,MACL,MAAMC;AAAA,MAC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AAA,YAEJ;AAAA,UAAA,CACD;AAAA,UAEA5B,KACE,gBAAAoB,EAAAE,GAAA,EAAS,aAAY,UAAS,iBAAgB,UAAS,SAAQ,QAC9D,UAAC,gBAAAF,EAAAsC,GAAA,EAAO,KAAKC,EAAc,QAAQ,KAAI,UAAS,OAAM,QAAQ,CAAA,GAChE;AAAA,QAAA,GAEJ;AAAA,MAAA;AAAA,IAAA;AAAA,EAGN;AACF,GAEAC,KAAezE;"}
@@ -36,7 +36,7 @@ const D = g(
36
36
  $flexDirection: "row",
37
37
  $alignItems: "center",
38
38
  $justifyContent: "center",
39
- $flexGapX: 0.75,
39
+ $flexGapX: 1.125,
40
40
  children: [
41
41
  /* @__PURE__ */ e(o, { children: n && /* @__PURE__ */ e(C, { src: n }) }),
42
42
  /* @__PURE__ */ e(s, { $renderAs: "ab2", children: c })
@@ -1 +1 @@
1
- {"version":3,"file":"accordion.js","sources":["../../../../src/features/ui/simple-accordian/accordion.tsx"],"sourcesContent":["import { memo, useState, useCallback, type FC } from 'react';\n\nimport MinusIcon from '../../../assets/line-icons/icons/minus';\nimport PlusIcon from '../../../assets/line-icons/icons/plus';\nimport Text from '../text/text';\nimport Image from '../image/image';\nimport FlexView from '../layout/flex-view';\nimport * as Styled from './accordion-styled';\nimport type { IAccordionProps } from './accordion-types';\n\nconst Accordion: FC<IAccordionProps> = memo(\n ({ title, icon, tag, children, defaultExpanded = false, $borderColor, $backgroundColor }) => {\n const [isExpanded, setIsExpanded] = useState(defaultExpanded);\n\n const handleToggle = useCallback(() => {\n if (children) {\n setIsExpanded(prev => !prev);\n }\n }, [children]);\n\n return (\n <FlexView\n $position=\"relative\"\n $borderColor={$borderColor || 'BLACK_1'}\n $background={$backgroundColor || 'WHITE'}\n >\n {tag && (\n <Styled.TagContainer $background=\"BLACK\" $gutter={4}>\n <Text $renderAs=\"ab4-black\" $color=\"WHITE\">\n {tag}\n </Text>\n </Styled.TagContainer>\n )}\n\n <Styled.Wrapper\n $flexDirection=\"row\"\n $alignItems=\"center\"\n $justifyContent=\"space-between\"\n $gutterX={1}\n $gapX={1.32}\n $disabled={!children}\n onClick={handleToggle}\n >\n <FlexView\n $flexDirection=\"row\"\n $alignItems=\"center\"\n $justifyContent=\"center\"\n $flexGapX={0.75}\n >\n <FlexView>{icon && <Image src={icon} />}</FlexView>\n <Text $renderAs=\"ab2\">{title}</Text>\n </FlexView>\n {children &&\n (isExpanded ? (\n <MinusIcon width={20} height={20} />\n ) : (\n <PlusIcon width={20} height={20} />\n ))}\n </Styled.Wrapper>\n\n {children && (\n <Styled.ContentWrapper $isExpanded={isExpanded}>{children}</Styled.ContentWrapper>\n )}\n </FlexView>\n );\n },\n);\n\nexport default Accordion;\n"],"names":["Accordion","memo","title","icon","tag","children","defaultExpanded","$borderColor","$backgroundColor","isExpanded","setIsExpanded","useState","handleToggle","useCallback","prev","jsxs","FlexView","jsx","Styled.TagContainer","Text","Styled.Wrapper","Image","MinusIcon","PlusIcon","Styled.ContentWrapper"],"mappings":";;;;;;;;AAUA,MAAMA,IAAiCC;AAAA,EACrC,CAAC,EAAE,OAAAC,GAAO,MAAAC,GAAM,KAAAC,GAAK,UAAAC,GAAU,iBAAAC,IAAkB,IAAO,cAAAC,GAAc,kBAAAC,QAAuB;AAC3F,UAAM,CAACC,GAAYC,CAAa,IAAIC,EAASL,CAAe,GAEtDM,IAAeC,EAAY,MAAM;AACrC,MAAIR,KACYK,EAAA,CAAAI,MAAQ,CAACA,CAAI;AAAA,IAC7B,GACC,CAACT,CAAQ,CAAC;AAGX,WAAA,gBAAAU;AAAA,MAACC;AAAA,MAAA;AAAA,QACC,WAAU;AAAA,QACV,cAAcT,KAAgB;AAAA,QAC9B,aAAaC,KAAoB;AAAA,QAEhC,UAAA;AAAA,UAAAJ,KACE,gBAAAa,EAAAC,GAAA,EAAoB,aAAY,SAAQ,SAAS,GAChD,UAAA,gBAAAD,EAACE,KAAK,WAAU,aAAY,QAAO,SAChC,YACH,CAAA,GACF;AAAA,UAGF,gBAAAJ;AAAA,YAACK;AAAAA,YAAA;AAAA,cACC,gBAAe;AAAA,cACf,aAAY;AAAA,cACZ,iBAAgB;AAAA,cAChB,UAAU;AAAA,cACV,OAAO;AAAA,cACP,WAAW,CAACf;AAAA,cACZ,SAASO;AAAA,cAET,UAAA;AAAA,gBAAA,gBAAAG;AAAA,kBAACC;AAAA,kBAAA;AAAA,oBACC,gBAAe;AAAA,oBACf,aAAY;AAAA,oBACZ,iBAAgB;AAAA,oBAChB,WAAW;AAAA,oBAEX,UAAA;AAAA,sBAAA,gBAAAC,EAACD,KAAU,UAAQb,KAAA,gBAAAc,EAACI,GAAM,EAAA,KAAKlB,EAAM,CAAA,GAAG;AAAA,sBACvC,gBAAAc,EAAAE,GAAA,EAAK,WAAU,OAAO,UAAMjB,GAAA;AAAA,oBAAA;AAAA,kBAAA;AAAA,gBAC/B;AAAA,gBACCG,MACEI,IACE,gBAAAQ,EAAAK,GAAA,EAAU,OAAO,IAAI,QAAQ,GAAI,CAAA,IAEjC,gBAAAL,EAAAM,GAAA,EAAS,OAAO,IAAI,QAAQ,GAAI,CAAA;AAAA,cAAA;AAAA,YAAA;AAAA,UAEvC;AAAA,UAEClB,KACE,gBAAAY,EAAAO,GAAA,EAAsB,aAAaf,GAAa,UAAAJ,GAAS;AAAA,QAAA;AAAA,MAAA;AAAA,IAAA;AAAA,EAIlE;AACF;"}
1
+ {"version":3,"file":"accordion.js","sources":["../../../../src/features/ui/simple-accordian/accordion.tsx"],"sourcesContent":["import { memo, useState, useCallback, type FC } from 'react';\n\nimport MinusIcon from '../../../assets/line-icons/icons/minus';\nimport PlusIcon from '../../../assets/line-icons/icons/plus';\nimport Text from '../text/text';\nimport Image from '../image/image';\nimport FlexView from '../layout/flex-view';\nimport * as Styled from './accordion-styled';\nimport type { IAccordionProps } from './accordion-types';\n\nconst Accordion: FC<IAccordionProps> = memo(\n ({ title, icon, tag, children, defaultExpanded = false, $borderColor, $backgroundColor }) => {\n const [isExpanded, setIsExpanded] = useState(defaultExpanded);\n\n const handleToggle = useCallback(() => {\n if (children) {\n setIsExpanded(prev => !prev);\n }\n }, [children]);\n\n return (\n <FlexView\n $position=\"relative\"\n $borderColor={$borderColor || 'BLACK_1'}\n $background={$backgroundColor || 'WHITE'}\n >\n {tag && (\n <Styled.TagContainer $background=\"BLACK\" $gutter={4}>\n <Text $renderAs=\"ab4-black\" $color=\"WHITE\">\n {tag}\n </Text>\n </Styled.TagContainer>\n )}\n\n <Styled.Wrapper\n $flexDirection=\"row\"\n $alignItems=\"center\"\n $justifyContent=\"space-between\"\n $gutterX={1}\n $gapX={1.32}\n $disabled={!children}\n onClick={handleToggle}\n >\n <FlexView\n $flexDirection=\"row\"\n $alignItems=\"center\"\n $justifyContent=\"center\"\n $flexGapX={1.125}\n >\n <FlexView>{icon && <Image src={icon} />}</FlexView>\n <Text $renderAs=\"ab2\">{title}</Text>\n </FlexView>\n {children &&\n (isExpanded ? (\n <MinusIcon width={20} height={20} />\n ) : (\n <PlusIcon width={20} height={20} />\n ))}\n </Styled.Wrapper>\n\n {children && (\n <Styled.ContentWrapper $isExpanded={isExpanded}>{children}</Styled.ContentWrapper>\n )}\n </FlexView>\n );\n },\n);\n\nexport default Accordion;\n"],"names":["Accordion","memo","title","icon","tag","children","defaultExpanded","$borderColor","$backgroundColor","isExpanded","setIsExpanded","useState","handleToggle","useCallback","prev","jsxs","FlexView","jsx","Styled.TagContainer","Text","Styled.Wrapper","Image","MinusIcon","PlusIcon","Styled.ContentWrapper"],"mappings":";;;;;;;;AAUA,MAAMA,IAAiCC;AAAA,EACrC,CAAC,EAAE,OAAAC,GAAO,MAAAC,GAAM,KAAAC,GAAK,UAAAC,GAAU,iBAAAC,IAAkB,IAAO,cAAAC,GAAc,kBAAAC,QAAuB;AAC3F,UAAM,CAACC,GAAYC,CAAa,IAAIC,EAASL,CAAe,GAEtDM,IAAeC,EAAY,MAAM;AACrC,MAAIR,KACYK,EAAA,CAAAI,MAAQ,CAACA,CAAI;AAAA,I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yTimelineProps>;
470
470
  declare interface DailyTimelineProps {
471
471
  userType: TUserTypes;
472
472
  studentId: string;
473
- courseStreams: TCourseStream[];
473
+ courseStreams?: TCourseStream[];
474
474
  onPuzzlesClick: (userNodeId: string) => void;
475
475
  onReviewClick: (userNodeId: string) => void;
476
476
  scrollAreaHeight: string | number | undefined;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cuemath/leap",
3
- "version": "3.5.4-as4",
3
+ "version": "3.5.4-as5",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "dist"