@cuemath/leap 3.0.3-as6 → 3.0.4-as1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/features/chapters-v2/comps/node-card/node-menu-options/node-menu-option.js +17 -15
- package/dist/features/chapters-v2/comps/node-card/node-menu-options/node-menu-option.js.map +1 -1
- package/dist/features/chapters-v2/comps/node-card/node-menu-options/node-menu-options.js +4 -4
- package/dist/features/chapters-v2/comps/node-card/node-menu-options/node-menu-options.js.map +1 -1
- package/dist/features/chapters-v2/comps/node-card/teacher-actions/teacher-actions.js +98 -112
- 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 +1 -2
- package/dist/features/chapters-v2/constants/node-constants.js.map +1 -1
- package/dist/features/circle-games/game-launcher/hooks/use-game-launcher-journey/use-game-launcher-journey.js +107 -100
- package/dist/features/circle-games/game-launcher/hooks/use-game-launcher-journey/use-game-launcher-journey.js.map +1 -1
- package/dist/features/circle-games/game-launcher/hooks/use-table-launcher-journey/use-table-launcher-journey.js +96 -93
- package/dist/features/circle-games/game-launcher/hooks/use-table-launcher-journey/use-table-launcher-journey.js.map +1 -1
- package/dist/features/circle-games/games/tutorial/tutorial-styled.js +1 -1
- package/dist/features/circle-games/games/tutorial/tutorial-styled.js.map +1 -1
- package/dist/features/homework/card-menu-option.js +28 -0
- package/dist/features/homework/card-menu-option.js.map +1 -0
- package/dist/features/homework/card-menu-options.js +12 -12
- package/dist/features/homework/card-menu-options.js.map +1 -1
- package/dist/features/homework/homework-card.js +74 -82
- package/dist/features/homework/homework-card.js.map +1 -1
- package/dist/features/homework/styles.js +30 -30
- package/dist/features/homework/styles.js.map +1 -1
- package/dist/features/journey/comps/coachmark/coachmark.js +20 -19
- package/dist/features/journey/comps/coachmark/coachmark.js.map +1 -1
- package/dist/features/journey/use-journey/constants.js +2 -4
- package/dist/features/journey/use-journey/constants.js.map +1 -1
- package/dist/features/journey/use-journey/journey-styled.js +5 -6
- package/dist/features/journey/use-journey/journey-styled.js.map +1 -1
- package/dist/features/milestone/milestone-list-container/milestone-list-container.js +68 -68
- package/dist/features/milestone/milestone-list-container/milestone-list-container.js.map +1 -1
- package/dist/features/milestone/milestone-tests/tests-creation/test-stages/chapter-selection/chapter-item/chapter-item.js +31 -26
- package/dist/features/milestone/milestone-tests/tests-creation/test-stages/chapter-selection/chapter-item/chapter-item.js.map +1 -1
- package/dist/features/ui/constants/z-index.js +2 -1
- package/dist/features/ui/constants/z-index.js.map +1 -1
- package/dist/features/ui/theme/device.js +5 -0
- package/dist/features/ui/theme/device.js.map +1 -0
- package/dist/features/ui/theme/get-theme.js +21 -19
- package/dist/features/ui/theme/get-theme.js.map +1 -1
- package/dist/index.d.ts +6 -0
- package/package.json +1 -1
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"coachmark.js","sources":["../../../../../src/features/journey/comps/coachmark/coachmark.tsx"],"sourcesContent":["import type { IArrowTooltipProps } from '../../../ui/arrow-tooltip/arrow-tooltip-types';\nimport type { INudgeProps } from '../../../ui/nudge/nudge-types';\nimport type { ICoachmarkProps } from '../../use-journey/journey-context-types';\n\nimport React, { useMemo } from 'react';\n\nimport ArrowTooltip from '../../../ui/arrow-tooltip/arrow-tooltip';\nimport Nudge from '../../../ui/nudge/nudge';\nimport {
|
1
|
+
{"version":3,"file":"coachmark.js","sources":["../../../../../src/features/journey/comps/coachmark/coachmark.tsx"],"sourcesContent":["import type { IArrowTooltipProps } from '../../../ui/arrow-tooltip/arrow-tooltip-types';\nimport type { INudgeProps } from '../../../ui/nudge/nudge-types';\nimport type { ICoachmarkProps } from '../../use-journey/journey-context-types';\n\nimport React, { useMemo } from 'react';\n\nimport ArrowTooltip from '../../../ui/arrow-tooltip/arrow-tooltip';\nimport Nudge from '../../../ui/nudge/nudge';\nimport { getTheme } from '../../../ui/theme/get-theme';\nimport { IndicatorType } from '../../use-journey/constants';\nimport * as S from './coachmark-styled';\nimport { toolTipGetXCoordinates } from './coachmark-utils';\n\nexport const Coachmark: React.FC<{ coachmark: ICoachmarkProps }> = ({ coachmark }) => {\n const targetElement = coachmark.originalElementToHighlightRef.current;\n const { top = 0, left = 0, height = 0, width = 0 } = targetElement?.getBoundingClientRect() || {};\n\n const { zIndex, device } = getTheme();\n const isMobile = device === 'mobile';\n\n const BLUR_OVERLAY_Z_INDEX = zIndex.JOURNEY_OVERLAY;\n\n const isAbsolute = useMemo(() => {\n return () => {\n if (!targetElement) return false;\n\n return window.getComputedStyle(targetElement).position === 'absolute';\n };\n }, [targetElement]);\n\n const tooltipProps = useMemo(() => {\n const arrowToolTipProps = coachmark.indicator as IArrowTooltipProps;\n\n return {\n width: isMobile ? 246 : 264, // Can be over ridden\n tooltipXCoOrdinates:\n toolTipGetXCoordinates(arrowToolTipProps.position) +\n (arrowToolTipProps.tooltipXCoOrdinates ?? 0), // For absolutely positioned elements\n zIndex: BLUR_OVERLAY_Z_INDEX + 1,\n ...arrowToolTipProps,\n tooltipItem: <S.CoachmarkBody>{arrowToolTipProps.tooltipItem}</S.CoachmarkBody>,\n alwaysVisible: true,\n renderAs: 'primary', // Deprecate this\n borderWidth: 1,\n arrowColor: arrowToolTipProps.arrowColor || 'WHITE',\n borderColor: arrowToolTipProps.borderColor || 'WHITE',\n type: IndicatorType.TOOLTIP,\n isAnimated: true,\n } as IArrowTooltipProps;\n }, [BLUR_OVERLAY_Z_INDEX, coachmark.indicator, isMobile]);\n\n const nudgeProps = useMemo(() => {\n const props: INudgeProps = coachmark.indicator as INudgeProps;\n\n return {\n ...props,\n nudgePointerX: left + (props.nudgePointerX ?? 0),\n nudgePointerY: top + (props.nudgePointerY ?? 0),\n };\n }, [coachmark.indicator, left, top]);\n\n if (!targetElement || !coachmark.isActive) {\n return null;\n }\n\n if (coachmark.type === IndicatorType.TOOLTIP) {\n if (isAbsolute()) {\n return (\n <>\n {coachmark.elementToHighlight}\n <S.ClonedElementWrapper $position=\"absolute\" $top={top} $left={left}>\n <ArrowTooltip {...tooltipProps}>\n <div style={{ height, width }} />\n </ArrowTooltip>\n </S.ClonedElementWrapper>\n </>\n );\n }\n\n return (\n <S.ClonedElementWrapper $position=\"absolute\" $top={top} $left={left}>\n <ArrowTooltip {...tooltipProps}>{coachmark.elementToHighlight}</ArrowTooltip>\n </S.ClonedElementWrapper>\n );\n }\n\n if (coachmark.type === IndicatorType.NUDGE) {\n return (\n <>\n <S.ClonedElementWrapper\n $top={isAbsolute() ? 0 : top}\n $left={isAbsolute() ? 0 : left}\n $position={isAbsolute() ? 'relative' : 'absolute'}\n >\n {coachmark.elementToHighlight}\n </S.ClonedElementWrapper>\n <Nudge zIndex={BLUR_OVERLAY_Z_INDEX + 1} {...nudgeProps} />\n </>\n );\n }\n\n return null;\n};\n"],"names":["Coachmark","coachmark","targetElement","top","left","height","width","zIndex","device","getTheme","isMobile","BLUR_OVERLAY_Z_INDEX","isAbsolute","useMemo","tooltipProps","arrowToolTipProps","toolTipGetXCoordinates","jsx","S.CoachmarkBody","IndicatorType","nudgeProps","props","jsxs","Fragment","S.ClonedElementWrapper","ArrowTooltip","Nudge"],"mappings":";;;;;;;;AAaO,MAAMA,IAAsD,CAAC,EAAE,WAAAC,QAAgB;AAC9E,QAAAC,IAAgBD,EAAU,8BAA8B,SACxD,EAAE,KAAAE,IAAM,GAAG,MAAAC,IAAO,GAAG,QAAAC,IAAS,GAAG,OAAAC,IAAQ,EAAE,KAAIJ,KAAA,gBAAAA,EAAe,4BAA2B,CAAA,GAEzF,EAAE,QAAAK,GAAQ,QAAAC,EAAO,IAAIC,EAAS,GAC9BC,IAAWF,MAAW,UAEtBG,IAAuBJ,EAAO,iBAE9BK,IAAaC,EAAQ,MAClB,MACAX,IAEE,OAAO,iBAAiBA,CAAa,EAAE,aAAa,aAFhC,IAI5B,CAACA,CAAa,CAAC,GAEZY,IAAeD,EAAQ,MAAM;AACjC,UAAME,IAAoBd,EAAU;AAE7B,WAAA;AAAA,MACL,OAAO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EAAA,UAAA;AAAA,IAAA,gBAAAN;AAAA,MAACO;AAAAA,MAAA;AAAA,QACC,MAAMZ,MAAe,IAAIT;AAAA,QACzB,OAAOS,MAAe,IAAIR;AAAA,QAC1B,WAAWQ,MAAe,aAAa;AAAA,QAEtC,UAAUX,EAAA;AAAA,MAAA;AAAA,IACb;AAAA,sBACCyB,GAAM,EAAA,QAAQf,IAAuB,GAAI,GAAGS,GAAY;AAAA,EAC3D,EAAA,CAAA,IAIG;AACT;"}
|
@@ -1,7 +1,5 @@
|
|
1
|
-
var
|
2
|
-
const o = 1e3;
|
1
|
+
var t = /* @__PURE__ */ ((r) => (r.TOOLTIP = "tooltip", r.NUDGE = "nudge", r))(t || {});
|
3
2
|
export {
|
4
|
-
|
5
|
-
e as IndicatorType
|
3
|
+
t as IndicatorType
|
6
4
|
};
|
7
5
|
//# sourceMappingURL=constants.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"constants.js","sources":["../../../../src/features/journey/use-journey/constants.ts"],"sourcesContent":["export enum IndicatorType {\n TOOLTIP = 'tooltip',\n NUDGE = 'nudge',\n}\
|
1
|
+
{"version":3,"file":"constants.js","sources":["../../../../src/features/journey/use-journey/constants.ts"],"sourcesContent":["export enum IndicatorType {\n TOOLTIP = 'tooltip',\n NUDGE = 'nudge',\n}\n"],"names":["IndicatorType"],"mappings":"AAAY,IAAAA,sBAAAA,OACVA,EAAA,UAAU,WACVA,EAAA,QAAQ,SAFEA,IAAAA,KAAA,CAAA,CAAA;"}
|
@@ -1,19 +1,18 @@
|
|
1
|
-
import t, { css as
|
2
|
-
|
3
|
-
const b = t.div`
|
1
|
+
import t, { css as e } from "styled-components";
|
2
|
+
const d = t.div`
|
4
3
|
position: fixed;
|
5
4
|
top: 0;
|
6
5
|
right: 0;
|
7
6
|
bottom: 0;
|
8
7
|
left: 0;
|
9
|
-
z-index: ${
|
10
|
-
${({ isJourneyBlurred: o, theme: r }) => o &&
|
8
|
+
z-index: ${({ theme: o }) => o.zIndex.JOURNEY_OVERLAY};
|
9
|
+
${({ isJourneyBlurred: o, theme: r }) => o && e`
|
11
10
|
background: ${r.colors.BLACK_T_38};
|
12
11
|
backdrop-filter: blur(80px);
|
13
12
|
-webkit-backdrop-filter: blur(80px);
|
14
13
|
`}
|
15
14
|
`;
|
16
15
|
export {
|
17
|
-
|
16
|
+
d as Overlay
|
18
17
|
};
|
19
18
|
//# sourceMappingURL=journey-styled.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"journey-styled.js","sources":["../../../../src/features/journey/use-journey/journey-styled.tsx"],"sourcesContent":["import styled from 'styled-components';\nimport { css } from 'styled-components';\n\
|
1
|
+
{"version":3,"file":"journey-styled.js","sources":["../../../../src/features/journey/use-journey/journey-styled.tsx"],"sourcesContent":["import styled from 'styled-components';\nimport { css } from 'styled-components';\n\nexport const Overlay = styled.div<{ isJourneyBlurred: boolean }>`\n position: fixed;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n z-index: ${({ theme }) => theme.zIndex.JOURNEY_OVERLAY};\n ${({ isJourneyBlurred, theme }) =>\n isJourneyBlurred &&\n css`\n background: ${theme.colors.BLACK_T_38};\n backdrop-filter: blur(80px);\n -webkit-backdrop-filter: blur(80px);\n `}\n`;\n``;\n"],"names":["Overlay","styled","theme","isJourneyBlurred","css"],"mappings":";AAGO,MAAMA,IAAUC,EAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,aAMjB,CAAC,EAAE,OAAAC,EAAA,MAAYA,EAAM,OAAO,eAAe;AAAA,IACpD,CAAC,EAAE,kBAAAC,GAAkB,OAAAD,EAAA,MACrBC,KACAC;AAAA,oBACgBF,EAAM,OAAO,UAAU;AAAA;AAAA;AAAA,KAGtC;AAAA;"}
|
@@ -1,31 +1,31 @@
|
|
1
|
-
import { jsx as
|
2
|
-
import { h as
|
3
|
-
import { memo as le, useMemo as Se, useState as
|
4
|
-
import { ILLUSTRATIONS as
|
1
|
+
import { jsx as E, jsxs as u, Fragment as ae } from "react/jsx-runtime";
|
2
|
+
import { h as Ee } from "../../../node_modules/humanize-plus/dist/humanize.js";
|
3
|
+
import { memo as le, useMemo as Se, useState as R, useCallback as me, useEffect as p } from "react";
|
4
|
+
import { ILLUSTRATIONS as ce } from "../../../assets/illustrations/illustrations.js";
|
5
5
|
import { EVENTS as e } from "../../communication/pub-sub/constants.js";
|
6
|
-
import { useInClassActionListener as
|
6
|
+
import { useInClassActionListener as Te } from "../../communication/pub-sub/hooks.js";
|
7
7
|
import { invalidateHomeworks as f } from "../../homework/hw-card-list/api/get-homeworks.js";
|
8
8
|
import de from "../../ui/separator/separator.js";
|
9
|
-
import { invalidateMilestoneResources as
|
10
|
-
import { useGetAllMilestonesdata as
|
11
|
-
import { invalidateTestHelpData as
|
12
|
-
import
|
9
|
+
import { invalidateMilestoneResources as Ae } from "./api/get-milestone-resources.js";
|
10
|
+
import { useGetAllMilestonesdata as _e, invalidateMilestonesData as Ne } from "./api/get-milestones.js";
|
11
|
+
import { invalidateTestHelpData as De } from "./api/get-tests-list.js";
|
12
|
+
import Me from "./filter-milestones.js";
|
13
13
|
import Ie from "./milestone-list/milestone-list.js";
|
14
14
|
import Le from "./milestone-list/milestone-loader/milestone-loader.js";
|
15
|
-
import { ContentWrapper as
|
16
|
-
const
|
17
|
-
|
18
|
-
},
|
19
|
-
({ studentName: d, studentId: l, studentClassroomId: h, ...
|
15
|
+
import { ContentWrapper as Ce, LoaderWrapper as Oe } from "./styled.js";
|
16
|
+
const ue = (d) => {
|
17
|
+
Ne(d);
|
18
|
+
}, Re = le(
|
19
|
+
({ studentName: d, studentId: l, studentClassroomId: h, ...P }) => {
|
20
20
|
const {
|
21
21
|
milestoneType: s,
|
22
|
-
isStudentPresent:
|
23
|
-
isClassOngoing:
|
24
|
-
userType:
|
25
|
-
canCreatePlan:
|
26
|
-
teacherName:
|
22
|
+
isStudentPresent: N,
|
23
|
+
isClassOngoing: v,
|
24
|
+
userType: A,
|
25
|
+
canCreatePlan: G,
|
26
|
+
teacherName: U,
|
27
27
|
parentName: g,
|
28
|
-
courseStream:
|
28
|
+
courseStream: _,
|
29
29
|
activeMilestoneId: F,
|
30
30
|
activeTabId: w,
|
31
31
|
onExpandPastMilestones: V,
|
@@ -48,33 +48,33 @@ const Ce = (d) => {
|
|
48
48
|
onTestReview: Z,
|
49
49
|
onTestStart: ee,
|
50
50
|
onWidgetTabSelection: te
|
51
|
-
} =
|
51
|
+
} = P, n = Se(
|
52
52
|
() => ({
|
53
|
-
milestone_state_group: s === "ACTIVE" ?
|
54
|
-
course_stream:
|
53
|
+
milestone_state_group: s === "ACTIVE" ? A === "TEACHER" ? "LIVE" : "STUDENT_LIVE" : s,
|
54
|
+
course_stream: _,
|
55
55
|
student_id: l
|
56
56
|
}),
|
57
|
-
[s,
|
57
|
+
[s, _, l, A]
|
58
58
|
), {
|
59
59
|
data: o,
|
60
60
|
getAll: m,
|
61
|
-
isStale:
|
61
|
+
isStale: D,
|
62
62
|
isProcessing: S
|
63
|
-
} =
|
64
|
-
(
|
65
|
-
const { searchText: i, selectedBoard:
|
66
|
-
(i ||
|
67
|
-
const
|
68
|
-
const { milestone_name: ne, board: ie, grade:
|
69
|
-
return (i ? ne.toLowerCase().includes(i.toLowerCase()) : !0) && (
|
63
|
+
} = _e(n), [M, I] = R(), [L, C] = R(!1), oe = me(
|
64
|
+
(c) => {
|
65
|
+
const { searchText: i, selectedBoard: r, selectedGrade: a } = c || {};
|
66
|
+
(i || r || a) && C(!0);
|
67
|
+
const T = o == null ? void 0 : o.filter((t) => {
|
68
|
+
const { milestone_name: ne, board: ie, grade: re } = t || {};
|
69
|
+
return (i ? ne.toLowerCase().includes(i.toLowerCase()) : !0) && (r ? ie === r : !0) && (a ? re === a : !0);
|
70
70
|
});
|
71
|
-
I(
|
71
|
+
I(T);
|
72
72
|
},
|
73
73
|
[o]
|
74
74
|
), se = () => {
|
75
|
-
|
75
|
+
C(!1), I(void 0);
|
76
76
|
};
|
77
|
-
if (
|
77
|
+
if (Te(
|
78
78
|
{
|
79
79
|
studentClassroomId: h,
|
80
80
|
actions: [
|
@@ -99,56 +99,56 @@ const Ce = (d) => {
|
|
99
99
|
[e.PAST_MILESTONE_OUTCOME_ADDED],
|
100
100
|
[e.MILESTONE_TEST_ASSIGNED]
|
101
101
|
],
|
102
|
-
callback: (
|
103
|
-
var
|
104
|
-
const i = (
|
105
|
-
(t) => t.eventName === e.MILESTONE_RESOURCE_ASSIGNED || t.eventName === e.MILESTONE_RESOURCE_UNASSIGNED
|
106
|
-
)) == null ? void 0 :
|
107
|
-
(t) => t.eventName === e.MILESTONE_TEST_ASSIGNED
|
108
|
-
)) == null ? void 0 :
|
102
|
+
callback: (c) => {
|
103
|
+
var a, T;
|
104
|
+
const i = (a = c.find(
|
105
|
+
(t) => t.eventName === e.MILESTONE_RESOURCE_ASSIGNED || t.eventName === e.MILESTONE_RESOURCE_UNASSIGNED
|
106
|
+
)) == null ? void 0 : a.eventPayload, r = (T = c.find(
|
107
|
+
(t) => t.eventName === e.MILESTONE_TEST_ASSIGNED
|
108
|
+
)) == null ? void 0 : T.eventPayload;
|
109
109
|
if (i) {
|
110
110
|
const { milestoneId: t } = i || {};
|
111
|
-
f(l),
|
111
|
+
f(l), Ae(t);
|
112
112
|
}
|
113
|
-
if (
|
114
|
-
const { milestoneId: t } =
|
115
|
-
f(l),
|
113
|
+
if (r) {
|
114
|
+
const { milestoneId: t } = r;
|
115
|
+
f(l), De(t);
|
116
116
|
}
|
117
|
-
|
117
|
+
ue(n);
|
118
118
|
}
|
119
119
|
},
|
120
|
-
(s === "ACTIVE" || s === "INACTIVE") &&
|
120
|
+
(s === "ACTIVE" || s === "INACTIVE") && N
|
121
121
|
), p(() => {
|
122
122
|
m(n);
|
123
123
|
}, [m, n]), p(() => {
|
124
|
-
!S &&
|
125
|
-
}, [m, n,
|
126
|
-
return /* @__PURE__ */
|
124
|
+
!S && D && m(n);
|
125
|
+
}, [m, n, D, S]), S && !o)
|
126
|
+
return /* @__PURE__ */ E(Le, { numMilestones: 2 });
|
127
127
|
const O = s === "ACTIVE" && o && o.length > 6;
|
128
|
-
return /* @__PURE__ */
|
129
|
-
S && /* @__PURE__ */
|
130
|
-
O && /* @__PURE__ */
|
131
|
-
/* @__PURE__ */
|
132
|
-
|
128
|
+
return /* @__PURE__ */ u(Ce, { $disablePointerEvents: S, children: [
|
129
|
+
S && /* @__PURE__ */ E(Oe, { children: /* @__PURE__ */ E("img", { src: ce.LOADER_1, alt: "loading" }) }),
|
130
|
+
O && /* @__PURE__ */ u(ae, { children: [
|
131
|
+
/* @__PURE__ */ E(
|
132
|
+
Me,
|
133
133
|
{
|
134
|
-
filteredMilestones:
|
134
|
+
filteredMilestones: M,
|
135
135
|
milestones: o,
|
136
136
|
handleFilterMilestones: oe,
|
137
137
|
handleClearFilter: se
|
138
138
|
}
|
139
139
|
),
|
140
|
-
/* @__PURE__ */
|
140
|
+
/* @__PURE__ */ E(de, { heightX: 1.5 })
|
141
141
|
] }),
|
142
|
-
/* @__PURE__ */
|
142
|
+
/* @__PURE__ */ E(
|
143
143
|
Ie,
|
144
144
|
{
|
145
145
|
showFilters: !!O,
|
146
|
-
canCreatePlan:
|
147
|
-
isClassOngoing:
|
146
|
+
canCreatePlan: G,
|
147
|
+
isClassOngoing: v,
|
148
148
|
isFiltersAdded: L,
|
149
|
-
isStudentPresent:
|
149
|
+
isStudentPresent: N,
|
150
150
|
milestoneType: s,
|
151
|
-
milestones: L ?
|
151
|
+
milestones: L ? M : o,
|
152
152
|
onAddChapter: K,
|
153
153
|
onAddOutcome: x,
|
154
154
|
onChapterClick: b,
|
@@ -172,16 +172,16 @@ const Ce = (d) => {
|
|
172
172
|
activeTabId: w,
|
173
173
|
onWidgetTabSelection: te,
|
174
174
|
studentId: l,
|
175
|
-
studentName:
|
176
|
-
teacherName:
|
175
|
+
studentName: Ee.titleCase(d),
|
176
|
+
teacherName: U,
|
177
177
|
parentName: g,
|
178
|
-
userType:
|
179
|
-
courseStream:
|
178
|
+
userType: A,
|
179
|
+
courseStream: _
|
180
180
|
}
|
181
181
|
)
|
182
182
|
] });
|
183
183
|
}
|
184
|
-
), je =
|
184
|
+
), je = Re;
|
185
185
|
export {
|
186
186
|
je as default
|
187
187
|
};
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"milestone-list-container.js","sources":["../../../../src/features/milestone/milestone-list-container/milestone-list-container.tsx"],"sourcesContent":["import type {\n IMilestoneContainerProps,\n IMilestoneListQueryParams,\n} from './milestone-list-container-types';\nimport type { IMilestoneData } from './milestone-list/milestone-list-types';\n\nimport { titleCase } from 'humanize-plus';\nimport React, { memo, useCallback, useEffect, useMemo, useState } from 'react';\n\nimport { ILLUSTRATIONS } from '../../../assets/illustrations/illustrations';\nimport { EVENTS } from '../../communication/pub-sub/constants';\nimport { useInClassActionListener } from '../../communication/pub-sub/hooks';\nimport { invalidateHomeworks } from '../../homework/hw-card-list/api/get-homeworks';\nimport Separator from '../../ui/separator/separator';\nimport { invalidateMilestoneResources } from './api/get-milestone-resources';\nimport { useGetAllMilestonesdata, invalidateMilestonesData } from './api/get-milestones';\nimport { invalidateTestHelpData } from './api/get-tests-list';\nimport FilterMilestones from './filter-milestones';\nimport MilestoneList from './milestone-list/milestone-list';\nimport MilestoneLoader from './milestone-list/milestone-loader/milestone-loader';\nimport * as Styled from './styled';\n\nconst invalidateAllMilestones = (queryParams: IMilestoneListQueryParams) => {\n invalidateMilestonesData(queryParams);\n};\n\nconst MilestoneListContainer: React.FC<IMilestoneContainerProps> = memo(\n ({ studentName, studentId, studentClassroomId, ...restMilestoneListContainerProps }) => {\n const {\n milestoneType,\n isStudentPresent,\n isClassOngoing,\n userType,\n canCreatePlan,\n teacherName,\n parentName,\n courseStream,\n activeMilestoneId,\n activeTabId,\n onExpandPastMilestones,\n onAddOutcome,\n onChapterClick,\n onEdit,\n onCreateMilestoneTest,\n onDraftPublish,\n onAddChapter,\n onCreatePlan,\n onDelete,\n onAssignResources,\n onNodeAttempt,\n onNodeView,\n onNodeReview,\n onNodeReattempt,\n onNodeReset,\n onNodeUnassign,\n onTestPreview,\n onTestReview,\n onTestStart,\n onWidgetTabSelection,\n } = restMilestoneListContainerProps;\n\n const queryParams: IMilestoneListQueryParams = useMemo(\n () =>\n ({\n milestone_state_group:\n milestoneType === 'ACTIVE'\n ? userType === 'TEACHER'\n ? 'LIVE'\n : 'STUDENT_LIVE'\n : milestoneType,\n course_stream: courseStream,\n student_id: studentId,\n }) as const,\n [milestoneType, courseStream, studentId, userType],\n );\n\n const {\n data: milestoneData,\n getAll: getMilestoneData,\n isStale: isMilestoneDataStale,\n isProcessing: isMilestoneProcessing,\n } = useGetAllMilestonesdata(queryParams);\n\n const [filteredMilestones, setFilteredMilestones] = useState<IMilestoneData[] | undefined>();\n const [isFiltersAdded, setIsFiltersAdded] = useState<boolean>(false);\n\n const handleFilterMilestones = useCallback(\n (data: { searchText?: string; selectedBoard?: string; selectedGrade?: string }) => {\n const { searchText, selectedBoard, selectedGrade } = data || {};\n\n if (searchText || selectedBoard || selectedGrade) {\n setIsFiltersAdded(true);\n }\n\n const filteredData = milestoneData?.filter(item => {\n const { milestone_name: milestoneName, board, grade } = item || {};\n const matchesSearchText = searchText\n ? milestoneName.toLowerCase().includes(searchText.toLowerCase())\n : true;\n const matchesCurriculum = selectedBoard ? board === selectedBoard : true;\n const matchesGrade = selectedGrade ? grade === selectedGrade : true;\n\n return matchesSearchText && matchesCurriculum && matchesGrade;\n });\n\n setFilteredMilestones(filteredData);\n },\n [milestoneData],\n );\n\n const handleClearFilter = () => {\n setIsFiltersAdded(false);\n setFilteredMilestones(undefined);\n };\n\n useInClassActionListener(\n {\n studentClassroomId,\n actions: [\n [EVENTS.CHAPTER_UPDATED],\n [EVENTS.LESSONS_MARKED_AS_FAMILIAR],\n [EVENTS.LESSONS_MARKED_AS_IRRELEVANT],\n [EVENTS.LESSONS_PROGRESS_RESET],\n [EVENTS.UNLOCK_SHEETS],\n [EVENTS.EXTRA_PRACTICE_ASSIGNED],\n [EVENTS.MILESTONE_DATE_UPDATED],\n [EVENTS.MILESTONE_DELETED],\n [EVENTS.MILESTONE_NAME_UPDATED],\n [EVENTS.MILESTONE_EDITED],\n [EVENTS.MILESTONE_RESOURCE_ASSIGNED],\n [EVENTS.MILESTONE_RESOURCE_UNASSIGNED],\n [EVENTS.MILESTONE_RESOURCE_RESET],\n [EVENTS.SHEET_UNASSIGNED],\n [EVENTS.GOAL_CREATED],\n [EVENTS.GOAL_EDITED],\n [EVENTS.GOAL_DELETED],\n [EVENTS.GOAL_OUTCOME_ADDED],\n [EVENTS.PAST_MILESTONE_OUTCOME_ADDED],\n [EVENTS.MILESTONE_TEST_ASSIGNED],\n ],\n callback: messages => {\n const milestoneResourceEventPayload = messages.find(\n message =>\n message.eventName === EVENTS.MILESTONE_RESOURCE_ASSIGNED ||\n message.eventName === EVENTS.MILESTONE_RESOURCE_UNASSIGNED ||\n message.eventName === EVENTS.MILESTONE_RESOURCE_RESET,\n )?.eventPayload;\n const milestoneTestEventPayload = messages.find(\n message =>\n message.eventName === EVENTS.MILESTONE_TEST_ASSIGNED ||\n message.eventName === EVENTS.MILESTONE_RESOURCE_RESET,\n )?.eventPayload;\n\n if (milestoneResourceEventPayload) {\n const { milestoneId: resourceMilestoneId } =\n (milestoneResourceEventPayload as { milestoneId: string }) || {};\n\n invalidateHomeworks(studentId);\n invalidateMilestoneResources(resourceMilestoneId);\n }\n\n if (milestoneTestEventPayload) {\n const { milestoneId } = milestoneTestEventPayload as { milestoneId: string };\n\n invalidateHomeworks(studentId);\n invalidateTestHelpData(milestoneId);\n }\n\n invalidateAllMilestones(queryParams);\n },\n },\n (milestoneType === 'ACTIVE' || milestoneType === 'INACTIVE') && isStudentPresent,\n );\n\n useEffect(() => {\n getMilestoneData(queryParams);\n }, [getMilestoneData, queryParams]);\n\n useEffect(() => {\n if (!isMilestoneProcessing && isMilestoneDataStale) {\n getMilestoneData(queryParams);\n }\n }, [getMilestoneData, queryParams, isMilestoneDataStale, isMilestoneProcessing]);\n\n if (isMilestoneProcessing && !milestoneData) {\n return <MilestoneLoader numMilestones={2} />;\n }\n\n const showFilters = milestoneType === 'ACTIVE' && milestoneData && milestoneData.length > 6;\n\n return (\n <Styled.ContentWrapper $disablePointerEvents={isMilestoneProcessing}>\n {isMilestoneProcessing && (\n <Styled.LoaderWrapper>\n <img src={ILLUSTRATIONS.LOADER_1} alt=\"loading\" />\n </Styled.LoaderWrapper>\n )}\n {showFilters && (\n <>\n <FilterMilestones\n filteredMilestones={filteredMilestones}\n milestones={milestoneData}\n handleFilterMilestones={handleFilterMilestones}\n handleClearFilter={handleClearFilter}\n />\n <Separator heightX={1.5} />\n </>\n )}\n\n <MilestoneList\n showFilters={!!showFilters}\n canCreatePlan={canCreatePlan}\n isClassOngoing={isClassOngoing}\n isFiltersAdded={isFiltersAdded}\n isStudentPresent={isStudentPresent}\n milestoneType={milestoneType}\n milestones={isFiltersAdded ? filteredMilestones : milestoneData}\n onAddChapter={onAddChapter}\n onAddOutcome={onAddOutcome}\n onChapterClick={onChapterClick}\n onCreatePlan={onCreatePlan}\n onDelete={onDelete}\n onDraftPublish={onDraftPublish}\n onEdit={onEdit}\n onExpandPastMilestones={onExpandPastMilestones}\n onCreateMilestoneTest={onCreateMilestoneTest}\n onAssignResources={onAssignResources}\n onTestPreview={onTestPreview}\n onTestReview={onTestReview}\n onTestStart={onTestStart}\n onNodeAttempt={onNodeAttempt}\n onNodeView={onNodeView}\n onNodeReview={onNodeReview}\n onNodeReattempt={onNodeReattempt}\n onNodeReset={onNodeReset}\n onNodeUnassign={onNodeUnassign}\n activeMilestoneId={activeMilestoneId}\n activeTabId={activeTabId}\n onWidgetTabSelection={onWidgetTabSelection}\n studentId={studentId}\n studentName={titleCase(studentName)}\n teacherName={teacherName}\n parentName={parentName}\n userType={userType}\n courseStream={courseStream}\n />\n </Styled.ContentWrapper>\n );\n },\n);\n\nexport default MilestoneListContainer;\n"],"names":["invalidateAllMilestones","queryParams","invalidateMilestonesData","MilestoneListContainer","memo","studentName","studentId","studentClassroomId","restMilestoneListContainerProps","milestoneType","isStudentPresent","isClassOngoing","userType","canCreatePlan","teacherName","parentName","courseStream","activeMilestoneId","activeTabId","onExpandPastMilestones","onAddOutcome","onChapterClick","onEdit","onCreateMilestoneTest","onDraftPublish","onAddChapter","onCreatePlan","onDelete","onAssignResources","onNodeAttempt","onNodeView","onNodeReview","onNodeReattempt","onNodeReset","onNodeUnassign","onTestPreview","onTestReview","onTestStart","onWidgetTabSelection","useMemo","milestoneData","getMilestoneData","isMilestoneDataStale","isMilestoneProcessing","useGetAllMilestonesdata","filteredMilestones","setFilteredMilestones","useState","isFiltersAdded","setIsFiltersAdded","handleFilterMilestones","useCallback","data","searchText","selectedBoard","selectedGrade","filteredData","item","milestoneName","board","grade","handleClearFilter","useInClassActionListener","EVENTS","messages","milestoneResourceEventPayload","_a","message","milestoneTestEventPayload","_b","resourceMilestoneId","invalidateHomeworks","invalidateMilestoneResources","milestoneId","invalidateTestHelpData","useEffect","jsx","MilestoneLoader","showFilters","jsxs","Styled.ContentWrapper","Styled.LoaderWrapper","ILLUSTRATIONS","Fragment","FilterMilestones","Separator","MilestoneList","titleCase","MilestoneListContainer$1"],"mappings":";;;;;;;;;;;;;;;AAsBA,MAAMA,KAA0B,CAACC,MAA2C;AAC1E,EAAAC,GAAyBD,CAAW;AACtC,GAEME,KAA6DC;AAAA,EACjE,CAAC,EAAE,aAAAC,GAAa,WAAAC,GAAW,oBAAAC,GAAoB,GAAGC,QAAsC;AAChF,UAAA;AAAA,MACJ,eAAAC;AAAA,MACA,kBAAAC;AAAA,MACA,gBAAAC;AAAA,MACA,UAAAC;AAAA,MACA,eAAAC;AAAA,MACA,aAAAC;AAAA,MACA,YAAAC;AAAA,MACA,cAAAC;AAAA,MACA,mBAAAC;AAAA,MACA,aAAAC;AAAA,MACA,wBAAAC;AAAA,MACA,cAAAC;AAAA,MACA,gBAAAC;AAAA,MACA,QAAAC;AAAA,MACA,uBAAAC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AAAF;AAAA,UACA,gBAAAqC;AAAA,UACA,kBAAAtC;AAAA,UACA,eAAAD;AAAA,UACA,YAAYuC,IAAiBH,IAAqBL;AAAA,UAClD,cAAAf;AAAA,UACA,cAAAL;AAAA,UACA,gBAAAC;AAAA,UACA,cAAAK;AAAA,UACA,UAAAC;AAAA,UACA,gBAAAH;AAAA,UACA,QAAAF;AAAA,UACA,wBAAAH;AAAA,UACA,uBAAAI;AAAA,UACA,mBAAAK;AAAA,UACA,eAAAO;AAAA,UACA,cAAAC;AAAA,UACA,aAAAC;AAAA,UACA,eAAAR;AAAA,UACA,YAAAC;AAAA,UACA,cAAAC;AAAA,UACA,iBAAAC;AAAA,UACA,aAAAC;AAAA,UACA,gBAAAC;AAAA,UACA,mBAAAjB;AAAA,UACA,aAAAC;AAAA,UACA,sBAAAoB;AAAA,UACA,WAAAhC;AAAA,UACA,aAAaiF,aAAUlF,CAAW;AAAA,UAClC,aAAAS;AAAA,UACA,YAAAC;AAAA,UACA,UAAAH;AAAA,UACA,cAAAI;AAAA,QAAA;AAAA,MACF;AAAA,IACF,EAAA,CAAA;AAAA,EAEJ;AACF,GAEAwE,KAAerF;"}
|
1
|
+
{"version":3,"file":"milestone-list-container.js","sources":["../../../../src/features/milestone/milestone-list-container/milestone-list-container.tsx"],"sourcesContent":["import type {\n IMilestoneContainerProps,\n IMilestoneListQueryParams,\n} from './milestone-list-container-types';\nimport type { IMilestoneData } from './milestone-list/milestone-list-types';\n\nimport { titleCase } from 'humanize-plus';\nimport React, { memo, useCallback, useEffect, useMemo, useState } from 'react';\n\nimport { ILLUSTRATIONS } from '../../../assets/illustrations/illustrations';\nimport { EVENTS } from '../../communication/pub-sub/constants';\nimport { useInClassActionListener } from '../../communication/pub-sub/hooks';\nimport { invalidateHomeworks } from '../../homework/hw-card-list/api/get-homeworks';\nimport Separator from '../../ui/separator/separator';\nimport { invalidateMilestoneResources } from './api/get-milestone-resources';\nimport { useGetAllMilestonesdata, invalidateMilestonesData } from './api/get-milestones';\nimport { invalidateTestHelpData } from './api/get-tests-list';\nimport FilterMilestones from './filter-milestones';\nimport MilestoneList from './milestone-list/milestone-list';\nimport MilestoneLoader from './milestone-list/milestone-loader/milestone-loader';\nimport * as Styled from './styled';\n\nconst invalidateAllMilestones = (queryParams: IMilestoneListQueryParams) => {\n invalidateMilestonesData(queryParams);\n};\n\nconst MilestoneListContainer: React.FC<IMilestoneContainerProps> = memo(\n ({ studentName, studentId, studentClassroomId, ...restMilestoneListContainerProps }) => {\n const {\n milestoneType,\n isStudentPresent,\n isClassOngoing,\n userType,\n canCreatePlan,\n teacherName,\n parentName,\n courseStream,\n activeMilestoneId,\n activeTabId,\n onExpandPastMilestones,\n onAddOutcome,\n onChapterClick,\n onEdit,\n onCreateMilestoneTest,\n onDraftPublish,\n onAddChapter,\n onCreatePlan,\n onDelete,\n onAssignResources,\n onNodeAttempt,\n onNodeView,\n onNodeReview,\n onNodeReattempt,\n onNodeReset,\n onNodeUnassign,\n onTestPreview,\n onTestReview,\n onTestStart,\n onWidgetTabSelection,\n } = restMilestoneListContainerProps;\n\n const queryParams: IMilestoneListQueryParams = useMemo(\n () =>\n ({\n milestone_state_group:\n milestoneType === 'ACTIVE'\n ? userType === 'TEACHER'\n ? 'LIVE'\n : 'STUDENT_LIVE'\n : milestoneType,\n course_stream: courseStream,\n student_id: studentId,\n }) as const,\n [milestoneType, courseStream, studentId, userType],\n );\n\n const {\n data: milestoneData,\n getAll: getMilestoneData,\n isStale: isMilestoneDataStale,\n isProcessing: isMilestoneProcessing,\n } = useGetAllMilestonesdata(queryParams);\n\n const [filteredMilestones, setFilteredMilestones] = useState<IMilestoneData[] | undefined>();\n const [isFiltersAdded, setIsFiltersAdded] = useState<boolean>(false);\n\n const handleFilterMilestones = useCallback(\n (data: { searchText?: string; selectedBoard?: string; selectedGrade?: string }) => {\n const { searchText, selectedBoard, selectedGrade } = data || {};\n\n if (searchText || selectedBoard || selectedGrade) {\n setIsFiltersAdded(true);\n }\n\n const filteredData = milestoneData?.filter(item => {\n const { milestone_name: milestoneName, board, grade } = item || {};\n const matchesSearchText = searchText\n ? milestoneName.toLowerCase().includes(searchText.toLowerCase())\n : true;\n const matchesCurriculum = selectedBoard ? board === selectedBoard : true;\n const matchesGrade = selectedGrade ? grade === selectedGrade : true;\n\n return matchesSearchText && matchesCurriculum && matchesGrade;\n });\n\n setFilteredMilestones(filteredData);\n },\n [milestoneData],\n );\n\n const handleClearFilter = () => {\n setIsFiltersAdded(false);\n setFilteredMilestones(undefined);\n };\n\n useInClassActionListener(\n {\n studentClassroomId,\n actions: [\n [EVENTS.CHAPTER_UPDATED],\n [EVENTS.LESSONS_MARKED_AS_FAMILIAR],\n [EVENTS.LESSONS_MARKED_AS_IRRELEVANT],\n [EVENTS.LESSONS_PROGRESS_RESET],\n [EVENTS.UNLOCK_SHEETS],\n [EVENTS.EXTRA_PRACTICE_ASSIGNED],\n [EVENTS.MILESTONE_DATE_UPDATED],\n [EVENTS.MILESTONE_DELETED],\n [EVENTS.MILESTONE_NAME_UPDATED],\n [EVENTS.MILESTONE_EDITED],\n [EVENTS.MILESTONE_RESOURCE_ASSIGNED],\n [EVENTS.MILESTONE_RESOURCE_UNASSIGNED],\n [EVENTS.MILESTONE_RESOURCE_RESET],\n [EVENTS.SHEET_UNASSIGNED],\n [EVENTS.GOAL_CREATED],\n [EVENTS.GOAL_EDITED],\n [EVENTS.GOAL_DELETED],\n [EVENTS.GOAL_OUTCOME_ADDED],\n [EVENTS.PAST_MILESTONE_OUTCOME_ADDED],\n [EVENTS.MILESTONE_TEST_ASSIGNED],\n ],\n callback: messages => {\n const milestoneResourceEventPayload = messages.find(\n message =>\n message.eventName === EVENTS.MILESTONE_RESOURCE_ASSIGNED ||\n message.eventName === EVENTS.MILESTONE_RESOURCE_UNASSIGNED,\n )?.eventPayload;\n const milestoneTestEventPayload = messages.find(\n message => message.eventName === EVENTS.MILESTONE_TEST_ASSIGNED,\n )?.eventPayload;\n\n if (milestoneResourceEventPayload) {\n const { milestoneId: resourceMilestoneId } =\n (milestoneResourceEventPayload as { milestoneId: string }) || {};\n\n invalidateHomeworks(studentId);\n invalidateMilestoneResources(resourceMilestoneId);\n }\n\n if (milestoneTestEventPayload) {\n const { milestoneId } = milestoneTestEventPayload as { milestoneId: string };\n\n invalidateHomeworks(studentId);\n invalidateTestHelpData(milestoneId);\n }\n\n invalidateAllMilestones(queryParams);\n },\n },\n (milestoneType === 'ACTIVE' || milestoneType === 'INACTIVE') && isStudentPresent,\n );\n\n useEffect(() => {\n getMilestoneData(queryParams);\n }, [getMilestoneData, queryParams]);\n\n useEffect(() => {\n if (!isMilestoneProcessing && isMilestoneDataStale) {\n getMilestoneData(queryParams);\n }\n }, [getMilestoneData, queryParams, isMilestoneDataStale, isMilestoneProcessing]);\n\n if (isMilestoneProcessing && !milestoneData) {\n return <MilestoneLoader numMilestones={2} />;\n }\n\n const showFilters = milestoneType === 'ACTIVE' && milestoneData && milestoneData.length > 6;\n\n return (\n <Styled.ContentWrapper $disablePointerEvents={isMilestoneProcessing}>\n {isMilestoneProcessing && (\n <Styled.LoaderWrapper>\n <img src={ILLUSTRATIONS.LOADER_1} alt=\"loading\" />\n </Styled.LoaderWrapper>\n )}\n {showFilters && (\n <>\n <FilterMilestones\n filteredMilestones={filteredMilestones}\n milestones={milestoneData}\n handleFilterMilestones={handleFilterMilestones}\n handleClearFilter={handleClearFilter}\n />\n <Separator heightX={1.5} />\n </>\n )}\n\n <MilestoneList\n showFilters={!!showFilters}\n canCreatePlan={canCreatePlan}\n isClassOngoing={isClassOngoing}\n isFiltersAdded={isFiltersAdded}\n isStudentPresent={isStudentPresent}\n milestoneType={milestoneType}\n milestones={isFiltersAdded ? filteredMilestones : milestoneData}\n onAddChapter={onAddChapter}\n onAddOutcome={onAddOutcome}\n onChapterClick={onChapterClick}\n onCreatePlan={onCreatePlan}\n onDelete={onDelete}\n onDraftPublish={onDraftPublish}\n onEdit={onEdit}\n onExpandPastMilestones={onExpandPastMilestones}\n onCreateMilestoneTest={onCreateMilestoneTest}\n onAssignResources={onAssignResources}\n onTestPreview={onTestPreview}\n onTestReview={onTestReview}\n onTestStart={onTestStart}\n onNodeAttempt={onNodeAttempt}\n onNodeView={onNodeView}\n onNodeReview={onNodeReview}\n onNodeReattempt={onNodeReattempt}\n onNodeReset={onNodeReset}\n onNodeUnassign={onNodeUnassign}\n activeMilestoneId={activeMilestoneId}\n activeTabId={activeTabId}\n onWidgetTabSelection={onWidgetTabSelection}\n studentId={studentId}\n studentName={titleCase(studentName)}\n teacherName={teacherName}\n parentName={parentName}\n userType={userType}\n courseStream={courseStream}\n />\n </Styled.ContentWrapper>\n );\n },\n);\n\nexport default MilestoneListContainer;\n"],"names":["invalidateAllMilestones","queryParams","invalidateMilestonesData","MilestoneListContainer","memo","studentName","studentId","studentClassroomId","restMilestoneListContainerProps","milestoneType","isStudentPresent","isClassOngoing","userType","canCreatePlan","teacherName","parentName","courseStream","activeMilestoneId","activeTabId","onExpandPastMilestones","onAddOutcome","onChapterClick","onEdit","onCreateMilestoneTest","onDraftPublish","onAddChapter","onCreatePlan","onDelete","onAssignResources","onNodeAttempt","onNodeView","onNodeReview","onNodeReattempt","onNodeReset","onNodeUnassign","onTestPreview","onTestReview","onTestStart","onWidgetTabSelection","useMemo","milestoneData","getMilestoneData","isMilestoneDataStale","isMilestoneProcessing","useGetAllMilestonesdata","filteredMilestones","setFilteredMilestones","useState","isFiltersAdded","setIsFiltersAdded","handleFilterMilestones","useCallback","data","searchText","selectedBoard","selectedGrade","filteredData","item","milestoneName","board","grade","handleClearFilter","useInClassActionListener","EVENTS","messages","milestoneResourceEventPayload","_a","message","milestoneTestEventPayload","_b","resourceMilestoneId","invalidateHomeworks","invalidateMilestoneResources","milestoneId","invalidateTestHelpData","useEffect","jsx","MilestoneLoader","showFilters","jsxs","Styled.ContentWrapper","Styled.LoaderWrapper","ILLUSTRATIONS","Fragment","FilterMilestones","Separator","MilestoneList","titleCase","MilestoneListContainer$1"],"mappings":";;;;;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|
5
|
-
import
|
6
|
-
import
|
7
|
-
|
1
|
+
import { jsx as r, jsxs as b } from "react/jsx-runtime";
|
2
|
+
import { memo as $, useCallback as T } from "react";
|
3
|
+
import { NODE_TYPE as l } from "../../../../../../sheets/constants/sheet.js";
|
4
|
+
import u from "../../../../../../ui/arrow-tooltip/arrow-tooltip.js";
|
5
|
+
import f from "../../../../../../ui/image/image.js";
|
6
|
+
import C from "../../../../../../ui/layout/flex-view.js";
|
7
|
+
import { ChapterItemWrapper as E, StyledText as g } from "./chapter-item-styled.js";
|
8
|
+
const y = $(({ chapter: m, selected: t, onChapterSelection: o }) => {
|
8
9
|
const {
|
9
|
-
image_url:
|
10
|
-
name:
|
11
|
-
id:
|
12
|
-
|
13
|
-
item_bank_enabled:
|
14
|
-
} =
|
10
|
+
image_url: s,
|
11
|
+
name: i,
|
12
|
+
id: a,
|
13
|
+
blocks: d,
|
14
|
+
item_bank_enabled: p
|
15
|
+
} = m, h = d.some(
|
16
|
+
(_) => _.sheets.some(
|
17
|
+
(n) => n.node_type === l.ASSESSMENT || n.node_type === l.CHAPTER_ASSESSMENT
|
18
|
+
)
|
19
|
+
), e = !p && !h, c = T(() => {
|
15
20
|
if (e) return null;
|
16
|
-
o(
|
17
|
-
}, [o,
|
21
|
+
o(a);
|
22
|
+
}, [o, a, e]);
|
18
23
|
return /* @__PURE__ */ r(
|
19
|
-
|
24
|
+
u,
|
20
25
|
{
|
21
26
|
position: "bottom",
|
22
27
|
renderAs: "primary",
|
23
28
|
tooltipItem: "Chapter unavailable for test creation",
|
24
29
|
hidden: !e,
|
25
30
|
widthX: 9.5,
|
26
|
-
children: /* @__PURE__ */
|
27
|
-
|
31
|
+
children: /* @__PURE__ */ b(
|
32
|
+
E,
|
28
33
|
{
|
29
34
|
$widthX: 9.5,
|
30
35
|
$heightX: 8.875,
|
@@ -36,13 +41,13 @@ const k = c(({ chapter: l, selected: t, onChapterSelection: o }) => {
|
|
36
41
|
$disabled: e,
|
37
42
|
$borderColor: t ? "BLACK_T_87" : "WHITE_5",
|
38
43
|
$background: t ? "WHITE_3" : "WHITE_1",
|
39
|
-
onClick:
|
44
|
+
onClick: c,
|
40
45
|
children: [
|
41
|
-
/* @__PURE__ */ r(
|
42
|
-
|
46
|
+
/* @__PURE__ */ r(C, { $position: "relative", children: /* @__PURE__ */ r(
|
47
|
+
f,
|
43
48
|
{
|
44
|
-
src:
|
45
|
-
alt:
|
49
|
+
src: s || "",
|
50
|
+
alt: i,
|
46
51
|
withLoader: !0,
|
47
52
|
width: 56,
|
48
53
|
height: 56,
|
@@ -50,12 +55,12 @@ const k = c(({ chapter: l, selected: t, onChapterSelection: o }) => {
|
|
50
55
|
}
|
51
56
|
) }),
|
52
57
|
/* @__PURE__ */ r(
|
53
|
-
|
58
|
+
g,
|
54
59
|
{
|
55
60
|
$renderAs: t ? "ab3-bold" : "ab3",
|
56
61
|
$align: "center",
|
57
62
|
$color: e ? "BLACK_T_38" : "BLACK_T_87",
|
58
|
-
children:
|
63
|
+
children: i
|
59
64
|
}
|
60
65
|
)
|
61
66
|
]
|
@@ -65,6 +70,6 @@ const k = c(({ chapter: l, selected: t, onChapterSelection: o }) => {
|
|
65
70
|
);
|
66
71
|
});
|
67
72
|
export {
|
68
|
-
|
73
|
+
y as default
|
69
74
|
};
|
70
75
|
//# sourceMappingURL=chapter-item.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"chapter-item.js","sources":["../../../../../../../../src/features/milestone/milestone-tests/tests-creation/test-stages/chapter-selection/chapter-item/chapter-item.tsx"],"sourcesContent":["import type { IChapterItem } from './chapter-item-types';\nimport type { FC } from 'react';\n\nimport { useCallback, memo } from 'react';\n\nimport ArrowTooltip from '../../../../../../ui/arrow-tooltip/arrow-tooltip';\nimport Image from '../../../../../../ui/image/image';\nimport FlexView from '../../../../../../ui/layout/flex-view';\nimport * as Styled from './chapter-item-styled';\n\nconst ChapterItem: FC<IChapterItem> = memo(({ chapter, selected, onChapterSelection }) => {\n const {\n image_url: imageUrl,\n name,\n id: userChapterId,\n
|
1
|
+
{"version":3,"file":"chapter-item.js","sources":["../../../../../../../../src/features/milestone/milestone-tests/tests-creation/test-stages/chapter-selection/chapter-item/chapter-item.tsx"],"sourcesContent":["import type { IChapterItem } from './chapter-item-types';\nimport type { FC } from 'react';\n\nimport { useCallback, memo } from 'react';\n\nimport { NODE_TYPE } from '../../../../../../sheets/constants/sheet';\nimport ArrowTooltip from '../../../../../../ui/arrow-tooltip/arrow-tooltip';\nimport Image from '../../../../../../ui/image/image';\nimport FlexView from '../../../../../../ui/layout/flex-view';\nimport * as Styled from './chapter-item-styled';\n\nconst ChapterItem: FC<IChapterItem> = memo(({ chapter, selected, onChapterSelection }) => {\n const {\n image_url: imageUrl,\n name,\n id: userChapterId,\n blocks,\n item_bank_enabled: itemBankEnabled,\n } = chapter;\n const hasTestSheets = blocks.some(block =>\n block.sheets.some(\n sheet =>\n sheet.node_type === NODE_TYPE.ASSESSMENT ||\n sheet.node_type === NODE_TYPE.CHAPTER_ASSESSMENT,\n ),\n );\n\n const isDisabled = !itemBankEnabled && !hasTestSheets;\n\n const handleOnChapterSelection = useCallback(() => {\n if (isDisabled) return null;\n\n onChapterSelection(userChapterId);\n }, [onChapterSelection, userChapterId, isDisabled]);\n\n return (\n <ArrowTooltip\n position=\"bottom\"\n renderAs=\"primary\"\n tooltipItem=\"Chapter unavailable for test creation\"\n hidden={!isDisabled}\n widthX={9.5}\n >\n <Styled.ChapterItemWrapper\n $widthX={9.5}\n $heightX={8.875}\n $gapX={1}\n $gutterX={1}\n $flexGap={12}\n $position=\"relative\"\n $alignItems=\"center\"\n $disabled={isDisabled}\n $borderColor={selected ? 'BLACK_T_87' : 'WHITE_5'}\n $background={selected ? 'WHITE_3' : 'WHITE_1'}\n onClick={handleOnChapterSelection}\n >\n <FlexView $position=\"relative\">\n <Image\n src={imageUrl || ''}\n alt={name}\n withLoader\n width={56}\n height={56}\n borderRadius={50}\n />\n </FlexView>\n <Styled.StyledText\n $renderAs={selected ? 'ab3-bold' : 'ab3'}\n $align=\"center\"\n $color={isDisabled ? 'BLACK_T_38' : 'BLACK_T_87'}\n >\n {name}\n </Styled.StyledText>\n </Styled.ChapterItemWrapper>\n </ArrowTooltip>\n );\n});\n\nexport default ChapterItem;\n"],"names":["ChapterItem","memo","chapter","selected","onChapterSelection","imageUrl","name","userChapterId","blocks","itemBankEnabled","hasTestSheets","block","sheet","NODE_TYPE","isDisabled","handleOnChapterSelection","useCallback","jsx","ArrowTooltip","jsxs","Styled.ChapterItemWrapper","FlexView","Image","Styled.StyledText"],"mappings":";;;;;;;AAWA,MAAMA,IAAgCC,EAAK,CAAC,EAAE,SAAAC,GAAS,UAAAC,GAAU,oBAAAC,QAAyB;AAClF,QAAA;AAAA,IACJ,WAAWC;AAAA,IACX,MAAAC;AAAA,IACA,IAAIC;AAAA,IACJ,QAAAC;AAAA,IACA,mBAAmBC;AAAA,EACjB,IAAAP,GACEQ,IAAgBF,EAAO;AAAA,IAAK,CAAAG,MAChCA,EAAM,OAAO;AAAA,MACX,OACEC,EAAM,cAAcC,EAAU,cAC9BD,EAAM,cAAcC,EAAU;AAAA,IAClC;AAAA,EAAA,GAGIC,IAAa,CAACL,KAAmB,CAACC,GAElCK,IAA2BC,EAAY,MAAM;AACjD,QAAIF,EAAmB,QAAA;AAEvB,IAAAV,EAAmBG,CAAa;AAAA,EAC/B,GAAA,CAACH,GAAoBG,GAAeO,CAAU,CAAC;AAGhD,SAAA,gBAAAG;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,UAAS;AAAA,MACT,UAAS;AAAA,MACT,aAAY;AAAA,MACZ,QAAQ,CAACJ;AAAA,MACT,QAAQ;AAAA,MAER,UAAA,gBAAAK;AAAA,QAACC;AAAAA,QAAA;AAAA,UACC,SAAS;AAAA,UACT,UAAU;AAAA,UACV,OAAO;AAAA,UACP,UAAU;AAAA,UACV,UAAU;AAAA,UACV,WAAU;AAAA,UACV,aAAY;AAAA,UACZ,WAAWN;AAAA,UACX,cAAcX,IAAW,eAAe;AAAA,UACxC,aAAaA,IAAW,YAAY;AAAA,UACpC,SAASY;AAAA,UAET,UAAA;AAAA,YAAC,gBAAAE,EAAAI,GAAA,EAAS,WAAU,YAClB,UAAA,gBAAAJ;AAAA,cAACK;AAAA,cAAA;AAAA,gBACC,KAAKjB,KAAY;AAAA,gBACjB,KAAKC;AAAA,gBACL,YAAU;AAAA,gBACV,OAAO;AAAA,gBACP,QAAQ;AAAA,gBACR,cAAc;AAAA,cAAA;AAAA,YAAA,GAElB;AAAA,YACA,gBAAAW;AAAA,cAACM;AAAAA,cAAA;AAAA,gBACC,WAAWpB,IAAW,aAAa;AAAA,gBACnC,QAAO;AAAA,gBACP,QAAQW,IAAa,eAAe;AAAA,gBAEnC,UAAAR;AAAA,cAAA;AAAA,YACH;AAAA,UAAA;AAAA,QAAA;AAAA,MACF;AAAA,IAAA;AAAA,EAAA;AAGN,CAAC;"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"z-index.js","sources":["../../../../src/features/ui/constants/z-index.ts"],"sourcesContent":["const ZINDEX = {\n CHAPTER_CROWN_ICON: 4,\n CHAPTER_PLUS_ICON: 2,\n CHAPTER_PROGRESS_SVG: 2,\n LPAR_SHEET_ITEM_BOTTOM_DASH_BOX: 1,\n LPAR_SHEET_ITEM_TOP_VERTICAL_ICON: 2,\n MODAL: 20,\n SAT_SUMMARY_SCORE: 25, //* SAT_SUMMARY_SCORE > MODAL\n CANVAS_SCRIBBLING: 26, //* CANVAS_SCRIBBLING > Learnosity\n TILE_CONTAINER: 30, //whiteboard\n QUESTION_TIPS: -1,\n DESMOS_CALCULATOR: 2,\n GOAL_CHAPTER_SHEETS_MENU: 4,\n} as const;\n\nexport { ZINDEX };\n"],"names":["ZINDEX"],"mappings":"AAAA,MAAMA,IAAS;AAAA,EACb,oBAAoB;AAAA,EACpB,mBAAmB;AAAA,EACnB,sBAAsB;AAAA,EACtB,iCAAiC;AAAA,EACjC,mCAAmC;AAAA,EACnC,OAAO;AAAA,EACP,mBAAmB;AAAA;AAAA,EACnB,mBAAmB;AAAA;AAAA,EACnB,gBAAgB;AAAA;AAAA,EAChB,eAAe;AAAA,EACf,mBAAmB;AAAA,EACnB,0BAA0B;
|
1
|
+
{"version":3,"file":"z-index.js","sources":["../../../../src/features/ui/constants/z-index.ts"],"sourcesContent":["const ZINDEX = {\n CHAPTER_CROWN_ICON: 4,\n CHAPTER_PLUS_ICON: 2,\n CHAPTER_PROGRESS_SVG: 2,\n LPAR_SHEET_ITEM_BOTTOM_DASH_BOX: 1,\n LPAR_SHEET_ITEM_TOP_VERTICAL_ICON: 2,\n MODAL: 20,\n SAT_SUMMARY_SCORE: 25, //* SAT_SUMMARY_SCORE > MODAL\n CANVAS_SCRIBBLING: 26, //* CANVAS_SCRIBBLING > Learnosity\n TILE_CONTAINER: 30, //whiteboard\n QUESTION_TIPS: -1,\n DESMOS_CALCULATOR: 2,\n GOAL_CHAPTER_SHEETS_MENU: 4,\n JOURNEY_OVERLAY: 1000,\n} as const;\n\nexport { ZINDEX };\n"],"names":["ZINDEX"],"mappings":"AAAA,MAAMA,IAAS;AAAA,EACb,oBAAoB;AAAA,EACpB,mBAAmB;AAAA,EACnB,sBAAsB;AAAA,EACtB,iCAAiC;AAAA,EACjC,mCAAmC;AAAA,EACnC,OAAO;AAAA,EACP,mBAAmB;AAAA;AAAA,EACnB,mBAAmB;AAAA;AAAA,EACnB,gBAAgB;AAAA;AAAA,EAChB,eAAe;AAAA,EACf,mBAAmB;AAAA,EACnB,0BAA0B;AAAA,EAC1B,iBAAiB;AACnB;"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"device.js","sources":["../../../../src/features/ui/theme/device.ts"],"sourcesContent":["import type { TSupportedDevices } from '../types';\n\nexport const getDeviceConfig = (): TSupportedDevices => {\n const MOBILE_WIDTH = 600;\n\n return window.innerWidth <= MOBILE_WIDTH ? 'mobile' : 'desktop';\n};\n"],"names":["getDeviceConfig"],"mappings":"AAEO,MAAMA,IAAkB,MAGtB,OAAO,cAAc,MAAe,WAAW;"}
|
@@ -1,30 +1,32 @@
|
|
1
1
|
import r from "./arrow-tooltip.js";
|
2
2
|
import e from "./button.js";
|
3
|
-
import
|
4
|
-
import
|
5
|
-
import n from "./
|
6
|
-
import f from "./
|
7
|
-
import p from "./
|
8
|
-
import u from "./
|
9
|
-
import
|
10
|
-
import
|
11
|
-
|
12
|
-
|
3
|
+
import i from "./checkbox.js";
|
4
|
+
import m, { hues as g } from "./clrs.js";
|
5
|
+
import { getDeviceConfig as n } from "./device.js";
|
6
|
+
import f from "./input.js";
|
7
|
+
import p from "./layout.js";
|
8
|
+
import u from "./tab.js";
|
9
|
+
import C from "./text.js";
|
10
|
+
import c from "./text-button.js";
|
11
|
+
import { getZIndexConfig as x } from "./z-index.js";
|
12
|
+
const v = () => {
|
13
|
+
const t = p(), { gutter: o } = t;
|
13
14
|
return {
|
14
15
|
arrowTooltip: r(),
|
15
16
|
button: e(o),
|
16
|
-
colors:
|
17
|
-
hues:
|
18
|
-
input:
|
19
|
-
checkbox:
|
17
|
+
colors: m(),
|
18
|
+
hues: g,
|
19
|
+
input: f(o),
|
20
|
+
checkbox: i(o),
|
20
21
|
layout: t,
|
21
|
-
tab:
|
22
|
-
text:
|
23
|
-
textButton:
|
24
|
-
zIndex:
|
22
|
+
tab: u(t.gutter),
|
23
|
+
text: C(),
|
24
|
+
textButton: c(),
|
25
|
+
zIndex: x(),
|
26
|
+
device: n()
|
25
27
|
};
|
26
28
|
};
|
27
29
|
export {
|
28
|
-
|
30
|
+
v as getTheme
|
29
31
|
};
|
30
32
|
//# sourceMappingURL=get-theme.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"get-theme.js","sources":["../../../../src/features/ui/theme/get-theme.ts"],"sourcesContent":["import type { DefaultTheme } from 'styled-components';\n\nimport getArrowTooltipConfig from './arrow-tooltip';\nimport getButtonConfig from './button';\nimport getCheckboxConfig from './checkbox';\nimport getColors, { hues } from './clrs';\nimport getInputConfig from './input';\nimport getLayout from './layout';\nimport getTabConfig from './tab';\nimport getTextTypes from './text';\nimport getTextButtonConfig from './text-button';\nimport { getZIndexConfig } from './z-index';\n\nconst getTheme: () => DefaultTheme = () => {\n const layout = getLayout();\n const { gutter } = layout;\n\n return {\n arrowTooltip: getArrowTooltipConfig(),\n button: getButtonConfig(gutter),\n colors: getColors(),\n hues: hues,\n input: getInputConfig(gutter),\n checkbox: getCheckboxConfig(gutter),\n layout,\n tab: getTabConfig(layout.gutter),\n text: getTextTypes(),\n textButton: getTextButtonConfig(),\n zIndex: getZIndexConfig(),\n };\n};\n\nexport { getTheme };\n"],"names":["getTheme","layout","getLayout","gutter","getArrowTooltipConfig","getButtonConfig","getColors","hues","getInputConfig","getCheckboxConfig","getTabConfig","getTextTypes","getTextButtonConfig","getZIndexConfig"],"mappings":"
|
1
|
+
{"version":3,"file":"get-theme.js","sources":["../../../../src/features/ui/theme/get-theme.ts"],"sourcesContent":["import type { DefaultTheme } from 'styled-components';\n\nimport getArrowTooltipConfig from './arrow-tooltip';\nimport getButtonConfig from './button';\nimport getCheckboxConfig from './checkbox';\nimport getColors, { hues } from './clrs';\nimport { getDeviceConfig } from './device';\nimport getInputConfig from './input';\nimport getLayout from './layout';\nimport getTabConfig from './tab';\nimport getTextTypes from './text';\nimport getTextButtonConfig from './text-button';\nimport { getZIndexConfig } from './z-index';\n\nconst getTheme: () => DefaultTheme = () => {\n const layout = getLayout();\n const { gutter } = layout;\n\n return {\n arrowTooltip: getArrowTooltipConfig(),\n button: getButtonConfig(gutter),\n colors: getColors(),\n hues: hues,\n input: getInputConfig(gutter),\n checkbox: getCheckboxConfig(gutter),\n layout,\n tab: getTabConfig(layout.gutter),\n text: getTextTypes(),\n textButton: getTextButtonConfig(),\n zIndex: getZIndexConfig(),\n device: getDeviceConfig(),\n };\n};\n\nexport { getTheme };\n"],"names":["getTheme","layout","getLayout","gutter","getArrowTooltipConfig","getButtonConfig","getColors","hues","getInputConfig","getCheckboxConfig","getTabConfig","getTextTypes","getTextButtonConfig","getZIndexConfig","getDeviceConfig"],"mappings":";;;;;;;;;;;AAcA,MAAMA,IAA+B,MAAM;AACzC,QAAMC,IAASC,KACT,EAAE,QAAAC,EAAW,IAAAF;AAEZ,SAAA;AAAA,IACL,cAAcG,EAAsB;AAAA,IACpC,QAAQC,EAAgBF,CAAM;AAAA,IAC9B,QAAQG,EAAU;AAAA,IAClB,MAAAC;AAAA,IACA,OAAOC,EAAeL,CAAM;AAAA,IAC5B,UAAUM,EAAkBN,CAAM;AAAA,IAClC,QAAAF;AAAA,IACA,KAAKS,EAAaT,EAAO,MAAM;AAAA,IAC/B,MAAMU,EAAa;AAAA,IACnB,YAAYC,EAAoB;AAAA,IAChC,QAAQC,EAAgB;AAAA,IACxB,QAAQC,EAAgB;AAAA,EAAA;AAE5B;"}
|
package/dist/index.d.ts
CHANGED
@@ -457,6 +457,8 @@ declare const getCheckboxConfig: IGetCheckboxConfig;
|
|
457
457
|
|
458
458
|
declare function getColors(): TColorsMap;
|
459
459
|
|
460
|
+
declare const getDeviceConfig: () => TSupportedDevices;
|
461
|
+
|
460
462
|
declare const getInputConfig: IGetInputConfig;
|
461
463
|
|
462
464
|
declare function getLayout(multiplier?: number): ILayout;
|
@@ -3090,6 +3092,7 @@ export declare interface ITheme {
|
|
3090
3092
|
textButton: ReturnType<typeof getTextButtonConfig>;
|
3091
3093
|
zIndex: ReturnType<typeof getZIndexConfig>;
|
3092
3094
|
checkbox: ReturnType<typeof getCheckboxConfig>;
|
3095
|
+
device: ReturnType<typeof getDeviceConfig>;
|
3093
3096
|
}
|
3094
3097
|
|
3095
3098
|
declare interface ITile {
|
@@ -5216,6 +5219,8 @@ declare type TSubscribe = (id: string, cb: (data: IActionData | IActionData[]) =
|
|
5216
5219
|
|
5217
5220
|
declare type TSubscribeMouseMove = (id: string, callback: (data: IPointerData) => void) => void;
|
5218
5221
|
|
5222
|
+
export declare type TSupportedDevices = 'mobile' | 'desktop';
|
5223
|
+
|
5219
5224
|
export declare type TTableMode = 'random' | 'sequence' | 'advance' | 'infinite';
|
5220
5225
|
|
5221
5226
|
export declare type TTabSizes = 'xsmall' | 'small' | 'regular' | 'medium';
|
@@ -5522,6 +5527,7 @@ declare const ZINDEX: {
|
|
5522
5527
|
readonly QUESTION_TIPS: -1;
|
5523
5528
|
readonly DESMOS_CALCULATOR: 2;
|
5524
5529
|
readonly GOAL_CHAPTER_SHEETS_MENU: 4;
|
5530
|
+
readonly JOURNEY_OVERLAY: 1000;
|
5525
5531
|
};
|
5526
5532
|
|
5527
5533
|
export { }
|