@cuemath/leap 3.5.4-as1 → 3.5.4-as10

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 +1 @@
1
- {"version":3,"file":"use-daily-timeline-get.js","sources":["../../../../src/features/timeline/api/use-daily-timeline-get.ts"],"sourcesContent":["import { createGetAPI } from '@cuemath/rest-api';\n\nimport { BASE_URL_V3 } from '../../../constants/api';\nimport { stringify } from '../../../helpers/query-string';\nimport type { TCourseStream } from '../../milestone/create/milestone-create-types';\n\nexport type TState = 'COMPLETED' | 'IN_PROGRESS' | 'PENDING';\n\nexport interface ItemRef {\n ref: string;\n}\n\nexport interface TimeLineItem {\n accuracy: number | null;\n block_type: string | null;\n card_type?: string;\n chapter_name: string | null;\n feedback_comments: string | null;\n image_hue: string | null;\n is_timed: boolean;\n items: ItemRef[] | null;\n label: string;\n learnosity_activity_ref: string | null;\n node_id: string;\n node_type: string;\n max_score: number | null;\n points: number | null;\n state: TState;\n subtext: string | null;\n task_type: string | null;\n time_taken: number | null;\n tip: string | null;\n title: string;\n total_questions: number | null;\n total_score: number | null;\n user_id?: string;\n user_node_id: string;\n}\n\nexport interface TimeLineEntry {\n cards: TimeLineItem[];\n course_stream: TCourseStream | 'CIRCLE' | null;\n summary: string | null;\n type: 'CW' | 'HW' | 'CIRCLE';\n}\n\nexport type TimelineData = {\n daily_logs: TimeLineEntry[];\n\n from_date: string;\n to_date: string;\n};\n\nexport type TimelineResponse = {\n curr_page: number | null;\n next_page: number | null;\n per_page: number | null;\n total_pages: number | null;\n user_logs: TimelineData[];\n};\n\ninterface GetUserTimelineParams {\n course_stream?: TCourseStream[];\n page?: number; // defaults to 1\n size?: number; // defaults to 10 - page size means no of dates data\n timezone: string;\n}\n\nconst { useGet: useDailyTimelineGet } = createGetAPI<TimelineResponse, GetUserTimelineParams>({\n getURL: (studentId: string, queryParams) => {\n return `${BASE_URL_V3}/user-timeline/${studentId}?${stringify(queryParams)}`;\n },\n});\n\nexport { useDailyTimelineGet };\n"],"names":["useDailyTimelineGet","createGetAPI","studentId","queryParams","BASE_URL_V3","stringify"],"mappings":";;;AAoEA,MAAM,EAAE,QAAQA,EAAoB,IAAIC,EAAsD;AAAA,EAC5F,QAAQ,CAACC,GAAmBC,MACnB,GAAGC,CAAW,kBAAkBF,CAAS,IAAIG,EAAUF,CAAW,CAAC;AAE9E,CAAC;"}
1
+ {"version":3,"file":"use-daily-timeline-get.js","sources":["../../../../src/features/timeline/api/use-daily-timeline-get.ts"],"sourcesContent":["import { createGetAPI } from '@cuemath/rest-api';\n\nimport { BASE_URL_V3 } from '../../../constants/api';\nimport { stringify } from '../../../helpers/query-string';\nimport type { TCourseStream } from '../../milestone/create/milestone-create-types';\n\nexport type TState = 'COMPLETED' | 'IN_PROGRESS' | 'PENDING';\n\nexport interface ItemRef {\n ref: string;\n}\n\nexport interface TimeLineItem {\n accuracy: number | null;\n block_type: string | null;\n card_type?: string;\n chapter_name: string | null;\n feedback_comments: string | null;\n image_hue: string | null;\n is_timed: boolean;\n items: ItemRef[] | null;\n label: string;\n learnosity_activity_ref: string | null;\n max_score: number | null;\n node_id: string;\n node_type: string;\n points: number | null;\n state: TState;\n subtext: string | null;\n task_type: string | null;\n time_taken: number | null;\n tip: string | null;\n title: string;\n total_questions: number | null;\n total_score: number | null;\n user_block_id: string | null;\n user_id?: string;\n user_node_id: string;\n}\n\nexport interface TimeLineEntry {\n cards: TimeLineItem[];\n course_stream: TCourseStream | 'CIRCLE' | null;\n summary: string | null;\n type: 'CW' | 'HW' | 'CIRCLE';\n}\n\nexport type TimelineData = {\n daily_logs: TimeLineEntry[];\n\n from_date: string;\n to_date: string;\n};\n\nexport type TimelineResponse = {\n curr_page: number | null;\n next_page: number | null;\n per_page: number | null;\n total_pages: number | null;\n user_logs: TimelineData[];\n};\n\ninterface GetUserTimelineParams {\n course_stream?: TCourseStream[];\n page?: number; // defaults to 1\n size?: number; // defaults to 10 - page size means no of dates data\n timezone: string;\n}\n\nconst { useGet: useDailyTimelineGet } = createGetAPI<TimelineResponse, GetUserTimelineParams>({\n getURL: (studentId: string, queryParams) => {\n return `${BASE_URL_V3}/user-timeline/${studentId}?${stringify(queryParams)}`;\n },\n});\n\nexport { useDailyTimelineGet };\n"],"names":["useDailyTimelineGet","createGetAPI","studentId","queryParams","BASE_URL_V3","stringify"],"mappings":";;;AAqEA,MAAM,EAAE,QAAQA,EAAoB,IAAIC,EAAsD;AAAA,EAC5F,QAAQ,CAACC,GAAmBC,MACnB,GAAGC,CAAW,kBAAkBF,CAAS,IAAIG,EAAUF,CAAW,CAAC;AAE9E,CAAC;"}
@@ -1,44 +1,53 @@
1
1
  import { jsxs as o, jsx as r } from "react/jsx-runtime";
