@cuemath/leap 2.9.6-as1 → 2.9.6-as10
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 +28 -28
- 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 +44 -43
- package/dist/features/chapters-v2/chapter-details/block-sections/block-sections.js.map +1 -1
- package/dist/features/chapters-v2/chapter-details/chapter-banner/chapter-banner.js +31 -30
- package/dist/features/chapters-v2/chapter-details/chapter-banner/chapter-banner.js.map +1 -1
- package/dist/features/chapters-v2/chapter-details/chapter-details.js +82 -55
- package/dist/features/chapters-v2/chapter-details/chapter-details.js.map +1 -1
- package/dist/features/chapters-v2/comps/node-card/node-card-styled.js +30 -24
- package/dist/features/chapters-v2/comps/node-card/node-card-styled.js.map +1 -1
- package/dist/features/chapters-v2/comps/node-card/student-actions/student-actions.js +3 -3
- package/dist/features/chapters-v2/comps/node-card/student-actions/student-actions.js.map +1 -1
- package/dist/features/chapters-v2/comps/node-card/teacher-actions/teacher-actions.js +25 -25
- package/dist/features/chapters-v2/comps/node-card/teacher-actions/teacher-actions.js.map +1 -1
- package/dist/features/chapters-v2/utils/node-card-utils.js +31 -29
- package/dist/features/chapters-v2/utils/node-card-utils.js.map +1 -1
- package/dist/features/homework/hw-card-list/hw-card-list.js +38 -39
- package/dist/features/homework/hw-card-list/hw-card-list.js.map +1 -1
- package/dist/features/journey/hooks/use-chapter-journey.js +194 -0
- package/dist/features/journey/hooks/use-chapter-journey.js.map +1 -0
- package/dist/features/journey/journey-id/journey-id-student.js +2 -3
- package/dist/features/journey/journey-id/journey-id-student.js.map +1 -1
- package/dist/features/journey/journey-id/journey-id-teacher.js +5 -0
- package/dist/features/journey/journey-id/journey-id-teacher.js.map +1 -0
- package/dist/features/journey/use-journey/journey-context-provider.js +48 -48
- package/dist/features/journey/use-journey/journey-context-provider.js.map +1 -1
- package/dist/features/milestone/milestone-list-container/milestone-list/milestone-widget/milestone-info.js +12 -11
- package/dist/features/milestone/milestone-list-container/milestone-list/milestone-widget/milestone-info.js.map +1 -1
- package/dist/features/milestone/milestone-tests/test-list-v2/test-list-view.js +1 -1
- package/dist/features/milestone/milestone-tests/test-list-v2/test-list-view.js.map +1 -1
- package/dist/features/sheet-v2/resource-list/resource-list.js +1 -1
- package/dist/features/sheet-v2/resource-list/resource-list.js.map +1 -1
- package/dist/index.d.ts +29 -4
- package/dist/index.js +140 -137
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
@@ -1,46 +1,70 @@
|
|
1
|
-
import { jsxs as
|
2
|
-
import { memo as
|
3
|
-
import { ILLUSTRATIONS as
|
4
|
-
import
|
5
|
-
import
|
6
|
-
import
|
7
|
-
import
|
8
|
-
import
|
9
|
-
import
|
10
|
-
import
|
11
|
-
import
|
12
|
-
import
|
13
|
-
import
|
14
|
-
|
1
|
+
import { jsxs as f, jsx as t } from "react/jsx-runtime";
|
2
|
+
import { memo as N, useCallback as v, useEffect as s } from "react";
|
3
|
+
import { ILLUSTRATIONS as D } from "../../../assets/illustrations/illustrations.js";
|
4
|
+
import E from "../../../assets/line-icons/icons/back2.js";
|
5
|
+
import { useJourney as P } from "../../journey/use-journey/use-journey.js";
|
6
|
+
import T from "../../ui/buttons/button/button.js";
|
7
|
+
import j from "../../ui/buttons/icon-button/icon-button.js";
|
8
|
+
import J from "../../ui/layout/flex-view.js";
|
9
|
+
import H from "../../ui/loader/app-loader/app-loader.js";
|
10
|
+
import O from "../../ui/text/text.js";
|
11
|
+
import { useGetChapterDetails as U } from "../api/chapter.js";
|
12
|
+
import W from "./block-sections/block-sections.js";
|
13
|
+
import X from "./chapter-banner/chapter-banner.js";
|
14
|
+
import { ContentWrapper as z, BackButtonContainer as F, BackButtonWrapper as G, LoaderWrapper as V } from "./chapter-details-styled.js";
|
15
|
+
const q = N((g) => {
|
15
16
|
const {
|
16
|
-
userChapterId:
|
17
|
+
userChapterId: c,
|
17
18
|
studentId: n,
|
18
19
|
userType: a,
|
19
|
-
onBlockSkipUnskip:
|
20
|
-
onNodeAttempt:
|
21
|
-
onNodeAttemptLocationChange:
|
22
|
-
onNodeMarkAsDone:
|
23
|
-
onNodeReattempt:
|
24
|
-
onNodeReview:
|
25
|
-
onNodeView:
|
26
|
-
onExit:
|
27
|
-
|
28
|
-
|
20
|
+
onBlockSkipUnskip: u,
|
21
|
+
onNodeAttempt: C,
|
22
|
+
onNodeAttemptLocationChange: k,
|
23
|
+
onNodeMarkAsDone: y,
|
24
|
+
onNodeReattempt: A,
|
25
|
+
onNodeReview: B,
|
26
|
+
onNodeView: $,
|
27
|
+
onExit: x,
|
28
|
+
startChapterPageJourney: i,
|
29
|
+
chapterPageRef: I,
|
30
|
+
bannerRef: S,
|
31
|
+
coreBlocksRef: w,
|
32
|
+
canStartJourney: m
|
33
|
+
} = g, {
|
34
|
+
get: p,
|
29
35
|
data: e,
|
30
36
|
isProcessing: r,
|
31
|
-
isProcessingFailed:
|
32
|
-
isStale:
|
33
|
-
} =
|
34
|
-
|
35
|
-
}, [
|
36
|
-
|
37
|
+
isProcessingFailed: R,
|
38
|
+
isStale: l
|
39
|
+
} = U(), o = v(() => {
|
40
|
+
p(c, void 0, { studentId: n });
|
41
|
+
}, [p, c, n]);
|
42
|
+
s(() => {
|
37
43
|
o();
|
38
|
-
}, [o])
|
39
|
-
|
40
|
-
|
41
|
-
|
44
|
+
}, [o]);
|
45
|
+
const { isJourneyActive: h } = P();
|
46
|
+
return s(() => {
|
47
|
+
if (e) {
|
48
|
+
const { progress_stat: _ } = e, { classwork: b } = _ || {}, { completed: d, total: L } = b || {};
|
49
|
+
m && d !== 0 && L === d && !h && i && i({
|
50
|
+
chapterDetails: e,
|
51
|
+
studentId: n,
|
52
|
+
userType: a
|
53
|
+
});
|
54
|
+
}
|
55
|
+
}, [
|
56
|
+
e,
|
57
|
+
i,
|
58
|
+
h,
|
59
|
+
n,
|
60
|
+
a,
|
61
|
+
m
|
62
|
+
]), s(() => {
|
63
|
+
!r && l && o();
|
64
|
+
}, [o, r, l]), R ? /* @__PURE__ */ f(J, { $flexGapX: 1.5, $height: "100vh", $justifyContent: "center", $alignItems: "center", children: [
|
65
|
+
/* @__PURE__ */ t(O, { $renderAs: "h6", children: "Oops! Something went wrong. Please try again later." }),
|
42
66
|
/* @__PURE__ */ t(
|
43
|
-
|
67
|
+
T,
|
44
68
|
{
|
45
69
|
widthX: 14,
|
46
70
|
size: "small",
|
@@ -50,54 +74,57 @@ const P = B((c) => {
|
|
50
74
|
onClick: o
|
51
75
|
}
|
52
76
|
)
|
53
|
-
] }) : !e && r ? /* @__PURE__ */ t(
|
54
|
-
|
77
|
+
] }) : !e && r ? /* @__PURE__ */ t(H, { height: "80vh" }) : /* @__PURE__ */ f(
|
78
|
+
z,
|
55
79
|
{
|
80
|
+
ref: I,
|
56
81
|
$widthX: 50,
|
57
82
|
$disablePointerEvents: r,
|
58
83
|
$justifyContent: "center",
|
59
84
|
$alignItems: "center",
|
60
85
|
children: [
|
61
|
-
a === "TEACHER" && /* @__PURE__ */ t(
|
62
|
-
|
86
|
+
a === "TEACHER" && /* @__PURE__ */ t(F, { $height: "100%", children: /* @__PURE__ */ t(G, { children: /* @__PURE__ */ t(
|
87
|
+
j,
|
63
88
|
{
|
64
|
-
Icon:
|
89
|
+
Icon: E,
|
65
90
|
renderAs: "secondary-gray",
|
66
91
|
analyticsLabel: "chapter_page_exit",
|
67
92
|
size: "xsmall",
|
68
|
-
onClick:
|
93
|
+
onClick: x
|
69
94
|
}
|
70
95
|
) }) }),
|
71
|
-
r && /* @__PURE__ */ t(
|
96
|
+
r && /* @__PURE__ */ t(V, { children: /* @__PURE__ */ t("img", { src: D.LOADER_1, alt: "loader" }) }),
|
72
97
|
e && /* @__PURE__ */ t(
|
73
|
-
|
98
|
+
X,
|
74
99
|
{
|
75
100
|
title: e.name,
|
76
101
|
imageHue: e.image_hue,
|
77
102
|
imageUrl: e.image_url,
|
78
|
-
progressStats: e == null ? void 0 : e.progress_stat
|
103
|
+
progressStats: e == null ? void 0 : e.progress_stat,
|
104
|
+
bannerRef: S
|
79
105
|
}
|
80
106
|
),
|
81
107
|
e && /* @__PURE__ */ t(
|
82
|
-
|
108
|
+
W,
|
83
109
|
{
|
84
110
|
imageHue: e.image_hue,
|
85
111
|
userType: a,
|
86
112
|
blocks: e.blocks,
|
87
|
-
onBlockSkipUnskip:
|
88
|
-
onNodeAttempt:
|
89
|
-
onNodeAttemptLocationChange:
|
90
|
-
onNodeMarkAsDone:
|
91
|
-
onNodeReattempt:
|
92
|
-
onNodeReview:
|
93
|
-
onNodeView:
|
113
|
+
onBlockSkipUnskip: u,
|
114
|
+
onNodeAttempt: C,
|
115
|
+
onNodeAttemptLocationChange: k,
|
116
|
+
onNodeMarkAsDone: y,
|
117
|
+
onNodeReattempt: A,
|
118
|
+
onNodeReview: B,
|
119
|
+
onNodeView: $,
|
120
|
+
coreBlocksRef: w
|
94
121
|
}
|
95
122
|
)
|
96
123
|
]
|
97
124
|
}
|
98
125
|
);
|
99
|
-
}),
|
126
|
+
}), me = q;
|
100
127
|
export {
|
101
|
-
|
128
|
+
me as default
|
102
129
|
};
|
103
130
|
//# sourceMappingURL=chapter-details.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"chapter-details.js","sources":["../../../../src/features/chapters-v2/chapter-details/chapter-details.tsx"],"sourcesContent":["import type { IChapterDetails } from './chapter-details-types';\nimport type { FC } from 'react';\n\nimport { memo, useCallback, useEffect } from 'react';\n\nimport { ILLUSTRATIONS } from '../../../assets/illustrations/illustrations';\nimport Back2Icon from '../../../assets/line-icons/icons/back2';\nimport Button from '../../ui/buttons/button/button';\nimport IconButton from '../../ui/buttons/icon-button/icon-button';\nimport FlexView from '../../ui/layout/flex-view';\nimport AppLoader from '../../ui/loader/app-loader/app-loader';\nimport Text from '../../ui/text/text';\nimport { useGetChapterDetails } from '../api/chapter';\nimport BlockSections from './block-sections/block-sections';\nimport ChapterBanner from './chapter-banner/chapter-banner';\nimport * as Styled from './chapter-details-styled';\n\nconst ChapterDetails: FC<IChapterDetails> = memo(props => {\n const {\n userChapterId,\n studentId,\n userType,\n onBlockSkipUnskip,\n onNodeAttempt,\n onNodeAttemptLocationChange,\n onNodeMarkAsDone,\n onNodeReattempt,\n onNodeReview,\n onNodeView,\n onExit,\n } = props;\n\n const {\n get: getChapterDetails,\n data: chapterDetails,\n isProcessing,\n isProcessingFailed,\n isStale,\n } = useGetChapterDetails();\n\n const fetchChapterDetails = useCallback(() => {\n getChapterDetails(userChapterId, undefined, { studentId });\n }, [getChapterDetails, userChapterId, studentId]);\n\n useEffect(() => {\n fetchChapterDetails();\n }, [fetchChapterDetails]);\n\n useEffect(() => {\n if (!isProcessing && isStale) {\n fetchChapterDetails();\n }\n }, [fetchChapterDetails, isProcessing, isStale]);\n\n if (isProcessingFailed) {\n return (\n <FlexView $flexGapX={1.5} $height=\"100vh\" $justifyContent=\"center\" $alignItems=\"center\">\n <Text $renderAs=\"h6\">Oops! Something went wrong. Please try again later.</Text>\n <Button\n widthX={14}\n size=\"small\"\n shape=\"square\"\n renderAs=\"primary\"\n label=\"Try again\"\n onClick={fetchChapterDetails}\n />\n </FlexView>\n );\n }\n\n if (!chapterDetails && isProcessing) {\n return <AppLoader height=\"80vh\" />;\n }\n\n return (\n <Styled.ContentWrapper\n $widthX={50}\n $disablePointerEvents={isProcessing}\n $justifyContent=\"center\"\n $alignItems=\"center\"\n >\n {userType === 'TEACHER' && (\n <Styled.BackButtonContainer $height=\"100%\">\n <Styled.BackButtonWrapper>\n <IconButton\n Icon={Back2Icon}\n renderAs=\"secondary-gray\"\n analyticsLabel=\"chapter_page_exit\"\n size=\"xsmall\"\n onClick={onExit}\n />\n </Styled.BackButtonWrapper>\n </Styled.BackButtonContainer>\n )}\n\n {isProcessing && (\n <Styled.LoaderWrapper>\n <img src={ILLUSTRATIONS.LOADER_1} alt=\"loader\" />\n </Styled.LoaderWrapper>\n )}\n\n {chapterDetails && (\n <ChapterBanner\n title={chapterDetails.name}\n imageHue={chapterDetails.image_hue}\n imageUrl={chapterDetails.image_url}\n progressStats={chapterDetails?.progress_stat}\n />\n )}\n\n {chapterDetails && (\n <BlockSections\n imageHue={chapterDetails.image_hue}\n userType={userType}\n blocks={chapterDetails.blocks}\n onBlockSkipUnskip={onBlockSkipUnskip}\n onNodeAttempt={onNodeAttempt}\n onNodeAttemptLocationChange={onNodeAttemptLocationChange}\n onNodeMarkAsDone={onNodeMarkAsDone}\n onNodeReattempt={onNodeReattempt}\n onNodeReview={onNodeReview}\n onNodeView={onNodeView}\n />\n )}\n </Styled.ContentWrapper>\n );\n});\n\nexport default ChapterDetails;\n"],"names":["ChapterDetails","memo","props","userChapterId","studentId","userType","onBlockSkipUnskip","onNodeAttempt","onNodeAttemptLocationChange","onNodeMarkAsDone","onNodeReattempt","onNodeReview","onNodeView","onExit","getChapterDetails","chapterDetails","isProcessing","isProcessingFailed","isStale","useGetChapterDetails","fetchChapterDetails","useCallback","useEffect","jsxs","FlexView","jsx","Text","Button","AppLoader","Styled.ContentWrapper","Styled.BackButtonContainer","Styled.BackButtonWrapper","IconButton","Back2Icon","Styled.LoaderWrapper","ILLUSTRATIONS","ChapterBanner","BlockSections","ChapterDetails$1"],"mappings":"
|
1
|
+
{"version":3,"file":"chapter-details.js","sources":["../../../../src/features/chapters-v2/chapter-details/chapter-details.tsx"],"sourcesContent":["import type { IChapterDetails } from './chapter-details-types';\nimport type { FC } from 'react';\n\nimport { memo, useCallback, useEffect } from 'react';\n\nimport { ILLUSTRATIONS } from '../../../assets/illustrations/illustrations';\nimport Back2Icon from '../../../assets/line-icons/icons/back2';\nimport { useJourney } from '../../journey/use-journey/use-journey';\nimport Button from '../../ui/buttons/button/button';\nimport IconButton from '../../ui/buttons/icon-button/icon-button';\nimport FlexView from '../../ui/layout/flex-view';\nimport AppLoader from '../../ui/loader/app-loader/app-loader';\nimport Text from '../../ui/text/text';\nimport { useGetChapterDetails } from '../api/chapter';\nimport BlockSections from './block-sections/block-sections';\nimport ChapterBanner from './chapter-banner/chapter-banner';\nimport * as Styled from './chapter-details-styled';\n\nconst ChapterDetails: FC<IChapterDetails> = memo(props => {\n const {\n userChapterId,\n studentId,\n userType,\n onBlockSkipUnskip,\n onNodeAttempt,\n onNodeAttemptLocationChange,\n onNodeMarkAsDone,\n onNodeReattempt,\n onNodeReview,\n onNodeView,\n onExit,\n startChapterPageJourney,\n chapterPageRef,\n bannerRef,\n coreBlocksRef,\n canStartJourney,\n } = props;\n\n const {\n get: getChapterDetails,\n data: chapterDetails,\n isProcessing,\n isProcessingFailed,\n isStale,\n } = useGetChapterDetails();\n\n const fetchChapterDetails = useCallback(() => {\n getChapterDetails(userChapterId, undefined, { studentId });\n }, [getChapterDetails, userChapterId, studentId]);\n\n useEffect(() => {\n fetchChapterDetails();\n }, [fetchChapterDetails]);\n const { isJourneyActive } = useJourney();\n\n useEffect(() => {\n if (chapterDetails) {\n const { progress_stat: progressStat } = chapterDetails;\n const { classwork } = progressStat || {};\n const { completed, total } = classwork || {};\n\n if (\n canStartJourney &&\n completed !== 0 &&\n total === completed &&\n !isJourneyActive &&\n startChapterPageJourney\n ) {\n startChapterPageJourney({\n chapterDetails: chapterDetails,\n studentId,\n userType,\n });\n }\n }\n }, [\n chapterDetails,\n startChapterPageJourney,\n isJourneyActive,\n studentId,\n userType,\n canStartJourney,\n ]);\n\n useEffect(() => {\n if (!isProcessing && isStale) {\n fetchChapterDetails();\n }\n }, [fetchChapterDetails, isProcessing, isStale]);\n\n if (isProcessingFailed) {\n return (\n <FlexView $flexGapX={1.5} $height=\"100vh\" $justifyContent=\"center\" $alignItems=\"center\">\n <Text $renderAs=\"h6\">Oops! Something went wrong. Please try again later.</Text>\n <Button\n widthX={14}\n size=\"small\"\n shape=\"square\"\n renderAs=\"primary\"\n label=\"Try again\"\n onClick={fetchChapterDetails}\n />\n </FlexView>\n );\n }\n\n if (!chapterDetails && isProcessing) {\n return <AppLoader height=\"80vh\" />;\n }\n\n return (\n <Styled.ContentWrapper\n ref={chapterPageRef}\n $widthX={50}\n $disablePointerEvents={isProcessing}\n $justifyContent=\"center\"\n $alignItems=\"center\"\n >\n {userType === 'TEACHER' && (\n <Styled.BackButtonContainer $height=\"100%\">\n <Styled.BackButtonWrapper>\n <IconButton\n Icon={Back2Icon}\n renderAs=\"secondary-gray\"\n analyticsLabel=\"chapter_page_exit\"\n size=\"xsmall\"\n onClick={onExit}\n />\n </Styled.BackButtonWrapper>\n </Styled.BackButtonContainer>\n )}\n\n {isProcessing && (\n <Styled.LoaderWrapper>\n <img src={ILLUSTRATIONS.LOADER_1} alt=\"loader\" />\n </Styled.LoaderWrapper>\n )}\n\n {chapterDetails && (\n <ChapterBanner\n title={chapterDetails.name}\n imageHue={chapterDetails.image_hue}\n imageUrl={chapterDetails.image_url}\n progressStats={chapterDetails?.progress_stat}\n bannerRef={bannerRef}\n />\n )}\n\n {chapterDetails && (\n <BlockSections\n imageHue={chapterDetails.image_hue}\n userType={userType}\n blocks={chapterDetails.blocks}\n onBlockSkipUnskip={onBlockSkipUnskip}\n onNodeAttempt={onNodeAttempt}\n onNodeAttemptLocationChange={onNodeAttemptLocationChange}\n onNodeMarkAsDone={onNodeMarkAsDone}\n onNodeReattempt={onNodeReattempt}\n onNodeReview={onNodeReview}\n onNodeView={onNodeView}\n coreBlocksRef={coreBlocksRef}\n />\n )}\n </Styled.ContentWrapper>\n );\n});\n\nexport default ChapterDetails;\n"],"names":["ChapterDetails","memo","props","userChapterId","studentId","userType","onBlockSkipUnskip","onNodeAttempt","onNodeAttemptLocationChange","onNodeMarkAsDone","onNodeReattempt","onNodeReview","onNodeView","onExit","startChapterPageJourney","chapterPageRef","bannerRef","coreBlocksRef","canStartJourney","getChapterDetails","chapterDetails","isProcessing","isProcessingFailed","isStale","useGetChapterDetails","fetchChapterDetails","useCallback","useEffect","isJourneyActive","useJourney","progressStat","classwork","completed","total","jsxs","FlexView","jsx","Text","Button","AppLoader","Styled.ContentWrapper","Styled.BackButtonContainer","Styled.BackButtonWrapper","IconButton","Back2Icon","Styled.LoaderWrapper","ILLUSTRATIONS","ChapterBanner","BlockSections","ChapterDetails$1"],"mappings":";;;;;;;;;;;;;;AAkBA,MAAMA,IAAsCC,EAAK,CAASC,MAAA;AAClD,QAAA;AAAA,IACJ,eAAAC;AAAA,IACA,WAAAC;AAAA,IACA,UAAAC;AAAA,IACA,mBAAAC;AAAA,IACA,eAAAC;AAAA,IACA,6BAAAC;AAAA,IACA,kBAAAC;AAAA,IACA,iBAAAC;AAAA,IACA,cAAAC;AAAA,IACA,YAAAC;AAAA,IACA,QAAAC;AAAA,IACA,yBAAAC;AAAA,IACA,gBAAAC;AAAA,IACA,WAAAC;AAAA,IACA,eAAAC;AAAA,IACA,iBAAAC;AAAA,EACE,IAAAhB,GAEE;AAAA,IACJ,KAAKiB;AAAA,IACL,MAAMC;AAAA,IACN,cAAAC;AAAA,IACA,oBAAAC;AAAA,IACA,SAAAC;AAAA,MACEC,EAAqB,GAEnBC,IAAsBC,EAAY,MAAM;AAC5C,IAAAP,EAAkBhB,GAAe,QAAW,EAAE,WAAAC,EAAW,CAAA;AAAA,EACxD,GAAA,CAACe,GAAmBhB,GAAeC,CAAS,CAAC;AAEhD,EAAAuB,EAAU,MAAM;AACM,IAAAF;EAAA,GACnB,CAACA,CAAmB,CAAC;AAClB,QAAA,EAAE,iBAAAG,MAAoBC;AAqC5B,SAnCAF,EAAU,MAAM;AACd,QAAIP,GAAgB;AACZ,YAAA,EAAE,eAAeU,EAAiB,IAAAV,GAClC,EAAE,WAAAW,EAAA,IAAcD,KAAgB,IAChC,EAAE,WAAAE,GAAW,OAAAC,MAAUF,KAAa,CAAA;AAE1C,MACEb,KACAc,MAAc,KACdC,MAAUD,KACV,CAACJ,KACDd,KAEwBA,EAAA;AAAA,QACtB,gBAAAM;AAAA,QACA,WAAAhB;AAAA,QACA,UAAAC;AAAA,MAAA,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,UAAA;AAAA,YACC,OAAO3B,EAAe;AAAA,YACtB,UAAUA,EAAe;AAAA,YACzB,UAAUA,EAAe;AAAA,YACzB,eAAeA,KAAA,gBAAAA,EAAgB;AAAA,YAC/B,WAAAJ;AAAA,UAAA;AAAA,QACF;AAAA,QAGDI,KACC,gBAAAgB;AAAA,UAACY;AAAA,UAAA;AAAA,YACC,UAAU5B,EAAe;AAAA,YACzB,UAAAf;AAAA,YACA,QAAQe,EAAe;AAAA,YACvB,mBAAAd;AAAA,YACA,eAAAC;AAAA,YACA,6BAAAC;AAAA,YACA,kBAAAC;AAAA,YACA,iBAAAC;AAAA,YACA,cAAAC;AAAA,YACA,YAAAC;AAAA,YACA,eAAAK;AAAA,UAAA;AAAA,QACF;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAIR,CAAC,GAEDgC,KAAejD;"}
|
@@ -1,18 +1,17 @@
|
|
1
1
|
import t from "styled-components";
|
2
2
|
import d from "../../../../assets/line-icons/icons/important.js";
|
3
|
-
import
|
3
|
+
import l from "../../../../assets/line-icons/icons/lock2.js";
|
4
4
|
import e from "../../../ui/layout/flex-view.js";
|
5
|
-
import
|
6
|
-
const
|
5
|
+
import c from "../../../ui/text/text.js";
|
6
|
+
const m = t(e)(({
|
7
7
|
$showOutline: o,
|
8
8
|
theme: r,
|
9
9
|
$disabled: n,
|
10
|
-
$isSheetLocked:
|
10
|
+
$isSheetLocked: a
|
11
11
|
}) => {
|
12
|
-
const { BLACK_1: p, BLACK:
|
12
|
+
const { BLACK_1: p, BLACK: s, BLACK_T_15: i } = r.colors;
|
13
13
|
return `
|
14
14
|
cursor: ${n ? "not-allowed" : "pointer"};
|
15
|
-
${n ? "pointer-events: none;" : "pointer-events: auto;"};
|
16
15
|
position: relative;
|
17
16
|
border-image: linear-gradient(to right, ${i} 0%, ${i} 100%);
|
18
17
|
${o && `outline: 1px solid ${i};`};
|
@@ -36,7 +35,7 @@ const f = t(e)(({
|
|
36
35
|
|
37
36
|
.node-card-border > .border-path-animation {
|
38
37
|
fill: none;
|
39
|
-
stroke: ${
|
38
|
+
stroke: ${s};
|
40
39
|
stroke-width: 1.5;
|
41
40
|
//* view box size 170 + 56 + 170 + 56 = 452
|
42
41
|
//* 452 / 2 = 226
|
@@ -61,7 +60,7 @@ const f = t(e)(({
|
|
61
60
|
}
|
62
61
|
`}
|
63
62
|
|
64
|
-
${o && !
|
63
|
+
${o && !a && `outline: 1px solid ${s};`};
|
65
64
|
}
|
66
65
|
`;
|
67
66
|
}), g = t(d)(({ theme: o }) => {
|
@@ -73,41 +72,48 @@ const f = t(e)(({
|
|
73
72
|
top: -2.5px;
|
74
73
|
right: -2.5px;
|
75
74
|
`;
|
76
|
-
}),
|
75
|
+
}), $ = t(e)(({ $bgImage: o }) => `
|
77
76
|
background-image: url(${o});
|
78
77
|
|
79
78
|
& .context-menu {
|
80
79
|
justify-self: flex-end;
|
81
80
|
margin-left: auto;
|
82
81
|
}
|
83
|
-
`),
|
82
|
+
`), k = t(e)`
|
84
83
|
border-radius: 50%;
|
85
|
-
`,
|
84
|
+
`, w = t(e)(() => `
|
86
85
|
position: relative;
|
87
86
|
padding: 12px 8px 12px 12px;
|
88
|
-
`),
|
87
|
+
`), I = t(e)(({ $top: o, $right: r }) => `
|
89
88
|
position: absolute;
|
90
89
|
top: ${o ?? 0}px;
|
91
90
|
right: ${r ?? 0}px;
|
92
91
|
z-index: 3;
|
93
92
|
`);
|
94
|
-
t(
|
93
|
+
t(l)(({}) => `
|
95
94
|
width: 28px;
|
96
95
|
height: 28px;
|
97
96
|
`);
|
98
|
-
const
|
99
|
-
|
97
|
+
const v = t(e)(({
|
98
|
+
theme: o,
|
99
|
+
$paddingRight: r,
|
100
|
+
$paddingLeft: n
|
101
|
+
}) => {
|
102
|
+
const { BLACK_1: a, WHITE_1: p } = o.colors;
|
100
103
|
return `
|
101
104
|
position: absolute;
|
102
105
|
top: -10px;
|
103
106
|
right: -10px;
|
104
|
-
|
107
|
+
padding: 0px;
|
108
|
+
padding-left: ${n}px;
|
109
|
+
padding-right: ${r}px;
|
110
|
+
background: ${a};
|
105
111
|
|
106
112
|
path {
|
107
|
-
fill: ${
|
113
|
+
fill: ${p};
|
108
114
|
}
|
109
115
|
`;
|
110
|
-
}), y = t(
|
116
|
+
}), y = t(c)(() => `
|
111
117
|
display: -webkit-box;
|
112
118
|
-webkit-box-orient: vertical;
|
113
119
|
-webkit-line-clamp: 2;
|
@@ -139,15 +145,15 @@ const I = t(e)(({ theme: o }) => {
|
|
139
145
|
}
|
140
146
|
`);
|
141
147
|
export {
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
148
|
+
k as IconWrapper,
|
149
|
+
v as InProgressIconWrapper,
|
150
|
+
m as NodeCardContainer,
|
151
|
+
w as NodeCardContentWrapper,
|
152
|
+
$ as NodeCardInfoWrapper,
|
147
153
|
y as NodeCardTitle,
|
148
154
|
C as NodeKebabMenuWrapper,
|
149
155
|
W as NodeMenuOptionsWrapper,
|
150
|
-
|
156
|
+
I as SheetTagWrapper,
|
151
157
|
g as StyledImportantIcon
|
152
158
|
};
|
153
159
|
//# sourceMappingURL=node-card-styled.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"node-card-styled.js","sources":["../../../../../src/features/chapters-v2/comps/node-card/node-card-styled.tsx"],"sourcesContent":["import styled from 'styled-components';\n\nimport ImportantIcon from '../../../../assets/line-icons/icons/important';\nimport Lock2Icon from '../../../../assets/line-icons/icons/lock2';\nimport FlexView from '../../../ui/layout/flex-view';\nimport Text from '../../../ui/text/text';\n\ninterface INodeCardContainer {\n $showOutline?: boolean;\n $disabled: boolean;\n $isSheetLocked?: boolean;\n}\n\nconst NodeCardContainer = styled(FlexView)<INodeCardContainer>(({\n $showOutline,\n theme,\n $disabled,\n $isSheetLocked,\n}) => {\n const { BLACK_1, BLACK, BLACK_T_15 } = theme.colors;\n\n return `\n cursor: ${$disabled ? 'not-allowed' : 'pointer'};\n
|
1
|
+
{"version":3,"file":"node-card-styled.js","sources":["../../../../../src/features/chapters-v2/comps/node-card/node-card-styled.tsx"],"sourcesContent":["import styled from 'styled-components';\n\nimport ImportantIcon from '../../../../assets/line-icons/icons/important';\nimport Lock2Icon from '../../../../assets/line-icons/icons/lock2';\nimport FlexView from '../../../ui/layout/flex-view';\nimport Text from '../../../ui/text/text';\n\ninterface INodeCardContainer {\n $showOutline?: boolean;\n $disabled: boolean;\n $isSheetLocked?: boolean;\n}\n\nconst NodeCardContainer = styled(FlexView)<INodeCardContainer>(({\n $showOutline,\n theme,\n $disabled,\n $isSheetLocked,\n}) => {\n const { BLACK_1, BLACK, BLACK_T_15 } = theme.colors;\n\n return `\n cursor: ${$disabled ? 'not-allowed' : 'pointer'};\n position: relative;\n border-image: linear-gradient(to right, ${BLACK_T_15} 0%, ${BLACK_T_15} 100%);\n ${$showOutline && `outline: 1px solid ${BLACK_T_15};`};\n\n .node-card-border {\n position: absolute;\n top: 0;\n left: 0;\n z-index: 2;\n width: 100%;\n height: 100%;\n pointer-events: none;\n background: transparent;\n }\n\n .node-card-border > .border-path {\n fill: none;\n stroke: ${BLACK_T_15};\n stroke-width: 1.5;\n }\n\n .node-card-border > .border-path-animation {\n fill: none;\n stroke: ${BLACK};\n stroke-width: 1.5;\n //* view box size 170 + 56 + 170 + 56 = 452\n //* 452 / 2 = 226\n stroke-dasharray: 226 226;\n stroke-dashoffset: 0;\n\n animation: dashmove 6s linear infinite;\n }\n \n @keyframes dashmove {\n to {\n stroke-dashoffset: -900;\n }\n }\n \n &:hover {\n ${\n !$disabled &&\n `\n .node-card-border > .border-path-animation {\n stroke: ${BLACK_1};\n stroke-dasharray: 452;\n animation: none;\n }\n `\n }\n\n ${$showOutline && !$isSheetLocked && `outline: 1px solid ${BLACK};`};\n }\n `;\n});\n\nconst StyledImportantIcon = styled(ImportantIcon)(({ theme }) => {\n const { layout } = theme;\n\n return `\n width: ${layout.gutter * 0.75}px;\n height: ${layout.gutter * 0.75}px;\n position: absolute;\n top: -2.5px;\n right: -2.5px;\n `;\n});\n\ninterface INodeCardInfoWrapper {\n $bgImage: string;\n}\n\nconst NodeCardInfoWrapper = styled(FlexView)<INodeCardInfoWrapper>(({ $bgImage }) => {\n return `\n background-image: url(${$bgImage});\n\n & .context-menu {\n justify-self: flex-end;\n margin-left: auto;\n }\n `;\n});\n\nconst IconWrapper = styled(FlexView)`\n border-radius: 50%;\n`;\n\nconst NodeCardContentWrapper = styled(FlexView)(() => {\n return `\n position: relative;\n padding: 12px 8px 12px 12px;\n `;\n});\n\ninterface ISheetTagWrapper {\n $top?: number;\n $right?: number;\n}\n\nconst SheetTagWrapper = styled(FlexView)<ISheetTagWrapper>(({ $top, $right }) => {\n return `\n position: absolute;\n top: ${$top ?? 0}px;\n right: ${$right ?? 0}px;\n z-index: 3;\n`;\n});\n\nconst StyledLockIcon = styled(Lock2Icon)(({}) => {\n return `\n width: 28px;\n height: 28px;\n `;\n});\n\nconst InProgressIconWrapper = styled(FlexView)<{ $paddingRight: number; $paddingLeft: number }>(({\n theme,\n $paddingRight,\n $paddingLeft,\n}) => {\n const { BLACK_1, WHITE_1 } = theme.colors;\n\n return `\n position: absolute;\n top: -10px;\n right: -10px;\n padding: 0px;\n padding-left: ${$paddingLeft}px;\n padding-right: ${$paddingRight}px;\n background: ${BLACK_1};\n\n path {\n fill: ${WHITE_1};\n }\n `;\n});\n\nconst NodeCardTitle = styled(Text)(() => {\n return `\n display: -webkit-box;\n -webkit-box-orient: vertical;\n -webkit-line-clamp: 2;\n text-overflow: ellipsis;\n overflow: hidden;\n `;\n});\n\nconst NodeKebabMenuWrapper = styled(FlexView)(({ theme }) => {\n return `\n cursor: pointer;\n \n &:hover {\n border-radius: 50%;\n background: ${theme.colors.WHITE_5}; \n }\n `;\n});\n\ninterface INodeOptionsMenuWrapper {\n $visible: boolean;\n}\n\nconst NodeMenuOptionsWrapper = styled(FlexView)<INodeOptionsMenuWrapper>(({ theme, $visible }) => {\n return `\n cursor: pointer;\n\n position: absolute;\n z-index: 6;\n top: calc(100% + 4px);\n left: 0;\n\n transform-origin: top;\n transform: scaleY(${$visible ? 1 : 0});\n opacity: ${$visible ? 1 : 0};\n transition: transform 0.2s ease-in-out, opacity 0.2s ease-in-out;\n \n &:hover {\n border-radius: 50%;\n background: ${theme.colors.WHITE_5}; \n }\n `;\n});\n\nexport {\n NodeCardContainer,\n StyledImportantIcon,\n NodeCardInfoWrapper,\n IconWrapper,\n NodeCardContentWrapper,\n SheetTagWrapper,\n StyledLockIcon,\n InProgressIconWrapper,\n NodeCardTitle,\n NodeKebabMenuWrapper,\n NodeMenuOptionsWrapper,\n};\n"],"names":["NodeCardContainer","styled","FlexView","$showOutline","theme","$disabled","$isSheetLocked","BLACK_1","BLACK","BLACK_T_15","StyledImportantIcon","ImportantIcon","layout","NodeCardInfoWrapper","$bgImage","IconWrapper","NodeCardContentWrapper","SheetTagWrapper","$top","$right","Lock2Icon","InProgressIconWrapper","$paddingRight","$paddingLeft","WHITE_1","NodeCardTitle","Text","NodeKebabMenuWrapper","NodeMenuOptionsWrapper","$visible"],"mappings":";;;;;AAaA,MAAMA,IAAoBC,EAAOC,CAAQ,EAAsB,CAAC;AAAA,EAC9D,cAAAC;AAAA,EACA,OAAAC;AAAA,EACA,WAAAC;AAAA,EACA,gBAAAC;AACF,MAAM;AACJ,QAAM,EAAE,SAAAC,GAAS,OAAAC,GAAO,YAAAC,EAAA,IAAeL,EAAM;AAEtC,SAAA;AAAA,cACKC,IAAY,gBAAgB,SAAS;AAAA;AAAA,8CAELI,CAAU,QAAQA,CAAU;AAAA,MACpEN,KAAgB,sBAAsBM,CAAU,GAAG;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,gBAezCA,CAAU;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,gBAMVD,CAAK;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAA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AAE,MAC1B;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,GAOR,GAEKC,IAAuB1B,EAAOC,CAAQ,EAAE,CAAC,EAAE,OAAAE,QACxC;AAAA;AAAA;AAAA;AAAA;AAAA,oBAKWA,EAAM,OAAO,OAAO;AAAA;AAAA,GAGvC,GAMKwB,IAAyB3B,EAAOC,CAAQ,EAA2B,CAAC,EAAE,OAAAE,GAAO,UAAAyB,QAC1E;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,wBASeA,IAAW,IAAI,CAAC;AAAA,eACzBA,IAAW,IAAI,CAAC;AAAA;AAAA;AAAA;AAAA;AAAA,oBAKXzB,EAAM,OAAO,OAAO;AAAA;AAAA,GAGvC;"}
|
@@ -66,8 +66,8 @@ const we = Y((b) => {
|
|
66
66
|
r,
|
67
67
|
s
|
68
68
|
]), X = m(() => {
|
69
|
-
O(!0);
|
70
|
-
}, []), j = m(() => {
|
69
|
+
r || O(!0);
|
70
|
+
}, [r]), j = m(() => {
|
71
71
|
O(!1);
|
72
72
|
}, []), z = [
|
73
73
|
{
|
@@ -137,7 +137,7 @@ const we = Y((b) => {
|
|
137
137
|
/* @__PURE__ */ d(ee, { $renderAs: "ac4-black", $color: "BLACK", children: [
|
138
138
|
y,
|
139
139
|
" ",
|
140
|
-
M && "
|
140
|
+
M && "• CW"
|
141
141
|
] }),
|
142
142
|
_ && /* @__PURE__ */ e(ne, {})
|
143
143
|
]
|
@@ -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 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,CAAQ,GAC9C,EAAE,MAAM2B,GAAc,QAAQC,MAAmBC,GAAqB7B,CAAQ,GAE9E8B,IAA0BC;AAAA,IAC9B,CAACC,MAAqB;AACpB,cAAQA,GAAU;AAAA,QAChB,KAAK;AACH,UAAAzB,IAA2BX,KAAA,QAAAA,EAAaN,KAAYK,KAAA,QAAAA,EAAeL;AAEnE;AAAA,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AA,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 if (sheetLocked) return;\n setRenderLottie(true);\n }, [sheetLocked]);\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;A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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,IAAA,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,gBAEA,gBAAAV;AAAA,kBAACW;AAAA,kBAAA;AAAA,oBACC,UAAAlD;AAAA,oBACA,OAAAG;AAAA,oBACA,UAAAL;AAAA,oBACA,WAAAD;AAAA,kBAAA;AAAA,gBACF;AAAA,gBAEC,CAACe,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,4 +1,4 @@
|
|
1
|
-
import { jsxs as
|
1
|
+
import { jsxs as o, jsx as e } from "react/jsx-runtime";
|
2
2
|
import { memo as U, useState as Y, useRef as q, useCallback as f } from "react";
|
3
3
|
import J from "../../../../../assets/line-icons/icons/check2.js";
|
4
4
|
import Q from "../../../../../assets/line-icons/icons/eye2.js";
|
@@ -23,10 +23,10 @@ const { ASSIGN_AS_HW: Ce, REVIEW: _e, VIEW: Ie, MARK_AS_DONE: ge } = ie, Pe = U(
|
|
23
23
|
imageHue: A,
|
24
24
|
blockType: L,
|
25
25
|
isSkipped: $,
|
26
|
-
onNodeAttemptLocationChange:
|
27
|
-
onNodeMarkAsDone:
|
28
|
-
onNodeView:
|
29
|
-
onNodeReview:
|
26
|
+
onNodeAttemptLocationChange: i,
|
27
|
+
onNodeMarkAsDone: n,
|
28
|
+
onNodeView: a,
|
29
|
+
onNodeReview: c
|
30
30
|
}) => {
|
31
31
|
const [w, C] = Y(!1), l = q(null), { menuVisible: x, onMenuClick: _ } = D(l), {
|
32
32
|
accuracy: y,
|
@@ -34,7 +34,7 @@ const { ASSIGN_AS_HW: Ce, REVIEW: _e, VIEW: Ie, MARK_AS_DONE: ge } = ie, Pe = U(
|
|
34
34
|
node_type: d,
|
35
35
|
card_header: B,
|
36
36
|
title: M,
|
37
|
-
state:
|
37
|
+
state: s,
|
38
38
|
is_optional: I,
|
39
39
|
sheet_statement: g,
|
40
40
|
permissions: H,
|
@@ -43,17 +43,17 @@ const { ASSIGN_AS_HW: Ce, REVIEW: _e, VIEW: Ie, MARK_AS_DONE: ge } = ie, Pe = U(
|
|
43
43
|
can_change_attempt_location: G,
|
44
44
|
can_mark_familiar: K,
|
45
45
|
can_review: p
|
46
|
-
} = H, b = L === oe.GOAL,
|
46
|
+
} = H, b = L === oe.GOAL, r = s === u.LOCKED, R = s === u.NOT_STARTED, j = s === u.IN_PROGRESS, E = W === "INCLASS", S = !I && (j || R), P = ne(d), { icon: X, lottie: v } = ae(d), h = f(
|
47
47
|
(k) => {
|
48
48
|
switch (k) {
|
49
49
|
case "node-card-view":
|
50
|
-
p && m ?
|
50
|
+
p && m ? c == null || c(t) : a == null || a(t);
|
51
51
|
return;
|
52
52
|
case "node-card-assign-as-hw":
|
53
|
-
|
53
|
+
i == null || i(t);
|
54
54
|
return;
|
55
55
|
case "node-card-mark-as-done":
|
56
|
-
|
56
|
+
n == null || n(t);
|
57
57
|
return;
|
58
58
|
default:
|
59
59
|
throw new Error(`No callback function for ${k}`);
|
@@ -62,15 +62,15 @@ const { ASSIGN_AS_HW: Ce, REVIEW: _e, VIEW: Ie, MARK_AS_DONE: ge } = ie, Pe = U(
|
|
62
62
|
[
|
63
63
|
p,
|
64
64
|
t,
|
65
|
-
o,
|
66
65
|
i,
|
67
|
-
a,
|
68
66
|
n,
|
67
|
+
c,
|
68
|
+
a,
|
69
69
|
m
|
70
70
|
]
|
71
71
|
), F = f(() => {
|
72
|
-
C(!0);
|
73
|
-
}, []), z = f(() => {
|
72
|
+
r || C(!0);
|
73
|
+
}, [r]), z = f(() => {
|
74
74
|
C(!1);
|
75
75
|
}, []), N = [
|
76
76
|
{
|
@@ -95,17 +95,17 @@ const { ASSIGN_AS_HW: Ce, REVIEW: _e, VIEW: Ie, MARK_AS_DONE: ge } = ie, Pe = U(
|
|
95
95
|
onClick: h
|
96
96
|
}
|
97
97
|
];
|
98
|
-
return /* @__PURE__ */
|
98
|
+
return /* @__PURE__ */ o(
|
99
99
|
se,
|
100
100
|
{
|
101
101
|
$showOutline: !S,
|
102
|
-
$isSheetLocked:
|
102
|
+
$isSheetLocked: r,
|
103
103
|
$background: `${A}_2`,
|
104
104
|
$disabled: !!$,
|
105
105
|
onMouseEnter: F,
|
106
106
|
onMouseLeave: z,
|
107
107
|
children: [
|
108
|
-
/* @__PURE__ */
|
108
|
+
/* @__PURE__ */ o(
|
109
109
|
Z,
|
110
110
|
{
|
111
111
|
renderAs: "primary",
|
@@ -116,7 +116,7 @@ const { ASSIGN_AS_HW: Ce, REVIEW: _e, VIEW: Ie, MARK_AS_DONE: ge } = ie, Pe = U(
|
|
116
116
|
parentWidth: "100%",
|
117
117
|
widthX: 11.25,
|
118
118
|
children: [
|
119
|
-
/* @__PURE__ */
|
119
|
+
/* @__PURE__ */ o(
|
120
120
|
le,
|
121
121
|
{
|
122
122
|
$flexDirection: "row",
|
@@ -127,7 +127,7 @@ const { ASSIGN_AS_HW: Ce, REVIEW: _e, VIEW: Ie, MARK_AS_DONE: ge } = ie, Pe = U(
|
|
127
127
|
$gutterX: 0.78125,
|
128
128
|
$flexGap: 8.5,
|
129
129
|
children: [
|
130
|
-
/* @__PURE__ */
|
130
|
+
/* @__PURE__ */ o(
|
131
131
|
de,
|
132
132
|
{
|
133
133
|
$width: 31,
|
@@ -136,25 +136,25 @@ const { ASSIGN_AS_HW: Ce, REVIEW: _e, VIEW: Ie, MARK_AS_DONE: ge } = ie, Pe = U(
|
|
136
136
|
$position: "relative",
|
137
137
|
$alignItems: "center",
|
138
138
|
$justifyContent: "center",
|
139
|
-
$opacity:
|
139
|
+
$opacity: r ? 0.5 : 1,
|
140
140
|
children: [
|
141
141
|
w ? /* @__PURE__ */ e(te, { src: v }) : /* @__PURE__ */ e(X, { width: 20, height: 20 }),
|
142
142
|
!I && /* @__PURE__ */ e(me, {})
|
143
143
|
]
|
144
144
|
}
|
145
145
|
),
|
146
|
-
/* @__PURE__ */
|
146
|
+
/* @__PURE__ */ o(re, { $renderAs: "ac4-black", $color: "BLACK", $opacity: r ? 0.5 : 1, children: [
|
147
147
|
B,
|
148
148
|
" ",
|
149
|
-
E && "
|
149
|
+
E && "• CW"
|
150
150
|
] }),
|
151
151
|
/* @__PURE__ */ e(ee, { className: "context-menu", children: b && /* @__PURE__ */ e(T, { ref: l, onClick: _, children: /* @__PURE__ */ e(O, { width: 16, height: 16 }) }) }),
|
152
152
|
S && !$ && /* @__PURE__ */ e(ce, {})
|
153
153
|
]
|
154
154
|
}
|
155
155
|
),
|
156
|
-
/* @__PURE__ */ e(ue, { nodeType: d, state:
|
157
|
-
!b && /* @__PURE__ */
|
156
|
+
/* @__PURE__ */ e(ue, { nodeType: d, state: s, accuracy: y }),
|
157
|
+
!b && /* @__PURE__ */ o(
|
158
158
|
pe,
|
159
159
|
{
|
160
160
|
$flexDirection: "row",
|
@@ -169,7 +169,7 @@ const { ASSIGN_AS_HW: Ce, REVIEW: _e, VIEW: Ie, MARK_AS_DONE: ge } = ie, Pe = U(
|
|
169
169
|
{
|
170
170
|
$renderAs: "ab3",
|
171
171
|
$color: "BLACK_1",
|
172
|
-
$opacity:
|
172
|
+
$opacity: r ? 0.5 : 1,
|
173
173
|
children: M
|
174
174
|
}
|
175
175
|
),
|