@cuemath/leap 2.9.4-as4 → 2.9.4-as6

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.
Files changed (23) hide show
  1. package/dist/features/chapters-v2/chapter-details/chapter-banner/chapter-banner.js +2 -2
  2. package/dist/features/chapters-v2/chapter-details/chapter-banner/chapter-banner.js.map +1 -1
  3. package/dist/features/chapters-v2/comps/node-card/student-actions/student-actions.js +61 -61
  4. package/dist/features/chapters-v2/comps/node-card/student-actions/student-actions.js.map +1 -1
  5. package/dist/features/chapters-v2/comps/node-card/teacher-actions/teacher-actions.js +62 -62
  6. package/dist/features/chapters-v2/comps/node-card/teacher-actions/teacher-actions.js.map +1 -1
  7. package/dist/features/homework/hw-card-list/hw-card-list.js +3 -4
  8. package/dist/features/homework/hw-card-list/hw-card-list.js.map +1 -1
  9. package/dist/features/journey/hooks/use-home-page-journey.js +34 -34
  10. package/dist/features/journey/hooks/use-home-page-journey.js.map +1 -1
  11. package/dist/features/journey/journey-id/journey-id-student.js +3 -2
  12. package/dist/features/journey/journey-id/journey-id-student.js.map +1 -1
  13. package/dist/features/journey/use-journey/journey-context-provider.js +48 -48
  14. package/dist/features/journey/use-journey/journey-context-provider.js.map +1 -1
  15. package/dist/features/milestone/milestone-list-container/milestone-list/milestone-list.js +43 -43
  16. package/dist/features/milestone/milestone-list-container/milestone-list/milestone-list.js.map +1 -1
  17. package/dist/features/milestone/milestone-list-container/milestone-list-container.js +116 -115
  18. package/dist/features/milestone/milestone-list-container/milestone-list-container.js.map +1 -1
  19. package/dist/features/milestone/milestone-resources/resources-assign/resources-assign.js +8 -8
  20. package/dist/features/milestone/milestone-resources/resources-assign/resources-assign.js.map +1 -1
  21. package/dist/index.d.ts +10 -8
  22. package/dist/index.js +175 -174
  23. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"teacher-actions.js","sources":["../../../../../../src/features/chapters-v2/comps/node-card/teacher-actions/teacher-actions.tsx"],"sourcesContent":["import type { INodeCardProps } from '../node-card-types';\nimport type { INodeMenuOption } from '../node-menu-options/node-menu-options-types';\nimport type { FC } from 'react';\n\nimport { memo, useCallback, useRef, useState } from 'react';\n\nimport Check2Icon from '../../../../../assets/line-icons/icons/check2';\nimport Eye2Icon from '../../../../../assets/line-icons/icons/eye2';\nimport Home2Icon from '../../../../../assets/line-icons/icons/home2';\nimport MoreVerticalIcon from '../../../../../assets/line-icons/icons/more-vertical';\nimport ArrowTooltip from '../../../../ui/arrow-tooltip/arrow-tooltip';\nimport useContextMenuClickHandler from '../../../../ui/hooks/use-context-menu-click-handler';\nimport FlexView from '../../../../ui/layout/flex-view';\nimport LottieAnimation from '../../../../ui/lottie-animation/lottie-animation';\nimport Text from '../../../../ui/text/text';\nimport { BLOCK_TYPE } from '../../../constants/block-constants';\nimport { NODE_CARD_STATES, TEACHER_MENU_LABELS } from '../../../constants/node-constants';\nimport { getNodeTypeBasedBgImage } from '../../../utils';\nimport { getNodeCardBasedIcon } from '../../../utils/node-card-utils';\nimport BorderPathAnimation from '../border-path-animation';\nimport * as Styled from '../node-card-styled';\nimport NodeCardTags from '../node-card-tags';\nimport NodeMenuOptions from '../node-menu-options/node-menu-options';\n\nconst { ASSIGN_AS_HW, REVIEW, VIEW, MARK_AS_DONE } = TEACHER_MENU_LABELS;\n\nconst TeacherActions: FC<Omit<INodeCardProps, 'userType'>> = memo(\n ({\n nodeData,\n imageHue,\n blockType,\n isSkipped,\n onNodeAttemptLocationChange,\n onNodeMarkAsDone,\n onNodeView,\n onNodeReview,\n }) => {\n const [renderLottie, setRenderLottie] = useState(false);\n const containerRef = useRef<HTMLDivElement>(null);\n\n const { menuVisible, onMenuClick } = useContextMenuClickHandler(containerRef);\n\n const {\n accuracy,\n attempt_location: attemptLocation,\n node_type: nodeType,\n card_header: cardHeader,\n title,\n state,\n is_optional: isOptional,\n sheet_statement: sheetStatement,\n permissions,\n user_attempt_id: userAttemptId,\n } = nodeData;\n\n const {\n can_change_attempt_location: canChangeAttemptLocation,\n can_mark_familiar: canMarkFamiliar,\n can_review: canReview,\n } = permissions;\n\n const isGoalBlock = blockType === BLOCK_TYPE.GOAL;\n const sheetLocked = state === NODE_CARD_STATES.LOCKED;\n const sheetNotStarted = state === NODE_CARD_STATES.NOT_STARTED;\n const sheetInProgress = state === NODE_CARD_STATES.IN_PROGRESS;\n const inClassSheet = attemptLocation === 'INCLASS';\n const tooltipHidden = !sheetStatement || !isGoalBlock;\n\n const showCardAnimation = !isOptional && (sheetInProgress || sheetNotStarted);\n\n const nodeBgImage = getNodeTypeBasedBgImage(nodeType);\n const { icon: NodeCardIcon, lottie: nodeCardLottie } = getNodeCardBasedIcon(nodeType);\n\n const handleOnMenuOptionClick = useCallback(\n (optionId: string) => {\n switch (optionId) {\n case 'node-card-view':\n if (canReview && userAttemptId) {\n onNodeReview?.(nodeData);\n } else {\n onNodeView?.(nodeData);\n }\n\n return;\n\n case 'node-card-assign-as-hw':\n onNodeAttemptLocationChange?.(nodeData);\n\n return;\n\n case 'node-card-mark-as-done':\n onNodeMarkAsDone?.(nodeData);\n\n return;\n default:\n throw new Error(`No callback function for ${optionId}`);\n }\n },\n [\n canReview,\n nodeData,\n onNodeAttemptLocationChange,\n onNodeMarkAsDone,\n onNodeReview,\n onNodeView,\n userAttemptId,\n ],\n );\n\n const handleOnMouseEnter = useCallback(() => {\n setRenderLottie(true);\n }, []);\n\n const handleOnMouseLeave = useCallback(() => {\n setRenderLottie(false);\n }, []);\n\n const menuOptions: INodeMenuOption[] = [\n {\n id: 'node-card-view',\n label: canReview && userAttemptId ? REVIEW : VIEW,\n icon: Eye2Icon,\n disabled: false,\n onClick: handleOnMenuOptionClick,\n },\n {\n id: 'node-card-assign-as-hw',\n label: ASSIGN_AS_HW,\n icon: Home2Icon,\n disabled: !canChangeAttemptLocation || !inClassSheet,\n onClick: handleOnMenuOptionClick,\n },\n {\n id: 'node-card-mark-as-done',\n label: MARK_AS_DONE,\n icon: Check2Icon,\n disabled: !canMarkFamiliar,\n onClick: handleOnMenuOptionClick,\n },\n ];\n\n return (\n <Styled.NodeCardContainer\n $showOutline={!showCardAnimation}\n $isSheetLocked={sheetLocked}\n $background={`${imageHue}_2`}\n $disabled={Boolean(isSkipped)}\n onMouseEnter={handleOnMouseEnter}\n onMouseLeave={handleOnMouseLeave}\n >\n <ArrowTooltip\n renderAs=\"primary\"\n tooltipItem={sheetStatement}\n position=\"bottom\"\n zIndex={5}\n hidden={tooltipHidden}\n parentWidth=\"100%\"\n widthX={11.25}\n >\n <Styled.NodeCardInfoWrapper\n $flexDirection=\"row\"\n $alignItems=\"center\"\n $width=\"100%\"\n $heightX={3.5}\n $bgImage={nodeBgImage}\n $gutterX={0.78125}\n $flexGap={8.5}\n >\n <Styled.IconWrapper\n $width={31}\n $height={31}\n $background=\"WHITE_1\"\n $position=\"relative\"\n $alignItems=\"center\"\n $justifyContent=\"center\"\n $opacity={sheetLocked ? 0.5 : 1}\n >\n {renderLottie ? (\n <LottieAnimation src={nodeCardLottie} />\n ) : (\n <NodeCardIcon width={20} height={20} />\n )}\n {!isOptional && <Styled.StyledImportantIcon />}\n </Styled.IconWrapper>\n\n <Text $renderAs=\"ac4-black\" $color=\"BLACK\" $opacity={sheetLocked ? 0.5 : 1}>\n {cardHeader} {inClassSheet && `. CW`}\n </Text>\n\n <FlexView className=\"context-menu\">\n {isGoalBlock && (\n <Styled.NodeKebabMenuWrapper ref={containerRef} onClick={onMenuClick}>\n <MoreVerticalIcon width={16} height={16} />\n </Styled.NodeKebabMenuWrapper>\n )}\n </FlexView>\n\n {showCardAnimation && !isSkipped && <BorderPathAnimation />}\n </Styled.NodeCardInfoWrapper>\n\n <NodeCardTags nodeType={nodeType} state={state} accuracy={accuracy} />\n\n {!isGoalBlock && (\n <Styled.NodeCardContentWrapper\n $flexDirection=\"row\"\n $alignItems=\"center\"\n $background=\"WHITE_1\"\n $flexGap={8}\n $heightX={4}\n $justifyContent=\"space-between\"\n >\n <Styled.NodeCardTitle\n $renderAs=\"ab3\"\n $color=\"BLACK_1\"\n $opacity={sheetLocked ? 0.5 : 1}\n >\n {title}\n </Styled.NodeCardTitle>\n\n <Styled.NodeKebabMenuWrapper ref={containerRef} onClick={onMenuClick}>\n <MoreVerticalIcon width={16} height={16} />\n </Styled.NodeKebabMenuWrapper>\n </Styled.NodeCardContentWrapper>\n )}\n </ArrowTooltip>\n\n <Styled.NodeMenuOptionsWrapper $visible={menuVisible}>\n <NodeMenuOptions options={menuOptions} />\n </Styled.NodeMenuOptionsWrapper>\n </Styled.NodeCardContainer>\n );\n },\n);\n\nexport default TeacherActions;\n"],"names":["ASSIGN_AS_HW","REVIEW","VIEW","MARK_AS_DONE","TEACHER_MENU_LABELS","TeacherActions","memo","nodeData","imageHue","blockType","isSkipped","onNodeAttemptLocationChange","onNodeMarkAsDone","onNodeView","onNodeReview","renderLottie","setRenderLottie","useState","containerRef","useRef","menuVisible","onMenuClick","useContextMenuClickHandler","accuracy","attemptLocation","nodeType","cardHeader","title","state","isOptional","sheetStatement","permissions","userAttemptId","canChangeAttemptLocation","canMarkFamiliar","canReview","isGoalBlock","BLOCK_TYPE","sheetLocked","NODE_CARD_STATES","sheetNotStarted","sheetInProgress","inClassSheet","tooltipHidden","showCardAnimation","nodeBgImage","getNodeTypeBasedBgImage","NodeCardIcon","nodeCardLottie","getNodeCardBasedIcon","handleOnMenuOptionClick","useCallback","optionId","handleOnMouseEnter","handleOnMouseLeave","menuOptions","Eye2Icon","Home2Icon","Check2Icon","jsxs","Styled.NodeCardContainer","ArrowTooltip","Styled.NodeCardInfoWrapper","Styled.IconWrapper","jsx","LottieAnimation","Styled.StyledImportantIcon","Text","FlexView","Styled.NodeKebabMenuWrapper","MoreVerticalIcon","BorderPathAnimation","NodeCardTags","Styled.NodeCardContentWrapper","Styled.NodeCardTitle","Styled.NodeMenuOptionsWrapper","NodeMenuOptions"],"mappings":";;;;;;;;;;;;;;;;;;;AAwBA,MAAM,EAAE,cAAAA,IAAc,QAAAC,IAAQ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AAAA,kBAAA;AAAA,oBACC,gBAAe;AAAA,oBACf,aAAY;AAAA,oBACZ,aAAY;AAAA,oBACZ,UAAU;AAAA,oBACV,UAAU;AAAA,oBACV,iBAAgB;AAAA,oBAEhB,UAAA;AAAA,sBAAA,gBAAAT;AAAA,wBAACU;AAAAA,wBAAA;AAAA,0BACC,WAAU;AAAA,0BACV,QAAO;AAAA,0BACP,UAAUpC,IAAc,MAAM;AAAA,0BAE7B,UAAAX;AAAA,wBAAA;AAAA,sBACH;AAAA,sBAEC,gBAAAqC,EAAAK,GAAA,EAA4B,KAAKnD,GAAc,SAASG,GACvD,UAAA,gBAAA2C,EAACM,GAAiB,EAAA,OAAO,IAAI,QAAQ,GAAI,CAAA,GAC3C;AAAA,oBAAA;AAAA,kBAAA;AAAA,gBACF;AAAA,cAAA;AAAA,YAAA;AAAA,UAEJ;AAAA,UAEA,gBAAAN,EAACW,IAAA,EAA8B,UAAUvD,GACvC,UAAC,gBAAA4C,EAAAY,IAAA,EAAgB,SAASrB,EAAA,CAAa,EACzC,CAAA;AAAA,QAAA;AAAA,MAAA;AAAA,IAAA;AAAA,EAGN;AACF;"}
