@cuemath/leap 3.1.1-beta-0.2 → 3.1.2-beta-0.1
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/homework/hw-card-list/api/get-homeworks.js +1 -1
- package/dist/features/homework/hw-card-list/api/get-homeworks.js.map +1 -1
- package/dist/features/homework/hw-card-list/hw-card-list-view.js +112 -144
- package/dist/features/homework/hw-card-list/hw-card-list-view.js.map +1 -1
- package/dist/features/journey/hooks/use-home-page-journey/home-page-homeworks-mock.js +262 -199
- package/dist/features/journey/hooks/use-home-page-journey/home-page-homeworks-mock.js.map +1 -1
- package/dist/features/journey/hooks/use-home-page-journey/use-home-page-journey.js +15 -15
- package/dist/features/journey/hooks/use-home-page-journey/use-home-page-journey.js.map +1 -1
- package/dist/features/milestone/milestone-list-container/api/get-past-milestone-count.js +13 -0
- package/dist/features/milestone/milestone-list-container/api/get-past-milestone-count.js.map +1 -0
- package/dist/index.d.ts +35 -13
- package/dist/index.js +146 -143
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/dist/features/homework/hw-card-list/hw-card-list-utils.js +0 -8
- package/dist/features/homework/hw-card-list/hw-card-list-utils.js.map +0 -1
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"use-home-page-journey.js","sources":["../../../../../src/features/journey/hooks/use-home-page-journey/use-home-page-journey.tsx"],"sourcesContent":["import type { INodeDataProps } from '../../../chapters-v2/comps/node-card/node-card-types';\nimport type { IChapterDataProps } from '../../../chapters/chapter/chapter-types';\nimport type { TCourseStream } from '../../../milestone/create/milestone-create-types';\nimport type { IArrowTooltipProps } from '../../../ui/arrow-tooltip/arrow-tooltip-types';\nimport type { ICoachmarkProps } from '../../use-journey/journey-context-types';\nimport type { IHomepageStartJourneyProps } from './homepage-journey-types';\n\nimport { useCallback, useEffect, useMemo, useRef } from 'react';\n\nimport ChapterItem from '../../../chapters/chapters-list/chapter-item/chapter-item';\nimport HomeworkCard from '../../../homework/homework-card';\nimport HwCardListView from '../../../homework/hw-card-list/hw-card-list-view';\nimport MilestoneListContainer from '../../../milestone/milestone-list-container/milestone-list-container';\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';\nimport { HOMEWORK_DETAILS } from './home-page-homeworks-mock';\nimport { RECENT_CHAPTERS } from './recent-chapters-mock';\nimport { ChaptersWrapper, ELementWrapper } from './styles';\nimport TooltipItem from './tooltip-item';\n\nexport const useHomePageJourney = () => {\n const journeyId = JOURNEY_ID_STUDENT.HOMEPAGE_JOURNEY;\n\n const homepageRef = useRef<HTMLDivElement>(null);\n const homeworkRef = useRef<HTMLDivElement>(null);\n const recentChaptersRef = useRef<HTMLDivElement>(null);\n const timerRefs = useRef<ReturnType<typeof setTimeout>[]>([]);\n const { nextCoachmark, setJourney, endJourney } = useJourney();\n\n const emptyFunction = useCallback(() => null, []);\n\n const handleEndJourney = useCallback(() => {\n endJourney(journeyId);\n document.body.style.overflow = 'unset';\n }, [endJourney, journeyId]);\n\n const handleNextCoachmark = useCallback(() => {\n nextCoachmark(journeyId, false, 0, true);\n }, [nextCoachmark, journeyId]);\n\n const startJourney = useCallback(\n ({ studentId, stream, userType }: IHomepageStartJourneyProps) => {\n const { title = '', subtext = '' } = HOMEWORK_DETAILS.assigned_homeworks[0] || {};\n const isStudent = userType === 'STUDENT';\n\n if (!homepageRef?.current || !homeworkRef?.current) {\n return;\n }\n\n const homepageSteps: ICoachmarkProps[] = [\n {\n originalElementToHighlightRef: homepageRef,\n isActive: false,\n type: IndicatorType.TOOLTIP,\n elementToHighlight: (\n <FlexView\n $flexGapX={2.5}\n $marginBottomX={8}\n $background=\"WHITE\"\n $widthX={47}\n $gutterX={1}\n >\n <HwCardListView\n userType={userType}\n studentId={studentId}\n isHwProcessing={false}\n hwDetails={HOMEWORK_DETAILS}\n onTestStart={emptyFunction}\n onNodeAttempt={emptyFunction}\n onTestPreview={emptyFunction}\n onNodeView={emptyFunction}\n onTestReview={emptyFunction}\n onNodeReview={emptyFunction}\n onNodeUnassign={emptyFunction}\n />\n <FlexView $flexRowGapX={1} ref={recentChaptersRef}>\n <Text $renderAs=\"ac4-black\" $color=\"BLACK_T_60\">\n Recent Chapters ({RECENT_CHAPTERS?.length})\n </Text>\n <ChaptersWrapper>\n {RECENT_CHAPTERS.map((chapter, idx) => (\n <ChapterItem\n key={chapter.id}\n chapter={chapter as unknown as IChapterDataProps}\n onChapterClick={emptyFunction}\n itemIndex={idx}\n />\n ))}\n </ChaptersWrapper>\n </FlexView>\n <MilestoneListContainer\n milestoneType=\"ACTIVE\"\n activeMilestoneId={''}\n activeTabId={''}\n canCreatePlan={false}\n courseStream={stream as TCourseStream}\n isClassOngoing={false}\n isStudentPresent={false}\n parentName={''}\n studentId={studentId}\n studentName={''}\n teacherName={''}\n userType={userType}\n //* Callbacks\n onAddChapter={emptyFunction}\n onAddOutcome={emptyFunction}\n onChapterClick={emptyFunction}\n onCreatePlan={emptyFunction}\n onDelete={emptyFunction}\n onDraftPublish={emptyFunction}\n onEdit={emptyFunction}\n onExpandPastMilestones={emptyFunction}\n onNodeView={emptyFunction}\n onNodeReview={emptyFunction}\n onWidgetTabSelection={emptyFunction}\n //* Resource callbacks\n onAssignResources={emptyFunction}\n onNodeReset={emptyFunction}\n onNodeUnassign={emptyFunction}\n //* Tests callbacks\n onCreateMilestoneTest={emptyFunction}\n onTestPreview={emptyFunction}\n onTestReview={emptyFunction}\n />\n </FlexView>\n ),\n indicator: {\n position: 'top',\n tooltipXCoOrdinates: 0,\n tooltipYCoOrdinates: 0,\n backgroundColor: 'BLUE_4',\n borderColor: 'BLACK',\n arrowColor: 'BLACK',\n arrowSize: 12,\n width: 264,\n tooltipItem: (\n <TooltipItem\n text={`Welcome to the all new ${isStudent ? 'learning' : 'tutoring'} homepage.`}\n buttonLabel=\"Next\"\n onButtonClick={handleNextCoachmark}\n />\n ),\n } as IArrowTooltipProps,\n },\n {\n originalElementToHighlightRef: homeworkRef,\n elementToHighlight: (\n <ELementWrapper>\n <HwCardListView\n userType={userType}\n studentId={studentId}\n isHwProcessing={false}\n hwDetails={HOMEWORK_DETAILS}\n onTestStart={emptyFunction}\n onNodeAttempt={emptyFunction}\n onTestPreview={emptyFunction}\n onNodeView={emptyFunction}\n onTestReview={emptyFunction}\n onNodeReview={emptyFunction}\n onNodeUnassign={emptyFunction}\n />\n </ELementWrapper>\n ),\n type: IndicatorType.TOOLTIP,\n indicator: {\n position: 'top',\n tooltipXCoOrdinates: -197,\n tooltipYCoOrdinates: -12,\n arrowXCoOrdinates: -110,\n backgroundColor: 'GREEN_4',\n borderColor: 'BLACK',\n arrowColor: 'BLACK',\n width: 264,\n arrowSize: 12,\n tooltipItem: (\n <TooltipItem\n text={`Homework is now easy to access and easy to ${\n isStudent ? 'complete' : 'review'\n }!`}\n buttonLabel=\"Next\"\n onButtonClick={handleNextCoachmark}\n />\n ),\n } as IArrowTooltipProps,\n isActive: false,\n },\n {\n originalElementToHighlightRef: homeworkRef,\n elementToHighlight: (\n <ELementWrapper>\n <HomeworkCard\n isInQueue={false}\n userType={userType}\n header={title}\n subHeader={subtext || ''}\n nodeData={HOMEWORK_DETAILS.assigned_homeworks[0] as INodeDataProps}\n renderAs=\"homework\"\n studentId={studentId}\n shouldOpenOnRight={false}\n />\n </ELementWrapper>\n ),\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 <TooltipItem\n text=\"Track homework status and their due dates.\"\n buttonLabel=\"Next\"\n onButtonClick={handleNextCoachmark}\n />\n ),\n } as IArrowTooltipProps,\n isActive: false,\n },\n {\n originalElementToHighlightRef: homepageRef,\n elementToHighlight: (\n <ELementWrapper>\n <FlexView $flexRowGapX={1}>\n <Text $renderAs=\"ac4-black\" $color=\"BLACK_T_60\">\n Recent Chapters ({RECENT_CHAPTERS?.length})\n </Text>\n <ChaptersWrapper>\n {RECENT_CHAPTERS.map((chapter, idx) => (\n <ChapterItem\n key={chapter.id}\n chapter={chapter as unknown as IChapterDataProps}\n onChapterClick={emptyFunction}\n itemIndex={idx}\n />\n ))}\n </ChaptersWrapper>\n </FlexView>\n </ELementWrapper>\n ),\n type: IndicatorType.TOOLTIP,\n indicator: {\n position: 'top',\n tooltipXCoOrdinates: -200,\n tooltipYCoOrdinates: -10,\n backgroundColor: 'YELLOW_4',\n borderColor: 'BLACK',\n arrowColor: 'BLACK',\n arrowXCoOrdinates: -97,\n arrowSize: 12,\n width: 264,\n tooltipItem: (\n <TooltipItem\n text=\"Access all your recent chapters in one place.\"\n buttonLabel=\"Got it\"\n onButtonClick={handleEndJourney}\n />\n ),\n } as IArrowTooltipProps,\n isActive: false,\n },\n ];\n\n setJourney(journeyId, homepageSteps);\n\n const delayBeforeStart = setTimeout(() => {\n clearTimeout(delayBeforeStart);\n if (userType === 'STUDENT') {\n window.scrollTo(0, 0);\n } else {\n document.getElementById('tab-content-container')?.scrollTo(0, 0);\n }\n document.body.style.overflow = 'hidden';\n handleNextCoachmark();\n }, 200);\n\n timerRefs.current.push(delayBeforeStart); // Store to cleanup later\n },\n [handleEndJourney, emptyFunction, handleNextCoachmark, journeyId, setJourney],\n );\n\n const data = useMemo(\n () => ({\n homepageRef,\n homeworkRef,\n startJourney,\n }),\n [startJourney],\n );\n\n // Cleanup on unmount\n useEffect(() => {\n return () => {\n timerRefs.current.forEach(timer => clearTimeout(timer));\n timerRefs.current = [];\n };\n }, []);\n\n return data;\n};\n"],"names":["useHomePageJourney","journeyId","JOURNEY_ID_STUDENT","homepageRef","useRef","homeworkRef","recentChaptersRef","timerRefs","nextCoachmark","setJourney","endJourney","useJourney","emptyFunction","useCallback","handleEndJourney","handleNextCoachmark","startJourney","studentId","stream","userType","title","subtext","HOMEWORK_DETAILS","isStudent","homepageSteps","IndicatorType","jsxs","FlexView","jsx","HwCardListView","Text","_a","RECENT_CHAPTERS","ChaptersWrapper","chapter","idx","ChapterItem","MilestoneListContainer","TooltipItem","ELementWrapper","HomeworkCard","_b","delayBeforeStart","data","useMemo","useEffect","timer"],"mappings":";;;;;;;;;;;;;;;AAuBO,MAAMA,KAAqB,MAAM;AACtC,QAAMC,IAAYC,EAAmB,kBAE/BC,IAAcC,EAAuB,IAAI,GACzCC,IAAcD,EAAuB,IAAI,GACzCE,IAAoBF,EAAuB,IAAI,GAC/CG,IAAYH,EAAwC,CAAA,CAAE,GACtD,EAAE,eAAAI,GAAe,YAAAC,GAAY,YAAAC,MAAeC,EAAW,GAEvDC,IAAgBC,EAAY,MAAM,MAAM,CAAE,CAAA,GAE1CC,IAAmBD,EAAY,MAAM;AACzC,IAAAH,EAAWT,CAAS,GACX,SAAA,KAAK,MAAM,WAAW;AAAA,EAAA,GAC9B,CAACS,GAAYT,CAAS,CAAC,GAEpBc,IAAsBF,EAAY,MAAM;AAC9B,IAAAL,EAAAP,GAAW,IAAO,GAAG,EAAI;AAAA,EAAA,GACtC,CAACO,GAAeP,CAAS,CAAC,GAEvBe,IAAeH;AAAA,IACnB,CAAC,EAAE,WAAAI,GAAW,QAAAC,GAAQ,UAAAC,QAA2C;;AACzD,YAAA,EAAE,OAAAC,IAAQ,IAAI,SAAAC,IAAU,OAAOC,EAAiB,mBAAmB,CAAC,KAAK,IACzEC,IAAYJ,MAAa;AAE/B,UAAI,EAAChB,KAAA,QAAAA,EAAa,YAAW,EAACE,KAAA,QAAAA,EAAa;AACzC;AAGF,YAAMmB,IAAmC;AAAA,QACvC;AAAA,UACE,+BAA+BrB;AAAA,UAC/B,UAAU;AAAA,UACV,MAAMsB,EAAc;AAAA,UACpB,oBACE,gBAAAC;AAAA,YAACC;AAAA,YAAA;AAAA,cACC,W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CAAE,CAAA,GAEEoC;AACT;"}
|
1
|
+
{"version":3,"file":"use-home-page-journey.js","sources":["../../../../../src/features/journey/hooks/use-home-page-journey/use-home-page-journey.tsx"],"sourcesContent":["import type { INodeDataProps } from '../../../chapters-v2/comps/node-card/node-card-types';\nimport type { IChapterDataProps } from '../../../chapters/chapter/chapter-types';\nimport type { TCourseStream } from '../../../milestone/create/milestone-create-types';\nimport type { IArrowTooltipProps } from '../../../ui/arrow-tooltip/arrow-tooltip-types';\nimport type { ICoachmarkProps } from '../../use-journey/journey-context-types';\nimport type { IHomepageStartJourneyProps } from './homepage-journey-types';\n\nimport { useCallback, useEffect, useMemo, useRef } from 'react';\n\nimport ChapterItem from '../../../chapters/chapters-list/chapter-item/chapter-item';\nimport HomeworkCard from '../../../homework/homework-card';\nimport HwCardListView from '../../../homework/hw-card-list/hw-card-list-view';\nimport MilestoneListContainer from '../../../milestone/milestone-list-container/milestone-list-container';\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';\nimport { HOMEWORK_DETAILS } from './home-page-homeworks-mock';\nimport { RECENT_CHAPTERS } from './recent-chapters-mock';\nimport { ChaptersWrapper, ELementWrapper } from './styles';\nimport TooltipItem from './tooltip-item';\n\nexport const useHomePageJourney = () => {\n const journeyId = JOURNEY_ID_STUDENT.HOMEPAGE_JOURNEY;\n\n const homepageRef = useRef<HTMLDivElement>(null);\n const homeworkRef = useRef<HTMLDivElement>(null);\n const recentChaptersRef = useRef<HTMLDivElement>(null);\n const timerRefs = useRef<ReturnType<typeof setTimeout>[]>([]);\n const { nextCoachmark, setJourney, endJourney } = useJourney();\n\n const emptyFunction = useCallback(() => null, []);\n\n const handleEndJourney = useCallback(() => {\n endJourney(journeyId);\n document.body.style.overflow = 'unset';\n }, [endJourney, journeyId]);\n\n const handleNextCoachmark = useCallback(() => {\n nextCoachmark(journeyId, false, 0, true);\n }, [nextCoachmark, journeyId]);\n\n const startJourney = useCallback(\n ({ studentId, stream, userType }: IHomepageStartJourneyProps) => {\n const { title, subtext } = HOMEWORK_DETAILS[0] as INodeDataProps;\n const isStudent = userType === 'STUDENT';\n\n if (!homepageRef?.current || !homeworkRef?.current) {\n return;\n }\n\n const homepageSteps: ICoachmarkProps[] = [\n {\n originalElementToHighlightRef: homepageRef,\n isActive: false,\n type: IndicatorType.TOOLTIP,\n elementToHighlight: (\n <FlexView\n $flexGapX={2.5}\n $marginBottomX={8}\n $background=\"WHITE\"\n $widthX={47}\n $gutterX={1}\n >\n <HwCardListView\n userType={userType}\n studentId={studentId}\n isHwProcessing={false}\n hwDetails={HOMEWORK_DETAILS as INodeDataProps[]}\n onTestStart={emptyFunction}\n onNodeAttempt={emptyFunction}\n onTestPreview={emptyFunction}\n onNodeView={emptyFunction}\n onTestReview={emptyFunction}\n onNodeReview={emptyFunction}\n onNodeUnassign={emptyFunction}\n />\n <FlexView $flexRowGapX={1} ref={recentChaptersRef}>\n <Text $renderAs=\"ac4-black\" $color=\"BLACK_T_60\">\n Recent Chapters ({RECENT_CHAPTERS?.length})\n </Text>\n <ChaptersWrapper>\n {RECENT_CHAPTERS.map((chapter, idx) => (\n <ChapterItem\n key={chapter.id}\n chapter={chapter as unknown as IChapterDataProps}\n onChapterClick={emptyFunction}\n itemIndex={idx}\n />\n ))}\n </ChaptersWrapper>\n </FlexView>\n <MilestoneListContainer\n milestoneType=\"ACTIVE\"\n activeMilestoneId={''}\n activeTabId={''}\n canCreatePlan={false}\n courseStream={stream as TCourseStream}\n isClassOngoing={false}\n isStudentPresent={false}\n parentName={''}\n studentId={studentId}\n studentName={''}\n teacherName={''}\n userType={userType}\n //* Callbacks\n onAddChapter={emptyFunction}\n onAddOutcome={emptyFunction}\n onChapterClick={emptyFunction}\n onCreatePlan={emptyFunction}\n onDelete={emptyFunction}\n onDraftPublish={emptyFunction}\n onEdit={emptyFunction}\n onExpandPastMilestones={emptyFunction}\n onNodeView={emptyFunction}\n onNodeReview={emptyFunction}\n onWidgetTabSelection={emptyFunction}\n //* Resource callbacks\n onAssignResources={emptyFunction}\n onNodeReset={emptyFunction}\n onNodeUnassign={emptyFunction}\n //* Tests callbacks\n onCreateMilestoneTest={emptyFunction}\n onTestPreview={emptyFunction}\n onTestReview={emptyFunction}\n />\n </FlexView>\n ),\n indicator: {\n position: 'top',\n tooltipXCoOrdinates: 0,\n tooltipYCoOrdinates: 0,\n backgroundColor: 'BLUE_4',\n borderColor: 'BLACK',\n arrowColor: 'BLACK',\n arrowSize: 12,\n width: 264,\n tooltipItem: (\n <TooltipItem\n text={`Welcome to the all new ${isStudent ? 'learning' : 'tutoring'} homepage.`}\n buttonLabel=\"Next\"\n onButtonClick={handleNextCoachmark}\n />\n ),\n } as IArrowTooltipProps,\n },\n {\n originalElementToHighlightRef: homeworkRef,\n elementToHighlight: (\n <ELementWrapper>\n <HwCardListView\n userType={userType}\n studentId={studentId}\n isHwProcessing={false}\n hwDetails={HOMEWORK_DETAILS as INodeDataProps[]}\n onTestStart={emptyFunction}\n onNodeAttempt={emptyFunction}\n onTestPreview={emptyFunction}\n onNodeView={emptyFunction}\n onTestReview={emptyFunction}\n onNodeReview={emptyFunction}\n onNodeUnassign={emptyFunction}\n />\n </ELementWrapper>\n ),\n type: IndicatorType.TOOLTIP,\n indicator: {\n position: 'top',\n tooltipXCoOrdinates: -197,\n tooltipYCoOrdinates: -12,\n arrowXCoOrdinates: -110,\n backgroundColor: 'GREEN_4',\n borderColor: 'BLACK',\n arrowColor: 'BLACK',\n width: 264,\n arrowSize: 12,\n tooltipItem: (\n <TooltipItem\n text={`Homework is now easy to access and easy to ${\n isStudent ? 'complete' : 'review'\n }!`}\n buttonLabel=\"Next\"\n onButtonClick={handleNextCoachmark}\n />\n ),\n } as IArrowTooltipProps,\n isActive: false,\n },\n {\n originalElementToHighlightRef: homeworkRef,\n elementToHighlight: (\n <ELementWrapper>\n <HomeworkCard\n isInQueue={false}\n userType={userType}\n header={title}\n subHeader={subtext || ''}\n nodeData={HOMEWORK_DETAILS[0] as INodeDataProps}\n renderAs=\"homework\"\n studentId={studentId}\n shouldOpenOnRight={false}\n />\n </ELementWrapper>\n ),\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 <TooltipItem\n text=\"Track homework status and their due dates.\"\n buttonLabel=\"Next\"\n onButtonClick={handleNextCoachmark}\n />\n ),\n } as IArrowTooltipProps,\n isActive: false,\n },\n {\n originalElementToHighlightRef: homepageRef,\n elementToHighlight: (\n <ELementWrapper>\n <FlexView $flexRowGapX={1}>\n <Text $renderAs=\"ac4-black\" $color=\"BLACK_T_60\">\n Recent Chapters ({RECENT_CHAPTERS?.length})\n </Text>\n <ChaptersWrapper>\n {RECENT_CHAPTERS.map((chapter, idx) => (\n <ChapterItem\n key={chapter.id}\n chapter={chapter as unknown as IChapterDataProps}\n onChapterClick={emptyFunction}\n itemIndex={idx}\n />\n ))}\n </ChaptersWrapper>\n </FlexView>\n </ELementWrapper>\n ),\n type: IndicatorType.TOOLTIP,\n indicator: {\n position: 'top',\n tooltipXCoOrdinates: -200,\n tooltipYCoOrdinates: -10,\n backgroundColor: 'YELLOW_4',\n borderColor: 'BLACK',\n arrowColor: 'BLACK',\n arrowXCoOrdinates: -97,\n arrowSize: 12,\n width: 264,\n tooltipItem: (\n <TooltipItem\n text=\"Access all your recent chapters in one place.\"\n buttonLabel=\"Got it\"\n onButtonClick={handleEndJourney}\n />\n ),\n } as IArrowTooltipProps,\n isActive: false,\n },\n ];\n\n setJourney(journeyId, homepageSteps);\n\n const delayBeforeStart = setTimeout(() => {\n clearTimeout(delayBeforeStart);\n if (userType === 'STUDENT') {\n window.scrollTo(0, 0);\n } else {\n document.getElementById('tab-content-container')?.scrollTo(0, 0);\n }\n document.body.style.overflow = 'hidden';\n handleNextCoachmark();\n }, 200);\n\n timerRefs.current.push(delayBeforeStart); // Store to cleanup later\n },\n [handleEndJourney, emptyFunction, handleNextCoachmark, journeyId, setJourney],\n );\n\n const data = useMemo(\n () => ({\n homepageRef,\n homeworkRef,\n startJourney,\n }),\n [startJourney],\n );\n\n // Cleanup on unmount\n useEffect(() => {\n return () => {\n timerRefs.current.forEach(timer => clearTimeout(timer));\n timerRefs.current = [];\n };\n }, []);\n\n return data;\n};\n"],"names":["useHomePageJourney","journeyId","JOURNEY_ID_STUDENT","homepageRef","useRef","homeworkRef","recentChaptersRef","timerRefs","nextCoachmark","setJourney","endJourney","useJourney","emptyFunction","useCallback","handleEndJourney","handleNextCoachmark","startJourney","studentId","stream","userType","title","subtext","HOMEWORK_DETAILS","isStudent","homepageSteps","IndicatorType","jsxs","FlexView","jsx","HwCardListView","Text","_a","RECENT_CHAPTERS","ChaptersWrapper","chapter","idx","ChapterItem","MilestoneListContainer","TooltipItem","ELementWrapper","HomeworkCard","_b","delayBeforeStart","data","useMemo","useEffect","timer"],"mappings":";;;;;;;;;;;;;;;AAuBO,MAAMA,KAAqB,MAAM;AACtC,QAAMC,IAAYC,EAAmB,kBAE/BC,IAAcC,EAAuB,IAAI,GACzCC,IAAcD,EAAuB,IAAI,GACzCE,IAAoBF,EAAuB,IAAI,GAC/CG,IAAYH,EAAwC,CAAA,CAAE,GACtD,EAAE,eAAAI,GAAe,YAAAC,GAAY,YAAAC,MAAeC,EAAW,GAEvDC,IAAgBC,EAAY,MAAM,MAAM,CAAE,CAAA,GAE1CC,IAAmBD,EAAY,MAAM;AACzC,IAAAH,EAAWT,CAAS,GACX,SAAA,KAAK,MAAM,WAAW;AAAA,EAAA,GAC9B,CAACS,GAAYT,CAAS,CAAC,GAEpBc,IAAsBF,EAAY,MAAM;AAC9B,IAAAL,EAAAP,GAAW,IA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EAAkD,SAAS,GAAG,IAEvD,SAAA,KAAK,MAAM,WAAW,UACXhB;SACnB,GAAG;AAEI,MAAAR,EAAA,QAAQ,KAAKmC,CAAgB;AAAA,IACzC;AAAA,IACA,CAAC5B,GAAkBF,GAAeG,GAAqBd,GAAWQ,CAAU;AAAA,EAAA,GAGxEkC,IAAOC;AAAA,IACX,OAAO;AAAA,MACL,aAAAzC;AAAA,MACA,aAAAE;AAAA,MACA,cAAAW;AAAA,IAAA;AAAA,IAEF,CAACA,CAAY;AAAA,EAAA;AAIf,SAAA6B,EAAU,MACD,MAAM;AACX,IAAAtC,EAAU,QAAQ,QAAQ,CAASuC,MAAA,aAAaA,CAAK,CAAC,GACtDvC,EAAU,UAAU;EAAC,GAEtB,CAAE,CAAA,GAEEoC;AACT;"}
|
@@ -0,0 +1,13 @@
|
|
1
|
+
import { createGetAllAPI as r } from "@cuemath/rest-api";
|
2
|
+
import { BASE_URL_V3_1 as n } from "../../../../constants/api.js";
|
3
|
+
const { useGetAll: a, invalidate: l } = r({
|
4
|
+
getURL: (e) => {
|
5
|
+
const { milestone_state_group: t, student_id: s, course_stream: o } = e;
|
6
|
+
return `${n}/user-milestones/users/${s}/course-streams/${o}/${t}/count`;
|
7
|
+
}
|
8
|
+
});
|
9
|
+
export {
|
10
|
+
l as invalidatePastMilestoneCount,
|
11
|
+
a as useGetPastMilestoneCount
|
12
|
+
};
|
13
|
+
//# sourceMappingURL=get-past-milestone-count.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"get-past-milestone-count.js","sources":["../../../../../src/features/milestone/milestone-list-container/api/get-past-milestone-count.ts"],"sourcesContent":["import type { TCourseStream } from '../../create/milestone-create-types';\nimport type { IMilestoneData } from '../milestone-list/milestone-list-types';\n\nimport { createGetAllAPI } from '@cuemath/rest-api';\n\nimport { BASE_URL_V3_1 } from '../../../../constants/api';\n\ntype TQuery = {\n milestone_state_group: 'ALL' | 'DRAFT' | 'STUDENT_ALL' | 'LIVE' | 'STUDENT_LIVE' | 'INACTIVE';\n student_id: string;\n course_stream: TCourseStream;\n};\n\nconst { useGetAll: useGetPastMilestoneCount, invalidate: invalidatePastMilestoneCount } =\n createGetAllAPI<IMilestoneData, TQuery>({\n getURL: query => {\n const { milestone_state_group, student_id, course_stream } = query;\n\n return `${BASE_URL_V3_1}/user-milestones/users/${student_id}/course-streams/${course_stream}/${milestone_state_group}/count`;\n },\n });\n\nexport { useGetPastMilestoneCount, invalidatePastMilestoneCount };\n"],"names":["useGetPastMilestoneCount","invalidatePastMilestoneCount","createGetAllAPI","query","milestone_state_group","student_id","course_stream","BASE_URL_V3_1"],"mappings":";;AAaA,MAAM,EAAE,WAAWA,GAA0B,YAAYC,EAAA,IACvDC,EAAwC;AAAA,EACtC,QAAQ,CAASC,MAAA;AACf,UAAM,EAAE,uBAAAC,GAAuB,YAAAC,GAAY,eAAAC,EAAA,IAAkBH;AAE7D,WAAO,GAAGI,CAAa,0BAA0BF,CAAU,mBAAmBC,CAAa,IAAIF,CAAqB;AAAA,EACtH;AACF,CAAC;"}
|
package/dist/index.d.ts
CHANGED
@@ -2409,38 +2409,38 @@ export declare interface INodeDataProps {
|
|
2409
2409
|
attempt_location: TSheetAttemptLocation_2;
|
2410
2410
|
block_id: string;
|
2411
2411
|
card_header: string;
|
2412
|
-
chapter_id: string
|
2413
|
-
chapter_name?: string;
|
2412
|
+
chapter_id: string;
|
2414
2413
|
complete_status: boolean;
|
2415
2414
|
course_type: TCourseType;
|
2416
2415
|
desmos_calculator_enabled: boolean;
|
2417
2416
|
due_date_ts: number | null;
|
2418
|
-
homework_id?: string;
|
2419
|
-
id: string;
|
2420
|
-
image_hue: THueNames;
|
2421
|
-
image_url: string | null;
|
2422
2417
|
is_lesson_v3_enabled: boolean;
|
2423
2418
|
is_optional: boolean;
|
2424
2419
|
is_timed: boolean;
|
2425
2420
|
is_worksheet_v3: boolean | null;
|
2426
|
-
items?: TNodeDataTestItemsDataProps[];
|
2427
2421
|
learnosity_activity_ref: string;
|
2428
2422
|
marked_as_completed: boolean;
|
2429
2423
|
node_id: string;
|
2424
|
+
id: string;
|
2430
2425
|
node_type: TNodeTypes_2;
|
2431
|
-
permissions: INodePermissions;
|
2432
2426
|
sheet_statement: string;
|
2427
|
+
permissions: INodePermissions;
|
2433
2428
|
sheet_time: number | null;
|
2434
2429
|
state: TSheetStates;
|
2435
|
-
subtext: string | null;
|
2436
2430
|
title: string;
|
2437
|
-
total_questions: number | null;
|
2438
|
-
unlocked_on_ts: number | null;
|
2439
|
-
user_attempt_id: string | null;
|
2440
2431
|
user_chapter_id: string | null;
|
2441
|
-
user_milestone_id?: string;
|
2442
2432
|
user_node_id: string | null;
|
2443
2433
|
worksheet_id: string;
|
2434
|
+
image_url: string;
|
2435
|
+
image_hue: THueNames;
|
2436
|
+
total_questions: number | null;
|
2437
|
+
unlocked_on_ts: number | null;
|
2438
|
+
items?: TNodeDataTestItemsDataProps[];
|
2439
|
+
user_milestone_id?: string;
|
2440
|
+
user_attempt_id: string | null;
|
2441
|
+
subtext: string | null;
|
2442
|
+
homework_id?: string;
|
2443
|
+
chapter_name?: string;
|
2444
2444
|
}
|
2445
2445
|
|
2446
2446
|
declare interface INodePermissions {
|
@@ -2477,6 +2477,8 @@ export declare const invalidateMilestoneResources: (id: string, query?: void | u
|
|
2477
2477
|
|
2478
2478
|
export declare const invalidateMilestonesData: (query?: TQuery | undefined) => void;
|
2479
2479
|
|
2480
|
+
export declare const invalidatePastMilestoneCount: (query?: TQuery_2 | undefined) => void;
|
2481
|
+
|
2480
2482
|
export declare const invalidateTestHelpData: (id: string, query?: void | undefined, allIdsInvalid?: boolean) => void;
|
2481
2483
|
|
2482
2484
|
declare interface IOnChapterExitWarningProps {
|
@@ -5388,6 +5390,12 @@ declare type TQuery = {
|
|
5388
5390
|
course_stream: TCourseStream;
|
5389
5391
|
};
|
5390
5392
|
|
5393
|
+
declare type TQuery_2 = {
|
5394
|
+
milestone_state_group: 'ALL' | 'DRAFT' | 'STUDENT_ALL' | 'LIVE' | 'STUDENT_LIVE' | 'INACTIVE';
|
5395
|
+
student_id: string;
|
5396
|
+
course_stream: TCourseStream;
|
5397
|
+
};
|
5398
|
+
|
5391
5399
|
declare type TQuestionByQuestionOverviewList = {
|
5392
5400
|
section: string;
|
5393
5401
|
question_no: number;
|
@@ -5766,6 +5774,20 @@ export declare const useGetMilestoneResources: (initialId?: string, initialQuery
|
|
5766
5774
|
} & Record<string, unknown>) | undefined;
|
5767
5775
|
};
|
5768
5776
|
|
5777
|
+
export declare const useGetPastMilestoneCount: (initialQuery?: TQuery_2 | undefined) => {
|
5778
|
+
getAll: (query: TQuery_2, meta: void) => Promise<void>;
|
5779
|
+
resource: ResourceModel<IMilestoneData[]> | undefined;
|
5780
|
+
data: IMilestoneData[] | undefined;
|
5781
|
+
permissions: Record<string, unknown> | undefined;
|
5782
|
+
isProcessing: boolean;
|
5783
|
+
isProcessed: boolean;
|
5784
|
+
isProcessingFailed: boolean;
|
5785
|
+
isStale: boolean;
|
5786
|
+
error: ({
|
5787
|
+
message?: string | undefined;
|
5788
|
+
} & Record<string, unknown>) | undefined;
|
5789
|
+
};
|
5790
|
+
|
5769
5791
|
export declare const useGetTestHelpData: (initialId?: string, initialQuery?: void | undefined) => {
|
5770
5792
|
get: (id: string, query: void, meta: {
|
5771
5793
|
studentId: string;
|