@cuemath/leap 3.5.34-as4 → 3.5.34-j1
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.
- package/dist/features/timeline/daily-timeline/daily-timeline-types.js.map +1 -1
- package/dist/features/timeline/daily-timeline/daily-timeline.js +71 -60
- package/dist/features/timeline/daily-timeline/daily-timeline.js.map +1 -1
- package/dist/features/timeline/monthly-timeline/monthly-timeline-types.js.map +1 -1
- package/dist/features/timeline/monthly-timeline/monthly-timeline.js +54 -50
- package/dist/features/timeline/monthly-timeline/monthly-timeline.js.map +1 -1
- package/dist/index.d.ts +2 -0
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"daily-timeline-types.js","sources":["../../../../src/features/timeline/daily-timeline/daily-timeline-types.ts"],"sourcesContent":["import { type TCourseStream } from '../../milestone/create/milestone-create-types';\nimport { type ITimeLineItem, type ITimelineData } from './api/use-daily-timeline-get';\n\nexport enum NODE_STATE {\n COMPLETED = 'COMPLETED',\n IN_PROGRESS = 'IN_PROGRESS',\n PENDING = 'PENDING',\n NOT_STARTED = 'NOT_STARTED',\n WAIT_FOR_REVIEW = 'WAIT_FOR_REVIEW',\n}\n\nexport enum USER_TYPE {\n TEACHER = 'TEACHER',\n STUDENT = 'STUDENT',\n PARENT = 'PARENT',\n}\n\nexport enum CARD_TYPE {\n CW = 'CW',\n HW = 'HW',\n CIRCLE = 'CIRCLE',\n}\n\nexport interface IDailyTimelineProps {\n userType: USER_TYPE;\n studentId: string;\n courseStreams?: TCourseStream[];\n onPuzzleClick?: (card: ITimeLineItem) => void;\n onReviewClick?: (\n userNodeId: string | null,\n isSatMockTestBlock: boolean,\n userBlockId: string | null,\n ) => void;\n scrollAreaHeight?: string | number;\n}\n\nexport interface IDailyTimelineItemsProps extends IDailyTimelineProps {\n entry: ITimelineData;\n isFirstElement: boolean;\n shouldShowTag: boolean;\n}\n"],"names":["NODE_STATE","USER_TYPE","CARD_TYPE"],"mappings":"AAGY,IAAAA,sBAAAA,OACVA,EAAA,YAAY,aACZA,EAAA,cAAc,eACdA,EAAA,UAAU,WACVA,EAAA,cAAc,eACdA,EAAA,kBAAkB,mBALRA,IAAAA,KAAA,CAAA,CAAA,GAQAC,sBAAAA,OACVA,EAAA,UAAU,WACVA,EAAA,UAAU,WACVA,EAAA,SAAS,UAHCA,IAAAA,KAAA,CAAA,CAAA,GAMAC,sBAAAA,OACVA,EAAA,KAAK,MACLA,EAAA,KAAK,MACLA,EAAA,SAAS,UAHCA,IAAAA,KAAA,CAAA,CAAA;"}
|
|
1
|
+
{"version":3,"file":"daily-timeline-types.js","sources":["../../../../src/features/timeline/daily-timeline/daily-timeline-types.ts"],"sourcesContent":["import { type TCourseStream } from '../../milestone/create/milestone-create-types';\nimport { type ITimeLineItem, type ITimelineData } from './api/use-daily-timeline-get';\n\nexport enum NODE_STATE {\n COMPLETED = 'COMPLETED',\n IN_PROGRESS = 'IN_PROGRESS',\n PENDING = 'PENDING',\n NOT_STARTED = 'NOT_STARTED',\n WAIT_FOR_REVIEW = 'WAIT_FOR_REVIEW',\n}\n\nexport enum USER_TYPE {\n TEACHER = 'TEACHER',\n STUDENT = 'STUDENT',\n PARENT = 'PARENT',\n}\n\nexport enum CARD_TYPE {\n CW = 'CW',\n HW = 'HW',\n CIRCLE = 'CIRCLE',\n}\n\nexport interface IDailyTimelineProps {\n userType: USER_TYPE;\n studentId: string;\n courseStreams?: TCourseStream[];\n onPuzzleClick?: (card: ITimeLineItem) => void;\n onReviewClick?: (\n userNodeId: string | null,\n isSatMockTestBlock: boolean,\n userBlockId: string | null,\n ) => void;\n scrollAreaHeight?: string | number;\n onAPIComplete?: () => void;\n}\n\nexport interface IDailyTimelineItemsProps extends IDailyTimelineProps {\n entry: ITimelineData;\n isFirstElement: boolean;\n shouldShowTag: boolean;\n}\n"],"names":["NODE_STATE","USER_TYPE","CARD_TYPE"],"mappings":"AAGY,IAAAA,sBAAAA,OACVA,EAAA,YAAY,aACZA,EAAA,cAAc,eACdA,EAAA,UAAU,WACVA,EAAA,cAAc,eACdA,EAAA,kBAAkB,mBALRA,IAAAA,KAAA,CAAA,CAAA,GAQAC,sBAAAA,OACVA,EAAA,UAAU,WACVA,EAAA,UAAU,WACVA,EAAA,SAAS,UAHCA,IAAAA,KAAA,CAAA,CAAA,GAMAC,sBAAAA,OACVA,EAAA,KAAK,MACLA,EAAA,KAAK,MACLA,EAAA,SAAS,UAHCA,IAAAA,KAAA,CAAA,CAAA;"}
|
|
@@ -1,99 +1,110 @@
|
|
|
1
|
-
import { jsx as s, jsxs as
|
|
2
|
-
import { memo as
|
|
3
|
-
import { useDailyTimelineGet as
|
|
4
|
-
import { ScrollWrapper as
|
|
5
|
-
import { USER_TYPE as
|
|
6
|
-
import { INITIAL_PAGE as
|
|
7
|
-
import { getTimezone as
|
|
8
|
-
import { DAILY_TIMELINE_ANALYTICS_EVENTS as
|
|
9
|
-
import
|
|
10
|
-
import { useUIContext as
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
import
|
|
16
|
-
const
|
|
17
|
-
({
|
|
18
|
-
|
|
19
|
-
|
|
1
|
+
import { jsx as s, jsxs as R } from "react/jsx-runtime";
|
|
2
|
+
import { memo as A, useState as C, useCallback as h, useMemo as F, useEffect as m, Fragment as V } from "react";
|
|
3
|
+
import { useDailyTimelineGet as Y } from "./api/use-daily-timeline-get.js";
|
|
4
|
+
import { ScrollWrapper as j, DailyTimelineContainer as P } from "./daily-timeline-styled.js";
|
|
5
|
+
import { USER_TYPE as k, CARD_TYPE as M } from "./daily-timeline-types.js";
|
|
6
|
+
import { INITIAL_PAGE as G } from "./comps/constants.js";
|
|
7
|
+
import { getTimezone as O } from "../../../helpers/date-time.js";
|
|
8
|
+
import { DAILY_TIMELINE_ANALYTICS_EVENTS as T } from "./daily-timeline-events.js";
|
|
9
|
+
import U from "./daily-timeline-view.js";
|
|
10
|
+
import { useUIContext as W } from "../../ui/context/context.js";
|
|
11
|
+
import b from "../../hooks/use-previous.js";
|
|
12
|
+
import X from "../../ui/error/error.js";
|
|
13
|
+
import q from "../../ui/layout/flex-view.js";
|
|
14
|
+
import B from "../../ui/intersection-loader/intersection-loader.js";
|
|
15
|
+
import H from "../../ui/loader/app-loader/app-loader.js";
|
|
16
|
+
const z = A(
|
|
17
|
+
({
|
|
18
|
+
userType: E,
|
|
19
|
+
studentId: i,
|
|
20
|
+
courseStreams: f,
|
|
21
|
+
onPuzzleClick: N,
|
|
22
|
+
onReviewClick: v,
|
|
23
|
+
scrollAreaHeight: u,
|
|
24
|
+
onAPIComplete: l
|
|
25
|
+
}) => {
|
|
26
|
+
const [c, g] = C([]), [_, L] = C(!1), { onEvent: t } = W(), {
|
|
27
|
+
get: y,
|
|
20
28
|
data: e,
|
|
21
|
-
isProcessingFailed:
|
|
22
|
-
isProcessing:
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
29
|
+
isProcessingFailed: x,
|
|
30
|
+
isProcessing: I,
|
|
31
|
+
isProcessed: S
|
|
32
|
+
} = Y(i), d = b(e == null ? void 0 : e.curr_page), n = h(
|
|
33
|
+
(r = G, o = !1) => {
|
|
34
|
+
o && L(!0), y(i, {
|
|
26
35
|
page: r,
|
|
27
|
-
timezone:
|
|
28
|
-
course_stream:
|
|
36
|
+
timezone: O(),
|
|
37
|
+
course_stream: E === k.TEACHER ? f : []
|
|
29
38
|
});
|
|
30
39
|
},
|
|
31
|
-
[
|
|
32
|
-
),
|
|
40
|
+
[y, i, E, f]
|
|
41
|
+
), $ = F(() => {
|
|
33
42
|
const r = /* @__PURE__ */ new Set();
|
|
34
|
-
|
|
35
|
-
a.daily_logs && a.daily_logs.forEach((
|
|
36
|
-
|
|
43
|
+
c.forEach((a) => {
|
|
44
|
+
a.daily_logs && a.daily_logs.forEach((p) => {
|
|
45
|
+
p.course_stream && p.course_stream !== M.CIRCLE && r.add(p.course_stream);
|
|
37
46
|
});
|
|
38
47
|
});
|
|
39
48
|
const o = new Set(
|
|
40
|
-
(
|
|
49
|
+
(f || []).filter((a) => String(a) !== M.CIRCLE)
|
|
41
50
|
);
|
|
42
51
|
return o.size > 1 || r.size > 1 || o.size > 0 && r.size > 0 && (o.size !== r.size || !Array.from(o).every((a) => r.has(a)));
|
|
43
|
-
}, [
|
|
44
|
-
e != null && e.next_page && !
|
|
52
|
+
}, [c, f]), w = h(() => {
|
|
53
|
+
e != null && e.next_page && !_ && (n(e.next_page, !0), t(T.TIMELINE_SCROLLED, {
|
|
45
54
|
student_id: i
|
|
46
55
|
}));
|
|
47
|
-
}, [e, i, t,
|
|
48
|
-
n(1, !1),
|
|
56
|
+
}, [e, i, t, _, n]), D = h(() => {
|
|
57
|
+
n(1, !1), g([]);
|
|
49
58
|
}, [n]);
|
|
50
|
-
return
|
|
51
|
-
e && (e.curr_page === 1 ?
|
|
52
|
-
}, [e,
|
|
53
|
-
t(
|
|
59
|
+
return m(() => {
|
|
60
|
+
e && (e.curr_page === 1 ? g((e == null ? void 0 : e.user_logs) ?? []) : e.curr_page && d !== e.curr_page && (g((r) => [...r, ...e.user_logs ?? []]), L(!1)));
|
|
61
|
+
}, [e, d]), m(() => {
|
|
62
|
+
t(T.TIMELINE_VIEWED, {
|
|
54
63
|
student_id: i
|
|
55
64
|
});
|
|
56
|
-
}, [i, t]),
|
|
57
|
-
t(
|
|
65
|
+
}, [i, t]), m(() => () => {
|
|
66
|
+
t(T.TIMELINE_CLOSED, {
|
|
58
67
|
student_id: i
|
|
59
68
|
});
|
|
60
|
-
}, [i, t]),
|
|
69
|
+
}, [i, t]), m(() => {
|
|
61
70
|
n(1, !1);
|
|
62
|
-
}, [n]),
|
|
63
|
-
|
|
71
|
+
}, [n]), m(() => {
|
|
72
|
+
S && (l == null || l());
|
|
73
|
+
}, [S, l]), x ? /* @__PURE__ */ s(X, { height: u ?? "100vh", onTryAgain: D }) : I && !c.length ? /* @__PURE__ */ s(
|
|
74
|
+
q,
|
|
64
75
|
{
|
|
65
76
|
$alignItems: "center",
|
|
66
77
|
$justifyContent: "center",
|
|
67
|
-
$height:
|
|
68
|
-
children: /* @__PURE__ */ s(
|
|
78
|
+
$height: u || "100vh",
|
|
79
|
+
children: /* @__PURE__ */ s(H, { width: "100%", height: "100%" })
|
|
69
80
|
}
|
|
70
|
-
) : /* @__PURE__ */ s(
|
|
71
|
-
|
|
72
|
-
|
|
81
|
+
) : /* @__PURE__ */ s(j, { $alignItems: "center", $gapX: 1, children: /* @__PURE__ */ R(P, { children: [
|
|
82
|
+
c.map((r, o) => /* @__PURE__ */ s(V, { children: /* @__PURE__ */ s(
|
|
83
|
+
U,
|
|
73
84
|
{
|
|
74
85
|
entry: r,
|
|
75
86
|
isFirstElement: o === 0,
|
|
76
|
-
shouldShowTag:
|
|
77
|
-
onPuzzleClick:
|
|
78
|
-
onReviewClick:
|
|
79
|
-
userType:
|
|
87
|
+
shouldShowTag: $,
|
|
88
|
+
onPuzzleClick: N,
|
|
89
|
+
onReviewClick: v,
|
|
90
|
+
userType: E,
|
|
80
91
|
studentId: i
|
|
81
92
|
}
|
|
82
93
|
) }, `timeline-entry-${o}`)),
|
|
83
94
|
/* @__PURE__ */ s(
|
|
84
|
-
|
|
95
|
+
B,
|
|
85
96
|
{
|
|
86
|
-
onLoadMore:
|
|
87
|
-
isLoading:
|
|
97
|
+
onLoadMore: w,
|
|
98
|
+
isLoading: _,
|
|
88
99
|
hasMore: !!(e != null && e.next_page)
|
|
89
100
|
}
|
|
90
101
|
)
|
|
91
102
|
] }) });
|
|
92
103
|
}
|
|
93
104
|
);
|
|
94
|
-
|
|
95
|
-
const
|
|
105
|
+
z.displayName = "DailyTimeline";
|
|
106
|
+
const ce = z;
|
|
96
107
|
export {
|
|
97
|
-
|
|
108
|
+
ce as default
|
|
98
109
|
};
|
|
99
110
|
//# 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 { Fragment, memo, useCallback, useEffect, useMemo, useState, type FC } from 'react';\n\nimport { type ITimelineData, useDailyTimelineGet } from './api/use-daily-timeline-get';\nimport * as Styled from './daily-timeline-styled';\nimport { CARD_TYPE, USER_TYPE, type IDailyTimelineProps } from './daily-timeline-types';\nimport { INITIAL_PAGE } from './comps/constants';\nimport { getTimezone } from '../../../helpers/date-time';\nimport { DAILY_TIMELINE_ANALYTICS_EVENTS } from './daily-timeline-events';\nimport DailyTimelineView from './daily-timeline-view';\nimport { useUIContext } from '../../ui/context/context';\nimport usePrevious from '../../hooks/use-previous';\nimport Error from '../../ui/error/error';\nimport FlexView from '../../ui/layout/flex-view';\nimport IntersectionLoader from '../../ui/intersection-loader/intersection-loader';\nimport AppLoader from '../../ui/loader/app-loader/app-loader';\n\nconst DailyTimeline: FC<IDailyTimelineProps> = memo(\n ({
|
|
1
|
+
{"version":3,"file":"daily-timeline.js","sources":["../../../../src/features/timeline/daily-timeline/daily-timeline.tsx"],"sourcesContent":["import { Fragment, memo, useCallback, useEffect, useMemo, useState, type FC } from 'react';\n\nimport { type ITimelineData, useDailyTimelineGet } from './api/use-daily-timeline-get';\nimport * as Styled from './daily-timeline-styled';\nimport { CARD_TYPE, USER_TYPE, type IDailyTimelineProps } from './daily-timeline-types';\nimport { INITIAL_PAGE } from './comps/constants';\nimport { getTimezone } from '../../../helpers/date-time';\nimport { DAILY_TIMELINE_ANALYTICS_EVENTS } from './daily-timeline-events';\nimport DailyTimelineView from './daily-timeline-view';\nimport { useUIContext } from '../../ui/context/context';\nimport usePrevious from '../../hooks/use-previous';\nimport Error from '../../ui/error/error';\nimport FlexView from '../../ui/layout/flex-view';\nimport IntersectionLoader from '../../ui/intersection-loader/intersection-loader';\nimport AppLoader from '../../ui/loader/app-loader/app-loader';\n\nconst DailyTimeline: FC<IDailyTimelineProps> = memo(\n ({\n userType,\n studentId,\n courseStreams,\n onPuzzleClick,\n onReviewClick,\n scrollAreaHeight,\n onAPIComplete,\n }) => {\n const [allTimelineData, setAllTimelineData] = useState<ITimelineData[]>([]);\n const [isLoadingMore, setIsLoadingMore] = useState(false);\n const { onEvent: trackEvent } = useUIContext();\n const {\n get: getTimeline,\n data: timelineData,\n isProcessingFailed,\n isProcessing,\n isProcessed,\n } = useDailyTimelineGet(studentId);\n\n const prevCurrentPage = usePrevious(timelineData?.curr_page);\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 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 !== CARD_TYPE.CIRCLE) {\n allCourseStreams.add(log.course_stream);\n }\n });\n }\n });\n\n const courseStreamsSet = new Set(\n (courseStreams || []).filter(stream => String(stream) !== CARD_TYPE.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 trackEvent(DAILY_TIMELINE_ANALYTICS_EVENTS.TIMELINE_SCROLLED, {\n student_id: studentId,\n });\n }\n }, [timelineData, studentId, trackEvent, isLoadingMore, fetchTimeline]);\n\n const onTryAgain = useCallback(() => {\n fetchTimeline(1, false);\n setAllTimelineData([]);\n }, [fetchTimeline]);\n\n useEffect(() => {\n if (timelineData) {\n if (timelineData.curr_page === 1) {\n setAllTimelineData(timelineData?.user_logs ?? []);\n } else if (timelineData.curr_page && prevCurrentPage !== timelineData.curr_page) {\n setAllTimelineData(prev => [...prev, ...(timelineData.user_logs ?? [])]);\n setIsLoadingMore(false);\n }\n }\n }, [timelineData, prevCurrentPage]);\n\n useEffect(() => {\n trackEvent(DAILY_TIMELINE_ANALYTICS_EVENTS.TIMELINE_VIEWED, {\n student_id: studentId,\n });\n }, [studentId, trackEvent]);\n\n useEffect(() => {\n return () => {\n trackEvent(DAILY_TIMELINE_ANALYTICS_EVENTS.TIMELINE_CLOSED, {\n student_id: studentId,\n });\n };\n }, [studentId, trackEvent]);\n\n useEffect(() => {\n fetchTimeline(1, false);\n }, [fetchTimeline]);\n\n useEffect(() => {\n if (isProcessed) {\n onAPIComplete?.();\n }\n }, [isProcessed, onAPIComplete]);\n\n if (isProcessingFailed) {\n return <Error height={scrollAreaHeight ?? '100vh'} onTryAgain={onTryAgain} />;\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\" $gapX={1}>\n <Styled.DailyTimelineContainer>\n {allTimelineData.map((entry, index) => (\n <Fragment key={`timeline-entry-${index}`}>\n <DailyTimelineView\n entry={entry}\n isFirstElement={index === 0}\n shouldShowTag={shouldShowTag}\n onPuzzleClick={onPuzzleClick}\n onReviewClick={onReviewClick}\n userType={userType}\n studentId={studentId}\n />\n </Fragment>\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","onPuzzleClick","onReviewClick","scrollAreaHeight","onAPIComplete","allTimelineData","setAllTimelineData","useState","isLoadingMore","setIsLoadingMore","trackEvent","useUIContext","getTimeline","timelineData","isProcessingFailed","isProcessing","isProcessed","useDailyTimelineGet","prevCurrentPage","usePrevious","fetchTimeline","useCallback","page","INITIAL_PAGE","append","getTimezone","USER_TYPE","shouldShowTag","useMemo","allCourseStreams","entry","log","CARD_TYPE","courseStreamsSet","stream","handleLoadMore","DAILY_TIMELINE_ANALYTICS_EVENTS","onTryAgain","useEffect","prev","jsx","Error","FlexView","AppLoader","Styled.ScrollWrapper","jsxs","Styled.DailyTimelineContainer","index","Fragment","DailyTimelineView","IntersectionLoader","DailyTimeline$1"],"mappings":";;;;;;;;;;;;;;;AAgBA,MAAMA,IAAyCC;AAAA,EAC7C,CAAC;AAAA,IACC,UAAAC;AAAA,IACA,WAAAC;AAAA,IACA,eAAAC;AAAA,IACA,eAAAC;AAAA,IACA,eAAAC;AAAA,IACA,kBAAAC;AAAA,IACA,eAAAC;AAAA,EAAA,MACI;AACJ,UAAM,CAACC,GAAiBC,CAAkB,IAAIC,EAA0B,CAAE,CAAA,GACpE,CAACC,GAAeC,CAAgB,IAAIF,EAAS,EAAK,GAClD,EAAE,SAASG,EAAW,IAAIC,EAAa,GACvC;AAAA,MACJ,KAAKC;AAAA,MACL,MAAMC;AAAA,MACN,oBAAAC;AAAA,MACA,cAAAC;AAAA,MACA,aAAAC;AAAA,IAAA,IACEC,EAAoBlB,CAAS,GAE3BmB,IAAkBC,EAAYN,KAAA,gBAAAA,EAAc,SAAS,GAErDO,IAAgBC;AAAA,MACpB,CAACC,IAAOC,GAAcC,IAAS,OAAU;AACvC,QAAIA,KACFf,EAAiB,EAAI,GAGvBG,EAAYb,GAAW;AAAA,UACrB,MAAAuB;AAAA,UACA,UAAUG,EAAY;AAAA,UACtB,eAAe3B,MAAa4B,EAAU,UAAU1B,IAAgB,CAAC;AAAA,QAAA,CAClE;AAAA,MACH;AAAA,MACA,CAACY,GAAab,GAA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AA;AAAA,MARW,EAAA,GAAA,kBAAkBgD,CAAK,EAUtC,CACD;AAAA,MACD,gBAAAP;AAAA,QAACU;AAAA,QAAA;AAAA,UACC,YAAYf;AAAA,UACZ,WAAW3B;AAAA,UACX,SAAS,CAAC,EAACK,KAAA,QAAAA,EAAc;AAAA,QAAA;AAAA,MAC3B;AAAA,IAAA,EACF,CAAA,EACF,CAAA;AAAA,EAEJ;AACF;AAEAjB,EAAc,cAAc;AAE5B,MAAAuD,KAAevD;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"monthly-timeline-types.js","sources":["../../../../src/features/timeline/monthly-timeline/monthly-timeline-types.ts"],"sourcesContent":["import { type TCourseStream } from '../../milestone/create/milestone-create-types';\n\nexport enum REPORT_TYPE {\n MPR_V1 = 'MPR_V1',\n MPR_V2 = 'MPR_V2',\n PTM = 'PTM',\n}\n\nexport enum EGoalCategory {\n SCHOOL_SUCCESS = 'SCHOOL_SUCCESS',\n ENRICHMENT = 'ENRICHMENT',\n TEST_PREP = 'TEST_PREP',\n}\n\nexport interface IMonthlyTimeline {\n year: number;\n month: number;\n reports: IMonthlyTimelineReport[];\n}\n\nexport interface IMonthlyTimelineReport {\n report_data: TimelineReportData | null;\n course_stream: TCourseStream | null;\n report_type: REPORT_TYPE;\n}\n\nexport interface TimelineReportData {\n id: string | null;\n progress_data: ProgressData | null;\n}\n\nexport interface ProgressData {\n user_milestones: IUserMilestone[];\n}\n\nexport interface IUserMilestone {\n goal_category: EGoalCategory;\n goal_code: string;\n milestone_name: string;\n previous_progress_stat: ProgressStat | null;\n progress_stat: ProgressStat;\n user_chapters: IUserChapter[];\n user_milestone_id: string;\n}\n\nexport interface IUserChapter {\n chapter_code: string;\n chapter_name: string;\n image_url: string;\n previous_progress_stat: ProgressStat | null;\n progress_stat: ProgressStat;\n user_chapter_id: string;\n}\n\nexport interface ProgressStat {\n completed: number;\n total: number;\n}\n\nexport interface IMonthlyTimelineProps {\n userType: 'PARENT' | 'TEACHER' | 'STUDENT';\n studentId: string;\n courseStreams?: string[];\n onReportClick?: (reportId: string, reportType: REPORT_TYPE, year: number, month: string) => void;\n scrollAreaHeight?: string | number;\n}\n\nexport interface IMonthlyTimelineViewProps {\n reports: IMonthlyTimelineReport[];\n onReportClick?: IMonthlyTimelineProps['onReportClick'];\n year: number;\n month: number;\n}\n"],"names":["REPORT_TYPE","EGoalCategory"],"mappings":"AAEY,IAAAA,sBAAAA,OACVA,EAAA,SAAS,UACTA,EAAA,SAAS,UACTA,EAAA,MAAM,OAHIA,IAAAA,KAAA,CAAA,CAAA,GAMAC,sBAAAA,OACVA,EAAA,iBAAiB,kBACjBA,EAAA,aAAa,cACbA,EAAA,YAAY,aAHFA,IAAAA,KAAA,CAAA,CAAA;"}
|
|
1
|
+
{"version":3,"file":"monthly-timeline-types.js","sources":["../../../../src/features/timeline/monthly-timeline/monthly-timeline-types.ts"],"sourcesContent":["import { type TCourseStream } from '../../milestone/create/milestone-create-types';\n\nexport enum REPORT_TYPE {\n MPR_V1 = 'MPR_V1',\n MPR_V2 = 'MPR_V2',\n PTM = 'PTM',\n}\n\nexport enum EGoalCategory {\n SCHOOL_SUCCESS = 'SCHOOL_SUCCESS',\n ENRICHMENT = 'ENRICHMENT',\n TEST_PREP = 'TEST_PREP',\n}\n\nexport interface IMonthlyTimeline {\n year: number;\n month: number;\n reports: IMonthlyTimelineReport[];\n}\n\nexport interface IMonthlyTimelineReport {\n report_data: TimelineReportData | null;\n course_stream: TCourseStream | null;\n report_type: REPORT_TYPE;\n}\n\nexport interface TimelineReportData {\n id: string | null;\n progress_data: ProgressData | null;\n}\n\nexport interface ProgressData {\n user_milestones: IUserMilestone[];\n}\n\nexport interface IUserMilestone {\n goal_category: EGoalCategory;\n goal_code: string;\n milestone_name: string;\n previous_progress_stat: ProgressStat | null;\n progress_stat: ProgressStat;\n user_chapters: IUserChapter[];\n user_milestone_id: string;\n}\n\nexport interface IUserChapter {\n chapter_code: string;\n chapter_name: string;\n image_url: string;\n previous_progress_stat: ProgressStat | null;\n progress_stat: ProgressStat;\n user_chapter_id: string;\n}\n\nexport interface ProgressStat {\n completed: number;\n total: number;\n}\n\nexport interface IMonthlyTimelineProps {\n userType: 'PARENT' | 'TEACHER' | 'STUDENT';\n studentId: string;\n courseStreams?: string[];\n onReportClick?: (reportId: string, reportType: REPORT_TYPE, year: number, month: string) => void;\n scrollAreaHeight?: string | number;\n onAPIComplete?: () => void;\n}\n\nexport interface IMonthlyTimelineViewProps {\n reports: IMonthlyTimelineReport[];\n onReportClick?: IMonthlyTimelineProps['onReportClick'];\n year: number;\n month: number;\n}\n"],"names":["REPORT_TYPE","EGoalCategory"],"mappings":"AAEY,IAAAA,sBAAAA,OACVA,EAAA,SAAS,UACTA,EAAA,SAAS,UACTA,EAAA,MAAM,OAHIA,IAAAA,KAAA,CAAA,CAAA,GAMAC,sBAAAA,OACVA,EAAA,iBAAiB,kBACjBA,EAAA,aAAa,cACbA,EAAA,YAAY,aAHFA,IAAAA,KAAA,CAAA,CAAA;"}
|
|
@@ -1,65 +1,69 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { memo as
|
|
3
|
-
import { monthlyTimelineGet as
|
|
4
|
-
import
|
|
5
|
-
import
|
|
1
|
+
import { jsx as r, Fragment as w, jsxs as s } from "react/jsx-runtime";
|
|
2
|
+
import { memo as L, useMemo as R, useCallback as X, useEffect as d } from "react";
|
|
3
|
+
import { monthlyTimelineGet as j } from "./api/use-monthly-timeline-get.js";
|
|
4
|
+
import F from "./monthly-timeline-view.js";
|
|
5
|
+
import M from "../../ui/loader/app-loader/app-loader.js";
|
|
6
6
|
import t from "../../ui/layout/flex-view.js";
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import { yearImages as
|
|
11
|
-
import
|
|
12
|
-
import { ImageContainer as
|
|
13
|
-
import { getTimezone as
|
|
14
|
-
import { ILLUSTRATIONS as
|
|
15
|
-
const
|
|
16
|
-
userType:
|
|
7
|
+
import S from "../../ui/text/text.js";
|
|
8
|
+
import y from "../../ui/image/image.js";
|
|
9
|
+
import h from "../../ui/separator/separator.js";
|
|
10
|
+
import { yearImages as A, monthNames as B } from "./constants.js";
|
|
11
|
+
import I from "../../ui/error/error.js";
|
|
12
|
+
import { ImageContainer as v, DateText as z } from "./monthly-timeline-styled.js";
|
|
13
|
+
import { getTimezone as C } from "../../../helpers/date-time.js";
|
|
14
|
+
import { ILLUSTRATIONS as D } from "../../../assets/illustrations/illustrations.js";
|
|
15
|
+
const K = ({
|
|
16
|
+
userType: c,
|
|
17
17
|
studentId: n,
|
|
18
18
|
courseStreams: l,
|
|
19
|
-
onReportClick:
|
|
19
|
+
onReportClick: u,
|
|
20
|
+
onAPIComplete: o
|
|
20
21
|
}) => {
|
|
21
|
-
const
|
|
22
|
+
const m = R(
|
|
22
23
|
() => ({
|
|
23
|
-
course_streams:
|
|
24
|
-
timezone:
|
|
24
|
+
course_streams: c === "TEACHER" ? l : [],
|
|
25
|
+
timezone: C()
|
|
25
26
|
}),
|
|
26
|
-
[l,
|
|
27
|
+
[l, c]
|
|
27
28
|
), {
|
|
28
|
-
get:
|
|
29
|
-
data:
|
|
30
|
-
isProcessing:
|
|
31
|
-
isProcessingFailed:
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
29
|
+
get: f,
|
|
30
|
+
data: i = [],
|
|
31
|
+
isProcessing: x,
|
|
32
|
+
isProcessingFailed: E,
|
|
33
|
+
isProcessed: g
|
|
34
|
+
} = j(n, m), a = X(() => {
|
|
35
|
+
f(n, m);
|
|
36
|
+
}, [f, m, n]);
|
|
37
|
+
return d(() => {
|
|
38
|
+
a();
|
|
39
|
+
}, [a]), d(() => {
|
|
40
|
+
g && (o == null || o());
|
|
41
|
+
}, [g, o]), x ? /* @__PURE__ */ r(M, { height: "100dvh" }) : E ? /* @__PURE__ */ r(t, { $flex: 1, $alignItems: "center", $justifyContent: "center", children: /* @__PURE__ */ r(I, { onTryAgain: a }) }) : /* @__PURE__ */ r(w, { children: (i == null ? void 0 : i.length) > 0 ? /* @__PURE__ */ r(t, { $gapX: 2, children: i.map((e, _) => {
|
|
42
|
+
const p = _ === 0, b = e.month === 12, T = !p && b, $ = A[e.year];
|
|
43
|
+
return /* @__PURE__ */ s(t, { $width: "100%", children: [
|
|
44
|
+
!p && !T && /* @__PURE__ */ r(h, { heightX: 2 }),
|
|
45
|
+
T && $ && /* @__PURE__ */ r(v, { $marginBottom: -122, children: /* @__PURE__ */ r(y, { src: $, alt: e.year.toString() }) }),
|
|
46
|
+
/* @__PURE__ */ s(t, { $gutterX: 1, children: [
|
|
47
|
+
/* @__PURE__ */ r(z, { $renderAs: "ac4", $color: "BLACK_T_60", children: B[e.month - 1] }),
|
|
48
|
+
/* @__PURE__ */ r(h, { heightX: 1 }),
|
|
49
|
+
/* @__PURE__ */ r(
|
|
50
|
+
F,
|
|
47
51
|
{
|
|
48
|
-
reports:
|
|
49
|
-
month:
|
|
50
|
-
year:
|
|
51
|
-
onReportClick:
|
|
52
|
+
reports: e.reports,
|
|
53
|
+
month: e.month,
|
|
54
|
+
year: e.year,
|
|
55
|
+
onReportClick: u
|
|
52
56
|
}
|
|
53
57
|
)
|
|
54
58
|
] })
|
|
55
|
-
] }, `${
|
|
56
|
-
}) }) : /* @__PURE__ */
|
|
57
|
-
/* @__PURE__ */
|
|
58
|
-
/* @__PURE__ */
|
|
59
|
-
/* @__PURE__ */
|
|
59
|
+
] }, `${e.month}-${e.year}`);
|
|
60
|
+
}) }) : /* @__PURE__ */ s(t, { $justifyContent: "center", $alignItems: "center", $height: "100%", children: [
|
|
61
|
+
/* @__PURE__ */ r(y, { src: D.EMPTY_REPORTS }),
|
|
62
|
+
/* @__PURE__ */ r(h, { heightX: 1.5 }),
|
|
63
|
+
/* @__PURE__ */ r(S, { $renderAs: "ab2", color: "BLACK_T_60", children: "Report will be available next month." })
|
|
60
64
|
] }) });
|
|
61
|
-
},
|
|
65
|
+
}, rr = L(K);
|
|
62
66
|
export {
|
|
63
|
-
|
|
67
|
+
rr as default
|
|
64
68
|
};
|
|
65
69
|
//# sourceMappingURL=monthly-timeline.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"monthly-timeline.js","sources":["../../../../src/features/timeline/monthly-timeline/monthly-timeline.tsx"],"sourcesContent":["import { type FC, memo, useCallback, useEffect, useMemo } from 'react';\n\nimport { type IMonthlyTimelineProps } from './monthly-timeline-types';\nimport { monthlyTimelineGet } from './api/use-monthly-timeline-get';\nimport MonthlyTimelineView from './monthly-timeline-view';\nimport AppLoader from '../../ui/loader/app-loader/app-loader';\nimport FlexView from '../../ui/layout/flex-view';\nimport Text from '../../ui/text/text';\nimport Image from '../../ui/image/image';\nimport Separator from '../../ui/separator/separator';\nimport { monthNames, yearImages } from './constants';\nimport Error from '../../ui/error/error';\nimport * as Styled from './monthly-timeline-styled';\nimport { getTimezone } from '../../../helpers/date-time';\nimport { ILLUSTRATIONS } from '../../../assets/illustrations/illustrations';\n\nconst MonthlyTimeline: FC<IMonthlyTimelineProps> = ({\n userType,\n studentId,\n courseStreams,\n onReportClick,\n}) => {\n const initialQueryParams = useMemo(\n () => ({\n course_streams: userType === 'TEACHER' ? courseStreams : [],\n timezone: getTimezone(),\n }),\n [courseStreams, userType],\n );\n\n const {\n get: getTimeline,\n data: timelineData = [],\n isProcessing,\n isProcessingFailed,\n } = monthlyTimelineGet(studentId, initialQueryParams);\n\n const fetchData = useCallback(() => {\n getTimeline(studentId, initialQueryParams);\n }, [getTimeline, initialQueryParams, studentId]);\n\n useEffect(() => {\n fetchData();\n }, [fetchData]);\n\n if (isProcessing) {\n return <AppLoader height=\"100dvh\" />;\n }\n\n if (isProcessingFailed) {\n return (\n <FlexView $flex={1} $alignItems=\"center\" $justifyContent=\"center\">\n <Error onTryAgain={fetchData} />\n </FlexView>\n );\n }\n\n return (\n <>\n {timelineData?.length > 0 ? (\n <FlexView $gapX={2}>\n {timelineData.map((item, index) => {\n const isFirstItem = index === 0;\n const isDecember = item.month === 12;\n const showYearImage = !isFirstItem && isDecember;\n const yearImage = yearImages[item.year];\n\n return (\n <FlexView key={`${item.month}-${item.year}`} $width=\"100%\">\n {!isFirstItem && !showYearImage && <Separator heightX={2} />}\n {showYearImage && yearImage && (\n <Styled.ImageContainer $marginBottom={-122}>\n <Image src={yearImage} alt={item.year.toString()} />\n </Styled.ImageContainer>\n )}\n <FlexView $gutterX={1}>\n <Styled.DateText $renderAs=\"ac4\" $color=\"BLACK_T_60\">\n {monthNames[item.month - 1]}\n </Styled.DateText>\n <Separator heightX={1} />\n <MonthlyTimelineView\n reports={item.reports}\n month={item.month}\n year={item.year}\n onReportClick={onReportClick}\n />\n </FlexView>\n </FlexView>\n );\n })}\n </FlexView>\n ) : (\n <FlexView $justifyContent=\"center\" $alignItems=\"center\" $height=\"100%\">\n <Image src={ILLUSTRATIONS.EMPTY_REPORTS} />\n <Separator heightX={1.5} />\n <Text $renderAs=\"ab2\" color=\"BLACK_T_60\">\n Report will be available next month.\n </Text>\n </FlexView>\n )}\n </>\n );\n};\n\nexport default memo(MonthlyTimeline);\n"],"names":["MonthlyTimeline","userType","studentId","courseStreams","onReportClick","initialQueryParams","useMemo","getTimezone","getTimeline","timelineData","isProcessing","isProcessingFailed","monthlyTimelineGet","fetchData","useCallback","useEffect","jsx","AppLoader","FlexView","Error","Fragment","item","index","isFirstItem","isDecember","showYearImage","yearImage","yearImages","jsxs","Separator","Styled.ImageContainer","Image","Styled.DateText","monthNames","MonthlyTimelineView","ILLUSTRATIONS","Text","monthlyTimeline","memo"],"mappings":";;;;;;;;;;;;;;AAgBA,MAAMA,IAA6C,CAAC;AAAA,EAClD,UAAAC;AAAA,EACA,WAAAC;AAAA,EACA,eAAAC;AAAA,EACA,eAAAC;AACF,MAAM;AACJ,QAAMC,IAAqBC;AAAA,IACzB,OAAO;AAAA,MACL,
|
|
1
|
+
{"version":3,"file":"monthly-timeline.js","sources":["../../../../src/features/timeline/monthly-timeline/monthly-timeline.tsx"],"sourcesContent":["import { type FC, memo, useCallback, useEffect, useMemo } from 'react';\n\nimport { type IMonthlyTimelineProps } from './monthly-timeline-types';\nimport { monthlyTimelineGet } from './api/use-monthly-timeline-get';\nimport MonthlyTimelineView from './monthly-timeline-view';\nimport AppLoader from '../../ui/loader/app-loader/app-loader';\nimport FlexView from '../../ui/layout/flex-view';\nimport Text from '../../ui/text/text';\nimport Image from '../../ui/image/image';\nimport Separator from '../../ui/separator/separator';\nimport { monthNames, yearImages } from './constants';\nimport Error from '../../ui/error/error';\nimport * as Styled from './monthly-timeline-styled';\nimport { getTimezone } from '../../../helpers/date-time';\nimport { ILLUSTRATIONS } from '../../../assets/illustrations/illustrations';\n\nconst MonthlyTimeline: FC<IMonthlyTimelineProps> = ({\n userType,\n studentId,\n courseStreams,\n onReportClick,\n onAPIComplete,\n}) => {\n const initialQueryParams = useMemo(\n () => ({\n course_streams: userType === 'TEACHER' ? courseStreams : [],\n timezone: getTimezone(),\n }),\n [courseStreams, userType],\n );\n\n const {\n get: getTimeline,\n data: timelineData = [],\n isProcessing,\n isProcessingFailed,\n isProcessed,\n } = monthlyTimelineGet(studentId, initialQueryParams);\n\n const fetchData = useCallback(() => {\n getTimeline(studentId, initialQueryParams);\n }, [getTimeline, initialQueryParams, studentId]);\n\n useEffect(() => {\n fetchData();\n }, [fetchData]);\n\n useEffect(() => {\n if (isProcessed) {\n onAPIComplete?.();\n }\n }, [isProcessed, onAPIComplete]);\n\n if (isProcessing) {\n return <AppLoader height=\"100dvh\" />;\n }\n\n if (isProcessingFailed) {\n return (\n <FlexView $flex={1} $alignItems=\"center\" $justifyContent=\"center\">\n <Error onTryAgain={fetchData} />\n </FlexView>\n );\n }\n\n return (\n <>\n {timelineData?.length > 0 ? (\n <FlexView $gapX={2}>\n {timelineData.map((item, index) => {\n const isFirstItem = index === 0;\n const isDecember = item.month === 12;\n const showYearImage = !isFirstItem && isDecember;\n const yearImage = yearImages[item.year];\n\n return (\n <FlexView key={`${item.month}-${item.year}`} $width=\"100%\">\n {!isFirstItem && !showYearImage && <Separator heightX={2} />}\n {showYearImage && yearImage && (\n <Styled.ImageContainer $marginBottom={-122}>\n <Image src={yearImage} alt={item.year.toString()} />\n </Styled.ImageContainer>\n )}\n <FlexView $gutterX={1}>\n <Styled.DateText $renderAs=\"ac4\" $color=\"BLACK_T_60\">\n {monthNames[item.month - 1]}\n </Styled.DateText>\n <Separator heightX={1} />\n <MonthlyTimelineView\n reports={item.reports}\n month={item.month}\n year={item.year}\n onReportClick={onReportClick}\n />\n </FlexView>\n </FlexView>\n );\n })}\n </FlexView>\n ) : (\n <FlexView $justifyContent=\"center\" $alignItems=\"center\" $height=\"100%\">\n <Image src={ILLUSTRATIONS.EMPTY_REPORTS} />\n <Separator heightX={1.5} />\n <Text $renderAs=\"ab2\" color=\"BLACK_T_60\">\n Report will be available next month.\n </Text>\n </FlexView>\n )}\n </>\n );\n};\n\nexport default memo(MonthlyTimeline);\n"],"names":["MonthlyTimeline","userType","studentId","courseStreams","onReportClick","onAPIComplete","initialQueryParams","useMemo","getTimezone","getTimeline","timelineData","isProcessing","isProcessingFailed","isProcessed","monthlyTimelineGet","fetchData","useCallback","useEffect","jsx","AppLoader","FlexView","Error","Fragment","item","index","isFirstItem","isDecember","showYearImage","yearImage","yearImages","jsxs","Separator","Styled.ImageContainer","Image","Styled.DateText","monthNames","MonthlyTimelineView","ILLUSTRATIONS","Text","monthlyTimeline","memo"],"mappings":";;;;;;;;;;;;;;AAgBA,MAAMA,IAA6C,CAAC;AAAA,EAClD,UAAAC;AAAA,EACA,WAAAC;AAAA,EACA,eAAAC;AAAA,EACA,eAAAC;AAAA,EACA,eAAAC;AACF,MAAM;AACJ,QAAMC,IAAqBC;AAAA,IACzB,OAAO;AAAA,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pC,UAAC,gBAAAd,EAAAe,GAAA,EAAM,KAAKL,GAAW,KAAKL,EAAK,KAAK,SAAA,EAAY,CAAA,GACpD;AAAA,MAEF,gBAAAO,EAACV,GAAS,EAAA,UAAU,GAClB,UAAA;AAAA,QAAC,gBAAAF,EAAAgB,GAAA,EAAgB,WAAU,OAAM,QAAO,cACrC,UAAWC,EAAAZ,EAAK,QAAQ,CAAC,EAC5B,CAAA;AAAA,QACA,gBAAAL,EAACa,GAAU,EAAA,SAAS,EAAG,CAAA;AAAA,QACvB,gBAAAb;AAAA,UAACkB;AAAA,UAAA;AAAA,YACC,SAASb,EAAK;AAAA,YACd,OAAOA,EAAK;AAAA,YACZ,MAAMA,EAAK;AAAA,YACX,eAAAnB;AAAA,UAAA;AAAA,QACF;AAAA,MAAA,GACF;AAAA,IAAA,KAlBa,GAAGmB,EAAK,KAAK,IAAIA,EAAK,IAAI,EAmBzC;AAAA,EAEH,CAAA,GACH,IAEC,gBAAAO,EAAAV,GAAA,EAAS,iBAAgB,UAAS,aAAY,UAAS,SAAQ,QAC9D,UAAA;AAAA,IAAC,gBAAAF,EAAAe,GAAA,EAAM,KAAKI,EAAc,cAAe,CAAA;AAAA,IACzC,gBAAAnB,EAACa,GAAU,EAAA,SAAS,IAAK,CAAA;AAAA,sBACxBO,GAAK,EAAA,WAAU,OAAM,OAAM,cAAa,UAEzC,wCAAA;AAAA,EAAA,EACF,CAAA,EAEJ,CAAA;AAEJ,GAEeC,KAAAC,EAAKxC,CAAe;"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1633,6 +1633,7 @@ declare interface IDailyTimelineProps {
|
|
|
1633
1633
|
onPuzzleClick?: (card: ITimeLineItem) => void;
|
|
1634
1634
|
onReviewClick?: (userNodeId: string | null, isSatMockTestBlock: boolean, userBlockId: string | null) => void;
|
|
1635
1635
|
scrollAreaHeight?: string | number;
|
|
1636
|
+
onAPIComplete?: () => void;
|
|
1636
1637
|
}
|
|
1637
1638
|
|
|
1638
1639
|
declare interface IDatePickerInputProps extends Omit<ICustomInputFieldProps, 'value' | 'onChange'> {
|
|
@@ -3028,6 +3029,7 @@ declare interface IMonthlyTimelineProps {
|
|
|
3028
3029
|
courseStreams?: string[];
|
|
3029
3030
|
onReportClick?: (reportId: string, reportType: REPORT_TYPE, year: number, month: string) => void;
|
|
3030
3031
|
scrollAreaHeight?: string | number;
|
|
3032
|
+
onAPIComplete?: () => void;
|
|
3031
3033
|
}
|
|
3032
3034
|
|
|
3033
3035
|
export declare interface IMultiplayerWebGameProps extends IBaseWebGameProps, ISyncableWebGameProps {
|