@cuemath/leap 3.1.2-beta-0.1 → 3.1.2-beta-0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/features/milestone/milestone-list-container/api/get-past-milestone-count.js +8 -8
- package/dist/features/milestone/milestone-list-container/api/get-past-milestone-count.js.map +1 -1
- package/dist/features/milestone/milestone-list-container/milestone-list/milestone-list.js +103 -124
- package/dist/features/milestone/milestone-list-container/milestone-list/milestone-list.js.map +1 -1
- package/dist/features/milestone/milestone-list-container/milestone-list/milestone-widget/milestone-widget-styled.js +15 -14
- package/dist/features/milestone/milestone-list-container/milestone-list/milestone-widget/milestone-widget-styled.js.map +1 -1
- package/dist/index.d.ts +9 -6
- package/package.json +1 -1
@@ -1,13 +1,13 @@
|
|
1
|
-
import {
|
2
|
-
import {
|
3
|
-
const {
|
4
|
-
getURL: (e) => {
|
5
|
-
const { milestone_state_group:
|
6
|
-
return `${n}/user-milestones/users/${
|
1
|
+
import { createGetAPI as r } from "@cuemath/rest-api";
|
2
|
+
import { BASE_URL_V3 as n } from "../../../../constants/api.js";
|
3
|
+
const { useGet: m, invalidate: c } = r({
|
4
|
+
getURL: (e, u, t) => {
|
5
|
+
const { milestone_state_group: s, course_stream: o } = t;
|
6
|
+
return `${n}/user-milestones/users/${e}/course-streams/${o}/${s}/count`;
|
7
7
|
}
|
8
8
|
});
|
9
9
|
export {
|
10
|
-
|
11
|
-
|
10
|
+
c as invalidatePastMilestoneCount,
|
11
|
+
m as useGetPastMilestoneCount
|
12
12
|
};
|
13
13
|
//# sourceMappingURL=get-past-milestone-count.js.map
|
package/dist/features/milestone/milestone-list-container/api/get-past-milestone-count.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"get-past-milestone-count.js","sources":["../../../../../src/features/milestone/milestone-list-container/api/get-past-milestone-count.ts"],"sourcesContent":["import type { TCourseStream } from '../../create/milestone-create-types';\
|
1
|
+
{"version":3,"file":"get-past-milestone-count.js","sources":["../../../../../src/features/milestone/milestone-list-container/api/get-past-milestone-count.ts"],"sourcesContent":["import type { TCourseStream } from '../../create/milestone-create-types';\n\nimport { createGetAPI } from '@cuemath/rest-api';\n\nimport { BASE_URL_V3 } from '../../../../constants/api';\n\ntype TQuery = {\n milestone_state_group: 'ALL' | 'DRAFT' | 'STUDENT_ALL' | 'LIVE' | 'STUDENT_LIVE' | 'INACTIVE';\n course_stream: TCourseStream;\n};\n\nconst { useGet: useGetPastMilestoneCount, invalidate: invalidatePastMilestoneCount } = createGetAPI<\n {\n user_milestones_count: number;\n },\n void,\n TQuery\n>({\n getURL: (studentId, _, query) => {\n const { milestone_state_group, course_stream } = query;\n\n return `${BASE_URL_V3}/user-milestones/users/${studentId}/course-streams/${course_stream}/${milestone_state_group}/count`;\n },\n});\n\nexport { useGetPastMilestoneCount, invalidatePastMilestoneCount };\n"],"names":["useGetPastMilestoneCount","invalidatePastMilestoneCount","createGetAPI","studentId","_","query","milestone_state_group","course_stream","BASE_URL_V3"],"mappings":";;AAWA,MAAM,EAAE,QAAQA,GAA0B,YAAYC,EAAA,IAAiCC,EAMrF;AAAA,EACA,QAAQ,CAACC,GAAWC,GAAGC,MAAU;AACzB,UAAA,EAAE,uBAAAC,GAAuB,eAAAC,EAAkB,IAAAF;AAEjD,WAAO,GAAGG,CAAW,0BAA0BL,CAAS,mBAAmBI,CAAa,IAAID,CAAqB;AAAA,EACnH;AACF,CAAC;"}
|
@@ -1,157 +1,136 @@
|
|
1
|
-
import { jsxs as
|
2
|
-
import
|
3
|
-
import
|
1
|
+
import { jsxs as r, Fragment as K, jsx as o } from "react/jsx-runtime";
|
2
|
+
import Q, { memo as Y, useCallback as h } from "react";
|
3
|
+
import Z from "../../../hooks/use-lazy-ref.js";
|
4
4
|
import u from "../../../ui/buttons/text-button/text-button.js";
|
5
|
-
import
|
6
|
-
import
|
7
|
-
import
|
8
|
-
import
|
9
|
-
import
|
10
|
-
import
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
const [a, N] = ie(!1), {
|
5
|
+
import d from "../../../ui/layout/flex-view.js";
|
6
|
+
import ee from "../../../ui/separator/separator.js";
|
7
|
+
import te from "../../../ui/text/text.js";
|
8
|
+
import oe from "./milestone-widget/milestone-widget.js";
|
9
|
+
import ne from "./no-active-milestone/no-active-milestone.js";
|
10
|
+
import ie from "../../../../node_modules/uuid/dist/esm-browser/v4.js";
|
11
|
+
const ue = Y(
|
12
|
+
({ milestones: e, studentId: A, milestoneType: a, ...g }) => {
|
13
|
+
const {
|
15
14
|
canCreatePlan: m,
|
16
|
-
isClassOngoing:
|
17
|
-
isFiltersAdded:
|
18
|
-
isStudentPresent:
|
19
|
-
onAddChapter:
|
20
|
-
onAddOutcome:
|
21
|
-
onChapterClick:
|
22
|
-
onCreatePlan:
|
23
|
-
onDelete:
|
24
|
-
onDraftPublish:
|
25
|
-
onEdit:
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
onNodeReview: k,
|
15
|
+
isClassOngoing: C,
|
16
|
+
isFiltersAdded: M,
|
17
|
+
isStudentPresent: T,
|
18
|
+
onAddChapter: N,
|
19
|
+
onAddOutcome: n,
|
20
|
+
onChapterClick: v,
|
21
|
+
onCreatePlan: i,
|
22
|
+
onDelete: R,
|
23
|
+
onDraftPublish: w,
|
24
|
+
onEdit: x,
|
25
|
+
onCreateMilestoneTest: b,
|
26
|
+
onNodeAttempt: D,
|
27
|
+
onNodeView: $,
|
28
|
+
onNodeReview: P,
|
31
29
|
onNodeReattempt: F,
|
32
|
-
onNodeReset:
|
33
|
-
onNodeUnassign:
|
34
|
-
onAssignResources:
|
35
|
-
onTestPreview:
|
36
|
-
onTestReview:
|
37
|
-
onTestStart:
|
38
|
-
activeMilestoneId:
|
39
|
-
activeTabId:
|
40
|
-
onWidgetTabSelection:
|
41
|
-
studentName:
|
42
|
-
teacherName:
|
43
|
-
parentName:
|
44
|
-
userType:
|
45
|
-
courseStream:
|
46
|
-
onNodeAssignAsHomework:
|
47
|
-
} =
|
48
|
-
|
49
|
-
}, [
|
50
|
-
|
51
|
-
},
|
52
|
-
i == null || i();
|
53
|
-
}, [i]);
|
30
|
+
onNodeReset: I,
|
31
|
+
onNodeUnassign: k,
|
32
|
+
onAssignResources: E,
|
33
|
+
onTestPreview: S,
|
34
|
+
onTestReview: V,
|
35
|
+
onTestStart: _,
|
36
|
+
activeMilestoneId: j,
|
37
|
+
activeTabId: z,
|
38
|
+
onWidgetTabSelection: B,
|
39
|
+
studentName: c,
|
40
|
+
teacherName: G,
|
41
|
+
parentName: y,
|
42
|
+
userType: l,
|
43
|
+
courseStream: H,
|
44
|
+
onNodeAssignAsHomework: L
|
45
|
+
} = g, s = a === "ACTIVE", f = a === "DRAFT", p = Z(ie), O = h(() => {
|
46
|
+
i == null || i(p);
|
47
|
+
}, [i, p]), W = h(() => {
|
48
|
+
n == null || n();
|
49
|
+
}, [n]);
|
54
50
|
if (!e) return null;
|
55
|
-
const
|
56
|
-
(
|
57
|
-
),
|
58
|
-
(
|
51
|
+
const X = e.some(
|
52
|
+
(t) => t.milestone_state === "ACTIVE"
|
53
|
+
), U = e.some(
|
54
|
+
(t) => t.milestone_state === "DRAFT"
|
59
55
|
);
|
60
|
-
return /* @__PURE__ */
|
61
|
-
|
62
|
-
|
56
|
+
return /* @__PURE__ */ r(K, { children: [
|
57
|
+
s && !X && /* @__PURE__ */ o(d, { $marginBottom: 40, children: /* @__PURE__ */ o(
|
58
|
+
ne,
|
63
59
|
{
|
64
60
|
canCreatePlan: m,
|
65
|
-
isDraftMilestonePresent:
|
66
|
-
isFiltersAdded:
|
67
|
-
onCreatePlan:
|
68
|
-
studentName:
|
69
|
-
userType:
|
61
|
+
isDraftMilestonePresent: U,
|
62
|
+
isFiltersAdded: M,
|
63
|
+
onCreatePlan: i,
|
64
|
+
studentName: c,
|
65
|
+
userType: l
|
70
66
|
}
|
71
67
|
) }),
|
72
|
-
|
73
|
-
/* @__PURE__ */
|
68
|
+
s && /* @__PURE__ */ r(d, { $flexDirection: "row", $justifyContent: "space-between", $marginBottom: 16, children: [
|
69
|
+
/* @__PURE__ */ r(te, { $renderAs: "ac4", children: [
|
74
70
|
"Goals (",
|
75
71
|
e.length,
|
76
72
|
")"
|
77
73
|
] }),
|
78
|
-
|
79
|
-
/* @__PURE__ */
|
74
|
+
l === "TEACHER" && /* @__PURE__ */ r(d, { $flexDirection: "row", $flexGapX: 1, children: [
|
75
|
+
/* @__PURE__ */ o(
|
80
76
|
u,
|
81
77
|
{
|
82
78
|
label: "Create Goal",
|
83
79
|
size: "small",
|
84
|
-
onClick:
|
80
|
+
onClick: O,
|
85
81
|
disabled: !m
|
86
82
|
}
|
87
83
|
),
|
88
|
-
/* @__PURE__ */
|
84
|
+
/* @__PURE__ */ o(u, { label: "Add Milestone", size: "small", onClick: W })
|
89
85
|
] })
|
90
86
|
] }),
|
91
|
-
|
92
|
-
|
93
|
-
{
|
94
|
-
|
95
|
-
|
96
|
-
$justifyContent: "space-between",
|
97
|
-
$marginBottomX: 1,
|
98
|
-
children: [
|
99
|
-
/* @__PURE__ */ t(C, { $renderAs: "ac4", children: [
|
100
|
-
"PAST LEARNING PLANS & OUTCOMES (",
|
101
|
-
e.length,
|
102
|
-
")"
|
103
|
-
] }),
|
104
|
-
/* @__PURE__ */ n(le, { onClick: J, $expanded: a })
|
105
|
-
]
|
106
|
-
}
|
107
|
-
),
|
108
|
-
(A || l || a) && e.map((o, Z) => {
|
109
|
-
const { id: ee } = o;
|
110
|
-
return /* @__PURE__ */ t(ne.Fragment, { children: [
|
111
|
-
/* @__PURE__ */ n(
|
112
|
-
ae,
|
87
|
+
(f || s) && e.map((t, q) => {
|
88
|
+
const { id: J } = t;
|
89
|
+
return /* @__PURE__ */ r(Q.Fragment, { children: [
|
90
|
+
/* @__PURE__ */ o(
|
91
|
+
oe,
|
113
92
|
{
|
114
|
-
milestone:
|
115
|
-
studentId:
|
116
|
-
studentName:
|
117
|
-
parentName:
|
118
|
-
teacherName:
|
119
|
-
userType:
|
120
|
-
onAddOutcome:
|
121
|
-
onChapterClick:
|
122
|
-
isMilestoneActive:
|
123
|
-
milestoneType:
|
124
|
-
onEdit:
|
125
|
-
onCreateMilestoneTest:
|
126
|
-
onAddChapter:
|
127
|
-
onDelete:
|
128
|
-
onDraftPublish:
|
129
|
-
isClassOngoing:
|
130
|
-
isStudentPresent:
|
131
|
-
onAssignResources:
|
132
|
-
onNodeAttempt:
|
133
|
-
onNodeView:
|
134
|
-
onNodeReview:
|
93
|
+
milestone: t,
|
94
|
+
studentId: A,
|
95
|
+
studentName: c,
|
96
|
+
parentName: y,
|
97
|
+
teacherName: G,
|
98
|
+
userType: l,
|
99
|
+
onAddOutcome: n,
|
100
|
+
onChapterClick: v,
|
101
|
+
isMilestoneActive: s || f,
|
102
|
+
milestoneType: a,
|
103
|
+
onEdit: x,
|
104
|
+
onCreateMilestoneTest: b,
|
105
|
+
onAddChapter: N,
|
106
|
+
onDelete: R,
|
107
|
+
onDraftPublish: w,
|
108
|
+
isClassOngoing: C,
|
109
|
+
isStudentPresent: T,
|
110
|
+
onAssignResources: E,
|
111
|
+
onNodeAttempt: D,
|
112
|
+
onNodeView: $,
|
113
|
+
onNodeReview: P,
|
135
114
|
onNodeReattempt: F,
|
136
|
-
onNodeReset:
|
137
|
-
onNodeUnassign:
|
138
|
-
onNodeAssignAsHomework:
|
139
|
-
onTestPreview:
|
140
|
-
onTestReview:
|
141
|
-
onTestStart:
|
142
|
-
courseStream:
|
143
|
-
activeMilestoneId:
|
144
|
-
activeTabId:
|
145
|
-
onWidgetTabSelection:
|
115
|
+
onNodeReset: I,
|
116
|
+
onNodeUnassign: k,
|
117
|
+
onNodeAssignAsHomework: L,
|
118
|
+
onTestPreview: S,
|
119
|
+
onTestReview: V,
|
120
|
+
onTestStart: _,
|
121
|
+
courseStream: H,
|
122
|
+
activeMilestoneId: j,
|
123
|
+
activeTabId: z,
|
124
|
+
onWidgetTabSelection: B
|
146
125
|
}
|
147
126
|
),
|
148
|
-
|
149
|
-
] }, `milestone=${
|
127
|
+
q !== e.length - 1 && /* @__PURE__ */ o(ee, { heightX: 2 })
|
128
|
+
] }, `milestone=${J}`);
|
150
129
|
})
|
151
130
|
] });
|
152
131
|
}
|
153
132
|
);
|
154
133
|
export {
|
155
|
-
|
134
|
+
ue as default
|
156
135
|
};
|
157
136
|
//# sourceMappingURL=milestone-list.js.map
|
package/dist/features/milestone/milestone-list-container/milestone-list/milestone-list.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"milestone-list.js","sources":["../../../../../src/features/milestone/milestone-list-container/milestone-list/milestone-list.tsx"],"sourcesContent":["import type { IMilestoneListProps } from './milestone-list-types';\n\nimport React, { memo, useCallback, useState } from 'react';\nimport { v4 as uuidv4 } from 'uuid';\n\nimport useLazyRef from '../../../hooks/use-lazy-ref';\nimport TextButton from '../../../ui/buttons/text-button/text-button';\nimport FlexView from '../../../ui/layout/flex-view';\nimport Separator from '../../../ui/separator/separator';\nimport Text from '../../../ui/text/text';\nimport MilestoneWidget from './milestone-widget/milestone-widget';\nimport { StyledDownIcon } from './milestone-widget/milestone-widget-styled';\nimport NoActiveMilestone from './no-active-milestone/no-active-milestone';\n\nconst MilestoneList: React.FC<IMilestoneListProps> = memo(\n ({ milestones, studentId, milestoneType, ...restMilestoneListProps }) => {\n const [expandInactiveMilestones, setExpandInactiveMilestones] = useState(false);\n const {\n canCreatePlan,\n isClassOngoing,\n isFiltersAdded,\n isStudentPresent,\n onAddChapter,\n onAddOutcome,\n onChapterClick,\n onCreatePlan,\n onDelete,\n onDraftPublish,\n onEdit,\n onExpandPastMilestones,\n onCreateMilestoneTest,\n onNodeAttempt,\n onNodeView,\n onNodeReview,\n onNodeReattempt,\n onNodeReset,\n onNodeUnassign,\n onAssignResources,\n onTestPreview,\n onTestReview,\n onTestStart,\n activeMilestoneId,\n activeTabId,\n onWidgetTabSelection,\n studentName,\n teacherName,\n parentName,\n userType,\n courseStream,\n onNodeAssignAsHomework,\n } = restMilestoneListProps;\n\n const isMilestoneActive = milestoneType === 'ACTIVE';\n const isDraftMilestone = milestoneType === 'DRAFT';\n const temporaryMilestoneId = useLazyRef(uuidv4);\n\n const handleCreatePlan = useCallback(() => {\n onCreatePlan?.(temporaryMilestoneId);\n }, [onCreatePlan, temporaryMilestoneId]);\n\n const toggleExpand = () => {\n if (!expandInactiveMilestones && onExpandPastMilestones) {\n onExpandPastMilestones();\n }\n setExpandInactiveMilestones(!expandInactiveMilestones);\n };\n\n const handleOnAddOutcome = useCallback(() => {\n onAddOutcome?.();\n }, [onAddOutcome]);\n\n if (!milestones) return null;\n\n const activeMilestonePresent = milestones.some(\n milestone => milestone.milestone_state === 'ACTIVE',\n );\n const draftMilestonePresent = milestones.some(\n milestone => milestone.milestone_state === 'DRAFT',\n );\n\n return (\n <>\n {isMilestoneActive && !activeMilestonePresent && (\n <FlexView $marginBottom={40}>\n <NoActiveMilestone\n canCreatePlan={canCreatePlan}\n isDraftMilestonePresent={draftMilestonePresent}\n isFiltersAdded={isFiltersAdded}\n onCreatePlan={onCreatePlan}\n studentName={studentName}\n userType={userType}\n />\n </FlexView>\n )}\n\n {isMilestoneActive && (\n <FlexView $flexDirection=\"row\" $justifyContent=\"space-between\" $marginBottom={16}>\n <Text $renderAs=\"ac4\">Goals ({milestones.length})</Text>\n\n {userType === 'TEACHER' && (\n <FlexView $flexDirection=\"row\" $flexGapX={1}>\n <TextButton\n label=\"Create Goal\"\n size=\"small\"\n onClick={handleCreatePlan}\n disabled={!canCreatePlan}\n />\n <TextButton label=\"Add Milestone\" size=\"small\" onClick={handleOnAddOutcome} />\n </FlexView>\n )}\n </FlexView>\n )}\n\n {milestoneType === 'INACTIVE' && Boolean(milestones.length) && (\n <FlexView\n $flexDirection=\"row\"\n $alignItems=\"center\"\n $justifyContent=\"space-between\"\n $marginBottomX={1}\n >\n <Text $renderAs=\"ac4\">PAST LEARNING PLANS & OUTCOMES ({milestones.length})</Text>\n <StyledDownIcon onClick={toggleExpand} $expanded={expandInactiveMilestones} />\n </FlexView>\n )}\n\n {(isDraftMilestone || isMilestoneActive || expandInactiveMilestones) &&\n milestones.map((milestone, idx) => {\n const { id: milestoneId } = milestone;\n\n return (\n <React.Fragment key={`milestone=${milestoneId}`}>\n <MilestoneWidget\n milestone={milestone}\n studentId={studentId}\n studentName={studentName}\n parentName={parentName}\n teacherName={teacherName}\n userType={userType}\n onAddOutcome={onAddOutcome}\n onChapterClick={onChapterClick}\n isMilestoneActive={isMilestoneActive || isDraftMilestone}\n milestoneType={milestoneType}\n onEdit={onEdit}\n onCreateMilestoneTest={onCreateMilestoneTest}\n onAddChapter={onAddChapter}\n onDelete={onDelete}\n onDraftPublish={onDraftPublish}\n isClassOngoing={isClassOngoing}\n isStudentPresent={isStudentPresent}\n onAssignResources={onAssignResources}\n onNodeAttempt={onNodeAttempt}\n onNodeView={onNodeView}\n onNodeReview={onNodeReview}\n onNodeReattempt={onNodeReattempt}\n onNodeReset={onNodeReset}\n onNodeUnassign={onNodeUnassign}\n onNodeAssignAsHomework={onNodeAssignAsHomework}\n onTestPreview={onTestPreview}\n onTestReview={onTestReview}\n onTestStart={onTestStart}\n courseStream={courseStream}\n activeMilestoneId={activeMilestoneId}\n activeTabId={activeTabId}\n onWidgetTabSelection={onWidgetTabSelection}\n />\n {idx !== milestones.length - 1 && <Separator heightX={2} />}\n </React.Fragment>\n );\n })}\n </>\n );\n },\n);\n\nexport default MilestoneList;\n"],"names":["MilestoneList","memo","milestones","studentId","milestoneType","restMilestoneListProps","expandInactiveMilestones","setExpandInactiveMilestones","useState","canCreatePlan","isClassOngoing","isFiltersAdded","isStudentPresent","onAddChapter","onAddOutcome","onChapterClick","onCreatePlan","onDelete","onDraftPublish","onEdit","onExpandPastMilestones","onCreateMilestoneTest","onNodeAttempt","onNodeView","onNodeReview","onNodeReattempt","onNodeReset","onNodeUnassign","onAssignResources","onTestPreview","onTestReview","onTestStart","activeMilestoneId","activeTabId","onWidgetTabSelection","studentName","teacherName","parentName","userType","courseStream","onNodeAssignAsHomework","isMilestoneActive","isDraftMilestone","temporaryMilestoneId","useLazyRef","uuidv4","handleCreatePlan","useCallback","toggleExpand","handleOnAddOutcome","activeMilestonePresent","milestone","draftMilestonePresent","jsxs","Fragment","jsx","FlexView","NoActiveMilestone","Text","TextButton","StyledDownIcon","idx","milestoneId","React","MilestoneWidget","Separator"],"mappings":";;;;;;;;;;;AAcA,MAAMA,KAA+CC;AAAA,EACnD,CAAC,EAAE,YAAAC,GAAY,WAAAC,GAAW,eAAAC,GAAe,GAAGC,QAA6B;AACvE,UAAM,CAACC,GAA0BC,CAA2B,IAAIC,GAAS,EAAK,GACxE;AAAA,MACJ,eAAAC;AAAA,MACA,gBAAAC;AAAA,MACA,gBAAAC;AAAA,MACA,kBAAAC;AAAA,MACA,cAAAC;AAAA,MACA,cAAAC;AAAA,MACA,gBAAAC;AAAA,MACA,cAAAC;AAAA,MACA,UAAAC;AAAA,MACA,gBAAAC;AAAA,MACA,QAAAC;AAAA,MACA,wBAAAC;AAAA,MACA,uBAAAC;AAAA,MACA,eAAAC;AAAA,MACA,YAAAC;AAAA,MACA,cAAAC;AAAA,MACA,iBAAAC;AAAA,MACA,aAAAC;AAAA,MACA,gBAAAC;AAAA,MACA,mBAAAC;AAAA,MACA,eAAAC;AAAA,MACA,cAAAC;AAAA,MACA,aAAAC;AAAA,MACA,mBAAAC;AAAA,MACA,aAAAC;AAAA,MACA,sBAAAC;AAAA,MACA,aAAAC;AAAA,MACA,aAAAC;AAAA,MACA,YAAAC;AAAA,MACA,UAAAC;AAAA,MACA,cAAAC;AAAA,MACA,wBAAAC;AAAA,IACE,IAAAnC,GAEEoC,IAAoBrC,MAAkB,UACtCsC,IAAmBtC,MAAkB,SACrCuC,IAAuBC,GAAWC,EAAM,GAExCC,IAAmBC,EAAY,MAAM;AACzC,MAAA/B,KAAA,QAAAA,EAAe2B;AAAA,IAAoB,GAClC,CAAC3B,GAAc2B,CAAoB,CAAC,GAEjC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;AAAA,UACC2B,MAAQ3D,EAAW,SAAS,KAAM,gBAAAqD,EAAAU,IAAA,EAAU,SAAS,GAAG;AAAA,QAnCtC,EAAA,GAAA,aAAaH,EAAW,EAoC7C;AAAA,MAAA,CAEH;AAAA,IACL,EAAA,CAAA;AAAA,EAEJ;AACF;"}
|
1
|
+
{"version":3,"file":"milestone-list.js","sources":["../../../../../src/features/milestone/milestone-list-container/milestone-list/milestone-list.tsx"],"sourcesContent":["import type { IMilestoneListProps } from './milestone-list-types';\n\nimport React, { memo, useCallback } from 'react';\nimport { v4 as uuidv4 } from 'uuid';\n\nimport useLazyRef from '../../../hooks/use-lazy-ref';\nimport TextButton from '../../../ui/buttons/text-button/text-button';\nimport FlexView from '../../../ui/layout/flex-view';\nimport Separator from '../../../ui/separator/separator';\nimport Text from '../../../ui/text/text';\nimport MilestoneWidget from './milestone-widget/milestone-widget';\nimport NoActiveMilestone from './no-active-milestone/no-active-milestone';\n\nconst MilestoneList: React.FC<IMilestoneListProps> = memo(\n ({ milestones, studentId, milestoneType, ...restMilestoneListProps }) => {\n const {\n canCreatePlan,\n isClassOngoing,\n isFiltersAdded,\n isStudentPresent,\n onAddChapter,\n onAddOutcome,\n onChapterClick,\n onCreatePlan,\n onDelete,\n onDraftPublish,\n onEdit,\n onCreateMilestoneTest,\n onNodeAttempt,\n onNodeView,\n onNodeReview,\n onNodeReattempt,\n onNodeReset,\n onNodeUnassign,\n onAssignResources,\n onTestPreview,\n onTestReview,\n onTestStart,\n activeMilestoneId,\n activeTabId,\n onWidgetTabSelection,\n studentName,\n teacherName,\n parentName,\n userType,\n courseStream,\n onNodeAssignAsHomework,\n } = restMilestoneListProps;\n\n const isMilestoneActive = milestoneType === 'ACTIVE';\n const isDraftMilestone = milestoneType === 'DRAFT';\n const temporaryMilestoneId = useLazyRef(uuidv4);\n\n const handleCreatePlan = useCallback(() => {\n onCreatePlan?.(temporaryMilestoneId);\n }, [onCreatePlan, temporaryMilestoneId]);\n\n const handleOnAddOutcome = useCallback(() => {\n onAddOutcome?.();\n }, [onAddOutcome]);\n\n if (!milestones) return null;\n\n const activeMilestonePresent = milestones.some(\n milestone => milestone.milestone_state === 'ACTIVE',\n );\n const draftMilestonePresent = milestones.some(\n milestone => milestone.milestone_state === 'DRAFT',\n );\n\n return (\n <>\n {isMilestoneActive && !activeMilestonePresent && (\n <FlexView $marginBottom={40}>\n <NoActiveMilestone\n canCreatePlan={canCreatePlan}\n isDraftMilestonePresent={draftMilestonePresent}\n isFiltersAdded={isFiltersAdded}\n onCreatePlan={onCreatePlan}\n studentName={studentName}\n userType={userType}\n />\n </FlexView>\n )}\n\n {isMilestoneActive && (\n <FlexView $flexDirection=\"row\" $justifyContent=\"space-between\" $marginBottom={16}>\n <Text $renderAs=\"ac4\">Goals ({milestones.length})</Text>\n\n {userType === 'TEACHER' && (\n <FlexView $flexDirection=\"row\" $flexGapX={1}>\n <TextButton\n label=\"Create Goal\"\n size=\"small\"\n onClick={handleCreatePlan}\n disabled={!canCreatePlan}\n />\n <TextButton label=\"Add Milestone\" size=\"small\" onClick={handleOnAddOutcome} />\n </FlexView>\n )}\n </FlexView>\n )}\n\n {(isDraftMilestone || isMilestoneActive) &&\n milestones.map((milestone, idx) => {\n const { id: milestoneId } = milestone;\n\n return (\n <React.Fragment key={`milestone=${milestoneId}`}>\n <MilestoneWidget\n milestone={milestone}\n studentId={studentId}\n studentName={studentName}\n parentName={parentName}\n teacherName={teacherName}\n userType={userType}\n onAddOutcome={onAddOutcome}\n onChapterClick={onChapterClick}\n isMilestoneActive={isMilestoneActive || isDraftMilestone}\n milestoneType={milestoneType}\n onEdit={onEdit}\n onCreateMilestoneTest={onCreateMilestoneTest}\n onAddChapter={onAddChapter}\n onDelete={onDelete}\n onDraftPublish={onDraftPublish}\n isClassOngoing={isClassOngoing}\n isStudentPresent={isStudentPresent}\n onAssignResources={onAssignResources}\n onNodeAttempt={onNodeAttempt}\n onNodeView={onNodeView}\n onNodeReview={onNodeReview}\n onNodeReattempt={onNodeReattempt}\n onNodeReset={onNodeReset}\n onNodeUnassign={onNodeUnassign}\n onNodeAssignAsHomework={onNodeAssignAsHomework}\n onTestPreview={onTestPreview}\n onTestReview={onTestReview}\n onTestStart={onTestStart}\n courseStream={courseStream}\n activeMilestoneId={activeMilestoneId}\n activeTabId={activeTabId}\n onWidgetTabSelection={onWidgetTabSelection}\n />\n {idx !== milestones.length - 1 && <Separator heightX={2} />}\n </React.Fragment>\n );\n })}\n </>\n );\n },\n);\n\nexport default MilestoneList;\n"],"names":["MilestoneList","memo","milestones","studentId","milestoneType","restMilestoneListProps","canCreatePlan","isClassOngoing","isFiltersAdded","isStudentPresent","onAddChapter","onAddOutcome","onChapterClick","onCreatePlan","onDelete","onDraftPublish","onEdit","onCreateMilestoneTest","onNodeAttempt","onNodeView","onNodeReview","onNodeReattempt","onNodeReset","onNodeUnassign","onAssignResources","onTestPreview","onTestReview","onTestStart","activeMilestoneId","activeTabId","onWidgetTabSelection","studentName","teacherName","parentName","userType","courseStream","onNodeAssignAsHomework","isMilestoneActive","isDraftMilestone","temporaryMilestoneId","useLazyRef","uuidv4","handleCreatePlan","useCallback","handleOnAddOutcome","activeMilestonePresent","milestone","draftMilestonePresent","jsxs","Fragment","jsx","FlexView","NoActiveMilestone","Text","TextButton","idx","milestoneId","React","MilestoneWidget","Separator"],"mappings":";;;;;;;;;;AAaA,MAAMA,KAA+CC;AAAA,EACnD,CAAC,EAAE,YAAAC,GAAY,WAAAC,GAAW,eAAAC,GAAe,GAAGC,QAA6B;AACjE,UAAA;AAAA,MACJ,eAAAC;AAAA,MACA,gBAAAC;AAAA,MACA,gBAAAC;AAAA,MACA,kBAAAC;AAAA,MACA,cAAAC;AAAA,MACA,cAAAC;AAAA,MACA,gBAAAC;AAAA,MACA,cAAAC;AAAA,MACA,UAAAC;AAAA,MACA,gBAAAC;AAAA,MACA,QAAAC;AAAA,MACA,uBAAAC;AAAA,MACA,eAAAC;AAAA,MACA,YAAAC;AAAA,MACA,cAAAC;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UACF;AAAA,UACCyB,MAAQrD,EAAW,SAAS,KAAM,gBAAAgD,EAAAS,IAAA,EAAU,SAAS,GAAG;AAAA,QAnCtC,EAAA,GAAA,aAAaH,CAAW,EAoC7C;AAAA,MAAA,CAEH;AAAA,IACL,EAAA,CAAA;AAAA,EAEJ;AACF;"}
|
@@ -13,7 +13,8 @@ const f = x`
|
|
13
13
|
`, v = r(i)`
|
14
14
|
position: relative;
|
15
15
|
animation: ${f} 0.3s ease-in-out;
|
16
|
-
|
16
|
+
`;
|
17
|
+
r(g)(({ theme: o, $expanded: t }) => {
|
17
18
|
const {
|
18
19
|
layout: { gutter: e },
|
19
20
|
colors: { BLACK_1: n }
|
@@ -27,7 +28,8 @@ const f = x`
|
|
27
28
|
transform: rotate(${t === !0 ? 180 : 0}deg);
|
28
29
|
transition: transform 0.3s ease;
|
29
30
|
`;
|
30
|
-
})
|
31
|
+
});
|
32
|
+
const k = r.div(({ $expanded: o, theme: t }) => {
|
31
33
|
const { colors: e } = t;
|
32
34
|
return `
|
33
35
|
display:grid;
|
@@ -37,7 +39,7 @@ const f = x`
|
|
37
39
|
border: 1px solid ${e.GREY_2};
|
38
40
|
border-top:none;
|
39
41
|
`;
|
40
|
-
}),
|
42
|
+
}), C = r.div`
|
41
43
|
min-height: 0px;
|
42
44
|
width: 100%;
|
43
45
|
`;
|
@@ -81,7 +83,7 @@ r.div(({ theme: o, $rotate: t }) => {
|
|
81
83
|
}
|
82
84
|
`;
|
83
85
|
});
|
84
|
-
const
|
86
|
+
const I = r(i)`
|
85
87
|
border-bottom: 0px;
|
86
88
|
position: relative;
|
87
89
|
padding: 32px 32px 24px;
|
@@ -90,7 +92,7 @@ const _ = r(i)`
|
|
90
92
|
r(s)`
|
91
93
|
white-space: pre-wrap;
|
92
94
|
`;
|
93
|
-
const
|
95
|
+
const _ = r(s)`
|
94
96
|
display: -webkit-box;
|
95
97
|
-webkit-box-orient: vertical;
|
96
98
|
-webkit-line-clamp: 2;
|
@@ -109,7 +111,7 @@ r(i)(({
|
|
109
111
|
top: ${t.layout.gutter * 1.75 / 2}px;
|
110
112
|
${o === "right" ? "right: 0px;" : "left: 0px;"}
|
111
113
|
`);
|
112
|
-
const
|
114
|
+
const A = r.div(({ theme: o }) => {
|
113
115
|
const { layout: t } = o;
|
114
116
|
return `
|
115
117
|
position: absolute;
|
@@ -127,7 +129,7 @@ const D = r.div(({ theme: o }) => {
|
|
127
129
|
position: absolute;
|
128
130
|
inset: 50%;
|
129
131
|
transform: translate(-50%, -50%) rotate(-90deg);
|
130
|
-
`),
|
132
|
+
`), W = r.circle(
|
131
133
|
({ theme: o, $progressCircle: t, $progress: e, $progressBackground: n }) => {
|
132
134
|
const { colors: p, layout: l } = o, { GREY_2: c } = p, { gutter: a } = l, d = a * 12.5, u = t ? d - e : e;
|
133
135
|
return `
|
@@ -146,13 +148,12 @@ r(s)(({ theme: o, $backgroundColor: t }) => `
|
|
146
148
|
`);
|
147
149
|
export {
|
148
150
|
G as ChapterProgressSVG,
|
149
|
-
|
150
|
-
|
151
|
-
|
151
|
+
W as ChapterProgressSVGCircle,
|
152
|
+
C as Content,
|
153
|
+
k as ContentWrapper,
|
152
154
|
v as MainContainer,
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
_ as Wrapper
|
155
|
+
_ as MilestoneTitle,
|
156
|
+
A as StyledCheckIconWrapper,
|
157
|
+
I as Wrapper
|
157
158
|
};
|
158
159
|
//# sourceMappingURL=milestone-widget-styled.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"milestone-widget-styled.js","sources":["../../../../../../src/features/milestone/milestone-list-container/milestone-list/milestone-widget/milestone-widget-styled.tsx"],"sourcesContent":["import type { TColorNames } from '../../../../ui/types';\n\nimport styled, { keyframes } from 'styled-components';\n\nimport ChevronDownIcon from '../../../../../assets/line-icons/icons/chevron-down';\nimport InfoIcon from '../../../../../assets/line-icons/icons/info';\nimport FlexView from '../../../../ui/layout/flex-view';\nimport Text from '../../../../ui/text/text';\n\ninterface IContentWrapperProps {\n $expanded: boolean;\n}\n\ninterface IStyledDownIconProps {\n $expanded: boolean;\n}\n\nconst fadeIn = keyframes`\n 0% {\n opacity: 0;\n }\n 100% {\n opacity: 1;\n }\n`;\n\nconst MainContainer = styled(FlexView)`\n position: relative;\n animation: ${fadeIn} 0.3s ease-in-out;\n`;\n\nconst StyledDownIcon = styled(ChevronDownIcon)<IStyledDownIconProps>(({ theme, $expanded }) => {\n const {\n layout: { gutter },\n colors: { BLACK_1 },\n } = theme;\n\n return `\n cursor: pointer;\n width: ${gutter * 1.5}px;\n height: ${gutter * 1.5}px;\n outline: 1px solid ${BLACK_1};\n border-radius: 50%;\n transform: rotate(${$expanded === true ? 180 : 0}deg);\n transition: transform 0.3s ease;\n `;\n});\n\nconst ContentWrapper = styled.div<IContentWrapperProps>(({ $expanded, theme }) => {\n const { colors } = theme;\n\n return `\n display:grid;\n grid-template-rows:${$expanded ? 1 : 0}fr;\n overflow:hidden;\n transition:grid-template-rows 200ms;\n border: 1px solid ${colors.GREY_2};\n border-top:none;\n `;\n});\n\nconst Content = styled.div`\n min-height: 0px;\n width: 100%;\n`;\n\nconst HelpWrapper = styled.div(({ theme }) => {\n const {\n layout: { gutter },\n } = theme;\n\n return `\n padding: ${gutter * 2}px;\n `;\n});\n\nconst StyledInfoIcon = styled(InfoIcon)(\n () => `\n position: relative;\n cursor: pointer;\n `,\n);\n\nconst LessonsInfoWrapper = styled.div(({ theme }) => {\n const {\n layout: { gutter },\n } = theme;\n\n return `\n padding:${gutter}px;\n display: grid;\n gap:0px;\n grid-template-rows: 1fr ${gutter * 1.75}px 1fr ${gutter * 1.75}px 1fr;\n grid-template-columns: ${gutter * 4}px ${gutter * 5}px ${gutter * 6.375}px ${gutter * 10.25}px;\n width:${gutter * 28}px;\n align-items:center;\n `;\n});\n\nconst UpArrowWrapper = styled.div<{ $rotate: boolean }>(({ theme, $rotate }) => {\n const {\n layout: { gutter },\n } = theme;\n\n return `\n grid-column: span 4;\n padding-left: ${gutter * 1.5}px;\n & img {\n transform: rotate(${$rotate ? 180 : 0}deg);\n }\n `;\n});\n\nconst Wrapper = styled(FlexView)`\n border-bottom: 0px;\n position: relative;\n padding: 32px 32px 24px;\n cursor: pointer;\n`;\n\nconst SpacedText = styled(Text)`\n white-space: pre-wrap;\n`;\n\nconst MilestoneTitle = styled(Text)`\n display: -webkit-box;\n -webkit-box-orient: vertical;\n -webkit-line-clamp: 2;\n text-overflow: ellipsis;\n overflow: hidden;\n`;\n\nconst MilestoneWidgetStatusWrapper = styled(FlexView)`\n position: relative;\n z-index: 1;\n`;\n\ninterface IMilestoneWidgetStatusTag {\n $placement: string;\n}\n\nconst MilestoneWidgetStatusTag = styled(FlexView)<IMilestoneWidgetStatusTag>(({\n $placement,\n theme,\n}) => {\n return `\n position: absolute;\n top: ${(theme.layout.gutter * 1.75) / 2}px;\n ${$placement === 'right' ? 'right: 0px;' : 'left: 0px;'}\n `;\n});\n\nconst StyledCheckIconWrapper = styled.div(({ theme }) => {\n const { layout } = theme;\n\n return `\n position: absolute;\n top: 0px;\n right: 0px;\n z-index: 2;\n\n width: ${layout.gutter * 1.25}px;\n height: ${layout.gutter * 1.25}px;\n border-radius: 50%;\n background: ${theme.colors.WHITE_1};\n outline: 1px solid ${theme.colors.BLACK_1};\n `;\n});\n\nconst ChapterProgressSVG = styled.svg(() => {\n return `\n position: absolute;\n inset: 50%;\n transform: translate(-50%, -50%) rotate(-90deg);\n `;\n});\n\ninterface IChapterProgressSVGCircleProps {\n $progressCircle?: boolean;\n $progress: number;\n $progressBackground?: TColorNames;\n}\n\nconst ChapterProgressSVGCircle = styled.circle<IChapterProgressSVGCircleProps>(\n ({ theme, $progressCircle, $progress, $progressBackground }) => {\n const { colors, layout } = theme;\n const { GREY_2 } = colors;\n const { gutter } = layout;\n\n const strokeDashArray = gutter * 12.5;\n const strokeDashOffset = $progressCircle ? strokeDashArray - $progress : $progress;\n\n return `\n stroke-dasharray: ${strokeDashArray};\n stroke-dashoffset: ${strokeDashOffset};\n stroke: ${$progressCircle ? colors[$progressBackground || 'BLACK'] : GREY_2};\n\n stroke-width: ${gutter * 0.125}px;\n fill: none;\n `;\n },\n);\n\ninterface IWidgetStateTag {\n $backgroundColor: TColorNames;\n}\n\nconst WidgetStateTag = styled(Text)<IWidgetStateTag>(({ theme, $backgroundColor }) => {\n return `\n padding: 4px;\n background: ${theme.colors[$backgroundColor]};\n `;\n});\n\nexport {\n Content,\n ContentWrapper,\n HelpWrapper,\n LessonsInfoWrapper,\n MainContainer,\n SpacedText,\n StyledDownIcon,\n StyledInfoIcon,\n UpArrowWrapper,\n Wrapper,\n MilestoneTitle,\n MilestoneWidgetStatusWrapper,\n MilestoneWidgetStatusTag,\n StyledCheckIconWrapper,\n ChapterProgressSVG,\n ChapterProgressSVGCircle,\n WidgetStateTag,\n};\n"],"names":["fadeIn","keyframes","MainContainer","styled","FlexView","
|
1
|
+
{"version":3,"file":"milestone-widget-styled.js","sources":["../../../../../../src/features/milestone/milestone-list-container/milestone-list/milestone-widget/milestone-widget-styled.tsx"],"sourcesContent":["import type { TColorNames } from '../../../../ui/types';\n\nimport styled, { keyframes } from 'styled-components';\n\nimport ChevronDownIcon from '../../../../../assets/line-icons/icons/chevron-down';\nimport InfoIcon from '../../../../../assets/line-icons/icons/info';\nimport FlexView from '../../../../ui/layout/flex-view';\nimport Text from '../../../../ui/text/text';\n\ninterface IContentWrapperProps {\n $expanded: boolean;\n}\n\ninterface IStyledDownIconProps {\n $expanded: boolean;\n}\n\nconst fadeIn = keyframes`\n 0% {\n opacity: 0;\n }\n 100% {\n opacity: 1;\n }\n`;\n\nconst MainContainer = styled(FlexView)`\n position: relative;\n animation: ${fadeIn} 0.3s ease-in-out;\n`;\n\nconst StyledDownIcon = styled(ChevronDownIcon)<IStyledDownIconProps>(({ theme, $expanded }) => {\n const {\n layout: { gutter },\n colors: { BLACK_1 },\n } = theme;\n\n return `\n cursor: pointer;\n width: ${gutter * 1.5}px;\n height: ${gutter * 1.5}px;\n outline: 1px solid ${BLACK_1};\n border-radius: 50%;\n transform: rotate(${$expanded === true ? 180 : 0}deg);\n transition: transform 0.3s ease;\n `;\n});\n\nconst ContentWrapper = styled.div<IContentWrapperProps>(({ $expanded, theme }) => {\n const { colors } = theme;\n\n return `\n display:grid;\n grid-template-rows:${$expanded ? 1 : 0}fr;\n overflow:hidden;\n transition:grid-template-rows 200ms;\n border: 1px solid ${colors.GREY_2};\n border-top:none;\n `;\n});\n\nconst Content = styled.div`\n min-height: 0px;\n width: 100%;\n`;\n\nconst HelpWrapper = styled.div(({ theme }) => {\n const {\n layout: { gutter },\n } = theme;\n\n return `\n padding: ${gutter * 2}px;\n `;\n});\n\nconst StyledInfoIcon = styled(InfoIcon)(\n () => `\n position: relative;\n cursor: pointer;\n `,\n);\n\nconst LessonsInfoWrapper = styled.div(({ theme }) => {\n const {\n layout: { gutter },\n } = theme;\n\n return `\n padding:${gutter}px;\n display: grid;\n gap:0px;\n grid-template-rows: 1fr ${gutter * 1.75}px 1fr ${gutter * 1.75}px 1fr;\n grid-template-columns: ${gutter * 4}px ${gutter * 5}px ${gutter * 6.375}px ${gutter * 10.25}px;\n width:${gutter * 28}px;\n align-items:center;\n `;\n});\n\nconst UpArrowWrapper = styled.div<{ $rotate: boolean }>(({ theme, $rotate }) => {\n const {\n layout: { gutter },\n } = theme;\n\n return `\n grid-column: span 4;\n padding-left: ${gutter * 1.5}px;\n & img {\n transform: rotate(${$rotate ? 180 : 0}deg);\n }\n `;\n});\n\nconst Wrapper = styled(FlexView)`\n border-bottom: 0px;\n position: relative;\n padding: 32px 32px 24px;\n cursor: pointer;\n`;\n\nconst SpacedText = styled(Text)`\n white-space: pre-wrap;\n`;\n\nconst MilestoneTitle = styled(Text)`\n display: -webkit-box;\n -webkit-box-orient: vertical;\n -webkit-line-clamp: 2;\n text-overflow: ellipsis;\n overflow: hidden;\n`;\n\nconst MilestoneWidgetStatusWrapper = styled(FlexView)`\n position: relative;\n z-index: 1;\n`;\n\ninterface IMilestoneWidgetStatusTag {\n $placement: string;\n}\n\nconst MilestoneWidgetStatusTag = styled(FlexView)<IMilestoneWidgetStatusTag>(({\n $placement,\n theme,\n}) => {\n return `\n position: absolute;\n top: ${(theme.layout.gutter * 1.75) / 2}px;\n ${$placement === 'right' ? 'right: 0px;' : 'left: 0px;'}\n `;\n});\n\nconst StyledCheckIconWrapper = styled.div(({ theme }) => {\n const { layout } = theme;\n\n return `\n position: absolute;\n top: 0px;\n right: 0px;\n z-index: 2;\n\n width: ${layout.gutter * 1.25}px;\n height: ${layout.gutter * 1.25}px;\n border-radius: 50%;\n background: ${theme.colors.WHITE_1};\n outline: 1px solid ${theme.colors.BLACK_1};\n `;\n});\n\nconst ChapterProgressSVG = styled.svg(() => {\n return `\n position: absolute;\n inset: 50%;\n transform: translate(-50%, -50%) rotate(-90deg);\n `;\n});\n\ninterface IChapterProgressSVGCircleProps {\n $progressCircle?: boolean;\n $progress: number;\n $progressBackground?: TColorNames;\n}\n\nconst ChapterProgressSVGCircle = styled.circle<IChapterProgressSVGCircleProps>(\n ({ theme, $progressCircle, $progress, $progressBackground }) => {\n const { colors, layout } = theme;\n const { GREY_2 } = colors;\n const { gutter } = layout;\n\n const strokeDashArray = gutter * 12.5;\n const strokeDashOffset = $progressCircle ? strokeDashArray - $progress : $progress;\n\n return `\n stroke-dasharray: ${strokeDashArray};\n stroke-dashoffset: ${strokeDashOffset};\n stroke: ${$progressCircle ? colors[$progressBackground || 'BLACK'] : GREY_2};\n\n stroke-width: ${gutter * 0.125}px;\n fill: none;\n `;\n },\n);\n\ninterface IWidgetStateTag {\n $backgroundColor: TColorNames;\n}\n\nconst WidgetStateTag = styled(Text)<IWidgetStateTag>(({ theme, $backgroundColor }) => {\n return `\n padding: 4px;\n background: ${theme.colors[$backgroundColor]};\n `;\n});\n\nexport {\n Content,\n ContentWrapper,\n HelpWrapper,\n LessonsInfoWrapper,\n MainContainer,\n SpacedText,\n StyledDownIcon,\n StyledInfoIcon,\n UpArrowWrapper,\n Wrapper,\n MilestoneTitle,\n MilestoneWidgetStatusWrapper,\n MilestoneWidgetStatusTag,\n StyledCheckIconWrapper,\n ChapterProgressSVG,\n ChapterProgressSVGCircle,\n WidgetStateTag,\n};\n"],"names":["fadeIn","keyframes","MainContainer","styled","FlexView","ChevronDownIcon","theme","$expanded","gutter","BLACK_1","ContentWrapper","colors","Content","InfoIcon","$rotate","Wrapper","Text","MilestoneTitle","$placement","StyledCheckIconWrapper","layout","ChapterProgressSVG","ChapterProgressSVGCircle","$progressCircle","$progress","$progressBackground","GREY_2","strokeDashArray","strokeDashOffset","$backgroundColor"],"mappings":";;;;;AAiBA,MAAMA,IAASC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,GASTC,IAAgBC,EAAOC,CAAQ;AAAA;AAAA,eAEtBJ,CAAM;AAAA;AAGEG,EAAOE,CAAe,EAAwB,CAAC,EAAE,OAAAC,GAAO,WAAAC,QAAgB;AACvF,QAAA;AAAA,IACJ,QAAQ,EAAE,QAAAC,EAAO;AAAA,IACjB,QAAQ,EAAE,SAAAC,EAAQ;AAAA,EAChB,IAAAH;AAEG,SAAA;AAAA;AAAA,aAEIE,IAAS,GAAG;AAAA,cACXA,IAAS,GAAG;AAAA,yBACDC,CAAO;AAAA;AAAA,wBAERF,MAAc,KAAO,MAAM,CAAC;AAAA;AAAA;AAGpD,CAAC;AAED,MAAMG,IAAiBP,EAAO,IAA0B,CAAC,EAAE,WAAAI,GAAW,OAAAD,QAAY;AAC1E,QAAA,EAAE,QAAAK,EAAW,IAAAL;AAEZ,SAAA;AAAA;AAAA,yBAEgBC,IAAY,IAAI,CAAC;AAAA;AAAA;AAAA,wBAGlBI,EAAO,MAAM;AAAA;AAAA;AAGrC,CAAC,GAEKC,IAAUT,EAAO;AAAA;AAAA;AAAA;AAKHA,EAAO,IAAI,CAAC,EAAE,OAAAG,QAAY;AACtC,QAAA;AAAA,IACJ,QAAQ,EAAE,QAAAE,EAAO;AAAA,EACf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AA;AAAA;AAAA,aAMIc,EAAO,SAAS,IAAI;AAAA,cACnBA,EAAO,SAAS,IAAI;AAAA;AAAA,kBAEhBd,EAAM,OAAO,OAAO;AAAA,yBACbA,EAAM,OAAO,OAAO;AAAA;AAE7C,CAAC,GAEKe,IAAqBlB,EAAO,IAAI,MAC7B;AAAA;AAAA;AAAA;AAAA,GAKR,GAQKmB,IAA2BnB,EAAO;AAAA,EACtC,CAAC,EAAE,OAAAG,GAAO,iBAAAiB,GAAiB,WAAAC,GAAW,qBAAAC,QAA0B;AACxD,UAAA,EAAE,QAAAd,GAAQ,QAAAS,EAAW,IAAAd,GACrB,EAAE,QAAAoB,EAAW,IAAAf,GACb,EAAE,QAAAH,EAAW,IAAAY,GAEbO,IAAkBnB,IAAS,MAC3BoB,IAAmBL,IAAkBI,IAAkBH,IAAYA;AAElE,WAAA;AAAA,0BACeG,CAAe;AAAA,2BACdC,CAAgB;AAAA,gBAC3BL,IAAkBZ,EAAOc,KAAuB,OAAO,IAAIC,CAAM;AAAA;AAAA,sBAE3DlB,IAAS,KAAK;AAAA;AAAA;AAAA,EAGlC;AACF;AAMuBL,EAAOa,CAAI,EAAmB,CAAC,EAAE,OAAAV,GAAO,kBAAAuB,QACtD;AAAA;AAAA,kBAESvB,EAAM,OAAOuB,CAAgB,CAAC;AAAA,GAE/C;"}
|
package/dist/index.d.ts
CHANGED
@@ -2477,7 +2477,7 @@ export declare const invalidateMilestoneResources: (id: string, query?: void | u
|
|
2477
2477
|
|
2478
2478
|
export declare const invalidateMilestonesData: (query?: TQuery | undefined) => void;
|
2479
2479
|
|
2480
|
-
export declare const invalidatePastMilestoneCount: (query?:
|
2480
|
+
export declare const invalidatePastMilestoneCount: (id: string, query?: void | undefined, allIdsInvalid?: boolean) => void;
|
2481
2481
|
|
2482
2482
|
export declare const invalidateTestHelpData: (id: string, query?: void | undefined, allIdsInvalid?: boolean) => void;
|
2483
2483
|
|
@@ -5392,7 +5392,6 @@ declare type TQuery = {
|
|
5392
5392
|
|
5393
5393
|
declare type TQuery_2 = {
|
5394
5394
|
milestone_state_group: 'ALL' | 'DRAFT' | 'STUDENT_ALL' | 'LIVE' | 'STUDENT_LIVE' | 'INACTIVE';
|
5395
|
-
student_id: string;
|
5396
5395
|
course_stream: TCourseStream;
|
5397
5396
|
};
|
5398
5397
|
|
@@ -5774,10 +5773,14 @@ export declare const useGetMilestoneResources: (initialId?: string, initialQuery
|
|
5774
5773
|
} & Record<string, unknown>) | undefined;
|
5775
5774
|
};
|
5776
5775
|
|
5777
|
-
export declare const useGetPastMilestoneCount: (initialQuery?:
|
5778
|
-
|
5779
|
-
resource: ResourceModel<
|
5780
|
-
|
5776
|
+
export declare const useGetPastMilestoneCount: (initialId?: string, initialQuery?: void | undefined) => {
|
5777
|
+
get: (id: string, query: void, meta: TQuery_2) => Promise<void>;
|
5778
|
+
resource: ResourceModel<{
|
5779
|
+
user_milestones_count: number;
|
5780
|
+
}> | undefined;
|
5781
|
+
data: {
|
5782
|
+
user_milestones_count: number;
|
5783
|
+
} | undefined;
|
5781
5784
|
permissions: Record<string, unknown> | undefined;
|
5782
5785
|
isProcessing: boolean;
|
5783
5786
|
isProcessed: boolean;
|