@cuemath/leap 3.2.2 → 3.2.3-pdb-0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/illustrations/illustrations.js +1 -0
- package/dist/assets/illustrations/illustrations.js.map +1 -1
- package/dist/assets/lottie/lottie.js +5 -0
- package/dist/assets/lottie/lottie.js.map +1 -1
- package/dist/features/communication/pub-sub/constants.js +7 -4
- package/dist/features/communication/pub-sub/constants.js.map +1 -1
- package/dist/features/homework/homework-card-view.js +85 -97
- package/dist/features/homework/homework-card-view.js.map +1 -1
- package/dist/features/homework/homework-card.js +44 -42
- package/dist/features/homework/homework-card.js.map +1 -1
- package/dist/features/homework/hw-card-list/hw-card-list-view.js +31 -29
- package/dist/features/homework/hw-card-list/hw-card-list-view.js.map +1 -1
- package/dist/features/homework/hw-card-list/hw-card-list.js +57 -50
- package/dist/features/homework/hw-card-list/hw-card-list.js.map +1 -1
- package/dist/features/homework/utils.js +33 -27
- package/dist/features/homework/utils.js.map +1 -1
- package/dist/features/journey/hooks/use-puzzles-journey/use-puzzle-assigned.js +72 -0
- package/dist/features/journey/hooks/use-puzzles-journey/use-puzzle-assigned.js.map +1 -0
- package/dist/features/journey/hooks/use-puzzles-journey/use-puzzle-attempt-journey.js +59 -0
- package/dist/features/journey/hooks/use-puzzles-journey/use-puzzle-attempt-journey.js.map +1 -0
- package/dist/features/journey/hooks/use-puzzles-journey/use-puzzle-dashboard-journey.js +63 -0
- package/dist/features/journey/hooks/use-puzzles-journey/use-puzzle-dashboard-journey.js.map +1 -0
- package/dist/features/journey/journey-id/journey-id-student.js +2 -2
- package/dist/features/journey/journey-id/journey-id-student.js.map +1 -1
- package/dist/features/journey/journey-id/journey-id-teacher.js +1 -1
- package/dist/features/journey/journey-id/journey-id-teacher.js.map +1 -1
- package/dist/features/puzzles/api/puzzle-dashboard.js +10 -0
- package/dist/features/puzzles/api/puzzle-dashboard.js.map +1 -0
- package/dist/features/puzzles/comps/puzzle-card-styled.js +24 -69
- package/dist/features/puzzles/comps/puzzle-card-styled.js.map +1 -1
- package/dist/features/puzzles/comps/puzzle-card.js +53 -30
- package/dist/features/puzzles/comps/puzzle-card.js.map +1 -1
- package/dist/features/puzzles/constants/puzzle-container.js +8 -0
- package/dist/features/puzzles/constants/puzzle-container.js.map +1 -0
- package/dist/features/puzzles/puzzle-container/puzzle-container-styled.js +55 -25
- package/dist/features/puzzles/puzzle-container/puzzle-container-styled.js.map +1 -1
- package/dist/features/puzzles/puzzle-container/puzzle-container-view.js +45 -0
- package/dist/features/puzzles/puzzle-container/puzzle-container-view.js.map +1 -0
- package/dist/features/puzzles/puzzle-container/puzzle-container.js +89 -107
- package/dist/features/puzzles/puzzle-container/puzzle-container.js.map +1 -1
- package/dist/features/puzzles/puzzle-dashboard/puzzle-dashboard-styled.js +30 -0
- package/dist/features/puzzles/puzzle-dashboard/puzzle-dashboard-styled.js.map +1 -0
- package/dist/features/puzzles/puzzle-dashboard/puzzle-dashboard.js +84 -0
- package/dist/features/puzzles/puzzle-dashboard/puzzle-dashboard.js.map +1 -0
- package/dist/features/puzzles/utils/puzzle-pattern.js +28 -13
- package/dist/features/puzzles/utils/puzzle-pattern.js.map +1 -1
- package/dist/features/worksheet/worksheet/worksheet-helpers.js +20 -19
- package/dist/features/worksheet/worksheet/worksheet-helpers.js.map +1 -1
- package/dist/features/worksheet/worksheet/worksheet-question/learnosity-question.js +29 -25
- package/dist/features/worksheet/worksheet/worksheet-question/learnosity-question.js.map +1 -1
- package/dist/features/worksheet/worksheet/worksheet-question/worksheet-question-styled.js +97 -47
- package/dist/features/worksheet/worksheet/worksheet-question/worksheet-question-styled.js.map +1 -1
- package/dist/features/worksheet/worksheet/worksheet-question/worksheet-question.js +166 -163
- package/dist/features/worksheet/worksheet/worksheet-question/worksheet-question.js.map +1 -1
- package/dist/features/worksheet/worksheet/worksheet-questions-controller/worksheet-questions-controller.js +203 -198
- package/dist/features/worksheet/worksheet/worksheet-questions-controller/worksheet-questions-controller.js.map +1 -1
- package/dist/features/worksheet/worksheet/worksheet-styled.js +34 -34
- package/dist/features/worksheet/worksheet/worksheet-styled.js.map +1 -1
- package/dist/features/worksheet/worksheet/worksheet-types.js.map +1 -1
- package/dist/features/worksheet/worksheet/worksheet.js +303 -309
- package/dist/features/worksheet/worksheet/worksheet.js.map +1 -1
- package/dist/features/worksheet/worksheet-preview/hooks/use-worksheet-layout.js +1 -1
- package/dist/features/worksheet/worksheet-preview/hooks/use-worksheet-layout.js.map +1 -1
- package/dist/features/worksheet/worksheet-preview/worksheet-preview.js +17 -16
- package/dist/features/worksheet/worksheet-preview/worksheet-preview.js.map +1 -1
- package/dist/index.d.ts +49 -3
- package/dist/index.js +179 -175
- package/dist/index.js.map +1 -1
- package/dist/static/puzzle-blue-lottie.7017e2e8.json +1 -0
- package/dist/static/puzzle-blue-lottie.bf64ebc5.json +12760 -0
- package/dist/static/puzzle-dashboard-banner.b7956519.svg +1 -0
- package/dist/static/puzzle-green-lottie.1da90698.json +1 -0
- package/dist/static/puzzle-orange-lottie.cfcf3724.json +1 -0
- package/dist/static/puzzle-purple-lottie.e70de110.json +9860 -0
- package/dist/static/puzzle-yellow-lottie.275b5cf4.json +1 -0
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hw-card-list.js","sources":["../../../../src/features/homework/hw-card-list/hw-card-list.tsx"],"sourcesContent":["import type {\n INodeCardCallbacks,\n INodeDataProps,\n} from '../../chapters-v2/comps/node-card/node-card-types';\nimport type { IHomepageStartJourneyProps } from '../../journey/hooks/use-home-page-journey/homepage-journey-types';\nimport type { TUserTypes } from '../../ui/types';\n\nimport React, { memo, useCallback, useEffect } from 'react';\n\nimport { useJourney } from '../../journey/use-journey/use-journey';\nimport { useGetHomeworks } from './api/get-homeworks';\nimport HwCardListView from './hw-card-list-view';\n\ninterface HWCardListProps extends INodeCardCallbacks {\n userType: TUserTypes;\n studentId: string;\n stream: string;\n onTestPreview?: (sheetData: INodeDataProps, milestoneId?: string) => void;\n onTestStart?: (sheetData: INodeDataProps, homeworkId?: string) => void;\n onTestReview?: (sheetData: INodeDataProps, milestoneId?: string) => void;\n homeworkRef?: React.RefObject<HTMLDivElement>;\n startHomePageJourney?: ({ studentId, stream, userType }: IHomepageStartJourneyProps) => void;\n canStartJourney?: boolean;\n}\n\nconst HWCardList: React.FC<HWCardListProps> = ({\n userType,\n studentId,\n stream,\n onTestStart,\n onNodeAttempt,\n onTestPreview,\n onNodeView,\n onTestReview,\n onNodeReview,\n onNodeUnassign,\n homeworkRef,\n startHomePageJourney,\n canStartJourney,\n}) => {\n const {\n get: getHomeworks,\n data: hwDetails,\n isProcessingFailed,\n isProcessing,\n isProcessed,\n isStale,\n } = useGetHomeworks(studentId);\n const { isJourneyActive } = useJourney();\n\n useEffect(() => {\n if (isProcessed && startHomePageJourney && !isJourneyActive && canStartJourney) {\n startHomePageJourney({ studentId, stream, userType });\n }\n }, [\n canStartJourney,\n isJourneyActive,\n isProcessed,\n startHomePageJourney,\n stream,\n studentId,\n userType,\n ]);\n\n const fetchHomeworks = useCallback(() => {\n getHomeworks(studentId, undefined, { stream });\n }, [getHomeworks, stream, studentId]);\n\n useEffect(() => {\n if (!isProcessing && isStale) {\n fetchHomeworks();\n }\n }, [fetchHomeworks, isProcessing, isStale]);\n\n useEffect(() => {\n fetchHomeworks();\n }, [fetchHomeworks]);\n\n if (isProcessingFailed) {\n return null;\n }\n\n return (\n <div ref={homeworkRef}>\n <HwCardListView\n isHwProcessing={isProcessing}\n hwDetails={hwDetails}\n onTestStart={onTestStart}\n onNodeAttempt={onNodeAttempt}\n onTestPreview={onTestPreview}\n onNodeView={onNodeView}\n onTestReview={onTestReview}\n onNodeReview={onNodeReview}\n onNodeUnassign={onNodeUnassign}\n userType={userType}\n studentId={studentId}\n />\n </div>\n );\n};\n\nexport default memo(HWCardList);\n"],"names":["HWCardList","userType","studentId","stream","onTestStart","onNodeAttempt","onTestPreview","onNodeView","onTestReview","onNodeReview","onNodeUnassign","homeworkRef","startHomePageJourney","canStartJourney","getHomeworks","hwDetails","isProcessingFailed","isProcessing","isProcessed","isStale","useGetHomeworks","isJourneyActive","useJourney","useEffect","fetchHomeworks","useCallback","jsx","HwCardListView","hwCardList","memo"],"mappings":"
|
|
1
|
+
{"version":3,"file":"hw-card-list.js","sources":["../../../../src/features/homework/hw-card-list/hw-card-list.tsx"],"sourcesContent":["import type {\n INodeCardCallbacks,\n INodeDataProps,\n} from '../../chapters-v2/comps/node-card/node-card-types';\nimport type { IHomepageStartJourneyProps } from '../../journey/hooks/use-home-page-journey/homepage-journey-types';\nimport type { TUserTypes } from '../../ui/types';\n\nimport React, { memo, useCallback, useEffect } from 'react';\n\nimport { usePuzzleAssignedJourney } from '../../journey/hooks/use-puzzles-journey/use-puzzle-assigned';\nimport { useJourney } from '../../journey/use-journey/use-journey';\nimport { getPuzzleCardData } from '../utils';\nimport { useGetHomeworks } from './api/get-homeworks';\nimport HwCardListView from './hw-card-list-view';\n\ninterface HWCardListProps extends INodeCardCallbacks {\n userType: TUserTypes;\n studentId: string;\n stream: string;\n onTestPreview?: (sheetData: INodeDataProps, milestoneId?: string) => void;\n onTestStart?: (sheetData: INodeDataProps, homeworkId?: string) => void;\n onTestReview?: (sheetData: INodeDataProps, milestoneId?: string) => void;\n homeworkRef?: React.RefObject<HTMLDivElement>;\n startHomePageJourney?: ({ studentId, stream, userType }: IHomepageStartJourneyProps) => void;\n canStartJourney?: boolean;\n canStartPuzzleAssignedJourney?: boolean;\n}\n\nconst HWCardList: React.FC<HWCardListProps> = ({\n userType,\n studentId,\n stream,\n onTestStart,\n onNodeAttempt,\n onTestPreview,\n onNodeView,\n onTestReview,\n onNodeReview,\n onNodeUnassign,\n homeworkRef,\n startHomePageJourney,\n canStartJourney,\n canStartPuzzleAssignedJourney,\n}) => {\n const {\n get: getHomeworks,\n data: hwDetails,\n isProcessingFailed,\n isProcessing,\n isProcessed,\n isStale,\n } = useGetHomeworks(studentId);\n const { isJourneyActive } = useJourney();\n\n const { puzzleHWCardRef, startJourney: startPuzzleAssignedJourney } = usePuzzleAssignedJourney();\n\n useEffect(() => {\n if (isProcessed && startHomePageJourney && !isJourneyActive && canStartJourney) {\n startHomePageJourney({ studentId, stream, userType });\n }\n }, [\n canStartJourney,\n isJourneyActive,\n isProcessed,\n startHomePageJourney,\n stream,\n studentId,\n userType,\n ]);\n\n const fetchHomeworks = useCallback(() => {\n getHomeworks(studentId, undefined, { stream });\n }, [getHomeworks, stream, studentId]);\n\n useEffect(() => {\n if (!isProcessing && isStale) {\n fetchHomeworks();\n }\n }, [fetchHomeworks, isProcessing, isStale]);\n\n useEffect(() => {\n fetchHomeworks();\n }, [fetchHomeworks]);\n\n useEffect(() => {\n const nodeData = getPuzzleCardData(hwDetails);\n\n if (\n canStartPuzzleAssignedJourney &&\n !isJourneyActive &&\n startPuzzleAssignedJourney &&\n nodeData\n ) {\n startPuzzleAssignedJourney(nodeData);\n }\n }, [canStartPuzzleAssignedJourney, hwDetails, isJourneyActive, startPuzzleAssignedJourney]);\n\n if (isProcessingFailed) {\n return null;\n }\n\n return (\n <div ref={homeworkRef}>\n <HwCardListView\n isHwProcessing={isProcessing}\n hwDetails={hwDetails}\n onTestStart={onTestStart}\n onNodeAttempt={onNodeAttempt}\n onTestPreview={onTestPreview}\n onNodeView={onNodeView}\n onTestReview={onTestReview}\n onNodeReview={onNodeReview}\n onNodeUnassign={onNodeUnassign}\n userType={userType}\n studentId={studentId}\n puzzleHWCardRef={puzzleHWCardRef}\n />\n </div>\n );\n};\n\nexport default memo(HWCardList);\n"],"names":["HWCardList","userType","studentId","stream","onTestStart","onNodeAttempt","onTestPreview","onNodeView","onTestReview","onNodeReview","onNodeUnassign","homeworkRef","startHomePageJourney","canStartJourney","canStartPuzzleAssignedJourney","getHomeworks","hwDetails","isProcessingFailed","isProcessing","isProcessed","isStale","useGetHomeworks","isJourneyActive","useJourney","puzzleHWCardRef","startPuzzleAssignedJourney","usePuzzleAssignedJourney","useEffect","fetchHomeworks","useCallback","nodeData","getPuzzleCardData","jsx","HwCardListView","hwCardList","memo"],"mappings":";;;;;;;AA4BA,MAAMA,IAAwC,CAAC;AAAA,EAC7C,UAAAC;AAAA,EACA,WAAAC;AAAA,EACA,QAAAC;AAAA,EACA,aAAAC;AAAA,EACA,eAAAC;AAAA,EACA,eAAAC;AAAA,EACA,YAAAC;AAAA,EACA,cAAAC;AAAA,EACA,cAAAC;AAAA,EACA,gBAAAC;AAAA,EACA,aAAAC;AAAA,EACA,sBAAAC;AAAA,EACA,iBAAAC;AAAA,EACA,+BAAAC;AACF,MAAM;AACE,QAAA;AAAA,IACJ,KAAKC;AAAA,IACL,MAAMC;AAAA,IACN,oBAAAC;AAAA,IACA,cAAAC;AAAA,IACA,aAAAC;AAAA,IACA,SAAAC;AAAA,EAAA,IACEC,EAAgBnB,CAAS,GACvB,EAAE,iBAAAoB,MAAoBC,KAEtB,EAAE,iBAAAC,GAAiB,cAAcC,MAA+BC,EAAyB;AAE/F,EAAAC,EAAU,MAAM;AACd,IAAIR,KAAeP,KAAwB,CAACU,KAAmBT,KAC7DD,EAAqB,EAAE,WAAAV,GAAW,QAAAC,GAAQ,UAAAF,EAAU,CAAA;AAAA,EACtD,GACC;AAAA,IACDY;AAAA,IACAS;AAAA,IACAH;AAAA,IACAP;AAAA,IACAT;AAAA,IACAD;AAAA,IACAD;AAAA,EAAA,CACD;AAEK,QAAA2B,IAAiBC,EAAY,MAAM;AACvC,IAAAd,EAAab,GAAW,QAAW,EAAE,QAAAC,EAAQ,CAAA;AAAA,EAC5C,GAAA,CAACY,GAAcZ,GAAQD,CAAS,CAAC;AAyBpC,SAvBAyB,EAAU,MAAM;AACV,IAAA,CAACT,KAAgBE,KACJQ;EAEhB,GAAA,CAACA,GAAgBV,GAAcE,CAAO,CAAC,GAE1CO,EAAU,MAAM;AACC,IAAAC;EAAA,GACd,CAACA,CAAc,CAAC,GAEnBD,EAAU,MAAM;AACR,UAAAG,IAAWC,EAAkBf,CAAS;AAE5C,IACEF,KACA,CAACQ,KACDG,KACAK,KAEAL,EAA2BK,CAAQ;AAAA,KAEpC,CAAChB,GAA+BE,GAAWM,GAAiBG,CAA0B,CAAC,GAEtFR,IACK,OAIP,gBAAAe,EAAC,OAAI,EAAA,KAAKrB,GACR,UAAA,gBAAAqB;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,gBAAgBf;AAAA,MAChB,WAAAF;AAAA,MACA,aAAAZ;AAAA,MACA,eAAAC;AAAA,MACA,eAAAC;AAAA,MACA,YAAAC;AAAA,MACA,cAAAC;AAAA,MACA,cAAAC;AAAA,MACA,gBAAAC;AAAA,MACA,UAAAT;AAAA,MACA,WAAAC;AAAA,MACA,iBAAAsB;AAAA,IAAA;AAAA,EAEJ,EAAA,CAAA;AAEJ,GAEeU,IAAAC,EAAKnC,CAAU;"}
|
|
@@ -1,48 +1,54 @@
|
|
|
1
1
|
import { TESTS_CREATION_ANALYTICS_EVENTS as l } from "../milestone/milestone-tests/tests-creation/tests-creation-analytics-events.js";
|
|
2
|
-
import { NODE_TYPE as
|
|
2
|
+
import { NODE_TYPE as n } from "../sheets/constants/sheet.js";
|
|
3
3
|
import { HOMEWORK_ANALYTICS_EVENTS as c } from "./homework-analytics-events.js";
|
|
4
4
|
const y = ({
|
|
5
|
-
canResume:
|
|
6
|
-
canStart:
|
|
7
|
-
homeworkId:
|
|
8
|
-
isHomeWork:
|
|
9
|
-
isStudent:
|
|
10
|
-
milestoneId:
|
|
11
|
-
nodeType:
|
|
12
|
-
studentId:
|
|
13
|
-
userNodeId:
|
|
5
|
+
canResume: t,
|
|
6
|
+
canStart: e,
|
|
7
|
+
homeworkId: i,
|
|
8
|
+
isHomeWork: o,
|
|
9
|
+
isStudent: _,
|
|
10
|
+
milestoneId: s,
|
|
11
|
+
nodeType: r,
|
|
12
|
+
studentId: a,
|
|
13
|
+
userNodeId: d
|
|
14
14
|
}) => {
|
|
15
|
-
if (
|
|
16
|
-
if (
|
|
17
|
-
return
|
|
15
|
+
if (_) {
|
|
16
|
+
if (o)
|
|
17
|
+
return e || t ? {
|
|
18
18
|
analyticsLabel: c.HOMEWORK_ATTEMPTED,
|
|
19
|
-
analyticsProps: { student_id:
|
|
19
|
+
analyticsProps: { student_id: a, node_type: r, homework_id: i }
|
|
20
20
|
} : {
|
|
21
21
|
analyticsLabel: "homework-student-menu",
|
|
22
|
-
analyticsProps: { student_id:
|
|
22
|
+
analyticsProps: { student_id: a, node_type: r, homework_id: i }
|
|
23
23
|
};
|
|
24
|
-
if (
|
|
24
|
+
if (e || t)
|
|
25
25
|
return {
|
|
26
|
-
analyticsLabel:
|
|
26
|
+
analyticsLabel: r === n.DYNAMIC ? l.CUSTOM_TEST_ATTEMPTED : "node-attempted",
|
|
27
27
|
analyticsProps: {
|
|
28
|
-
student_id:
|
|
29
|
-
node_type:
|
|
30
|
-
user_node_id:
|
|
31
|
-
milestone_id:
|
|
32
|
-
can_start:
|
|
33
|
-
can_resume:
|
|
28
|
+
student_id: a,
|
|
29
|
+
node_type: r,
|
|
30
|
+
user_node_id: d,
|
|
31
|
+
milestone_id: s,
|
|
32
|
+
can_start: e,
|
|
33
|
+
can_resume: t
|
|
34
34
|
}
|
|
35
35
|
};
|
|
36
36
|
}
|
|
37
|
-
return
|
|
37
|
+
return o ? {
|
|
38
38
|
analyticsLabel: "homework-card-teacher",
|
|
39
|
-
analyticsProps: { student_id:
|
|
39
|
+
analyticsProps: { student_id: a, node_type: r }
|
|
40
40
|
} : {
|
|
41
41
|
analyticsLabel: "goals-card-teacher",
|
|
42
|
-
analyticsProps: { student_id:
|
|
42
|
+
analyticsProps: { student_id: a, node_type: r }
|
|
43
43
|
};
|
|
44
|
+
}, T = (t) => {
|
|
45
|
+
if (!t)
|
|
46
|
+
return;
|
|
47
|
+
const { assigned_homeworks: e } = t;
|
|
48
|
+
return e.find((i) => i.node_type === n.PUZZLE_CARD);
|
|
44
49
|
};
|
|
45
50
|
export {
|
|
46
|
-
y as getCardAnalyticProps
|
|
51
|
+
y as getCardAnalyticProps,
|
|
52
|
+
T as getPuzzleCardData
|
|
47
53
|
};
|
|
48
54
|
//# sourceMappingURL=utils.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sources":["../../../src/features/homework/utils.ts"],"sourcesContent":["import type { TNodeTypes } from '../chapters-v2/comps/node-card/node-card-types';\n\nimport { TESTS_CREATION_ANALYTICS_EVENTS } from '../milestone/milestone-tests/tests-creation/tests-creation-analytics-events';\nimport { NODE_TYPE } from '../sheets/constants/sheet';\nimport { HOMEWORK_ANALYTICS_EVENTS } from './homework-analytics-events';\n\ninterface IGetCardAnalyticProps {\n canResume: boolean;\n canStart: boolean;\n homeworkId?: string;\n isHomeWork: boolean;\n isStudent: boolean;\n milestoneId?: string;\n nodeType: TNodeTypes;\n studentId: string;\n userNodeId: string | null;\n}\n\nconst getCardAnalyticProps = ({\n canResume,\n canStart,\n homeworkId,\n isHomeWork,\n isStudent,\n milestoneId,\n nodeType,\n studentId,\n userNodeId,\n}: IGetCardAnalyticProps) => {\n if (isStudent) {\n if (isHomeWork) {\n if (canStart || canResume) {\n return {\n analyticsLabel: HOMEWORK_ANALYTICS_EVENTS.HOMEWORK_ATTEMPTED,\n analyticsProps: { student_id: studentId, node_type: nodeType, homework_id: homeworkId },\n };\n }\n\n return {\n analyticsLabel: 'homework-student-menu',\n analyticsProps: { student_id: studentId, node_type: nodeType, homework_id: homeworkId },\n };\n }\n\n if (canStart || canResume) {\n return {\n analyticsLabel:\n nodeType === NODE_TYPE.DYNAMIC\n ? TESTS_CREATION_ANALYTICS_EVENTS.CUSTOM_TEST_ATTEMPTED\n : 'node-attempted',\n analyticsProps: {\n student_id: studentId,\n node_type: nodeType,\n user_node_id: userNodeId,\n milestone_id: milestoneId,\n can_start: canStart,\n can_resume: canResume,\n },\n };\n }\n }\n\n if (isHomeWork) {\n return {\n analyticsLabel: 'homework-card-teacher',\n analyticsProps: { student_id: studentId, node_type: nodeType },\n };\n }\n\n return {\n analyticsLabel: 'goals-card-teacher',\n analyticsProps: { student_id: studentId, node_type: nodeType },\n };\n};\n\nexport { getCardAnalyticProps };\n"],"names":["getCardAnalyticProps","canResume","canStart","homeworkId","isHomeWork","isStudent","milestoneId","nodeType","studentId","userNodeId","HOMEWORK_ANALYTICS_EVENTS","NODE_TYPE","TESTS_CREATION_ANALYTICS_EVENTS"],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"utils.js","sources":["../../../src/features/homework/utils.ts"],"sourcesContent":["import type { TNodeTypes } from '../chapters-v2/comps/node-card/node-card-types';\nimport type { IHomeworkDetails } from './hw-card-list/api/get-homeworks';\n\nimport { TESTS_CREATION_ANALYTICS_EVENTS } from '../milestone/milestone-tests/tests-creation/tests-creation-analytics-events';\nimport { NODE_TYPE } from '../sheets/constants/sheet';\nimport { HOMEWORK_ANALYTICS_EVENTS } from './homework-analytics-events';\n\ninterface IGetCardAnalyticProps {\n canResume: boolean;\n canStart: boolean;\n homeworkId?: string;\n isHomeWork: boolean;\n isStudent: boolean;\n milestoneId?: string;\n nodeType: TNodeTypes;\n studentId: string;\n userNodeId: string | null;\n}\n\nconst getCardAnalyticProps = ({\n canResume,\n canStart,\n homeworkId,\n isHomeWork,\n isStudent,\n milestoneId,\n nodeType,\n studentId,\n userNodeId,\n}: IGetCardAnalyticProps) => {\n if (isStudent) {\n if (isHomeWork) {\n if (canStart || canResume) {\n return {\n analyticsLabel: HOMEWORK_ANALYTICS_EVENTS.HOMEWORK_ATTEMPTED,\n analyticsProps: { student_id: studentId, node_type: nodeType, homework_id: homeworkId },\n };\n }\n\n return {\n analyticsLabel: 'homework-student-menu',\n analyticsProps: { student_id: studentId, node_type: nodeType, homework_id: homeworkId },\n };\n }\n\n if (canStart || canResume) {\n return {\n analyticsLabel:\n nodeType === NODE_TYPE.DYNAMIC\n ? TESTS_CREATION_ANALYTICS_EVENTS.CUSTOM_TEST_ATTEMPTED\n : 'node-attempted',\n analyticsProps: {\n student_id: studentId,\n node_type: nodeType,\n user_node_id: userNodeId,\n milestone_id: milestoneId,\n can_start: canStart,\n can_resume: canResume,\n },\n };\n }\n }\n\n if (isHomeWork) {\n return {\n analyticsLabel: 'homework-card-teacher',\n analyticsProps: { student_id: studentId, node_type: nodeType },\n };\n }\n\n return {\n analyticsLabel: 'goals-card-teacher',\n analyticsProps: { student_id: studentId, node_type: nodeType },\n };\n};\n\nconst getPuzzleCardData = (hwDetails?: IHomeworkDetails) => {\n if (!hwDetails) {\n return undefined;\n }\n\n const { assigned_homeworks: assignedHomework } = hwDetails;\n\n return assignedHomework.find(homework => homework.node_type === NODE_TYPE.PUZZLE_CARD);\n};\n\nexport { getCardAnalyticProps, getPuzzleCardData };\n"],"names":["getCardAnalyticProps","canResume","canStart","homeworkId","isHomeWork","isStudent","milestoneId","nodeType","studentId","userNodeId","HOMEWORK_ANALYTICS_EVENTS","NODE_TYPE","TESTS_CREATION_ANALYTICS_EVENTS","getPuzzleCardData","hwDetails","assignedHomework","homework"],"mappings":";;;AAmBA,MAAMA,IAAuB,CAAC;AAAA,EAC5B,WAAAC;AAAA,EACA,UAAAC;AAAA,EACA,YAAAC;AAAA,EACA,YAAAC;AAAA,EACA,WAAAC;AAAA,EACA,aAAAC;AAAA,EACA,UAAAC;AAAA,EACA,WAAAC;AAAA,EACA,YAAAC;AACF,MAA6B;AAC3B,MAAIJ,GAAW;AACb,QAAID;AACF,aAAIF,KAAYD,IACP;AAAA,QACL,gBAAgBS,EAA0B;AAAA,QAC1C,gBAAgB,EAAE,YAAYF,GAAW,WAAWD,GAAU,aAAaJ,EAAW;AAAA,MAAA,IAInF;AAAA,QACL,gBAAgB;AAAA,QAChB,gBAAgB,EAAE,YAAYK,GAAW,WAAWD,GAAU,aAAaJ,EAAW;AAAA,MAAA;AAI1F,QAAID,KAAYD;AACP,aAAA;AAAA,QACL,gBACEM,MAAaI,EAAU,UACnBC,EAAgC,wBAChC;AAAA,QACN,gBAAgB;AAAA,UACd,YAAYJ;AAAA,UACZ,WAAWD;AAAA,UACX,cAAcE;AAAA,UACd,cAAcH;AAAA,UACd,WAAWJ;AAAA,UACX,YAAYD;AAAA,QACd;AAAA,MAAA;AAAA,EAGN;AAEA,SAAIG,IACK;AAAA,IACL,gBAAgB;AAAA,IAChB,gBAAgB,EAAE,YAAYI,GAAW,WAAWD,EAAS;AAAA,EAAA,IAI1D;AAAA,IACL,gBAAgB;AAAA,IAChB,gBAAgB,EAAE,YAAYC,GAAW,WAAWD,EAAS;AAAA,EAAA;AAEjE,GAEMM,IAAoB,CAACC,MAAiC;AAC1D,MAAI,CAACA;AACI;AAGH,QAAA,EAAE,oBAAoBC,EAAqB,IAAAD;AAEjD,SAAOC,EAAiB,KAAK,CAAAC,MAAYA,EAAS,cAAcL,EAAU,WAAW;AACvF;"}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import { useRef as r, useCallback as n, useMemo as h } from "react";
|
|
3
|
+
import C from "../../../homework/homework-card-view.js";
|
|
4
|
+
import T from "../../../ui/layout/flex-view.js";
|
|
5
|
+
import { JOURNEY_ID_STUDENT as w } from "../../journey-id/journey-id-student.js";
|
|
6
|
+
import { IndicatorType as E } from "../../use-journey/constants.js";
|
|
7
|
+
import { useJourney as b } from "../../use-journey/use-journey.js";
|
|
8
|
+
import g from "../use-home-page-journey/tooltip-item.js";
|
|
9
|
+
const z = () => {
|
|
10
|
+
const e = w.PUZZLE_ASSIGNED_JOURNEY, d = r(null), o = r(null), p = r([]), { setJourney: i, endJourney: s, nextCoachmark: l } = b(), a = n(() => {
|
|
11
|
+
l(e, !1, 0, !1);
|
|
12
|
+
}, [e, l]), u = n(() => {
|
|
13
|
+
document.body.style.overflow = "unset", s(e);
|
|
14
|
+
}, [s, e]), m = n(
|
|
15
|
+
(f) => {
|
|
16
|
+
if (!(o != null && o.current))
|
|
17
|
+
return;
|
|
18
|
+
const y = [
|
|
19
|
+
{
|
|
20
|
+
originalElementToHighlightRef: o,
|
|
21
|
+
elementToHighlight: /* @__PURE__ */ t(T, { children: /* @__PURE__ */ t(
|
|
22
|
+
C,
|
|
23
|
+
{
|
|
24
|
+
header: "",
|
|
25
|
+
subHeader: "",
|
|
26
|
+
userType: "STUDENT",
|
|
27
|
+
nodeData: f,
|
|
28
|
+
studentContainerRef: d
|
|
29
|
+
}
|
|
30
|
+
) }),
|
|
31
|
+
type: E.TOOLTIP,
|
|
32
|
+
indicator: {
|
|
33
|
+
renderAs: "primary",
|
|
34
|
+
tooltipXCoOrdinates: 66,
|
|
35
|
+
arrowSize: 12,
|
|
36
|
+
arrowXCoOrdinates: -100,
|
|
37
|
+
position: "bottom",
|
|
38
|
+
backgroundColor: "GREEN_4",
|
|
39
|
+
borderColor: "BLACK",
|
|
40
|
+
arrowColor: "BLACK",
|
|
41
|
+
tooltipItem: /* @__PURE__ */ t(
|
|
42
|
+
g,
|
|
43
|
+
{
|
|
44
|
+
text: "New Puzzle assigned! Click here to view.",
|
|
45
|
+
buttonLabel: "Got it",
|
|
46
|
+
onButtonClick: u
|
|
47
|
+
}
|
|
48
|
+
)
|
|
49
|
+
},
|
|
50
|
+
isActive: !1
|
|
51
|
+
}
|
|
52
|
+
];
|
|
53
|
+
i(e, y);
|
|
54
|
+
const c = setTimeout(() => {
|
|
55
|
+
clearTimeout(c), document.body.style.overflow = "hidden", a();
|
|
56
|
+
}, 500);
|
|
57
|
+
p.current.push(c);
|
|
58
|
+
},
|
|
59
|
+
[u, a, e, i]
|
|
60
|
+
);
|
|
61
|
+
return h(
|
|
62
|
+
() => ({
|
|
63
|
+
puzzleHWCardRef: o,
|
|
64
|
+
startJourney: m
|
|
65
|
+
}),
|
|
66
|
+
[m]
|
|
67
|
+
);
|
|
68
|
+
};
|
|
69
|
+
export {
|
|
70
|
+
z as usePuzzleAssignedJourney
|
|
71
|
+
};
|
|
72
|
+
//# sourceMappingURL=use-puzzle-assigned.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-puzzle-assigned.js","sources":["../../../../../src/features/journey/hooks/use-puzzles-journey/use-puzzle-assigned.tsx"],"sourcesContent":["import type { INodeDataProps } from '../../../chapters-v2/comps/node-card/node-card-types';\nimport type { IArrowTooltipProps } from '../../../ui/arrow-tooltip/arrow-tooltip-types';\nimport type { ICoachmarkProps } from '../../use-journey/journey-context-types';\n\nimport { useCallback, useMemo, useRef } from 'react';\n\nimport HomeworkCardView from '../../../homework/homework-card-view';\nimport FlexView from '../../../ui/layout/flex-view';\nimport { JOURNEY_ID_STUDENT } from '../../journey-id/journey-id-student';\nimport { IndicatorType } from '../../use-journey/constants';\nimport { useJourney } from '../../use-journey/use-journey';\nimport TooltipItem from '../use-home-page-journey/tooltip-item';\n\nconst usePuzzleAssignedJourney = () => {\n const journeyId = JOURNEY_ID_STUDENT.PUZZLE_ASSIGNED_JOURNEY;\n\n const studentContainerRef = useRef<HTMLDivElement>(null) as React.RefObject<HTMLDivElement>;\n const puzzleHWCardRef = useRef<HTMLDivElement>(null) as React.RefObject<HTMLDivElement>;\n const timerRefs = useRef<ReturnType<typeof setTimeout>[]>([]);\n\n const { setJourney, endJourney, nextCoachmark } = useJourney();\n\n const handleNextCoachMark = useCallback(() => {\n nextCoachmark(journeyId, false, 0, false);\n }, [journeyId, nextCoachmark]);\n\n const handleEndJourney = useCallback(() => {\n document.body.style.overflow = 'unset';\n endJourney(journeyId);\n }, [endJourney, journeyId]);\n\n const startJourney = useCallback(\n (nodeData: INodeDataProps) => {\n if (!puzzleHWCardRef?.current) {\n return;\n }\n\n const puzzleAttemptSteps: ICoachmarkProps[] = [\n {\n originalElementToHighlightRef: puzzleHWCardRef,\n elementToHighlight: (\n <FlexView>\n <HomeworkCardView\n header=\"\"\n subHeader=\"\"\n userType=\"STUDENT\"\n nodeData={nodeData}\n studentContainerRef={studentContainerRef}\n />\n </FlexView>\n ),\n type: IndicatorType.TOOLTIP,\n indicator: {\n renderAs: 'primary',\n tooltipXCoOrdinates: 66,\n arrowSize: 12,\n arrowXCoOrdinates: -100,\n position: 'bottom',\n backgroundColor: 'GREEN_4',\n borderColor: 'BLACK',\n arrowColor: 'BLACK',\n tooltipItem: (\n <TooltipItem\n text=\"New Puzzle assigned! Click here to view.\"\n buttonLabel=\"Got it\"\n onButtonClick={handleEndJourney}\n />\n ),\n } as IArrowTooltipProps,\n isActive: false,\n },\n ];\n\n setJourney(journeyId, puzzleAttemptSteps);\n\n const delayBeforeStart = setTimeout(() => {\n clearTimeout(delayBeforeStart);\n document.body.style.overflow = 'hidden';\n handleNextCoachMark();\n }, 500);\n\n timerRefs.current.push(delayBeforeStart);\n },\n [handleEndJourney, handleNextCoachMark, journeyId, setJourney],\n );\n\n const data = useMemo(\n () => ({\n puzzleHWCardRef,\n startJourney,\n }),\n [startJourney],\n );\n\n return data;\n};\n\nexport { usePuzzleAssignedJourney };\n"],"names":["usePuzzleAssignedJourney","journeyId","JOURNEY_ID_STUDENT","studentContainerRef","useRef","puzzleHWCardRef","timerRefs","setJourney","endJourney","nextCoachmark","useJourney","handleNextCoachMark","useCallback","handleEndJourney","startJourney","nodeData","puzzleAttemptSteps","FlexView","jsx","HomeworkCardView","IndicatorType","TooltipItem","delayBeforeStart","useMemo"],"mappings":";;;;;;;;AAaA,MAAMA,IAA2B,MAAM;AACrC,QAAMC,IAAYC,EAAmB,yBAE/BC,IAAsBC,EAAuB,IAAI,GACjDC,IAAkBD,EAAuB,IAAI,GAC7CE,IAAYF,EAAwC,CAAA,CAAE,GAEtD,EAAE,YAAAG,GAAY,YAAAC,GAAY,eAAAC,MAAkBC,EAAW,GAEvDC,IAAsBC,EAAY,MAAM;AAC9B,IAAAH,EAAAR,GAAW,IAAO,GAAG,EAAK;AAAA,EAAA,GACvC,CAACA,GAAWQ,CAAa,CAAC,GAEvBI,IAAmBD,EAAY,MAAM;AAChC,aAAA,KAAK,MAAM,WAAW,SAC/BJ,EAAWP,CAAS;AAAA,EAAA,GACnB,CAACO,GAAYP,CAAS,CAAC,GAEpBa,IAAeF;AAAA,IACnB,CAACG,MAA6B;AACxB,UAAA,EAACV,KAAA,QAAAA,EAAiB;AACpB;AAGF,YAAMW,IAAwC;AAAA,QAC5C;AAAA,UACE,+BAA+BX;AAAA,UAC/B,sCACGY,GACC,EAAA,UAAA,gBAAAC;AAAA,YAACC;AAAA,YAAA;AAAA,cACC,QAAO;AAAA,cACP,WAAU;AAAA,cACV,UAAS;AAAA,cACT,UAAAJ;AAAA,cACA,qBAAAZ;AAAA,YAAA;AAAA,UAAA,GAEJ;AAAA,UAEF,MAAMiB,EAAc;AAAA,UACpB,WAAW;AAAA,YACT,UAAU;AAAA,YACV,qBAAqB;AAAA,YACrB,WAAW;AAAA,YACX,mBAAmB;AAAA,YACnB,UAAU;AAAA,YACV,iBAAiB;AAAA,YACjB,aAAa;AAAA,YACb,YAAY;AAAA,YACZ,aACE,gBAAAF;AAAA,cAACG;AAAA,cAAA;AAAA,gBACC,MAAK;AAAA,gBACL,aAAY;AAAA,gBACZ,eAAeR;AAAA,cAAA;AAAA,YACjB;AAAA,UAEJ;AAAA,UACA,UAAU;AAAA,QACZ;AAAA,MAAA;AAGF,MAAAN,EAAWN,GAAWe,CAAkB;AAElC,YAAAM,IAAmB,WAAW,MAAM;AACxC,qBAAaA,CAAgB,GACpB,SAAA,KAAK,MAAM,WAAW,UACXX;SACnB,GAAG;AAEI,MAAAL,EAAA,QAAQ,KAAKgB,CAAgB;AAAA,IACzC;AAAA,IACA,CAACT,GAAkBF,GAAqBV,GAAWM,CAAU;AAAA,EAAA;AAWxD,SARMgB;AAAA,IACX,OAAO;AAAA,MACL,iBAAAlB;AAAA,MACA,cAAAS;AAAA,IAAA;AAAA,IAEF,CAACA,CAAY;AAAA,EAAA;AAIjB;"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import { useRef as c, useCallback as r, useMemo as y } from "react";
|
|
3
|
+
import f from "../../../ui/buttons/button/button.js";
|
|
4
|
+
import { JOURNEY_ID_STUDENT as h } from "../../journey-id/journey-id-student.js";
|
|
5
|
+
import { IndicatorType as T } from "../../use-journey/constants.js";
|
|
6
|
+
import { useJourney as C } from "../../use-journey/use-journey.js";
|
|
7
|
+
import b from "../use-home-page-journey/tooltip-item.js";
|
|
8
|
+
const z = () => {
|
|
9
|
+
const o = h.PUZZLE_ATTEMPT_JOURNEY, e = c(null), d = c([]), { setJourney: n, endJourney: i, nextCoachmark: s } = C(), l = r(() => {
|
|
10
|
+
s(o, !1, 0, !1);
|
|
11
|
+
}, [o, s]), a = r(() => {
|
|
12
|
+
document.body.style.overflow = "unset", i(o);
|
|
13
|
+
}, [i, o]), u = r(() => {
|
|
14
|
+
if (!(e != null && e.current))
|
|
15
|
+
return;
|
|
16
|
+
const p = [
|
|
17
|
+
{
|
|
18
|
+
originalElementToHighlightRef: e,
|
|
19
|
+
elementToHighlight: /* @__PURE__ */ t("div", { children: /* @__PURE__ */ t(f, { renderAs: "primary", size: "small", label: "I have solved" }) }),
|
|
20
|
+
type: T.TOOLTIP,
|
|
21
|
+
indicator: {
|
|
22
|
+
renderAs: "primary",
|
|
23
|
+
tooltipXCoOrdinates: -100,
|
|
24
|
+
arrowSize: 12,
|
|
25
|
+
arrowXCoOrdinates: 100,
|
|
26
|
+
position: "top",
|
|
27
|
+
backgroundColor: "PURPLE_4",
|
|
28
|
+
borderColor: "BLACK",
|
|
29
|
+
arrowColor: "BLACK",
|
|
30
|
+
tooltipItem: /* @__PURE__ */ t(
|
|
31
|
+
b,
|
|
32
|
+
{
|
|
33
|
+
text: "Click here when you've solved the puzzle.",
|
|
34
|
+
buttonLabel: "Got it",
|
|
35
|
+
onButtonClick: a
|
|
36
|
+
}
|
|
37
|
+
)
|
|
38
|
+
},
|
|
39
|
+
isActive: !1
|
|
40
|
+
}
|
|
41
|
+
];
|
|
42
|
+
n(o, p);
|
|
43
|
+
const m = setTimeout(() => {
|
|
44
|
+
clearTimeout(m), document.body.style.overflow = "hidden", l();
|
|
45
|
+
}, 500);
|
|
46
|
+
d.current.push(m);
|
|
47
|
+
}, [a, l, o, n]);
|
|
48
|
+
return y(
|
|
49
|
+
() => ({
|
|
50
|
+
puzzleAttemptCtaRef: e,
|
|
51
|
+
startJourney: u
|
|
52
|
+
}),
|
|
53
|
+
[u]
|
|
54
|
+
);
|
|
55
|
+
};
|
|
56
|
+
export {
|
|
57
|
+
z as usePuzzleAttemptJourney
|
|
58
|
+
};
|
|
59
|
+
//# sourceMappingURL=use-puzzle-attempt-journey.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-puzzle-attempt-journey.js","sources":["../../../../../src/features/journey/hooks/use-puzzles-journey/use-puzzle-attempt-journey.tsx"],"sourcesContent":["import type { IArrowTooltipProps } from '../../../ui/arrow-tooltip/arrow-tooltip-types';\nimport type { ICoachmarkProps } from '../../use-journey/journey-context-types';\n\nimport { useCallback, useMemo, useRef } from 'react';\n\nimport Button from '../../../ui/buttons/button/button';\nimport { JOURNEY_ID_STUDENT } from '../../journey-id/journey-id-student';\nimport { IndicatorType } from '../../use-journey/constants';\nimport { useJourney } from '../../use-journey/use-journey';\nimport TooltipItem from '../use-home-page-journey/tooltip-item';\n\nconst usePuzzleAttemptJourney = () => {\n const journeyId = JOURNEY_ID_STUDENT.PUZZLE_ATTEMPT_JOURNEY;\n\n const puzzleAttemptCtaRef = useRef<HTMLDivElement>(null) as React.RefObject<HTMLDivElement>;\n const timerRefs = useRef<ReturnType<typeof setTimeout>[]>([]);\n\n const { setJourney, endJourney, nextCoachmark } = useJourney();\n\n const handleNextCoachMark = useCallback(() => {\n nextCoachmark(journeyId, false, 0, false);\n }, [journeyId, nextCoachmark]);\n\n const handleEndJourney = useCallback(() => {\n document.body.style.overflow = 'unset';\n endJourney(journeyId);\n }, [endJourney, journeyId]);\n\n const startJourney = useCallback(() => {\n if (!puzzleAttemptCtaRef?.current) {\n return;\n }\n\n const puzzleAttemptSteps: ICoachmarkProps[] = [\n {\n originalElementToHighlightRef: puzzleAttemptCtaRef,\n elementToHighlight: (\n <div>\n <Button renderAs=\"primary\" size=\"small\" label=\"I have solved\" />\n </div>\n ),\n type: IndicatorType.TOOLTIP,\n indicator: {\n renderAs: 'primary',\n tooltipXCoOrdinates: -100,\n arrowSize: 12,\n arrowXCoOrdinates: 100,\n position: 'top',\n backgroundColor: 'PURPLE_4',\n borderColor: 'BLACK',\n arrowColor: 'BLACK',\n tooltipItem: (\n <TooltipItem\n text={`Click here when you've solved the puzzle.`}\n buttonLabel=\"Got it\"\n onButtonClick={handleEndJourney}\n />\n ),\n } as IArrowTooltipProps,\n isActive: false,\n },\n ];\n\n setJourney(journeyId, puzzleAttemptSteps);\n\n const delayBeforeStart = setTimeout(() => {\n clearTimeout(delayBeforeStart);\n document.body.style.overflow = 'hidden';\n handleNextCoachMark();\n }, 500);\n\n timerRefs.current.push(delayBeforeStart);\n }, [handleEndJourney, handleNextCoachMark, journeyId, setJourney]);\n\n const data = useMemo(\n () => ({\n puzzleAttemptCtaRef,\n startJourney,\n }),\n [startJourney],\n );\n\n return data;\n};\n\nexport { usePuzzleAttemptJourney };\n"],"names":["usePuzzleAttemptJourney","journeyId","JOURNEY_ID_STUDENT","puzzleAttemptCtaRef","useRef","timerRefs","setJourney","endJourney","nextCoachmark","useJourney","handleNextCoachMark","useCallback","handleEndJourney","startJourney","puzzleAttemptSteps","jsx","Button","IndicatorType","TooltipItem","delayBeforeStart","useMemo"],"mappings":";;;;;;;AAWA,MAAMA,IAA0B,MAAM;AACpC,QAAMC,IAAYC,EAAmB,wBAE/BC,IAAsBC,EAAuB,IAAI,GACjDC,IAAYD,EAAwC,CAAA,CAAE,GAEtD,EAAE,YAAAE,GAAY,YAAAC,GAAY,eAAAC,MAAkBC,EAAW,GAEvDC,IAAsBC,EAAY,MAAM;AAC9B,IAAAH,EAAAP,GAAW,IAAO,GAAG,EAAK;AAAA,EAAA,GACvC,CAACA,GAAWO,CAAa,CAAC,GAEvBI,IAAmBD,EAAY,MAAM;AAChC,aAAA,KAAK,MAAM,WAAW,SAC/BJ,EAAWN,CAAS;AAAA,EAAA,GACnB,CAACM,GAAYN,CAAS,CAAC,GAEpBY,IAAeF,EAAY,MAAM;AACjC,QAAA,EAACR,KAAA,QAAAA,EAAqB;AACxB;AAGF,UAAMW,IAAwC;AAAA,MAC5C;AAAA,QACE,+BAA+BX;AAAA,QAC/B,oBACG,gBAAAY,EAAA,OAAA,EACC,UAAC,gBAAAA,EAAAC,GAAA,EAAO,UAAS,WAAU,MAAK,SAAQ,OAAM,gBAAA,CAAgB,EAChE,CAAA;AAAA,QAEF,MAAMC,EAAc;AAAA,QACpB,WAAW;AAAA,UACT,UAAU;AAAA,UACV,qBAAqB;AAAA,UACrB,WAAW;AAAA,UACX,mBAAmB;AAAA,UACnB,UAAU;AAAA,UACV,iBAAiB;AAAA,UACjB,aAAa;AAAA,UACb,YAAY;AAAA,UACZ,aACE,gBAAAF;AAAA,YAACG;AAAA,YAAA;AAAA,cACC,MAAM;AAAA,cACN,aAAY;AAAA,cACZ,eAAeN;AAAA,YAAA;AAAA,UACjB;AAAA,QAEJ;AAAA,QACA,UAAU;AAAA,MACZ;AAAA,IAAA;AAGF,IAAAN,EAAWL,GAAWa,CAAkB;AAElC,UAAAK,IAAmB,WAAW,MAAM;AACxC,mBAAaA,CAAgB,GACpB,SAAA,KAAK,MAAM,WAAW,UACXT;OACnB,GAAG;AAEI,IAAAL,EAAA,QAAQ,KAAKc,CAAgB;AAAA,KACtC,CAACP,GAAkBF,GAAqBT,GAAWK,CAAU,CAAC;AAU1D,SARMc;AAAA,IACX,OAAO;AAAA,MACL,qBAAAjB;AAAA,MACA,cAAAU;AAAA,IAAA;AAAA,IAEF,CAACA,CAAY;AAAA,EAAA;AAIjB;"}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { useRef as c, useCallback as r, useMemo as f } from "react";
|
|
3
|
+
import h from "../../../ui/avatar/avatar.js";
|
|
4
|
+
import { JOURNEY_ID_STUDENT as C } from "../../journey-id/journey-id-student.js";
|
|
5
|
+
import { IndicatorType as T } from "../../use-journey/constants.js";
|
|
6
|
+
import { useJourney as b } from "../../use-journey/use-journey.js";
|
|
7
|
+
import A from "../use-home-page-journey/tooltip-item.js";
|
|
8
|
+
const I = () => {
|
|
9
|
+
const o = C.PUZZLE_DASHBOARD_JOURNEY, t = c(null), d = c([]), { setJourney: n, endJourney: i, nextCoachmark: s } = b(), a = r(() => {
|
|
10
|
+
s(o, !1, 0, !1);
|
|
11
|
+
}, [o, s]), l = r(() => {
|
|
12
|
+
document.body.style.overflow = "unset", i(o);
|
|
13
|
+
}, [i, o]), u = r(
|
|
14
|
+
(p) => {
|
|
15
|
+
if (!(t != null && t.current))
|
|
16
|
+
return;
|
|
17
|
+
const y = [
|
|
18
|
+
{
|
|
19
|
+
originalElementToHighlightRef: t,
|
|
20
|
+
elementToHighlight: /* @__PURE__ */ e("div", { children: /* @__PURE__ */ e(h, { size: 55, avatar: p }) }),
|
|
21
|
+
type: T.TOOLTIP,
|
|
22
|
+
indicator: {
|
|
23
|
+
renderAs: "primary",
|
|
24
|
+
tooltipXCoOrdinates: 14,
|
|
25
|
+
tooltipYCoOrdinates: 36,
|
|
26
|
+
arrowSize: 12,
|
|
27
|
+
arrowYCoOrdinates: -36,
|
|
28
|
+
position: "right",
|
|
29
|
+
backgroundColor: "BLUE_4",
|
|
30
|
+
borderColor: "BLACK",
|
|
31
|
+
arrowColor: "BLACK",
|
|
32
|
+
tooltipItem: /* @__PURE__ */ e(
|
|
33
|
+
A,
|
|
34
|
+
{
|
|
35
|
+
text: "Click here to see all previously solved puzzles.",
|
|
36
|
+
buttonLabel: "Got it",
|
|
37
|
+
onButtonClick: l
|
|
38
|
+
}
|
|
39
|
+
)
|
|
40
|
+
},
|
|
41
|
+
isActive: !1
|
|
42
|
+
}
|
|
43
|
+
];
|
|
44
|
+
n(o, y);
|
|
45
|
+
const m = setTimeout(() => {
|
|
46
|
+
clearTimeout(m), document.body.style.overflow = "hidden", a();
|
|
47
|
+
}, 500);
|
|
48
|
+
d.current.push(m);
|
|
49
|
+
},
|
|
50
|
+
[l, a, o, n]
|
|
51
|
+
);
|
|
52
|
+
return f(
|
|
53
|
+
() => ({
|
|
54
|
+
puzzleProfileRef: t,
|
|
55
|
+
startJourney: u
|
|
56
|
+
}),
|
|
57
|
+
[u]
|
|
58
|
+
);
|
|
59
|
+
};
|
|
60
|
+
export {
|
|
61
|
+
I as usePuzzleDashboardJourney
|
|
62
|
+
};
|
|
63
|
+
//# sourceMappingURL=use-puzzle-dashboard-journey.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-puzzle-dashboard-journey.js","sources":["../../../../../src/features/journey/hooks/use-puzzles-journey/use-puzzle-dashboard-journey.tsx"],"sourcesContent":["import type { IArrowTooltipProps } from '../../../ui/arrow-tooltip/arrow-tooltip-types';\nimport type { IAvatarLayer } from '../../../ui/avatar/avatar-types';\nimport type { ICoachmarkProps } from '../../use-journey/journey-context-types';\n\nimport { useCallback, useMemo, useRef } from 'react';\n\nimport Avatar from '../../../ui/avatar/avatar';\nimport { JOURNEY_ID_STUDENT } from '../../journey-id/journey-id-student';\nimport { IndicatorType } from '../../use-journey/constants';\nimport { useJourney } from '../../use-journey/use-journey';\nimport TooltipItem from '../use-home-page-journey/tooltip-item';\n\nconst usePuzzleDashboardJourney = () => {\n const journeyId = JOURNEY_ID_STUDENT.PUZZLE_DASHBOARD_JOURNEY;\n\n const puzzleProfileRef = useRef<HTMLDivElement>(null) as React.RefObject<HTMLDivElement>;\n const timerRefs = useRef<ReturnType<typeof setTimeout>[]>([]);\n\n const { setJourney, endJourney, nextCoachmark } = useJourney();\n\n const handleNextCoachMark = useCallback(() => {\n nextCoachmark(journeyId, false, 0, false);\n }, [journeyId, nextCoachmark]);\n\n const handleEndJourney = useCallback(() => {\n document.body.style.overflow = 'unset';\n endJourney(journeyId);\n }, [endJourney, journeyId]);\n\n const startJourney = useCallback(\n (avatar: IAvatarLayer[]) => {\n if (!puzzleProfileRef?.current) {\n return;\n }\n\n const puzzleAttemptSteps: ICoachmarkProps[] = [\n {\n originalElementToHighlightRef: puzzleProfileRef,\n elementToHighlight: (\n <div>\n <Avatar size={55} avatar={avatar} />\n </div>\n ),\n type: IndicatorType.TOOLTIP,\n indicator: {\n renderAs: 'primary',\n tooltipXCoOrdinates: 14,\n tooltipYCoOrdinates: 36,\n arrowSize: 12,\n arrowYCoOrdinates: -36,\n position: 'right',\n backgroundColor: 'BLUE_4',\n borderColor: 'BLACK',\n arrowColor: 'BLACK',\n tooltipItem: (\n <TooltipItem\n text=\"Click here to see all previously solved puzzles.\"\n buttonLabel=\"Got it\"\n onButtonClick={handleEndJourney}\n />\n ),\n } as IArrowTooltipProps,\n isActive: false,\n },\n ];\n\n setJourney(journeyId, puzzleAttemptSteps);\n\n const delayBeforeStart = setTimeout(() => {\n clearTimeout(delayBeforeStart);\n document.body.style.overflow = 'hidden';\n handleNextCoachMark();\n }, 500);\n\n timerRefs.current.push(delayBeforeStart);\n },\n [handleEndJourney, handleNextCoachMark, journeyId, setJourney],\n );\n\n const data = useMemo(\n () => ({\n puzzleProfileRef,\n startJourney,\n }),\n [startJourney],\n );\n\n return data;\n};\n\nexport { usePuzzleDashboardJourney };\n"],"names":["usePuzzleDashboardJourney","journeyId","JOURNEY_ID_STUDENT","puzzleProfileRef","useRef","timerRefs","setJourney","endJourney","nextCoachmark","useJourney","handleNextCoachMark","useCallback","handleEndJourney","startJourney","avatar","puzzleAttemptSteps","jsx","Avatar","IndicatorType","TooltipItem","delayBeforeStart","useMemo"],"mappings":";;;;;;;AAYA,MAAMA,IAA4B,MAAM;AACtC,QAAMC,IAAYC,EAAmB,0BAE/BC,IAAmBC,EAAuB,IAAI,GAC9CC,IAAYD,EAAwC,CAAA,CAAE,GAEtD,EAAE,YAAAE,GAAY,YAAAC,GAAY,eAAAC,MAAkBC,EAAW,GAEvDC,IAAsBC,EAAY,MAAM;AAC9B,IAAAH,EAAAP,GAAW,IAAO,GAAG,EAAK;AAAA,EAAA,GACvC,CAACA,GAAWO,CAAa,CAAC,GAEvBI,IAAmBD,EAAY,MAAM;AAChC,aAAA,KAAK,MAAM,WAAW,SAC/BJ,EAAWN,CAAS;AAAA,EAAA,GACnB,CAACM,GAAYN,CAAS,CAAC,GAEpBY,IAAeF;AAAA,IACnB,CAACG,MAA2B;AACtB,UAAA,EAACX,KAAA,QAAAA,EAAkB;AACrB;AAGF,YAAMY,IAAwC;AAAA,QAC5C;AAAA,UACE,+BAA+BZ;AAAA,UAC/B,sCACG,OACC,EAAA,UAAA,gBAAAa,EAACC,KAAO,MAAM,IAAI,QAAAH,GAAgB,EACpC,CAAA;AAAA,UAEF,MAAMI,EAAc;AAAA,UACpB,WAAW;AAAA,YACT,UAAU;AAAA,YACV,qBAAqB;AAAA,YACrB,qBAAqB;AAAA,YACrB,WAAW;AAAA,YACX,mBAAmB;AAAA,YACnB,UAAU;AAAA,YACV,iBAAiB;AAAA,YACjB,aAAa;AAAA,YACb,YAAY;AAAA,YACZ,aACE,gBAAAF;AAAA,cAACG;AAAA,cAAA;AAAA,gBACC,MAAK;AAAA,gBACL,aAAY;AAAA,gBACZ,eAAeP;AAAA,cAAA;AAAA,YACjB;AAAA,UAEJ;AAAA,UACA,UAAU;AAAA,QACZ;AAAA,MAAA;AAGF,MAAAN,EAAWL,GAAWc,CAAkB;AAElC,YAAAK,IAAmB,WAAW,MAAM;AACxC,qBAAaA,CAAgB,GACpB,SAAA,KAAK,MAAM,WAAW,UACXV;SACnB,GAAG;AAEI,MAAAL,EAAA,QAAQ,KAAKe,CAAgB;AAAA,IACzC;AAAA,IACA,CAACR,GAAkBF,GAAqBT,GAAWK,CAAU;AAAA,EAAA;AAWxD,SARMe;AAAA,IACX,OAAO;AAAA,MACL,kBAAAlB;AAAA,MACA,cAAAU;AAAA,IAAA;AAAA,IAEF,CAACA,CAAY;AAAA,EAAA;AAIjB;"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
var
|
|
1
|
+
var R = /* @__PURE__ */ ((E) => (E.CIRCLE_ACTIVITIES_INTRO_JOURNEY = "CIRCLE_ACTIVITIES_INTRO_JOURNEY", E.CIRCLE_LEADERBOARD_INTRO_JOURNEY = "CIRCLE_LEADERBOARD_INTRO_JOURNEY", E.CIRCLE_POINTS_REWARD_JOURNEY = "CIRCLE_POINTS_REWARD_JOURNEY", E.CIRCLE_STREAK_UPDATE_JOURNEY = "CIRCLE_STREAK_UPDATE_JOURNEY", E.CIRCLE_TUTORIAL_JOURNEY = "CIRCLE_TUTORIAL_JOURNEY", E.CIRCLE_TABLES_INTRO_JOURNEY = "CIRCLE_TABLES_INTRO_JOURNEY", E.CIRCLE_TABLES_INFINTE_JOURNEY = "CIRCLE_TABLES_INFINITE_JOURNEY", E.CIRCLE_LESSONS_K_1_INTRO_JOURNEY = "CIRCLE_LESSONS_K_1_INTRO_JOURNEY", E.CIRCLE_STREAK_REDUCTION_JOURNEY = "CIRCLE_STREAK_REDUCTION_JOURNEY", E.HOMEPAGE_JOURNEY = "HOMEPAGE_JOURNEY", E.CHAPTER_PAGE_JOURNEY = "CHAPTER_PAGE_JOURNEY", E.PUZZLE_ATTEMPT_JOURNEY = "PUZZLE_ATTEMPT_JOURNEY", E.CHALLENGE_ARENA_JOURNEY = "CHALLENGE_ARENA_JOURNEY", E.PUZZLE_ASSIGNED_JOURNEY = "PUZZLE_ASSIGNED_JOURNEY", E.PUZZLE_DASHBOARD_JOURNEY = "PUZZLE_DASHBOARD_JOURNEY", E))(R || {});
|
|
2
2
|
export {
|
|
3
|
-
|
|
3
|
+
R as JOURNEY_ID_STUDENT
|
|
4
4
|
};
|
|
5
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 CIRCLE_TABLES_INFINTE_JOURNEY = 'CIRCLE_TABLES_INFINITE_JOURNEY',\n CIRCLE_LESSONS_K_1_INTRO_JOURNEY = 'CIRCLE_LESSONS_K_1_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 CHALLENGE_ARENA_JOURNEY = 'CHALLENGE_ARENA_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,+BAC9BA,EAAA,gCAAgC,kCAChCA,EAAA,mCAAmC,oCAGnCA,EAAA,kCAAkC,mCAClCA,EAAA,mBAAmB,oBACnBA,EAAA,uBAAuB,wBACvBA,EAAA,0BAA0B,
|
|
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 CIRCLE_TABLES_INFINTE_JOURNEY = 'CIRCLE_TABLES_INFINITE_JOURNEY',\n CIRCLE_LESSONS_K_1_INTRO_JOURNEY = 'CIRCLE_LESSONS_K_1_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 PUZZLE_ATTEMPT_JOURNEY = 'PUZZLE_ATTEMPT_JOURNEY',\n CHALLENGE_ARENA_JOURNEY = 'CHALLENGE_ARENA_JOURNEY',\n PUZZLE_ASSIGNED_JOURNEY = 'PUZZLE_ASSIGNED_JOURNEY',\n PUZZLE_DASHBOARD_JOURNEY = 'PUZZLE_DASHBOARD_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,+BAC9BA,EAAA,gCAAgC,kCAChCA,EAAA,mCAAmC,oCAGnCA,EAAA,kCAAkC,mCAClCA,EAAA,mBAAmB,oBACnBA,EAAA,uBAAuB,wBACvBA,EAAA,yBAAyB,0BACzBA,EAAA,0BAA0B,2BAC1BA,EAAA,0BAA0B,2BAC1BA,EAAA,2BAA2B,4BAjBjBA,IAAAA,KAAA,CAAA,CAAA;"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var A = /* @__PURE__ */ ((E) => (E.HOMEPAGE_JOURNEY = "HOMEPAGE_JOURNEY", E.CHAPTER_PAGE_JOURNEY = "CHAPTER_PAGE_JOURNEY", E.CHALLENGE_ARENA_JOURNEY = "CHALLENGE_ARENA_JOURNEY", E))(A || {});
|
|
1
|
+
var A = /* @__PURE__ */ ((E) => (E.HOMEPAGE_JOURNEY = "HOMEPAGE_JOURNEY", E.CHAPTER_PAGE_JOURNEY = "CHAPTER_PAGE_JOURNEY", E.CHALLENGE_ARENA_JOURNEY = "CHALLENGE_ARENA_JOURNEY", E.PUZZLE_ASSIGN_JOURNEY = "PUZZLE_ASSIGN_JOURNEY", E))(A || {});
|
|
2
2
|
export {
|
|
3
3
|
A as JOURNEY_ID_TEACHER
|
|
4
4
|
};
|
|
@@ -1 +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 CHALLENGE_ARENA_JOURNEY = 'CHALLENGE_ARENA_JOURNEY',\n}\n"],"names":["JOURNEY_ID_TEACHER"],"mappings":"AAAY,IAAAA,sBAAAA,OACVA,EAAA,mBAAmB,oBACnBA,EAAA,uBAAuB,wBACvBA,EAAA,0BAA0B,
|
|
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 CHALLENGE_ARENA_JOURNEY = 'CHALLENGE_ARENA_JOURNEY',\n PUZZLE_ASSIGN_JOURNEY = 'PUZZLE_ASSIGN_JOURNEY',\n}\n"],"names":["JOURNEY_ID_TEACHER"],"mappings":"AAAY,IAAAA,sBAAAA,OACVA,EAAA,mBAAmB,oBACnBA,EAAA,uBAAuB,wBACvBA,EAAA,0BAA0B,2BAC1BA,EAAA,wBAAwB,yBAJdA,IAAAA,KAAA,CAAA,CAAA;"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { createGetAPI as s } from "@cuemath/rest-api";
|
|
2
|
+
import { BASE_URL_V3 as r } from "../../../constants/api.js";
|
|
3
|
+
const { useGet: a, invalidate: z } = s({
|
|
4
|
+
getURL: (e, o, { courseStream: t }) => `${r}/users/${e}/course-streams/${t}/puzzles-history/`
|
|
5
|
+
});
|
|
6
|
+
export {
|
|
7
|
+
z as invalidateGetPuzzles,
|
|
8
|
+
a as useGetPuzzles
|
|
9
|
+
};
|
|
10
|
+
//# sourceMappingURL=puzzle-dashboard.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"puzzle-dashboard.js","sources":["../../../../src/features/puzzles/api/puzzle-dashboard.ts"],"sourcesContent":["import type { TCourseStream } from '../../milestone/create/milestone-create-types';\nimport type { IPuzzleCardAssignData } from '../puzzle-container/puzzle-container-types';\n\nimport { createGetAPI } from '@cuemath/rest-api';\n\nimport { BASE_URL_V3 } from '../../../constants/api';\n\nconst { useGet: useGetPuzzles, invalidate: invalidateGetPuzzles } = createGetAPI<\n IPuzzleCardAssignData[],\n void,\n { courseStream: TCourseStream }\n>({\n getURL: (studentId, _, { courseStream }) =>\n `${BASE_URL_V3}/users/${studentId}/course-streams/${courseStream}/puzzles-history/`,\n});\n\nexport { useGetPuzzles, invalidateGetPuzzles };\n"],"names":["useGetPuzzles","invalidateGetPuzzles","createGetAPI","studentId","_","courseStream","BASE_URL_V3"],"mappings":";;AAOA,MAAM,EAAE,QAAQA,GAAe,YAAYC,EAAA,IAAyBC,EAIlE;AAAA,EACA,QAAQ,CAACC,GAAWC,GAAG,EAAE,cAAAC,EAAA,MACvB,GAAGC,CAAW,UAAUH,CAAS,mBAAmBE,CAAY;AACpE,CAAC;"}
|
|
@@ -1,79 +1,34 @@
|
|
|
1
|
-
import e
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
to { transform: translateY(0); }
|
|
7
|
-
`, o = a`
|
|
8
|
-
from { transform: rotateY(0deg); }
|
|
9
|
-
to { transform: rotateY(360deg); }
|
|
10
|
-
`, c = a`
|
|
11
|
-
from { transform: translateY(0); opacity: 1; }
|
|
12
|
-
to { transform: translateY(-100%); opacity: 0; }
|
|
13
|
-
`, d = e(n)`
|
|
1
|
+
import e from "styled-components";
|
|
2
|
+
import r from "../../ui/layout/flex-view.js";
|
|
3
|
+
import i from "../../ui/text/text.js";
|
|
4
|
+
import { getPuzzleCardPattern as p } from "../utils/puzzle-pattern.js";
|
|
5
|
+
const n = e(r)`
|
|
14
6
|
position: relative;
|
|
7
|
+
cursor: pointer;
|
|
15
8
|
|
|
16
|
-
box-shadow: inset 0px 0px 0px 4px ${({ theme:
|
|
9
|
+
box-shadow: inset 0px 0px 0px 4px ${({ theme: o, $imageHue: t }) => o.colors[`${t}_4`]};
|
|
17
10
|
|
|
18
|
-
background-image: ${({ $imageHue:
|
|
11
|
+
background-image: ${({ $imageHue: o }) => `url(${p(o)})`};
|
|
19
12
|
background-size: cover;
|
|
20
13
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
opacity: 0;
|
|
24
|
-
visibility: hidden;
|
|
25
|
-
transform: translateY(-100%);
|
|
26
|
-
`}
|
|
27
|
-
|
|
28
|
-
${({ $animationPhase: t, theme: i, $imageHue: s }) => {
|
|
29
|
-
switch (t) {
|
|
30
|
-
case "movingIn":
|
|
31
|
-
return r`
|
|
32
|
-
visibility: visible;
|
|
33
|
-
opacity: 1;
|
|
34
|
-
animation: ${m} 0.5s ease-out forwards;
|
|
35
|
-
`;
|
|
36
|
-
case "revealing":
|
|
37
|
-
return r`
|
|
38
|
-
visibility: visible;
|
|
39
|
-
opacity: 1;
|
|
40
|
-
transform: translateY(0); /* Position after moveIn */
|
|
41
|
-
animation: ${o} 1s ease-in-out forwards;
|
|
42
|
-
`;
|
|
43
|
-
case "visible":
|
|
44
|
-
return r`
|
|
45
|
-
visibility: visible;
|
|
46
|
-
opacity: 1;
|
|
47
|
-
transform: translateY(0) rotateY(360deg);
|
|
48
|
-
background-color: ${i.colors[`${s}_2`]};
|
|
49
|
-
transition: background-color 0.2s ease-in;
|
|
50
|
-
`;
|
|
51
|
-
case "assigning":
|
|
52
|
-
return r`
|
|
53
|
-
visibility: visible;
|
|
54
|
-
opacity: 1;
|
|
55
|
-
transform: translateY(0); /* Reset rotation for this animation */
|
|
56
|
-
animation: ${o} 1s ease-in-out forwards;
|
|
57
|
-
`;
|
|
58
|
-
case "assigned":
|
|
59
|
-
return r`
|
|
60
|
-
visibility: visible;
|
|
61
|
-
opacity: 1;
|
|
62
|
-
transform: translateY(0) rotateY(360deg);
|
|
63
|
-
`;
|
|
64
|
-
case "movingOut":
|
|
65
|
-
return r`
|
|
66
|
-
visibility: visible;
|
|
67
|
-
opacity: 1;
|
|
68
|
-
transform: translateY(0); /* Start from final position */
|
|
69
|
-
animation: ${c} 0.5s ease-in forwards;
|
|
70
|
-
`;
|
|
71
|
-
default:
|
|
72
|
-
return "";
|
|
14
|
+
&:hover {
|
|
15
|
+
outline: 1px solid ${({ theme: o }) => o.colors.BLACK_1};
|
|
73
16
|
}
|
|
74
|
-
|
|
17
|
+
`, x = e(i)`
|
|
18
|
+
display: -webkit-box;
|
|
19
|
+
-webkit-line-clamp: 3;
|
|
20
|
+
-webkit-box-orient: vertical;
|
|
21
|
+
overflow: hidden;
|
|
22
|
+
text-overflow: ellipsis;
|
|
23
|
+
white-space: break-spaces;
|
|
24
|
+
`, b = e(r)`
|
|
25
|
+
position: absolute;
|
|
26
|
+
top: -10px;
|
|
27
|
+
right: -10px;
|
|
75
28
|
`;
|
|
76
29
|
export {
|
|
77
|
-
|
|
30
|
+
n as PuzzleWrapper,
|
|
31
|
+
b as StickerWrapper,
|
|
32
|
+
x as Title
|
|
78
33
|
};
|
|
79
34
|
//# sourceMappingURL=puzzle-card-styled.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"puzzle-card-styled.js","sources":["../../../../src/features/puzzles/comps/puzzle-card-styled.tsx"],"sourcesContent":["import type { THueNames } from '../../ui/types';\n\nimport styled
|
|
1
|
+
{"version":3,"file":"puzzle-card-styled.js","sources":["../../../../src/features/puzzles/comps/puzzle-card-styled.tsx"],"sourcesContent":["import type { THueNames } from '../../ui/types';\n\nimport styled from 'styled-components';\n\nimport FlexView from '../../ui/layout/flex-view';\nimport Text from '../../ui/text/text';\nimport { getPuzzleCardPattern } from '../utils/puzzle-pattern';\n\nconst PuzzleWrapper = styled(FlexView)<{ $animationPhase?: string; $imageHue: THueNames }>`\n position: relative;\n cursor: pointer;\n\n box-shadow: inset 0px 0px 0px 4px ${({ theme, $imageHue }) => theme.colors[`${$imageHue}_4`]};\n\n background-image: ${({ $imageHue }) => `url(${getPuzzleCardPattern($imageHue)})`};\n background-size: cover;\n\n &:hover {\n outline: 1px solid ${({ theme }) => theme.colors.BLACK_1};\n }\n`;\n\nconst Title = styled(Text)`\n display: -webkit-box;\n -webkit-line-clamp: 3;\n -webkit-box-orient: vertical;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: break-spaces;\n`;\n\nconst StickerWrapper = styled(FlexView)`\n position: absolute;\n top: -10px;\n right: -10px;\n`;\n\nexport { PuzzleWrapper, Title, StickerWrapper };\n"],"names":["PuzzleWrapper","styled","FlexView","theme","$imageHue","getPuzzleCardPattern","Title","Text","StickerWrapper"],"mappings":";;;;AAQM,MAAAA,IAAgBC,EAAOC,CAAQ;AAAA;AAAA;AAAA;AAAA,sCAIC,CAAC,EAAE,OAAAC,GAAO,WAAAC,QAAgBD,EAAM,OAAO,GAAGC,CAAS,IAAI,CAAC;AAAA;AAAA,sBAExE,CAAC,EAAE,WAAAA,EAAU,MAAM,OAAOC,EAAqBD,CAAS,CAAC,GAAG;AAAA;AAAA;AAAA;AAAA,yBAIzD,CAAC,EAAE,OAAAD,EAAA,MAAYA,EAAM,OAAO,OAAO;AAAA;AAAA,GAItDG,IAAQL,EAAOM,CAAI;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,GASnBC,IAAiBP,EAAOC,CAAQ;AAAA;AAAA;AAAA;AAAA;"}
|