@cuemath/leap 3.5.54 → 3.5.55-as1
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/math-fit/math-fit-report/comps/score-section/score-section.js +63 -51
- package/dist/features/math-fit/math-fit-report/comps/score-section/score-section.js.map +1 -1
- package/dist/features/timeline/daily-timeline/comps/accordion-item/accordion-item.js +21 -21
- package/dist/features/timeline/daily-timeline/comps/accordion-item/accordion-item.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,73 +1,85 @@
|
|
|
1
1
|
import { jsxs as t, jsx as e } from "react/jsx-runtime";
|
|
2
|
-
import { memo as
|
|
3
|
-
import
|
|
2
|
+
import { memo as x, useCallback as _, Fragment as A } from "react";
|
|
3
|
+
import { useTheme as S } from "styled-components";
|
|
4
|
+
import w from "../../../../ui/buttons/button/button.js";
|
|
4
5
|
import r from "../../../../ui/layout/flex-view.js";
|
|
5
6
|
import n from "../../../../ui/text/text.js";
|
|
6
|
-
import
|
|
7
|
-
import { Divider as
|
|
8
|
-
import
|
|
9
|
-
import { getQuestionStatusBgColor as
|
|
10
|
-
import { EQuestionState as
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
7
|
+
import B from "../score-badge/score-badge.js";
|
|
8
|
+
import { Divider as E } from "./score-section-styled.js";
|
|
9
|
+
import p from "../../../../ui/separator/separator.js";
|
|
10
|
+
import { getQuestionStatusBgColor as T } from "../../math-fit-report-helpers.js";
|
|
11
|
+
import { EQuestionState as X } from "../../../math-fit-overview/math-fit-overview-types.js";
|
|
12
|
+
import { IS_APP_RUNNING_IN_RN as L } from "../../../../../constants/app-config.js";
|
|
13
|
+
import { EDeviceType as N } from "../../../../ui/theme/constants.js";
|
|
14
|
+
const W = x(function({
|
|
15
|
+
section: c,
|
|
16
|
+
sheet: s,
|
|
17
|
+
onReviewSection: l
|
|
15
18
|
}) {
|
|
16
19
|
const {
|
|
17
20
|
title: h,
|
|
18
|
-
score:
|
|
19
|
-
scoreChange:
|
|
20
|
-
sessionId:
|
|
21
|
+
score: d,
|
|
22
|
+
scoreChange: g,
|
|
23
|
+
sessionId: $,
|
|
21
24
|
isIncomplete: o = !1,
|
|
22
|
-
sectionNumber:
|
|
23
|
-
topics:
|
|
24
|
-
} =
|
|
25
|
-
!o &&
|
|
26
|
-
}, [o,
|
|
25
|
+
sectionNumber: u,
|
|
26
|
+
topics: f
|
|
27
|
+
} = c, { device: b } = S(), m = b <= N.MOBILE, I = _(() => {
|
|
28
|
+
!o && c.sheet && l && l(s, $);
|
|
29
|
+
}, [o, l, c.sheet, s, $]);
|
|
27
30
|
return /* @__PURE__ */ t(r, { children: [
|
|
28
31
|
/* @__PURE__ */ t(r, { $flexDirection: "row", $alignItems: "center", children: [
|
|
29
32
|
/* @__PURE__ */ t(n, { $renderAs: "ab2-bold", $color: "BLACK_1", children: [
|
|
30
33
|
h,
|
|
31
34
|
":"
|
|
32
35
|
] }),
|
|
33
|
-
/* @__PURE__ */ e(
|
|
34
|
-
o ? /* @__PURE__ */ e(r, { $gutter: 3, $gap: 2.5, $background: "BLACK_5", children: /* @__PURE__ */ e(n, { $renderAs: "ab4-bold", $color: "WHITE", children: "INCOMPLETE" }) }) :
|
|
36
|
+
/* @__PURE__ */ e(p, { width: 4 }),
|
|
37
|
+
o ? /* @__PURE__ */ e(r, { $gutter: 3, $gap: 2.5, $background: "BLACK_5", children: /* @__PURE__ */ e(n, { $renderAs: "ab4-bold", $color: "WHITE", children: "INCOMPLETE" }) }) : d && /* @__PURE__ */ e(B, { score: d, maxScore: 10, scoreChange: g })
|
|
35
38
|
] }),
|
|
36
|
-
/* @__PURE__ */ e(r, { $flexRowGapX: 0.5, $gapX: 0.75, children:
|
|
37
|
-
/* @__PURE__ */ t(
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
$
|
|
46
|
-
$
|
|
47
|
-
|
|
48
|
-
children: /* @__PURE__ */ e(
|
|
49
|
-
n,
|
|
39
|
+
/* @__PURE__ */ e(r, { $flexRowGapX: 0.5, $gapX: 0.75, children: f.map((a, C) => /* @__PURE__ */ t(A, { children: [
|
|
40
|
+
/* @__PURE__ */ t(
|
|
41
|
+
r,
|
|
42
|
+
{
|
|
43
|
+
$flexDirection: m ? "column" : "row",
|
|
44
|
+
$justifyContent: "space-between",
|
|
45
|
+
$alignItems: m ? "" : "center",
|
|
46
|
+
$flexRowGapX: m ? 0.5 : 0,
|
|
47
|
+
children: [
|
|
48
|
+
/* @__PURE__ */ e(n, { $renderAs: "ub2", $color: o ? "BLACK_T_38" : "BLACK_1", children: a.name }),
|
|
49
|
+
/* @__PURE__ */ e(r, { $flexGapX: 0.5, $flexDirection: "row", children: a.miniGoal.items.map((i) => /* @__PURE__ */ e(
|
|
50
|
+
r,
|
|
50
51
|
{
|
|
51
|
-
$
|
|
52
|
-
$
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
52
|
+
$widthX: 1.25,
|
|
53
|
+
$heightX: 1.25,
|
|
54
|
+
$alignItems: "center",
|
|
55
|
+
$justifyContent: "center",
|
|
56
|
+
$borderRadiusX: 2,
|
|
57
|
+
$background: T(i.state),
|
|
58
|
+
children: /* @__PURE__ */ e(
|
|
59
|
+
n,
|
|
60
|
+
{
|
|
61
|
+
$renderAs: "ub3",
|
|
62
|
+
$color: i.state === X.SKIPPED ? "BLACK_T_38" : "WHITE",
|
|
63
|
+
children: i.order
|
|
64
|
+
}
|
|
65
|
+
)
|
|
66
|
+
},
|
|
67
|
+
i.item_reference
|
|
68
|
+
)) })
|
|
69
|
+
]
|
|
70
|
+
}
|
|
71
|
+
),
|
|
72
|
+
C !== f.length - 1 && /* @__PURE__ */ e(E, {})
|
|
61
73
|
] }, a.name)) }),
|
|
62
|
-
/* @__PURE__ */ t(r, { $alignItems: "center", children: [
|
|
63
|
-
/* @__PURE__ */ e(
|
|
74
|
+
!L && /* @__PURE__ */ t(r, { $alignItems: "center", children: [
|
|
75
|
+
/* @__PURE__ */ e(p, { heightX: 0.75 }),
|
|
64
76
|
/* @__PURE__ */ e(
|
|
65
|
-
|
|
77
|
+
w,
|
|
66
78
|
{
|
|
67
|
-
label: `Review Section ${
|
|
79
|
+
label: `Review Section ${u}`,
|
|
68
80
|
renderAs: o ? "secondary" : "primary",
|
|
69
81
|
size: "small",
|
|
70
|
-
onClick:
|
|
82
|
+
onClick: I,
|
|
71
83
|
disabled: o
|
|
72
84
|
}
|
|
73
85
|
)
|
|
@@ -75,6 +87,6 @@ const F = C(function({
|
|
|
75
87
|
] });
|
|
76
88
|
});
|
|
77
89
|
export {
|
|
78
|
-
|
|
90
|
+
W as default
|
|
79
91
|
};
|
|
80
92
|
//# sourceMappingURL=score-section.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"score-section.js","sources":["../../../../../../src/features/math-fit/math-fit-report/comps/score-section/score-section.tsx"],"sourcesContent":["import { Fragment, memo, useCallback, type FC } from 'react';\n\nimport Button from '../../../../ui/buttons/button/button';\nimport FlexView from '../../../../ui/layout/flex-view';\nimport Text from '../../../../ui/text/text';\nimport ScoreBadge from '../score-badge/score-badge';\nimport type { IScoreSectionProps } from './score-section-types';\nimport * as Styled from './score-section-styled';\nimport Separator from '../../../../ui/separator/separator';\nimport { getQuestionStatusBgColor } from '../../math-fit-report-helpers';\nimport { EQuestionState } from '../../../math-fit-overview/math-fit-overview-types';\n\nconst ScoreSection: FC<IScoreSectionProps> = memo(function ScoreSection({\n section,\n sheet,\n onReviewSection,\n}) {\n const {\n title,\n score,\n scoreChange,\n sessionId,\n isIncomplete = false,\n sectionNumber,\n topics,\n } = section;\n const onClickReview = useCallback(() => {\n if (!isIncomplete && section.sheet && onReviewSection) {\n onReviewSection(sheet, sessionId);\n }\n }, [isIncomplete, onReviewSection, section.sheet, sheet, sessionId]);\n\n return (\n <FlexView>\n <FlexView $flexDirection=\"row\" $alignItems=\"center\">\n <Text $renderAs=\"ab2-bold\" $color=\"BLACK_1\">\n {title}:\n </Text>\n <Separator width={4} />\n {isIncomplete ? (\n <FlexView $gutter={3} $gap={2.5} $background=\"BLACK_5\">\n <Text $renderAs=\"ab4-bold\" $color=\"WHITE\">\n INCOMPLETE\n </Text>\n </FlexView>\n ) : (\n score && <ScoreBadge score={score} maxScore={10} scoreChange={scoreChange} />\n )}\n </FlexView>\n <FlexView $flexRowGapX={0.5} $gapX={0.75}>\n {topics.map((topic, index) => (\n <Fragment key={topic.name}>\n <FlexView
|
|
1
|
+
{"version":3,"file":"score-section.js","sources":["../../../../../../src/features/math-fit/math-fit-report/comps/score-section/score-section.tsx"],"sourcesContent":["import { Fragment, memo, useCallback, type FC } from 'react';\nimport { useTheme } from 'styled-components';\n\nimport Button from '../../../../ui/buttons/button/button';\nimport FlexView from '../../../../ui/layout/flex-view';\nimport Text from '../../../../ui/text/text';\nimport ScoreBadge from '../score-badge/score-badge';\nimport type { IScoreSectionProps } from './score-section-types';\nimport * as Styled from './score-section-styled';\nimport Separator from '../../../../ui/separator/separator';\nimport { getQuestionStatusBgColor } from '../../math-fit-report-helpers';\nimport { EQuestionState } from '../../../math-fit-overview/math-fit-overview-types';\nimport { IS_APP_RUNNING_IN_RN } from '../../../../../constants/app-config';\nimport { EDeviceType } from '../../../../ui/theme/constants';\n\nconst ScoreSection: FC<IScoreSectionProps> = memo(function ScoreSection({\n section,\n sheet,\n onReviewSection,\n}) {\n const {\n title,\n score,\n scoreChange,\n sessionId,\n isIncomplete = false,\n sectionNumber,\n topics,\n } = section;\n const { device } = useTheme();\n const isMobile = device <= EDeviceType.MOBILE;\n const onClickReview = useCallback(() => {\n if (!isIncomplete && section.sheet && onReviewSection) {\n onReviewSection(sheet, sessionId);\n }\n }, [isIncomplete, onReviewSection, section.sheet, sheet, sessionId]);\n\n return (\n <FlexView>\n <FlexView $flexDirection=\"row\" $alignItems=\"center\">\n <Text $renderAs=\"ab2-bold\" $color=\"BLACK_1\">\n {title}:\n </Text>\n <Separator width={4} />\n {isIncomplete ? (\n <FlexView $gutter={3} $gap={2.5} $background=\"BLACK_5\">\n <Text $renderAs=\"ab4-bold\" $color=\"WHITE\">\n INCOMPLETE\n </Text>\n </FlexView>\n ) : (\n score && <ScoreBadge score={score} maxScore={10} scoreChange={scoreChange} />\n )}\n </FlexView>\n <FlexView $flexRowGapX={0.5} $gapX={0.75}>\n {topics.map((topic, index) => (\n <Fragment key={topic.name}>\n <FlexView\n $flexDirection={isMobile ? 'column' : 'row'}\n $justifyContent=\"space-between\"\n $alignItems={isMobile ? '' : 'center'}\n $flexRowGapX={isMobile ? 0.5 : 0}\n >\n <Text $renderAs=\"ub2\" $color={isIncomplete ? 'BLACK_T_38' : 'BLACK_1'}>\n {topic.name}\n </Text>\n <FlexView $flexGapX={0.5} $flexDirection=\"row\">\n {topic.miniGoal.items.map(question => (\n <FlexView\n key={question.item_reference}\n $widthX={1.25}\n $heightX={1.25}\n $alignItems=\"center\"\n $justifyContent=\"center\"\n $borderRadiusX={2}\n $background={getQuestionStatusBgColor(question.state)}\n >\n <Text\n $renderAs=\"ub3\"\n $color={question.state === EQuestionState.SKIPPED ? 'BLACK_T_38' : 'WHITE'}\n >\n {question.order}\n </Text>\n </FlexView>\n ))}\n </FlexView>\n </FlexView>\n {index !== topics.length - 1 && <Styled.Divider />}\n </Fragment>\n ))}\n </FlexView>\n {!IS_APP_RUNNING_IN_RN && (\n <FlexView $alignItems=\"center\">\n <Separator heightX={0.75} />\n <Button\n label={`Review Section ${sectionNumber}`}\n renderAs={isIncomplete ? 'secondary' : 'primary'}\n size=\"small\"\n onClick={onClickReview}\n disabled={isIncomplete}\n />\n </FlexView>\n )}\n </FlexView>\n );\n});\n\nexport default ScoreSection;\n"],"names":["ScoreSection","memo","section","sheet","onReviewSection","title","score","scoreChange","sessionId","isIncomplete","sectionNumber","topics","device","useTheme","isMobile","EDeviceType","onClickReview","useCallback","FlexView","jsxs","Text","jsx","Separator","ScoreBadge","topic","index","Fragment","question","getQuestionStatusBgColor","EQuestionState","Styled.Divider","IS_APP_RUNNING_IN_RN","Button"],"mappings":";;;;;;;;;;;;;AAeM,MAAAA,IAAuCC,EAAK,SAAsB;AAAA,EACtE,SAAAC;AAAA,EACA,OAAAC;AAAA,EACA,iBAAAC;AACF,GAAG;AACK,QAAA;AAAA,IACJ,OAAAC;AAAA,IACA,OAAAC;AAAA,IACA,aAAAC;AAAA,IACA,WAAAC;AAAA,IACA,cAAAC,IAAe;AAAA,IACf,eAAAC;AAAA,IACA,QAAAC;AAAA,EACE,IAAAT,GACE,EAAE,QAAAU,MAAWC,KACbC,IAAWF,KAAUG,EAAY,QACjCC,IAAgBC,EAAY,MAAM;AACtC,IAAI,CAACR,KAAgBP,EAAQ,SAASE,KACpCA,EAAgBD,GAAOK,CAAS;AAAA,EAClC,GACC,CAACC,GAAcL,GAAiBF,EAAQ,OAAOC,GAAOK,CAAS,CAAC;AAEnE,2BACGU,GACC,EAAA,UAAA;AAAA,IAAA,gBAAAC,EAACD,GAAS,EAAA,gBAAe,OAAM,aAAY,UACzC,UAAA;AAAA,MAAA,gBAAAC,EAACC,GAAK,EAAA,WAAU,YAAW,QAAO,WAC/B,UAAA;AAAA,QAAAf;AAAA,QAAM;AAAA,MAAA,GACT;AAAA,MACA,gBAAAgB,EAACC,GAAU,EAAA,OAAO,EAAG,CAAA;AAAA,MACpBb,IACE,gBAAAY,EAAAH,GAAA,EAAS,SAAS,GAAG,MAAM,KAAK,aAAY,WAC3C,UAAA,gBAAAG,EAACD,GAAK,EAAA,WAAU,YAAW,QAAO,SAAQ,UAE1C,aAAA,CAAA,EACF,CAAA,IAEAd,uBAAUiB,GAAW,EAAA,OAAAjB,GAAc,UAAU,IAAI,aAAAC,EAA0B,CAAA;AAAA,IAAA,GAE/E;AAAA,IACC,gBAAAc,EAAAH,GAAA,EAAS,cAAc,KAAK,OAAO,MACj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,IAAe,cAAc;AAAA,UACvC,MAAK;AAAA,UACL,SAASO;AAAA,UACT,UAAUP;AAAA,QAAA;AAAA,MACZ;AAAA,IAAA,GACF;AAAA,EAEJ,EAAA,CAAA;AAEJ,CAAC;"}
|
|
@@ -1,33 +1,33 @@
|
|
|
1
|
-
import { jsxs as t, jsx as
|
|
2
|
-
import { memo as M, useMemo as O, useCallback as
|
|
3
|
-
import
|
|
1
|
+
import { jsxs as t, jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import { memo as M, useMemo as O, useCallback as C } from "react";
|
|
3
|
+
import p from "../../../../ui/buttons/text-button/text-button.js";
|
|
4
4
|
import i from "../../../../ui/layout/flex-view.js";
|
|
5
5
|
import s from "../../../../ui/text/text.js";
|
|
6
6
|
import { getStateConf as P } from "../utils.js";
|
|
7
7
|
import { BLOCK_TYPE as U } from "../../../../chapters-v2/constants/block-constants.js";
|
|
8
|
-
import { NODE_STATE as G, CARD_TYPE as
|
|
8
|
+
import { NODE_STATE as G, CARD_TYPE as b, USER_TYPE as d } from "../../daily-timeline-types.js";
|
|
9
9
|
import { NODE_TYPES as H } from "../../../../../types/models/worksheet.js";
|
|
10
|
-
import { IS_APP_RUNNING_IN_RN as
|
|
10
|
+
import { IS_APP_RUNNING_IN_RN as T } from "../../../../../constants/app-config.js";
|
|
11
11
|
const X = M(
|
|
12
|
-
({ type:
|
|
12
|
+
({ type: u, userType: r, card: c, onPuzzleClick: l, onReviewClick: _ }) => {
|
|
13
13
|
const {
|
|
14
14
|
label: x,
|
|
15
15
|
title: I,
|
|
16
|
-
state:
|
|
16
|
+
state: h,
|
|
17
17
|
subtext: a,
|
|
18
18
|
user_node_id: m,
|
|
19
19
|
block_type: N,
|
|
20
|
-
user_block_id:
|
|
20
|
+
user_block_id: A,
|
|
21
21
|
node_type: R,
|
|
22
22
|
card_type: w,
|
|
23
|
-
mathfit_test_id:
|
|
24
|
-
} = c, n = N === U.SAT_MOCK_TEST, B = R === H.PUZZLE_CARD, [
|
|
23
|
+
mathfit_test_id: E
|
|
24
|
+
} = c, n = N === U.SAT_MOCK_TEST, B = R === H.PUZZLE_CARD, [$, L, S] = P(h), e = h === G.COMPLETED, f = w === b.MATHFIT_NODE, D = O(() => f && T && e ? !0 : u === b.CIRCLE || T ? !1 : r === d.TEACHER ? f && !e ? !1 : !n || e : r === d.STUDENT ? e : !1, [u, r, e, f, n]), K = e && (r === d.STUDENT || T) || r === d.TEACHER, g = C(() => {
|
|
25
25
|
l == null || l(c);
|
|
26
|
-
}, [l, c]), k =
|
|
27
|
-
_ && m && _(m, n,
|
|
28
|
-
}, [
|
|
26
|
+
}, [l, c]), k = C(() => {
|
|
27
|
+
_ && m && _(m, n, A, E);
|
|
28
|
+
}, [E, n, _, A, m]);
|
|
29
29
|
return /* @__PURE__ */ t(i, { $flexDirection: "row", $flexGapX: 1.5, children: [
|
|
30
|
-
/* @__PURE__ */
|
|
30
|
+
/* @__PURE__ */ o(i, { $justifyContent: "flex-end", $height: 18, $background: "WHITE", children: /* @__PURE__ */ o(i, { $background: L, $borderColor: "BLACK_1", $borderRadiusX: 0.8, children: $ && /* @__PURE__ */ o($, { width: 14, height: 14, color: S }) }) }),
|
|
31
31
|
/* @__PURE__ */ t(i, { $flexRowGapX: 0.25, children: [
|
|
32
32
|
/* @__PURE__ */ t(s, { $renderAs: "ub2", $color: "BLACK_1", children: [
|
|
33
33
|
/* @__PURE__ */ t(s, { $renderAs: "ub2-bold", $inline: !0, $color: "BLACK_1", children: [
|
|
@@ -37,18 +37,18 @@ const X = M(
|
|
|
37
37
|
" ",
|
|
38
38
|
I
|
|
39
39
|
] }),
|
|
40
|
-
B ? K ? /* @__PURE__ */
|
|
41
|
-
|
|
40
|
+
B ? K ? /* @__PURE__ */ o(
|
|
41
|
+
p,
|
|
42
42
|
{
|
|
43
|
-
label:
|
|
43
|
+
label: e ? "View reviewed puzzle" : "View assigned puzzle",
|
|
44
44
|
size: "small",
|
|
45
45
|
color: "BLACK_T_60",
|
|
46
46
|
onClick: g
|
|
47
47
|
}
|
|
48
|
-
) : /* @__PURE__ */
|
|
49
|
-
a && /* @__PURE__ */
|
|
50
|
-
D && /* @__PURE__ */
|
|
51
|
-
|
|
48
|
+
) : /* @__PURE__ */ o(s, { $renderAs: "ub3", $color: "BLACK_T_60", children: a }) : /* @__PURE__ */ t(i, { $flexDirection: "row", $flexGapX: 0.75, $alignItems: "center", children: [
|
|
49
|
+
a && /* @__PURE__ */ o(s, { $renderAs: "ub3", $color: "BLACK_T_60", children: a }),
|
|
50
|
+
D && /* @__PURE__ */ o(
|
|
51
|
+
p,
|
|
52
52
|
{
|
|
53
53
|
label: "Review",
|
|
54
54
|
size: "small",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"accordion-item.js","sources":["../../../../../../src/features/timeline/daily-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 { CARD_TYPE, NODE_STATE, USER_TYPE } from '../../daily-timeline-types';\nimport { NODE_TYPES } from '../../../../../types/models/worksheet';\nimport { IS_APP_RUNNING_IN_RN } from '../../../../../constants/app-config';\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_type: cardType,\n mathfit_test_id: mathfitTestId,\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 isMathFitNode = cardType === CARD_TYPE.MATHFIT_NODE;\n\n const shouldShowReview = useMemo(() => {\n if (type === CARD_TYPE.CIRCLE || IS_APP_RUNNING_IN_RN) return false;\n\n if (userType === USER_TYPE.TEACHER) {\n if (isMathFitNode && !isCompleted) return false;\n\n return !isSatMockTestBlock || isCompleted;\n }\n\n if (userType === USER_TYPE.STUDENT) return isCompleted;\n\n return false;\n }, [type, userType, isCompleted, isMathFitNode, isSatMockTestBlock]);\n\n const canReviewPuzzle =\n (isCompleted && (userType === USER_TYPE.STUDENT || IS_APP_RUNNING_IN_RN)) ||\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, mathfitTestId);\n }\n }, [mathfitTestId, 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","cardType","mathfitTestId","isSatMockTestBlock","BLOCK_TYPE","isPuzzleCard","NODE_TYPES","Icon","bgColor","color","getStateConf","isCompleted","NODE_STATE","isMathFitNode","CARD_TYPE","shouldShowReview","useMemo","IS_APP_RUNNING_IN_RN","USER_TYPE","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,MACX,WAAWC;AAAA,MACX,iBAAiBC;AAAA,IACf,IAAAZ,GACEa,IAAqBL,MAAcM,EAAW,eAC9CC,IAAeL,MAAaM,EAAW,aACvC,CAACC,GAAMC,GAASC,CAAK,IAAIC,EAAaf,CAAK,GAK3CgB,IAAchB,MAAUiB,EAAW,WACnCC,IAAgBZ,MAAaa,EAAU,cAEvCC,IAAmBC,EAAQ,
|
|
1
|
+
{"version":3,"file":"accordion-item.js","sources":["../../../../../../src/features/timeline/daily-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 { CARD_TYPE, NODE_STATE, USER_TYPE } from '../../daily-timeline-types';\nimport { NODE_TYPES } from '../../../../../types/models/worksheet';\nimport { IS_APP_RUNNING_IN_RN } from '../../../../../constants/app-config';\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_type: cardType,\n mathfit_test_id: mathfitTestId,\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 isMathFitNode = cardType === CARD_TYPE.MATHFIT_NODE;\n\n const shouldShowReview = useMemo(() => {\n if (isMathFitNode && IS_APP_RUNNING_IN_RN && isCompleted) return true;\n\n if (type === CARD_TYPE.CIRCLE || IS_APP_RUNNING_IN_RN) return false;\n\n if (userType === USER_TYPE.TEACHER) {\n if (isMathFitNode && !isCompleted) return false;\n\n return !isSatMockTestBlock || isCompleted;\n }\n\n if (userType === USER_TYPE.STUDENT) return isCompleted;\n\n return false;\n }, [type, userType, isCompleted, isMathFitNode, isSatMockTestBlock]);\n\n const canReviewPuzzle =\n (isCompleted && (userType === USER_TYPE.STUDENT || IS_APP_RUNNING_IN_RN)) ||\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, mathfitTestId);\n }\n }, [mathfitTestId, 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","cardType","mathfitTestId","isSatMockTestBlock","BLOCK_TYPE","isPuzzleCard","NODE_TYPES","Icon","bgColor","color","getStateConf","isCompleted","NODE_STATE","isMathFitNode","CARD_TYPE","shouldShowReview","useMemo","IS_APP_RUNNING_IN_RN","USER_TYPE","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,MACX,WAAWC;AAAA,MACX,iBAAiBC;AAAA,IACf,IAAAZ,GACEa,IAAqBL,MAAcM,EAAW,eAC9CC,IAAeL,MAAaM,EAAW,aACvC,CAACC,GAAMC,GAASC,CAAK,IAAIC,EAAaf,CAAK,GAK3CgB,IAAchB,MAAUiB,EAAW,WACnCC,IAAgBZ,MAAaa,EAAU,cAEvCC,IAAmBC,EAAQ,MAC3BH,KAAiBI,KAAwBN,IAAoB,KAE7DvB,MAAS0B,EAAU,UAAUG,IAA6B,KAE1D5B,MAAa6B,EAAU,UACrBL,KAAiB,CAACF,IAAoB,KAEnC,CAACR,KAAsBQ,IAG5BtB,MAAa6B,EAAU,UAAgBP,IAEpC,IACN,CAACvB,GAAMC,GAAUsB,GAAaE,GAAeV,CAAkB,CAAC,GAE7DgB,IACHR,MAAgBtB,MAAa6B,EAAU,WAAWD,MACnD5B,MAAa6B,EAAU,SAEnBE,IAAoBC,EAAY,MAAM;AAC1C,MAAA9B,KAAA,QAAAA,EAAgBD;AAAA,IAAI,GACnB,CAACC,GAAeD,CAAI,CAAC,GAElBgC,IAAoBD,EAAY,MAAM;AAC1C,MAAI7B,KAAiBK,KACLL,EAAAK,GAAYM,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