1
+ {"version":3,"file":"teacher-actions.js","sources":["../../../../../../src/features/chapters-v2/comps/node-card/teacher-actions/teacher-actions.tsx"],"sourcesContent":["import type { INodeCardProps } from '../node-card-types';\nimport type { INodeMenuOption } from '../node-menu-options/node-menu-options-types';\nimport type { FC } from 'react';\n\nimport { memo, useCallback, useRef, useState } from 'react';\n\nimport Check2Icon from '../../../../../assets/line-icons/icons/check2';\nimport Eye2Icon from '../../../../../assets/line-icons/icons/eye2';\nimport Home2Icon from '../../../../../assets/line-icons/icons/home2';\nimport MoreVerticalIcon from '../../../../../assets/line-icons/icons/more-vertical';\nimport ArrowTooltip from '../../../../ui/arrow-tooltip/arrow-tooltip';\nimport useContextMenuClickHandler from '../../../../ui/hooks/use-context-menu-click-handler';\nimport FlexView from '../../../../ui/layout/flex-view';\nimport LottieAnimation from '../../../../ui/lottie-animation/lottie-animation';\nimport Text from '../../../../ui/text/text';\nimport { BLOCK_TYPE } from '../../../constants/block-constants';\nimport { NODE_CARD_STATES, TEACHER_MENU_LABELS } from '../../../constants/node-constants';\nimport { getNodeTypeBasedBgImage } from '../../../utils';\nimport { getNodeCardBasedIcon } from '../../../utils/node-card-utils';\nimport BorderPathAnimation from '../border-path-animation';\nimport * as Styled from '../node-card-styled';\nimport NodeCardTags from '../node-card-tags';\nimport NodeMenuOptions from '../node-menu-options/node-menu-options';\n\nconst { ASSIGN_AS_HW, REVIEW, VIEW, MARK_AS_DONE } = TEACHER_MENU_LABELS;\n\nconst TeacherActions: FC<Omit<INodeCardProps, 'userType'>> = memo(\n ({\n nodeData,\n imageHue,\n blockType,\n isSkipped,\n onNodeAttemptLocationChange,\n onNodeMarkAsDone,\n onNodeView,\n onNodeReview,\n }) => {\n const [renderLottie, setRenderLottie] = useState(false);\n const containerRef = useRef<HTMLDivElement>(null);\n\n const { menuVisible, onMenuClick } = useContextMenuClickHandler(containerRef);\n\n const {\n accuracy,\n attempt_location: attemptLocation,\n node_type: nodeType,\n card_header: cardHeader,\n title,\n state,\n is_optional: isOptional,\n sheet_statement: sheetStatement,\n permissions,\n user_attempt_id: userAttemptId,\n } = nodeData;\n\n const {\n can_change_attempt_location: canChangeAttemptLocation,\n can_mark_familiar: canMarkFamiliar,\n can_review: canReview,\n } = permissions;\n\n const isGoalBlock = blockType === BLOCK_TYPE.GOAL;\n const sheetLocked = state === NODE_CARD_STATES.LOCKED;\n const sheetNotStarted = state === NODE_CARD_STATES.NOT_STARTED;\n const sheetInProgress = state === NODE_CARD_STATES.IN_PROGRESS;\n const inClassSheet = attemptLocation === 'INCLASS';\n\n const showCardAnimation = !isOptional && (sheetInProgress || sheetNotStarted);\n\n const nodeBgImage = getNodeTypeBasedBgImage(nodeType);\n const { icon: NodeCardIcon, lottie: nodeCardLottie } = getNodeCardBasedIcon(nodeType);\n\n const handleOnMenuOptionClick = useCallback(\n (optionId: string) => {\n switch (optionId) {\n case 'node-card-view':\n if (canReview && userAttemptId) {\n onNodeReview?.(nodeData);\n } else {\n onNodeView?.(nodeData);\n }\n\n return;\n\n case 'node-card-assign-as-hw':\n onNodeAttemptLocationChange?.(nodeData);\n\n return;\n\n case 'node-card-mark-as-done':\n onNodeMarkAsDone?.(nodeData);\n\n return;\n default:\n throw new Error(`No callback function for ${optionId}`);\n }\n },\n [\n canReview,\n nodeData,\n onNodeAttemptLocationChange,\n onNodeMarkAsDone,\n onNodeReview,\n onNodeView,\n userAttemptId,\n ],\n );\n\n const handleOnMouseEnter = useCallback(() => {\n setRenderLottie(true);\n }, []);\n\n const handleOnMouseLeave = useCallback(() => {\n setRenderLottie(false);\n }, []);\n\n const menuOptions: INodeMenuOption[] = [\n {\n id: 'node-card-view',\n label: canReview && userAttemptId ? REVIEW : VIEW,\n icon: Eye2Icon,\n disabled: false,\n onClick: handleOnMenuOptionClick,\n },\n {\n id: 'node-card-assign-as-hw',\n label: ASSIGN_AS_HW,\n icon: Home2Icon,\n disabled: !canChangeAttemptLocation || !inClassSheet,\n onClick: handleOnMenuOptionClick,\n },\n {\n id: 'node-card-mark-as-done',\n label: MARK_AS_DONE,\n icon: Check2Icon,\n disabled: !canMarkFamiliar,\n onClick: handleOnMenuOptionClick,\n },\n ];\n\n return (\n <Styled.NodeCardContainer\n $showOutline={!showCardAnimation}\n $isSheetLocked={sheetLocked}\n $background={`${imageHue}_2`}\n $disabled={Boolean(isSkipped)}\n onMouseEnter={handleOnMouseEnter}\n onMouseLeave={handleOnMouseLeave}\n >\n <ArrowTooltip\n renderAs=\"primary\"\n tooltipItem={sheetStatement}\n position=\"bottom\"\n zIndex={5}\n hidden={!sheetStatement}\n parentWidth=\"100%\"\n widthX={11.25}\n >\n <Styled.NodeCardInfoWrapper\n $flexDirection=\"row\"\n $alignItems=\"center\"\n $width=\"100%\"\n $heightX={3.5}\n $bgImage={nodeBgImage}\n $gutterX={0.78125}\n $flexGap={8.5}\n >\n <Styled.IconWrapper\n $width={31}\n $height={31}\n $background=\"WHITE_1\"\n $position=\"relative\"\n $alignItems=\"center\"\n $justifyContent=\"center\"\n $opacity={sheetLocked ? 0.5 : 1}\n >\n {renderLottie ? (\n <LottieAnimation src={nodeCardLottie} />\n ) : (\n <NodeCardIcon width={20} height={20} />\n )}\n {!isOptional && <Styled.StyledImportantIcon />}\n </Styled.IconWrapper>\n\n <Text $renderAs=\"ac4-black\" $color=\"BLACK\" $opacity={sheetLocked ? 0.5 : 1}>\n {cardHeader} {inClassSheet && `. CW`}\n </Text>\n\n <FlexView className=\"context-menu\">\n {isGoalBlock && (\n <Styled.NodeKebabMenuWrapper ref={containerRef} onClick={onMenuClick}>\n <MoreVerticalIcon width={16} height={16} />\n </Styled.NodeKebabMenuWrapper>\n )}\n </FlexView>\n\n {showCardAnimation && !isSkipped && <BorderPathAnimation />}\n </Styled.NodeCardInfoWrapper>\n\n <NodeCardTags nodeType={nodeType} state={state} accuracy={accuracy} />\n\n {!isGoalBlock && (\n <Styled.NodeCardContentWrapper\n $flexDirection=\"row\"\n $alignItems=\"center\"\n $background=\"WHITE_1\"\n $flexGap={8}\n $heightX={4}\n $justifyContent=\"space-between\"\n >\n <Styled.NodeCardTitle\n $renderAs=\"ab3\"\n $color=\"BLACK_1\"\n $opacity={sheetLocked ? 0.5 : 1}\n >\n {title}\n </Styled.NodeCardTitle>\n\n <Styled.NodeKebabMenuWrapper ref={containerRef} onClick={onMenuClick}>\n <MoreVerticalIcon width={16} height={16} />\n </Styled.NodeKebabMenuWrapper>\n </Styled.NodeCardContentWrapper>\n )}\n </ArrowTooltip>\n\n <Styled.NodeMenuOptionsWrapper $visible={menuVisible}>\n <NodeMenuOptions options={menuOptions} />\n </Styled.NodeMenuOptionsWrapper>\n </Styled.NodeCardContainer>\n );\n },\n);\n\nexport default TeacherActions;\n"],"names":["ASSIGN_AS_HW","REVIEW","VIEW","MARK_AS_DONE","TEACHER_MENU_LABELS","TeacherActions","memo","nodeData","imageHue","blockType","isSkipped","onNodeAttemptLocationChange","onNodeMarkAsDone","onNodeView","onNodeReview","renderLottie","setRenderLottie","useState","containerRef","useRef","menuVisible","onMenuClick","useContextMenuClickHandler","accuracy","attemptLocation","nodeType","cardHeader","title","state","isOptional","sheetStatement","permissions","userAttemptId","canChangeAttemptLocation","canMarkFamiliar","canReview","isGoalBlock","BLOCK_TYPE","sheetLocked","NODE_CARD_STATES","sheetNotStarted","sheetInProgress","inClassSheet","showCardAnimation","nodeBgImage","getNodeTypeBasedBgImage","NodeCardIcon","nodeCardLottie","getNodeCardBasedIcon","handleOnMenuOptionClick","useCallback","optionId","handleOnMouseEnter","handleOnMouseLeave","menuOptions","Eye2Icon","Home2Icon","Check2Icon","jsxs","Styled.NodeCardContainer","ArrowTooltip","Styled.NodeCardInfoWrapper","Styled.IconWrapper","jsx","LottieAnimation","Styled.StyledImportantIcon","Text","FlexView","Styled.NodeKebabMenuWrapper","MoreVerticalIcon","BorderPathAnimation","NodeCardTags","Styled.NodeCardContentWrapper","Styled.NodeCardTitle","Styled.NodeMenuOptionsWrapper","NodeMenuOptions"],"mappings":";;;;;;;;;;;;;;;;;;;AAwBA,MAAM,EAAE,cAAAA,IAAc,QAAAC,IAAQ,MAAAC,IAAM,cAAAC,OAAiBC,IAE/CC,KAAuDC;AAAA,EAC3D,CAAC;AAAA,IACC,UAAAC;AAAA,IACA,UAAAC;AAAA,IACA,WAAAC;AAAA,IACA,WAAAC;AAAA,IACA,6BAAAC;AAAA,IACA,kBAAAC;AAAA,IACA,YAAAC;AAAA,IACA,cAAAC;AAAA,EAAA,MACI;AACJ,UAAM,CAACC,GAAcC,CAAe,IAAIC,EAAS,EAAK,GAChDC,IAAeC,EAAuB,IAAI,GAE1C,EAAE,aAAAC,GAAa,aAAAC,EAAY,IAAIC,EAA2BJ,CAAY,GAEtE;AAAA,MACJ,UAAAK;AAAA,MACA,kBAAkBC;AAAA,MAClB,WAAWC;AAAA,MACX,aAAaC;AAAA,MACb,OAAAC;AAAA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AA,YAAA;AAAA,UAEJ;AAAA,UAEA,gBAAAN,EAACW,IAAA,EAA8B,UAAUtD,GACvC,UAAC,gBAAA2C,EAAAY,IAAA,EAAgB,SAASrB,EAAA,CAAa,EACzC,CAAA;AAAA,QAAA;AAAA,MAAA;AAAA,IAAA;AAAA,EAGN;AACF;"}
@@ -25,7 +25,7 @@ const $e = ({
25
25
  startHomePageJourney: m,
26
26
  canStartJourney: k
27
27
  }) => {
28
- const r = re(null), [K, b] = u(!1), [M, H] = u(!1), [F, G] = u(!1), [X, Q] = u(!0), {
28
+ const r = re(null), [K, b] = u(!1), [M, H] = u(!1), [F, G] = u(!1), [Q, X] = u(!0), {
29
29
  get: _,
30
30
  data: e,
31
31
  isProcessingFailed: O,
@@ -58,7 +58,7 @@ const $e = ({
58
58
  }, []), i = n(() => {
59
59
  if (r.current) {
60
60
  const { scrollLeft: t, scrollWidth: l, clientWidth: C } = r.current;
61
- G(t > 10), Q(t < l - C - 10);
61
+ G(t > 1), X(t < l - C - 1);
62
62
  }
63
63
  }, []);
64
64
  h(() => {
@@ -141,7 +141,6 @@ const $e = ({
141
141
  e.length > 10 && l === 10 && /* @__PURE__ */ o(
142
142
  de,
143
143
  {
144
- $widthX: 9.5,
145
144
  $background: "BLACK_4",
146
145
  $justifyContent: "center",
147
146
  $gutter: 4,
@@ -171,7 +170,7 @@ const $e = ({
171
170
  w
172
171
  );
173
172
  }) }) }),
174
- X && /* @__PURE__ */ o(
173
+ Q && /* @__PURE__ */ o(
175
174
  A,
176
175
  {
177
176
  $position: "absolute",
@@ -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/types/homepage-journey-types';\nimport type { TUserTypes } from '../../ui/types';\n\nimport React, { useCallback, useEffect, useRef, useState } from 'react';\n\nimport ChevronLeftIcon from '../../../assets/line-icons/icons/chevron-left';\nimport ChevronRightIcon from '../../../assets/line-icons/icons/chevron-right';\nimport { useJourney } from '../../journey/use-journey/use-journey';\nimport { getTopicsFromItems } from '../../milestone/milestone-tests/tests-list/test-sheets-list/test-sheet-item/test-sheet-item-utils';\nimport FlexView from '../../ui/layout/flex-view';\nimport Text from '../../ui/text/text';\nimport HomeworkCard from '../homework-card';\nimport { useGetHomeworks } from './api/get-homeworks';\nimport * as Styled from './hw-card-list-styled';\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) => void;\n onTestReview?: (sheetData: INodeDataProps, milestoneId?: string) => void;\n homeworkRef?: React.RefObject<HTMLDivElement>;\n individualHomeworkRef?: React.RefObject<HTMLDivElement>;\n startHomePageJourney?: ({\n hwDetails,\n studentId,\n stream,\n userType,\n }: IHomepageStartJourneyProps) => void;\n canStartJourney?: boolean;\n}\n\nconst HWCardList: React.FC<HWCardListProps> = ({\n userType = 'STUDENT',\n studentId,\n stream,\n onTestStart,\n onNodeAttempt,\n onTestPreview,\n onNodeView,\n onTestReview,\n onNodeReview,\n onNodeUnassign,\n homeworkRef,\n individualHomeworkRef,\n startHomePageJourney,\n canStartJourney,\n}) => {\n const scrollRef = useRef<HTMLDivElement>(null);\n const [isLeftHovered, setIsLeftHovered] = useState(false);\n const [isRightHovered, setIsRightHovered] = useState(false);\n const [canScrollLeft, setCanScrollLeft] = useState(false);\n const [canScrollRight, setCanScrollRight] = useState(true);\n const {\n get: getHomeworks,\n data: hwDetails,\n isProcessingFailed,\n isProcessing,\n isStale,\n } = useGetHomeworks(studentId);\n const { isJourneyActive } = useJourney();\n\n useEffect(() => {\n if (hwDetails?.length && startHomePageJourney && !isJourneyActive && canStartJourney) {\n startHomePageJourney({ hwDetails, studentId, stream, userType });\n }\n }, [\n canStartJourney,\n hwDetails,\n isJourneyActive,\n startHomePageJourney,\n stream,\n studentId,\n userType,\n ]);\n\n const handleScrollLeft = useCallback(() => {\n if (scrollRef.current) {\n scrollRef.current.scrollBy({ left: -200, behavior: 'smooth' });\n }\n }, []);\n\n const handleScrollRight = useCallback(() => {\n if (scrollRef.current) {\n scrollRef.current.scrollBy({ left: 200, behavior: 'smooth' });\n }\n }, []);\n\n const handleLeftHoverEnter = useCallback(() => {\n setIsLeftHovered(true);\n }, []);\n\n const handleLeftHoverLeave = useCallback(() => {\n setIsLeftHovered(false);\n }, []);\n\n const handleRightHoverEnter = useCallback(() => {\n setIsRightHovered(true);\n }, []);\n\n const handleRightHoverLeave = useCallback(() => {\n setIsRightHovered(false);\n }, []);\n\n const checkScrollPosition = useCallback(() => {\n if (scrollRef.current) {\n const { scrollLeft, scrollWidth, clientWidth } = scrollRef.current;\n\n setCanScrollLeft(scrollLeft > 10);\n setCanScrollRight(scrollLeft < scrollWidth - clientWidth - 10);\n }\n }, []);\n\n useEffect(() => {\n const scrollElement = scrollRef.current;\n\n if (scrollElement) {\n scrollElement.addEventListener('scroll', checkScrollPosition);\n checkScrollPosition();\n\n return () => {\n scrollElement.removeEventListener('scroll', checkScrollPosition);\n };\n }\n }, [checkScrollPosition]);\n\n // Also check when content changes\n useEffect(() => {\n checkScrollPosition();\n }, [hwDetails, checkScrollPosition]);\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 const waitForReviewSheets = (hwDetails?.filter(sheet => sheet.state === 'WAIT_FOR_REVIEW') || [])\n .length;\n\n if (hwDetails && hwDetails.length === 0) {\n return (\n <FlexView $flexRowGapX={1}>\n <Text $renderAs=\"ac4-black\" $color=\"BLACK_T_60\">\n Homework ({hwDetails?.length})\n </Text>\n <Text $renderAs=\"ab2\" $color=\"BLACK_T_60\">\n No Homework assigned yet\n </Text>\n </FlexView>\n );\n }\n\n if (isProcessingFailed) {\n return null;\n }\n\n return (\n <Styled.ContentWrapper ref={homeworkRef} $flexRowGapX={1} $disablePointerEvents={isProcessing}>\n {!isJourneyActive && (\n <Text $renderAs=\"ac4-black\" $color=\"BLACK_T_60\">\n Homework ({waitForReviewSheets}/{hwDetails?.length})\n </Text>\n )}\n <FlexView $position=\"relative\" onMouseEnter={checkScrollPosition}>\n {/* Left hover zone */}\n {canScrollLeft && (\n <Styled.HoverZone\n key=\"left-hover-zone\"\n $position=\"absolute\"\n $width=\"60px\"\n left=\"0\"\n right=\"auto\"\n onMouseEnter={handleLeftHoverEnter}\n onMouseLeave={handleLeftHoverLeave}\n >\n {/* Left scroll button - only visible when hovered */}\n <Styled.ScrollButton\n $position=\"absolute\"\n $background=\"BLACK_T_60\"\n $justifyContent=\"center\"\n $alignItems=\"center\"\n $height=\"100%\"\n onClick={handleScrollLeft}\n $visible={isLeftHovered}\n left=\"0px\"\n right=\"auto\"\n >\n <ChevronLeftIcon width={24} height={24} />\n </Styled.ScrollButton>\n </Styled.HoverZone>\n )}\n\n <Styled.ScrollContainer ref={scrollRef}>\n <FlexView $flexDirection=\"row\" $flexGapX={1}>\n {hwDetails?.map((sheet, idx) => {\n const {\n items,\n node_id: nodeId,\n worksheet_id: worksheetId,\n node_type: nodeType,\n title,\n subtext,\n } = sheet;\n const topics = getTopicsFromItems(items);\n const testChapterName = topics.join(', ');\n const isDynamicSheet = nodeType === 'DYNAMIC';\n\n return (\n <FlexView\n ref={idx === 0 ? individualHomeworkRef : undefined}\n key={nodeId}\n $flexDirection=\"row\"\n $flexGapX={1}\n >\n {hwDetails.length > 10 && idx === 10 && (\n <Styled.QueueWrapper\n $widthX={9.5}\n $background=\"BLACK_4\"\n $justifyContent=\"center\"\n $gutter={4}\n $gap={8}\n >\n <Styled.QueueText $renderAs=\"ac3\" $color=\"WHITE\">\n In Queue\n </Styled.QueueText>\n </Styled.QueueWrapper>\n )}\n <HomeworkCard\n isInQueue={hwDetails.length > 10 && idx > 9}\n key={`${worksheetId}_${nodeId}_${idx}`}\n userType={userType}\n header={isDynamicSheet ? testChapterName : title}\n subHeader={subtext || ''}\n nodeData={sheet}\n renderAs=\"homework\"\n onNodeAttempt={isDynamicSheet ? onTestStart : onNodeAttempt}\n shouldOpenOnRight={hwDetails.length > 3 && idx === hwDetails.length - 1}\n onNodeView={isDynamicSheet ? onTestPreview : onNodeView}\n onNodeReview={isDynamicSheet ? onTestReview : onNodeReview}\n onNodeUnassign={onNodeUnassign}\n />\n </FlexView>\n );\n })}\n </FlexView>\n </Styled.ScrollContainer>\n\n {/* Right hover zone */}\n {canScrollRight && (\n <Styled.HoverZone\n key=\"right-hover-zone\"\n $position=\"absolute\"\n $width=\"60px\"\n right=\"0\"\n left=\"auto\"\n onMouseEnter={handleRightHoverEnter}\n onMouseLeave={handleRightHoverLeave}\n >\n {/* Right scroll button - only visible when hovered */}\n <Styled.ScrollButton\n $position=\"absolute\"\n $width=\"60px\"\n $height=\"100%\"\n $background=\"BLACK_T_60\"\n $justifyContent=\"center\"\n $alignItems=\"center\"\n onClick={handleScrollRight}\n $visible={isRightHovered}\n left=\"auto\"\n right=\"0px\"\n >\n <ChevronRightIcon width={24} height={24} />\n </Styled.ScrollButton>\n </Styled.HoverZone>\n )}\n </FlexView>\n </Styled.ContentWrapper>\n );\n};\n\nexport default HWCardList;\n"],"names":["HWCardList","userType","studentId","stream","onTestStart","onNodeAttempt","onTestPreview","onNodeView","onTestReview","onNodeReview","onNodeUnassign","homeworkRef","individualHomeworkRef","startHomePageJourney","canStartJourney","scrollRef","useRef","isLeftHovered","setIsLeftHovered","useState","isRightHovered","setIsRightHovered","canScrollLeft","setCanScrollLeft","canScrollRight","setCanScrollRight","getHomeworks","hwDetails","isProcessingFailed","isProcessing","isStale","useGetHomeworks","isJourneyActive","useJourney","useEffect","handleScrollLeft","useCallback","handleScrollRight","handleLeftHoverEnter","handleLeftHoverLeave","handleRightHoverEnter","handleRightHoverLeave","checkScrollPosition","scrollLeft","scrollWidth","clientWidth","scrollElement","fetchHomeworks","waitForReviewSheets","sheet","jsxs","FlexView","Text","Styled.ContentWrapper","jsx","Styled.HoverZone","Styled.ScrollButton","ChevronLeftIcon","Styled.ScrollContainer","idx","items","nodeId","worksheetId","nodeType","title","subtext","testChapterName","getTopicsFromItems","isDynamicSheet","Styled.QueueWrapper","Styled.QueueText","HomeworkCard","ChevronRightIcon","HWCardList$1"],"mappings":";;;;;;;;;;;AAqCA,MAAMA,KAAwC,CAAC;AAAA,EAC7C,UAAAC,IAAW;AAAA,EACX,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,uBAAAC;AAAA,EACA,sBAAAC;AAAA,EACA,iBAAAC;AACF,MAAM;AACE,QAAAC,IAAYC,GAAuB,IAAI,GACvC,CAACC,GAAeC,CAAgB,IAAIC,EAAS,EAAK,GAClD,CAACC,GAAgBC,CAAiB,IAAIF,EAAS,EAAK,GACpD,CAACG,GAAeC,CAAgB,IAAIJ,EAAS,EAAK,GAClD,CAACK,GAAgBC,CAAiB,IAAIN,EAAS,EAAI,GACnD;AAAA,IACJ,KAAKO;AAAA,IACL,MAAMC;AAAA,IACN,oBAAAC;AAAA,IACA,cAAAC;AAAA,IACA,SAAAC;AAAA,EAAA,IACEC,GAAgB7B,CAAS,GACvB,EAAE,iBAAA8B,MAAoBC;AAE5B,EAAAC,EAAU,MAAM;AACd,IAAIP,KAAA,QAAAA,EAAW,UAAUd,KAAwB,CAACmB,KAAmBlB,KACnED,EAAqB,EAAE,WAAAc,GAAW,WAAAzB,GAAW,QAAAC,GAAQ,UAAAF,EAAU,CAAA;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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/types/homepage-journey-types';\nimport type { TUserTypes } from '../../ui/types';\n\nimport React, { useCallback, useEffect, useRef, useState } from 'react';\n\nimport ChevronLeftIcon from '../../../assets/line-icons/icons/chevron-left';\nimport ChevronRightIcon from '../../../assets/line-icons/icons/chevron-right';\nimport { useJourney } from '../../journey/use-journey/use-journey';\nimport { getTopicsFromItems } from '../../milestone/milestone-tests/tests-list/test-sheets-list/test-sheet-item/test-sheet-item-utils';\nimport FlexView from '../../ui/layout/flex-view';\nimport Text from '../../ui/text/text';\nimport HomeworkCard from '../homework-card';\nimport { useGetHomeworks } from './api/get-homeworks';\nimport * as Styled from './hw-card-list-styled';\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) => void;\n onTestReview?: (sheetData: INodeDataProps, milestoneId?: string) => void;\n homeworkRef?: React.RefObject<HTMLDivElement>;\n individualHomeworkRef?: React.RefObject<HTMLDivElement>;\n startHomePageJourney?: ({\n hwDetails,\n studentId,\n stream,\n userType,\n }: IHomepageStartJourneyProps) => void;\n canStartJourney?: boolean;\n}\n\nconst HWCardList: React.FC<HWCardListProps> = ({\n userType = 'STUDENT',\n studentId,\n stream,\n onTestStart,\n onNodeAttempt,\n onTestPreview,\n onNodeView,\n onTestReview,\n onNodeReview,\n onNodeUnassign,\n homeworkRef,\n individualHomeworkRef,\n startHomePageJourney,\n canStartJourney,\n}) => {\n const scrollRef = useRef<HTMLDivElement>(null);\n const [isLeftHovered, setIsLeftHovered] = useState(false);\n const [isRightHovered, setIsRightHovered] = useState(false);\n const [canScrollLeft, setCanScrollLeft] = useState(false);\n const [canScrollRight, setCanScrollRight] = useState(true);\n const {\n get: getHomeworks,\n data: hwDetails,\n isProcessingFailed,\n isProcessing,\n isStale,\n } = useGetHomeworks(studentId);\n const { isJourneyActive } = useJourney();\n\n useEffect(() => {\n if (hwDetails?.length && startHomePageJourney && !isJourneyActive && canStartJourney) {\n startHomePageJourney({ hwDetails, studentId, stream, userType });\n }\n }, [\n canStartJourney,\n hwDetails,\n isJourneyActive,\n startHomePageJourney,\n stream,\n studentId,\n userType,\n ]);\n\n const handleScrollLeft = useCallback(() => {\n if (scrollRef.current) {\n scrollRef.current.scrollBy({ left: -200, behavior: 'smooth' });\n }\n }, []);\n\n const handleScrollRight = useCallback(() => {\n if (scrollRef.current) {\n scrollRef.current.scrollBy({ left: 200, behavior: 'smooth' });\n }\n }, []);\n\n const handleLeftHoverEnter = useCallback(() => {\n setIsLeftHovered(true);\n }, []);\n\n const handleLeftHoverLeave = useCallback(() => {\n setIsLeftHovered(false);\n }, []);\n\n const handleRightHoverEnter = useCallback(() => {\n setIsRightHovered(true);\n }, []);\n\n const handleRightHoverLeave = useCallback(() => {\n setIsRightHovered(false);\n }, []);\n\n const checkScrollPosition = useCallback(() => {\n if (scrollRef.current) {\n const { scrollLeft, scrollWidth, clientWidth } = scrollRef.current;\n\n setCanScrollLeft(scrollLeft > 1);\n setCanScrollRight(scrollLeft < scrollWidth - clientWidth - 1);\n }\n }, []);\n\n useEffect(() => {\n const scrollElement = scrollRef.current;\n\n if (scrollElement) {\n scrollElement.addEventListener('scroll', checkScrollPosition);\n checkScrollPosition();\n\n return () => {\n scrollElement.removeEventListener('scroll', checkScrollPosition);\n };\n }\n }, [checkScrollPosition]);\n\n // Also check when content changes\n useEffect(() => {\n checkScrollPosition();\n }, [hwDetails, checkScrollPosition]);\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 const waitForReviewSheets = (hwDetails?.filter(sheet => sheet.state === 'WAIT_FOR_REVIEW') || [])\n .length;\n\n if (hwDetails && hwDetails.length === 0) {\n return (\n <FlexView $flexRowGapX={1}>\n <Text $renderAs=\"ac4-black\" $color=\"BLACK_T_60\">\n Homework ({hwDetails?.length})\n </Text>\n <Text $renderAs=\"ab2\" $color=\"BLACK_T_60\">\n No Homework assigned yet\n </Text>\n </FlexView>\n );\n }\n\n if (isProcessingFailed) {\n return null;\n }\n\n return (\n <Styled.ContentWrapper ref={homeworkRef} $flexRowGapX={1} $disablePointerEvents={isProcessing}>\n {!isJourneyActive && (\n <Text $renderAs=\"ac4-black\" $color=\"BLACK_T_60\">\n Homework ({waitForReviewSheets}/{hwDetails?.length})\n </Text>\n )}\n <FlexView $position=\"relative\" onMouseEnter={checkScrollPosition}>\n {/* Left hover zone */}\n {canScrollLeft && (\n <Styled.HoverZone\n key=\"left-hover-zone\"\n $position=\"absolute\"\n $width=\"60px\"\n left=\"0\"\n right=\"auto\"\n onMouseEnter={handleLeftHoverEnter}\n onMouseLeave={handleLeftHoverLeave}\n >\n {/* Left scroll button - only visible when hovered */}\n <Styled.ScrollButton\n $position=\"absolute\"\n $background=\"BLACK_T_60\"\n $justifyContent=\"center\"\n $alignItems=\"center\"\n $height=\"100%\"\n onClick={handleScrollLeft}\n $visible={isLeftHovered}\n left=\"0px\"\n right=\"auto\"\n >\n <ChevronLeftIcon width={24} height={24} />\n </Styled.ScrollButton>\n </Styled.HoverZone>\n )}\n\n <Styled.ScrollContainer ref={scrollRef}>\n <FlexView $flexDirection=\"row\" $flexGapX={1}>\n {hwDetails?.map((sheet, idx) => {\n const {\n items,\n node_id: nodeId,\n worksheet_id: worksheetId,\n node_type: nodeType,\n title,\n subtext,\n } = sheet;\n const topics = getTopicsFromItems(items);\n const testChapterName = topics.join(', ');\n const isDynamicSheet = nodeType === 'DYNAMIC';\n\n return (\n <FlexView\n ref={idx === 0 ? individualHomeworkRef : undefined}\n key={nodeId}\n $flexDirection=\"row\"\n $flexGapX={1}\n >\n {hwDetails.length > 10 && idx === 10 && (\n <Styled.QueueWrapper\n $background=\"BLACK_4\"\n $justifyContent=\"center\"\n $gutter={4}\n $gap={8}\n >\n <Styled.QueueText $renderAs=\"ac3\" $color=\"WHITE\">\n In Queue\n </Styled.QueueText>\n </Styled.QueueWrapper>\n )}\n <HomeworkCard\n isInQueue={hwDetails.length > 10 && idx > 9}\n key={`${worksheetId}_${nodeId}_${idx}`}\n userType={userType}\n header={isDynamicSheet ? testChapterName : title}\n subHeader={subtext || ''}\n nodeData={sheet}\n renderAs=\"homework\"\n onNodeAttempt={isDynamicSheet ? onTestStart : onNodeAttempt}\n shouldOpenOnRight={hwDetails.length > 3 && idx === hwDetails.length - 1}\n onNodeView={isDynamicSheet ? onTestPreview : onNodeView}\n onNodeReview={isDynamicSheet ? onTestReview : onNodeReview}\n onNodeUnassign={onNodeUnassign}\n />\n </FlexView>\n );\n })}\n </FlexView>\n </Styled.ScrollContainer>\n\n {/* Right hover zone */}\n {canScrollRight && (\n <Styled.HoverZone\n key=\"right-hover-zone\"\n $position=\"absolute\"\n $width=\"60px\"\n right=\"0\"\n left=\"auto\"\n onMouseEnter={handleRightHoverEnter}\n onMouseLeave={handleRightHoverLeave}\n >\n {/* Right scroll button - only visible when hovered */}\n <Styled.ScrollButton\n $position=\"absolute\"\n $width=\"60px\"\n $height=\"100%\"\n $background=\"BLACK_T_60\"\n $justifyContent=\"center\"\n $alignItems=\"center\"\n onClick={handleScrollRight}\n $visible={isRightHovered}\n left=\"auto\"\n right=\"0px\"\n >\n <ChevronRightIcon width={24} height={24} />\n </Styled.ScrollButton>\n </Styled.HoverZone>\n )}\n </FlexView>\n </Styled.ContentWrapper>\n );\n};\n\nexport default HWCardList;\n"],"names":["HWCardList","userType","studentId","stream","onTestStart","onNodeAttempt","onTestPreview","onNodeView","onTestReview","onNodeReview","onNodeUnassign","homeworkRef","individualHomeworkRef","startHomePageJourney","canStartJourney","scrollRef","useRef","isLeftHovered","setIsLeftHovered","useState","isRightHovered","setIsRightHovered","canScrollLeft","setCanScrollLeft","canScrollRight","setCanScrollRight","getHomeworks","hwDetails","isProcessingFailed","isProcessing","isStale","useGetHomeworks","isJourneyActive","useJourney","useEffect","handleScrollLeft","useCallback","handleScrollRight","handleLeftHoverEnter","handleLeftHoverLeave","handleRightHoverEnter","handleRightHoverLeave","checkScrollPosition","scrollLeft","scrollWidth","clientWidth","scrollElement","fetchHomeworks","waitForReviewSheets","sheet","jsxs","FlexView","Text","Styled.ContentWrapper","jsx","Styled.HoverZone","Styled.ScrollButton","ChevronLeftIcon","Styled.ScrollContainer","idx","items","nodeId","worksheetId","nodeType","title","subtext","testChapterName","getTopicsFromItems","isDynamicSheet","Styled.QueueWrapper","Styled.QueueText","HomeworkCard","ChevronRightIcon","HWCardList$1"],"mappings":";;;;;;;;;;;AAqCA,MAAMA,KAAwC,CAAC;AAAA,EAC7C,UAAAC,IAAW;AAAA,EACX,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,uBAAAC;AAAA,EACA,sBAAAC;AAAA,EACA,iBAAAC;AACF,MAAM;AACE,QAAAC,IAAYC,GAAuB,IAAI,GACvC,CAACC,GAAeC,CAAgB,IAAIC,EAAS,EAAK,GAClD,CAACC,GAAgBC,CAAiB,IAAIF,EAAS,EAAK,GACpD,CAACG,GAAeC,CAAgB,IAAIJ,EAAS,EAAK,GAClD,CAACK,GAAgBC,CAAiB,IAAIN,EAAS,EAAI,GACnD;AAAA,IACJ,KAAKO;AAAA,IACL,MAAMC;AAAA,IACN,oBAAAC;AAAA,IACA,cAAAC;AAAA,IACA,SAAAC;AAAA,EAAA,IACEC,GAAgB7B,CAAS,GACvB,EAA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AA,UAC3C;AAAA,QAAA;AAAA,QAtBI;AAAA,MAuBN;AAAA,IAAA,GAEJ;AAAA,EACF,EAAA,CAAA;AAEJ,GAEAC,KAAezE;"}
@@ -1,18 +1,18 @@
1
- import { jsx as e, jsxs as h, Fragment as P } from "react/jsx-runtime";
1
+ import { jsx as e, jsxs as p, Fragment as P } from "react/jsx-runtime";
2
2
  import { useRef as a, useCallback as L, useMemo as Y, useEffect as _ } from "react";
3
3
  import $ from "../../homework/homework-card.js";
4
4
  import J from "../../homework/hw-card-list/hw-card-list.js";
5
5
  import { getTopicsFromItems as U } from "../../milestone/milestone-tests/tests-list/test-sheets-list/test-sheet-item/test-sheet-item-utils.js";
6
6
  import z from "../../recent-chapters/recent-chapters.js";
7
- import u from "../../ui/buttons/button/button.js";
7
+ import h from "../../ui/buttons/button/button.js";
8
8
  import s from "../../ui/layout/flex-view.js";
9
- import C from "../../ui/text/text.js";
9
+ import u from "../../ui/text/text.js";
10
10
  import { ELementWrapper as H } from "../comps/coachmark/coachmark-styled.js";
11
11
  import { JOURNEY_ID_STUDENT as O } from "../journey-id/journey-id-student.js";
12
- import { IndicatorType as f } from "../use-journey/constants.js";
12
+ import { IndicatorType as C } from "../use-journey/constants.js";
13
13
  import { useJourney as K } from "../use-journey/use-journey.js";
14
14
  const ie = () => {
15
- const o = O.HOMEPAGE_JOURNEY, i = a(null), n = a(null), l = a(null), c = a(null), g = a([]), { nextCoachmark: t, setJourney: A, endJourney: w, addCoachmark: E } = K(), y = L(
15
+ const o = O.HOMEPAGE_JOURNEY, i = a(null), n = a(null), l = a(null), c = a(null), f = a([]), { nextCoachmark: t, setJourney: A, endJourney: g, addCoachmark: E } = K(), y = L(
16
16
  (r, d, m) => {
17
17
  c.current ? (E(O.HOMEPAGE_JOURNEY, {
18
18
  originalElementToHighlightRef: c,
@@ -26,18 +26,18 @@ const ie = () => {
26
26
  }
27
27
  ) }),
28
28
  isActive: !1,
29
- type: f.TOOLTIP,
29
+ type: C.TOOLTIP,
30
30
  indicator: {
31
- tooltipItem: /* @__PURE__ */ h(s, { $flexRowGapX: 0.75, $justifyContent: "flex-start", children: [
32
- /* @__PURE__ */ e(C, { $renderAs: "ab2-bold", children: "Access all your recent chapters in one place." }),
31
+ tooltipItem: /* @__PURE__ */ p(s, { $flexRowGapX: 0.75, $justifyContent: "flex-start", children: [
32
+ /* @__PURE__ */ e(u, { $renderAs: "ab2-bold", children: "Access all your recent chapters in one place." }),
33
33
  /* @__PURE__ */ e(
34
- u,
34
+ h,
35
35
  {
36
36
  label: "Got it",
37
37
  size: "xsmall",
38
38
  widthX: 6,
39
39
  renderAs: "secondary",
40
- onClick: () => w(O.HOMEPAGE_JOURNEY)
40
+ onClick: () => g(O.HOMEPAGE_JOURNEY)
41
41
  }
42
42
  )
43
43
  ] }),
@@ -52,33 +52,33 @@ const ie = () => {
52
52
  arrowSize: 12,
53
53
  width: 264
54
54
  }
55
- }), t(o, !1, 0, !0)) : w(o);
55
+ }), t(o, !1, 0, !0)) : g(o);
56
56
  },
57
- [t, o, E, w]
57
+ [t, o, E, g]
58
58
  ), b = L(
59
- ({ hwDetails: r, studentId: d, stream: m, userType: T }) => {
60
- const { items: k, node_type: X, title: I, subtext: N } = r[0], S = U(k).join(", "), B = X === "DYNAMIC", p = T === "STUDENT";
59
+ ({ hwDetails: r, studentId: d, stream: m, userType: w }) => {
60
+ const { items: k, node_type: X, title: I, subtext: N } = r[0], S = U(k).join(", "), B = X === "DYNAMIC", T = w === "STUDENT";
61
61
  if (!(i != null && i.current) || !(n != null && n.current) || !(l != null && l.current))
62
62
  return;
63
63
  const G = [
64
64
  {
65
65
  originalElementToHighlightRef: i,
66
66
  isActive: !1,
67
- type: f.TOOLTIP,
67
+ type: C.TOOLTIP,
68
68
  elementToHighlight: /* @__PURE__ */ e(P, {}),
69
69
  indicator: {
70
- position: "left",
71
- tooltipXCoOrdinates: 0,
72
- tooltipYCoOrdinates: p ? 100 : 0,
70
+ position: "top",
71
+ tooltipXCoOrdinates: 360,
72
+ tooltipYCoOrdinates: 30,
73
73
  backgroundColor: "BLUE_4",
74
74
  borderColor: "BLACK",
75
75
  arrowColor: "BLACK",
76
76
  arrowSize: 12,
77
77
  width: 264,
78
- tooltipItem: /* @__PURE__ */ h(s, { $flexRowGapX: 0.75, children: [
79
- /* @__PURE__ */ e(C, { $renderAs: "ab2-bold", children: p ? "Welcome to the all new learning homepage." : "Welcome to the all new tutoring homepage." }),
78
+ tooltipItem: /* @__PURE__ */ p(s, { $flexRowGapX: 0.75, children: [
79
+ /* @__PURE__ */ e(u, { $renderAs: "ab2-bold", children: T ? "Welcome to the all new learning homepage." : "Welcome to the all new tutoring homepage." }),
80
80
  /* @__PURE__ */ e(
81
- u,
81
+ h,
82
82
  {
83
83
  label: "Next",
84
84
  size: "xsmall",
@@ -92,8 +92,8 @@ const ie = () => {
92
92
  },
93
93
  {
94
94
  originalElementToHighlightRef: n,
95
- elementToHighlight: /* @__PURE__ */ e(H, { children: /* @__PURE__ */ e(J, { userType: T, studentId: d, stream: m }) }),
96
- type: f.TOOLTIP,
95
+ elementToHighlight: /* @__PURE__ */ e(H, { children: /* @__PURE__ */ e(J, { userType: w, studentId: d, stream: m }) }),
96
+ type: C.TOOLTIP,
97
97
  indicator: {
98
98
  position: "top",
99
99
  tooltipXCoOrdinates: -197,
@@ -104,10 +104,10 @@ const ie = () => {
104
104
  arrowColor: "BLACK",
105
105
  width: 264,
106
106
  arrowSize: 12,
107
- tooltipItem: /* @__PURE__ */ h(s, { $flexRowGapX: 0.75, children: [
108
- /* @__PURE__ */ e(C, { $renderAs: "ab2-bold", children: p ? "Homework is now easy to access and easy to complete!" : "Homework is now easy to access and easy to review!" }),
107
+ tooltipItem: /* @__PURE__ */ p(s, { $flexRowGapX: 0.75, children: [
108
+ /* @__PURE__ */ e(u, { $renderAs: "ab2-bold", children: T ? "Homework is now easy to access and easy to complete!" : "Homework is now easy to access and easy to review!" }),
109
109
  /* @__PURE__ */ e(
110
- u,
110
+ h,
111
111
  {
112
112
  label: "Next",
113
113
  size: "xsmall",
@@ -126,7 +126,7 @@ const ie = () => {
126
126
  $,
127
127
  {
128
128
  isInQueue: !1,
129
- userType: T,
129
+ userType: w,
130
130
  header: B ? S : I,
131
131
  subHeader: N || "",
132
132
  nodeData: r[0],
@@ -134,7 +134,7 @@ const ie = () => {
134
134
  shouldOpenOnRight: !1
135
135
  }
136
136
  ) }),
137
- type: f.TOOLTIP,
137
+ type: C.TOOLTIP,
138
138
  indicator: {
139
139
  position: "top",
140
140
  tooltipXCoOrdinates: -35,
@@ -145,16 +145,16 @@ const ie = () => {
145
145
  arrowXCoOrdinates: -97,
146
146
  arrowSize: 12,
147
147
  width: 264,
148
- tooltipItem: /* @__PURE__ */ h(s, { $flexRowGapX: 0.75, children: [
149
- /* @__PURE__ */ e(C, { $renderAs: "ab2-bold", children: "Track homework status and their due dates." }),
148
+ tooltipItem: /* @__PURE__ */ p(s, { $flexRowGapX: 0.75, children: [
149
+ /* @__PURE__ */ e(u, { $renderAs: "ab2-bold", children: "Track homework status and their due dates." }),
150
150
  /* @__PURE__ */ e(
151
- u,
151
+ h,
152
152
  {
153
153
  label: c.current ? "Next" : "Got it",
154
154
  size: "xsmall",
155
155
  widthX: 6,
156
156
  renderAs: "secondary",
157
- onClick: () => y(d, p, m)
157
+ onClick: () => y(d, T, m)
158
158
  }
159
159
  )
160
160
  ] })
@@ -166,7 +166,7 @@ const ie = () => {
166
166
  const x = setTimeout(() => {
167
167
  clearTimeout(x), t(o);
168
168
  }, 200);
169
- g.current.push(x);
169
+ f.current.push(x);
170
170
  },
171
171
  [A, o, t, y]
172
172
  ), R = Y(
@@ -180,7 +180,7 @@ const ie = () => {
180
180
  [b]
181
181
  );
182
182
  return _(() => () => {
183
- g.current.forEach((r) => clearTimeout(r)), g.current = [];
183
+ f.current.forEach((r) => clearTimeout(r)), f.current = [];
184
184
  }, []), R;
185
185
  };
186
186
  export {
@@ -1 +1 @@
1
- {"version":3,"file":"use-home-page-journey.js","sources":["../../../../src/features/journey/hooks/use-home-page-journey.tsx"],"sourcesContent":["import type { IHomeworkData } from '../../homework/hw-card-list/api/get-homeworks';\nimport type { TCourseStream } from '../../milestone/create/milestone-create-types';\nimport type { IArrowTooltipProps } from '../../ui/arrow-tooltip/arrow-tooltip-types';\nimport type { IHomepageStartJourneyProps } from '../types/homepage-journey-types';\nimport type { ICoachmarkProps } from '../use-journey/journey-context-types';\n\nimport { useCallback, useEffect, useMemo, useRef } from 'react';\n\nimport HomeworkCard from '../../homework/homework-card';\nimport HWCardList from '../../homework/hw-card-list/hw-card-list';\nimport { getTopicsFromItems } from '../../milestone/milestone-tests/tests-list/test-sheets-list/test-sheet-item/test-sheet-item-utils';\nimport RecentChapters from '../../recent-chapters/recent-chapters';\nimport Button from '../../ui/buttons/button/button';\nimport FlexView from '../../ui/layout/flex-view';\nimport Text from '../../ui/text/text';\nimport { ELementWrapper } from '../comps/coachmark/coachmark-styled';\nimport { JOURNEY_ID_STUDENT } from '../journey-id/journey-id-student';\nimport { IndicatorType } from '../use-journey/constants';\nimport { useJourney } from '../use-journey/use-journey';\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 individualHomeworkRef = useRef<HTMLDivElement>(null);\n const recentChaptersRef = useRef<HTMLDivElement>(null);\n const timerRefs = useRef<ReturnType<typeof setTimeout>[]>([]);\n const { nextCoachmark, setJourney, endJourney, addCoachmark } = useJourney();\n\n const handleLastStep = useCallback(\n (userId: string, isStudent: boolean, courseValue: string) => {\n if (recentChaptersRef.current) {\n addCoachmark(JOURNEY_ID_STUDENT.HOMEPAGE_JOURNEY, {\n originalElementToHighlightRef: recentChaptersRef,\n elementToHighlight: (\n <FlexView $widthX={45}>\n <RecentChapters\n studentId={userId}\n courseStream={courseValue as TCourseStream}\n userType={isStudent ? 'STUDENT' : 'TEACHER'}\n onChapterClick={() => null}\n />\n </FlexView>\n ),\n isActive: false,\n type: IndicatorType.TOOLTIP,\n indicator: {\n tooltipItem: (\n <FlexView $flexRowGapX={0.75} $justifyContent=\"flex-start\">\n <Text $renderAs=\"ab2-bold\">Access all your recent chapters in one place.</Text>\n <Button\n label=\"Got it\"\n size=\"xsmall\"\n widthX={6}\n renderAs=\"secondary\"\n onClick={() => endJourney(JOURNEY_ID_STUDENT.HOMEPAGE_JOURNEY)}\n />\n </FlexView>\n ),\n position: 'top',\n renderAs: 'primary',\n tooltipXCoOrdinates: -227,\n tooltipYCoOrdinates: 12,\n arrowXCoOrdinates: -110,\n backgroundColor: 'YELLOW_4',\n borderColor: 'BLACK',\n arrowColor: 'BLACK',\n arrowSize: 12,\n width: 264,\n } as IArrowTooltipProps,\n });\n nextCoachmark(journeyId, false, 0, true);\n } else {\n endJourney(journeyId);\n }\n },\n [nextCoachmark, journeyId, addCoachmark, endJourney],\n );\n\n const startJourney = useCallback(\n ({ hwDetails, studentId, stream, userType }: IHomepageStartJourneyProps) => {\n const { items, node_type: nodeType, title, subtext } = hwDetails[0] as IHomeworkData;\n const topics = getTopicsFromItems(items);\n const testChapterName = topics.join(', ');\n const isDynamicSheet = nodeType === 'DYNAMIC';\n const isStudent = userType === 'STUDENT';\n\n if (!homepageRef?.current || !homeworkRef?.current || !individualHomeworkRef?.current) {\n return;\n }\n\n const homepageSteps: ICoachmarkProps[] = [\n {\n originalElementToHighlightRef: homepageRef,\n isActive: false,\n type: IndicatorType.TOOLTIP,\n elementToHighlight: <></>,\n indicator: {\n position: 'left',\n tooltipXCoOrdinates: 0,\n tooltipYCoOrdinates: isStudent ? 100 : 0,\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\">\n {isStudent\n ? 'Welcome to the all new learning homepage.'\n : 'Welcome to the all new tutoring homepage.'}\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 },\n {\n originalElementToHighlightRef: homeworkRef,\n elementToHighlight: (\n <ELementWrapper>\n <HWCardList userType={userType} studentId={studentId} stream={stream} />\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 <FlexView $flexRowGapX={0.75}>\n <Text $renderAs=\"ab2-bold\">\n {isStudent\n ? 'Homework is now easy to access and easy to complete!'\n : 'Homework is now easy to access and easy to review!'}\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: individualHomeworkRef,\n elementToHighlight: (\n <ELementWrapper>\n <HomeworkCard\n isInQueue={false}\n userType={userType}\n header={isDynamicSheet ? testChapterName : title}\n subHeader={subtext || ''}\n nodeData={hwDetails[0] as IHomeworkData}\n renderAs=\"homework\"\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 <FlexView $flexRowGapX={0.75}>\n <Text $renderAs=\"ab2-bold\">Track homework status and their due dates.</Text>\n <Button\n label={recentChaptersRef.current ? 'Next' : 'Got it'}\n size=\"xsmall\"\n widthX={6}\n renderAs=\"secondary\"\n onClick={() => handleLastStep(studentId, isStudent, stream)}\n />\n </FlexView>\n ),\n } as IArrowTooltipProps,\n isActive: false,\n },\n ];\n\n setJourney(journeyId, homepageSteps);\n\n const delayBeforeStart = setTimeout(() => {\n clearTimeout(delayBeforeStart);\n nextCoachmark(journeyId);\n }, 200);\n\n timerRefs.current.push(delayBeforeStart); // Store to cleanup later\n },\n [setJourney, journeyId, nextCoachmark, handleLastStep],\n );\n\n const data = useMemo(\n () => ({\n homepageRef,\n homeworkRef,\n individualHomeworkRef,\n recentChaptersRef,\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","individualHomeworkRef","recentChaptersRef","timerRefs","nextCoachmark","setJourney","endJourney","addCoachmark","useJourney","handleLastStep","useCallback","userId","isStudent","courseValue","jsx","FlexView","RecentChapters","IndicatorType","jsxs","Text","Button","startJourney","hwDetails","studentId","stream","userType","items","nodeType","title","subtext","testChapterName","getTopicsFromItems","isDynamicSheet","homepageSteps","Fragment","ELementWrapper","HWCardList","HomeworkCard","delayBeforeStart","data","useMemo","useEffect","timer"],"mappings":";;;;;;;;;;;;;AAoBO,MAAMA,KAAqB,MAAM;AACtC,QAAMC,IAAYC,EAAmB,kBAE/BC,IAAcC,EAAuB,IAAI,GACzCC,IAAcD,EAAuB,IAAI,GACzCE,IAAwBF,EAAuB,IAAI,GACnDG,IAAoBH,EAAuB,IAAI,GAC/CI,IAAYJ,EAAwC,CAAA,CAAE,GACtD,EAAE,eAAAK,GAAe,YAAAC,GAAY,YAAAC,GAAY,cAAAC,EAAA,IAAiBC,KAE1DC,IAAiBC;AAAA,IACrB,CAACC,GAAgBC,GAAoBC,MAAwB;AAC3D,MAAIX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AWX,GAAWY,CAAM;AAAA,gBAAA;AAAA,cAC5D;AAAA,YAAA,GACF;AAAA,UAEJ;AAAA,UACA,UAAU;AAAA,QACZ;AAAA,MAAA;AAGF,MAAAnB,EAAWT,GAAWqC,CAAa;AAE7B,YAAAK,IAAmB,WAAW,MAAM;AACxC,qBAAaA,CAAgB,GAC7BlC,EAAcR,CAAS;AAAA,SACtB,GAAG;AAEI,MAAAO,EAAA,QAAQ,KAAKmC,CAAgB;AAAA,IACzC;AAAA,IACA,CAACjC,GAAYT,GAAWQ,GAAeK,CAAc;AAAA,EAAA,GAGjD8B,IAAOC;AAAA,IACX,OAAO;AAAA,MACL,aAAA1C;AAAA,MACA,aAAAE;AAAA,MACA,uBAAAC;AAAA,MACA,mBAAAC;AAAA,MACA,cAAAmB;AAAA,IAAA;AAAA,IAEF,CAACA,CAAY;AAAA,EAAA;AAIf,SAAAoB,EAAU,MACD,MAAM;AACX,IAAAtC,EAAU,QAAQ,QAAQ,CAASuC,MAAA,aAAaA,CAAK,CAAC,GACtDvC,EAAU,UAAU;EAAC,GAEtB,CAAE,CAAA,GAEEoC;AACT;"}
1
+ {"version":3,"file":"use-home-page-journey.js","sources":["../../../../src/features/journey/hooks/use-home-page-journey.tsx"],"sourcesContent":["import type { IHomeworkData } from '../../homework/hw-card-list/api/get-homeworks';\nimport type { TCourseStream } from '../../milestone/create/milestone-create-types';\nimport type { IArrowTooltipProps } from '../../ui/arrow-tooltip/arrow-tooltip-types';\nimport type { IHomepageStartJourneyProps } from '../types/homepage-journey-types';\nimport type { ICoachmarkProps } from '../use-journey/journey-context-types';\n\nimport { useCallback, useEffect, useMemo, useRef } from 'react';\n\nimport HomeworkCard from '../../homework/homework-card';\nimport HWCardList from '../../homework/hw-card-list/hw-card-list';\nimport { getTopicsFromItems } from '../../milestone/milestone-tests/tests-list/test-sheets-list/test-sheet-item/test-sheet-item-utils';\nimport RecentChapters from '../../recent-chapters/recent-chapters';\nimport Button from '../../ui/buttons/button/button';\nimport FlexView from '../../ui/layout/flex-view';\nimport Text from '../../ui/text/text';\nimport { ELementWrapper } from '../comps/coachmark/coachmark-styled';\nimport { JOURNEY_ID_STUDENT } from '../journey-id/journey-id-student';\nimport { IndicatorType } from '../use-journey/constants';\nimport { useJourney } from '../use-journey/use-journey';\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 individualHomeworkRef = useRef<HTMLDivElement>(null);\n const recentChaptersRef = useRef<HTMLDivElement>(null);\n const timerRefs = useRef<ReturnType<typeof setTimeout>[]>([]);\n const { nextCoachmark, setJourney, endJourney, addCoachmark } = useJourney();\n\n const handleLastStep = useCallback(\n (userId: string, isStudent: boolean, courseValue: string) => {\n if (recentChaptersRef.current) {\n addCoachmark(JOURNEY_ID_STUDENT.HOMEPAGE_JOURNEY, {\n originalElementToHighlightRef: recentChaptersRef,\n elementToHighlight: (\n <FlexView $widthX={45}>\n <RecentChapters\n studentId={userId}\n courseStream={courseValue as TCourseStream}\n userType={isStudent ? 'STUDENT' : 'TEACHER'}\n onChapterClick={() => null}\n />\n </FlexView>\n ),\n isActive: false,\n type: IndicatorType.TOOLTIP,\n indicator: {\n tooltipItem: (\n <FlexView $flexRowGapX={0.75} $justifyContent=\"flex-start\">\n <Text $renderAs=\"ab2-bold\">Access all your recent chapters in one place.</Text>\n <Button\n label=\"Got it\"\n size=\"xsmall\"\n widthX={6}\n renderAs=\"secondary\"\n onClick={() => endJourney(JOURNEY_ID_STUDENT.HOMEPAGE_JOURNEY)}\n />\n </FlexView>\n ),\n position: 'top',\n renderAs: 'primary',\n tooltipXCoOrdinates: -227,\n tooltipYCoOrdinates: 12,\n arrowXCoOrdinates: -110,\n backgroundColor: 'YELLOW_4',\n borderColor: 'BLACK',\n arrowColor: 'BLACK',\n arrowSize: 12,\n width: 264,\n } as IArrowTooltipProps,\n });\n nextCoachmark(journeyId, false, 0, true);\n } else {\n endJourney(journeyId);\n }\n },\n [nextCoachmark, journeyId, addCoachmark, endJourney],\n );\n\n const startJourney = useCallback(\n ({ hwDetails, studentId, stream, userType }: IHomepageStartJourneyProps) => {\n const { items, node_type: nodeType, title, subtext } = hwDetails[0] as IHomeworkData;\n const topics = getTopicsFromItems(items);\n const testChapterName = topics.join(', ');\n const isDynamicSheet = nodeType === 'DYNAMIC';\n const isStudent = userType === 'STUDENT';\n\n if (!homepageRef?.current || !homeworkRef?.current || !individualHomeworkRef?.current) {\n return;\n }\n\n const homepageSteps: ICoachmarkProps[] = [\n {\n originalElementToHighlightRef: homepageRef,\n isActive: false,\n type: IndicatorType.TOOLTIP,\n elementToHighlight: <></>,\n indicator: {\n position: 'top',\n tooltipXCoOrdinates: 360,\n tooltipYCoOrdinates: 30,\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\">\n {isStudent\n ? 'Welcome to the all new learning homepage.'\n : 'Welcome to the all new tutoring homepage.'}\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 },\n {\n originalElementToHighlightRef: homeworkRef,\n elementToHighlight: (\n <ELementWrapper>\n <HWCardList userType={userType} studentId={studentId} stream={stream} />\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 <FlexView $flexRowGapX={0.75}>\n <Text $renderAs=\"ab2-bold\">\n {isStudent\n ? 'Homework is now easy to access and easy to complete!'\n : 'Homework is now easy to access and easy to review!'}\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: individualHomeworkRef,\n elementToHighlight: (\n <ELementWrapper>\n <HomeworkCard\n isInQueue={false}\n userType={userType}\n header={isDynamicSheet ? testChapterName : title}\n subHeader={subtext || ''}\n nodeData={hwDetails[0] as IHomeworkData}\n renderAs=\"homework\"\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 <FlexView $flexRowGapX={0.75}>\n <Text $renderAs=\"ab2-bold\">Track homework status and their due dates.</Text>\n <Button\n label={recentChaptersRef.current ? 'Next' : 'Got it'}\n size=\"xsmall\"\n widthX={6}\n renderAs=\"secondary\"\n onClick={() => handleLastStep(studentId, isStudent, stream)}\n />\n </FlexView>\n ),\n } as IArrowTooltipProps,\n isActive: false,\n },\n ];\n\n setJourney(journeyId, homepageSteps);\n\n const delayBeforeStart = setTimeout(() => {\n clearTimeout(delayBeforeStart);\n nextCoachmark(journeyId);\n }, 200);\n\n timerRefs.current.push(delayBeforeStart); // Store to cleanup later\n },\n [setJourney, journeyId, nextCoachmark, handleLastStep],\n );\n\n const data = useMemo(\n () => ({\n homepageRef,\n homeworkRef,\n individualHomeworkRef,\n recentChaptersRef,\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","individualHomeworkRef","recentChaptersRef","timerRefs","nextCoachmark","setJourney","endJourney","addCoachmark","useJourney","handleLastStep","useCallback","userId","isStudent","courseValue","jsx","FlexView","RecentChapters","IndicatorType","jsxs","Text","Button","startJourney","hwDetails","studentId","stream","userType","items","nodeType","title","subtext","testChapterName","getTopicsFromItems","isDynamicSheet","homepageSteps","Fragment","ELementWrapper","HWCardList","HomeworkCard","delayBeforeStart","data","useMemo","useEffect","timer"],"mappings":";;;;;;;;;;;;;AAoBO,MAAMA,KAAqB,MAAM;AACtC,QAAMC,IAAYC,EAAmB,kBAE/BC,IAAcC,EAAuB,IAAI,GACzCC,IAAcD,EAAuB,IAAI,GACzCE,IAAwBF,EAAuB,IAAI,GACnDG,IAAoBH,EAAuB,IAAI,GAC/CI,IAAYJ,EAAwC,CAAA,CAAE,GACtD,EAAE,eAAAK,GAAe,YAAAC,GAAY,YAAAC,GAAY,cAAAC,EAAA,IAAiBC,KAE1DC,IAAiBC;AAAA,IACrB,CAACC,GAAgBC,GAAoBC,MAAwB;AAC3D,MAAIX,EAAkB,WACpBK,EAAaV,EAAmB,kBAAkB;AAAA,QAChD,+BAA+BK;AAAA,QAC/B,oBACE,gBAAAY,EAACC,GAAS,EAAA,SAAS,IACjB,UAAA,gBAAAD;AAAA,UAACE;AAAA,UAAA;AAAA,YACC,WAAWL;AAAA,YACX,cAAcE;AAAA,YACd,UAAUD,IAAY,YAAY;AAAA,YAClC,gBAAgB,MAAM;AAAA,UAAA;AAAA,QAAA,GAE1B;AAAA,QAEF,UAAU;AAAA,QACV,MAAMK,EAAc;AAAA,QACpB,WAAW;AAAA,UACT,aACG,gBAAAC,EAAAH,GAAA,EAAS,cAAc,MAAM,iBAAgB,cAC5C,UAAA;AAAA,YAAC,gBAAAD,EAAAK,GAAA,EAAK,WAAU,YAAW,UAA6C,iDAAA;AAAA,YACxE,gBAAAL;AAAA,cAAC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AAA,EAAA;AAIf,SAAAoB,EAAU,MACD,MAAM;AACX,IAAAtC,EAAU,QAAQ,QAAQ,CAASuC,MAAA,aAAaA,CAAK,CAAC,GACtDvC,EAAU,UAAU;EAAC,GAEtB,CAAE,CAAA,GAEEoC;AACT;"}
@@ -1,5 +1,6 @@
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))(E || {});
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))(E || {}), C = /* @__PURE__ */ ((R) => (R.HOMEPAGE_JOURNEY = "HOMEPAGE_JOURNEY", R))(C || {});
2
2
  export {
3
- E as JOURNEY_ID_STUDENT
3
+ E as JOURNEY_ID_STUDENT,
4
+ C as JOURNEY_ID_TEACHER
4
5
  };
5
6
  //# 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}\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,oBAVTA,IAAAA,KAAA,CAAA,CAAA;"}
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}\n\nexport enum JOURNEY_ID_TEACHER {\n HOMEPAGE_JOURNEY = 'HOMEPAGE_JOURNEY',\n}\n"],"names":["JOURNEY_ID_STUDENT","JOURNEY_ID_TEACHER"],"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,oBAVTA,IAAAA,KAAA,CAAA,CAAA,GAaAC,sBAAAA,OACVA,EAAA,mBAAmB,oBADTA,IAAAA,KAAA,CAAA,CAAA;"}
@@ -1,109 +1,109 @@
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";
1
+ import { jsxs as D, jsx as R } from "react/jsx-runtime";
2
+ import { createContext as L, useState as J, useRef as k, useCallback as y, useMemo as N, useEffect as T } 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: 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) {
6
+ const S = L(null), W = ({ children: b, appId: c, userId: o }) => {
7
+ const [O, x] = J(!1), [p, v] = J(null), [a, i] = J([]), [d, _] = J(!1), m = k(-1), t = k(), f = k([]), { post: g } = M(), { data: C = null, get: A } = z(), $ = y(
8
+ (e, r, s) => {
9
+ if (a.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
- v(!0), t.current = e, y.current = -1, a([...r]);
15
+ _(!0), t.current = e, m.current = -1, i([...r]), x(!!s);
16
16
  },
17
- [c.length]
18
- ), u = l(() => {
17
+ [a.length]
18
+ ), u = y(() => {
19
19
  f.current.forEach((e) => {
20
20
  clearTimeout(e);
21
- }), f.current = [], t.current = void 0, y.current = -1, a([]), v(!1);
22
- }, []), $ = l(
21
+ }), f.current = [], t.current = void 0, m.current = -1, i([]), _(!1);
22
+ }, []), E = y(
23
23
  (e) => {
24
- u(), p((r) => r && !r.includes(e) ? [...r, e] : r), _({
25
- app_id: s,
24
+ u(), v((r) => r && !r.includes(e) ? [...r, e] : r), g({
25
+ app_id: c,
26
26
  user_id: o,
27
27
  journey_id: e,
28
28
  journey_status: "COMPLETED"
29
29
  });
30
30
  },
31
- [s, u, _, o]
32
- ), E = l((e, r) => {
31
+ [c, u, g, o]
32
+ ), P = y((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
- a((m) => [...m, r]);
40
- }, []), P = l(
41
- (e, r = !1, m = 0, q = !1) => {
39
+ i((s) => [...s, r]);
40
+ }, []), j = y(
41
+ (e, r = !1, s = 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
- 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)
48
+ x(q), s !== 0 && i((n) => n.map((l) => ({ ...l, isActive: !1 })));
49
+ const w = setTimeout(() => {
50
+ clearTimeout(w);
51
+ const n = m.current + 1;
52
+ i((l) => {
53
+ if (n >= l.length || l.length === 0)
54
54
  return u(), [];
55
- y.current = n;
56
- const h = [...i];
55
+ m.current = n;
56
+ const h = [...l];
57
57
  return h[n].isActive = !0, n > 0 && (h[n - 1].isActive = r), h;
58
58
  });
59
- }, m);
60
- f.current.push(j);
59
+ }, s);
60
+ f.current.push(w);
61
61
  },
62
62
  [u]
63
63
  ), U = N(
64
64
  () => ({
65
- nextCoachmark: P,
66
- setJourney: A,
67
- addCoachmark: E,
65
+ nextCoachmark: j,
66
+ setJourney: $,
67
+ addCoachmark: P,
68
68
  clearJourney: u,
69
- endJourney: $,
70
- coachmarks: c,
71
- userCompletedJourneyIds: x,
69
+ endJourney: E,
70
+ coachmarks: a,
71
+ userCompletedJourneyIds: p,
72
72
  isJourneyActive: d
73
73
  }),
74
74
  [
75
+ j,
76
+ $,
75
77
  P,
76
- A,
77
- E,
78
78
  u,
79
- $,
80
- c,
81
- x,
79
+ E,
80
+ a,
81
+ p,
82
82
  d
83
83
  ]
84
84
  );
85
- return R(() => {
86
- s && o && g(o, {
87
- app_id: s,
85
+ return T(() => {
86
+ c && o && A(o, {
87
+ app_id: c,
88
88
  user_id: o,
89
89
  journey_status: "COMPLETED"
90
90
  });
91
- }, [s, g, o]), R(() => {
91
+ }, [c, A, o]), T(() => {
92
92
  if (C) {
93
93
  const e = C.map((r) => r.journey_id);
94
- p(e);
94
+ v(e);
95
95
  }
96
96
  }, [C]), /* @__PURE__ */ D(S.Provider, { value: U, children: [
97
- d && /* @__PURE__ */ w(
97
+ d && /* @__PURE__ */ R(
98
98
  G,
99
99
  {
100
100
  about: "journey-overlay",
101
- isJourneyBlurred: b,
101
+ isJourneyBlurred: O,
102
102
  "data-testid": t.current,
103
- children: c.map((e, r) => /* @__PURE__ */ w(B, { coachmark: e }, `coachmark-${r}`))
103
+ children: a.map((e, r) => /* @__PURE__ */ R(B, { coachmark: e }, `coachmark-${r}`))
104
104
  }
105
105
  ),
106
- T
106
+ b
107
107
  ] });
108
108
  };
109
109
  export {