@cuemath/leap 2.8.61-as1 → 2.8.61-as11
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/chevron-left.js.map +1 -1
- package/dist/assets/line-icons/icons/chevron-right.js.map +1 -1
- package/dist/features/chapters/chapters-list/chapter-item/chapter-item-styled.js +23 -22
- package/dist/features/chapters/chapters-list/chapter-item/chapter-item-styled.js.map +1 -1
- package/dist/features/chapters/chapters-list/chapter-item/chapter-item.js +88 -74
- package/dist/features/chapters/chapters-list/chapter-item/chapter-item.js.map +1 -1
- package/dist/features/chapters/chapters-list/chapters-list.js +17 -18
- package/dist/features/chapters/chapters-list/chapters-list.js.map +1 -1
- package/dist/features/chapters-v2/chapter-details/block-sections/block-section-view.js +39 -39
- 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 +32 -28
- 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 +22 -22
- package/dist/features/chapters-v2/chapter-details/chapter-banner/chapter-banner.js.map +1 -1
- package/dist/features/chapters-v2/comps/node-card/node-card-tags.js +6 -6
- package/dist/features/chapters-v2/comps/node-card/node-card-tags.js.map +1 -1
- package/dist/features/chapters-v2/comps/node-card/teacher-actions/teacher-actions.js +70 -71
- 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 +0 -1
- package/dist/features/chapters-v2/constants/node-constants.js.map +1 -1
- package/dist/features/chapters-v2/utils/index.js +4 -4
- package/dist/features/chapters-v2/utils/index.js.map +1 -1
- package/dist/features/chapters-v2/utils/node-card-utils.js +59 -42
- package/dist/features/chapters-v2/utils/node-card-utils.js.map +1 -1
- package/dist/features/communication/pub-sub/constants.js +5 -2
- package/dist/features/communication/pub-sub/constants.js.map +1 -1
- package/dist/features/homework/card-menu-options.js +35 -20
- package/dist/features/homework/card-menu-options.js.map +1 -1
- package/dist/features/homework/homework-card.js +241 -161
- package/dist/features/homework/homework-card.js.map +1 -1
- package/dist/features/homework/hw-card-list/api/get-homeworks.js +10 -0
- package/dist/features/homework/hw-card-list/api/get-homeworks.js.map +1 -0
- package/dist/features/homework/hw-card-list/hw-card-list-styled.js +53 -0
- package/dist/features/homework/hw-card-list/hw-card-list-styled.js.map +1 -0
- package/dist/features/homework/hw-card-list/hw-card-list.js +164 -0
- package/dist/features/homework/hw-card-list/hw-card-list.js.map +1 -0
- package/dist/features/homework/node-progress.js +29 -0
- package/dist/features/homework/node-progress.js.map +1 -0
- package/dist/features/homework/styles.js +41 -38
- package/dist/features/homework/styles.js.map +1 -1
- package/dist/features/milestone/create/comps/chapter-item/chapter-item.js +42 -49
- package/dist/features/milestone/create/comps/chapter-item/chapter-item.js.map +1 -1
- package/dist/features/milestone/create/comps/sheets-list/sheets-list-styled.js +14 -20
- package/dist/features/milestone/create/comps/sheets-list/sheets-list-styled.js.map +1 -1
- package/dist/features/milestone/create/comps/sheets-list/sheets-list.js +26 -50
- package/dist/features/milestone/create/comps/sheets-list/sheets-list.js.map +1 -1
- package/dist/features/milestone/create/utils/index.js +33 -38
- package/dist/features/milestone/create/utils/index.js.map +1 -1
- package/dist/features/milestone/edit/goal-edit-helpers.js +50 -53
- package/dist/features/milestone/edit/goal-edit-helpers.js.map +1 -1
- package/dist/features/milestone/milestone-list-container/milestone-list/milestone-widget/milestone-info.js +10 -10
- package/dist/features/milestone/milestone-list-container/milestone-list/milestone-widget/milestone-info.js.map +1 -1
- package/dist/features/milestone/milestone-tests/test-list-v2/test-list-view.js +17 -15
- package/dist/features/milestone/milestone-tests/test-list-v2/test-list-view.js.map +1 -1
- package/dist/features/milestone/milestone-tests/tests-list/test-sheets-list/test-sheet-item/test-sheet-item-utils.js +10 -0
- package/dist/features/milestone/milestone-tests/tests-list/test-sheets-list/test-sheet-item/test-sheet-item-utils.js.map +1 -0
- package/dist/features/recent-chapters/recent-chapters.js +17 -23
- package/dist/features/recent-chapters/recent-chapters.js.map +1 -1
- package/dist/features/sheet-v2/resource-list/resource-list.js +12 -10
- package/dist/features/sheet-v2/resource-list/resource-list.js.map +1 -1
- package/dist/index.d.ts +54 -24
- package/dist/index.js +41 -37
- package/dist/index.js.map +1 -1
- package/dist/node_modules/date-fns/differenceInDays.js +17 -0
- package/dist/node_modules/date-fns/differenceInDays.js.map +1 -0
- package/package.json +1 -1
@@ -5,7 +5,7 @@ import V from "../../../../ui/arrow-tooltip/arrow-tooltip.js";
|
|
5
5
|
import v from "../../../../ui/image/image.js";
|
6
6
|
import r from "../../../../ui/layout/flex-view.js";
|
7
7
|
import U from "../../../../ui/separator/separator.js";
|
8
|
-
import
|
8
|
+
import a from "../../../../ui/text/text.js";
|
9
9
|
import Y from "./goals/goal-action-ctas.js";
|
10
10
|
import { GOAL_CATEGORY_BASED_IMAGES as q } from "./milestone-constants.js";
|
11
11
|
import { getRemainingDaysToCompleteGoal as z, getGoalCategoryBasedColorTheme as J, getMilestoneWidgetStatusInfo as Q } from "./milestone-utils.js";
|
@@ -32,7 +32,7 @@ const ue = X(
|
|
32
32
|
goal_category: l,
|
33
33
|
goal_code: g,
|
34
34
|
progress_stat: S
|
35
|
-
} = d, { completed: p = 0, total: k = 0 } = S || {}, h = i === "OUTCOME_PENDING",
|
35
|
+
} = d, { completed: p = 0, total: k = 0 } = S || {}, h = i === "OUTCOME_PENDING", s = p > 0 ? Math.floor((p / k || 1) * 100) : 0, o = j(null), [B, O] = H(!1), { textColor: N, borderColor: $ } = J(l), c = Q(i), R = (h ? c == null ? void 0 : c.progressBackgroundColor : $) || "WHITE_5", M = L(() => typeof g == "string", [g]), P = z(b);
|
36
36
|
return F(() => {
|
37
37
|
o.current && o.current.scrollHeight > o.current.clientHeight && O(!0);
|
38
38
|
}, [o]), l ? /* @__PURE__ */ t(
|
@@ -40,7 +40,7 @@ const ue = X(
|
|
40
40
|
{
|
41
41
|
$flexDirection: "row",
|
42
42
|
$justifyContent: "space-between",
|
43
|
-
$alignItems: "
|
43
|
+
$alignItems: "center",
|
44
44
|
$flexGapX: 1,
|
45
45
|
children: [
|
46
46
|
/* @__PURE__ */ t(r, { $flexDirection: "row", $flexGapX: 1.5, children: [
|
@@ -62,7 +62,7 @@ const ue = X(
|
|
62
62
|
{
|
63
63
|
$progressCircle: !0,
|
64
64
|
$progressBackground: "BLACK_1",
|
65
|
-
$progress:
|
65
|
+
$progress: s * 2,
|
66
66
|
r: "31",
|
67
67
|
cx: "32",
|
68
68
|
cy: "32"
|
@@ -78,14 +78,14 @@ const ue = X(
|
|
78
78
|
height: 40
|
79
79
|
}
|
80
80
|
) }),
|
81
|
-
|
81
|
+
s === 100 && /* @__PURE__ */ e(ee, { children: /* @__PURE__ */ e(K, { width: 20, height: 20 }) })
|
82
82
|
]
|
83
83
|
}
|
84
84
|
),
|
85
85
|
/* @__PURE__ */ t(r, { $flexGap: 16, children: [
|
86
86
|
/* @__PURE__ */ t(r, { $flexGap: 4, children: [
|
87
87
|
/* @__PURE__ */ t(r, { $flexDirection: "row", $alignItems: "center", $flexGap: 4, children: [
|
88
|
-
/* @__PURE__ */ e(
|
88
|
+
/* @__PURE__ */ e(a, { $renderAs: "ac4-black", $color: N, children: l.split("_").join(" ") }),
|
89
89
|
h && /* @__PURE__ */ e(
|
90
90
|
r,
|
91
91
|
{
|
@@ -94,7 +94,7 @@ const ue = X(
|
|
94
94
|
$gutter: 4,
|
95
95
|
$alignItems: "center",
|
96
96
|
$background: R,
|
97
|
-
children: /* @__PURE__ */ e(
|
97
|
+
children: /* @__PURE__ */ e(a, { $renderAs: "ac4", $color: "WHITE", children: "Outcome pending" })
|
98
98
|
}
|
99
99
|
),
|
100
100
|
i === "DRAFT" && /* @__PURE__ */ e(
|
@@ -105,7 +105,7 @@ const ue = X(
|
|
105
105
|
$gutter: 4,
|
106
106
|
$alignItems: "center",
|
107
107
|
$background: $,
|
108
|
-
children: /* @__PURE__ */ e(
|
108
|
+
children: /* @__PURE__ */ e(a, { $renderAs: "ac4", children: "Draft" })
|
109
109
|
}
|
110
110
|
)
|
111
111
|
] }),
|
@@ -126,8 +126,8 @@ const ue = X(
|
|
126
126
|
)
|
127
127
|
}
|
128
128
|
),
|
129
|
-
i !== "DRAFT" && /* @__PURE__ */ t(
|
130
|
-
|
129
|
+
i !== "DRAFT" && s > 0 && /* @__PURE__ */ t(a, { $renderAs: "ub3", $color: "BLACK_T_60", children: [
|
130
|
+
s,
|
131
131
|
"% complete",
|
132
132
|
P
|
133
133
|
] })
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"milestone-info.js","sources":["../../../../../../src/features/milestone/milestone-list-container/milestone-list/milestone-widget/milestone-info.tsx"],"sourcesContent":["import type { IMileStoneInfoWrapperProps } from './milestone-widget-types';\n\nimport React, { memo, useLayoutEffect, useMemo, useRef, useState } from 'react';\n\nimport Check2Icon from '../../../../../assets/line-icons/icons/check2';\nimport ArrowTooltip from '../../../../ui/arrow-tooltip/arrow-tooltip';\nimport Image from '../../../../ui/image/image';\nimport FlexView from '../../../../ui/layout/flex-view';\nimport Separator from '../../../../ui/separator/separator';\nimport Text from '../../../../ui/text/text';\nimport GoalActionCtas from './goals/goal-action-ctas';\nimport { GOAL_CATEGORY_BASED_IMAGES } from './milestone-constants';\nimport {\n getGoalCategoryBasedColorTheme,\n getMilestoneWidgetStatusInfo,\n getRemainingDaysToCompleteGoal,\n} from './milestone-utils';\nimport * as Styled from './milestone-widget-styled';\nimport OutcomeWrapper from './outcome/outcome';\n\nconst MilestoneInfoWrapper: React.FC<IMileStoneInfoWrapperProps> = memo(\n ({ isClassOngoing, isStudentPresent, isExpanded, ...restMilestoneInfoWrapperProps }) => {\n const {\n milestone,\n studentId,\n studentName,\n teacherName,\n parentName,\n userType,\n courseStream,\n outcomes,\n onEdit,\n onDraftPublish,\n onAddOutcome,\n } = restMilestoneInfoWrapperProps;\n\n const {\n milestone_name: milestoneName,\n milestone_date_ts: dueDate,\n milestone_state: milestoneState,\n goal_category: goalCategory,\n goal_code: goalCode,\n progress_stat: progressStat,\n } = milestone;\n\n const { completed = 0, total = 0 } = progressStat || {};\n const isOutcomePending = milestoneState === 'OUTCOME_PENDING';\n const progressCompletionPercentage =\n completed > 0 ? Math.floor((completed / total || 1) * 100) : 0;\n\n const titleTextRef = useRef<HTMLDivElement>(null);\n const [showTitleTooltip, setShowTitleTooltip] = useState(false);\n\n const { textColor: goalCategoryTextColor, borderColor } =\n getGoalCategoryBasedColorTheme(goalCategory);\n\n const outcomeStatusInfo = getMilestoneWidgetStatusInfo(milestoneState);\n const backgroundColor =\n (isOutcomePending ? outcomeStatusInfo?.progressBackgroundColor : borderColor) || 'WHITE_5';\n\n const isGoalCreation = useMemo(() => typeof goalCode === 'string', [goalCode]);\n const remainingDays = getRemainingDaysToCompleteGoal(dueDate);\n\n useLayoutEffect(() => {\n if (\n titleTextRef.current &&\n titleTextRef.current.scrollHeight > titleTextRef.current.clientHeight\n ) {\n setShowTitleTooltip(true);\n }\n }, [titleTextRef]);\n\n if (!goalCategory) return null;\n\n return (\n <FlexView\n $flexDirection=\"row\"\n $justifyContent=\"space-between\"\n $alignItems=\"flex-start\"\n $flexGapX={1}\n >\n <FlexView $flexDirection=\"row\" $flexGapX={1.5}>\n <FlexView\n $widthX={4}\n $heightX={4}\n $background=\"WHITE_T_38\"\n $position=\"relative\"\n $justifyContent=\"center\"\n $alignItems=\"center\"\n $borderRadiusX={2}\n >\n <Styled.ChapterProgressSVG width=\"64px\" height=\"64px\">\n <Styled.ChapterProgressSVGCircle $progress={0} r=\"31\" cx=\"32\" cy=\"32\" />\n <Styled.ChapterProgressSVGCircle\n $progressCircle\n $progressBackground=\"BLACK_1\"\n $progress={progressCompletionPercentage * 2}\n r=\"31\"\n cx=\"32\"\n cy=\"32\"\n />\n </Styled.ChapterProgressSVG>\n\n <FlexView $widthX={4} $heightX={4} $justifyContent=\"center\" $alignItems=\"center\">\n <Image\n src={GOAL_CATEGORY_BASED_IMAGES[goalCategory]}\n withLoader\n width={40}\n height={40}\n />\n </FlexView>\n\n {progressCompletionPercentage === 100 && (\n <Styled.StyledCheckIconWrapper>\n <Check2Icon width={20} height={20} />\n </Styled.StyledCheckIconWrapper>\n )}\n </FlexView>\n\n <FlexView $flexGap={16}>\n <FlexView $flexGap={4}>\n <FlexView $flexDirection=\"row\" $alignItems=\"center\" $flexGap={4}>\n <Text $renderAs=\"ac4-black\" $color={goalCategoryTextColor}>\n {goalCategory.split('_').join(' ')}\n </Text>\n\n {isOutcomePending && (\n <FlexView\n $flexDirection=\"row\"\n $gap={4}\n $gutter={4}\n $alignItems=\"center\"\n $background={backgroundColor}\n >\n <Text $renderAs=\"ac4\" $color=\"WHITE\">\n Outcome pending\n </Text>\n </FlexView>\n )}\n\n {milestoneState === 'DRAFT' && (\n <FlexView\n $flexDirection=\"row\"\n $gap={4}\n $gutter={4}\n $alignItems=\"center\"\n $background={borderColor}\n >\n <Text $renderAs=\"ac4\">Draft</Text>\n </FlexView>\n )}\n </FlexView>\n\n <ArrowTooltip\n renderAs=\"primary\"\n position=\"bottom\"\n tooltipItem={milestoneName}\n hidden={!showTitleTooltip}\n >\n <Styled.MilestoneTitle\n ref={titleTextRef}\n $renderAs={!isGoalCreation ? 'ah3' : 'ah4'}\n >\n {milestoneName}\n </Styled.MilestoneTitle>\n </ArrowTooltip>\n\n {milestoneState !== 'DRAFT' && (\n <Text $renderAs=\"ub3\" $color=\"BLACK_T_60\">\n {progressCompletionPercentage}% complete{remainingDays}\n </Text>\n )}\n </FlexView>\n\n {outcomes?.length ? (\n <>\n <Separator width={40} height={1} background=\"BLACK_T_15\" />\n <OutcomeWrapper outcomes={outcomes} />\n </>\n ) : undefined}\n </FlexView>\n </FlexView>\n\n {userType === 'TEACHER' && (\n <GoalActionCtas\n milestone={milestone}\n studentId={studentId}\n studentName={studentName}\n teacherName={teacherName ?? ''}\n parentName={parentName ?? ''}\n onAddOutcome={onAddOutcome}\n isClassOngoing={Boolean(isClassOngoing)}\n isStudentPresent={Boolean(isStudentPresent)}\n onDraftPublish={onDraftPublish}\n onEdit={onEdit}\n courseStream={courseStream}\n />\n )}\n </FlexView>\n );\n },\n);\n\nexport default MilestoneInfoWrapper;\n"],"names":["MilestoneInfoWrapper","memo","isClassOngoing","isStudentPresent","isExpanded","restMilestoneInfoWrapperProps","milestone","studentId","studentName","teacherName","parentName","userType","courseStream","outcomes","onEdit","onDraftPublish","onAddOutcome","milestoneName","dueDate","milestoneState","goalCategory","goalCode","progressStat","completed","total","isOutcomePending","progressCompletionPercentage","titleTextRef","useRef","showTitleTooltip","setShowTitleTooltip","useState","goalCategoryTextColor","borderColor","getGoalCategoryBasedColorTheme","outcomeStatusInfo","getMilestoneWidgetStatusInfo","backgroundColor","isGoalCreation","useMemo","remainingDays","getRemainingDaysToCompleteGoal","useLayoutEffect","jsxs","FlexView","Styled.ChapterProgressSVG","jsx","Styled.ChapterProgressSVGCircle","Image","GOAL_CATEGORY_BASED_IMAGES","Styled.StyledCheckIconWrapper","Check2Icon","Text","ArrowTooltip","Styled.MilestoneTitle","Fragment","Separator","OutcomeWrapper","GoalActionCtas"],"mappings":";;;;;;;;;;;;;AAoBA,MAAMA,KAA6DC;AAAA,EACjE,CAAC,EAAE,gBAAAC,GAAgB,kBAAAC,GAAkB,YAAAC,IAAY,GAAGC,QAAoC;AAChF,UAAA;AAAA,MACJ,WAAAC;AAAA,MACA,WAAAC;AAAA,MACA,aAAAC;AAAA,MACA,aAAAC;AAAA,MACA,YAAAC;AAAA,MACA,UAAAC;AAAA,MACA,cAAAC;AAAA,MACA,UAAAC;AAAA,MACA,QAAAC;AAAA,MACA,gBAAAC;AAAA,MACA,cAAAC;AAAA,IACE,IAAAX,GAEE;AAAA,MACJ,gBAAgBY;AAAA,MAChB,mBAAmBC;AAAA,MACnB,iBAAiBC;AAAA,MACjB,eAAeC;AAAA,MACf,WAAWC;AAAA,MACX,eAAe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A,cAC1B,gBAAAY;AAAA,cACA,QAAAD;AAAA,cACA,cAAAF;AAAA,YAAA;AAAA,UACF;AAAA,QAAA;AAAA,MAAA;AAAA,IAAA,IA5HoB;AAAA,EAgI5B;AACF;"}
|
1
|
+
{"version":3,"file":"milestone-info.js","sources":["../../../../../../src/features/milestone/milestone-list-container/milestone-list/milestone-widget/milestone-info.tsx"],"sourcesContent":["import type { IMileStoneInfoWrapperProps } from './milestone-widget-types';\n\nimport React, { memo, useLayoutEffect, useMemo, useRef, useState } from 'react';\n\nimport Check2Icon from '../../../../../assets/line-icons/icons/check2';\nimport ArrowTooltip from '../../../../ui/arrow-tooltip/arrow-tooltip';\nimport Image from '../../../../ui/image/image';\nimport FlexView from '../../../../ui/layout/flex-view';\nimport Separator from '../../../../ui/separator/separator';\nimport Text from '../../../../ui/text/text';\nimport GoalActionCtas from './goals/goal-action-ctas';\nimport { GOAL_CATEGORY_BASED_IMAGES } from './milestone-constants';\nimport {\n getGoalCategoryBasedColorTheme,\n getMilestoneWidgetStatusInfo,\n getRemainingDaysToCompleteGoal,\n} from './milestone-utils';\nimport * as Styled from './milestone-widget-styled';\nimport OutcomeWrapper from './outcome/outcome';\n\nconst MilestoneInfoWrapper: React.FC<IMileStoneInfoWrapperProps> = memo(\n ({ isClassOngoing, isStudentPresent, isExpanded, ...restMilestoneInfoWrapperProps }) => {\n const {\n milestone,\n studentId,\n studentName,\n teacherName,\n parentName,\n userType,\n courseStream,\n outcomes,\n onEdit,\n onDraftPublish,\n onAddOutcome,\n } = restMilestoneInfoWrapperProps;\n\n const {\n milestone_name: milestoneName,\n milestone_date_ts: dueDate,\n milestone_state: milestoneState,\n goal_category: goalCategory,\n goal_code: goalCode,\n progress_stat: progressStat,\n } = milestone;\n\n const { completed = 0, total = 0 } = progressStat || {};\n const isOutcomePending = milestoneState === 'OUTCOME_PENDING';\n const progressCompletionPercentage =\n completed > 0 ? Math.floor((completed / total || 1) * 100) : 0;\n\n const titleTextRef = useRef<HTMLDivElement>(null);\n const [showTitleTooltip, setShowTitleTooltip] = useState(false);\n\n const { textColor: goalCategoryTextColor, borderColor } =\n getGoalCategoryBasedColorTheme(goalCategory);\n\n const outcomeStatusInfo = getMilestoneWidgetStatusInfo(milestoneState);\n const backgroundColor =\n (isOutcomePending ? outcomeStatusInfo?.progressBackgroundColor : borderColor) || 'WHITE_5';\n\n const isGoalCreation = useMemo(() => typeof goalCode === 'string', [goalCode]);\n const remainingDays = getRemainingDaysToCompleteGoal(dueDate);\n\n useLayoutEffect(() => {\n if (\n titleTextRef.current &&\n titleTextRef.current.scrollHeight > titleTextRef.current.clientHeight\n ) {\n setShowTitleTooltip(true);\n }\n }, [titleTextRef]);\n\n if (!goalCategory) return null;\n\n return (\n <FlexView\n $flexDirection=\"row\"\n $justifyContent=\"space-between\"\n $alignItems=\"center\"\n $flexGapX={1}\n >\n <FlexView $flexDirection=\"row\" $flexGapX={1.5}>\n <FlexView\n $widthX={4}\n $heightX={4}\n $background=\"WHITE_T_38\"\n $position=\"relative\"\n $justifyContent=\"center\"\n $alignItems=\"center\"\n $borderRadiusX={2}\n >\n <Styled.ChapterProgressSVG width=\"64px\" height=\"64px\">\n <Styled.ChapterProgressSVGCircle $progress={0} r=\"31\" cx=\"32\" cy=\"32\" />\n <Styled.ChapterProgressSVGCircle\n $progressCircle\n $progressBackground=\"BLACK_1\"\n $progress={progressCompletionPercentage * 2}\n r=\"31\"\n cx=\"32\"\n cy=\"32\"\n />\n </Styled.ChapterProgressSVG>\n\n <FlexView $widthX={4} $heightX={4} $justifyContent=\"center\" $alignItems=\"center\">\n <Image\n src={GOAL_CATEGORY_BASED_IMAGES[goalCategory]}\n withLoader\n width={40}\n height={40}\n />\n </FlexView>\n\n {progressCompletionPercentage === 100 && (\n <Styled.StyledCheckIconWrapper>\n <Check2Icon width={20} height={20} />\n </Styled.StyledCheckIconWrapper>\n )}\n </FlexView>\n\n <FlexView $flexGap={16}>\n <FlexView $flexGap={4}>\n <FlexView $flexDirection=\"row\" $alignItems=\"center\" $flexGap={4}>\n <Text $renderAs=\"ac4-black\" $color={goalCategoryTextColor}>\n {goalCategory.split('_').join(' ')}\n </Text>\n\n {isOutcomePending && (\n <FlexView\n $flexDirection=\"row\"\n $gap={4}\n $gutter={4}\n $alignItems=\"center\"\n $background={backgroundColor}\n >\n <Text $renderAs=\"ac4\" $color=\"WHITE\">\n Outcome pending\n </Text>\n </FlexView>\n )}\n\n {milestoneState === 'DRAFT' && (\n <FlexView\n $flexDirection=\"row\"\n $gap={4}\n $gutter={4}\n $alignItems=\"center\"\n $background={borderColor}\n >\n <Text $renderAs=\"ac4\">Draft</Text>\n </FlexView>\n )}\n </FlexView>\n\n <ArrowTooltip\n renderAs=\"primary\"\n position=\"bottom\"\n tooltipItem={milestoneName}\n hidden={!showTitleTooltip}\n >\n <Styled.MilestoneTitle\n ref={titleTextRef}\n $renderAs={!isGoalCreation ? 'ah3' : 'ah4'}\n >\n {milestoneName}\n </Styled.MilestoneTitle>\n </ArrowTooltip>\n\n {milestoneState !== 'DRAFT' && progressCompletionPercentage > 0 && (\n <Text $renderAs=\"ub3\" $color=\"BLACK_T_60\">\n {progressCompletionPercentage}% complete{remainingDays}\n </Text>\n )}\n </FlexView>\n\n {outcomes?.length ? (\n <>\n <Separator width={40} height={1} background=\"BLACK_T_15\" />\n <OutcomeWrapper outcomes={outcomes} />\n </>\n ) : undefined}\n </FlexView>\n </FlexView>\n\n {userType === 'TEACHER' && (\n <GoalActionCtas\n milestone={milestone}\n studentId={studentId}\n studentName={studentName}\n teacherName={teacherName ?? ''}\n parentName={parentName ?? ''}\n onAddOutcome={onAddOutcome}\n isClassOngoing={Boolean(isClassOngoing)}\n isStudentPresent={Boolean(isStudentPresent)}\n onDraftPublish={onDraftPublish}\n onEdit={onEdit}\n courseStream={courseStream}\n />\n )}\n </FlexView>\n );\n },\n);\n\nexport default MilestoneInfoWrapper;\n"],"names":["MilestoneInfoWrapper","memo","isClassOngoing","isStudentPresent","isExpanded","restMilestoneInfoWrapperProps","milestone","studentId","studentName","teacherName","parentName","userType","courseStream","outcomes","onEdit","onDraftPublish","onAddOutcome","milestoneName","dueDate","milestoneState","goalCategory","goalCode","progressStat","completed","total","isOutcomePending","progressCompletionPercentage","titleTextRef","useRef","showTitleTooltip","setShowTitleTooltip","useState","goalCategoryTextColor","borderColor","getGoalCategoryBasedColorTheme","outcomeStatusInfo","getMilestoneWidgetStatusInfo","backgroundColor","isGoalCreation","useMemo","remainingDays","getRemainingDaysToCompleteGoal","useLayoutEffect","jsxs","FlexView","Styled.ChapterProgressSVG","jsx","Styled.ChapterProgressSVGCircle","Image","GOAL_CATEGORY_BASED_IMAGES","Styled.StyledCheckIconWrapper","Check2Icon","Text","ArrowTooltip","Styled.MilestoneTitle","Fragment","Separator","OutcomeWrapper","GoalActionCtas"],"mappings":";;;;;;;;;;;;;AAoBA,MAAMA,KAA6DC;AAAA,EACjE,CAAC,EAAE,gBAAAC,GAAgB,kBAAAC,GAAkB,YAAAC,IAAY,GAAGC,QAAoC;AAChF,UAAA;AAAA,MACJ,WAAAC;AAAA,MACA,WAAAC;AAAA,MACA,aAAAC;AAAA,MACA,aAAAC;AAAA,MACA,YAAAC;AAAA,MACA,UAAAC;AAAA,MACA,cAAAC;AAAA,MACA,UAAAC;AAAA,MACA,QAAAC;AAAA,MACA,gBAAAC;AAAA,MACA,cAAAC;AAAA,IACE,IAAAX,GAEE;AAAA,MACJ,gBAAgBY;AAAA,MAChB,mBAAmBC;AAAA,MACnB,iBAAiBC;AAAA,MACjB,eAAeC;AAAA,MACf,WAAWC;AAAA,MACX,eAAeC;AAAA,IACb,IAAAhB,GAEE,EAAE,WAAAiB,IAAY,GAAG,OAAAC,IAAQ,EAAE,IAAIF,KAAgB,IAC/CG,IAAmBN,MAAmB,mBACtCO,IACJH,IAAY,IAAI,KAAK,OAAOA,IAAYC,KAAS,KAAK,GAAG,IAAI,GAEzDG,IAAeC,EAAuB,IAAI,GAC1C,CAACC,GAAkBC,CAAmB,IAA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|
8
8
|
import { MILESTONE_WIDGET_MIN_HEIGHT as x } from "../../constants.js";
|
9
9
|
import { TESTS_CREATION_ANALYTICS_EVENTS as y } from "../tests-creation/tests-creation-analytics-events.js";
|
10
|
-
import { TestSheetItemWrapper as
|
11
|
-
const
|
10
|
+
import { TestSheetItemWrapper as O, IconContainer as b, IconButtonCover as g } from "./test-list-view-styled.js";
|
11
|
+
const j = (e) => {
|
12
12
|
const o = /* @__PURE__ */ new Set();
|
13
13
|
return e == null || e.forEach((r) => {
|
14
14
|
o.add(r.chapter_name);
|
@@ -19,10 +19,10 @@ const M = (e) => {
|
|
19
19
|
studentId: o,
|
20
20
|
sheets: r,
|
21
21
|
userType: i,
|
22
|
-
onCreateNewTest:
|
23
|
-
isMilestoneActive:
|
24
|
-
canUpdatedPlan:
|
25
|
-
...
|
22
|
+
onCreateNewTest: m,
|
23
|
+
isMilestoneActive: c,
|
24
|
+
canUpdatedPlan: d,
|
25
|
+
...p
|
26
26
|
}) => /* @__PURE__ */ E(
|
27
27
|
w,
|
28
28
|
{
|
@@ -30,14 +30,14 @@ const M = (e) => {
|
|
30
30
|
$position: "relative",
|
31
31
|
$justifyContent: "space-between",
|
32
32
|
children: [
|
33
|
-
/* @__PURE__ */ t(
|
33
|
+
/* @__PURE__ */ t(O, { children: r.map((s, a) => {
|
34
34
|
const {
|
35
35
|
items: l,
|
36
36
|
node_id: h,
|
37
37
|
sheet_time: T,
|
38
38
|
total_questions: n,
|
39
39
|
worksheet_id: f
|
40
|
-
} = s, u = Math.ceil((T || 0) / 60), I =
|
40
|
+
} = s, u = Math.ceil((T || 0) / 60), I = j(l), _ = `${typeof n == "number" ? `${n} ${$.pluralize(n, "Question")}, ` : ""}${u} Mins`;
|
41
41
|
return /* @__PURE__ */ t(
|
42
42
|
A,
|
43
43
|
{
|
@@ -45,26 +45,28 @@ const M = (e) => {
|
|
45
45
|
header: I,
|
46
46
|
subHeader: _,
|
47
47
|
nodeData: s,
|
48
|
-
|
48
|
+
renderAs: "milestone",
|
49
|
+
shouldOpenOnRight: (a + 1) % 3 === 0,
|
50
|
+
...p
|
49
51
|
},
|
50
|
-
`${f}_${h}_${
|
52
|
+
`${f}_${h}_${a}`
|
51
53
|
);
|
52
54
|
}) }),
|
53
|
-
i === "TEACHER" &&
|
54
|
-
|
55
|
+
i === "TEACHER" && d && /* @__PURE__ */ t(
|
56
|
+
b,
|
55
57
|
{
|
56
58
|
$flexDirection: "row",
|
57
59
|
$justifyContent: "flex-end",
|
58
60
|
$gapX: 1,
|
59
61
|
$gutterX: 1,
|
60
|
-
children: /* @__PURE__ */ t(
|
62
|
+
children: /* @__PURE__ */ t(g, { children: /* @__PURE__ */ t(
|
61
63
|
N,
|
62
64
|
{
|
63
65
|
Icon: S,
|
64
66
|
renderAs: "secondary",
|
65
67
|
analyticsLabel: y.CUSTOM_TEST_CREATION_STARTED,
|
66
|
-
onClick:
|
67
|
-
disabled: !
|
68
|
+
onClick: m,
|
69
|
+
disabled: !c,
|
68
70
|
analyticsProps: {
|
69
71
|
milestone_id: e
|
70
72
|
}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"test-list-view.js","sources":["../../../../../src/features/milestone/milestone-tests/test-list-v2/test-list-view.tsx"],"sourcesContent":["import type { TNodeDataTestItemsDataProps } from '../../../chapters-v2/comps/node-card/node-card-types';\nimport type { ITestSheetsList } from './types';\nimport type { FC } from 'react';\n\nimport { pluralize } from 'humanize-plus';\nimport { memo } from 'react';\n\nimport Plus2Icon from '../../../../assets/line-icons/icons/plus2';\nimport HomeworkCard from '../../../homework/homework-card';\nimport IconButton from '../../../ui/buttons/icon-button/icon-button';\nimport FlexView from '../../../ui/layout/flex-view';\nimport { MILESTONE_WIDGET_MIN_HEIGHT } from '../../constants';\nimport { TESTS_CREATION_ANALYTICS_EVENTS } from '../tests-creation/tests-creation-analytics-events';\nimport * as Styled from './test-list-view-styled';\n\nconst getTopicNameFromItems = (items?: TNodeDataTestItemsDataProps[]) => {\n const topics = new Set<string>();\n\n items?.forEach(item => {\n topics.add(item.chapter_name);\n });\n\n return Array.from(topics).join(', ');\n};\n\nconst TestSheetsList: FC<ITestSheetsList> = memo(\n ({\n milestoneId,\n studentId,\n sheets,\n userType,\n onCreateNewTest,\n isMilestoneActive,\n canUpdatedPlan,\n ...sheetCallbacks\n }) => {\n return (\n <FlexView\n $height={MILESTONE_WIDGET_MIN_HEIGHT}\n $position=\"relative\"\n $justifyContent=\"space-between\"\n >\n <Styled.TestSheetItemWrapper>\n {sheets.map((sheet, idx) => {\n const {\n items,\n node_id: nodeId,\n sheet_time: sheetTime,\n total_questions: totalQuestions,\n worksheet_id: worksheetId,\n } = sheet;\n const totalSheetTime = Math.ceil((sheetTime || 0) / 60);\n const testChapterName = getTopicNameFromItems(items);\n const subHeader = `${\n typeof totalQuestions === 'number'\n ? `${totalQuestions} ${pluralize(totalQuestions, 'Question')}, `\n : ''\n }${totalSheetTime} Mins`;\n\n return (\n <HomeworkCard\n key={`${worksheetId}_${nodeId}_${idx}`}\n userType={userType}\n header={testChapterName}\n subHeader={subHeader}\n nodeData={sheet}\n {...sheetCallbacks}\n />\n );\n })}\n </Styled.TestSheetItemWrapper>\n\n {userType === 'TEACHER' && canUpdatedPlan && (\n <Styled.IconContainer\n $flexDirection=\"row\"\n $justifyContent=\"flex-end\"\n $gapX={1}\n $gutterX={1}\n >\n <Styled.IconButtonCover>\n <IconButton\n Icon={Plus2Icon}\n renderAs=\"secondary\"\n analyticsLabel={TESTS_CREATION_ANALYTICS_EVENTS.CUSTOM_TEST_CREATION_STARTED}\n onClick={onCreateNewTest}\n disabled={!isMilestoneActive}\n analyticsProps={{\n milestone_id: milestoneId,\n }}\n />\n </Styled.IconButtonCover>\n </Styled.IconContainer>\n )}\n </FlexView>\n );\n },\n);\n\nexport default TestSheetsList;\n"],"names":["getTopicNameFromItems","items","topics","item","TestSheetsList","memo","milestoneId","studentId","sheets","userType","onCreateNewTest","isMilestoneActive","canUpdatedPlan","sheetCallbacks","jsxs","FlexView","MILESTONE_WIDGET_MIN_HEIGHT","jsx","Styled.TestSheetItemWrapper","sheet","idx","nodeId","sheetTime","totalQuestions","worksheetId","totalSheetTime","testChapterName","subHeader","pluralize","HomeworkCard","Styled.IconContainer","Styled.IconButtonCover","IconButton","Plus2Icon","TESTS_CREATION_ANALYTICS_EVENTS"],"mappings":";;;;;;;;;;AAeA,MAAMA,IAAwB,CAACC,MAA0C;AACjE,QAAAC,wBAAa;AAEnB,SAAAD,KAAA,QAAAA,EAAO,QAAQ,CAAQE,MAAA;AACd,IAAAD,EAAA,IAAIC,EAAK,YAAY;AAAA,EAAA,IAGvB,MAAM,KAAKD,CAAM,EAAE,KAAK,IAAI;AACrC,GAEME,IAAsCC;AAAA,EAC1C,CAAC;AAAA,IACC,aAAAC;AAAA,IACA,WAAAC;AAAA,IACA,QAAAC;AAAA,IACA,UAAAC;AAAA,IACA,iBAAAC;AAAA,IACA,mBAAAC;AAAA,IACA,gBAAAC;AAAA,IACA,GAAGC;AAAA,EAAA,MAGD,gBAAAC;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,SAASC;AAAA,MACT,WAAU;AAAA,MACV,iBAAgB;AAAA,MAEhB,UAAA;AAAA,QAAA,gBAAAC,EAACC,GAAA,EACE,YAAO,IAAI,CAACC,GAAOC,MAAQ;AACpB,gBAAA;AAAA,YACJ,OAAAnB;AAAA,YACA,SAASoB;AAAA,YACT,YAAYC;AAAA,YACZ,iBAAiBC;AAAA,YACjB,cAAcC;AAAA,UACZ,IAAAL,GACEM,IAAiB,KAAK,MAAMH,KAAa,KAAK,EAAE,GAChDI,IAAkB1B,EAAsBC,CAAK,GAC7C0B,IAAY,GAChB,OAAOJ,KAAmB,WACtB,GAAGA,CAAc,IAAIK,EAAA,UAAUL,GAAgB,UAAU,CAAC,OAC1D,EACN,GAAGE,CAAc;AAGf,iBAAA,gBAAAR;AAAA,YAACY;AAAA,YAAA;AAAA,cAEC,UAAApB;AAAA,cACA,QAAQiB;AAAA,cACR,WAAAC;AAAA,cACA,UAAUR;AAAA,cACT,
|
1
|
+
{"version":3,"file":"test-list-view.js","sources":["../../../../../src/features/milestone/milestone-tests/test-list-v2/test-list-view.tsx"],"sourcesContent":["import type { TNodeDataTestItemsDataProps } from '../../../chapters-v2/comps/node-card/node-card-types';\nimport type { ITestSheetsList } from './types';\nimport type { FC } from 'react';\n\nimport { pluralize } from 'humanize-plus';\nimport { memo } from 'react';\n\nimport Plus2Icon from '../../../../assets/line-icons/icons/plus2';\nimport HomeworkCard from '../../../homework/homework-card';\nimport IconButton from '../../../ui/buttons/icon-button/icon-button';\nimport FlexView from '../../../ui/layout/flex-view';\nimport { MILESTONE_WIDGET_MIN_HEIGHT } from '../../constants';\nimport { TESTS_CREATION_ANALYTICS_EVENTS } from '../tests-creation/tests-creation-analytics-events';\nimport * as Styled from './test-list-view-styled';\n\nconst getTopicNameFromItems = (items?: TNodeDataTestItemsDataProps[]) => {\n const topics = new Set<string>();\n\n items?.forEach(item => {\n topics.add(item.chapter_name);\n });\n\n return Array.from(topics).join(', ');\n};\n\nconst TestSheetsList: FC<ITestSheetsList> = memo(\n ({\n milestoneId,\n studentId,\n sheets,\n userType,\n onCreateNewTest,\n isMilestoneActive,\n canUpdatedPlan,\n ...sheetCallbacks\n }) => {\n return (\n <FlexView\n $height={MILESTONE_WIDGET_MIN_HEIGHT}\n $position=\"relative\"\n $justifyContent=\"space-between\"\n >\n <Styled.TestSheetItemWrapper>\n {sheets.map((sheet, idx) => {\n const {\n items,\n node_id: nodeId,\n sheet_time: sheetTime,\n total_questions: totalQuestions,\n worksheet_id: worksheetId,\n } = sheet;\n const totalSheetTime = Math.ceil((sheetTime || 0) / 60);\n const testChapterName = getTopicNameFromItems(items);\n const subHeader = `${\n typeof totalQuestions === 'number'\n ? `${totalQuestions} ${pluralize(totalQuestions, 'Question')}, `\n : ''\n }${totalSheetTime} Mins`;\n\n return (\n <HomeworkCard\n key={`${worksheetId}_${nodeId}_${idx}`}\n userType={userType}\n header={testChapterName}\n subHeader={subHeader}\n nodeData={sheet}\n renderAs=\"milestone\"\n shouldOpenOnRight={(idx + 1) % 3 === 0}\n {...sheetCallbacks}\n />\n );\n })}\n </Styled.TestSheetItemWrapper>\n\n {userType === 'TEACHER' && canUpdatedPlan && (\n <Styled.IconContainer\n $flexDirection=\"row\"\n $justifyContent=\"flex-end\"\n $gapX={1}\n $gutterX={1}\n >\n <Styled.IconButtonCover>\n <IconButton\n Icon={Plus2Icon}\n renderAs=\"secondary\"\n analyticsLabel={TESTS_CREATION_ANALYTICS_EVENTS.CUSTOM_TEST_CREATION_STARTED}\n onClick={onCreateNewTest}\n disabled={!isMilestoneActive}\n analyticsProps={{\n milestone_id: milestoneId,\n }}\n />\n </Styled.IconButtonCover>\n </Styled.IconContainer>\n )}\n </FlexView>\n );\n },\n);\n\nexport default TestSheetsList;\n"],"names":["getTopicNameFromItems","items","topics","item","TestSheetsList","memo","milestoneId","studentId","sheets","userType","onCreateNewTest","isMilestoneActive","canUpdatedPlan","sheetCallbacks","jsxs","FlexView","MILESTONE_WIDGET_MIN_HEIGHT","jsx","Styled.TestSheetItemWrapper","sheet","idx","nodeId","sheetTime","totalQuestions","worksheetId","totalSheetTime","testChapterName","subHeader","pluralize","HomeworkCard","Styled.IconContainer","Styled.IconButtonCover","IconButton","Plus2Icon","TESTS_CREATION_ANALYTICS_EVENTS"],"mappings":";;;;;;;;;;AAeA,MAAMA,IAAwB,CAACC,MAA0C;AACjE,QAAAC,wBAAa;AAEnB,SAAAD,KAAA,QAAAA,EAAO,QAAQ,CAAQE,MAAA;AACd,IAAAD,EAAA,IAAIC,EAAK,YAAY;AAAA,EAAA,IAGvB,MAAM,KAAKD,CAAM,EAAE,KAAK,IAAI;AACrC,GAEME,IAAsCC;AAAA,EAC1C,CAAC;AAAA,IACC,aAAAC;AAAA,IACA,WAAAC;AAAA,IACA,QAAAC;AAAA,IACA,UAAAC;AAAA,IACA,iBAAAC;AAAA,IACA,mBAAAC;AAAA,IACA,gBAAAC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,YAAA,GAEJ;AAAA,UAAA;AAAA,QACF;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAKV;"}
|
@@ -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;"}
|
@@ -1,40 +1,34 @@
|
|
1
1
|
import { jsxs as s, jsx as l } from "react/jsx-runtime";
|
2
|
-
import { useCallback as
|
3
|
-
import
|
4
|
-
import
|
5
|
-
import
|
6
|
-
import { useGetRecentChapters as
|
7
|
-
import { ChaptersWrapper as
|
8
|
-
const
|
9
|
-
|
10
|
-
courseStream: t,
|
11
|
-
userType: p,
|
12
|
-
onChapterClick: a
|
13
|
-
}) => {
|
14
|
-
const { get: o, data: e, isProcessingFailed: m } = x(), i = f(() => {
|
2
|
+
import { useCallback as c, useEffect as f } from "react";
|
3
|
+
import h from "../chapters/chapters-list/chapter-item/chapter-item.js";
|
4
|
+
import C from "../ui/layout/flex-view.js";
|
5
|
+
import d from "../ui/text/text.js";
|
6
|
+
import { useGetRecentChapters as u } from "./api/get-recent-chapters.js";
|
7
|
+
import { ChaptersWrapper as x } from "./recent-chapters-styled.js";
|
8
|
+
const g = ({ studentId: r, courseStream: t, onChapterClick: p }) => {
|
9
|
+
const { get: o, data: e, isProcessingFailed: a } = u(), i = c(() => {
|
15
10
|
o(r, void 0, { courseStream: t });
|
16
11
|
}, [t, o, r]);
|
17
|
-
return
|
12
|
+
return f(() => {
|
18
13
|
i();
|
19
|
-
}, [i]),
|
20
|
-
/* @__PURE__ */ s(
|
14
|
+
}, [i]), a ? null : e && e.length > 0 ? /* @__PURE__ */ s(C, { $flexRowGapX: 1, children: [
|
15
|
+
/* @__PURE__ */ s(d, { $renderAs: "ac4-black", $color: "BLACK_T_60", children: [
|
21
16
|
"Recent Chapters (",
|
22
17
|
e == null ? void 0 : e.length,
|
23
18
|
")"
|
24
19
|
] }),
|
25
|
-
/* @__PURE__ */ l(
|
26
|
-
|
20
|
+
/* @__PURE__ */ l(x, { children: e.map((n, m) => /* @__PURE__ */ l(
|
21
|
+
h,
|
27
22
|
{
|
28
|
-
userType: p,
|
29
23
|
chapter: n,
|
30
|
-
onChapterClick:
|
31
|
-
itemIndex:
|
24
|
+
onChapterClick: p,
|
25
|
+
itemIndex: m
|
32
26
|
},
|
33
27
|
n.id
|
34
28
|
)) })
|
35
29
|
] }) : null;
|
36
|
-
},
|
30
|
+
}, F = g;
|
37
31
|
export {
|
38
|
-
|
32
|
+
F as default
|
39
33
|
};
|
40
34
|
//# sourceMappingURL=recent-chapters.js.map
|
@@ -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> = ({
|
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> = ({ studentId, courseStream, onChapterClick }) => {\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 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","onChapterClick","getChapters","chapterData","isProcessingFailed","useGetRecentChapters","fetchChapterDetails","useCallback","useEffect","jsxs","FlexView","Text","jsx","Styled.ChaptersWrapper","chapter","idx","ChapterItem","RecentChapters$1"],"mappings":";;;;;;;AAoBA,MAAMA,IAA0C,CAAC,EAAE,WAAAC,GAAW,cAAAC,GAAc,gBAAAC,QAAqB;AAC/F,QAAM,EAAE,KAAKC,GAAa,MAAMC,GAAa,oBAAAC,EAAA,IAAuBC,KAE9DC,IAAsBC,EAAY,MAAM;AAC5C,IAAAL,EAAYH,GAAW,QAAW,EAAE,cAAAC,EAAc,CAAA;AAAA,EACjD,GAAA,CAACA,GAAcE,GAAaH,CAAS,CAAC;AAMzC,SAJAS,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,SAAAF;AAAA,QACA,gBAAAb;AAAA,QACA,WAAWc;AAAA,MAAA;AAAA,MAHND,EAAQ;AAAA,IAKhB,CAAA,GACH;AAAA,EACF,EAAA,CAAA,IAIG;AACT,GAEAG,IAAenB;"}
|
@@ -1,16 +1,16 @@
|
|
1
1
|
import { jsx as s } from "react/jsx-runtime";
|
2
|
-
import { h as
|
3
|
-
import { memo as
|
2
|
+
import { h as p } from "../../../node_modules/humanize-plus/dist/humanize.js";
|
3
|
+
import { memo as c } from "react";
|
4
4
|
import u from "styled-components";
|
5
5
|
import l from "../../homework/homework-card.js";
|
6
6
|
import f from "../../ui/layout/flex-view.js";
|
7
|
-
const
|
7
|
+
const h = u.div`
|
8
8
|
display: grid;
|
9
9
|
grid-template-columns: repeat(3, 200px);
|
10
10
|
grid-gap: 32px;
|
11
11
|
justify-content: center;
|
12
12
|
padding: 32px 0;
|
13
|
-
`,
|
13
|
+
`, E = (r) => {
|
14
14
|
const {
|
15
15
|
sheet_time: t,
|
16
16
|
node_type: o,
|
@@ -20,7 +20,7 @@ const E = u.div`
|
|
20
20
|
case "ASSESSMENT":
|
21
21
|
case "MASTERY":
|
22
22
|
case "DYNAMIC":
|
23
|
-
return `${typeof e == "number" ? `${e} ${
|
23
|
+
return `${typeof e == "number" ? `${e} ${p.pluralize(e, "Question")}, ${t ? `${t / 60} min` : ""}` : ""}`;
|
24
24
|
case "PUZZLE_EASY":
|
25
25
|
case "PUZZLE_HARD":
|
26
26
|
case "PUZZLE_MEDIUM":
|
@@ -29,20 +29,22 @@ const E = u.div`
|
|
29
29
|
default:
|
30
30
|
return "";
|
31
31
|
}
|
32
|
-
},
|
33
|
-
const { title:
|
32
|
+
}, _ = ({ sheets: r, userType: t, ...o }) => /* @__PURE__ */ s(f, { children: /* @__PURE__ */ s(h, { children: r.map((e, n) => {
|
33
|
+
const { title: i, node_id: a, worksheet_id: d } = e, m = E(e);
|
34
34
|
return /* @__PURE__ */ s(
|
35
35
|
l,
|
36
36
|
{
|
37
|
-
header:
|
37
|
+
header: i,
|
38
38
|
subHeader: m,
|
39
39
|
userType: t,
|
40
40
|
nodeData: e,
|
41
|
+
renderAs: "milestone",
|
42
|
+
shouldOpenOnRight: (n + 1) % 3 === 0,
|
41
43
|
...o
|
42
44
|
},
|
43
|
-
`${d}_${a}_${
|
45
|
+
`${d}_${a}_${n}`
|
44
46
|
);
|
45
|
-
}) }) }), y =
|
47
|
+
}) }) }), y = c(_);
|
46
48
|
export {
|
47
49
|
y as default
|
48
50
|
};
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"resource-list.js","sources":["../../../../src/features/sheet-v2/resource-list/resource-list.tsx"],"sourcesContent":["import type { INodeDataProps } from '../../chapters-v2/comps/node-card/node-card-types';\nimport type { IResourcesListProps } from './types';\nimport type { FC } from 'react';\n\nimport { pluralize } from 'humanize-plus';\nimport { memo } from 'react';\nimport styled from 'styled-components';\n\nimport HomeworkCard from '../../homework/homework-card';\nimport FlexView from '../../ui/layout/flex-view';\n\nconst ResourceItemListWrapper = styled.div`\n display: grid;\n grid-template-columns: repeat(3, 200px);\n grid-gap: 32px;\n justify-content: center;\n padding: 32px 0;\n`;\n\nconst getSubHeader = (sheet: INodeDataProps) => {\n const {\n sheet_time: sheetTime,\n node_type: nodeType,\n total_questions: totalQuestions,\n } = sheet || {};\n\n switch (nodeType) {\n case 'ASSESSMENT':\n case 'MASTERY':\n case 'DYNAMIC':\n return `${\n typeof totalQuestions === 'number'\n ? `${totalQuestions} ${pluralize(totalQuestions, 'Question')}, ${\n sheetTime ? `${sheetTime / 60} min` : ''\n }`\n : ''\n }`;\n case 'PUZZLE_EASY':\n case 'PUZZLE_HARD':\n case 'PUZZLE_MEDIUM':\n case 'PUZZLE':\n return '';\n default:\n return '';\n }\n};\n\nconst ResourcesList: FC<IResourcesListProps> = ({ sheets, userType, ...sheetCallBacks }) => (\n <FlexView>\n <ResourceItemListWrapper>\n {sheets.map((sheet, idx) => {\n const { title, node_id: nodeId, worksheet_id: worksheetId } = sheet;\n const subHeader = getSubHeader(sheet);\n\n return (\n <HomeworkCard\n key={`${worksheetId}_${nodeId}_${idx}`}\n header={title}\n subHeader={subHeader}\n userType={userType}\n nodeData={sheet}\n {...sheetCallBacks}\n />\n );\n })}\n </ResourceItemListWrapper>\n </FlexView>\n);\n\nexport default memo(ResourcesList);\n"],"names":["ResourceItemListWrapper","styled","getSubHeader","sheet","sheetTime","nodeType","totalQuestions","pluralize","ResourcesList","sheets","userType","sheetCallBacks","jsx","FlexView","idx","title","nodeId","worksheetId","subHeader","HomeworkCard","ResourcesList$1","memo"],"mappings":";;;;;;AAWA,MAAMA,IAA0BC,EAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,GAQjCC,IAAe,CAACC,MAA0B;AACxC,QAAA;AAAA,IACJ,YAAYC;AAAA,IACZ,WAAWC;AAAA,IACX,iBAAiBC;AAAA,EAAA,IACfH,KAAS,CAAA;AAEb,UAAQE,GAAU;AAAA,IAChB,KAAK;AAAA,IACL,KAAK;AAAA,IACL,KAAK;AACH,aAAO,GACL,OAAOC,KAAmB,WACtB,GAAGA,CAAc,IAAIC,YAAUD,GAAgB,UAAU,CAAC,KACxDF,IAAY,GAAGA,IAAY,EAAE,SAAS,EACxC,KACA,EACN;AAAA,IACF,KAAK;AAAA,IACL,KAAK;AAAA,IACL,KAAK;AAAA,IACL,KAAK;AACI,aAAA;AAAA,IACT;AACS,aAAA;AAAA,EACX;AACF,GAEMI,IAAyC,CAAC,EAAE,QAAAC,GAAQ,UAAAC,GAAU,GAAGC,EAAe,MACnF,gBAAAC,EAAAC,GAAA,EACC,4BAACb,GACE,EAAA,UAAAS,EAAO,IAAI,CAACN,GAAOW,MAAQ;AAC1B,QAAM,EAAE,OAAAC,GAAO,SAASC,GAAQ,cAAcC,EAAgB,IAAAd,GACxDe,IAAYhB,EAAaC,CAAK;AAGlC,SAAA,gBAAAS;AAAA,IAACO;AAAA,IAAA;AAAA,MAEC,QAAQJ;AAAA,MACR,WAAAG;AAAA,MACA,UAAAR;AAAA,MACA,UAAUP;AAAA,MACT,
|
1
|
+
{"version":3,"file":"resource-list.js","sources":["../../../../src/features/sheet-v2/resource-list/resource-list.tsx"],"sourcesContent":["import type { INodeDataProps } from '../../chapters-v2/comps/node-card/node-card-types';\nimport type { IResourcesListProps } from './types';\nimport type { FC } from 'react';\n\nimport { pluralize } from 'humanize-plus';\nimport { memo } from 'react';\nimport styled from 'styled-components';\n\nimport HomeworkCard from '../../homework/homework-card';\nimport FlexView from '../../ui/layout/flex-view';\n\nconst ResourceItemListWrapper = styled.div`\n display: grid;\n grid-template-columns: repeat(3, 200px);\n grid-gap: 32px;\n justify-content: center;\n padding: 32px 0;\n`;\n\nconst getSubHeader = (sheet: INodeDataProps) => {\n const {\n sheet_time: sheetTime,\n node_type: nodeType,\n total_questions: totalQuestions,\n } = sheet || {};\n\n switch (nodeType) {\n case 'ASSESSMENT':\n case 'MASTERY':\n case 'DYNAMIC':\n return `${\n typeof totalQuestions === 'number'\n ? `${totalQuestions} ${pluralize(totalQuestions, 'Question')}, ${\n sheetTime ? `${sheetTime / 60} min` : ''\n }`\n : ''\n }`;\n case 'PUZZLE_EASY':\n case 'PUZZLE_HARD':\n case 'PUZZLE_MEDIUM':\n case 'PUZZLE':\n return '';\n default:\n return '';\n }\n};\n\nconst ResourcesList: FC<IResourcesListProps> = ({ sheets, userType, ...sheetCallBacks }) => (\n <FlexView>\n <ResourceItemListWrapper>\n {sheets.map((sheet, idx) => {\n const { title, node_id: nodeId, worksheet_id: worksheetId } = sheet;\n const subHeader = getSubHeader(sheet);\n\n return (\n <HomeworkCard\n key={`${worksheetId}_${nodeId}_${idx}`}\n header={title}\n subHeader={subHeader}\n userType={userType}\n nodeData={sheet}\n renderAs=\"milestone\"\n shouldOpenOnRight={(idx + 1) % 3 === 0}\n {...sheetCallBacks}\n />\n );\n })}\n </ResourceItemListWrapper>\n </FlexView>\n);\n\nexport default memo(ResourcesList);\n"],"names":["ResourceItemListWrapper","styled","getSubHeader","sheet","sheetTime","nodeType","totalQuestions","pluralize","ResourcesList","sheets","userType","sheetCallBacks","jsx","FlexView","idx","title","nodeId","worksheetId","subHeader","HomeworkCard","ResourcesList$1","memo"],"mappings":";;;;;;AAWA,MAAMA,IAA0BC,EAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,GAQjCC,IAAe,CAACC,MAA0B;AACxC,QAAA;AAAA,IACJ,YAAYC;AAAA,IACZ,WAAWC;AAAA,IACX,iBAAiBC;AAAA,EAAA,IACfH,KAAS,CAAA;AAEb,UAAQE,GAAU;AAAA,IAChB,KAAK;AAAA,IACL,KAAK;AAAA,IACL,KAAK;AACH,aAAO,GACL,OAAOC,KAAmB,WACtB,GAAGA,CAAc,IAAIC,YAAUD,GAAgB,UAAU,CAAC,KACxDF,IAAY,GAAGA,IAAY,EAAE,SAAS,EACxC,KACA,EACN;AAAA,IACF,KAAK;AAAA,IACL,KAAK;AAAA,IACL,KAAK;AAAA,IACL,KAAK;AACI,aAAA;AAAA,IACT;AACS,aAAA;AAAA,EACX;AACF,GAEMI,IAAyC,CAAC,EAAE,QAAAC,GAAQ,UAAAC,GAAU,GAAGC,EAAe,MACnF,gBAAAC,EAAAC,GAAA,EACC,4BAACb,GACE,EAAA,UAAAS,EAAO,IAAI,CAACN,GAAOW,MAAQ;AAC1B,QAAM,EAAE,OAAAC,GAAO,SAASC,GAAQ,cAAcC,EAAgB,IAAAd,GACxDe,IAAYhB,EAAaC,CAAK;AAGlC,SAAA,gBAAAS;AAAA,IAACO;AAAA,IAAA;AAAA,MAEC,QAAQJ;AAAA,MACR,WAAAG;AAAA,MACA,UAAAR;AAAA,MACA,UAAUP;AAAA,MACV,UAAS;AAAA,MACT,oBAAoBW,IAAM,KAAK,MAAM;AAAA,MACpC,GAAGH;AAAA,IAAA;AAAA,IAPC,GAAGM,CAAW,IAAID,CAAM,IAAIF,CAAG;AAAA,EAAA;AAU1C,CAAC,GACH,EACF,CAAA,GAGaM,IAAAC,EAAKb,CAAa;"}
|
package/dist/index.d.ts
CHANGED
@@ -94,22 +94,7 @@ declare const BLOCK_STATUS: {
|
|
94
94
|
readonly LOCKED: "LOCKED";
|
95
95
|
};
|
96
96
|
|
97
|
-
declare
|
98
|
-
readonly DEFAULT: "DEFAULT";
|
99
|
-
readonly PREREQ: "PREREQ";
|
100
|
-
readonly RECAP: "RECAP";
|
101
|
-
readonly GOAL: "GOAL";
|
102
|
-
readonly TESTS: "TESTS";
|
103
|
-
readonly PLAYLIST: "PLAYLIST";
|
104
|
-
readonly SOLUTIONS: "SOLUTIONS";
|
105
|
-
readonly NOTES: "NOTES";
|
106
|
-
readonly FLASHCARDS: "FLASHCARDS";
|
107
|
-
readonly SUBJECTIVES: "SUBJECTIVES";
|
108
|
-
readonly PUZZLE_CARDS: "PUZZLE_CARDS";
|
109
|
-
readonly SAT_MOCK_TEST: "SAT_MOCK_TEST";
|
110
|
-
};
|
111
|
-
|
112
|
-
declare enum BLOCK_TYPE_2 {
|
97
|
+
declare enum BLOCK_TYPE {
|
113
98
|
DEFAULT = "DEFAULT",
|
114
99
|
PREREQ = "PREREQ",
|
115
100
|
RECAP = "RECAP",
|
@@ -124,6 +109,21 @@ declare enum BLOCK_TYPE_2 {
|
|
124
109
|
SAT_MOCK_TEST = "SAT_MOCK_TEST"
|
125
110
|
}
|
126
111
|
|
112
|
+
declare const BLOCK_TYPE_2: {
|
113
|
+
readonly DEFAULT: "DEFAULT";
|
114
|
+
readonly PREREQ: "PREREQ";
|
115
|
+
readonly RECAP: "RECAP";
|
116
|
+
readonly GOAL: "GOAL";
|
117
|
+
readonly TESTS: "TESTS";
|
118
|
+
readonly PLAYLIST: "PLAYLIST";
|
119
|
+
readonly SOLUTIONS: "SOLUTIONS";
|
120
|
+
readonly NOTES: "NOTES";
|
121
|
+
readonly FLASHCARDS: "FLASHCARDS";
|
122
|
+
readonly SUBJECTIVES: "SUBJECTIVES";
|
123
|
+
readonly PUZZLE_CARDS: "PUZZLE_CARDS";
|
124
|
+
readonly SAT_MOCK_TEST: "SAT_MOCK_TEST";
|
125
|
+
};
|
126
|
+
|
127
127
|
export declare const Book2Icon: React_2.FC<React_2.SVGProps<SVGSVGElement>>;
|
128
128
|
|
129
129
|
export declare const BookClosedIcon: React.FC<React.SVGProps<SVGSVGElement>>;
|
@@ -352,6 +352,7 @@ declare interface ErrorProps {
|
|
352
352
|
}
|
353
353
|
|
354
354
|
export declare const EVENTS: {
|
355
|
+
HOMEWORK_UNASSIGN: "HOMEWORK_UNASSIGN";
|
355
356
|
GOAL_CREATED: "GOAL_CREATED";
|
356
357
|
GOAL_EDITED: "GOAL_EDITED";
|
357
358
|
GOAL_DELETED: "GOAL_DELETED";
|
@@ -492,8 +493,19 @@ export declare const HighlighterIcon: React.FC<React.SVGProps<SVGSVGElement>>;
|
|
492
493
|
|
493
494
|
export declare const HomeIcon: React_2.FC<React_2.SVGProps<SVGSVGElement>>;
|
494
495
|
|
496
|
+
export declare const HomeworkCardList: React_2.FC<HWCardListProps>;
|
497
|
+
|
495
498
|
declare const hues: readonly ["YELLOW", "ORANGE", "PURPLE", "GREEN", "BLUE"];
|
496
499
|
|
500
|
+
declare interface HWCardListProps extends INodeCardCallbacks {
|
501
|
+
userType: TUserTypes;
|
502
|
+
studentId: string;
|
503
|
+
stream: string;
|
504
|
+
onTestPreview?: (sheetData: INodeDataProps, milestoneId?: string) => void;
|
505
|
+
onTestStart?: (sheetData: INodeDataProps) => void;
|
506
|
+
onTestReview?: (sheetData: INodeDataProps, milestoneId?: string) => void;
|
507
|
+
}
|
508
|
+
|
497
509
|
declare interface IAccordionSectionProps {
|
498
510
|
headerElement: React.ReactElement;
|
499
511
|
bodyElement: React.ReactElement;
|
@@ -725,12 +737,11 @@ declare interface ICascadingSelectInputProps {
|
|
725
737
|
|
726
738
|
declare interface IChapter extends IChapterState, Pick<IChapterModel, 'code' | 'id' | 'chapter_code' | 'image_url' | 'name' | 'chapter_tags' | 'state' | 'recommended' | 'is_puzzle_chapter' | 'program_id'> {
|
727
739
|
search_and_added?: boolean;
|
728
|
-
total_supplementary_sheets: number;
|
729
740
|
learning_sheet_data: ILearningSheetData[];
|
730
741
|
}
|
731
742
|
|
732
743
|
export declare interface IChapterBlockData {
|
733
|
-
block_type: keyof typeof
|
744
|
+
block_type: keyof typeof BLOCK_TYPE;
|
734
745
|
chapter_code: string;
|
735
746
|
code: string;
|
736
747
|
block_id: string;
|
@@ -777,12 +788,17 @@ export declare interface IChapterDataProps {
|
|
777
788
|
user_chapter_progress: IUserChapterProgressProps;
|
778
789
|
state: TUserChapterStates | null;
|
779
790
|
program_id: string;
|
780
|
-
progress_stat:
|
791
|
+
progress_stat: {
|
792
|
+
classwork: IMilestoneData['progress_stat'];
|
793
|
+
mandatory: IMilestoneData['progress_stat'];
|
794
|
+
optional: IMilestoneData['progress_stat'];
|
795
|
+
};
|
781
796
|
sheets_data: {
|
782
797
|
lessons: ILessonsListProps['lessons'];
|
783
798
|
supplementary_sheets_group_sort_order: string[];
|
784
799
|
supplementary_sheets_grouped: Record<string, ISheetsListProps['sheets']>;
|
785
800
|
};
|
801
|
+
blocks: IUserChapterData['blocks'];
|
786
802
|
}
|
787
803
|
|
788
804
|
declare interface IChapterDetails extends IBlockSectionsCallbacks {
|
@@ -814,6 +830,7 @@ declare interface IChapterModel {
|
|
814
830
|
mastery_time: number;
|
815
831
|
chapter_time_unit: TTimeUnit;
|
816
832
|
is_puzzle_chapter?: boolean;
|
833
|
+
blocks: IUserChapterData['blocks'];
|
817
834
|
}
|
818
835
|
|
819
836
|
declare interface IChapterProgressInfo {
|
@@ -1302,6 +1319,11 @@ declare interface IGradeSelectorProps {
|
|
1302
1319
|
layoutAlignment?: 'center' | 'auto';
|
1303
1320
|
}
|
1304
1321
|
|
1322
|
+
export declare interface IHomeworkData extends INodeDataProps {
|
1323
|
+
homework_id: string;
|
1324
|
+
chapter_name: string;
|
1325
|
+
}
|
1326
|
+
|
1305
1327
|
declare interface IIconButtonProps extends Omit<IButtonProps, 'label' | 'shape' | 'widthX' | 'width' | 'iconPosition' | 'alignSelf' | 'analyticsLabel' | 'renderAs'>, Required<Pick<IClickableAnalyticsProps, 'analyticsLabel'>> {
|
1306
1328
|
Icon: React.FC<React.SVGProps<SVGSVGElement>>;
|
1307
1329
|
customBgColor?: TColorNames;
|
@@ -1458,8 +1480,7 @@ declare interface ILeaderboardProps {
|
|
1458
1480
|
}
|
1459
1481
|
|
1460
1482
|
declare interface ILearningSheetData {
|
1461
|
-
|
1462
|
-
learnosityRef: string;
|
1483
|
+
name: string;
|
1463
1484
|
}
|
1464
1485
|
|
1465
1486
|
declare interface ILearnosity {
|
@@ -2125,11 +2146,11 @@ declare interface INodeCardCallbacks {
|
|
2125
2146
|
onNodeAttempt?: (nodeData: INodeDataProps) => void;
|
2126
2147
|
onNodeView?: (nodeData: INodeDataProps, milestoneId?: string) => void;
|
2127
2148
|
onNodeReview?: (nodeData: INodeDataProps, milestoneId?: string) => void;
|
2128
|
-
onNodeReattempt?: (nodeData: INodeDataProps) => void;
|
2149
|
+
onNodeReattempt?: (nodeData: INodeDataProps, milestoneId?: string) => void;
|
2129
2150
|
onNodeAttemptLocationChange?: (nodeData: INodeDataProps) => void;
|
2130
2151
|
onNodeMarkAsDone?: (nodeData: INodeDataProps) => void;
|
2131
2152
|
onNodeReset?: (nodeData: INodeDataProps, milestoneId?: string) => void;
|
2132
|
-
onNodeUnassign?: (nodeData: INodeDataProps, milestoneId?: string) => void;
|
2153
|
+
onNodeUnassign?: (nodeData: INodeDataProps | IHomeworkData, milestoneId?: string) => void;
|
2133
2154
|
}
|
2134
2155
|
|
2135
2156
|
export declare interface INodeDataProps {
|
@@ -2160,7 +2181,9 @@ export declare interface INodeDataProps {
|
|
2160
2181
|
image_url: string;
|
2161
2182
|
image_hue: THueNames;
|
2162
2183
|
total_questions: number | null;
|
2184
|
+
unlocked_on_ts: number | null;
|
2163
2185
|
items?: TNodeDataTestItemsDataProps[];
|
2186
|
+
user_milestone_id?: string;
|
2164
2187
|
}
|
2165
2188
|
|
2166
2189
|
declare interface INodePermissions {
|
@@ -2185,6 +2208,8 @@ export declare interface INudgeProps {
|
|
2185
2208
|
|
2186
2209
|
export declare const invalidateGetChapterDetails: (id: string, query?: void | undefined, allIdsInvalid?: boolean) => void;
|
2187
2210
|
|
2211
|
+
export declare const invalidateHomeworks: (id: string, query?: void | undefined, allIdsInvalid?: boolean) => void;
|
2212
|
+
|
2188
2213
|
export declare const invalidateMilestoneResources: (id: string, query?: void | undefined, allIdsInvalid?: boolean) => void;
|
2189
2214
|
|
2190
2215
|
export declare const invalidateMilestonesData: (query?: TQuery | undefined) => void;
|
@@ -4230,7 +4255,7 @@ declare type TBlockStatsData = {
|
|
4230
4255
|
|
4231
4256
|
declare type TBlockStatus = keyof typeof BLOCK_STATUS;
|
4232
4257
|
|
4233
|
-
declare type TBlockType = keyof typeof
|
4258
|
+
declare type TBlockType = keyof typeof BLOCK_TYPE_2;
|
4234
4259
|
|
4235
4260
|
export declare type TButtonSizes = 'xsmall' | 'small' | 'regular' | 'medium' | 'large';
|
4236
4261
|
|
@@ -4474,6 +4499,11 @@ export declare type TInclassMessage = {
|
|
4474
4499
|
eventPayload: {
|
4475
4500
|
worksheetId: string;
|
4476
4501
|
};
|
4502
|
+
} | {
|
4503
|
+
eventName: typeof EVENTS.HOMEWORK_UNASSIGN;
|
4504
|
+
eventPayload: {
|
4505
|
+
studentId: string;
|
4506
|
+
};
|
4477
4507
|
} | {
|
4478
4508
|
eventName: typeof EVENTS.CHAPTER_UPDATED;
|
4479
4509
|
eventPayload: {
|