2
- import { memo as A, useCallback as h } from "react";
3
- import f from "../../../ui/buttons/text-button/text-button.js";
4
- import i from "../../../ui/layout/flex-view.js";
5
- import c from "../../../ui/text/text.js";
6
- import { getStateColor as _, getStateIcon as w } from "./utils.js";
7
- const C = A(
8
- ({ userType: l, card: $, onPuzzleClick: n, onReviewClick: d }) => {
9
- const { label: t, title: x, state: s, subtext: a, user_node_id: e } = $, b = t === "PUZZLE", m = w(s), u = h(() => {
10
- t === "PUZZLE" && l === "TEACHER" && e && n && n(e);
11
- }, [t, n, e, l]), p = h(() => {
12
- d && e && d(e);
13
- }, [d, e]);
14
- return /* @__PURE__ */ o(i, { $flexDirection: "row", $flexGapX: 1.5, children: [
15
- /* @__PURE__ */ r(i, { $background: _(s), $borderRadiusX: 0.5, $width: 16, $height: 16, children: m && /* @__PURE__ */ r(m, { width: 16, height: 16 }) }),
16
- /* @__PURE__ */ o(i, { $flexRowGapX: 0.25, children: [
17
- /* @__PURE__ */ o(c, { $renderAs: "ub3", children: [
18
- /* @__PURE__ */ o(c, { $renderAs: "ub3-bold", $inline: !0, children: [
19
- t,
2
+ import { memo as I, useCallback as $ } from "react";
3
+ import b from "../../../ui/buttons/text-button/text-button.js";
4
+ import t from "../../../ui/layout/flex-view.js";
5
+ import s from "../../../ui/text/text.js";
6
+ import { getStateColor as k, getStateIcon as L } from "./utils.js";
7
+ import { BLOCK_TYPE as g } from "../../../chapters-v2/constants/block-constants.js";
8
+ const B = I(
9
+ ({ type: n, userType: d, card: C, onPuzzleClick: l, onReviewClick: i }) => {
10
+ const {
11
+ label: a,
12
+ title: T,
13
+ state: c,
14
+ subtext: m,
15
+ user_node_id: e,
16
+ block_type: _,
17
+ user_block_id: h
18
+ } = C, x = a === "PUZZLE", u = L(c), f = c === "COMPLETED", w = d === "TEACHER" && n !== "CIRCLE" || d === "STUDENT" && f && n !== "CIRCLE", A = $(() => {
19
+ e && l && l(e);
20
+ }, [l, e]), p = _ === g.SAT_MOCK_TEST, E = $(() => {
21
+ i && e && i(e, p, h);
22
+ }, [p, i, h, e]);
23
+ return /* @__PURE__ */ o(t, { $flexDirection: "row", $flexGapX: 1.5, children: [
24
+ /* @__PURE__ */ r(t, { $background: k(c), $borderRadiusX: 0.5, $width: 16, $height: 16, children: u && /* @__PURE__ */ r(u, { width: 16, height: 16 }) }),
25
+ /* @__PURE__ */ o(t, { $flexRowGapX: 0.25, children: [
26
+ /* @__PURE__ */ o(s, { $renderAs: "ub3", children: [
27
+ /* @__PURE__ */ o(s, { $renderAs: "ub3-bold", $inline: !0, children: [
28
+ a,
20
29
  ":"
21
30
  ] }),
22
31
  " ",
23
- x
32
+ T
24
33
  ] }),
25
- b ? /* @__PURE__ */ r(
26
- f,
34
+ x ? /* @__PURE__ */ r(
35
+ b,
27
36
  {
28
- label: "View assigned puzzle",
37
+ label: f ? "View reviewed puzzle" : "View assigned puzzle",
29
38
  size: "small",
30
39
  color: "BLACK_T_60",
31
- onClick: u
40
+ onClick: A
32
41
  }
33
- ) : /* @__PURE__ */ o(i, { $flexDirection: "row", $flexGapX: 0.25, children: [
34
- a && /* @__PURE__ */ r(c, { $renderAs: "ub3", $color: "BLACK_T_60", children: a }),
35
- l === "TEACHER" && /* @__PURE__ */ r(
36
- f,
42
+ ) : /* @__PURE__ */ o(t, { $flexDirection: "row", $flexGapX: 0.75, $alignItems: "center", children: [
43
+ m && /* @__PURE__ */ r(s, { $renderAs: "ub3", $color: "BLACK_T_60", children: m }),
44
+ w && /* @__PURE__ */ r(
45
+ b,
37
46
  {
38
47
  label: "Review",
39
48
  size: "small",
40
49
  color: "BLACK_T_60",
41
- onClick: p
50
+ onClick: E
42
51
  }
43
52
  )
44
53
  ] })
@@ -46,8 +55,8 @@ const C = A(
46
55
  ] });
47
56
  }
48
57
  );
49
- C.displayName = "AccordionItem";
58
+ B.displayName = "AccordionItem";
50
59
  export {
51
- C as default
60
+ B as default
52
61
  };
53
62
  //# sourceMappingURL=accordion-item.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"accordion-item.js","sources":["../../../../../src/features/timeline/comps/accordion-item/accordion-item.tsx"],"sourcesContent":["import { memo, useCallback, type FC } from 'react';\n\nimport TextButton from '../../../ui/buttons/text-button/text-button';\nimport FlexView from '../../../ui/layout/flex-view';\nimport Text from '../../../ui/text/text';\nimport type { AccordionItemProps } from './accordion-item-types';\nimport { getStateColor, getStateIcon } from './utils';\n\nconst AccordionItem: FC<AccordionItemProps> = memo(\n ({ userType, card, onPuzzleClick, onReviewClick }) => {\n const { label, title, state, subtext, user_node_id: userNodeId } = card;\n const isPuzzle = label === 'PUZZLE';\n const Icon = getStateIcon(state);\n\n const handleClick = useCallback(() => {\n if (label === 'PUZZLE' && userType === 'TEACHER' && userNodeId && onPuzzleClick) {\n onPuzzleClick(userNodeId);\n }\n }, [label, onPuzzleClick, userNodeId, userType]);\n\n const handleReviewClick = useCallback(() => {\n if (onReviewClick && userNodeId) {\n onReviewClick(userNodeId);\n }\n }, [onReviewClick, userNodeId]);\n\n return (\n <FlexView $flexDirection=\"row\" $flexGapX={1.5}>\n <FlexView $background={getStateColor(state)} $borderRadiusX={0.5} $width={16} $height={16}>\n {Icon && <Icon width={16} height={16} />}\n </FlexView>\n <FlexView $flexRowGapX={0.25}>\n <Text $renderAs=\"ub3\">\n <Text $renderAs=\"ub3-bold\" $inline>\n {label}:\n </Text>{' '}\n {title}\n </Text>\n {isPuzzle ? (\n <TextButton\n label=\"View assigned puzzle\"\n size=\"small\"\n color=\"BLACK_T_60\"\n onClick={handleClick}\n />\n ) : (\n <FlexView $flexDirection=\"row\" $flexGapX={0.25}>\n {subtext && (\n <Text $renderAs=\"ub3\" $color=\"BLACK_T_60\">\n {subtext}\n </Text>\n )}\n {userType === 'TEACHER' && (\n <TextButton\n label=\"Review\"\n size=\"small\"\n color=\"BLACK_T_60\"\n onClick={handleReviewClick}\n />\n )}\n </FlexView>\n )}\n </FlexView>\n </FlexView>\n );\n },\n);\n\nAccordionItem.displayName = 'AccordionItem';\n\nexport default AccordionItem;\n"],"names":["AccordionItem","memo","userType","card","onPuzzleClick","onReviewClick","label","title","state","subtext","userNodeId","isPuzzle","Icon","getStateIcon","handleClick","useCallback","handleReviewClick","jsxs","FlexView","jsx","getStateColor","Text","TextButton"],"mappings":";;;;;;AAQA,MAAMA,IAAwCC;AAAA,EAC5C,CAAC,EAAE,UAAAC,GAAU,MAAAC,GAAM,eAAAC,GAAe,eAAAC,QAAoB;AACpD,UAAM,EAAE,OAAAC,GAAO,OAAAC,GAAO,OAAAC,GAAO,SAAAC,GAAS,cAAcC,EAAe,IAAAP,GAC7DQ,IAAWL,MAAU,UACrBM,IAAOC,EAAaL,CAAK,GAEzBM,IAAcC,EAAY,MAAM;AACpC,MAAIT,MAAU,YAAYJ,MAAa,aAAaQ,KAAcN,KAChEA,EAAcM,CAAU;AAAA,OAEzB,CAACJ,GAAOF,GAAeM,GAAYR,CAAQ,CAAC,GAEzCc,IAAoBD,EAAY,MAAM;AAC1C,MAAIV,KAAiBK,KACnBL,EAAcK,CAAU;AAAA,IAC1B,GACC,CAACL,GAAeK,CAAU,CAAC;AAE9B,WACG,gBAAAO,EAAAC,GAAA,EAAS,gBAAe,OAAM,WAAW,KACxC,UAAA;AAAA,MAAA,gBAAAC,EAACD,KAAS,aAAaE,EAAcZ,CAAK,GAAG,gBAAgB,KAAK,QAAQ,IAAI,SAAS,IACpF,eAAS,gBAAAW,EAAAP,GAAA,EAAK,OAAO,IAAI,QAAQ,GAAI,CAAA,GACxC;AAAA,MACA,gBAAAK,EAACC,GAAS,EAAA,cAAc,MACtB,UAAA;AAAA,QAAC,gBAAAD,EAAAI,GAAA,EAAK,WAAU,OACd,UAAA;AAAA,UAAA,gBAAAJ,EAACI,GAAK,EAAA,WAAU,YAAW,SAAO,IAC/B,UAAA;AAAA,YAAAf;AAAA,YAAM;AAAA,UAAA,GACT;AAAA,UAAQ;AAAA,UACPC;AAAA,QAAA,GACH;AAAA,QACCI,IACC,gBAAAQ;AAAA,UAACG;AAAA,UAAA;AAAA,YACC,OAAM;AAAA,YACN,MAAK;AAAA,YACL,OAAM;AAAA,YACN,SAASR;AAAA,UAAA;AAAA,QAAA,IAGV,gBAAAG,EAAAC,GAAA,EAAS,gBAAe,OAAM,WAAW,MACvC,UAAA;AAAA,UAAAT,uBACEY,GAAK,EAAA,WAAU,OAAM,QAAO,cAC1B,UACHZ,GAAA;AAAA,UAEDP,MAAa,aACZ,gBAAAiB;AAAA,YAACG;AAAA,YAAA;AAAA,cACC,OAAM;AAAA,cACN,MAAK;AAAA,cACL,OAAM;AAAA,cACN,SAASN;AAAA,YAAA;AAAA,UACX;AAAA,QAAA,GAEJ;AAAA,MAAA,GAEJ;AAAA,IACF,EAAA,CAAA;AAAA,EAEJ;AACF;AAEAhB,EAAc,cAAc;"}
1
+ {"version":3,"file":"accordion-item.js","sources":["../../../../../src/features/timeline/comps/accordion-item/accordion-item.tsx"],"sourcesContent":["import { memo, useCallback, type FC } from 'react';\n\nimport TextButton from '../../../ui/buttons/text-button/text-button';\nimport FlexView from '../../../ui/layout/flex-view';\nimport Text from '../../../ui/text/text';\nimport type { AccordionItemProps } from './accordion-item-types';\nimport { getStateColor, getStateIcon } from './utils';\nimport { BLOCK_TYPE } from '../../../chapters-v2/constants/block-constants';\n\nconst AccordionItem: FC<AccordionItemProps> = memo(\n ({ type, userType, card, onPuzzleClick, onReviewClick }) => {\n const {\n label,\n title,\n state,\n subtext,\n user_node_id: userNodeId,\n block_type: blockType,\n user_block_id: userBlockId,\n } = card;\n const isPuzzle = label === 'PUZZLE';\n const Icon = getStateIcon(state);\n const isCompleted = state === 'COMPLETED';\n\n const shouldShowReview =\n (userType === 'TEACHER' && type !== 'CIRCLE') ||\n (userType === 'STUDENT' && isCompleted && type !== 'CIRCLE');\n\n const handlePuzzleClick = useCallback(() => {\n if (userNodeId && onPuzzleClick) {\n onPuzzleClick(userNodeId);\n }\n }, [onPuzzleClick, userNodeId]);\n const isSatMockTestBlock = blockType === BLOCK_TYPE.SAT_MOCK_TEST;\n\n const handleReviewClick = useCallback(() => {\n if (onReviewClick && userNodeId) {\n onReviewClick(userNodeId, isSatMockTestBlock, userBlockId);\n }\n }, [isSatMockTestBlock, onReviewClick, userBlockId, userNodeId]);\n\n return (\n <FlexView $flexDirection=\"row\" $flexGapX={1.5}>\n <FlexView $background={getStateColor(state)} $borderRadiusX={0.5} $width={16} $height={16}>\n {Icon && <Icon width={16} height={16} />}\n </FlexView>\n <FlexView $flexRowGapX={0.25}>\n <Text $renderAs=\"ub3\">\n <Text $renderAs=\"ub3-bold\" $inline>\n {label}:\n </Text>{' '}\n {title}\n </Text>\n {isPuzzle ? (\n <TextButton\n label={isCompleted ? 'View reviewed puzzle' : 'View assigned puzzle'}\n size=\"small\"\n color=\"BLACK_T_60\"\n onClick={handlePuzzleClick}\n />\n ) : (\n <FlexView $flexDirection=\"row\" $flexGapX={0.75} $alignItems=\"center\">\n {subtext && (\n <Text $renderAs=\"ub3\" $color=\"BLACK_T_60\">\n {subtext}\n </Text>\n )}\n {shouldShowReview && (\n <TextButton\n label=\"Review\"\n size=\"small\"\n color=\"BLACK_T_60\"\n onClick={handleReviewClick}\n />\n )}\n </FlexView>\n )}\n </FlexView>\n </FlexView>\n );\n },\n);\n\nAccordionItem.displayName = 'AccordionItem';\n\nexport default AccordionItem;\n"],"names":["AccordionItem","memo","type","userType","card","onPuzzleClick","onReviewClick","label","title","state","subtext","userNodeId","blockType","userBlockId","isPuzzle","Icon","getStateIcon","isCompleted","shouldShowReview","handlePuzzleClick","useCallback","isSatMockTestBlock","BLOCK_TYPE","handleReviewClick","jsxs","FlexView","jsx","getStateColor","Text","TextButton"],"mappings":";;;;;;;AASA,MAAMA,IAAwCC;AAAA,EAC5C,CAAC,EAAE,MAAAC,GAAM,UAAAC,GAAU,MAAAC,GAAM,eAAAC,GAAe,eAAAC,QAAoB;AACpD,UAAA;AAAA,MACJ,OAAAC;AAAA,MACA,OAAAC;AAAA,MACA,OAAAC;AAAA,MACA,SAAAC;AAAA,MACA,cAAcC;AAAA,MACd,YAAYC;AAAA,MACZ,eAAeC;AAAA,IACb,IAAAT,GACEU,IAAWP,MAAU,UACrBQ,IAAOC,EAAaP,CAAK,GACzBQ,IAAcR,MAAU,aAExBS,IACHf,MAAa,aAAaD,MAAS,YACnCC,MAAa,aAAac,KAAef,MAAS,UAE/CiB,IAAoBC,EAAY,MAAM;AAC1C,MAAIT,KAAcN,KAChBA,EAAcM,CAAU;AAAA,IAC1B,GACC,CAACN,GAAeM,CAAU,CAAC,GACxBU,IAAqBT,MAAcU,EAAW,eAE9CC,IAAoBH,EAAY,MAAM;AAC1C,MAAId,KAAiBK,KACLL,EAAAK,GAAYU,GAAoBR,CAAW;AAAA,OAE1D,CAACQ,GAAoBf,GAAeO,GAAaF,CAAU,CAAC;AAE/D,WACG,gBAAAa,EAAAC,GAAA,EAAS,gBAAe,OAAM,WAAW,KACxC,UAAA;AAAA,MAAA,gBAAAC,EAACD,KAAS,aAAaE,EAAclB,CAAK,GAAG,gBAAgB,KAAK,QAAQ,IAAI,SAAS,IACpF,eAAS,gBAAAiB,EAAAX,GAAA,EAAK,OAAO,IAAI,QAAQ,GAAI,CAAA,GACxC;AAAA,MACA,gBAAAS,EAACC,GAAS,EAAA,cAAc,MACtB,UAAA;AAAA,QAAC,gBAAAD,EAAAI,GAAA,EAAK,WAAU,OACd,UAAA;AAAA,UAAA,gBAAAJ,EAACI,GAAK,EAAA,WAAU,YAAW,SAAO,IAC/B,UAAA;AAAA,YAAArB;AAAA,YAAM;AAAA,UAAA,GACT;AAAA,UAAQ;AAAA,UACPC;AAAA,QAAA,GACH;AAAA,QACCM,IACC,gBAAAY;AAAA,UAACG;AAAA,UAAA;AAAA,YACC,OAAOZ,IAAc,yBAAyB;AAAA,YAC9C,MAAK;AAAA,YACL,OAAM;AAAA,YACN,SAASE;AAAA,UAAA;AAAA,QAAA,sBAGVM,GAAS,EAAA,gBAAe,OAAM,WAAW,MAAM,aAAY,UACzD,UAAA;AAAA,UAAAf,uBACEkB,GAAK,EAAA,WAAU,OAAM,QAAO,cAC1B,UACHlB,GAAA;AAAA,UAEDQ,KACC,gBAAAQ;AAAA,YAACG;AAAA,YAAA;AAAA,cACC,OAAM;AAAA,cACN,MAAK;AAAA,cACL,OAAM;AAAA,cACN,SAASN;AAAA,YAAA;AAAA,UACX;AAAA,QAAA,GAEJ;AAAA,MAAA,GAEJ;AAAA,IACF,EAAA,CAAA;AAAA,EAEJ;AACF;AAEAvB,EAAc,cAAc;"}
@@ -0,0 +1,17 @@
1
+ import { jsx as e } from "react/jsx-runtime";
2
+ import a from "styled-components";
3
+ import i from "../../ui/layout/flex-view.js";
4
+ import { monthImageMap as n } from "./accordion-item/utils.js";
5
+ const m = a(i)`
6
+ margin-top: ${({ $isLastYear: r }) => r ? "-46px" : "0"};
7
+ background-image: url(${({ $img: r }) => r});
8
+ background-size: cover;
9
+ background-position: center;
10
+ `, u = ({ fromMonth: r, isLastDayOfMth: t }) => {
11
+ const o = n[String(r).padStart(2, "0")];
12
+ return r && t ? /* @__PURE__ */ e(m, { $isLastYear: t, $img: o, $width: "100%", $height: 246 }) : null;
13
+ };
14
+ export {
15
+ u as default
16
+ };
17
+ //# sourceMappingURL=month-break.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"month-break.js","sources":["../../../../src/features/timeline/comps/month-break.tsx"],"sourcesContent":["import styled from 'styled-components';\n\nimport FlexView from '../../ui/layout/flex-view';\nimport { monthImageMap } from './accordion-item/utils';\n\nconst MonthImageWrapper = styled(FlexView)<{ $isLastYear: boolean; $img: string }>`\n margin-top: ${({ $isLastYear }) => ($isLastYear ? '-46px' : '0')};\n background-image: url(${({ $img }) => $img});\n background-size: cover;\n background-position: center;\n`;\n\ninterface MonthBreakProps {\n fromMonth: number;\n isLastDayOfMth: boolean;\n}\n\nconst MonthBreak = ({ fromMonth, isLastDayOfMth }: MonthBreakProps) => {\n const Image = monthImageMap[String(fromMonth).padStart(2, '0') as keyof typeof monthImageMap];\n\n if (fromMonth && isLastDayOfMth)\n return (\n <MonthImageWrapper $isLastYear={isLastDayOfMth} $img={Image} $width={'100%'} $height={246} />\n );\n\n return null;\n};\n\nexport default MonthBreak;\n"],"names":["MonthImageWrapper","styled","FlexView","$isLastYear","$img","MonthBreak","fromMonth","isLastDayOfMth","Image","monthImageMap","jsx"],"mappings":";;;;AAKA,MAAMA,IAAoBC,EAAOC,CAAQ;AAAA,gBACzB,CAAC,EAAE,aAAAC,EAAA,MAAmBA,IAAc,UAAU,GAAI;AAAA,0BACxC,CAAC,EAAE,MAAAC,EAAK,MAAMA,CAAI;AAAA;AAAA;AAAA,GAUtCC,IAAa,CAAC,EAAE,WAAAC,GAAW,gBAAAC,QAAsC;AAC/D,QAAAC,IAAQC,EAAc,OAAOH,CAAS,EAAE,SAAS,GAAG,GAAG,CAA+B;AAE5F,SAAIA,KAAaC,IAEb,gBAAAG,EAACV,KAAkB,aAAaO,GAAgB,MAAMC,GAAO,QAAQ,QAAQ,SAAS,IAAK,CAAA,IAGxF;AACT;"}
@@ -0,0 +1,15 @@
1
+ import { jsxs as o, jsx as r } from "react/jsx-runtime";
2
+ import i from "styled-components";
3
+ import a from "../../ui/layout/flex-view.js";
4
+ import m from "../../ui/separator/separator.js";
5
+ import l from "../../ui/text/text.js";
6
+ const n = i(a)`
7
+ z-index: 1;
8
+ `, x = ({ toYear: e, isLastDayOfYear: t }) => t ? /* @__PURE__ */ o(n, { $gutterX: 1, children: [
9
+ /* @__PURE__ */ r(m, { heightX: 1 }),
10
+ /* @__PURE__ */ r(l, { $renderAs: "ac4-black", $color: "BLACK_T_60", children: e })
11
+ ] }) : null;
12
+ export {
13
+ x as default
14
+ };
15
+ //# sourceMappingURL=year-break.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"year-break.js","sources":["../../../../src/features/timeline/comps/year-break.tsx"],"sourcesContent":["import styled from 'styled-components';\n\nimport FlexView from '../../ui/layout/flex-view';\nimport Separator from '../../ui/separator/separator';\nimport Text from '../../ui/text/text';\n\nconst YearWrapper = styled(FlexView)`\n z-index: 1;\n`;\n\ninterface YearBreakProps {\n toYear: number;\n isLastDayOfYear: boolean;\n}\n\nconst YearBreak = ({ toYear, isLastDayOfYear }: YearBreakProps) => {\n if (isLastDayOfYear) {\n return (\n <YearWrapper $gutterX={1}>\n <Separator heightX={1} />\n <Text $renderAs=\"ac4-black\" $color=\"BLACK_T_60\">\n {toYear}\n </Text>\n </YearWrapper>\n );\n }\n\n return null;\n};\n\nexport default YearBreak;\n"],"names":["YearWrapper","styled","FlexView","YearBreak","toYear","isLastDayOfYear","jsxs","jsx","Separator","Text"],"mappings":";;;;;AAMA,MAAMA,IAAcC,EAAOC,CAAQ;AAAA;AAAA,GAS7BC,IAAY,CAAC,EAAE,QAAAC,GAAQ,iBAAAC,QACvBA,IAEA,gBAAAC,EAACN,GAAY,EAAA,UAAU,GACrB,UAAA;AAAA,EAAC,gBAAAO,EAAAC,GAAA,EAAU,SAAS,EAAG,CAAA;AAAA,oBACtBC,GAAK,EAAA,WAAU,aAAY,QAAO,cAChC,UACHL,GAAA;AACF,EAAA,CAAA,IAIG;"}
@@ -1,44 +1,45 @@
1
1
  import { jsx as o } from "react/jsx-runtime";
2
- import { memo as c, useMemo as s } from "react";
2
+ import { memo as p, useMemo as s } from "react";
3
3
  import g from "../../../ui/layout/flex-view.js";
4
4
  import h from "../../../ui/simple-accordian/accordion.js";
5
5
  import u from "../../comps/accordion-item/accordion-item.js";
6
6
  import { getTimelineCardIcon as $ } from "../../comps/accordion-item/utils.js";
7
7
  import { Card as x } from "./daily-timeline-items-styled.js";
8
- const B = c(
8
+ const B = p(
9
9
  ({
10
- type: e,
11
- summary: i,
12
- cards: t,
10
+ type: i,
11
+ summary: e,
12
+ cards: m,
13
13
  onPuzzleClick: n,
14
14
  onReviewClick: l,
15
15
  courseStream: d,
16
16
  shouldShowTag: a,
17
17
  userType: f
18
18
  }) => {
19
- const p = s(() => $(e), [e]);
19
+ const c = s(() => $(i), [i]);
20
20
  return /* @__PURE__ */ o(
21
21
  h,
22
22
  {
23
23
  tag: a ? d : void 0,
24
- title: i,
24
+ title: e,
25
25
  defaultExpanded: !1,
26
- icon: p,
27
- children: t.length > 0 && /* @__PURE__ */ o(g, { $gutter: 32, $marginBottom: 24, children: t.map((m, r) => /* @__PURE__ */ o(
26
+ icon: c ?? "",
27
+ children: m.length > 0 && /* @__PURE__ */ o(g, { $gutter: 32, $marginBottom: 24, children: m.map((r, t) => /* @__PURE__ */ o(
28
28
  x,
29
29
  {
30
- $isLastCard: r === t.length - 1,
30
+ $isLastCard: t === m.length - 1,
31
31
  children: /* @__PURE__ */ o(
32
32
  u,
33
33
  {
34
- userType: f,
35
- card: m,
34
+ card: r,
36
35
  onPuzzleClick: n,
37
- onReviewClick: l
36
+ onReviewClick: l,
37
+ type: i,
38
+ userType: f
38
39
  }
39
40
  )
40
41
  },
41
- `${m.node_id}-${r}`
42
+ `${r.node_id}-${t}`
42
43
  )) })
43
44
  }
44
45
  );
@@ -1 +1 @@
1
- {"version":3,"file":"daily-timeline-items.js","sources":["../../../../../src/features/timeline/daily-timeline/daily-timeline-items/daily-timeline-items.tsx"],"sourcesContent":["import { memo, useMemo, type FC } from 'react';\n\nimport FlexView from '../../../ui/layout/flex-view';\nimport Accordion from '../../../ui/simple-accordian/accordion';\nimport AccordionItem from '../../comps/accordion-item/accordion-item';\nimport { getTimelineCardIcon } from '../../comps/accordion-item/utils';\nimport * as Styled from './daily-timeline-items-styled';\nimport type { DailyTimelineItemsProps } from './daily-timeline-items.types';\n\nconst DailyTimelineItems: FC<DailyTimelineItemsProps> = memo(\n ({\n type,\n summary,\n cards,\n onPuzzleClick,\n onReviewClick,\n courseStream,\n shouldShowTag,\n userType,\n }) => {\n const icon = useMemo(() => getTimelineCardIcon(type), [type]);\n\n return (\n <Accordion\n tag={shouldShowTag ? courseStream : undefined}\n title={summary}\n defaultExpanded={false}\n icon={icon}\n >\n {cards.length > 0 && (\n <FlexView $gutter={32} $marginBottom={24}>\n {cards.map((card, index) => (\n <Styled.Card\n key={`${card.node_id}-${index}`}\n $isLastCard={index === cards.length - 1}\n >\n <AccordionItem\n userType={userType}\n card={card}\n onPuzzleClick={onPuzzleClick}\n onReviewClick={onReviewClick}\n />\n </Styled.Card>\n ))}\n </FlexView>\n )}\n </Accordion>\n );\n },\n);\n\nexport default DailyTimelineItems;\n"],"names":["DailyTimelineItems","memo","type","summary","cards","onPuzzleClick","onReviewClick","courseStream","shouldShowTag","userType","icon","useMemo","getTimelineCardIcon","jsx","Accordion","FlexView","card","index","Styled.Card","AccordionItem"],"mappings":";;;;;;;AASA,MAAMA,IAAkDC;AAAA,EACtD,CAAC;AAAA,IACC,MAAAC;AAAA,IACA,SAAAC;AAAA,IACA,OAAAC;AAAA,IACA,eAAAC;AAAA,IACA,eAAAC;AAAA,IACA,cAAAC;AAAA,IACA,eAAAC;AAAA,IACA,UAAAC;AAAA,EAAA,MACI;AACE,UAAAC,IAAOC,EAAQ,MAAMC,EAAoBV,CAAI,GAAG,CAACA,CAAI,CAAC;AAG1D,WAAA,gBAAAW;AAAA,MAACC;AAAA,MAAA;AAAA,QACC,KAAKN,IAAgBD,IAAe;AAAA,QACpC,OAAOJ;AAAA,QACP,iBAAiB;AAAA,QACjB,MAAAO;AAAA,QAEC,UAAMN,EAAA,SAAS,KACd,gBAAAS,EAACE,GAAS,EAAA,SAAS,IAAI,eAAe,IACnC,UAAAX,EAAM,IAAI,CAACY,GAAMC,MAChB,gBAAAJ;AAAA,UAACK;AAAAA,UAAA;AAAA,YAEC,aAAaD,MAAUb,EAAM,SAAS;AAAA,YAEtC,UAAA,gBAAAS;AAAA,cAACM;AAAA,cAAA;AAAA,gBACC,UAAAV;AAAA,gBACA,MAAAO;AAAA,gBACA,eAAAX;AAAA,gBACA,eAAAC;AAAA,cAAA;AAAA,YACF;AAAA,UAAA;AAAA,UARK,GAAGU,EAAK,OAAO,IAAIC,CAAK;AAAA,QAUhC,CAAA,GACH;AAAA,MAAA;AAAA,IAAA;AAAA,EAIR;AACF;"}
1
+ {"version":3,"file":"daily-timeline-items.js","sources":["../../../../../src/features/timeline/daily-timeline/daily-timeline-items/daily-timeline-items.tsx"],"sourcesContent":["import { memo, useMemo, type FC } from 'react';\n\nimport FlexView from '../../../ui/layout/flex-view';\nimport Accordion from '../../../ui/simple-accordian/accordion';\nimport AccordionItem from '../../comps/accordion-item/accordion-item';\nimport { getTimelineCardIcon } from '../../comps/accordion-item/utils';\nimport * as Styled from './daily-timeline-items-styled';\nimport type { DailyTimelineItemsProps } from './daily-timeline-items.types';\n\nconst DailyTimelineItems: FC<DailyTimelineItemsProps> = memo(\n ({\n type,\n summary,\n cards,\n onPuzzleClick,\n onReviewClick,\n courseStream,\n shouldShowTag,\n userType,\n }) => {\n const icon = useMemo(() => getTimelineCardIcon(type), [type]);\n\n return (\n <Accordion\n tag={shouldShowTag ? courseStream : undefined}\n title={summary}\n defaultExpanded={false}\n icon={icon ?? ''}\n >\n {cards.length > 0 && (\n <FlexView $gutter={32} $marginBottom={24}>\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 </FlexView>\n )}\n </Accordion>\n );\n },\n);\n\nexport default DailyTimelineItems;\n"],"names":["DailyTimelineItems","memo","type","summary","cards","onPuzzleClick","onReviewClick","courseStream","shouldShowTag","userType","icon","useMemo","getTimelineCardIcon","jsx","Accordion","FlexView","card","index","Styled.Card","AccordionItem"],"mappings":";;;;;;;AASA,MAAMA,IAAkDC;AAAA,EACtD,CAAC;AAAA,IACC,MAAAC;AAAA,IACA,SAAAC;AAAA,IACA,OAAAC;AAAA,IACA,eAAAC;AAAA,IACA,eAAAC;AAAA,IACA,cAAAC;AAAA,IACA,eAAAC;AAAA,IACA,UAAAC;AAAA,EAAA,MACI;AACE,UAAAC,IAAOC,EAAQ,MAAMC,EAAoBV,CAAI,GAAG,CAACA,CAAI,CAAC;AAG1D,WAAA,gBAAAW;AAAA,MAACC;AAAA,MAAA;AAAA,QACC,KAAKN,IAAgBD,IAAe;AAAA,QACpC,OAAOJ;AAAA,QACP,iBAAiB;AAAA,QACjB,MAAMO,KAAQ;AAAA,QAEb,UAAMN,EAAA,SAAS,KACd,gBAAAS,EAACE,GAAS,EAAA,SAAS,IAAI,eAAe,IACnC,UAAAX,EAAM,IAAI,CAACY,GAAMC,MAChB,gBAAAJ;AAAA,UAACK;AAAAA,UAAA;AAAA,YAEC,aAAaD,MAAUb,EAAM,SAAS;AAAA,YAEtC,UAAA,gBAAAS;AAAA,cAACM;AAAA,cAAA;AAAA,gBACC,MAAAH;AAAA,gBACA,eAAAX;AAAA,gBACA,eAAAC;AAAA,gBACA,MAAAJ;AAAA,gBACA,UAAAO;AAAA,cAAA;AAAA,YACF;AAAA,UAAA;AAAA,UATK,GAAGO,EAAK,OAAO,IAAIC,CAAK;AAAA,QAWhC,CAAA,GACH;AAAA,MAAA;AAAA,IAAA;AAAA,EAIR;AACF;"}
@@ -1,33 +1,26 @@
1
- import e from "styled-components";
2
- import i from "../../ui/layout/flex-view.js";
3
- const a = e(i)`
1
+ import o from "styled-components";
2
+ import t from "../../ui/layout/flex-view.js";
3
+ const n = o(t)`
4
4
  overflow-y: auto;
5
+ width: 100%;
6
+ `, m = o(t)`
5
7
  max-width: 512px;
6
- `, m = e(i)`
8
+ width: 100%;
9
+ `, d = o(t)`
7
10
  & > div {
8
11
  border-bottom: none;
9
12
  }
10
13
  & > div:last-child {
11
- border-bottom: 1px solid ${({ theme: o, $borderBottomColor: t }) => o.colors[t]};
14
+ border-bottom: 1px solid ${({ theme: i, $borderBottomColor: e }) => i.colors[e]};
12
15
  }
13
- `, p = e(i)`
14
- margin-top: ${({ $addedmonthbreak: o }) => o ? "-122px" : "0"};
15
- z-index: 1;
16
- `, d = e(i)`
17
- margin-top: ${({ $isLastYear: o }) => o ? "-46px" : "0"};
18
- background-image: url(${({ $img: o }) => o});
19
- background-size: cover;
20
- background-position: center;
21
- width: 100%;
22
- height: 246px;
23
- `, l = e(i)`
16
+ `, a = o(t)`
17
+ margin-top: ${({ $addedmonthbreak: i }) => i ? "-122px" : "0"};
24
18
  z-index: 1;
25
19
  `;
26
20
  export {
27
- p as DailyItems,
28
- a as DailyTimelineConatainer,
29
- m as DailyTimelineItemsContainer,
30
- d as MonthImageWrapper,
31
- l as YearWrapper
21
+ a as DailyItems,
22
+ m as DailyTimelineContainer,
23
+ d as DailyTimelineItemsContainer,
24
+ n as ScrollWrapper
32
25
  };
33
26
  //# sourceMappingURL=daily-timeline-styled.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"daily-timeline-styled.js","sources":["../../../../src/features/timeline/daily-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 DailyTimelineConatainer = styled(FlexView)`\n overflow-y: auto;\n max-width: 512px;\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\nconst MonthImageWrapper = styled(FlexView)<{ $isLastYear: boolean; $img: string }>`\n margin-top: ${({ $isLastYear }) => ($isLastYear ? '-46px' : '0')};\n background-image: url(${({ $img }) => $img});\n background-size: cover;\n background-position: center;\n width: 100%;\n height: 246px;\n`;\n\nconst YearWrapper = styled(FlexView)`\n z-index: 1;\n`;\n\nexport {\n DailyTimelineConatainer,\n DailyItems,\n MonthImageWrapper,\n YearWrapper,\n DailyTimelineItemsContainer,\n};\n"],"names":["DailyTimelineConatainer","styled","FlexView","DailyTimelineItemsContainer","theme","$borderBottomColor","DailyItems","$addedmonthbreak","MonthImageWrapper","$isLastYear","$img","YearWrapper"],"mappings":";;AAKM,MAAAA,IAA0BC,EAAOC,CAAQ;AAAA;AAAA;AAAA,GAKzCC,IAA8BF,EAAOC,CAAQ;AAAA;AAAA;AAAA;AAAA;AAAA,+BAKpB,CAAC,EAAE,OAAAE,GAAO,oBAAAC,EAAA,MAAyBD,EAAM,OAAOC,CAAkB,CAAC;AAAA;AAAA,GAI5FC,IAAaL,EAAOC,CAAQ;AAAA,gBAClB,CAAC,EAAE,kBAAAK,EAAA,MAAwBA,IAAmB,WAAW,GAAI;AAAA;AAAA,GAIvEC,IAAoBP,EAAOC,CAAQ;AAAA,gBACzB,CAAC,EAAE,aAAAO,EAAA,MAAmBA,IAAc,UAAU,GAAI;AAAA,0BACxC,CAAC,EAAE,MAAAC,EAAK,MAAMA,CAAI;AAAA;AAAA;AAAA;AAAA;AAAA,GAOtCC,IAAcV,EAAOC,CAAQ;AAAA;AAAA;"}
1
+ {"version":3,"file":"daily-timeline-styled.js","sources":["../../../../src/features/timeline/daily-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,119 +1,121 @@
1
- import { jsx as e, jsxs as a } from "react/jsx-runtime";
2
- import { memo as q, useMemo as b, useState as x, useRef as G, useCallback as U, useEffect as p } from "react";
1
+ import { jsx as e, jsxs as g } from "react/jsx-runtime";
2
+ import { memo as G, useMemo as x, useState as B, useRef as U, useCallback as W, useEffect as p } from "react";
3
3
  import { ILLUSTRATIONS as Z } 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";
4
+ import { Loader as q } from "../../ui/buttons/button/button-styled.js";
5
+ import J from "../../ui/error/error.js";
6
6
  import u from "../../ui/layout/flex-view.js";
7
- import ee from "../../ui/loader/app-loader/app-loader.js";
8
- import s from "../../ui/separator/separator.js";
9
- import te from "../../ui/simple-accordian/accordion.js";
10
- import v from "../../ui/text/text.js";
7
+ import Q from "../../ui/loader/app-loader/app-loader.js";
8
+ import l from "../../ui/separator/separator.js";
9
+ import ee from "../../ui/simple-accordian/accordion.js";
10
+ import te from "../../ui/text/text.js";
11
11
  import { useDailyTimelineGet as oe } from "../api/use-daily-timeline-get.js";
12
- import { getTimelineCardIcon as re, getDayMonthYear as B, monthImageMap as ie } from "../comps/accordion-item/utils.js";
13
- import ne from "./daily-timeline-items/daily-timeline-items.js";
14
- import { DailyTimelineConatainer as ae, YearWrapper as se, MonthImageWrapper as me, DailyItems as le, DailyTimelineItemsContainer as ce } from "./daily-timeline-styled.js";
15
- import { parseISO as E } from "../../../node_modules/date-fns/parseISO.js";
12
+ import { getTimelineCardIcon as re, getDayMonthYear as N } from "../comps/accordion-item/utils.js";
13
+ import ie from "./daily-timeline-items/daily-timeline-items.js";
14
+ import { ScrollWrapper as ne, DailyTimelineContainer as ae, DailyItems as me, DailyTimelineItemsContainer as se } from "./daily-timeline-styled.js";
15
+ import le from "../comps/month-break.js";
16
+ import ce from "../comps/year-break.js";
17
+ import { parseISO as k } from "../../../node_modules/date-fns/parseISO.js";
16
18
  import { isLastDayOfMonth as he } from "../../../node_modules/date-fns/isLastDayOfMonth.js";
17
- const de = q(
18
- ({ userType: N, studentId: m, courseStreams: y, onPuzzlesClick: O, onReviewClick: Y }) => {
19
- const $ = b(() => Intl.DateTimeFormat().resolvedOptions().timeZone, []), [T, C] = x([]), [l, L] = x(!1), j = G(null), k = b(() => re("NO_ACTIVITY"), []), {
20
- get: _,
21
- data: t,
19
+ const fe = G(
20
+ ({ userType: c, studentId: h, courseStreams: a, onPuzzlesClick: S, onReviewClick: j, scrollAreaHeight: R }) => {
21
+ const y = x(() => Intl.DateTimeFormat().resolvedOptions().timeZone, []), [T, $] = B([]), [f, L] = B(!1), C = U(null), z = x(() => re("NO_ACTIVITY"), []), {
22
+ get: D,
23
+ data: o,
22
24
  isProcessingFailed: K,
23
- isProcessing: R
24
- } = oe(m), { user_logs: c } = t || {}, i = U(
25
- (o = 1, h = !1) => {
26
- h && L(!0), _(m, {
27
- page: o,
25
+ isProcessing: X
26
+ } = oe(h), { user_logs: d } = o ?? {}, i = W(
27
+ (t = 1, r = !1) => {
28
+ r && L(!0), D(h, {
29
+ page: t,
28
30
  size: 10,
29
- timezone: $,
30
- course_stream: y
31
+ timezone: y,
32
+ course_stream: c === "TEACHER" ? a : []
31
33
  });
32
34
  },
33
- [_, m, $, y]
35
+ [D, h, y, c, a]
34
36
  );
35
37
  return p(() => {
36
- t && (t.curr_page === 1 ? C(c || []) : (C((o) => [...o, ...c || []]), L(!1)));
37
- }, [t, c]), p(() => {
38
+ o && (o.curr_page === 1 ? $(d ?? []) : ($((t) => [...t, ...d ?? []]), L(!1)));
39
+ }, [o, d]), p(() => {
38
40
  i(1, !1);
39
41
  }, [i]), p(() => {
40
- const o = () => {
41
- t != null && t.next_page && !l && window.scrollY + window.innerHeight >= document.body.scrollHeight - 100 && i(t.next_page, !0);
42
+ const t = C.current;
43
+ if (!t) return;
44
+ const r = () => {
45
+ o != null && o.next_page && !f && t.scrollTop + t.clientHeight >= t.scrollHeight - 100 && i(o.next_page, !0);
42
46
  };
43
- return window.addEventListener("scroll", o), () => {
44
- window.removeEventListener("scroll", o);
47
+ return t.addEventListener("scroll", r), () => {
48
+ t.removeEventListener("scroll", r);
45
49
  };
46
- }, [t == null ? void 0 : t.next_page, l, i]), K ? /* @__PURE__ */ e(Q, { height: "70vh", onTryAgain: () => i(1, !1) }) : R && !T.length ? /* @__PURE__ */ e(u, { $alignItems: "center", $justifyContent: "center", $height: "100%", children: /* @__PURE__ */ e(ee, { width: "100%", height: "100%" }) }) : /* @__PURE__ */ a(ae, { ref: j, children: [
47
- T.map((o, h) => {
48
- const { daily_logs: n, from_date: A, to_date: I } = o;
49
- if (n) {
50
- const X = E(A), D = E(I), {
51
- day: w,
52
- month: z,
53
- monthName: F
54
- } = B(X), {
55
- day: S,
56
- month: d,
57
- year: P,
58
- monthName: H
59
- } = B(D), f = he(D), M = f && d === 12 && S === 31, g = Array.from(
60
- new Set(n.map((r) => r.course_stream).filter(Boolean))
61
- ), V = g.includes("CIRCLE") ? g.length > 2 : g.length > 1;
62
- return /* @__PURE__ */ a(u, { children: [
63
- M && /* @__PURE__ */ a(se, { $gutterX: 1, children: [
64
- /* @__PURE__ */ e(s, { heightX: 1 }),
65
- /* @__PURE__ */ e(v, { $renderAs: "ac4-black", $color: "BLACK_T_60", children: P })
66
- ] }),
67
- f && d && /* @__PURE__ */ e(
68
- me,
69
- {
70
- $isLastYear: M,
71
- $img: ie[String(z).padStart(2, "0")]
72
- }
73
- ),
74
- /* @__PURE__ */ a(le, { $gutterX: 1, $addedmonthbreak: !!(f && d), children: [
75
- /* @__PURE__ */ e(s, { heightX: 1 }),
76
- /* @__PURE__ */ e(v, { $renderAs: "ac4-black", $color: "BLACK_T_60", children: A === I ? `${w} ${F}` : `${w} - ${S} ${H}` }),
77
- /* @__PURE__ */ e(s, { heightX: 1 }),
78
- /* @__PURE__ */ e(
79
- ce,
80
- {
81
- $borderBottomColor: n.length > 0 ? "BLACK" : "BLACK_T_04",
82
- children: n.length > 0 ? n.map((r, W) => /* @__PURE__ */ e(
83
- ne,
50
+ }, [o, f, i]), K ? /* @__PURE__ */ e(J, { height: "70vh", onTryAgain: () => i(1, !1) }) : X && !T.length ? /* @__PURE__ */ e(u, { $alignItems: "center", $justifyContent: "center", $height: "100%", children: /* @__PURE__ */ e(Q, { width: "100%", height: "100%" }) }) : /* @__PURE__ */ e(
51
+ ne,
52
+ {
53
+ ref: C,
54
+ $height: R,
55
+ $alignItems: "center",
56
+ children: /* @__PURE__ */ g(ae, { children: [
57
+ T.map((t, r) => {
58
+ const { daily_logs: m, from_date: _, to_date: A } = t;
59
+ if (m) {
60
+ const Y = k(_), I = k(A), {
61
+ day: M,
62
+ month: O,
63
+ monthName: w
64
+ } = N(Y), {
65
+ day: E,
66
+ month: b,
67
+ year: F,
68
+ monthName: H
69
+ } = N(I), s = he(I), v = s && b === 12 && E === 31, P = !!(a && a.length > 1);
70
+ return /* @__PURE__ */ g(u, { children: [
71
+ /* @__PURE__ */ e(ce, { toYear: F, isLastDayOfYear: v }),
72
+ !v && O && s && /* @__PURE__ */ e(l, { heightX: 1 }),
73
+ /* @__PURE__ */ e(le, { fromMonth: O, isLastDayOfMth: s }),
74
+ /* @__PURE__ */ g(me, { $gutterX: 1, $addedmonthbreak: !!(s && b), children: [
75
+ /* @__PURE__ */ e(l, { heightX: 1 }),
76
+ /* @__PURE__ */ e(te, { $renderAs: "ac4-black", $color: "BLACK_T_60", children: _ === A ? `${M} ${w}` : `${M} - ${E} ${H}` }),
77
+ /* @__PURE__ */ e(l, { heightX: 1 }),
78
+ /* @__PURE__ */ e(
79
+ se,
84
80
  {
85
- type: r.type,
86
- summary: r.summary || "",
87
- courseStream: r.course_stream || void 0,
88
- cards: r.cards,
89
- onPuzzleClick: O,
90
- onReviewClick: Y,
91
- userType: N,
92
- shouldShowTag: V && r.course_stream !== "CIRCLE"
93
- },
94
- `timeline-${W}`
95
- )) : /* @__PURE__ */ e(
96
- te,
97
- {
98
- icon: k,
99
- title: "No Activity",
100
- defaultExpanded: !1,
101
- $borderColor: "BLACK_T_04",
102
- $backgroundColor: "BLACK_T_15"
81
+ $borderBottomColor: m.length > 0 ? "BLACK" : "BLACK_T_04",
82
+ children: m.length > 0 ? m.map((n, V) => /* @__PURE__ */ e(
83
+ ie,
84
+ {
85
+ type: n.type,
86
+ summary: n.summary ?? "",
87
+ courseStream: n.course_stream ?? void 0,
88
+ cards: n.cards,
89
+ onPuzzleClick: S,
90
+ onReviewClick: j,
91
+ userType: c,
92
+ shouldShowTag: P && n.course_stream !== "CIRCLE"
93
+ },
94
+ `timeline-${V}`
95
+ )) : /* @__PURE__ */ e(
96
+ ee,
97
+ {
98
+ icon: z ?? "",
99
+ title: "No Activity",
100
+ defaultExpanded: !1,
101
+ $borderColor: "BLACK_T_04",
102
+ $backgroundColor: "BLACK_T_15"
103
+ }
104
+ )
103
105
  }
104
- )
105
- }
106
- ),
107
- /* @__PURE__ */ e(s, { heightX: 1 })
108
- ] })
109
- ] }, `timeline-entry-${h}`);
110
- }
111
- }),
112
- l && /* @__PURE__ */ e(u, { $alignItems: "center", $justifyContent: "center", $height: "100%", children: /* @__PURE__ */ e(J, { src: Z.LOADER, alt: "Loader", $size: "large" }) })
113
- ] });
106
+ ),
107
+ /* @__PURE__ */ e(l, { heightX: 1 })
108
+ ] })
109
+ ] }, `timeline-entry-${r}`);
110
+ }
111
+ }),
112
+ f && /* @__PURE__ */ e(u, { $alignItems: "center", $justifyContent: "center", $height: "100%", children: /* @__PURE__ */ e(q, { src: Z.LOADER, alt: "Loader", $size: "large" }) })
113
+ ] })
114
+ }
115
+ );
114
116
  }
115
- ), be = de;
117
+ ), xe = fe;
116
118
  export {
117
- be as default
119
+ xe as default
118
120
  };
119
121
  //# 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 }) => {\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 handleScroll = () => {\n if (\n timelineData?.next_page &&\n !isLoadingMore &&\n window.scrollY + window.innerHeight >= document.body.scrollHeight - 100\n ) {\n fetchTimeline(timelineData.next_page, true);\n }\n };\n\n window.addEventListener('scroll', handleScroll);\n\n return () => {\n window.removeEventListener('scroll', handleScroll);\n };\n }, [timelineData?.next_page, 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.DailyTimelineConatainer ref={scrollContainerRef}>\n {allTimelineData.map((entry, index) => {\n const { daily_logs, from_date, to_date } = entry;\n\n if (daily_logs) {\n const fromDateObj = parseISO(from_date);\n const toDateObj = parseISO(to_date);\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(daily_logs.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 $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 {from_date === to_date\n ? `${fromDay} ${fromMonthName}`\n : `${fromDay} - ${toDay} ${toMonthName}`}\n </Text>\n <Separator heightX={1} />\n <Styled.DailyTimelineItemsContainer\n $borderBottomColor={daily_logs.length > 0 ? 'BLACK' : 'BLACK_T_04'}\n >\n {daily_logs.length > 0 ? (\n daily_logs.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.DailyTimelineConatainer>\n );\n },\n);\n\nexport default DailyTimeline;\n"],"names":["DailyTimeline","memo","userType","studentId","courseStreams","onPuzzlesClick","onReviewClick","timezone","useMemo","allTimelineData","setAllTimelineData","useState","isLoadingMore","setIsLoadingMore","scrollContainerRef","useRef","NoActivityIcon","getTimelineCardIcon","getTimeline","timelineData","isProcessingFailed","isProcessing","useDailyTimelineGet","userLogs","fetchTimeline","useCallback","page","append","useEffect","prev","handleScroll","jsx","Error","FlexView","AppLoader","jsxs","Styled.DailyTimelineConatainer","entry","index","daily_logs","from_date","to_date","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","DailyTim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AAI,kBAAkB;AAAA,oBAAA;AAAA,oBARjD,YAAYS,CAAQ;AAAA,kBAU5B,CAAA,IAED,gBAAAnC;AAAA,oBAACqC;AAAA,oBAAA;AAAA,sBACC,MAAMpD;AAAA,sBACN,OAAM;AAAA,sBACN,iBAAiB;AAAA,sBACjB,cAAa;AAAA,sBACb,kBAAiB;AAAA,oBAAA;AAAA,kBACnB;AAAA,gBAAA;AAAA,cAEJ;AAAA,cACA,gBAAAe,EAAC6B,GAAU,EAAA,SAAS,EAAG,CAAA;AAAA,YAAA,GACzB;AAAA,UAvDa,EAAA,GAAA,kBAAkBtB,CAAK,EAwDtC;AAAA,QAEJ;AAAA,MAAA,CACD;AAAA,MAEA1B,KACE,gBAAAmB,EAAAE,GAAA,EAAS,aAAY,UAAS,iBAAgB,UAAS,SAAQ,QAC9D,UAAC,gBAAAF,EAAAsC,GAAA,EAAO,KAAKC,EAAc,QAAQ,KAAI,UAAS,OAAM,QAAQ,CAAA,GAChE;AAAA,IAEJ,EAAA,CAAA;AAAA,EAEJ;AACF,GAEAC,KAAevE;"}
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 } 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';\nimport MonthBreak from '../comps/month-break';\nimport YearBreak from '../comps/year-break';\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 isLastDayOfMth = isLastDayOfMonth(toDateObj);\n const isLastDayOfYear = isLastDayOfMth && toMonth === 12 && toDay === 31;\n const shouldShowTag = !!(courseStreams && courseStreams.length > 1);\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 ?? 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","isLastDayOfMth","isLastDayOfMonth","isLastDayOfYear","shouldShowTag","YearBreak","Separator","MonthBreak","Styled.DailyItems","Text","Styled.DailyTimelineItemsContainer","log","logIndex","DailyTimelineItems","Accordion","Loader","ILLUSTRATIONS","DailyTimeline$1"],"mappings":";;;;;;;;;;;;;;;;;;AAmBA,MAAMA,KAAwCC;AAAA,EAC5C,CAAC,EAAE,UAAAC,GAAU,WAAAC,GAAW,eAAAC,GAAe,gBAAAC,GAAgB,eAAAC,GAAe,k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iB;AAAA,wBAAA;AAAA,sBACnB;AAAA,oBAAA;AAAA,kBAEJ;AAAA,kBACA,gBAAAgB,EAAC4B,GAAU,EAAA,SAAS,EAAG,CAAA;AAAA,gBAAA,GACzB;AAAA,cAxCa,EAAA,GAAA,kBAAkBpB,CAAK,EAyCtC;AAAA,YAEJ;AAAA,UAAA,CACD;AAAA,UAEA5B,KACE,gBAAAoB,EAAAE,GAAA,EAAS,aAAY,UAAS,iBAAgB,UAAS,SAAQ,QAC9D,UAAC,gBAAAF,EAAAqC,GAAA,EAAO,KAAKC,EAAc,QAAQ,KAAI,UAAS,OAAM,QAAQ,CAAA,GAChE;AAAA,QAAA,GAEJ;AAAA,MAAA;AAAA,IAAA;AAAA,EAGN;AACF,GAEAC,KAAexE;"}
@@ -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 type { FC } from 'react';\nimport { memo, useState, useCallback } 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":";;;;;;;;AAWA,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,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A,UAEvC;AAAA,UAEClB,KACE,gBAAAY,EAAAO,GAAA,EAAsB,aAAaf,GAAa,UAAAJ,GAAS;AAAA,QAAA;AAAA,MAAA;AAAA,IAAA;AAAA,EAIlE;AACF;"}
package/dist/index.d.ts CHANGED
@@ -1,39 +1,39 @@
1
- import type { ButtonHTMLAttributes } from 'react';
2
- import type { Channel } from '@cuemath/cue-message-broker';
1
+ import { ButtonHTMLAttributes } from 'react';
2
+ import { Channel } from '@cuemath/cue-message-broker';
3
3
  import { ChannelStatus } from '@cuemath/cue-message-broker';
4
4
  import { ComponentType } from 'react';
5
- import type { Config } from '@lottiefiles/dotlottie-web';
5
+ import { Config } from '@lottiefiles/dotlottie-web';
6
6
  import { Context } from 'react';
7
- import type { Data } from '@lottiefiles/dotlottie-web';
8
- import type { DefaultTheme } from 'styled-components';
7
+ import { Data } from '@lottiefiles/dotlottie-web';
8
+ import { DefaultTheme } from 'styled-components';
9
9
  import { DetailedHTMLProps } from 'react';
10
- import type { Dispatch } from 'react';
11
- import type { EventListener as EventListener_2 } from '@lottiefiles/dotlottie-web';
12
- import type { EventType } from '@lottiefiles/dotlottie-web';
10
+ import { Dispatch } from 'react';
11
+ import { EventListener as EventListener_2 } from '@lottiefiles/dotlottie-web';
12
+ import { EventType } from '@lottiefiles/dotlottie-web';
13
13
  import { FC } from 'react';
14
- import type { FormEvent } from 'react';
14
+ import { FormEvent } from 'react';
15
15
  import { ForwardRefExoticComponent } from 'react';
16
16
  import { HTMLAttributes } from 'react';
17
- import type { HTMLProps } from 'react';
17
+ import { HTMLProps } from 'react';
18
18
  import { IChannelMessage } from '@cuemath/cue-message-broker';
19
- import type { IframeHTMLAttributes } from 'react';
20
- import type { ImgHTMLAttributes } from 'react';
21
- import type { InputHTMLAttributes } from 'react';
19
+ import { IframeHTMLAttributes } from 'react';
20
+ import { ImgHTMLAttributes } from 'react';
21
+ import { InputHTMLAttributes } from 'react';
22
22
  import { IProvidedProps } from 'google-maps-react';
23
23
  import { IStyledComponent } from 'styled-components';
24
24
  import { JSX } from 'react/jsx-runtime';
25
25
  import { MemoExoticComponent } from 'react';
26
- import type { MutableRefObject } from 'react';
26
+ import { MutableRefObject } from 'react';
27
27
  import { NamedExoticComponent } from 'react';
28
28
  import { Omit as Omit_2 } from 'google-maps-react';
29
- import type { PLUGIN_NAME } from '@cuemath/analytics-v2/dist/constants';
29
+ import { PLUGIN_NAME } from '@cuemath/analytics-v2/dist/constants';
30
30
  import { PropsWithChildren } from 'react';
31
31
  import { ReactElement } from 'react';
32
32
  import { ReactNode } from 'react';
33
33
  import { RefAttributes } from 'react';
34
34
  import { RefObject } from 'react';
35
35
  import { ResourceModel } from '@cuemath/rest-api';
36
- import type { SetStateAction } from 'react';
36
+ import { SetStateAction } from 'react';
37
37
  import { Substitute } from 'styled-components/dist/types';
38
38
  import { SVGProps } from 'react';
39
39
  import { VideoHTMLAttributes } from 'react';
@@ -84,7 +84,7 @@ declare type AnimationSegment = [number, number];
84
84
  export declare const AppLoader: FC<IAppLoaderProps>;
85
85
 
86
86
  export declare const ArcButton: NamedExoticComponent<IArcButtonProps & {
87
- children?: ReactNode | undefined;
87
+ children?: ReactNode | undefined;
88
88
  } & RefAttributes<HTMLDivElement>>;
89
89
 
90
90
  export declare const ArrowTooltip: NamedExoticComponent<IArrowTooltipProps>;
@@ -440,7 +440,7 @@ declare interface CueCoinIconProps extends SVGProps<SVGSVGElement> {
440
440
  variant?: 'gold' | 'silver';
441
441
  }
442
442
 
443
- export declare const CuemathAppFeatures: NamedExoticComponent<{}>;
443
+ export declare const CuemathAppFeatures: NamedExoticComponent< {}>;
444
444
 
445
445
  export declare const CuemathLogo: FC<SVGProps<SVGSVGElement>>;
446
446
 
@@ -468,11 +468,12 @@ export declare const CustomInputField: NamedExoticComponent<ICustomInputFieldPro
468
468
  export declare const DailyTimeline: FC<DailyTimelineProps>;
469
469
 
470
470
  declare interface DailyTimelineProps {
471
- userType: TUserTypes;
471
+ userType: TUserTypes_2;
472
472
  studentId: string;
473
- courseStreams: TCourseStream[];
473
+ courseStreams?: TCourseStream[];
474
474
  onPuzzlesClick: (userNodeId: string) => void;
475
- onReviewClick: (userNodeId: string) => void;
475
+ onReviewClick?: (userNodeId: string | null, isSatMockTestBlock: boolean, userBlockId: string | null) => void;
476
+ scrollAreaHeight: string | number | undefined;
476
477
  }
477
478
 
478
479
  export declare const DashArrowIcon: FC<SVGProps<SVGSVGElement>>;
@@ -698,7 +699,7 @@ declare enum GENDER {
698
699
  OTHER = "OTHER"
699
700
  }
700
701
 
701
- export declare const getActiveSATSheet: (sheets: TLPARSheetData[]) => TLPARSheetData;
702
+ export declare const getActiveSATSheet: (sheets: TLPARSheetData[]) => TLPARSheetData | undefined;
702
703
 
703
704
  declare const getArrowTooltipConfig: IGetArrowTooltipConfig;
704
705
 
@@ -5241,7 +5242,7 @@ export declare const OTPInput: NamedExoticComponent<IOTPInputProps>;
5241
5242
  export declare type OutcomeStage = keyof typeof STAGES;
5242
5243
 
5243
5244
  export declare const OverlayLoader: MemoExoticComponent<({ isLoading }: {
5244
- isLoading?: boolean | undefined;
5245
+ isLoading?: boolean | undefined;
5245
5246
  }) => JSX.Element | null>;
5246
5247
 
5247
5248
  export declare const ParentDashboard: MemoExoticComponent<(props: IParentDashboardProps) => JSX.Element>;
@@ -5564,7 +5565,7 @@ export declare const SheetIcon: FC<SVGProps<SVGSVGElement>>;
5564
5565
  export declare const SheetList: FC<ISheetsListProps>;
5565
5566
 
5566
5567
  export declare const SheetLocked: MemoExoticComponent<({ onHomeClick }: {
5567
- onHomeClick: () => void;
5568
+ onHomeClick: () => void;
5568
5569
  }) => JSX.Element>;
5569
5570
 
5570
5571
  export declare const SignUp: ({ mathGymEnrolledUser, circleEnrolledUser, circleOnLeapPremiumDays, circleUsername, countryCode, grade: defaultGrade, state, circleOnLeapPremiumEnabled, studentId, isSignUpProcessing, onCreateUser, onUpdateUser, onSignupStepsComplete, isPLAStudent, }: ISignUpProps) => JSX.Element;
@@ -6911,6 +6912,8 @@ declare type TUserProgram = {
6911
6912
 
6912
6913
  export declare type TUserTypes = 'TEACHER' | 'STUDENT';
6913
6914
 
6915
+ declare type TUserTypes_2 = 'TEACHER' | 'STUDENT' | 'PARENT';
6916
+
6914
6917
  export declare const TutorChangeModal: MemoExoticComponent<() => JSX.Element>;
6915
6918
 
6916
6919
  export declare const Tutorial: ({ src, title, onCross, showProgress, onTutorialPlayedOnce, isJourneyActive, }: ITutorialProps) => JSX.Element;
@@ -7082,8 +7085,8 @@ export declare const useGetMilestoneResources: (initialId?: string, initialQuery
7082
7085
 
7083
7086
  export declare const useGetPastMilestoneCount: (initialId?: string, initialQuery?: void | undefined) => {
7084
7087
  get: (id: string, query: void, meta: TQuery_2) => Promise<void>;
7085
- resource: ResourceModel<{
7086
- user_milestones_count: number;
7088
+ resource: ResourceModel< {
7089
+ user_milestones_count: number;
7087
7090
  }> | undefined;
7088
7091
  data: {
7089
7092
  user_milestones_count: number;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cuemath/leap",
3
- "version": "3.5.4-as1",
3
+ "version": "3.5.4-as10",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "dist"