@cuemath/leap 2.8.60-ag1 → 2.8.60-ag3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (32) hide show
  1. package/dist/features/chapters/chapters-list/chapter-item/chapter-item-styled.js +5 -4
  2. package/dist/features/chapters/chapters-list/chapter-item/chapter-item-styled.js.map +1 -1
  3. package/dist/features/chapters/chapters-list/chapter-item/chapter-item.js +2 -1
  4. package/dist/features/chapters/chapters-list/chapter-item/chapter-item.js.map +1 -1
  5. package/dist/features/chapters-v2/chapter-details/block-sections/block-section-view.js +7 -7
  6. package/dist/features/chapters-v2/chapter-details/block-sections/block-section-view.js.map +1 -1
  7. package/dist/features/chapters-v2/comps/node-card/node-card-tags.js +6 -6
  8. package/dist/features/chapters-v2/comps/node-card/node-card-tags.js.map +1 -1
  9. package/dist/features/chapters-v2/comps/node-card/student-actions/student-actions.js +2 -2
  10. package/dist/features/chapters-v2/comps/node-card/student-actions/student-actions.js.map +1 -1
  11. package/dist/features/chapters-v2/utils/node-card-utils.js +18 -17
  12. package/dist/features/chapters-v2/utils/node-card-utils.js.map +1 -1
  13. package/dist/features/homework/card-menu-options.js +44 -20
  14. package/dist/features/homework/card-menu-options.js.map +1 -1
  15. package/dist/features/homework/homework-card.js +200 -153
  16. package/dist/features/homework/homework-card.js.map +1 -1
  17. package/dist/features/homework/hw-card-list/hw-card-list.js +444 -0
  18. package/dist/features/homework/hw-card-list/hw-card-list.js.map +1 -0
  19. package/dist/features/homework/styles.js +30 -23
  20. package/dist/features/homework/styles.js.map +1 -1
  21. package/dist/features/milestone/milestone-list-container/api/get-milestone-resources.js +1 -1
  22. package/dist/features/milestone/milestone-list-container/api/get-milestone-resources.js.map +1 -1
  23. package/dist/features/milestone/milestone-list-container/api/get-tests-list.js +1 -1
  24. package/dist/features/milestone/milestone-list-container/api/get-tests-list.js.map +1 -1
  25. package/dist/features/milestone/milestone-tests/tests-list/test-sheets-list/test-sheet-item/test-sheet-item-utils.js +10 -0
  26. package/dist/features/milestone/milestone-tests/tests-list/test-sheets-list/test-sheet-item/test-sheet-item-utils.js.map +1 -0
  27. package/dist/features/recent-chapters/recent-chapters.js +1 -1
  28. package/dist/features/recent-chapters/recent-chapters.js.map +1 -1
  29. package/dist/index.d.ts +8 -2
  30. package/dist/index.js +328 -326
  31. package/dist/index.js.map +1 -1
  32. package/package.json +1 -1
@@ -1,5 +1,5 @@
1
1
  import { createGetAPI as s } from "@cuemath/rest-api";
2
- import { BASE_URL_V3 as a } from "../../../../constants/api.js";
2
+ import { BASE_URL_V3_1 as a } from "../../../../constants/api.js";
3
3
  const { useGet: l, invalidate: m } = s({
4
4
  getURL: (e, r, { studentId: t }) => `${a}/users/${t}/user-milestone/${e}/tests`
5
5
  });
