@cuemath/leap 3.5.9-as1 → 3.5.9-as3

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,13 +1,31 @@
1
1
  import e from "styled-components";
2
- import t from "../../../ui/layout/flex-view.js";
3
- const i = e(t)`
4
- border-left: ${({ $isLastCard: o, theme: r }) => o ? "none" : `1px dashed ${r.colors.GREY_3}`};
2
+ import n from "../../../ui/layout/flex-view.js";
3
+ const i = e(n)`
4
+ border-bottom: ${({ $shouldAddBorder: o, theme: t }) => o ? `1px solid ${t.colors.BLACK}` : "none"};
5
+ `, p = e(n)`
6
+ border-top: none;
7
+ border-bottom: ${({ $isExpanded: o }) => o && "none"};
8
+ padding-bottom: 24px;
9
+ `, s = e(n)`
10
+ position: absolute;
11
+ top: 0px;
12
+ left: 0px;
13
+ z-index: 2;
14
+ `;
15
+ e(n)`
16
+ border-bottom: ${({ $isLastItem: o, theme: t }) => o ? `1px solid ${t.colors.BLACK}` : "none"};
17
+ `;
18
+ const b = e(n)`
19
+ border-left: ${({ $isLastCard: o, theme: t }) => o ? "none" : `1px dashed ${t.colors.GREY_3}`};
5
20
  padding-bottom: ${({ $isLastCard: o }) => o ? "0" : "20px"};
6
21
  > div {
7
22
  margin-left: -8px;
8
23
  }
