@cuemath/leap 2.9.9-as1 → 2.9.9-as3
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/chapters-list/chapter-item/chapter-item.js +5 -5
- package/dist/features/chapters/chapters-list/chapter-item/chapter-item.js.map +1 -1
- package/dist/features/chapters-v2/chapter-details/block-sections/block-section-view.js +1 -1
- 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-styled.js +16 -7
- package/dist/features/chapters-v2/chapter-details/block-sections/block-sections-styled.js.map +1 -1
- package/dist/features/chapters-v2/chapter-details/block-sections/block-sections.js +57 -64
- package/dist/features/chapters-v2/chapter-details/block-sections/block-sections.js.map +1 -1
- package/dist/features/chapters-v2/comps/node-card/node-card-tags.js +8 -8
- package/dist/features/chapters-v2/comps/node-card/node-card-tags.js.map +1 -1
- package/dist/features/chapters-v2/comps/node-card/node-menu-options/node-menu-option.js +31 -0
- package/dist/features/chapters-v2/comps/node-card/node-menu-options/node-menu-option.js.map +1 -0
- package/dist/features/chapters-v2/comps/node-card/node-menu-options/node-menu-options.js +6 -28
- package/dist/features/chapters-v2/comps/node-card/node-menu-options/node-menu-options.js.map +1 -1
- package/dist/features/chapters-v2/comps/node-card/student-actions/student-actions.js +102 -93
- 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 +94 -92
- package/dist/features/chapters-v2/comps/node-card/teacher-actions/teacher-actions.js.map +1 -1
- package/dist/features/chapters-v2/comps/tag/tag.js +2 -2
- package/dist/features/chapters-v2/comps/tag/tag.js.map +1 -1
- package/dist/features/chapters-v2/utils/index.js +2 -5
- package/dist/features/chapters-v2/utils/index.js.map +1 -1
- package/dist/features/homework/card-menu-option.js +28 -0
- package/dist/features/homework/card-menu-option.js.map +1 -0
- package/dist/features/homework/card-menu-options.js +12 -28
- package/dist/features/homework/card-menu-options.js.map +1 -1
- package/dist/features/homework/card-title.js +10 -9
- package/dist/features/homework/card-title.js.map +1 -1
- package/dist/features/homework/homework-card-view.js +51 -49
- package/dist/features/homework/homework-card-view.js.map +1 -1
- package/dist/features/homework/hw-card-list/hw-card-list.js +78 -72
- package/dist/features/homework/hw-card-list/hw-card-list.js.map +1 -1
- package/dist/features/milestone/milestone-list-container/milestone-list/milestone-list.js +32 -31
- package/dist/features/milestone/milestone-list-container/milestone-list/milestone-list.js.map +1 -1
- package/dist/features/milestone/milestone-list-container/milestone-list/milestone-widget/milestone-info.js +14 -14
- package/dist/features/milestone/milestone-list-container/milestone-list/milestone-widget/milestone-info.js.map +1 -1
- package/dist/features/milestone/milestone-list-container/milestone-list/milestone-widget/outcome/outcome-styled.js +2 -6
- package/dist/features/milestone/milestone-list-container/milestone-list/milestone-widget/outcome/outcome-styled.js.map +1 -1
- package/dist/features/milestone/milestone-tests/test-list-v2/test-list-view.js +30 -29
- package/dist/features/milestone/milestone-tests/test-list-v2/test-list-view.js.map +1 -1
- package/dist/features/ui/lottie-animation/lottie-animation.js +19 -13
- package/dist/features/ui/lottie-animation/lottie-animation.js.map +1 -1
- package/dist/index.d.ts +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 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,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,EA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G,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 { ILottieAnimationRef } from '../../../../ui/lottie-animation/types';\nimport 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 } 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 renderSettings = { renderer: 'canvas', autoplay: false };\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 containerRef = useRef<HTMLDivElement>(null);\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 { lottie: nodeCardLottie } = getNodeCardBasedIcon(nodeType);\n const animationRef = useRef<ILottieAnimationRef | null>(null);\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\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 animationRef.current?.play();\n }, [sheetLocked]);\n\n const handleOnMouseLeave = useCallback(() => {\n animationRef.current?.stop();\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 <LottieAnimation src={nodeCardLottie} ref={animationRef} settings={renderSettings} />\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":["renderSettings","ASSIGN_AS_HW","REVIEW","VIEW","MARK_AS_DONE","TEACHER_MENU_LABELS","TeacherActions","memo","nodeData","imageHue","blockType","isSkipped","onNodeAttemptLocationChange","onNodeMarkAsDone","onNodeView","onNodeReview","containerRef","useRef","menuVisible","onMenuClick","useContextMenuClickHandler","accuracy","attemptLocation","nodeType","cardHeader","title","state","isOptional","sheetStatement","permissions","userAttemptId","nodeCardLottie","getNodeCardBasedIcon","animationRef","canChangeAttemptLocation","canMarkFamiliar","canReview","isGoalBlock","BLOCK_TYPE","sheetLocked","NODE_CARD_STATES","sheetNotStarted","sheetInProgress","inClassSheet","showCardAnimation","nodeBgImage","getNodeTypeBasedBgImage","handleOnMenuOptionClick","useCallback","optionId","handleOnMouseEnter","_a","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":";;;;;;;;;;;;;;;;;;;AAyBA,MAAMA,KAAiB,EAAE,UAAU,UAAU,UAAU,GAAM,GACvD,EAAE,cAAAC,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;AACE,UAAAC,IAAeC,EAAuB,IAAI,GAC1C,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,IAAAtB,GAEE,EAAE,QAAQuB,EAAe,IAAIC,GAAqBT,CAAQ,GAC1DU,IAAehB,EAAmC,IAAI,GAEtD;AAAA,MACJ,6BAA6BiB;AAAA,MAC7B,mBAAmBC;AAAA,MACnB,YAAYC;AAAA,IACV,IAAAP,GAEEQ,IAAc3B,MAAc4B,GAAW,MACvCC,IAAcb,M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
|
18
18
|
children: [
|
19
|
-
e
|
20
|
-
r && /* @__PURE__ */ o(s, { $renderAs: "ac4-black", children: r })
|
19
|
+
!!e && /* @__PURE__ */ o(e, { width: 20, height: 20 }),
|
20
|
+
!!r && /* @__PURE__ */ o(s, { $renderAs: "ac4-black", children: r })
|
21
21
|
]
|
22
22
|
}
|
23
23
|
);
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"tag.js","sources":["../../../../../src/features/chapters-v2/comps/tag/tag.tsx"],"sourcesContent":["import type { FC } from 'react';\n\nimport React, { memo } from 'react';\n\nimport Text from '../../../ui/text/text';\nimport * as Styled from './tag-styled';\n\ninterface ITagProps {\n label?: string;\n Icon?: FC<React.SVGProps<SVGSVGElement>>;\n}\n\nconst Tag: FC<ITagProps> = memo(({ label, Icon }) => {\n const isOnlyIconPresent = !label;\n\n return (\n <Styled.TagContainer\n $flexDirection=\"row\"\n $alignItems=\"center\"\n $justifyContent=\"center\"\n $borderRadius={50}\n $gap={isOnlyIconPresent ? 0 : 6}\n $gutter={isOnlyIconPresent ? 0 : 6}\n $background=\"WHITE_1\"\n $onlyIcon={isOnlyIconPresent}\n >\n {Icon
|
1
|
+
{"version":3,"file":"tag.js","sources":["../../../../../src/features/chapters-v2/comps/tag/tag.tsx"],"sourcesContent":["import type { FC } from 'react';\n\nimport React, { memo } from 'react';\n\nimport Text from '../../../ui/text/text';\nimport * as Styled from './tag-styled';\n\ninterface ITagProps {\n label?: string;\n Icon?: FC<React.SVGProps<SVGSVGElement>>;\n}\n\nconst Tag: FC<ITagProps> = memo(({ label, Icon }) => {\n const isOnlyIconPresent = !label;\n\n return (\n <Styled.TagContainer\n $flexDirection=\"row\"\n $alignItems=\"center\"\n $justifyContent=\"center\"\n $borderRadius={50}\n $gap={isOnlyIconPresent ? 0 : 6}\n $gutter={isOnlyIconPresent ? 0 : 6}\n $background=\"WHITE_1\"\n $onlyIcon={isOnlyIconPresent}\n >\n {!!Icon && <Icon width={20} height={20} />}\n {!!label && <Text $renderAs=\"ac4-black\">{label}</Text>}\n </Styled.TagContainer>\n );\n});\n\nexport default Tag;\n"],"names":["Tag","memo","label","Icon","isOnlyIconPresent","jsxs","Styled.TagContainer","jsx","Text"],"mappings":";;;;AAYA,MAAMA,IAAqBC,EAAK,CAAC,EAAE,OAAAC,GAAO,MAAAC,QAAW;AACnD,QAAMC,IAAoB,CAACF;AAGzB,SAAA,gBAAAG;AAAA,IAACC;AAAAA,IAAA;AAAA,MACC,gBAAe;AAAA,MACf,aAAY;AAAA,MACZ,iBAAgB;AAAA,MAChB,eAAe;AAAA,MACf,MAAMF,IAAoB,IAAI;AAAA,MAC9B,SAASA,IAAoB,IAAI;AAAA,MACjC,aAAY;AAAA,MACZ,WAAWA;AAAA,MAEV,UAAA;AAAA,QAAA,CAAC,CAACD,KAAQ,gBAAAI,EAACJ,KAAK,OAAO,IAAI,QAAQ,IAAI;AAAA,QACvC,CAAC,CAACD,uBAAUM,GAAK,EAAA,WAAU,aAAa,UAAMN,GAAA;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAGrD,CAAC;"}
|
@@ -27,11 +27,8 @@ const _ = (t) => {
|
|
27
27
|
return e.NODE_CUSTOM_TEST_BG;
|
28
28
|
}
|
29
29
|
}, T = (t, E, n, r) => {
|
30
|
-
if (!t)
|
31
|
-
|
32
|
-
if (r !== void 0 && r > 0)
|
33
|
-
return `${r}`;
|
34
|
-
}
|
30
|
+
if (!(t || !r))
|
31
|
+
return n ? `${r}` : `(${E})`;
|
35
32
|
};
|
36
33
|
export {
|
37
34
|
_ as getChapterCompletionPercentage,
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../src/features/chapters-v2/utils/index.ts"],"sourcesContent":["import type { IChapterProgressStats } from '../chapter-details/chapter-details-types';\nimport type { INodeDataProps } from '../comps/node-card/node-card-types';\n\nimport { ILLUSTRATIONS } from '../../../assets/illustrations/illustrations';\n\n// This function calculates the completion percentage of a chapter based on progress stats.\n// If no progress stats are provided, it returns 0.\n// It uses the `mandatory` field from the progress stats to determine the completed and total items.\n// It returns an integer representing the percentage of completion, rounded down to the nearest whole number.\nconst getChapterCompletionPercentage = (progressStats: IChapterProgressStats | null) => {\n if (!progressStats) return 0;\n\n const { mandatory } = progressStats;\n const { completed, total } = mandatory;\n\n if (total === 0) {\n return 0;\n }\n\n const percentage = Math.floor((completed / total) * 100);\n\n return percentage;\n};\n\nconst getNodeTypeBasedBgImage = (nodeType: INodeDataProps['node_type']) => {\n switch (nodeType) {\n case 'LEARNING':\n return ILLUSTRATIONS.NODE_LEARN_BG;\n case 'RECAP':\n return ILLUSTRATIONS.NODE_RECAP_BG;\n\n case 'ASSESSMENT':\n case 'DYNAMIC':\n return ILLUSTRATIONS.NODE_CUSTOM_TEST_BG;\n\n case 'PRACTICE':\n case 'EXTRA_PRACTICE':\n case 'TARGET_PRACTICE':\n case 'MASTERY':\n return ILLUSTRATIONS.NODE_PRACTICE_BG;\n\n case 'PUZZLE_EASY':\n case 'PUZZLE_MEDIUM':\n case 'PUZZLE_HARD':\n return ILLUSTRATIONS.NODE_PUZZLE_BG;\n\n case 'VIDEO':\n return ILLUSTRATIONS.NODE_VIDEO_BG;\n\n default:\n return ILLUSTRATIONS.NODE_CUSTOM_TEST_BG;\n }\n};\n\nconst getSheetNLessonCount = (\n isSkipped: boolean,\n sheetsLength: number,\n isGoalBlock?: boolean,\n lessonIdx?: number,\n) => {\n if (isSkipped) return undefined;\n\n if (!isGoalBlock) return `(${sheetsLength})`;\n\n
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../src/features/chapters-v2/utils/index.ts"],"sourcesContent":["import type { IChapterProgressStats } from '../chapter-details/chapter-details-types';\nimport type { INodeDataProps } from '../comps/node-card/node-card-types';\n\nimport { ILLUSTRATIONS } from '../../../assets/illustrations/illustrations';\n\n// This function calculates the completion percentage of a chapter based on progress stats.\n// If no progress stats are provided, it returns 0.\n// It uses the `mandatory` field from the progress stats to determine the completed and total items.\n// It returns an integer representing the percentage of completion, rounded down to the nearest whole number.\nconst getChapterCompletionPercentage = (progressStats: IChapterProgressStats | null) => {\n if (!progressStats) return 0;\n\n const { mandatory } = progressStats;\n const { completed, total } = mandatory;\n\n if (total === 0) {\n return 0;\n }\n\n const percentage = Math.floor((completed / total) * 100);\n\n return percentage;\n};\n\nconst getNodeTypeBasedBgImage = (nodeType: INodeDataProps['node_type']) => {\n switch (nodeType) {\n case 'LEARNING':\n return ILLUSTRATIONS.NODE_LEARN_BG;\n case 'RECAP':\n return ILLUSTRATIONS.NODE_RECAP_BG;\n\n case 'ASSESSMENT':\n case 'DYNAMIC':\n return ILLUSTRATIONS.NODE_CUSTOM_TEST_BG;\n\n case 'PRACTICE':\n case 'EXTRA_PRACTICE':\n case 'TARGET_PRACTICE':\n case 'MASTERY':\n return ILLUSTRATIONS.NODE_PRACTICE_BG;\n\n case 'PUZZLE_EASY':\n case 'PUZZLE_MEDIUM':\n case 'PUZZLE_HARD':\n return ILLUSTRATIONS.NODE_PUZZLE_BG;\n\n case 'VIDEO':\n return ILLUSTRATIONS.NODE_VIDEO_BG;\n\n default:\n return ILLUSTRATIONS.NODE_CUSTOM_TEST_BG;\n }\n};\n\nconst getSheetNLessonCount = (\n isSkipped: boolean,\n sheetsLength: number,\n isGoalBlock?: boolean,\n lessonIdx?: number,\n) => {\n if (isSkipped || !lessonIdx) return undefined;\n\n if (!isGoalBlock) return `(${sheetsLength})`;\n\n return `${lessonIdx}`;\n};\n\nexport { getChapterCompletionPercentage, getNodeTypeBasedBgImage, getSheetNLessonCount };\n"],"names":["getChapterCompletionPercentage","progressStats","mandatory","completed","total","getNodeTypeBasedBgImage","nodeType","ILLUSTRATIONS","getSheetNLessonCount","isSkipped","sheetsLength","isGoalBlock","lessonIdx"],"mappings":";AASM,MAAAA,IAAiC,CAACC,MAAgD;AAClF,MAAA,CAACA,EAAsB,QAAA;AAErB,QAAA,EAAE,WAAAC,EAAc,IAAAD,GAChB,EAAE,WAAAE,GAAW,OAAAC,EAAU,IAAAF;AAE7B,SAAIE,MAAU,IACL,IAGU,KAAK,MAAOD,IAAYC,IAAS,GAAG;AAGzD,GAEMC,IAA0B,CAACC,MAA0C;AACzE,UAAQA,GAAU;AAAA,IAChB,KAAK;AACH,aAAOC,EAAc;AAAA,IACvB,KAAK;AACH,aAAOA,EAAc;AAAA,IAEvB,KAAK;AAAA,IACL,KAAK;AACH,aAAOA,EAAc;AAAA,IAEvB,KAAK;AAAA,IACL,KAAK;AAAA,IACL,KAAK;AAAA,IACL,KAAK;AACH,aAAOA,EAAc;AAAA,IAEvB,KAAK;AAAA,IACL,KAAK;AAAA,IACL,KAAK;AACH,aAAOA,EAAc;AAAA,IAEvB,KAAK;AACH,aAAOA,EAAc;AAAA,IAEvB;AACE,aAAOA,EAAc;AAAA,EACzB;AACF,GAEMC,IAAuB,CAC3BC,GACAC,GACAC,GACAC,MACG;AACC,MAAA,EAAAH,KAAa,CAACG;AAElB,WAAKD,IAEE,GAAGC,CAAS,KAFM,IAAIF,CAAY;AAG3C;"}
|
@@ -0,0 +1,28 @@
|
|
1
|
+
import { jsx as i, jsxs as c } from "react/jsx-runtime";
|
2
|
+
import { memo as d, useCallback as p } from "react";
|
3
|
+
import s from "../ui/buttons/clickable/clickable.js";
|
4
|
+
import { CardOptionWrapper as m, OptionText as $ } from "./styles.js";
|
5
|
+
const C = d((l) => {
|
6
|
+
const { icon: t, label: n, id: e, onClick: r, disabled: o } = l, a = p(() => o ? null : r(e), [o, e, r]);
|
7
|
+
return /* @__PURE__ */ i(s, { onClick: a, label: e, children: /* @__PURE__ */ c(
|
8
|
+
m,
|
9
|
+
{
|
10
|
+
$flexDirection: "row",
|
11
|
+
$alignItems: "center",
|
12
|
+
$flexGap: 8,
|
13
|
+
$gapX: 0.5,
|
14
|
+
$gutterX: 1,
|
15
|
+
$opacity: o ? 0.5 : 1,
|
16
|
+
$disabled: o,
|
17
|
+
children: [
|
18
|
+
/* @__PURE__ */ i(t, { width: 20, height: 20 }),
|
19
|
+
/* @__PURE__ */ i($, { $renderAs: "ub3", $color: "WHITE", children: n })
|
20
|
+
]
|
21
|
+
},
|
22
|
+
e
|
23
|
+
) }, e);
|
24
|
+
});
|
25
|
+
export {
|
26
|
+
C as default
|
27
|
+
};
|
28
|
+
//# sourceMappingURL=card-menu-option.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"card-menu-option.js","sources":["../../../src/features/homework/card-menu-option.tsx"],"sourcesContent":["import type { ICardMenuOption } from './card-menu-options';\n\nimport { memo, useCallback } from 'react';\n\nimport Clickable from '../ui/buttons/clickable/clickable';\nimport * as Styled from './styles';\n\nconst CardMenuOption = memo((option: ICardMenuOption) => {\n const { icon: OptionIcon, label, id, onClick, disabled } = option;\n\n const handleClick = useCallback(() => (!disabled ? onClick(id) : null), [disabled, id, onClick]);\n\n return (\n <Clickable onClick={handleClick} label={id} key={id}>\n <Styled.CardOptionWrapper\n $flexDirection=\"row\"\n $alignItems=\"center\"\n $flexGap={8}\n $gapX={0.5}\n $gutterX={1}\n $opacity={disabled ? 0.5 : 1}\n $disabled={disabled}\n key={id}\n >\n <OptionIcon width={20} height={20} />\n <Styled.OptionText $renderAs=\"ub3\" $color=\"WHITE\">\n {label}\n </Styled.OptionText>\n </Styled.CardOptionWrapper>\n </Clickable>\n );\n});\n\nexport default CardMenuOption;\n"],"names":["CardMenuOption","memo","option","OptionIcon","label","id","onClick","disabled","handleClick","useCallback","jsx","Clickable","jsxs","Styled.CardOptionWrapper","Styled.OptionText"],"mappings":";;;;AAOM,MAAAA,IAAiBC,EAAK,CAACC,MAA4B;AACvD,QAAM,EAAE,MAAMC,GAAY,OAAAC,GAAO,IAAAC,GAAI,SAAAC,GAAS,UAAAC,EAAa,IAAAL,GAErDM,IAAcC,EAAY,MAAQF,IAAyB,OAAdD,EAAQD,CAAE,GAAW,CAACE,GAAUF,GAAIC,CAAO,CAAC;AAE/F,SACG,gBAAAI,EAAAC,GAAA,EAAU,SAASH,GAAa,OAAOH,GACtC,UAAA,gBAAAO;AAAA,IAACC;AAAAA,IAAA;AAAA,MACC,gBAAe;AAAA,MACf,aAAY;AAAA,MACZ,UAAU;AAAA,MACV,OAAO;AAAA,MACP,UAAU;AAAA,MACV,UAAUN,IAAW,MAAM;AAAA,MAC3B,WAAWA;AAAA,MAGX,UAAA;AAAA,QAAA,gBAAAG,EAACP,GAAW,EAAA,OAAO,IAAI,QAAQ,IAAI;AAAA,QACnC,gBAAAO,EAACI,GAAA,EAAkB,WAAU,OAAM,QAAO,SACvC,UACHV,GAAA;AAAA,MAAA;AAAA,IAAA;AAAA,IALKC;AAAA,EAAA,KATwCA,CAgBjD;AAEJ,CAAC;"}
|
@@ -1,38 +1,22 @@
|
|
1
|
-
import { jsx as
|
2
|
-
import { memo as
|
3
|
-
import
|
4
|
-
import { CardMenuOptionsWrapper as
|
5
|
-
const
|
6
|
-
({ options:
|
7
|
-
|
1
|
+
import { jsx as m } from "react/jsx-runtime";
|
2
|
+
import { memo as p, createElement as a } from "react";
|
3
|
+
import i from "./card-menu-option.js";
|
4
|
+
import { CardMenuOptionsWrapper as d } from "./styles.js";
|
5
|
+
const C = p(
|
6
|
+
({ options: e, shouldOpenOnRight: n, visible: r, $width: t }) => r ? /* @__PURE__ */ m(
|
7
|
+
d,
|
8
8
|
{
|
9
|
-
$visible:
|
9
|
+
$visible: r,
|
10
10
|
$background: "BLACK_2",
|
11
11
|
$borderColor: "WHITE_T_38",
|
12
12
|
$gapX: 0.5,
|
13
|
-
$width:
|
14
|
-
$shouldopenonright:
|
15
|
-
children:
|
16
|
-
s,
|
17
|
-
{
|
18
|
-
$flexDirection: "row",
|
19
|
-
$alignItems: "center",
|
20
|
-
$flexGap: 8,
|
21
|
-
$gapX: 0.5,
|
22
|
-
$gutterX: 1,
|
23
|
-
$opacity: e ? 0.5 : 1,
|
24
|
-
$disabled: e,
|
25
|
-
children: [
|
26
|
-
/* @__PURE__ */ o(p, { width: 20, height: 20 }),
|
27
|
-
/* @__PURE__ */ o(d, { $renderAs: "ub3", $color: "WHITE", children: a })
|
28
|
-
]
|
29
|
-
},
|
30
|
-
r
|
31
|
-
) }, r))
|
13
|
+
$width: t,
|
14
|
+
$shouldopenonright: n,
|
15
|
+
children: e.map((o) => /* @__PURE__ */ a(i, { ...o, key: o.id }))
|
32
16
|
}
|
33
17
|
) : null
|
34
18
|
);
|
35
19
|
export {
|
36
|
-
|
20
|
+
C as default
|
37
21
|
};
|
38
22
|
//# sourceMappingURL=card-menu-options.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"card-menu-options.js","sources":["../../../src/features/homework/card-menu-options.tsx"],"sourcesContent":["import type { FC, SVGProps } from 'react';\n\nimport { memo } from 'react';\n\nimport
|
1
|
+
{"version":3,"file":"card-menu-options.js","sources":["../../../src/features/homework/card-menu-options.tsx"],"sourcesContent":["import type { FC, SVGProps } from 'react';\n\nimport { memo } from 'react';\n\nimport CardMenuOption from './card-menu-option';\nimport * as Styled from './styles';\n\nexport interface ICardMenuOption {\n id: string;\n label: string;\n icon: FC<SVGProps<SVGSVGElement>>;\n onClick: (id: string) => void;\n disabled: boolean;\n}\n\ninterface ICardMenuOptionsProps {\n $width?: string | number;\n options: ICardMenuOption[];\n triggerRef: React.RefObject<HTMLElement>;\n visible: boolean;\n shouldOpenOnRight: boolean;\n}\n\nconst CardMenuOptions: FC<ICardMenuOptionsProps> = memo(\n ({ options, shouldOpenOnRight, visible, $width }) => {\n if (!visible) return null;\n\n return (\n <Styled.CardMenuOptionsWrapper\n $visible={visible}\n $background=\"BLACK_2\"\n $borderColor=\"WHITE_T_38\"\n $gapX={0.5}\n $width={$width}\n $shouldopenonright={shouldOpenOnRight}\n >\n {options.map(option => (\n <CardMenuOption {...option} key={option.id} />\n ))}\n </Styled.CardMenuOptionsWrapper>\n );\n },\n);\n\nexport default CardMenuOptions;\n"],"names":["CardMenuOptions","memo","options","shouldOpenOnRight","visible","$width","jsx","Styled.CardMenuOptionsWrapper","option","createElement","CardMenuOption"],"mappings":";;;;AAuBA,MAAMA,IAA6CC;AAAA,EACjD,CAAC,EAAE,SAAAC,GAAS,mBAAAC,GAAmB,SAAAC,GAAS,QAAAC,QACjCD,IAGH,gBAAAE;AAAA,IAACC;AAAAA,IAAA;AAAA,MACC,UAAUH;AAAA,MACV,aAAY;AAAA,MACZ,cAAa;AAAA,MACb,OAAO;AAAA,MACP,QAAAC;AAAA,MACA,oBAAoBF;AAAA,MAEnB,UAAAD,EAAQ,IAAI,CAAAM,MACV,gBAAAC,EAAAC,GAAA,EAAgB,GAAGF,GAAQ,KAAKA,EAAO,GAAI,CAAA,CAC7C;AAAA,IAAA;AAAA,EAAA,IAbgB;AAiBzB;"}
|
@@ -1,15 +1,16 @@
|
|
1
|
-
import { jsx as t, jsxs as
|
1
|
+
import { jsx as t, jsxs as o } from "react/jsx-runtime";
|
2
|
+
import { memo as a } from "react";
|
2
3
|
import c from "../ui/layout/flex-view.js";
|
3
4
|
import i from "../ui/text/text.js";
|
4
|
-
const l = ({ label:
|
5
|
-
/* @__PURE__ */ t(c, { $background: "BLACK_T_60", $width: "fit-content", $gutterX: 0.25, children: /* @__PURE__ */ t(i, { $color: "WHITE", $renderAs: "ac4-black", children:
|
6
|
-
/* @__PURE__ */ t(i, { $renderAs: "ac4-black", children:
|
7
|
-
] }),
|
8
|
-
cardHeader:
|
9
|
-
nodeType:
|
5
|
+
const l = ({ label: r, title: e }) => /* @__PURE__ */ o(c, { children: [
|
6
|
+
/* @__PURE__ */ t(c, { $background: "BLACK_T_60", $width: "fit-content", $gutterX: 0.25, children: /* @__PURE__ */ t(i, { $color: "WHITE", $renderAs: "ac4-black", children: r }) }),
|
7
|
+
/* @__PURE__ */ t(i, { $renderAs: "ac4-black", children: e })
|
8
|
+
] }), m = ({
|
9
|
+
cardHeader: r,
|
10
|
+
nodeType: e,
|
10
11
|
courseType: n
|
11
|
-
}) =>
|
12
|
+
}) => e === "MASTERY" ? /* @__PURE__ */ t(l, { label: "Smart", title: "Practice" }) : n === "REMEDIAL" ? /* @__PURE__ */ t(l, { label: "EXTRA", title: r }) : n === "EXAM" ? /* @__PURE__ */ t(l, { label: "CUSTOM", title: r }) : /* @__PURE__ */ t(i, { $renderAs: "ac4-black", children: r }), A = a(m);
|
12
13
|
export {
|
13
|
-
|
14
|
+
A as default
|
14
15
|
};
|
15
16
|
//# sourceMappingURL=card-title.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"card-title.js","sources":["../../../src/features/homework/card-title.tsx"],"sourcesContent":["import type { TCourseType, TNodeTypes } from '../chapters-v2/comps/node-card/node-card-types';\n\nimport FlexView from '../ui/layout/flex-view';\nimport Text from '../ui/text/text';\n\nconst LabelledTitle = ({ label, title }: { label: string; title: string }) => (\n <FlexView>\n <FlexView $background=\"BLACK_T_60\" $width=\"fit-content\" $gutterX={0.25}>\n <Text $color=\"WHITE\" $renderAs=\"ac4-black\">\n {label}\n </Text>\n </FlexView>\n <Text $renderAs=\"ac4-black\">{title}</Text>\n </FlexView>\n);\n\nconst CardTitle = ({\n cardHeader,\n nodeType,\n courseType,\n}: {\n cardHeader: string;\n nodeType: TNodeTypes;\n courseType: TCourseType;\n}) => {\n if (nodeType === 'MASTERY') {\n return <LabelledTitle label=\"Smart\" title=\"Practice\" />;\n }\n\n if (courseType === 'REMEDIAL') {\n return <LabelledTitle label=\"EXTRA\" title={cardHeader} />;\n }\n\n if (courseType === 'EXAM') {\n return <LabelledTitle label=\"CUSTOM\" title={cardHeader} />;\n }\n\n return <Text $renderAs=\"ac4-black\">{cardHeader}</Text>;\n};\n\nexport default CardTitle;\n"],"names":["LabelledTitle","label","title","FlexView","jsx","Text","CardTitle","cardHeader","nodeType","courseType"],"mappings":"
|
1
|
+
{"version":3,"file":"card-title.js","sources":["../../../src/features/homework/card-title.tsx"],"sourcesContent":["import type { TCourseType, TNodeTypes } from '../chapters-v2/comps/node-card/node-card-types';\n\nimport { memo } from 'react';\n\nimport FlexView from '../ui/layout/flex-view';\nimport Text from '../ui/text/text';\n\nconst LabelledTitle = ({ label, title }: { label: string; title: string }) => (\n <FlexView>\n <FlexView $background=\"BLACK_T_60\" $width=\"fit-content\" $gutterX={0.25}>\n <Text $color=\"WHITE\" $renderAs=\"ac4-black\">\n {label}\n </Text>\n </FlexView>\n <Text $renderAs=\"ac4-black\">{title}</Text>\n </FlexView>\n);\n\nconst CardTitle = ({\n cardHeader,\n nodeType,\n courseType,\n}: {\n cardHeader: string;\n nodeType: TNodeTypes;\n courseType: TCourseType;\n}) => {\n if (nodeType === 'MASTERY') {\n return <LabelledTitle label=\"Smart\" title=\"Practice\" />;\n }\n\n if (courseType === 'REMEDIAL') {\n return <LabelledTitle label=\"EXTRA\" title={cardHeader} />;\n }\n\n if (courseType === 'EXAM') {\n return <LabelledTitle label=\"CUSTOM\" title={cardHeader} />;\n }\n\n return <Text $renderAs=\"ac4-black\">{cardHeader}</Text>;\n};\n\nexport default memo(CardTitle);\n"],"names":["LabelledTitle","label","title","FlexView","jsx","Text","CardTitle","cardHeader","nodeType","courseType","CardTitle$1","memo"],"mappings":";;;;AAOA,MAAMA,IAAgB,CAAC,EAAE,OAAAC,GAAO,OAAAC,EAAM,wBACnCC,GACC,EAAA,UAAA;AAAA,EAAA,gBAAAC,EAACD,GAAS,EAAA,aAAY,cAAa,QAAO,eAAc,UAAU,MAChE,UAAC,gBAAAC,EAAAC,GAAA,EAAK,QAAO,SAAQ,WAAU,aAC5B,YACH,CAAA,GACF;AAAA,EACC,gBAAAD,EAAAC,GAAA,EAAK,WAAU,aAAa,UAAMH,GAAA;AAAA,EACrC,CAAA,GAGII,IAAY,CAAC;AAAA,EACjB,YAAAC;AAAA,EACA,UAAAC;AAAA,EACA,YAAAC;AACF,MAKMD,MAAa,YACP,gBAAAJ,EAAAJ,GAAA,EAAc,OAAM,SAAQ,OAAM,WAAW,CAAA,IAGnDS,MAAe,aACT,gBAAAL,EAAAJ,GAAA,EAAc,OAAM,SAAQ,OAAOO,EAAY,CAAA,IAGrDE,MAAe,SACT,gBAAAL,EAAAJ,GAAA,EAAc,OAAM,UAAS,OAAOO,EAAY,CAAA,IAGlD,gBAAAH,EAAAC,GAAA,EAAK,WAAU,aAAa,UAAWE,EAAA,CAAA,GAGlCG,IAAAC,EAAKL,CAAS;"}
|
@@ -1,49 +1,51 @@
|
|
1
1
|
import { jsxs as i, jsx as e } from "react/jsx-runtime";
|
2
|
-
import { useState as
|
2
|
+
import { memo as X, useState as N, useRef as p, useCallback as u, useLayoutEffect as v } from "react";
|
3
3
|
import B from "../../assets/line-icons/icons/closed-eye.js";
|
4
4
|
import R from "../chapters-v2/comps/node-card/node-card-tags.js";
|
5
|
-
import { getNodeTypeBasedBgImage as
|
5
|
+
import { getNodeTypeBasedBgImage as L } from "../chapters-v2/utils/index.js";
|
6
6
|
import { getNodeCardBasedIcon as O } from "../chapters-v2/utils/node-card-utils.js";
|
7
|
-
import
|
7
|
+
import g from "../ui/arrow-tooltip/arrow-tooltip.js";
|
8
8
|
import r from "../ui/layout/flex-view.js";
|
9
|
-
import
|
10
|
-
import
|
11
|
-
import
|
12
|
-
import { CardWrapper as j, IconWrapper as G, BannerImageWrapper as M, BannerImage as
|
13
|
-
const
|
14
|
-
header:
|
9
|
+
import S from "../ui/lottie-animation/lottie-animation.js";
|
10
|
+
import W from "./card-title.js";
|
11
|
+
import D from "./node-progress.js";
|
12
|
+
import { CardWrapper as j, IconWrapper as G, BannerImageWrapper as M, BannerImage as V, HeaderText as z, SubHeaderText as U } from "./styles.js";
|
13
|
+
const F = { renderer: "canvas", autoplay: !1 }, K = ({
|
14
|
+
header: d,
|
15
15
|
isInQueue: h,
|
16
|
-
nodeData:
|
17
|
-
studentContainerRef:
|
18
|
-
subHeader:
|
19
|
-
userType:
|
16
|
+
nodeData: $,
|
17
|
+
studentContainerRef: f,
|
18
|
+
subHeader: T,
|
19
|
+
userType: w
|
20
20
|
}) => {
|
21
21
|
const {
|
22
22
|
node_type: o,
|
23
23
|
state: I,
|
24
|
-
accuracy:
|
25
|
-
due_date_ts:
|
26
|
-
image_url:
|
27
|
-
image_hue:
|
28
|
-
card_header:
|
29
|
-
unlocked_on_ts:
|
24
|
+
accuracy: b,
|
25
|
+
due_date_ts: a,
|
26
|
+
image_url: c,
|
27
|
+
image_hue: l,
|
28
|
+
card_header: y = "",
|
29
|
+
unlocked_on_ts: m,
|
30
30
|
course_type: _
|
31
|
-
} =
|
32
|
-
|
33
|
-
|
34
|
-
|
31
|
+
} = $, [x, C] = N(!1), n = p(null), H = L(o), s = p(null), { lottie: k } = O(o), A = u(() => {
|
32
|
+
var t;
|
33
|
+
(t = s.current) == null || t.play();
|
34
|
+
}, []), E = u(() => {
|
35
|
+
var t;
|
36
|
+
(t = s.current) == null || t.stop();
|
35
37
|
}, []);
|
36
|
-
return
|
37
|
-
|
38
|
-
}, [
|
38
|
+
return v(() => {
|
39
|
+
n.current && n.current.scrollHeight > n.current.clientHeight && C(!0);
|
40
|
+
}, []), /* @__PURE__ */ i(
|
39
41
|
r,
|
40
42
|
{
|
41
|
-
ref:
|
43
|
+
ref: f,
|
42
44
|
$widthX: 12.38,
|
43
45
|
$position: "relative",
|
44
|
-
$background: `${
|
45
|
-
onMouseEnter:
|
46
|
-
onMouseLeave:
|
46
|
+
$background: `${l || "ORANGE"}_2`,
|
47
|
+
onMouseEnter: A,
|
48
|
+
onMouseLeave: E,
|
47
49
|
children: [
|
48
50
|
/* @__PURE__ */ i(
|
49
51
|
j,
|
@@ -52,7 +54,7 @@ const ie = ({
|
|
52
54
|
$alignItems: "center",
|
53
55
|
$width: "100%",
|
54
56
|
$heightX: 3.5,
|
55
|
-
$bgImage:
|
57
|
+
$bgImage: H,
|
56
58
|
$gutterX: 0.78125,
|
57
59
|
$flexGap: 8.5,
|
58
60
|
$position: "relative",
|
@@ -67,12 +69,12 @@ const ie = ({
|
|
67
69
|
$position: "relative",
|
68
70
|
$alignItems: "center",
|
69
71
|
$justifyContent: "center",
|
70
|
-
children:
|
72
|
+
children: /* @__PURE__ */ e(S, { src: k, ref: s, settings: F })
|
71
73
|
}
|
72
74
|
),
|
73
|
-
/* @__PURE__ */ e(
|
75
|
+
/* @__PURE__ */ e(W, { cardHeader: y, nodeType: o, courseType: _ }),
|
74
76
|
h && /* @__PURE__ */ e(
|
75
|
-
|
77
|
+
g,
|
76
78
|
{
|
77
79
|
renderAs: "primary",
|
78
80
|
tooltipItem: "Not visible to student",
|
@@ -81,7 +83,7 @@ const ie = ({
|
|
81
83
|
children: /* @__PURE__ */ e(B, {})
|
82
84
|
}
|
83
85
|
),
|
84
|
-
!!
|
86
|
+
!!c && /* @__PURE__ */ e(M, { children: /* @__PURE__ */ e(V, { src: c, alt: "Chapter image" }) })
|
85
87
|
]
|
86
88
|
}
|
87
89
|
),
|
@@ -90,31 +92,31 @@ const ie = ({
|
|
90
92
|
{
|
91
93
|
nodeType: o,
|
92
94
|
state: I,
|
93
|
-
accuracy:
|
94
|
-
dueDateTs:
|
95
|
-
isStudent:
|
95
|
+
accuracy: b,
|
96
|
+
dueDateTs: a,
|
97
|
+
isStudent: w === "STUDENT"
|
96
98
|
}
|
97
99
|
),
|
98
|
-
|
99
|
-
|
100
|
+
a && m && /* @__PURE__ */ e(
|
101
|
+
D,
|
100
102
|
{
|
101
|
-
dueDate:
|
102
|
-
unlockedOn:
|
103
|
-
progressBg: `${
|
103
|
+
dueDate: a * 1e3,
|
104
|
+
unlockedOn: m * 1e3,
|
105
|
+
progressBg: `${l || "ORANGE"}_4`
|
104
106
|
}
|
105
107
|
),
|
106
108
|
/* @__PURE__ */ i(r, { $gutterX: 0.75, $gapX: 1, $flexRowGapX: 0.5, $background: "WHITE", children: [
|
107
109
|
/* @__PURE__ */ e(
|
108
|
-
|
110
|
+
g,
|
109
111
|
{
|
110
112
|
renderAs: "primary",
|
111
113
|
position: "bottom",
|
112
|
-
tooltipItem:
|
114
|
+
tooltipItem: d,
|
113
115
|
width: 300,
|
114
116
|
hidden: !x,
|
115
117
|
parentWidth: "auto",
|
116
118
|
zIndex: 6,
|
117
|
-
children: /* @__PURE__ */ e(r, { $heightX: 2.5, children: /* @__PURE__ */ e(
|
119
|
+
children: /* @__PURE__ */ e(r, { $heightX: 2.5, children: /* @__PURE__ */ e(z, { ref: n, $renderAs: "ab3", children: d }) })
|
118
120
|
}
|
119
121
|
),
|
120
122
|
/* @__PURE__ */ i(
|
@@ -125,7 +127,7 @@ const ie = ({
|
|
125
127
|
$alignItems: "center",
|
126
128
|
$justifyContent: "space-between",
|
127
129
|
children: [
|
128
|
-
/* @__PURE__ */ e(
|
130
|
+
/* @__PURE__ */ e(U, { $renderAs: "ub3", $color: "BLACK_T_60", children: T }),
|
129
131
|
/* @__PURE__ */ e(r, { $width: 32 })
|
130
132
|
]
|
131
133
|
}
|
@@ -134,8 +136,8 @@ const ie = ({
|
|
134
136
|
]
|
135
137
|
}
|
136
138
|
);
|
137
|
-
};
|
139
|
+
}, ae = X(K);
|
138
140
|
export {
|
139
|
-
|
141
|
+
ae as default
|
140
142
|
};
|
141
143
|
//# sourceMappingURL=homework-card-view.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"homework-card-view.js","sources":["../../../src/features/homework/homework-card-view.tsx"],"sourcesContent":["import type { INodeDataProps } from '../chapters-v2/comps/node-card/node-card-types';\nimport type { TUserTypes } from '../ui/types';\nimport type { FC } from 'react';\n\nimport { useCallback, useLayoutEffect, useRef, useState } from 'react';\n\nimport ClosedEyeIcon from '../../assets/line-icons/icons/closed-eye';\nimport NodeCardTags from '../chapters-v2/comps/node-card/node-card-tags';\nimport { getNodeTypeBasedBgImage } from '../chapters-v2/utils';\nimport { getNodeCardBasedIcon } from '../chapters-v2/utils/node-card-utils';\nimport ArrowTooltip from '../ui/arrow-tooltip/arrow-tooltip';\nimport FlexView from '../ui/layout/flex-view';\nimport LottieAnimation from '../ui/lottie-animation/lottie-animation';\nimport CardTitle from './card-title';\nimport NodeProgress from './node-progress';\nimport * as Styled from './styles';\n\ninterface IHomeworkCardViewProps {\n header: string;\n isInQueue?: boolean;\n nodeData: INodeDataProps;\n studentContainerRef: React.RefObject<HTMLDivElement>;\n subHeader: string;\n userType: TUserTypes;\n}\n\nconst HomeworkView: FC<IHomeworkCardViewProps> = ({\n header,\n isInQueue,\n nodeData,\n studentContainerRef,\n subHeader,\n userType,\n}) => {\n const {\n node_type: nodeType,\n state,\n accuracy,\n due_date_ts: dueDateTs,\n image_url: imageUrl,\n image_hue: imageHue,\n card_header: cardHeader = '',\n unlocked_on_ts: unlockedOnTs,\n course_type: courseType,\n } = nodeData;\n const [showTitleTooltip, setShowTitleTooltip] = useState(false);\n const titleTextRef = useRef<HTMLDivElement>(null);\n const
|
1
|
+
{"version":3,"file":"homework-card-view.js","sources":["../../../src/features/homework/homework-card-view.tsx"],"sourcesContent":["import type { INodeDataProps } from '../chapters-v2/comps/node-card/node-card-types';\nimport type { ILottieAnimationRef } from '../ui/lottie-animation/types';\nimport type { TUserTypes } from '../ui/types';\nimport type { FC } from 'react';\n\nimport { memo, useCallback, useLayoutEffect, useRef, useState } from 'react';\n\nimport ClosedEyeIcon from '../../assets/line-icons/icons/closed-eye';\nimport NodeCardTags from '../chapters-v2/comps/node-card/node-card-tags';\nimport { getNodeTypeBasedBgImage } from '../chapters-v2/utils';\nimport { getNodeCardBasedIcon } from '../chapters-v2/utils/node-card-utils';\nimport ArrowTooltip from '../ui/arrow-tooltip/arrow-tooltip';\nimport FlexView from '../ui/layout/flex-view';\nimport LottieAnimation from '../ui/lottie-animation/lottie-animation';\nimport CardTitle from './card-title';\nimport NodeProgress from './node-progress';\nimport * as Styled from './styles';\n\nconst renderSettings = { renderer: 'canvas', autoplay: false };\n\ninterface IHomeworkCardViewProps {\n header: string;\n isInQueue?: boolean;\n nodeData: INodeDataProps;\n studentContainerRef: React.RefObject<HTMLDivElement>;\n subHeader: string;\n userType: TUserTypes;\n}\n\nconst HomeworkView: FC<IHomeworkCardViewProps> = ({\n header,\n isInQueue,\n nodeData,\n studentContainerRef,\n subHeader,\n userType,\n}) => {\n const {\n node_type: nodeType,\n state,\n accuracy,\n due_date_ts: dueDateTs,\n image_url: imageUrl,\n image_hue: imageHue,\n card_header: cardHeader = '',\n unlocked_on_ts: unlockedOnTs,\n course_type: courseType,\n } = nodeData;\n const [showTitleTooltip, setShowTitleTooltip] = useState(false);\n const titleTextRef = useRef<HTMLDivElement>(null);\n const bgImage = getNodeTypeBasedBgImage(nodeType);\n const animationRef = useRef<ILottieAnimationRef | null>(null);\n const { lottie: nodeCardLottie } = getNodeCardBasedIcon(nodeType);\n\n const handleOnMouseEnter = useCallback(() => {\n animationRef.current?.play();\n }, []);\n\n const handleOnMouseLeave = useCallback(() => {\n animationRef.current?.stop();\n }, []);\n\n useLayoutEffect(() => {\n if (\n titleTextRef.current &&\n titleTextRef.current.scrollHeight > titleTextRef.current.clientHeight\n ) {\n setShowTitleTooltip(true);\n }\n }, []);\n\n return (\n <FlexView\n ref={studentContainerRef}\n $widthX={12.38}\n $position=\"relative\"\n $background={`${imageHue || 'ORANGE'}_2`}\n onMouseEnter={handleOnMouseEnter}\n onMouseLeave={handleOnMouseLeave}\n >\n <Styled.CardWrapper\n $flexDirection=\"row\"\n $alignItems=\"center\"\n $width=\"100%\"\n $heightX={3.5}\n $bgImage={bgImage}\n $gutterX={0.78125}\n $flexGap={8.5}\n $position=\"relative\"\n >\n <Styled.IconWrapper\n $width={31}\n $height={31}\n $borderRadiusX={2}\n $background=\"WHITE_1\"\n $position=\"relative\"\n $alignItems=\"center\"\n $justifyContent=\"center\"\n >\n <LottieAnimation src={nodeCardLottie} ref={animationRef} settings={renderSettings} />\n </Styled.IconWrapper>\n <CardTitle cardHeader={cardHeader} nodeType={nodeType} courseType={courseType} />\n {isInQueue && (\n <ArrowTooltip\n renderAs=\"primary\"\n tooltipItem=\"Not visible to student\"\n position=\"bottom\"\n zIndex={6}\n >\n <ClosedEyeIcon />\n </ArrowTooltip>\n )}\n {!!imageUrl && (\n <Styled.BannerImageWrapper>\n <Styled.BannerImage src={imageUrl} alt=\"Chapter image\" />\n </Styled.BannerImageWrapper>\n )}\n </Styled.CardWrapper>\n <NodeCardTags\n nodeType={nodeType}\n state={state}\n accuracy={accuracy}\n dueDateTs={dueDateTs}\n isStudent={userType === 'STUDENT'}\n />\n {dueDateTs && unlockedOnTs && (\n <NodeProgress\n dueDate={dueDateTs * 1000}\n unlockedOn={unlockedOnTs * 1000}\n progressBg={`${imageHue || 'ORANGE'}_4`}\n />\n )}\n <FlexView $gutterX={0.75} $gapX={1} $flexRowGapX={0.5} $background=\"WHITE\">\n <ArrowTooltip\n renderAs=\"primary\"\n position=\"bottom\"\n tooltipItem={header}\n width={300}\n hidden={!showTitleTooltip}\n parentWidth=\"auto\"\n zIndex={6}\n >\n <FlexView $heightX={2.5}>\n <Styled.HeaderText ref={titleTextRef} $renderAs=\"ab3\">\n {header}\n </Styled.HeaderText>\n </FlexView>\n </ArrowTooltip>\n <FlexView\n $flexDirection=\"row\"\n $heightX={1.25}\n $alignItems=\"center\"\n $justifyContent=\"space-between\"\n >\n <Styled.SubHeaderText $renderAs=\"ub3\" $color=\"BLACK_T_60\">\n {subHeader}\n </Styled.SubHeaderText>\n <FlexView $width={32} />\n </FlexView>\n </FlexView>\n </FlexView>\n );\n};\n\nexport default memo(HomeworkView);\n"],"names":["renderSettings","HomeworkView","header","isInQueue","nodeData","studentContainerRef","subHeader","userType","nodeType","state","accuracy","dueDateTs","imageUrl","imageHue","cardHeader","unlockedOnTs","courseType","showTitleTooltip","setShowTitleTooltip","useState","titleTextRef","useRef","bgImage","getNodeTypeBasedBgImage","animationRef","nodeCardLottie","getNodeCardBasedIcon","handleOnMouseEnter","useCallback","_a","handleOnMouseLeave","useLayoutEffect","jsxs","FlexView","Styled.CardWrapper","jsx","Styled.IconWrapper","LottieAnimation","CardTitle","ArrowTooltip","ClosedEyeIcon","Styled.BannerImageWrapper","Styled.BannerImage","NodeCardTags","NodeProgress","Styled.HeaderText","Styled.SubHeaderText","HomeworkView$1","memo"],"mappings":";;;;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