@cuemath/leap 3.5.19-link.1 → 3.5.20-link.0
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/constants/app-config.js +5 -0
- package/dist/constants/app-config.js.map +1 -0
- package/dist/features/timeline/comps/accordion-item/accordion-item.js +36 -36
- package/dist/features/timeline/comps/accordion-item/accordion-item.js.map +1 -1
- package/dist/features/timeline/comps/daily-timeline-items/daily-timeline-items.js +9 -10
- package/dist/features/timeline/comps/daily-timeline-items/daily-timeline-items.js.map +1 -1
- package/dist/features/timeline/comps/no-activity.js +4 -5
- package/dist/features/timeline/comps/no-activity.js.map +1 -1
- package/dist/features/timeline/comps/utils.js +9 -9
- package/dist/features/timeline/comps/utils.js.map +1 -1
- package/dist/features/timeline/daily-timeline-types.js.map +1 -1
- package/dist/features/trial-session/comps/worksheet/worksheet.js +22 -22
- package/dist/features/trial-session/comps/worksheet/worksheet.js.map +1 -1
- package/dist/features/ui/buttons/text-button/text-button-styled.js +7 -6
- package/dist/features/ui/buttons/text-button/text-button-styled.js.map +1 -1
- package/dist/index.d.ts +30 -2
- package/package.json +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"app-config.js","sources":["../../src/constants/app-config.ts"],"sourcesContent":["export const IS_TOUCH_DEVICE = window.ReactNativeWebView;\n"],"names":["IS_TOUCH_DEVICE"],"mappings":"AAAO,MAAMA,IAAkB,OAAO;"}
|
|
@@ -1,59 +1,59 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { memo as
|
|
3
|
-
import
|
|
1
|
+
import { jsxs as t, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { memo as S, useMemo as K, useCallback as $ } from "react";
|
|
3
|
+
import u from "../../../ui/buttons/text-button/text-button.js";
|
|
4
4
|
import l from "../../../ui/layout/flex-view.js";
|
|
5
5
|
import d from "../../../ui/text/text.js";
|
|
6
|
-
import { getStateConf as
|
|
7
|
-
import { BLOCK_TYPE as
|
|
8
|
-
import { CODING_ACTIVITY_NODE_TYPES as
|
|
9
|
-
import { NODE_STATE as
|
|
10
|
-
import { NODE_TYPES as
|
|
11
|
-
const
|
|
12
|
-
({ type: T, userType:
|
|
6
|
+
import { getStateConf as N } from "../utils.js";
|
|
7
|
+
import { BLOCK_TYPE as g } from "../../../chapters-v2/constants/block-constants.js";
|
|
8
|
+
import { CODING_ACTIVITY_NODE_TYPES as O } from "../constants.js";
|
|
9
|
+
import { NODE_STATE as k, CARD_TYPE as P, USER_TYPE as i } from "../../daily-timeline-types.js";
|
|
10
|
+
import { NODE_TYPES as Y } from "../../../../types/models/worksheet.js";
|
|
11
|
+
const G = S(
|
|
12
|
+
({ type: T, userType: o, card: s, onPuzzleClick: n, onReviewClick: m }) => {
|
|
13
13
|
const {
|
|
14
|
-
label:
|
|
15
|
-
title:
|
|
16
|
-
state:
|
|
14
|
+
label: b,
|
|
15
|
+
title: h,
|
|
16
|
+
state: E,
|
|
17
17
|
subtext: _,
|
|
18
|
-
user_node_id:
|
|
18
|
+
user_node_id: a,
|
|
19
19
|
block_type: p,
|
|
20
|
-
user_block_id:
|
|
20
|
+
user_block_id: C,
|
|
21
21
|
node_type: f
|
|
22
|
-
} =
|
|
22
|
+
} = s, c = p === g.SAT_MOCK_TEST, x = f === Y.PUZZLE_CARD, [A, w, B] = N(E), r = E === k.COMPLETED, D = K(() => T === P.CIRCLE ? !1 : o === i.TEACHER ? !c || r : o === i.STUDENT ? r && !O.includes(
|
|
23
23
|
f
|
|
24
|
-
) : !1, [
|
|
25
|
-
|
|
26
|
-
}, [
|
|
27
|
-
|
|
28
|
-
}, [c,
|
|
29
|
-
return /* @__PURE__ */
|
|
30
|
-
/* @__PURE__ */ e(l, { $justifyContent: "flex-end", $height: 18, $background: "WHITE", children: /* @__PURE__ */ e(l, { $background: w, $
|
|
31
|
-
/* @__PURE__ */
|
|
32
|
-
/* @__PURE__ */
|
|
33
|
-
/* @__PURE__ */
|
|
34
|
-
|
|
24
|
+
) : !1, [o, T, c, r, f]), I = r && (o === i.STUDENT || o === i.PARENT) || o === i.TEACHER, L = $(() => {
|
|
25
|
+
n == null || n(s);
|
|
26
|
+
}, [n, s]), R = $(() => {
|
|
27
|
+
m && a && m(a, c, C);
|
|
28
|
+
}, [c, m, C, a]);
|
|
29
|
+
return /* @__PURE__ */ t(l, { $flexDirection: "row", $flexGapX: 1.5, children: [
|
|
30
|
+
/* @__PURE__ */ e(l, { $justifyContent: "flex-end", $height: 18, $background: "WHITE", children: /* @__PURE__ */ e(l, { $background: w, $borderColor: "BLACK_1", $borderRadiusX: 0.8, children: A && /* @__PURE__ */ e(A, { width: 14, height: 14, color: B }) }) }),
|
|
31
|
+
/* @__PURE__ */ t(l, { $flexRowGapX: 0.25, children: [
|
|
32
|
+
/* @__PURE__ */ t(d, { $renderAs: "ub2", $color: "BLACK_1", children: [
|
|
33
|
+
/* @__PURE__ */ t(d, { $renderAs: "ub2-bold", $inline: !0, $color: "BLACK_1", children: [
|
|
34
|
+
b,
|
|
35
35
|
":"
|
|
36
36
|
] }),
|
|
37
37
|
" ",
|
|
38
|
-
|
|
38
|
+
h
|
|
39
39
|
] }),
|
|
40
40
|
x ? I ? /* @__PURE__ */ e(
|
|
41
|
-
|
|
41
|
+
u,
|
|
42
42
|
{
|
|
43
|
-
label:
|
|
43
|
+
label: r ? "View reviewed puzzle" : "View assigned puzzle",
|
|
44
44
|
size: "small",
|
|
45
45
|
color: "BLACK_T_60",
|
|
46
|
-
onClick:
|
|
46
|
+
onClick: L
|
|
47
47
|
}
|
|
48
|
-
) : /* @__PURE__ */ e(d, { $renderAs: "ub3", $color: "BLACK_T_60", children: _ }) : /* @__PURE__ */
|
|
48
|
+
) : /* @__PURE__ */ e(d, { $renderAs: "ub3", $color: "BLACK_T_60", children: _ }) : /* @__PURE__ */ t(l, { $flexDirection: "row", $flexGapX: 0.75, $alignItems: "center", children: [
|
|
49
49
|
_ && /* @__PURE__ */ e(d, { $renderAs: "ub3", $color: "BLACK_T_60", children: _ }),
|
|
50
50
|
D && /* @__PURE__ */ e(
|
|
51
|
-
|
|
51
|
+
u,
|
|
52
52
|
{
|
|
53
53
|
label: "Review",
|
|
54
54
|
size: "small",
|
|
55
55
|
color: "BLACK_T_60",
|
|
56
|
-
onClick:
|
|
56
|
+
onClick: R
|
|
57
57
|
}
|
|
58
58
|
)
|
|
59
59
|
] })
|
|
@@ -61,8 +61,8 @@ const O = L(
|
|
|
61
61
|
] });
|
|
62
62
|
}
|
|
63
63
|
);
|
|
64
|
-
|
|
64
|
+
G.displayName = "AccordionItem";
|
|
65
65
|
export {
|
|
66
|
-
|
|
66
|
+
G as default
|
|
67
67
|
};
|
|
68
68
|
//# 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, useMemo, 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 { IAccordionItemProps } from './accordion-item-types';\nimport { getStateConf } from '../utils';\nimport { BLOCK_TYPE } from '../../../chapters-v2/constants/block-constants';\nimport { type TColorNames } from '../../../ui/types';\nimport { CODING_ACTIVITY_NODE_TYPES } from '../constants';\nimport { CARD_TYPE, NODE_STATE, USER_TYPE } from '../../daily-timeline-types';\nimport { NODE_TYPES } from '../../../../types/models/worksheet';\n\nconst AccordionItem: FC<IAccordionItemProps> = 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 node_type: nodeType,\n } = card;\n const isSatMockTestBlock = blockType === BLOCK_TYPE.SAT_MOCK_TEST;\n const isPuzzleCard = nodeType === NODE_TYPES.PUZZLE_CARD;\n const [Icon, bgColor] = getStateConf(state) as [FC<React.SVGProps<SVGSVGElement
|
|
1
|
+
{"version":3,"file":"accordion-item.js","sources":["../../../../../src/features/timeline/comps/accordion-item/accordion-item.tsx"],"sourcesContent":["import { memo, useCallback, useMemo, 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 { IAccordionItemProps } from './accordion-item-types';\nimport { getStateConf } from '../utils';\nimport { BLOCK_TYPE } from '../../../chapters-v2/constants/block-constants';\nimport { type TColorNames } from '../../../ui/types';\nimport { CODING_ACTIVITY_NODE_TYPES } from '../constants';\nimport { CARD_TYPE, NODE_STATE, USER_TYPE } from '../../daily-timeline-types';\nimport { NODE_TYPES } from '../../../../types/models/worksheet';\n\nconst AccordionItem: FC<IAccordionItemProps> = 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 node_type: nodeType,\n } = card;\n const isSatMockTestBlock = blockType === BLOCK_TYPE.SAT_MOCK_TEST;\n const isPuzzleCard = nodeType === NODE_TYPES.PUZZLE_CARD;\n const [Icon, bgColor, color] = getStateConf(state) as [\n FC<React.SVGProps<SVGSVGElement>>,\n TColorNames,\n TColorNames,\n ];\n const isCompleted = state === NODE_STATE.COMPLETED;\n const shouldShowReview = useMemo(() => {\n if (type === CARD_TYPE.CIRCLE) return false;\n\n if (userType === USER_TYPE.TEACHER) return !isSatMockTestBlock || isCompleted;\n\n if (userType === USER_TYPE.STUDENT)\n return (\n isCompleted &&\n !CODING_ACTIVITY_NODE_TYPES.includes(\n nodeType as (typeof CODING_ACTIVITY_NODE_TYPES)[number],\n )\n );\n\n return false;\n }, [userType, type, isSatMockTestBlock, isCompleted, nodeType]);\n\n const canReviewPuzzle =\n (isCompleted && (userType === USER_TYPE.STUDENT || userType === USER_TYPE.PARENT)) ||\n userType === USER_TYPE.TEACHER;\n\n const handlePuzzleClick = useCallback(() => {\n onPuzzleClick?.(card);\n }, [onPuzzleClick, card]);\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 $justifyContent=\"flex-end\" $height={18} $background=\"WHITE\">\n <FlexView $background={bgColor} $borderColor=\"BLACK_1\" $borderRadiusX={0.8}>\n {Icon && <Icon width={14} height={14} color={color} />}\n </FlexView>\n </FlexView>\n <FlexView $flexRowGapX={0.25}>\n <Text $renderAs=\"ub2\" $color=\"BLACK_1\">\n <Text $renderAs=\"ub2-bold\" $inline $color=\"BLACK_1\">\n {label}:\n </Text>{' '}\n {title}\n </Text>\n {isPuzzleCard ? (\n canReviewPuzzle ? (\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 <Text $renderAs=\"ub3\" $color=\"BLACK_T_60\">\n {subtext}\n </Text>\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","nodeType","isSatMockTestBlock","BLOCK_TYPE","isPuzzleCard","NODE_TYPES","Icon","bgColor","color","getStateConf","isCompleted","NODE_STATE","shouldShowReview","useMemo","CARD_TYPE","USER_TYPE","CODING_ACTIVITY_NODE_TYPES","canReviewPuzzle","handlePuzzleClick","useCallback","handleReviewClick","jsxs","FlexView","jsx","Text","TextButton"],"mappings":";;;;;;;;;;AAaA,MAAMA,IAAyCC;AAAA,EAC7C,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,MACf,WAAWC;AAAA,IACT,IAAAV,GACEW,IAAqBH,MAAcI,EAAW,eAC9CC,IAAeH,MAAaI,EAAW,aACvC,CAACC,GAAMC,GAASC,CAAK,IAAIC,EAAab,CAAK,GAK3Cc,IAAcd,MAAUe,EAAW,WACnCC,IAAmBC,EAAQ,MAC3BxB,MAASyB,EAAU,SAAe,KAElCxB,MAAayB,EAAU,UAAgB,CAACb,KAAsBQ,IAE9DpB,MAAayB,EAAU,UAEvBL,KACA,CAACM,EAA2B;AAAA,MAC1Bf;AAAA,IAAA,IAIC,IACN,CAACX,GAAUD,GAAMa,GAAoBQ,GAAaT,CAAQ,CAAC,GAExDgB,IACHP,MAAgBpB,MAAayB,EAAU,WAAWzB,MAAayB,EAAU,WAC1EzB,MAAayB,EAAU,SAEnBG,IAAoBC,EAAY,MAAM;AAC1C,MAAA3B,KAAA,QAAAA,EAAgBD;AAAA,IAAI,GACnB,CAACC,GAAeD,CAAI,CAAC,GAElB6B,IAAoBD,EAAY,MAAM;AAC1C,MAAI1B,KAAiBK,KACLL,EAAAK,GAAYI,GAAoBF,CAAW;AAAA,OAE1D,CAACE,GAAoBT,GAAeO,GAAaF,CAAU,CAAC;AAE/D,WACG,gBAAAuB,EAAAC,GAAA,EAAS,gBAAe,OAAM,WAAW,KACxC,UAAA;AAAA,MAAC,gBAAAC,EAAAD,GAAA,EAAS,iBAAgB,YAAW,SAAS,IAAI,aAAY,SAC5D,UAAA,gBAAAC,EAACD,GAAS,EAAA,aAAaf,GAAS,cAAa,WAAU,gBAAgB,KACpE,UAAQD,KAAA,gBAAAiB,EAACjB,GAAK,EAAA,OAAO,IAAI,QAAQ,IAAI,OAAAE,EAAc,CAAA,EAAA,CACtD,EACF,CAAA;AAAA,MACA,gBAAAa,EAACC,GAAS,EAAA,cAAc,MACtB,UAAA;AAAA,QAAA,gBAAAD,EAACG,GAAK,EAAA,WAAU,OAAM,QAAO,WAC3B,UAAA;AAAA,UAAA,gBAAAH,EAACG,KAAK,WAAU,YAAW,SAAO,IAAC,QAAO,WACvC,UAAA;AAAA,YAAA9B;AAAA,YAAM;AAAA,UAAA,GACT;AAAA,UAAQ;AAAA,UACPC;AAAA,QAAA,GACH;AAAA,QACCS,IACCa,IACE,gBAAAM;AAAA,UAACE;AAAA,UAAA;AAAA,YACC,OAAOf,IAAc,yBAAyB;AAAA,YAC9C,MAAK;AAAA,YACL,OAAM;AAAA,YACN,SAASQ;AAAA,UAAA;AAAA,QAAA,IAGV,gBAAAK,EAAAC,GAAA,EAAK,WAAU,OAAM,QAAO,cAC1B,UAAA3B,EACH,CAAA,IAGF,gBAAAwB,EAACC,KAAS,gBAAe,OAAM,WAAW,MAAM,aAAY,UACzD,UAAA;AAAA,UAAAzB,uBACE2B,GAAK,EAAA,WAAU,OAAM,QAAO,cAC1B,UACH3B,GAAA;AAAA,UAEDe,KACC,gBAAAW;AAAA,YAACE;AAAA,YAAA;AAAA,cACC,OAAM;AAAA,cACN,MAAK;AAAA,cACL,OAAM;AAAA,cACN,SAASL;AAAA,YAAA;AAAA,UACX;AAAA,QAAA,GAEJ;AAAA,MAAA,GAEJ;AAAA,IACF,EAAA,CAAA;AAAA,EAEJ;AACF;AAEAjC,EAAc,cAAc;"}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { jsx as e, jsxs as m, Fragment as b } from "react/jsx-runtime";
|
|
2
|
-
import { memo as y, useState as L, useMemo as x, useCallback as
|
|
3
|
-
import
|
|
2
|
+
import { memo as y, useState as L, useMemo as x, useCallback as D } from "react";
|
|
3
|
+
import w from "../../../../assets/line-icons/icons/plus.js";
|
|
4
4
|
import S from "../../../ui/accordion-section/accordion-section.js";
|
|
5
5
|
import r from "../../../ui/layout/flex-view.js";
|
|
6
6
|
import N from "../../../../assets/line-icons/icons/minus.js";
|
|
7
7
|
import k from "../../../ui/image/image.js";
|
|
8
8
|
import h from "../../../ui/text/text.js";
|
|
9
9
|
import V from "../accordion-item/accordion-item.js";
|
|
10
|
-
import { Wrapper as
|
|
10
|
+
import { Wrapper as j, TagContainer as B, SectionFooter as M, Card as X } from "./daily-timeline-items-styled.js";
|
|
11
11
|
import { getTimelineCardIcon as P } from "../utils.js";
|
|
12
12
|
import { useUIContext as W } from "../../../ui/context/context.js";
|
|
13
13
|
import { DAILY_TIMELINE_ANALYTICS_EVENTS as u } from "../../daily-timeline-events.js";
|
|
@@ -24,7 +24,7 @@ const F = y((I) => {
|
|
|
24
24
|
isLastItem: C,
|
|
25
25
|
fromDate: l,
|
|
26
26
|
studentId: c
|
|
27
|
-
} = I, [_, A] = L(!1), d = x(() => P(t), [t]), { onEvent: a } = W(), T =
|
|
27
|
+
} = I, [_, A] = L(!1), d = x(() => P(t), [t]), { onEvent: a } = W(), T = D(
|
|
28
28
|
(o) => {
|
|
29
29
|
A(o), a(
|
|
30
30
|
o ? u.TIMELINE_VIEW_EXPANDED : u.TIMELINE_VIEW_COLLAPSED,
|
|
@@ -38,11 +38,11 @@ const F = y((I) => {
|
|
|
38
38
|
},
|
|
39
39
|
[l, a, c, t, i]
|
|
40
40
|
);
|
|
41
|
-
return /* @__PURE__ */ e(
|
|
41
|
+
return /* @__PURE__ */ e(j, { $borderColor: "BLACK_1", $shouldAddBorder: C, children: /* @__PURE__ */ e(
|
|
42
42
|
S,
|
|
43
43
|
{
|
|
44
44
|
headerElement: /* @__PURE__ */ m(r, { children: [
|
|
45
|
-
E && s && /* @__PURE__ */ e(
|
|
45
|
+
E && s && /* @__PURE__ */ e(B, { $position: "absolute", $background: "BLACK_5", $gutter: 4, children: /* @__PURE__ */ e(h, { $renderAs: "ab4-black", $color: "WHITE", children: s }) }),
|
|
46
46
|
/* @__PURE__ */ m(
|
|
47
47
|
r,
|
|
48
48
|
{
|
|
@@ -50,7 +50,6 @@ const F = y((I) => {
|
|
|
50
50
|
$alignItems: "center",
|
|
51
51
|
$justifyContent: "space-between",
|
|
52
52
|
$heightX: 4,
|
|
53
|
-
$widthX: 30,
|
|
54
53
|
$gutterX: 1,
|
|
55
54
|
$gapX: 1.32,
|
|
56
55
|
children: [
|
|
@@ -67,13 +66,13 @@ const F = y((I) => {
|
|
|
67
66
|
]
|
|
68
67
|
}
|
|
69
68
|
),
|
|
70
|
-
_ ? /* @__PURE__ */ e(N, { width: 20, height: 20 }) : /* @__PURE__ */ e(
|
|
69
|
+
_ ? /* @__PURE__ */ e(N, { width: 20, height: 20 }) : /* @__PURE__ */ e(w, { width: 20, height: 20 })
|
|
71
70
|
]
|
|
72
71
|
}
|
|
73
72
|
)
|
|
74
73
|
] }),
|
|
75
|
-
bodyElement: n.length > 0 ? /* @__PURE__ */ e(
|
|
76
|
-
|
|
74
|
+
bodyElement: n.length > 0 ? /* @__PURE__ */ e(M, { $gutter: 32, children: n.map((o, p) => /* @__PURE__ */ e(
|
|
75
|
+
X,
|
|
77
76
|
{
|
|
78
77
|
$isLastCard: p === n.length - 1,
|
|
79
78
|
children: /* @__PURE__ */ e(
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"daily-timeline-items.js","sources":["../../../../../src/features/timeline/comps/daily-timeline-items/daily-timeline-items.tsx"],"sourcesContent":["import { memo, useCallback, useMemo, useState, type FC } from 'react';\n\nimport PlusIcon from '../../../../assets/line-icons/icons/plus';\nimport AccordionSection from '../../../ui/accordion-section/accordion-section';\nimport FlexView from '../../../ui/layout/flex-view';\nimport MinusIcon from '../../../../assets/line-icons/icons/minus';\nimport Image from '../../../ui/image/image';\nimport Text from '../../../ui/text/text';\nimport AccordionItem from '../accordion-item/accordion-item';\nimport * as Styled from './daily-timeline-items-styled';\nimport { getTimelineCardIcon } from '../utils';\nimport { type IDailyTimelineItemsProps } from './daily-timeline-items.types';\nimport { useUIContext } from '../../../ui/context/context';\nimport { DAILY_TIMELINE_ANALYTICS_EVENTS } from '../../daily-timeline-events';\n\nconst DailyTimelineItems: FC<IDailyTimelineItemsProps> = memo(props => {\n const {\n type,\n summary,\n cards,\n onPuzzleClick,\n onReviewClick,\n courseStream,\n shouldShowTag,\n userType,\n isLastItem,\n fromDate,\n studentId,\n } = props;\n const [isExpended, setIsExpended] = useState(false);\n\n const timelineIcon = useMemo(() => getTimelineCardIcon(type), [type]);\n const { onEvent: trackEvent } = useUIContext();\n\n const handleExpand = useCallback(\n (val: boolean) => {\n setIsExpended(val);\n trackEvent(\n val\n ? DAILY_TIMELINE_ANALYTICS_EVENTS.TIMELINE_VIEW_EXPANDED\n : DAILY_TIMELINE_ANALYTICS_EVENTS.TIMELINE_VIEW_COLLAPSED,\n {\n timeline_date: fromDate,\n student_id: studentId,\n timeline_section_type: type,\n timeline_section_subject: summary,\n },\n );\n },\n [fromDate, trackEvent, studentId, type, summary],\n );\n\n return (\n <Styled.Wrapper $borderColor=\"BLACK_1\" $shouldAddBorder={isLastItem}>\n <AccordionSection\n headerElement={\n <FlexView>\n {shouldShowTag && courseStream && (\n <Styled.TagContainer $position=\"absolute\" $background=\"BLACK_5\" $gutter={4}>\n <Text $renderAs=\"ab4-black\" $color=\"WHITE\">\n {courseStream}\n </Text>\n </Styled.TagContainer>\n )}\n <FlexView\n $flexDirection=\"row\"\n $alignItems=\"center\"\n $justifyContent=\"space-between\"\n $heightX={4}\n $
|
|
1
|
+
{"version":3,"file":"daily-timeline-items.js","sources":["../../../../../src/features/timeline/comps/daily-timeline-items/daily-timeline-items.tsx"],"sourcesContent":["import { memo, useCallback, useMemo, useState, type FC } from 'react';\n\nimport PlusIcon from '../../../../assets/line-icons/icons/plus';\nimport AccordionSection from '../../../ui/accordion-section/accordion-section';\nimport FlexView from '../../../ui/layout/flex-view';\nimport MinusIcon from '../../../../assets/line-icons/icons/minus';\nimport Image from '../../../ui/image/image';\nimport Text from '../../../ui/text/text';\nimport AccordionItem from '../accordion-item/accordion-item';\nimport * as Styled from './daily-timeline-items-styled';\nimport { getTimelineCardIcon } from '../utils';\nimport { type IDailyTimelineItemsProps } from './daily-timeline-items.types';\nimport { useUIContext } from '../../../ui/context/context';\nimport { DAILY_TIMELINE_ANALYTICS_EVENTS } from '../../daily-timeline-events';\n\nconst DailyTimelineItems: FC<IDailyTimelineItemsProps> = memo(props => {\n const {\n type,\n summary,\n cards,\n onPuzzleClick,\n onReviewClick,\n courseStream,\n shouldShowTag,\n userType,\n isLastItem,\n fromDate,\n studentId,\n } = props;\n const [isExpended, setIsExpended] = useState(false);\n\n const timelineIcon = useMemo(() => getTimelineCardIcon(type), [type]);\n const { onEvent: trackEvent } = useUIContext();\n\n const handleExpand = useCallback(\n (val: boolean) => {\n setIsExpended(val);\n trackEvent(\n val\n ? DAILY_TIMELINE_ANALYTICS_EVENTS.TIMELINE_VIEW_EXPANDED\n : DAILY_TIMELINE_ANALYTICS_EVENTS.TIMELINE_VIEW_COLLAPSED,\n {\n timeline_date: fromDate,\n student_id: studentId,\n timeline_section_type: type,\n timeline_section_subject: summary,\n },\n );\n },\n [fromDate, trackEvent, studentId, type, summary],\n );\n\n return (\n <Styled.Wrapper $borderColor=\"BLACK_1\" $shouldAddBorder={isLastItem}>\n <AccordionSection\n headerElement={\n <FlexView>\n {shouldShowTag && courseStream && (\n <Styled.TagContainer $position=\"absolute\" $background=\"BLACK_5\" $gutter={4}>\n <Text $renderAs=\"ab4-black\" $color=\"WHITE\">\n {courseStream}\n </Text>\n </Styled.TagContainer>\n )}\n <FlexView\n $flexDirection=\"row\"\n $alignItems=\"center\"\n $justifyContent=\"space-between\"\n $heightX={4}\n $gutterX={1}\n $gapX={1.32}\n >\n <FlexView\n $flexDirection=\"row\"\n $alignItems=\"center\"\n $justifyContent=\"center\"\n $flexGapX={1.125}\n >\n <FlexView>{timelineIcon && <Image src={timelineIcon} />}</FlexView>\n <Text $renderAs=\"ab2\" $color=\"BLACK_1\">\n {summary ?? ''}\n </Text>\n </FlexView>\n {isExpended ? (\n <MinusIcon width={20} height={20} />\n ) : (\n <PlusIcon width={20} height={20} />\n )}\n </FlexView>\n </FlexView>\n }\n bodyElement={\n cards.length > 0 ? (\n <Styled.SectionFooter $gutter={32}>\n {cards.map((card, index) => (\n <Styled.Card\n key={card.node_id ?? `card-${index}`}\n $isLastCard={index === cards.length - 1}\n >\n <AccordionItem\n card={card}\n onPuzzleClick={onPuzzleClick}\n onReviewClick={onReviewClick}\n type={type}\n userType={userType}\n />\n </Styled.Card>\n ))}\n </Styled.SectionFooter>\n ) : (\n <></>\n )\n }\n defaultVisible={false}\n onBodyVisibilityChange={handleExpand}\n />\n </Styled.Wrapper>\n );\n});\n\nDailyTimelineItems.displayName = 'DailyTimelineItems';\n\nexport default DailyTimelineItems;\n"],"names":["DailyTimelineItems","memo","props","type","summary","cards","onPuzzleClick","onReviewClick","courseStream","shouldShowTag","userType","isLastItem","fromDate","studentId","isExpended","setIsExpended","useState","timelineIcon","useMemo","getTimelineCardIcon","trackEvent","useUIContext","handleExpand","useCallback","val","DAILY_TIMELINE_ANALYTICS_EVENTS","Styled.Wrapper","jsx","AccordionSection","FlexView","Styled.TagContainer","Text","jsxs","Image","MinusIcon","PlusIcon","Styled.SectionFooter","card","index","Styled.Card","AccordionItem","Fragment"],"mappings":";;;;;;;;;;;;;AAeM,MAAAA,IAAmDC,EAAK,CAASC,MAAA;AAC/D,QAAA;AAAA,IACJ,MAAAC;AAAA,IACA,SAAAC;AAAA,IACA,OAAAC;AAAA,IACA,eAAAC;AAAA,IACA,eAAAC;AAAA,IACA,cAAAC;AAAA,IACA,eAAAC;AAAA,IACA,UAAAC;AAAA,IACA,YAAAC;AAAA,IACA,UAAAC;AAAA,IACA,WAAAC;AAAA,EACE,IAAAX,GACE,CAACY,GAAYC,CAAa,IAAIC,EAAS,EAAK,GAE5CC,IAAeC,EAAQ,MAAMC,EAAoBhB,CAAI,GAAG,CAACA,CAAI,CAAC,GAC9D,EAAE,SAASiB,EAAW,IAAIC,EAAa,GAEvCC,IAAeC;AAAA,IACnB,CAACC,MAAiB;AAChB,MAAAT,EAAcS,CAAG,GACjBJ;AAAA,QACEI,IACIC,EAAgC,yBAChCA,EAAgC;AAAA,QACpC;AAAA,UACE,eAAeb;AAAA,UACf,YAAYC;AAAA,UACZ,uBAAuBV;AAAA,UACvB,0BAA0BC;AAAA,QAC5B;AAAA,MAAA;AAAA,IAEJ;AAAA,IACA,CAACQ,GAAUQ,GAAYP,GAAWV,GAAMC,CAAO;AAAA,EAAA;AAGjD,2BACGsB,GAAA,EAAe,cAAa,WAAU,kBAAkBf,GACvD,UAAA,gBAAAgB;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,iCACGC,GACE,EAAA,UAAA;AAAA,QAAApB,KAAiBD,KACf,gBAAAmB,EAAAG,GAAA,EAAoB,WAAU,YAAW,aAAY,WAAU,SAAS,GACvE,4BAACC,GAAK,EAAA,WAAU,aAAY,QAAO,SAChC,YACH,CAAA,GACF;AAAA,QAEF,gBAAAC;AAAA,UAACH;AAAA,UAAA;AAAA,YACC,gBAAe;AAAA,YACf,aAAY;AAAA,YACZ,iBAAgB;AAAA,YAChB,UAAU;AAAA,YACV,UAAU;AAAA,YACV,OAAO;AAAA,YAEP,UAAA;AAAA,cAAA,gBAAAG;AAAA,gBAACH;AAAA,gBAAA;AAAA,kBACC,gBAAe;AAAA,kBACf,aAAY;AAAA,kBACZ,iBAAgB;AAAA,kBAChB,WAAW;AAAA,kBAEX,UAAA;AAAA,oBAAA,gBAAAF,EAACE,KAAU,UAAgBZ,KAAA,gBAAAU,EAACM,GAAM,EAAA,KAAKhB,EAAc,CAAA,GAAG;AAAA,sCACvDc,GAAK,EAAA,WAAU,OAAM,QAAO,WAC1B,eAAW,IACd;AAAA,kBAAA;AAAA,gBAAA;AAAA,cACF;AAAA,cACCjB,IACC,gBAAAa,EAACO,GAAU,EAAA,OAAO,IAAI,QAAQ,GAAI,CAAA,IAEjC,gBAAAP,EAAAQ,GAAA,EAAS,OAAO,IAAI,QAAQ,IAAI;AAAA,YAAA;AAAA,UAAA;AAAA,QAErC;AAAA,MAAA,GACF;AAAA,MAEF,aACE9B,EAAM,SAAS,sBACZ+B,GAAA,EAAqB,SAAS,IAC5B,UAAA/B,EAAM,IAAI,CAACgC,GAAMC,MAChB,gBAAAX;AAAA,QAACY;AAAAA,QAAA;AAAA,UAEC,aAAaD,MAAUjC,EAAM,SAAS;AAAA,UAEtC,UAAA,gBAAAsB;AAAA,YAACa;AAAA,YAAA;AAAA,cACC,MAAAH;AAAA,cACA,eAAA/B;AAAA,cACA,eAAAC;AAAA,cACA,MAAAJ;AAAA,cACA,UAAAO;AAAA,YAAA;AAAA,UACF;AAAA,QAAA;AAAA,QATK2B,EAAK,WAAW,QAAQC,CAAK;AAAA,MAWrC,CAAA,GACH,IAEE,gBAAAX,EAAAc,GAAA,CAAA,CAAA;AAAA,MAGN,gBAAgB;AAAA,MAChB,wBAAwBnB;AAAA,IAAA;AAAA,EAE5B,EAAA,CAAA;AAEJ,CAAC;AAEDtB,EAAmB,cAAc;"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsxs as t, jsx as r } from "react/jsx-runtime";
|
|
2
|
-
import { memo as
|
|
3
|
-
import
|
|
2
|
+
import { memo as e } from "react";
|
|
3
|
+
import i from "../../ui/image/image.js";
|
|
4
4
|
import m from "../../ui/layout/flex-view.js";
|
|
5
5
|
import c from "../../ui/text/text.js";
|
|
6
6
|
import { ILLUSTRATIONS as $ } from "../../../assets/illustrations/illustrations.js";
|
|
@@ -13,17 +13,16 @@ const o = () => /* @__PURE__ */ t(
|
|
|
13
13
|
$gutterX: 1,
|
|
14
14
|
$gapX: 1.32,
|
|
15
15
|
$heightX: 4,
|
|
16
|
-
$widthX: 30,
|
|
17
16
|
$borderColor: "BLACK_T_15",
|
|
18
17
|
$background: "BLACK_T_04",
|
|
19
18
|
children: [
|
|
20
|
-
/* @__PURE__ */ r(
|
|
19
|
+
/* @__PURE__ */ r(i, { src: $.NO_ACTIVITY }),
|
|
21
20
|
/* @__PURE__ */ r(c, { $renderAs: "ab2", $color: "BLACK_T_38", children: "No Activity" })
|
|
22
21
|
]
|
|
23
22
|
}
|
|
24
23
|
);
|
|
25
24
|
o.displayName = "NoActivity";
|
|
26
|
-
const f =
|
|
25
|
+
const f = e(o);
|
|
27
26
|
export {
|
|
28
27
|
f as default
|
|
29
28
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"no-activity.js","sources":["../../../../src/features/timeline/comps/no-activity.tsx"],"sourcesContent":["import { memo } from 'react';\n\nimport Image from '../../ui/image/image';\nimport FlexView from '../../ui/layout/flex-view';\nimport Text from '../../ui/text/text';\nimport { ILLUSTRATIONS } from '../../../assets/illustrations/illustrations';\n\nconst NoActivity = () => {\n return (\n <FlexView\n $flexDirection=\"row\"\n $flexGapX={0.75}\n $alignItems=\"center\"\n $gutterX={1}\n $gapX={1.32}\n $heightX={4}\n $
|
|
1
|
+
{"version":3,"file":"no-activity.js","sources":["../../../../src/features/timeline/comps/no-activity.tsx"],"sourcesContent":["import { memo } from 'react';\n\nimport Image from '../../ui/image/image';\nimport FlexView from '../../ui/layout/flex-view';\nimport Text from '../../ui/text/text';\nimport { ILLUSTRATIONS } from '../../../assets/illustrations/illustrations';\n\nconst NoActivity = () => {\n return (\n <FlexView\n $flexDirection=\"row\"\n $flexGapX={0.75}\n $alignItems=\"center\"\n $gutterX={1}\n $gapX={1.32}\n $heightX={4}\n $borderColor=\"BLACK_T_15\"\n $background=\"BLACK_T_04\"\n >\n <Image src={ILLUSTRATIONS.NO_ACTIVITY} />\n <Text $renderAs=\"ab2\" $color=\"BLACK_T_38\">\n No Activity\n </Text>\n </FlexView>\n );\n};\n\nNoActivity.displayName = 'NoActivity';\n\nexport default memo(NoActivity);\n"],"names":["NoActivity","jsxs","FlexView","jsx","Image","ILLUSTRATIONS","Text","NoActivity$1","memo"],"mappings":";;;;;;AAOA,MAAMA,IAAa,MAEf,gBAAAC;AAAA,EAACC;AAAA,EAAA;AAAA,IACC,gBAAe;AAAA,IACf,WAAW;AAAA,IACX,aAAY;AAAA,IACZ,UAAU;AAAA,IACV,OAAO;AAAA,IACP,UAAU;AAAA,IACV,cAAa;AAAA,IACb,aAAY;AAAA,IAEZ,UAAA;AAAA,MAAC,gBAAAC,EAAAC,GAAA,EAAM,KAAKC,EAAc,YAAa,CAAA;AAAA,wBACtCC,GAAK,EAAA,WAAU,OAAM,QAAO,cAAa,UAE1C,eAAA;AAAA,IAAA;AAAA,EAAA;AAAA;AAKNN,EAAW,cAAc;AAEzB,MAAeO,IAAAC,EAAKR,CAAU;"}
|
|
@@ -3,19 +3,19 @@ import a from "../../../assets/line-icons/icons/check2.js";
|
|
|
3
3
|
import m from "../../../assets/line-icons/icons/cross.js";
|
|
4
4
|
import n from "../../../assets/line-icons/icons/status.js";
|
|
5
5
|
import { CARD_TYPE as e, NODE_STATE as o } from "../daily-timeline-types.js";
|
|
6
|
-
import { formatDate as
|
|
7
|
-
const
|
|
6
|
+
import { formatDate as C } from "../../../node_modules/date-fns/format.js";
|
|
7
|
+
const i = (t) => {
|
|
8
8
|
switch (t) {
|
|
9
9
|
case o.COMPLETED:
|
|
10
|
-
return [a, "
|
|
10
|
+
return [a, "BLACK_1", "WHITE"];
|
|
11
11
|
case o.IN_PROGRESS:
|
|
12
|
-
return [n, "
|
|
12
|
+
return [n, "BLACK_1", "WHITE"];
|
|
13
13
|
case o.PENDING:
|
|
14
|
-
return [m, "
|
|
14
|
+
return [m, "WHITE", "BLACK_1"];
|
|
15
15
|
default:
|
|
16
16
|
return [n, "GREY_2"];
|
|
17
17
|
}
|
|
18
|
-
},
|
|
18
|
+
}, T = (t) => {
|
|
19
19
|
switch (t) {
|
|
20
20
|
case e.CW:
|
|
21
21
|
return r.CW_ICON;
|
|
@@ -30,11 +30,11 @@ const N = (t) => {
|
|
|
30
30
|
day: t.getDate(),
|
|
31
31
|
month: t.getMonth() + 1,
|
|
32
32
|
year: t.getFullYear(),
|
|
33
|
-
monthName:
|
|
33
|
+
monthName: C(t, "MMM")
|
|
34
34
|
});
|
|
35
35
|
export {
|
|
36
36
|
_ as getDayMonthYear,
|
|
37
|
-
|
|
38
|
-
|
|
37
|
+
i as getStateConf,
|
|
38
|
+
T as getTimelineCardIcon
|
|
39
39
|
};
|
|
40
40
|
//# sourceMappingURL=utils.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sources":["../../../../src/features/timeline/comps/utils.ts"],"sourcesContent":["import { format } from 'date-fns';\n\nimport { ILLUSTRATIONS } from '../../../assets/illustrations/illustrations';\nimport Check2Icon from '../../../assets/line-icons/icons/check2';\nimport CrossIcon from '../../../assets/line-icons/icons/cross';\nimport StatusIcon from '../../../assets/line-icons/icons/status';\nimport { CARD_TYPE, NODE_STATE } from '../daily-timeline-types';\n\nexport const getStateConf = (state: NODE_STATE) => {\n switch (state) {\n case NODE_STATE.COMPLETED:\n return [Check2Icon, '
|
|
1
|
+
{"version":3,"file":"utils.js","sources":["../../../../src/features/timeline/comps/utils.ts"],"sourcesContent":["import { format } from 'date-fns';\n\nimport { ILLUSTRATIONS } from '../../../assets/illustrations/illustrations';\nimport Check2Icon from '../../../assets/line-icons/icons/check2';\nimport CrossIcon from '../../../assets/line-icons/icons/cross';\nimport StatusIcon from '../../../assets/line-icons/icons/status';\nimport { CARD_TYPE, NODE_STATE } from '../daily-timeline-types';\n\nexport const getStateConf = (state: NODE_STATE) => {\n switch (state) {\n case NODE_STATE.COMPLETED:\n return [Check2Icon, 'BLACK_1', 'WHITE'];\n case NODE_STATE.IN_PROGRESS:\n return [StatusIcon, 'BLACK_1', 'WHITE'];\n case NODE_STATE.PENDING:\n return [CrossIcon, 'WHITE', 'BLACK_1'];\n default:\n return [StatusIcon, 'GREY_2'];\n }\n};\n\nexport const getTimelineCardIcon = (type: CARD_TYPE) => {\n switch (type) {\n case CARD_TYPE.CW:\n return ILLUSTRATIONS.CW_ICON;\n case CARD_TYPE.HW:\n return ILLUSTRATIONS.HW_ICON;\n case CARD_TYPE.CIRCLE:\n return ILLUSTRATIONS.CIRCLE_ICON;\n default:\n return null;\n }\n};\n\nexport const getDayMonthYear = (dateObj: Date) => ({\n day: dateObj.getDate(),\n month: dateObj.getMonth() + 1,\n year: dateObj.getFullYear(),\n monthName: format(dateObj, 'MMM'),\n});\n"],"names":["getStateConf","state","NODE_STATE","Check2Icon","StatusIcon","CrossIcon","getTimelineCardIcon","type","CARD_TYPE","ILLUSTRATIONS","getDayMonthYear","dateObj","format"],"mappings":";;;;;;AAQa,MAAAA,IAAe,CAACC,MAAsB;AACjD,UAAQA,GAAO;AAAA,IACb,KAAKC,EAAW;AACP,aAAA,CAACC,GAAY,WAAW,OAAO;AAAA,IACxC,KAAKD,EAAW;AACP,aAAA,CAACE,GAAY,WAAW,OAAO;AAAA,IACxC,KAAKF,EAAW;AACP,aAAA,CAACG,GAAW,SAAS,SAAS;AAAA,IACvC;AACS,aAAA,CAACD,GAAY,QAAQ;AAAA,EAChC;AACF,GAEaE,IAAsB,CAACC,MAAoB;AACtD,UAAQA,GAAM;AAAA,IACZ,KAAKC,EAAU;AACb,aAAOC,EAAc;AAAA,IACvB,KAAKD,EAAU;AACb,aAAOC,EAAc;AAAA,IACvB,KAAKD,EAAU;AACb,aAAOC,EAAc;AAAA,IACvB;AACS,aAAA;AAAA,EACX;AACF,GAEaC,IAAkB,CAACC,OAAmB;AAAA,EACjD,KAAKA,EAAQ,QAAQ;AAAA,EACrB,OAAOA,EAAQ,SAAA,IAAa;AAAA,EAC5B,MAAMA,EAAQ,YAAY;AAAA,EAC1B,WAAWC,EAAOD,GAAS,KAAK;AAClC;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"daily-timeline-types.js","sources":["../../../src/features/timeline/daily-timeline-types.ts"],"sourcesContent":["import { type TCourseStream } from '../milestone/create/milestone-create-types';\nimport { 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}\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?: (
|
|
1
|
+
{"version":3,"file":"daily-timeline-types.js","sources":["../../../src/features/timeline/daily-timeline-types.ts"],"sourcesContent":["import { type TCourseStream } from '../milestone/create/milestone-create-types';\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}\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,eAJJA,IAAAA,KAAA,CAAA,CAAA,GAOAC,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,34 +1,34 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { useState as
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import { useResumeTrialWorksheet as
|
|
6
|
-
import { useTrialSessionContext as
|
|
7
|
-
const
|
|
8
|
-
const { isTeacher: o, studentId: r, worksheet: s, formData:
|
|
9
|
-
if (
|
|
1
|
+
import { jsx as f } from "react/jsx-runtime";
|
|
2
|
+
import { useState as u, useCallback as D, useEffect as E } from "react";
|
|
3
|
+
import N from "../../../ui/error/error.js";
|
|
4
|
+
import W from "../../../ui/loader/app-loader/app-loader.js";
|
|
5
|
+
import { useResumeTrialWorksheet as b } from "../../api/trial-nodes.js";
|
|
6
|
+
import { useTrialSessionContext as j } from "../../context/use-trial-session-context.js";
|
|
7
|
+
const q = () => {
|
|
8
|
+
const { isTeacher: o, studentId: r, worksheet: s, formData: p, updateSlideConfig: l, trialHomeData: h } = j(), [_, n] = u(!1), [g, y] = u(!1), { resetAttempt: e } = p || {}, { demo_info: I } = h, { region_data: C, course: i } = I || {}, { opportunity_country: a = "US" } = C || {}, P = (S, m) => {
|
|
9
|
+
if (S && n(!0), m) {
|
|
10
10
|
const {
|
|
11
|
-
user_node_id:
|
|
12
|
-
node_id:
|
|
13
|
-
user_attempt_id:
|
|
14
|
-
node_type:
|
|
11
|
+
user_node_id: T,
|
|
12
|
+
node_id: k,
|
|
13
|
+
user_attempt_id: A,
|
|
14
|
+
node_type: x
|
|
15
15
|
} = m;
|
|
16
|
-
|
|
16
|
+
y(!0), l({ userNodeId: T, nodeId: k, attemptId: A, nodeType: x, resetAttempt: !1 });
|
|
17
17
|
}
|
|
18
|
-
}, { patch:
|
|
19
|
-
onComplete:
|
|
20
|
-
}), t =
|
|
21
|
-
o && (n(!1),
|
|
18
|
+
}, { patch: c, isProcessing: d } = b({
|
|
19
|
+
onComplete: P
|
|
20
|
+
}), t = D(() => {
|
|
21
|
+
o && !d && !g && (n(!1), c(
|
|
22
22
|
r,
|
|
23
23
|
{ country_code: a, course: i },
|
|
24
24
|
{ reset_attempt: e === void 0 || e }
|
|
25
25
|
));
|
|
26
|
-
}, [a, i, o,
|
|
27
|
-
return
|
|
26
|
+
}, [a, i, o, c, r, e]);
|
|
27
|
+
return E(() => {
|
|
28
28
|
t();
|
|
29
|
-
}, [t]),
|
|
29
|
+
}, [t]), _ ? /* @__PURE__ */ f(N, { height: "100%", onTryAgain: t }) : d || !s ? /* @__PURE__ */ f(W, { height: "100%" }) : s;
|
|
30
30
|
};
|
|
31
31
|
export {
|
|
32
|
-
|
|
32
|
+
q as default
|
|
33
33
|
};
|
|
34
34
|
//# sourceMappingURL=worksheet.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"worksheet.js","sources":["../../../../../src/features/trial-session/comps/worksheet/worksheet.tsx"],"sourcesContent":["import { useCallback, useEffect, useState, type FC } from 'react';\n\nimport type { IResumeWorksheetModel } from '../../../../types/models/worksheet';\nimport Error from '../../../ui/error/error';\nimport AppLoader from '../../../ui/loader/app-loader/app-loader';\nimport { useResumeTrialWorksheet } from '../../api/trial-nodes';\nimport { useTrialSessionContext } from '../../context/use-trial-session-context';\n\nconst SessionWorksheet: FC = () => {\n const { isTeacher, studentId, worksheet, formData, updateSlideConfig, trialHomeData } =\n useTrialSessionContext();\n const [isError, setIserror] = useState<boolean>(false);\n\n const { resetAttempt } = formData || {};\n const { demo_info: demoInfo } = trialHomeData;\n const { region_data: regionData, course } = demoInfo || {};\n const { opportunity_country: countryCode = 'US' } = regionData || {};\n\n const onComplete = (error: string | null, sheetData?: IResumeWorksheetModel) => {\n if (error) {\n setIserror(true);\n }\n\n if (sheetData) {\n const {\n user_node_id: userNodeId,\n node_id: nodeId,\n user_attempt_id: attemptId,\n node_type: nodeType,\n } = sheetData;\n\n updateSlideConfig({ userNodeId, nodeId, attemptId, nodeType, resetAttempt: false });\n }\n };\n\n const { patch: resumeNode, isProcessing } = useResumeTrialWorksheet({\n onComplete,\n });\n\n const fetchData = useCallback(() => {\n if (isTeacher) {\n setIserror(false);\n resumeNode(\n studentId,\n { country_code: countryCode, course },\n { reset_attempt: resetAttempt === undefined || resetAttempt },\n );\n }\n }, [countryCode, course, isTeacher, resumeNode, studentId, resetAttempt]);\n\n useEffect(() => {\n fetchData();\n }, [fetchData]);\n\n if (isError) {\n return <Error height=\"100%\" onTryAgain={fetchData} />;\n }\n\n if (isProcessing || !worksheet) {\n return <AppLoader height=\"100%\" />;\n }\n\n return worksheet;\n};\n\nexport default SessionWorksheet;\n"],"names":["SessionWorksheet","isTeacher","studentId","worksheet","formData","updateSlideConfig","trialHomeData","useTrialSessionContext","isError","setIserror","useState","resetAttempt","demoInfo","regionData","course","countryCode","onComplete","error","sheetData","userNodeId","nodeId","attemptId","nodeType","resumeNode","isProcessing","useResumeTrialWorksheet","fetchData","useCallback","useEffect","jsx","Error","AppLoader"],"mappings":";;;;;;AAQA,MAAMA,IAAuB,MAAM;AAC3B,QAAA,EAAE,WAAAC,GAAW,WAAAC,GAAW,WAAAC,GAAW,UAAAC,GAAU,mBAAAC,GAAmB,eAAAC,MACpEC,KACI,CAACC,GAASC,CAAU,IAAIC,EAAkB,EAAK,
|
|
1
|
+
{"version":3,"file":"worksheet.js","sources":["../../../../../src/features/trial-session/comps/worksheet/worksheet.tsx"],"sourcesContent":["import { useCallback, useEffect, useState, type FC } from 'react';\n\nimport type { IResumeWorksheetModel } from '../../../../types/models/worksheet';\nimport Error from '../../../ui/error/error';\nimport AppLoader from '../../../ui/loader/app-loader/app-loader';\nimport { useResumeTrialWorksheet } from '../../api/trial-nodes';\nimport { useTrialSessionContext } from '../../context/use-trial-session-context';\n\nconst SessionWorksheet: FC = () => {\n const { isTeacher, studentId, worksheet, formData, updateSlideConfig, trialHomeData } =\n useTrialSessionContext();\n const [isError, setIserror] = useState<boolean>(false);\n const [isPatchProcessed, setIsPatchProcessed] = useState(false);\n\n const { resetAttempt } = formData || {};\n const { demo_info: demoInfo } = trialHomeData;\n const { region_data: regionData, course } = demoInfo || {};\n const { opportunity_country: countryCode = 'US' } = regionData || {};\n\n const onComplete = (error: string | null, sheetData?: IResumeWorksheetModel) => {\n if (error) {\n setIserror(true);\n }\n\n if (sheetData) {\n const {\n user_node_id: userNodeId,\n node_id: nodeId,\n user_attempt_id: attemptId,\n node_type: nodeType,\n } = sheetData;\n\n setIsPatchProcessed(true);\n updateSlideConfig({ userNodeId, nodeId, attemptId, nodeType, resetAttempt: false });\n }\n };\n\n const { patch: resumeNode, isProcessing } = useResumeTrialWorksheet({\n onComplete,\n });\n\n const fetchData = useCallback(() => {\n if (isTeacher && !isProcessing && !isPatchProcessed) {\n setIserror(false);\n resumeNode(\n studentId,\n { country_code: countryCode, course },\n { reset_attempt: resetAttempt === undefined || resetAttempt },\n );\n }\n }, [countryCode, course, isTeacher, resumeNode, studentId, resetAttempt]);\n\n useEffect(() => {\n fetchData();\n }, [fetchData]);\n\n if (isError) {\n return <Error height=\"100%\" onTryAgain={fetchData} />;\n }\n\n if (isProcessing || !worksheet) {\n return <AppLoader height=\"100%\" />;\n }\n\n return worksheet;\n};\n\nexport default SessionWorksheet;\n"],"names":["SessionWorksheet","isTeacher","studentId","worksheet","formData","updateSlideConfig","trialHomeData","useTrialSessionContext","isError","setIserror","useState","isPatchProcessed","setIsPatchProcessed","resetAttempt","demoInfo","regionData","course","countryCode","onComplete","error","sheetData","userNodeId","nodeId","attemptId","nodeType","resumeNode","isProcessing","useResumeTrialWorksheet","fetchData","useCallback","useEffect","jsx","Error","AppLoader"],"mappings":";;;;;;AAQA,MAAMA,IAAuB,MAAM;AAC3B,QAAA,EAAE,WAAAC,GAAW,WAAAC,GAAW,WAAAC,GAAW,UAAAC,GAAU,mBAAAC,GAAmB,eAAAC,MACpEC,KACI,CAACC,GAASC,CAAU,IAAIC,EAAkB,EAAK,GAC/C,CAACC,GAAkBC,CAAmB,IAAIF,EAAS,EAAK,GAExD,EAAE,cAAAG,EAAA,IAAiBT,KAAY,IAC/B,EAAE,WAAWU,EAAa,IAAAR,GAC1B,EAAE,aAAaS,GAAY,QAAAC,EAAO,IAAIF,KAAY,CAAA,GAClD,EAAE,qBAAqBG,IAAc,KAAK,IAAIF,KAAc,CAAA,GAE5DG,IAAa,CAACC,GAAsBC,MAAsC;AAK9E,QAJID,KACFV,EAAW,EAAI,GAGbW,GAAW;AACP,YAAA;AAAA,QACJ,cAAcC;AAAA,QACd,SAASC;AAAA,QACT,iBAAiBC;AAAA,QACjB,WAAWC;AAAA,MACT,IAAAJ;AAEJ,MAAAR,EAAoB,EAAI,GACxBP,EAAkB,EAAE,YAAAgB,GAAY,QAAAC,GAAQ,WAAAC,GAAW,UAAAC,GAAU,cAAc,IAAO;AAAA,IACpF;AAAA,EAAA,GAGI,EAAE,OAAOC,GAAY,cAAAC,EAAA,IAAiBC,EAAwB;AAAA,IAClE,YAAAT;AAAA,EAAA,CACD,GAEKU,IAAYC,EAAY,MAAM;AAClC,IAAI5B,KAAa,CAACyB,KAAgB,CAACf,MACjCF,EAAW,EAAK,GAChBgB;AAAA,MACEvB;AAAA,MACA,EAAE,cAAce,GAAa,QAAAD,EAAO;AAAA,MACpC,EAAE,eAAeH,MAAiB,UAAaA,EAAa;AAAA,IAAA;AAAA,EAEhE,GACC,CAACI,GAAaD,GAAQf,GAAWwB,GAAYvB,GAAWW,CAAY,CAAC;AAMxE,SAJAiB,EAAU,MAAM;AACJ,IAAAF;EAAA,GACT,CAACA,CAAS,CAAC,GAEVpB,IACM,gBAAAuB,EAAAC,GAAA,EAAM,QAAO,QAAO,YAAYJ,EAAW,CAAA,IAGjDF,KAAgB,CAACvB,IACZ,gBAAA4B,EAACE,GAAU,EAAA,QAAO,OAAO,CAAA,IAG3B9B;AACT;"}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import i from "styled-components";
|
|
2
|
-
import
|
|
3
|
-
import { ClickableWrapper as
|
|
4
|
-
|
|
2
|
+
import d from "../../text/text.js";
|
|
3
|
+
import { ClickableWrapper as c } from "../clickable/clickable-styled.js";
|
|
4
|
+
import { IS_TOUCH_DEVICE as x } from "../../../../constants/app-config.js";
|
|
5
|
+
const u = i(d)(({ theme: t, $buttonSize: n }) => {
|
|
5
6
|
const { textButton: o } = t, { underlineHeight: e, underlineOffset: r } = o.sizes[n];
|
|
6
7
|
return `
|
|
7
8
|
text-decoration: underline;
|
|
@@ -9,7 +10,7 @@ const p = i(c)(({ theme: t, $buttonSize: n }) => {
|
|
|
9
10
|
text-underline-offset: ${r}px;
|
|
10
11
|
|
|
11
12
|
&:hover {
|
|
12
|
-
text-decoration: none;
|
|
13
|
+
text-decoration: ${x ? "underline" : "none"};
|
|
13
14
|
}
|
|
14
15
|
|
|
15
16
|
&:active {
|
|
@@ -17,7 +18,7 @@ const p = i(c)(({ theme: t, $buttonSize: n }) => {
|
|
|
17
18
|
text-decoration-thickness: ${e}px;
|
|
18
19
|
}
|
|
19
20
|
|
|
20
|
-
${
|
|
21
|
+
${c}[aria-disabled='true'] & {
|
|
21
22
|
text-decoration: underline;
|
|
22
23
|
text-decoration-thickness: ${e}px;
|
|
23
24
|
opacity: 0.5;
|
|
@@ -25,6 +26,6 @@ const p = i(c)(({ theme: t, $buttonSize: n }) => {
|
|
|
25
26
|
`;
|
|
26
27
|
});
|
|
27
28
|
export {
|
|
28
|
-
|
|
29
|
+
u as Text
|
|
29
30
|
};
|
|
30
31
|
//# sourceMappingURL=text-button-styled.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"text-button-styled.js","sources":["../../../../../src/features/ui/buttons/text-button/text-button-styled.tsx"],"sourcesContent":["import styled from 'styled-components';\n\nimport UIText from '../../text/text';\nimport { ClickableWrapper } from '../clickable/clickable-styled';\nimport type { ITextButtonProps } from './text-button-types';\n\ninterface IStyledTextProps {\n $buttonSize: NonNullable<ITextButtonProps['size']>;\n}\n\nconst Text = styled(UIText)<IStyledTextProps>(({ theme, $buttonSize }) => {\n const { textButton } = theme;\n const { underlineHeight, underlineOffset } = textButton.sizes[$buttonSize];\n\n return `\n text-decoration: underline;\n text-decoration-thickness: ${underlineHeight}px;\n text-underline-offset: ${underlineOffset}px;\n\n &:hover {\n text-decoration: none;\n }\n\n &:active {\n text-decoration: underline;\n text-decoration-thickness: ${underlineHeight}px;\n }\n\n ${ClickableWrapper}[aria-disabled='true'] & {\n text-decoration: underline;\n text-decoration-thickness: ${underlineHeight}px;\n opacity: 0.5;\n }\n `;\n});\n\nexport { Text };\n"],"names":["Text","styled","UIText","theme","$buttonSize","textButton","underlineHeight","underlineOffset","ClickableWrapper"],"mappings":"
|
|
1
|
+
{"version":3,"file":"text-button-styled.js","sources":["../../../../../src/features/ui/buttons/text-button/text-button-styled.tsx"],"sourcesContent":["import styled from 'styled-components';\n\nimport UIText from '../../text/text';\nimport { ClickableWrapper } from '../clickable/clickable-styled';\nimport type { ITextButtonProps } from './text-button-types';\nimport { IS_TOUCH_DEVICE } from '../../../../constants/app-config';\n\ninterface IStyledTextProps {\n $buttonSize: NonNullable<ITextButtonProps['size']>;\n}\n\nconst Text = styled(UIText)<IStyledTextProps>(({ theme, $buttonSize }) => {\n const { textButton } = theme;\n const { underlineHeight, underlineOffset } = textButton.sizes[$buttonSize];\n\n return `\n text-decoration: underline;\n text-decoration-thickness: ${underlineHeight}px;\n text-underline-offset: ${underlineOffset}px;\n\n &:hover {\n text-decoration: ${IS_TOUCH_DEVICE ? 'underline' : 'none'};\n }\n\n &:active {\n text-decoration: underline;\n text-decoration-thickness: ${underlineHeight}px;\n }\n\n ${ClickableWrapper}[aria-disabled='true'] & {\n text-decoration: underline;\n text-decoration-thickness: ${underlineHeight}px;\n opacity: 0.5;\n }\n `;\n});\n\nexport { Text };\n"],"names":["Text","styled","UIText","theme","$buttonSize","textButton","underlineHeight","underlineOffset","IS_TOUCH_DEVICE","ClickableWrapper"],"mappings":";;;;AAWM,MAAAA,IAAOC,EAAOC,CAAM,EAAoB,CAAC,EAAE,OAAAC,GAAO,aAAAC,QAAkB;AAClE,QAAA,EAAE,YAAAC,EAAe,IAAAF,GACjB,EAAE,iBAAAG,GAAiB,iBAAAC,EAAA,IAAoBF,EAAW,MAAMD,CAAW;AAElE,SAAA;AAAA;AAAA,iCAEwBE,CAAe;AAAA,6BACnBC,CAAe;AAAA;AAAA;AAAA,yBAGnBC,IAAkB,cAAc,MAAM;AAAA;AAAA;AAAA;AAAA;AAAA,mCAK5BF,CAAe;AAAA;AAAA;AAAA,MAG5CG,CAAgB;AAAA;AAAA,mCAEaH,CAAe;AAAA;AAAA;AAAA;AAIlD,CAAC;"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1569,7 +1569,7 @@ declare interface IDailyTimelineProps {
|
|
|
1569
1569
|
userType: USER_TYPE;
|
|
1570
1570
|
studentId: string;
|
|
1571
1571
|
courseStreams?: TCourseStream[];
|
|
1572
|
-
onPuzzleClick?: (
|
|
1572
|
+
onPuzzleClick?: (card: ITimeLineItem) => void;
|
|
1573
1573
|
onReviewClick?: (userNodeId: string | null, isSatMockTestBlock: boolean, userBlockId: string | null) => void;
|
|
1574
1574
|
scrollAreaHeight?: string | number;
|
|
1575
1575
|
}
|
|
@@ -4194,6 +4194,34 @@ declare interface ITimeLeftTimelineProps {
|
|
|
4194
4194
|
showRemainingTime?: boolean;
|
|
4195
4195
|
}
|
|
4196
4196
|
|
|
4197
|
+
export declare interface ITimeLineItem {
|
|
4198
|
+
accuracy: number | null;
|
|
4199
|
+
block_type: string | null;
|
|
4200
|
+
card_type?: string;
|
|
4201
|
+
chapter_name: string | null;
|
|
4202
|
+
feedback_comments: string | null;
|
|
4203
|
+
image_hue: string | null;
|
|
4204
|
+
is_timed: boolean;
|
|
4205
|
+
items: TNodeDataTestItemsDataProps[] | null;
|
|
4206
|
+
label: string;
|
|
4207
|
+
learnosity_activity_ref: string | null;
|
|
4208
|
+
max_score: number | null;
|
|
4209
|
+
node_id: string;
|
|
4210
|
+
node_type: string;
|
|
4211
|
+
points: number | null;
|
|
4212
|
+
state: NODE_STATE;
|
|
4213
|
+
subtext: string | null;
|
|
4214
|
+
task_type: string | null;
|
|
4215
|
+
time_taken: number | null;
|
|
4216
|
+
tip: string | null;
|
|
4217
|
+
title: string;
|
|
4218
|
+
total_questions: number | null;
|
|
4219
|
+
total_score: number | null;
|
|
4220
|
+
user_block_id: string | null;
|
|
4221
|
+
user_id?: string;
|
|
4222
|
+
user_node_id: string;
|
|
4223
|
+
}
|
|
4224
|
+
|
|
4197
4225
|
declare interface ITimeStampsResponseModel {
|
|
4198
4226
|
current: number;
|
|
4199
4227
|
start_timestamp: number;
|
|
@@ -6632,7 +6660,7 @@ declare type TMilestoneStates = 'ACTIVE' | 'OUTCOME_PENDING' | 'OUTCOME_ADDED' |
|
|
|
6632
6660
|
|
|
6633
6661
|
declare type TMilestoneType = 'ACTIVE' | 'INACTIVE' | 'DRAFT';
|
|
6634
6662
|
|
|
6635
|
-
declare interface TNodeDataTestItemsDataProps {
|
|
6663
|
+
export declare interface TNodeDataTestItemsDataProps {
|
|
6636
6664
|
chapter_name: string;
|
|
6637
6665
|
goal_name: string;
|
|
6638
6666
|
ref: string;
|