9
24
  `;
10
25
  export {
11
- i as Card
26
+ b as Card,
27
+ i as SectionContainer,
28
+ p as SectionFooter,
29
+ s as TagContainer
12
30
  };
13
31
  //# sourceMappingURL=daily-timeline-items-styled.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"daily-timeline-items-styled.js","sources":["../../../../../src/features/timeline/comps/daily-timeline-items/daily-timeline-items-styled.tsx"],"sourcesContent":["import styled from 'styled-components';\n\nimport FlexView from '../../../ui/layout/flex-view';\n\nexport const Card = styled(FlexView)<{ $isLastCard: boolean }>`\n border-left: ${({ $isLastCard, theme }) =>\n $isLastCard ? 'none' : `1px dashed ${theme.colors.GREY_3}`};\n padding-bottom: ${({ $isLastCard }) => ($isLastCard ? '0' : '20px')};\n > div {\n margin-left: -8px;\n }\n`;\n"],"names":["Card","styled","FlexView","$isLastCard","theme"],"mappings":";;AAIa,MAAAA,IAAOC,EAAOC,CAAQ;AAAA,iBAClB,CAAC,EAAE,aAAAC,GAAa,OAAAC,EAAM,MACnCD,IAAc,SAAS,cAAcC,EAAM,OAAO,MAAM,EAAE;AAAA,oBAC1C,CAAC,EAAE,aAAAD,EAAA,MAAmBA,IAAc,MAAM,MAAO;AAAA;AAAA;AAAA;AAAA;"}
1
+ {"version":3,"file":"daily-timeline-items-styled.js","sources":["../../../../../src/features/timeline/comps/daily-timeline-items/daily-timeline-items-styled.tsx"],"sourcesContent":["import styled from 'styled-components';\n\nimport FlexView from '../../../ui/layout/flex-view';\n\nexport const SectionContainer = styled(FlexView)<{ $shouldAddBorder?: boolean }>`\n border-bottom: ${({ $shouldAddBorder, theme }) =>\n $shouldAddBorder ? `1px solid ${theme.colors.BLACK}` : 'none'};\n`;\n\nexport const SectionFooter = styled(FlexView)<{ $isExpanded?: boolean }>`\n border-top: none;\n border-bottom: ${({ $isExpanded }) => $isExpanded && 'none'};\n padding-bottom: 24px;\n`;\n\nexport const TagContainer = styled(FlexView)`\n position: absolute;\n top: 0px;\n left: 0px;\n z-index: 2;\n`;\n\nexport const SectionChild = styled(FlexView)<{ $isLastItem?: boolean }>`\n border-bottom: ${({ $isLastItem, theme }) =>\n $isLastItem ? `1px solid ${theme.colors.BLACK}` : 'none'};\n`;\n\nexport const Card = styled(FlexView)<{ $isLastCard: boolean }>`\n border-left: ${({ $isLastCard, theme }) =>\n $isLastCard ? 'none' : `1px dashed ${theme.colors.GREY_3}`};\n padding-bottom: ${({ $isLastCard }) => ($isLastCard ? '0' : '20px')};\n > div {\n margin-left: -8px;\n }\n`;\n"],"names":["SectionContainer","styled","FlexView","$shouldAddBorder","theme","SectionFooter","$isExpanded","TagContainer","$isLastItem","Card","$isLastCard"],"mappings":";;AAIa,MAAAA,IAAmBC,EAAOC,CAAQ;AAAA,mBAC5B,CAAC,EAAE,kBAAAC,GAAkB,OAAAC,EAAM,MAC1CD,IAAmB,aAAaC,EAAM,OAAO,KAAK,KAAK,MAAM;AAAA,GAGpDC,IAAgBJ,EAAOC,CAAQ;AAAA;AAAA,mBAEzB,CAAC,EAAE,aAAAI,QAAkBA,KAAe,MAAM;AAAA;AAAA,GAIhDC,IAAeN,EAAOC,CAAQ;AAAA;AAAA;AAAA;AAAA;AAAA;AAOfD,EAAOC,CAAQ;AAAA,mBACxB,CAAC,EAAE,aAAAM,GAAa,OAAAJ,EAAM,MACrCI,IAAc,aAAaJ,EAAM,OAAO,KAAK,KAAK,MAAM;AAAA;AAG/C,MAAAK,IAAOR,EAAOC,CAAQ;AAAA,iBAClB,CAAC,EAAE,aAAAQ,GAAa,OAAAN,EAAM,MACnCM,IAAc,SAAS,cAAcN,EAAM,OAAO,MAAM,EAAE;AAAA,oBAC1C,CAAC,EAAE,aAAAM,EAAA,MAAmBA,IAAc,MAAM,MAAO;AAAA;AAAA;AAAA;AAAA;"}
@@ -1,43 +1,110 @@
1
- import { jsx as e } from "react/jsx-runtime";
2
- import { memo as p } from "react";
3
- import f from "../../../ui/layout/flex-view.js";
4
- import u from "../../../ui/simple-accordian/simple-accordion.js";
5
- import g from "../accordion-item/accordion-item.js";
6
- import { Card as h } from "./daily-timeline-items-styled.js";
7
- import { getTimelineCardIcon as y } from "../utils.js";
8
- const C = p((l) => {
1
+ import { jsx as e, jsxs as s, Fragment as y } from "react/jsx-runtime";
2
+ import { memo as w, useState as E, useMemo as A, useCallback as T } from "react";
3
+ import k from "../../../../assets/line-icons/icons/plus.js";
4
+ import S from "../../../ui/accordion-section/accordion-section.js";
5
+ import l from "../../../ui/layout/flex-view.js";
6
+ import j from "../../../../assets/line-icons/icons/minus.js";
7
+ import B from "../../../ui/image/image.js";
8
+ import h from "../../../ui/text/text.js";
9
+ import D from "../accordion-item/accordion-item.js";
10
+ import { SectionContainer as L, TagContainer as v, SectionFooter as F, Card as K } from "./daily-timeline-items-styled.js";
11
+ import { getTimelineCardIcon as V } from "../utils.js";
12
+ import { useUIContext as X } from "../../../ui/context/context.js";
13
+ const z = w(($) => {
9
14
  const {
10
- type: i,
11
- summary: a,
12
- cards: o,
13
- onPuzzleClick: n,
14
- onReviewClick: d,
15
- courseStream: r,
16
- shouldShowTag: s,
17
- userType: c
18
- } = l;
15
+ type: t,
16
+ summary: o,
17
+ cards: n,
18
+ onPuzzleClick: f,
19
+ onReviewClick: g,
20
+ courseStream: m,
21
+ shouldShowTag: C,
22
+ userType: I,
23
+ isLastItem: d,
24
+ fromDate: a,
25
+ studentId: c
26
+ } = $, [r, b] = E(!1), p = A(() => V(t), [t]), { onEvent: x } = X(), _ = T(
27
+ (i) => {
28
+ b(i), x(i ? "timeline_view_expanded" : "timeline_view_collapsed", {
29
+ timeline_date: a,
30
+ student_id: c,
31
+ timeline_section_type: t,
32
+ timeline_section_subject: o
33
+ });
34
+ },
35
+ [a, c, t, o]
36
+ );
19
37
  return /* @__PURE__ */ e(
20
- u,
38
+ S,
21
39
  {
22
- tag: s && r ? r : void 0,
23
- title: a ?? "",
24
- defaultExpanded: !1,
25
- icon: y(i) ?? "",
26
- children: o.length > 0 && /* @__PURE__ */ e(f, { $gutter: 32, $marginBottom: 24, children: o.map((m, t) => /* @__PURE__ */ e(h, { $isLastCard: t === o.length - 1, children: /* @__PURE__ */ e(
27
- g,
40
+ headerElement: /* @__PURE__ */ s(
41
+ L,
42
+ {
43
+ $borderColor: "BLACK_1",
44
+ $shouldAddBorder: d && !r,
45
+ children: [
46
+ C && m && /* @__PURE__ */ e(v, { $position: "absolute", $background: "BLACK", $gutter: 4, children: /* @__PURE__ */ e(h, { $renderAs: "ab4-black", $color: "WHITE", children: m }) }),
47
+ /* @__PURE__ */ s(
48
+ l,
49
+ {
50
+ $flexDirection: "row",
51
+ $alignItems: "center",
52
+ $justifyContent: "space-between",
53
+ $gutterX: 1,
54
+ $gapX: 1.32,
55
+ children: [
56
+ /* @__PURE__ */ s(
57
+ l,
58
+ {
59
+ $flexDirection: "row",
60
+ $alignItems: "center",
61
+ $justifyContent: "center",
62
+ $flexGapX: 1.125,
63
+ children: [
64
+ /* @__PURE__ */ e(l, { children: p && /* @__PURE__ */ e(B, { src: p }) }),
65
+ /* @__PURE__ */ e(h, { $renderAs: "ab2", children: o ?? "" })
66
+ ]
67
+ }
68
+ ),
69
+ r ? /* @__PURE__ */ e(j, { width: 20, height: 20 }) : /* @__PURE__ */ e(k, { width: 20, height: 20 })
70
+ ]
71
+ }
72
+ )
73
+ ]
74
+ }
75
+ ),
76
+ bodyElement: n.length > 0 ? /* @__PURE__ */ e(
77
+ F,
28
78
  {
29
- card: m,
30
- onPuzzleClick: n,
31
- onReviewClick: d,
32
- type: i,
33
- userType: c
79
+ $gutter: 32,
80
+ $borderColor: "BLACK_1",
81
+ $isExpanded: r && !d,
82
+ children: n.map((i, u) => /* @__PURE__ */ e(
83
+ K,
84
+ {
85
+ $isLastCard: u === n.length - 1,
86
+ children: /* @__PURE__ */ e(
87
+ D,
88
+ {
89
+ card: i,
90
+ onPuzzleClick: f,
91
+ onReviewClick: g,
92
+ type: t,
93
+ userType: I
94
+ }
95
+ )
96
+ },
97
+ `${i.node_id}-${u}`
98
+ ))
34
99
  }
35
- ) }, `${m.node_id}-${t}`)) })
100
+ ) : /* @__PURE__ */ e(y, {}),
101
+ defaultVisible: !1,
102
+ onBodyVisibilityChange: _
36
103
  }
37
104
  );
38
105
  });
39
- C.displayName = "DailyTimelineItems";
106
+ z.displayName = "DailyTimelineItems";
40
107
  export {
41
- C as default
108
+ z as default
42
109
  };
43
110
  //# sourceMappingURL=daily-timeline-items.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"daily-timeline-items.js","sources":["../../../../../src/features/timeline/comps/daily-timeline-items/daily-timeline-items.tsx"],"sourcesContent":["import { memo, type FC } from 'react';\n\nimport FlexView from '../../../ui/layout/flex-view';\nimport SimpleAccordion from '../../../ui/simple-accordian/simple-accordion';\nimport AccordionItem from '../accordion-item/accordion-item';\nimport * as Styled from './daily-timeline-items-styled';\nimport { getTimelineCardIcon } from '../utils';\nimport { type IDailyTimelineItemsProps } from './daily-timeline-items.types';\n\nconst DailyTimelineItems: FC<IDailyTimelineItemsProps> = memo(props => {\n const {\n type,\n summary,\n cards,\n onPuzzleClick,\n onReviewClick,\n courseStream,\n shouldShowTag,\n userType,\n } = props;\n\n return (\n <SimpleAccordion\n tag={shouldShowTag && courseStream ? courseStream : undefined}\n title={summary ?? ''}\n defaultExpanded={false}\n icon={getTimelineCardIcon(type) ?? ''}\n >\n {cards.length > 0 && (\n <FlexView $gutter={32} $marginBottom={24}>\n {cards.map((card, index) => (\n <Styled.Card key={`${card.node_id}-${index}`} $isLastCard={index === cards.length - 1}>\n <AccordionItem\n card={card}\n onPuzzleClick={onPuzzleClick}\n onReviewClick={onReviewClick}\n type={type}\n userType={userType}\n />\n </Styled.Card>\n ))}\n </FlexView>\n )}\n </SimpleAccordion>\n );\n});\n\nDailyTimelineItems.displayName = 'DailyTimelineItems';\n\nexport default DailyTimelineItems;\n"],"names":["DailyTimelineItems","memo","props","type","summary","cards","onPuzzleClick","onReviewClick","courseStream","shouldShowTag","userType","jsx","SimpleAccordion","getTimelineCardIcon","FlexView","card","index","Styled.Card","AccordionItem"],"mappings":";;;;;;;AASM,MAAAA,IAAmDC,EAAK,CAASC,MAAA;AAC/D,QAAA;AAAA,IACJ,MAAAC;AAAA,IACA,SAAAC;AAAA,IACA,OAAAC;AAAA,IACA,eAAAC;AAAA,IACA,eAAAC;AAAA,IACA,cAAAC;AAAA,IACA,eAAAC;AAAA,IACA,UAAAC;AAAA,EACE,IAAAR;AAGF,SAAA,gBAAAS;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,KAAKH,KAAiBD,IAAeA,IAAe;AAAA,MACpD,OAAOJ,KAAW;AAAA,MAClB,iBAAiB;AAAA,MACjB,MAAMS,EAAoBV,CAAI,KAAK;AAAA,MAElC,UAAAE,EAAM,SAAS,KACd,gBAAAM,EAACG,KAAS,SAAS,IAAI,eAAe,IACnC,UAAMT,EAAA,IAAI,CAACU,GAAMC,wBACfC,GAAA,EAA6C,aAAaD,MAAUX,EAAM,SAAS,GAClF,UAAA,gBAAAM;AAAA,QAACO;AAAA,QAAA;AAAA,UACC,MAAAH;AAAA,UACA,eAAAT;AAAA,UACA,eAAAC;AAAA,UACA,MAAAJ;AAAA,UACA,UAAAO;AAAA,QAAA;AAAA,MAAA,KANc,GAAGK,EAAK,OAAO,IAAIC,CAAK,EAQ1C,CACD,GACH;AAAA,IAAA;AAAA,EAAA;AAIR,CAAC;AAEDhB,EAAmB,cAAc;"}
1
+ {"version":3,"file":"daily-timeline-items.js","sources":["../../../../../src/features/timeline/comps/daily-timeline-items/daily-timeline-items.tsx"],"sourcesContent":["import { memo, useCallback, useMemo, useState, type FC } from 'react';\n\nimport PlusIcon from '../../../../assets/line-icons/icons/plus';\nimport AccordionSection from '../../../ui/accordion-section/accordion-section';\nimport FlexView from '../../../ui/layout/flex-view';\nimport MinusIcon from '../../../../assets/line-icons/icons/minus';\nimport Image from '../../../ui/image/image';\nimport Text from '../../../ui/text/text';\nimport AccordionItem from '../accordion-item/accordion-item';\nimport * as Styled from './daily-timeline-items-styled';\nimport { getTimelineCardIcon } from '../utils';\nimport { type IDailyTimelineItemsProps } from './daily-timeline-items.types';\nimport { useUIContext } from '../../../ui/context/context';\n\nconst DailyTimelineItems: FC<IDailyTimelineItemsProps> = memo(props => {\n const {\n type,\n summary,\n cards,\n onPuzzleClick,\n onReviewClick,\n courseStream,\n shouldShowTag,\n userType,\n isLastItem,\n fromDate,\n studentId,\n } = props;\n const [isExpended, setIsExpended] = useState(false);\n\n const timelineIcon = useMemo(() => getTimelineCardIcon(type), [type]);\n const { onEvent: trackEvent } = useUIContext();\n\n const handleExpand = useCallback(\n (val: boolean) => {\n setIsExpended(val);\n\n trackEvent(val ? 'timeline_view_expanded' : 'timeline_view_collapsed', {\n timeline_date: fromDate,\n student_id: studentId,\n timeline_section_type: type,\n timeline_section_subject: summary,\n });\n },\n [fromDate, studentId, type, summary],\n );\n\n return (\n <AccordionSection\n headerElement={\n <Styled.SectionContainer\n $borderColor={'BLACK_1'}\n $shouldAddBorder={isLastItem && !isExpended}\n >\n {shouldShowTag && courseStream && (\n <Styled.TagContainer $position=\"absolute\" $background=\"BLACK\" $gutter={4}>\n <Text $renderAs=\"ab4-black\" $color=\"WHITE\">\n {courseStream}\n </Text>\n </Styled.TagContainer>\n )}\n <FlexView\n $flexDirection=\"row\"\n $alignItems=\"center\"\n $justifyContent=\"space-between\"\n $gutterX={1}\n $gapX={1.32}\n >\n <FlexView\n $flexDirection=\"row\"\n $alignItems=\"center\"\n $justifyContent=\"center\"\n $flexGapX={1.125}\n >\n <FlexView>{timelineIcon && <Image src={timelineIcon} />}</FlexView>\n <Text $renderAs=\"ab2\">{summary ?? ''}</Text>\n </FlexView>\n {isExpended ? (\n <MinusIcon width={20} height={20} />\n ) : (\n <PlusIcon width={20} height={20} />\n )}\n </FlexView>\n </Styled.SectionContainer>\n }\n bodyElement={\n cards.length > 0 ? (\n <Styled.SectionFooter\n $gutter={32}\n $borderColor={'BLACK_1'}\n $isExpanded={isExpended && !isLastItem}\n >\n {cards.map((card, index) => (\n <Styled.Card\n key={`${card.node_id}-${index}`}\n $isLastCard={index === cards.length - 1}\n >\n <AccordionItem\n card={card}\n onPuzzleClick={onPuzzleClick}\n onReviewClick={onReviewClick}\n type={type}\n userType={userType}\n />\n </Styled.Card>\n ))}\n </Styled.SectionFooter>\n ) : (\n <></>\n )\n }\n defaultVisible={false}\n onBodyVisibilityChange={handleExpand}\n />\n );\n});\n\nDailyTimelineItems.displayName = 'DailyTimelineItems';\n\nexport default DailyTimelineItems;\n"],"names":["DailyTimelineItems","memo","props","type","summary","cards","onPuzzleClick","onReviewClick","courseStream","shouldShowTag","userType","isLastItem","fromDate","studentId","isExpended","setIsExpended","useState","timelineIcon","useMemo","getTimelineCardIcon","trackEvent","useUIContext","handleExpand","useCallback","val","jsx","AccordionSection","jsxs","Styled.SectionContainer","Styled.TagContainer","Text","FlexView","Image","MinusIcon","PlusIcon","Styled.SectionFooter","card","index","Styled.Card","AccordionItem","Fragment"],"mappings":";;;;;;;;;;;;AAcM,MAAAA,IAAmDC,EAAK,CAASC,MAAA;AAC/D,QAAA;AAAA,IACJ,MAAAC;AAAA,IACA,SAAAC;AAAA,IACA,OAAAC;AAAA,IACA,eAAAC;AAAA,IACA,eAAAC;AAAA,IACA,cAAAC;AAAA,IACA,eAAAC;AAAA,IACA,UAAAC;AAAA,IACA,YAAAC;AAAA,IACA,UAAAC;AAAA,IACA,WAAAC;AAAA,EACE,IAAAX,GACE,CAACY,GAAYC,CAAa,IAAIC,EAAS,EAAK,GAE5CC,IAAeC,EAAQ,MAAMC,EAAoBhB,CAAI,GAAG,CAACA,CAAI,CAAC,GAC9D,EAAE,SAASiB,EAAW,IAAIC,EAAa,GAEvCC,IAAeC;AAAA,IACnB,CAACC,MAAiB;AAChB,MAAAT,EAAcS,CAAG,GAENJ,EAAAI,IAAM,2BAA2B,2BAA2B;AAAA,QACrE,eAAeZ;AAAA,QACf,YAAYC;AAAA,QACZ,uBAAuBV;AAAA,QACvB,0BAA0BC;AAAA,MAAA,CAC3B;AAAA,IACH;AAAA,IACA,CAACQ,GAAUC,GAAWV,GAAMC,CAAO;AAAA,EAAA;AAInC,SAAA,gBAAAqB;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,eACE,gBAAAC;AAAA,QAACC;AAAAA,QAAA;AAAA,UACC,cAAc;AAAA,UACd,kBAAkBjB,KAAc,CAACG;AAAA,UAEhC,UAAA;AAAA,YAAAL,KAAiBD,KACf,gBAAAiB,EAAAI,GAAA,EAAoB,WAAU,YAAW,aAAY,SAAQ,SAAS,GACrE,4BAACC,GAAK,EAAA,WAAU,aAAY,QAAO,SAChC,YACH,CAAA,GACF;AAAA,YAEF,gBAAAH;AAAA,cAACI;AAAA,cAA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AAZ,EAAAe,GAAA,EAAA;AAAA,MAGN,gBAAgB;AAAA,MAChB,wBAAwBlB;AAAA,IAAA;AAAA,EAAA;AAG9B,CAAC;AAEDtB,EAAmB,cAAc;"}
@@ -0,0 +1,40 @@
1
+ import { jsx as t, jsxs as i } from "react/jsx-runtime";
2
+ import { memo as n } from "react";
3
+ import c from "../../ui/image/image.js";
4
+ import e from "../../ui/layout/flex-view.js";
5
+ import m from "../../ui/text/text.js";
6
+ import { getTimelineCardIcon as a } from "./utils.js";
7
+ const o = () => {
8
+ const r = a("NO_ACTIVITY");
9
+ return /* @__PURE__ */ t(
10
+ e,
11
+ {
12
+ $flexDirection: "row",
13
+ $alignItems: "center",
14
+ $justifyContent: "space-between",
15
+ $gutterX: 1,
16
+ $gapX: 1.32,
17
+ $borderColor: "BLACK_T_04",
18
+ $background: "BLACK_T_15",
19
+ children: /* @__PURE__ */ i(
20
+ e,
21
+ {
22
+ $flexDirection: "row",
23
+ $alignItems: "center",
24
+ $justifyContent: "center",
25
+ $flexGapX: 1.125,
26
+ children: [
27
+ /* @__PURE__ */ t(e, { children: r && /* @__PURE__ */ t(c, { src: r }) }),
28
+ /* @__PURE__ */ t(m, { $renderAs: "ab2", children: "No Activity" })
29
+ ]
30
+ }
31
+ )
32
+ }
33
+ );
34
+ };
35
+ o.displayName = "Noactivity";
36
+ const x = n(o);
37
+ export {
38
+ x as default
39
+ };
40
+ //# sourceMappingURL=no-activity.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"no-activity.js","sources":["../../../../src/features/timeline/comps/no-activity.tsx"],"sourcesContent":["import { memo } from 'react';\n\nimport Image from '../../ui/image/image';\nimport FlexView from '../../ui/layout/flex-view';\nimport Text from '../../ui/text/text';\nimport { getTimelineCardIcon } from './utils';\n\nconst Noactivity = () => {\n const NoActivityIcon = getTimelineCardIcon('NO_ACTIVITY');\n\n return (\n <FlexView\n $flexDirection=\"row\"\n $alignItems=\"center\"\n $justifyContent=\"space-between\"\n $gutterX={1}\n $gapX={1.32}\n $borderColor=\"BLACK_T_04\"\n $background=\"BLACK_T_15\"\n >\n <FlexView\n $flexDirection=\"row\"\n $alignItems=\"center\"\n $justifyContent=\"center\"\n $flexGapX={1.125}\n >\n <FlexView>{NoActivityIcon && <Image src={NoActivityIcon} />}</FlexView>\n <Text $renderAs=\"ab2\">No Activity</Text>\n </FlexView>\n </FlexView>\n );\n};\n\nNoactivity.displayName = 'Noactivity';\n\nexport default memo(Noactivity);\n"],"names":["Noactivity","NoActivityIcon","getTimelineCardIcon","jsx","FlexView","jsxs","Image","Text","NoActivity","memo"],"mappings":";;;;;;AAOA,MAAMA,IAAa,MAAM;AACjB,QAAAC,IAAiBC,EAAoB,aAAa;AAGtD,SAAA,gBAAAC;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,gBAAe;AAAA,MACf,aAAY;AAAA,MACZ,iBAAgB;AAAA,MAChB,UAAU;AAAA,MACV,OAAO;AAAA,MACP,cAAa;AAAA,MACb,aAAY;AAAA,MAEZ,UAAA,gBAAAC;AAAA,QAACD;AAAA,QAAA;AAAA,UACC,gBAAe;AAAA,UACf,aAAY;AAAA,UACZ,iBAAgB;AAAA,UAChB,WAAW;AAAA,UAEX,UAAA;AAAA,YAAA,gBAAAD,EAACC,KAAU,UAAkBH,KAAA,gBAAAE,EAACG,GAAM,EAAA,KAAKL,EAAgB,CAAA,GAAG;AAAA,YAC3D,gBAAAE,EAAAI,GAAA,EAAK,WAAU,OAAM,UAAW,eAAA;AAAA,UAAA;AAAA,QAAA;AAAA,MACnC;AAAA,IAAA;AAAA,EAAA;AAGN;AAEAP,EAAW,cAAc;AAEzB,MAAeQ,IAAAC,EAAKT,CAAU;"}
@@ -1,26 +1,18 @@
1
1
  import o from "styled-components";
2
2
  import t from "../ui/layout/flex-view.js";
3
- const n = o(t)`
3
+ const l = o(t)`
4
4
  overflow-y: auto;
5
5
  width: 100%;
6
6
  `, m = o(t)`
7
7
  max-width: 512px;
8
8
  width: 100%;
9
- `, d = o(t)`
10
- & > div {
11
- border-bottom: none;
12
- }
13
- & > div:last-child {
14
- border-bottom: 1px solid ${({ theme: i, $borderBottomColor: e }) => i.colors[e]};
15
- }
16
- `, a = o(t)`
9
+ `, n = o(t)`
17
10
  margin-top: ${({ $addedMonthBreak: i }) => i ? "-122px" : "0"};
18
11
  z-index: 1;
19
12
  `;
