@cuemath/leap 2.9.6-as1 → 2.9.6-as10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/features/chapters-v2/chapter-details/block-sections/block-section-view.js +28 -28
- package/dist/features/chapters-v2/chapter-details/block-sections/block-section-view.js.map +1 -1
- package/dist/features/chapters-v2/chapter-details/block-sections/block-sections.js +44 -43
- package/dist/features/chapters-v2/chapter-details/block-sections/block-sections.js.map +1 -1
- package/dist/features/chapters-v2/chapter-details/chapter-banner/chapter-banner.js +31 -30
- package/dist/features/chapters-v2/chapter-details/chapter-banner/chapter-banner.js.map +1 -1
- package/dist/features/chapters-v2/chapter-details/chapter-details.js +82 -55
- package/dist/features/chapters-v2/chapter-details/chapter-details.js.map +1 -1
- package/dist/features/chapters-v2/comps/node-card/node-card-styled.js +30 -24
- package/dist/features/chapters-v2/comps/node-card/node-card-styled.js.map +1 -1
- package/dist/features/chapters-v2/comps/node-card/student-actions/student-actions.js +3 -3
- package/dist/features/chapters-v2/comps/node-card/student-actions/student-actions.js.map +1 -1
- package/dist/features/chapters-v2/comps/node-card/teacher-actions/teacher-actions.js +25 -25
- package/dist/features/chapters-v2/comps/node-card/teacher-actions/teacher-actions.js.map +1 -1
- package/dist/features/chapters-v2/utils/node-card-utils.js +31 -29
- package/dist/features/chapters-v2/utils/node-card-utils.js.map +1 -1
- package/dist/features/homework/hw-card-list/hw-card-list.js +38 -39
- package/dist/features/homework/hw-card-list/hw-card-list.js.map +1 -1
- package/dist/features/journey/hooks/use-chapter-journey.js +194 -0
- package/dist/features/journey/hooks/use-chapter-journey.js.map +1 -0
- package/dist/features/journey/journey-id/journey-id-student.js +2 -3
- package/dist/features/journey/journey-id/journey-id-student.js.map +1 -1
- package/dist/features/journey/journey-id/journey-id-teacher.js +5 -0
- package/dist/features/journey/journey-id/journey-id-teacher.js.map +1 -0
- package/dist/features/journey/use-journey/journey-context-provider.js +48 -48
- package/dist/features/journey/use-journey/journey-context-provider.js.map +1 -1
- package/dist/features/milestone/milestone-list-container/milestone-list/milestone-widget/milestone-info.js +12 -11
- package/dist/features/milestone/milestone-list-container/milestone-list/milestone-widget/milestone-info.js.map +1 -1
- package/dist/features/milestone/milestone-tests/test-list-v2/test-list-view.js +1 -1
- package/dist/features/milestone/milestone-tests/test-list-v2/test-list-view.js.map +1 -1
- package/dist/features/sheet-v2/resource-list/resource-list.js +1 -1
- package/dist/features/sheet-v2/resource-list/resource-list.js.map +1 -1
- package/dist/index.d.ts +29 -4
- package/dist/index.js +140 -137
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
@@ -1 +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\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,MACA,OAAAC;AAAA,MACA,aAAaC;AAAA,MACb,iBAAiBC;AAAA,MACjB,aAAAC;AAAA,MACA,iBAAiBC;AAAA,IACf,IAAAzB,GAEE;AAAA,MACJ,6BAA6B0B;AAAA,MAC7B,mBAAmBC;AAAA,MACnB,YAAYC;AAAA,IACV,IAAAJ,GAEEK,IAAc3B,MAAc4B,GAAW,MACvCC,IAAcV,MAAUW,EAAiB,QACzCC,IAAkBZ,MAAUW,EAAiB,aAC7CE,IAA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EA,gBAAAqB,EAACI,MAAS,WAAU,gBACjB,eACE,gBAAAJ,EAAAK,GAAA,EAA4B,KAAKlD,GAAc,SAASG,GACvD,4BAACgD,GAAiB,EAAA,OAAO,IAAI,QAAQ,IAAI,GAC3C,EAEJ,CAAA;AAAA,sBAEC1B,KAAqB,CAACjC,KAAa,gBAAAqD,EAACO,IAAoB,CAAA,CAAA;AAAA,oBAAA;AAAA,kBAAA;AAAA,gBAC3D;AAAA,gBAEC,gBAAAP,EAAAQ,IAAA,EAAa,UAAA9C,GAAoB,OAAAG,GAAc,UAAAL,EAAoB,CAAA;AAAA,gBAEnE,CAACa,KACA,gBAAAsB;AAAA,kBAACc;AAAAA,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,UAAUnC,IAAc,MAAM;AAAA,0BAE7B,UAAAX;AAAA,wBAAA;AAAA,sBACH;AAAA,sBAEC,gBAAAoC,EAAAK,GAAA,EAA4B,KAAKlD,GAAc,SAASG,GACvD,UAAA,gBAAA0C,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,UAAUtD,GACvC,UAAC,gBAAA2C,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 if (sheetLocked) return;\n setRenderLottie(true);\n }, [sheetLocked]);\n\n const handleOnMouseLeave = useCallback(() => {\n setRenderLottie(false);\n }, []);\n\n const menuOptions: INodeMenuOption[] = [\n {\n id: 'node-card-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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AAY;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,UAAUnC,IAAc,MAAM;AAAA,0BAE7B,UAAAX;AAAA,wBAAA;AAAA,sBACH;AAAA,sBAEC,gBAAAoC,EAAAK,GAAA,EAA4B,KAAKlD,GAAc,SAASG,GACvD,UAAA,gBAAA0C,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,UAAUtD,GACvC,UAAC,gBAAA2C,EAAAY,IAAA,EAAgB,SAASrB,EAAA,CAAa,EACzC,CAAA;AAAA,QAAA;AAAA,MAAA;AAAA,IAAA;AAAA,EAGN;AACF;"}
|
@@ -1,19 +1,19 @@
|
|
1
|
-
import { jsx as e, jsxs as
|
2
|
-
import
|
1
|
+
import { jsx as e, jsxs as p } from "react/jsx-runtime";
|
2
|
+
import I from "../../../assets/line-icons/icons/alarm.js";
|
3
3
|
import f from "../../../assets/line-icons/icons/bulb2.js";
|
4
4
|
import T from "../../../assets/line-icons/icons/check2.js";
|
5
5
|
import u from "../../../assets/line-icons/icons/dart.js";
|
6
|
-
import
|
7
|
-
import
|
6
|
+
import R from "../../../assets/line-icons/icons/exclamation.js";
|
7
|
+
import A from "../../../assets/line-icons/icons/lock2.js";
|
8
8
|
import h from "../../../assets/line-icons/icons/play2.js";
|
9
|
-
import
|
10
|
-
import
|
11
|
-
import
|
12
|
-
import
|
9
|
+
import $ from "../../../assets/line-icons/icons/puzzle.js";
|
10
|
+
import g from "../../../assets/line-icons/icons/recap.js";
|
11
|
+
import D from "../../../assets/line-icons/icons/status.js";
|
12
|
+
import C from "../../../assets/line-icons/icons/testtube.js";
|
13
13
|
import { LOTTIE as t } from "../../../assets/lottie/lottie.js";
|
14
|
-
import
|
14
|
+
import S from "../../ui/layout/flex-view.js";
|
15
15
|
import a from "../../ui/arrow-tooltip/arrow-tooltip.js";
|
16
|
-
import
|
16
|
+
import d from "../../ui/text/text.js";
|
17
17
|
import { InProgressIconWrapper as l } from "../comps/node-card/node-card-styled.js";
|
18
18
|
import E from "../comps/tag/tag.js";
|
19
19
|
const P = 60 * 60 * 24, b = ["NOT_STARTED", "IN_PROGRESS"], O = (o) => {
|
@@ -21,8 +21,8 @@ const P = 60 * 60 * 24, b = ["NOT_STARTED", "IN_PROGRESS"], O = (o) => {
|
|
21
21
|
return { isOverdue: !1, daysText: "", differenceInDays: 0 };
|
22
22
|
const i = Math.floor(Date.now() / 1e3), c = o - i, n = Math.ceil(c / P), s = n < 0, r = n > 0 ? `${Math.abs(n)}D` : "";
|
23
23
|
return { isOverdue: s, daysText: r, differenceInDays: n };
|
24
|
-
},
|
25
|
-
const { isOverdue: s, daysText: r, differenceInDays:
|
24
|
+
}, B = (o, i, c, n) => {
|
25
|
+
const { isOverdue: s, daysText: r, differenceInDays: m } = O(n);
|
26
26
|
if (s && b.includes(o))
|
27
27
|
return {
|
28
28
|
icon: /* @__PURE__ */ e(
|
@@ -34,7 +34,7 @@ const P = 60 * 60 * 24, b = ["NOT_STARTED", "IN_PROGRESS"], O = (o) => {
|
|
34
34
|
zIndex: 10,
|
35
35
|
hidden: !i,
|
36
36
|
parentWidth: "fit-content",
|
37
|
-
children: /* @__PURE__ */ e(
|
37
|
+
children: /* @__PURE__ */ e(S, { $background: "RED", $borderRadius: 16, $gapX: 0.24, $gutterX: 0.5, children: /* @__PURE__ */ e(d, { $renderAs: "ac4-black", $color: "WHITE", children: "OVERDUE" }) })
|
38
38
|
}
|
39
39
|
),
|
40
40
|
top: -10,
|
@@ -48,7 +48,7 @@ const P = 60 * 60 * 24, b = ["NOT_STARTED", "IN_PROGRESS"], O = (o) => {
|
|
48
48
|
{
|
49
49
|
renderAs: "primary",
|
50
50
|
position: "bottom",
|
51
|
-
tooltipItem:
|
51
|
+
tooltipItem: m > 1 ? `${m} days left` : "Complete it today",
|
52
52
|
zIndex: 10,
|
53
53
|
hidden: !i,
|
54
54
|
children: /* @__PURE__ */ e(
|
@@ -57,9 +57,10 @@ const P = 60 * 60 * 24, b = ["NOT_STARTED", "IN_PROGRESS"], O = (o) => {
|
|
57
57
|
$flexDirection: "row",
|
58
58
|
$alignItems: "center",
|
59
59
|
$justifyContent: "center",
|
60
|
-
$gutterX: 0.5,
|
61
60
|
$borderRadius: 16,
|
62
|
-
|
61
|
+
$paddingRight: 6,
|
62
|
+
$paddingLeft: 6,
|
63
|
+
children: r && /* @__PURE__ */ e(d, { $renderAs: "ub3-bold", $color: "WHITE", children: r })
|
63
64
|
}
|
64
65
|
)
|
65
66
|
}
|
@@ -69,23 +70,24 @@ const P = 60 * 60 * 24, b = ["NOT_STARTED", "IN_PROGRESS"], O = (o) => {
|
|
69
70
|
};
|
70
71
|
case "LOCKED":
|
71
72
|
return {
|
72
|
-
icon: /* @__PURE__ */ e(
|
73
|
+
icon: /* @__PURE__ */ e(A, { width: 32, height: 32 }),
|
73
74
|
top: -12,
|
74
75
|
right: -12
|
75
76
|
};
|
76
77
|
case "IN_PROGRESS":
|
77
78
|
return {
|
78
|
-
icon: /* @__PURE__ */
|
79
|
+
icon: /* @__PURE__ */ p(
|
79
80
|
l,
|
80
81
|
{
|
81
82
|
$flexDirection: "row",
|
82
83
|
$alignItems: "center",
|
83
84
|
$justifyContent: "center",
|
84
|
-
$gutterX: r ? 0.25 : 0,
|
85
85
|
$borderRadius: 16,
|
86
|
+
$paddingRight: 0,
|
87
|
+
$paddingLeft: r ? 6 : 0,
|
86
88
|
children: [
|
87
|
-
r && /* @__PURE__ */ e(
|
88
|
-
/* @__PURE__ */ e(
|
89
|
+
r && /* @__PURE__ */ e(d, { $renderAs: "ub3-bold", $color: "WHITE", children: r }),
|
90
|
+
/* @__PURE__ */ e(D, {})
|
89
91
|
]
|
90
92
|
}
|
91
93
|
)
|
@@ -111,7 +113,7 @@ const P = 60 * 60 * 24, b = ["NOT_STARTED", "IN_PROGRESS"], O = (o) => {
|
|
111
113
|
position: "bottom",
|
112
114
|
tooltipItem: i ? "Waiting for teacher to review" : "Needs your review",
|
113
115
|
zIndex: 10,
|
114
|
-
children: /* @__PURE__ */ e(E, { Icon:
|
116
|
+
children: /* @__PURE__ */ e(E, { Icon: R })
|
115
117
|
}
|
116
118
|
),
|
117
119
|
top: -10,
|
@@ -122,7 +124,7 @@ const P = 60 * 60 * 24, b = ["NOT_STARTED", "IN_PROGRESS"], O = (o) => {
|
|
122
124
|
icon: void 0
|
123
125
|
};
|
124
126
|
}
|
125
|
-
},
|
127
|
+
}, X = (o) => {
|
126
128
|
switch (o) {
|
127
129
|
case "LEARNING":
|
128
130
|
return {
|
@@ -132,14 +134,14 @@ const P = 60 * 60 * 24, b = ["NOT_STARTED", "IN_PROGRESS"], O = (o) => {
|
|
132
134
|
case "RECAP":
|
133
135
|
return {
|
134
136
|
lottie: t.RECAP,
|
135
|
-
icon:
|
137
|
+
icon: g
|
136
138
|
};
|
137
139
|
case "DYNAMIC":
|
138
140
|
case "ASSESSMENT":
|
139
141
|
case "CHAPTER_ASSESSMENT":
|
140
142
|
return {
|
141
143
|
lottie: t.TEST,
|
142
|
-
icon:
|
144
|
+
icon: I
|
143
145
|
};
|
144
146
|
case "PRACTICE":
|
145
147
|
case "EXTRA_PRACTICE":
|
@@ -154,7 +156,7 @@ const P = 60 * 60 * 24, b = ["NOT_STARTED", "IN_PROGRESS"], O = (o) => {
|
|
154
156
|
case "PUZZLE_HARD":
|
155
157
|
return {
|
156
158
|
lottie: t.PUZZLE,
|
157
|
-
icon:
|
159
|
+
icon: $
|
158
160
|
};
|
159
161
|
case "VIDEO":
|
160
162
|
return {
|
@@ -164,12 +166,12 @@ const P = 60 * 60 * 24, b = ["NOT_STARTED", "IN_PROGRESS"], O = (o) => {
|
|
164
166
|
default:
|
165
167
|
return {
|
166
168
|
lottie: t.PROJECT,
|
167
|
-
icon:
|
169
|
+
icon: C
|
168
170
|
};
|
169
171
|
}
|
170
172
|
};
|
171
173
|
export {
|
172
|
-
|
173
|
-
|
174
|
+
X as getNodeCardBasedIcon,
|
175
|
+
B as getNodeStateBasedTagInfo
|
174
176
|
};
|
175
177
|
//# sourceMappingURL=node-card-utils.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"node-card-utils.js","sources":["../../../../src/features/chapters-v2/utils/node-card-utils.tsx"],"sourcesContent":["import type { INodeDataProps } from '../comps/node-card/node-card-types';\n\nimport AlarmIcon from '../../../assets/line-icons/icons/alarm';\nimport Bulb2Icon from '../../../assets/line-icons/icons/bulb2';\nimport Check2Icon from '../../../assets/line-icons/icons/check2';\nimport DartIcon from '../../../assets/line-icons/icons/dart';\nimport ExclamationIcon from '../../../assets/line-icons/icons/exclamation';\nimport Lock2Icon from '../../../assets/line-icons/icons/lock2';\nimport Play2Icon from '../../../assets/line-icons/icons/play2';\nimport PuzzleIcon from '../../../assets/line-icons/icons/puzzle';\nimport RecapIcon from '../../../assets/line-icons/icons/recap';\nimport StatusIcon from '../../../assets/line-icons/icons/status';\nimport TestTubeIcon from '../../../assets/line-icons/icons/testtube';\nimport { LOTTIE } from '../../../assets/lottie/lottie';\nimport FlexView from '../..//ui/layout/flex-view';\nimport ArrowTooltip from '../../ui/arrow-tooltip/arrow-tooltip';\nimport Text from '../../ui/text/text';\nimport { InProgressIconWrapper } from '../comps/node-card/node-card-styled';\nimport Tag from '../comps/tag/tag';\n\ninterface DueDateInfo {\n isOverdue: boolean;\n daysText: string;\n differenceInDays: number;\n}\n\nconst SECONDS_PER_DAY = 60 * 60 * 24;\nconst OVERDUE_TAG_STATES: INodeDataProps['state'][] = ['NOT_STARTED', 'IN_PROGRESS'];\n\nconst calculateDueDateInfo = (dueDateTs?: number | null): DueDateInfo => {\n if (!dueDateTs) {\n return { isOverdue: false, daysText: '', differenceInDays: 0 };\n }\n\n const currentTimestamp = Math.floor(Date.now() / 1000);\n const differenceInSeconds = dueDateTs - currentTimestamp;\n const differenceInDays = Math.ceil(differenceInSeconds / SECONDS_PER_DAY);\n\n const isOverdue = differenceInDays < 0;\n\n const daysText = differenceInDays > 0 ? `${Math.abs(differenceInDays)}D` : '';\n\n return { isOverdue, daysText, differenceInDays };\n};\n\nconst getNodeStateBasedTagInfo = (\n nodeState: INodeDataProps['state'],\n isStudent: boolean,\n accuracy?: number | null,\n dueDateTs?: number | null,\n) => {\n const { isOverdue, daysText, differenceInDays } = calculateDueDateInfo(dueDateTs);\n\n if (isOverdue && OVERDUE_TAG_STATES.includes(nodeState)) {\n return {\n icon: (\n <ArrowTooltip\n renderAs=\"primary\"\n position=\"bottom\"\n tooltipItem=\"Complete now\"\n zIndex={10}\n hidden={!isStudent}\n parentWidth=\"fit-content\"\n >\n <FlexView $background=\"RED\" $borderRadius={16} $gapX={0.24} $gutterX={0.5}>\n <Text $renderAs=\"ac4-black\" $color=\"WHITE\">\n OVERDUE\n </Text>\n </FlexView>\n </ArrowTooltip>\n ),\n top: -10,\n right: -10,\n };\n }\n\n switch (nodeState) {\n case 'NOT_STARTED':\n return {\n icon: (\n <ArrowTooltip\n renderAs=\"primary\"\n position=\"bottom\"\n tooltipItem={\n differenceInDays > 1 ? `${differenceInDays} days left` : 'Complete it today'\n }\n zIndex={10}\n hidden={!isStudent}\n >\n <InProgressIconWrapper\n $flexDirection=\"row\"\n $alignItems=\"center\"\n $justifyContent=\"center\"\n $
|
1
|
+
{"version":3,"file":"node-card-utils.js","sources":["../../../../src/features/chapters-v2/utils/node-card-utils.tsx"],"sourcesContent":["import type { INodeDataProps } from '../comps/node-card/node-card-types';\n\nimport AlarmIcon from '../../../assets/line-icons/icons/alarm';\nimport Bulb2Icon from '../../../assets/line-icons/icons/bulb2';\nimport Check2Icon from '../../../assets/line-icons/icons/check2';\nimport DartIcon from '../../../assets/line-icons/icons/dart';\nimport ExclamationIcon from '../../../assets/line-icons/icons/exclamation';\nimport Lock2Icon from '../../../assets/line-icons/icons/lock2';\nimport Play2Icon from '../../../assets/line-icons/icons/play2';\nimport PuzzleIcon from '../../../assets/line-icons/icons/puzzle';\nimport RecapIcon from '../../../assets/line-icons/icons/recap';\nimport StatusIcon from '../../../assets/line-icons/icons/status';\nimport TestTubeIcon from '../../../assets/line-icons/icons/testtube';\nimport { LOTTIE } from '../../../assets/lottie/lottie';\nimport FlexView from '../..//ui/layout/flex-view';\nimport ArrowTooltip from '../../ui/arrow-tooltip/arrow-tooltip';\nimport Text from '../../ui/text/text';\nimport { InProgressIconWrapper } from '../comps/node-card/node-card-styled';\nimport Tag from '../comps/tag/tag';\n\ninterface DueDateInfo {\n isOverdue: boolean;\n daysText: string;\n differenceInDays: number;\n}\n\nconst SECONDS_PER_DAY = 60 * 60 * 24;\nconst OVERDUE_TAG_STATES: INodeDataProps['state'][] = ['NOT_STARTED', 'IN_PROGRESS'];\n\nconst calculateDueDateInfo = (dueDateTs?: number | null): DueDateInfo => {\n if (!dueDateTs) {\n return { isOverdue: false, daysText: '', differenceInDays: 0 };\n }\n\n const currentTimestamp = Math.floor(Date.now() / 1000);\n const differenceInSeconds = dueDateTs - currentTimestamp;\n const differenceInDays = Math.ceil(differenceInSeconds / SECONDS_PER_DAY);\n\n const isOverdue = differenceInDays < 0;\n\n const daysText = differenceInDays > 0 ? `${Math.abs(differenceInDays)}D` : '';\n\n return { isOverdue, daysText, differenceInDays };\n};\n\nconst getNodeStateBasedTagInfo = (\n nodeState: INodeDataProps['state'],\n isStudent: boolean,\n accuracy?: number | null,\n dueDateTs?: number | null,\n) => {\n const { isOverdue, daysText, differenceInDays } = calculateDueDateInfo(dueDateTs);\n\n if (isOverdue && OVERDUE_TAG_STATES.includes(nodeState)) {\n return {\n icon: (\n <ArrowTooltip\n renderAs=\"primary\"\n position=\"bottom\"\n tooltipItem=\"Complete now\"\n zIndex={10}\n hidden={!isStudent}\n parentWidth=\"fit-content\"\n >\n <FlexView $background=\"RED\" $borderRadius={16} $gapX={0.24} $gutterX={0.5}>\n <Text $renderAs=\"ac4-black\" $color=\"WHITE\">\n OVERDUE\n </Text>\n </FlexView>\n </ArrowTooltip>\n ),\n top: -10,\n right: -10,\n };\n }\n\n switch (nodeState) {\n case 'NOT_STARTED':\n return {\n icon: (\n <ArrowTooltip\n renderAs=\"primary\"\n position=\"bottom\"\n tooltipItem={\n differenceInDays > 1 ? `${differenceInDays} days left` : 'Complete it today'\n }\n zIndex={10}\n hidden={!isStudent}\n >\n <InProgressIconWrapper\n $flexDirection=\"row\"\n $alignItems=\"center\"\n $justifyContent=\"center\"\n $borderRadius={16}\n $paddingRight={6}\n $paddingLeft={6}\n >\n {daysText && (\n <Text $renderAs=\"ub3-bold\" $color=\"WHITE\">\n {daysText}\n </Text>\n )}\n </InProgressIconWrapper>\n </ArrowTooltip>\n ),\n top: 0,\n right: 0,\n };\n case 'LOCKED':\n return {\n icon: <Lock2Icon width={32} height={32} />,\n top: -12,\n right: -12,\n };\n case 'IN_PROGRESS':\n return {\n icon: (\n <InProgressIconWrapper\n $flexDirection=\"row\"\n $alignItems=\"center\"\n $justifyContent=\"center\"\n $borderRadius={16}\n $paddingRight={0}\n $paddingLeft={daysText ? 6 : 0}\n >\n {daysText && (\n <Text $renderAs=\"ub3-bold\" $color=\"WHITE\">\n {daysText}\n </Text>\n )}\n <StatusIcon />\n </InProgressIconWrapper>\n ),\n };\n case 'COMPLETED':\n return {\n icon: (\n <Tag\n Icon={Check2Icon}\n label={typeof accuracy === 'number' ? `${accuracy}%` : undefined}\n />\n ),\n top: -10,\n right: -10,\n };\n case 'WAIT_FOR_REVIEW':\n return {\n icon: (\n <ArrowTooltip\n renderAs=\"primary\"\n position=\"bottom\"\n tooltipItem={isStudent ? 'Waiting for teacher to review' : 'Needs your review'}\n zIndex={10}\n >\n <Tag Icon={ExclamationIcon} />\n </ArrowTooltip>\n ),\n top: -10,\n right: -10,\n };\n\n default:\n return {\n icon: undefined,\n };\n }\n};\n\nconst getNodeCardBasedIcon = (nodeType: INodeDataProps['node_type']) => {\n switch (nodeType) {\n case 'LEARNING':\n return {\n lottie: LOTTIE.LEARN,\n icon: Bulb2Icon,\n };\n case 'RECAP':\n return {\n lottie: LOTTIE.RECAP,\n icon: RecapIcon,\n };\n case 'DYNAMIC':\n case 'ASSESSMENT':\n case 'CHAPTER_ASSESSMENT':\n return {\n lottie: LOTTIE.TEST,\n icon: AlarmIcon,\n };\n case 'PRACTICE':\n case 'EXTRA_PRACTICE':\n case 'TARGET_PRACTICE':\n case 'MASTERY':\n return {\n lottie: LOTTIE.PRACTICE,\n icon: DartIcon,\n };\n case 'PUZZLE_EASY':\n case 'PUZZLE_MEDIUM':\n case 'PUZZLE_HARD':\n return {\n lottie: LOTTIE.PUZZLE,\n icon: PuzzleIcon,\n };\n case 'VIDEO':\n return {\n lottie: LOTTIE.VIDEO,\n icon: Play2Icon,\n };\n default:\n return {\n lottie: LOTTIE.PROJECT,\n icon: TestTubeIcon,\n };\n }\n};\n\nexport { getNodeStateBasedTagInfo, getNodeCardBasedIcon };\n"],"names":["SECONDS_PER_DAY","OVERDUE_TAG_STATES","calculateDueDateInfo","dueDateTs","currentTimestamp","differenceInSeconds","differenceInDays","isOverdue","daysText","getNodeStateBasedTagInfo","nodeState","isStudent","accuracy","jsx","ArrowTooltip","FlexView","Text","InProgressIconWrapper","Lock2Icon","jsxs","StatusIcon","Tag","Check2Icon","ExclamationIcon","getNodeCardBasedIcon","nodeType","LOTTIE","Bulb2Icon","RecapIcon","AlarmIcon","DartIcon","PuzzleIcon","Play2Icon","TestTubeIcon"],"mappings":";;;;;;;;;;;;;;;;;;AA0BA,MAAMA,IAAkB,KAAK,KAAK,IAC5BC,IAAgD,CAAC,eAAe,aAAa,GAE7EC,IAAuB,CAACC,MAA2C;AACvE,MAAI,CAACA;AACH,WAAO,EAAE,WAAW,IAAO,UA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,aAAA;AAAA,QACL,MAAM;AAAA,MAAA;AAAA,EAEZ;AACF,GAEMC,IAAuB,CAACC,MAA0C;AACtE,UAAQA,GAAU;AAAA,IAChB,KAAK;AACI,aAAA;AAAA,QACL,QAAQC,EAAO;AAAA,QACf,MAAMC;AAAA,MAAA;AAAA,IAEV,KAAK;AACI,aAAA;AAAA,QACL,QAAQD,EAAO;AAAA,QACf,MAAME;AAAA,MAAA;AAAA,IAEV,KAAK;AAAA,IACL,KAAK;AAAA,IACL,KAAK;AACI,aAAA;AAAA,QACL,QAAQF,EAAO;AAAA,QACf,MAAMG;AAAA,MAAA;AAAA,IAEV,KAAK;AAAA,IACL,KAAK;AAAA,IACL,KAAK;AAAA,IACL,KAAK;AACI,aAAA;AAAA,QACL,QAAQH,EAAO;AAAA,QACf,MAAMI;AAAA,MAAA;AAAA,IAEV,KAAK;AAAA,IACL,KAAK;AAAA,IACL,KAAK;AACI,aAAA;AAAA,QACL,QAAQJ,EAAO;AAAA,QACf,MAAMK;AAAA,MAAA;AAAA,IAEV,KAAK;AACI,aAAA;AAAA,QACL,QAAQL,EAAO;AAAA,QACf,MAAMM;AAAA,MAAA;AAAA,IAEV;AACS,aAAA;AAAA,QACL,QAAQN,EAAO;AAAA,QACf,MAAMO;AAAA,MAAA;AAAA,EAEZ;AACF;"}
|
@@ -3,13 +3,13 @@ import { useRef as Y, useState as H, useEffect as f, useCallback as c } from "re
|
|
3
3
|
import q from "../../../assets/line-icons/icons/chevron-left.js";
|
4
4
|
import z from "../../../assets/line-icons/icons/chevron-right.js";
|
5
5
|
import { useJourney as Z } from "../../journey/use-journey/use-journey.js";
|
6
|
-
import
|
7
|
-
import
|
6
|
+
import u from "../../ui/layout/flex-view.js";
|
7
|
+
import v from "../../ui/text/text.js";
|
8
8
|
import J from "../homework-card.js";
|
9
9
|
import { useGetHomeworks as D } from "./api/get-homeworks.js";
|
10
10
|
import { ContentWrapper as ee, ScrollButton as w, ScrollContainer as re, QueueWrapper as oe, QueueText as te } from "./hw-card-list-styled.js";
|
11
11
|
const ne = ({
|
12
|
-
userType:
|
12
|
+
userType: a = "STUDENT",
|
13
13
|
studentId: s,
|
14
14
|
stream: d,
|
15
15
|
onTestStart: x,
|
@@ -21,31 +21,31 @@ const ne = ({
|
|
21
21
|
onNodeUnassign: S,
|
22
22
|
homeworkRef: W,
|
23
23
|
individualHomeworkRef: y,
|
24
|
-
startHomePageJourney:
|
25
|
-
canStartJourney:
|
24
|
+
startHomePageJourney: $,
|
25
|
+
canStartJourney: C
|
26
26
|
}) => {
|
27
|
-
const n = Y(null), [K,
|
28
|
-
get:
|
27
|
+
const n = Y(null), [K, k] = H(!1), [N, _] = H(!1), {
|
28
|
+
get: L,
|
29
29
|
data: e,
|
30
30
|
isProcessingFailed: j,
|
31
|
-
isProcessing:
|
32
|
-
isStale:
|
33
|
-
} = D(s), { isJourneyActive:
|
31
|
+
isProcessing: m,
|
32
|
+
isStale: b
|
33
|
+
} = D(s), { isJourneyActive: A } = Z();
|
34
34
|
f(() => {
|
35
|
-
e != null && e.length &&
|
35
|
+
e != null && e.length && $ && !A && C && $({ hwDetails: e, studentId: s, stream: d, userType: a });
|
36
36
|
}, [
|
37
|
-
|
37
|
+
C,
|
38
38
|
e,
|
39
|
-
|
40
|
-
|
39
|
+
A,
|
40
|
+
$,
|
41
41
|
d,
|
42
42
|
s,
|
43
|
-
|
43
|
+
a
|
44
44
|
]);
|
45
45
|
const r = c(() => {
|
46
46
|
if (n.current) {
|
47
|
-
const { scrollLeft: o, scrollWidth: i, clientWidth:
|
48
|
-
o > 1 &&
|
47
|
+
const { scrollLeft: o, scrollWidth: i, clientWidth: p } = n.current;
|
48
|
+
o > 1 && k(!0), o < i - p - 1 && _(!0);
|
49
49
|
}
|
50
50
|
}, []), G = c(() => {
|
51
51
|
n.current && (n.current.scrollBy({ left: -200, behavior: "smooth" }), r());
|
@@ -54,7 +54,7 @@ const ne = ({
|
|
54
54
|
}, [r]), Q = c(() => {
|
55
55
|
n.current && r();
|
56
56
|
}, [r]), X = c(() => {
|
57
|
-
|
57
|
+
k(!1), _(!1);
|
58
58
|
}, []);
|
59
59
|
f(() => {
|
60
60
|
const o = n.current;
|
@@ -66,23 +66,23 @@ const ne = ({
|
|
66
66
|
r();
|
67
67
|
}, [e, r]);
|
68
68
|
const h = c(() => {
|
69
|
-
|
70
|
-
}, [
|
69
|
+
L(s, void 0, { stream: d });
|
70
|
+
}, [L, d, s]);
|
71
71
|
f(() => {
|
72
|
-
!
|
73
|
-
}, [h,
|
72
|
+
!m && b && h();
|
73
|
+
}, [h, m, b]), f(() => {
|
74
74
|
h();
|
75
75
|
}, [h]);
|
76
76
|
const M = ((e == null ? void 0 : e.filter((o) => o.state === "WAIT_FOR_REVIEW")) || []).length;
|
77
|
-
return e && e.length === 0 ? /* @__PURE__ */ l(
|
78
|
-
/* @__PURE__ */ l(
|
77
|
+
return e && e.length === 0 ? /* @__PURE__ */ l(u, { $flexRowGapX: 1, children: [
|
78
|
+
/* @__PURE__ */ l(v, { $renderAs: "ac4-black", $color: "BLACK_T_60", children: [
|
79
79
|
"Homework (",
|
80
80
|
e == null ? void 0 : e.length,
|
81
81
|
")"
|
82
82
|
] }),
|
83
|
-
/* @__PURE__ */ t(
|
84
|
-
] }) : j ? null : /* @__PURE__ */ l(ee, { ref: W, $flexRowGapX: 1, $disablePointerEvents:
|
85
|
-
|
83
|
+
/* @__PURE__ */ t(v, { $renderAs: "ab2", $color: "BLACK_T_60", children: "No Homework assigned yet" })
|
84
|
+
] }) : j ? null : /* @__PURE__ */ l(ee, { ref: W, $flexRowGapX: 1, $disablePointerEvents: m, children: [
|
85
|
+
/* @__PURE__ */ l(v, { $renderAs: "ac4-black", $color: "BLACK_T_60", children: [
|
86
86
|
"Homework (",
|
87
87
|
M,
|
88
88
|
"/",
|
@@ -90,7 +90,7 @@ const ne = ({
|
|
90
90
|
")"
|
91
91
|
] }),
|
92
92
|
/* @__PURE__ */ l(
|
93
|
-
|
93
|
+
u,
|
94
94
|
{
|
95
95
|
$position: "relative",
|
96
96
|
onMouseEnter: Q,
|
@@ -111,16 +111,16 @@ const ne = ({
|
|
111
111
|
children: /* @__PURE__ */ t(q, { width: 24, height: 24 })
|
112
112
|
}
|
113
113
|
),
|
114
|
-
/* @__PURE__ */ t(re, { ref: n, children: /* @__PURE__ */ t(
|
114
|
+
/* @__PURE__ */ t(re, { ref: n, children: /* @__PURE__ */ t(u, { $flexDirection: "row", $flexGapX: 1, children: e == null ? void 0 : e.map((o, i) => {
|
115
115
|
const {
|
116
|
-
node_id:
|
116
|
+
node_id: p,
|
117
117
|
worksheet_id: O,
|
118
118
|
node_type: V,
|
119
119
|
title: P,
|
120
120
|
subtext: U
|
121
|
-
} = o,
|
121
|
+
} = o, g = V === "DYNAMIC";
|
122
122
|
return /* @__PURE__ */ l(
|
123
|
-
|
123
|
+
u,
|
124
124
|
{
|
125
125
|
ref: i === 0 ? y : void 0,
|
126
126
|
$flexDirection: "row",
|
@@ -140,22 +140,21 @@ const ne = ({
|
|
140
140
|
J,
|
141
141
|
{
|
142
142
|
isInQueue: e.length > 10 && i > 9,
|
143
|
-
userType:
|
143
|
+
userType: a,
|
144
144
|
header: P,
|
145
145
|
subHeader: U || "",
|
146
146
|
nodeData: o,
|
147
147
|
renderAs: "homework",
|
148
|
-
onNodeAttempt:
|
148
|
+
onNodeAttempt: g ? x : R,
|
149
149
|
shouldOpenOnRight: !0,
|
150
|
-
onNodeView:
|
151
|
-
onNodeReview:
|
150
|
+
onNodeView: g ? E : T,
|
151
|
+
onNodeReview: g ? B : I,
|
152
152
|
onNodeUnassign: S
|
153
|
-
}
|
154
|
-
`${O}_${u}_${i}`
|
153
|
+
}
|
155
154
|
)
|
156
155
|
]
|
157
156
|
},
|
158
|
-
|
157
|
+
`${O}_${p}_${i}`
|
159
158
|
);
|
160
159
|
}) }) }),
|
161
160
|
/* @__PURE__ */ t(
|
@@ -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 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 {\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 updatedCanScroll = useCallback(() => {\n if (scrollRef.current) {\n const { scrollLeft, scrollWidth, clientWidth } = scrollRef.current;\n\n if (scrollLeft > 1) {\n setIsLeftHovered(true);\n }\n\n if (scrollLeft < scrollWidth - clientWidth - 1) {\n setIsRightHovered(true);\n }\n }\n }, []);\n\n const handleScrollLeft = useCallback(() => {\n if (scrollRef.current) {\n scrollRef.current.scrollBy({ left: -200, behavior: 'smooth' });\n updatedCanScroll();\n }\n }, [updatedCanScroll]);\n\n const handleScrollRight = useCallback(() => {\n if (scrollRef.current) {\n scrollRef.current.scrollBy({ left: 200, behavior: 'smooth' });\n updatedCanScroll();\n }\n }, [updatedCanScroll]);\n\n const handleHoverEnter = useCallback(() => {\n if (!scrollRef.current) return;\n\n updatedCanScroll();\n }, [updatedCanScroll]);\n\n const handleHoverLeave = useCallback(() => {\n setIsLeftHovered(false);\n setIsRightHovered(false);\n }, []);\n\n useEffect(() => {\n const scrollElement = scrollRef.current;\n\n if (scrollElement) {\n scrollElement.addEventListener('scroll', updatedCanScroll);\n updatedCanScroll();\n\n return () => {\n scrollElement.removeEventListener('scroll', updatedCanScroll);\n };\n }\n }, [updatedCanScroll]);\n\n useEffect(() => {\n updatedCanScroll();\n }, [hwDetails, updatedCanScroll]);\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\n $position=\"relative\"\n onMouseEnter={handleHoverEnter}\n onMouseLeave={handleHoverLeave}\n >\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\n <Styled.ScrollContainer ref={scrollRef}>\n <FlexView $flexDirection=\"row\" $flexGapX={1}>\n {hwDetails?.map((sheet, idx) => {\n const {\n node_id: nodeId,\n worksheet_id: worksheetId,\n node_type: nodeType,\n title,\n subtext,\n } = sheet;\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={title}\n subHeader={subtext || ''}\n nodeData={sheet}\n renderAs=\"homework\"\n onNodeAttempt={isDynamicSheet ? onTestStart : onNodeAttempt}\n shouldOpenOnRight={true}\n onNodeView={isDynamicSheet ? onTestPreview : onNodeView}\n onNodeReview={isDynamicSheet ? onTestReview : onNodeReview}\n onNodeUnassign={onNodeUnassign}\n />\n </FlexView>\n );\n })}\n </FlexView>\n </Styled.ScrollContainer>\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 </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","getHomeworks","hwDetails","isProcessingFailed","isProcessing","isStale","useGetHomeworks","isJourneyActive","useJourney","useEffect","updatedCanScroll","useCallback","scrollLeft","scrollWidth","clientWidth","handleScrollLeft","handleScrollRight","handleHoverEnter","handleHoverLeave","scrollElement","fetchHomeworks","waitForReviewSheets","sheet","jsxs","FlexView","Text","Styled.ContentWrapper","jsx","Styled.ScrollButton","ChevronLeftIcon","Styled.ScrollContainer","idx","nodeId","worksheetId","nodeType","title","subtext","isDynamicSheet","Styled.QueueWrapper","Styled.QueueText","HomeworkCard","ChevronRightIcon","HWCardList$1"],"mappings":";;;;;;;;;;AAoCA,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,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A,oBAACW;AAAAA,oBAAA;AAAA,sBACC,aAAY;AAAA,sBACZ,iBAAgB;AAAA,sBAChB,SAAS;AAAA,sBACT,MAAM;AAAA,sBAEN,UAAA,gBAAAX,EAACY,IAAA,EAAiB,WAAU,OAAM,QAAO,SAAQ,UAEjD,YAAA;AAAA,oBAAA;AAAA,kBACF;AAAA,kBAEF,gBAAAZ;AAAA,oBAACa;AAAA,oBAAA;AAAA,sBACC,WAAWtC,EAAU,SAAS,MAAM6B,IAAM;AAAA,sBAE1C,UAAAnD;AAAA,sBACA,QAAQuD;AAAA,sBACR,WAAWC,KAAW;AAAA,sBACtB,UAAUd;AAAA,sBACV,UAAS;AAAA,sBACT,eAAee,IAAiBtD,IAAcC;AAAA,sBAC9C,mBAAmB;AAAA,sBACnB,YAAYqD,IAAiBpD,IAAgBC;AAAA,sBAC7C,cAAcmD,IAAiBlD,IAAeC;AAAA,sBAC9C,gBAAAC;AAAA,oBAAA;AAAA,oBAVK,GAAG4C,CAAW,IAAID,CAAM,IAAID,CAAG;AAAA,kBAWtC;AAAA,gBAAA;AAAA,cAAA;AAAA,cA7BKC;AAAA,YAAA;AAAA,UA8BP,IAGN,EACF,CAAA;AAAA,UACA,gBAAAL;AAAA,YAACC;AAAAA,YAAA;AAAA,cACC,WAAU;AAAA,cACV,QAAO;AAAA,cACP,SAAQ;AAAA,cACR,aAAY;AAAA,cACZ,iBAAgB;AAAA,cAChB,aAAY;AAAA,cACZ,SAASZ;AAAA,cACT,UAAUjB;AAAA,cACV,MAAK;AAAA,cACL,OAAM;AAAA,cAEN,UAAC,gBAAA4B,EAAAc,GAAA,EAAiB,OAAO,IAAI,QAAQ,IAAI;AAAA,YAAA;AAAA,UAC3C;AAAA,QAAA;AAAA,MAAA;AAAA,IACF;AAAA,EACF,EAAA,CAAA;AAEJ,GAEAC,KAAe/D;"}
|
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 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 {\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 updatedCanScroll = useCallback(() => {\n if (scrollRef.current) {\n const { scrollLeft, scrollWidth, clientWidth } = scrollRef.current;\n\n if (scrollLeft > 1) {\n setIsLeftHovered(true);\n }\n\n if (scrollLeft < scrollWidth - clientWidth - 1) {\n setIsRightHovered(true);\n }\n }\n }, []);\n\n const handleScrollLeft = useCallback(() => {\n if (scrollRef.current) {\n scrollRef.current.scrollBy({ left: -200, behavior: 'smooth' });\n updatedCanScroll();\n }\n }, [updatedCanScroll]);\n\n const handleScrollRight = useCallback(() => {\n if (scrollRef.current) {\n scrollRef.current.scrollBy({ left: 200, behavior: 'smooth' });\n updatedCanScroll();\n }\n }, [updatedCanScroll]);\n\n const handleHoverEnter = useCallback(() => {\n if (!scrollRef.current) return;\n\n updatedCanScroll();\n }, [updatedCanScroll]);\n\n const handleHoverLeave = useCallback(() => {\n setIsLeftHovered(false);\n setIsRightHovered(false);\n }, []);\n\n useEffect(() => {\n const scrollElement = scrollRef.current;\n\n if (scrollElement) {\n scrollElement.addEventListener('scroll', updatedCanScroll);\n updatedCanScroll();\n\n return () => {\n scrollElement.removeEventListener('scroll', updatedCanScroll);\n };\n }\n }, [updatedCanScroll]);\n\n useEffect(() => {\n updatedCanScroll();\n }, [hwDetails, updatedCanScroll]);\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 <Text $renderAs=\"ac4-black\" $color=\"BLACK_T_60\">\n Homework ({waitForReviewSheets}/{hwDetails?.length})\n </Text>\n <FlexView\n $position=\"relative\"\n onMouseEnter={handleHoverEnter}\n onMouseLeave={handleHoverLeave}\n >\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\n <Styled.ScrollContainer ref={scrollRef}>\n <FlexView $flexDirection=\"row\" $flexGapX={1}>\n {hwDetails?.map((sheet, idx) => {\n const {\n node_id: nodeId,\n worksheet_id: worksheetId,\n node_type: nodeType,\n title,\n subtext,\n } = sheet;\n const isDynamicSheet = nodeType === 'DYNAMIC';\n\n return (\n <FlexView\n ref={idx === 0 ? individualHomeworkRef : undefined}\n key={`${worksheetId}_${nodeId}_${idx}`}\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 userType={userType}\n header={title}\n subHeader={subtext || ''}\n nodeData={sheet}\n renderAs=\"homework\"\n onNodeAttempt={isDynamicSheet ? onTestStart : onNodeAttempt}\n shouldOpenOnRight={true}\n onNodeView={isDynamicSheet ? onTestPreview : onNodeView}\n onNodeReview={isDynamicSheet ? onTestReview : onNodeReview}\n onNodeUnassign={onNodeUnassign}\n />\n </FlexView>\n );\n })}\n </FlexView>\n </Styled.ScrollContainer>\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 </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","getHomeworks","hwDetails","isProcessingFailed","isProcessing","isStale","useGetHomeworks","isJourneyActive","useJourney","useEffect","updatedCanScroll","useCallback","scrollLeft","scrollWidth","clientWidth","handleScrollLeft","handleScrollRight","handleHoverEnter","handleHoverLeave","scrollElement","fetchHomeworks","waitForReviewSheets","sheet","jsxs","FlexView","Text","Styled.ContentWrapper","jsx","Styled.ScrollButton","ChevronLeftIcon","Styled.ScrollContainer","idx","nodeId","worksheetId","nodeType","title","subtext","isDynamicSheet","Styled.QueueWrapper","Styled.QueueText","HomeworkCard","ChevronRightIcon","HWCardList$1"],"mappings":";;;;;;;;;;AAoCA,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,E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