@cuemath/leap 2.8.61-as1 → 2.8.61-as11
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/assets/line-icons/icons/chevron-left.js.map +1 -1
- package/dist/assets/line-icons/icons/chevron-right.js.map +1 -1
- package/dist/features/chapters/chapters-list/chapter-item/chapter-item-styled.js +23 -22
- package/dist/features/chapters/chapters-list/chapter-item/chapter-item-styled.js.map +1 -1
- package/dist/features/chapters/chapters-list/chapter-item/chapter-item.js +88 -74
- package/dist/features/chapters/chapters-list/chapter-item/chapter-item.js.map +1 -1
- package/dist/features/chapters/chapters-list/chapters-list.js +17 -18
- package/dist/features/chapters/chapters-list/chapters-list.js.map +1 -1
- package/dist/features/chapters-v2/chapter-details/block-sections/block-section-view.js +39 -39
- 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 +32 -28
- package/dist/features/chapters-v2/chapter-details/block-sections/block-sections.js.map +1 -1
- package/dist/features/chapters-v2/chapter-details/chapter-banner/chapter-banner.js +22 -22
- package/dist/features/chapters-v2/chapter-details/chapter-banner/chapter-banner.js.map +1 -1
- package/dist/features/chapters-v2/comps/node-card/node-card-tags.js +6 -6
- package/dist/features/chapters-v2/comps/node-card/node-card-tags.js.map +1 -1
- package/dist/features/chapters-v2/comps/node-card/teacher-actions/teacher-actions.js +70 -71
- package/dist/features/chapters-v2/comps/node-card/teacher-actions/teacher-actions.js.map +1 -1
- package/dist/features/chapters-v2/constants/node-constants.js +0 -1
- package/dist/features/chapters-v2/constants/node-constants.js.map +1 -1
- package/dist/features/chapters-v2/utils/index.js +4 -4
- package/dist/features/chapters-v2/utils/index.js.map +1 -1
- package/dist/features/chapters-v2/utils/node-card-utils.js +59 -42
- package/dist/features/chapters-v2/utils/node-card-utils.js.map +1 -1
- package/dist/features/communication/pub-sub/constants.js +5 -2
- package/dist/features/communication/pub-sub/constants.js.map +1 -1
- package/dist/features/homework/card-menu-options.js +35 -20
- package/dist/features/homework/card-menu-options.js.map +1 -1
- package/dist/features/homework/homework-card.js +241 -161
- package/dist/features/homework/homework-card.js.map +1 -1
- package/dist/features/homework/hw-card-list/api/get-homeworks.js +10 -0
- package/dist/features/homework/hw-card-list/api/get-homeworks.js.map +1 -0
- package/dist/features/homework/hw-card-list/hw-card-list-styled.js +53 -0
- package/dist/features/homework/hw-card-list/hw-card-list-styled.js.map +1 -0
- package/dist/features/homework/hw-card-list/hw-card-list.js +164 -0
- package/dist/features/homework/hw-card-list/hw-card-list.js.map +1 -0
- package/dist/features/homework/node-progress.js +29 -0
- package/dist/features/homework/node-progress.js.map +1 -0
- package/dist/features/homework/styles.js +41 -38
- package/dist/features/homework/styles.js.map +1 -1
- package/dist/features/milestone/create/comps/chapter-item/chapter-item.js +42 -49
- package/dist/features/milestone/create/comps/chapter-item/chapter-item.js.map +1 -1
- package/dist/features/milestone/create/comps/sheets-list/sheets-list-styled.js +14 -20
- package/dist/features/milestone/create/comps/sheets-list/sheets-list-styled.js.map +1 -1
- package/dist/features/milestone/create/comps/sheets-list/sheets-list.js +26 -50
- package/dist/features/milestone/create/comps/sheets-list/sheets-list.js.map +1 -1
- package/dist/features/milestone/create/utils/index.js +33 -38
- package/dist/features/milestone/create/utils/index.js.map +1 -1
- package/dist/features/milestone/edit/goal-edit-helpers.js +50 -53
- package/dist/features/milestone/edit/goal-edit-helpers.js.map +1 -1
- package/dist/features/milestone/milestone-list-container/milestone-list/milestone-widget/milestone-info.js +10 -10
- package/dist/features/milestone/milestone-list-container/milestone-list/milestone-widget/milestone-info.js.map +1 -1
- package/dist/features/milestone/milestone-tests/test-list-v2/test-list-view.js +17 -15
- package/dist/features/milestone/milestone-tests/test-list-v2/test-list-view.js.map +1 -1
- package/dist/features/milestone/milestone-tests/tests-list/test-sheets-list/test-sheet-item/test-sheet-item-utils.js +10 -0
- package/dist/features/milestone/milestone-tests/tests-list/test-sheets-list/test-sheet-item/test-sheet-item-utils.js.map +1 -0
- package/dist/features/recent-chapters/recent-chapters.js +17 -23
- package/dist/features/recent-chapters/recent-chapters.js.map +1 -1
- package/dist/features/sheet-v2/resource-list/resource-list.js +12 -10
- package/dist/features/sheet-v2/resource-list/resource-list.js.map +1 -1
- package/dist/index.d.ts +54 -24
- package/dist/index.js +41 -37
- package/dist/index.js.map +1 -1
- package/dist/node_modules/date-fns/differenceInDays.js +17 -0
- package/dist/node_modules/date-fns/differenceInDays.js.map +1 -0
- package/package.json +1 -1
@@ -1,112 +1,112 @@
|
|
1
1
|
import { jsx as t, jsxs as n } from "react/jsx-runtime";
|
2
|
-
import
|
2
|
+
import S from "../../../../assets/line-icons/icons/more-vertical.js";
|
3
3
|
import I from "../../../../assets/line-icons/icons/skip.js";
|
4
4
|
import O from "../../../ui/context-menu/context-menu.js";
|
5
5
|
import c from "../../../ui/layout/flex-view.js";
|
6
|
-
import
|
6
|
+
import u from "../../../ui/text/text.js";
|
7
7
|
import T from "../../comps/node-card/node-card.js";
|
8
8
|
import j from "../../comps/node-card/node-menu-options/node-menu-options.js";
|
9
|
-
import { BLOCK_NAME as
|
10
|
-
import { getSheetNLessonCount as
|
11
|
-
import { BlockSectionWrapper as
|
12
|
-
const
|
9
|
+
import { BLOCK_NAME as k } from "../../constants/block-constants.js";
|
10
|
+
import { getSheetNLessonCount as y } from "../../utils/index.js";
|
11
|
+
import { BlockSectionWrapper as M, BlockOptionsWrapper as B, BlockSheetContainer as K } from "./block-sections-styled.js";
|
12
|
+
const q = ({
|
13
13
|
userType: o,
|
14
14
|
imageHue: m,
|
15
|
-
blockData:
|
16
|
-
lessonIdx:
|
17
|
-
isLastBlock:
|
15
|
+
blockData: l,
|
16
|
+
lessonIdx: s,
|
17
|
+
isLastBlock: C,
|
18
18
|
isGoalBlock: r,
|
19
|
-
onNodeAttempt:
|
20
|
-
onNodeAttemptLocationChange:
|
19
|
+
onNodeAttempt: g,
|
20
|
+
onNodeAttemptLocationChange: x,
|
21
21
|
onNodeMarkAsDone: _,
|
22
|
-
onNodeReattempt:
|
23
|
-
onNodeReview:
|
24
|
-
onNodeView:
|
22
|
+
onNodeReattempt: b,
|
23
|
+
onNodeReview: E,
|
24
|
+
onNodeView: N,
|
25
25
|
onBlockSkipUnskip: i
|
26
26
|
}) => {
|
27
|
-
const { block_type:
|
27
|
+
const { block_type: p, name: a, sheets: d, permissions: w } = l, { can_skip: h, can_un_skip: e } = w, f = k[p], A = y(e, d.length, r, s), L = [
|
28
28
|
{
|
29
29
|
id: "node-card-skip",
|
30
|
-
label:
|
30
|
+
label: e ? "Revert 'Skip'" : "Skip",
|
31
31
|
icon: I,
|
32
32
|
disabled: !1,
|
33
|
-
onClick: () => i == null ? void 0 : i(
|
33
|
+
onClick: () => i == null ? void 0 : i(l, h)
|
34
34
|
}
|
35
35
|
];
|
36
36
|
return o === "STUDENT" && e ? null : /* @__PURE__ */ t(
|
37
|
-
|
37
|
+
M,
|
38
38
|
{
|
39
39
|
$background: r ? `${m}_1` : "WHITE_1",
|
40
40
|
$gutterX: 1,
|
41
|
-
$lastBlock:
|
41
|
+
$lastBlock: C,
|
42
42
|
$flexGap: 12,
|
43
43
|
children: /* @__PURE__ */ n(c, { $flexGap: 12, children: [
|
44
44
|
/* @__PURE__ */ n(c, { $flexDirection: "row", $alignItems: "center", $justifyContent: "space-between", children: [
|
45
45
|
/* @__PURE__ */ n(c, { $opacity: e ? 0.5 : 1, children: [
|
46
46
|
/* @__PURE__ */ n(
|
47
|
-
|
47
|
+
u,
|
48
48
|
{
|
49
49
|
$renderAs: "ac4",
|
50
50
|
$color: "BLACK_T_60",
|
51
51
|
$textDecoration: e ? "line-through" : "none",
|
52
52
|
children: [
|
53
|
-
|
53
|
+
f === "Puzzles" ? a : f,
|
54
54
|
" ",
|
55
|
-
|
55
|
+
A
|
56
56
|
]
|
57
57
|
}
|
58
58
|
),
|
59
|
-
r && (
|
60
|
-
|
59
|
+
r && (s ?? 0) > 0 && /* @__PURE__ */ t(
|
60
|
+
u,
|
61
61
|
{
|
62
62
|
$renderAs: "ab2-bold",
|
63
63
|
$color: "BLACK_1",
|
64
64
|
$textDecoration: e ? "line-through" : "none",
|
65
|
-
children:
|
65
|
+
children: a
|
66
66
|
}
|
67
67
|
)
|
68
68
|
] }),
|
69
|
-
o === "TEACHER" && (
|
69
|
+
o === "TEACHER" && (h || e) && /* @__PURE__ */ t(
|
70
70
|
O,
|
71
71
|
{
|
72
72
|
targetElement: /* @__PURE__ */ t(
|
73
|
-
|
73
|
+
B,
|
74
74
|
{
|
75
75
|
$width: 20,
|
76
76
|
$height: 20,
|
77
77
|
$justifyContent: "center",
|
78
78
|
$alignItems: "center",
|
79
|
-
children: /* @__PURE__ */ t(
|
79
|
+
children: /* @__PURE__ */ t(S, { width: 16, height: 16 })
|
80
80
|
}
|
81
81
|
),
|
82
|
-
menuElement: /* @__PURE__ */ t(j, { options:
|
82
|
+
menuElement: /* @__PURE__ */ t(j, { options: L }),
|
83
83
|
menuOffset: 5,
|
84
84
|
menuZIndex: 4
|
85
85
|
}
|
86
86
|
)
|
87
87
|
] }),
|
88
|
-
/* @__PURE__ */ t(
|
88
|
+
/* @__PURE__ */ t(K, { $opacity: e ? 0.5 : 1, children: d.map(($) => /* @__PURE__ */ t(
|
89
89
|
T,
|
90
90
|
{
|
91
91
|
imageHue: m || "BLUE",
|
92
92
|
userType: o,
|
93
|
-
nodeData:
|
94
|
-
blockType:
|
93
|
+
nodeData: $,
|
94
|
+
blockType: p,
|
95
95
|
isSkipped: e,
|
96
|
-
onNodeAttempt:
|
97
|
-
onNodeAttemptLocationChange:
|
96
|
+
onNodeAttempt: g,
|
97
|
+
onNodeAttemptLocationChange: x,
|
98
98
|
onNodeMarkAsDone: _,
|
99
|
-
onNodeReattempt:
|
100
|
-
onNodeReview:
|
101
|
-
onNodeView:
|
99
|
+
onNodeReattempt: b,
|
100
|
+
onNodeReview: E,
|
101
|
+
onNodeView: N
|
102
102
|
},
|
103
|
-
|
103
|
+
$.node_id
|
104
104
|
)) })
|
105
105
|
] })
|
106
106
|
}
|
107
107
|
);
|
108
108
|
};
|
109
109
|
export {
|
110
|
-
|
110
|
+
q as default
|
111
111
|
};
|
112
112
|
//# 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 onNodeAttempt,\n onNodeAttemptLocationChange,\n onNodeMarkAsDone,\n onNodeReattempt,\n onNodeReview,\n onNodeView,\n onBlockSkipUnskip,\n}) => {\n const { block_type: blockType, name, sheets,
|
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 onNodeAttempt,\n onNodeAttemptLocationChange,\n onNodeMarkAsDone,\n onNodeReattempt,\n onNodeReview,\n onNodeView,\n onBlockSkipUnskip,\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',\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 <Styled.BlockSectionWrapper\n $background={isGoalBlock ? `${imageHue}_1` : 'WHITE_1'}\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 ?? 0) > 0 && (\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={16} height={16} />\n </Styled.BlockOptionsWrapper>\n }\n menuElement={<NodeMenuOptions options={menuOptions} />}\n menuOffset={5}\n menuZIndex={4}\n />\n )}\n </FlexView>\n\n <Styled.BlockSheetContainer $opacity={canUnskip ? 0.5 : 1}>\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 onNodeAttemptLocationChange={onNodeAttemptLocationChange}\n onNodeMarkAsDone={onNodeMarkAsDone}\n onNodeReattempt={onNodeReattempt}\n onNodeReview={onNodeReview}\n onNodeView={onNodeView}\n />\n ))}\n </Styled.BlockSheetContainer>\n </FlexView>\n </Styled.BlockSectionWrapper>\n );\n};\n\nexport default BlockSectionView;\n"],"names":["BlockSectionView","userType","imageHue","blockData","lessonIdx","isLastBlock","isGoalBlock","onNodeAttempt","onNodeAttemptLocationChange","onNodeMarkAsDone","onNodeReattempt","onNodeReview","onNodeView","onBlockSkipUnskip","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,eAAAC;AAAA,EACA,6BAAAC;AAAA,EACA,kBAAAC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A,gBACP,iBAAiBX,IAAY,iBAAiB;AAAA,gBAE7C,UAAAJ;AAAA,cAAA;AAAA,YACH;AAAA,UAAA,GAEJ;AAAA,UAECd,MAAa,cAAciB,KAAWC,MACrC,gBAAAO;AAAA,YAACK;AAAA,YAAA;AAAA,cACC,eACE,gBAAAL;AAAA,gBAACM;AAAAA,gBAAA;AAAA,kBACC,QAAQ;AAAA,kBACR,SAAS;AAAA,kBACT,iBAAgB;AAAA,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,QAEA,gBAAAE,EAACS,GAAA,EAA2B,UAAUhB,IAAY,MAAM,GACrD,UAAOH,EAAA,IAAI,CACVoB,MAAA,gBAAAV;AAAA,UAACW;AAAA,UAAA;AAAA,YAEC,UAAUnC,KAAY;AAAA,YACtB,UAAAD;AAAA,YACA,UAAAmC;AAAA,YACA,WAAAtB;AAAA,YACA,WAAWK;AAAA,YACX,eAAAZ;AAAA,YACA,6BAAAC;AAAA,YACA,kBAAAC;AAAA,YACA,iBAAAC;AAAA,YACA,cAAAC;AAAA,YACA,YAAAC;AAAA,UAAA;AAAA,UAXKwB,EAAS;AAAA,QAajB,CAAA,GACH;AAAA,MAAA,GACF;AAAA,IAAA;AAAA,EAAA;AAGN;"}
|
@@ -1,8 +1,8 @@
|
|
1
|
-
import { jsxs as
|
2
|
-
import { memo as
|
1
|
+
import { jsxs as G, jsx as f } from "react/jsx-runtime";
|
2
|
+
import { memo as I } from "react";
|
3
3
|
import L from "../../../ui/layout/flex-view.js";
|
4
|
-
import
|
5
|
-
const
|
4
|
+
import u from "./block-section-view.js";
|
5
|
+
const b = I((A) => {
|
6
6
|
const {
|
7
7
|
blocks: t,
|
8
8
|
imageHue: n,
|
@@ -11,41 +11,45 @@ const O = G((A) => {
|
|
11
11
|
onNodeAttemptLocationChange: c,
|
12
12
|
onNodeMarkAsDone: l,
|
13
13
|
onNodeReattempt: r,
|
14
|
-
onNodeReview:
|
15
|
-
onNodeView:
|
16
|
-
onBlockSkipUnskip:
|
14
|
+
onNodeReview: d,
|
15
|
+
onNodeView: p,
|
16
|
+
onBlockSkipUnskip: m
|
17
17
|
} = A;
|
18
|
-
let
|
19
|
-
const
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
18
|
+
let k = 0;
|
19
|
+
const S = t.filter(
|
20
|
+
(o) => o.section_code === "GOALS" || o.section_code === "READINESS"
|
21
|
+
), N = t.filter(
|
22
|
+
(o) => o.section_code !== "GOALS" && o.section_code !== "READINESS"
|
23
|
+
);
|
24
|
+
return /* @__PURE__ */ G(L, { $width: "100%", children: [
|
25
|
+
S.map((o, e) => {
|
26
|
+
const { block_type: _, block_id: B, is_skipped: w } = o;
|
27
|
+
let a = 0;
|
28
|
+
const x = e === S.length - 1;
|
29
|
+
return _ === "GOAL" && (w || (k += 1), a = k), /* @__PURE__ */ f(
|
30
|
+
u,
|
27
31
|
{
|
28
32
|
blockData: o,
|
29
33
|
userType: i,
|
30
|
-
isLastBlock:
|
31
|
-
lessonIdx:
|
34
|
+
isLastBlock: x,
|
35
|
+
lessonIdx: a,
|
32
36
|
imageHue: n,
|
33
37
|
isGoalBlock: !0,
|
34
38
|
onNodeAttempt: s,
|
35
39
|
onNodeAttemptLocationChange: c,
|
36
40
|
onNodeMarkAsDone: l,
|
37
41
|
onNodeReattempt: r,
|
38
|
-
onNodeReview:
|
39
|
-
onNodeView:
|
40
|
-
onBlockSkipUnskip:
|
42
|
+
onNodeReview: d,
|
43
|
+
onNodeView: p,
|
44
|
+
onBlockSkipUnskip: m
|
41
45
|
},
|
42
|
-
|
46
|
+
B
|
43
47
|
);
|
44
48
|
}),
|
45
49
|
N.map((o) => {
|
46
50
|
const { block_id: e } = o;
|
47
|
-
return /* @__PURE__ */
|
48
|
-
|
51
|
+
return /* @__PURE__ */ f(
|
52
|
+
u,
|
49
53
|
{
|
50
54
|
blockData: o,
|
51
55
|
userType: i,
|
@@ -54,9 +58,9 @@ const O = G((A) => {
|
|
54
58
|
onNodeAttemptLocationChange: c,
|
55
59
|
onNodeMarkAsDone: l,
|
56
60
|
onNodeReattempt: r,
|
57
|
-
onNodeReview:
|
58
|
-
onNodeView:
|
59
|
-
onBlockSkipUnskip:
|
61
|
+
onNodeReview: d,
|
62
|
+
onNodeView: p,
|
63
|
+
onBlockSkipUnskip: m
|
60
64
|
},
|
61
65
|
e
|
62
66
|
);
|
@@ -64,6 +68,6 @@ const O = G((A) => {
|
|
64
68
|
] });
|
65
69
|
});
|
66
70
|
export {
|
67
|
-
|
71
|
+
b as default
|
68
72
|
};
|
69
73
|
//# 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 } from 'react';\n\nimport FlexView from '../../../ui/layout/flex-view';\nimport BlockSectionView from './block-section-view';\n\nconst BlockSections: FC<IBlockSectionsProps> = memo(props => {\n const {\n blocks,\n imageHue,\n userType,\n onNodeAttempt,\n onNodeAttemptLocationChange,\n onNodeMarkAsDone,\n onNodeReattempt,\n onNodeReview,\n onNodeView,\n onBlockSkipUnskip,\n } = props;\n\n let lessonCount = 0;\n\n const goalBlocks = blocks.filter(block => block.section_code === 'GOALS');\n const nonGoalBlocks = blocks.filter(block => block.section_code !== 'GOALS');\n\n return (\n <FlexView $width=\"100%\">\n {goalBlocks.map((blockData, idx) => {\n const { block_type: blockType, block_id: blockId, is_skipped: isSkipped } = blockData;\n let lessonIdx = 0;\n\n const isLastBlock = idx === goalBlocks.length - 1;\n\n if (blockType === 'GOAL') {\n if (!isSkipped) {\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 onNodeAttempt={onNodeAttempt}\n onNodeAttemptLocationChange={onNodeAttemptLocationChange}\n onNodeMarkAsDone={onNodeMarkAsDone}\n onNodeReattempt={onNodeReattempt}\n onNodeReview={onNodeReview}\n onNodeView={onNodeView}\n onBlockSkipUnskip={onBlockSkipUnskip}\n />\n );\n })}\n\n {nonGoalBlocks.map(blockData => {\n const { block_id: blockId } = blockData;\n\n return (\n <BlockSectionView\n key={blockId}\n blockData={blockData}\n userType={userType}\n imageHue={imageHue}\n onNodeAttempt={onNodeAttempt}\n onNodeAttemptLocationChange={onNodeAttemptLocationChange}\n onNodeMarkAsDone={onNodeMarkAsDone}\n onNodeReattempt={onNodeReattempt}\n onNodeReview={onNodeReview}\n onNodeView={onNodeView}\n onBlockSkipUnskip={onBlockSkipUnskip}\n />\n );\n })}\n </FlexView>\n );\n});\n\nexport default BlockSections;\n"],"names":["BlockSections","memo","props","blocks","imageHue","userType","onNodeAttempt","onNodeAttemptLocationChange","onNodeMarkAsDone","onNodeReattempt","onNodeReview","onNodeView","onBlockSkipUnskip","lessonCount","goalBlocks","block","nonGoalBlocks","jsxs","FlexView","blockData","idx","blockType","blockId","isSkipped","lessonIdx","isLastBlock","jsx","BlockSectionView"],"mappings":";;;;AAQM,MAAAA,IAAyCC,EAAK,CAASC,MAAA;AACrD,QAAA;AAAA,IACJ,QAAAC;AAAA,IACA,UAAAC;AAAA,IACA,UAAAC;AAAA,IACA,eAAAC;AAAA,IACA,6BAAAC;AAAA,IACA,kBAAAC;AAAA,IACA,iBAAAC;AAAA,IACA,cAAAC;AAAA,IACA,YAAAC;AAAA,IACA,mBAAAC;AAAA,EACE,IAAAV;AAEJ,MAAIW,IAAc;AAElB,QAAMC,IAAaX,EAAO,
|
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 } from 'react';\n\nimport FlexView from '../../../ui/layout/flex-view';\nimport BlockSectionView from './block-section-view';\n\nconst BlockSections: FC<IBlockSectionsProps> = memo(props => {\n const {\n blocks,\n imageHue,\n userType,\n onNodeAttempt,\n onNodeAttemptLocationChange,\n onNodeMarkAsDone,\n onNodeReattempt,\n onNodeReview,\n onNodeView,\n onBlockSkipUnskip,\n } = props;\n\n let lessonCount = 0;\n\n const goalBlocks = blocks.filter(\n block => block.section_code === 'GOALS' || block.section_code === 'READINESS',\n );\n\n const nonGoalBlocks = blocks.filter(\n block => block.section_code !== 'GOALS' && block.section_code !== 'READINESS',\n );\n\n return (\n <FlexView $width=\"100%\">\n {goalBlocks.map((blockData, idx) => {\n const { block_type: blockType, block_id: blockId, is_skipped: isSkipped } = blockData;\n let lessonIdx = 0;\n\n const isLastBlock = idx === goalBlocks.length - 1;\n\n if (blockType === 'GOAL') {\n if (!isSkipped) {\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 onNodeAttempt={onNodeAttempt}\n onNodeAttemptLocationChange={onNodeAttemptLocationChange}\n onNodeMarkAsDone={onNodeMarkAsDone}\n onNodeReattempt={onNodeReattempt}\n onNodeReview={onNodeReview}\n onNodeView={onNodeView}\n onBlockSkipUnskip={onBlockSkipUnskip}\n />\n );\n })}\n\n {nonGoalBlocks.map(blockData => {\n const { block_id: blockId } = blockData;\n\n return (\n <BlockSectionView\n key={blockId}\n blockData={blockData}\n userType={userType}\n imageHue={imageHue}\n onNodeAttempt={onNodeAttempt}\n onNodeAttemptLocationChange={onNodeAttemptLocationChange}\n onNodeMarkAsDone={onNodeMarkAsDone}\n onNodeReattempt={onNodeReattempt}\n onNodeReview={onNodeReview}\n onNodeView={onNodeView}\n onBlockSkipUnskip={onBlockSkipUnskip}\n />\n );\n })}\n </FlexView>\n );\n});\n\nexport default BlockSections;\n"],"names":["BlockSections","memo","props","blocks","imageHue","userType","onNodeAttempt","onNodeAttemptLocationChange","onNodeMarkAsDone","onNodeReattempt","onNodeReview","onNodeView","onBlockSkipUnskip","lessonCount","goalBlocks","block","nonGoalBlocks","jsxs","FlexView","blockData","idx","blockType","blockId","isSkipped","lessonIdx","isLastBlock","jsx","BlockSectionView"],"mappings":";;;;AAQM,MAAAA,IAAyCC,EAAK,CAASC,MAAA;AACrD,QAAA;AAAA,IACJ,QAAAC;AAAA,IACA,UAAAC;AAAA,IACA,UAAAC;AAAA,IACA,eAAAC;AAAA,IACA,6BAAAC;AAAA,IACA,kBAAAC;AAAA,IACA,iBAAAC;AAAA,IACA,cAAAC;AAAA,IACA,YAAAC;AAAA,IACA,mBAAAC;AAAA,EACE,IAAAV;AAEJ,MAAIW,IAAc;AAElB,QAAMC,IAAaX,EAAO;AAAA,IACxB,CAASY,MAAAA,EAAM,iBAAiB,WAAWA,EAAM,iBAAiB;AAAA,EAAA,GAG9DC,IAAgBb,EAAO;AAAA,IAC3B,CAASY,MAAAA,EAAM,iBAAiB,WAAWA,EAAM,iBAAiB;AAAA,EAAA;AAIlE,SAAA,gBAAAE,EAACC,GAAS,EAAA,QAAO,QACd,UAAA;AAAA,IAAWJ,EAAA,IAAI,CAACK,GAAWC,MAAQ;AAClC,YAAM,EAAE,YAAYC,GAAW,UAAUC,GAAS,YAAYC,EAAc,IAAAJ;AAC5E,UAAIK,IAAY;AAEV,YAAAC,IAAcL,MAAQN,EAAW,SAAS;AAEhD,aAAIO,MAAc,WACXE,MACYV,KAAA,IAGLW,IAAAX,IAIZ,gBAAAa;AAAA,QAACC;AAAA,QAAA;AAAA,UACC,WAAAR;AAAA,UACA,UAAAd;AAAA,UACA,aAAAoB;AAAA,UAEA,WAAAD;AAAA,UACA,UAAApB;AAAA,UACA,aAAW;AAAA,UACX,eAAAE;AAAA,UACA,6BAAAC;AAAA,UACA,kBAAAC;AAAA,UACA,iBAAAC;AAAA,UACA,cAAAC;AAAA,UACA,YAAAC;AAAA,UACA,mBAAAC;AAAA,QAAA;AAAA,QAVKU;AAAA,MAAA;AAAA,IAWP,CAEH;AAAA,IAEAN,EAAc,IAAI,CAAaG,MAAA;AACxB,YAAA,EAAE,UAAUG,EAAY,IAAAH;AAG5B,aAAA,gBAAAO;AAAA,QAACC;AAAA,QAAA;AAAA,UAEC,WAAAR;AAAA,UACA,UAAAd;AAAA,UACA,UAAAD;AAAA,UACA,eAAAE;AAAA,UACA,6BAAAC;AAAA,UACA,kBAAAC;AAAA,UACA,iBAAAC;AAAA,UACA,cAAAC;AAAA,UACA,YAAAC;AAAA,UACA,mBAAAC;AAAA,QAAA;AAAA,QAVKU;AAAA,MAAA;AAAA,IAWP,CAEH;AAAA,EACH,EAAA,CAAA;AAEJ,CAAC;"}
|
@@ -1,23 +1,23 @@
|
|
1
1
|
import { jsx as e, jsxs as t } from "react/jsx-runtime";
|
2
|
-
import { memo as B, useMemo as
|
2
|
+
import { memo as B, useMemo as d } from "react";
|
3
3
|
import { ILLUSTRATIONS as D } from "../../../../assets/illustrations/illustrations.js";
|
4
|
-
import
|
4
|
+
import g from "../../../../assets/line-icons/icons/check2.js";
|
5
5
|
import V from "../../../ui/image/image.js";
|
6
6
|
import n from "../../../ui/layout/flex-view.js";
|
7
7
|
import i from "../../../ui/text/text.js";
|
8
|
-
import
|
8
|
+
import C from "../../comps/tag/tag.js";
|
9
9
|
import { getChapterCompletionPercentage as W } from "../../utils/index.js";
|
10
|
-
import { BannerContainer as b, BannerImageWrapper as M, BannerImage as O, ChapterProgressSVG as X, ChapterProgressSVGCircle as
|
11
|
-
const a = 52, l = 54, c = 54, ee = B((
|
12
|
-
const { progressStats: o, imageHue:
|
13
|
-
const
|
10
|
+
import { BannerContainer as b, BannerImageWrapper as M, BannerImage as O, ChapterProgressSVG as X, ChapterProgressSVGCircle as $, StyledImportantIcon as f, StyledCheckIcon as j, BannerTitleWrapper as H } from "./chapter-banner-styled.js";
|
11
|
+
const a = 52, l = 54, c = 54, ee = B((I) => {
|
12
|
+
const { progressStats: o, imageHue: S, title: x, imageUrl: u } = I, r = d(() => W(o), [o]), { iconTopVal: R, iconLeftVal: E } = d(() => {
|
13
|
+
const h = (-(r === 100 ? 60 : r) * 3.6 - 180) * Math.PI / 180, P = c + a * Math.sin(h), A = l + a * Math.cos(h);
|
14
14
|
return {
|
15
15
|
iconLeftVal: P,
|
16
16
|
iconTopVal: A
|
17
17
|
};
|
18
18
|
}, [r]);
|
19
19
|
if (!o) return null;
|
20
|
-
const { mandatory:
|
20
|
+
const { mandatory: _, optional: w, class_work: T } = o, { completed: k = 0, total: s = 0 } = _ || {}, { completed: y = 0, total: p = 0 } = w || {}, { completed: G = 0, total: m = 0 } = T || {}, L = m > 0 && G === m;
|
21
21
|
return /* @__PURE__ */ e(
|
22
22
|
b,
|
23
23
|
{
|
@@ -25,7 +25,7 @@ const a = 52, l = 54, c = 54, ee = B((f) => {
|
|
25
25
|
$justifyContent: "center",
|
26
26
|
$alignItems: "center",
|
27
27
|
$widthX: 50,
|
28
|
-
$background: `${
|
28
|
+
$background: `${S}_4`,
|
29
29
|
children: /* @__PURE__ */ t(n, { $height: 168, $position: "relative", children: [
|
30
30
|
/* @__PURE__ */ e(
|
31
31
|
V,
|
@@ -38,10 +38,10 @@ const a = 52, l = 54, c = 54, ee = B((f) => {
|
|
38
38
|
}
|
39
39
|
),
|
40
40
|
/* @__PURE__ */ t(M, { children: [
|
41
|
-
/* @__PURE__ */ e(O, { src:
|
41
|
+
/* @__PURE__ */ e(O, { src: u, alt: "Chapter image" }),
|
42
42
|
/* @__PURE__ */ t(X, { width: "108px", height: "108px", children: [
|
43
43
|
/* @__PURE__ */ e(
|
44
|
-
|
44
|
+
$,
|
45
45
|
{
|
46
46
|
$progress: 0,
|
47
47
|
r: a,
|
@@ -50,7 +50,7 @@ const a = 52, l = 54, c = 54, ee = B((f) => {
|
|
50
50
|
}
|
51
51
|
),
|
52
52
|
/* @__PURE__ */ e(
|
53
|
-
|
53
|
+
$,
|
54
54
|
{
|
55
55
|
$progressCircle: !0,
|
56
56
|
$progressBackground: "BLACK",
|
@@ -61,29 +61,29 @@ const a = 52, l = 54, c = 54, ee = B((f) => {
|
|
61
61
|
}
|
62
62
|
)
|
63
63
|
] }),
|
64
|
-
r > 0 && /* @__PURE__ */ e(
|
65
|
-
r === 100 && /* @__PURE__ */ e(j, { children: /* @__PURE__ */ e(
|
64
|
+
r > 0 && /* @__PURE__ */ e(f, { $progress: !0, $top: R, $left: E }),
|
65
|
+
r === 100 && /* @__PURE__ */ e(j, { children: /* @__PURE__ */ e(C, { Icon: g }) })
|
66
66
|
] }),
|
67
67
|
/* @__PURE__ */ t(H, { $flexGap: 4, children: [
|
68
|
-
/* @__PURE__ */ e(i, { $renderAs: "ah4-bold", children:
|
68
|
+
/* @__PURE__ */ e(i, { $renderAs: "ah4-bold", children: x }),
|
69
69
|
/* @__PURE__ */ t(n, { $flexDirection: "row", $alignItems: "center", $flexGapX: 2.75, children: [
|
70
|
-
/* @__PURE__ */ t(n, { $position: "relative", $flexDirection: "row", children: [
|
71
|
-
/* @__PURE__ */ e(
|
70
|
+
!!s && /* @__PURE__ */ t(n, { $position: "relative", $flexDirection: "row", children: [
|
71
|
+
/* @__PURE__ */ e(f, {}),
|
72
72
|
/* @__PURE__ */ t(n, { $flexDirection: "row", $alignItems: "center", $flexGap: 4, children: [
|
73
73
|
/* @__PURE__ */ t(i, { $renderAs: "ab2", children: [
|
74
74
|
"Core - ",
|
75
|
-
|
75
|
+
k,
|
76
76
|
"/",
|
77
|
-
|
77
|
+
s
|
78
78
|
] }),
|
79
|
-
L && /* @__PURE__ */ e(
|
79
|
+
L && /* @__PURE__ */ e(C, { Icon: g, label: "CW" })
|
80
80
|
] })
|
81
81
|
] }),
|
82
|
-
|
82
|
+
p > 0 && /* @__PURE__ */ t(i, { $renderAs: "ab2", children: [
|
83
83
|
"Supplementary - ",
|
84
84
|
y,
|
85
85
|
"/",
|
86
|
-
|
86
|
+
p
|
87
87
|
] })
|
88
88
|
] })
|
89
89
|
] })
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"chapter-banner.js","sources":["../../../../../src/features/chapters-v2/chapter-details/chapter-banner/chapter-banner.tsx"],"sourcesContent":["import type { IChapterBannerProps } from './chapter-banner-types';\nimport type { FC } from 'react';\n\nimport { memo, useMemo } from 'react';\n\nimport { ILLUSTRATIONS } from '../../../../assets/illustrations/illustrations';\nimport Check2Icon from '../../../../assets/line-icons/icons/check2';\nimport Image from '../../../ui/image/image';\nimport FlexView from '../../../ui/layout/flex-view';\nimport Text from '../../../ui/text/text';\nimport Tag from '../../comps/tag/tag';\nimport { getChapterCompletionPercentage } from '../../utils';\nimport * as Styled from './chapter-banner-styled';\n\nconst PROGRESS_CIRCLE_RADIUS = 52;\nconst PROGRESS_CIRCLE_CENTER_X = 54;\nconst PROGRESS_CIRCLE_CENTER_Y = 54;\n\n// This component renders a banner for a chapter, displaying its title, progress, and associated tags.\n// It includes an image, progress visualization, and details about the chapter's core and supplementary sheets.\n// It calculates the completion percentage and dynamically positions an icon based on progress.\nconst ChapterBanner: FC<IChapterBannerProps> = memo(props => {\n const { progressStats, imageHue, title, imageUrl } = props;\n\n const completionPercentage = useMemo(() => {\n return getChapterCompletionPercentage(progressStats);\n }, [progressStats]);\n\n const { iconTopVal, iconLeftVal } = useMemo(() => {\n //* Calculate the position of the important icon based on the completion percentage\n //* Convert degrees to radians\n const angleInDegree = completionPercentage === 100 ? 60 : completionPercentage;\n\n const angleInRadian = ((-angleInDegree * 3.6 - 180) * Math.PI) / 180;\n const positionX = PROGRESS_CIRCLE_CENTER_Y + PROGRESS_CIRCLE_RADIUS * Math.sin(angleInRadian);\n const positionY = PROGRESS_CIRCLE_CENTER_X + PROGRESS_CIRCLE_RADIUS * Math.cos(angleInRadian);\n\n return {\n iconLeftVal: positionX,\n iconTopVal: positionY,\n };\n }, [completionPercentage]);\n\n if (!progressStats) return null;\n\n const { mandatory, optional, class_work: classWork } = progressStats;\n const { completed: completedMandatorySheets = 0, total: totalMandatorySheets = 0 } =\n mandatory || {};\n const { completed: completedOptionalSheets = 0, total: totalOptionalSheets = 0 } = optional || {};\n const { completed: completedClassWorkSheets = 0, total: totalClassWorkSheets = 0 } =\n classWork || {};\n
|
1
|
+
{"version":3,"file":"chapter-banner.js","sources":["../../../../../src/features/chapters-v2/chapter-details/chapter-banner/chapter-banner.tsx"],"sourcesContent":["import type { IChapterBannerProps } from './chapter-banner-types';\nimport type { FC } from 'react';\n\nimport { memo, useMemo } from 'react';\n\nimport { ILLUSTRATIONS } from '../../../../assets/illustrations/illustrations';\nimport Check2Icon from '../../../../assets/line-icons/icons/check2';\nimport Image from '../../../ui/image/image';\nimport FlexView from '../../../ui/layout/flex-view';\nimport Text from '../../../ui/text/text';\nimport Tag from '../../comps/tag/tag';\nimport { getChapterCompletionPercentage } from '../../utils';\nimport * as Styled from './chapter-banner-styled';\n\nconst PROGRESS_CIRCLE_RADIUS = 52;\nconst PROGRESS_CIRCLE_CENTER_X = 54;\nconst PROGRESS_CIRCLE_CENTER_Y = 54;\n\n// This component renders a banner for a chapter, displaying its title, progress, and associated tags.\n// It includes an image, progress visualization, and details about the chapter's core and supplementary sheets.\n// It calculates the completion percentage and dynamically positions an icon based on progress.\nconst ChapterBanner: FC<IChapterBannerProps> = memo(props => {\n const { progressStats, imageHue, title, imageUrl } = props;\n\n const completionPercentage = useMemo(() => {\n return getChapterCompletionPercentage(progressStats);\n }, [progressStats]);\n\n const { iconTopVal, iconLeftVal } = useMemo(() => {\n //* Calculate the position of the important icon based on the completion percentage\n //* Convert degrees to radians\n const angleInDegree = completionPercentage === 100 ? 60 : completionPercentage;\n\n const angleInRadian = ((-angleInDegree * 3.6 - 180) * Math.PI) / 180;\n const positionX = PROGRESS_CIRCLE_CENTER_Y + PROGRESS_CIRCLE_RADIUS * Math.sin(angleInRadian);\n const positionY = PROGRESS_CIRCLE_CENTER_X + PROGRESS_CIRCLE_RADIUS * Math.cos(angleInRadian);\n\n return {\n iconLeftVal: positionX,\n iconTopVal: positionY,\n };\n }, [completionPercentage]);\n\n if (!progressStats) return null;\n\n const { mandatory, optional, class_work: classWork } = progressStats;\n const { completed: completedMandatorySheets = 0, total: totalMandatorySheets = 0 } =\n mandatory || {};\n const { completed: completedOptionalSheets = 0, total: totalOptionalSheets = 0 } = optional || {};\n const { completed: completedClassWorkSheets = 0, total: totalClassWorkSheets = 0 } =\n classWork || {};\n const showClassWorkTag =\n totalClassWorkSheets > 0 && completedClassWorkSheets === totalClassWorkSheets;\n\n return (\n <Styled.BannerContainer\n $flexDirection=\"row\"\n $justifyContent=\"center\"\n $alignItems=\"center\"\n $widthX={50}\n $background={`${imageHue}_4`}\n >\n <FlexView $height={168} $position=\"relative\">\n <Image\n width=\"100%\"\n height=\"168px\"\n src={ILLUSTRATIONS.CHAPTER_HEADER_BG}\n alt=\"Chapter header background\"\n withLoader\n />\n <Styled.BannerImageWrapper>\n <Styled.BannerImage src={imageUrl} alt=\"Chapter image\" />\n <Styled.ChapterProgressSVG width=\"108px\" height=\"108px\">\n <Styled.ChapterProgressSVGCircle\n $progress={0}\n r={PROGRESS_CIRCLE_RADIUS}\n cx={PROGRESS_CIRCLE_CENTER_X}\n cy={PROGRESS_CIRCLE_CENTER_Y}\n />\n <Styled.ChapterProgressSVGCircle\n $progressCircle\n $progressBackground={'BLACK'}\n $progress={3.3 * completionPercentage}\n r={PROGRESS_CIRCLE_RADIUS}\n cx={PROGRESS_CIRCLE_CENTER_X}\n cy={PROGRESS_CIRCLE_CENTER_Y}\n />\n </Styled.ChapterProgressSVG>\n\n {completionPercentage > 0 && (\n <Styled.StyledImportantIcon $progress $top={iconTopVal} $left={iconLeftVal} />\n )}\n\n {completionPercentage === 100 && (\n <Styled.StyledCheckIcon>\n <Tag Icon={Check2Icon} />\n </Styled.StyledCheckIcon>\n )}\n </Styled.BannerImageWrapper>\n <Styled.BannerTitleWrapper $flexGap={4}>\n <Text $renderAs=\"ah4-bold\">{title}</Text>\n <FlexView $flexDirection=\"row\" $alignItems=\"center\" $flexGapX={2.75}>\n {!!totalMandatorySheets && (\n <FlexView $position=\"relative\" $flexDirection=\"row\">\n <Styled.StyledImportantIcon />\n <FlexView $flexDirection=\"row\" $alignItems=\"center\" $flexGap={4}>\n <Text $renderAs=\"ab2\">\n Core - {completedMandatorySheets}/{totalMandatorySheets}\n </Text>\n {showClassWorkTag && <Tag Icon={Check2Icon} label=\"CW\" />}\n </FlexView>\n </FlexView>\n )}\n {totalOptionalSheets > 0 && (\n <Text $renderAs=\"ab2\">\n Supplementary - {completedOptionalSheets}/{totalOptionalSheets}\n </Text>\n )}\n </FlexView>\n </Styled.BannerTitleWrapper>\n </FlexView>\n </Styled.BannerContainer>\n );\n});\n\nexport default ChapterBanner;\n"],"names":["PROGRESS_CIRCLE_RADIUS","PROGRESS_CIRCLE_CENTER_X","PROGRESS_CIRCLE_CENTER_Y","ChapterBanner","memo","props","progressStats","imageHue","title","imageUrl","completionPercentage","useMemo","getChapterCompletionPercentage","iconTopVal","iconLeftVal","angleInRadian","positionX","positionY","mandatory","optional","classWork","completedMandatorySheets","totalMandatorySheets","completedOptionalSheets","totalOptionalSheets","completedClassWorkSheets","totalClassWorkSheets","showClassWorkTag","jsx","Styled.BannerContainer","jsxs","FlexView","Image","ILLUSTRATIONS","Styled.BannerImageWrapper","Styled.BannerImage","Styled.ChapterProgressSVG","Styled.ChapterProgressSVGCircle","Styled.StyledImportantIcon","Styled.StyledCheckIcon","Tag","Check2Icon","Styled.BannerTitleWrapper","Text"],"mappings":";;;;;;;;;;AAcA,MAAMA,IAAyB,IACzB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AK,WAAU,OAAM,UAAA;AAAA,kBAAA;AAAA,kBACZtB;AAAA,kBAAyB;AAAA,kBAAEC;AAAA,gBAAA,GACrC;AAAA,gBACCK,KAAqB,gBAAAC,EAAAY,GAAA,EAAI,MAAMC,GAAY,OAAM,MAAK;AAAA,cAAA,GACzD;AAAA,YAAA,GACF;AAAA,YAEDjB,IAAsB,KACpB,gBAAAM,EAAAa,GAAA,EAAK,WAAU,OAAM,UAAA;AAAA,cAAA;AAAA,cACHpB;AAAA,cAAwB;AAAA,cAAEC;AAAA,YAAA,GAC7C;AAAA,UAAA,GAEJ;AAAA,QAAA,GACF;AAAA,MAAA,GACF;AAAA,IAAA;AAAA,EAAA;AAGN,CAAC;"}
|
@@ -1,16 +1,16 @@
|
|
1
1
|
import { jsx as d } from "react/jsx-runtime";
|
2
2
|
import { memo as m } from "react";
|
3
3
|
import { getNodeStateBasedTagInfo as p } from "../../utils/node-card-utils.js";
|
4
|
-
import { SheetTagWrapper as
|
5
|
-
const
|
6
|
-
const { state:
|
4
|
+
import { SheetTagWrapper as S } from "./node-card-styled.js";
|
5
|
+
const y = m((t) => {
|
6
|
+
const { state: e, accuracy: a, nodeType: o, dueDateTs: r } = t, c = o === "DYNAMIC" || o === "ASSESSMENT" || o === "CHAPTER_ASSESSMENT" ? a : void 0, {
|
7
7
|
icon: i,
|
8
8
|
top: n,
|
9
9
|
right: s
|
10
|
-
} = p(
|
11
|
-
return /* @__PURE__ */ d(
|
10
|
+
} = p(e, c, r);
|
11
|
+
return /* @__PURE__ */ d(S, { $top: n, $right: s, children: i });
|
12
12
|
});
|
13
13
|
export {
|
14
|
-
|
14
|
+
y as default
|
15
15
|
};
|
16
16
|
//# sourceMappingURL=node-card-tags.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"node-card-tags.js","sources":["../../../../../src/features/chapters-v2/comps/node-card/node-card-tags.tsx"],"sourcesContent":["import type { INodeCardTagsProps } from './node-card-types';\nimport type { FC } from 'react';\n\nimport { memo } from 'react';\n\nimport { getNodeStateBasedTagInfo } from '../../utils/node-card-utils';\nimport * as Styled from './node-card-styled';\n\nconst NodeCardTags: FC<INodeCardTagsProps> = memo(props => {\n const { state, accuracy, nodeType, dueDateTs } = props;\n\n const isDynamicNode
|
1
|
+
{"version":3,"file":"node-card-tags.js","sources":["../../../../../src/features/chapters-v2/comps/node-card/node-card-tags.tsx"],"sourcesContent":["import type { INodeCardTagsProps } from './node-card-types';\nimport type { FC } from 'react';\n\nimport { memo } from 'react';\n\nimport { getNodeStateBasedTagInfo } from '../../utils/node-card-utils';\nimport * as Styled from './node-card-styled';\n\nconst NodeCardTags: FC<INodeCardTagsProps> = memo(props => {\n const { state, accuracy, nodeType, dueDateTs } = props;\n\n const isDynamicNode =\n nodeType === 'DYNAMIC' || nodeType === 'ASSESSMENT' || nodeType === 'CHAPTER_ASSESSMENT';\n const accuracyValue = isDynamicNode ? accuracy : undefined;\n\n const {\n icon: NodeTagIcon,\n top,\n right,\n } = getNodeStateBasedTagInfo(state, accuracyValue, dueDateTs);\n\n return (\n <Styled.SheetTagWrapper $top={top} $right={right}>\n {NodeTagIcon}\n </Styled.SheetTagWrapper>\n );\n});\n\nexport default NodeCardTags;\n"],"names":["NodeCardTags","memo","props","state","accuracy","nodeType","dueDateTs","accuracyValue","NodeTagIcon","top","right","getNodeStateBasedTagInfo","jsx","Styled.SheetTagWrapper"],"mappings":";;;;AAQM,MAAAA,IAAuCC,EAAK,CAASC,MAAA;AACzD,QAAM,EAAE,OAAAC,GAAO,UAAAC,GAAU,UAAAC,GAAU,WAAAC,MAAcJ,GAI3CK,IADJF,MAAa,aAAaA,MAAa,gBAAgBA,MAAa,uBAChCD,IAAW,QAE3C;AAAA,IACJ,MAAMI;AAAA,IACN,KAAAC;AAAA,IACA,OAAAC;AAAA,EACE,IAAAC,EAAyBR,GAAOI,GAAeD,CAAS;AAG1D,SAAA,gBAAAM,EAACC,GAAA,EAAuB,MAAMJ,GAAK,QAAQC,GACxC,UACHF,EAAA,CAAA;AAEJ,CAAC;"}
|