@cuemath/leap 3.3.10-j2 → 3.3.11-guru.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/features/auth/comps/linear-progress-bar/linear-progress-bar.js +4 -4
- package/dist/features/auth/comps/linear-progress-bar/linear-progress-bar.js.map +1 -1
- package/dist/features/auth/pla-signup/onboarding-guide/onboarding-guide.js +2 -2
- package/dist/features/auth/pla-signup/onboarding-guide/onboarding-guide.js.map +1 -1
- package/dist/features/chapters/lpar-chapter/block-section/sat-sheet-item/sat-sheet-summary/question-overview.js +19 -18
- package/dist/features/chapters/lpar-chapter/block-section/sat-sheet-item/sat-sheet-summary/question-overview.js.map +1 -1
- package/dist/features/chapters/lpar-chapter/block-section/sat-sheet-item/sat-sheet-summary/sat-sheet-summary-styled.js +7 -7
- package/dist/features/chapters/lpar-chapter/block-section/sat-sheet-item/sat-sheet-summary/sat-sheet-summary-styled.js.map +1 -1
- package/dist/features/chapters/lpar-chapter/block-section/sat-sheet-item/sat-sheet-summary/sat-sheet-summary.js +26 -24
- package/dist/features/chapters/lpar-chapter/block-section/sat-sheet-item/sat-sheet-summary/sat-sheet-summary.js.map +1 -1
- package/dist/features/chapters/lpar-chapter/block-section/sat-sheet-item/sat-sheet-summary/summary-module.js +15 -13
- package/dist/features/chapters/lpar-chapter/block-section/sat-sheet-item/sat-sheet-summary/summary-module.js.map +1 -1
- package/dist/features/chapters/lpar-chapter/constants/index.js.map +1 -1
- package/dist/features/chapters-v2/chapter-details/block-sections/block-section-view.js +129 -69
- package/dist/features/chapters-v2/chapter-details/block-sections/block-section-view.js.map +1 -1
- package/dist/features/chapters-v2/chapter-details/block-sections/block-sections.js +24 -23
- package/dist/features/chapters-v2/chapter-details/block-sections/block-sections.js.map +1 -1
- package/dist/features/chapters-v2/chapter-details/chapter-details.js +71 -68
- package/dist/features/chapters-v2/chapter-details/chapter-details.js.map +1 -1
- package/dist/features/chapters-v2/comps/node-card/node-card-styled.js +36 -31
- package/dist/features/chapters-v2/comps/node-card/node-card-styled.js.map +1 -1
- package/dist/features/chapters-v2/comps/sat-mock-test/sat-mock-test-styled.js +22 -0
- package/dist/features/chapters-v2/comps/sat-mock-test/sat-mock-test-styled.js.map +1 -0
- package/dist/features/chapters-v2/comps/sat-mock-test/sat-mock-test.js +151 -0
- package/dist/features/chapters-v2/comps/sat-mock-test/sat-mock-test.js.map +1 -0
- package/dist/features/chapters-v2/constants/block-constants.js +7 -5
- package/dist/features/chapters-v2/constants/block-constants.js.map +1 -1
- package/dist/features/chapters-v2/utils/index.js +8 -2
- package/dist/features/chapters-v2/utils/index.js.map +1 -1
- package/dist/features/chapters-v2/utils/sat-sheet-utils.js +12 -0
- package/dist/features/chapters-v2/utils/sat-sheet-utils.js.map +1 -0
- package/dist/features/journey/hooks/use-home-page-journey/home-page-homeworks-mock.js +8 -4
- package/dist/features/journey/hooks/use-home-page-journey/home-page-homeworks-mock.js.map +1 -1
- package/dist/features/parent-dashboard/comps/cuemath-app-features/cuemath-app-features.js +2 -2
- package/dist/features/parent-dashboard/comps/cuemath-app-features/cuemath-app-features.js.map +1 -1
- package/dist/features/parent-dashboard/comps/math-practice/math-practice.js +12 -12
- package/dist/features/parent-dashboard/comps/math-practice/math-practice.js.map +1 -1
- package/dist/features/sheets/constants/sheet.js +12 -4
- package/dist/features/sheets/constants/sheet.js.map +1 -1
- package/dist/features/trial-session/comps/pla/next-steps/next-steps.js +6 -6
- package/dist/features/trial-session/comps/pla/next-steps/next-steps.js.map +1 -1
- package/dist/features/trial-session/comps/pla/session-status/session-status.js.map +1 -1
- package/dist/features/trial-session/comps/pla/session-summary/summary-card/summary-card.js +13 -13
- package/dist/features/trial-session/comps/pla/session-summary/summary-card/summary-card.js.map +1 -1
- package/dist/features/trial-session/comps/pla/upcoming-sessions/upcoming-sessions-types.js.map +1 -1
- package/dist/features/trial-session/comps/pla/upcoming-sessions/upcoming-sessions.js +9 -9
- package/dist/features/trial-session/comps/pla/upcoming-sessions/upcoming-sessions.js.map +1 -1
- package/dist/features/worksheet/worksheet/worksheet-behavior-helper.js +38 -38
- package/dist/features/worksheet/worksheet/worksheet-behavior-helper.js.map +1 -1
- package/dist/features/worksheet/worksheet/worksheet-questions-controller/worksheet-questions-controller.js +128 -126
- package/dist/features/worksheet/worksheet/worksheet-questions-controller/worksheet-questions-controller.js.map +1 -1
- package/dist/index.d.ts +27 -27
- package/dist/index.js +146 -149
- package/dist/index.js.map +1 -1
- package/dist/node_modules/query-string/base.js +1 -1
- package/dist/node_modules/query-string/node_modules/decode-uri-component/index.js.map +1 -0
- package/dist/node_modules/uuid/dist/esm-browser/regex.js +5 -0
- package/dist/node_modules/uuid/dist/esm-browser/regex.js.map +1 -0
- package/dist/node_modules/uuid/dist/esm-browser/rng.js +2 -3
- package/dist/node_modules/uuid/dist/esm-browser/rng.js.map +1 -1
- package/dist/node_modules/uuid/dist/esm-browser/stringify.js +10 -6
- package/dist/node_modules/uuid/dist/esm-browser/stringify.js.map +1 -1
- package/dist/node_modules/uuid/dist/esm-browser/v4.js +9 -12
- package/dist/node_modules/uuid/dist/esm-browser/v4.js.map +1 -1
- package/dist/node_modules/uuid/dist/esm-browser/validate.js +8 -0
- package/dist/node_modules/uuid/dist/esm-browser/validate.js.map +1 -0
- package/package.json +2 -3
- package/dist/features/parent-dashboard/api/parent-home.js +0 -10
- package/dist/features/parent-dashboard/api/parent-home.js.map +0 -1
- package/dist/features/parent-dashboard/comps/compact-header/compact-header.js +0 -30
- package/dist/features/parent-dashboard/comps/compact-header/compact-header.js.map +0 -1
- package/dist/features/parent-dashboard/hooks/use-parent-home-data.js +0 -64
- package/dist/features/parent-dashboard/hooks/use-parent-home-data.js.map +0 -1
- package/dist/features/parent-dashboard/parent-dashboard-constants.js +0 -26
- package/dist/features/parent-dashboard/parent-dashboard-constants.js.map +0 -1
- package/dist/features/parent-dashboard/parent-dashboard-styled.js +0 -33
- package/dist/features/parent-dashboard/parent-dashboard-styled.js.map +0 -1
- package/dist/features/parent-dashboard/parent-dashboard-view.js +0 -203
- package/dist/features/parent-dashboard/parent-dashboard-view.js.map +0 -1
- package/dist/features/parent-dashboard/parent-dashboard.js +0 -8
- package/dist/features/parent-dashboard/parent-dashboard.js.map +0 -1
- package/dist/node_modules/decode-uri-component/index.js.map +0 -1
- package/dist/node_modules/uuid/dist/esm-browser/native.js +0 -7
- package/dist/node_modules/uuid/dist/esm-browser/native.js.map +0 -1
- /package/dist/node_modules/{decode-uri-component → query-string/node_modules/decode-uri-component}/index.js +0 -0
|
@@ -1,119 +1,179 @@
|
|
|
1
|
-
import { jsx as e, jsxs as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
|
|
1
|
+
import { jsx as e, jsxs as m, Fragment as Y } from "react/jsx-runtime";
|
|
2
|
+
import { memo as Z, useCallback as f } from "react";
|
|
3
|
+
import q from "../../../../assets/line-icons/icons/eye2.js";
|
|
4
|
+
import G from "../../../../assets/line-icons/icons/more-vertical.js";
|
|
5
|
+
import J from "../../../../assets/line-icons/icons/redo.js";
|
|
6
|
+
import N from "../../../../assets/line-icons/icons/skip.js";
|
|
7
|
+
import Q from "../../../ui/context-menu/context-menu.js";
|
|
8
|
+
import S from "../../../ui/layout/flex-view.js";
|
|
9
|
+
import k from "../../../ui/text/text.js";
|
|
10
|
+
import U from "../../comps/node-card/node-card.js";
|
|
11
|
+
import D from "../../comps/node-card/node-menu-options/node-menu-options.js";
|
|
12
|
+
import R from "../../comps/sat-mock-test/sat-mock-test.js";
|
|
13
|
+
import { BLOCK_TYPE as ee, BLOCK_NAME as te } from "../../constants/block-constants.js";
|
|
14
|
+
import { getSheetNLessonCount as re } from "../../utils/index.js";
|
|
15
|
+
import { getActiveSATSheet as ne } from "../../utils/sat-sheet-utils.js";
|
|
16
|
+
import { BlockSectionWrapper as ie, BlockOptionsWrapper as oe, BlockSheetContainer as ce } from "./block-sections-styled.js";
|
|
17
|
+
const se = ({
|
|
13
18
|
userType: o,
|
|
14
|
-
imageHue:
|
|
15
|
-
blockData:
|
|
16
|
-
lessonIdx:
|
|
17
|
-
isLastBlock:
|
|
18
|
-
isGoalBlock:
|
|
19
|
-
blockSectionRef:
|
|
20
|
-
onNodeAttempt:
|
|
21
|
-
onNodeAssignAsHomework:
|
|
22
|
-
onNodeMarkAsDone:
|
|
23
|
-
onNodeReattempt:
|
|
24
|
-
onNodeReview:
|
|
25
|
-
onNodeView:
|
|
26
|
-
onBlockSkipUnskip:
|
|
27
|
-
onNodeUnassign:
|
|
28
|
-
onNodeUnlock:
|
|
29
|
-
onNodeSkipUnSkip:
|
|
19
|
+
imageHue: u,
|
|
20
|
+
blockData: n,
|
|
21
|
+
lessonIdx: $,
|
|
22
|
+
isLastBlock: x,
|
|
23
|
+
isGoalBlock: a,
|
|
24
|
+
blockSectionRef: L,
|
|
25
|
+
onNodeAttempt: _,
|
|
26
|
+
onNodeAssignAsHomework: I,
|
|
27
|
+
onNodeMarkAsDone: M,
|
|
28
|
+
onNodeReattempt: O,
|
|
29
|
+
onNodeReview: r,
|
|
30
|
+
onNodeView: w,
|
|
31
|
+
onBlockSkipUnskip: c,
|
|
32
|
+
onNodeUnassign: K,
|
|
33
|
+
onNodeUnlock: j,
|
|
34
|
+
onNodeSkipUnSkip: v,
|
|
35
|
+
onBlockReset: s
|
|
30
36
|
}) => {
|
|
31
|
-
const {
|
|
37
|
+
const {
|
|
38
|
+
block_type: d,
|
|
39
|
+
name: b,
|
|
40
|
+
sheets: l,
|
|
41
|
+
permissions: C,
|
|
42
|
+
block_stats: H,
|
|
43
|
+
state: V,
|
|
44
|
+
block_statement: W
|
|
45
|
+
} = n, i = d === ee.SAT_MOCK_TEST, {
|
|
46
|
+
can_skip: h,
|
|
47
|
+
can_un_skip: t,
|
|
48
|
+
can_reset: g,
|
|
49
|
+
can_review: E
|
|
50
|
+
} = C, T = te[d], y = re({
|
|
51
|
+
isSkipped: t,
|
|
52
|
+
sheetsLength: l.length,
|
|
53
|
+
isGoalBlock: a,
|
|
54
|
+
lessonIdx: $,
|
|
55
|
+
isSatMockTestBlock: i
|
|
56
|
+
}), p = ne(l), B = i && (g || E) || o === "TEACHER" && (h || t), P = f(() => {
|
|
57
|
+
if (!p)
|
|
58
|
+
throw new Error("Active SAT sheet is not available");
|
|
59
|
+
r == null || r(p);
|
|
60
|
+
}, [p, r]), z = f(() => {
|
|
61
|
+
c == null || c(n, h);
|
|
62
|
+
}, [n, h, c]), F = f(() => {
|
|
63
|
+
s == null || s(n);
|
|
64
|
+
}, [n, s]), X = [
|
|
32
65
|
{
|
|
33
66
|
id: "node-card-skip",
|
|
34
67
|
label: t ? "Revert 'Skip'" : "Skip All",
|
|
35
|
-
icon:
|
|
36
|
-
disabled:
|
|
37
|
-
onClick:
|
|
68
|
+
icon: N,
|
|
69
|
+
disabled: i,
|
|
70
|
+
onClick: z
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
id: "sat-node-card-review",
|
|
74
|
+
label: "Review",
|
|
75
|
+
icon: q,
|
|
76
|
+
disabled: !E,
|
|
77
|
+
onClick: P
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
id: "sat-node-card-reset",
|
|
81
|
+
label: "Reset",
|
|
82
|
+
icon: J,
|
|
83
|
+
disabled: !g,
|
|
84
|
+
onClick: F
|
|
38
85
|
}
|
|
39
86
|
];
|
|
40
|
-
return o === "STUDENT" && t ? null : /* @__PURE__ */ e("div", { ref:
|
|
41
|
-
|
|
87
|
+
return o === "STUDENT" && t ? null : /* @__PURE__ */ e("div", { ref: L, children: /* @__PURE__ */ e(
|
|
88
|
+
ie,
|
|
42
89
|
{
|
|
43
|
-
$background:
|
|
90
|
+
$background: a ? "WHITE_1" : "WHITE_3",
|
|
44
91
|
$gutterX: 1,
|
|
45
|
-
$lastBlock:
|
|
92
|
+
$lastBlock: x,
|
|
46
93
|
$flexGap: 12,
|
|
47
|
-
children: /* @__PURE__ */
|
|
48
|
-
/* @__PURE__ */
|
|
49
|
-
/* @__PURE__ */
|
|
50
|
-
/* @__PURE__ */
|
|
51
|
-
|
|
94
|
+
children: /* @__PURE__ */ m(S, { $flexGap: 12, children: [
|
|
95
|
+
/* @__PURE__ */ m(S, { $flexDirection: "row", $alignItems: "center", $justifyContent: "space-between", children: [
|
|
96
|
+
/* @__PURE__ */ m(S, { $opacity: t ? 0.5 : 1, children: [
|
|
97
|
+
/* @__PURE__ */ m(
|
|
98
|
+
k,
|
|
52
99
|
{
|
|
53
100
|
$renderAs: "ac4",
|
|
54
101
|
$color: "BLACK_T_60",
|
|
55
102
|
$textDecoration: t ? "line-through" : "none",
|
|
56
103
|
children: [
|
|
57
|
-
|
|
104
|
+
T === "Puzzles" ? b : T,
|
|
58
105
|
" ",
|
|
59
|
-
|
|
106
|
+
y
|
|
60
107
|
]
|
|
61
108
|
}
|
|
62
109
|
),
|
|
63
|
-
!!
|
|
64
|
-
|
|
110
|
+
!!a && !!$ && !i && /* @__PURE__ */ e(
|
|
111
|
+
k,
|
|
65
112
|
{
|
|
66
113
|
$renderAs: "ab2-bold",
|
|
67
114
|
$color: "BLACK_1",
|
|
68
115
|
$textDecoration: t ? "line-through" : "none",
|
|
69
|
-
children:
|
|
116
|
+
children: b
|
|
70
117
|
}
|
|
71
118
|
)
|
|
72
119
|
] }),
|
|
73
|
-
|
|
74
|
-
|
|
120
|
+
B && /* @__PURE__ */ e(
|
|
121
|
+
Q,
|
|
75
122
|
{
|
|
76
123
|
targetElement: /* @__PURE__ */ e(
|
|
77
|
-
|
|
124
|
+
oe,
|
|
78
125
|
{
|
|
79
126
|
$width: 20,
|
|
80
127
|
$height: 20,
|
|
81
128
|
$justifyContent: "center",
|
|
82
129
|
$alignItems: "center",
|
|
83
|
-
children: /* @__PURE__ */ e(
|
|
130
|
+
children: /* @__PURE__ */ e(G, { width: 18, height: 18 })
|
|
84
131
|
}
|
|
85
132
|
),
|
|
86
|
-
menuElement: /* @__PURE__ */ e(
|
|
133
|
+
menuElement: /* @__PURE__ */ e(D, { options: X }),
|
|
87
134
|
menuOffset: 5,
|
|
88
135
|
menuZIndex: 4
|
|
89
136
|
}
|
|
90
137
|
)
|
|
91
138
|
] }),
|
|
92
|
-
/* @__PURE__ */ e(
|
|
93
|
-
|
|
139
|
+
/* @__PURE__ */ e(Y, { children: i ? /* @__PURE__ */ e(
|
|
140
|
+
R,
|
|
94
141
|
{
|
|
95
|
-
imageHue: $ || "BLUE",
|
|
96
142
|
userType: o,
|
|
97
|
-
|
|
98
|
-
|
|
143
|
+
imageHue: u || "BLUE",
|
|
144
|
+
sheets: l,
|
|
145
|
+
blockStats: H,
|
|
146
|
+
blockState: V,
|
|
147
|
+
blockStatement: W,
|
|
148
|
+
onNodeAttempt: _,
|
|
149
|
+
onNodeReview: r,
|
|
150
|
+
blockPermissions: C
|
|
151
|
+
}
|
|
152
|
+
) : /* @__PURE__ */ e(ce, { children: l.map((A) => /* @__PURE__ */ e(
|
|
153
|
+
U,
|
|
154
|
+
{
|
|
155
|
+
imageHue: u || "BLUE",
|
|
156
|
+
userType: o,
|
|
157
|
+
nodeData: A,
|
|
158
|
+
blockType: d,
|
|
99
159
|
isSkipped: t,
|
|
100
|
-
onNodeAttempt:
|
|
101
|
-
onNodeAssignAsHomework:
|
|
102
|
-
onNodeMarkAsDone:
|
|
103
|
-
onNodeReattempt:
|
|
104
|
-
onNodeReview:
|
|
105
|
-
onNodeView:
|
|
106
|
-
onNodeUnassign:
|
|
107
|
-
onNodeUnlock:
|
|
108
|
-
onNodeSkipUnSkip:
|
|
160
|
+
onNodeAttempt: _,
|
|
161
|
+
onNodeAssignAsHomework: I,
|
|
162
|
+
onNodeMarkAsDone: M,
|
|
163
|
+
onNodeReattempt: O,
|
|
164
|
+
onNodeReview: r,
|
|
165
|
+
onNodeView: w,
|
|
166
|
+
onNodeUnassign: K,
|
|
167
|
+
onNodeUnlock: j,
|
|
168
|
+
onNodeSkipUnSkip: v
|
|
109
169
|
},
|
|
110
|
-
|
|
111
|
-
)) })
|
|
170
|
+
A.node_id
|
|
171
|
+
)) }) })
|
|
112
172
|
] })
|
|
113
173
|
}
|
|
114
174
|
) });
|
|
115
|
-
};
|
|
175
|
+
}, Ae = Z(se);
|
|
116
176
|
export {
|
|
117
|
-
|
|
177
|
+
Ae as default
|
|
118
178
|
};
|
|
119
179
|
//# sourceMappingURL=block-section-view.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"block-section-view.js","sources":["../../../../../src/features/chapters-v2/chapter-details/block-sections/block-section-view.tsx"],"sourcesContent":["import type { INodeMenuOption } from '../../comps/node-card/node-menu-options/node-menu-options-types';\nimport type { IBlockSectionProps } from './block-sections-types';\nimport type { FC } from 'react';\n\nimport MoreVerticalIcon from '../../../../assets/line-icons/icons/more-vertical';\nimport SkipIcon from '../../../../assets/line-icons/icons/skip';\nimport ContextMenu from '../../../ui/context-menu/context-menu';\nimport FlexView from '../../../ui/layout/flex-view';\nimport Text from '../../../ui/text/text';\nimport NodeCard from '../../comps/node-card/node-card';\nimport NodeMenuOptions from '../../comps/node-card/node-menu-options/node-menu-options';\nimport { BLOCK_NAME } from '../../constants/block-constants';\nimport { getSheetNLessonCount } from '../../utils';\nimport * as Styled from './block-sections-styled';\n\nconst BlockSectionView: FC<IBlockSectionProps> = ({\n userType,\n imageHue,\n blockData,\n lessonIdx,\n isLastBlock,\n isGoalBlock,\n blockSectionRef,\n onNodeAttempt,\n onNodeAssignAsHomework,\n onNodeMarkAsDone,\n onNodeReattempt,\n onNodeReview,\n onNodeView,\n onBlockSkipUnskip,\n onNodeUnassign,\n onNodeUnlock,\n onNodeSkipUnSkip,\n}) => {\n const { block_type: blockType, name, sheets, permissions } = blockData;\n\n const { can_skip: canSkip, can_un_skip: canUnskip } = permissions;\n const blockName = BLOCK_NAME[blockType];\n\n const sheetNLessonCount = getSheetNLessonCount(canUnskip, sheets.length, isGoalBlock, lessonIdx);\n\n const menuOptions: INodeMenuOption[] = [\n {\n id: 'node-card-skip',\n label: canUnskip ? `Revert 'Skip'` : 'Skip All',\n icon: SkipIcon,\n disabled: false,\n onClick: () => onBlockSkipUnskip?.(blockData, canSkip),\n },\n ];\n\n if (userType === 'STUDENT' && canUnskip) return null;\n\n return (\n <div ref={blockSectionRef}>\n <Styled.BlockSectionWrapper\n $background={isGoalBlock ? `WHITE_1` : 'WHITE_3'}\n $gutterX={1}\n $lastBlock={isLastBlock}\n $flexGap={12}\n >\n <FlexView $flexGap={12}>\n <FlexView $flexDirection=\"row\" $alignItems=\"center\" $justifyContent=\"space-between\">\n <FlexView $opacity={canUnskip ? 0.5 : 1}>\n <Text\n $renderAs=\"ac4\"\n $color=\"BLACK_T_60\"\n $textDecoration={canUnskip ? 'line-through' : 'none'}\n >\n {blockName === 'Puzzles' ? name : blockName} {sheetNLessonCount}\n </Text>\n\n {!!isGoalBlock && !!lessonIdx && (\n <Text\n $renderAs=\"ab2-bold\"\n $color=\"BLACK_1\"\n $textDecoration={canUnskip ? 'line-through' : 'none'}\n >\n {name}\n </Text>\n )}\n </FlexView>\n\n {userType === 'TEACHER' && (canSkip || canUnskip) && (\n <ContextMenu\n targetElement={\n <Styled.BlockOptionsWrapper\n $width={20}\n $height={20}\n $justifyContent=\"center\"\n $alignItems=\"center\"\n >\n <MoreVerticalIcon width={18} height={18} />\n </Styled.BlockOptionsWrapper>\n }\n menuElement={<NodeMenuOptions options={menuOptions} />}\n menuOffset={5}\n menuZIndex={4}\n />\n )}\n </FlexView>\n\n <Styled.BlockSheetContainer>\n {sheets.map(nodeData => (\n <NodeCard\n key={nodeData.node_id}\n imageHue={imageHue || 'BLUE'}\n userType={userType}\n nodeData={nodeData}\n blockType={blockType}\n isSkipped={canUnskip}\n onNodeAttempt={onNodeAttempt}\n onNodeAssignAsHomework={onNodeAssignAsHomework}\n onNodeMarkAsDone={onNodeMarkAsDone}\n onNodeReattempt={onNodeReattempt}\n onNodeReview={onNodeReview}\n onNodeView={onNodeView}\n onNodeUnassign={onNodeUnassign}\n onNodeUnlock={onNodeUnlock}\n onNodeSkipUnSkip={onNodeSkipUnSkip}\n />\n ))}\n </Styled.BlockSheetContainer>\n </FlexView>\n </Styled.BlockSectionWrapper>\n </div>\n );\n};\n\nexport default BlockSectionView;\n"],"names":["BlockSectionView","userType","imageHue","blockData","lessonIdx","isLastBlock","isGoalBlock","blockSectionRef","onNodeAttempt","onNodeAssignAsHomework","onNodeMarkAsDone","onNodeReattempt","onNodeReview","onNodeView","onBlockSkipUnskip","onNodeUnassign","onNodeUnlock","onNodeSkipUnSkip","blockType","name","sheets","permissions","canSkip","canUnskip","blockName","BLOCK_NAME","sheetNLessonCount","getSheetNLessonCount","menuOptions","SkipIcon","jsx","Styled.BlockSectionWrapper","jsxs","FlexView","Text","ContextMenu","Styled.BlockOptionsWrapper","MoreVerticalIcon","NodeMenuOptions","Styled.BlockSheetContainer","nodeData","NodeCard"],"mappings":";;;;;;;;;;;AAeA,MAAMA,IAA2C,CAAC;AAAA,EAChD,UAAAC;AAAA,EACA,UAAAC;AAAA,EACA,WAAAC;AAAA,EACA,WAAAC;AAAA,EACA,aAAAC;AAAA,EACA,aAAAC;AAAA,EACA,iBAAAC;AAAA,EACA,eAAAC;AAAA,EACA,wBAAAC;AAAA,EACA,kBAAAC;AAAA,EACA,iBAAAC;AAAA,EACA,cAAAC;AAAA,EACA,YAAAC;AAAA,EACA,mBAAAC;AAAA,EACA,gBAAAC;AAAA,EACA,cAAAC;AAAA,EACA,kBAAAC;AACF,MAAM;AACJ,QAAM,EAAE,YAAYC,GAAW,MAAAC,GAAM,QAAAC,GAAQ,aAAAC,EAAgB,IAAAlB,GAEvD,EAAE,UAAUmB,GAAS,aAAaC,MAAcF,GAChDG,IAAYC,EAAWP,CAAS,GAEhCQ,IAAoBC,EAAqBJ,GAAWH,EAAO,QAAQd,GAAaF,CAAS,GAEzFwB,IAAiC;AAAA,I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AA,kBAChB,aAAY;AAAA,kBAEZ,UAAC,gBAAAN,EAAAO,GAAA,EAAiB,OAAO,IAAI,QAAQ,IAAI;AAAA,gBAAA;AAAA,cAC3C;AAAA,cAEF,aAAa,gBAAAP,EAACQ,GAAgB,EAAA,SAASV,EAAa,CAAA;AAAA,cACpD,YAAY;AAAA,cACZ,YAAY;AAAA,YAAA;AAAA,UACd;AAAA,QAAA,GAEJ;AAAA,0BAECW,GAAA,EACE,UAAAnB,EAAO,IAAI,CACVoB,MAAA,gBAAAV;AAAA,UAACW;AAAA,UAAA;AAAA,YAEC,UAAUvC,KAAY;AAAA,YACtB,UAAAD;AAAA,YACA,UAAAuC;AAAA,YACA,WAAAtB;AAAA,YACA,WAAWK;AAAA,YACX,eAAAf;AAAA,YACA,wBAAAC;AAAA,YACA,kBAAAC;AAAA,YACA,iBAAAC;AAAA,YACA,cAAAC;AAAA,YACA,YAAAC;AAAA,YACA,gBAAAE;AAAA,YACA,cAAAC;AAAA,YACA,kBAAAC;AAAA,UAAA;AAAA,UAdKuB,EAAS;AAAA,QAgBjB,CAAA,GACH;AAAA,MAAA,GACF;AAAA,IAAA;AAAA,EAEJ,EAAA,CAAA;AAEJ;"}
|
|
1
|
+
{"version":3,"file":"block-section-view.js","sources":["../../../../../src/features/chapters-v2/chapter-details/block-sections/block-section-view.tsx"],"sourcesContent":["import type { INodeMenuOption } from '../../comps/node-card/node-menu-options/node-menu-options-types';\nimport type { IBlockSectionProps } from './block-sections-types';\n\nimport { memo, useCallback, type FC } from 'react';\n\nimport Eye2Icon from '../../../../assets/line-icons/icons/eye2';\nimport MoreVerticalIcon from '../../../../assets/line-icons/icons/more-vertical';\nimport RedoIcon from '../../../../assets/line-icons/icons/redo';\nimport SkipIcon from '../../../../assets/line-icons/icons/skip';\nimport ContextMenu from '../../../ui/context-menu/context-menu';\nimport FlexView from '../../../ui/layout/flex-view';\nimport Text from '../../../ui/text/text';\nimport NodeCard from '../../comps/node-card/node-card';\nimport NodeMenuOptions from '../../comps/node-card/node-menu-options/node-menu-options';\nimport SatMockTest from '../../comps/sat-mock-test/sat-mock-test';\nimport { BLOCK_NAME, BLOCK_TYPE } from '../../constants/block-constants';\nimport { getSheetNLessonCount } from '../../utils';\nimport { getActiveSATSheet } from '../../utils/sat-sheet-utils';\nimport * as Styled from './block-sections-styled';\n\nconst BlockSectionView: FC<IBlockSectionProps> = ({\n userType,\n imageHue,\n blockData,\n lessonIdx,\n isLastBlock,\n isGoalBlock,\n blockSectionRef,\n onNodeAttempt,\n onNodeAssignAsHomework,\n onNodeMarkAsDone,\n onNodeReattempt,\n onNodeReview,\n onNodeView,\n onBlockSkipUnskip,\n onNodeUnassign,\n onNodeUnlock,\n onNodeSkipUnSkip,\n onBlockReset,\n}) => {\n const {\n block_type: blockType,\n name,\n sheets,\n permissions,\n block_stats: blockStats,\n state,\n block_statement: blockStatement,\n } = blockData;\n\n const isSatMockTestBlock = blockType === BLOCK_TYPE.SAT_MOCK_TEST;\n\n const {\n can_skip: canSkip,\n can_un_skip: canUnskip,\n can_reset: canReset,\n can_review: canReview,\n } = permissions;\n const blockName = BLOCK_NAME[blockType];\n\n const sheetNLessonCount = getSheetNLessonCount({\n isSkipped: canUnskip,\n sheetsLength: sheets.length,\n isGoalBlock,\n lessonIdx,\n isSatMockTestBlock,\n });\n\n const activeNodeSheet = getActiveSATSheet(sheets);\n\n const renderMenuOptions =\n (isSatMockTestBlock && (canReset || canReview)) ||\n (userType === 'TEACHER' && (canSkip || canUnskip));\n\n const handleSATSheetReview = useCallback(() => {\n if (!activeNodeSheet) {\n throw new Error('Active SAT sheet is not available');\n }\n\n onNodeReview?.(activeNodeSheet);\n }, [activeNodeSheet, onNodeReview]);\n\n const handleBlockSkipUnskip = useCallback(() => {\n onBlockSkipUnskip?.(blockData, canSkip);\n }, [blockData, canSkip, onBlockSkipUnskip]);\n\n const handleBlockReset = useCallback(() => {\n onBlockReset?.(blockData);\n }, [blockData, onBlockReset]);\n\n const menuOptions: INodeMenuOption[] = [\n {\n id: 'node-card-skip',\n label: canUnskip ? `Revert 'Skip'` : 'Skip All',\n icon: SkipIcon,\n disabled: isSatMockTestBlock,\n onClick: handleBlockSkipUnskip,\n },\n {\n id: 'sat-node-card-review',\n label: 'Review',\n icon: Eye2Icon,\n disabled: !canReview,\n onClick: handleSATSheetReview,\n },\n {\n id: 'sat-node-card-reset',\n label: 'Reset',\n icon: RedoIcon,\n disabled: !canReset,\n onClick: handleBlockReset,\n },\n ];\n\n if (userType === 'STUDENT' && canUnskip) return null;\n\n return (\n <div ref={blockSectionRef}>\n <Styled.BlockSectionWrapper\n $background={isGoalBlock ? `WHITE_1` : 'WHITE_3'}\n $gutterX={1}\n $lastBlock={isLastBlock}\n $flexGap={12}\n >\n <FlexView $flexGap={12}>\n <FlexView $flexDirection=\"row\" $alignItems=\"center\" $justifyContent=\"space-between\">\n <FlexView $opacity={canUnskip ? 0.5 : 1}>\n <Text\n $renderAs=\"ac4\"\n $color=\"BLACK_T_60\"\n $textDecoration={canUnskip ? 'line-through' : 'none'}\n >\n {blockName === 'Puzzles' ? name : blockName} {sheetNLessonCount}\n </Text>\n\n {!!isGoalBlock && !!lessonIdx && !isSatMockTestBlock && (\n <Text\n $renderAs=\"ab2-bold\"\n $color=\"BLACK_1\"\n $textDecoration={canUnskip ? 'line-through' : 'none'}\n >\n {name}\n </Text>\n )}\n </FlexView>\n\n {renderMenuOptions && (\n <ContextMenu\n targetElement={\n <Styled.BlockOptionsWrapper\n $width={20}\n $height={20}\n $justifyContent=\"center\"\n $alignItems=\"center\"\n >\n <MoreVerticalIcon width={18} height={18} />\n </Styled.BlockOptionsWrapper>\n }\n menuElement={<NodeMenuOptions options={menuOptions} />}\n menuOffset={5}\n menuZIndex={4}\n />\n )}\n </FlexView>\n\n <>\n {isSatMockTestBlock ? (\n <SatMockTest\n userType={userType}\n imageHue={imageHue || 'BLUE'}\n sheets={sheets}\n blockStats={blockStats}\n blockState={state}\n blockStatement={blockStatement}\n onNodeAttempt={onNodeAttempt}\n onNodeReview={onNodeReview}\n blockPermissions={permissions}\n />\n ) : (\n <Styled.BlockSheetContainer>\n {sheets.map(nodeData => (\n <NodeCard\n key={nodeData.node_id}\n imageHue={imageHue || 'BLUE'}\n userType={userType}\n nodeData={nodeData}\n blockType={blockType}\n isSkipped={canUnskip}\n onNodeAttempt={onNodeAttempt}\n onNodeAssignAsHomework={onNodeAssignAsHomework}\n onNodeMarkAsDone={onNodeMarkAsDone}\n onNodeReattempt={onNodeReattempt}\n onNodeReview={onNodeReview}\n onNodeView={onNodeView}\n onNodeUnassign={onNodeUnassign}\n onNodeUnlock={onNodeUnlock}\n onNodeSkipUnSkip={onNodeSkipUnSkip}\n />\n ))}\n </Styled.BlockSheetContainer>\n )}\n </>\n </FlexView>\n </Styled.BlockSectionWrapper>\n </div>\n );\n};\n\nexport default memo(BlockSectionView);\n"],"names":["BlockSectionView","userType","imageHue","blockData","lessonIdx","isLastBlock","isGoalBlock","blockSectionRef","onNodeAttempt","onNodeAssignAsHomework","onNodeMarkAsDone","onNodeReattempt","onNodeReview","onNodeView","onBlockSkipUnskip","onNodeUnassign","onNodeUnlock","onNodeSkipUnSkip","onBlockReset","blockType","name","sheets","permissions","blockStats","state","blockStatement","isSatMockTestBlock","BLOCK_TYPE","canSkip","canUnskip","canReset","canReview","blockName","BLOCK_NAME","sheetNLessonCount","getSheetNLessonCount","activeNodeSheet","getActiveSATSheet","renderMenuOptions","handleSATSheetReview","useCallback","handleBlockSkipUnskip","handleBlockReset","menuOptions","SkipIcon","Eye2Icon","RedoIcon","jsx","Styled.BlockSectionWrapper","jsxs","FlexView","Text","ContextMenu","Styled.BlockOptionsWrapper","MoreVerticalIcon","NodeMenuOptions","SatMockTest","Styled.BlockSheetContainer","nodeData","NodeCard","BlockSectionView$1","memo"],"mappings":";;;;;;;;;;;;;;;;AAoBA,MAAMA,KAA2C,CAAC;AAAA,EAChD,UAAAC;AAAA,EACA,UAAAC;AAAA,EACA,WAAAC;AAAA,EACA,WA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CAAA;AAEJ,GAEeE,KAAAC,EAAK7D,EAAgB;"}
|
|
@@ -1,52 +1,53 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { memo as
|
|
3
|
-
import
|
|
1
|
+
import { jsxs as T, jsx as c } from "react/jsx-runtime";
|
|
2
|
+
import { memo as b, useMemo as A } from "react";
|
|
3
|
+
import { BLOCK_TYPE as C, SECTION_CODE as g } from "../../constants/block-constants.js";
|
|
4
|
+
import m from "./block-section-view.js";
|
|
4
5
|
import { ChapterDetailsWrapper as R } from "./block-sections-styled.js";
|
|
5
|
-
const C = g((
|
|
6
|
-
const { blocks:
|
|
7
|
-
let
|
|
6
|
+
const { SAT_MOCK_TEST: u, GOAL: y } = C, { GOALS: G, READINESS: I } = g, v = b((_) => {
|
|
7
|
+
const { blocks: t, imageHue: n, userType: i, coreBlocksRef: B, blockSectionRef: S, ...r } = _;
|
|
8
|
+
let p = 0, k = !1;
|
|
8
9
|
const { goalBlocks: d, nonGoalBlocks: a } = A(
|
|
9
|
-
() =>
|
|
10
|
-
(o, e) => (e.section_code ===
|
|
10
|
+
() => t.reduce(
|
|
11
|
+
(o, e) => (e.section_code === G || e.section_code === I || e.block_type === u ? o.goalBlocks.push(e) : o.nonGoalBlocks.push(e), o),
|
|
11
12
|
{ goalBlocks: [], nonGoalBlocks: [] }
|
|
12
13
|
),
|
|
13
|
-
[
|
|
14
|
+
[t]
|
|
14
15
|
);
|
|
15
|
-
return /* @__PURE__ */
|
|
16
|
+
return /* @__PURE__ */ T(
|
|
16
17
|
R,
|
|
17
18
|
{
|
|
18
19
|
$width: "100%",
|
|
19
20
|
$background: a.length ? "WHITE_3" : "WHITE_1",
|
|
20
21
|
children: [
|
|
21
22
|
/* @__PURE__ */ c("div", { ref: B, children: d.map((o, e) => {
|
|
22
|
-
const { block_type:
|
|
23
|
+
const { block_type: l, block_id: s, permissions: E } = o;
|
|
23
24
|
let f = 0;
|
|
24
|
-
const
|
|
25
|
-
return
|
|
26
|
-
|
|
25
|
+
const h = e === d.length - 1;
|
|
26
|
+
return (l === y || l === u) && (E.can_un_skip || (p += 1), f = p), /* @__PURE__ */ c(
|
|
27
|
+
m,
|
|
27
28
|
{
|
|
28
29
|
blockData: o,
|
|
29
30
|
userType: i,
|
|
30
|
-
isLastBlock:
|
|
31
|
+
isLastBlock: h,
|
|
31
32
|
lessonIdx: f,
|
|
32
|
-
imageHue:
|
|
33
|
+
imageHue: n,
|
|
33
34
|
isGoalBlock: !0,
|
|
34
35
|
...r,
|
|
35
36
|
blockSectionRef: void 0
|
|
36
37
|
},
|
|
37
|
-
|
|
38
|
+
s
|
|
38
39
|
);
|
|
39
40
|
}) }),
|
|
40
41
|
a.map((o) => {
|
|
41
|
-
const { block_id: e, block_type:
|
|
42
|
-
return
|
|
43
|
-
|
|
42
|
+
const { block_id: e, block_type: l } = o, s = l === "CHALLENGE_ARENA" && !k;
|
|
43
|
+
return s && (k = !0), /* @__PURE__ */ c(
|
|
44
|
+
m,
|
|
44
45
|
{
|
|
45
46
|
blockData: o,
|
|
46
47
|
userType: i,
|
|
47
|
-
imageHue:
|
|
48
|
+
imageHue: n,
|
|
48
49
|
...r,
|
|
49
|
-
blockSectionRef:
|
|
50
|
+
blockSectionRef: s ? S : void 0
|
|
50
51
|
},
|
|
51
52
|
e
|
|
52
53
|
);
|
|
@@ -56,6 +57,6 @@ const C = g((m) => {
|
|
|
56
57
|
);
|
|
57
58
|
});
|
|
58
59
|
export {
|
|
59
|
-
|
|
60
|
+
v as default
|
|
60
61
|
};
|
|
61
62
|
//# sourceMappingURL=block-sections.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"block-sections.js","sources":["../../../../../src/features/chapters-v2/chapter-details/block-sections/block-sections.tsx"],"sourcesContent":["import type { IBlockSectionsProps } from './block-sections-types';\nimport type { FC } from 'react';\n\nimport { memo, useMemo } from 'react';\n\nimport BlockSectionView from './block-section-view';\nimport * as Styled from './block-sections-styled';\n\nconst BlockSections: FC<IBlockSectionsProps> = memo(props => {\n const { blocks, imageHue, userType, coreBlocksRef, blockSectionRef, ...blockSectionCallBacks } =\n props;\n\n let lessonCount = 0;\n let addChallengeArenaRef = false;\n\n const { goalBlocks, nonGoalBlocks } = useMemo(\n () =>\n blocks.reduce(\n (acc, block) => {\n if (block.section_code ===
|
|
1
|
+
{"version":3,"file":"block-sections.js","sources":["../../../../../src/features/chapters-v2/chapter-details/block-sections/block-sections.tsx"],"sourcesContent":["import type { IBlockSectionsProps } from './block-sections-types';\nimport type { FC } from 'react';\n\nimport { memo, useMemo } from 'react';\n\nimport { BLOCK_TYPE, SECTION_CODE } from '../../constants/block-constants';\nimport BlockSectionView from './block-section-view';\nimport * as Styled from './block-sections-styled';\n\nconst { SAT_MOCK_TEST, GOAL } = BLOCK_TYPE;\nconst { GOALS, READINESS } = SECTION_CODE;\n\nconst BlockSections: FC<IBlockSectionsProps> = memo(props => {\n const { blocks, imageHue, userType, coreBlocksRef, blockSectionRef, ...blockSectionCallBacks } =\n props;\n\n let lessonCount = 0;\n let addChallengeArenaRef = false;\n\n const { goalBlocks, nonGoalBlocks } = useMemo(\n () =>\n blocks.reduce(\n (acc, block) => {\n if (\n block.section_code === GOALS ||\n block.section_code === READINESS ||\n block.block_type === SAT_MOCK_TEST\n ) {\n acc.goalBlocks.push(block);\n } else {\n acc.nonGoalBlocks.push(block);\n }\n\n return acc;\n },\n { goalBlocks: [] as typeof blocks, nonGoalBlocks: [] as typeof blocks },\n ),\n [blocks],\n );\n\n return (\n <Styled.ChapterDetailsWrapper\n $width=\"100%\"\n $background={!nonGoalBlocks.length ? `WHITE_1` : 'WHITE_3'}\n >\n <div ref={coreBlocksRef}>\n {goalBlocks.map((blockData, idx) => {\n const { block_type: blockType, block_id: blockId, permissions } = blockData;\n let lessonIdx = 0;\n\n const isLastBlock = idx === goalBlocks.length - 1;\n\n if (blockType === GOAL || blockType === SAT_MOCK_TEST) {\n if (!permissions.can_un_skip) {\n lessonCount += 1;\n }\n\n lessonIdx = lessonCount;\n }\n\n return (\n <BlockSectionView\n blockData={blockData}\n userType={userType}\n isLastBlock={isLastBlock}\n key={blockId}\n lessonIdx={lessonIdx}\n imageHue={imageHue}\n isGoalBlock\n {...blockSectionCallBacks}\n blockSectionRef={undefined}\n />\n );\n })}\n </div>\n\n {nonGoalBlocks.map(blockData => {\n const { block_id: blockId, block_type: blockType } = blockData;\n\n // Apply blockSectionRef only to the first CHALLENGE_ARENA block\n const shouldApplyRef = blockType === 'CHALLENGE_ARENA' && !addChallengeArenaRef;\n\n if (shouldApplyRef) {\n addChallengeArenaRef = true;\n }\n\n return (\n <BlockSectionView\n key={blockId}\n blockData={blockData}\n userType={userType}\n imageHue={imageHue}\n {...blockSectionCallBacks}\n blockSectionRef={shouldApplyRef ? blockSectionRef : undefined}\n />\n );\n })}\n </Styled.ChapterDetailsWrapper>\n );\n});\n\nexport default BlockSections;\n"],"names":["SAT_MOCK_TEST","GOAL","BLOCK_TYPE","GOALS","READINESS","SECTION_CODE","BlockSections","memo","props","blocks","imageHue","userType","coreBlocksRef","blockSectionRef","blockSectionCallBacks","lessonCount","addChallengeArenaRef","goalBlocks","nonGoalBlocks","useMemo","acc","block","jsxs","Styled.ChapterDetailsWrapper","jsx","blockData","idx","blockType","blockId","permissions","lessonIdx","isLastBlock","BlockSectionView","shouldApplyRef"],"mappings":";;;;;AASA,MAAM,EAAE,eAAAA,GAAe,MAAAC,EAAS,IAAAC,GAC1B,EAAE,OAAAC,GAAO,WAAAC,EAAc,IAAAC,GAEvBC,IAAyCC,EAAK,CAASC,MAAA;AACrD,QAAA,EAAE,QAAAC,GAAQ,UAAAC,GAAU,UAAAC,GAAU,eAAAC,GAAe,iBAAAC,GAAiB,GAAGC,EACrE,IAAAN;AAEF,MAAIO,IAAc,GACdC,IAAuB;AAErB,QAAA,EAAE,YAAAC,GAAY,eAAAC,EAAA,IAAkBC;AAAA,IACpC,MACEV,EAAO;AAAA,MACL,CAACW,GAAKC,OAEFA,EAAM,iBAAiB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AAA,QAMP,CAEH;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAGP,CAAC;"}
|
|
@@ -1,62 +1,63 @@
|
|
|
1
|
-
import { jsxs as c, jsx as
|
|
2
|
-
import { memo as
|
|
3
|
-
import { ILLUSTRATIONS as
|
|
4
|
-
import
|
|
5
|
-
import { useChallengeArenaJourney as
|
|
6
|
-
import { useJourney as
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import { useGetChapterDetails as
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
import { ContentWrapper as
|
|
16
|
-
const
|
|
1
|
+
import { jsxs as c, jsx as t, Fragment as E } from "react/jsx-runtime";
|
|
2
|
+
import { memo as L, useCallback as P, useEffect as p } from "react";
|
|
3
|
+
import { ILLUSTRATIONS as T } from "../../../assets/illustrations/illustrations.js";
|
|
4
|
+
import U from "../../../assets/line-icons/icons/back2.js";
|
|
5
|
+
import { useChallengeArenaJourney as j } from "../../journey/hooks/use-chapter-page-journey/use-challenge-arena-journey.js";
|
|
6
|
+
import { useJourney as H } from "../../journey/use-journey/use-journey.js";
|
|
7
|
+
import F from "../../ui/buttons/button/button.js";
|
|
8
|
+
import O from "../../ui/buttons/icon-button/icon-button.js";
|
|
9
|
+
import W from "../../ui/layout/flex-view.js";
|
|
10
|
+
import X from "../../ui/loader/app-loader/app-loader.js";
|
|
11
|
+
import z from "../../ui/text/text.js";
|
|
12
|
+
import { useGetChapterDetails as G } from "../api/chapter.js";
|
|
13
|
+
import V from "./block-sections/block-sections.js";
|
|
14
|
+
import q from "./chapter-banner/chapter-banner.js";
|
|
15
|
+
import { ContentWrapper as M, BackButtonContainer as K, BackButtonWrapper as Q, LoaderWrapper as Y } from "./chapter-details-styled.js";
|
|
16
|
+
const Z = L((u) => {
|
|
17
17
|
const {
|
|
18
18
|
userChapterId: a,
|
|
19
19
|
studentId: i,
|
|
20
|
-
userType:
|
|
20
|
+
userType: r,
|
|
21
21
|
onBlockSkipUnskip: k,
|
|
22
22
|
onNodeAttempt: C,
|
|
23
23
|
onNodeAssignAsHomework: y,
|
|
24
24
|
onNodeMarkAsDone: A,
|
|
25
|
-
onNodeReattempt:
|
|
26
|
-
onNodeReview:
|
|
27
|
-
onNodeView:
|
|
28
|
-
onExit:
|
|
29
|
-
onNodeUnassign:
|
|
30
|
-
onNodeUnlock:
|
|
31
|
-
onNodeSkipUnSkip:
|
|
25
|
+
onNodeReattempt: B,
|
|
26
|
+
onNodeReview: S,
|
|
27
|
+
onNodeView: $,
|
|
28
|
+
onExit: N,
|
|
29
|
+
onNodeUnassign: x,
|
|
30
|
+
onNodeUnlock: R,
|
|
31
|
+
onNodeSkipUnSkip: w,
|
|
32
32
|
startChapterPageJourney: s,
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
33
|
+
onBlockReset: I,
|
|
34
|
+
chapterPageRef: b,
|
|
35
|
+
bannerRef: J,
|
|
36
|
+
coreBlocksRef: _,
|
|
36
37
|
canStartJourney: l,
|
|
37
38
|
canStartChallengeArenaJourney: h
|
|
38
|
-
} = u, { isJourneyActive: m } =
|
|
39
|
-
get:
|
|
39
|
+
} = u, { isJourneyActive: m } = H(), {
|
|
40
|
+
get: g,
|
|
40
41
|
data: e,
|
|
41
42
|
isProcessing: o,
|
|
42
|
-
isProcessingFailed:
|
|
43
|
-
isStale:
|
|
44
|
-
} =
|
|
45
|
-
|
|
46
|
-
}, [
|
|
43
|
+
isProcessingFailed: v,
|
|
44
|
+
isStale: d
|
|
45
|
+
} = G(), n = P(() => {
|
|
46
|
+
g(a, void 0, { studentId: i });
|
|
47
|
+
}, [g, a, i]);
|
|
47
48
|
p(() => {
|
|
48
49
|
n();
|
|
49
50
|
}, [n]);
|
|
50
|
-
const { blockSectionRef:
|
|
51
|
+
const { blockSectionRef: D, startJourney: f } = j();
|
|
51
52
|
return p(() => {
|
|
52
53
|
e && l && !m && s && s({
|
|
53
54
|
chapterDetails: e,
|
|
54
55
|
userChapterId: a,
|
|
55
56
|
studentId: i,
|
|
56
|
-
userType:
|
|
57
|
+
userType: r
|
|
57
58
|
}), e && !l && h && !m && f({
|
|
58
59
|
chapterDetails: e,
|
|
59
|
-
userType:
|
|
60
|
+
userType: r
|
|
60
61
|
});
|
|
61
62
|
}, [
|
|
62
63
|
h,
|
|
@@ -67,13 +68,13 @@ const Y = E((u) => {
|
|
|
67
68
|
s,
|
|
68
69
|
i,
|
|
69
70
|
a,
|
|
70
|
-
|
|
71
|
+
r
|
|
71
72
|
]), p(() => {
|
|
72
|
-
!o &&
|
|
73
|
-
}, [n, o,
|
|
74
|
-
/* @__PURE__ */
|
|
75
|
-
/* @__PURE__ */
|
|
76
|
-
|
|
73
|
+
!o && d && n();
|
|
74
|
+
}, [n, o, d]), v ? /* @__PURE__ */ c(W, { $flexGapX: 1.5, $height: "100vh", $justifyContent: "center", $alignItems: "center", children: [
|
|
75
|
+
/* @__PURE__ */ t(z, { $renderAs: "h6", children: "Oops! Something went wrong. Please try again later." }),
|
|
76
|
+
/* @__PURE__ */ t(
|
|
77
|
+
F,
|
|
77
78
|
{
|
|
78
79
|
widthX: 14,
|
|
79
80
|
size: "small",
|
|
@@ -83,63 +84,65 @@ const Y = E((u) => {
|
|
|
83
84
|
onClick: n
|
|
84
85
|
}
|
|
85
86
|
)
|
|
86
|
-
] }) : !e && o ? /* @__PURE__ */
|
|
87
|
-
|
|
87
|
+
] }) : !e && o ? /* @__PURE__ */ t(X, { height: "100vh" }) : /* @__PURE__ */ c(
|
|
88
|
+
M,
|
|
88
89
|
{
|
|
89
|
-
ref:
|
|
90
|
+
ref: b,
|
|
90
91
|
$widthX: 50,
|
|
91
92
|
$disablePointerEvents: o,
|
|
92
93
|
$justifyContent: "center",
|
|
93
94
|
$alignItems: "center",
|
|
95
|
+
$height: "max-content",
|
|
94
96
|
children: [
|
|
95
|
-
|
|
96
|
-
|
|
97
|
+
r === "TEACHER" && /* @__PURE__ */ t(K, { $height: "100%", className: "goal-widget-chapter-item", children: /* @__PURE__ */ t(Q, { children: /* @__PURE__ */ t(
|
|
98
|
+
O,
|
|
97
99
|
{
|
|
98
|
-
Icon:
|
|
100
|
+
Icon: U,
|
|
99
101
|
renderAs: "secondary-gray",
|
|
100
102
|
analyticsLabel: "chapter_page_exit",
|
|
101
103
|
size: "xsmall",
|
|
102
|
-
onClick:
|
|
104
|
+
onClick: N
|
|
103
105
|
}
|
|
104
106
|
) }) }),
|
|
105
|
-
o && /* @__PURE__ */
|
|
106
|
-
e && /* @__PURE__ */ c(
|
|
107
|
-
/* @__PURE__ */
|
|
108
|
-
|
|
107
|
+
o && /* @__PURE__ */ t(Y, { children: /* @__PURE__ */ t("img", { src: T.LOADER_1, alt: "loader" }) }),
|
|
108
|
+
e && /* @__PURE__ */ c(E, { children: [
|
|
109
|
+
/* @__PURE__ */ t(
|
|
110
|
+
q,
|
|
109
111
|
{
|
|
110
112
|
title: e.name,
|
|
111
113
|
imageHue: e.image_hue,
|
|
112
114
|
imageUrl: e.image_url,
|
|
113
115
|
progressStats: e == null ? void 0 : e.progress_stat,
|
|
114
|
-
bannerRef:
|
|
116
|
+
bannerRef: J
|
|
115
117
|
}
|
|
116
118
|
),
|
|
117
|
-
/* @__PURE__ */
|
|
118
|
-
|
|
119
|
+
/* @__PURE__ */ t(
|
|
120
|
+
V,
|
|
119
121
|
{
|
|
120
122
|
imageHue: e.image_hue,
|
|
121
|
-
userType:
|
|
123
|
+
userType: r,
|
|
122
124
|
blocks: e.blocks,
|
|
123
125
|
onBlockSkipUnskip: k,
|
|
124
126
|
onNodeAttempt: C,
|
|
125
127
|
onNodeAssignAsHomework: y,
|
|
126
128
|
onNodeMarkAsDone: A,
|
|
127
|
-
onNodeReattempt:
|
|
128
|
-
onNodeReview:
|
|
129
|
-
onNodeView:
|
|
130
|
-
coreBlocksRef:
|
|
131
|
-
blockSectionRef:
|
|
132
|
-
onNodeUnassign:
|
|
133
|
-
onNodeUnlock:
|
|
134
|
-
onNodeSkipUnSkip:
|
|
129
|
+
onNodeReattempt: B,
|
|
130
|
+
onNodeReview: S,
|
|
131
|
+
onNodeView: $,
|
|
132
|
+
coreBlocksRef: _,
|
|
133
|
+
blockSectionRef: D,
|
|
134
|
+
onNodeUnassign: x,
|
|
135
|
+
onNodeUnlock: R,
|
|
136
|
+
onNodeSkipUnSkip: w,
|
|
137
|
+
onBlockReset: I
|
|
135
138
|
}
|
|
136
139
|
)
|
|
137
140
|
] })
|
|
138
141
|
]
|
|
139
142
|
}
|
|
140
143
|
);
|
|
141
|
-
}),
|
|
144
|
+
}), fe = Z;
|
|
142
145
|
export {
|
|
143
|
-
|
|
146
|
+
fe as default
|
|
144
147
|
};
|
|
145
148
|
//# sourceMappingURL=chapter-details.js.map
|