@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
@@ -0,0 +1,194 @@
|
|
1
|
+
import { jsx as e, jsxs as a } from "react/jsx-runtime";
|
2
|
+
import { useRef as n, useCallback as B, useMemo as L, useEffect as N } from "react";
|
3
|
+
import y from "../../chapters-v2/chapter-details/chapter-banner/chapter-banner.js";
|
4
|
+
import I from "../../chapters-v2/chapter-details/chapter-details.js";
|
5
|
+
import c from "../../ui/buttons/button/button.js";
|
6
|
+
import d from "../../ui/layout/flex-view.js";
|
7
|
+
import m from "../../ui/text/text.js";
|
8
|
+
import { JOURNEY_ID_STUDENT as S } from "../journey-id/journey-id-student.js";
|
9
|
+
import { IndicatorType as p } from "../use-journey/constants.js";
|
10
|
+
import { useJourney as _ } from "../use-journey/use-journey.js";
|
11
|
+
const Y = () => {
|
12
|
+
const o = S.CHAPTER_PAGE_JOURNEY, t = n(null), r = n(null), u = n(null), s = n([]), { nextCoachmark: i, setJourney: h, endJourney: g } = _(), C = B(
|
13
|
+
({ chapterDetails: l, studentId: R, userType: E }) => {
|
14
|
+
const {
|
15
|
+
progress_stat: f,
|
16
|
+
name: A,
|
17
|
+
image_hue: T,
|
18
|
+
image_url: w
|
19
|
+
// blocks,
|
20
|
+
} = l;
|
21
|
+
if (!(t != null && t.current) || !(r != null && r.current) || !u.current)
|
22
|
+
return;
|
23
|
+
const k = t.current.getBoundingClientRect(), O = [
|
24
|
+
{
|
25
|
+
originalElementToHighlightRef: t,
|
26
|
+
isActive: !1,
|
27
|
+
type: p.TOOLTIP,
|
28
|
+
elementToHighlight: /* @__PURE__ */ e(
|
29
|
+
I,
|
30
|
+
{
|
31
|
+
userChapterId: l.id,
|
32
|
+
studentId: R,
|
33
|
+
userType: E,
|
34
|
+
onBlockSkipUnskip: () => null,
|
35
|
+
onNodeAttempt: () => null,
|
36
|
+
onNodeAttemptLocationChange: () => null,
|
37
|
+
onNodeMarkAsDone: () => null,
|
38
|
+
onNodeReattempt: () => null,
|
39
|
+
onNodeReview: () => null,
|
40
|
+
onNodeView: () => null,
|
41
|
+
onExit: () => null
|
42
|
+
}
|
43
|
+
),
|
44
|
+
indicator: {
|
45
|
+
position: "left",
|
46
|
+
tooltipYCoOrdinates: -(k.height / 2) + 178,
|
47
|
+
backgroundColor: "BLUE_4",
|
48
|
+
borderColor: "BLACK",
|
49
|
+
arrowColor: "BLACK",
|
50
|
+
arrowSize: 12,
|
51
|
+
width: 264,
|
52
|
+
tooltipItem: /* @__PURE__ */ a(d, { $flexRowGapX: 0.75, children: [
|
53
|
+
/* @__PURE__ */ e(m, { $renderAs: "ab2-bold", children: "Welcome to the all new chapter experience." }),
|
54
|
+
/* @__PURE__ */ e(
|
55
|
+
c,
|
56
|
+
{
|
57
|
+
label: "Next",
|
58
|
+
size: "xsmall",
|
59
|
+
widthX: 6,
|
60
|
+
renderAs: "secondary",
|
61
|
+
onClick: () => i(o, !1, 0, !0)
|
62
|
+
}
|
63
|
+
)
|
64
|
+
] })
|
65
|
+
}
|
66
|
+
},
|
67
|
+
{
|
68
|
+
originalElementToHighlightRef: r,
|
69
|
+
elementToHighlight: /* @__PURE__ */ e(
|
70
|
+
y,
|
71
|
+
{
|
72
|
+
title: A,
|
73
|
+
progressStats: f,
|
74
|
+
imageUrl: w,
|
75
|
+
imageHue: T
|
76
|
+
}
|
77
|
+
),
|
78
|
+
type: p.TOOLTIP,
|
79
|
+
indicator: {
|
80
|
+
position: "bottom",
|
81
|
+
tooltipXCoOrdinates: -45,
|
82
|
+
tooltipYCoOrdinates: -40,
|
83
|
+
backgroundColor: "ORANGE_4",
|
84
|
+
borderColor: "BLACK",
|
85
|
+
arrowColor: "BLACK",
|
86
|
+
width: 264,
|
87
|
+
arrowSize: 12,
|
88
|
+
tooltipItem: /* @__PURE__ */ a(d, { $flexRowGapX: 0.75, children: [
|
89
|
+
/* @__PURE__ */ e(m, { $renderAs: "ab2-bold", children: "A chapter is divided into *core sheets (compulsory), and supplementary sheets." }),
|
90
|
+
/* @__PURE__ */ e(
|
91
|
+
c,
|
92
|
+
{
|
93
|
+
label: "Next",
|
94
|
+
size: "xsmall",
|
95
|
+
widthX: 6,
|
96
|
+
renderAs: "secondary",
|
97
|
+
onClick: () => i(o, !1, 0, !0)
|
98
|
+
}
|
99
|
+
)
|
100
|
+
] })
|
101
|
+
},
|
102
|
+
isActive: !1
|
103
|
+
},
|
104
|
+
{
|
105
|
+
originalElementToHighlightRef: r,
|
106
|
+
elementToHighlight: /* @__PURE__ */ e(
|
107
|
+
y,
|
108
|
+
{
|
109
|
+
title: A,
|
110
|
+
progressStats: f,
|
111
|
+
imageUrl: w,
|
112
|
+
imageHue: T
|
113
|
+
}
|
114
|
+
),
|
115
|
+
type: p.TOOLTIP,
|
116
|
+
indicator: {
|
117
|
+
position: "bottom",
|
118
|
+
tooltipXCoOrdinates: -275,
|
119
|
+
tooltipYCoOrdinates: -15,
|
120
|
+
backgroundColor: "PURPLE_4",
|
121
|
+
borderColor: "BLACK",
|
122
|
+
arrowColor: "BLACK",
|
123
|
+
arrowSize: 12,
|
124
|
+
width: 264,
|
125
|
+
tooltipItem: /* @__PURE__ */ a(d, { $flexRowGapX: 0.75, children: [
|
126
|
+
/* @__PURE__ */ e(m, { $renderAs: "ab2-bold", children: "Easily track the progress of the core sheets." }),
|
127
|
+
/* @__PURE__ */ e(
|
128
|
+
c,
|
129
|
+
{
|
130
|
+
label: "Got it",
|
131
|
+
size: "xsmall",
|
132
|
+
widthX: 6,
|
133
|
+
renderAs: "secondary",
|
134
|
+
onClick: () => g(o)
|
135
|
+
}
|
136
|
+
)
|
137
|
+
] })
|
138
|
+
},
|
139
|
+
isActive: !1
|
140
|
+
}
|
141
|
+
// {
|
142
|
+
// originalElementToHighlightRef: coreBlocksRef,
|
143
|
+
// elementToHighlight: <BlockSections userType={userType} blocks={blocks} imageHue="BLUE" />,
|
144
|
+
// type: IndicatorType.TOOLTIP,
|
145
|
+
// indicator: {
|
146
|
+
// position: 'top',
|
147
|
+
// tooltipXCoOrdinates: -35,
|
148
|
+
// tooltipYCoOrdinates: -7,
|
149
|
+
// backgroundColor: 'PURPLE_4',
|
150
|
+
// borderColor: 'BLACK',
|
151
|
+
// arrowColor: 'BLACK',
|
152
|
+
// arrowXCoOrdinates: -97,
|
153
|
+
// arrowSize: 12,
|
154
|
+
// width: 264,
|
155
|
+
// tooltipItem: (
|
156
|
+
// <FlexView $flexRowGapX={0.75}>
|
157
|
+
// <Text $renderAs="ab2-bold">Easily track the progress of the core sheets.</Text>
|
158
|
+
// <Button
|
159
|
+
// label="Next"
|
160
|
+
// size="xsmall"
|
161
|
+
// widthX={6}
|
162
|
+
// renderAs="secondary"
|
163
|
+
// onClick={() => endJourney(journeyId)}
|
164
|
+
// />
|
165
|
+
// </FlexView>
|
166
|
+
// ),
|
167
|
+
// } as IArrowTooltipProps,
|
168
|
+
// isActive: false,
|
169
|
+
// },
|
170
|
+
];
|
171
|
+
h(o, O);
|
172
|
+
const b = setTimeout(() => {
|
173
|
+
clearTimeout(b), i(o, !1, 0, !0);
|
174
|
+
}, 200);
|
175
|
+
s.current.push(b);
|
176
|
+
},
|
177
|
+
[h, o, i, g]
|
178
|
+
), x = L(
|
179
|
+
() => ({
|
180
|
+
chapterPageRef: t,
|
181
|
+
bannerRef: r,
|
182
|
+
coreBlocksRef: u,
|
183
|
+
startJourney: C
|
184
|
+
}),
|
185
|
+
[C]
|
186
|
+
);
|
187
|
+
return N(() => () => {
|
188
|
+
s.current.forEach((l) => clearTimeout(l)), s.current = [];
|
189
|
+
}, []), x;
|
190
|
+
};
|
191
|
+
export {
|
192
|
+
Y as useChapterPageJourney
|
193
|
+
};
|
194
|
+
//# sourceMappingURL=use-chapter-journey.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"use-chapter-journey.js","sources":["../../../../src/features/journey/hooks/use-chapter-journey.tsx"],"sourcesContent":["import type { IUserChapterData } from '../../chapters-v2/chapter-details/chapter-details-types';\nimport type { IArrowTooltipProps } from '../../ui/arrow-tooltip/arrow-tooltip-types';\nimport type { ICoachmarkProps } from '../use-journey/journey-context-types';\n\nimport { useCallback, useEffect, useMemo, useRef } from 'react';\n\nimport ChapterBanner from '../../chapters-v2/chapter-details/chapter-banner/chapter-banner';\nimport ChapterDetails from '../../chapters-v2/chapter-details/chapter-details';\nimport Button from '../../ui/buttons/button/button';\nimport FlexView from '../../ui/layout/flex-view';\nimport Text from '../../ui/text/text';\nimport { JOURNEY_ID_STUDENT } from '../journey-id/journey-id-student';\nimport { IndicatorType } from '../use-journey/constants';\nimport { useJourney } from '../use-journey/use-journey';\n\ninterface IChapterStartJourneyProps {\n chapterDetails: IUserChapterData;\n studentId: string;\n userType: 'STUDENT' | 'TEACHER';\n}\n\nexport const useChapterPageJourney = () => {\n const journeyId = JOURNEY_ID_STUDENT.CHAPTER_PAGE_JOURNEY;\n\n const chapterPageRef = useRef<HTMLDivElement>(null);\n const bannerRef = useRef<HTMLDivElement>(null);\n const coreBlocksRef = useRef<HTMLDivElement>(null);\n const timerRefs = useRef<ReturnType<typeof setTimeout>[]>([]);\n const { nextCoachmark, setJourney, endJourney } = useJourney();\n\n const startJourney = useCallback(\n ({ chapterDetails, studentId, userType }: IChapterStartJourneyProps) => {\n // const isStudent = userType === 'STUDENT';\n\n const {\n progress_stat: progressStat,\n name,\n image_hue: imageHue,\n image_url: imageUrl,\n // blocks,\n } = chapterDetails;\n\n if (!chapterPageRef?.current || !bannerRef?.current || !coreBlocksRef.current) {\n return;\n }\n\n const chapterPageRect = chapterPageRef.current.getBoundingClientRect();\n\n const chapterPageSteps: ICoachmarkProps[] = [\n {\n originalElementToHighlightRef: chapterPageRef,\n isActive: false,\n type: IndicatorType.TOOLTIP,\n elementToHighlight: (\n <ChapterDetails\n userChapterId={chapterDetails.id}\n studentId={studentId}\n userType={userType}\n onBlockSkipUnskip={() => null}\n onNodeAttempt={() => null}\n onNodeAttemptLocationChange={() => null}\n onNodeMarkAsDone={() => null}\n onNodeReattempt={() => null}\n onNodeReview={() => null}\n onNodeView={() => null}\n onExit={() => null}\n />\n ),\n indicator: {\n position: 'left',\n tooltipYCoOrdinates: -(chapterPageRect.height / 2) + 178,\n backgroundColor: 'BLUE_4',\n borderColor: 'BLACK',\n arrowColor: 'BLACK',\n arrowSize: 12,\n width: 264,\n tooltipItem: (\n <FlexView $flexRowGapX={0.75}>\n <Text $renderAs=\"ab2-bold\">Welcome to the all new chapter experience.</Text>\n <Button\n label=\"Next\"\n size=\"xsmall\"\n widthX={6}\n renderAs=\"secondary\"\n onClick={() => nextCoachmark(journeyId, false, 0, true)}\n />\n </FlexView>\n ),\n } as IArrowTooltipProps,\n },\n {\n originalElementToHighlightRef: bannerRef,\n elementToHighlight: (\n <ChapterBanner\n title={name}\n progressStats={progressStat}\n imageUrl={imageUrl}\n imageHue={imageHue}\n />\n ),\n type: IndicatorType.TOOLTIP,\n indicator: {\n position: 'bottom',\n tooltipXCoOrdinates: -45,\n tooltipYCoOrdinates: -40,\n backgroundColor: 'ORANGE_4',\n borderColor: 'BLACK',\n arrowColor: 'BLACK',\n width: 264,\n arrowSize: 12,\n tooltipItem: (\n <FlexView $flexRowGapX={0.75}>\n <Text $renderAs=\"ab2-bold\">\n A chapter is divided into *core sheets (compulsory), and supplementary sheets.\n </Text>\n <Button\n label=\"Next\"\n size=\"xsmall\"\n widthX={6}\n renderAs=\"secondary\"\n onClick={() => nextCoachmark(journeyId, false, 0, true)}\n />\n </FlexView>\n ),\n } as IArrowTooltipProps,\n isActive: false,\n },\n {\n originalElementToHighlightRef: bannerRef,\n elementToHighlight: (\n <ChapterBanner\n title={name}\n progressStats={progressStat}\n imageUrl={imageUrl}\n imageHue={imageHue}\n />\n ),\n type: IndicatorType.TOOLTIP,\n indicator: {\n position: 'bottom',\n tooltipXCoOrdinates: -275,\n tooltipYCoOrdinates: -15,\n backgroundColor: 'PURPLE_4',\n borderColor: 'BLACK',\n arrowColor: 'BLACK',\n arrowSize: 12,\n width: 264,\n tooltipItem: (\n <FlexView $flexRowGapX={0.75}>\n <Text $renderAs=\"ab2-bold\">Easily track the progress of the core sheets.</Text>\n <Button\n label=\"Got it\"\n size=\"xsmall\"\n widthX={6}\n renderAs=\"secondary\"\n onClick={() => endJourney(journeyId)}\n />\n </FlexView>\n ),\n } as IArrowTooltipProps,\n isActive: false,\n },\n // {\n // originalElementToHighlightRef: coreBlocksRef,\n // elementToHighlight: <BlockSections userType={userType} blocks={blocks} imageHue=\"BLUE\" />,\n // type: IndicatorType.TOOLTIP,\n // indicator: {\n // position: 'top',\n // tooltipXCoOrdinates: -35,\n // tooltipYCoOrdinates: -7,\n // backgroundColor: 'PURPLE_4',\n // borderColor: 'BLACK',\n // arrowColor: 'BLACK',\n // arrowXCoOrdinates: -97,\n // arrowSize: 12,\n // width: 264,\n // tooltipItem: (\n // <FlexView $flexRowGapX={0.75}>\n // <Text $renderAs=\"ab2-bold\">Easily track the progress of the core sheets.</Text>\n // <Button\n // label=\"Next\"\n // size=\"xsmall\"\n // widthX={6}\n // renderAs=\"secondary\"\n // onClick={() => endJourney(journeyId)}\n // />\n // </FlexView>\n // ),\n // } as IArrowTooltipProps,\n // isActive: false,\n // },\n ];\n\n setJourney(journeyId, chapterPageSteps);\n\n const delayBeforeStart = setTimeout(() => {\n clearTimeout(delayBeforeStart);\n nextCoachmark(journeyId, false, 0, true);\n }, 200);\n\n timerRefs.current.push(delayBeforeStart); // Store to cleanup later\n },\n [setJourney, journeyId, nextCoachmark, endJourney],\n );\n\n const data = useMemo(\n () => ({\n chapterPageRef,\n bannerRef,\n coreBlocksRef,\n startJourney,\n }),\n [startJourney],\n );\n\n useEffect(() => {\n return () => {\n timerRefs.current.forEach(timer => clearTimeout(timer));\n timerRefs.current = [];\n };\n }, []);\n\n return data;\n};\n"],"names":["useChapterPageJourney","journeyId","JOURNEY_ID_STUDENT","chapterPageRef","useRef","bannerRef","coreBlocksRef","timerRefs","nextCoachmark","setJourney","endJourney","useJourney","startJourney","useCallback","chapterDetails","studentId","userType","progressStat","name","imageHue","imageUrl","chapterPageRect","chapterPageSteps","IndicatorType","jsx","ChapterDetails","jsxs","FlexView","Text","Button","ChapterBanner","delayBeforeStart","data","useMemo","useEffect","timer"],"mappings":";;;;;;;;;;AAqBO,MAAMA,IAAwB,MAAM;AACzC,QAAMC,IAAYC,EAAmB,sBAE/BC,IAAiBC,EAAuB,IAAI,GAC5CC,IAAYD,EAAuB,IAAI,GACvCE,IAAgBF,EAAuB,IAAI,GAC3CG,IAAYH,EAAwC,CAAA,CAAE,GACtD,EAAE,eAAAI,GAAe,YAAAC,GAAY,YAAAC,MAAeC,EAAW,GAEvDC,IAAeC;AAAA,IACnB,CAAC,EAAE,gBAAAC,GAAgB,WAAAC,GAAW,UAAAC,QAA0C;AAGhE,YAAA;AAAA,QACJ,eAAeC;AAAA,QACf,MAAAC;AAAA,QACA,WAAWC;AAAA,QACX,WAAWC;AAAA;AAAA,MAET,IAAAN;AAEA,UAAA,EAACX,KAAA,QAAAA,EAAgB,YAAW,EAACE,KAAA,QAAAA,EAAW,YAAW,CAACC,EAAc;AACpE;AAGI,YAAAe,IAAkBlB,EAAe,QAAQ,sBAAsB,GAE/DmB,IAAsC;AAAA,QAC1C;AAAA,UACE,+BAA+BnB;AAAA,UAC/B,UAAU;AAAA,UACV,MAAMoB,EAAc;AAAA,UACpB,oBACE,gBAAAC;AAAA,YAACC;AAAA,YAAA;AAAA,cACC,eAAeX,EAAe;AAAA,cAC9B,WAAAC;AAAA,c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AA;AAgCF,MAAAQ,EAAWR,GAAWqB,CAAgB;AAEhC,YAAAS,IAAmB,WAAW,MAAM;AACxC,qBAAaA,CAAgB,GACfvB,EAAAP,GAAW,IAAO,GAAG,EAAI;AAAA,SACtC,GAAG;AAEI,MAAAM,EAAA,QAAQ,KAAKwB,CAAgB;AAAA,IACzC;AAAA,IACA,CAACtB,GAAYR,GAAWO,GAAeE,CAAU;AAAA,EAAA,GAG7CsB,IAAOC;AAAA,IACX,OAAO;AAAA,MACL,gBAAA9B;AAAA,MACA,WAAAE;AAAA,MACA,eAAAC;AAAA,MACA,cAAAM;AAAA,IAAA;AAAA,IAEF,CAACA,CAAY;AAAA,EAAA;AAGf,SAAAsB,EAAU,MACD,MAAM;AACX,IAAA3B,EAAU,QAAQ,QAAQ,CAAS4B,MAAA,aAAaA,CAAK,CAAC,GACtD5B,EAAU,UAAU;EAAC,GAEtB,CAAE,CAAA,GAEEyB;AACT;"}
|
@@ -1,6 +1,5 @@
|
|
1
|
-
var E = /* @__PURE__ */ ((R) => (R.CIRCLE_ACTIVITIES_INTRO_JOURNEY = "CIRCLE_ACTIVITIES_INTRO_JOURNEY", R.CIRCLE_LEADERBOARD_INTRO_JOURNEY = "CIRCLE_LEADERBOARD_INTRO_JOURNEY", R.CIRCLE_POINTS_REWARD_JOURNEY = "CIRCLE_POINTS_REWARD_JOURNEY", R.CIRCLE_STREAK_UPDATE_JOURNEY = "CIRCLE_STREAK_UPDATE_JOURNEY", R.CIRCLE_TUTORIAL_JOURNEY = "CIRCLE_TUTORIAL_JOURNEY", R.CIRCLE_TABLES_INTRO_JOURNEY = "CIRCLE_TABLES_INTRO_JOURNEY", R.CIRCLE_STREAK_REDUCTION_JOURNEY = "CIRCLE_STREAK_REDUCTION_JOURNEY", R.HOMEPAGE_JOURNEY = "HOMEPAGE_JOURNEY", R
|
1
|
+
var E = /* @__PURE__ */ ((R) => (R.CIRCLE_ACTIVITIES_INTRO_JOURNEY = "CIRCLE_ACTIVITIES_INTRO_JOURNEY", R.CIRCLE_LEADERBOARD_INTRO_JOURNEY = "CIRCLE_LEADERBOARD_INTRO_JOURNEY", R.CIRCLE_POINTS_REWARD_JOURNEY = "CIRCLE_POINTS_REWARD_JOURNEY", R.CIRCLE_STREAK_UPDATE_JOURNEY = "CIRCLE_STREAK_UPDATE_JOURNEY", R.CIRCLE_TUTORIAL_JOURNEY = "CIRCLE_TUTORIAL_JOURNEY", R.CIRCLE_TABLES_INTRO_JOURNEY = "CIRCLE_TABLES_INTRO_JOURNEY", R.CIRCLE_STREAK_REDUCTION_JOURNEY = "CIRCLE_STREAK_REDUCTION_JOURNEY", R.HOMEPAGE_JOURNEY = "HOMEPAGE_JOURNEY", R.CHAPTER_PAGE_JOURNEY = "CHAPTER_PAGE_JOURNEY", R))(E || {});
|
2
2
|
export {
|
3
|
-
E as JOURNEY_ID_STUDENT
|
4
|
-
C as JOURNEY_ID_TEACHER
|
3
|
+
E as JOURNEY_ID_STUDENT
|
5
4
|
};
|
6
5
|
//# sourceMappingURL=journey-id-student.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"journey-id-student.js","sources":["../../../../src/features/journey/journey-id/journey-id-student.ts"],"sourcesContent":["export enum JOURNEY_ID_STUDENT {\n CIRCLE_ACTIVITIES_INTRO_JOURNEY = 'CIRCLE_ACTIVITIES_INTRO_JOURNEY',\n CIRCLE_LEADERBOARD_INTRO_JOURNEY = 'CIRCLE_LEADERBOARD_INTRO_JOURNEY',\n CIRCLE_POINTS_REWARD_JOURNEY = 'CIRCLE_POINTS_REWARD_JOURNEY',\n CIRCLE_STREAK_UPDATE_JOURNEY = 'CIRCLE_STREAK_UPDATE_JOURNEY',\n CIRCLE_TUTORIAL_JOURNEY = 'CIRCLE_TUTORIAL_JOURNEY',\n CIRCLE_TABLES_INTRO_JOURNEY = 'CIRCLE_TABLES_INTRO_JOURNEY',\n\n // TODO: Deprecate bottom journeys, they are not actually journeys\n CIRCLE_STREAK_REDUCTION_JOURNEY = 'CIRCLE_STREAK_REDUCTION_JOURNEY',\n HOMEPAGE_JOURNEY = 'HOMEPAGE_JOURNEY',\n
|
1
|
+
{"version":3,"file":"journey-id-student.js","sources":["../../../../src/features/journey/journey-id/journey-id-student.ts"],"sourcesContent":["export enum JOURNEY_ID_STUDENT {\n CIRCLE_ACTIVITIES_INTRO_JOURNEY = 'CIRCLE_ACTIVITIES_INTRO_JOURNEY',\n CIRCLE_LEADERBOARD_INTRO_JOURNEY = 'CIRCLE_LEADERBOARD_INTRO_JOURNEY',\n CIRCLE_POINTS_REWARD_JOURNEY = 'CIRCLE_POINTS_REWARD_JOURNEY',\n CIRCLE_STREAK_UPDATE_JOURNEY = 'CIRCLE_STREAK_UPDATE_JOURNEY',\n CIRCLE_TUTORIAL_JOURNEY = 'CIRCLE_TUTORIAL_JOURNEY',\n CIRCLE_TABLES_INTRO_JOURNEY = 'CIRCLE_TABLES_INTRO_JOURNEY',\n\n // TODO: Deprecate bottom journeys, they are not actually journeys\n CIRCLE_STREAK_REDUCTION_JOURNEY = 'CIRCLE_STREAK_REDUCTION_JOURNEY',\n HOMEPAGE_JOURNEY = 'HOMEPAGE_JOURNEY',\n CHAPTER_PAGE_JOURNEY = 'CHAPTER_PAGE_JOURNEY',\n}\n"],"names":["JOURNEY_ID_STUDENT"],"mappings":"AAAY,IAAAA,sBAAAA,OACVA,EAAA,kCAAkC,mCAClCA,EAAA,mCAAmC,oCACnCA,EAAA,+BAA+B,gCAC/BA,EAAA,+BAA+B,gCAC/BA,EAAA,0BAA0B,2BAC1BA,EAAA,8BAA8B,+BAG9BA,EAAA,kCAAkC,mCAClCA,EAAA,mBAAmB,oBACnBA,EAAA,uBAAuB,wBAXbA,IAAAA,KAAA,CAAA,CAAA;"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"journey-id-teacher.js","sources":["../../../../src/features/journey/journey-id/journey-id-teacher.ts"],"sourcesContent":["export enum JOURNEY_ID_TEACHER {\n HOMEPAGE_JOURNEY = 'HOMEPAGE_JOURNEY',\n CHAPTER_PAGE_JOURNEY = 'CHAPTER_PAGE_JOURNEY',\n}\n"],"names":["JOURNEY_ID_TEACHER"],"mappings":"AAAY,IAAAA,sBAAAA,OACVA,EAAA,mBAAmB,oBACnBA,EAAA,uBAAuB,wBAFbA,IAAAA,KAAA,CAAA,CAAA;"}
|
@@ -1,109 +1,109 @@
|
|
1
|
-
import { jsxs as D, jsx as
|
2
|
-
import { createContext as L, useState as J, useRef as k, useCallback as
|
1
|
+
import { jsxs as D, jsx as w } from "react/jsx-runtime";
|
2
|
+
import { createContext as L, useState as J, useRef as k, useCallback as l, useMemo as N, useEffect as R } from "react";
|
3
3
|
import { Coachmark as B } from "../comps/coachmark/coachmark.js";
|
4
4
|
import { usePostUserJourney as M, useGetUserJourney as z } from "../user-journey-api/user-journey-api.js";
|
5
5
|
import { Overlay as G } from "./journey-styled.js";
|
6
|
-
const S = L(null), W = ({ children:
|
7
|
-
const [
|
8
|
-
(e, r
|
9
|
-
if (
|
6
|
+
const S = L(null), W = ({ children: T, appId: s, userId: o }) => {
|
7
|
+
const [b, O] = J(!1), [x, p] = J(null), [c, a] = J([]), [d, v] = J(!1), y = k(-1), t = k(), f = k([]), { post: _ } = M(), { data: C = null, get: g } = z(), A = l(
|
8
|
+
(e, r) => {
|
9
|
+
if (c.length > 0) {
|
10
10
|
console.error(
|
11
11
|
`setJourney: Other Journey is already active, Current Journey: ${t.current}, New Journey Request: ${e}`
|
12
12
|
);
|
13
13
|
return;
|
14
14
|
}
|
15
|
-
|
15
|
+
v(!0), t.current = e, y.current = -1, a([...r]);
|
16
16
|
},
|
17
|
-
[
|
18
|
-
), u =
|
17
|
+
[c.length]
|
18
|
+
), u = l(() => {
|
19
19
|
f.current.forEach((e) => {
|
20
20
|
clearTimeout(e);
|
21
|
-
}), f.current = [], t.current = void 0,
|
22
|
-
}, []),
|
21
|
+
}), f.current = [], t.current = void 0, y.current = -1, a([]), v(!1);
|
22
|
+
}, []), $ = l(
|
23
23
|
(e) => {
|
24
|
-
u(),
|
25
|
-
app_id:
|
24
|
+
u(), p((r) => r && !r.includes(e) ? [...r, e] : r), _({
|
25
|
+
app_id: s,
|
26
26
|
user_id: o,
|
27
27
|
journey_id: e,
|
28
28
|
journey_status: "COMPLETED"
|
29
29
|
});
|
30
30
|
},
|
31
|
-
[
|
32
|
-
),
|
31
|
+
[s, u, _, o]
|
32
|
+
), E = l((e, r) => {
|
33
33
|
if (!t.current || e !== t.current) {
|
34
34
|
console.error(
|
35
35
|
t.current ? `A Journey is already active, Current Journey: ${t.current}, New Journey Request: ${e}` : "addCoachmark was called before setJourney and Journey ID is undefined"
|
36
36
|
);
|
37
37
|
return;
|
38
38
|
}
|
39
|
-
|
40
|
-
}, []),
|
41
|
-
(e, r = !1,
|
39
|
+
a((m) => [...m, r]);
|
40
|
+
}, []), P = l(
|
41
|
+
(e, r = !1, m = 0, q = !1) => {
|
42
42
|
if (!t.current || e !== t.current) {
|
43
43
|
console.error(
|
44
44
|
t.current ? "nextCoachmark was called before setJourney" : `A Journey is already active, Current Journey: ${t.current}, New Journey Request: ${e}`
|
45
45
|
);
|
46
46
|
return;
|
47
47
|
}
|
48
|
-
|
49
|
-
const
|
50
|
-
clearTimeout(
|
51
|
-
const n =
|
52
|
-
|
53
|
-
if (n >=
|
48
|
+
O(q), m !== 0 && a((n) => n.map((i) => ({ ...i, isActive: !1 })));
|
49
|
+
const j = setTimeout(() => {
|
50
|
+
clearTimeout(j);
|
51
|
+
const n = y.current + 1;
|
52
|
+
a((i) => {
|
53
|
+
if (n >= i.length || i.length === 0)
|
54
54
|
return u(), [];
|
55
|
-
|
56
|
-
const h = [...
|
55
|
+
y.current = n;
|
56
|
+
const h = [...i];
|
57
57
|
return h[n].isActive = !0, n > 0 && (h[n - 1].isActive = r), h;
|
58
58
|
});
|
59
|
-
},
|
60
|
-
f.current.push(
|
59
|
+
}, m);
|
60
|
+
f.current.push(j);
|
61
61
|
},
|
62
62
|
[u]
|
63
63
|
), U = N(
|
64
64
|
() => ({
|
65
|
-
nextCoachmark:
|
66
|
-
setJourney:
|
67
|
-
addCoachmark:
|
65
|
+
nextCoachmark: P,
|
66
|
+
setJourney: A,
|
67
|
+
addCoachmark: E,
|
68
68
|
clearJourney: u,
|
69
|
-
endJourney:
|
70
|
-
coachmarks:
|
71
|
-
userCompletedJourneyIds:
|
69
|
+
endJourney: $,
|
70
|
+
coachmarks: c,
|
71
|
+
userCompletedJourneyIds: x,
|
72
72
|
isJourneyActive: d
|
73
73
|
}),
|
74
74
|
[
|
75
|
-
j,
|
76
|
-
$,
|
77
75
|
P,
|
78
|
-
|
76
|
+
A,
|
79
77
|
E,
|
80
|
-
|
81
|
-
|
78
|
+
u,
|
79
|
+
$,
|
80
|
+
c,
|
81
|
+
x,
|
82
82
|
d
|
83
83
|
]
|
84
84
|
);
|
85
|
-
return
|
86
|
-
|
87
|
-
app_id:
|
85
|
+
return R(() => {
|
86
|
+
s && o && g(o, {
|
87
|
+
app_id: s,
|
88
88
|
user_id: o,
|
89
89
|
journey_status: "COMPLETED"
|
90
90
|
});
|
91
|
-
}, [
|
91
|
+
}, [s, g, o]), R(() => {
|
92
92
|
if (C) {
|
93
93
|
const e = C.map((r) => r.journey_id);
|
94
|
-
|
94
|
+
p(e);
|
95
95
|
}
|
96
96
|
}, [C]), /* @__PURE__ */ D(S.Provider, { value: U, children: [
|
97
|
-
d && /* @__PURE__ */
|
97
|
+
d && /* @__PURE__ */ w(
|
98
98
|
G,
|
99
99
|
{
|
100
100
|
about: "journey-overlay",
|
101
|
-
isJourneyBlurred:
|
101
|
+
isJourneyBlurred: b,
|
102
102
|
"data-testid": t.current,
|
103
|
-
children:
|
103
|
+
children: c.map((e, r) => /* @__PURE__ */ w(B, { coachmark: e }, `coachmark-${r}`))
|
104
104
|
}
|
105
105
|
),
|
106
|
-
|
106
|
+
T
|
107
107
|
] });
|
108
108
|
};
|
109
109
|
export {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"journey-context-provider.js","sources":["../../../../src/features/journey/use-journey/journey-context-provider.tsx"],"sourcesContent":["/* eslint-disable no-console */\nimport type { TJourneyId } from '../journey-id/journey-id-types';\nimport type {\n ICoachmarkProps,\n IJourneyContext,\n IJourneyProviderProps,\n} from './journey-context-types';\nimport type { FC } from 'react';\n\nimport { createContext, useCallback, useEffect, useMemo, useRef, useState } from 'react';\n\nimport { Coachmark } from '../comps/coachmark/coachmark';\nimport { useGetUserJourney, usePostUserJourney } from '../user-journey-api/user-journey-api';\nimport * as S from './journey-styled';\n\nexport const JourneyContext = createContext<IJourneyContext | null>(null);\n\nexport const JourneyProvider: FC<IJourneyProviderProps> = ({ children, appId, userId }) => {\n const [isJourneyBlurred, setIsJourneyBlurred] = useState<boolean>(false);\n const [userCompletedJourneyIds, setUserCompletedJourneyIds] = useState<TJourneyId[] | null>(null);\n const [coachmarkList, setCoachmarkList] = useState<ICoachmarkProps[]>([]);\n const [isJourneyActive, setIsJourneyActive] = useState(false);\n const currentIndex = useRef(-1);\n const currentJourneyId = useRef<TJourneyId | undefined>();\n const timerRefs = useRef<ReturnType<typeof setTimeout>[]>([]);\n\n const { post: postJourneyCompletion } = usePostUserJourney();\n const { data: userCompletedJourneys = null, get: getJourneyProgress } = useGetUserJourney();\n\n const setJourney = useCallback(\n (id: TJourneyId, coachmarks: ICoachmarkProps[], shouldBlueInitialJourney?: boolean) => {\n if (coachmarkList.length > 0) {\n console.error(\n `setJourney: Other Journey is already active, Current Journey: ${currentJourneyId.current}, New Journey Request: ${id}`,\n );\n\n return;\n }\n setIsJourneyActive(true);\n currentJourneyId.current = id;\n currentIndex.current = -1;\n setCoachmarkList([...coachmarks]);\n setIsJourneyBlurred(!!shouldBlueInitialJourney);\n },\n [coachmarkList.length],\n );\n\n const clearJourney = useCallback(() => {\n // Clear all timers\n timerRefs.current.forEach(timer => {\n clearTimeout(timer);\n });\n timerRefs.current = [];\n currentJourneyId.current = undefined;\n currentIndex.current = -1;\n setCoachmarkList([]);\n setIsJourneyActive(false);\n }, []);\n\n const endJourney = useCallback(\n (journeyId: TJourneyId) => {\n clearJourney();\n setUserCompletedJourneyIds(prev => {\n if (prev && !prev.includes(journeyId)) {\n return [...prev, journeyId];\n }\n\n return prev;\n });\n // fire the API (doesn’t block the UI)\n postJourneyCompletion({\n app_id: appId,\n user_id: userId,\n journey_id: journeyId,\n journey_status: 'COMPLETED',\n });\n },\n [appId, clearJourney, postJourneyCompletion, userId],\n );\n\n const addCoachmark = useCallback((id: TJourneyId, coachmark: ICoachmarkProps) => {\n if (!currentJourneyId.current || id !== currentJourneyId.current) {\n console.error(\n currentJourneyId.current\n ? `A Journey is already active, Current Journey: ${currentJourneyId.current}, New Journey Request: ${id}`\n : `addCoachmark was called before setJourney and Journey ID is undefined`,\n );\n\n return;\n }\n\n setCoachmarkList(prev => [...prev, coachmark]);\n }, []);\n\n const nextCoachmark = useCallback(\n (\n id: TJourneyId,\n keepPrevActive: boolean = false,\n delayInMs: number = 0,\n shouldBlurNextJourney: boolean = false,\n ) => {\n if (!currentJourneyId.current || id !== currentJourneyId.current) {\n console.error(\n currentJourneyId.current\n ? `nextCoachmark was called before setJourney`\n : `A Journey is already active, Current Journey: ${currentJourneyId.current}, New Journey Request: ${id}`,\n );\n\n return;\n }\n\n setIsJourneyBlurred(shouldBlurNextJourney);\n\n if (delayInMs !== 0) {\n // If delay is not 0, we will hide all them coachmarks and reveal only after the delay\n setCoachmarkList(prevList => {\n return prevList.map((item: ICoachmarkProps) => {\n return { ...item, isActive: false };\n });\n });\n }\n\n const timer = setTimeout(() => {\n clearTimeout(timer);\n const currIndex = currentIndex.current + 1;\n\n setCoachmarkList(prevList => {\n // Finish onboarding\n if (currIndex >= prevList.length || prevList.length === 0) {\n clearJourney();\n\n return [];\n }\n\n currentIndex.current = currIndex;\n const updatedCoachmarkList = [...prevList];\n\n (updatedCoachmarkList[currIndex] as ICoachmarkProps).isActive = true;\n\n if (currIndex > 0) {\n (updatedCoachmarkList[currIndex - 1] as ICoachmarkProps).isActive = keepPrevActive;\n }\n\n return updatedCoachmarkList;\n });\n }, delayInMs);\n\n timerRefs.current.push(timer);\n },\n [clearJourney],\n );\n\n const memoizedContextValue: IJourneyContext = useMemo(\n () => ({\n nextCoachmark,\n setJourney,\n addCoachmark,\n clearJourney,\n endJourney,\n coachmarks: coachmarkList,\n userCompletedJourneyIds,\n isJourneyActive,\n }),\n [\n nextCoachmark,\n setJourney,\n addCoachmark,\n clearJourney,\n endJourney,\n coachmarkList,\n userCompletedJourneyIds,\n isJourneyActive,\n ],\n );\n\n // Get the initial state of incompleteJourneys\n useEffect(() => {\n if (appId && userId) {\n getJourneyProgress(userId, {\n app_id: appId,\n user_id: userId,\n journey_status: 'COMPLETED',\n });\n }\n }, [appId, getJourneyProgress, userId]);\n\n // Set the data to context state initially\n useEffect(() => {\n if (userCompletedJourneys) {\n const completedUserJourneysIds = userCompletedJourneys.map(journey => journey.journey_id);\n\n setUserCompletedJourneyIds(completedUserJourneysIds);\n }\n }, [userCompletedJourneys]);\n\n return (\n <JourneyContext.Provider value={memoizedContextValue}>\n {isJourneyActive && (\n <S.Overlay\n about=\"journey-overlay\"\n isJourneyBlurred={isJourneyBlurred}\n data-testid={currentJourneyId.current}\n >\n {coachmarkList.map((coachmark, index) => (\n <Coachmark key={`coachmark-${index}`} coachmark={coachmark} />\n ))}\n </S.Overlay>\n )}\n {children}\n </JourneyContext.Provider>\n );\n};\n"],"names":["JourneyContext","createContext","JourneyProvider","children","appId","userId","isJourneyBlurred","setIsJourneyBlurred","useState","userCompletedJourneyIds","setUserCompletedJourneyIds","coachmarkList","setCoachmarkList","isJourneyActive","setIsJourneyActive","currentIndex","useRef","currentJourneyId","timerRefs","postJourneyCompletion","usePostUserJourney","userCompletedJourneys","getJourneyProgress","useGetUserJourney","setJourney","useCallback","id","coachmarks","shouldBlueInitialJourney","clearJourney","timer","endJourney","journeyId","prev","addCoachmark","coachmark","nextCoachmark","keepPrevActive","delayInMs","shouldBlurNextJourney","prevList","item","currIndex","updatedCoachmarkList","memoizedContextValue","useMemo","useEffect","completedUserJourneysIds","journey","jsxs","jsx","S.Overlay","index","Coachmark"],"mappings":";;;;;AAea,MAAAA,IAAiBC,EAAsC,IAAI,GAE3DC,IAA6C,CAAC,EAAE,UAAAC,GAAU,OAAAC,GAAO,QAAAC,QAAa;AACzF,QAAM,CAACC,GAAkBC,CAAmB,IAAIC,EAAkB,EAAK,GACjE,CAACC,GAAyBC,CAA0B,IAAIF,EAA8B,IAAI,GAC1F,CAACG,GAAeC,CAAgB,IAAIJ,EAA4B,CAAE,CAAA,GAClE,CAACK,GAAiBC,CAAkB,IAAIN,EAAS,EAAK,GACtDO,IAAeC,EAAO,EAAE,GACxBC,IAAmBD,KACnBE,IAAYF,EAAwC,CAAA,CAAE,GAEtD,EAAE,MAAMG,EAAsB,IAAIC,EAAmB,GACrD,EAAE,MAAMC,IAAwB,MAAM,KAAKC,EAAA,IAAuBC,KAElEC,IAAaC;AAAA,IACjB,CAACC,GAAgBC,GAA+BC,MAAuC;AACjF,UAAAjB,EAAc,SAAS,GAAG;AACpB,gBAAA;AAAA,UACN,iEAAiEM,EAAiB,OAAO,0BAA0BS,CAAE;AAAA,QAAA;AAGvH;AAAA,MACF;AACA,MAAAZ,EAAmB,EAAI,GACvBG,EAAiB,UAAUS,GAC3BX,EAAa,UAAU,IACNH,EAAA,CAAC,GAAGe,CAAU,CAAC,GACZpB,EAAA,CAAC,CAACqB,CAAwB;AAAA,IAChD;AAAA,IACA,CAACjB,EAAc,MAAM;AAAA,EAAA,GAGjBkB,IAAeJ,EAAY,MAAM;AAE3B,IAAAP,EAAA,QAAQ,QAAQ,CAASY,MAAA;AACjC,mBAAaA,CAAK;AAAA,IAAA,CACnB,GACDZ,EAAU,UAAU,IACpBD,EAAiB,UAAU,QAC3BF,EAAa,UAAU,IACvBH,EAAiB,CAAE,CAAA,GACnBE,EAAmB,EAAK;AAAA,EAC1B,GAAG,CAAE,CAAA,GAECiB,IAAaN;AAAA,I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,gBAAAF,EAAAG,GAAA,EAAqC,WAAAlB,EAAtB,GAAA,aAAaiB,CAAK,EAA0B,CAC7D;AAAA,MAAA;AAAA,IACH;AAAA,IAEDjD;AAAA,EACH,EAAA,CAAA;AAEJ;"}
|
1
|
+
{"version":3,"file":"journey-context-provider.js","sources":["../../../../src/features/journey/use-journey/journey-context-provider.tsx"],"sourcesContent":["/* eslint-disable no-console */\nimport type { TJourneyId } from '../journey-id/journey-id-types';\nimport type {\n ICoachmarkProps,\n IJourneyContext,\n IJourneyProviderProps,\n} from './journey-context-types';\nimport type { FC } from 'react';\n\nimport { createContext, useCallback, useEffect, useMemo, useRef, useState } from 'react';\n\nimport { Coachmark } from '../comps/coachmark/coachmark';\nimport { useGetUserJourney, usePostUserJourney } from '../user-journey-api/user-journey-api';\nimport * as S from './journey-styled';\n\nexport const JourneyContext = createContext<IJourneyContext | null>(null);\n\nexport const JourneyProvider: FC<IJourneyProviderProps> = ({ children, appId, userId }) => {\n const [isJourneyBlurred, setIsJourneyBlurred] = useState<boolean>(false);\n const [userCompletedJourneyIds, setUserCompletedJourneyIds] = useState<TJourneyId[] | null>(null);\n const [coachmarkList, setCoachmarkList] = useState<ICoachmarkProps[]>([]);\n const [isJourneyActive, setIsJourneyActive] = useState(false);\n const currentIndex = useRef(-1);\n const currentJourneyId = useRef<TJourneyId | undefined>();\n const timerRefs = useRef<ReturnType<typeof setTimeout>[]>([]);\n\n const { post: postJourneyCompletion } = usePostUserJourney();\n const { data: userCompletedJourneys = null, get: getJourneyProgress } = useGetUserJourney();\n\n const setJourney = useCallback(\n (id: TJourneyId, coachmarks: ICoachmarkProps[]) => {\n if (coachmarkList.length > 0) {\n console.error(\n `setJourney: Other Journey is already active, Current Journey: ${currentJourneyId.current}, New Journey Request: ${id}`,\n );\n\n return;\n }\n setIsJourneyActive(true);\n currentJourneyId.current = id;\n currentIndex.current = -1;\n setCoachmarkList([...coachmarks]);\n },\n [coachmarkList.length],\n );\n\n const clearJourney = useCallback(() => {\n // Clear all timers\n timerRefs.current.forEach(timer => {\n clearTimeout(timer);\n });\n timerRefs.current = [];\n currentJourneyId.current = undefined;\n currentIndex.current = -1;\n setCoachmarkList([]);\n setIsJourneyActive(false);\n }, []);\n\n const endJourney = useCallback(\n (journeyId: TJourneyId) => {\n clearJourney();\n setUserCompletedJourneyIds(prev => {\n if (prev && !prev.includes(journeyId)) {\n return [...prev, journeyId];\n }\n\n return prev;\n });\n // fire the API (doesn’t block the UI)\n postJourneyCompletion({\n app_id: appId,\n user_id: userId,\n journey_id: journeyId,\n journey_status: 'COMPLETED',\n });\n },\n [appId, clearJourney, postJourneyCompletion, userId],\n );\n\n const addCoachmark = useCallback((id: TJourneyId, coachmark: ICoachmarkProps) => {\n if (!currentJourneyId.current || id !== currentJourneyId.current) {\n console.error(\n currentJourneyId.current\n ? `A Journey is already active, Current Journey: ${currentJourneyId.current}, New Journey Request: ${id}`\n : `addCoachmark was called before setJourney and Journey ID is undefined`,\n );\n\n return;\n }\n\n setCoachmarkList(prev => [...prev, coachmark]);\n }, []);\n\n const nextCoachmark = useCallback(\n (\n id: TJourneyId,\n keepPrevActive: boolean = false,\n delayInMs: number = 0,\n shouldBlurNextJourney: boolean = false,\n ) => {\n if (!currentJourneyId.current || id !== currentJourneyId.current) {\n console.error(\n currentJourneyId.current\n ? `nextCoachmark was called before setJourney`\n : `A Journey is already active, Current Journey: ${currentJourneyId.current}, New Journey Request: ${id}`,\n );\n\n return;\n }\n\n setIsJourneyBlurred(shouldBlurNextJourney);\n\n if (delayInMs !== 0) {\n // If delay is not 0, we will hide all them coachmarks and reveal only after the delay\n setCoachmarkList(prevList => {\n return prevList.map((item: ICoachmarkProps) => {\n return { ...item, isActive: false };\n });\n });\n }\n\n const timer = setTimeout(() => {\n clearTimeout(timer);\n const currIndex = currentIndex.current + 1;\n\n setCoachmarkList(prevList => {\n // Finish onboarding\n if (currIndex >= prevList.length || prevList.length === 0) {\n clearJourney();\n\n return [];\n }\n\n currentIndex.current = currIndex;\n const updatedCoachmarkList = [...prevList];\n\n (updatedCoachmarkList[currIndex] as ICoachmarkProps).isActive = true;\n\n if (currIndex > 0) {\n (updatedCoachmarkList[currIndex - 1] as ICoachmarkProps).isActive = keepPrevActive;\n }\n\n return updatedCoachmarkList;\n });\n }, delayInMs);\n\n timerRefs.current.push(timer);\n },\n [clearJourney],\n );\n\n const memoizedContextValue: IJourneyContext = useMemo(\n () => ({\n nextCoachmark,\n setJourney,\n addCoachmark,\n clearJourney,\n endJourney,\n coachmarks: coachmarkList,\n userCompletedJourneyIds,\n isJourneyActive,\n }),\n [\n nextCoachmark,\n setJourney,\n addCoachmark,\n clearJourney,\n endJourney,\n coachmarkList,\n userCompletedJourneyIds,\n isJourneyActive,\n ],\n );\n\n // Get the initial state of incompleteJourneys\n useEffect(() => {\n if (appId && userId) {\n getJourneyProgress(userId, {\n app_id: appId,\n user_id: userId,\n journey_status: 'COMPLETED',\n });\n }\n }, [appId, getJourneyProgress, userId]);\n\n // Set the data to context state initially\n useEffect(() => {\n if (userCompletedJourneys) {\n const completedUserJourneysIds = userCompletedJourneys.map(journey => journey.journey_id);\n\n setUserCompletedJourneyIds(completedUserJourneysIds);\n }\n }, [userCompletedJourneys]);\n\n return (\n <JourneyContext.Provider value={memoizedContextValue}>\n {isJourneyActive && (\n <S.Overlay\n about=\"journey-overlay\"\n isJourneyBlurred={isJourneyBlurred}\n data-testid={currentJourneyId.current}\n >\n {coachmarkList.map((coachmark, index) => (\n <Coachmark key={`coachmark-${index}`} coachmark={coachmark} />\n ))}\n </S.Overlay>\n )}\n {children}\n </JourneyContext.Provider>\n );\n};\n"],"names":["JourneyContext","createContext","JourneyProvider","children","appId","userId","isJourneyBlurred","setIsJourneyBlurred","useState","userCompletedJourneyIds","setUserCompletedJourneyIds","coachmarkList","setCoachmarkList","isJourneyActive","setIsJourneyActive","currentIndex","useRef","currentJourneyId","timerRefs","postJourneyCompletion","usePostUserJourney","userCompletedJourneys","getJourneyProgress","useGetUserJourney","setJourney","useCallback","id","coachmarks","clearJourney","timer","endJourney","journeyId","prev","addCoachmark","coachmark","nextCoachmark","keepPrevActive","delayInMs","shouldBlurNextJourney","prevList","item","currIndex","updatedCoachmarkList","memoizedContextValue","useMemo","useEffect","completedUserJourneysIds","journey","jsxs","jsx","S.Overlay","index","Coachmark"],"mappings":";;;;;AAea,MAAAA,IAAiBC,EAAsC,IAAI,GAE3DC,IAA6C,CAAC,EAAE,UAAAC,GAAU,OAAAC,GAAO,QAAAC,QAAa;AACzF,QAAM,CAACC,GAAkBC,CAAmB,IAAIC,EAAkB,EAAK,GACjE,CAACC,GAAyBC,CAA0B,IAAIF,EAA8B,IAAI,GAC1F,CAACG,GAAeC,CAAgB,IAAIJ,EAA4B,CAAE,CAAA,GAClE,CAACK,GAAiBC,CAAkB,IAAIN,EAAS,EAAK,GACtDO,IAAeC,EAAO,EAAE,GACxBC,IAAmBD,KACnBE,IAAYF,EAAwC,CAAA,CAAE,GAEtD,EAAE,MAAMG,EAAsB,IAAIC,EAAmB,GACrD,EAAE,MAAMC,IAAwB,MAAM,KAAKC,EAAA,IAAuBC,KAElEC,IAAaC;AAAA,IACjB,CAACC,GAAgBC,MAAkC;AAC7C,UAAAhB,EAAc,SAAS,GAAG;AACpB,gBAAA;AAAA,UACN,iEAAiEM,EAAiB,OAAO,0BAA0BS,CAAE;AAAA,QAAA;AAGvH;AAAA,MACF;AACA,MAAAZ,EAAmB,EAAI,GACvBG,EAAiB,UAAUS,GAC3BX,EAAa,UAAU,IACNH,EAAA,CAAC,GAAGe,CAAU,CAAC;AAAA,IAClC;AAAA,IACA,CAAChB,EAAc,MAAM;AAAA,EAAA,GAGjBiB,IAAeH,EAAY,MAAM;AAE3B,IAAAP,EAAA,QAAQ,QAAQ,CAASW,MAAA;AACjC,mBAAaA,CAAK;AAAA,IAAA,CACnB,GACDX,EAAU,UAAU,IACpBD,EAAiB,UAAU,QAC3BF,EAAa,UAAU,IACvBH,EAAiB,CAAE,CAAA,GACnBE,EAAm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AiB;AAAA,QAE7B,UAAAN,EAAc,IAAI,CAACuB,GAAWiB,MAC5B,gBAAAF,EAAAG,GAAA,EAAqC,WAAAlB,EAAtB,GAAA,aAAaiB,CAAK,EAA0B,CAC7D;AAAA,MAAA;AAAA,IACH;AAAA,IAEDhD;AAAA,EACH,EAAA,CAAA;AAEJ;"}
|
@@ -1,7 +1,7 @@
|
|
1
|
-
import { jsxs as t, jsx as e, Fragment as
|
2
|
-
import { memo as
|
3
|
-
import
|
4
|
-
import
|
1
|
+
import { jsxs as t, jsx as e, Fragment as P } from "react/jsx-runtime";
|
2
|
+
import { memo as W, useRef as X, useState as j, useMemo as H, useLayoutEffect as F } from "react";
|
3
|
+
import K from "../../../../../assets/line-icons/icons/check2.js";
|
4
|
+
import V from "../../../../ui/arrow-tooltip/arrow-tooltip.js";
|
5
5
|
import v from "../../../../ui/image/image.js";
|
6
6
|
import r from "../../../../ui/layout/flex-view.js";
|
7
7
|
import U from "../../../../ui/separator/separator.js";
|
@@ -11,7 +11,7 @@ import { GOAL_CATEGORY_BASED_IMAGES as q } from "./milestone-constants.js";
|
|
11
11
|
import { getRemainingDaysToCompleteGoal as z, getGoalCategoryBasedColorTheme as J, getMilestoneWidgetStatusInfo as Q } from "./milestone-utils.js";
|
12
12
|
import { ChapterProgressSVG as Z, ChapterProgressSVGCircle as u, StyledCheckIconWrapper as ee, MilestoneTitle as te } from "./milestone-widget-styled.js";
|
13
13
|
import re from "./outcome/outcome.js";
|
14
|
-
const ue =
|
14
|
+
const ue = W(
|
15
15
|
({ isClassOngoing: C, isStudentPresent: T, isExpanded: oe, ...x }) => {
|
16
16
|
const {
|
17
17
|
milestone: m,
|
@@ -32,7 +32,7 @@ const ue = X(
|
|
32
32
|
goal_category: l,
|
33
33
|
goal_code: p,
|
34
34
|
progress_stat: k
|
35
|
-
} = m, { completed: h = 0, total: a = 0 } = k || {}, $ = o === "OUTCOME_PENDING", c = h > 0 ? Math.floor((h / a || 1) * 100) : 0, n =
|
35
|
+
} = m, { completed: h = 0, total: a = 0 } = k || {}, $ = o === "OUTCOME_PENDING", c = h > 0 ? Math.floor((h / a || 1) * 100) : 0, n = X(null), [B, O] = j(!1), { textColor: N, borderColor: f } = J(l), d = Q(o), R = ($ ? d == null ? void 0 : d.progressBackgroundColor : f) || "WHITE_5", L = H(() => typeof p == "string", [p]), M = z(S);
|
36
36
|
return F(() => {
|
37
37
|
n.current && n.current.scrollHeight > n.current.clientHeight && O(!0);
|
38
38
|
}, [n]), l ? /* @__PURE__ */ t(
|
@@ -78,7 +78,7 @@ const ue = X(
|
|
78
78
|
height: 40
|
79
79
|
}
|
80
80
|
) }),
|
81
|
-
c === 100 && /* @__PURE__ */ e(ee, { children: /* @__PURE__ */ e(
|
81
|
+
c === 100 && /* @__PURE__ */ e(ee, { children: /* @__PURE__ */ e(K, { width: 20, height: 20 }) })
|
82
82
|
]
|
83
83
|
}
|
84
84
|
),
|
@@ -110,7 +110,7 @@ const ue = X(
|
|
110
110
|
)
|
111
111
|
] }),
|
112
112
|
/* @__PURE__ */ e(
|
113
|
-
|
113
|
+
V,
|
114
114
|
{
|
115
115
|
renderAs: "primary",
|
116
116
|
position: "bottom",
|
@@ -120,7 +120,8 @@ const ue = X(
|
|
120
120
|
te,
|
121
121
|
{
|
122
122
|
ref: n,
|
123
|
-
$renderAs:
|
123
|
+
$renderAs: L ? "ah4" : "ab1",
|
124
|
+
$color: "BLACK_1",
|
124
125
|
children: g
|
125
126
|
}
|
126
127
|
)
|
@@ -128,10 +129,10 @@ const ue = X(
|
|
128
129
|
),
|
129
130
|
o !== "DRAFT" && /* @__PURE__ */ t(s, { $renderAs: "ub3", $color: "BLACK_T_60", children: [
|
130
131
|
!!a && `${c}% complete`,
|
131
|
-
!!a && o === "ACTIVE" &&
|
132
|
+
!!a && o === "ACTIVE" && M
|
132
133
|
] })
|
133
134
|
] }),
|
134
|
-
i != null && i.length ? /* @__PURE__ */ t(
|
135
|
+
i != null && i.length ? /* @__PURE__ */ t(P, { children: [
|
135
136
|
/* @__PURE__ */ e(U, { width: 40, height: 1, background: "BLACK_T_15" }),
|
136
137
|
/* @__PURE__ */ e(re, { outcomes: i })
|
137
138
|
] }) : void 0
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"milestone-info.js","sources":["../../../../../../src/features/milestone/milestone-list-container/milestone-list/milestone-widget/milestone-info.tsx"],"sourcesContent":["import type { IMileStoneInfoWrapperProps } from './milestone-widget-types';\n\nimport React, { memo, useLayoutEffect, useMemo, useRef, useState } from 'react';\n\nimport Check2Icon from '../../../../../assets/line-icons/icons/check2';\nimport ArrowTooltip from '../../../../ui/arrow-tooltip/arrow-tooltip';\nimport Image from '../../../../ui/image/image';\nimport FlexView from '../../../../ui/layout/flex-view';\nimport Separator from '../../../../ui/separator/separator';\nimport Text from '../../../../ui/text/text';\nimport GoalActionCtas from './goals/goal-action-ctas';\nimport { GOAL_CATEGORY_BASED_IMAGES } from './milestone-constants';\nimport {\n getGoalCategoryBasedColorTheme,\n getMilestoneWidgetStatusInfo,\n getRemainingDaysToCompleteGoal,\n} from './milestone-utils';\nimport * as Styled from './milestone-widget-styled';\nimport OutcomeWrapper from './outcome/outcome';\n\nconst MilestoneInfoWrapper: React.FC<IMileStoneInfoWrapperProps> = memo(\n ({ isClassOngoing, isStudentPresent, isExpanded, ...restMilestoneInfoWrapperProps }) => {\n const {\n milestone,\n studentId,\n studentName,\n teacherName,\n parentName,\n userType,\n courseStream,\n outcomes,\n onEdit,\n onDraftPublish,\n onAddOutcome,\n } = restMilestoneInfoWrapperProps;\n\n const {\n milestone_name: milestoneName,\n milestone_date_ts: dueDate,\n milestone_state: milestoneState,\n goal_category: goalCategory,\n goal_code: goalCode,\n progress_stat: progressStat,\n } = milestone;\n\n const { completed = 0, total = 0 } = progressStat || {};\n const isOutcomePending = milestoneState === 'OUTCOME_PENDING';\n const progressCompletionPercentage =\n completed > 0 ? Math.floor((completed / total || 1) * 100) : 0;\n\n const titleTextRef = useRef<HTMLDivElement>(null);\n const [showTitleTooltip, setShowTitleTooltip] = useState(false);\n\n const { textColor: goalCategoryTextColor, borderColor } =\n getGoalCategoryBasedColorTheme(goalCategory);\n\n const outcomeStatusInfo = getMilestoneWidgetStatusInfo(milestoneState);\n const backgroundColor =\n (isOutcomePending ? outcomeStatusInfo?.progressBackgroundColor : borderColor) || 'WHITE_5';\n\n const isGoalCreation = useMemo(() => typeof goalCode === 'string', [goalCode]);\n const remainingDays = getRemainingDaysToCompleteGoal(dueDate);\n\n useLayoutEffect(() => {\n if (\n titleTextRef.current &&\n titleTextRef.current.scrollHeight > titleTextRef.current.clientHeight\n ) {\n setShowTitleTooltip(true);\n }\n }, [titleTextRef]);\n\n if (!goalCategory) return null;\n\n return (\n <FlexView\n $flexDirection=\"row\"\n $justifyContent=\"space-between\"\n $alignItems=\"center\"\n $flexGapX={1}\n >\n <FlexView $flexDirection=\"row\" $flexGapX={1.5}>\n <FlexView\n $widthX={4}\n $heightX={4}\n $background=\"WHITE_T_38\"\n $position=\"relative\"\n $justifyContent=\"center\"\n $alignItems=\"center\"\n $borderRadiusX={2}\n >\n <Styled.ChapterProgressSVG width=\"64px\" height=\"64px\">\n <Styled.ChapterProgressSVGCircle $progress={0} r=\"31\" cx=\"32\" cy=\"32\" />\n <Styled.ChapterProgressSVGCircle\n $progressCircle\n $progressBackground=\"BLACK_1\"\n $progress={progressCompletionPercentage * 2}\n r=\"31\"\n cx=\"32\"\n cy=\"32\"\n />\n </Styled.ChapterProgressSVG>\n\n <FlexView $widthX={4} $heightX={4} $justifyContent=\"center\" $alignItems=\"center\">\n <Image\n src={GOAL_CATEGORY_BASED_IMAGES[goalCategory]}\n withLoader\n width={40}\n height={40}\n />\n </FlexView>\n\n {progressCompletionPercentage === 100 && (\n <Styled.StyledCheckIconWrapper>\n <Check2Icon width={20} height={20} />\n </Styled.StyledCheckIconWrapper>\n )}\n </FlexView>\n\n <FlexView $flexGap={16}>\n <FlexView $flexGap={4}>\n <FlexView $flexDirection=\"row\" $alignItems=\"center\" $flexGap={4}>\n <Text $renderAs=\"ac4-black\" $color={goalCategoryTextColor}>\n {goalCategory.split('_').join(' ')}\n </Text>\n\n {isOutcomePending && (\n <FlexView\n $flexDirection=\"row\"\n $gap={4}\n $gutter={4}\n $alignItems=\"center\"\n $background={backgroundColor}\n >\n <Text $renderAs=\"ac4\" $color=\"WHITE\">\n Outcome pending\n </Text>\n </FlexView>\n )}\n\n {milestoneState === 'DRAFT' && (\n <FlexView\n $flexDirection=\"row\"\n $gap={4}\n $gutter={4}\n $alignItems=\"center\"\n $background={borderColor}\n >\n <Text $renderAs=\"ac4\">Draft</Text>\n </FlexView>\n )}\n </FlexView>\n\n <ArrowTooltip\n renderAs=\"primary\"\n position=\"bottom\"\n tooltipItem={milestoneName}\n hidden={!showTitleTooltip}\n >\n <Styled.MilestoneTitle\n ref={titleTextRef}\n $renderAs={!isGoalCreation ? 'ah3' : 'ah4'}\n >\n {milestoneName}\n </Styled.MilestoneTitle>\n </ArrowTooltip>\n\n {milestoneState !== 'DRAFT' && (\n <Text $renderAs=\"ub3\" $color=\"BLACK_T_60\">\n {!!total && `${progressCompletionPercentage}% complete`}\n {!!total && milestoneState === 'ACTIVE' && remainingDays}\n </Text>\n )}\n </FlexView>\n\n {outcomes?.length ? (\n <>\n <Separator width={40} height={1} background=\"BLACK_T_15\" />\n <OutcomeWrapper outcomes={outcomes} />\n </>\n ) : undefined}\n </FlexView>\n </FlexView>\n\n {userType === 'TEACHER' && (\n <GoalActionCtas\n milestone={milestone}\n studentId={studentId}\n studentName={studentName}\n teacherName={teacherName ?? ''}\n parentName={parentName ?? ''}\n onAddOutcome={onAddOutcome}\n isClassOngoing={Boolean(isClassOngoing)}\n isStudentPresent={Boolean(isStudentPresent)}\n onDraftPublish={onDraftPublish}\n onEdit={onEdit}\n courseStream={courseStream}\n />\n )}\n </FlexView>\n );\n },\n);\n\nexport default MilestoneInfoWrapper;\n"],"names":["MilestoneInfoWrapper","memo","isClassOngoing","isStudentPresent","isExpanded","restMilestoneInfoWrapperProps","milestone","studentId","studentName","teacherName","parentName","userType","courseStream","outcomes","onEdit","onDraftPublish","onAddOutcome","milestoneName","dueDate","milestoneState","goalCategory","goalCode","progressStat","completed","total","isOutcomePending","progressCompletionPercentage","titleTextRef","useRef","showTitleTooltip","setShowTitleTooltip","useState","goalCategoryTextColor","borderColor","getGoalCategoryBasedColorTheme","outcomeStatusInfo","getMilestoneWidgetStatusInfo","backgroundColor","isGoalCreation","useMemo","remainingDays","getRemainingDaysToCompleteGoal","useLayoutEffect","jsxs","FlexView","Styled.ChapterProgressSVG","jsx","Styled.ChapterProgressSVGCircle","Image","GOAL_CATEGORY_BASED_IMAGES","Styled.StyledCheckIconWrapper","Check2Icon","Text","ArrowTooltip","Styled.MilestoneTitle","Fragment","Separator","OutcomeWrapper","GoalActionCtas"],"mappings":";;;;;;;;;;;;;AAoBA,MAAMA,KAA6DC;AAAA,EACjE,CAAC,EAAE,gBAAAC,GAAgB,kBAAAC,GAAkB,YAAAC,IAAY,GAAGC,QAAoC;AAChF,UAAA;AAAA,MACJ,WAAAC;AAAA,MACA,WAAAC;AAAA,MACA,aAAAC;AAAA,MACA,aAAAC;AAAA,MACA,YAAAC;AAAA,MACA,UAAAC;AAAA,MACA,cAAAC;AAAA,MACA,UAAAC;AAAA,MACA,QAAAC;AAAA,MACA,gBAAAC;AAAA,MACA,cAAAC;AAAA,IACE,IAAAX,GAEE;AAAA,MACJ,gBAAgBY;AAAA,MAChB,mBAAmBC;AAAA,MACnB,iBAAiBC;AAAA,MACjB,eAAeC;AAAA,MACf,WAAWC;AAAA,MACX,eAAeC;AAAA,IACb,IAAAhB,GAEE,EAAE,WAAAiB,IAAY,GAAG,OAAAC,IAAQ,EAAE,IAAIF,KAAgB,IAC/CG,IAAmBN,MAAmB,mBACtCO,IACJH,IAAY,IAAI,KAAK,OAAOA,IAAYC,KAAS,KAAK,GAAG,IAAI,GAEzDG,IAAeC,EAAuB,IAAI,GAC1C,CAACC,GAAkBC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../../../../../src/features/milestone/milestone-list-container/milestone-list/milestone-widget/milestone-info.tsx"],"sourcesContent":["import type { IMileStoneInfoWrapperProps } from './milestone-widget-types';\n\nimport React, { memo, useLayoutEffect, useMemo, useRef, useState } from 'react';\n\nimport Check2Icon from '../../../../../assets/line-icons/icons/check2';\nimport ArrowTooltip from '../../../../ui/arrow-tooltip/arrow-tooltip';\nimport Image from '../../../../ui/image/image';\nimport FlexView from '../../../../ui/layout/flex-view';\nimport Separator from '../../../../ui/separator/separator';\nimport Text from '../../../../ui/text/text';\nimport GoalActionCtas from './goals/goal-action-ctas';\nimport { GOAL_CATEGORY_BASED_IMAGES } from './milestone-constants';\nimport {\n getGoalCategoryBasedColorTheme,\n getMilestoneWidgetStatusInfo,\n getRemainingDaysToCompleteGoal,\n} from './milestone-utils';\nimport * as Styled from './milestone-widget-styled';\nimport OutcomeWrapper from './outcome/outcome';\n\nconst MilestoneInfoWrapper: React.FC<IMileStoneInfoWrapperProps> = memo(\n ({ isClassOngoing, isStudentPresent, isExpanded, ...restMilestoneInfoWrapperProps }) => {\n const {\n milestone,\n studentId,\n studentName,\n teacherName,\n parentName,\n userType,\n courseStream,\n outcomes,\n onEdit,\n onDraftPublish,\n onAddOutcome,\n } = restMilestoneInfoWrapperProps;\n\n const {\n milestone_name: milestoneName,\n milestone_date_ts: dueDate,\n milestone_state: milestoneState,\n goal_category: goalCategory,\n goal_code: goalCode,\n progress_stat: progressStat,\n } = milestone;\n\n const { completed = 0, total = 0 } = progressStat || {};\n const isOutcomePending = milestoneState === 'OUTCOME_PENDING';\n const progressCompletionPercentage =\n completed > 0 ? Math.floor((completed / total || 1) * 100) : 0;\n\n const titleTextRef = useRef<HTMLDivElement>(null);\n const [showTitleTooltip, setShowTitleTooltip] = useState(false);\n\n const { textColor: goalCategoryTextColor, borderColor } =\n getGoalCategoryBasedColorTheme(goalCategory);\n\n const outcomeStatusInfo = getMilestoneWidgetStatusInfo(milestoneState);\n const backgroundColor =\n (isOutcomePending ? outcomeStatusInfo?.progressBackgroundColor : borderColor) || 'WHITE_5';\n\n const isGoalCreation = useMemo(() => typeof goalCode === 'string', [goalCode]);\n const remainingDays = getRemainingDaysToCompleteGoal(dueDate);\n\n useLayoutEffect(() => {\n if (\n titleTextRef.current &&\n titleTextRef.current.scrollHeight > titleTextRef.current.clientHeight\n ) {\n setShowTitleTooltip(true);\n }\n }, [titleTextRef]);\n\n if (!goalCategory) return null;\n\n return (\n <FlexView\n $flexDirection=\"row\"\n $justifyContent=\"space-between\"\n $alignItems=\"center\"\n $flexGapX={1}\n >\n <FlexView $flexDirection=\"row\" $flexGapX={1.5}>\n <FlexView\n $widthX={4}\n $heightX={4}\n $background=\"WHITE_T_38\"\n $position=\"relative\"\n $justifyContent=\"center\"\n $alignItems=\"center\"\n $borderRadiusX={2}\n >\n <Styled.ChapterProgressSVG width=\"64px\" height=\"64px\">\n <Styled.ChapterProgressSVGCircle $progress={0} r=\"31\" cx=\"32\" cy=\"32\" />\n <Styled.ChapterProgressSVGCircle\n $progressCircle\n $progressBackground=\"BLACK_1\"\n $progress={progressCompletionPercentage * 2}\n r=\"31\"\n cx=\"32\"\n cy=\"32\"\n />\n </Styled.ChapterProgressSVG>\n\n <FlexView $widthX={4} $heightX={4} $justifyContent=\"center\" $alignItems=\"center\">\n <Image\n src={GOAL_CATEGORY_BASED_IMAGES[goalCategory]}\n withLoader\n width={40}\n height={40}\n />\n </FlexView>\n\n {progressCompletionPercentage === 100 && (\n <Styled.StyledCheckIconWrapper>\n <Check2Icon width={20} height={20} />\n </Styled.StyledCheckIconWrapper>\n )}\n </FlexView>\n\n <FlexView $flexGap={16}>\n <FlexView $flexGap={4}>\n <FlexView $flexDirection=\"row\" $alignItems=\"center\" $flexGap={4}>\n <Text $renderAs=\"ac4-black\" $color={goalCategoryTextColor}>\n {goalCategory.split('_').join(' ')}\n </Text>\n\n {isOutcomePending && (\n <FlexView\n $flexDirection=\"row\"\n $gap={4}\n $gutter={4}\n $alignItems=\"center\"\n $background={backgroundColor}\n >\n <Text $renderAs=\"ac4\" $color=\"WHITE\">\n Outcome pending\n </Text>\n </FlexView>\n )}\n\n {milestoneState === 'DRAFT' && (\n <FlexView\n $flexDirection=\"row\"\n $gap={4}\n $gutter={4}\n $alignItems=\"center\"\n $background={borderColor}\n >\n <Text $renderAs=\"ac4\">Draft</Text>\n </FlexView>\n )}\n </FlexView>\n\n <ArrowTooltip\n renderAs=\"primary\"\n position=\"bottom\"\n tooltipItem={milestoneName}\n hidden={!showTitleTooltip}\n >\n <Styled.MilestoneTitle\n ref={titleTextRef}\n $renderAs={!isGoalCreation ? 'ab1' : 'ah4'}\n $color=\"BLACK_1\"\n >\n {milestoneName}\n </Styled.MilestoneTitle>\n </ArrowTooltip>\n\n {milestoneState !== 'DRAFT' && (\n <Text $renderAs=\"ub3\" $color=\"BLACK_T_60\">\n {!!total && `${progressCompletionPercentage}% complete`}\n {!!total && milestoneState === 'ACTIVE' && remainingDays}\n </Text>\n )}\n </FlexView>\n\n {outcomes?.length ? (\n <>\n <Separator width={40} height={1} background=\"BLACK_T_15\" />\n <OutcomeWrapper outcomes={outcomes} />\n </>\n ) : undefined}\n </FlexView>\n </FlexView>\n\n {userType === 'TEACHER' && (\n <GoalActionCtas\n milestone={milestone}\n studentId={studentId}\n studentName={studentName}\n teacherName={teacherName ?? ''}\n parentName={parentName ?? ''}\n onAddOutcome={onAddOutcome}\n isClassOngoing={Boolean(isClassOngoing)}\n isStudentPresent={Boolean(isStudentPresent)}\n onDraftPublish={onDraftPublish}\n onEdit={onEdit}\n courseStream={courseStream}\n />\n )}\n </FlexView>\n );\n },\n);\n\nexport default MilestoneInfoWrapper;\n"],"names":["MilestoneInfoWrapper","memo","isClassOngoing","isStudentPresent","isExpanded","restMilestoneInfoWrapperProps","milestone","studentId","studentName","teacherName","parentName","userType","courseStream","outcomes","onEdit","onDraftPublish","onAddOutcome","milestoneName","dueDate","milestoneState","goalCategory","goalCode","progressStat","completed","total","isOutcomePending","progressCompletionPercentage","titleTextRef","useRef","showTitleTooltip","setShowTitleTooltip","useState","goalCategoryTextColor","borderColor","getGoalCategoryBasedColorTheme","outcomeStatusInfo","getMilestoneWidgetStatusInfo","backgroundColor","isGoalCreation","useMemo","remainingDays","getRemainingDaysToCompleteGoal","useLayoutEffect","jsxs","FlexView","Styled.ChapterProgressSVG","jsx","Styled.ChapterProgressSVGCircle","Image","GOAL_CATEGORY_BASED_IMAGES","Styled.StyledCheckIconWrapper","Check2Icon","Text","ArrowTooltip","Styled.MilestoneTitle","Fragment","Separator","OutcomeWrapper","GoalActionCtas"],"mappings":";;;;;;;;;;;;;AAoBA,MAAMA,KAA6DC;AAAA,EACjE,CAAC,EAAE,gBAAAC,GAAgB,kBAAAC,GAAkB,YAAAC,IAAY,GAAGC,QAAoC;AAChF,UAAA;AAAA,MACJ,WAAAC;AAAA,MACA,WAAAC;AAAA,MACA,aAAAC;AAAA,MACA,aAAAC;AAAA,MACA,YAAAC;AAAA,MACA,UAAAC;AAAA,MACA,cAAAC;AAAA,MACA,UAAAC;AAAA,MACA,QAAAC;AAAA,MACA,gBAAAC;AAAA,MACA,cAAAC;AAAA,IACE,IAAAX,GAEE;AAAA,MACJ,gBAAgBY;AAAA,MAChB,mBAAmBC;AAAA,MACnB,iBAAiBC;AAAA,MACjB,eAAeC;AAAA,MACf,WAAWC;AAAA,MACX,eAAeC;AAAA,IACb,IAAAhB,GAEE,EAAE,WAAAiB,IAAY,GAAG,OAAAC,IAAQ,EAAE,IAAIF,KAAgB,IAC/CG,IAAmBN,MAAmB,mBACtCO,IACJH,IAAY,IAAI,KAAK,OAAOA,IAAYC,KAAS,KAAK,GAAG,IAAI,GAEzDG,IAAeC,EAAuB,IAAI,GAC1C,CAACC,GAAkBC,CAAmB,IAAIC,EAAS,EAAK,GAExD,EAAE,WAAWC,GAAuB,aAAAC,EAAY,IACpDC,EAA+Bd,CAAY,GAEvCe,IAAoBC,EAA6BjB,CAAc,GAC/DkB,KACHZ,IAAmBU,KAAA,gBA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AA,oBAET,UAAA,gBAAAiB;AAAA,sBAACQ;AAAAA,sBAAA;AAAA,wBACC,KAAK3B;AAAA,wBACL,WAAYW,IAAyB,QAAR;AAAA,wBAC7B,QAAO;AAAA,wBAEN,UAAArB;AAAA,sBAAA;AAAA,oBACH;AAAA,kBAAA;AAAA,gBACF;AAAA,gBAECE,MAAmB,WAClB,gBAAAwB,EAACS,KAAK,WAAU,OAAM,QAAO,cAC1B,UAAA;AAAA,kBAAC,CAAA,CAAC5B,KAAS,GAAGE,CAA4B;AAAA,kBAC1C,CAAC,CAACF,KAASL,MAAmB,YAAYqB;AAAA,gBAAA,GAC7C;AAAA,cAAA,GAEJ;AAAA,cAEC3B,KAAA,QAAAA,EAAU,SAEP,gBAAA8B,EAAAY,GAAA,EAAA,UAAA;AAAA,gBAAA,gBAAAT,EAACU,KAAU,OAAO,IAAI,QAAQ,GAAG,YAAW,cAAa;AAAA,gBACzD,gBAAAV,EAACW,MAAe,UAAA5C,GAAoB;AAAA,cAAA,EACtC,CAAA,IACE;AAAA,YAAA,GACN;AAAA,UAAA,GACF;AAAA,UAECF,MAAa,aACZ,gBAAAmC;AAAA,YAACY;AAAA,YAAA;AAAA,cACC,WAAApD;AAAA,cACA,WAAAC;AAAA,cACA,aAAAC;AAAA,cACA,aAAaC,KAAe;AAAA,cAC5B,YAAYC,KAAc;AAAA,cAC1B,cAAAM;AAAA,cACA,gBAAgB,EAAQd;AAAA,cACxB,kBAAkB,EAAQC;AAAA,cAC1B,gBAAAY;AAAA,cACA,QAAAD;AAAA,cACA,cAAAF;AAAA,YAAA;AAAA,UACF;AAAA,QAAA;AAAA,MAAA;AAAA,IAAA,IA9HoB;AAAA,EAkI5B;AACF;"}
|
@@ -38,7 +38,7 @@ const R = (e) => {
|
|
38
38
|
total_questions: n,
|
39
39
|
worksheet_id: u,
|
40
40
|
is_timed: _
|
41
|
-
} = s, f = Math.ceil((h || 0) / 60), I = R(p), E = _ ? `${f} Mins` : "", $ = `${n ? `${n} ${S.pluralize(n, "Question")}` : ""} ${E}`;
|
41
|
+
} = s, f = Math.ceil((h || 0) / 60), I = R(p), E = _ ? `${f} Mins` : "", $ = `${n ? `${n} ${S.pluralize(n, "Question")}` : ""} • ${E}`;
|
42
42
|
return /* @__PURE__ */ t(
|
43
43
|
N,
|
44
44
|
{
|