@cuemath/leap 3.2.19 → 3.2.20-beta-0.1
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,53 +1,53 @@
|
|
1
|
-
import { jsxs as t, jsx as
|
2
|
-
import { useMemo as C, useCallback as
|
1
|
+
import { jsxs as t, jsx as e } from "react/jsx-runtime";
|
2
|
+
import { useMemo as C, useCallback as f } from "react";
|
3
3
|
import { useUIContext as D } from "../../../../ui/context/context.js";
|
4
|
-
import
|
4
|
+
import c from "../../../../ui/layout/flex-view.js";
|
5
5
|
import S from "../../../../ui/text/text.js";
|
6
6
|
import { RewardAccuracy as _ } from "../sheet-item/rewards-n-actions/reward-n-actions-styled.js";
|
7
7
|
import v from "../sheet-item/sheet-item-icon.js";
|
8
|
-
import { SheetItemContainer as O, VerticalLineWrapper as U, TopVerticalLine as
|
8
|
+
import { SheetItemContainer as O, VerticalLineWrapper as U, TopVerticalLine as j, SheetDetailsWrapper as B } from "../sheet-item/sheet-item-styled.js";
|
9
9
|
import { getUserNodeIdsToUnlockSAT as M, getSATSheetStatementStats as G } from "./sat-sheet-item-utils.js";
|
10
10
|
import { getActiveSheet as V } from "./sat-sheet-utils.js";
|
11
11
|
import L from "./student-actions/student-actions.js";
|
12
12
|
import N from "./teacher-actions/teacher-actions.js";
|
13
13
|
const ee = ({
|
14
14
|
blockStatus: n,
|
15
|
-
satMaxScore:
|
15
|
+
satMaxScore: u,
|
16
16
|
satScore: A,
|
17
17
|
...T
|
18
18
|
}) => {
|
19
|
-
const { blockId:
|
20
|
-
user_block_id:
|
19
|
+
const { blockId: o, sheets: s, userType: I, onSATReview: m, onSATUnlock: l, onSATStartOrResume: d } = T, {
|
20
|
+
user_block_id: r,
|
21
21
|
can_review: h,
|
22
22
|
can_start: g,
|
23
23
|
can_resume: x,
|
24
24
|
order: y
|
25
|
-
} = V(
|
25
|
+
} = V(s) || {}, { onEvent: p } = D(), a = C(
|
26
26
|
() => ({
|
27
|
-
user_block_id:
|
28
|
-
block_id:
|
27
|
+
user_block_id: r,
|
28
|
+
block_id: o
|
29
29
|
}),
|
30
|
-
[
|
31
|
-
), w = !!((n === "COMPLETED" || n === "MASTERED") && h &&
|
32
|
-
if (typeof
|
30
|
+
[o, r]
|
31
|
+
), w = !!((n === "COMPLETED" || n === "MASTERED") && h && r), $ = f(() => {
|
32
|
+
if (typeof m != "function")
|
33
33
|
throw new Error("onSATReview must be a function");
|
34
|
-
if (!
|
34
|
+
if (!r)
|
35
35
|
throw new Error("userBlockId must be a string");
|
36
|
-
p("clicked",
|
37
|
-
}, [
|
38
|
-
if (typeof
|
36
|
+
p("clicked", a), m(r);
|
37
|
+
}, [a, m, p, r]), E = f(() => {
|
38
|
+
if (typeof l != "function")
|
39
39
|
throw new Error("onSATUnlock must be a function");
|
40
|
-
const
|
41
|
-
if (
|
40
|
+
const i = M(s);
|
41
|
+
if (i.length === 0)
|
42
42
|
throw new Error("User node IDs are missing");
|
43
|
-
|
44
|
-
}, [
|
45
|
-
if (typeof
|
43
|
+
l(i);
|
44
|
+
}, [l, s]), b = f(() => {
|
45
|
+
if (typeof d != "function")
|
46
46
|
throw new Error("onSATStartOrResume must be a function");
|
47
|
-
if (!
|
48
|
-
throw new Error("
|
49
|
-
|
50
|
-
}, [
|
47
|
+
if (!o)
|
48
|
+
throw new Error("blockId must be a string");
|
49
|
+
d(o);
|
50
|
+
}, [d, o]);
|
51
51
|
return /* @__PURE__ */ t(
|
52
52
|
O,
|
53
53
|
{
|
@@ -56,10 +56,10 @@ const ee = ({
|
|
56
56
|
$alignItems: "center",
|
57
57
|
$flexGapX: 1,
|
58
58
|
children: [
|
59
|
-
/* @__PURE__ */ t(
|
60
|
-
/* @__PURE__ */
|
59
|
+
/* @__PURE__ */ t(c, { $width: "70%", $flexGap: 8, $flexDirection: "row", children: [
|
60
|
+
/* @__PURE__ */ e(U, { children: /* @__PURE__ */ e(j, {}) }),
|
61
61
|
/* @__PURE__ */ t(
|
62
|
-
|
62
|
+
B,
|
63
63
|
{
|
64
64
|
$width: "100%",
|
65
65
|
$flexDirection: "row",
|
@@ -67,25 +67,25 @@ const ee = ({
|
|
67
67
|
$flexGap: 8,
|
68
68
|
$marginBottom: 12,
|
69
69
|
children: [
|
70
|
-
/* @__PURE__ */
|
71
|
-
/* @__PURE__ */ t(
|
72
|
-
/* @__PURE__ */
|
73
|
-
/* @__PURE__ */
|
74
|
-
const { statement: k, color: R } = G(
|
75
|
-
return /* @__PURE__ */
|
70
|
+
/* @__PURE__ */ e(v, { chapterPermissionCode: n }),
|
71
|
+
/* @__PURE__ */ t(c, { $justifyContent: "center", $width: "100%", children: [
|
72
|
+
/* @__PURE__ */ e(S, { $renderAs: "body1Medium", children: "Assessment • Mock test" }),
|
73
|
+
/* @__PURE__ */ e(c, { children: s.map((i) => {
|
74
|
+
const { statement: k, color: R } = G(i);
|
75
|
+
return /* @__PURE__ */ e(S, { $renderAs: "body2", $color: R, children: k }, i.node_id);
|
76
76
|
}) })
|
77
77
|
] })
|
78
78
|
]
|
79
79
|
}
|
80
80
|
)
|
81
81
|
] }),
|
82
|
-
/* @__PURE__ */ t(
|
83
|
-
h &&
|
82
|
+
/* @__PURE__ */ t(c, { $flexDirection: "row", $alignItems: "center", $justifyContent: "center", $flexGap: 8, children: [
|
83
|
+
h && u && /* @__PURE__ */ e(c, { $justifyContent: "center", $alignItems: "center", children: /* @__PURE__ */ t(_, { $renderAs: "eyebrow2", $align: "center", children: [
|
84
84
|
A,
|
85
85
|
"/",
|
86
|
-
|
86
|
+
u
|
87
87
|
] }) }),
|
88
|
-
I === "STUDENT" ? /* @__PURE__ */
|
88
|
+
I === "STUDENT" ? /* @__PURE__ */ e(
|
89
89
|
L,
|
90
90
|
{
|
91
91
|
handleOnReview: $,
|
@@ -94,17 +94,17 @@ const ee = ({
|
|
94
94
|
canResume: !!x,
|
95
95
|
canStart: !!g,
|
96
96
|
handleOnStartOrResume: b,
|
97
|
-
analyticsProps:
|
97
|
+
analyticsProps: a,
|
98
98
|
questionOrder: y
|
99
99
|
}
|
100
|
-
) : /* @__PURE__ */
|
100
|
+
) : /* @__PURE__ */ e(
|
101
101
|
N,
|
102
102
|
{
|
103
103
|
handleOnReview: $,
|
104
104
|
handleOnUnlock: E,
|
105
105
|
isMenuVisible: w,
|
106
106
|
blockStatus: n,
|
107
|
-
analyticsProps:
|
107
|
+
analyticsProps: a
|
108
108
|
}
|
109
109
|
)
|
110
110
|
] })
|
package/dist/features/chapters/lpar-chapter/block-section/sat-sheet-item/sat-sheet-item.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"sat-sheet-item.js","sources":["../../../../../../src/features/chapters/lpar-chapter/block-section/sat-sheet-item/sat-sheet-item.tsx"],"sourcesContent":["import type { ISATSheetItemProps } from './sat-sheet-item-types';\n\nimport { useCallback, type FC, useMemo } from 'react';\n\nimport { useUIContext } from '../../../../ui/context/context';\nimport FlexView from '../../../../ui/layout/flex-view';\nimport Text from '../../../../ui/text/text';\nimport { RewardAccuracy } from '../sheet-item/rewards-n-actions/reward-n-actions-styled';\nimport SheetItemIcon from '../sheet-item/sheet-item-icon';\nimport {\n SheetDetailsWrapper,\n SheetItemContainer,\n TopVerticalLine,\n VerticalLineWrapper,\n} from '../sheet-item/sheet-item-styled';\nimport { getSATSheetStatementStats, getUserNodeIdsToUnlockSAT } from './sat-sheet-item-utils';\nimport { getActiveSheet } from './sat-sheet-utils';\nimport StudentActions from './student-actions/student-actions';\nimport TeacherActions from './teacher-actions/teacher-actions';\n\nconst SATSheetItem: FC<ISATSheetItemProps> = ({\n blockStatus,\n satMaxScore,\n satScore,\n ...restSATSheetItemProps\n}) => {\n const { blockId, sheets, userType, onSATReview, onSATUnlock, onSATStartOrResume } =\n restSATSheetItemProps;\n const {\n user_block_id: userBlockId,\n can_review: canReview,\n can_start: canStart,\n can_resume: canResume,\n order: questionOrder,\n } = getActiveSheet(sheets) || {};\n\n const { onEvent: trackEvent } = useUIContext();\n const analyticsProps = useMemo(\n () => ({\n user_block_id: userBlockId,\n block_id: blockId,\n }),\n [blockId, userBlockId],\n );\n\n const isMenuVisible = Boolean(\n (blockStatus === 'COMPLETED' || blockStatus === 'MASTERED') && canReview && userBlockId,\n );\n\n const handleOnReview = useCallback(() => {\n if (typeof onSATReview !== 'function') {\n throw new Error('onSATReview must be a function');\n }\n\n if (!userBlockId) {\n throw new Error('userBlockId must be a string');\n }\n\n trackEvent('clicked', analyticsProps);\n\n onSATReview(userBlockId);\n }, [analyticsProps, onSATReview, trackEvent, userBlockId]);\n\n const handleOnUnlock = useCallback(() => {\n if (typeof onSATUnlock !== 'function') {\n throw new Error('onSATUnlock must be a function');\n }\n\n const userNodeIds = getUserNodeIdsToUnlockSAT(sheets);\n\n if (userNodeIds.length === 0) {\n throw new Error('User node IDs are missing');\n }\n\n onSATUnlock(userNodeIds);\n }, [onSATUnlock, sheets]);\n\n const handleOnStartOrResume = useCallback(() => {\n if (typeof onSATStartOrResume !== 'function') {\n throw new Error('onSATStartOrResume must be a function');\n }\n\n if (!
|
1
|
+
{"version":3,"file":"sat-sheet-item.js","sources":["../../../../../../src/features/chapters/lpar-chapter/block-section/sat-sheet-item/sat-sheet-item.tsx"],"sourcesContent":["import type { ISATSheetItemProps } from './sat-sheet-item-types';\n\nimport { useCallback, type FC, useMemo } from 'react';\n\nimport { useUIContext } from '../../../../ui/context/context';\nimport FlexView from '../../../../ui/layout/flex-view';\nimport Text from '../../../../ui/text/text';\nimport { RewardAccuracy } from '../sheet-item/rewards-n-actions/reward-n-actions-styled';\nimport SheetItemIcon from '../sheet-item/sheet-item-icon';\nimport {\n SheetDetailsWrapper,\n SheetItemContainer,\n TopVerticalLine,\n VerticalLineWrapper,\n} from '../sheet-item/sheet-item-styled';\nimport { getSATSheetStatementStats, getUserNodeIdsToUnlockSAT } from './sat-sheet-item-utils';\nimport { getActiveSheet } from './sat-sheet-utils';\nimport StudentActions from './student-actions/student-actions';\nimport TeacherActions from './teacher-actions/teacher-actions';\n\nconst SATSheetItem: FC<ISATSheetItemProps> = ({\n blockStatus,\n satMaxScore,\n satScore,\n ...restSATSheetItemProps\n}) => {\n const { blockId, sheets, userType, onSATReview, onSATUnlock, onSATStartOrResume } =\n restSATSheetItemProps;\n const {\n user_block_id: userBlockId,\n can_review: canReview,\n can_start: canStart,\n can_resume: canResume,\n order: questionOrder,\n } = getActiveSheet(sheets) || {};\n\n const { onEvent: trackEvent } = useUIContext();\n const analyticsProps = useMemo(\n () => ({\n user_block_id: userBlockId,\n block_id: blockId,\n }),\n [blockId, userBlockId],\n );\n\n const isMenuVisible = Boolean(\n (blockStatus === 'COMPLETED' || blockStatus === 'MASTERED') && canReview && userBlockId,\n );\n\n const handleOnReview = useCallback(() => {\n if (typeof onSATReview !== 'function') {\n throw new Error('onSATReview must be a function');\n }\n\n if (!userBlockId) {\n throw new Error('userBlockId must be a string');\n }\n\n trackEvent('clicked', analyticsProps);\n\n onSATReview(userBlockId);\n }, [analyticsProps, onSATReview, trackEvent, userBlockId]);\n\n const handleOnUnlock = useCallback(() => {\n if (typeof onSATUnlock !== 'function') {\n throw new Error('onSATUnlock must be a function');\n }\n\n const userNodeIds = getUserNodeIdsToUnlockSAT(sheets);\n\n if (userNodeIds.length === 0) {\n throw new Error('User node IDs are missing');\n }\n\n onSATUnlock(userNodeIds);\n }, [onSATUnlock, sheets]);\n\n const handleOnStartOrResume = useCallback(() => {\n if (typeof onSATStartOrResume !== 'function') {\n throw new Error('onSATStartOrResume must be a function');\n }\n\n if (!blockId) {\n throw new Error('blockId must be a string');\n }\n\n onSATStartOrResume(blockId);\n }, [onSATStartOrResume, blockId]);\n\n return (\n <SheetItemContainer\n $flexDirection=\"row\"\n $justifyContent=\"space-between\"\n $alignItems=\"center\"\n $flexGapX={1}\n >\n <FlexView $width=\"70%\" $flexGap={8} $flexDirection=\"row\">\n <VerticalLineWrapper>\n <TopVerticalLine />\n </VerticalLineWrapper>\n\n <SheetDetailsWrapper\n $width=\"100%\"\n $flexDirection=\"row\"\n $alignItems=\"center\"\n $flexGap={8}\n $marginBottom={12}\n >\n <SheetItemIcon chapterPermissionCode={blockStatus} />\n\n <FlexView $justifyContent=\"center\" $width=\"100%\">\n <Text $renderAs=\"body1Medium\">Assessment • Mock test</Text>\n\n <FlexView>\n {sheets.map(sheet => {\n const { statement, color } = getSATSheetStatementStats(sheet);\n\n return (\n <Text $renderAs=\"body2\" key={sheet.node_id} $color={color}>\n {statement}\n </Text>\n );\n })}\n </FlexView>\n </FlexView>\n </SheetDetailsWrapper>\n </FlexView>\n\n <FlexView $flexDirection=\"row\" $alignItems=\"center\" $justifyContent=\"center\" $flexGap={8}>\n {canReview && satMaxScore && (\n <FlexView $justifyContent=\"center\" $alignItems=\"center\">\n <RewardAccuracy $renderAs=\"eyebrow2\" $align=\"center\">\n {satScore}/{satMaxScore}\n </RewardAccuracy>\n </FlexView>\n )}\n\n {userType === 'STUDENT' ? (\n <StudentActions\n handleOnReview={handleOnReview}\n isMenuVisible={isMenuVisible}\n blockStatus={blockStatus}\n canResume={Boolean(canResume)}\n canStart={Boolean(canStart)}\n handleOnStartOrResume={handleOnStartOrResume}\n analyticsProps={analyticsProps}\n questionOrder={questionOrder}\n />\n ) : (\n <TeacherActions\n handleOnReview={handleOnReview}\n handleOnUnlock={handleOnUnlock}\n isMenuVisible={isMenuVisible}\n blockStatus={blockStatus}\n analyticsProps={analyticsProps}\n />\n )}\n </FlexView>\n </SheetItemContainer>\n );\n};\n\nexport default SATSheetItem;\n"],"names":["SATSheetItem","blockStatus","satMaxScore","satScore","restSATSheetItemProps","blockId","sheets","userType","onSATReview","onSATUnlock","onSATStartOrResume","userBlockId","canReview","canStart","canResume","questionOrder","getActiveSheet","trackEvent","useUIContext","analyticsProps","useMemo","isMenuVisible","handleOnReview","useCallback","handleOnUnlock","userNodeIds","getUserNodeIdsToUnlockSAT","handleOnStartOrResume","jsxs","SheetItemContainer","FlexView","jsx","VerticalLineWrapper","TopVerticalLine","SheetDetailsWrapper","SheetItemIcon","Text","sheet","statement","color","getSATSheetStatementStats","RewardAccuracy","StudentActions","TeacherActions"],"mappings":";;;;;;;;;;;;AAoBA,MAAMA,KAAuC,CAAC;AAAA,EAC5C,aAAAC;AAAA,EACA,aAAAC;AAAA,EACA,UAAAC;AAAA,EACA,GAAGC;AACL,MAAM;AACJ,QAAM,EAAE,SAAAC,GAAS,QAAAC,GAAQ,UAAAC,GAAU,aAAAC,GAAa,aAAAC,GAAa,oBAAAC,EAC3D,IAAAN,GACI;AAAA,IACJ,eAAeO;AAAA,IACf,YAAYC;AAAA,IACZ,WAAWC;AAAA,IACX,YAAYC;AAAA,IACZ,OAAOC;AAAA,EAAA,IACLC,EAAeV,CAAM,KAAK,IAExB,EAAE,SAASW,EAAW,IAAIC,EAAa,GACvCC,IAAiBC;AAAA,IACrB,OAAO;AAAA,MACL,eAAeT;AAAA,MACf,UAAUN;AAAA,IAAA;AAAA,IAEZ,CAACA,GAASM,CAAW;AAAA,EAAA,GAGjBU,IAAgB,IACnBpB,MAAgB,eAAeA,MAAgB,eAAeW,KAAaD,IAGxEW,IAAiBC,EAAY,MAAM;AACnC,QAAA,OAAOf,KAAgB;AACnB,YAAA,IAAI,MAAM,gCAAgC;AAGlD,QAAI,CAACG;AACG,YAAA,IAAI,MAAM,8BAA8B;AAGhD,IAAAM,EAAW,WAAWE,CAAc,GAEpCX,EAAYG,CAAW;AAAA,KACtB,CAACQ,GAAgBX,GAAaS,GAAYN,CAAW,CAAC,GAEnDa,IAAiBD,EAAY,MAAM;AACnC,QAAA,OAAOd,KAAgB;AACnB,YAAA,IAAI,MAAM,gCAAgC;AAG5C,UAAAgB,IAAcC,EAA0BpB,CAAM;AAEhD,QAAAmB,EAAY,WAAW;AACnB,YAAA,IAAI,MAAM,2BAA2B;AAG7C,IAAAhB,EAAYgB,CAAW;AAAA,EAAA,GACtB,CAAChB,GAAaH,CAAM,CAAC,GAElBqB,IAAwBJ,EAAY,MAAM;AAC1C,QAAA,OAAOb,KAAu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