@cuemath/leap 2.9.4-as5 → 2.9.4-as7
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/chapter-details/chapter-banner/chapter-banner.js +2 -2
- package/dist/features/chapters-v2/chapter-details/chapter-banner/chapter-banner.js.map +1 -1
- package/dist/features/chapters-v2/comps/node-card/student-actions/student-actions.js +61 -61
- package/dist/features/chapters-v2/comps/node-card/student-actions/student-actions.js.map +1 -1
- package/dist/features/chapters-v2/comps/node-card/teacher-actions/teacher-actions.js +62 -62
- package/dist/features/chapters-v2/comps/node-card/teacher-actions/teacher-actions.js.map +1 -1
- package/dist/features/communication/pub-sub/constants.js +9 -6
- package/dist/features/communication/pub-sub/constants.js.map +1 -1
- package/dist/features/homework/hw-card-list/hw-card-list.js +3 -4
- package/dist/features/homework/hw-card-list/hw-card-list.js.map +1 -1
- package/dist/features/journey/hooks/use-home-page-journey.js +34 -34
- package/dist/features/journey/hooks/use-home-page-journey.js.map +1 -1
- package/dist/features/journey/use-journey/journey-context-provider.js +48 -48
- package/dist/features/journey/use-journey/journey-context-provider.js.map +1 -1
- package/dist/features/milestone/milestone-list-container/milestone-list/milestone-list.js +43 -43
- package/dist/features/milestone/milestone-list-container/milestone-list/milestone-list.js.map +1 -1
- package/dist/features/milestone/milestone-list-container/milestone-list-container.js +116 -115
- package/dist/features/milestone/milestone-list-container/milestone-list-container.js.map +1 -1
- package/dist/features/milestone/milestone-resources/resources-assign/resources-assign.js +8 -8
- package/dist/features/milestone/milestone-resources/resources-assign/resources-assign.js.map +1 -1
- package/dist/index.d.ts +23 -6
- package/package.json +1 -1
@@ -17,7 +17,7 @@ const a = 52, l = 54, c = 54, ee = B((I) => {
|
|
17
17
|
};
|
18
18
|
}, [r]);
|
19
19
|
if (!o) return null;
|
20
|
-
const { mandatory:
|
20
|
+
const { mandatory: w, optional: T, classwork: _ } = o, { completed: k = 0, total: s = 0 } = w || {}, { completed: y = 0, total: p = 0 } = T || {}, { completed: G = 0, total: m = 0 } = _ || {}, L = m > 0 && G === m;
|
21
21
|
return /* @__PURE__ */ e(
|
22
22
|
b,
|
23
23
|
{
|
@@ -69,7 +69,7 @@ const a = 52, l = 54, c = 54, ee = B((I) => {
|
|
69
69
|
/* @__PURE__ */ t(n, { $flexDirection: "row", $alignItems: "center", $flexGapX: 2.75, children: [
|
70
70
|
!!s && /* @__PURE__ */ t(n, { $position: "relative", $flexDirection: "row", children: [
|
71
71
|
/* @__PURE__ */ e(f, {}),
|
72
|
-
/* @__PURE__ */ t(n, { $flexDirection: "row", $alignItems: "center", $flexGap:
|
72
|
+
/* @__PURE__ */ t(n, { $flexDirection: "row", $alignItems: "center", $flexGap: 8, children: [
|
73
73
|
/* @__PURE__ */ t(i, { $renderAs: "ab2", children: [
|
74
74
|
"Core - ",
|
75
75
|
k,
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"chapter-banner.js","sources":["../../../../../src/features/chapters-v2/chapter-details/chapter-banner/chapter-banner.tsx"],"sourcesContent":["import type { IChapterBannerProps } from './chapter-banner-types';\nimport type { FC } from 'react';\n\nimport { memo, useMemo } from 'react';\n\nimport { ILLUSTRATIONS } from '../../../../assets/illustrations/illustrations';\nimport Check2Icon from '../../../../assets/line-icons/icons/check2';\nimport Image from '../../../ui/image/image';\nimport FlexView from '../../../ui/layout/flex-view';\nimport Text from '../../../ui/text/text';\nimport Tag from '../../comps/tag/tag';\nimport { getChapterCompletionPercentage } from '../../utils';\nimport * as Styled from './chapter-banner-styled';\n\nconst PROGRESS_CIRCLE_RADIUS = 52;\nconst PROGRESS_CIRCLE_CENTER_X = 54;\nconst PROGRESS_CIRCLE_CENTER_Y = 54;\n\n// This component renders a banner for a chapter, displaying its title, progress, and associated tags.\n// It includes an image, progress visualization, and details about the chapter's core and supplementary sheets.\n// It calculates the completion percentage and dynamically positions an icon based on progress.\nconst ChapterBanner: FC<IChapterBannerProps> = memo(props => {\n const { progressStats, imageHue, title, imageUrl } = props;\n\n const completionPercentage = useMemo(() => {\n return getChapterCompletionPercentage(progressStats);\n }, [progressStats]);\n\n const { iconTopVal, iconLeftVal } = useMemo(() => {\n //* Calculate the position of the important icon based on the completion percentage\n //* Convert degrees to radians\n const angleInDegree = completionPercentage === 100 ? 60 : completionPercentage;\n\n const angleInRadian = ((-angleInDegree * 3.6 - 180) * Math.PI) / 180;\n const positionX = PROGRESS_CIRCLE_CENTER_Y + PROGRESS_CIRCLE_RADIUS * Math.sin(angleInRadian);\n const positionY = PROGRESS_CIRCLE_CENTER_X + PROGRESS_CIRCLE_RADIUS * Math.cos(angleInRadian);\n\n return {\n iconLeftVal: positionX,\n iconTopVal: positionY,\n };\n }, [completionPercentage]);\n\n if (!progressStats) return null;\n\n const { mandatory, optional,
|
1
|
+
{"version":3,"file":"chapter-banner.js","sources":["../../../../../src/features/chapters-v2/chapter-details/chapter-banner/chapter-banner.tsx"],"sourcesContent":["import type { IChapterBannerProps } from './chapter-banner-types';\nimport type { FC } from 'react';\n\nimport { memo, useMemo } from 'react';\n\nimport { ILLUSTRATIONS } from '../../../../assets/illustrations/illustrations';\nimport Check2Icon from '../../../../assets/line-icons/icons/check2';\nimport Image from '../../../ui/image/image';\nimport FlexView from '../../../ui/layout/flex-view';\nimport Text from '../../../ui/text/text';\nimport Tag from '../../comps/tag/tag';\nimport { getChapterCompletionPercentage } from '../../utils';\nimport * as Styled from './chapter-banner-styled';\n\nconst PROGRESS_CIRCLE_RADIUS = 52;\nconst PROGRESS_CIRCLE_CENTER_X = 54;\nconst PROGRESS_CIRCLE_CENTER_Y = 54;\n\n// This component renders a banner for a chapter, displaying its title, progress, and associated tags.\n// It includes an image, progress visualization, and details about the chapter's core and supplementary sheets.\n// It calculates the completion percentage and dynamically positions an icon based on progress.\nconst ChapterBanner: FC<IChapterBannerProps> = memo(props => {\n const { progressStats, imageHue, title, imageUrl } = props;\n\n const completionPercentage = useMemo(() => {\n return getChapterCompletionPercentage(progressStats);\n }, [progressStats]);\n\n const { iconTopVal, iconLeftVal } = useMemo(() => {\n //* Calculate the position of the important icon based on the completion percentage\n //* Convert degrees to radians\n const angleInDegree = completionPercentage === 100 ? 60 : completionPercentage;\n\n const angleInRadian = ((-angleInDegree * 3.6 - 180) * Math.PI) / 180;\n const positionX = PROGRESS_CIRCLE_CENTER_Y + PROGRESS_CIRCLE_RADIUS * Math.sin(angleInRadian);\n const positionY = PROGRESS_CIRCLE_CENTER_X + PROGRESS_CIRCLE_RADIUS * Math.cos(angleInRadian);\n\n return {\n iconLeftVal: positionX,\n iconTopVal: positionY,\n };\n }, [completionPercentage]);\n\n if (!progressStats) return null;\n\n const { mandatory, optional, classwork: classWork } = progressStats;\n const { completed: completedMandatorySheets = 0, total: totalMandatorySheets = 0 } =\n mandatory || {};\n const { completed: completedOptionalSheets = 0, total: totalOptionalSheets = 0 } = optional || {};\n const { completed: completedClassWorkSheets = 0, total: totalClassWorkSheets = 0 } =\n classWork || {};\n const showClassWorkTag =\n totalClassWorkSheets > 0 && completedClassWorkSheets === totalClassWorkSheets;\n\n return (\n <Styled.BannerContainer\n $flexDirection=\"row\"\n $justifyContent=\"center\"\n $alignItems=\"center\"\n $widthX={50}\n $background={`${imageHue}_4`}\n >\n <FlexView $height={168} $position=\"relative\">\n <Image\n width=\"100%\"\n height=\"168px\"\n src={ILLUSTRATIONS.CHAPTER_HEADER_BG}\n alt=\"Chapter header background\"\n withLoader\n />\n <Styled.BannerImageWrapper>\n <Styled.BannerImage src={imageUrl} alt=\"Chapter image\" />\n <Styled.ChapterProgressSVG width=\"108px\" height=\"108px\">\n <Styled.ChapterProgressSVGCircle\n $progress={0}\n r={PROGRESS_CIRCLE_RADIUS}\n cx={PROGRESS_CIRCLE_CENTER_X}\n cy={PROGRESS_CIRCLE_CENTER_Y}\n />\n <Styled.ChapterProgressSVGCircle\n $progressCircle\n $progressBackground={'BLACK'}\n $progress={3.3 * completionPercentage}\n r={PROGRESS_CIRCLE_RADIUS}\n cx={PROGRESS_CIRCLE_CENTER_X}\n cy={PROGRESS_CIRCLE_CENTER_Y}\n />\n </Styled.ChapterProgressSVG>\n\n {completionPercentage > 0 && (\n <Styled.StyledImportantIcon $progress $top={iconTopVal} $left={iconLeftVal} />\n )}\n\n {completionPercentage === 100 && (\n <Styled.StyledCheckIcon>\n <Tag Icon={Check2Icon} />\n </Styled.StyledCheckIcon>\n )}\n </Styled.BannerImageWrapper>\n <Styled.BannerTitleWrapper $flexGap={4}>\n <Text $renderAs=\"ah4-bold\">{title}</Text>\n <FlexView $flexDirection=\"row\" $alignItems=\"center\" $flexGapX={2.75}>\n {!!totalMandatorySheets && (\n <FlexView $position=\"relative\" $flexDirection=\"row\">\n <Styled.StyledImportantIcon />\n <FlexView $flexDirection=\"row\" $alignItems=\"center\" $flexGap={8}>\n <Text $renderAs=\"ab2\">\n Core - {completedMandatorySheets}/{totalMandatorySheets}\n </Text>\n {showClassWorkTag && <Tag Icon={Check2Icon} label=\"CW\" />}\n </FlexView>\n </FlexView>\n )}\n {totalOptionalSheets > 0 && (\n <Text $renderAs=\"ab2\">\n Supplementary - {completedOptionalSheets}/{totalOptionalSheets}\n </Text>\n )}\n </FlexView>\n </Styled.BannerTitleWrapper>\n </FlexView>\n </Styled.BannerContainer>\n );\n});\n\nexport default ChapterBanner;\n"],"names":["PROGRESS_CIRCLE_RADIUS","PROGRESS_CIRCLE_CENTER_X","PROGRESS_CIRCLE_CENTER_Y","ChapterBanner","memo","props","progressStats","imageHue","title","imageUrl","completionPercentage","useMemo","getChapterCompletionPercentage","iconTopVal","iconLeftVal","angleInRadian","positionX","positionY","mandatory","optional","classWork","completedMandatorySheets","totalMandatorySheets","completedOptionalSheets","totalOptionalSheets","completedClassWorkSheets","totalClassWorkSheets","showClassWorkTag","jsx","Styled.BannerContainer","jsxs","FlexView","Image","ILLUSTRATIONS","Styled.BannerImageWrapper","Styled.BannerImage","Styled.ChapterProgressSVG","Styled.ChapterProgressSVGCircle","Styled.StyledImportantIcon","Styled.Sty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,EAAA,gBAAe,OAAM,aAAY,UAAS,UAAU,GAC5D,UAAA;AAAA,gBAAC,gBAAAD,EAAAa,GAAA,EAAK,WAAU,OAAM,UAAA;AAAA,kBAAA;AAAA,kBACZtB;AAAA,kBAAyB;AAAA,kBAAEC;AAAA,gBAAA,GACrC;AAAA,gBACCK,KAAqB,gBAAAC,EAAAY,GAAA,EAAI,MAAMC,GAAY,OAAM,MAAK;AAAA,cAAA,GACzD;AAAA,YAAA,GACF;AAAA,YAEDjB,IAAsB,KACpB,gBAAAM,EAAAa,GAAA,EAAK,WAAU,OAAM,UAAA;AAAA,cAAA;AAAA,cACHpB;AAAA,cAAwB;AAAA,cAAEC;AAAA,YAAA,GAC7C;AAAA,UAAA,GAEJ;AAAA,QAAA,GACF;AAAA,MAAA,GACF;AAAA,IAAA;AAAA,EAAA;AAGN,CAAC;"}
|
@@ -1,47 +1,47 @@
|
|
1
|
-
import { jsx as e, jsxs as d, Fragment as
|
2
|
-
import { memo as
|
3
|
-
import
|
4
|
-
import
|
5
|
-
import
|
6
|
-
import
|
7
|
-
import
|
8
|
-
import
|
9
|
-
import { BLOCK_TYPE as
|
1
|
+
import { jsx as e, jsxs as d, Fragment as z } from "react/jsx-runtime";
|
2
|
+
import { memo as F, useState as Y, useCallback as m } from "react";
|
3
|
+
import Z from "../../../../../assets/line-icons/icons/eye2.js";
|
4
|
+
import q from "../../../../../assets/line-icons/icons/redo.js";
|
5
|
+
import J from "../../../../ui/arrow-tooltip/arrow-tooltip.js";
|
6
|
+
import Q from "../../../../ui/context-menu/context-menu.js";
|
7
|
+
import U from "../../../../ui/lottie-animation/lottie-animation.js";
|
8
|
+
import V from "../../../../ui/text/text.js";
|
9
|
+
import { BLOCK_TYPE as ee } from "../../../constants/block-constants.js";
|
10
10
|
import { NODE_CARD_STATES as f } from "../../../constants/node-constants.js";
|
11
|
-
import { getNodeTypeBasedBgImage as
|
12
|
-
import { getNodeCardBasedIcon as
|
13
|
-
import
|
14
|
-
import { NodeCardContainer as
|
15
|
-
import
|
16
|
-
import
|
17
|
-
const
|
11
|
+
import { getNodeTypeBasedBgImage as te } from "../../../utils/index.js";
|
12
|
+
import { getNodeCardBasedIcon as oe } from "../../../utils/node-card-utils.js";
|
13
|
+
import re from "../border-path-animation.js";
|
14
|
+
import { NodeCardContainer as ne, NodeCardInfoWrapper as ae, IconWrapper as ie, StyledImportantIcon as ce, NodeCardContentWrapper as se, NodeCardTitle as de } from "../node-card-styled.js";
|
15
|
+
import me from "../node-card-tags.js";
|
16
|
+
import le from "../node-menu-options/node-menu-options.js";
|
17
|
+
const Ee = F((A) => {
|
18
18
|
const {
|
19
19
|
nodeData: t,
|
20
|
-
imageHue:
|
21
|
-
blockType:
|
20
|
+
imageHue: L,
|
21
|
+
blockType: S,
|
22
22
|
onNodeAttempt: n,
|
23
23
|
onNodeReattempt: a,
|
24
24
|
onNodeReview: i,
|
25
25
|
onNodeView: o
|
26
|
-
} =
|
27
|
-
accuracy:
|
28
|
-
attempt_location:
|
26
|
+
} = A, {
|
27
|
+
accuracy: T,
|
28
|
+
attempt_location: E,
|
29
29
|
node_type: l,
|
30
|
-
card_header:
|
31
|
-
title:
|
30
|
+
card_header: w,
|
31
|
+
title: y,
|
32
32
|
state: c,
|
33
33
|
is_optional: C,
|
34
34
|
sheet_statement: $,
|
35
|
-
permissions:
|
35
|
+
permissions: N,
|
36
36
|
marked_as_completed: s
|
37
37
|
} = t, {
|
38
38
|
can_review: g,
|
39
39
|
can_start: p,
|
40
40
|
can_resume: h,
|
41
41
|
can_reset: I
|
42
|
-
} =
|
43
|
-
(
|
44
|
-
switch (
|
42
|
+
} = N, R = S === ee.GOAL, r = c === f.LOCKED, x = c === f.NOT_STARTED, B = c === f.IN_PROGRESS, v = E === "INCLASS", M = p || h, _ = !C && (B || x), u = !M && (I || g), [W, O] = Y(!1), D = te(l), { icon: G, lottie: H } = oe(l), k = m(
|
43
|
+
(b) => {
|
44
|
+
switch (b) {
|
45
45
|
case "node-card-review":
|
46
46
|
s ? o == null || o(t) : i == null || i(t);
|
47
47
|
return;
|
@@ -49,11 +49,11 @@ const we = Y((L) => {
|
|
49
49
|
a == null || a(t);
|
50
50
|
return;
|
51
51
|
default:
|
52
|
-
throw new Error(`No callback function for ${
|
52
|
+
throw new Error(`No callback function for ${b}`);
|
53
53
|
}
|
54
54
|
},
|
55
55
|
[t, a, i, o, s]
|
56
|
-
),
|
56
|
+
), K = m(() => {
|
57
57
|
u || r || (p || h ? n == null || n(t) : s && (o == null || o(t)));
|
58
58
|
}, [
|
59
59
|
h,
|
@@ -64,62 +64,62 @@ const we = Y((L) => {
|
|
64
64
|
u,
|
65
65
|
r,
|
66
66
|
s
|
67
|
-
]),
|
68
|
-
|
69
|
-
}, []),
|
70
|
-
|
71
|
-
}, []),
|
67
|
+
]), P = m(() => {
|
68
|
+
O(!0);
|
69
|
+
}, []), X = m(() => {
|
70
|
+
O(!1);
|
71
|
+
}, []), j = [
|
72
72
|
{
|
73
73
|
id: "node-card-review",
|
74
74
|
label: "Review",
|
75
|
-
icon:
|
75
|
+
icon: Z,
|
76
76
|
disabled: !g,
|
77
|
-
onClick:
|
77
|
+
onClick: k
|
78
78
|
},
|
79
79
|
{
|
80
80
|
id: "node-card-reattempt",
|
81
81
|
label: "Reattempt",
|
82
|
-
icon:
|
82
|
+
icon: q,
|
83
83
|
disabled: !I,
|
84
|
-
onClick:
|
84
|
+
onClick: k
|
85
85
|
}
|
86
86
|
];
|
87
87
|
return /* @__PURE__ */ e(
|
88
|
-
|
88
|
+
Q,
|
89
89
|
{
|
90
90
|
targetElement: /* @__PURE__ */ e(
|
91
|
-
|
91
|
+
ne,
|
92
92
|
{
|
93
|
-
$showOutline: !
|
94
|
-
$background: `${
|
93
|
+
$showOutline: !_,
|
94
|
+
$background: `${L}_2`,
|
95
95
|
$disabled: r,
|
96
|
-
onClick:
|
97
|
-
onMouseEnter:
|
98
|
-
onMouseLeave:
|
96
|
+
onClick: K,
|
97
|
+
onMouseEnter: P,
|
98
|
+
onMouseLeave: X,
|
99
99
|
children: /* @__PURE__ */ d(
|
100
|
-
|
100
|
+
J,
|
101
101
|
{
|
102
102
|
renderAs: "primary",
|
103
103
|
tooltipItem: $,
|
104
104
|
position: "bottom",
|
105
105
|
zIndex: 5,
|
106
|
-
hidden:
|
106
|
+
hidden: !$,
|
107
107
|
parentWidth: "100%",
|
108
108
|
widthX: 11.25,
|
109
109
|
children: [
|
110
110
|
/* @__PURE__ */ d(
|
111
|
-
|
111
|
+
ae,
|
112
112
|
{
|
113
113
|
$flexDirection: "row",
|
114
114
|
$alignItems: "center",
|
115
115
|
$heightX: 3.5,
|
116
|
-
$bgImage:
|
116
|
+
$bgImage: D,
|
117
117
|
$gutterX: 0.78125,
|
118
118
|
$flexGap: 8.5,
|
119
119
|
$opacity: r ? 0.5 : 1,
|
120
120
|
children: [
|
121
121
|
/* @__PURE__ */ d(
|
122
|
-
|
122
|
+
ie,
|
123
123
|
{
|
124
124
|
$width: 31,
|
125
125
|
$height: 31,
|
@@ -128,28 +128,28 @@ const we = Y((L) => {
|
|
128
128
|
$alignItems: "center",
|
129
129
|
$justifyContent: "center",
|
130
130
|
children: [
|
131
|
-
|
132
|
-
!C && /* @__PURE__ */ e(
|
131
|
+
W ? /* @__PURE__ */ e(U, { src: H }) : /* @__PURE__ */ e(G, { width: 20, height: 20 }),
|
132
|
+
!C && /* @__PURE__ */ e(ce, {})
|
133
133
|
]
|
134
134
|
}
|
135
135
|
),
|
136
|
-
/* @__PURE__ */ d(
|
137
|
-
|
136
|
+
/* @__PURE__ */ d(V, { $renderAs: "ac4-black", $color: "BLACK", children: [
|
137
|
+
w,
|
138
138
|
" ",
|
139
139
|
v && ". CW"
|
140
140
|
] }),
|
141
|
-
|
141
|
+
_ && /* @__PURE__ */ e(re, {})
|
142
142
|
]
|
143
143
|
}
|
144
144
|
),
|
145
|
-
/* @__PURE__ */ e(
|
146
|
-
!
|
147
|
-
|
145
|
+
/* @__PURE__ */ e(me, { nodeType: l, state: c, accuracy: T }),
|
146
|
+
!R && /* @__PURE__ */ e(se, { $background: "WHITE_1", $heightX: 4, children: /* @__PURE__ */ e(
|
147
|
+
de,
|
148
148
|
{
|
149
149
|
$renderAs: "ab3",
|
150
150
|
$color: "BLACK_1",
|
151
151
|
$opacity: r ? 0.5 : 1,
|
152
|
-
children:
|
152
|
+
children: y
|
153
153
|
}
|
154
154
|
) })
|
155
155
|
]
|
@@ -161,11 +161,11 @@ const we = Y((L) => {
|
|
161
161
|
menuWidth: "100%",
|
162
162
|
menuZIndex: 6,
|
163
163
|
menuOffset: 2,
|
164
|
-
menuElement: /* @__PURE__ */ e(
|
164
|
+
menuElement: /* @__PURE__ */ e(z, { children: u ? /* @__PURE__ */ e(le, { options: j }) : void 0 })
|
165
165
|
}
|
166
166
|
);
|
167
167
|
});
|
168
168
|
export {
|
169
|
-
|
169
|
+
Ee as default
|
170
170
|
};
|
171
171
|
//# sourceMappingURL=student-actions.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"student-actions.js","sources":["../../../../../../src/features/chapters-v2/comps/node-card/student-actions/student-actions.tsx"],"sourcesContent":["import type { INodeCardProps } from '../node-card-types';\nimport type { INodeMenuOption } from '../node-menu-options/node-menu-options-types';\n\nimport { memo, useCallback, useState, type FC } from 'react';\n\nimport Eye2Icon from '../../../../../assets/line-icons/icons/eye2';\nimport RedoIcon from '../../../../../assets/line-icons/icons/redo';\nimport ArrowTooltip from '../../../../ui/arrow-tooltip/arrow-tooltip';\nimport ContextMenu from '../../../../ui/context-menu/context-menu';\nimport LottieAnimation from '../../../../ui/lottie-animation/lottie-animation';\nimport Text from '../../../../ui/text/text';\nimport { BLOCK_TYPE } from '../../../constants/block-constants';\nimport { NODE_CARD_STATES } from '../../../constants/node-constants';\nimport { getNodeTypeBasedBgImage } from '../../../utils';\nimport { getNodeCardBasedIcon } from '../../../utils/node-card-utils';\nimport BorderPathAnimation from '../border-path-animation';\nimport * as Styled from '../node-card-styled';\nimport NodeCardTags from '../node-card-tags';\nimport NodeMenuOptions from '../node-menu-options/node-menu-options';\n\nconst StudentActions: FC<Omit<INodeCardProps, 'userType'>> = memo(props => {\n const {\n nodeData,\n imageHue,\n blockType,\n onNodeAttempt,\n onNodeReattempt,\n onNodeReview,\n onNodeView,\n } = props;\n const {\n accuracy,\n attempt_location: attemptLocation,\n node_type: nodeType,\n card_header: cardHeader,\n title,\n state,\n is_optional: isOptional,\n sheet_statement: sheetStatement,\n permissions,\n marked_as_completed: teacherMarkedAsCompleted,\n } = nodeData;\n\n const {\n can_review: canReview,\n can_start: canStart,\n can_resume: canResume,\n can_reset: canReset,\n } = permissions;\n\n const isGoalBlock = blockType === BLOCK_TYPE.GOAL;\n const sheetLocked = state === NODE_CARD_STATES.LOCKED;\n const sheetNotStarted = state === NODE_CARD_STATES.NOT_STARTED;\n const sheetInProgress = state === NODE_CARD_STATES.IN_PROGRESS;\n const inClassSheet = attemptLocation === 'INCLASS';\n const tooltipHidden = !sheetStatement || !isGoalBlock;\n const canStartOrResume = canStart || canResume;\n\n const showCardAnimation = !isOptional && (sheetInProgress || sheetNotStarted);\n const renderOptions = !canStartOrResume && (canReset || canReview);\n\n const [renderLottie, setRenderLottie] = useState(false);\n const nodeBgImage = getNodeTypeBasedBgImage(nodeType);\n const { icon: NodeCardIcon, lottie: nodeCardLottie } = getNodeCardBasedIcon(nodeType);\n\n const handleOnMenuOptionClick = useCallback(\n (optionId: string) => {\n switch (optionId) {\n case 'node-card-review':\n teacherMarkedAsCompleted ? onNodeView?.(nodeData) : onNodeReview?.(nodeData);\n\n return;\n\n case 'node-card-reattempt':\n onNodeReattempt?.(nodeData);\n\n return;\n\n default:\n throw new Error(`No callback function for ${optionId}`);\n }\n },\n [nodeData, onNodeReattempt, onNodeReview, onNodeView, teacherMarkedAsCompleted],\n );\n\n const handleOnNodeCardClick = useCallback(() => {\n if (renderOptions || sheetLocked) return;\n\n if (canStart || canResume) {\n onNodeAttempt?.(nodeData);\n } else if (teacherMarkedAsCompleted) {\n onNodeView?.(nodeData);\n }\n }, [\n canResume,\n canStart,\n nodeData,\n onNodeAttempt,\n onNodeView,\n renderOptions,\n sheetLocked,\n teacherMarkedAsCompleted,\n ]);\n\n const handleOnMouseEnter = useCallback(() => {\n setRenderLottie(true);\n }, []);\n\n const handleOnMouseLeave = useCallback(() => {\n setRenderLottie(false);\n }, []);\n\n const menuOptions: INodeMenuOption[] = [\n {\n id: 'node-card-review',\n label: 'Review',\n icon: Eye2Icon,\n disabled: !canReview,\n onClick: handleOnMenuOptionClick,\n },\n {\n id: 'node-card-reattempt',\n label: 'Reattempt',\n icon: RedoIcon,\n disabled: !canReset,\n onClick: handleOnMenuOptionClick,\n },\n ];\n\n return (\n <ContextMenu\n targetElement={\n <Styled.NodeCardContainer\n $showOutline={!showCardAnimation}\n $background={`${imageHue}_2`}\n $disabled={sheetLocked}\n onClick={handleOnNodeCardClick}\n onMouseEnter={handleOnMouseEnter}\n onMouseLeave={handleOnMouseLeave}\n >\n <ArrowTooltip\n renderAs=\"primary\"\n tooltipItem={sheetStatement}\n position=\"bottom\"\n zIndex={5}\n hidden={tooltipHidden}\n parentWidth=\"100%\"\n widthX={11.25}\n >\n <Styled.NodeCardInfoWrapper\n $flexDirection=\"row\"\n $alignItems=\"center\"\n $heightX={3.5}\n $bgImage={nodeBgImage}\n $gutterX={0.78125}\n $flexGap={8.5}\n $opacity={sheetLocked ? 0.5 : 1}\n >\n <Styled.IconWrapper\n $width={31}\n $height={31}\n $background=\"WHITE_1\"\n $position=\"relative\"\n $alignItems=\"center\"\n $justifyContent=\"center\"\n >\n {renderLottie ? (\n <LottieAnimation src={nodeCardLottie} />\n ) : (\n <NodeCardIcon width={20} height={20} />\n )}\n {!isOptional && <Styled.StyledImportantIcon />}\n </Styled.IconWrapper>\n\n <Text $renderAs=\"ac4-black\" $color=\"BLACK\">\n {cardHeader} {inClassSheet && `. CW`}\n </Text>\n\n {showCardAnimation && <BorderPathAnimation />}\n </Styled.NodeCardInfoWrapper>\n\n <NodeCardTags nodeType={nodeType} state={state} accuracy={accuracy} />\n\n {!isGoalBlock && (\n <Styled.NodeCardContentWrapper $background=\"WHITE_1\" $heightX={4}>\n <Styled.NodeCardTitle\n $renderAs=\"ab3\"\n $color=\"BLACK_1\"\n $opacity={sheetLocked ? 0.5 : 1}\n >\n {title}\n </Styled.NodeCardTitle>\n </Styled.NodeCardContentWrapper>\n )}\n </ArrowTooltip>\n </Styled.NodeCardContainer>\n }\n startLeft\n menuWidth=\"100%\"\n menuZIndex={6}\n menuOffset={2}\n menuElement={<>{renderOptions ? <NodeMenuOptions options={menuOptions} /> : undefined}</>}\n />\n );\n});\n\nexport default StudentActions;\n"],"names":["StudentActions","memo","props","nodeData","imageHue","blockType","onNodeAttempt","onNodeReattempt","onNodeReview","onNodeView","accuracy","attemptLocation","nodeType","cardHeader","title","state","isOptional","sheetStatement","permissions","teacherMarkedAsCompleted","canReview","canStart","canResume","canReset","isGoalBlock","BLOCK_TYPE","sheetLocked","NODE_CARD_STATES","sheetNotStarted","sheetInProgress","inClassSheet","tooltipHidden","canStartOrResume","showCardAnimation","renderOptions","renderLottie","setRenderLottie","useState","nodeBgImage","getNodeTypeBasedBgImage","NodeCardIcon","nodeCardLottie","getNodeCardBasedIcon","handleOnMenuOptionClick","useCallback","optionId","handleOnNodeCardClick","handleOnMouseEnter","handleOnMouseLeave","menuOptions","Eye2Icon","RedoIcon","jsx","ContextMenu","Styled.NodeCardContainer","jsxs","ArrowTooltip","Styled.NodeCardInfoWrapper","Styled.IconWrapper","LottieAnimation","Styled.StyledImportantIcon","Text","BorderPathAnimation","NodeCardTags","Styled.NodeCardContentWrapper","Styled.NodeCardTitle","NodeMenuOptions"],"mappings":";;;;;;;;;;;;;;;;AAoBM,MAAAA,KAAuDC,EAAK,CAASC,MAAA;AACnE,QAAA;AAAA,IACJ,UAAAC;AAAA,IACA,UAAAC;AAAA,IACA,WAAAC;AAAA,IACA,eAAAC;AAAA,IACA,iBAAAC;AAAA,IACA,cA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CAAC;"}
|
1
|
+
{"version":3,"file":"student-actions.js","sources":["../../../../../../src/features/chapters-v2/comps/node-card/student-actions/student-actions.tsx"],"sourcesContent":["import type { INodeCardProps } from '../node-card-types';\nimport type { INodeMenuOption } from '../node-menu-options/node-menu-options-types';\n\nimport { memo, useCallback, useState, type FC } from 'react';\n\nimport Eye2Icon from '../../../../../assets/line-icons/icons/eye2';\nimport RedoIcon from '../../../../../assets/line-icons/icons/redo';\nimport ArrowTooltip from '../../../../ui/arrow-tooltip/arrow-tooltip';\nimport ContextMenu from '../../../../ui/context-menu/context-menu';\nimport LottieAnimation from '../../../../ui/lottie-animation/lottie-animation';\nimport Text from '../../../../ui/text/text';\nimport { BLOCK_TYPE } from '../../../constants/block-constants';\nimport { NODE_CARD_STATES } from '../../../constants/node-constants';\nimport { getNodeTypeBasedBgImage } from '../../../utils';\nimport { getNodeCardBasedIcon } from '../../../utils/node-card-utils';\nimport BorderPathAnimation from '../border-path-animation';\nimport * as Styled from '../node-card-styled';\nimport NodeCardTags from '../node-card-tags';\nimport NodeMenuOptions from '../node-menu-options/node-menu-options';\n\nconst StudentActions: FC<Omit<INodeCardProps, 'userType'>> = memo(props => {\n const {\n nodeData,\n imageHue,\n blockType,\n onNodeAttempt,\n onNodeReattempt,\n onNodeReview,\n onNodeView,\n } = props;\n const {\n accuracy,\n attempt_location: attemptLocation,\n node_type: nodeType,\n card_header: cardHeader,\n title,\n state,\n is_optional: isOptional,\n sheet_statement: sheetStatement,\n permissions,\n marked_as_completed: teacherMarkedAsCompleted,\n } = nodeData;\n\n const {\n can_review: canReview,\n can_start: canStart,\n can_resume: canResume,\n can_reset: canReset,\n } = permissions;\n\n const isGoalBlock = blockType === BLOCK_TYPE.GOAL;\n const sheetLocked = state === NODE_CARD_STATES.LOCKED;\n const sheetNotStarted = state === NODE_CARD_STATES.NOT_STARTED;\n const sheetInProgress = state === NODE_CARD_STATES.IN_PROGRESS;\n const inClassSheet = attemptLocation === 'INCLASS';\n const canStartOrResume = canStart || canResume;\n\n const showCardAnimation = !isOptional && (sheetInProgress || sheetNotStarted);\n const renderOptions = !canStartOrResume && (canReset || canReview);\n\n const [renderLottie, setRenderLottie] = useState(false);\n const nodeBgImage = getNodeTypeBasedBgImage(nodeType);\n const { icon: NodeCardIcon, lottie: nodeCardLottie } = getNodeCardBasedIcon(nodeType);\n\n const handleOnMenuOptionClick = useCallback(\n (optionId: string) => {\n switch (optionId) {\n case 'node-card-review':\n teacherMarkedAsCompleted ? onNodeView?.(nodeData) : onNodeReview?.(nodeData);\n\n return;\n\n case 'node-card-reattempt':\n onNodeReattempt?.(nodeData);\n\n return;\n\n default:\n throw new Error(`No callback function for ${optionId}`);\n }\n },\n [nodeData, onNodeReattempt, onNodeReview, onNodeView, teacherMarkedAsCompleted],\n );\n\n const handleOnNodeCardClick = useCallback(() => {\n if (renderOptions || sheetLocked) return;\n\n if (canStart || canResume) {\n onNodeAttempt?.(nodeData);\n } else if (teacherMarkedAsCompleted) {\n onNodeView?.(nodeData);\n }\n }, [\n canResume,\n canStart,\n nodeData,\n onNodeAttempt,\n onNodeView,\n renderOptions,\n sheetLocked,\n teacherMarkedAsCompleted,\n ]);\n\n const handleOnMouseEnter = useCallback(() => {\n setRenderLottie(true);\n }, []);\n\n const handleOnMouseLeave = useCallback(() => {\n setRenderLottie(false);\n }, []);\n\n const menuOptions: INodeMenuOption[] = [\n {\n id: 'node-card-review',\n label: 'Review',\n icon: Eye2Icon,\n disabled: !canReview,\n onClick: handleOnMenuOptionClick,\n },\n {\n id: 'node-card-reattempt',\n label: 'Reattempt',\n icon: RedoIcon,\n disabled: !canReset,\n onClick: handleOnMenuOptionClick,\n },\n ];\n\n return (\n <ContextMenu\n targetElement={\n <Styled.NodeCardContainer\n $showOutline={!showCardAnimation}\n $background={`${imageHue}_2`}\n $disabled={sheetLocked}\n onClick={handleOnNodeCardClick}\n onMouseEnter={handleOnMouseEnter}\n onMouseLeave={handleOnMouseLeave}\n >\n <ArrowTooltip\n renderAs=\"primary\"\n tooltipItem={sheetStatement}\n position=\"bottom\"\n zIndex={5}\n hidden={!sheetStatement}\n parentWidth=\"100%\"\n widthX={11.25}\n >\n <Styled.NodeCardInfoWrapper\n $flexDirection=\"row\"\n $alignItems=\"center\"\n $heightX={3.5}\n $bgImage={nodeBgImage}\n $gutterX={0.78125}\n $flexGap={8.5}\n $opacity={sheetLocked ? 0.5 : 1}\n >\n <Styled.IconWrapper\n $width={31}\n $height={31}\n $background=\"WHITE_1\"\n $position=\"relative\"\n $alignItems=\"center\"\n $justifyContent=\"center\"\n >\n {renderLottie ? (\n <LottieAnimation src={nodeCardLottie} />\n ) : (\n <NodeCardIcon width={20} height={20} />\n )}\n {!isOptional && <Styled.StyledImportantIcon />}\n </Styled.IconWrapper>\n\n <Text $renderAs=\"ac4-black\" $color=\"BLACK\">\n {cardHeader} {inClassSheet && `. CW`}\n </Text>\n\n {showCardAnimation && <BorderPathAnimation />}\n </Styled.NodeCardInfoWrapper>\n\n <NodeCardTags nodeType={nodeType} state={state} accuracy={accuracy} />\n\n {!isGoalBlock && (\n <Styled.NodeCardContentWrapper $background=\"WHITE_1\" $heightX={4}>\n <Styled.NodeCardTitle\n $renderAs=\"ab3\"\n $color=\"BLACK_1\"\n $opacity={sheetLocked ? 0.5 : 1}\n >\n {title}\n </Styled.NodeCardTitle>\n </Styled.NodeCardContentWrapper>\n )}\n </ArrowTooltip>\n </Styled.NodeCardContainer>\n }\n startLeft\n menuWidth=\"100%\"\n menuZIndex={6}\n menuOffset={2}\n menuElement={<>{renderOptions ? <NodeMenuOptions options={menuOptions} /> : undefined}</>}\n />\n );\n});\n\nexport default StudentActions;\n"],"names":["StudentActions","memo","props","nodeData","imageHue","blockType","onNodeAttempt","onNodeReattempt","onNodeReview","onNodeView","accuracy","attemptLocation","nodeType","cardHeader","title","state","isOptional","sheetStatement","permissions","teacherMarkedAsCompleted","canReview","canStart","canResume","canReset","isGoalBlock","BLOCK_TYPE","sheetLocked","NODE_CARD_STATES","sheetNotStarted","sheetInProgress","inClassSheet","canStartOrResume","showCardAnimation","renderOptions","renderLottie","setRenderLottie","useState","nodeBgImage","getNodeTypeBasedBgImage","NodeCardIcon","nodeCardLottie","getNodeCardBasedIcon","handleOnMenuOptionClick","useCallback","optionId","handleOnNodeCardClick","handleOnMouseEnter","handleOnMouseLeave","menuOptions","Eye2Icon","RedoIcon","jsx","ContextMenu","Styled.NodeCardContainer","jsxs","ArrowTooltip","Styled.NodeCardInfoWrapper","Styled.IconWrapper","LottieAnimation","Styled.StyledImportantIcon","Text","BorderPathAnimation","NodeCardTags","Styled.NodeCardContentWrapper","Styled.NodeCardTitle","NodeMenuOptions"],"mappings":";;;;;;;;;;;;;;;;AAoBM,MAAAA,KAAuDC,EAAK,CAASC,MAAA;AACnE,QAAA;AAAA,IACJ,UAAAC;AAAA,IACA,UAAAC;AAAA,IACA,WAAAC;AAAA,IACA,eAAAC;AAAA,IACA,iBAAAC;AAAA,IACA,cAAAC;AAAA,IACA,YAAAC;AAAA,EACE,IAAAP,GACE;AAAA,IACJ,UAAAQ;AAAA,IACA,kBAAkBC;AAAA,IAClB,WAAWC;AAAA,IACX,aAAaC;AAAA,IACb,OAAAC;AAAA,IACA,OAAAC;AAAA,IACA,aAAaC;AAAA,IACb,iBAAiBC;AAAA,IACjB,aAAAC;AAAA,IACA,qBAAqBC;AAAA,EACnB,IAAAhB,GAEE;AAAA,IACJ,YAAYiB;AAAA,IACZ,WAAWC;AAAA,IACX,YAAYC;AAAA,IACZ,WAAWC;AAAA,EACT,IAAAL,GAEEM,IAAcnB,MAAcoB,GAAW,MACvCC,IAAcX,MAAUY,EAAiB,QACzCC,IAAkBb,MAAUY,EAAiB,aAC7CE,IAAkBd,MAAUY,EAAiB,aAC7CG,IAAenB,MAAoB,WACnCoB,IAAmBV,KAAYC,GAE/BU,IAAoB,CAAChB,MAAea,KAAmBD,IACvDK,IAAgB,CAACF,MAAqBR,KAAYH,IAElD,CAACc,GAAcC,CAAe,IAAIC,EAAS,E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EAAa,UAAAlD,GAAoB,OAAAG,GAAc,UAAAL,EAAoB,CAAA;AAAA,gBAEnE,CAACc,KACC,gBAAA2B,EAAAY,IAAA,EAA8B,aAAY,WAAU,UAAU,GAC7D,UAAA,gBAAAZ;AAAA,kBAACa;AAAAA,kBAAA;AAAA,oBACC,WAAU;AAAA,oBACV,QAAO;AAAA,oBACP,UAAUtC,IAAc,MAAM;AAAA,oBAE7B,UAAAZ;AAAA,kBAAA;AAAA,gBAAA,GAEL;AAAA,cAAA;AAAA,YAAA;AAAA,UAEJ;AAAA,QAAA;AAAA,MACF;AAAA,MAEF,WAAS;AAAA,MACT,WAAU;AAAA,MACV,YAAY;AAAA,MACZ,YAAY;AAAA,MACZ,oCAAgB,UAAgBmB,IAAA,gBAAAkB,EAACc,MAAgB,SAASjB,EAAa,CAAA,IAAK,OAAU,CAAA;AAAA,IAAA;AAAA,EAAA;AAG5F,CAAC;"}
|
@@ -1,53 +1,53 @@
|
|
1
1
|
import { jsxs as r, jsx as e } from "react/jsx-runtime";
|
2
|
-
import { memo as
|
3
|
-
import
|
4
|
-
import
|
5
|
-
import
|
2
|
+
import { memo as U, useState as Y, useRef as q, useCallback as f } from "react";
|
3
|
+
import J from "../../../../../assets/line-icons/icons/check2.js";
|
4
|
+
import Q from "../../../../../assets/line-icons/icons/eye2.js";
|
5
|
+
import V from "../../../../../assets/line-icons/icons/home2.js";
|
6
6
|
import O from "../../../../../assets/line-icons/icons/more-vertical.js";
|
7
|
-
import
|
8
|
-
import
|
9
|
-
import
|
10
|
-
import
|
11
|
-
import
|
12
|
-
import { BLOCK_TYPE as
|
13
|
-
import { NODE_CARD_STATES as
|
14
|
-
import { getNodeTypeBasedBgImage as
|
7
|
+
import Z from "../../../../ui/arrow-tooltip/arrow-tooltip.js";
|
8
|
+
import D from "../../../../ui/hooks/use-context-menu-click-handler.js";
|
9
|
+
import ee from "../../../../ui/layout/flex-view.js";
|
10
|
+
import te from "../../../../ui/lottie-animation/lottie-animation.js";
|
11
|
+
import re from "../../../../ui/text/text.js";
|
12
|
+
import { BLOCK_TYPE as oe } from "../../../constants/block-constants.js";
|
13
|
+
import { NODE_CARD_STATES as u, TEACHER_MENU_LABELS as ie } from "../../../constants/node-constants.js";
|
14
|
+
import { getNodeTypeBasedBgImage as ne } from "../../../utils/index.js";
|
15
15
|
import { getNodeCardBasedIcon as ae } from "../../../utils/node-card-utils.js";
|
16
|
-
import
|
17
|
-
import { NodeCardContainer as
|
18
|
-
import
|
19
|
-
import
|
20
|
-
const { ASSIGN_AS_HW:
|
16
|
+
import ce from "../border-path-animation.js";
|
17
|
+
import { NodeCardContainer as se, NodeCardInfoWrapper as le, IconWrapper as de, StyledImportantIcon as me, NodeKebabMenuWrapper as T, NodeCardContentWrapper as pe, NodeCardTitle as he, NodeMenuOptionsWrapper as fe } from "../node-card-styled.js";
|
18
|
+
import ue from "../node-card-tags.js";
|
19
|
+
import $e from "../node-menu-options/node-menu-options.js";
|
20
|
+
const { ASSIGN_AS_HW: Ce, REVIEW: _e, VIEW: Ie, MARK_AS_DONE: ge } = ie, Pe = U(
|
21
21
|
({
|
22
22
|
nodeData: t,
|
23
23
|
imageHue: A,
|
24
24
|
blockType: L,
|
25
|
-
isSkipped:
|
25
|
+
isSkipped: $,
|
26
26
|
onNodeAttemptLocationChange: o,
|
27
27
|
onNodeMarkAsDone: i,
|
28
28
|
onNodeView: n,
|
29
|
-
onNodeReview:
|
29
|
+
onNodeReview: a
|
30
30
|
}) => {
|
31
|
-
const [w,
|
31
|
+
const [w, C] = Y(!1), l = q(null), { menuVisible: x, onMenuClick: _ } = D(l), {
|
32
32
|
accuracy: y,
|
33
33
|
attempt_location: W,
|
34
34
|
node_type: d,
|
35
35
|
card_header: B,
|
36
36
|
title: M,
|
37
|
-
state:
|
38
|
-
is_optional:
|
39
|
-
sheet_statement:
|
37
|
+
state: c,
|
38
|
+
is_optional: I,
|
39
|
+
sheet_statement: g,
|
40
40
|
permissions: H,
|
41
41
|
user_attempt_id: m
|
42
42
|
} = t, {
|
43
43
|
can_change_attempt_location: G,
|
44
44
|
can_mark_familiar: K,
|
45
45
|
can_review: p
|
46
|
-
} = H,
|
46
|
+
} = H, b = L === oe.GOAL, s = c === u.LOCKED, R = c === u.NOT_STARTED, j = c === u.IN_PROGRESS, E = W === "INCLASS", S = !I && (j || R), P = ne(d), { icon: X, lottie: v } = ae(d), h = f(
|
47
47
|
(k) => {
|
48
48
|
switch (k) {
|
49
49
|
case "node-card-view":
|
50
|
-
p && m ?
|
50
|
+
p && m ? a == null || a(t) : n == null || n(t);
|
51
51
|
return;
|
52
52
|
case "node-card-assign-as-hw":
|
53
53
|
o == null || o(t);
|
@@ -64,71 +64,71 @@ const { ASSIGN_AS_HW: _e, REVIEW: Ie, VIEW: ge, MARK_AS_DONE: be } = ne, Xe = Y(
|
|
64
64
|
t,
|
65
65
|
o,
|
66
66
|
i,
|
67
|
-
|
67
|
+
a,
|
68
68
|
n,
|
69
69
|
m
|
70
70
|
]
|
71
|
-
),
|
72
|
-
|
73
|
-
}, []),
|
74
|
-
|
75
|
-
}, []),
|
71
|
+
), F = f(() => {
|
72
|
+
C(!0);
|
73
|
+
}, []), z = f(() => {
|
74
|
+
C(!1);
|
75
|
+
}, []), N = [
|
76
76
|
{
|
77
77
|
id: "node-card-view",
|
78
|
-
label: p && m ?
|
79
|
-
icon:
|
78
|
+
label: p && m ? _e : Ie,
|
79
|
+
icon: Q,
|
80
80
|
disabled: !1,
|
81
|
-
onClick:
|
81
|
+
onClick: h
|
82
82
|
},
|
83
83
|
{
|
84
84
|
id: "node-card-assign-as-hw",
|
85
|
-
label:
|
86
|
-
icon:
|
85
|
+
label: Ce,
|
86
|
+
icon: V,
|
87
87
|
disabled: !G || !E,
|
88
|
-
onClick:
|
88
|
+
onClick: h
|
89
89
|
},
|
90
90
|
{
|
91
91
|
id: "node-card-mark-as-done",
|
92
|
-
label:
|
93
|
-
icon:
|
92
|
+
label: ge,
|
93
|
+
icon: J,
|
94
94
|
disabled: !K,
|
95
|
-
onClick:
|
95
|
+
onClick: h
|
96
96
|
}
|
97
97
|
];
|
98
98
|
return /* @__PURE__ */ r(
|
99
|
-
|
99
|
+
se,
|
100
100
|
{
|
101
101
|
$showOutline: !S,
|
102
102
|
$isSheetLocked: s,
|
103
103
|
$background: `${A}_2`,
|
104
|
-
$disabled:
|
105
|
-
onMouseEnter:
|
106
|
-
onMouseLeave:
|
104
|
+
$disabled: !!$,
|
105
|
+
onMouseEnter: F,
|
106
|
+
onMouseLeave: z,
|
107
107
|
children: [
|
108
108
|
/* @__PURE__ */ r(
|
109
|
-
|
109
|
+
Z,
|
110
110
|
{
|
111
111
|
renderAs: "primary",
|
112
|
-
tooltipItem:
|
112
|
+
tooltipItem: g,
|
113
113
|
position: "bottom",
|
114
114
|
zIndex: 5,
|
115
|
-
hidden:
|
115
|
+
hidden: !g,
|
116
116
|
parentWidth: "100%",
|
117
117
|
widthX: 11.25,
|
118
118
|
children: [
|
119
119
|
/* @__PURE__ */ r(
|
120
|
-
|
120
|
+
le,
|
121
121
|
{
|
122
122
|
$flexDirection: "row",
|
123
123
|
$alignItems: "center",
|
124
124
|
$width: "100%",
|
125
125
|
$heightX: 3.5,
|
126
|
-
$bgImage:
|
126
|
+
$bgImage: P,
|
127
127
|
$gutterX: 0.78125,
|
128
128
|
$flexGap: 8.5,
|
129
129
|
children: [
|
130
130
|
/* @__PURE__ */ r(
|
131
|
-
|
131
|
+
de,
|
132
132
|
{
|
133
133
|
$width: 31,
|
134
134
|
$height: 31,
|
@@ -138,24 +138,24 @@ const { ASSIGN_AS_HW: _e, REVIEW: Ie, VIEW: ge, MARK_AS_DONE: be } = ne, Xe = Y(
|
|
138
138
|
$justifyContent: "center",
|
139
139
|
$opacity: s ? 0.5 : 1,
|
140
140
|
children: [
|
141
|
-
w ? /* @__PURE__ */ e(
|
142
|
-
!
|
141
|
+
w ? /* @__PURE__ */ e(te, { src: v }) : /* @__PURE__ */ e(X, { width: 20, height: 20 }),
|
142
|
+
!I && /* @__PURE__ */ e(me, {})
|
143
143
|
]
|
144
144
|
}
|
145
145
|
),
|
146
|
-
/* @__PURE__ */ r(
|
146
|
+
/* @__PURE__ */ r(re, { $renderAs: "ac4-black", $color: "BLACK", $opacity: s ? 0.5 : 1, children: [
|
147
147
|
B,
|
148
148
|
" ",
|
149
149
|
E && ". CW"
|
150
150
|
] }),
|
151
|
-
/* @__PURE__ */ e(
|
152
|
-
S &&
|
151
|
+
/* @__PURE__ */ e(ee, { className: "context-menu", children: b && /* @__PURE__ */ e(T, { ref: l, onClick: _, children: /* @__PURE__ */ e(O, { width: 16, height: 16 }) }) }),
|
152
|
+
S && !$ && /* @__PURE__ */ e(ce, {})
|
153
153
|
]
|
154
154
|
}
|
155
155
|
),
|
156
|
-
/* @__PURE__ */ e(
|
157
|
-
!
|
158
|
-
|
156
|
+
/* @__PURE__ */ e(ue, { nodeType: d, state: c, accuracy: y }),
|
157
|
+
!b && /* @__PURE__ */ r(
|
158
|
+
pe,
|
159
159
|
{
|
160
160
|
$flexDirection: "row",
|
161
161
|
$alignItems: "center",
|
@@ -165,7 +165,7 @@ const { ASSIGN_AS_HW: _e, REVIEW: Ie, VIEW: ge, MARK_AS_DONE: be } = ne, Xe = Y(
|
|
165
165
|
$justifyContent: "space-between",
|
166
166
|
children: [
|
167
167
|
/* @__PURE__ */ e(
|
168
|
-
|
168
|
+
he,
|
169
169
|
{
|
170
170
|
$renderAs: "ab3",
|
171
171
|
$color: "BLACK_1",
|
@@ -173,20 +173,20 @@ const { ASSIGN_AS_HW: _e, REVIEW: Ie, VIEW: ge, MARK_AS_DONE: be } = ne, Xe = Y(
|
|
173
173
|
children: M
|
174
174
|
}
|
175
175
|
),
|
176
|
-
/* @__PURE__ */ e(T, { ref: l, onClick:
|
176
|
+
/* @__PURE__ */ e(T, { ref: l, onClick: _, children: /* @__PURE__ */ e(O, { width: 16, height: 16 }) })
|
177
177
|
]
|
178
178
|
}
|
179
179
|
)
|
180
180
|
]
|
181
181
|
}
|
182
182
|
),
|
183
|
-
/* @__PURE__ */ e(
|
183
|
+
/* @__PURE__ */ e(fe, { $visible: x, children: /* @__PURE__ */ e($e, { options: N }) })
|
184
184
|
]
|
185
185
|
}
|
186
186
|
);
|
187
187
|
}
|
188
188
|
);
|
189
189
|
export {
|
190
|
-
|
190
|
+
Pe as default
|
191
191
|
};
|
192
192
|
//# sourceMappingURL=teacher-actions.js.map
|