20
13
  export {
21
- a as DailyItems,
14
+ n as DailyItems,
22
15
  m as DailyTimelineContainer,
23
- d as DailyTimelineItemsContainer,
24
- n as ScrollWrapper
16
+ l as ScrollWrapper
25
17
  };
26
18
  //# sourceMappingURL=daily-timeline-styled.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"daily-timeline-styled.js","sources":["../../../src/features/timeline/daily-timeline-styled.tsx"],"sourcesContent":["import styled from 'styled-components';\n\nimport FlexView from '../ui/layout/flex-view';\nimport { type TColorNames } from '../ui/types';\n\nconst ScrollWrapper = styled(FlexView)`\n overflow-y: auto;\n width: 100%;\n`;\n\nconst DailyTimelineContainer = styled(FlexView)`\n max-width: 512px;\n width: 100%;\n`;\n\nconst DailyTimelineItemsContainer = styled(FlexView)<{ $borderBottomColor: TColorNames }>`\n & > div {\n border-bottom: none;\n }\n & > div:last-child {\n border-bottom: 1px solid ${({ theme, $borderBottomColor }) => theme.colors[$borderBottomColor]};\n }\n`;\n\nconst DailyItems = styled(FlexView)<{ $addedMonthBreak?: boolean }>`\n margin-top: ${({ $addedMonthBreak }) => ($addedMonthBreak ? '-122px' : '0')};\n z-index: 1;\n`;\n\nexport { DailyTimelineContainer, DailyItems, DailyTimelineItemsContainer, ScrollWrapper };\n"],"names":["ScrollWrapper","styled","FlexView","DailyTimelineContainer","DailyTimelineItemsContainer","theme","$borderBottomColor","DailyItems","$addedMonthBreak"],"mappings":";;AAKM,MAAAA,IAAgBC,EAAOC,CAAQ;AAAA;AAAA;AAAA,GAK/BC,IAAyBF,EAAOC,CAAQ;AAAA;AAAA;AAAA,GAKxCE,IAA8BH,EAAOC,CAAQ;AAAA;AAAA;AAAA;AAAA;AAAA,+BAKpB,CAAC,EAAE,OAAAG,GAAO,oBAAAC,EAAA,MAAyBD,EAAM,OAAOC,CAAkB,CAAC;AAAA;AAAA,GAI5FC,IAAaN,EAAOC,CAAQ;AAAA,gBAClB,CAAC,EAAE,kBAAAM,EAAA,MAAwBA,IAAmB,WAAW,GAAI;AAAA;AAAA;"}
