@cuemath/leap 3.0.22 → 3.0.23
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/line-icons/icons/lock3.js +34 -0
- package/dist/assets/line-icons/icons/lock3.js.map +1 -0
- package/dist/assets/line-icons/icons/unlock2.js +34 -0
- package/dist/assets/line-icons/icons/unlock2.js.map +1 -0
- package/dist/features/chapters-v2/chapter-details/block-sections/block-section-view.js +26 -22
- 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 +31 -55
- 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 +1 -1
- 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 +58 -54
- 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 +1 -0
- package/dist/features/chapters-v2/comps/node-card/node-card-styled.js.map +1 -1
- package/dist/features/chapters-v2/comps/node-card/teacher-actions/teacher-actions.js +128 -107
- package/dist/features/chapters-v2/comps/node-card/teacher-actions/teacher-actions.js.map +1 -1
- package/dist/features/chapters-v2/constants/node-constants.js +3 -1
- package/dist/features/chapters-v2/constants/node-constants.js.map +1 -1
- package/dist/features/worksheet/worksheet-preview/api/get-preview-worksheet.js +17 -10
- package/dist/features/worksheet/worksheet-preview/api/get-preview-worksheet.js.map +1 -1
- package/dist/index.d.ts +6 -0
- package/dist/index.js +475 -471
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"chapter-details.js","sources":["../../../../src/features/chapters-v2/chapter-details/chapter-details.tsx"],"sourcesContent":["import type { IChapterDetails } from './chapter-details-types';\nimport type { FC } from 'react';\n\nimport { memo, useCallback, useEffect } from 'react';\n\nimport { ILLUSTRATIONS } from '../../../assets/illustrations/illustrations';\nimport Back2Icon from '../../../assets/line-icons/icons/back2';\nimport { useJourney } from '../../journey/use-journey/use-journey';\nimport Button from '../../ui/buttons/button/button';\nimport IconButton from '../../ui/buttons/icon-button/icon-button';\nimport FlexView from '../../ui/layout/flex-view';\nimport AppLoader from '../../ui/loader/app-loader/app-loader';\nimport Text from '../../ui/text/text';\nimport { useGetChapterDetails } from '../api/chapter';\nimport BlockSections from './block-sections/block-sections';\nimport ChapterBanner from './chapter-banner/chapter-banner';\nimport * as Styled from './chapter-details-styled';\n\nconst ChapterDetails: FC<IChapterDetails> = memo(props => {\n const {\n userChapterId,\n studentId,\n userType,\n onBlockSkipUnskip,\n onNodeAttempt,\n onNodeAssignAsHomework,\n onNodeMarkAsDone,\n onNodeReattempt,\n onNodeReview,\n onNodeView,\n onExit,\n startChapterPageJourney,\n chapterPageRef,\n bannerRef,\n coreBlocksRef,\n canStartJourney,\n } = props;\n const { isJourneyActive } = useJourney();\n const {\n get: getChapterDetails,\n data: chapterDetails,\n isProcessing,\n isProcessingFailed,\n isStale,\n } = useGetChapterDetails();\n\n const fetchChapterDetails = useCallback(() => {\n getChapterDetails(userChapterId, undefined, { studentId });\n }, [getChapterDetails, userChapterId, studentId]);\n\n useEffect(() => {\n fetchChapterDetails();\n }, [fetchChapterDetails]);\n\n useEffect(() => {\n if (chapterDetails && canStartJourney && !isJourneyActive && startChapterPageJourney) {\n startChapterPageJourney({\n chapterDetails: chapterDetails,\n userChapterId,\n studentId,\n userType,\n });\n }\n }, [\n canStartJourney,\n chapterDetails,\n isJourneyActive,\n startChapterPageJourney,\n studentId,\n userChapterId,\n userType,\n ]);\n\n useEffect(() => {\n if (!isProcessing && isStale) {\n fetchChapterDetails();\n }\n }, [fetchChapterDetails, isProcessing, isStale]);\n\n if (isProcessingFailed) {\n return (\n <FlexView $flexGapX={1.5} $height=\"100vh\" $justifyContent=\"center\" $alignItems=\"center\">\n <Text $renderAs=\"h6\">Oops! Something went wrong. Please try again later.</Text>\n <Button\n widthX={14}\n size=\"small\"\n shape=\"square\"\n renderAs=\"primary\"\n label=\"Try again\"\n onClick={fetchChapterDetails}\n />\n </FlexView>\n );\n }\n\n if (!chapterDetails && isProcessing) {\n return <AppLoader height=\"80vh\" />;\n }\n\n return (\n <Styled.ContentWrapper\n ref={chapterPageRef}\n $widthX={50}\n $disablePointerEvents={isProcessing}\n $justifyContent=\"center\"\n $alignItems=\"center\"\n >\n {userType === 'TEACHER' && (\n <Styled.BackButtonContainer $height=\"100%\">\n <Styled.BackButtonWrapper>\n <IconButton\n Icon={Back2Icon}\n renderAs=\"secondary-gray\"\n analyticsLabel=\"chapter_page_exit\"\n size=\"xsmall\"\n onClick={onExit}\n />\n </Styled.BackButtonWrapper>\n </Styled.BackButtonContainer>\n )}\n\n {isProcessing && (\n <Styled.LoaderWrapper>\n <img src={ILLUSTRATIONS.LOADER_1} alt=\"loader\" />\n </Styled.LoaderWrapper>\n )}\n\n {chapterDetails && (\n <>\n <ChapterBanner\n title={chapterDetails.name}\n imageHue={chapterDetails.image_hue}\n imageUrl={chapterDetails.image_url}\n progressStats={chapterDetails?.progress_stat}\n bannerRef={bannerRef}\n />\n <BlockSections\n imageHue={chapterDetails.image_hue}\n userType={userType}\n blocks={chapterDetails.blocks}\n onBlockSkipUnskip={onBlockSkipUnskip}\n onNodeAttempt={onNodeAttempt}\n onNodeAssignAsHomework={onNodeAssignAsHomework}\n onNodeMarkAsDone={onNodeMarkAsDone}\n onNodeReattempt={onNodeReattempt}\n onNodeReview={onNodeReview}\n onNodeView={onNodeView}\n coreBlocksRef={coreBlocksRef}\n />\n </>\n )}\n </Styled.ContentWrapper>\n );\n});\n\nexport default ChapterDetails;\n"],"names":["ChapterDetails","memo","props","userChapterId","studentId","userType","onBlockSkipUnskip","onNodeAttempt","onNodeAssignAsHomework","onNodeMarkAsDone","onNodeReattempt","onNodeReview","onNodeView","onExit","startChapterPageJourney","chapterPageRef","bannerRef","coreBlocksRef","canStartJourney","isJourneyActive","useJourney","getChapterDetails","chapterDetails","isProcessing","isProcessingFailed","isStale","useGetChapterDetails","fetchChapterDetails","useCallback","useEffect","jsxs","FlexView","jsx","Text","Button","AppLoader","Styled.ContentWrapper","Styled.BackButtonContainer","Styled.BackButtonWrapper","IconButton","Back2Icon","Styled.LoaderWrapper","ILLUSTRATIONS","Fragment","ChapterBanner","BlockSections","ChapterDetails$1"],"mappings":";;;;;;;;;;;;;;AAkBA,MAAMA,IAAsCC,EAAK,CAASC,MAAA;AAClD,QAAA;AAAA,IACJ,eAAAC;AAAA,IACA,WAAAC;AAAA,IACA,UAAAC;AAAA,IACA,mBAAAC;AAAA,IACA,eAAAC;AAAA,IACA,wBAAAC;AAAA,IACA,kBAAAC;AAAA,IACA,iBAAAC;AAAA,IACA,cAAAC;AAAA,IACA,YAAAC;AAAA,IACA,QAAAC;AAAA,IACA,yBAAAC;AAAA,IACA,gBAAAC;AAAA,IACA,WAAAC;AAAA,IACA,eAAAC;AAAA,IACA,iBAAAC;AAAA,EACE,
|
1
|
+
{"version":3,"file":"chapter-details.js","sources":["../../../../src/features/chapters-v2/chapter-details/chapter-details.tsx"],"sourcesContent":["import type { IChapterDetails } from './chapter-details-types';\nimport type { FC } from 'react';\n\nimport { memo, useCallback, useEffect } from 'react';\n\nimport { ILLUSTRATIONS } from '../../../assets/illustrations/illustrations';\nimport Back2Icon from '../../../assets/line-icons/icons/back2';\nimport { useJourney } from '../../journey/use-journey/use-journey';\nimport Button from '../../ui/buttons/button/button';\nimport IconButton from '../../ui/buttons/icon-button/icon-button';\nimport FlexView from '../../ui/layout/flex-view';\nimport AppLoader from '../../ui/loader/app-loader/app-loader';\nimport Text from '../../ui/text/text';\nimport { useGetChapterDetails } from '../api/chapter';\nimport BlockSections from './block-sections/block-sections';\nimport ChapterBanner from './chapter-banner/chapter-banner';\nimport * as Styled from './chapter-details-styled';\n\nconst ChapterDetails: FC<IChapterDetails> = memo(props => {\n const {\n userChapterId,\n studentId,\n userType,\n onBlockSkipUnskip,\n onNodeAttempt,\n onNodeAssignAsHomework,\n onNodeMarkAsDone,\n onNodeReattempt,\n onNodeReview,\n onNodeView,\n onExit,\n onNodeUnassign,\n onNodeUnlock,\n startChapterPageJourney,\n chapterPageRef,\n bannerRef,\n coreBlocksRef,\n canStartJourney,\n } = props;\n const { isJourneyActive } = useJourney();\n const {\n get: getChapterDetails,\n data: chapterDetails,\n isProcessing,\n isProcessingFailed,\n isStale,\n } = useGetChapterDetails();\n\n const fetchChapterDetails = useCallback(() => {\n getChapterDetails(userChapterId, undefined, { studentId });\n }, [getChapterDetails, userChapterId, studentId]);\n\n useEffect(() => {\n fetchChapterDetails();\n }, [fetchChapterDetails]);\n\n useEffect(() => {\n if (chapterDetails && canStartJourney && !isJourneyActive && startChapterPageJourney) {\n startChapterPageJourney({\n chapterDetails: chapterDetails,\n userChapterId,\n studentId,\n userType,\n });\n }\n }, [\n canStartJourney,\n chapterDetails,\n isJourneyActive,\n startChapterPageJourney,\n studentId,\n userChapterId,\n userType,\n ]);\n\n useEffect(() => {\n if (!isProcessing && isStale) {\n fetchChapterDetails();\n }\n }, [fetchChapterDetails, isProcessing, isStale]);\n\n if (isProcessingFailed) {\n return (\n <FlexView $flexGapX={1.5} $height=\"100vh\" $justifyContent=\"center\" $alignItems=\"center\">\n <Text $renderAs=\"h6\">Oops! Something went wrong. Please try again later.</Text>\n <Button\n widthX={14}\n size=\"small\"\n shape=\"square\"\n renderAs=\"primary\"\n label=\"Try again\"\n onClick={fetchChapterDetails}\n />\n </FlexView>\n );\n }\n\n if (!chapterDetails && isProcessing) {\n return <AppLoader height=\"80vh\" />;\n }\n\n return (\n <Styled.ContentWrapper\n ref={chapterPageRef}\n $widthX={50}\n $disablePointerEvents={isProcessing}\n $justifyContent=\"center\"\n $alignItems=\"center\"\n >\n {userType === 'TEACHER' && (\n <Styled.BackButtonContainer $height=\"100%\">\n <Styled.BackButtonWrapper>\n <IconButton\n Icon={Back2Icon}\n renderAs=\"secondary-gray\"\n analyticsLabel=\"chapter_page_exit\"\n size=\"xsmall\"\n onClick={onExit}\n />\n </Styled.BackButtonWrapper>\n </Styled.BackButtonContainer>\n )}\n\n {isProcessing && (\n <Styled.LoaderWrapper>\n <img src={ILLUSTRATIONS.LOADER_1} alt=\"loader\" />\n </Styled.LoaderWrapper>\n )}\n\n {chapterDetails && (\n <>\n <ChapterBanner\n title={chapterDetails.name}\n imageHue={chapterDetails.image_hue}\n imageUrl={chapterDetails.image_url}\n progressStats={chapterDetails?.progress_stat}\n bannerRef={bannerRef}\n />\n <BlockSections\n imageHue={chapterDetails.image_hue}\n userType={userType}\n blocks={chapterDetails.blocks}\n onBlockSkipUnskip={onBlockSkipUnskip}\n onNodeAttempt={onNodeAttempt}\n onNodeAssignAsHomework={onNodeAssignAsHomework}\n onNodeMarkAsDone={onNodeMarkAsDone}\n onNodeReattempt={onNodeReattempt}\n onNodeReview={onNodeReview}\n onNodeView={onNodeView}\n coreBlocksRef={coreBlocksRef}\n onNodeUnassign={onNodeUnassign}\n onNodeUnlock={onNodeUnlock}\n />\n </>\n )}\n </Styled.ContentWrapper>\n );\n});\n\nexport default ChapterDetails;\n"],"names":["ChapterDetails","memo","props","userChapterId","studentId","userType","onBlockSkipUnskip","onNodeAttempt","onNodeAssignAsHomework","onNodeMarkAsDone","onNodeReattempt","onNodeReview","onNodeView","onExit","onNodeUnassign","onNodeUnlock","startChapterPageJourney","chapterPageRef","bannerRef","coreBlocksRef","canStartJourney","isJourneyActive","useJourney","getChapterDetails","chapterDetails","isProcessing","isProcessingFailed","isStale","useGetChapterDetails","fetchChapterDetails","useCallback","useEffect","jsxs","FlexView","jsx","Text","Button","AppLoader","Styled.ContentWrapper","Styled.BackButtonContainer","Styled.BackButtonWrapper","IconButton","Back2Icon","Styled.LoaderWrapper","ILLUSTRATIONS","Fragment","ChapterBanner","BlockSections","ChapterDetails$1"],"mappings":";;;;;;;;;;;;;;AAkBA,MAAM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,cACA,QAAQmB,EAAe;AAAA,cACvB,mBAAAlB;AAAA,cACA,eAAAC;AAAA,cACA,wBAAAC;AAAA,cACA,kBAAAC;AAAA,cACA,iBAAAC;AAAA,cACA,cAAAC;AAAA,cACA,YAAAC;AAAA,cACA,eAAAO;AAAA,cACA,gBAAAL;AAAA,cACA,cAAAC;AAAA,YAAA;AAAA,UACF;AAAA,QAAA,GACF;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAIR,CAAC,GAEDiC,KAAehD;"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"node-card-styled.js","sources":["../../../../../src/features/chapters-v2/comps/node-card/node-card-styled.tsx"],"sourcesContent":["import styled from 'styled-components';\n\nimport ImportantIcon from '../../../../assets/line-icons/icons/important';\nimport Lock2Icon from '../../../../assets/line-icons/icons/lock2';\nimport FlexView from '../../../ui/layout/flex-view';\nimport Text from '../../../ui/text/text';\n\ninterface INodeCardContainer {\n $disabled: boolean;\n $isSheetLocked?: boolean;\n}\n\nconst NodeCardContainer = styled(FlexView)<INodeCardContainer>(({ theme, $disabled }) => {\n const { BLACK, BLACK_T_15, WHITE_5 } = theme.colors;\n\n return `\n cursor: ${$disabled ? 'not-allowed' : 'pointer'};\n position: relative;\n border-image: linear-gradient(to right, ${BLACK_T_15} 0%, ${BLACK_T_15} 100%);\n outline: 1px solid ${WHITE_5};\n\n .node-card-border {\n position: absolute;\n top: 0;\n left: 0;\n z-index: 2;\n width: 100%;\n height: 100%;\n pointer-events: none;\n background: transparent;\n }\n\n &:hover {\n ${\n !$disabled &&\n `\n outline: 1px solid ${BLACK};\n `\n } \n }\n `;\n});\n\nconst StyledImportantIcon = styled(ImportantIcon)(({ theme }) => {\n const { layout } = theme;\n\n return `\n width: ${layout.gutter * 0.75}px;\n height: ${layout.gutter * 0.75}px;\n position: absolute;\n top: -2.5px;\n right: -2.5px;\n `;\n});\n\ninterface INodeCardInfoWrapper {\n $bgImage: string;\n}\n\nconst NodeCardInfoWrapper = styled(FlexView)<INodeCardInfoWrapper>(({ $bgImage }) => {\n return `\n background-image: url(${$bgImage});\n\n & .context-menu {\n justify-self: flex-end;\n margin-left: auto;\n }\n `;\n});\n\nconst IconWrapper = styled(FlexView)`\n border-radius: 50%;\n`;\n\nconst NodeCardContentWrapper = styled(FlexView)(() => {\n return `\n position: relative;\n padding: 12px 8px 12px 12px;\n `;\n});\n\ninterface ISheetTagWrapper {\n $top?: number;\n $right?: number;\n}\n\nconst SheetTagWrapper = styled(FlexView)<ISheetTagWrapper>(({ $top, $right }) => {\n return `\n position: absolute;\n top: ${$top ?? 0}px;\n right: ${$right ?? 0}px;\n z-index: 3;\n`;\n});\n\nconst StyledLockIcon = styled(Lock2Icon)(({}) => {\n return `\n width: 28px;\n height: 28px;\n `;\n});\n\nconst InProgressIconWrapper = styled(FlexView)<{ $paddingRight: number; $paddingLeft: number }>(({\n theme,\n $paddingRight,\n $paddingLeft,\n}) => {\n const { BLACK_1, WHITE_1 } = theme.colors;\n\n return `\n position: absolute;\n top: -10px;\n right: -10px;\n padding: 0px;\n padding-left: ${$paddingLeft}px;\n padding-right: ${$paddingRight}px;\n background: ${BLACK_1};\n\n path {\n fill: ${WHITE_1};\n }\n `;\n});\n\nconst NodeCardTitle = styled(Text)(() => {\n return `\n display: -webkit-box;\n -webkit-box-orient: vertical;\n -webkit-line-clamp: 2;\n text-overflow: ellipsis;\n overflow: hidden;\n `;\n});\n\nconst NodeKebabMenuWrapper = styled(FlexView)(({ theme }) => {\n return `\n cursor: pointer;\n \n &:hover {\n border-radius: 50%;\n background: ${theme.colors.WHITE_5}; \n }\n `;\n});\n\ninterface INodeOptionsMenuWrapper {\n $visible: boolean;\n}\n\nconst NodeMenuOptionsWrapper = styled(FlexView)<INodeOptionsMenuWrapper>(({ theme, $visible }) => {\n return `\n cursor: pointer;\n\n position: absolute;\n z-index: 6;\n top: calc(100% + 4px);\n left: 0;\n\n transform-origin: top;\n transform: scaleY(${$visible ? 1 : 0});\n opacity: ${$visible ? 1 : 0};\n transition: transform 0.2s ease-in-out, opacity 0.2s ease-in-out;\n \n &:hover {\n border-radius: 50%;\n background: ${theme.colors.WHITE_5}; \n }\n `;\n});\n\nexport {\n NodeCardContainer,\n StyledImportantIcon,\n NodeCardInfoWrapper,\n IconWrapper,\n NodeCardContentWrapper,\n SheetTagWrapper,\n StyledLockIcon,\n InProgressIconWrapper,\n NodeCardTitle,\n NodeKebabMenuWrapper,\n NodeMenuOptionsWrapper,\n};\n"],"names":["NodeCardContainer","styled","FlexView","theme","$disabled","BLACK","BLACK_T_15","WHITE_5","StyledImportantIcon","ImportantIcon","layout","NodeCardInfoWrapper","$bgImage","IconWrapper","NodeCardContentWrapper","SheetTagWrapper","$top","$right","Lock2Icon","InProgressIconWrapper","$paddingRight","$paddingLeft","BLACK_1","WHITE_1","NodeCardTitle","Text","NodeKebabMenuWrapper","NodeMenuOptionsWrapper","$visible"],"mappings":";;;;;AAYM,MAAAA,IAAoBC,EAAOC,CAAQ,EAAsB,CAAC,EAAE,OAAAC,GAAO,WAAAC,QAAgB;AACvF,QAAM,EAAE,OAAAC,GAAO,YAAAC,GAAY,SAAAC,EAAA,IAAYJ,EAAM;AAEtC,SAAA;AAAA,cACKC,IAAY,gBAAgB,SAAS;AAAA;AAAA,8CAELE,CAAU,QAAQA,CAAU;AAAA,yBACjDC,CAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,QAexB,CAACH,KACD;AAAA,+BACuBC,CAAK;AAAA,SAE9B;AAAA;AAAA;AAGN,CAAC,GAEKG,IAAsBP,EAAOQ,CAAa,EAAE,CAAC,EAAE,OAAAN,QAAY;AACzD,QAAA,EAAE,QAAAO,EAAW,IAAAP;AAEZ,SAAA;AAAA,aACIO,EAAO,SAAS,IAAI;AAAA,cACnBA,EAAO,SAAS,IAAI;AAAA;AAAA;AAAA;AAAA;AAKlC,CAAC,GAMKC,IAAsBV,EAAOC,CAAQ,EAAwB,CAAC,EAAE,UAAAU,QAC7D;AAAA,4BACmBA,CAAQ;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,GAOnC,GAEKC,IAAcZ,EAAOC,CAAQ;AAAA;AAAA,GAI7BY,IAAyBb,EAAOC,CAAQ,EAAE,MACvC;AAAA;AAAA;AAAA,GAIR,GAOKa,IAAkBd,EAAOC,CAAQ,EAAoB,CAAC,EAAE,MAAAc,GAAM,QAAAC,QAC3D;AAAA;AAAA,SAEAD,KAAQ,CAAC;AAAA,WACPC,KAAU,CAAC;AAAA;AAAA,CAGrB;AAEsBhB,EAAOiB,CAAS,EAAE,CAAC,OACjC;AAAA;AAAA;AAAA,GAIR;AAED,MAAMC,IAAwBlB,EAAOC,CAAQ,EAAmD,CAAC;AAAA,EAC/F,OAAAC;AAAA,EACA,eAAAiB;AAAA,EACA,cAAAC;AACF,MAAM;AACJ,QAAM,EAAE,SAAAC,GAAS,SAAAC,MAAYpB,EAAM;AAE5B,SAAA;AAAA;AAAA;AAAA;AAAA;AAAA,oBAKWkB,CAAY;AAAA,qBACXD,CAAa;AAAA,kBAChBE,CAAO;AAAA;AAAA;AAAA,cAGXC,CAAO;AAAA;AAAA;AAGrB,CAAC,GAEKC,IAAgBvB,EAAOwB,CAAI,EAAE,MAC1B;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,GAOR,GAEKC,IAAuBzB,EAAOC,CAAQ,EAAE,CAAC,EAAE,OAAAC,QACxC;AAAA;AAAA;AAAA;AAAA;AAAA,
|
1
|
+
{"version":3,"file":"node-card-styled.js","sources":["../../../../../src/features/chapters-v2/comps/node-card/node-card-styled.tsx"],"sourcesContent":["import styled from 'styled-components';\n\nimport ImportantIcon from '../../../../assets/line-icons/icons/important';\nimport Lock2Icon from '../../../../assets/line-icons/icons/lock2';\nimport FlexView from '../../../ui/layout/flex-view';\nimport Text from '../../../ui/text/text';\n\ninterface INodeCardContainer {\n $disabled: boolean;\n $isSheetLocked?: boolean;\n}\n\nconst NodeCardContainer = styled(FlexView)<INodeCardContainer>(({ theme, $disabled }) => {\n const { BLACK, BLACK_T_15, WHITE_5 } = theme.colors;\n\n return `\n cursor: ${$disabled ? 'not-allowed' : 'pointer'};\n position: relative;\n border-image: linear-gradient(to right, ${BLACK_T_15} 0%, ${BLACK_T_15} 100%);\n outline: 1px solid ${WHITE_5};\n\n .node-card-border {\n position: absolute;\n top: 0;\n left: 0;\n z-index: 2;\n width: 100%;\n height: 100%;\n pointer-events: none;\n background: transparent;\n }\n\n &:hover {\n ${\n !$disabled &&\n `\n outline: 1px solid ${BLACK};\n `\n } \n }\n `;\n});\n\nconst StyledImportantIcon = styled(ImportantIcon)(({ theme }) => {\n const { layout } = theme;\n\n return `\n width: ${layout.gutter * 0.75}px;\n height: ${layout.gutter * 0.75}px;\n position: absolute;\n top: -2.5px;\n right: -2.5px;\n `;\n});\n\ninterface INodeCardInfoWrapper {\n $bgImage: string;\n}\n\nconst NodeCardInfoWrapper = styled(FlexView)<INodeCardInfoWrapper>(({ $bgImage }) => {\n return `\n background-image: url(${$bgImage});\n\n & .context-menu {\n justify-self: flex-end;\n margin-left: auto;\n }\n `;\n});\n\nconst IconWrapper = styled(FlexView)`\n border-radius: 50%;\n`;\n\nconst NodeCardContentWrapper = styled(FlexView)(() => {\n return `\n position: relative;\n padding: 12px 8px 12px 12px;\n `;\n});\n\ninterface ISheetTagWrapper {\n $top?: number;\n $right?: number;\n}\n\nconst SheetTagWrapper = styled(FlexView)<ISheetTagWrapper>(({ $top, $right }) => {\n return `\n position: absolute;\n top: ${$top ?? 0}px;\n right: ${$right ?? 0}px;\n z-index: 3;\n`;\n});\n\nconst StyledLockIcon = styled(Lock2Icon)(({}) => {\n return `\n width: 28px;\n height: 28px;\n `;\n});\n\nconst InProgressIconWrapper = styled(FlexView)<{ $paddingRight: number; $paddingLeft: number }>(({\n theme,\n $paddingRight,\n $paddingLeft,\n}) => {\n const { BLACK_1, WHITE_1 } = theme.colors;\n\n return `\n position: absolute;\n top: -10px;\n right: -10px;\n padding: 0px;\n padding-left: ${$paddingLeft}px;\n padding-right: ${$paddingRight}px;\n background: ${BLACK_1};\n\n path {\n fill: ${WHITE_1};\n }\n `;\n});\n\nconst NodeCardTitle = styled(Text)(() => {\n return `\n display: -webkit-box;\n -webkit-box-orient: vertical;\n -webkit-line-clamp: 2;\n text-overflow: ellipsis;\n overflow: hidden;\n `;\n});\n\nconst NodeKebabMenuWrapper = styled(FlexView)(({ theme }) => {\n return `\n cursor: pointer;\n padding: 4px;\n \n &:hover {\n border-radius: 50%;\n background: ${theme.colors.WHITE_5}; \n }\n `;\n});\n\ninterface INodeOptionsMenuWrapper {\n $visible: boolean;\n}\n\nconst NodeMenuOptionsWrapper = styled(FlexView)<INodeOptionsMenuWrapper>(({ theme, $visible }) => {\n return `\n cursor: pointer;\n\n position: absolute;\n z-index: 6;\n top: calc(100% + 4px);\n left: 0;\n\n transform-origin: top;\n transform: scaleY(${$visible ? 1 : 0});\n opacity: ${$visible ? 1 : 0};\n transition: transform 0.2s ease-in-out, opacity 0.2s ease-in-out;\n \n &:hover {\n border-radius: 50%;\n background: ${theme.colors.WHITE_5}; \n }\n `;\n});\n\nexport {\n NodeCardContainer,\n StyledImportantIcon,\n NodeCardInfoWrapper,\n IconWrapper,\n NodeCardContentWrapper,\n SheetTagWrapper,\n StyledLockIcon,\n InProgressIconWrapper,\n NodeCardTitle,\n NodeKebabMenuWrapper,\n NodeMenuOptionsWrapper,\n};\n"],"names":["NodeCardContainer","styled","FlexView","theme","$disabled","BLACK","BLACK_T_15","WHITE_5","StyledImportantIcon","ImportantIcon","layout","NodeCardInfoWrapper","$bgImage","IconWrapper","NodeCardContentWrapper","SheetTagWrapper","$top","$right","Lock2Icon","InProgressIconWrapper","$paddingRight","$paddingLeft","BLACK_1","WHITE_1","NodeCardTitle","Text","NodeKebabMenuWrapper","NodeMenuOptionsWrapper","$visible"],"mappings":";;;;;AAYM,MAAAA,IAAoBC,EAAOC,CAAQ,EAAsB,CAAC,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A;AAAA;AAAA;AAAA,oBAKWkB,CAAY;AAAA,qBACXD,CAAa;AAAA,kBAChBE,CAAO;AAAA;AAAA;AAAA,cAGXC,CAAO;AAAA;AAAA;AAGrB,CAAC,GAEKC,IAAgBvB,EAAOwB,CAAI,EAAE,MAC1B;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,GAOR,GAEKC,IAAuBzB,EAAOC,CAAQ,EAAE,CAAC,EAAE,OAAAC,QACxC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,oBAMWA,EAAM,OAAO,OAAO;AAAA;AAAA,GAGvC,GAMKwB,IAAyB1B,EAAOC,CAAQ,EAA2B,CAAC,EAAE,OAAAC,GAAO,UAAAyB,QAC1E;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,wBASeA,IAAW,IAAI,CAAC;AAAA,eACzBA,IAAW,IAAI,CAAC;AAAA;AAAA;AAAA;AAAA;AAAA,oBAKXzB,EAAM,OAAO,OAAO;AAAA;AAAA,GAGvC;"}
|
@@ -1,64 +1,76 @@
|
|
1
|
-
import { jsxs as a, jsx as
|
2
|
-
import { memo as
|
3
|
-
import
|
4
|
-
import
|
5
|
-
import
|
6
|
-
import
|
7
|
-
import
|
8
|
-
import
|
9
|
-
import
|
1
|
+
import { jsxs as a, jsx as t } from "react/jsx-runtime";
|
2
|
+
import { memo as N, useRef as S, useCallback as m } from "react";
|
3
|
+
import rr from "../../../../../assets/line-icons/icons/check2.js";
|
4
|
+
import tr from "../../../../../assets/line-icons/icons/eye2.js";
|
5
|
+
import er from "../../../../../assets/line-icons/icons/home2.js";
|
6
|
+
import cr from "../../../../../assets/line-icons/icons/lock3.js";
|
7
|
+
import T from "../../../../../assets/line-icons/icons/more-vertical.js";
|
8
|
+
import ir from "../../../../../assets/line-icons/icons/redo.js";
|
9
|
+
import nr from "../../../../../assets/line-icons/icons/unlock2.js";
|
10
|
+
import ar from "../../../../ui/arrow-tooltip/arrow-tooltip.js";
|
11
|
+
import lr from "../../../../ui/hooks/use-context-menu-click-handler.js";
|
10
12
|
import y from "../../../../ui/layout/flex-view.js";
|
11
|
-
import
|
12
|
-
import
|
13
|
-
import { BLOCK_TYPE as
|
14
|
-
import { NODE_CARD_STATES as
|
15
|
-
import { getNodeTypeBasedBgImage as
|
16
|
-
import { getNodeCardBasedIcon as
|
17
|
-
import { NodeCardContainer as
|
18
|
-
import
|
19
|
-
import
|
20
|
-
const
|
13
|
+
import sr from "../../../../ui/lottie-animation/lottie-animation.js";
|
14
|
+
import or from "../../../../ui/text/text.js";
|
15
|
+
import { BLOCK_TYPE as mr } from "../../../constants/block-constants.js";
|
16
|
+
import { NODE_CARD_STATES as x, TEACHER_MENU_LABELS as pr } from "../../../constants/node-constants.js";
|
17
|
+
import { getNodeTypeBasedBgImage as dr } from "../../../utils/index.js";
|
18
|
+
import { getNodeCardBasedIcon as hr } from "../../../utils/node-card-utils.js";
|
19
|
+
import { NodeCardContainer as ur, NodeCardInfoWrapper as fr, IconWrapper as Cr, StyledImportantIcon as $r, NodeKebabMenuWrapper as W, NodeCardContentWrapper as _r, NodeCardTitle as br, NodeMenuOptionsWrapper as Ir } from "../node-card-styled.js";
|
20
|
+
import kr from "../node-card-tags.js";
|
21
|
+
import Er from "../node-menu-options/node-menu-options.js";
|
22
|
+
const gr = { renderer: "canvas", autoplay: !1 }, { ASSIGN_AS_HW: Lr, REVIEW: Or, VIEW: Sr, MARK_AS_DONE: Tr, RESET: yr, LOCK: xr, UNLOCK: Wr } = pr, Dr = N(
|
21
23
|
({
|
22
|
-
nodeData:
|
23
|
-
imageHue:
|
24
|
-
blockType:
|
25
|
-
isSkipped:
|
26
|
-
onNodeAssignAsHomework:
|
27
|
-
onNodeMarkAsDone:
|
28
|
-
onNodeView:
|
29
|
-
onNodeReview:
|
30
|
-
onNodeReattempt:
|
24
|
+
nodeData: r,
|
25
|
+
imageHue: B,
|
26
|
+
blockType: M,
|
27
|
+
isSkipped: K,
|
28
|
+
onNodeAssignAsHomework: p,
|
29
|
+
onNodeMarkAsDone: d,
|
30
|
+
onNodeView: c,
|
31
|
+
onNodeReview: i,
|
32
|
+
onNodeReattempt: h,
|
33
|
+
onNodeUnlock: u,
|
34
|
+
onNodeUnassign: f
|
31
35
|
}) => {
|
32
|
-
const
|
33
|
-
accuracy:
|
34
|
-
attempt_location:
|
35
|
-
node_type:
|
36
|
-
card_header:
|
37
|
-
title:
|
36
|
+
const $ = S(null), { menuVisible: k, onMenuClick: E } = lr($), {
|
37
|
+
accuracy: A,
|
38
|
+
attempt_location: G,
|
39
|
+
node_type: _,
|
40
|
+
card_header: j,
|
41
|
+
title: X,
|
38
42
|
state: b,
|
39
|
-
is_optional:
|
40
|
-
sheet_statement:
|
41
|
-
permissions:
|
43
|
+
is_optional: H,
|
44
|
+
sheet_statement: g,
|
45
|
+
permissions: F,
|
42
46
|
user_attempt_id: l
|
43
|
-
} =
|
44
|
-
can_mark_familiar:
|
47
|
+
} = r, { lottie: P } = hr(_), I = S(null), {
|
48
|
+
can_mark_familiar: z,
|
45
49
|
can_review: s,
|
46
|
-
can_assign_as_homework:
|
47
|
-
can_reset:
|
48
|
-
|
50
|
+
can_assign_as_homework: Y,
|
51
|
+
can_reset: q,
|
52
|
+
can_unlock: C,
|
53
|
+
can_unassign: J
|
54
|
+
} = F, L = M === mr.GOAL, n = b === x.LOCKED, Q = b === x.NOT_STARTED, Z = G === "INCLASS", v = (n || Q) && (C || J), R = dr(_), o = m(
|
49
55
|
(e) => {
|
50
56
|
switch (e) {
|
51
57
|
case "node-card-view":
|
52
|
-
s && l ?
|
58
|
+
s && l ? i == null || i(r) : c == null || c(r);
|
53
59
|
return;
|
54
60
|
case "node-card-assign-as-hw":
|
55
|
-
|
61
|
+
p == null || p(r);
|
56
62
|
return;
|
57
63
|
case "node-card-mark-as-done":
|
58
|
-
|
64
|
+
d == null || d(r);
|
59
65
|
return;
|
60
66
|
case "node-card-reset":
|
61
|
-
|
67
|
+
h == null || h(r);
|
68
|
+
return;
|
69
|
+
case "node-card-unlock":
|
70
|
+
u == null || u(r);
|
71
|
+
return;
|
72
|
+
case "node-card-lock":
|
73
|
+
f == null || f(r);
|
62
74
|
return;
|
63
75
|
default:
|
64
76
|
throw new Error(`No callback function for ${e}`);
|
@@ -66,90 +78,99 @@ const ur = { renderer: "canvas", autoplay: !1 }, { ASSIGN_AS_HW: Cr, REVIEW: $r,
|
|
66
78
|
},
|
67
79
|
[
|
68
80
|
s,
|
69
|
-
|
70
|
-
m,
|
81
|
+
r,
|
71
82
|
p,
|
72
83
|
d,
|
84
|
+
h,
|
85
|
+
i,
|
86
|
+
f,
|
87
|
+
u,
|
73
88
|
c,
|
74
|
-
n,
|
75
89
|
l
|
76
90
|
]
|
77
|
-
), U =
|
91
|
+
), U = m(() => {
|
78
92
|
var e;
|
79
|
-
|
80
|
-
}, [
|
93
|
+
n || (e = I.current) == null || e.play();
|
94
|
+
}, [n]), w = m(() => {
|
81
95
|
var e;
|
82
|
-
(e =
|
83
|
-
}, []),
|
84
|
-
s && l ?
|
85
|
-
}, [s,
|
96
|
+
(e = I.current) == null || e.stop();
|
97
|
+
}, []), V = m(() => {
|
98
|
+
s && l ? i == null || i(r) : c == null || c(r);
|
99
|
+
}, [s, r, i, c, l]), O = m(
|
86
100
|
(e) => {
|
87
|
-
e.stopPropagation(),
|
101
|
+
e.stopPropagation(), E();
|
88
102
|
},
|
89
|
-
[
|
90
|
-
),
|
103
|
+
[E]
|
104
|
+
), D = [
|
91
105
|
{
|
92
106
|
id: "node-card-view",
|
93
|
-
label: s && l ?
|
94
|
-
icon:
|
107
|
+
label: s && l ? Or : Sr,
|
108
|
+
icon: tr,
|
95
109
|
disabled: !1,
|
96
|
-
onClick:
|
110
|
+
onClick: o
|
97
111
|
},
|
98
112
|
{
|
99
113
|
id: "node-card-assign-as-hw",
|
100
|
-
label:
|
101
|
-
icon:
|
102
|
-
disabled: !
|
103
|
-
onClick:
|
114
|
+
label: Lr,
|
115
|
+
icon: er,
|
116
|
+
disabled: !Y,
|
117
|
+
onClick: o
|
104
118
|
},
|
105
119
|
{
|
106
120
|
id: "node-card-reset",
|
107
|
-
label:
|
108
|
-
icon:
|
109
|
-
disabled: !
|
110
|
-
onClick:
|
121
|
+
label: yr,
|
122
|
+
icon: ir,
|
123
|
+
disabled: !q,
|
124
|
+
onClick: o
|
111
125
|
},
|
112
126
|
{
|
113
127
|
id: "node-card-mark-as-done",
|
114
|
-
label:
|
115
|
-
icon:
|
116
|
-
disabled: !
|
117
|
-
onClick:
|
128
|
+
label: Tr,
|
129
|
+
icon: rr,
|
130
|
+
disabled: !z,
|
131
|
+
onClick: o
|
132
|
+
},
|
133
|
+
{
|
134
|
+
id: `node-card-${C ? "unlock" : "lock"}`,
|
135
|
+
label: C ? Wr : xr,
|
136
|
+
icon: C ? nr : cr,
|
137
|
+
disabled: !v,
|
138
|
+
onClick: o
|
118
139
|
}
|
119
140
|
];
|
120
141
|
return /* @__PURE__ */ a(y, { $position: "relative", children: [
|
121
|
-
/* @__PURE__ */
|
122
|
-
|
142
|
+
/* @__PURE__ */ t(
|
143
|
+
ur,
|
123
144
|
{
|
124
|
-
$background: `${
|
125
|
-
$disabled: !!(
|
126
|
-
onClick:
|
145
|
+
$background: `${B}_2`,
|
146
|
+
$disabled: !!(K || n),
|
147
|
+
onClick: V,
|
127
148
|
children: /* @__PURE__ */ a(
|
128
|
-
|
149
|
+
ar,
|
129
150
|
{
|
130
151
|
renderAs: "primary",
|
131
|
-
tooltipItem:
|
152
|
+
tooltipItem: g,
|
132
153
|
position: "bottom",
|
133
154
|
zIndex: 5,
|
134
|
-
hidden:
|
155
|
+
hidden: k || !g,
|
135
156
|
parentWidth: "100%",
|
136
157
|
widthX: 11.25,
|
137
158
|
children: [
|
138
159
|
/* @__PURE__ */ a(
|
139
|
-
|
160
|
+
fr,
|
140
161
|
{
|
141
162
|
$flexDirection: "row",
|
142
163
|
$alignItems: "center",
|
143
164
|
$width: "100%",
|
144
165
|
$heightX: 3.5,
|
145
|
-
$bgImage:
|
166
|
+
$bgImage: R,
|
146
167
|
$gutterX: 0.78125,
|
147
168
|
$flexGap: 8.5,
|
148
169
|
onMouseEnter: U,
|
149
|
-
onMouseLeave:
|
170
|
+
onMouseLeave: w,
|
150
171
|
children: [
|
151
172
|
/* @__PURE__ */ a(
|
152
|
-
|
173
|
+
Cr,
|
153
174
|
{
|
154
175
|
$width: 31,
|
155
176
|
$height: 31,
|
@@ -157,32 +178,32 @@ const ur = { renderer: "canvas", autoplay: !1 }, { ASSIGN_AS_HW: Cr, REVIEW: $r,
|
|
157
178
|
$position: "relative",
|
158
179
|
$alignItems: "center",
|
159
180
|
$justifyContent: "center",
|
160
|
-
$opacity:
|
181
|
+
$opacity: n ? 0.5 : 1,
|
161
182
|
children: [
|
162
|
-
/* @__PURE__ */
|
163
|
-
|
183
|
+
/* @__PURE__ */ t(
|
184
|
+
sr,
|
164
185
|
{
|
165
|
-
src:
|
166
|
-
ref:
|
167
|
-
settings:
|
186
|
+
src: P,
|
187
|
+
ref: I,
|
188
|
+
settings: gr
|
168
189
|
}
|
169
190
|
),
|
170
|
-
!
|
191
|
+
!H && /* @__PURE__ */ t($r, {})
|
171
192
|
]
|
172
193
|
}
|
173
194
|
),
|
174
|
-
/* @__PURE__ */ a(
|
175
|
-
|
195
|
+
/* @__PURE__ */ a(or, { $renderAs: "ac4-black", $color: "BLACK", $opacity: n ? 0.5 : 1, children: [
|
196
|
+
j,
|
176
197
|
" ",
|
177
|
-
|
198
|
+
Z && "• CW"
|
178
199
|
] }),
|
179
|
-
/* @__PURE__ */
|
200
|
+
/* @__PURE__ */ t(y, { className: "context-menu", children: L && /* @__PURE__ */ t(W, { ref: $, onClick: O, children: /* @__PURE__ */ t(T, { width: 18, height: 18 }) }) })
|
180
201
|
]
|
181
202
|
}
|
182
203
|
),
|
183
|
-
/* @__PURE__ */
|
184
|
-
!
|
185
|
-
|
204
|
+
/* @__PURE__ */ t(kr, { nodeType: _, state: b, accuracy: A }),
|
205
|
+
!L && /* @__PURE__ */ a(
|
206
|
+
_r,
|
186
207
|
{
|
187
208
|
$flexDirection: "row",
|
188
209
|
$alignItems: "center",
|
@@ -191,16 +212,16 @@ const ur = { renderer: "canvas", autoplay: !1 }, { ASSIGN_AS_HW: Cr, REVIEW: $r,
|
|
191
212
|
$heightX: 4,
|
192
213
|
$justifyContent: "space-between",
|
193
214
|
children: [
|
194
|
-
/* @__PURE__ */
|
195
|
-
|
215
|
+
/* @__PURE__ */ t(
|
216
|
+
br,
|
196
217
|
{
|
197
218
|
$renderAs: "ab3",
|
198
219
|
$color: "BLACK_1",
|
199
|
-
$opacity:
|
200
|
-
children:
|
220
|
+
$opacity: n ? 0.5 : 1,
|
221
|
+
children: X
|
201
222
|
}
|
202
223
|
),
|
203
|
-
/* @__PURE__ */
|
224
|
+
/* @__PURE__ */ t(W, { ref: $, onClick: O, children: /* @__PURE__ */ t(T, { width: 18, height: 18 }) })
|
204
225
|
]
|
205
226
|
}
|
206
227
|
)
|
@@ -209,11 +230,11 @@ const ur = { renderer: "canvas", autoplay: !1 }, { ASSIGN_AS_HW: Cr, REVIEW: $r,
|
|
209
230
|
)
|
210
231
|
}
|
211
232
|
),
|
212
|
-
/* @__PURE__ */
|
233
|
+
/* @__PURE__ */ t(Ir, { $visible: k, children: /* @__PURE__ */ t(Er, { options: D }) })
|
213
234
|
] });
|
214
235
|
}
|
215
236
|
);
|
216
237
|
export {
|
217
|
-
|
238
|
+
Dr as default
|
218
239
|
};
|
219
240
|
//# sourceMappingURL=teacher-actions.js.map
|
@@ -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 { 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 RedoIcon from '../../../../../assets/line-icons/icons/redo';\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 * 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, RESET } = TEACHER_MENU_LABELS;\n\nconst TeacherActions: FC<Omit<INodeCardProps, 'userType'>> = memo(\n ({\n nodeData,\n imageHue,\n blockType,\n isSkipped,\n onNodeAssignAsHomework,\n onNodeMarkAsDone,\n onNodeView,\n onNodeReview,\n onNodeReattempt,\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_mark_familiar: canMarkFamiliar,\n can_review: canReview,\n can_assign_as_homework: canAssignAsHw,\n can_reset: canReset,\n } = permissions;\n\n const isGoalBlock = blockType === BLOCK_TYPE.GOAL;\n const sheetLocked = state === NODE_CARD_STATES.LOCKED;\n const inClassSheet = attemptLocation === 'INCLASS';\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 onNodeAssignAsHomework?.(nodeData);\n\n return;\n\n case 'node-card-mark-as-done':\n onNodeMarkAsDone?.(nodeData);\n\n return;\n\n case 'node-card-reset':\n onNodeReattempt?.(nodeData);\n\n return;\n\n default:\n throw new Error(`No callback function for ${optionId}`);\n }\n },\n [\n canReview,\n nodeData,\n onNodeAssignAsHomework,\n onNodeMarkAsDone,\n onNodeReattempt,\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 handleOnNodeCardClick = useCallback(() => {\n if (canReview && userAttemptId) {\n onNodeReview?.(nodeData);\n } else {\n onNodeView?.(nodeData);\n }\n }, [canReview, nodeData, onNodeReview, onNodeView, userAttemptId]);\n\n const handleOnKebabMenuClick = useCallback(\n (e: React.MouseEvent<HTMLDivElement, MouseEvent>) => {\n e.stopPropagation();\n onMenuClick();\n },\n [onMenuClick],\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: !canAssignAsHw,\n onClick: handleOnMenuOptionClick,\n },\n {\n id: 'node-card-reset',\n label: RESET,\n icon: RedoIcon,\n disabled: !canReset,\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 <FlexView $position=\"relative\">\n <Styled.NodeCardContainer\n $background={`${imageHue}_2`}\n $disabled={Boolean(isSkipped || sheetLocked)}\n onClick={handleOnNodeCardClick}\n >\n <ArrowTooltip\n renderAs=\"primary\"\n tooltipItem={sheetStatement}\n position=\"bottom\"\n zIndex={5}\n hidden={menuVisible || !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 onMouseEnter={handleOnMouseEnter}\n onMouseLeave={handleOnMouseLeave}\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\n src={nodeCardLottie}\n ref={animationRef}\n settings={renderSettings}\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={handleOnKebabMenuClick}>\n <MoreVerticalIcon width={18} height={18} />\n </Styled.NodeKebabMenuWrapper>\n )}\n </FlexView>\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={handleOnKebabMenuClick}>\n <MoreVerticalIcon width={18} height={18} />\n </Styled.NodeKebabMenuWrapper>\n </Styled.NodeCardContentWrapper>\n )}\n </ArrowTooltip>\n </Styled.NodeCardContainer>\n <Styled.NodeMenuOptionsWrapper $visible={menuVisible}>\n <NodeMenuOptions options={menuOptions} />\n </Styled.NodeMenuOptionsWrapper>\n </FlexView>\n );\n },\n);\n\nexport default TeacherActions;\n"],"names":["renderSettings","ASSIGN_AS_HW","REVIEW","VIEW","MARK_AS_DONE","RESET","TEACHER_MENU_LABELS","TeacherActions","memo","nodeData","imageHue","blockType","isSkipped","onNodeAssignAsHomework","onNodeMarkAsDone","onNodeView","onNodeReview","onNodeReattempt","containerRef","useRef","menuVisible","onMenuClick","useContextMenuClickHandler","accuracy","attemptLocation","nodeType","cardHeader","title","state","isOptional","sheetStatement","permissions","userAttemptId","nodeCardLottie","getNodeCardBasedIcon","animationRef","canMarkFamiliar","canReview","canAssignAsHw","canReset","isGoalBlock","BLOCK_TYPE","sheetLocked","NODE_CARD_STATES","inClassSheet","nodeBgImage","getNodeTypeBasedBgImage","handleOnMenuOptionClick","useCallback","optionId","handleOnMouseEnter","_a","handleOnMouseLeave","handleOnNodeCardClick","handleOnKebabMenuClick","menuOptions","Eye2Icon","Home2Icon","RedoIcon","Check2Icon","jsxs","FlexView","jsx","Styled.NodeCardContainer","ArrowTooltip","Styled.NodeCardInfoWrapper","Styled.IconWrapper","LottieAnimation","Styled.StyledImportantIcon","Text","Styled.NodeKebabMenuWrapper","MoreVerticalIcon","NodeCardTags","Styled.NodeCardContent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zC,CAAA;AAAA,IACF,EAAA,CAAA;AAAA,EAEJ;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 Lock3Icon from '../../../../../assets/line-icons/icons/lock3';\nimport MoreVerticalIcon from '../../../../../assets/line-icons/icons/more-vertical';\nimport RedoIcon from '../../../../../assets/line-icons/icons/redo';\nimport Unlock2Icon from '../../../../../assets/line-icons/icons/unlock2';\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 * 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, RESET, LOCK, UNLOCK } = TEACHER_MENU_LABELS;\n\nconst TeacherActions: FC<Omit<INodeCardProps, 'userType'>> = memo(\n ({\n nodeData,\n imageHue,\n blockType,\n isSkipped,\n onNodeAssignAsHomework,\n onNodeMarkAsDone,\n onNodeView,\n onNodeReview,\n onNodeReattempt,\n onNodeUnlock,\n onNodeUnassign,\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_mark_familiar: canMarkFamiliar,\n can_review: canReview,\n can_assign_as_homework: canAssignAsHw,\n can_reset: canReset,\n can_unlock: canUnlock,\n can_unassign: canUnassign,\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 inClassSheet = attemptLocation === 'INCLASS';\n const canLockUnlockSheet = (sheetLocked || sheetNotStarted) && (canUnlock || canUnassign);\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 onNodeAssignAsHomework?.(nodeData);\n\n return;\n\n case 'node-card-mark-as-done':\n onNodeMarkAsDone?.(nodeData);\n\n return;\n\n case 'node-card-reset':\n onNodeReattempt?.(nodeData);\n\n return;\n case 'node-card-unlock':\n onNodeUnlock?.(nodeData);\n\n return;\n case 'node-card-lock':\n onNodeUnassign?.(nodeData);\n\n return;\n\n default:\n throw new Error(`No callback function for ${optionId}`);\n }\n },\n [\n canReview,\n nodeData,\n onNodeAssignAsHomework,\n onNodeMarkAsDone,\n onNodeReattempt,\n onNodeReview,\n onNodeUnassign,\n onNodeUnlock,\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 handleOnNodeCardClick = useCallback(() => {\n if (canReview && userAttemptId) {\n onNodeReview?.(nodeData);\n } else {\n onNodeView?.(nodeData);\n }\n }, [canReview, nodeData, onNodeReview, onNodeView, userAttemptId]);\n\n const handleOnKebabMenuClick = useCallback(\n (e: React.MouseEvent<HTMLDivElement, MouseEvent>) => {\n e.stopPropagation();\n onMenuClick();\n },\n [onMenuClick],\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: !canAssignAsHw,\n onClick: handleOnMenuOptionClick,\n },\n {\n id: 'node-card-reset',\n label: RESET,\n icon: RedoIcon,\n disabled: !canReset,\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 id: `node-card-${canUnlock ? 'unlock' : 'lock'}`,\n label: canUnlock ? UNLOCK : LOCK,\n icon: canUnlock ? Unlock2Icon : Lock3Icon,\n disabled: !canLockUnlockSheet,\n onClick: handleOnMenuOptionClick,\n },\n ];\n\n return (\n <FlexView $position=\"relative\">\n <Styled.NodeCardContainer\n $background={`${imageHue}_2`}\n $disabled={Boolean(isSkipped || sheetLocked)}\n onClick={handleOnNodeCardClick}\n >\n <ArrowTooltip\n renderAs=\"primary\"\n tooltipItem={sheetStatement}\n position=\"bottom\"\n zIndex={5}\n hidden={menuVisible || !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 onMouseEnter={handleOnMouseEnter}\n onMouseLeave={handleOnMouseLeave}\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\n src={nodeCardLottie}\n ref={animationRef}\n settings={renderSettings}\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={handleOnKebabMenuClick}>\n <MoreVerticalIcon width={18} height={18} />\n </Styled.NodeKebabMenuWrapper>\n )}\n </FlexView>\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={handleOnKebabMenuClick}>\n <MoreVerticalIcon width={18} height={18} />\n </Styled.NodeKebabMenuWrapper>\n </Styled.NodeCardContentWrapper>\n )}\n </ArrowTooltip>\n </Styled.NodeCardContainer>\n <Styled.NodeMenuOptionsWrapper $visible={menuVisible}>\n <NodeMenuOptions options={menuOptions} />\n </Styled.NodeMenuOptionsWrapper>\n </FlexView>\n );\n },\n);\n\nexport default TeacherActions;\n"],"names":["renderSettings","ASSIGN_AS_HW","REVIEW","VIEW","MARK_AS_DONE","RESET","LOCK","UNLOCK","TEACHER_MENU_LABELS","TeacherActions","memo","nodeData","imageHue","blockType","isSkipped","onNodeAssignAsHomework","onNodeMarkAsDone","onNodeView","onNodeReview","onNodeReattempt","onNodeUnlock","onNodeUnassign","containerRef","useRef","menuVisible","onMenuClick","useContextMenuClickHandler","accuracy","attemptLocation","nodeType","cardHeader","title","state","isOptional","sheetStatement","permissions","userAttemptId","nodeCardLottie","getNodeCardBasedIcon","animationRef","canMarkFamiliar","canReview","canAssignAsHw","canReset","canUnlock","canUnassign","isGoalBlock","BLOCK_TYPE","sheetLocked","NODE_CARD_STATES","sheetNotStarted","inClassSheet","canLockUnlockSheet","nodeBgImage","getNodeTypeBasedBgImage","handleOnMenuOptionClick","useCallback","optionId","handleOnMouseEnter","_a","handleOnMouseLeave","handleOnNodeCardClick","handleOnKebabMenuClick","menuOptions","Eye2Icon","Home2Icon","RedoIcon","Check2Icon","Unlock2Icon","Lock3Icon","jsxs","FlexView","jsx","Styled.NodeCardContainer","ArrowTooltip","Styled.NodeCardInfoWrapper","Styled.IconWrapper","LottieAnimation","Styled.StyledImportantIcon","Text","Styled.NodeKebabMenuWrapper","MoreVerticalIcon","NodeCardTags","Styled.NodeCardContentWrapper","Styled.NodeCardTitle","Styled.NodeMenuOptionsWrapper","NodeMenuOptions"],"mappings":";;;;;;;;;;;;;;;;;;;;;AA2BA,MAAMA,KAAiB,EAAE,UAAU,UAAU,UAAU,GAAM,GACvD,EAAE,cAAAC,IAAc,QAAAC,IAAQ,MAAAC,IAAM,cAAAC,IAAc,OAAAC,IAAO,MAAAC,IAAM,QAAAC,GAAW,IAAAC,IAEpEC,KAAuDC;AAAA,EAC3D,CAAC;AAAA,I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,kBAAA;AAAA,gBACF;AAAA,cAAA;AAAA,YAAA;AAAA,UAEJ;AAAA,QAAA;AAAA,MACF;AAAA,MACA,gBAAAT,EAACa,IAAA,EAA8B,UAAU7D,GACvC,UAAC,gBAAAgD,EAAAc,IAAA,EAAgB,SAASvB,EAAA,CAAa,EACzC,CAAA;AAAA,IACF,EAAA,CAAA;AAAA,EAEJ;AACF;"}
|
@@ -5,7 +5,9 @@ const I = {
|
|
5
5
|
REVERT_SKIP: "Revert Skip",
|
6
6
|
REVIEW: "Review",
|
7
7
|
VIEW: "View",
|
8
|
-
RESET: "Reset"
|
8
|
+
RESET: "Reset",
|
9
|
+
LOCK: "Lock",
|
10
|
+
UNLOCK: "Unlock"
|
9
11
|
};
|
10
12
|
var R = /* @__PURE__ */ ((E) => (E.LOCKED = "LOCKED", E.NOT_STARTED = "NOT_STARTED", E.WAIT_FOR_REVIEW = "WAIT_FOR_REVIEW", E.IN_PROGRESS = "IN_PROGRESS", E.COMPLETED = "COMPLETED", E))(R || {});
|
11
13
|
export {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"node-constants.js","sources":["../../../../src/features/chapters-v2/constants/node-constants.ts"],"sourcesContent":["export const TEACHER_MENU_LABELS = {\n ASSIGN_AS_HW: 'Assign as HW',\n MARK_AS_DONE: 'Mark as Done',\n SKIP: 'Skip',\n REVERT_SKIP: 'Revert Skip',\n REVIEW: 'Review',\n VIEW: 'View',\n RESET: 'Reset',\n};\n\nexport enum NODE_CARD_STATES {\n LOCKED = 'LOCKED',\n NOT_STARTED = 'NOT_STARTED',\n WAIT_FOR_REVIEW = 'WAIT_FOR_REVIEW',\n IN_PROGRESS = 'IN_PROGRESS',\n COMPLETED = 'COMPLETED',\n}\n\nexport enum NODE_CARD_COURSE_TYPES {\n PROGRAM = 'PROGRAM',\n REMEDIAL = 'REMEDIAL',\n TEST_SERIES = 'TEST_SERIES',\n EXAM = 'EXAM',\n}\n"],"names":["TEACHER_MENU_LABELS","NODE_CARD_STATES"],"mappings":"AAAO,MAAMA,IAAsB;AAAA,EACjC,cAAc;AAAA,EACd,cAAc;AAAA,EACd,MAAM;AAAA,EACN,aAAa;AAAA,EACb,QAAQ;AAAA,EACR,MAAM;AAAA,EACN,OAAO;
|
1
|
+
{"version":3,"file":"node-constants.js","sources":["../../../../src/features/chapters-v2/constants/node-constants.ts"],"sourcesContent":["export const TEACHER_MENU_LABELS = {\n ASSIGN_AS_HW: 'Assign as HW',\n MARK_AS_DONE: 'Mark as Done',\n SKIP: 'Skip',\n REVERT_SKIP: 'Revert Skip',\n REVIEW: 'Review',\n VIEW: 'View',\n RESET: 'Reset',\n LOCK: 'Lock',\n UNLOCK: 'Unlock',\n};\n\nexport enum NODE_CARD_STATES {\n LOCKED = 'LOCKED',\n NOT_STARTED = 'NOT_STARTED',\n WAIT_FOR_REVIEW = 'WAIT_FOR_REVIEW',\n IN_PROGRESS = 'IN_PROGRESS',\n COMPLETED = 'COMPLETED',\n}\n\nexport enum NODE_CARD_COURSE_TYPES {\n PROGRAM = 'PROGRAM',\n REMEDIAL = 'REMEDIAL',\n TEST_SERIES = 'TEST_SERIES',\n EXAM = 'EXAM',\n}\n"],"names":["TEACHER_MENU_LABELS","NODE_CARD_STATES"],"mappings":"AAAO,MAAMA,IAAsB;AAAA,EACjC,cAAc;AAAA,EACd,cAAc;AAAA,EACd,MAAM;AAAA,EACN,aAAa;AAAA,EACb,QAAQ;AAAA,EACR,MAAM;AAAA,EACN,OAAO;AAAA,EACP,MAAM;AAAA,EACN,QAAQ;AACV;AAEY,IAAAC,sBAAAA,OACVA,EAAA,SAAS,UACTA,EAAA,cAAc,eACdA,EAAA,kBAAkB,mBAClBA,EAAA,cAAc,eACdA,EAAA,YAAY,aALFA,IAAAA,KAAA,CAAA,CAAA;"}
|
@@ -1,21 +1,28 @@
|
|
1
1
|
import { createGetAPI as o } from "@cuemath/rest-api";
|
2
2
|
import { BASE_URL_V1 as r } from "../../../../constants/api.js";
|
3
3
|
import { stringify as s } from "../../../../helpers/query-string.js";
|
4
|
-
const
|
5
|
-
|
6
|
-
|
4
|
+
const n = () => {
|
5
|
+
const t = window.location.hostname;
|
6
|
+
return t.startsWith("local") || t === "storybook.cuemath.com" ? t : null;
|
7
|
+
}, a = () => {
|
8
|
+
const t = n();
|
9
|
+
return t ? {
|
10
|
+
headers: {
|
11
|
+
"Learnosity-Host": t
|
12
|
+
// Set the Learnosity host header if applicable
|
13
|
+
}
|
14
|
+
} : void 0;
|
15
|
+
}, { useGet: u } = o({
|
16
|
+
getURL: (t, e) => `${r}/worksheets/fb575b36-7861-11e8-b8d4-acbc3277df8f/?${s({
|
17
|
+
activityReference: t,
|
7
18
|
sign: !0,
|
8
19
|
meta: !0,
|
9
20
|
test: !0,
|
10
|
-
...
|
21
|
+
...e
|
11
22
|
})}`,
|
12
|
-
params:
|
13
|
-
headers: {
|
14
|
-
"Learnosity-Host": window.location.hostname
|
15
|
-
}
|
16
|
-
} : void 0
|
23
|
+
params: a()
|
17
24
|
});
|
18
25
|
export {
|
19
|
-
|
26
|
+
u as usePreviewWorksheetGet
|
20
27
|
};
|
21
28
|
//# sourceMappingURL=get-preview-worksheet.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"get-preview-worksheet.js","sources":["../../../../../src/features/worksheet/worksheet-preview/api/get-preview-worksheet.ts"],"sourcesContent":["import type { IPreviewWorksheetModel } from '../../../../types/models/worksheet';\n\nimport { createGetAPI } from '@cuemath/rest-api';\n\nimport { BASE_URL_V1 } from '../../../../constants/api';\nimport { stringify } from '../../../../helpers/query-string';\n\ntype TPreviewWorksheetQuery = {\n action: string;\n node_type: string;\n items?: string[];\n};\n\nconst { useGet: usePreviewWorksheetGet } = createGetAPI<\n IPreviewWorksheetModel,\n TPreviewWorksheetQuery\n>({\n getURL: (activityRef, query) =>\n `${BASE_URL_V1}/worksheets/fb575b36-7861-11e8-b8d4-acbc3277df8f/?${stringify({\n activityReference: activityRef,\n sign: true,\n meta: true,\n test: true,\n ...query,\n })}`,\n params:
|
1
|
+
{"version":3,"file":"get-preview-worksheet.js","sources":["../../../../../src/features/worksheet/worksheet-preview/api/get-preview-worksheet.ts"],"sourcesContent":["import type { IPreviewWorksheetModel } from '../../../../types/models/worksheet';\n\nimport { createGetAPI } from '@cuemath/rest-api';\n\nimport { BASE_URL_V1 } from '../../../../constants/api';\nimport { stringify } from '../../../../helpers/query-string';\n\n/**\n * Determines the Learnosity host based on the current window location.\n * Returns the hostname if it starts with 'local' or matches 'storybook.cuemath.com',\n * otherwise returns null.\n */\nconst getLearnosityHost = () => {\n const hostname = window.location.hostname;\n\n if (hostname.startsWith('local') || hostname === 'storybook.cuemath.com') {\n return hostname;\n }\n\n return null;\n};\n\nconst getParams = () => {\n const learnosityHost = getLearnosityHost();\n\n return learnosityHost\n ? {\n headers: {\n 'Learnosity-Host': learnosityHost, // Set the Learnosity host header if applicable\n },\n }\n : undefined;\n};\n\ntype TPreviewWorksheetQuery = {\n action: string;\n node_type: string;\n items?: string[];\n};\n\nconst { useGet: usePreviewWorksheetGet } = createGetAPI<\n IPreviewWorksheetModel,\n TPreviewWorksheetQuery\n>({\n getURL: (activityRef, query) =>\n `${BASE_URL_V1}/worksheets/fb575b36-7861-11e8-b8d4-acbc3277df8f/?${stringify({\n activityReference: activityRef,\n sign: true,\n meta: true,\n test: true,\n ...query,\n })}`,\n params: getParams(),\n});\n\nexport { usePreviewWorksheetGet };\n"],"names":["getLearnosityHost","hostname","getParams","learnosityHost","usePreviewWorksheetGet","createGetAPI","activityRef","query","BASE_URL_V1","stringify"],"mappings":";;;AAYA,MAAMA,IAAoB,MAAM;AACxB,QAAAC,IAAW,OAAO,SAAS;AAEjC,SAAIA,EAAS,WAAW,OAAO,KAAKA,MAAa,0BACxCA,IAGF;AACT,GAEMC,IAAY,MAAM;AACtB,QAAMC,IAAiBH;AAEvB,SAAOG,IACH;AAAA,IACE,SAAS;AAAA,MACP,mBAAmBA;AAAA;AAAA,IACrB;AAAA,EAEF,IAAA;AACN,GAQM,EAAE,QAAQC,EAAuB,IAAIC,EAGzC;AAAA,EACA,QAAQ,CAACC,GAAaC,MACpB,GAAGC,CAAW,qDAAqDC,EAAU;AAAA,IAC3E,mBAAmBH;AAAA,IACnB,MAAM;AAAA,IACN,MAAM;AAAA,IACN,MAAM;AAAA,IACN,GAAGC;AAAA,EACJ,CAAA,CAAC;AAAA,EACJ,QAAQL,EAAU;AACpB,CAAC;"}
|
package/dist/index.d.ts
CHANGED
@@ -2363,6 +2363,7 @@ declare interface INodeCardCallbacks {
|
|
2363
2363
|
onNodeMarkAsDone?: (nodeData: INodeDataProps) => void;
|
2364
2364
|
onNodeReset?: (nodeData: INodeDataProps, milestoneId?: string) => void;
|
2365
2365
|
onNodeUnassign?: (nodeData: INodeDataProps, milestoneId?: string) => void;
|
2366
|
+
onNodeUnlock?: (nodeData: INodeDataProps, milestoneId?: string) => void;
|
2366
2367
|
}
|
2367
2368
|
|
2368
2369
|
export declare interface INodeDataProps {
|
@@ -2415,6 +2416,7 @@ declare interface INodePermissions {
|
|
2415
2416
|
can_start: boolean;
|
2416
2417
|
can_teacher_review: boolean;
|
2417
2418
|
can_unassign: boolean;
|
2419
|
+
can_unlock: boolean;
|
2418
2420
|
}
|
2419
2421
|
|
2420
2422
|
export declare const InputStatusIcon: NamedExoticComponent<IInputStatusIconProps>;
|
@@ -3944,6 +3946,8 @@ export declare const loadScript: ILoadScript;
|
|
3944
3946
|
|
3945
3947
|
export declare const Lock2Icon: React_2.FC<React_2.SVGProps<SVGSVGElement>>;
|
3946
3948
|
|
3949
|
+
export declare const Lock3Icon: React.FC<React.SVGProps<SVGSVGElement>>;
|
3950
|
+
|
3947
3951
|
export declare const LockIcon: React.FC<React.SVGProps<SVGSVGElement>>;
|
3948
3952
|
|
3949
3953
|
export declare const LOTTIE: {
|
@@ -5604,6 +5608,8 @@ declare interface UIContextProps {
|
|
5604
5608
|
|
5605
5609
|
export declare const UndoIcon: React.FC<React.SVGProps<SVGSVGElement>>;
|
5606
5610
|
|
5611
|
+
export declare const Unlock2Icon: React.FC<React.SVGProps<SVGSVGElement>>;
|
5612
|
+
|
5607
5613
|
export declare const UnlockIcon: React.FC<React.SVGProps<SVGSVGElement>>;
|
5608
5614
|
|
5609
5615
|
export declare const UpIcon: React.FC<React.SVGProps<SVGSVGElement>>;
|