@@ -1 +1 @@
1
- {"version":3,"file":"get-tests-list.js","sources":["../../../../../src/features/milestone/milestone-list-container/api/get-tests-list.ts"],"sourcesContent":["import type { INodeDataProps } from '../../../chapters-v2/comps/node-card/node-card-types';\n\nimport { createGetAPI } from '@cuemath/rest-api';\n\nimport { BASE_URL_V3 } from '../../../../constants/api';\n\n//* Home page test help data.\nconst { useGet: useGetTestHelpData, invalidate: invalidateTestHelpData } = createGetAPI<\n INodeDataProps[],\n void,\n {\n studentId: string;\n }\n>({\n getURL: (userMilestoneId, _, { studentId }) =>\n `${BASE_URL_V3}/users/${studentId}/user-milestone/${userMilestoneId}/tests`,\n});\n\nexport { useGetTestHelpData, invalidateTestHelpData };\n"],"names":["useGetTestHelpData","invalidateTestHelpData","createGetAPI","userMilestoneId","_","studentId","BASE_URL_V3"],"mappings":";;AAOA,MAAM,EAAE,QAAQA,GAAoB,YAAYC,EAAA,IAA2BC,EAMzE;AAAA,EACA,QAAQ,CAACC,GAAiBC,GAAG,EAAE,WAAAC,EAAA,MAC7B,GAAGC,CAAW,UAAUD,CAAS,mBAAmBF,CAAe;AACvE,CAAC;"}
1
+ {"version":3,"file":"get-tests-list.js","sources":["../../../../../src/features/milestone/milestone-list-container/api/get-tests-list.ts"],"sourcesContent":["import type { INodeDataProps } from '../../../chapters-v2/comps/node-card/node-card-types';\n\nimport { createGetAPI } from '@cuemath/rest-api';\n\nimport { BASE_URL_V3_1 } from '../../../../constants/api';\n\n//* Home page test help data.\nconst { useGet: useGetTestHelpData, invalidate: invalidateTestHelpData } = createGetAPI<\n INodeDataProps[],\n void,\n {\n studentId: string;\n }\n>({\n getURL: (userMilestoneId, _, { studentId }) =>\n `${BASE_URL_V3_1}/users/${studentId}/user-milestone/${userMilestoneId}/tests`,\n});\n\nexport { useGetTestHelpData, invalidateTestHelpData };\n"],"names":["useGetTestHelpData","invalidateTestHelpData","createGetAPI","userMilestoneId","_","studentId","BASE_URL_V3_1"],"mappings":";;AAOA,MAAM,EAAE,QAAQA,GAAoB,YAAYC,EAAA,IAA2BC,EAMzE;AAAA,EACA,QAAQ,CAACC,GAAiBC,GAAG,EAAE,WAAAC,EAAA,MAC7B,GAAGC,CAAa,UAAUD,CAAS,mBAAmBF,CAAe;AACzE,CAAC;"}
@@ -0,0 +1,10 @@
1
+ const a = (r) => {
2
+ const o = /* @__PURE__ */ new Set();
3
+ return r == null || r.forEach((c) => {
4
+ o.add(c.chapter_name);
5
+ }), Array.from(o);
6
+ };
7
+ export {
8
+ a as getTopicsFromItems
9
+ };
10
+ //# sourceMappingURL=test-sheet-item-utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"test-sheet-item-utils.js","sources":["../../../../../../../src/features/milestone/milestone-tests/tests-list/test-sheets-list/test-sheet-item/test-sheet-item-utils.ts"],"sourcesContent":["import type {\n TSheetButtonState,\n TSheetButtonVariant,\n} from '../../../../../sheets/comps/sheet-button/types';\nimport type {\n ISheetDataProps,\n TTestHelpItemsDataProps,\n} from '../../../../../sheets/sheets-list/sheet-item/sheet-item-types';\n\nimport { SHEET_STATE } from '../../../../../sheets/constants/sheet';\nimport { IS_CHAPTER_COMPLETED_STATES } from '../../../../create/milestone-create-constants';\n\nconst { COMPLETED } = SHEET_STATE;\n\ninterface IGetTestSheetCtaInfo {\n (\n state: ISheetDataProps['state'],\n permissions: ISheetDataProps['permissions'],\n isStudent: boolean,\n ): {\n state: TSheetButtonState | undefined;\n renderAs: TSheetButtonVariant;\n label: 'Start' | 'Resume' | 'View' | 'Review';\n };\n}\n\nconst getTestCtaInfo: IGetTestSheetCtaInfo = (sheetState, permissions, isStudent) => {\n const { can_start: canStart, can_resume: canResume } = permissions;\n\n const isSheetCompleted =\n sheetState === COMPLETED ||\n IS_CHAPTER_COMPLETED_STATES.some(completedState => completedState === sheetState);\n\n if (isStudent) {\n if (canResume) {\n return {\n state: 'in_progress',\n renderAs: 'primary',\n label: 'Resume',\n };\n }\n\n if (canStart) {\n return {\n state: undefined,\n renderAs: 'primary',\n label: 'Start',\n };\n }\n }\n\n if (isSheetCompleted) {\n return {\n state: 'completed',\n renderAs: 'secondary_black',\n label: 'Review',\n };\n }\n\n return {\n state: canResume ? 'in_progress' : undefined,\n renderAs: 'primary',\n label: 'View',\n };\n};\n\nconst getTopicsFromItems = (items?: TTestHelpItemsDataProps[]) => {\n const topics = new Set<string>();\n\n items?.forEach(item => {\n topics.add(item.chapter_name);\n });\n\n return Array.from(topics);\n};\n\nexport { getTopicsFromItems, getTestCtaInfo };\n"],"names":["getTopicsFromItems","items","topics","item"],"mappings":"AAkEM,MAAAA,IAAqB,CAACC,MAAsC;AAC1D,QAAAC,wBAAa;AAEnB,SAAAD,KAAA,QAAAA,EAAO,QAAQ,CAAQE,MAAA;AACd,IAAAD,EAAA,IAAIC,EAAK,YAAY;AAAA,EAAA,IAGvB,MAAM,KAAKD,CAAM;AAC1B;"}
@@ -18,7 +18,7 @@ const R = ({
18
18
  i();
19
19
  }, [i]), m ? null : e && e.length > 0 ? /* @__PURE__ */ s(d, { $flexRowGapX: 1, children: [
20
20
  /* @__PURE__ */ s(u, { $renderAs: "ac4-black", $color: "BLACK_T_60", children: [
21
- "Recent Chapters ($",
21
+ "Recent Chapters (",
22
22
  e == null ? void 0 : e.length,
23
23
  ")"
24
24
  ] }),
@@ -1 +1 @@
1
- {"version":3,"file":"recent-chapters.js","sources":["../../../src/features/recent-chapters/recent-chapters.tsx"],"sourcesContent":["import type { IChaptersListProps } from '../chapters/chapters-list/chapters-list-types';\nimport type { TCourseStream } from '../milestone/create/milestone-create-types';\nimport type { TUserTypes } from '../ui/types';\nimport type { FC } from 'react';\n\nimport { useCallback, useEffect } from 'react';\n\nimport ChapterItem from '../chapters/chapters-list/chapter-item/chapter-item';\nimport FlexView from '../ui/layout/flex-view';\nimport Text from '../ui/text/text';\nimport { useGetRecentChapters } from './api/get-recent-chapters';\nimport * as Styled from './recent-chapters-styled';\n\ninterface RecentChaptersProps {\n studentId: string;\n courseStream: TCourseStream;\n userType: TUserTypes;\n onChapterClick: IChaptersListProps['onChapterClick'];\n}\n\nconst RecentChapters: FC<RecentChaptersProps> = ({\n studentId,\n courseStream,\n userType,\n onChapterClick,\n}) => {\n const { get: getChapters, data: chapterData, isProcessingFailed } = useGetRecentChapters();\n\n const fetchChapterDetails = useCallback(() => {\n getChapters(studentId, undefined, { courseStream });\n }, [courseStream, getChapters, studentId]);\n\n useEffect(() => {\n fetchChapterDetails();\n }, [fetchChapterDetails]);\n\n if (isProcessingFailed) {\n return null;\n }\n\n if (chapterData && chapterData.length > 0) {\n return (\n <FlexView $flexRowGapX={1}>\n <Text $renderAs=\"ac4-black\" $color=\"BLACK_T_60\">\n Recent Chapters (${chapterData?.length})\n </Text>\n <Styled.ChaptersWrapper>\n {chapterData.map((chapter, idx) => (\n <ChapterItem\n key={chapter.id}\n userType={userType as 'TEACHER' | 'STUDENT'}\n chapter={chapter}\n onChapterClick={onChapterClick}\n itemIndex={idx}\n />\n ))}\n </Styled.ChaptersWrapper>\n </FlexView>\n );\n }\n\n return null;\n};\n\nexport default RecentChapters;\n"],"names":["RecentChapters","studentId","courseStream","userType","onChapterClick","getChapters","chapterData","isProcessingFailed","useGetRecentChapters","fetchChapterDetails","useCallback","useEffect","jsxs","FlexView","Text","jsx","Styled.ChaptersWrapper","chapter","idx","ChapterItem","RecentChapters$1"],"mappings":";;;;;;;AAoBA,MAAMA,IAA0C,CAAC;AAAA,EAC/C,WAAAC;AAAA,EACA,cAAAC;AAAA,EACA,UAAAC;AAAA,EACA,gBAAAC;AACF,MAAM;AACJ,QAAM,EAAE,KAAKC,GAAa,MAAMC,GAAa,oBAAAC,EAAA,IAAuBC,KAE9DC,IAAsBC,EAAY,MAAM;AAC5C,IAAAL,EAAYJ,GAAW,QAAW,EAAE,cAAAC,EAAc,CAAA;AAAA,EACjD,GAAA,CAACA,GAAcG,GAAaJ,CAAS,CAAC;AAMzC,SAJAU,EAAU,MAAM;AACM,IAAAF;EAAA,GACnB,CAACA,CAAmB,CAAC,GAEpBF,IACK,OAGLD,KAAeA,EAAY,SAAS,IAEpC,gBAAAM,EAACC,GAAS,EAAA,cAAc,GACtB,UAAA;AAAA,IAAA,gBAAAD,EAACE,GAAK,EAAA,WAAU,aAAY,QAAO,cAAa,UAAA;AAAA,MAAA;AAAA,MAC3BR,KAAA,gBAAAA,EAAa;AAAA,MAAO;AAAA,IAAA,GACzC;AAAA,IACA,gBAAAS,EAACC,GAAA,EACE,YAAY,IAAI,CAACC,GAASC,MACzB,gBAAAH;AAAA,MAACI;AAAA,MAAA;AAAA,QAEC,UAAAhB;AAAA,QACA,SAAAc;AAAA,QACA,gBAAAb;AAAA,QACA,WAAWc;AAAA,MAAA;AAAA,MAJND,EAAQ;AAAA,IAMhB,CAAA,GACH;AAAA,EACF,EAAA,CAAA,IAIG;AACT,GAEAG,IAAepB;"}
1
+ {"version":3,"file":"recent-chapters.js","sources":["../../../src/features/recent-chapters/recent-chapters.tsx"],"sourcesContent":["import type { IChaptersListProps } from '../chapters/chapters-list/chapters-list-types';\nimport type { TCourseStream } from '../milestone/create/milestone-create-types';\nimport type { TUserTypes } from '../ui/types';\nimport type { FC } from 'react';\n\nimport { useCallback, useEffect } from 'react';\n\nimport ChapterItem from '../chapters/chapters-list/chapter-item/chapter-item';\nimport FlexView from '../ui/layout/flex-view';\nimport Text from '../ui/text/text';\nimport { useGetRecentChapters } from './api/get-recent-chapters';\nimport * as Styled from './recent-chapters-styled';\n\ninterface RecentChaptersProps {\n studentId: string;\n courseStream: TCourseStream;\n userType: TUserTypes;\n onChapterClick: IChaptersListProps['onChapterClick'];\n}\n\nconst RecentChapters: FC<RecentChaptersProps> = ({\n studentId,\n courseStream,\n userType,\n onChapterClick,\n}) => {\n const { get: getChapters, data: chapterData, isProcessingFailed } = useGetRecentChapters();\n\n const fetchChapterDetails = useCallback(() => {\n getChapters(studentId, undefined, { courseStream });\n }, [courseStream, getChapters, studentId]);\n\n useEffect(() => {\n fetchChapterDetails();\n }, [fetchChapterDetails]);\n\n if (isProcessingFailed) {\n return null;\n }\n\n if (chapterData && chapterData.length > 0) {\n return (\n <FlexView $flexRowGapX={1}>\n <Text $renderAs=\"ac4-black\" $color=\"BLACK_T_60\">\n Recent Chapters ({chapterData?.length})\n </Text>\n <Styled.ChaptersWrapper>\n {chapterData.map((chapter, idx) => (\n <ChapterItem\n key={chapter.id}\n userType={userType as 'TEACHER' | 'STUDENT'}\n chapter={chapter}\n onChapterClick={onChapterClick}\n itemIndex={idx}\n />\n ))}\n </Styled.ChaptersWrapper>\n </FlexView>\n );\n }\n\n return null;\n};\n\nexport default RecentChapters;\n"],"names":["RecentChapters","studentId","courseStream","userType","onChapterClick","getChapters","chapterData","isProcessingFailed","useGetRecentChapters","fetchChapterDetails","useCallback","useEffect","jsxs","FlexView","Text","jsx","Styled.ChaptersWrapper","chapter","idx","ChapterItem","RecentChapters$1"],"mappings":";;;;;;;AAoBA,MAAMA,IAA0C,CAAC;AAAA,EAC/C,WAAAC;AAAA,EACA,cAAAC;AAAA,EACA,UAAAC;AAAA,EACA,gBAAAC;AACF,MAAM;AACJ,QAAM,EAAE,KAAKC,GAAa,MAAMC,GAAa,oBAAAC,EAAA,IAAuBC,KAE9DC,IAAsBC,EAAY,MAAM;AAC5C,IAAAL,EAAYJ,GAAW,QAAW,EAAE,cAAAC,EAAc,CAAA;AAAA,EACjD,GAAA,CAACA,GAAcG,GAAaJ,CAAS,CAAC;AAMzC,SAJAU,EAAU,MAAM;AACM,IAAAF;EAAA,GACnB,CAACA,CAAmB,CAAC,GAEpBF,IACK,OAGLD,KAAeA,EAAY,SAAS,IAEpC,gBAAAM,EAACC,GAAS,EAAA,cAAc,GACtB,UAAA;AAAA,IAAA,gBAAAD,EAACE,GAAK,EAAA,WAAU,aAAY,QAAO,cAAa,UAAA;AAAA,MAAA;AAAA,MAC5BR,KAAA,gBAAAA,EAAa;AAAA,MAAO;AAAA,IAAA,GACxC;AAAA,IACA,gBAAAS,EAACC,GAAA,EACE,YAAY,IAAI,CAACC,GAASC,MACzB,gBAAAH;AAAA,MAACI;AAAA,MAAA;AAAA,QAEC,UAAAhB;AAAA,QACA,SAAAc;AAAA,QACA,gBAAAb;AAAA,QACA,WAAWc;AAAA,MAAA;AAAA,MAJND,EAAQ;AAAA,IAMhB,CAAA,GACH;AAAA,EACF,EAAA,CAAA,IAIG;AACT,GAEAG,IAAepB;"}
package/dist/index.d.ts CHANGED
@@ -494,6 +494,12 @@ export declare const HomeIcon: React_2.FC<React_2.SVGProps<SVGSVGElement>>;
494
494
 
495
495
  declare const hues: readonly ["YELLOW", "ORANGE", "PURPLE", "GREEN", "BLUE"];
496
496
 
497
+ export declare const HWCardList: React_2.FC<HWCardListProps>;
498
+
499
+ declare interface HWCardListProps {
500
+ userType: TUserTypes;
501
+ }
502
+
497
503
  declare interface IAccordionSectionProps {
498
504
  headerElement: React.ReactElement;
499
505
  bodyElement: React.ReactElement;
@@ -745,7 +751,7 @@ export declare interface IChapterBlockData {
745
751
 
746
752
  declare interface IChapterBlockPermission {
747
753
  can_skip: boolean;
748
- can_unskip: boolean;
754
+ can_un_skip: boolean;
749
755
  }
750
756
 
751
757
  export declare interface IChapterBlockV3 {
@@ -2125,7 +2131,7 @@ declare interface INodeCardCallbacks {
2125
2131
  onNodeAttempt?: (nodeData: INodeDataProps) => void;
2126
2132
  onNodeView?: (nodeData: INodeDataProps, milestoneId?: string) => void;
2127
2133
  onNodeReview?: (nodeData: INodeDataProps, milestoneId?: string) => void;
2128
- onNodeReattempt?: (nodeData: INodeDataProps) => void;
2134
+ onNodeReattempt?: (nodeData: INodeDataProps, milestoneId?: string) => void;
2129
2135
  onNodeAttemptLocationChange?: (nodeData: INodeDataProps) => void;
2130
2136
  onNodeMarkAsDone?: (nodeData: INodeDataProps) => void;
2131
2137
  onNodeReset?: (nodeData: INodeDataProps, milestoneId?: string) => void;