@cuemath/leap 2.9.4-as10 → 2.9.4-as13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/features/chapters-v2/chapter-details/block-sections/block-sections.js +76 -60
- package/dist/features/chapters-v2/chapter-details/block-sections/block-sections.js.map +1 -1
- package/dist/features/chapters-v2/chapter-details/chapter-details-styled.js +2 -3
- package/dist/features/chapters-v2/chapter-details/chapter-details-styled.js.map +1 -1
- package/dist/features/chapters-v2/comps/node-card/node-card-tags.js +11 -11
- package/dist/features/chapters-v2/comps/node-card/node-card-tags.js.map +1 -1
- package/dist/features/chapters-v2/comps/node-card/node-card.js +6 -6
- package/dist/features/chapters-v2/comps/node-card/node-card.js.map +1 -1
- package/dist/features/chapters-v2/comps/node-card/student-actions/student-actions.js +66 -57
- package/dist/features/chapters-v2/comps/node-card/student-actions/student-actions.js.map +1 -1
- package/dist/features/chapters-v2/utils/node-card-utils.js +77 -46
- package/dist/features/chapters-v2/utils/node-card-utils.js.map +1 -1
- package/dist/features/homework/homework-card-view.js +40 -30
- package/dist/features/homework/homework-card-view.js.map +1 -1
- package/dist/features/homework/homework-card.js +32 -31
- package/dist/features/homework/homework-card.js.map +1 -1
- package/dist/features/homework/hw-card-list/hw-card-list-styled.js +15 -23
- package/dist/features/homework/hw-card-list/hw-card-list-styled.js.map +1 -1
- package/dist/features/homework/hw-card-list/hw-card-list.js +134 -154
- package/dist/features/homework/hw-card-list/hw-card-list.js.map +1 -1
- package/dist/features/milestone/milestone-list-container/milestone-list/milestone-list.js +1 -1
- package/dist/features/milestone/milestone-list-container/milestone-list/milestone-list.js.map +1 -1
- package/dist/features/milestone/milestone-list-container/milestone-list-container.js +14 -14
- package/dist/features/milestone/milestone-list-container/milestone-list-container.js.map +1 -1
- package/dist/features/milestone/milestone-resources/resources-assign/api/goal-resource-assign.js +1 -1
- package/dist/features/milestone/milestone-resources/resources-assign/api/goal-resource-assign.js.map +1 -1
- package/dist/features/milestone/milestone-tests/tests-creation/api/test-sheet-assign.js.map +1 -1
- package/dist/features/milestone/milestone-tests/tests-creation/tests-creation.js +39 -38
- package/dist/features/milestone/milestone-tests/tests-creation/tests-creation.js.map +1 -1
- package/package.json +1 -1
@@ -1,73 +1,89 @@
|
|
1
|
-
import { jsxs as
|
2
|
-
import { memo as
|
3
|
-
import
|
4
|
-
import
|
5
|
-
|
1
|
+
import { jsxs as b, jsx as g } from "react/jsx-runtime";
|
2
|
+
import { memo as B } from "react";
|
3
|
+
import I from "styled-components";
|
4
|
+
import w from "../../../ui/layout/flex-view.js";
|
5
|
+
import S from "./block-section-view.js";
|
6
|
+
const E = I(w)`
|
7
|
+
min-height: calc(
|
8
|
+
100vh - 168px - 56px + 64px
|
9
|
+
); // 168 chapter banner, 56 header height , 64 bottom padding
|
10
|
+
|
11
|
+
&:last-child {
|
12
|
+
padding-bottom: 64px;
|
13
|
+
}
|
14
|
+
`, O = B((_) => {
|
6
15
|
const {
|
7
|
-
blocks:
|
8
|
-
imageHue:
|
16
|
+
blocks: n,
|
17
|
+
imageHue: e,
|
9
18
|
userType: i,
|
10
19
|
onNodeAttempt: s,
|
11
20
|
onNodeAttemptLocationChange: c,
|
12
|
-
onNodeMarkAsDone:
|
21
|
+
onNodeMarkAsDone: p,
|
13
22
|
onNodeReattempt: r,
|
14
|
-
onNodeReview:
|
15
|
-
onNodeView:
|
23
|
+
onNodeReview: l,
|
24
|
+
onNodeView: d,
|
16
25
|
onBlockSkipUnskip: m
|
17
|
-
} =
|
18
|
-
let
|
19
|
-
const
|
26
|
+
} = _;
|
27
|
+
let a = 0;
|
28
|
+
const k = n.filter(
|
20
29
|
(o) => o.section_code === "GOALS" || o.section_code === "READINESS"
|
21
|
-
),
|
30
|
+
), h = n.filter(
|
22
31
|
(o) => o.section_code !== "GOALS" && o.section_code !== "READINESS"
|
23
32
|
);
|
24
|
-
return /* @__PURE__ */
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
33
|
+
return /* @__PURE__ */ b(
|
34
|
+
E,
|
35
|
+
{
|
36
|
+
$width: "100%",
|
37
|
+
$background: h.length ? "WHITE_1" : `${e}_1`,
|
38
|
+
children: [
|
39
|
+
k.map((o, t) => {
|
40
|
+
const { block_type: u, block_id: x, is_skipped: A } = o;
|
41
|
+
let f = 0;
|
42
|
+
const N = t === k.length - 1;
|
43
|
+
return u === "GOAL" && (A || (a += 1), f = a), /* @__PURE__ */ g(
|
44
|
+
S,
|
45
|
+
{
|
46
|
+
blockData: o,
|
47
|
+
userType: i,
|
48
|
+
isLastBlock: N,
|
49
|
+
lessonIdx: f,
|
50
|
+
imageHue: e,
|
51
|
+
isGoalBlock: !0,
|
52
|
+
onNodeAttempt: s,
|
53
|
+
onNodeAttemptLocationChange: c,
|
54
|
+
onNodeMarkAsDone: p,
|
55
|
+
onNodeReattempt: r,
|
56
|
+
onNodeReview: l,
|
57
|
+
onNodeView: d,
|
58
|
+
onBlockSkipUnskip: m
|
59
|
+
},
|
60
|
+
x
|
61
|
+
);
|
62
|
+
}),
|
63
|
+
h.map((o) => {
|
64
|
+
const { block_id: t } = o;
|
65
|
+
return /* @__PURE__ */ g(
|
66
|
+
S,
|
67
|
+
{
|
68
|
+
blockData: o,
|
69
|
+
userType: i,
|
70
|
+
imageHue: e,
|
71
|
+
onNodeAttempt: s,
|
72
|
+
onNodeAttemptLocationChange: c,
|
73
|
+
onNodeMarkAsDone: p,
|
74
|
+
onNodeReattempt: r,
|
75
|
+
onNodeReview: l,
|
76
|
+
onNodeView: d,
|
77
|
+
onBlockSkipUnskip: m
|
78
|
+
},
|
79
|
+
t
|
80
|
+
);
|
81
|
+
})
|
82
|
+
]
|
83
|
+
}
|
84
|
+
);
|
69
85
|
});
|
70
86
|
export {
|
71
|
-
|
87
|
+
O as default
|
72
88
|
};
|
73
89
|
//# 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(\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 <
|
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';\nimport styled from 'styled-components';\n\nimport FlexView from '../../../ui/layout/flex-view';\nimport BlockSectionView from './block-section-view';\n\nconst ChapterDetailsWrapper = styled(FlexView)`\n min-height: calc(\n 100vh - 168px - 56px + 64px\n ); // 168 chapter banner, 56 header height , 64 bottom padding\n\n &:last-child {\n padding-bottom: 64px;\n }\n`;\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 <ChapterDetailsWrapper\n $width=\"100%\"\n $background={!nonGoalBlocks.length ? `${imageHue}_1` : 'WHITE_1'}\n >\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 </ChapterDetailsWrapper>\n );\n});\n\nexport default BlockSections;\n"],"names":["ChapterDetailsWrapper","styled","FlexView","BlockSections","memo","props","blocks","imageHue","userType","onNodeAttempt","onNodeAttemptLocationChange","onNodeMarkAsDone","onNodeReattempt","onNodeReview","onNodeView","onBlockSkipUnskip","lessonCount","goalBlocks","block","nonGoalBlocks","jsxs","blockData","idx","blockType","blockId","isSkipped","lessonIdx","isLastBlock","jsx","BlockSectionView"],"mappings":";;;;;AASA,MAAMA,IAAwBC,EAAOC,CAAQ;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,GAUvCC,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;AAAA,IAACpB;AAAA,IAAA;AAAA,MACC,QAAO;AAAA,MACP,aAAcmB,EAAc,SAA2B,YAAlB,GAAGZ,CAAQ;AAAA,MAE/C,UAAA;AAAA,QAAWU,EAAA,IAAI,CAACI,GAAWC,MAAQ;AAClC,gBAAM,EAAE,YAAYC,GAAW,UAAUC,GAAS,YAAYC,EAAc,IAAAJ;AAC5E,cAAIK,IAAY;AAEV,gBAAAC,IAAcL,MAAQL,EAAW,SAAS;AAEhD,iBAAIM,MAAc,WACXE,MACYT,KAAA,IAGLU,IAAAV,IAIZ,gBAAAY;AAAA,YAACC;AAAA,YAAA;AAAA,cACC,WAAAR;AAAA,cACA,UAAAb;AAAA,cACA,aAAAmB;AAAA,cAEA,WAAAD;AAAA,cACA,UAAAnB;AAAA,cACA,aAAW;AAAA,cACX,eAAAE;AAAA,cACA,6BAAAC;AAAA,cACA,kBAAAC;AAAA,cACA,iBAAAC;AAAA,cACA,cAAAC;AAAA,cACA,YAAAC;AAAA,cACA,mBAAAC;AAAA,YAAA;AAAA,YAVKS;AAAA,UAAA;AAAA,QAWP,CAEH;AAAA,QAEAL,EAAc,IAAI,CAAaE,MAAA;AACxB,gBAAA,EAAE,UAAUG,EAAY,IAAAH;AAG5B,iBAAA,gBAAAO;AAAA,YAACC;AAAA,YAAA;AAAA,cAEC,WAAAR;AAAA,cACA,UAAAb;AAAA,cACA,UAAAD;AAAA,cACA,eAAAE;AAAA,cACA,6BAAAC;AAAA,cACA,kBAAAC;AAAA,cACA,iBAAAC;AAAA,cACA,cAAAC;AAAA,cACA,YAAAC;AAAA,cACA,mBAAAC;AAAA,YAAA;AAAA,YAVKS;AAAA,UAAA;AAAA,QAWP,CAEH;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAGP,CAAC;"}
|
@@ -30,14 +30,13 @@ const a = o.div(({ theme: t }) => `
|
|
30
30
|
pointer-events: ${t ? "none" : "auto"};
|
31
31
|
border: 1px solid ${e.colors.WHITE_5};
|
32
32
|
border-top: none;
|
33
|
-
padding-bottom: ${e.layout.gutter * 4}px;
|
34
33
|
`
|
35
34
|
), s = o(r)`
|
36
35
|
position: absolute;
|
37
36
|
top: 0;
|
38
37
|
left: 0;
|
39
38
|
z-index: 6;
|
40
|
-
`,
|
39
|
+
`, l = o(r)(({ theme: t }) => `
|
41
40
|
position: sticky;
|
42
41
|
top: ${t.layout.gutter}px;
|
43
42
|
transform: translateX(${t.layout.gutter}px);
|
@@ -45,7 +44,7 @@ const a = o.div(({ theme: t }) => `
|
|
45
44
|
`);
|
46
45
|
export {
|
47
46
|
s as BackButtonContainer,
|
48
|
-
|
47
|
+
l as BackButtonWrapper,
|
49
48
|
p as ContentWrapper,
|
50
49
|
a as LoaderWrapper
|
51
50
|
};
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"chapter-details-styled.js","sources":["../../../../src/features/chapters-v2/chapter-details/chapter-details-styled.tsx"],"sourcesContent":["import styled from 'styled-components';\n\nimport FlexView from '../../ui/layout/flex-view';\n\nconst LoaderWrapper = styled.div(({ theme }) => {\n return `\n height: 100%;\n position: absolute;\n left: 0;\n right: 0;\n top: 0;\n bottom: 0;\n background: rgba(204, 204, 204, 0.25);\n z-index: 2;\n\n & * {\n pointer-events: none;\n }\n\n & img {\n top: 50%;\n position: absolute;\n left: 50%;\n transform: translate(-50%, -50%);\n width: ${theme.layout.gutter * 5}px;\n height: ${theme.layout.gutter * 5}px;\n filter: brightness(0);\n }\n `;\n});\n\nconst ContentWrapper = styled(FlexView)<{ $disablePointerEvents: boolean }>(\n ({ $disablePointerEvents, theme }) => `\n position: relative;\n margin: 0 auto;\n pointer-events: ${$disablePointerEvents ? 'none' : 'auto'};\n border: 1px solid ${theme.colors.WHITE_5};\n border-top: none;\n
|
1
|
+
{"version":3,"file":"chapter-details-styled.js","sources":["../../../../src/features/chapters-v2/chapter-details/chapter-details-styled.tsx"],"sourcesContent":["import styled from 'styled-components';\n\nimport FlexView from '../../ui/layout/flex-view';\n\nconst LoaderWrapper = styled.div(({ theme }) => {\n return `\n height: 100%;\n position: absolute;\n left: 0;\n right: 0;\n top: 0;\n bottom: 0;\n background: rgba(204, 204, 204, 0.25);\n z-index: 2;\n\n & * {\n pointer-events: none;\n }\n\n & img {\n top: 50%;\n position: absolute;\n left: 50%;\n transform: translate(-50%, -50%);\n width: ${theme.layout.gutter * 5}px;\n height: ${theme.layout.gutter * 5}px;\n filter: brightness(0);\n }\n `;\n});\n\nconst ContentWrapper = styled(FlexView)<{ $disablePointerEvents: boolean }>(\n ({ $disablePointerEvents, theme }) => `\n position: relative;\n margin: 0 auto;\n pointer-events: ${$disablePointerEvents ? 'none' : 'auto'};\n border: 1px solid ${theme.colors.WHITE_5};\n border-top: none;\n `,\n);\n\nconst BackButtonContainer = styled(FlexView)`\n position: absolute;\n top: 0;\n left: 0;\n z-index: 6;\n`;\n\nconst BackButtonWrapper = styled(FlexView)(({ theme }) => {\n return `\n position: sticky;\n top: ${theme.layout.gutter}px;\n transform: translateX(${theme.layout.gutter}px);\n z-index: 6;\n `;\n});\n\nexport { ContentWrapper, LoaderWrapper, BackButtonContainer, BackButtonWrapper };\n"],"names":["LoaderWrapper","styled","theme","ContentWrapper","FlexView","$disablePointerEvents","BackButtonContainer","BackButtonWrapper"],"mappings":";;AAIA,MAAMA,IAAgBC,EAAO,IAAI,CAAC,EAAE,OAAAC,QAC3B;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,eAmBMA,EAAM,OAAO,SAAS,CAAC;AAAA,gBACtBA,EAAM,OAAO,SAAS,CAAC;AAAA;AAAA;AAAA,GAItC,GAEKC,IAAiBF,EAAOG,CAAQ;AAAA,EACpC,CAAC,EAAE,uBAAAC,GAAuB,OAAAH,EAAA,MAAY;AAAA;AAAA;AAAA,wBAGhBG,IAAwB,SAAS,MAAM;AAAA,0BACrCH,EAAM,OAAO,OAAO;AAAA;AAAA;AAG9C,GAEMI,IAAsBL,EAAOG,CAAQ;AAAA;AAAA;AAAA;AAAA;AAAA,GAOrCG,IAAoBN,EAAOG,CAAQ,EAAE,CAAC,EAAE,OAAAF,QACrC;AAAA;AAAA,WAEEA,EAAM,OAAO,MAAM;AAAA,4BACFA,EAAM,OAAO,MAAM;AAAA;AAAA,GAG9C;"}
|
@@ -1,16 +1,16 @@
|
|
1
|
-
import { jsx as
|
2
|
-
import { memo as
|
1
|
+
import { jsx as m } from "react/jsx-runtime";
|
2
|
+
import { memo as S } from "react";
|
3
3
|
import { getNodeStateBasedTagInfo as p } from "../../utils/node-card-utils.js";
|
4
|
-
import { SheetTagWrapper as
|
5
|
-
const
|
6
|
-
const { state: e, accuracy: a, nodeType: o, dueDateTs: r } = t,
|
7
|
-
icon:
|
8
|
-
top:
|
9
|
-
right:
|
10
|
-
} = p(e, c, r);
|
11
|
-
return /* @__PURE__ */
|
4
|
+
import { SheetTagWrapper as T } from "./node-card-styled.js";
|
5
|
+
const E = S((t) => {
|
6
|
+
const { state: e, accuracy: a, nodeType: o, dueDateTs: r, isStudent: c } = t, i = o === "DYNAMIC" || o === "ASSESSMENT" || o === "CHAPTER_ASSESSMENT" ? a : void 0, {
|
7
|
+
icon: n,
|
8
|
+
top: s,
|
9
|
+
right: d
|
10
|
+
} = p(e, !!c, i, r);
|
11
|
+
return /* @__PURE__ */ m(T, { $top: s, $right: d, children: n });
|
12
12
|
});
|
13
13
|
export {
|
14
|
-
|
14
|
+
E as default
|
15
15
|
};
|
16
16
|
//# sourceMappingURL=node-card-tags.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"node-card-tags.js","sources":["../../../../../src/features/chapters-v2/comps/node-card/node-card-tags.tsx"],"sourcesContent":["import type { INodeCardTagsProps } from './node-card-types';\nimport type { FC } from 'react';\n\nimport { memo } from 'react';\n\nimport { getNodeStateBasedTagInfo } from '../../utils/node-card-utils';\nimport * as Styled from './node-card-styled';\n\nconst NodeCardTags: FC<INodeCardTagsProps> = memo(props => {\n const { state, accuracy, nodeType, dueDateTs } = props;\n\n const isDynamicNode =\n nodeType === 'DYNAMIC' || nodeType === 'ASSESSMENT' || nodeType === 'CHAPTER_ASSESSMENT';\n const accuracyValue = isDynamicNode ? accuracy : undefined;\n\n const {\n icon: NodeTagIcon,\n top,\n right,\n } = getNodeStateBasedTagInfo(state, accuracyValue, dueDateTs);\n\n return (\n <Styled.SheetTagWrapper $top={top} $right={right}>\n {NodeTagIcon}\n </Styled.SheetTagWrapper>\n );\n});\n\nexport default NodeCardTags;\n"],"names":["NodeCardTags","memo","props","state","accuracy","nodeType","dueDateTs","accuracyValue","NodeTagIcon","top","right","getNodeStateBasedTagInfo","jsx","Styled.SheetTagWrapper"],"mappings":";;;;AAQM,MAAAA,IAAuCC,EAAK,CAASC,MAAA;AACzD,QAAM,EAAE,OAAAC,GAAO,UAAAC,GAAU,UAAAC,GAAU,WAAAC,
|
1
|
+
{"version":3,"file":"node-card-tags.js","sources":["../../../../../src/features/chapters-v2/comps/node-card/node-card-tags.tsx"],"sourcesContent":["import type { INodeCardTagsProps } from './node-card-types';\nimport type { FC } from 'react';\n\nimport { memo } from 'react';\n\nimport { getNodeStateBasedTagInfo } from '../../utils/node-card-utils';\nimport * as Styled from './node-card-styled';\n\nconst NodeCardTags: FC<INodeCardTagsProps> = memo(props => {\n const { state, accuracy, nodeType, dueDateTs, isStudent } = props;\n\n const isDynamicNode =\n nodeType === 'DYNAMIC' || nodeType === 'ASSESSMENT' || nodeType === 'CHAPTER_ASSESSMENT';\n const accuracyValue = isDynamicNode ? accuracy : undefined;\n\n const {\n icon: NodeTagIcon,\n top,\n right,\n } = getNodeStateBasedTagInfo(state, !!isStudent, accuracyValue, dueDateTs);\n\n return (\n <Styled.SheetTagWrapper $top={top} $right={right}>\n {NodeTagIcon}\n </Styled.SheetTagWrapper>\n );\n});\n\nexport default NodeCardTags;\n"],"names":["NodeCardTags","memo","props","state","accuracy","nodeType","dueDateTs","isStudent","accuracyValue","NodeTagIcon","top","right","getNodeStateBasedTagInfo","jsx","Styled.SheetTagWrapper"],"mappings":";;;;AAQM,MAAAA,IAAuCC,EAAK,CAASC,MAAA;AACzD,QAAM,EAAE,OAAAC,GAAO,UAAAC,GAAU,UAAAC,GAAU,WAAAC,GAAW,WAAAC,EAAc,IAAAL,GAItDM,IADJH,MAAa,aAAaA,MAAa,gBAAgBA,MAAa,uBAChCD,IAAW,QAE3C;AAAA,IACJ,MAAMK;AAAA,IACN,KAAAC;AAAA,IACA,OAAAC;AAAA,EAAA,IACEC,EAAyBT,GAAO,CAAC,CAACI,GAAWC,GAAeF,CAAS;AAGvE,SAAA,gBAAAO,EAACC,GAAA,EAAuB,MAAMJ,GAAK,QAAQC,GACxC,UACHF,EAAA,CAAA;AAEJ,CAAC;"}
|
@@ -1,10 +1,10 @@
|
|
1
|
-
import { jsx as
|
2
|
-
import { memo as
|
3
|
-
import
|
4
|
-
import
|
5
|
-
const f =
|
1
|
+
import { jsx as e } from "react/jsx-runtime";
|
2
|
+
import { memo as o } from "react";
|
3
|
+
import n from "./student-actions/student-actions.js";
|
4
|
+
import i from "./teacher-actions/teacher-actions.js";
|
5
|
+
const f = o((t) => {
|
6
6
|
const { userType: r } = t;
|
7
|
-
return r === "STUDENT" ? /* @__PURE__ */
|
7
|
+
return r === "STUDENT" ? /* @__PURE__ */ e(n, { ...t, isStudent: !0 }) : /* @__PURE__ */ e(i, { ...t });
|
8
8
|
});
|
9
9
|
export {
|
10
10
|
f as default
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"node-card.js","sources":["../../../../../src/features/chapters-v2/comps/node-card/node-card.tsx"],"sourcesContent":["import type { INodeCardProps } from './node-card-types';\nimport type { FC } from 'react';\n\nimport { memo } from 'react';\n\nimport StudentActions from './student-actions/student-actions';\nimport TeacherActions from './teacher-actions/teacher-actions';\n\nconst NodeCard: FC<INodeCardProps> = memo(props => {\n const { userType } = props;\n const isStudent = userType === 'STUDENT';\n\n if (isStudent) {\n return <StudentActions {...props} />;\n }\n\n return <TeacherActions {...props} />;\n});\n\nexport default NodeCard;\n"],"names":["NodeCard","memo","props","userType","jsx","StudentActions","TeacherActions"],"mappings":";;;;AAQM,MAAAA,IAA+BC,EAAK,CAASC,MAAA;AAC3C,QAAA,EAAE,UAAAC,EAAa,IAAAD;AAGrB,SAFkBC,MAAa,
|
1
|
+
{"version":3,"file":"node-card.js","sources":["../../../../../src/features/chapters-v2/comps/node-card/node-card.tsx"],"sourcesContent":["import type { INodeCardProps } from './node-card-types';\nimport type { FC } from 'react';\n\nimport { memo } from 'react';\n\nimport StudentActions from './student-actions/student-actions';\nimport TeacherActions from './teacher-actions/teacher-actions';\n\nconst NodeCard: FC<INodeCardProps> = memo(props => {\n const { userType } = props;\n const isStudent = userType === 'STUDENT';\n\n if (isStudent) {\n return <StudentActions {...props} isStudent />;\n }\n\n return <TeacherActions {...props} />;\n});\n\nexport default NodeCard;\n"],"names":["NodeCard","memo","props","userType","jsx","StudentActions","TeacherActions"],"mappings":";;;;AAQM,MAAAA,IAA+BC,EAAK,CAASC,MAAA;AAC3C,QAAA,EAAE,UAAAC,EAAa,IAAAD;AAGrB,SAFkBC,MAAa,YAGrB,gBAAAC,EAAAC,GAAA,EAAgB,GAAGH,GAAO,WAAS,GAAC,CAAA,IAGvC,gBAAAE,EAACE,GAAgB,EAAA,GAAGJ,EAAO,CAAA;AACpC,CAAC;"}
|
@@ -1,47 +1,48 @@
|
|
1
|
-
import { jsx as e, jsxs as d, Fragment as
|
2
|
-
import { memo as
|
3
|
-
import
|
4
|
-
import
|
5
|
-
import
|
6
|
-
import
|
7
|
-
import
|
8
|
-
import
|
9
|
-
import { BLOCK_TYPE as
|
1
|
+
import { jsx as e, jsxs as d, Fragment as F } from "react/jsx-runtime";
|
2
|
+
import { memo as Y, useState as Z, useCallback as m } from "react";
|
3
|
+
import q from "../../../../../assets/line-icons/icons/eye2.js";
|
4
|
+
import J from "../../../../../assets/line-icons/icons/redo.js";
|
5
|
+
import Q from "../../../../ui/arrow-tooltip/arrow-tooltip.js";
|
6
|
+
import U from "../../../../ui/context-menu/context-menu.js";
|
7
|
+
import V from "../../../../ui/lottie-animation/lottie-animation.js";
|
8
|
+
import ee from "../../../../ui/text/text.js";
|
9
|
+
import { BLOCK_TYPE as te } from "../../../constants/block-constants.js";
|
10
10
|
import { NODE_CARD_STATES as f } from "../../../constants/node-constants.js";
|
11
|
-
import { getNodeTypeBasedBgImage as
|
12
|
-
import { getNodeCardBasedIcon as
|
13
|
-
import
|
14
|
-
import { NodeCardContainer as
|
15
|
-
import
|
16
|
-
import
|
17
|
-
const
|
11
|
+
import { getNodeTypeBasedBgImage as oe } from "../../../utils/index.js";
|
12
|
+
import { getNodeCardBasedIcon as re } from "../../../utils/node-card-utils.js";
|
13
|
+
import ne from "../border-path-animation.js";
|
14
|
+
import { NodeCardContainer as ae, NodeCardInfoWrapper as ie, IconWrapper as ce, StyledImportantIcon as se, NodeCardContentWrapper as de, NodeCardTitle as me } from "../node-card-styled.js";
|
15
|
+
import le from "../node-card-tags.js";
|
16
|
+
import pe from "../node-menu-options/node-menu-options.js";
|
17
|
+
const we = Y((b) => {
|
18
18
|
const {
|
19
19
|
nodeData: t,
|
20
|
-
imageHue:
|
21
|
-
blockType:
|
20
|
+
imageHue: A,
|
21
|
+
blockType: L,
|
22
22
|
onNodeAttempt: n,
|
23
23
|
onNodeReattempt: a,
|
24
24
|
onNodeReview: i,
|
25
|
-
onNodeView: o
|
26
|
-
|
27
|
-
|
28
|
-
|
25
|
+
onNodeView: o,
|
26
|
+
isStudent: T
|
27
|
+
} = b, {
|
28
|
+
accuracy: E,
|
29
|
+
attempt_location: w,
|
29
30
|
node_type: l,
|
30
|
-
card_header:
|
31
|
-
title:
|
31
|
+
card_header: y,
|
32
|
+
title: N,
|
32
33
|
state: c,
|
33
34
|
is_optional: C,
|
34
35
|
sheet_statement: $,
|
35
|
-
permissions:
|
36
|
+
permissions: R,
|
36
37
|
marked_as_completed: s
|
37
38
|
} = t, {
|
38
39
|
can_review: g,
|
39
40
|
can_start: p,
|
40
41
|
can_resume: h,
|
41
42
|
can_reset: I
|
42
|
-
} =
|
43
|
-
(
|
44
|
-
switch (
|
43
|
+
} = R, x = L === te.GOAL, r = c === f.LOCKED, B = c === f.NOT_STARTED, v = c === f.IN_PROGRESS, M = w === "INCLASS", W = p || h, _ = !C && (v || B), u = !W && (I || g), [D, O] = Z(!1), G = oe(l), { icon: H, lottie: K } = re(l), k = m(
|
44
|
+
(S) => {
|
45
|
+
switch (S) {
|
45
46
|
case "node-card-review":
|
46
47
|
s ? o == null || o(t) : i == null || i(t);
|
47
48
|
return;
|
@@ -49,11 +50,11 @@ const Ee = F((A) => {
|
|
49
50
|
a == null || a(t);
|
50
51
|
return;
|
51
52
|
default:
|
52
|
-
throw new Error(`No callback function for ${
|
53
|
+
throw new Error(`No callback function for ${S}`);
|
53
54
|
}
|
54
55
|
},
|
55
56
|
[t, a, i, o, s]
|
56
|
-
),
|
57
|
+
), P = m(() => {
|
57
58
|
u || r || (p || h ? n == null || n(t) : s && (o == null || o(t)));
|
58
59
|
}, [
|
59
60
|
h,
|
@@ -64,40 +65,40 @@ const Ee = F((A) => {
|
|
64
65
|
u,
|
65
66
|
r,
|
66
67
|
s
|
67
|
-
]),
|
68
|
+
]), X = m(() => {
|
68
69
|
O(!0);
|
69
|
-
}, []),
|
70
|
+
}, []), j = m(() => {
|
70
71
|
O(!1);
|
71
|
-
}, []),
|
72
|
+
}, []), z = [
|
72
73
|
{
|
73
74
|
id: "node-card-review",
|
74
75
|
label: "Review",
|
75
|
-
icon:
|
76
|
+
icon: q,
|
76
77
|
disabled: !g,
|
77
78
|
onClick: k
|
78
79
|
},
|
79
80
|
{
|
80
81
|
id: "node-card-reattempt",
|
81
82
|
label: "Reattempt",
|
82
|
-
icon:
|
83
|
+
icon: J,
|
83
84
|
disabled: !I,
|
84
85
|
onClick: k
|
85
86
|
}
|
86
87
|
];
|
87
88
|
return /* @__PURE__ */ e(
|
88
|
-
|
89
|
+
U,
|
89
90
|
{
|
90
91
|
targetElement: /* @__PURE__ */ e(
|
91
|
-
|
92
|
+
ae,
|
92
93
|
{
|
93
94
|
$showOutline: !_,
|
94
|
-
$background: `${
|
95
|
+
$background: `${A}_2`,
|
95
96
|
$disabled: r,
|
96
|
-
onClick:
|
97
|
-
onMouseEnter:
|
98
|
-
onMouseLeave:
|
97
|
+
onClick: P,
|
98
|
+
onMouseEnter: X,
|
99
|
+
onMouseLeave: j,
|
99
100
|
children: /* @__PURE__ */ d(
|
100
|
-
|
101
|
+
Q,
|
101
102
|
{
|
102
103
|
renderAs: "primary",
|
103
104
|
tooltipItem: $,
|
@@ -108,18 +109,18 @@ const Ee = F((A) => {
|
|
108
109
|
widthX: 11.25,
|
109
110
|
children: [
|
110
111
|
/* @__PURE__ */ d(
|
111
|
-
|
112
|
+
ie,
|
112
113
|
{
|
113
114
|
$flexDirection: "row",
|
114
115
|
$alignItems: "center",
|
115
116
|
$heightX: 3.5,
|
116
|
-
$bgImage:
|
117
|
+
$bgImage: G,
|
117
118
|
$gutterX: 0.78125,
|
118
119
|
$flexGap: 8.5,
|
119
120
|
$opacity: r ? 0.5 : 1,
|
120
121
|
children: [
|
121
122
|
/* @__PURE__ */ d(
|
122
|
-
|
123
|
+
ce,
|
123
124
|
{
|
124
125
|
$width: 31,
|
125
126
|
$height: 31,
|
@@ -128,28 +129,36 @@ const Ee = F((A) => {
|
|
128
129
|
$alignItems: "center",
|
129
130
|
$justifyContent: "center",
|
130
131
|
children: [
|
131
|
-
|
132
|
-
!C && /* @__PURE__ */ e(
|
132
|
+
D ? /* @__PURE__ */ e(V, { src: K }) : /* @__PURE__ */ e(H, { width: 20, height: 20 }),
|
133
|
+
!C && /* @__PURE__ */ e(se, {})
|
133
134
|
]
|
134
135
|
}
|
135
136
|
),
|
136
|
-
/* @__PURE__ */ d(
|
137
|
-
|
137
|
+
/* @__PURE__ */ d(ee, { $renderAs: "ac4-black", $color: "BLACK", children: [
|
138
|
+
y,
|
138
139
|
" ",
|
139
|
-
|
140
|
+
M && ". CW"
|
140
141
|
] }),
|
141
|
-
_ && /* @__PURE__ */ e(
|
142
|
+
_ && /* @__PURE__ */ e(ne, {})
|
142
143
|
]
|
143
144
|
}
|
144
145
|
),
|
145
|
-
/* @__PURE__ */ e(
|
146
|
-
|
147
|
-
|
146
|
+
/* @__PURE__ */ e(
|
147
|
+
le,
|
148
|
+
{
|
149
|
+
nodeType: l,
|
150
|
+
state: c,
|
151
|
+
accuracy: E,
|
152
|
+
isStudent: T
|
153
|
+
}
|
154
|
+
),
|
155
|
+
!x && /* @__PURE__ */ e(de, { $background: "WHITE_1", $heightX: 4, children: /* @__PURE__ */ e(
|
156
|
+
me,
|
148
157
|
{
|
149
158
|
$renderAs: "ab3",
|
150
159
|
$color: "BLACK_1",
|
151
160
|
$opacity: r ? 0.5 : 1,
|
152
|
-
children:
|
161
|
+
children: N
|
153
162
|
}
|
154
163
|
) })
|
155
164
|
]
|
@@ -161,11 +170,11 @@ const Ee = F((A) => {
|
|
161
170
|
menuWidth: "100%",
|
162
171
|
menuZIndex: 6,
|
163
172
|
menuOffset: 2,
|
164
|
-
menuElement: /* @__PURE__ */ e(
|
173
|
+
menuElement: /* @__PURE__ */ e(F, { children: u ? /* @__PURE__ */ e(pe, { options: z }) : void 0 })
|
165
174
|
}
|
166
175
|
);
|
167
176
|
});
|
168
177
|
export {
|
169
|
-
|
178
|
+
we as default
|
170
179
|
};
|
171
180
|
//# sourceMappingURL=student-actions.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"student-actions.js","sources":["../../../../../../src/features/chapters-v2/comps/node-card/student-actions/student-actions.tsx"],"sourcesContent":["import type { INodeCardProps } from '../node-card-types';\nimport type { INodeMenuOption } from '../node-menu-options/node-menu-options-types';\n\nimport { memo, useCallback, useState, type FC } from 'react';\n\nimport Eye2Icon from '../../../../../assets/line-icons/icons/eye2';\nimport RedoIcon from '../../../../../assets/line-icons/icons/redo';\nimport ArrowTooltip from '../../../../ui/arrow-tooltip/arrow-tooltip';\nimport ContextMenu from '../../../../ui/context-menu/context-menu';\nimport LottieAnimation from '../../../../ui/lottie-animation/lottie-animation';\nimport Text from '../../../../ui/text/text';\nimport { BLOCK_TYPE } from '../../../constants/block-constants';\nimport { NODE_CARD_STATES } 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 StudentActions: FC<Omit<INodeCardProps, 'userType'>> = memo(props => {\n const {\n nodeData,\n imageHue,\n blockType,\n onNodeAttempt,\n onNodeReattempt,\n onNodeReview,\n onNodeView,\n } = props;\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 marked_as_completed: teacherMarkedAsCompleted,\n } = nodeData;\n\n const {\n can_review: canReview,\n can_start: canStart,\n can_resume: canResume,\n can_reset: canReset,\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 canStartOrResume = canStart || canResume;\n\n const showCardAnimation = !isOptional && (sheetInProgress || sheetNotStarted);\n const renderOptions = !canStartOrResume && (canReset || canReview);\n\n const [renderLottie, setRenderLottie] = useState(false);\n const nodeBgImage = getNodeTypeBasedBgImage(nodeType);\n const { icon: NodeCardIcon, lottie: nodeCardLottie } = getNodeCardBasedIcon(nodeType);\n\n const handleOnMenuOptionClick = useCallback(\n (optionId: string) => {\n switch (optionId) {\n case 'node-card-review':\n teacherMarkedAsCompleted ? onNodeView?.(nodeData) : onNodeReview?.(nodeData);\n\n return;\n\n case 'node-card-reattempt':\n onNodeReattempt?.(nodeData);\n\n return;\n\n default:\n throw new Error(`No callback function for ${optionId}`);\n }\n },\n [nodeData, onNodeReattempt, onNodeReview, onNodeView, teacherMarkedAsCompleted],\n );\n\n const handleOnNodeCardClick = useCallback(() => {\n if (renderOptions || sheetLocked) return;\n\n if (canStart || canResume) {\n onNodeAttempt?.(nodeData);\n } else if (teacherMarkedAsCompleted) {\n onNodeView?.(nodeData);\n }\n }, [\n canResume,\n canStart,\n nodeData,\n onNodeAttempt,\n onNodeView,\n renderOptions,\n sheetLocked,\n teacherMarkedAsCompleted,\n ]);\n\n const handleOnMouseEnter = useCallback(() => {\n setRenderLottie(true);\n }, []);\n\n const handleOnMouseLeave = useCallback(() => {\n setRenderLottie(false);\n }, []);\n\n const menuOptions: INodeMenuOption[] = [\n {\n id: 'node-card-review',\n label: 'Review',\n icon: Eye2Icon,\n disabled: !canReview,\n onClick: handleOnMenuOptionClick,\n },\n {\n id: 'node-card-reattempt',\n label: 'Reattempt',\n icon: RedoIcon,\n disabled: !canReset,\n onClick: handleOnMenuOptionClick,\n },\n ];\n\n return (\n <ContextMenu\n targetElement={\n <Styled.NodeCardContainer\n $showOutline={!showCardAnimation}\n $background={`${imageHue}_2`}\n $disabled={sheetLocked}\n onClick={handleOnNodeCardClick}\n onMouseEnter={handleOnMouseEnter}\n onMouseLeave={handleOnMouseLeave}\n >\n <ArrowTooltip\n renderAs=\"primary\"\n tooltipItem={sheetStatement}\n position=\"bottom\"\n zIndex={5}\n hidden={!sheetStatement}\n parentWidth=\"100%\"\n widthX={11.25}\n >\n <Styled.NodeCardInfoWrapper\n $flexDirection=\"row\"\n $alignItems=\"center\"\n $heightX={3.5}\n $bgImage={nodeBgImage}\n $gutterX={0.78125}\n $flexGap={8.5}\n $opacity={sheetLocked ? 0.5 : 1}\n >\n <Styled.IconWrapper\n $width={31}\n $height={31}\n $background=\"WHITE_1\"\n $position=\"relative\"\n $alignItems=\"center\"\n $justifyContent=\"center\"\n >\n {renderLottie ? (\n <LottieAnimation src={nodeCardLottie} />\n ) : (\n <NodeCardIcon width={20} height={20} />\n )}\n {!isOptional && <Styled.StyledImportantIcon />}\n </Styled.IconWrapper>\n\n <Text $renderAs=\"ac4-black\" $color=\"BLACK\">\n {cardHeader} {inClassSheet && `. CW`}\n </Text>\n\n {showCardAnimation && <BorderPathAnimation />}\n </Styled.NodeCardInfoWrapper>\n\n <NodeCardTags nodeType={nodeType} state={state} accuracy={accuracy} />\n\n {!isGoalBlock && (\n <Styled.NodeCardContentWrapper $background=\"WHITE_1\" $heightX={4}>\n <Styled.NodeCardTitle\n $renderAs=\"ab3\"\n $color=\"BLACK_1\"\n $opacity={sheetLocked ? 0.5 : 1}\n >\n {title}\n </Styled.NodeCardTitle>\n </Styled.NodeCardContentWrapper>\n )}\n </ArrowTooltip>\n </Styled.NodeCardContainer>\n }\n startLeft\n menuWidth=\"100%\"\n menuZIndex={6}\n menuOffset={2}\n menuElement={<>{renderOptions ? <NodeMenuOptions options={menuOptions} /> : undefined}</>}\n />\n );\n});\n\nexport default StudentActions;\n"],"names":["StudentActions","memo","props","nodeData","imageHue","blockType","onNodeAttempt","onNodeReattempt","onNodeReview","onNodeView","accuracy","attemptLocation","nodeType","cardHeader","title","state","isOptional","sheetStatement","permissions","teacherMarkedAsCompleted","canReview","canStart","canResume","canReset","isGoalBlock","BLOCK_TYPE","sheetLocked","NODE_CARD_STATES","sheetNotStarted","sheetInProgress","inClassSheet","canStartOrResume","showCardAnimation","renderOptions","renderLottie","setRenderLottie","useState","nodeBgImage","getNodeTypeBasedBgImage","NodeCardIcon","nodeCardLottie","getNodeCardBasedIcon","handleOnMenuOptionClick","useCallback","optionId","handleOnNodeCardClick","handleOnMouseEnter","handleOnMouseLeave","menuOptions","Eye2Icon","RedoIcon","jsx","ContextMenu","Styled.NodeCardContainer","jsxs","ArrowTooltip","Styled.NodeCardInfoWrapper","Styled.IconWrapper","LottieAnimation","Styled.StyledImportantIcon","Text","BorderPathAnimation","NodeCardTags","Styled.NodeCardContentWrapper","Styled.NodeCardTitle","NodeMenuOptions"],"mappings":";;;;;;;;;;;;;;;;AAoBM,MAAAA,KAAuDC,EAAK,CAASC,MAAA;AACnE,QAAA;AAAA,IACJ,UAAAC;AAAA,IACA,UAAAC;AAAA,IACA,WAAAC;AAAA,IACA,eAAAC;AAAA,IACA,iBAAAC;AAAA,IACA,cAAAC;AAAA,IACA,YAAAC;AAAA,EACE,IAAAP,GACE;AAAA,IAC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0BACR,SAAS;AAAA,0BACT,aAAY;AAAA,0BACZ,WAAU;AAAA,0BACV,aAAY;AAAA,0BACZ,iBAAgB;AAAA,0BAEf,UAAA;AAAA,4BACCvB,IAAA,gBAAAiB,EAACO,GAAgB,EAAA,KAAKlB,EAAgB,CAAA,sBAErCD,GAAa,EAAA,OAAO,IAAI,QAAQ,GAAI,CAAA;AAAA,4BAEtC,CAACvB,KAAe,gBAAAmC,EAAAQ,IAAA,EAA2B;AAAA,0BAAA;AAAA,wBAAA;AAAA,sBAC9C;AAAA,sBAEC,gBAAAL,EAAAM,GAAA,EAAK,WAAU,aAAY,QAAO,SAChC,UAAA;AAAA,wBAAA/C;AAAA,wBAAW;AAAA,wBAAEiB,KAAgB;AAAA,sBAAA,GAChC;AAAA,sBAECE,uBAAsB6B,IAAoB,EAAA;AAAA,oBAAA;AAAA,kBAAA;AAAA,gBAC7C;AAAA,gBAEC,gBAAAV,EAAAW,IAAA,EAAa,UAAAlD,GAAoB,OAAAG,GAAc,UAAAL,EAAoB,CAAA;AAAA,gBAEnE,CAACc,KACC,gBAAA2B,EAAAY,IAAA,EAA8B,aAAY,WAAU,UAAU,GAC7D,UAAA,gBAAAZ;AAAA,kBAACa;AAAAA,kBAAA;AAAA,oBACC,WAAU;AAAA,oBACV,QAAO;AAAA,oBACP,UAAUtC,IAAc,MAAM;AAAA,oBAE7B,UAAAZ;AAAA,kBAAA;AAAA,gBAAA,GAEL;AAAA,cAAA;AAAA,YAAA;AAAA,UAEJ;AAAA,QAAA;AAAA,MACF;AAAA,MAEF,WAAS;AAAA,MACT,WAAU;AAAA,MACV,YAAY;AAAA,MACZ,YAAY;AAAA,MACZ,oCAAgB,UAAgBmB,IAAA,gBAAAkB,EAACc,MAAgB,SAASjB,EAAa,CAAA,IAAK,OAAU,CAAA;AAAA,IAAA;AAAA,EAAA;AAG5F,CAAC;"}
|
1
|
+
{"version":3,"file":"student-actions.js","sources":["../../../../../../src/features/chapters-v2/comps/node-card/student-actions/student-actions.tsx"],"sourcesContent":["import type { INodeCardProps } from '../node-card-types';\nimport type { INodeMenuOption } from '../node-menu-options/node-menu-options-types';\n\nimport { memo, useCallback, useState, type FC } from 'react';\n\nimport Eye2Icon from '../../../../../assets/line-icons/icons/eye2';\nimport RedoIcon from '../../../../../assets/line-icons/icons/redo';\nimport ArrowTooltip from '../../../../ui/arrow-tooltip/arrow-tooltip';\nimport ContextMenu from '../../../../ui/context-menu/context-menu';\nimport LottieAnimation from '../../../../ui/lottie-animation/lottie-animation';\nimport Text from '../../../../ui/text/text';\nimport { BLOCK_TYPE } from '../../../constants/block-constants';\nimport { NODE_CARD_STATES } 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 StudentActions: FC<Omit<INodeCardProps, 'userType'>> = memo(props => {\n const {\n nodeData,\n imageHue,\n blockType,\n onNodeAttempt,\n onNodeReattempt,\n onNodeReview,\n onNodeView,\n isStudent,\n } = props;\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 marked_as_completed: teacherMarkedAsCompleted,\n } = nodeData;\n\n const {\n can_review: canReview,\n can_start: canStart,\n can_resume: canResume,\n can_reset: canReset,\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 canStartOrResume = canStart || canResume;\n\n const showCardAnimation = !isOptional && (sheetInProgress || sheetNotStarted);\n const renderOptions = !canStartOrResume && (canReset || canReview);\n\n const [renderLottie, setRenderLottie] = useState(false);\n const nodeBgImage = getNodeTypeBasedBgImage(nodeType);\n const { icon: NodeCardIcon, lottie: nodeCardLottie } = getNodeCardBasedIcon(nodeType);\n\n const handleOnMenuOptionClick = useCallback(\n (optionId: string) => {\n switch (optionId) {\n case 'node-card-review':\n teacherMarkedAsCompleted ? onNodeView?.(nodeData) : onNodeReview?.(nodeData);\n\n return;\n\n case 'node-card-reattempt':\n onNodeReattempt?.(nodeData);\n\n return;\n\n default:\n throw new Error(`No callback function for ${optionId}`);\n }\n },\n [nodeData, onNodeReattempt, onNodeReview, onNodeView, teacherMarkedAsCompleted],\n );\n\n const handleOnNodeCardClick = useCallback(() => {\n if (renderOptions || sheetLocked) return;\n\n if (canStart || canResume) {\n onNodeAttempt?.(nodeData);\n } else if (teacherMarkedAsCompleted) {\n onNodeView?.(nodeData);\n }\n }, [\n canResume,\n canStart,\n nodeData,\n onNodeAttempt,\n onNodeView,\n renderOptions,\n sheetLocked,\n teacherMarkedAsCompleted,\n ]);\n\n const handleOnMouseEnter = useCallback(() => {\n setRenderLottie(true);\n }, []);\n\n const handleOnMouseLeave = useCallback(() => {\n setRenderLottie(false);\n }, []);\n\n const menuOptions: INodeMenuOption[] = [\n {\n id: 'node-card-review',\n label: 'Review',\n icon: Eye2Icon,\n disabled: !canReview,\n onClick: handleOnMenuOptionClick,\n },\n {\n id: 'node-card-reattempt',\n label: 'Reattempt',\n icon: RedoIcon,\n disabled: !canReset,\n onClick: handleOnMenuOptionClick,\n },\n ];\n\n return (\n <ContextMenu\n targetElement={\n <Styled.NodeCardContainer\n $showOutline={!showCardAnimation}\n $background={`${imageHue}_2`}\n $disabled={sheetLocked}\n onClick={handleOnNodeCardClick}\n onMouseEnter={handleOnMouseEnter}\n onMouseLeave={handleOnMouseLeave}\n >\n <ArrowTooltip\n renderAs=\"primary\"\n tooltipItem={sheetStatement}\n position=\"bottom\"\n zIndex={5}\n hidden={!sheetStatement}\n parentWidth=\"100%\"\n widthX={11.25}\n >\n <Styled.NodeCardInfoWrapper\n $flexDirection=\"row\"\n $alignItems=\"center\"\n $heightX={3.5}\n $bgImage={nodeBgImage}\n $gutterX={0.78125}\n $flexGap={8.5}\n $opacity={sheetLocked ? 0.5 : 1}\n >\n <Styled.IconWrapper\n $width={31}\n $height={31}\n $background=\"WHITE_1\"\n $position=\"relative\"\n $alignItems=\"center\"\n $justifyContent=\"center\"\n >\n {renderLottie ? (\n <LottieAnimation src={nodeCardLottie} />\n ) : (\n <NodeCardIcon width={20} height={20} />\n )}\n {!isOptional && <Styled.StyledImportantIcon />}\n </Styled.IconWrapper>\n\n <Text $renderAs=\"ac4-black\" $color=\"BLACK\">\n {cardHeader} {inClassSheet && `. CW`}\n </Text>\n\n {showCardAnimation && <BorderPathAnimation />}\n </Styled.NodeCardInfoWrapper>\n\n <NodeCardTags\n nodeType={nodeType}\n state={state}\n accuracy={accuracy}\n isStudent={isStudent}\n />\n\n {!isGoalBlock && (\n <Styled.NodeCardContentWrapper $background=\"WHITE_1\" $heightX={4}>\n <Styled.NodeCardTitle\n $renderAs=\"ab3\"\n $color=\"BLACK_1\"\n $opacity={sheetLocked ? 0.5 : 1}\n >\n {title}\n </Styled.NodeCardTitle>\n </Styled.NodeCardContentWrapper>\n )}\n </ArrowTooltip>\n </Styled.NodeCardContainer>\n }\n startLeft\n menuWidth=\"100%\"\n menuZIndex={6}\n menuOffset={2}\n menuElement={<>{renderOptions ? <NodeMenuOptions options={menuOptions} /> : undefined}</>}\n />\n );\n});\n\nexport default StudentActions;\n"],"names":["StudentActions","memo","props","nodeData","imageHue","blockType","onNodeAttempt","onNodeReattempt","onNodeReview","onNodeView","isStudent","accuracy","attemptLocation","nodeType","cardHeader","title","state","isOptional","sheetStatement","permissions","teacherMarkedAsCompleted","canReview","canStart","canResume","canReset","isGoalBlock","BLOCK_TYPE","sheetLocked","NODE_CARD_STATES","sheetNotStarted","sheetInProgress","inClassSheet","canStartOrResume","showCardAnimation","renderOptions","renderLottie","setRenderLottie","useState","nodeBgImage","getNodeTypeBasedBgImage","NodeCardIcon","nodeCardLottie","getNodeCardBasedIcon","handleOnMenuOptionClick","useCallback","optionId","handleOnNodeCardClick","handleOnMouseEnter","handleOnMouseLeave","menuOptions","Eye2Icon","RedoIcon","jsx","ContextMenu","Styled.NodeCardContainer","jsxs","ArrowTooltip","Styled.NodeCardInfoWrapper","Styled.IconWrapper","LottieAnimation","Styled.StyledImportantIcon","Text","BorderPathAnimation","NodeCardTags","Styled.NodeCardContentWrapper","Styled.NodeCardTitle","NodeMenuOptions"],"mappings":";;;;;;;;;;;;;;;;AAoBM,MAAAA,KAAuDC,EAAK,CAASC,MAAA;AACnE,QAAA;AAAA,IACJ,UAAAC;AAAA,IACA,UAAAC;AAAA,IACA,WAAAC;AAAA,IACA,eAAAC;AAAA,IACA,iBAAAC;AAAA,IACA,cAAAC;AAAA,IACA,YAAAC;AAAA,IACA,WAAAC;AAAA,EACE,IAAAR,GACE;AAAA,IACJ,UAAAS;AAAA,IACA,kBAAkBC;AAAA,IAClB,WAAWC;AAAA,IACX,aAAaC;AAAA,IACb,OAAAC;AAAA,IACA,OAAAC;AAAA,IACA,aAAaC;AAAA,IACb,iBAAiBC;AAAA,IACjB,aAAAC;AAAA,IACA,qBAAqBC;AAAA,EACnB,IAAAjB,GAEE;AAAA,IACJ,YAAYkB;AAAA,IACZ,WAAWC;AAAA,IACX,YAAYC;AAAA,IACZ,WAAWC;AAAA,EACT,IAAAL,GAEEM,IAAcpB,MAAcqB,GAAW,MACvCC,IAAcX,MAAUY,EAAiB,QACzCC,IAAkBb,MAAUY,EAAiB,aAC7CE,IAAkBd,MAAUY,EAAiB,aAC7CG,IAAenB,MAAoB,WACnCoB,IAAmBV,KAAYC,GAE/BU,IAAoB,CAAChB,MAAea,KAAmBD,IACvDK,IAAgB,CAACF,MAAqBR,KAAYH,IAElD,CAACc,GAAcC,CAAe,IAAIC,EAAS,EAAK,GAChDC,IAAcC,GAAwB1B,C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