@cuemath/leap 3.5.4-as12 → 3.5.4-as13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,48 +1,48 @@
|
|
|
1
1
|
import { jsxs as o, jsx as t } from "react/jsx-runtime";
|
|
2
2
|
import { memo as k, useCallback as p } from "react";
|
|
3
3
|
import C from "../../../ui/buttons/text-button/text-button.js";
|
|
4
|
-
import
|
|
4
|
+
import i from "../../../ui/layout/flex-view.js";
|
|
5
5
|
import n from "../../../ui/text/text.js";
|
|
6
|
-
import { getStateColor as L, getStateIcon as
|
|
7
|
-
import { BLOCK_TYPE as
|
|
8
|
-
const
|
|
9
|
-
({ type:
|
|
6
|
+
import { getStateColor as L, getStateIcon as R, CODING_ACTIVITY_NODE_TYPES as S } from "../utils.js";
|
|
7
|
+
import { BLOCK_TYPE as g } from "../../../chapters-v2/constants/block-constants.js";
|
|
8
|
+
const B = k(
|
|
9
|
+
({ type: d, userType: a, card: f, onPuzzleClick: l, onReviewClick: s }) => {
|
|
10
10
|
const {
|
|
11
|
-
label:
|
|
12
|
-
title:
|
|
11
|
+
label: m,
|
|
12
|
+
title: w,
|
|
13
13
|
state: c,
|
|
14
|
-
subtext:
|
|
14
|
+
subtext: T,
|
|
15
15
|
user_node_id: e,
|
|
16
|
-
block_type:
|
|
17
|
-
user_block_id:
|
|
18
|
-
node_type:
|
|
19
|
-
} = f,
|
|
16
|
+
block_type: $,
|
|
17
|
+
user_block_id: h,
|
|
18
|
+
node_type: b
|
|
19
|
+
} = f, u = $ === g.SAT_MOCK_TEST, x = m === "PUZZLE", _ = R(c), r = c === "COMPLETED", E = a === "TEACHER" && d !== "CIRCLE" || a === "STUDENT" && r && d !== "CIRCLE" && !S.includes(b), I = p(() => {
|
|
20
20
|
e && l && l(e);
|
|
21
|
-
}, [l, e]),
|
|
22
|
-
|
|
23
|
-
}, [
|
|
24
|
-
return /* @__PURE__ */ o(
|
|
25
|
-
/* @__PURE__ */ t(
|
|
26
|
-
/* @__PURE__ */ o(
|
|
21
|
+
}, [l, e]), A = p(() => {
|
|
22
|
+
s && e && s(e, r && u, h);
|
|
23
|
+
}, [r, u, s, h, e]);
|
|
24
|
+
return /* @__PURE__ */ o(i, { $flexDirection: "row", $flexGapX: 1.5, children: [
|
|
25
|
+
/* @__PURE__ */ t(i, { $background: L(c), $borderRadiusX: 0.5, $width: 16, $height: 16, children: _ && /* @__PURE__ */ t(_, { width: 16, height: 16 }) }),
|
|
26
|
+
/* @__PURE__ */ o(i, { $flexRowGapX: 0.25, children: [
|
|
27
27
|
/* @__PURE__ */ o(n, { $renderAs: "ub3", children: [
|
|
28
28
|
/* @__PURE__ */ o(n, { $renderAs: "ub3-bold", $inline: !0, children: [
|
|
29
|
-
|
|
29
|
+
m,
|
|
30
30
|
":"
|
|
31
31
|
] }),
|
|
32
32
|
" ",
|
|
33
|
-
|
|
33
|
+
w
|
|
34
34
|
] }),
|
|
35
|
-
|
|
35
|
+
x ? /* @__PURE__ */ t(
|
|
36
36
|
C,
|
|
37
37
|
{
|
|
38
|
-
label:
|
|
38
|
+
label: r ? "View reviewed puzzle" : "View assigned puzzle",
|
|
39
39
|
size: "small",
|
|
40
40
|
color: "BLACK_T_60",
|
|
41
|
-
onClick:
|
|
41
|
+
onClick: I
|
|
42
42
|
}
|
|
43
|
-
) : /* @__PURE__ */ o(
|
|
44
|
-
|
|
45
|
-
|
|
43
|
+
) : /* @__PURE__ */ o(i, { $flexDirection: "row", $flexGapX: 0.75, $alignItems: "center", children: [
|
|
44
|
+
T && /* @__PURE__ */ t(n, { $renderAs: "ub3", $color: "BLACK_T_60", children: T }),
|
|
45
|
+
E && /* @__PURE__ */ t(
|
|
46
46
|
C,
|
|
47
47
|
{
|
|
48
48
|
label: "Review",
|
|
@@ -56,8 +56,8 @@ const z = k(
|
|
|
56
56
|
] });
|
|
57
57
|
}
|
|
58
58
|
);
|
|
59
|
-
|
|
59
|
+
B.displayName = "AccordionItem";
|
|
60
60
|
export {
|
|
61
|
-
|
|
61
|
+
B as default
|
|
62
62
|
};
|
|
63
63
|
//# sourceMappingURL=accordion-item.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"accordion-item.js","sources":["../../../../../src/features/timeline/comps/accordion-item/accordion-item.tsx"],"sourcesContent":["import { memo, useCallback, type FC } from 'react';\n\nimport TextButton from '../../../ui/buttons/text-button/text-button';\nimport FlexView from '../../../ui/layout/flex-view';\nimport Text from '../../../ui/text/text';\nimport type { AccordionItemProps } from './accordion-item-types';\nimport { CODING_ACTIVITY_NODE_TYPES, getStateColor, getStateIcon } from '../utils';\nimport { BLOCK_TYPE } from '../../../chapters-v2/constants/block-constants';\n\nconst AccordionItem: FC<AccordionItemProps> = memo(\n ({ type, userType, card, onPuzzleClick, onReviewClick }) => {\n const {\n label,\n title,\n state,\n subtext,\n user_node_id: userNodeId,\n block_type: blockType,\n user_block_id: userBlockId,\n node_type: nodeType,\n } = card;\n
|
|
1
|
+
{"version":3,"file":"accordion-item.js","sources":["../../../../../src/features/timeline/comps/accordion-item/accordion-item.tsx"],"sourcesContent":["import { memo, useCallback, type FC } from 'react';\n\nimport TextButton from '../../../ui/buttons/text-button/text-button';\nimport FlexView from '../../../ui/layout/flex-view';\nimport Text from '../../../ui/text/text';\nimport type { AccordionItemProps } from './accordion-item-types';\nimport { CODING_ACTIVITY_NODE_TYPES, getStateColor, getStateIcon } from '../utils';\nimport { BLOCK_TYPE } from '../../../chapters-v2/constants/block-constants';\n\nconst AccordionItem: FC<AccordionItemProps> = memo(\n ({ type, userType, card, onPuzzleClick, onReviewClick }) => {\n const {\n label,\n title,\n state,\n subtext,\n user_node_id: userNodeId,\n block_type: blockType,\n user_block_id: userBlockId,\n node_type: nodeType,\n } = card;\n const isSatMockTestBlock = blockType === BLOCK_TYPE.SAT_MOCK_TEST;\n const isPuzzle = label === 'PUZZLE';\n const Icon = getStateIcon(state);\n const isCompleted = state === 'COMPLETED';\n const shouldShowReview =\n (userType === 'TEACHER' && type !== 'CIRCLE') ||\n (userType === 'STUDENT' &&\n isCompleted &&\n type !== 'CIRCLE' &&\n !CODING_ACTIVITY_NODE_TYPES.includes(nodeType));\n\n const handlePuzzleClick = useCallback(() => {\n if (userNodeId && onPuzzleClick) {\n onPuzzleClick(userNodeId);\n }\n }, [onPuzzleClick, userNodeId]);\n\n const handleReviewClick = useCallback(() => {\n if (onReviewClick && userNodeId) {\n const showMockTestReview = isCompleted && isSatMockTestBlock;\n\n onReviewClick(userNodeId, showMockTestReview, userBlockId);\n }\n }, [isCompleted, isSatMockTestBlock, onReviewClick, userBlockId, userNodeId]);\n\n return (\n <FlexView $flexDirection=\"row\" $flexGapX={1.5}>\n <FlexView $background={getStateColor(state)} $borderRadiusX={0.5} $width={16} $height={16}>\n {Icon && <Icon width={16} height={16} />}\n </FlexView>\n <FlexView $flexRowGapX={0.25}>\n <Text $renderAs=\"ub3\">\n <Text $renderAs=\"ub3-bold\" $inline>\n {label}:\n </Text>{' '}\n {title}\n </Text>\n {isPuzzle ? (\n <TextButton\n label={isCompleted ? 'View reviewed puzzle' : 'View assigned puzzle'}\n size=\"small\"\n color=\"BLACK_T_60\"\n onClick={handlePuzzleClick}\n />\n ) : (\n <FlexView $flexDirection=\"row\" $flexGapX={0.75} $alignItems=\"center\">\n {subtext && (\n <Text $renderAs=\"ub3\" $color=\"BLACK_T_60\">\n {subtext}\n </Text>\n )}\n {shouldShowReview && (\n <TextButton\n label=\"Review\"\n size=\"small\"\n color=\"BLACK_T_60\"\n onClick={handleReviewClick}\n />\n )}\n </FlexView>\n )}\n </FlexView>\n </FlexView>\n );\n },\n);\n\nAccordionItem.displayName = 'AccordionItem';\n\nexport default AccordionItem;\n"],"names":["AccordionItem","memo","type","userType","card","onPuzzleClick","onReviewClick","label","title","state","subtext","userNodeId","blockType","userBlockId","nodeType","isSatMockTestBlock","BLOCK_TYPE","isPuzzle","Icon","getStateIcon","isCompleted","shouldShowReview","CODING_ACTIVITY_NODE_TYPES","handlePuzzleClick","useCallback","handleReviewClick","jsxs","FlexView","jsx","getStateColor","Text","TextButton"],"mappings":";;;;;;;AASA,MAAMA,IAAwCC;AAAA,EAC5C,CAAC,EAAE,MAAAC,GAAM,UAAAC,GAAU,MAAAC,GAAM,eAAAC,GAAe,eAAAC,QAAoB;AACpD,UAAA;AAAA,MACJ,OAAAC;AAAA,MACA,OAAAC;AAAA,MACA,OAAAC;AAAA,MACA,SAAAC;AAAA,MACA,cAAcC;AAAA,MACd,YAAYC;AAAA,MACZ,eAAeC;AAAA,MACf,WAAWC;AAAA,IACT,IAAAV,GACEW,IAAqBH,MAAcI,EAAW,eAC9CC,IAAWV,MAAU,UACrBW,IAAOC,EAAaV,CAAK,GACzBW,IAAcX,MAAU,aACxBY,IACHlB,MAAa,aAAaD,MAAS,YACnCC,MAAa,aACZiB,KACAlB,MAAS,YACT,CAACoB,EAA2B,SAASR,CAAQ,GAE3CS,IAAoBC,EAAY,MAAM;AAC1C,MAAIb,KAAcN,KAChBA,EAAcM,CAAU;AAAA,IAC1B,GACC,CAACN,GAAeM,CAAU,CAAC,GAExBc,IAAoBD,EAAY,MAAM;AAC1C,MAAIlB,KAAiBK,KAGLL,EAAAK,GAFaS,KAAeL,GAEIF,CAAW;AAAA,IAC3D,GACC,CAACO,GAAaL,GAAoBT,GAAeO,GAAaF,CAAU,CAAC;AAE5E,WACG,gBAAAe,EAAAC,GAAA,EAAS,gBAAe,OAAM,WAAW,KACxC,UAAA;AAAA,MAAA,gBAAAC,EAACD,KAAS,aAAaE,EAAcpB,CAAK,GAAG,gBAAgB,KAAK,QAAQ,IAAI,SAAS,IACpF,eAAS,gBAAAmB,EAAAV,GAAA,EAAK,OAAO,IAAI,QAAQ,GAAI,CAAA,GACxC;AAAA,MACA,gBAAAQ,EAACC,GAAS,EAAA,cAAc,MACtB,UAAA;AAAA,QAAC,gBAAAD,EAAAI,GAAA,EAAK,WAAU,OACd,UAAA;AAAA,UAAA,gBAAAJ,EAACI,GAAK,EAAA,WAAU,YAAW,SAAO,IAC/B,UAAA;AAAA,YAAAvB;AAAA,YAAM;AAAA,UAAA,GACT;AAAA,UAAQ;AAAA,UACPC;AAAA,QAAA,GACH;AAAA,QACCS,IACC,gBAAAW;AAAA,UAACG;AAAA,UAAA;AAAA,YACC,OAAOX,IAAc,yBAAyB;AAAA,YAC9C,MAAK;AAAA,YACL,OAAM;AAAA,YACN,SAASG;AAAA,UAAA;AAAA,QAAA,sBAGVI,GAAS,EAAA,gBAAe,OAAM,WAAW,MAAM,aAAY,UACzD,UAAA;AAAA,UAAAjB,uBACEoB,GAAK,EAAA,WAAU,OAAM,QAAO,cAC1B,UACHpB,GAAA;AAAA,UAEDW,KACC,gBAAAO;AAAA,YAACG;AAAA,YAAA;AAAA,cACC,OAAM;AAAA,cACN,MAAK;AAAA,cACL,OAAM;AAAA,cACN,SAASN;AAAA,YAAA;AAAA,UACX;AAAA,QAAA,GAEJ;AAAA,MAAA,GAEJ;AAAA,IACF,EAAA,CAAA;AAAA,EAEJ;AACF;AAEAzB,EAAc,cAAc;"}
|