@cuemath/leap 2.8.61-as4 → 2.8.61-as6
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/chapters-v2/chapter-details/block-sections/block-section-view.js +25 -25
- 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/comps/node-card/teacher-actions/teacher-actions.js +17 -17
- package/dist/features/chapters-v2/comps/node-card/teacher-actions/teacher-actions.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/homework-card.js +21 -21
- package/dist/features/homework/homework-card.js.map +1 -1
- package/dist/features/homework/hw-card-list/api/get-homeworks.js.map +1 -1
- package/dist/features/homework/hw-card-list/hw-card-list.js +84 -77
- package/dist/features/homework/hw-card-list/hw-card-list.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/index.d.ts +11 -0
- package/package.json +1 -1
@@ -1,40 +1,40 @@
|
|
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
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:
|
15
|
+
blockData: l,
|
16
|
+
lessonIdx: s,
|
17
17
|
isLastBlock: C,
|
18
18
|
isGoalBlock: r,
|
19
|
-
onNodeAttempt:
|
20
|
-
onNodeAttemptLocationChange:
|
21
|
-
onNodeMarkAsDone:
|
19
|
+
onNodeAttempt: g,
|
20
|
+
onNodeAttemptLocationChange: x,
|
21
|
+
onNodeMarkAsDone: _,
|
22
22
|
onNodeReattempt: b,
|
23
23
|
onNodeReview: E,
|
24
24
|
onNodeView: N,
|
25
25
|
onBlockSkipUnskip: i
|
26
26
|
}) => {
|
27
|
-
const { block_type: p, name: a, sheets: d,
|
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,
|
@@ -52,11 +52,11 @@ const G = ({
|
|
52
52
|
children: [
|
53
53
|
f === "Puzzles" ? a : f,
|
54
54
|
" ",
|
55
|
-
|
55
|
+
A
|
56
56
|
]
|
57
57
|
}
|
58
58
|
),
|
59
|
-
r && (
|
59
|
+
r && (s ?? 0) > 0 && /* @__PURE__ */ t(
|
60
60
|
u,
|
61
61
|
{
|
62
62
|
$renderAs: "ab2-bold",
|
@@ -66,26 +66,26 @@ const G = ({
|
|
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",
|
@@ -93,9 +93,9 @@ const G = ({
|
|
93
93
|
nodeData: $,
|
94
94
|
blockType: p,
|
95
95
|
isSkipped: e,
|
96
|
-
onNodeAttempt:
|
97
|
-
onNodeAttemptLocationChange:
|
98
|
-
onNodeMarkAsDone:
|
96
|
+
onNodeAttempt: g,
|
97
|
+
onNodeAttemptLocationChange: x,
|
98
|
+
onNodeMarkAsDone: _,
|
99
99
|
onNodeReattempt: b,
|
100
100
|
onNodeReview: E,
|
101
101
|
onNodeView: N
|
@@ -107,6 +107,6 @@ const G = ({
|
|
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;AAAA,EACA,iBAAAC;AAAA,EACA,cAAAC;AAAA,EACA,YAAAC;AAAA,EACA,mBAAAC;AACF,MAAM;A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A,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;"}
|
@@ -22,10 +22,10 @@ const { ASSIGN_AS_HW: de, REVIEW: me, VIEW: pe, MARK_AS_DONE: he } = V, Be = P(
|
|
22
22
|
imageHue: T,
|
23
23
|
blockType: O,
|
24
24
|
isSkipped: $,
|
25
|
-
onNodeAttemptLocationChange:
|
26
|
-
onNodeMarkAsDone:
|
27
|
-
onNodeView:
|
28
|
-
onNodeReview:
|
25
|
+
onNodeAttemptLocationChange: i,
|
26
|
+
onNodeMarkAsDone: o,
|
27
|
+
onNodeView: n,
|
28
|
+
onNodeReview: c
|
29
29
|
}) => {
|
30
30
|
const l = X(null), { menuVisible: w, onMenuClick: u } = Y(l), {
|
31
31
|
accuracy: x,
|
@@ -33,7 +33,7 @@ const { ASSIGN_AS_HW: de, REVIEW: me, VIEW: pe, MARK_AS_DONE: he } = V, Be = P(
|
|
33
33
|
node_type: d,
|
34
34
|
card_header: W,
|
35
35
|
title: A,
|
36
|
-
state:
|
36
|
+
state: a,
|
37
37
|
is_optional: C,
|
38
38
|
sheet_statement: _,
|
39
39
|
permissions: B
|
@@ -41,17 +41,17 @@ const { ASSIGN_AS_HW: de, REVIEW: me, VIEW: pe, MARK_AS_DONE: he } = V, Be = P(
|
|
41
41
|
can_change_attempt_location: H,
|
42
42
|
can_mark_familiar: L,
|
43
43
|
can_review: m
|
44
|
-
} = B, p = O === Q.GOAL,
|
44
|
+
} = B, p = O === Q.GOAL, s = a === f.LOCKED, G = a === f.NOT_STARTED, K = a === f.IN_PROGRESS, I = y === "INCLASS", M = !_ || !p, g = !C && (K || G), R = Z(d), b = D(d), h = F(
|
45
45
|
(E) => {
|
46
46
|
switch (E) {
|
47
47
|
case "node-card-view":
|
48
|
-
m ?
|
48
|
+
m ? c == null || c(r) : n == null || n(r);
|
49
49
|
return;
|
50
50
|
case "node-card-assign-as-hw":
|
51
|
-
|
51
|
+
i == null || i(r);
|
52
52
|
return;
|
53
53
|
case "node-card-mark-as-done":
|
54
|
-
|
54
|
+
o == null || o(r);
|
55
55
|
return;
|
56
56
|
default:
|
57
57
|
throw new Error(`No callback function for ${E}`);
|
@@ -60,10 +60,10 @@ const { ASSIGN_AS_HW: de, REVIEW: me, VIEW: pe, MARK_AS_DONE: he } = V, Be = P(
|
|
60
60
|
[
|
61
61
|
m,
|
62
62
|
r,
|
63
|
+
i,
|
63
64
|
o,
|
64
|
-
|
65
|
-
|
66
|
-
c
|
65
|
+
c,
|
66
|
+
n
|
67
67
|
]
|
68
68
|
), j = [
|
69
69
|
{
|
@@ -92,7 +92,7 @@ const { ASSIGN_AS_HW: de, REVIEW: me, VIEW: pe, MARK_AS_DONE: he } = V, Be = P(
|
|
92
92
|
re,
|
93
93
|
{
|
94
94
|
$showOutline: !g,
|
95
|
-
$isSheetLocked:
|
95
|
+
$isSheetLocked: s,
|
96
96
|
$background: `${T}_2`,
|
97
97
|
$disabled: !!$,
|
98
98
|
children: [
|
@@ -127,14 +127,14 @@ const { ASSIGN_AS_HW: de, REVIEW: me, VIEW: pe, MARK_AS_DONE: he } = V, Be = P(
|
|
127
127
|
$position: "relative",
|
128
128
|
$alignItems: "center",
|
129
129
|
$justifyContent: "center",
|
130
|
-
$opacity:
|
130
|
+
$opacity: s ? 0.5 : 1,
|
131
131
|
children: [
|
132
132
|
b && /* @__PURE__ */ e(b, { width: 20, height: 20 }),
|
133
133
|
!C && /* @__PURE__ */ e(oe, {})
|
134
134
|
]
|
135
135
|
}
|
136
136
|
),
|
137
|
-
/* @__PURE__ */ t(J, { $renderAs: "ac4-black", $color: "BLACK", $opacity:
|
137
|
+
/* @__PURE__ */ t(J, { $renderAs: "ac4-black", $color: "BLACK", $opacity: s ? 0.5 : 1, children: [
|
138
138
|
W,
|
139
139
|
" ",
|
140
140
|
I && ". CW"
|
@@ -144,7 +144,7 @@ const { ASSIGN_AS_HW: de, REVIEW: me, VIEW: pe, MARK_AS_DONE: he } = V, Be = P(
|
|
144
144
|
]
|
145
145
|
}
|
146
146
|
),
|
147
|
-
/* @__PURE__ */ e(se, { nodeType: d, state:
|
147
|
+
/* @__PURE__ */ e(se, { nodeType: d, state: a, accuracy: x }),
|
148
148
|
!p && /* @__PURE__ */ t(
|
149
149
|
ne,
|
150
150
|
{
|
@@ -160,7 +160,7 @@ const { ASSIGN_AS_HW: de, REVIEW: me, VIEW: pe, MARK_AS_DONE: he } = V, Be = P(
|
|
160
160
|
{
|
161
161
|
$renderAs: "ab3",
|
162
162
|
$color: "BLACK_1",
|
163
|
-
$opacity:
|
163
|
+
$opacity: s ? 0.5 : 1,
|
164
164
|
children: A
|
165
165
|
}
|
166
166
|
),
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"teacher-actions.js","sources":["../../../../../../src/features/chapters-v2/comps/node-card/teacher-actions/teacher-actions.tsx"],"sourcesContent":["import type { INodeCardProps } from '../node-card-types';\nimport type { INodeMenuOption } from '../node-menu-options/node-menu-options-types';\nimport type { FC } from 'react';\n\nimport { memo, useCallback, useRef } from 'react';\n\nimport Check2Icon from '../../../../../assets/line-icons/icons/check2';\nimport Eye2Icon from '../../../../../assets/line-icons/icons/eye2';\nimport Home2Icon from '../../../../../assets/line-icons/icons/home2';\nimport MoreVerticalIcon from '../../../../../assets/line-icons/icons/more-vertical';\nimport ArrowTooltip from '../../../../ui/arrow-tooltip/arrow-tooltip';\nimport useContextMenuClickHandler from '../../../../ui/hooks/use-context-menu-click-handler';\nimport FlexView from '../../../../ui/layout/flex-view';\nimport Text from '../../../../ui/text/text';\nimport { BLOCK_TYPE } from '../../../constants/block-constants';\nimport { NODE_CARD_STATES, TEACHER_MENU_LABELS } from '../../../constants/node-constants';\nimport { getNodeTypeBasedBgImage } from '../../../utils';\nimport { getNodeCardBasedIcon } from '../../../utils/node-card-utils';\nimport BorderPathAnimation from '../border-path-animation';\nimport * as Styled from '../node-card-styled';\nimport NodeCardTags from '../node-card-tags';\nimport NodeMenuOptions from '../node-menu-options/node-menu-options';\n\nconst { ASSIGN_AS_HW, REVIEW, VIEW, MARK_AS_DONE } = TEACHER_MENU_LABELS;\n\nconst TeacherActions: FC<Omit<INodeCardProps, 'userType'>> = memo(\n ({\n nodeData,\n imageHue,\n blockType,\n isSkipped,\n onNodeAttemptLocationChange,\n onNodeMarkAsDone,\n onNodeView,\n onNodeReview,\n }) => {\n const containerRef = useRef<HTMLDivElement>(null);\n\n const { menuVisible, onMenuClick } = useContextMenuClickHandler(containerRef);\n\n const {\n accuracy,\n attempt_location: attemptLocation,\n node_type: nodeType,\n card_header: cardHeader,\n title,\n state,\n is_optional: isOptional,\n sheet_statement: sheetStatement,\n permissions,\n } = nodeData;\n\n const {\n can_change_attempt_location: canChangeAttemptLocation,\n can_mark_familiar: canMarkFamiliar,\n can_review: canReview,\n } = permissions;\n\n const isGoalBlock = blockType === BLOCK_TYPE.GOAL;\n const sheetLocked = state === NODE_CARD_STATES.LOCKED;\n const sheetNotStarted = state === NODE_CARD_STATES.NOT_STARTED;\n const sheetInProgress = state === NODE_CARD_STATES.IN_PROGRESS;\n const inClassSheet = attemptLocation === 'INCLASS';\n const tooltipHidden = !sheetStatement || !isGoalBlock || sheetLocked;\n\n const showCardAnimation = !isOptional && (sheetInProgress || sheetNotStarted);\n\n const nodeBgImage = getNodeTypeBasedBgImage(nodeType);\n const NodeCardIcon = getNodeCardBasedIcon(nodeType);\n\n const handleOnMenuOptionClick = useCallback(\n (optionId: string) => {\n switch (optionId) {\n case 'node-card-view':\n if (canReview) {\n onNodeReview?.(nodeData);\n } else {\n onNodeView?.(nodeData);\n }\n\n return;\n\n case 'node-card-assign-as-hw':\n onNodeAttemptLocationChange?.(nodeData);\n\n return;\n\n case 'node-card-mark-as-done':\n onNodeMarkAsDone?.(nodeData);\n\n return;\n default:\n throw new Error(`No callback function for ${optionId}`);\n }\n },\n [\n canReview,\n nodeData,\n onNodeAttemptLocationChange,\n onNodeMarkAsDone,\n onNodeReview,\n onNodeView,\n ],\n );\n\n const menuOptions: INodeMenuOption[] = [\n {\n id: 'node-card-view',\n label: canReview ? REVIEW : VIEW,\n icon: Eye2Icon,\n disabled: false,\n onClick: handleOnMenuOptionClick,\n },\n {\n id: 'node-card-assign-as-hw',\n label: ASSIGN_AS_HW,\n icon: Home2Icon,\n disabled: !canChangeAttemptLocation || !inClassSheet,\n onClick: handleOnMenuOptionClick,\n },\n {\n id: 'node-card-mark-as-done',\n label: MARK_AS_DONE,\n icon: Check2Icon,\n disabled: !canMarkFamiliar,\n onClick: handleOnMenuOptionClick,\n },\n ];\n\n return (\n <Styled.NodeCardContainer\n $showOutline={!showCardAnimation}\n $isSheetLocked={sheetLocked}\n $background={`${imageHue}_2`}\n $disabled={Boolean(isSkipped)}\n >\n <ArrowTooltip\n renderAs=\"primary\"\n tooltipItem={sheetStatement}\n position=\"bottom\"\n zIndex={5}\n hidden={tooltipHidden}\n parentWidth=\"100%\"\n widthX={11.25}\n >\n <Styled.NodeCardInfoWrapper\n $flexDirection=\"row\"\n $alignItems=\"center\"\n $width=\"100%\"\n $heightX={3.5}\n $bgImage={nodeBgImage}\n $gutterX={0.78125}\n $flexGap={8.5}\n >\n <Styled.IconWrapper\n $width={31}\n $height={31}\n $background=\"WHITE_1\"\n $position=\"relative\"\n $alignItems=\"center\"\n $justifyContent=\"center\"\n $opacity={sheetLocked ? 0.5 : 1}\n >\n {NodeCardIcon && <NodeCardIcon width={20} height={20} />}\n {!isOptional && <Styled.StyledImportantIcon />}\n </Styled.IconWrapper>\n\n <Text $renderAs=\"ac4-black\" $color=\"BLACK\" $opacity={sheetLocked ? 0.5 : 1}>\n {cardHeader} {inClassSheet && `. CW`}\n </Text>\n\n <FlexView className=\"context-menu\">\n {isGoalBlock && (\n <Styled.NodeKebabMenuWrapper ref={containerRef} onClick={onMenuClick}>\n <MoreVerticalIcon width={16} height={16} />\n </Styled.NodeKebabMenuWrapper>\n )}\n </FlexView>\n\n {showCardAnimation && !isSkipped && <BorderPathAnimation />}\n </Styled.NodeCardInfoWrapper>\n\n <NodeCardTags nodeType={nodeType} state={state} accuracy={accuracy} />\n\n {!isGoalBlock && (\n <Styled.NodeCardContentWrapper\n $flexDirection=\"row\"\n $alignItems=\"center\"\n $background=\"WHITE_1\"\n $flexGap={8}\n $heightX={4}\n $justifyContent=\"space-between\"\n >\n <Styled.NodeCardTitle\n $renderAs=\"ab3\"\n $color=\"BLACK_1\"\n $opacity={sheetLocked ? 0.5 : 1}\n >\n {title}\n </Styled.NodeCardTitle>\n\n <Styled.NodeKebabMenuWrapper ref={containerRef} onClick={onMenuClick}>\n <MoreVerticalIcon width={16} height={16} />\n </Styled.NodeKebabMenuWrapper>\n </Styled.NodeCardContentWrapper>\n )}\n </ArrowTooltip>\n\n <Styled.NodeMenuOptionsWrapper $visible={menuVisible}>\n <NodeMenuOptions options={menuOptions} />\n </Styled.NodeMenuOptionsWrapper>\n </Styled.NodeCardContainer>\n );\n },\n);\n\nexport default TeacherActions;\n"],"names":["ASSIGN_AS_HW","REVIEW","VIEW","MARK_AS_DONE","TEACHER_MENU_LABELS","TeacherActions","memo","nodeData","imageHue","blockType","isSkipped","onNodeAttemptLocationChange","onNodeMarkAsDone","onNodeView","onNodeReview","containerRef","useRef","menuVisible","onMenuClick","useContextMenuClickHandler","accuracy","attemptLocation","nodeType","cardHeader","title","state","isOptional","sheetStatement","permissions","canChangeAttemptLocation","canMarkFamiliar","canReview","isGoalBlock","BLOCK_TYPE","sheetLocked","NODE_CARD_STATES","sheetNotStarted","sheetInProgress","inClassSheet","tooltipHidden","showCardAnimation","nodeBgImage","getNodeTypeBasedBgImage","NodeCardIcon","getNodeCardBasedIcon","handleOnMenuOptionClick","useCallback","optionId","menuOptions","Eye2Icon","Home2Icon","Check2Icon","jsxs","Styled.NodeCardContainer","ArrowTooltip","Styled.NodeCardInfoWrapper","Styled.IconWrapper","jsx","Styled.StyledImportantIcon","Text","FlexView","Styled.NodeKebabMenuWrapper","MoreVerticalIcon","BorderPathAnimation","NodeCardTags","Styled.NodeCardContentWrapper","Styled.NodeCardTitle","Styled.NodeMenuOptionsWrapper","NodeMenuOptions"],"mappings":";;;;;;;;;;;;;;;;;;AAuBA,MAAM,EAAE,cAAAA,IAAc,QAAAC,IAAQ,MAAAC,IAAM,cAAAC,OAAiBC,GAE/CC,KAAuDC;AAAA,EAC3D,CAAC;AAAA,IACC,UAAAC;AAAA,IACA,UAAAC;AAAA,IACA,WAAAC;AAAA,IACA,WAAAC;AAAA,IACA,6BAAAC;AAAA,IACA,kBAAAC;AAAA,IACA,YAAAC;AAAA,IACA,cAAAC;AAAA,EAAA,MACI;AACE,UAAAC,IAAeC,EAAuB,IAAI,GAE1C,EAAE,aAAAC,GAAa,aAAAC,EAAY,IAAIC,EAA2BJ,CAAY,GAEtE;AAAA,MACJ,UAAAK;AAAA,MACA,kBAAkBC;AAAA,MAClB,WAAWC;AAAA,MACX,aAAaC;AAAA,MACb,OAAAC;AAAA,MACA,OAAAC;AAAA,MACA,aAAaC;AAAA,MACb,iBAAiBC;AAAA,MACjB,aAAAC;AAAA,IACE,IAAArB,GAEE;AAAA,MACJ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GAAiB,EAAA,OAAO,IAAI,QAAQ,IAAI,GAC3C,EAEJ,CAAA;AAAA,sBAECtB,KAAqB,CAAC9B,KAAa,gBAAA+C,EAACM,IAAoB,CAAA,CAAA;AAAA,oBAAA;AAAA,kBAAA;AAAA,gBAC3D;AAAA,gBAEC,gBAAAN,EAAAO,IAAA,EAAa,UAAA1C,GAAoB,OAAAG,GAAc,UAAAL,EAAoB,CAAA;AAAA,gBAEnE,CAACY,KACA,gBAAAoB;AAAA,kBAACa;AAAAA,kBAAA;AAAA,oBACC,gBAAe;AAAA,oBACf,aAAY;AAAA,oBACZ,aAAY;AAAA,oBACZ,UAAU;AAAA,oBACV,UAAU;AAAA,oBACV,iBAAgB;AAAA,oBAEhB,UAAA;AAAA,sBAAA,gBAAAR;AAAA,wBAACS;AAAAA,wBAAA;AAAA,0BACC,WAAU;AAAA,0BACV,QAAO;AAAA,0BACP,UAAUhC,IAAc,MAAM;AAAA,0BAE7B,UAAAV;AAAA,wBAAA;AAAA,sBACH;AAAA,sBAEC,gBAAAiC,EAAAI,GAAA,EAA4B,KAAK9C,GAAc,SAASG,GACvD,UAAA,gBAAAuC,EAACK,GAAiB,EAAA,OAAO,IAAI,QAAQ,GAAI,CAAA,GAC3C;AAAA,oBAAA;AAAA,kBAAA;AAAA,gBACF;AAAA,cAAA;AAAA,YAAA;AAAA,UAEJ;AAAA,UAEA,gBAAAL,EAACU,IAAA,EAA8B,UAAUlD,GACvC,UAAC,gBAAAwC,EAAAW,IAAA,EAAgB,SAASpB,EAAA,CAAa,EACzC,CAAA;AAAA,QAAA;AAAA,MAAA;AAAA,IAAA;AAAA,EAGN;AACF;"}
|
1
|
+
{"version":3,"file":"teacher-actions.js","sources":["../../../../../../src/features/chapters-v2/comps/node-card/teacher-actions/teacher-actions.tsx"],"sourcesContent":["import type { INodeCardProps } from '../node-card-types';\nimport type { INodeMenuOption } from '../node-menu-options/node-menu-options-types';\nimport type { FC } from 'react';\n\nimport { memo, useCallback, useRef } from 'react';\n\nimport Check2Icon from '../../../../../assets/line-icons/icons/check2';\nimport Eye2Icon from '../../../../../assets/line-icons/icons/eye2';\nimport Home2Icon from '../../../../../assets/line-icons/icons/home2';\nimport MoreVerticalIcon from '../../../../../assets/line-icons/icons/more-vertical';\nimport ArrowTooltip from '../../../../ui/arrow-tooltip/arrow-tooltip';\nimport useContextMenuClickHandler from '../../../../ui/hooks/use-context-menu-click-handler';\nimport FlexView from '../../../../ui/layout/flex-view';\nimport Text from '../../../../ui/text/text';\nimport { BLOCK_TYPE } from '../../../constants/block-constants';\nimport { NODE_CARD_STATES, TEACHER_MENU_LABELS } from '../../../constants/node-constants';\nimport { getNodeTypeBasedBgImage } from '../../../utils';\nimport { getNodeCardBasedIcon } from '../../../utils/node-card-utils';\nimport BorderPathAnimation from '../border-path-animation';\nimport * as Styled from '../node-card-styled';\nimport NodeCardTags from '../node-card-tags';\nimport NodeMenuOptions from '../node-menu-options/node-menu-options';\n\nconst { ASSIGN_AS_HW, REVIEW, VIEW, MARK_AS_DONE } = TEACHER_MENU_LABELS;\n\nconst TeacherActions: FC<Omit<INodeCardProps, 'userType'>> = memo(\n ({\n nodeData,\n imageHue,\n blockType,\n isSkipped,\n onNodeAttemptLocationChange,\n onNodeMarkAsDone,\n onNodeView,\n onNodeReview,\n }) => {\n const containerRef = useRef<HTMLDivElement>(null);\n\n const { menuVisible, onMenuClick } = useContextMenuClickHandler(containerRef);\n\n const {\n accuracy,\n attempt_location: attemptLocation,\n node_type: nodeType,\n card_header: cardHeader,\n title,\n state,\n is_optional: isOptional,\n sheet_statement: sheetStatement,\n permissions,\n } = nodeData;\n\n const {\n can_change_attempt_location: canChangeAttemptLocation,\n can_mark_familiar: canMarkFamiliar,\n can_review: canReview,\n } = permissions;\n\n const isGoalBlock = blockType === BLOCK_TYPE.GOAL;\n const sheetLocked = state === NODE_CARD_STATES.LOCKED;\n const sheetNotStarted = state === NODE_CARD_STATES.NOT_STARTED;\n const sheetInProgress = state === NODE_CARD_STATES.IN_PROGRESS;\n const inClassSheet = attemptLocation === 'INCLASS';\n const tooltipHidden = !sheetStatement || !isGoalBlock;\n\n const showCardAnimation = !isOptional && (sheetInProgress || sheetNotStarted);\n\n const nodeBgImage = getNodeTypeBasedBgImage(nodeType);\n const NodeCardIcon = getNodeCardBasedIcon(nodeType);\n\n const handleOnMenuOptionClick = useCallback(\n (optionId: string) => {\n switch (optionId) {\n case 'node-card-view':\n if (canReview) {\n onNodeReview?.(nodeData);\n } else {\n onNodeView?.(nodeData);\n }\n\n return;\n\n case 'node-card-assign-as-hw':\n onNodeAttemptLocationChange?.(nodeData);\n\n return;\n\n case 'node-card-mark-as-done':\n onNodeMarkAsDone?.(nodeData);\n\n return;\n default:\n throw new Error(`No callback function for ${optionId}`);\n }\n },\n [\n canReview,\n nodeData,\n onNodeAttemptLocationChange,\n onNodeMarkAsDone,\n onNodeReview,\n onNodeView,\n ],\n );\n\n const menuOptions: INodeMenuOption[] = [\n {\n id: 'node-card-view',\n label: canReview ? REVIEW : VIEW,\n icon: Eye2Icon,\n disabled: false,\n onClick: handleOnMenuOptionClick,\n },\n {\n id: 'node-card-assign-as-hw',\n label: ASSIGN_AS_HW,\n icon: Home2Icon,\n disabled: !canChangeAttemptLocation || !inClassSheet,\n onClick: handleOnMenuOptionClick,\n },\n {\n id: 'node-card-mark-as-done',\n label: MARK_AS_DONE,\n icon: Check2Icon,\n disabled: !canMarkFamiliar,\n onClick: handleOnMenuOptionClick,\n },\n ];\n\n return (\n <Styled.NodeCardContainer\n $showOutline={!showCardAnimation}\n $isSheetLocked={sheetLocked}\n $background={`${imageHue}_2`}\n $disabled={Boolean(isSkipped)}\n >\n <ArrowTooltip\n renderAs=\"primary\"\n tooltipItem={sheetStatement}\n position=\"bottom\"\n zIndex={5}\n hidden={tooltipHidden}\n parentWidth=\"100%\"\n widthX={11.25}\n >\n <Styled.NodeCardInfoWrapper\n $flexDirection=\"row\"\n $alignItems=\"center\"\n $width=\"100%\"\n $heightX={3.5}\n $bgImage={nodeBgImage}\n $gutterX={0.78125}\n $flexGap={8.5}\n >\n <Styled.IconWrapper\n $width={31}\n $height={31}\n $background=\"WHITE_1\"\n $position=\"relative\"\n $alignItems=\"center\"\n $justifyContent=\"center\"\n $opacity={sheetLocked ? 0.5 : 1}\n >\n {NodeCardIcon && <NodeCardIcon width={20} height={20} />}\n {!isOptional && <Styled.StyledImportantIcon />}\n </Styled.IconWrapper>\n\n <Text $renderAs=\"ac4-black\" $color=\"BLACK\" $opacity={sheetLocked ? 0.5 : 1}>\n {cardHeader} {inClassSheet && `. CW`}\n </Text>\n\n <FlexView className=\"context-menu\">\n {isGoalBlock && (\n <Styled.NodeKebabMenuWrapper ref={containerRef} onClick={onMenuClick}>\n <MoreVerticalIcon width={16} height={16} />\n </Styled.NodeKebabMenuWrapper>\n )}\n </FlexView>\n\n {showCardAnimation && !isSkipped && <BorderPathAnimation />}\n </Styled.NodeCardInfoWrapper>\n\n <NodeCardTags nodeType={nodeType} state={state} accuracy={accuracy} />\n\n {!isGoalBlock && (\n <Styled.NodeCardContentWrapper\n $flexDirection=\"row\"\n $alignItems=\"center\"\n $background=\"WHITE_1\"\n $flexGap={8}\n $heightX={4}\n $justifyContent=\"space-between\"\n >\n <Styled.NodeCardTitle\n $renderAs=\"ab3\"\n $color=\"BLACK_1\"\n $opacity={sheetLocked ? 0.5 : 1}\n >\n {title}\n </Styled.NodeCardTitle>\n\n <Styled.NodeKebabMenuWrapper ref={containerRef} onClick={onMenuClick}>\n <MoreVerticalIcon width={16} height={16} />\n </Styled.NodeKebabMenuWrapper>\n </Styled.NodeCardContentWrapper>\n )}\n </ArrowTooltip>\n\n <Styled.NodeMenuOptionsWrapper $visible={menuVisible}>\n <NodeMenuOptions options={menuOptions} />\n </Styled.NodeMenuOptionsWrapper>\n </Styled.NodeCardContainer>\n );\n },\n);\n\nexport default TeacherActions;\n"],"names":["ASSIGN_AS_HW","REVIEW","VIEW","MARK_AS_DONE","TEACHER_MENU_LABELS","TeacherActions","memo","nodeData","imageHue","blockType","isSkipped","onNodeAttemptLocationChange","onNodeMarkAsDone","onNodeView","onNodeReview","containerRef","useRef","menuVisible","onMenuClick","useContextMenuClickHandler","accuracy","attemptLocation","nodeType","cardHeader","title","state","isOptional","sheetStatement","permissions","canChangeAttemptLocation","canMarkFamiliar","canReview","isGoalBlock","BLOCK_TYPE","sheetLocked","NODE_CARD_STATES","sheetNotStarted","sheetInProgress","inClassSheet","tooltipHidden","showCardAnimation","nodeBgImage","getNodeTypeBasedBgImage","NodeCardIcon","getNodeCardBasedIcon","handleOnMenuOptionClick","useCallback","optionId","menuOptions","Eye2Icon","Home2Icon","Check2Icon","jsxs","Styled.NodeCardContainer","ArrowTooltip","Styled.NodeCardInfoWrapper","Styled.IconWrapper","jsx","Styled.StyledImportantIcon","Text","FlexView","Styled.NodeKebabMenuWrapper","MoreVerticalIcon","BorderPathAnimation","NodeCardTags","Styled.NodeCardContentWrapper","Styled.NodeCardTitle","Styled.NodeMenuOptionsWrapper","NodeMenuOptions"],"mappings":";;;;;;;;;;;;;;;;;;AAuBA,MAAM,EAAE,cAAAA,IAAc,QAAAC,IAAQ,MAAAC,IAAM,cAAAC,OAAiBC,GAE/CC,KAAuDC;AAAA,EAC3D,CAAC;AAAA,IACC,UAAAC;AAAA,IACA,UAAAC;AAAA,IACA,WAAAC;AAAA,IACA,WAAAC;AAAA,IACA,6BAAAC;AAAA,IACA,kBAAAC;AAAA,IACA,YAAAC;AAAA,IACA,cAAAC;AAAA,EAAA,MACI;AACE,UAAAC,IAAeC,EAAuB,IAAI,GAE1C,EAAE,aAAAC,GAAa,aAAAC,EAAY,IAAIC,EAA2BJ,CAAY,GAEtE;AAAA,MACJ,UAAAK;AAAA,MACA,kBAAkBC;AAAA,MAClB,WAAWC;AAAA,MACX,aAAaC;AAAA,MACb,OAAAC;AAAA,MACA,OAAAC;AAAA,MACA,aAAaC;AAAA,MACb,iBAAiBC;AAAA,MACjB,aAAAC;AAAA,IACE,IAAArB,GAEE;AA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_UNASSIGN"
|
28
|
+
}, A = {
|
27
29
|
...E,
|
28
30
|
..._,
|
29
|
-
...S
|
31
|
+
...S,
|
32
|
+
...T
|
30
33
|
};
|
31
34
|
export {
|
32
|
-
|
35
|
+
A as EVENTS
|
33
36
|
};
|
34
37
|
//# sourceMappingURL=constants.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"constants.js","sources":["../../../../src/features/communication/pub-sub/constants.ts"],"sourcesContent":["const CHAPTER_SHEET_EVENTS = {\n CHAPTER_UPDATED: 'CHAPTER_UPDATED',\n LESSONS_MARKED_AS_FAMILIAR: 'LESSONS_MARKED_AS_FAMILIAR',\n LESSONS_MARKED_AS_IRRELEVANT: 'LESSONS_MARKED_AS_IRRELEVANT',\n LESSONS_PROGRESS_RESET: 'LESSONS_PROGRESS_RESET',\n UNLOCK_SHEETS: 'UNLOCK_SHEETS',\n EXTRA_PRACTICE_ASSIGNED: 'EXTRA_PRACTICE_ASSIGNED',\n CHANGE_LOCATION: 'CHANGE_LOCATION',\n SHEET_STARTED: 'SHEET_STARTED',\n SHEET_UNASSIGNED: 'SHEET_UNASSIGNED',\n} as const;\n\nconst GOAL_EVENTS = {\n GOAL_CREATED: 'GOAL_CREATED',\n GOAL_EDITED: 'GOAL_EDITED',\n GOAL_DELETED: 'GOAL_DELETED',\n GOAL_OUTCOME_ADDED: 'GOAL_OUTCOME_ADDED',\n} as const;\n\nconst MILESTONE_EVENTS = {\n MILESTONE_NAME_UPDATED: 'MILESTONE_NAME_UPDATED',\n MILESTONE_DATE_UPDATED: 'MILESTONE_DATE_UPDATED',\n MILESTONE_DELETED: 'MILESTONE_DELETED',\n MILESTONE_EDITED: 'MILESTONE_EDITED',\n MILESTONE_RESOURCE_ASSIGNED: 'MILESTONE_RESOURCE_ASSIGNED',\n MILESTONE_RESOURCE_UNASSIGNED: 'MILESTONE_RESOURCE_UNASSIGNED',\n MILESTONE_RESOURCE_RESET: 'MILESTONE_RESOURCE_RESET',\n PAST_MILESTONE_OUTCOME_ADDED: 'PAST_MILESTONE_OUTCOME_ADDED',\n MILESTONE_TEST_ASSIGNED: 'MILESTONE_TEST_ASSIGNED',\n} as const;\n\nconst EVENTS = {\n ...CHAPTER_SHEET_EVENTS,\n ...MILESTONE_EVENTS,\n ...GOAL_EVENTS,\n};\n\nexport { EVENTS };\n"],"names":["CHAPTER_SHEET_EVENTS","GOAL_EVENTS","MILESTONE_EVENTS","EVENTS"],"mappings":"AAAA,MAAMA,IAAuB;AAAA,EAC3B,iBAAiB;AAAA,EACjB,4BAA4B;AAAA,EAC5B,8BAA8B;AAAA,EAC9B,wBAAwB;AAAA,EACxB,eAAe;AAAA,EACf,yBAAyB;AAAA,EACzB,iBAAiB;AAAA,EACjB,eAAe;AAAA,EACf,kBAAkB;AACpB,GAEMC,IAAc;AAAA,EAClB,cAAc;AAAA,EACd,aAAa;AAAA,EACb,cAAc;AAAA,EACd,oBAAoB;AACtB,GAEMC,IAAmB;AAAA,EACvB,wBAAwB;AAAA,EACxB,wBAAwB;AAAA,EACxB,mBAAmB;AAAA,EACnB,kBAAkB;AAAA,EAClB,6BAA6B;AAAA,EAC7B,+BAA+B;AAAA,EAC/B,0BAA0B;AAAA,EAC1B,8BAA8B;AAAA,EAC9B,yBAAyB;AAC3B,GAEMC,IAAS;AAAA,EACb,
|
1
|
+
{"version":3,"file":"constants.js","sources":["../../../../src/features/communication/pub-sub/constants.ts"],"sourcesContent":["const CHAPTER_SHEET_EVENTS = {\n CHAPTER_UPDATED: 'CHAPTER_UPDATED',\n LESSONS_MARKED_AS_FAMILIAR: 'LESSONS_MARKED_AS_FAMILIAR',\n LESSONS_MARKED_AS_IRRELEVANT: 'LESSONS_MARKED_AS_IRRELEVANT',\n LESSONS_PROGRESS_RESET: 'LESSONS_PROGRESS_RESET',\n UNLOCK_SHEETS: 'UNLOCK_SHEETS',\n EXTRA_PRACTICE_ASSIGNED: 'EXTRA_PRACTICE_ASSIGNED',\n CHANGE_LOCATION: 'CHANGE_LOCATION',\n SHEET_STARTED: 'SHEET_STARTED',\n SHEET_UNASSIGNED: 'SHEET_UNASSIGNED',\n} as const;\n\nconst GOAL_EVENTS = {\n GOAL_CREATED: 'GOAL_CREATED',\n GOAL_EDITED: 'GOAL_EDITED',\n GOAL_DELETED: 'GOAL_DELETED',\n GOAL_OUTCOME_ADDED: 'GOAL_OUTCOME_ADDED',\n} as const;\n\nconst MILESTONE_EVENTS = {\n MILESTONE_NAME_UPDATED: 'MILESTONE_NAME_UPDATED',\n MILESTONE_DATE_UPDATED: 'MILESTONE_DATE_UPDATED',\n MILESTONE_DELETED: 'MILESTONE_DELETED',\n MILESTONE_EDITED: 'MILESTONE_EDITED',\n MILESTONE_RESOURCE_ASSIGNED: 'MILESTONE_RESOURCE_ASSIGNED',\n MILESTONE_RESOURCE_UNASSIGNED: 'MILESTONE_RESOURCE_UNASSIGNED',\n MILESTONE_RESOURCE_RESET: 'MILESTONE_RESOURCE_RESET',\n PAST_MILESTONE_OUTCOME_ADDED: 'PAST_MILESTONE_OUTCOME_ADDED',\n MILESTONE_TEST_ASSIGNED: 'MILESTONE_TEST_ASSIGNED',\n} as const;\n\nconst HOMEWORK_EVENTS = {\n HOMEWORK_UNASSIGN: 'HOMEWORK_UNASSIGN',\n} as const;\n\nconst EVENTS = {\n ...CHAPTER_SHEET_EVENTS,\n ...MILESTONE_EVENTS,\n ...GOAL_EVENTS,\n ...HOMEWORK_EVENTS,\n};\n\nexport { EVENTS };\n"],"names":["CHAPTER_SHEET_EVENTS","GOAL_EVENTS","MILESTONE_EVENTS","HOMEWORK_EVENTS","EVENTS"],"mappings":"AAAA,MAAMA,IAAuB;AAAA,EAC3B,iBAAiB;AAAA,EACjB,4BAA4B;AAAA,EAC5B,8BAA8B;AAAA,EAC9B,wBAAwB;AAAA,EACxB,eAAe;AAAA,EACf,yBAAyB;AAAA,EACzB,iBAAiB;AAAA,EACjB,eAAe;AAAA,EACf,kBAAkB;AACpB,GAEMC,IAAc;AAAA,EAClB,cAAc;AAAA,EACd,aAAa;AAAA,EACb,cAAc;AAAA,EACd,oBAAoB;AACtB,GAEMC,IAAmB;AAAA,EACvB,wBAAwB;AAAA,EACxB,wBAAwB;AAAA,EACxB,mBAAmB;AAAA,EACnB,kBAAkB;AAAA,EAClB,6BAA6B;AAAA,EAC7B,+BAA+B;AAAA,EAC/B,0BAA0B;AAAA,EAC1B,8BAA8B;AAAA,EAC9B,yBAAyB;AAC3B,GAEMC,IAAkB;AAAA,EACtB,mBAAmB;AACrB,GAEMC,IAAS;AAAA,EACb,GAAGJ;AAAA,EACH,GAAGE;AAAA,EACH,GAAGD;AAAA,EACH,GAAGE;AACL;"}
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { jsxs as
|
1
|
+
import { jsxs as c, jsx as e } from "react/jsx-runtime";
|
2
2
|
import { memo as te, useRef as _, useState as ie, useLayoutEffect as ne, useCallback as y } from "react";
|
3
3
|
import V from "../../assets/line-icons/icons/eye2.js";
|
4
4
|
import oe from "../../assets/line-icons/icons/more-vertical.js";
|
@@ -20,15 +20,15 @@ const _e = ({
|
|
20
20
|
subHeader: G,
|
21
21
|
userType: K,
|
22
22
|
userMilestoneId: t,
|
23
|
-
onNodeUnassign:
|
24
|
-
onNodeReattempt:
|
23
|
+
onNodeUnassign: a,
|
24
|
+
onNodeReattempt: s,
|
25
25
|
onNodeView: h,
|
26
26
|
onNodeReview: i,
|
27
27
|
onNodeAttempt: m,
|
28
28
|
renderAs: L,
|
29
29
|
shouldOpenOnRight: z
|
30
30
|
}) => {
|
31
|
-
const
|
31
|
+
const n = L === "homework", {
|
32
32
|
node_type: f,
|
33
33
|
state: F,
|
34
34
|
accuracy: P,
|
@@ -39,7 +39,7 @@ const _e = ({
|
|
39
39
|
permissions: J,
|
40
40
|
user_node_id: l,
|
41
41
|
unlocked_on_ts: v
|
42
|
-
} = r, Q = se(f), H = le(f), w = _(null), g = _(null),
|
42
|
+
} = r, Q = se(f), H = le(f), w = _(null), g = _(null), o = _(null), { menuVisible: O, onMenuClick: Y } = M(w), { menuVisible: Z, onMenuClick: R } = M(g), [U, D] = ie(!1), {
|
43
43
|
can_start: W,
|
44
44
|
can_resume: S,
|
45
45
|
can_review: $,
|
@@ -48,8 +48,8 @@ const _e = ({
|
|
48
48
|
can_reset: b
|
49
49
|
} = J, C = K === "STUDENT";
|
50
50
|
ne(() => {
|
51
|
-
|
52
|
-
}, [
|
51
|
+
o.current && o.current.scrollHeight > o.current.clientHeight && D(!0);
|
52
|
+
}, [o]);
|
53
53
|
const k = y(() => {
|
54
54
|
if (W || S) {
|
55
55
|
if (typeof m != "function")
|
@@ -57,7 +57,7 @@ const _e = ({
|
|
57
57
|
m(r);
|
58
58
|
return;
|
59
59
|
}
|
60
|
-
if (b && !
|
60
|
+
if (b && !n) {
|
61
61
|
R();
|
62
62
|
return;
|
63
63
|
}
|
@@ -73,7 +73,7 @@ const _e = ({
|
|
73
73
|
W,
|
74
74
|
S,
|
75
75
|
b,
|
76
|
-
|
76
|
+
n,
|
77
77
|
$,
|
78
78
|
m,
|
79
79
|
r,
|
@@ -103,16 +103,16 @@ const _e = ({
|
|
103
103
|
k();
|
104
104
|
return;
|
105
105
|
case "teacher-card-unassign":
|
106
|
-
|
106
|
+
a == null || a(r, t);
|
107
107
|
return;
|
108
108
|
case "student-card-reattempt":
|
109
|
-
|
109
|
+
s == null || s(r, t);
|
110
110
|
return;
|
111
111
|
default:
|
112
112
|
throw new Error(`No callback function for ${A}`);
|
113
113
|
}
|
114
114
|
},
|
115
|
-
[r,
|
115
|
+
[r, s, a, k, T, t]
|
116
116
|
), ee = [
|
117
117
|
{
|
118
118
|
id: "teacher-card-view",
|
@@ -125,7 +125,7 @@ const _e = ({
|
|
125
125
|
id: "teacher-card-unassign",
|
126
126
|
label: "Unassign",
|
127
127
|
icon: Te,
|
128
|
-
disabled: !N,
|
128
|
+
disabled: !N || !n,
|
129
129
|
onClick: u
|
130
130
|
}
|
131
131
|
], re = [
|
@@ -144,8 +144,8 @@ const _e = ({
|
|
144
144
|
onClick: u
|
145
145
|
}
|
146
146
|
];
|
147
|
-
return /* @__PURE__ */
|
148
|
-
/* @__PURE__ */ e(ue, { onClick: C ? k : T, label: "homework-card", children: /* @__PURE__ */
|
147
|
+
return /* @__PURE__ */ c(me, { $position: "relative", $width: "fit-content", children: [
|
148
|
+
/* @__PURE__ */ e(ue, { onClick: C ? k : T, label: "homework-card", children: /* @__PURE__ */ c(
|
149
149
|
d,
|
150
150
|
{
|
151
151
|
ref: g,
|
@@ -153,7 +153,7 @@ const _e = ({
|
|
153
153
|
$position: "relative",
|
154
154
|
$background: `${I || "ORANGE"}_2`,
|
155
155
|
children: [
|
156
|
-
/* @__PURE__ */
|
156
|
+
/* @__PURE__ */ c(
|
157
157
|
fe,
|
158
158
|
{
|
159
159
|
$flexDirection: "row",
|
@@ -200,7 +200,7 @@ const _e = ({
|
|
200
200
|
progressBg: `${I || "ORANGE"}_4`
|
201
201
|
}
|
202
202
|
),
|
203
|
-
/* @__PURE__ */
|
203
|
+
/* @__PURE__ */ c(d, { $gutterX: 0.75, $gapX: 1, $flexRowGapX: 0.5, $background: "WHITE", children: [
|
204
204
|
/* @__PURE__ */ e(
|
205
205
|
B,
|
206
206
|
{
|
@@ -209,7 +209,7 @@ const _e = ({
|
|
209
209
|
tooltipItem: x,
|
210
210
|
hidden: !U,
|
211
211
|
parentWidth: "auto",
|
212
|
-
children: /* @__PURE__ */ e(d, { $heightX: 2.5, children: /* @__PURE__ */ e($e, { ref:
|
212
|
+
children: /* @__PURE__ */ e(d, { $heightX: 2.5, children: /* @__PURE__ */ e($e, { ref: o, $renderAs: "ab3", children: x }) })
|
213
213
|
}
|
214
214
|
),
|
215
215
|
/* @__PURE__ */ e(
|
@@ -226,7 +226,7 @@ const _e = ({
|
|
226
226
|
]
|
227
227
|
}
|
228
228
|
) }),
|
229
|
-
C && !
|
229
|
+
C && !n && /* @__PURE__ */ e(
|
230
230
|
j,
|
231
231
|
{
|
232
232
|
$width: 200,
|
@@ -236,7 +236,7 @@ const _e = ({
|
|
236
236
|
shouldOpenOnRight: !1
|
237
237
|
}
|
238
238
|
),
|
239
|
-
!C && /* @__PURE__ */
|
239
|
+
!C && /* @__PURE__ */ c(Ce, { $position: "absolute", $width: "fit-content", children: [
|
240
240
|
/* @__PURE__ */ e(
|
241
241
|
B,
|
242
242
|
{
|
@@ -245,7 +245,7 @@ const _e = ({
|
|
245
245
|
position: "bottom",
|
246
246
|
zIndex: 5,
|
247
247
|
parentWidth: "100%",
|
248
|
-
hidden: !
|
248
|
+
hidden: !n || O,
|
249
249
|
children: /* @__PURE__ */ e(
|
250
250
|
ke,
|
251
251
|
{
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"homework-card.js","sources":["../../../src/features/homework/homework-card.tsx"],"sourcesContent":["import type {\n INodeCardCallbacks,\n INodeDataProps,\n} from '../chapters-v2/comps/node-card/node-card-types';\nimport type { TUserTypes } from '../ui/types';\n\nimport { memo, useCallback, useLayoutEffect, useRef, useState } 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 NodeCardTags from '../chapters-v2/comps/node-card/node-card-tags';\nimport { getNodeTypeBasedBgImage } from '../chapters-v2/utils';\nimport { getNodeCardBasedIcon } from '../chapters-v2/utils/node-card-utils';\nimport ArrowTooltip from '../ui/arrow-tooltip/arrow-tooltip';\nimport Clickable from '../ui/buttons/clickable/clickable';\nimport useContextMenuClickHandler from '../ui/hooks/use-context-menu-click-handler';\nimport FlexView from '../ui/layout/flex-view';\nimport Text from '../ui/text/text';\nimport CardMenuOptions from './card-menu-options';\nimport NodeProgress from './node-progress';\nimport * as Styled from './styles';\n\ninterface IHomeworkCardProps extends INodeCardCallbacks {\n header: string;\n nodeData: INodeDataProps;\n subHeader: string;\n userType: TUserTypes;\n userMilestoneId?: string;\n renderAs: 'homework' | 'milestone';\n shouldOpenOnRight: boolean;\n}\n\nconst HomeworkCard = ({\n header,\n nodeData,\n subHeader,\n userType,\n userMilestoneId,\n onNodeUnassign,\n onNodeReattempt,\n onNodeView,\n onNodeReview,\n onNodeAttempt,\n renderAs,\n shouldOpenOnRight,\n}: IHomeworkCardProps) => {\n const isHomeWork = renderAs === 'homework';\n const {\n node_type: nodeType,\n state,\n accuracy,\n due_date_ts: dueDateTs,\n image_url: imageUrl,\n image_hue: imageHue,\n card_header: cardHeader = '',\n permissions,\n user_node_id: userNodeId,\n unlocked_on_ts: unlockedOnTs,\n } = nodeData;\n const bgImage = getNodeTypeBasedBgImage(nodeType);\n const NodeCardIcon = getNodeCardBasedIcon(nodeType);\n const teacherContainerRef = useRef<HTMLDivElement>(null);\n const studentContainerRef = useRef<HTMLDivElement>(null);\n const titleTextRef = useRef<HTMLDivElement>(null);\n const { menuVisible: teacherMenuVisible, onMenuClick: onTeacherMenuClick } =\n useContextMenuClickHandler(teacherContainerRef);\n const { menuVisible: studentMenuVisible, onMenuClick: onStudentMenuClick } =\n useContextMenuClickHandler(studentContainerRef);\n const [showTitleTooltip, setShowTitleTooltip] = useState(false);\n\n const {\n can_start: canStart,\n can_resume: canResume,\n can_review: canReview,\n can_teacher_review: canTeacherReview,\n can_unassign: canUnassign,\n can_reset: canReset,\n } = permissions;\n const isStudent = userType === 'STUDENT';\n\n useLayoutEffect(() => {\n if (\n titleTextRef.current &&\n titleTextRef.current.scrollHeight > titleTextRef.current.clientHeight\n ) {\n setShowTitleTooltip(true);\n }\n }, [titleTextRef]);\n\n const onStudentView = useCallback(() => {\n if (canStart || canResume) {\n if (typeof onNodeAttempt !== 'function') {\n throw new Error('onNodeAttempt must be a function');\n }\n\n onNodeAttempt(nodeData);\n\n return;\n }\n\n if (canReset && !isHomeWork) {\n onStudentMenuClick();\n\n return;\n }\n\n if (canReview) {\n if (typeof onNodeReview !== 'function') {\n throw new Error('onReview must be a function');\n }\n\n if (!userNodeId) {\n throw new Error('user node id must be present to review the sheet');\n }\n onNodeReview(nodeData, userMilestoneId);\n\n return;\n }\n }, [\n canStart,\n canResume,\n canReset,\n isHomeWork,\n canReview,\n onNodeAttempt,\n nodeData,\n onStudentMenuClick,\n onNodeReview,\n userNodeId,\n userMilestoneId,\n ]);\n\n const onTeacherView = useCallback(() => {\n if (canTeacherReview) {\n if (typeof onNodeReview !== 'function') {\n throw new Error('onNodeReview must be a function');\n }\n\n if (!userNodeId) {\n throw new Error('user node id must be present to review the sheet');\n }\n\n onNodeReview(nodeData, userMilestoneId);\n\n return;\n }\n\n if (typeof onNodeView !== 'function') {\n throw new Error('onNodeView must be a function');\n }\n\n onNodeView(nodeData, userMilestoneId);\n }, [canTeacherReview, userMilestoneId, nodeData, onNodeReview, onNodeView, userNodeId]);\n\n const handleOnMenuOptionClick = useCallback(\n (optionId: string) => {\n switch (optionId) {\n case 'teacher-card-view':\n onTeacherView();\n\n return;\n case 'student-card-click':\n onStudentView();\n\n return;\n case 'teacher-card-unassign':\n onNodeUnassign?.(nodeData, userMilestoneId);\n\n return;\n case 'student-card-reattempt':\n onNodeReattempt?.(nodeData, userMilestoneId);\n\n return;\n default:\n throw new Error(`No callback function for ${optionId}`);\n }\n },\n [nodeData, onNodeReattempt, onNodeUnassign, onStudentView, onTeacherView, userMilestoneId],\n );\n\n const teacherOptions = [\n {\n id: 'teacher-card-view',\n label: 'View',\n icon: Eye2Icon,\n disabled: false,\n onClick: handleOnMenuOptionClick,\n },\n {\n id: 'teacher-card-unassign',\n label: 'Unassign',\n icon: Styled.StyledMinus2Icon,\n disabled: !canUnassign,\n onClick: handleOnMenuOptionClick,\n },\n ];\n\n const studentOptions = [\n {\n id: 'student-card-click',\n label: 'Review',\n icon: Eye2Icon,\n disabled: !canReview,\n onClick: handleOnMenuOptionClick,\n },\n {\n id: 'student-card-reattempt',\n label: 'Reattempt',\n icon: RedoIcon,\n disabled: !canReset,\n onClick: handleOnMenuOptionClick,\n },\n ];\n\n return (\n <Styled.CardContainer $position=\"relative\" $width=\"fit-content\">\n <Clickable onClick={isStudent ? onStudentView : onTeacherView} label=\"homework-card\">\n <FlexView\n ref={studentContainerRef}\n $widthX={12.38}\n $position=\"relative\"\n $background={`${imageHue || 'ORANGE'}_2`}\n >\n <Styled.CardWrapper\n $flexDirection=\"row\"\n $alignItems=\"center\"\n $width=\"100%\"\n $heightX={3.5}\n $bgImage={bgImage}\n $gutterX={0.78125}\n $flexGap={8.5}\n $position=\"relative\"\n >\n <Styled.IconWrapper\n $width={31}\n $height={31}\n $borderRadiusX={2}\n $background=\"WHITE_1\"\n $position=\"relative\"\n $alignItems=\"center\"\n $justifyContent=\"center\"\n >\n {NodeCardIcon && <NodeCardIcon width={20} height={20} />}\n </Styled.IconWrapper>\n <Text $renderAs=\"ac4-black\">{cardHeader}</Text>\n {!!imageUrl && (\n <Styled.BannerImageWrapper>\n <Styled.BannerImage src={imageUrl} alt=\"Chapter image\" />\n </Styled.BannerImageWrapper>\n )}\n </Styled.CardWrapper>\n <NodeCardTags\n nodeType={nodeType}\n state={state}\n accuracy={accuracy}\n dueDateTs={dueDateTs}\n />\n {dueDateTs && unlockedOnTs && (\n <NodeProgress\n dueDate={dueDateTs * 1000}\n unlockedOn={unlockedOnTs * 1000}\n progressBg={`${imageHue || 'ORANGE'}_4`}\n />\n )}\n <FlexView $gutterX={0.75} $gapX={1} $flexRowGapX={0.5} $background=\"WHITE\">\n <ArrowTooltip\n renderAs=\"primary\"\n position=\"bottom\"\n tooltipItem={header}\n hidden={!showTitleTooltip}\n parentWidth=\"auto\"\n >\n <FlexView $heightX={2.5}>\n <Styled.HeaderText ref={titleTextRef} $renderAs=\"ab3\">\n {header}\n </Styled.HeaderText>\n </FlexView>\n </ArrowTooltip>\n <FlexView\n $flexDirection=\"row\"\n $heightX={1.25}\n $alignItems=\"center\"\n $justifyContent=\"space-between\"\n >\n <Styled.SubHeaderText $renderAs=\"ub3\" $color=\"BLACK_T_60\">\n {subHeader}\n </Styled.SubHeaderText>\n </FlexView>\n </FlexView>\n </FlexView>\n </Clickable>\n {isStudent && !isHomeWork && (\n <CardMenuOptions\n $width={200}\n options={studentOptions}\n triggerRef={studentContainerRef}\n visible={studentMenuVisible}\n shouldOpenOnRight={false}\n />\n )}\n {!isStudent && (\n <Styled.MenuWrapper $position=\"absolute\" $width=\"fit-content\">\n <ArrowTooltip\n renderAs=\"primary\"\n tooltipItem=\"Review\"\n position=\"bottom\"\n zIndex={5}\n parentWidth=\"100%\"\n hidden={!isHomeWork || teacherMenuVisible}\n >\n <Styled.CardKebabMenuWrapper\n $alignItems=\"center\"\n $justifyContent=\"center\"\n ref={teacherContainerRef}\n onClick={onTeacherMenuClick}\n >\n <MoreVerticalIcon width={16} height={16} />\n </Styled.CardKebabMenuWrapper>\n </ArrowTooltip>\n <CardMenuOptions\n options={teacherOptions}\n triggerRef={teacherContainerRef}\n visible={teacherMenuVisible}\n shouldOpenOnRight={shouldOpenOnRight}\n />\n </Styled.MenuWrapper>\n )}\n </Styled.CardContainer>\n );\n};\n\nexport default memo(HomeworkCard);\n"],"names":["HomeworkCard","header","nodeData","subHeader","userType","userMilestoneId","onNodeUnassign","onNodeReattempt","onNodeView","onNodeReview","onNodeAttempt","renderAs","shouldOpenOnRight","isHomeWork","nodeType","state","accuracy","dueDateTs","imageUrl","imageHue","cardHeader","permissions","userNodeId","unlockedOnTs","bgImage","getNodeTypeBasedBgImage","NodeCardIcon","getNodeCardBasedIcon","teacherContainerRef","useRef","studentContainerRef","titleTextRef","teacherMenuVisible","onTeacherMenuClick","useContextMenuClickHandler","studentMenuVisible","onStudentMenuClick","showTitleTooltip","setShowTitleTooltip","useState","canStart","canResume","canReview","canTeacherReview","canUnassign","canReset","isStudent","useLayoutEffect","onStudentView","useCallback","onTeacherView","handleOnMenuOptionClick","optionId","teacherOptions","Eye2Icon","Styled.StyledMinus2Icon","studentOptions","RedoIcon","Styled.CardContainer","jsx","Clickable","jsxs","FlexView","Styled.CardWrapper","Styled.IconWrapper","Text","Styled.BannerImageWrapper","Styled.BannerImage","NodeCardTags","NodeProgress","ArrowTooltip","Styled.HeaderText","Styled.SubHeaderText","CardMenuOptions","Styled.MenuWrapper","Styled.CardKebabMenuWrapper","MoreVerticalIcon","HomeworkCard$1","memo"],"mappings":";;;;;;;;;;;;;;;;AAiCA,MAAMA,KAAe,CAAC;AAAA,EACpB,QAAAC;AAAA,EACA,UAAAC;AAAA,EACA,WAAAC;AAAA,EACA,UAAAC;AAAA,EACA,iBAAAC;AAAA,EACA,gBAAAC;AAAA,EACA,iBAAAC;AAAA,EACA,YAAAC;AAAA,EACA,cAAAC;AAAA,EACA,eAAAC;AAAA,EACA,UAAAC;AAAA,EACA,mBAAAC;AACF,MAA0B;AACxB,QAAMC,IAAaF,MAAa,YAC1B;AAAA,IACJ,WAAWG;AAAA,IACX,OAAAC;AAAA,IACA,UAAAC;AAAA,IACA,aAAaC;AAAA,IACb,WAAWC;AAAA,IACX,WAAWC;AAAA,IACX,aAAaC,IAAa;AAAA,IAC1B,aAAAC;AAAA,IACA,cAAcC;AAAA,IACd,gBAAgBC;AAAA,EACd,IAAArB,GACEsB,IAAUC,GAAwBX,CAAQ,GAC1CY,IAAeC,GAAqBb,CAAQ,GAC5Cc,IAAsBC,EAAuB,IAAI,GACjDC,IAAsBD,EAAuB,IAAI,GACjDE,IAAeF,EAAuB,IAAI,GAC1C,EAAE,aAAaG,GAAoB,aAAaC,MACpDC,EAA2BN,CAAmB,GAC1C,EAAE,aAAaO,GAAoB,aAAaC,MACpDF,EAA2BJ,CAAmB,GAC1C,CAACO,GAAkBC,CAAmB,IAAIC,GAAS,EAAK,GAExD;AAAA,IACJ,WAAWC;AAAA,IACX,YAAYC;AAAA,IACZ,YAAYC;AAAA,IACZ,oBAAoBC;AAAA,IACpB,cAAcC;AAAA,IACd,WAAWC;AAAA,EACT,IAAAxB,GACEyB,IAAY1C,MAAa;AAE/B,EAAA2C,GAAgB,MAAM;AACpB,IACEhB,EAAa,WACbA,EAAa,QAAQ,eAAeA,EAAa,QAAQ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features/homework/homework-card.tsx"],"sourcesContent":["import type {\n INodeCardCallbacks,\n INodeDataProps,\n} from '../chapters-v2/comps/node-card/node-card-types';\nimport type { TUserTypes } from '../ui/types';\nimport type { IHomeworkData } from './hw-card-list/api/get-homeworks';\n\nimport { memo, useCallback, useLayoutEffect, useRef, useState } 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 NodeCardTags from '../chapters-v2/comps/node-card/node-card-tags';\nimport { getNodeTypeBasedBgImage } from '../chapters-v2/utils';\nimport { getNodeCardBasedIcon } from '../chapters-v2/utils/node-card-utils';\nimport ArrowTooltip from '../ui/arrow-tooltip/arrow-tooltip';\nimport Clickable from '../ui/buttons/clickable/clickable';\nimport useContextMenuClickHandler from '../ui/hooks/use-context-menu-click-handler';\nimport FlexView from '../ui/layout/flex-view';\nimport Text from '../ui/text/text';\nimport CardMenuOptions from './card-menu-options';\nimport NodeProgress from './node-progress';\nimport * as Styled from './styles';\n\ninterface IHomeworkCardProps extends INodeCardCallbacks {\n header: string;\n nodeData: INodeDataProps | IHomeworkData;\n subHeader: string;\n userType: TUserTypes;\n userMilestoneId?: string;\n renderAs: 'homework' | 'milestone';\n shouldOpenOnRight: boolean;\n}\n\nconst HomeworkCard = ({\n header,\n nodeData,\n subHeader,\n userType,\n userMilestoneId,\n onNodeUnassign,\n onNodeReattempt,\n onNodeView,\n onNodeReview,\n onNodeAttempt,\n renderAs,\n shouldOpenOnRight,\n}: IHomeworkCardProps) => {\n const isHomeWork = renderAs === 'homework';\n const {\n node_type: nodeType,\n state,\n accuracy,\n due_date_ts: dueDateTs,\n image_url: imageUrl,\n image_hue: imageHue,\n card_header: cardHeader = '',\n permissions,\n user_node_id: userNodeId,\n unlocked_on_ts: unlockedOnTs,\n } = nodeData;\n const bgImage = getNodeTypeBasedBgImage(nodeType);\n const NodeCardIcon = getNodeCardBasedIcon(nodeType);\n const teacherContainerRef = useRef<HTMLDivElement>(null);\n const studentContainerRef = useRef<HTMLDivElement>(null);\n const titleTextRef = useRef<HTMLDivElement>(null);\n const { menuVisible: teacherMenuVisible, onMenuClick: onTeacherMenuClick } =\n useContextMenuClickHandler(teacherContainerRef);\n const { menuVisible: studentMenuVisible, onMenuClick: onStudentMenuClick } =\n useContextMenuClickHandler(studentContainerRef);\n const [showTitleTooltip, setShowTitleTooltip] = useState(false);\n\n const {\n can_start: canStart,\n can_resume: canResume,\n can_review: canReview,\n can_teacher_review: canTeacherReview,\n can_unassign: canUnassign,\n can_reset: canReset,\n } = permissions;\n const isStudent = userType === 'STUDENT';\n\n useLayoutEffect(() => {\n if (\n titleTextRef.current &&\n titleTextRef.current.scrollHeight > titleTextRef.current.clientHeight\n ) {\n setShowTitleTooltip(true);\n }\n }, [titleTextRef]);\n\n const onStudentView = useCallback(() => {\n if (canStart || canResume) {\n if (typeof onNodeAttempt !== 'function') {\n throw new Error('onNodeAttempt must be a function');\n }\n\n onNodeAttempt(nodeData);\n\n return;\n }\n\n if (canReset && !isHomeWork) {\n onStudentMenuClick();\n\n return;\n }\n\n if (canReview) {\n if (typeof onNodeReview !== 'function') {\n throw new Error('onReview must be a function');\n }\n\n if (!userNodeId) {\n throw new Error('user node id must be present to review the sheet');\n }\n onNodeReview(nodeData, userMilestoneId);\n\n return;\n }\n }, [\n canStart,\n canResume,\n canReset,\n isHomeWork,\n canReview,\n onNodeAttempt,\n nodeData,\n onStudentMenuClick,\n onNodeReview,\n userNodeId,\n userMilestoneId,\n ]);\n\n const onTeacherView = useCallback(() => {\n if (canTeacherReview) {\n if (typeof onNodeReview !== 'function') {\n throw new Error('onNodeReview must be a function');\n }\n\n if (!userNodeId) {\n throw new Error('user node id must be present to review the sheet');\n }\n\n onNodeReview(nodeData, userMilestoneId);\n\n return;\n }\n\n if (typeof onNodeView !== 'function') {\n throw new Error('onNodeView must be a function');\n }\n\n onNodeView(nodeData, userMilestoneId);\n }, [canTeacherReview, userMilestoneId, nodeData, onNodeReview, onNodeView, userNodeId]);\n\n const handleOnMenuOptionClick = useCallback(\n (optionId: string) => {\n switch (optionId) {\n case 'teacher-card-view':\n onTeacherView();\n\n return;\n case 'student-card-click':\n onStudentView();\n\n return;\n case 'teacher-card-unassign':\n onNodeUnassign?.(nodeData, userMilestoneId);\n\n return;\n case 'student-card-reattempt':\n onNodeReattempt?.(nodeData, userMilestoneId);\n\n return;\n default:\n throw new Error(`No callback function for ${optionId}`);\n }\n },\n [nodeData, onNodeReattempt, onNodeUnassign, onStudentView, onTeacherView, userMilestoneId],\n );\n\n const teacherOptions = [\n {\n id: 'teacher-card-view',\n label: 'View',\n icon: Eye2Icon,\n disabled: false,\n onClick: handleOnMenuOptionClick,\n },\n {\n id: 'teacher-card-unassign',\n label: 'Unassign',\n icon: Styled.StyledMinus2Icon,\n disabled: !canUnassign || !isHomeWork,\n onClick: handleOnMenuOptionClick,\n },\n ];\n\n const studentOptions = [\n {\n id: 'student-card-click',\n label: 'Review',\n icon: Eye2Icon,\n disabled: !canReview,\n onClick: handleOnMenuOptionClick,\n },\n {\n id: 'student-card-reattempt',\n label: 'Reattempt',\n icon: RedoIcon,\n disabled: !canReset,\n onClick: handleOnMenuOptionClick,\n },\n ];\n\n return (\n <Styled.CardContainer $position=\"relative\" $width=\"fit-content\">\n <Clickable onClick={isStudent ? onStudentView : onTeacherView} label=\"homework-card\">\n <FlexView\n ref={studentContainerRef}\n $widthX={12.38}\n $position=\"relative\"\n $background={`${imageHue || 'ORANGE'}_2`}\n >\n <Styled.CardWrapper\n $flexDirection=\"row\"\n $alignItems=\"center\"\n $width=\"100%\"\n $heightX={3.5}\n $bgImage={bgImage}\n $gutterX={0.78125}\n $flexGap={8.5}\n $position=\"relative\"\n >\n <Styled.IconWrapper\n $width={31}\n $height={31}\n $borderRadiusX={2}\n $background=\"WHITE_1\"\n $position=\"relative\"\n $alignItems=\"center\"\n $justifyContent=\"center\"\n >\n {NodeCardIcon && <NodeCardIcon width={20} height={20} />}\n </Styled.IconWrapper>\n <Text $renderAs=\"ac4-black\">{cardHeader}</Text>\n {!!imageUrl && (\n <Styled.BannerImageWrapper>\n <Styled.BannerImage src={imageUrl} alt=\"Chapter image\" />\n </Styled.BannerImageWrapper>\n )}\n </Styled.CardWrapper>\n <NodeCardTags\n nodeType={nodeType}\n state={state}\n accuracy={accuracy}\n dueDateTs={dueDateTs}\n />\n {dueDateTs && unlockedOnTs && (\n <NodeProgress\n dueDate={dueDateTs * 1000}\n unlockedOn={unlockedOnTs * 1000}\n progressBg={`${imageHue || 'ORANGE'}_4`}\n />\n )}\n <FlexView $gutterX={0.75} $gapX={1} $flexRowGapX={0.5} $background=\"WHITE\">\n <ArrowTooltip\n renderAs=\"primary\"\n position=\"bottom\"\n tooltipItem={header}\n hidden={!showTitleTooltip}\n parentWidth=\"auto\"\n >\n <FlexView $heightX={2.5}>\n <Styled.HeaderText ref={titleTextRef} $renderAs=\"ab3\">\n {header}\n </Styled.HeaderText>\n </FlexView>\n </ArrowTooltip>\n <FlexView\n $flexDirection=\"row\"\n $heightX={1.25}\n $alignItems=\"center\"\n $justifyContent=\"space-between\"\n >\n <Styled.SubHeaderText $renderAs=\"ub3\" $color=\"BLACK_T_60\">\n {subHeader}\n </Styled.SubHeaderText>\n </FlexView>\n </FlexView>\n </FlexView>\n </Clickable>\n {isStudent && !isHomeWork && (\n <CardMenuOptions\n $width={200}\n options={studentOptions}\n triggerRef={studentContainerRef}\n visible={studentMenuVisible}\n shouldOpenOnRight={false}\n />\n )}\n {!isStudent && (\n <Styled.MenuWrapper $position=\"absolute\" $width=\"fit-content\">\n <ArrowTooltip\n renderAs=\"primary\"\n tooltipItem=\"Review\"\n position=\"bottom\"\n zIndex={5}\n parentWidth=\"100%\"\n hidden={!isHomeWork || teacherMenuVisible}\n >\n <Styled.CardKebabMenuWrapper\n $alignItems=\"center\"\n $justifyContent=\"center\"\n ref={teacherContainerRef}\n onClick={onTeacherMenuClick}\n >\n <MoreVerticalIcon width={16} height={16} />\n </Styled.CardKebabMenuWrapper>\n </ArrowTooltip>\n <CardMenuOptions\n options={teacherOptions}\n triggerRef={teacherContainerRef}\n visible={teacherMenuVisible}\n shouldOpenOnRight={shouldOpenOnRight}\n />\n </Styled.MenuWrapper>\n )}\n </Styled.CardContainer>\n );\n};\n\nexport default memo(HomeworkCard);\n"],"names":["HomeworkCard","header","nodeData","subHeader","userType","userMilestoneId","onNodeUnassign","onNodeReattempt","onNodeView","onNodeReview","onNodeAttempt","renderAs","shouldOpenOnRight","isHomeWork","nodeType","state","accuracy","dueDateTs","imageUrl","imageHue","cardHeader","permissions","userNodeId","unlockedOnTs","bgImage","getNodeTypeBasedBgImage","NodeCardIcon","getNodeCardBasedIcon","teacherContainerRef","useRef","studentContainerRef","titleTextRef","teacherMenuVisible","onTeacherMenuClick","useContextMenuClickHandler","studentMenuVisible","onStudentMenuClick","showTitleTooltip","setShowTitleTooltip","useState","canStart","canResume","canReview","canTeacherReview","canUnassign","canReset","isStudent","useLayoutEffect","onStudentView","useCallback","onTeacherView","handleOnMenuOptionClick","optionId","teacherOptions","Eye2Icon","Styled.StyledMinus2Icon","studentOptions","RedoIcon","Styled.CardContainer","jsx","Clickable","jsxs","FlexView","Styled.CardWrapper","Styled.IconWrapper","Text","Styled.BannerImageWrapper","Styled.BannerImage","NodeCardTags","NodeProgress","ArrowTooltip","Styled.HeaderText","Styled.SubHeaderText","CardMenuOptions","Styled.MenuWrapper","Styled.CardKebabMenuWrapper","MoreVerticalIcon","HomeworkCard$1","memo"],"mappings":";;;;;;;;;;;;;;;;AAkCA,MAAMA,KAAe,CAAC;AAAA,EACpB,QAAAC;AAAA,EACA,UAAAC;AAAA,EACA,WAAAC;AAAA,EACA,UAAAC;AAAA,EACA,iBAAAC;AAAA,EACA,gBAAAC;AAAA,EACA,iBAAAC;AAAA,EACA,YAAAC;AAAA,EACA,cAAAC;AAAA,EACA,eAAAC;AAAA,EACA,UAAAC;AAAA,EACA,mB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A,QACT,YAAY1B;AAAA,QACZ,SAASK;AAAA,QACT,mBAAmB;AAAA,MAAA;AAAA,IACrB;AAAA,IAED,CAACW,KACC,gBAAAe,EAAAa,IAAA,EAAmB,WAAU,YAAW,QAAO,eAC9C,UAAA;AAAA,MAAA,gBAAAf;AAAA,QAACW;AAAA,QAAA;AAAA,UACC,UAAS;AAAA,UACT,aAAY;AAAA,UACZ,UAAS;AAAA,UACT,QAAQ;AAAA,UACR,aAAY;AAAA,UACZ,QAAQ,CAACzD,KAAcmB;AAAA,UAEvB,UAAA,gBAAA2B;AAAA,YAACgB;AAAAA,YAAA;AAAA,cACC,aAAY;AAAA,cACZ,iBAAgB;AAAA,cAChB,KAAK/C;AAAA,cACL,SAASK;AAAA,cAET,UAAC,gBAAA0B,EAAAiB,IAAA,EAAiB,OAAO,IAAI,QAAQ,IAAI;AAAA,YAAA;AAAA,UAC3C;AAAA,QAAA;AAAA,MACF;AAAA,MACA,gBAAAjB;AAAA,QAACc;AAAA,QAAA;AAAA,UACC,SAASpB;AAAA,UACT,YAAYzB;AAAA,UACZ,SAASI;AAAA,UACT,mBAAApB;AAAA,QAAA;AAAA,MACF;AAAA,IAAA,GACF;AAAA,EAEJ,EAAA,CAAA;AAEJ,GAEeiE,KAAAC,GAAK9E,EAAY;"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"get-homeworks.js","sources":["../../../../../src/features/homework/hw-card-list/api/get-homeworks.ts"],"sourcesContent":["import type { INodeDataProps } from '../../../chapters-v2/comps/node-card/node-card-types';\n\nimport { createGetAPI } from '@cuemath/rest-api';\n\nimport { BASE_URL_V3 } from '../../../../constants/api';\n\nconst { useGet: useGetHomeworks, invalidate: invalidateHomeworks } = createGetAPI<\n
|
1
|
+
{"version":3,"file":"get-homeworks.js","sources":["../../../../../src/features/homework/hw-card-list/api/get-homeworks.ts"],"sourcesContent":["import type { INodeDataProps } from '../../../chapters-v2/comps/node-card/node-card-types';\n\nimport { createGetAPI } from '@cuemath/rest-api';\n\nimport { BASE_URL_V3 } from '../../../../constants/api';\n\nexport interface IHomeworkData extends INodeDataProps {\n homework_id: string;\n chapter_name: string;\n}\n\nconst { useGet: useGetHomeworks, invalidate: invalidateHomeworks } = createGetAPI<\n IHomeworkData[],\n void,\n { stream: string }\n>({\n getURL: (studentId: string, _, { stream }) =>\n `${BASE_URL_V3}/users/${studentId}/course-streams/${stream}/homework`,\n});\n\nexport { useGetHomeworks, invalidateHomeworks };\n"],"names":["useGetHomeworks","invalidateHomeworks","createGetAPI","studentId","_","stream","BASE_URL_V3"],"mappings":";;AAWA,MAAM,EAAE,QAAQA,GAAiB,YAAYC,EAAA,IAAwBC,EAInE;AAAA,EACA,QAAQ,CAACC,GAAmBC,GAAG,EAAE,QAAAC,EAAA,MAC/B,GAAGC,CAAW,UAAUH,CAAS,mBAAmBE,CAAM;AAC9D,CAAC;"}
|
@@ -1,76 +1,83 @@
|
|
1
|
-
import { jsxs as
|
2
|
-
import { h as
|
3
|
-
import { useRef as
|
4
|
-
import
|
5
|
-
import
|
6
|
-
import { getTopicsFromItems as
|
7
|
-
import
|
8
|
-
import
|
1
|
+
import { jsxs as s, jsx as t } from "react/jsx-runtime";
|
2
|
+
import { h as Z } from "../../../node_modules/humanize-plus/dist/humanize.js";
|
3
|
+
import { useRef as D, useState as c, useCallback as n, useEffect as u } from "react";
|
4
|
+
import J from "../../../assets/line-icons/icons/chevron-left.js";
|
5
|
+
import ee from "../../../assets/line-icons/icons/chevron-right.js";
|
6
|
+
import { getTopicsFromItems as te } from "../../milestone/milestone-tests/tests-list/test-sheets-list/test-sheet-item/test-sheet-item-utils.js";
|
7
|
+
import h from "../../ui/layout/flex-view.js";
|
8
|
+
import m from "../../ui/text/text.js";
|
9
9
|
import oe from "../homework-card.js";
|
10
10
|
import { useGetHomeworks as re } from "./api/get-homeworks.js";
|
11
|
-
import { HoverZone as
|
11
|
+
import { HoverZone as k, ScrollButton as _, ScrollContainer as ne } from "./hw-card-list-styled.js";
|
12
12
|
const ie = ({
|
13
|
-
userType:
|
14
|
-
studentId:
|
15
|
-
stream:
|
13
|
+
userType: b = "STUDENT",
|
14
|
+
studentId: p,
|
15
|
+
stream: $,
|
16
16
|
onTestStart: w,
|
17
17
|
onNodeAttempt: x,
|
18
18
|
onTestPreview: R,
|
19
19
|
onNodeView: S,
|
20
|
-
onTestReview:
|
21
|
-
onNodeReview:
|
22
|
-
onNodeUnassign:
|
20
|
+
onTestReview: T,
|
21
|
+
onNodeReview: A,
|
22
|
+
onNodeUnassign: E
|
23
23
|
}) => {
|
24
|
-
const
|
25
|
-
|
26
|
-
}, []),
|
27
|
-
|
28
|
-
}, []),
|
29
|
-
$(!0);
|
30
|
-
}, []), G = r(() => {
|
31
|
-
$(!1);
|
32
|
-
}, []), K = r(() => {
|
24
|
+
const r = D(null), [I, g] = c(!1), [y, v] = c(!1), [B, M] = c(!1), [N, j] = c(!0), { get: L, data: e, isProcessingFailed: K } = re(), z = n(() => {
|
25
|
+
r.current && r.current.scrollBy({ left: -200, behavior: "smooth" });
|
26
|
+
}, []), G = n(() => {
|
27
|
+
r.current && r.current.scrollBy({ left: 200, behavior: "smooth" });
|
28
|
+
}, []), W = n(() => {
|
33
29
|
g(!0);
|
34
|
-
}, []),
|
30
|
+
}, []), F = n(() => {
|
35
31
|
g(!1);
|
36
|
-
}, []),
|
37
|
-
|
38
|
-
|
39
|
-
|
32
|
+
}, []), X = n(() => {
|
33
|
+
v(!0);
|
34
|
+
}, []), O = n(() => {
|
35
|
+
v(!1);
|
36
|
+
}, []), i = n(() => {
|
37
|
+
if (r.current) {
|
38
|
+
const { scrollLeft: o, scrollWidth: l, clientWidth: a } = r.current;
|
39
|
+
M(o > 10), j(o < l - a - 10);
|
40
40
|
}
|
41
41
|
}, []);
|
42
|
-
|
43
|
-
const
|
44
|
-
if (
|
45
|
-
return
|
46
|
-
|
42
|
+
u(() => {
|
43
|
+
const o = r.current;
|
44
|
+
if (o)
|
45
|
+
return o.addEventListener("scroll", i), i(), () => {
|
46
|
+
o.removeEventListener("scroll", i);
|
47
47
|
};
|
48
|
-
}, [i]),
|
48
|
+
}, [i]), u(() => {
|
49
49
|
i();
|
50
|
-
}, [
|
51
|
-
const
|
52
|
-
|
53
|
-
}, [
|
54
|
-
return
|
55
|
-
|
56
|
-
}, [
|
57
|
-
/* @__PURE__ */
|
50
|
+
}, [e, i]);
|
51
|
+
const C = n(() => {
|
52
|
+
L(p, void 0, { stream: $ });
|
53
|
+
}, [L, $, p]);
|
54
|
+
return u(() => {
|
55
|
+
C();
|
56
|
+
}, [C]), e && e.length === 0 ? /* @__PURE__ */ s(h, { $flexRowGapX: 1, children: [
|
57
|
+
/* @__PURE__ */ s(m, { $renderAs: "ac4-black", $color: "BLACK_T_60", children: [
|
58
58
|
"Homework (",
|
59
|
-
|
59
|
+
e == null ? void 0 : e.length,
|
60
60
|
")"
|
61
61
|
] }),
|
62
|
-
/* @__PURE__ */
|
63
|
-
|
64
|
-
|
62
|
+
/* @__PURE__ */ t(m, { $renderAs: "ab2", $color: "BLACK_T_60", children: "No Homework assigned yet" })
|
63
|
+
] }) : K ? null : /* @__PURE__ */ s(h, { $flexRowGapX: 1, children: [
|
64
|
+
/* @__PURE__ */ s(m, { $renderAs: "ac4-black", $color: "BLACK_T_60", children: [
|
65
|
+
"Homework (",
|
66
|
+
e == null ? void 0 : e.length,
|
67
|
+
")"
|
68
|
+
] }),
|
69
|
+
/* @__PURE__ */ s(h, { $position: "relative", onMouseEnter: i, children: [
|
70
|
+
B && /* @__PURE__ */ t(
|
71
|
+
k,
|
65
72
|
{
|
66
73
|
$position: "absolute",
|
67
74
|
$width: "60px",
|
68
75
|
left: "0",
|
69
76
|
right: "auto",
|
70
|
-
onMouseEnter:
|
71
|
-
onMouseLeave:
|
77
|
+
onMouseEnter: W,
|
78
|
+
onMouseLeave: F,
|
72
79
|
children: /* @__PURE__ */ t(
|
73
|
-
|
80
|
+
_,
|
74
81
|
{
|
75
82
|
$position: "absolute",
|
76
83
|
$background: "BLACK_T_60",
|
@@ -81,49 +88,49 @@ const ie = ({
|
|
81
88
|
$visible: I,
|
82
89
|
left: "0px",
|
83
90
|
right: "auto",
|
84
|
-
children: /* @__PURE__ */ t(
|
91
|
+
children: /* @__PURE__ */ t(J, { width: 24, height: 24 })
|
85
92
|
}
|
86
93
|
)
|
87
94
|
},
|
88
95
|
"left-hover-zone"
|
89
96
|
),
|
90
|
-
/* @__PURE__ */ t(ne, { ref:
|
97
|
+
/* @__PURE__ */ t(ne, { ref: r, children: /* @__PURE__ */ t(h, { $flexDirection: "row", $flexGapX: 1, children: e == null ? void 0 : e.map((o, l) => {
|
91
98
|
const {
|
92
|
-
items:
|
93
|
-
node_id:
|
94
|
-
sheet_time:
|
95
|
-
total_questions:
|
96
|
-
worksheet_id:
|
97
|
-
node_type:
|
98
|
-
} =
|
99
|
+
items: a,
|
100
|
+
node_id: P,
|
101
|
+
sheet_time: H,
|
102
|
+
total_questions: d,
|
103
|
+
worksheet_id: Q,
|
104
|
+
node_type: V
|
105
|
+
} = o, q = H && Math.ceil(H / 60) || 0, U = te(a).join(", "), Y = `${typeof d == "number" ? `${d} ${Z.pluralize(d, "Question")}, ` : ""}${q} Mins`, f = V === "DYNAMIC";
|
99
106
|
return /* @__PURE__ */ t(
|
100
107
|
oe,
|
101
108
|
{
|
102
|
-
userType:
|
103
|
-
header:
|
104
|
-
subHeader:
|
105
|
-
nodeData:
|
109
|
+
userType: b,
|
110
|
+
header: U,
|
111
|
+
subHeader: Y,
|
112
|
+
nodeData: o,
|
106
113
|
renderAs: "homework",
|
107
|
-
onNodeAttempt:
|
108
|
-
shouldOpenOnRight:
|
109
|
-
onNodeView:
|
110
|
-
onNodeReview:
|
111
|
-
onNodeUnassign:
|
114
|
+
onNodeAttempt: f ? w : x,
|
115
|
+
shouldOpenOnRight: e.length > 3 && l === e.length - 1,
|
116
|
+
onNodeView: f ? R : S,
|
117
|
+
onNodeReview: f ? T : A,
|
118
|
+
onNodeUnassign: E
|
112
119
|
},
|
113
|
-
`${
|
120
|
+
`${Q}_${P}_${l}`
|
114
121
|
);
|
115
122
|
}) }) }),
|
116
|
-
|
117
|
-
|
123
|
+
N && /* @__PURE__ */ t(
|
124
|
+
k,
|
118
125
|
{
|
119
126
|
$position: "absolute",
|
120
127
|
$width: "60px",
|
121
128
|
right: "0",
|
122
129
|
left: "auto",
|
123
|
-
onMouseEnter:
|
124
|
-
onMouseLeave:
|
130
|
+
onMouseEnter: X,
|
131
|
+
onMouseLeave: O,
|
125
132
|
children: /* @__PURE__ */ t(
|
126
|
-
|
133
|
+
_,
|
127
134
|
{
|
128
135
|
$position: "absolute",
|
129
136
|
$width: "60px",
|
@@ -131,11 +138,11 @@ const ie = ({
|
|
131
138
|
$background: "BLACK_T_60",
|
132
139
|
$justifyContent: "center",
|
133
140
|
$alignItems: "center",
|
134
|
-
onClick:
|
135
|
-
$visible:
|
141
|
+
onClick: G,
|
142
|
+
$visible: y,
|
136
143
|
left: "auto",
|
137
144
|
right: "0px",
|
138
|
-
children: /* @__PURE__ */ t(
|
145
|
+
children: /* @__PURE__ */ t(ee, { width: 24, height: 24 })
|
139
146
|
}
|
140
147
|
)
|
141
148
|
},
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"hw-card-list.js","sources":["../../../../src/features/homework/hw-card-list/hw-card-list.tsx"],"sourcesContent":["import type {\n INodeCardCallbacks,\n INodeDataProps,\n} from '../../chapters-v2/comps/node-card/node-card-types';\nimport type { TUserTypes } from '../../ui/types';\n\nimport { pluralize } from 'humanize-plus';\nimport React, { useCallback, useEffect, useRef, useState } from 'react';\n\nimport ChevronLeftIcon from '../../../assets/line-icons/icons/chevron-left';\nimport ChevronRightIcon from '../../../assets/line-icons/icons/chevron-right';\nimport { getTopicsFromItems } from '../../milestone/milestone-tests/tests-list/test-sheets-list/test-sheet-item/test-sheet-item-utils';\nimport FlexView from '../../ui/layout/flex-view';\nimport Text from '../../ui/text/text';\nimport HomeworkCard from '../homework-card';\nimport { useGetHomeworks } from './api/get-homeworks';\nimport * as Styled from './hw-card-list-styled';\n\ninterface HWCardListProps extends INodeCardCallbacks {\n userType: TUserTypes;\n studentId: string;\n stream: string;\n onTestPreview?: (sheetData: INodeDataProps, milestoneId?: string) => void;\n onTestStart?: (sheetData: INodeDataProps) => void;\n onTestReview?: (sheetData: INodeDataProps, milestoneId?: string) => void;\n}\n\nconst HWCardList: React.FC<HWCardListProps> = ({\n userType = 'STUDENT',\n studentId,\n stream,\n onTestStart,\n onNodeAttempt,\n onTestPreview,\n onNodeView,\n onTestReview,\n onNodeReview,\n onNodeUnassign,\n}) => {\n const scrollRef = useRef<HTMLDivElement>(null);\n const [isLeftHovered, setIsLeftHovered] = useState(false);\n const [isRightHovered, setIsRightHovered] = useState(false);\n const [canScrollLeft, setCanScrollLeft] = useState(false);\n const [canScrollRight, setCanScrollRight] = useState(true);\n const { get: getHomeworks, data: hwDetails, isProcessingFailed } = useGetHomeworks();\n\n const handleScrollLeft = useCallback(() => {\n if (scrollRef.current) {\n scrollRef.current.scrollBy({ left: -200, behavior: 'smooth' });\n }\n }, []);\n\n const handleScrollRight = useCallback(() => {\n if (scrollRef.current) {\n scrollRef.current.scrollBy({ left: 200, behavior: 'smooth' });\n }\n }, []);\n\n const handleLeftHoverEnter = useCallback(() => {\n setIsLeftHovered(true);\n }, []);\n\n const handleLeftHoverLeave = useCallback(() => {\n setIsLeftHovered(false);\n }, []);\n\n const handleRightHoverEnter = useCallback(() => {\n setIsRightHovered(true);\n }, []);\n\n const handleRightHoverLeave = useCallback(() => {\n setIsRightHovered(false);\n }, []);\n\n // Function to check scroll position and update button availability\n const checkScrollPosition = useCallback(() => {\n if (scrollRef.current) {\n const { scrollLeft, scrollWidth, clientWidth } = scrollRef.current;\n\n // Can scroll left if scrolled to the right\n setCanScrollLeft(scrollLeft > 10);\n\n // Can scroll right if not at the end\n setCanScrollRight(scrollLeft < scrollWidth - clientWidth - 10);\n }\n }, []);\n\n // Add scroll event listener to check scroll position\n useEffect(() => {\n const scrollElement = scrollRef.current;\n\n if (scrollElement) {\n scrollElement.addEventListener('scroll', checkScrollPosition);\n // Run once on mount to set initial button states\n checkScrollPosition();\n\n return () => {\n scrollElement.removeEventListener('scroll', checkScrollPosition);\n };\n }\n }, [checkScrollPosition]);\n\n // Also check when content changes\n useEffect(() => {\n checkScrollPosition();\n }, [hwDetails, checkScrollPosition]);\n\n const fetchChapterDetails = useCallback(() => {\n getHomeworks(studentId, undefined, { stream });\n }, [getHomeworks, stream, studentId]);\n\n useEffect(() => {\n fetchChapterDetails();\n }, [fetchChapterDetails]);\n\n if (isProcessingFailed) {\n return null;\n }\n\n return (\n <FlexView $flexRowGapX={1}>\n <Text $renderAs=\"ac4-black\" $color=\"BLACK_T_60\">\n Homework ({hwDetails?.length})\n </Text>\n <FlexView $position=\"relative\" onMouseEnter={checkScrollPosition}>\n {/* Left hover zone */}\n {canScrollLeft && (\n <Styled.HoverZone\n key=\"left-hover-zone\"\n $position=\"absolute\"\n $width=\"60px\"\n left=\"0\"\n right=\"auto\"\n onMouseEnter={handleLeftHoverEnter}\n onMouseLeave={handleLeftHoverLeave}\n >\n {/* Left scroll button - only visible when hovered */}\n <Styled.ScrollButton\n $position=\"absolute\"\n $background=\"BLACK_T_60\"\n $justifyContent=\"center\"\n $alignItems=\"center\"\n $height=\"100%\"\n onClick={handleScrollLeft}\n $visible={isLeftHovered}\n left=\"0px\"\n right=\"auto\"\n >\n <ChevronLeftIcon width={24} height={24} />\n </Styled.ScrollButton>\n </Styled.HoverZone>\n )}\n\n <Styled.ScrollContainer ref={scrollRef}>\n <FlexView $flexDirection=\"row\" $flexGapX={1}>\n {hwDetails?.map((sheet, idx) => {\n const {\n items,\n node_id: nodeId,\n sheet_time: sheetTime,\n total_questions: totalQuestions,\n worksheet_id: worksheetId,\n node_type: nodeType,\n } = sheet;\n const totalSheetTime = (sheetTime && Math.ceil(sheetTime / 60)) || 0;\n const topics = getTopicsFromItems(items);\n const testChapterName = topics.join(', ');\n const subHeader = `${\n typeof totalQuestions === 'number'\n ? `${totalQuestions} ${pluralize(totalQuestions, 'Question')}, `\n : ''\n }${totalSheetTime} Mins`;\n const isTestSheet = nodeType === 'DYNAMIC';\n\n return (\n <HomeworkCard\n key={`${worksheetId}_${nodeId}_${idx}`}\n userType={userType}\n header={testChapterName}\n subHeader={subHeader}\n nodeData={sheet}\n renderAs=\"homework\"\n onNodeAttempt={isTestSheet ? onTestStart : onNodeAttempt}\n shouldOpenOnRight={false}\n onNodeView={isTestSheet ? onTestPreview : onNodeView}\n onNodeReview={isTestSheet ? onTestReview : onNodeReview}\n onNodeUnassign={onNodeUnassign}\n />\n );\n })}\n </FlexView>\n </Styled.ScrollContainer>\n\n {/* Right hover zone */}\n {canScrollRight && (\n <Styled.HoverZone\n key=\"right-hover-zone\"\n $position=\"absolute\"\n $width=\"60px\"\n right=\"0\"\n left=\"auto\"\n onMouseEnter={handleRightHoverEnter}\n onMouseLeave={handleRightHoverLeave}\n >\n {/* Right scroll button - only visible when hovered */}\n <Styled.ScrollButton\n $position=\"absolute\"\n $width=\"60px\"\n $height=\"100%\"\n $background=\"BLACK_T_60\"\n $justifyContent=\"center\"\n $alignItems=\"center\"\n onClick={handleScrollRight}\n $visible={isRightHovered}\n left=\"auto\"\n right=\"0px\"\n >\n <ChevronRightIcon width={24} height={24} />\n </Styled.ScrollButton>\n </Styled.HoverZone>\n )}\n </FlexView>\n </FlexView>\n );\n};\n\nexport default HWCardList;\n"],"names":["HWCardList","userType","studentId","stream","onTestStart","onNodeAttempt","onTestPreview","onNodeView","onTestReview","onNodeReview","onNodeUnassign","scrollRef","useRef","isLeftHovered","setIsLeftHovered","useState","isRightHovered","setIsRightHovered","canScrollLeft","setCanScrollLeft","canScrollRight","setCanScrollRight","getHomeworks","hwDetails","isProcessingFailed","useGetHomeworks","handleScrollLeft","useCallback","handleScrollRight","handleLeftHoverEnter","handleLeftHoverLeave","handleRightHoverEnter","handleRightHoverLeave","checkScrollPosition","scrollLeft","scrollWidth","clientWidth","useEffect","scrollElement","fetchChapterDetails","jsxs","FlexView","Text","jsx","Styled.HoverZone","Styled.ScrollButton","ChevronLeftIcon","Styled.ScrollContainer","sheet","idx","items","nodeId","sheetTime","totalQuestions","worksheetId","nodeType","totalSheetTime","testChapterName","getTopicsFromItems","subHeader","pluralize","isTestSheet","HomeworkCard","ChevronRightIcon","HWCardList$1"],"mappings":";;;;;;;;;;;AA2BA,MAAMA,KAAwC,CAAC;AAAA,EAC7C,UAAAC,IAAW;AAAA,EACX,WAAAC;AAAA,EACA,QAAAC;AAAA,EACA,aAAAC;AAAA,EACA,eAAAC;AAAA,EACA,eAAAC;AAAA,EACA,YAAAC;AAAA,EACA,cAAAC;AAAA,EACA,cAAAC;AAAA,EACA,gBAAAC;AACF,MAAM;AACE,QAAAC,IAAYC,EAAuB,IAAI,GACvC,CAACC,GAAeC,CAAgB,IAAIC,EAAS,EAAK,GAClD,CAACC,GAAgBC,CAAiB,IAAIF,EAAS,EAAK,GACpD,CAACG,GAAeC,CAAgB,IAAIJ,EAAS,EAAK,GAClD,CAACK,GAAgBC,CAAiB,IAAIN,EAAS,EAAI,GACnD,EAAE,KAAKO,GAAc,MAAMC,GAAW,oBAAAC,EAAA,IAAuBC,MAE7DC,IAAmBC,EAAY,MAAM;AACzC,IAAIhB,EAAU,WACZA,EAAU,QAAQ,SAAS,EAAE,MAAM,MAAM,UAAU,UAAU;AAAA,EAEjE,GAAG,CAAE,CAAA,GAECiB,IAAoBD,EAAY,MAAM;AAC1C,IAAIhB,EAAU,WACZA,EAAU,QAAQ,SAAS,EAAE,MAAM,KAAK,UAAU,UAAU;AAAA,EAEhE,GAAG,CAAE,CAAA,GAECkB,IAAuBF,EAAY,MAAM;AAC7C,IAAAb,EAAiB,EAAI;AAAA,EACvB,GAAG,CAAE,CAAA,GAECgB,IAAuBH,EAAY,MAAM;AAC7C,IAAAb,EAAiB,EAAK;AAAA,EACxB,GAAG,CAAE,CAAA,GAECiB,IAAwBJ,EAAY,MAA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BC;AAAA,YAC1C,cAAcsD,IAAcrD,IAAeC;AAAA,YAC3C,gBAAAC;AAAA,UAAA;AAAA,UAVK,GAAG4C,CAAW,IAAIH,CAAM,IAAIF,CAAG;AAAA,QAAA;AAAA,MAWtC,IAGN,EACF,CAAA;AAAA,MAGC7B,KACC,gBAAAuB;AAAA,QAACC;AAAAA,QAAA;AAAA,UAEC,WAAU;AAAA,UACV,QAAO;AAAA,UACP,OAAM;AAAA,UACN,MAAK;AAAA,UACL,cAAcb;AAAA,UACd,cAAcC;AAAA,UAGd,UAAA,gBAAAW;AAAA,YAACE;AAAAA,YAAA;AAAA,cACC,WAAU;AAAA,cACV,QAAO;AAAA,cACP,SAAQ;AAAA,cACR,aAAY;AAAA,cACZ,iBAAgB;AAAA,cAChB,aAAY;AAAA,cACZ,SAASjB;AAAA,cACT,UAAUZ;AAAA,cACV,MAAK;AAAA,cACL,OAAM;AAAA,cAEN,UAAC,gBAAA2B,EAAAoB,GAAA,EAAiB,OAAO,IAAI,QAAQ,IAAI;AAAA,YAAA;AAAA,UAC3C;AAAA,QAAA;AAAA,QAtBI;AAAA,MAuBN;AAAA,IAAA,GAEJ;AAAA,EACF,EAAA,CAAA;AAEJ,GAEAC,KAAehE;"}
|
1
|
+
{"version":3,"file":"hw-card-list.js","sources":["../../../../src/features/homework/hw-card-list/hw-card-list.tsx"],"sourcesContent":["import type {\n INodeCardCallbacks,\n INodeDataProps,\n} from '../../chapters-v2/comps/node-card/node-card-types';\nimport type { TUserTypes } from '../../ui/types';\n\nimport { pluralize } from 'humanize-plus';\nimport React, { useCallback, useEffect, useRef, useState } from 'react';\n\nimport ChevronLeftIcon from '../../../assets/line-icons/icons/chevron-left';\nimport ChevronRightIcon from '../../../assets/line-icons/icons/chevron-right';\nimport { getTopicsFromItems } from '../../milestone/milestone-tests/tests-list/test-sheets-list/test-sheet-item/test-sheet-item-utils';\nimport FlexView from '../../ui/layout/flex-view';\nimport Text from '../../ui/text/text';\nimport HomeworkCard from '../homework-card';\nimport { useGetHomeworks } from './api/get-homeworks';\nimport * as Styled from './hw-card-list-styled';\n\ninterface HWCardListProps extends INodeCardCallbacks {\n userType: TUserTypes;\n studentId: string;\n stream: string;\n onTestPreview?: (sheetData: INodeDataProps, milestoneId?: string) => void;\n onTestStart?: (sheetData: INodeDataProps) => void;\n onTestReview?: (sheetData: INodeDataProps, milestoneId?: string) => void;\n}\n\nconst HWCardList: React.FC<HWCardListProps> = ({\n userType = 'STUDENT',\n studentId,\n stream,\n onTestStart,\n onNodeAttempt,\n onTestPreview,\n onNodeView,\n onTestReview,\n onNodeReview,\n onNodeUnassign,\n}) => {\n const scrollRef = useRef<HTMLDivElement>(null);\n const [isLeftHovered, setIsLeftHovered] = useState(false);\n const [isRightHovered, setIsRightHovered] = useState(false);\n const [canScrollLeft, setCanScrollLeft] = useState(false);\n const [canScrollRight, setCanScrollRight] = useState(true);\n const { get: getHomeworks, data: hwDetails, isProcessingFailed } = useGetHomeworks();\n\n const handleScrollLeft = useCallback(() => {\n if (scrollRef.current) {\n scrollRef.current.scrollBy({ left: -200, behavior: 'smooth' });\n }\n }, []);\n\n const handleScrollRight = useCallback(() => {\n if (scrollRef.current) {\n scrollRef.current.scrollBy({ left: 200, behavior: 'smooth' });\n }\n }, []);\n\n const handleLeftHoverEnter = useCallback(() => {\n setIsLeftHovered(true);\n }, []);\n\n const handleLeftHoverLeave = useCallback(() => {\n setIsLeftHovered(false);\n }, []);\n\n const handleRightHoverEnter = useCallback(() => {\n setIsRightHovered(true);\n }, []);\n\n const handleRightHoverLeave = useCallback(() => {\n setIsRightHovered(false);\n }, []);\n\n // Function to check scroll position and update button availability\n const checkScrollPosition = useCallback(() => {\n if (scrollRef.current) {\n const { scrollLeft, scrollWidth, clientWidth } = scrollRef.current;\n\n // Can scroll left if scrolled to the right\n setCanScrollLeft(scrollLeft > 10);\n\n // Can scroll right if not at the end\n setCanScrollRight(scrollLeft < scrollWidth - clientWidth - 10);\n }\n }, []);\n\n // Add scroll event listener to check scroll position\n useEffect(() => {\n const scrollElement = scrollRef.current;\n\n if (scrollElement) {\n scrollElement.addEventListener('scroll', checkScrollPosition);\n // Run once on mount to set initial button states\n checkScrollPosition();\n\n return () => {\n scrollElement.removeEventListener('scroll', checkScrollPosition);\n };\n }\n }, [checkScrollPosition]);\n\n // Also check when content changes\n useEffect(() => {\n checkScrollPosition();\n }, [hwDetails, checkScrollPosition]);\n\n const fetchChapterDetails = useCallback(() => {\n getHomeworks(studentId, undefined, { stream });\n }, [getHomeworks, stream, studentId]);\n\n useEffect(() => {\n fetchChapterDetails();\n }, [fetchChapterDetails]);\n\n if (hwDetails && hwDetails.length === 0) {\n return (\n <FlexView $flexRowGapX={1}>\n <Text $renderAs=\"ac4-black\" $color=\"BLACK_T_60\">\n Homework ({hwDetails?.length})\n </Text>\n <Text $renderAs=\"ab2\" $color=\"BLACK_T_60\">\n No Homework assigned yet\n </Text>\n </FlexView>\n );\n }\n\n if (isProcessingFailed) {\n return null;\n }\n\n return (\n <FlexView $flexRowGapX={1}>\n <Text $renderAs=\"ac4-black\" $color=\"BLACK_T_60\">\n Homework ({hwDetails?.length})\n </Text>\n <FlexView $position=\"relative\" onMouseEnter={checkScrollPosition}>\n {/* Left hover zone */}\n {canScrollLeft && (\n <Styled.HoverZone\n key=\"left-hover-zone\"\n $position=\"absolute\"\n $width=\"60px\"\n left=\"0\"\n right=\"auto\"\n onMouseEnter={handleLeftHoverEnter}\n onMouseLeave={handleLeftHoverLeave}\n >\n {/* Left scroll button - only visible when hovered */}\n <Styled.ScrollButton\n $position=\"absolute\"\n $background=\"BLACK_T_60\"\n $justifyContent=\"center\"\n $alignItems=\"center\"\n $height=\"100%\"\n onClick={handleScrollLeft}\n $visible={isLeftHovered}\n left=\"0px\"\n right=\"auto\"\n >\n <ChevronLeftIcon width={24} height={24} />\n </Styled.ScrollButton>\n </Styled.HoverZone>\n )}\n\n <Styled.ScrollContainer ref={scrollRef}>\n <FlexView $flexDirection=\"row\" $flexGapX={1}>\n {hwDetails?.map((sheet, idx) => {\n const {\n items,\n node_id: nodeId,\n sheet_time: sheetTime,\n total_questions: totalQuestions,\n worksheet_id: worksheetId,\n node_type: nodeType,\n } = sheet;\n const totalSheetTime = (sheetTime && Math.ceil(sheetTime / 60)) || 0;\n const topics = getTopicsFromItems(items);\n const testChapterName = topics.join(', ');\n const subHeader = `${\n typeof totalQuestions === 'number'\n ? `${totalQuestions} ${pluralize(totalQuestions, 'Question')}, `\n : ''\n }${totalSheetTime} Mins`;\n const isTestSheet = nodeType === 'DYNAMIC';\n\n return (\n <HomeworkCard\n key={`${worksheetId}_${nodeId}_${idx}`}\n userType={userType}\n header={testChapterName}\n subHeader={subHeader}\n nodeData={sheet}\n renderAs=\"homework\"\n onNodeAttempt={isTestSheet ? onTestStart : onNodeAttempt}\n shouldOpenOnRight={hwDetails.length > 3 && idx === hwDetails.length - 1}\n onNodeView={isTestSheet ? onTestPreview : onNodeView}\n onNodeReview={isTestSheet ? onTestReview : onNodeReview}\n onNodeUnassign={onNodeUnassign}\n />\n );\n })}\n </FlexView>\n </Styled.ScrollContainer>\n\n {/* Right hover zone */}\n {canScrollRight && (\n <Styled.HoverZone\n key=\"right-hover-zone\"\n $position=\"absolute\"\n $width=\"60px\"\n right=\"0\"\n left=\"auto\"\n onMouseEnter={handleRightHoverEnter}\n onMouseLeave={handleRightHoverLeave}\n >\n {/* Right scroll button - only visible when hovered */}\n <Styled.ScrollButton\n $position=\"absolute\"\n $width=\"60px\"\n $height=\"100%\"\n $background=\"BLACK_T_60\"\n $justifyContent=\"center\"\n $alignItems=\"center\"\n onClick={handleScrollRight}\n $visible={isRightHovered}\n left=\"auto\"\n right=\"0px\"\n >\n <ChevronRightIcon width={24} height={24} />\n </Styled.ScrollButton>\n </Styled.HoverZone>\n )}\n </FlexView>\n </FlexView>\n );\n};\n\nexport default HWCardList;\n"],"names":["HWCardList","userType","studentId","stream","onTestStart","onNodeAttempt","onTestPreview","onNodeView","onTestReview","onNodeReview","onNodeUnassign","scrollRef","useRef","isLeftHovered","setIsLeftHovered","useState","isRightHovered","setIsRightHovered","canScrollLeft","setCanScrollLeft","canScrollRight","setCanScrollRight","getHomeworks","hwDetails","isProcessingFailed","useGetHomeworks","handleScrollLeft","useCallback","handleScrollRight","handleLeftHoverEnter","handleLeftHoverLeave","handleRightHoverEnter","handleRightHoverLeave","checkScrollPosition","scrollLeft","scrollWidth","clientWidth","useEffect","scrollElement","fetchChapterDetails","jsxs","FlexView","Text","jsx","Styled.HoverZone","Styled.ScrollButton","ChevronLeftIcon","Styled.ScrollContainer","sheet","idx","items","nodeId","sheetTime","totalQuestions","worksheetId","nodeType","totalSheetTime","testChapterName","getTopicsFromItems","subHeader","pluralize","isTestSheet","HomeworkCard","ChevronRightIcon","HWCardList$1"],"mappings":";;;;;;;;;;;AA2BA,MAAMA,KAAwC,CAAC;AAAA,EAC7C,UAAAC,IAAW;AAAA,EACX,WAAAC;AAAA,EACA,QAAAC;AAAA,EACA,aAAAC;AAAA,EACA,eAAAC;AAAA,EACA,eAAAC;AAAA,EACA,YAAAC;AAAA,EACA,cAAAC;AAAA,EACA,cAAAC;AAAA,EACA,gBAAAC;AACF,MAAM;AACE,QAAAC,IAAYC,EAAuB,IAAI,GACvC,CAACC,GAAeC,CAAgB,IAAIC,EAAS,EAAK,GAClD,CAACC,GAAgBC,CAAiB,IAAIF,EAAS,EAAK,GACpD,CAACG,GAAeC,CAAgB,IAAIJ,EAAS,EAAK,GAClD,CAACK,GAAgBC,CAAiB,IAAIN,EAAS,EAAI,GACnD,EAAE,KAAKO,GAAc,MAAMC,GAAW,oBAAAC,EAAA,IAAuBC,MAE7DC,IAAmBC,EAAY,MAAM;AACzC,IAAIhB,EAAU,WACZA,EAAU,QAAQ,SAAS,EAAE,MAAM,MAAM,UAAU,UAAU;AAAA,EAEjE,GAAG,CAAE,CAAA,GAECiB,IAAoBD,EAAY,MAAM;AAC1C,IAAIhB,EAAU,WACZA,EAAU,QAAQ,SAAS,EAAE,MAAM,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,IAAI;AAAA,YAAA;AAAA,UAC3C;AAAA,QAAA;AAAA,QAtBI;AAAA,MAuBN;AAAA,IAAA,GAEJ;AAAA,EACF,EAAA,CAAA;AAEJ,GAEAC,KAAehE;"}
|
@@ -5,7 +5,7 @@ import V from "../../../../ui/arrow-tooltip/arrow-tooltip.js";
|
|
5
5
|
import v from "../../../../ui/image/image.js";
|
6
6
|
import r from "../../../../ui/layout/flex-view.js";
|
7
7
|
import U from "../../../../ui/separator/separator.js";
|
8
|
-
import
|
8
|
+
import a from "../../../../ui/text/text.js";
|
9
9
|
import Y from "./goals/goal-action-ctas.js";
|
10
10
|
import { GOAL_CATEGORY_BASED_IMAGES as q } from "./milestone-constants.js";
|
11
11
|
import { getRemainingDaysToCompleteGoal as z, getGoalCategoryBasedColorTheme as J, getMilestoneWidgetStatusInfo as Q } from "./milestone-utils.js";
|
@@ -32,7 +32,7 @@ const ue = X(
|
|
32
32
|
goal_category: l,
|
33
33
|
goal_code: g,
|
34
34
|
progress_stat: S
|
35
|
-
} = d, { completed: p = 0, total: k = 0 } = S || {}, h = i === "OUTCOME_PENDING",
|
35
|
+
} = d, { completed: p = 0, total: k = 0 } = S || {}, h = i === "OUTCOME_PENDING", s = p > 0 ? Math.floor((p / k || 1) * 100) : 0, o = j(null), [B, O] = H(!1), { textColor: N, borderColor: $ } = J(l), c = Q(i), R = (h ? c == null ? void 0 : c.progressBackgroundColor : $) || "WHITE_5", M = L(() => typeof g == "string", [g]), P = z(b);
|
36
36
|
return F(() => {
|
37
37
|
o.current && o.current.scrollHeight > o.current.clientHeight && O(!0);
|
38
38
|
}, [o]), l ? /* @__PURE__ */ t(
|
@@ -40,7 +40,7 @@ const ue = X(
|
|
40
40
|
{
|
41
41
|
$flexDirection: "row",
|
42
42
|
$justifyContent: "space-between",
|
43
|
-
$alignItems: "
|
43
|
+
$alignItems: "center",
|
44
44
|
$flexGapX: 1,
|
45
45
|
children: [
|
46
46
|
/* @__PURE__ */ t(r, { $flexDirection: "row", $flexGapX: 1.5, children: [
|
@@ -62,7 +62,7 @@ const ue = X(
|
|
62
62
|
{
|
63
63
|
$progressCircle: !0,
|
64
64
|
$progressBackground: "BLACK_1",
|
65
|
-
$progress:
|
65
|
+
$progress: s * 2,
|
66
66
|
r: "31",
|
67
67
|
cx: "32",
|
68
68
|
cy: "32"
|
@@ -78,14 +78,14 @@ const ue = X(
|
|
78
78
|
height: 40
|
79
79
|
}
|
80
80
|
) }),
|
81
|
-
|
81
|
+
s === 100 && /* @__PURE__ */ e(ee, { children: /* @__PURE__ */ e(K, { width: 20, height: 20 }) })
|
82
82
|
]
|
83
83
|
}
|
84
84
|
),
|
85
85
|
/* @__PURE__ */ t(r, { $flexGap: 16, children: [
|
86
86
|
/* @__PURE__ */ t(r, { $flexGap: 4, children: [
|
87
87
|
/* @__PURE__ */ t(r, { $flexDirection: "row", $alignItems: "center", $flexGap: 4, children: [
|
88
|
-
/* @__PURE__ */ e(
|
88
|
+
/* @__PURE__ */ e(a, { $renderAs: "ac4-black", $color: N, children: l.split("_").join(" ") }),
|
89
89
|
h && /* @__PURE__ */ e(
|
90
90
|
r,
|
91
91
|
{
|
@@ -94,7 +94,7 @@ const ue = X(
|
|
94
94
|
$gutter: 4,
|
95
95
|
$alignItems: "center",
|
96
96
|
$background: R,
|
97
|
-
children: /* @__PURE__ */ e(
|
97
|
+
children: /* @__PURE__ */ e(a, { $renderAs: "ac4", $color: "WHITE", children: "Outcome pending" })
|
98
98
|
}
|
99
99
|
),
|
100
100
|
i === "DRAFT" && /* @__PURE__ */ e(
|
@@ -105,7 +105,7 @@ const ue = X(
|
|
105
105
|
$gutter: 4,
|
106
106
|
$alignItems: "center",
|
107
107
|
$background: $,
|
108
|
-
children: /* @__PURE__ */ e(
|
108
|
+
children: /* @__PURE__ */ e(a, { $renderAs: "ac4", children: "Draft" })
|
109
109
|
}
|
110
110
|
)
|
111
111
|
] }),
|
@@ -126,8 +126,8 @@ const ue = X(
|
|
126
126
|
)
|
127
127
|
}
|
128
128
|
),
|
129
|
-
i !== "DRAFT" && /* @__PURE__ */ t(
|
130
|
-
|
129
|
+
i !== "DRAFT" && s > 0 && /* @__PURE__ */ t(a, { $renderAs: "ub3", $color: "BLACK_T_60", children: [
|
130
|
+
s,
|
131
131
|
"% complete",
|
132
132
|
P
|
133
133
|
] })
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"milestone-info.js","sources":["../../../../../../src/features/milestone/milestone-list-container/milestone-list/milestone-widget/milestone-info.tsx"],"sourcesContent":["import type { IMileStoneInfoWrapperProps } from './milestone-widget-types';\n\nimport React, { memo, useLayoutEffect, useMemo, useRef, useState } from 'react';\n\nimport Check2Icon from '../../../../../assets/line-icons/icons/check2';\nimport ArrowTooltip from '../../../../ui/arrow-tooltip/arrow-tooltip';\nimport Image from '../../../../ui/image/image';\nimport FlexView from '../../../../ui/layout/flex-view';\nimport Separator from '../../../../ui/separator/separator';\nimport Text from '../../../../ui/text/text';\nimport GoalActionCtas from './goals/goal-action-ctas';\nimport { GOAL_CATEGORY_BASED_IMAGES } from './milestone-constants';\nimport {\n getGoalCategoryBasedColorTheme,\n getMilestoneWidgetStatusInfo,\n getRemainingDaysToCompleteGoal,\n} from './milestone-utils';\nimport * as Styled from './milestone-widget-styled';\nimport OutcomeWrapper from './outcome/outcome';\n\nconst MilestoneInfoWrapper: React.FC<IMileStoneInfoWrapperProps> = memo(\n ({ isClassOngoing, isStudentPresent, isExpanded, ...restMilestoneInfoWrapperProps }) => {\n const {\n milestone,\n studentId,\n studentName,\n teacherName,\n parentName,\n userType,\n courseStream,\n outcomes,\n onEdit,\n onDraftPublish,\n onAddOutcome,\n } = restMilestoneInfoWrapperProps;\n\n const {\n milestone_name: milestoneName,\n milestone_date_ts: dueDate,\n milestone_state: milestoneState,\n goal_category: goalCategory,\n goal_code: goalCode,\n progress_stat: progressStat,\n } = milestone;\n\n const { completed = 0, total = 0 } = progressStat || {};\n const isOutcomePending = milestoneState === 'OUTCOME_PENDING';\n const progressCompletionPercentage =\n completed > 0 ? Math.floor((completed / total || 1) * 100) : 0;\n\n const titleTextRef = useRef<HTMLDivElement>(null);\n const [showTitleTooltip, setShowTitleTooltip] = useState(false);\n\n const { textColor: goalCategoryTextColor, borderColor } =\n getGoalCategoryBasedColorTheme(goalCategory);\n\n const outcomeStatusInfo = getMilestoneWidgetStatusInfo(milestoneState);\n const backgroundColor =\n (isOutcomePending ? outcomeStatusInfo?.progressBackgroundColor : borderColor) || 'WHITE_5';\n\n const isGoalCreation = useMemo(() => typeof goalCode === 'string', [goalCode]);\n const remainingDays = getRemainingDaysToCompleteGoal(dueDate);\n\n useLayoutEffect(() => {\n if (\n titleTextRef.current &&\n titleTextRef.current.scrollHeight > titleTextRef.current.clientHeight\n ) {\n setShowTitleTooltip(true);\n }\n }, [titleTextRef]);\n\n if (!goalCategory) return null;\n\n return (\n <FlexView\n $flexDirection=\"row\"\n $justifyContent=\"space-between\"\n $alignItems=\"flex-start\"\n $flexGapX={1}\n >\n <FlexView $flexDirection=\"row\" $flexGapX={1.5}>\n <FlexView\n $widthX={4}\n $heightX={4}\n $background=\"WHITE_T_38\"\n $position=\"relative\"\n $justifyContent=\"center\"\n $alignItems=\"center\"\n $borderRadiusX={2}\n >\n <Styled.ChapterProgressSVG width=\"64px\" height=\"64px\">\n <Styled.ChapterProgressSVGCircle $progress={0} r=\"31\" cx=\"32\" cy=\"32\" />\n <Styled.ChapterProgressSVGCircle\n $progressCircle\n $progressBackground=\"BLACK_1\"\n $progress={progressCompletionPercentage * 2}\n r=\"31\"\n cx=\"32\"\n cy=\"32\"\n />\n </Styled.ChapterProgressSVG>\n\n <FlexView $widthX={4} $heightX={4} $justifyContent=\"center\" $alignItems=\"center\">\n <Image\n src={GOAL_CATEGORY_BASED_IMAGES[goalCategory]}\n withLoader\n width={40}\n height={40}\n />\n </FlexView>\n\n {progressCompletionPercentage === 100 && (\n <Styled.StyledCheckIconWrapper>\n <Check2Icon width={20} height={20} />\n </Styled.StyledCheckIconWrapper>\n )}\n </FlexView>\n\n <FlexView $flexGap={16}>\n <FlexView $flexGap={4}>\n <FlexView $flexDirection=\"row\" $alignItems=\"center\" $flexGap={4}>\n <Text $renderAs=\"ac4-black\" $color={goalCategoryTextColor}>\n {goalCategory.split('_').join(' ')}\n </Text>\n\n {isOutcomePending && (\n <FlexView\n $flexDirection=\"row\"\n $gap={4}\n $gutter={4}\n $alignItems=\"center\"\n $background={backgroundColor}\n >\n <Text $renderAs=\"ac4\" $color=\"WHITE\">\n Outcome pending\n </Text>\n </FlexView>\n )}\n\n {milestoneState === 'DRAFT' && (\n <FlexView\n $flexDirection=\"row\"\n $gap={4}\n $gutter={4}\n $alignItems=\"center\"\n $background={borderColor}\n >\n <Text $renderAs=\"ac4\">Draft</Text>\n </FlexView>\n )}\n </FlexView>\n\n <ArrowTooltip\n renderAs=\"primary\"\n position=\"bottom\"\n tooltipItem={milestoneName}\n hidden={!showTitleTooltip}\n >\n <Styled.MilestoneTitle\n ref={titleTextRef}\n $renderAs={!isGoalCreation ? 'ah3' : 'ah4'}\n >\n {milestoneName}\n </Styled.MilestoneTitle>\n </ArrowTooltip>\n\n {milestoneState !== 'DRAFT' && (\n <Text $renderAs=\"ub3\" $color=\"BLACK_T_60\">\n {progressCompletionPercentage}% complete{remainingDays}\n </Text>\n )}\n </FlexView>\n\n {outcomes?.length ? (\n <>\n <Separator width={40} height={1} background=\"BLACK_T_15\" />\n <OutcomeWrapper outcomes={outcomes} />\n </>\n ) : undefined}\n </FlexView>\n </FlexView>\n\n {userType === 'TEACHER' && (\n <GoalActionCtas\n milestone={milestone}\n studentId={studentId}\n studentName={studentName}\n teacherName={teacherName ?? ''}\n parentName={parentName ?? ''}\n onAddOutcome={onAddOutcome}\n isClassOngoing={Boolean(isClassOngoing)}\n isStudentPresent={Boolean(isStudentPresent)}\n onDraftPublish={onDraftPublish}\n onEdit={onEdit}\n courseStream={courseStream}\n />\n )}\n </FlexView>\n );\n },\n);\n\nexport default MilestoneInfoWrapper;\n"],"names":["MilestoneInfoWrapper","memo","isClassOngoing","isStudentPresent","isExpanded","restMilestoneInfoWrapperProps","milestone","studentId","studentName","teacherName","parentName","userType","courseStream","outcomes","onEdit","onDraftPublish","onAddOutcome","milestoneName","dueDate","milestoneState","goalCategory","goalCode","progressStat","completed","total","isOutcomePending","progressCompletionPercentage","titleTextRef","useRef","showTitleTooltip","setShowTitleTooltip","useState","goalCategoryTextColor","borderColor","getGoalCategoryBasedColorTheme","outcomeStatusInfo","getMilestoneWidgetStatusInfo","backgroundColor","isGoalCreation","useMemo","remainingDays","getRemainingDaysToCompleteGoal","useLayoutEffect","jsxs","FlexView","Styled.ChapterProgressSVG","jsx","Styled.ChapterProgressSVGCircle","Image","GOAL_CATEGORY_BASED_IMAGES","Styled.StyledCheckIconWrapper","Check2Icon","Text","ArrowTooltip","Styled.MilestoneTitle","Fragment","Separator","OutcomeWrapper","GoalActionCtas"],"mappings":";;;;;;;;;;;;;AAoBA,MAAMA,KAA6DC;AAAA,EACjE,CAAC,EAAE,gBAAAC,GAAgB,kBAAAC,GAAkB,YAAAC,IAAY,GAAGC,QAAoC;AAChF,UAAA;AAAA,MACJ,WAAAC;AAAA,MACA,WAAAC;AAAA,MACA,aAAAC;AAAA,MACA,aAAAC;AAAA,MACA,YAAAC;AAAA,MACA,UAAAC;AAAA,MACA,cAAAC;AAAA,MACA,UAAAC;AAAA,MACA,QAAAC;AAAA,MACA,gBAAAC;AAAA,MACA,cAAAC;AAAA,IACE,IAAAX,GAEE;AAAA,MACJ,gBAAgBY;AAAA,MAChB,mBAAmBC;AAAA,MACnB,iBAAiBC;AAAA,MACjB,eAAeC;AAAA,MACf,WAAWC;AAAA,MACX,eAAeC;AAAA,IACb,IAAAhB,GAEE,EAAE,WAAAiB,IAAY,GAAG,OAAAC,IAAQ,EAAE,IAAIF,KAAgB,IAC/CG,IAAmBN,MAAmB,mBACtCO,IACJH,IAAY,IAAI,KAAK,OAAOA,IAAYC,KAAS,KAAK,GAAG,IAAI,G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../../src/features/milestone/milestone-list-container/milestone-list/milestone-widget/milestone-info.tsx"],"sourcesContent":["import type { IMileStoneInfoWrapperProps } from './milestone-widget-types';\n\nimport React, { memo, useLayoutEffect, useMemo, useRef, useState } from 'react';\n\nimport Check2Icon from '../../../../../assets/line-icons/icons/check2';\nimport ArrowTooltip from '../../../../ui/arrow-tooltip/arrow-tooltip';\nimport Image from '../../../../ui/image/image';\nimport FlexView from '../../../../ui/layout/flex-view';\nimport Separator from '../../../../ui/separator/separator';\nimport Text from '../../../../ui/text/text';\nimport GoalActionCtas from './goals/goal-action-ctas';\nimport { GOAL_CATEGORY_BASED_IMAGES } from './milestone-constants';\nimport {\n getGoalCategoryBasedColorTheme,\n getMilestoneWidgetStatusInfo,\n getRemainingDaysToCompleteGoal,\n} from './milestone-utils';\nimport * as Styled from './milestone-widget-styled';\nimport OutcomeWrapper from './outcome/outcome';\n\nconst MilestoneInfoWrapper: React.FC<IMileStoneInfoWrapperProps> = memo(\n ({ isClassOngoing, isStudentPresent, isExpanded, ...restMilestoneInfoWrapperProps }) => {\n const {\n milestone,\n studentId,\n studentName,\n teacherName,\n parentName,\n userType,\n courseStream,\n outcomes,\n onEdit,\n onDraftPublish,\n onAddOutcome,\n } = restMilestoneInfoWrapperProps;\n\n const {\n milestone_name: milestoneName,\n milestone_date_ts: dueDate,\n milestone_state: milestoneState,\n goal_category: goalCategory,\n goal_code: goalCode,\n progress_stat: progressStat,\n } = milestone;\n\n const { completed = 0, total = 0 } = progressStat || {};\n const isOutcomePending = milestoneState === 'OUTCOME_PENDING';\n const progressCompletionPercentage =\n completed > 0 ? Math.floor((completed / total || 1) * 100) : 0;\n\n const titleTextRef = useRef<HTMLDivElement>(null);\n const [showTitleTooltip, setShowTitleTooltip] = useState(false);\n\n const { textColor: goalCategoryTextColor, borderColor } =\n getGoalCategoryBasedColorTheme(goalCategory);\n\n const outcomeStatusInfo = getMilestoneWidgetStatusInfo(milestoneState);\n const backgroundColor =\n (isOutcomePending ? outcomeStatusInfo?.progressBackgroundColor : borderColor) || 'WHITE_5';\n\n const isGoalCreation = useMemo(() => typeof goalCode === 'string', [goalCode]);\n const remainingDays = getRemainingDaysToCompleteGoal(dueDate);\n\n useLayoutEffect(() => {\n if (\n titleTextRef.current &&\n titleTextRef.current.scrollHeight > titleTextRef.current.clientHeight\n ) {\n setShowTitleTooltip(true);\n }\n }, [titleTextRef]);\n\n if (!goalCategory) return null;\n\n return (\n <FlexView\n $flexDirection=\"row\"\n $justifyContent=\"space-between\"\n $alignItems=\"center\"\n $flexGapX={1}\n >\n <FlexView $flexDirection=\"row\" $flexGapX={1.5}>\n <FlexView\n $widthX={4}\n $heightX={4}\n $background=\"WHITE_T_38\"\n $position=\"relative\"\n $justifyContent=\"center\"\n $alignItems=\"center\"\n $borderRadiusX={2}\n >\n <Styled.ChapterProgressSVG width=\"64px\" height=\"64px\">\n <Styled.ChapterProgressSVGCircle $progress={0} r=\"31\" cx=\"32\" cy=\"32\" />\n <Styled.ChapterProgressSVGCircle\n $progressCircle\n $progressBackground=\"BLACK_1\"\n $progress={progressCompletionPercentage * 2}\n r=\"31\"\n cx=\"32\"\n cy=\"32\"\n />\n </Styled.ChapterProgressSVG>\n\n <FlexView $widthX={4} $heightX={4} $justifyContent=\"center\" $alignItems=\"center\">\n <Image\n src={GOAL_CATEGORY_BASED_IMAGES[goalCategory]}\n withLoader\n width={40}\n height={40}\n />\n </FlexView>\n\n {progressCompletionPercentage === 100 && (\n <Styled.StyledCheckIconWrapper>\n <Check2Icon width={20} height={20} />\n </Styled.StyledCheckIconWrapper>\n )}\n </FlexView>\n\n <FlexView $flexGap={16}>\n <FlexView $flexGap={4}>\n <FlexView $flexDirection=\"row\" $alignItems=\"center\" $flexGap={4}>\n <Text $renderAs=\"ac4-black\" $color={goalCategoryTextColor}>\n {goalCategory.split('_').join(' ')}\n </Text>\n\n {isOutcomePending && (\n <FlexView\n $flexDirection=\"row\"\n $gap={4}\n $gutter={4}\n $alignItems=\"center\"\n $background={backgroundColor}\n >\n <Text $renderAs=\"ac4\" $color=\"WHITE\">\n Outcome pending\n </Text>\n </FlexView>\n )}\n\n {milestoneState === 'DRAFT' && (\n <FlexView\n $flexDirection=\"row\"\n $gap={4}\n $gutter={4}\n $alignItems=\"center\"\n $background={borderColor}\n >\n <Text $renderAs=\"ac4\">Draft</Text>\n </FlexView>\n )}\n </FlexView>\n\n <ArrowTooltip\n renderAs=\"primary\"\n position=\"bottom\"\n tooltipItem={milestoneName}\n hidden={!showTitleTooltip}\n >\n <Styled.MilestoneTitle\n ref={titleTextRef}\n $renderAs={!isGoalCreation ? 'ah3' : 'ah4'}\n >\n {milestoneName}\n </Styled.MilestoneTitle>\n </ArrowTooltip>\n\n {milestoneState !== 'DRAFT' && progressCompletionPercentage > 0 && (\n <Text $renderAs=\"ub3\" $color=\"BLACK_T_60\">\n {progressCompletionPercentage}% complete{remainingDays}\n </Text>\n )}\n </FlexView>\n\n {outcomes?.length ? (\n <>\n <Separator width={40} height={1} background=\"BLACK_T_15\" />\n <OutcomeWrapper outcomes={outcomes} />\n </>\n ) : undefined}\n </FlexView>\n </FlexView>\n\n {userType === 'TEACHER' && (\n <GoalActionCtas\n milestone={milestone}\n studentId={studentId}\n studentName={studentName}\n teacherName={teacherName ?? ''}\n parentName={parentName ?? ''}\n onAddOutcome={onAddOutcome}\n isClassOngoing={Boolean(isClassOngoing)}\n isStudentPresent={Boolean(isStudentPresent)}\n onDraftPublish={onDraftPublish}\n onEdit={onEdit}\n courseStream={courseStream}\n />\n )}\n </FlexView>\n );\n },\n);\n\nexport default MilestoneInfoWrapper;\n"],"names":["MilestoneInfoWrapper","memo","isClassOngoing","isStudentPresent","isExpanded","restMilestoneInfoWrapperProps","milestone","studentId","studentName","teacherName","parentName","userType","courseStream","outcomes","onEdit","onDraftPublish","onAddOutcome","milestoneName","dueDate","milestoneState","goalCategory","goalCode","progressStat","completed","total","isOutcomePending","progressCompletionPercentage","titleTextRef","useRef","showTitleTooltip","setShowTitleTooltip","useState","goalCategoryTextColor","borderColor","getGoalCategoryBasedColorTheme","outcomeStatusInfo","getMilestoneWidgetStatusInfo","backgroundColor","isGoalCreation","useMemo","remainingDays","getRemainingDaysToCompleteGoal","useLayoutEffect","jsxs","FlexView","Styled.ChapterProgressSVG","jsx","Styled.ChapterProgressSVGCircle","Image","GOAL_CATEGORY_BASED_IMAGES","Styled.StyledCheckIconWrapper","Check2Icon","Text","ArrowTooltip","Styled.MilestoneTitle","Fragment","Separator","OutcomeWrapper","GoalActionCtas"],"mappings":";;;;;;;;;;;;;AAoBA,MAAMA,KAA6DC;AAAA,EACjE,CAAC,EAAE,gBAAAC,GAAgB,kBAAAC,GAAkB,YAAAC,IAAY,GAAGC,QAAoC;AAChF,UAAA;AAAA,MACJ,WAAAC;AAAA,MACA,WAAAC;AAAA,MACA,aAAAC;AAAA,MACA,aAAAC;AAAA,MACA,YAAAC;AAAA,MACA,UAAAC;AAAA,MACA,cAAAC;AAAA,MACA,UAAAC;AAAA,MACA,QAAAC;AAAA,MACA,gBAAAC;AAAA,MACA,cAAAC;AAAA,IACE,IAAAX,GAEE;AAAA,MACJ,gBAAgBY;AAAA,MAChB,mBAAmBC;AAAA,MACnB,iBAAiBC;AAAA,MACjB,eAAeC;AAAA,MACf,WAAWC;AAAA,MACX,eAAeC;AAAA,IACb,IAAAhB,GAEE,EAAE,WAAAiB,IAAY,GAAG,OAAAC,IAAQ,EAAE,IAAIF,KAAgB,IAC/CG,IAAmBN,MAAmB,mBACtCO,IACJH,IAAY,IAAI,KAAK,OAAOA,IAAYC,KAAS,KAAK,GAAG,IAAI,GAEzDG,IAAeC,EAAuB,IAAI,GAC1C,CAACC,GAAkBC,CAAmB,IAAIC,EAAS,EAAK,GAExD,EAAE,WAAWC,GAAuB,aAAAC,EAAY,IACpDC,EAA+Bd,CAAY,GAEvCe,IAAoBC,EAA6BjB,CAAc,GAC/DkB,KACHZ,IAAmBU,KAAA,gBAAAA,EAAmB,0BAA0BF,MAAgB,WAE7EK,IA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AAAAA,sBAAA;AAAA,wBACC,KAAK3B;AAAA,wBACL,WAAYW,IAAyB,QAAR;AAAA,wBAE5B,UAAArB;AAAA,sBAAA;AAAA,oBACH;AAAA,kBAAA;AAAA,gBACF;AAAA,gBAECE,MAAmB,WAAWO,IAA+B,uBAC3D0B,GAAK,EAAA,WAAU,OAAM,QAAO,cAC1B,UAAA;AAAA,kBAAA1B;AAAA,kBAA6B;AAAA,kBAAWc;AAAA,gBAAA,GAC3C;AAAA,cAAA,GAEJ;AAAA,cAEC3B,KAAA,QAAAA,EAAU,SAEP,gBAAA8B,EAAAY,GAAA,EAAA,UAAA;AAAA,gBAAA,gBAAAT,EAACU,KAAU,OAAO,IAAI,QAAQ,GAAG,YAAW,cAAa;AAAA,gBACzD,gBAAAV,EAACW,MAAe,UAAA5C,GAAoB;AAAA,cAAA,EACtC,CAAA,IACE;AAAA,YAAA,GACN;AAAA,UAAA,GACF;AAAA,UAECF,MAAa,aACZ,gBAAAmC;AAAA,YAACY;AAAA,YAAA;AAAA,cACC,WAAApD;AAAA,cACA,WAAAC;AAAA,cACA,aAAAC;AAAA,cACA,aAAaC,KAAe;AAAA,cAC5B,YAAYC,KAAc;AAAA,cAC1B,cAAAM;AAAA,cACA,gBAAgB,EAAQd;AAAA,cACxB,kBAAkB,EAAQC;AAAA,cAC1B,gBAAAY;AAAA,cACA,QAAAD;AAAA,cACA,cAAAF;AAAA,YAAA;AAAA,UACF;AAAA,QAAA;AAAA,MAAA;AAAA,IAAA,IA5HoB;AAAA,EAgI5B;AACF;"}
|
package/dist/index.d.ts
CHANGED
@@ -352,6 +352,7 @@ declare interface ErrorProps {
|
|
352
352
|
}
|
353
353
|
|
354
354
|
export declare const EVENTS: {
|
355
|
+
HOMEWORK_UNASSIGN: "HOMEWORK_UNASSIGN";
|
355
356
|
GOAL_CREATED: "GOAL_CREATED";
|
356
357
|
GOAL_EDITED: "GOAL_EDITED";
|
357
358
|
GOAL_DELETED: "GOAL_DELETED";
|
@@ -1318,6 +1319,11 @@ declare interface IGradeSelectorProps {
|
|
1318
1319
|
layoutAlignment?: 'center' | 'auto';
|
1319
1320
|
}
|
1320
1321
|
|
1322
|
+
export declare interface IHomeworkData extends INodeDataProps {
|
1323
|
+
homework_id: string;
|
1324
|
+
chapter_name: string;
|
1325
|
+
}
|
1326
|
+
|
1321
1327
|
declare interface IIconButtonProps extends Omit<IButtonProps, 'label' | 'shape' | 'widthX' | 'width' | 'iconPosition' | 'alignSelf' | 'analyticsLabel' | 'renderAs'>, Required<Pick<IClickableAnalyticsProps, 'analyticsLabel'>> {
|
1322
1328
|
Icon: React.FC<React.SVGProps<SVGSVGElement>>;
|
1323
1329
|
customBgColor?: TColorNames;
|
@@ -4492,6 +4498,11 @@ export declare type TInclassMessage = {
|
|
4492
4498
|
eventPayload: {
|
4493
4499
|
worksheetId: string;
|
4494
4500
|
};
|
4501
|
+
} | {
|
4502
|
+
eventName: typeof EVENTS.HOMEWORK_UNASSIGN;
|
4503
|
+
eventPayload: {
|
4504
|
+
homeworkId: string;
|
4505
|
+
};
|
4495
4506
|
} | {
|
4496
4507
|
eventName: typeof EVENTS.CHAPTER_UPDATED;
|
4497
4508
|
eventPayload: {
|