1
+ {"version":3,"file":"daily-timeline-styled.js","sources":["../../../src/features/timeline/daily-timeline-styled.tsx"],"sourcesContent":["import styled from 'styled-components';\n\nimport FlexView from '../ui/layout/flex-view';\n\nconst ScrollWrapper = styled(FlexView)`\n overflow-y: auto;\n width: 100%;\n`;\n\nconst DailyTimelineContainer = styled(FlexView)`\n max-width: 512px;\n width: 100%;\n`;\n\nconst DailyItems = styled(FlexView)<{ $addedMonthBreak?: boolean }>`\n margin-top: ${({ $addedMonthBreak }) => ($addedMonthBreak ? '-122px' : '0')};\n z-index: 1;\n`;\n\nexport { DailyTimelineContainer, DailyItems, ScrollWrapper };\n"],"names":["ScrollWrapper","styled","FlexView","DailyTimelineContainer","DailyItems","$addedMonthBreak"],"mappings":";;AAIM,MAAAA,IAAgBC,EAAOC,CAAQ;AAAA;AAAA;AAAA,GAK/BC,IAAyBF,EAAOC,CAAQ;AAAA;AAAA;AAAA,GAKxCE,IAAaH,EAAOC,CAAQ;AAAA,gBAClB,CAAC,EAAE,kBAAAG,EAAA,MAAwBA,IAAmB,WAAW,GAAI;AAAA;AAAA;"}
@@ -1 +1 @@
1
- {"version":3,"file":"daily-timeline-types.js","sources":["../../../src/features/timeline/daily-timeline-types.ts"],"sourcesContent":["import { type TCourseStream } from '../milestone/create/milestone-create-types';\n\nexport const USER_TYPE = { TEACHER: 'TEACHER', STUDENT: 'STUDENT', PARENT: 'PARENT' } as const;\n\nexport interface IDailyTimelineProps {\n userType: (typeof USER_TYPE)[keyof typeof USER_TYPE];\n studentId: string;\n courseStreams?: TCourseStream[];\n onPuzzlesClick: (userNodeId: string) => void;\n onReviewClick?: (\n userNodeId: string | null,\n isSatMockTestBlock: boolean,\n userBlockId: string | null,\n ) => void;\n scrollAreaHeight: string | number | undefined;\n}\n"],"names":["USER_TYPE"],"mappings":"AAEO,MAAMA,IAAY,EAAE,SAAS,WAAW,SAAS,WAAW,QAAQ,SAAS;"}
1
+ {"version":3,"file":"daily-timeline-types.js","sources":["../../../src/features/timeline/daily-timeline-types.ts"],"sourcesContent":["import { type TCourseStream } from '../milestone/create/milestone-create-types';\n\nexport const USER_TYPE = { TEACHER: 'TEACHER', STUDENT: 'STUDENT', PARENT: 'PARENT' } as const;\n\nexport interface IDailyTimelineProps {\n userType: (typeof USER_TYPE)[keyof typeof USER_TYPE];\n studentId: string;\n courseStreams?: TCourseStream[];\n onPuzzlesClick: (userNodeId: string) => void;\n onReviewClick?: (\n userNodeId: string | null,\n isSatMockTestBlock: boolean,\n userBlockId: string | null,\n ) => void;\n scrollAreaHeight?: string | number;\n}\n"],"names":["USER_TYPE"],"mappings":"AAEO,MAAMA,IAAY,EAAE,SAAS,WAAW,SAAS,WAAW,QAAQ,SAAS;"}
@@ -1,136 +1,133 @@
1
- import { jsx as t, jsxs as u } from "react/jsx-runtime";
2
- import { memo as U, useState as O, useRef as V, useMemo as B, useCallback as W, useEffect as y } from "react";
3
- import { ILLUSTRATIONS as Z } from "../../assets/illustrations/illustrations.js";
4
- import { Loader as q } from "../ui/buttons/button/button-styled.js";
5
- import J from "../ui/error/error.js";
6
- import T from "../ui/layout/flex-view.js";
7
- import Q from "../ui/loader/app-loader/app-loader.js";
8
- import f from "../ui/separator/separator.js";
9
- import ee from "../ui/simple-accordian/simple-accordion.js";
10
- import te from "../ui/text/text.js";
11
- import { useDailyTimelineGet as re } from "./api/use-daily-timeline-get.js";
12
- import { getTimelineCardIcon as oe, getDayMonthYear as R } from "./comps/utils.js";
13
- import ie from "./comps/daily-timeline-items/daily-timeline-items.js";
14
- import { ScrollWrapper as ne, DailyTimelineContainer as ae, DailyItems as se, DailyTimelineItemsContainer as me } from "./daily-timeline-styled.js";
15
- import { USER_TYPE as le } from "./daily-timeline-types.js";
16
- import ce from "./comps/month-break/month-break.js";
17
- import fe from "./comps/year-break/year-break.js";
18
- import { INITIAL_PAGE as he } from "./comps/constants.js";
19
- import { parseISO as v } from "../../node_modules/date-fns/parseISO.js";
20
- import { isLastDayOfMonth as de } from "../../node_modules/date-fns/isLastDayOfMonth.js";
21
- const x = U(
22
- ({ userType: h, studentId: d, courseStreams: m, onPuzzlesClick: b, onReviewClick: k, scrollAreaHeight: _ }) => {
23
- const [l, C] = O([]), [p, L] = O(!1), $ = V(null), j = B(() => oe("NO_ACTIVITY"), []), {
24
- get: D,
25
- data: i,
26
- isProcessingFailed: w,
1
+ import { jsx as o, jsxs as u } from "react/jsx-runtime";
2
+ import { memo as V, useState as v, useCallback as w, useMemo as W, useEffect as p } from "react";
3
+ import q from "../ui/error/error.js";
4
+ import I from "../ui/layout/flex-view.js";
5
+ import H from "../ui/loader/app-loader/app-loader.js";
6
+ import J from "../ui/intersection-loader/intersection-loader.js";
7
+ import g from "../ui/separator/separator.js";
8
+ import Q from "../ui/text/text.js";
9
+ import { useDailyTimelineGet as Z } from "./api/use-daily-timeline-get.js";
10
+ import { getDayMonthYear as N } from "./comps/utils.js";
11
+ import ee from "./comps/daily-timeline-items/daily-timeline-items.js";
12
+ import { ScrollWrapper as oe, DailyTimelineContainer as te, DailyItems as re } from "./daily-timeline-styled.js";
13
+ import { USER_TYPE as ie } from "./daily-timeline-types.js";
14
+ import ae from "./comps/month-break/month-break.js";
15
+ import se from "./comps/year-break/year-break.js";
16
+ import { INITIAL_PAGE as me } from "./comps/constants.js";
17
+ import { getTimezone as ne } from "../../helpers/date-time.js";
18
+ import le from "./comps/no-activity.js";
19
+ import { useUIContext as fe } from "../ui/context/context.js";
20
+ import { parseISO as O } from "../../node_modules/date-fns/parseISO.js";
21
+ import { isLastDayOfMonth as ce } from "../../node_modules/date-fns/isLastDayOfMonth.js";
22
+ const j = V(
23
+ ({ userType: d, studentId: i, courseStreams: l, onPuzzlesClick: P, onReviewClick: R, scrollAreaHeight: L }) => {
24
+ const [f, T] = v([]), [y, $] = v(!1), { onEvent: c } = fe(), {
25
+ get: M,
26
+ data: e,
27
+ isProcessingFailed: X,
27
28
  isProcessing: Y
28
- } = re(d), { user_logs: g } = i ?? {}, a = W(
29
- (e = he, r = !1) => {
30
- r && L(!0), D(d, {
31
- page: e,
29
+ } = Z(i), { user_logs: _ } = e ?? {}, m = w(
30
+ (t = me, a = !1) => {
31
+ a && $(!0), M(i, {
32
+ page: t,
32
33
  size: 10,
33
- timezone: Intl.DateTimeFormat().resolvedOptions().timeZone,
34
- course_stream: h === le.TEACHER ? m : []
34
+ timezone: ne(),
35
+ course_stream: d === ie.TEACHER ? l : []
35
36
  });
36
37
  },
37
- [D, d, h, m]
38
- ), K = B(() => {
39
- const e = /* @__PURE__ */ new Set();
40
- l.forEach((o) => {
41
- o.daily_logs && o.daily_logs.forEach((n) => {
42
- n.course_stream && n.course_stream !== "CIRCLE" && e.add(n.course_stream);
38
+ [M, i, d, l]
39
+ ), b = W(() => {
40
+ const t = /* @__PURE__ */ new Set();
41
+ f.forEach((r) => {
42
+ r.daily_logs && r.daily_logs.forEach((s) => {
43
+ s.course_stream && s.course_stream !== "CIRCLE" && t.add(s.course_stream);
43
44
  });
44
45
  });
45
- const r = new Set(
46
- (m || []).filter((o) => String(o) !== "CIRCLE")
46
+ const a = new Set(
47
+ (l || []).filter((r) => String(r) !== "CIRCLE")
47
48
  );
48
- return r.size > 1 || e.size > 1 || r.size > 0 && e.size > 0 && (r.size !== e.size || !Array.from(r).every((o) => e.has(o)));
49
- }, [l, m]);
50
- return y(() => {
51
- i && (i.curr_page === 1 ? C(g ?? []) : (C((e) => [...e, ...g ?? []]), L(!1)));
52
- }, [i, g]), y(() => {
53
- a(1, !1);
54
- }, [a]), y(() => {
55
- const e = $.current;
56
- if (!e) return;
57
- const r = () => {
58
- i != null && i.next_page && !p && e.scrollTop + e.clientHeight >= e.scrollHeight - 100 && a(i.next_page, !0);
59
- };
60
- return e.addEventListener("scroll", r), () => {
61
- e.removeEventListener("scroll", r);
62
- };
63
- }, [i, p, a]), w ? /* @__PURE__ */ t(J, { height: "70vh", onTryAgain: () => a(1, !1) }) : Y && !l.length ? /* @__PURE__ */ t(T, { $alignItems: "center", $justifyContent: "center", $height: _, children: /* @__PURE__ */ t(Q, { width: "100%", height: "100%" }) }) : /* @__PURE__ */ t(
64
- ne,
49
+ return a.size > 1 || t.size > 1 || a.size > 0 && t.size > 0 && (a.size !== t.size || !Array.from(a).every((r) => t.has(r)));
50
+ }, [f, l]), B = w(() => {
51
+ e != null && e.next_page && !y && m(e.next_page, !0);
52
+ }, [e == null ? void 0 : e.next_page, y, m]);
53
+ return p(() => {
54
+ e && (e.curr_page === 1 ? T(_ ?? []) : (T((t) => [...t, ..._ ?? []]), $(!1)));
55
+ }, [e, _]), p(() => {
56
+ c("timeline_viewed", {
57
+ student_id: i
58
+ });
59
+ }, [i, c]), p(() => () => {
60
+ c("timeline_closed", {
61
+ student_id: i
62
+ });
63
+ }, [i, c]), p(() => {
64
+ m(1, !1);
65
+ }, [m]), X ? /* @__PURE__ */ o(q, { height: L || "100vh", onTryAgain: () => m(1, !1) }) : Y && !f.length ? /* @__PURE__ */ o(
66
+ I,
65
67
  {
66
- ref: $,
67
- $height: _,
68
68
  $alignItems: "center",
69
- children: /* @__PURE__ */ u(ae, { children: [
70
- l.map((e, r) => {
71
- const { daily_logs: o, from_date: n, to_date: I } = e;
72
- if (o) {
73
- const P = v(n), A = v(I), {
74
- day: E,
75
- month: S,
76
- monthName: X
77
- } = R(P), {
78
- day: M,
79
- month: z,
80
- year: F,
81
- monthName: G
82
- } = R(A), c = de(A), N = c && z === 12 && M === 31;
83
- return /* @__PURE__ */ u(T, { children: [
84
- /* @__PURE__ */ t(fe, { toYear: F, isLastDayOfYear: N }),
85
- !N && S && c && /* @__PURE__ */ t(f, { heightX: 1 }),
86
- /* @__PURE__ */ t(ce, { fromMonth: S, isLastDayOfMth: c }),
87
- /* @__PURE__ */ u(se, { $gutterX: 1, $addedMonthBreak: !!(c && z), children: [
88
- /* @__PURE__ */ t(f, { heightX: 1 }),
89
- /* @__PURE__ */ t(te, { $renderAs: "ac4-black", $color: "BLACK_T_60", children: n === I ? `${E} ${X}` : `${E} - ${M} ${G}` }),
90
- /* @__PURE__ */ t(f, { heightX: 1 }),
91
- /* @__PURE__ */ t(
92
- me,
93
- {
94
- $borderBottomColor: o.length > 0 ? "BLACK" : "BLACK_T_04",
95
- children: o.length > 0 ? o.map((s, H) => /* @__PURE__ */ t(
96
- ie,
97
- {
98
- type: s.type,
99
- summary: s.summary ?? "",
100
- courseStream: s.course_stream,
101
- cards: s.cards,
102
- onPuzzleClick: b,
103
- onReviewClick: k,
104
- userType: h,
105
- shouldShowTag: K && s.course_stream !== "CIRCLE"
106
- },
107
- `timeline-${H}`
108
- )) : /* @__PURE__ */ t(
109
- ee,
110
- {
111
- icon: j ?? "",
112
- title: "No Activity",
113
- defaultExpanded: !1,
114
- $borderColor: "BLACK_T_04",
115
- $backgroundColor: "BLACK_T_15"
116
- }
117
- )
118
- }
119
- ),
120
- /* @__PURE__ */ t(f, { heightX: 1 })
121
- ] })
122
- ] }, `timeline-entry-${r}`);
123
- }
124
- }),
125
- p && /* @__PURE__ */ t(T, { $alignItems: "center", $justifyContent: "center", $height: "100%", children: /* @__PURE__ */ t(q, { src: Z.LOADER, alt: "Loader", $size: "large" }) })
126
- ] })
69
+ $justifyContent: "center",
70
+ $height: L || "100vh",
71
+ children: /* @__PURE__ */ o(H, { width: "100%", height: "100%" })
127
72
  }
128
- );
73
+ ) : /* @__PURE__ */ o(oe, { $alignItems: "center", children: /* @__PURE__ */ u(te, { children: [
74
+ f.map((t, a) => {
75
+ const { daily_logs: r, from_date: s, to_date: C } = t;
76
+ if (r) {
77
+ const F = O(s), D = O(C), {
78
+ day: E,
79
+ month: z,
80
+ monthName: G
81
+ } = N(F), {
82
+ day: S,
83
+ month: x,
84
+ year: U,
85
+ monthName: K
86
+ } = N(D), h = ce(D), A = h && x === 12 && S === 31;
87
+ return /* @__PURE__ */ u(I, { children: [
88
+ /* @__PURE__ */ o(se, { toYear: U, isLastDayOfYear: A }),
89
+ !A && z && h && /* @__PURE__ */ o(g, { heightX: 1 }),
90
+ /* @__PURE__ */ o(ae, { fromMonth: z, isLastDayOfMth: h }),
91
+ /* @__PURE__ */ u(re, { $gutterX: 1, $addedMonthBreak: !!(h && x), children: [
92
+ /* @__PURE__ */ o(g, { heightX: 1 }),
93
+ /* @__PURE__ */ o(Q, { $renderAs: "ac4-black", $color: "BLACK_T_60", children: s === C ? `${E} ${G}` : `${E} - ${S} ${K}` }),
94
+ /* @__PURE__ */ o(g, { heightX: 1 }),
95
+ r.length > 0 ? r.map((n, k) => /* @__PURE__ */ o(
96
+ ee,
97
+ {
98
+ type: n.type,
99
+ summary: n.summary ?? "",
100
+ courseStream: n.course_stream,
101
+ cards: n.cards,
102
+ onPuzzleClick: P,
103
+ onReviewClick: R,
104
+ userType: d,
105
+ shouldShowTag: b && n.course_stream !== "CIRCLE",
106
+ isLastItem: k === r.length - 1,
107
+ fromDate: s,
108
+ studentId: i
109
+ },
110
+ `timeline-${k}`
111
+ )) : /* @__PURE__ */ o(le, {}),
112
+ /* @__PURE__ */ o(g, { heightX: 1 })
113
+ ] })
114
+ ] }, `timeline-entry-${a}`);
115
+ }
116
+ }),
117
+ /* @__PURE__ */ o(
118
+ J,
119
+ {
120
+ onLoadMore: B,
121
+ isLoading: y,
122
+ hasMore: !!(e != null && e.next_page)
123
+ }
124
+ )
125
+ ] }) });
129
126
  }
130
127
  );
131
- x.displayName = "DailyTimeline";
132
- const ve = x;
128
+ j.displayName = "DailyTimeline";
129
+ const Ie = j;
133
130
  export {
134
- ve as default
131
+ Ie as default
135
132
  };
136
133
  //# sourceMappingURL=daily-timeline.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"daily-timeline.js","sources":["../../../src/features/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 SimpleAccordion from '../ui/simple-accordian/simple-accordion';\nimport Text from '../ui/text/text';\nimport { type ITimelineData, useDailyTimelineGet } from './api/use-daily-timeline-get';\nimport { getDayMonthYear, getTimelineCardIcon } from './comps/utils';\nimport DailyTimelineItems from './comps/daily-timeline-items/daily-timeline-items';\nimport * as Styled from './daily-timeline-styled';\nimport { USER_TYPE, type IDailyTimelineProps } from './daily-timeline-types';\nimport MonthBreak from './comps/month-break/month-break';\nimport YearBreak from './comps/year-break/year-break';\nimport { INITIAL_PAGE } from './comps/constants';\n\nconst DailyTimeline: FC<IDailyTimelineProps> = memo(\n ({ userType, studentId, courseStreams, onPuzzlesClick, onReviewClick, scrollAreaHeight }) => {\n const [allTimelineData, setAllTimelineData] = useState<ITimelineData[]>([]);\n const [isLoadingMore, setIsLoadingMore] = useState(false);\n const scrollContainerRef = useRef<HTMLDivElement>(null);\n const NoActivityIcon = useMemo(() => getTimelineCardIcon('NO_ACTIVITY'), []);\n\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 = INITIAL_PAGE, append = false) => {\n if (append) {\n setIsLoadingMore(true);\n }\n\n getTimeline(studentId, {\n page,\n size: 10,\n timezone: Intl.DateTimeFormat().resolvedOptions().timeZone,\n course_stream: userType === USER_TYPE.TEACHER ? courseStreams : [],\n });\n },\n [getTimeline, studentId, userType, courseStreams],\n );\n\n const shouldShowTag = useMemo(() => {\n const allCourseStreams = new Set<string>();\n\n allTimelineData.forEach(entry => {\n if (entry.daily_logs) {\n entry.daily_logs.forEach(log => {\n if (log.course_stream && log.course_stream !== 'CIRCLE') {\n allCourseStreams.add(log.course_stream);\n }\n });\n }\n });\n\n const courseStreamsSet = new Set(\n (courseStreams || []).filter(stream => String(stream) !== 'CIRCLE'),\n );\n\n return (\n courseStreamsSet.size > 1 ||\n allCourseStreams.size > 1 ||\n (courseStreamsSet.size > 0 &&\n allCourseStreams.size > 0 &&\n (courseStreamsSet.size !== allCourseStreams.size ||\n !Array.from(courseStreamsSet).every(stream => allCourseStreams.has(stream))))\n );\n }, [allTimelineData, courseStreams]);\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={scrollAreaHeight}>\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 isLastDayOfMth = isLastDayOfMonth(toDateObj);\n const isLastDayOfYear = isLastDayOfMth && toMonth === 12 && toDay === 31;\n\n return (\n <FlexView key={`timeline-entry-${index}`}>\n <YearBreak toYear={toYear} isLastDayOfYear={isLastDayOfYear} />\n {!isLastDayOfYear && fromMonth && isLastDayOfMth && <Separator heightX={1} />}\n <MonthBreak fromMonth={fromMonth} isLastDayOfMth={isLastDayOfMth} />\n <Styled.DailyItems $gutterX={1} $addedMonthBreak={!!(isLastDayOfMth && 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}\n cards={log.cards}\n onPuzzleClick={onPuzzlesClick}\n onReviewClick={onReviewClick}\n userType={userType}\n shouldShowTag={shouldShowTag && log.course_stream !== 'CIRCLE'}\n />\n ))\n ) : (\n <SimpleAccordion\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\nDailyTimeline.displayName = 'DailyTimeline';\n\nexport default DailyTimeline;\n"],"names":["DailyTimeline","memo","userType","studentId","courseStreams","onPuzzlesClick","onReviewClick","scrollAreaHeight","allTimelineData","setAllTimelineData","useState","isLoadingMore","setIsLoadingMore","scrollContainerRef","useRef","NoActivityIcon","useMemo","getTimelineCardIcon","getTimeline","timelineData","isProcessingFailed","isProcessing","useDailyTimelineGet","userLogs","fetchTimeline","useCallback","page","INITIAL_PAGE","append","USER_TYPE","shouldShowTag","allCourseStreams","entry","log","courseStreamsSet","stream","useEffect","prev","container","handleScroll","jsx","Error","FlexView","AppLoader","Styled.ScrollWrapper","jsxs","Styled.DailyTimelineContainer","index","dailyLogs","fromDate","toDate","fromDateObj","parseISO","toDateObj","fromDay","fromMonth","fromMonthName","getDayMonthYear","toDay","toMonth","toYear","toMonthName","isLastDayOfMth","isLastDayOfMonth","isLastDayOfYear","YearBreak","Separator","MonthBreak","Styled.DailyItems","Text","Styled.DailyTimelineItemsContainer","logIndex","DailyTimelineItems","SimpleAccordion","Loader","ILLUSTRATIONS","DailyTimeline$1"],"mappings":";;;;;;;;;;;;;;;;;;;;AAoBA,MAAMA,IAAyCC;AAAA,EAC7C,CAAC,EAAE,UAAAC,GAAU,WAAAC,GAAW,eAAAC,GAAe,gBAAAC,GAAgB,eAAAC,GAAe,kBAAAC,QAAuB;AAC3F,UAAM,CAACC,GAAiBC,CAAkB,IAAIC,EAA0B,CAAE,CAAA,GACpE,CAACC,GAAeC,CAAgB,IAAIF,EAAS,EAAK,GAClDG,IAAqBC,EAAuB,IAAI,GAChDC,IAAiBC,EAAQ,MAAMC,GAAoB,aAAa,G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AI;AAAA,0BAClB,OAAOA,EAAI;AAAA,0BACX,eAAe5B;AAAA,0BACf,eAAAC;AAAA,0BACA,UAAAJ;AAAA,0BACA,eAAe4B,KAAiBG,EAAI,kBAAkB;AAAA,wBAAA;AAAA,wBARjD,YAAYsC,CAAQ;AAAA,sBAU5B,CAAA,IAED,gBAAA/B;AAAA,wBAACiC;AAAA,wBAAA;AAAA,0BACC,MAAM1D,KAAkB;AAAA,0BACxB,OAAM;AAAA,0BACN,iBAAiB;AAAA,0BACjB,cAAa;AAAA,0BACb,kBAAiB;AAAA,wBAAA;AAAA,sBACnB;AAAA,oBAAA;AAAA,kBAEJ;AAAA,kBACA,gBAAAyB,EAAC0B,GAAU,EAAA,SAAS,EAAG,CAAA;AAAA,gBAAA,GACzB;AAAA,cAxCa,EAAA,GAAA,kBAAkBnB,CAAK,EAyCtC;AAAA,YAEJ;AAAA,UAAA,CACD;AAAA,UAEApC,KACE,gBAAA6B,EAAAE,GAAA,EAAS,aAAY,UAAS,iBAAgB,UAAS,SAAQ,QAC9D,UAAC,gBAAAF,EAAAkC,GAAA,EAAO,KAAKC,EAAc,QAAQ,KAAI,UAAS,OAAM,QAAQ,CAAA,GAChE;AAAA,QAAA,GAEJ;AAAA,MAAA;AAAA,IAAA;AAAA,EAGN;AACF;AAEA3E,EAAc,cAAc;AAE5B,MAAA4E,KAAe5E;"}
1
+ {"version":3,"file":"daily-timeline.js","sources":["../../../src/features/timeline/daily-timeline.tsx"],"sourcesContent":["import { isLastDayOfMonth, parseISO } from 'date-fns';\nimport { memo, useCallback, useEffect, useMemo, useState, type FC } from 'react';\n\nimport Error from '../ui/error/error';\nimport FlexView from '../ui/layout/flex-view';\nimport AppLoader from '../ui/loader/app-loader/app-loader';\nimport IntersectionLoader from '../ui/intersection-loader/intersection-loader';\nimport Separator from '../ui/separator/separator';\nimport Text from '../ui/text/text';\nimport { type ITimelineData, useDailyTimelineGet } from './api/use-daily-timeline-get';\nimport { getDayMonthYear } from './comps/utils';\nimport DailyTimelineItems from './comps/daily-timeline-items/daily-timeline-items';\nimport * as Styled from './daily-timeline-styled';\nimport { USER_TYPE, type IDailyTimelineProps } from './daily-timeline-types';\nimport MonthBreak from './comps/month-break/month-break';\nimport YearBreak from './comps/year-break/year-break';\nimport { INITIAL_PAGE } from './comps/constants';\nimport { getTimezone } from '../../helpers/date-time';\nimport NoActivity from './comps/no-activity';\nimport { useUIContext } from '../ui/context/context';\n\nconst DailyTimeline: FC<IDailyTimelineProps> = memo(\n ({ userType, studentId, courseStreams, onPuzzlesClick, onReviewClick, scrollAreaHeight }) => {\n const [allTimelineData, setAllTimelineData] = useState<ITimelineData[]>([]);\n const [isLoadingMore, setIsLoadingMore] = useState(false);\n const { onEvent: trackEvent } = useUIContext();\n\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 = INITIAL_PAGE, append = false) => {\n if (append) {\n setIsLoadingMore(true);\n }\n\n getTimeline(studentId, {\n page,\n size: 10,\n timezone: getTimezone(),\n course_stream: userType === USER_TYPE.TEACHER ? courseStreams : [],\n });\n },\n [getTimeline, studentId, userType, courseStreams],\n );\n\n const shouldShowTag = useMemo(() => {\n const allCourseStreams = new Set<string>();\n\n allTimelineData.forEach(entry => {\n if (entry.daily_logs) {\n entry.daily_logs.forEach(log => {\n if (log.course_stream && log.course_stream !== 'CIRCLE') {\n allCourseStreams.add(log.course_stream);\n }\n });\n }\n });\n\n const courseStreamsSet = new Set(\n (courseStreams || []).filter(stream => String(stream) !== 'CIRCLE'),\n );\n\n return (\n courseStreamsSet.size > 1 ||\n allCourseStreams.size > 1 ||\n (courseStreamsSet.size > 0 &&\n allCourseStreams.size > 0 &&\n (courseStreamsSet.size !== allCourseStreams.size ||\n !Array.from(courseStreamsSet).every(stream => allCourseStreams.has(stream))))\n );\n }, [allTimelineData, courseStreams]);\n\n const handleLoadMore = useCallback(() => {\n if (timelineData?.next_page && !isLoadingMore) {\n fetchTimeline(timelineData.next_page, true);\n }\n }, [timelineData?.next_page, isLoadingMore, fetchTimeline]);\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 trackEvent('timeline_viewed', {\n student_id: studentId,\n });\n }, [studentId, trackEvent]);\n\n useEffect(() => {\n return () => {\n trackEvent('timeline_closed', {\n student_id: studentId,\n });\n };\n }, [studentId, trackEvent]);\n\n useEffect(() => {\n fetchTimeline(1, false);\n }, [fetchTimeline]);\n\n if (isProcessingFailed) {\n return (\n <Error height={scrollAreaHeight || '100vh'} onTryAgain={() => fetchTimeline(1, false)} />\n );\n }\n\n if (isProcessing && !allTimelineData.length) {\n return (\n <FlexView\n $alignItems=\"center\"\n $justifyContent=\"center\"\n $height={scrollAreaHeight || '100vh'}\n >\n <AppLoader width=\"100%\" height=\"100%\" />\n </FlexView>\n );\n }\n\n return (\n <Styled.ScrollWrapper $alignItems=\"center\">\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 isLastDayOfMth = isLastDayOfMonth(toDateObj);\n const isLastDayOfYear = isLastDayOfMth && toMonth === 12 && toDay === 31;\n\n return (\n <FlexView key={`timeline-entry-${index}`}>\n <YearBreak toYear={toYear} isLastDayOfYear={isLastDayOfYear} />\n {!isLastDayOfYear && fromMonth && isLastDayOfMth && <Separator heightX={1} />}\n <MonthBreak fromMonth={fromMonth} isLastDayOfMth={isLastDayOfMth} />\n <Styled.DailyItems $gutterX={1} $addedMonthBreak={!!(isLastDayOfMth && 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 {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}\n cards={log.cards}\n onPuzzleClick={onPuzzlesClick}\n onReviewClick={onReviewClick}\n userType={userType}\n shouldShowTag={shouldShowTag && log.course_stream !== 'CIRCLE'}\n isLastItem={logIndex === dailyLogs.length - 1}\n fromDate={fromDate}\n studentId={studentId}\n />\n ))\n ) : (\n <NoActivity />\n )}\n <Separator heightX={1} />\n </Styled.DailyItems>\n </FlexView>\n );\n }\n })}\n <IntersectionLoader\n onLoadMore={handleLoadMore}\n isLoading={isLoadingMore}\n hasMore={!!timelineData?.next_page}\n />\n </Styled.DailyTimelineContainer>\n </Styled.ScrollWrapper>\n );\n },\n);\n\nDailyTimeline.displayName = 'DailyTimeline';\n\nexport default DailyTimeline;\n"],"names":["DailyTimeline","memo","userType","studentId","courseStreams","onPuzzlesClick","onReviewClick","scrollAreaHeight","allTimelineData","setAllTimelineData","useState","isLoadingMore","setIsLoadingMore","trackEvent","useUIContext","getTimeline","timelineData","isProcessingFailed","isProcessing","useDailyTimelineGet","userLogs","fetchTimeline","useCallback","page","INITIAL_PAGE","append","getTimezone","USER_TYPE","shouldShowTag","useMemo","allCourseStreams","entry","log","courseStreamsSet","stream","handleLoadMore","useEffect","prev","jsx","Error","FlexView","AppLoader","Styled.ScrollWrapper","jsxs","Styled.DailyTimelineContainer","index","dailyLogs","fromDate","toDate","fromDateObj","parseISO","toDateObj","fromDay","fromMonth","fromMonthName","getDayMonthYear","toDay","toMonth","toYear","toMonthName","isLastDayOfMth","isLastDayOfMonth","isLastDayOfYear","YearBreak","Separator","MonthBreak","Styled.DailyItems","Text","logIndex","DailyTimelineItems","NoActivity","IntersectionLoader","DailyTimeline$1"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAqBA,MAAMA,IAAyCC;AAAA,EAC7C,CAAC,EAAE,UAAAC,GAAU,WAAAC,GAAW,eAAAC,GAAe,gBAAAC,GAAgB,eAAAC,GAAe,kBAAAC,QAAuB;AAC3F,UAAM,CAACC,GAAiBC,CAAkB,IAAIC,EAA0B,CAAE,CAAA,GACpE,CAACC,GAAeC,CAAgB,IAAIF,EAAS,EAAK,GAClD,EAAE,SAASG,EAAW,IAAIC,GAAa,GAEvC;AAAA,MACJ,KAAKC;AAAA,MACL,MAAMC;AAAA,MACN,oBAAAC;AAAA,MACA,cAAAC;AAAA,IAAA,IACEC,EAAoBhB,CAAS,GAC3B,EAAE,WAAWiB,MAAaJ,KAAgB,CAAA,GAE1CK,IAAgBC;AAAA,MACpB,CAACC,IAAOC,IAAcC,IAAS,OAAU;AACvC,QAAIA,KACFb,EAAiB,EAAI,GAGvBG,EAAYZ,GAAW;AAAA,UACrB,MAAAoB;AAAA,UACA,MAAM;AAAA,UACN,UAAUG,GAAY;AAAA,UACtB,eAAexB,MAAayB,GAAU,UAAUvB,IAAgB,CAAC;AAAA,QAAA,CAClE;AAAA,MACH;AAAA,MACA,CAACW,GAAaZ,GAAWD,GAAUE,CAAa;AAAA,IAAA,GAG5CwB,IAAgBC,EAAQ,MAAM;AAC5B,YAAAC,wBAAuB;AAE7B,MAAAtB,EAAgB,QAAQ,CAASuB,MAAA;AAC/B,QAAIA,EAAM,cACFA,EAAA,WAAW,QAAQ,CAAOC,MAAA;AAC9B,UAAIA,EAAI,iBAAiBA,EAAI,kBAAkB,YAC5BF,EAAA,IAAIE,EAAI,aAAa;AAAA,QACxC,CACD;AAAA,MACH,CACD;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gCACtBG,GAAK,EAAA,WAAU,aAAY,QAAO,cAChC,gBAAanB,IACV,GAAGI,CAAO,IAAIE,CAAa,KAC3B,GAAGF,CAAO,MAAMI,CAAK,IAAIG,CAAW,IAC1C;AAAA,cACA,gBAAArB,EAAC0B,GAAU,EAAA,SAAS,EAAG,CAAA;AAAA,cACtBlB,EAAU,SAAS,IAClBA,EAAU,IAAI,CAACd,GAAKoC,MAClB,gBAAA9B;AAAA,gBAAC+B;AAAA,gBAAA;AAAA,kBAEC,MAAMrC,EAAI;AAAA,kBACV,SAASA,EAAI,WAAW;AAAA,kBACxB,cAAcA,EAAI;AAAA,kBAClB,OAAOA,EAAI;AAAA,kBACX,eAAe3B;AAAA,kBACf,eAAAC;AAAA,kBACA,UAAAJ;AAAA,kBACA,eAAe0B,KAAiBI,EAAI,kBAAkB;AAAA,kBACtD,YAAYoC,MAAatB,EAAU,SAAS;AAAA,kBAC5C,UAAAC;AAAA,kBACA,WAAA5C;AAAA,gBAAA;AAAA,gBAXK,YAAYiE,CAAQ;AAAA,cAAA,CAa5B,IAED,gBAAA9B,EAACgC,IAAW,EAAA;AAAA,cAEd,gBAAAhC,EAAC0B,GAAU,EAAA,SAAS,EAAG,CAAA;AAAA,YAAA,GACzB;AAAA,UAjCa,EAAA,GAAA,kBAAkBnB,CAAK,EAkCtC;AAAA,QAEJ;AAAA,MAAA,CACD;AAAA,MACD,gBAAAP;AAAA,QAACiC;AAAA,QAAA;AAAA,UACC,YAAYpC;AAAA,UACZ,WAAWxB;AAAA,UACX,SAAS,CAAC,EAACK,KAAA,QAAAA,EAAc;AAAA,QAAA;AAAA,MAC3B;AAAA,IAAA,EACF,CAAA,EACF,CAAA;AAAA,EAEJ;AACF;AAEAhB,EAAc,cAAc;AAE5B,MAAAwE,KAAexE;"}
@@ -0,0 +1,47 @@
1
+ import { jsx as s } from "react/jsx-runtime";
2
+ import { memo as p, useRef as o, useCallback as I, useEffect as d } from "react";
3
+ import { Loader as x } from "../buttons/button/button-styled.js";
4
+ import { ILLUSTRATIONS as R } from "../../../assets/illustrations/illustrations.js";
5
+ import $ from "../layout/flex-view.js";
6
+ const b = p(
7
+ ({ onLoadMore: u, isLoading: r = !1, hasMore: t = !0, rootMargin: f = "50px", threshold: i = 0.1 }) => {
8
+ const n = o(null), e = o(null), m = I(
9
+ (l) => {
10
+ const [c] = l;
11
+ c != null && c.isIntersecting && t && !r && u();
12
+ },
13
+ [u, t, r]
14
+ );
15
+ return d(() => {
16
+ if (!t) {
17
+ e.current && e.current.disconnect();
18
+ return;
19
+ }
20
+ if (r) {
21
+ e.current && e.current.disconnect();
22
+ return;
23
+ }
24
+ return e.current = new IntersectionObserver(m, {
25
+ rootMargin: f,
26
+ threshold: i
27
+ }), n.current && e.current.observe(n.current), () => {
28
+ e.current && e.current.disconnect();
29
+ };
30
+ }, [m, r, t, f, i]), !t && !r ? null : /* @__PURE__ */ s(
31
+ $,
32
+ {
33
+ ref: n,
34
+ $alignItems: "center",
35
+ $justifyContent: "center",
36
+ $height: "80px",
37
+ $width: "100%",
38
+ children: r && /* @__PURE__ */ s(x, { src: R.LOADER, alt: "Loading more...", $size: "medium" })
39
+ }
40
+ );
41
+ }
42
+ );
43
+ b.displayName = "IntersectionLoader";
44
+ export {
45
+ b as default
46
+ };
47
+ //# sourceMappingURL=intersection-loader.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"intersection-loader.js","sources":["../../../../src/features/ui/intersection-loader/intersection-loader.tsx"],"sourcesContent":["import { memo, useCallback, useEffect, useRef, type FC } from 'react';\n\nimport { Loader } from '../buttons/button/button-styled';\nimport { ILLUSTRATIONS } from '../../../assets/illustrations/illustrations';\nimport FlexView from '../layout/flex-view';\n\ninterface IIntersectionLoaderProps {\n onLoadMore: () => void;\n isLoading?: boolean;\n hasMore?: boolean;\n rootMargin?: string;\n threshold?: number;\n}\n\nconst IntersectionLoader: FC<IIntersectionLoaderProps> = memo(\n ({ onLoadMore, isLoading = false, hasMore = true, rootMargin = '50px', threshold = 0.1 }) => {\n const elementRef = useRef<HTMLDivElement>(null);\n const observerRef = useRef<IntersectionObserver | null>(null);\n\n const handleIntersection = useCallback(\n (entries: IntersectionObserverEntry[]) => {\n const [entry] = entries;\n\n if (entry?.isIntersecting && hasMore && !isLoading) {\n onLoadMore();\n }\n },\n [onLoadMore, hasMore, isLoading],\n );\n\n useEffect(() => {\n // Don't observe when no more data\n if (!hasMore) {\n if (observerRef.current) {\n observerRef.current.disconnect();\n }\n\n return;\n }\n\n // Don't observe when loading to prevent multiple calls\n if (isLoading) {\n if (observerRef.current) {\n observerRef.current.disconnect();\n }\n\n return;\n }\n\n // Create new observer\n observerRef.current = new IntersectionObserver(handleIntersection, {\n rootMargin,\n threshold,\n });\n\n // Start observing\n if (elementRef.current) {\n observerRef.current.observe(elementRef.current);\n }\n\n // Cleanup on dependency change\n return () => {\n if (observerRef.current) {\n observerRef.current.disconnect();\n }\n };\n }, [handleIntersection, isLoading, hasMore, rootMargin, threshold]);\n\n if (!hasMore && !isLoading) {\n return null;\n }\n\n return (\n <FlexView\n ref={elementRef}\n $alignItems=\"center\"\n $justifyContent=\"center\"\n $height=\"80px\"\n $width=\"100%\"\n >\n {isLoading && <Loader src={ILLUSTRATIONS.LOADER} alt=\"Loading more...\" $size=\"medium\" />}\n </FlexView>\n );\n },\n);\n\nIntersectionLoader.displayName = 'IntersectionLoader';\n\nexport default IntersectionLoader;\n"],"names":["IntersectionLoader","memo","onLoadMore","isLoading","hasMore","rootMargin","threshold","elementRef","useRef","observerRef","handleIntersection","useCallback","entries","entry","useEffect","jsx","FlexView","Loader","ILLUSTRATIONS"],"mappings":";;;;;AAcA,MAAMA,IAAmDC;AAAA,EACvD,CAAC,EAAE,YAAAC,GAAY,WAAAC,IAAY,IAAO,SAAAC,IAAU,IAAM,YAAAC,IAAa,QAAQ,WAAAC,IAAY,UAAU;AACrF,UAAAC,IAAaC,EAAuB,IAAI,GACxCC,IAAcD,EAAoC,IAAI,GAEtDE,IAAqBC;AAAA,MACzB,CAACC,MAAyC;AAClC,cAAA,CAACC,CAAK,IAAID;AAEhB,QAAIC,KAAA,QAAAA,EAAO,kBAAkBT,KAAW,CAACD,KAC5BD;MAEf;AAAA,MACA,CAACA,GAAYE,GAASD,CAAS;AAAA,IAAA;AAyC7B,WAtCJW,EAAU,MAAM;AAEd,UAAI,CAACV,GAAS;AACZ,QAAIK,EAAY,WACdA,EAAY,QAAQ;AAGtB;AAAA,MACF;AAGA,UAAIN,GAAW;AACb,QAAIM,EAAY,WACdA,EAAY,QAAQ;AAGtB;AAAA,MACF;AAGY,aAAAA,EAAA,UAAU,IAAI,qBAAqBC,GAAoB;AAAA,QACjE,YAAAL;AAAA,QACA,WAAAC;AAAA,MAAA,CACD,GAGGC,EAAW,WACDE,EAAA,QAAQ,QAAQF,EAAW,OAAO,GAIzC,MAAM;AACX,QAAIE,EAAY,WACdA,EAAY,QAAQ;MACtB;AAAA,IACF,GACC,CAACC,GAAoBP,GAAWC,GAASC,GAAYC,CAAS,CAAC,GAE9D,CAACF,KAAW,CAACD,IACR,OAIP,gBAAAY;AAAA,MAACC;AAAA,MAAA;AAAA,QACC,KAAKT;AAAA,QACL,aAAY;AAAA,QACZ,iBAAgB;AAAA,QAChB,SAAQ;AAAA,QACR,QAAO;AAAA,QAEN,UAAAJ,uBAAcc,GAAO,EAAA,KAAKC,EAAc,QAAQ,KAAI,mBAAkB,OAAM,SAAS,CAAA;AAAA,MAAA;AAAA,IAAA;AAAA,EAG5F;AACF;AAEAlB,EAAmB,cAAc;"}
package/dist/index.d.ts CHANGED
@@ -1571,7 +1571,7 @@ declare interface IDailyTimelineProps {
1571
1571
  courseStreams?: TCourseStream[];
1572
1572
  onPuzzlesClick: (userNodeId: string) => void;
1573
1573
  onReviewClick?: (userNodeId: string | null, isSatMockTestBlock: boolean, userBlockId: string | null) => void;
1574
- scrollAreaHeight: string | number | undefined;
1574
+ scrollAreaHeight?: string | number;
1575
1575
  }
1576
1576
 
1577
1577
  declare interface IDatePickerInputProps extends Omit<ICustomInputFieldProps, 'value' | 'onChange'> {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cuemath/leap",
3
- "version": "3.5.9-as1",
3
+ "version": "3.5.9-as3",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "dist"
@@ -1,18 +0,0 @@
1
- import t from "styled-components";
2
- import e from "../layout/flex-view.js";
3
- const r = t(e)`
4
- position: absolute;
5
- top: 0px;
6
- left: 0px;
7
- z-index: 2;
8
- `, i = t(e)`
9
- cursor: ${({ $disabled: o }) => o ? "not-allowed" : "pointer"};
10
- `, l = t(e)`
11
- display: ${({ $isExpanded: o }) => o ? "flex" : "none"};
12
- `;
13
- export {
14
- l as ContentWrapper,
15
- r as TagContainer,
16
- i as Wrapper
17
- };
18
- //# sourceMappingURL=simple-accordion-styled.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"simple-accordion-styled.js","sources":["../../../../src/features/ui/simple-accordian/simple-accordion-styled.tsx"],"sourcesContent":["import styled from 'styled-components';\n\nimport FlexView from '../layout/flex-view';\n\nconst TagContainer = styled(FlexView)`\n position: absolute;\n top: 0px;\n left: 0px;\n z-index: 2;\n`;\n\nconst Wrapper = styled(FlexView)<{ $disabled?: boolean }>`\n cursor: ${({ $disabled }) => ($disabled ? 'not-allowed' : 'pointer')};\n`;\n\nconst ContentWrapper = styled(FlexView)<{ $isExpanded?: boolean }>`\n display: ${({ $isExpanded }) => ($isExpanded ? 'flex' : 'none')};\n`;\n\nexport { TagContainer, Wrapper, ContentWrapper };\n"],"names":["TagContainer","styled","FlexView","Wrapper","$disabled","ContentWrapper","$isExpanded"],"mappings":";;AAIM,MAAAA,IAAeC,EAAOC,CAAQ;AAAA;AAAA;AAAA;AAAA;AAAA,GAO9BC,IAAUF,EAAOC,CAAQ;AAAA,YACnB,CAAC,EAAE,WAAAE,EAAA,MAAiBA,IAAY,gBAAgB,SAAU;AAAA,GAGhEC,IAAiBJ,EAAOC,CAAQ;AAAA,aACzB,CAAC,EAAE,aAAAI,EAAA,MAAmBA,IAAc,SAAS,MAAO;AAAA;"}
@@ -1,60 +0,0 @@
1
- import { jsxs as o, jsx as e } from "react/jsx-runtime";
2
- import { memo as g, useState as u, useCallback as x } from "react";
3
- import b from "../../../assets/line-icons/icons/minus.js";
4
- import h from "../../../assets/line-icons/icons/plus.js";
5
- import s from "../text/text.js";
6
- import C from "../image/image.js";
7
- import t from "../layout/flex-view.js";
8
- import { TagContainer as I, Wrapper as w, ContentWrapper as A } from "./simple-accordion-styled.js";
9
- const k = g(
10
- ({ title: l, icon: i, tag: n, children: r, defaultExpanded: m = !1, $borderColor: c, $backgroundColor: p }) => {
11
- const [a, d] = u(m), $ = x(() => {
12
- r && d((f) => !f);
13
- }, [r]);
14
- return /* @__PURE__ */ o(
15
- t,
16
- {
17
- $position: "relative",
18
- $borderColor: c || "BLACK_1",
19
- $background: p || "WHITE",
20
- children: [
21
- n && /* @__PURE__ */ e(I, { $background: "BLACK", $gutter: 4, children: /* @__PURE__ */ e(s, { $renderAs: "ab4-black", $color: "WHITE", children: n }) }),
22
- /* @__PURE__ */ o(
23
- w,
24
- {
25
- $flexDirection: "row",
26
- $alignItems: "center",
27
- $justifyContent: "space-between",
28
- $gutterX: 1,
29
- $gapX: 1.32,
30
- $disabled: !r,
31
- onClick: $,
32
- children: [
33
- /* @__PURE__ */ o(
34
- t,
35
- {
36
- $flexDirection: "row",
37
- $alignItems: "center",
38
- $justifyContent: "center",
39
- $flexGapX: 1.125,
40
- children: [
41
- /* @__PURE__ */ e(t, { children: i && /* @__PURE__ */ e(C, { src: i }) }),
42
- /* @__PURE__ */ e(s, { $renderAs: "ab2", children: l })
43
- ]
44
- }
45
- ),
46
- r && (a ? /* @__PURE__ */ e(b, { width: 20, height: 20 }) : /* @__PURE__ */ e(h, { width: 20, height: 20 }))
47
- ]
48
- }
49
- ),
50
- r && /* @__PURE__ */ e(A, { $isExpanded: a, children: r })
51
- ]
52
- }
53
- );
54
- }
55
- );
56
- k.displayName = "SimpleAccordion";
57
- export {
58
- k as default
59
- };
60
- //# sourceMappingURL=simple-accordion.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"simple-accordion.js","sources":["../../../../src/features/ui/simple-accordian/simple-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 './simple-accordion-styled';\nimport type { ISimpleAccordionProps } from './simple-accordion-types';\n\nconst SimpleAccordion: FC<ISimpleAccordionProps> = 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\nSimpleAccordion.displayName = 'SimpleAccordion';\n\nexport default SimpleAccordion;\n"],"names":["SimpleAccordion","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,IAA6CC;AAAA,EACjD,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,g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