@cuemath/leap 3.0.2-as1 → 3.0.3-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 +15 -17
- 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/student-actions/student-actions.js +68 -66
- 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 +111 -95
- 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 +2 -1
- package/dist/features/chapters-v2/constants/node-constants.js.map +1 -1
- package/dist/features/homework/card-menu-option.js +11 -13
- package/dist/features/homework/card-menu-option.js.map +1 -1
- package/dist/features/homework/card-menu-options.js +8 -8
- package/dist/features/homework/card-menu-options.js.map +1 -1
- package/dist/features/homework/homework-card.js +82 -74
- package/dist/features/homework/homework-card.js.map +1 -1
- package/dist/features/ui/border-path-animation/border-path-animation-styled.js +51 -0
- package/dist/features/ui/border-path-animation/border-path-animation-styled.js.map +1 -0
- package/dist/features/ui/border-path-animation/border-path-animation.js +108 -0
- package/dist/features/ui/border-path-animation/border-path-animation.js.map +1 -0
- package/package.json +1 -1
@@ -1,47 +1,47 @@
|
|
1
|
-
import { jsxs as
|
2
|
-
import { memo as
|
3
|
-
import
|
4
|
-
import
|
5
|
-
import
|
6
|
-
import
|
1
|
+
import { jsxs as T, jsx as r } from "react/jsx-runtime";
|
2
|
+
import { memo as Q, useRef as x, useCallback as w, useMemo as U } from "react";
|
3
|
+
import W from "../../assets/line-icons/icons/eye2.js";
|
4
|
+
import D from "../../assets/line-icons/icons/more-vertical.js";
|
5
|
+
import H from "../../assets/line-icons/icons/redo.js";
|
6
|
+
import A from "../ui/arrow-tooltip/arrow-tooltip.js";
|
7
7
|
import N from "../ui/buttons/clickable/clickable.js";
|
8
|
-
import
|
8
|
+
import X from "../ui/hooks/use-context-menu-click-handler.js";
|
9
9
|
import ee from "../ui/layout/flex-view.js";
|
10
|
-
import
|
10
|
+
import I from "./card-menu-options.js";
|
11
11
|
import re from "./homework-card-view.js";
|
12
12
|
import { CardContainer as te, MenuWrapper as ie, CardKebabMenuWrapper as ne, BlurContainer as oe, BlurFlexView as ce, StyledMinus2Icon as se } from "./styles.js";
|
13
|
-
import { getCardAnalyticProps as
|
14
|
-
const
|
13
|
+
import { getCardAnalyticProps as ae } from "./utils.js";
|
14
|
+
const le = ({
|
15
15
|
// callbacks
|
16
16
|
nodeData: e,
|
17
17
|
onNodeAttempt: b,
|
18
|
-
onNodeReattempt:
|
18
|
+
onNodeReattempt: d,
|
19
19
|
onNodeReview: n,
|
20
20
|
onNodeUnassign: m,
|
21
21
|
onNodeView: C,
|
22
|
-
header:
|
22
|
+
header: j,
|
23
23
|
isInQueue: E,
|
24
|
-
renderAs:
|
25
|
-
shouldOpenOnRight:
|
24
|
+
renderAs: F,
|
25
|
+
shouldOpenOnRight: L,
|
26
26
|
studentId: v,
|
27
|
-
subHeader:
|
27
|
+
subHeader: P,
|
28
28
|
userMilestoneId: t,
|
29
29
|
userType: g
|
30
30
|
}) => {
|
31
|
-
const i =
|
31
|
+
const i = F === "homework", {
|
32
32
|
node_type: k,
|
33
|
-
state:
|
34
|
-
permissions:
|
33
|
+
state: B,
|
34
|
+
permissions: z,
|
35
35
|
user_node_id: o,
|
36
|
-
user_milestone_id:
|
36
|
+
user_milestone_id: a,
|
37
37
|
homework_id: c
|
38
|
-
} = e, y =
|
38
|
+
} = e, y = x(null), $ = x(null), { menuVisible: R, onMenuClick: K } = X(y), { menuVisible: Y, onMenuClick: V } = X($), {
|
39
39
|
can_start: h,
|
40
40
|
can_resume: f,
|
41
41
|
can_review: s,
|
42
|
-
can_unassign:
|
43
|
-
can_reset:
|
44
|
-
} =
|
42
|
+
can_unassign: q,
|
43
|
+
can_reset: S
|
44
|
+
} = z, l = g === "STUDENT", p = w(() => {
|
45
45
|
if (s) {
|
46
46
|
if (typeof n != "function")
|
47
47
|
throw new Error("onReview must be a function");
|
@@ -50,7 +50,7 @@ const ae = ({
|
|
50
50
|
n(e, t);
|
51
51
|
return;
|
52
52
|
}
|
53
|
-
}, [s, n, o, e, t]),
|
53
|
+
}, [s, n, o, e, t]), G = w(() => {
|
54
54
|
if (h || f) {
|
55
55
|
if (typeof b != "function")
|
56
56
|
throw new Error("onNodeAttempt must be a function");
|
@@ -61,12 +61,12 @@ const ae = ({
|
|
61
61
|
V();
|
62
62
|
return;
|
63
63
|
}
|
64
|
-
|
64
|
+
p();
|
65
65
|
}, [
|
66
66
|
h,
|
67
67
|
f,
|
68
68
|
i,
|
69
|
-
|
69
|
+
p,
|
70
70
|
b,
|
71
71
|
e,
|
72
72
|
c,
|
@@ -77,92 +77,100 @@ const ae = ({
|
|
77
77
|
throw new Error("onNodeReview must be a function");
|
78
78
|
if (!o)
|
79
79
|
throw new Error("user node id must be present to review the sheet");
|
80
|
-
n(e, t ||
|
80
|
+
n(e, t || a, c);
|
81
81
|
return;
|
82
82
|
}
|
83
83
|
if (typeof C != "function")
|
84
84
|
throw new Error("onNodeView must be a function");
|
85
|
-
C(e, t ||
|
85
|
+
C(e, t || a);
|
86
86
|
}, [
|
87
87
|
s,
|
88
88
|
C,
|
89
89
|
e,
|
90
90
|
t,
|
91
|
-
|
91
|
+
a,
|
92
92
|
n,
|
93
93
|
o,
|
94
94
|
c
|
95
|
-
]),
|
96
|
-
(
|
97
|
-
switch (
|
95
|
+
]), u = w(
|
96
|
+
(O) => {
|
97
|
+
switch (O) {
|
98
98
|
case "teacher-card-view":
|
99
99
|
_();
|
100
100
|
return;
|
101
101
|
case "student-card-view":
|
102
|
-
|
102
|
+
p();
|
103
103
|
return;
|
104
104
|
case "teacher-card-unassign":
|
105
105
|
m == null || m(e, t);
|
106
106
|
return;
|
107
107
|
case "student-card-reattempt":
|
108
|
-
|
108
|
+
case "teacher-card-redo":
|
109
|
+
d == null || d(e, t);
|
109
110
|
return;
|
110
111
|
default:
|
111
|
-
throw new Error(`No callback function for ${
|
112
|
+
throw new Error(`No callback function for ${O}`);
|
112
113
|
}
|
113
114
|
},
|
114
115
|
[
|
115
116
|
e,
|
116
|
-
u,
|
117
|
-
m,
|
118
117
|
d,
|
118
|
+
m,
|
119
|
+
p,
|
119
120
|
_,
|
120
121
|
t
|
121
122
|
]
|
122
|
-
),
|
123
|
+
), J = [
|
123
124
|
{
|
124
125
|
id: "teacher-card-view",
|
125
126
|
label: s ? "Review" : "View",
|
126
|
-
icon:
|
127
|
+
icon: W,
|
127
128
|
disabled: !1,
|
128
|
-
onClick:
|
129
|
+
onClick: u
|
129
130
|
},
|
130
131
|
{
|
131
132
|
id: "teacher-card-unassign",
|
132
133
|
label: "Unassign",
|
133
134
|
icon: se,
|
134
|
-
disabled: i ? k === "MASTERY" : !
|
135
|
-
onClick:
|
135
|
+
disabled: i ? k === "MASTERY" : !q,
|
136
|
+
onClick: u
|
137
|
+
},
|
138
|
+
{
|
139
|
+
id: "teacher-card-redo",
|
140
|
+
label: "Redo",
|
141
|
+
icon: H,
|
142
|
+
disabled: !S,
|
143
|
+
onClick: u
|
136
144
|
}
|
137
|
-
],
|
145
|
+
], Z = [
|
138
146
|
{
|
139
147
|
id: "student-card-view",
|
140
148
|
label: "Review",
|
141
|
-
icon:
|
149
|
+
icon: W,
|
142
150
|
disabled: !s,
|
143
|
-
onClick:
|
151
|
+
onClick: u
|
144
152
|
},
|
145
153
|
{
|
146
154
|
id: "student-card-reattempt",
|
147
155
|
label: "Reattempt",
|
148
|
-
icon:
|
149
|
-
disabled: !
|
150
|
-
onClick:
|
156
|
+
icon: H,
|
157
|
+
disabled: !S,
|
158
|
+
onClick: u
|
151
159
|
}
|
152
|
-
],
|
153
|
-
() =>
|
160
|
+
], M = U(
|
161
|
+
() => ae({
|
154
162
|
canResume: f,
|
155
163
|
canStart: h,
|
156
164
|
homeworkId: c,
|
157
165
|
isHomeWork: i,
|
158
|
-
isStudent:
|
159
|
-
milestoneId:
|
166
|
+
isStudent: l,
|
167
|
+
milestoneId: a,
|
160
168
|
nodeType: k,
|
161
169
|
studentId: v,
|
162
170
|
userNodeId: o
|
163
171
|
}),
|
164
172
|
[
|
165
|
-
|
173
|
+
l,
|
166
174
|
i,
|
167
175
|
v,
|
168
176
|
k,
|
@@ -170,75 +178,75 @@ const ae = ({
|
|
170
178
|
f,
|
171
179
|
c,
|
172
180
|
o,
|
173
|
-
|
181
|
+
a
|
174
182
|
]
|
175
183
|
);
|
176
|
-
return /* @__PURE__ */
|
184
|
+
return /* @__PURE__ */ T(te, { $position: "relative", $width: "fit-content", children: [
|
177
185
|
/* @__PURE__ */ r(
|
178
186
|
N,
|
179
187
|
{
|
180
|
-
onClick:
|
188
|
+
onClick: l ? G : _,
|
181
189
|
label: "homework-card",
|
182
|
-
analyticsLabel:
|
183
|
-
analyticsProps:
|
190
|
+
analyticsLabel: M.analyticsLabel,
|
191
|
+
analyticsProps: M.analyticsProps,
|
184
192
|
children: /* @__PURE__ */ r(
|
185
193
|
re,
|
186
194
|
{
|
187
|
-
header:
|
195
|
+
header: j,
|
188
196
|
isInQueue: E,
|
189
197
|
nodeData: e,
|
190
198
|
studentContainerRef: $,
|
191
|
-
subHeader:
|
199
|
+
subHeader: P,
|
192
200
|
userType: g
|
193
201
|
}
|
194
202
|
)
|
195
203
|
}
|
196
204
|
),
|
197
|
-
|
198
|
-
|
205
|
+
l && !i && /* @__PURE__ */ r(
|
206
|
+
I,
|
199
207
|
{
|
200
208
|
$width: 200,
|
201
|
-
options:
|
209
|
+
options: Z,
|
202
210
|
triggerRef: $,
|
203
|
-
visible:
|
211
|
+
visible: Y,
|
204
212
|
shouldOpenOnRight: !1
|
205
213
|
}
|
206
214
|
),
|
207
|
-
!
|
215
|
+
!l && /* @__PURE__ */ T(ie, { $position: "absolute", $width: "fit-content", $borderRadiusX: 2, children: [
|
208
216
|
/* @__PURE__ */ r(
|
209
|
-
|
217
|
+
A,
|
210
218
|
{
|
211
219
|
renderAs: "primary",
|
212
220
|
tooltipItem: "Review",
|
213
221
|
position: "bottom",
|
214
222
|
zIndex: 6,
|
215
223
|
parentWidth: "100%",
|
216
|
-
hidden: R ||
|
224
|
+
hidden: R || B !== "WAIT_FOR_REVIEW" && i,
|
217
225
|
children: /* @__PURE__ */ r(
|
218
226
|
ne,
|
219
227
|
{
|
220
228
|
$alignItems: "center",
|
221
229
|
$justifyContent: "center",
|
222
230
|
ref: y,
|
223
|
-
onClick:
|
224
|
-
children: /* @__PURE__ */ r(
|
231
|
+
onClick: K,
|
232
|
+
children: /* @__PURE__ */ r(D, { width: 16, height: 16 })
|
225
233
|
}
|
226
234
|
)
|
227
235
|
}
|
228
236
|
),
|
229
237
|
/* @__PURE__ */ r(
|
230
|
-
|
238
|
+
I,
|
231
239
|
{
|
232
|
-
options:
|
240
|
+
options: J,
|
233
241
|
triggerRef: y,
|
234
242
|
visible: R,
|
235
|
-
shouldOpenOnRight:
|
243
|
+
shouldOpenOnRight: L
|
236
244
|
}
|
237
245
|
)
|
238
246
|
] }),
|
239
|
-
E && /* @__PURE__ */ r(oe, { $background: "WHITE_5", children: /* @__PURE__ */ r(ce, { $heightX: 1, $widthX: 6, children: /* @__PURE__ */ r(
|
247
|
+
E && /* @__PURE__ */ r(oe, { $background: "WHITE_5", children: /* @__PURE__ */ r(ce, { $heightX: 1, $widthX: 6, children: /* @__PURE__ */ r(A, { renderAs: "primary", tooltipItem: "Not visible to student", position: "bottom", children: /* @__PURE__ */ r(ee, { $heightX: 1, $widthX: 6 }) }) }) })
|
240
248
|
] });
|
241
|
-
}, Ee =
|
249
|
+
}, Ee = Q(le);
|
242
250
|
export {
|
243
251
|
Ee as default
|
244
252
|
};
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"homework-card.js","sources":["../../../src/features/homework/homework-card.tsx"],"sourcesContent":["import type {\n INodeCardCallbacks,\n INodeDataProps,\n} from '../chapters-v2/comps/node-card/node-card-types';\nimport type { TUserTypes } from '../ui/types';\n\nimport { memo, useCallback, useMemo, useRef } from 'react';\n\nimport Eye2Icon from '../../assets/line-icons/icons/eye2';\nimport MoreVerticalIcon from '../../assets/line-icons/icons/more-vertical';\nimport RedoIcon from '../../assets/line-icons/icons/redo';\nimport ArrowTooltip from '../ui/arrow-tooltip/arrow-tooltip';\nimport Clickable from '../ui/buttons/clickable/clickable';\nimport useContextMenuClickHandler from '../ui/hooks/use-context-menu-click-handler';\nimport FlexView from '../ui/layout/flex-view';\nimport CardMenuOptions from './card-menu-options';\nimport HomeworkView from './homework-card-view';\nimport * as Styled from './styles';\nimport { getCardAnalyticProps } from './utils';\n\ninterface IHomeworkCardProps extends INodeCardCallbacks {\n header: string;\n nodeData: INodeDataProps;\n subHeader: string;\n userType: TUserTypes;\n studentId: string;\n userMilestoneId?: string;\n renderAs: 'homework' | 'milestone';\n shouldOpenOnRight: boolean;\n isInQueue?: boolean;\n}\n\nconst HomeworkCard = ({\n // callbacks\n nodeData,\n onNodeAttempt,\n onNodeReattempt,\n onNodeReview,\n onNodeUnassign,\n onNodeView,\n\n header,\n isInQueue,\n renderAs,\n shouldOpenOnRight,\n studentId,\n subHeader,\n userMilestoneId,\n userType,\n}: IHomeworkCardProps) => {\n const isHomeWork = renderAs === 'homework';\n const {\n node_type: nodeType,\n state,\n permissions,\n user_node_id: userNodeId,\n user_milestone_id: milestoneId,\n homework_id: homeworkId,\n } = nodeData;\n\n const teacherContainerRef = useRef<HTMLDivElement>(null);\n const studentContainerRef = useRef<HTMLDivElement>(null);\n const { menuVisible: teacherMenuVisible, onMenuClick: onTeacherMenuClick } =\n useContextMenuClickHandler(teacherContainerRef);\n const { menuVisible: studentMenuVisible, onMenuClick: onStudentMenuClick } =\n useContextMenuClickHandler(studentContainerRef);\n\n const {\n can_start: canStart,\n can_resume: canResume,\n can_review: canReview,\n can_unassign: canUnassign,\n can_reset: canReset,\n } = permissions;\n const isStudent = userType === 'STUDENT';\n\n const onStudentViewSheet = useCallback(() => {\n if (canReview) {\n if (typeof onNodeReview !== 'function') {\n throw new Error('onReview must be a function');\n }\n\n if (!userNodeId) {\n throw new Error('user node id must be present to review the sheet');\n }\n onNodeReview(nodeData, userMilestoneId);\n\n return;\n }\n }, [canReview, onNodeReview, userNodeId, nodeData, userMilestoneId]);\n\n const onStudentCardClick = useCallback(() => {\n if (canStart || canResume) {\n if (typeof onNodeAttempt !== 'function') {\n throw new Error('onNodeAttempt must be a function');\n }\n\n onNodeAttempt(nodeData, homeworkId);\n\n return;\n }\n\n if (!isHomeWork) {\n onStudentMenuClick();\n\n return;\n }\n onStudentViewSheet();\n }, [\n canStart,\n canResume,\n isHomeWork,\n onStudentViewSheet,\n onNodeAttempt,\n nodeData,\n homeworkId,\n onStudentMenuClick,\n ]);\n\n const onTeacherCardClick = useCallback(() => {\n if (canReview) {\n if (typeof onNodeReview !== 'function') {\n throw new Error('onNodeReview must be a function');\n }\n\n if (!userNodeId) {\n throw new Error('user node id must be present to review the sheet');\n }\n onNodeReview(nodeData, userMilestoneId || milestoneId, homeworkId);\n\n return;\n }\n\n if (typeof onNodeView !== 'function') {\n throw new Error('onNodeView must be a function');\n }\n\n onNodeView(nodeData, userMilestoneId || milestoneId);\n }, [\n canReview,\n onNodeView,\n nodeData,\n userMilestoneId,\n milestoneId,\n onNodeReview,\n userNodeId,\n homeworkId,\n ]);\n\n const handleOnMenuOptionClick = useCallback(\n (optionId: string) => {\n switch (optionId) {\n case 'teacher-card-view':\n onTeacherCardClick();\n\n return;\n case 'student-card-view':\n onStudentViewSheet();\n\n return;\n case 'teacher-card-unassign':\n onNodeUnassign?.(nodeData, userMilestoneId);\n\n return;\n case 'student-card-reattempt':\n onNodeReattempt?.(nodeData, userMilestoneId);\n\n return;\n default:\n throw new Error(`No callback function for ${optionId}`);\n }\n },\n [\n nodeData,\n onNodeReattempt,\n onNodeUnassign,\n onStudentViewSheet,\n onTeacherCardClick,\n userMilestoneId,\n ],\n );\n\n const teacherOptions = [\n {\n id: 'teacher-card-view',\n label: canReview ? 'Review' : 'View',\n icon: Eye2Icon,\n disabled: false,\n onClick: handleOnMenuOptionClick,\n },\n {\n id: 'teacher-card-unassign',\n label: 'Unassign',\n icon: Styled.StyledMinus2Icon,\n disabled: isHomeWork ? nodeType === 'MASTERY' : !canUnassign,\n onClick: handleOnMenuOptionClick,\n },\n ];\n\n const studentOptions = [\n {\n id: 'student-card-view',\n label: 'Review',\n icon: Eye2Icon,\n disabled: !canReview,\n onClick: handleOnMenuOptionClick,\n },\n {\n id: 'student-card-reattempt',\n label: 'Reattempt',\n icon: RedoIcon,\n disabled: !canReset,\n onClick: handleOnMenuOptionClick,\n },\n ];\n\n const analyticsLabel = useMemo(\n () =>\n getCardAnalyticProps({\n canResume,\n canStart,\n homeworkId,\n isHomeWork,\n isStudent,\n milestoneId,\n nodeType,\n studentId,\n userNodeId,\n }),\n [\n isStudent,\n isHomeWork,\n studentId,\n nodeType,\n canStart,\n canResume,\n homeworkId,\n userNodeId,\n milestoneId,\n ],\n );\n\n return (\n <Styled.CardContainer $position=\"relative\" $width=\"fit-content\">\n <Clickable\n onClick={isStudent ? onStudentCardClick : onTeacherCardClick}\n label=\"homework-card\"\n analyticsLabel={analyticsLabel.analyticsLabel}\n analyticsProps={analyticsLabel.analyticsProps}\n >\n <HomeworkView\n header={header}\n isInQueue={isInQueue}\n nodeData={nodeData}\n studentContainerRef={studentContainerRef}\n subHeader={subHeader}\n userType={userType}\n />\n </Clickable>\n {isStudent && !isHomeWork && (\n <CardMenuOptions\n $width={200}\n options={studentOptions}\n triggerRef={studentContainerRef}\n visible={studentMenuVisible}\n shouldOpenOnRight={false}\n />\n )}\n {!isStudent && (\n <Styled.MenuWrapper $position=\"absolute\" $width=\"fit-content\" $borderRadiusX={2}>\n <ArrowTooltip\n renderAs=\"primary\"\n tooltipItem=\"Review\"\n position=\"bottom\"\n zIndex={6}\n parentWidth=\"100%\"\n hidden={teacherMenuVisible || (state !== 'WAIT_FOR_REVIEW' && isHomeWork)}\n >\n <Styled.CardKebabMenuWrapper\n $alignItems=\"center\"\n $justifyContent=\"center\"\n ref={teacherContainerRef}\n onClick={onTeacherMenuClick}\n >\n <MoreVerticalIcon width={16} height={16} />\n </Styled.CardKebabMenuWrapper>\n </ArrowTooltip>\n <CardMenuOptions\n options={teacherOptions}\n triggerRef={teacherContainerRef}\n visible={teacherMenuVisible}\n shouldOpenOnRight={shouldOpenOnRight}\n />\n </Styled.MenuWrapper>\n )}\n {isInQueue && (\n <Styled.BlurContainer $background=\"WHITE_5\">\n <Styled.BlurFlexView $heightX={1} $widthX={6}>\n <ArrowTooltip renderAs=\"primary\" tooltipItem=\"Not visible to student\" position=\"bottom\">\n <FlexView $heightX={1} $widthX={6} />\n </ArrowTooltip>\n </Styled.BlurFlexView>\n </Styled.BlurContainer>\n )}\n </Styled.CardContainer>\n );\n};\n\nexport default memo(HomeworkCard);\n"],"names":["HomeworkCard","nodeData","onNodeAttempt","onNodeReattempt","onNodeReview","onNodeUnassign","onNodeView","header","isInQueue","renderAs","shouldOpenOnRight","studentId","subHeader","userMilestoneId","userType","isHomeWork","nodeType","state","permissions","userNodeId","milestoneId","homeworkId","teacherContainerRef","useRef","studentContainerRef","teacherMenuVisible","onTeacherMenuClick","useContextMenuClickHandler","studentMenuVisible","onStudentMenuClick","canStart","canResume","canReview","canUnassign","canReset","isStudent","onStudentViewSheet","useCallback","onStudentCardClick","onTeacherCardClick","handleOnMenuOptionClick","optionId","teacherOptions","Eye2Icon","Styled.StyledMinus2Icon","studentOptions","RedoIcon","analyticsLabel","useMemo","getCardAnalyticProps","Styled.CardContainer","jsx","Clickable","HomeworkView","CardMenuOptions","jsxs","Styled.MenuWrapper","ArrowTooltip","Styled.CardKebabMenuWrapper","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AAA,EAEJ,EAAA,CAAA;AAEJ,GAEeC,KAAAC,EAAKhE,EAAY;"}
|
1
|
+
{"version":3,"file":"homework-card.js","sources":["../../../src/features/homework/homework-card.tsx"],"sourcesContent":["import type {\n INodeCardCallbacks,\n INodeDataProps,\n} from '../chapters-v2/comps/node-card/node-card-types';\nimport type { TUserTypes } from '../ui/types';\n\nimport { memo, useCallback, useMemo, useRef } from 'react';\n\nimport Eye2Icon from '../../assets/line-icons/icons/eye2';\nimport MoreVerticalIcon from '../../assets/line-icons/icons/more-vertical';\nimport RedoIcon from '../../assets/line-icons/icons/redo';\nimport ArrowTooltip from '../ui/arrow-tooltip/arrow-tooltip';\nimport Clickable from '../ui/buttons/clickable/clickable';\nimport useContextMenuClickHandler from '../ui/hooks/use-context-menu-click-handler';\nimport FlexView from '../ui/layout/flex-view';\nimport CardMenuOptions from './card-menu-options';\nimport HomeworkView from './homework-card-view';\nimport * as Styled from './styles';\nimport { getCardAnalyticProps } from './utils';\n\ninterface IHomeworkCardProps extends INodeCardCallbacks {\n header: string;\n nodeData: INodeDataProps;\n subHeader: string;\n userType: TUserTypes;\n studentId: string;\n userMilestoneId?: string;\n renderAs: 'homework' | 'milestone';\n shouldOpenOnRight: boolean;\n isInQueue?: boolean;\n}\n\nconst HomeworkCard = ({\n // callbacks\n nodeData,\n onNodeAttempt,\n onNodeReattempt,\n onNodeReview,\n onNodeUnassign,\n onNodeView,\n\n header,\n isInQueue,\n renderAs,\n shouldOpenOnRight,\n studentId,\n subHeader,\n userMilestoneId,\n userType,\n}: IHomeworkCardProps) => {\n const isHomeWork = renderAs === 'homework';\n const {\n node_type: nodeType,\n state,\n permissions,\n user_node_id: userNodeId,\n user_milestone_id: milestoneId,\n homework_id: homeworkId,\n } = nodeData;\n\n const teacherContainerRef = useRef<HTMLDivElement>(null);\n const studentContainerRef = useRef<HTMLDivElement>(null);\n const { menuVisible: teacherMenuVisible, onMenuClick: onTeacherMenuClick } =\n useContextMenuClickHandler(teacherContainerRef);\n const { menuVisible: studentMenuVisible, onMenuClick: onStudentMenuClick } =\n useContextMenuClickHandler(studentContainerRef);\n\n const {\n can_start: canStart,\n can_resume: canResume,\n can_review: canReview,\n can_unassign: canUnassign,\n can_reset: canReset,\n } = permissions;\n const isStudent = userType === 'STUDENT';\n\n const onStudentViewSheet = useCallback(() => {\n if (canReview) {\n if (typeof onNodeReview !== 'function') {\n throw new Error('onReview must be a function');\n }\n\n if (!userNodeId) {\n throw new Error('user node id must be present to review the sheet');\n }\n onNodeReview(nodeData, userMilestoneId);\n\n return;\n }\n }, [canReview, onNodeReview, userNodeId, nodeData, userMilestoneId]);\n\n const onStudentCardClick = useCallback(() => {\n if (canStart || canResume) {\n if (typeof onNodeAttempt !== 'function') {\n throw new Error('onNodeAttempt must be a function');\n }\n\n onNodeAttempt(nodeData, homeworkId);\n\n return;\n }\n\n if (!isHomeWork) {\n onStudentMenuClick();\n\n return;\n }\n onStudentViewSheet();\n }, [\n canStart,\n canResume,\n isHomeWork,\n onStudentViewSheet,\n onNodeAttempt,\n nodeData,\n homeworkId,\n onStudentMenuClick,\n ]);\n\n const onTeacherCardClick = useCallback(() => {\n if (canReview) {\n if (typeof onNodeReview !== 'function') {\n throw new Error('onNodeReview must be a function');\n }\n\n if (!userNodeId) {\n throw new Error('user node id must be present to review the sheet');\n }\n onNodeReview(nodeData, userMilestoneId || milestoneId, homeworkId);\n\n return;\n }\n\n if (typeof onNodeView !== 'function') {\n throw new Error('onNodeView must be a function');\n }\n\n onNodeView(nodeData, userMilestoneId || milestoneId);\n }, [\n canReview,\n onNodeView,\n nodeData,\n userMilestoneId,\n milestoneId,\n onNodeReview,\n userNodeId,\n homeworkId,\n ]);\n\n const handleOnMenuOptionClick = useCallback(\n (optionId: string) => {\n switch (optionId) {\n case 'teacher-card-view':\n onTeacherCardClick();\n\n return;\n case 'student-card-view':\n onStudentViewSheet();\n\n return;\n case 'teacher-card-unassign':\n onNodeUnassign?.(nodeData, userMilestoneId);\n\n return;\n case 'student-card-reattempt':\n case 'teacher-card-redo':\n onNodeReattempt?.(nodeData, userMilestoneId);\n\n return;\n\n default:\n throw new Error(`No callback function for ${optionId}`);\n }\n },\n [\n nodeData,\n onNodeReattempt,\n onNodeUnassign,\n onStudentViewSheet,\n onTeacherCardClick,\n userMilestoneId,\n ],\n );\n\n const teacherOptions = [\n {\n id: 'teacher-card-view',\n label: canReview ? 'Review' : 'View',\n icon: Eye2Icon,\n disabled: false,\n onClick: handleOnMenuOptionClick,\n },\n {\n id: 'teacher-card-unassign',\n label: 'Unassign',\n icon: Styled.StyledMinus2Icon,\n disabled: isHomeWork ? nodeType === 'MASTERY' : !canUnassign,\n onClick: handleOnMenuOptionClick,\n },\n {\n id: 'teacher-card-redo',\n label: 'Redo',\n icon: RedoIcon,\n disabled: !canReset,\n onClick: handleOnMenuOptionClick,\n },\n ];\n\n const studentOptions = [\n {\n id: 'student-card-view',\n label: 'Review',\n icon: Eye2Icon,\n disabled: !canReview,\n onClick: handleOnMenuOptionClick,\n },\n {\n id: 'student-card-reattempt',\n label: 'Reattempt',\n icon: RedoIcon,\n disabled: !canReset,\n onClick: handleOnMenuOptionClick,\n },\n ];\n\n const analyticsLabel = useMemo(\n () =>\n getCardAnalyticProps({\n canResume,\n canStart,\n homeworkId,\n isHomeWork,\n isStudent,\n milestoneId,\n nodeType,\n studentId,\n userNodeId,\n }),\n [\n isStudent,\n isHomeWork,\n studentId,\n nodeType,\n canStart,\n canResume,\n homeworkId,\n userNodeId,\n milestoneId,\n ],\n );\n\n return (\n <Styled.CardContainer $position=\"relative\" $width=\"fit-content\">\n <Clickable\n onClick={isStudent ? onStudentCardClick : onTeacherCardClick}\n label=\"homework-card\"\n analyticsLabel={analyticsLabel.analyticsLabel}\n analyticsProps={analyticsLabel.analyticsProps}\n >\n <HomeworkView\n header={header}\n isInQueue={isInQueue}\n nodeData={nodeData}\n studentContainerRef={studentContainerRef}\n subHeader={subHeader}\n userType={userType}\n />\n </Clickable>\n {isStudent && !isHomeWork && (\n <CardMenuOptions\n $width={200}\n options={studentOptions}\n triggerRef={studentContainerRef}\n visible={studentMenuVisible}\n shouldOpenOnRight={false}\n />\n )}\n {!isStudent && (\n <Styled.MenuWrapper $position=\"absolute\" $width=\"fit-content\" $borderRadiusX={2}>\n <ArrowTooltip\n renderAs=\"primary\"\n tooltipItem=\"Review\"\n position=\"bottom\"\n zIndex={6}\n parentWidth=\"100%\"\n hidden={teacherMenuVisible || (state !== 'WAIT_FOR_REVIEW' && isHomeWork)}\n >\n <Styled.CardKebabMenuWrapper\n $alignItems=\"center\"\n $justifyContent=\"center\"\n ref={teacherContainerRef}\n onClick={onTeacherMenuClick}\n >\n <MoreVerticalIcon width={16} height={16} />\n </Styled.CardKebabMenuWrapper>\n </ArrowTooltip>\n <CardMenuOptions\n options={teacherOptions}\n triggerRef={teacherContainerRef}\n visible={teacherMenuVisible}\n shouldOpenOnRight={shouldOpenOnRight}\n />\n </Styled.MenuWrapper>\n )}\n {isInQueue && (\n <Styled.BlurContainer $background=\"WHITE_5\">\n <Styled.BlurFlexView $heightX={1} $widthX={6}>\n <ArrowTooltip renderAs=\"primary\" tooltipItem=\"Not visible to student\" position=\"bottom\">\n <FlexView $heightX={1} $widthX={6} />\n </ArrowTooltip>\n </Styled.BlurFlexView>\n </Styled.BlurContainer>\n )}\n </Styled.CardContainer>\n );\n};\n\nexport default memo(HomeworkCard);\n"],"names":["HomeworkCard","nodeData","onNodeAttempt","onNodeReattempt","onNodeReview","onNodeUnassign","onNodeView","header","isInQueue","renderAs","shouldOpenOnRight","studentId","subHeader","userMilestoneId","userType","isHomeWork","nodeType","state","permissions","userNodeId","milestoneId","homeworkId","teacherContainerRef","useRef","studentContainerRef","teacherMenuVisible","onTeacherMenuClick","useContextMenuClickHandler","studentMenuVisible","onStudentMenuClick","canStart","canResume","canReview","canUnassign","canReset","isStudent","onStudentViewSheet","useCallback","onStudentCardClick","onTeacherCardClick","handleOnMenuOptionClick","optionId","teacherOptions","Eye2Icon","Styled.StyledMinus2Icon","RedoIcon","studentOptions","analyticsLabel","useMemo","getCardAnalyticProps","Styled.CardContainer","jsx","Clickable","HomeworkView","CardMenuOptions","jsxs","Styled.MenuWrapper","ArrowTooltip","Styled.CardKebabMenuWrapper","MoreVerticalIcon","Styled.BlurContainer","Styled.BlurFlexView","FlexView","HomeworkCard$1","memo"],"mappings":";;;;;;;;;;;;;AAgCA,MAAMA,KAAe,CAAC;AAAA;AAAA,EAEpB,UAAAC;AAAA,EACA,eAAAC;AAAA,EACA,iBAAAC;AAAA,EACA,cAAAC;AAAA,EACA,gBAAAC;AAAA,EACA,YAAAC;AAAA,EAEA,QAAAC;AAAA,EACA,WAAAC;AAAA,EACA,UAAAC;AAAA,EACA,mBAAAC;AAAA,EACA,WAAAC;AAAA,EACA,WAAAC;AAAA,EACA,iBAAAC;AAAA,EACA,UAAAC;AACF,MAA0B;AACxB,QAAMC,IAAaN,MAAa,YAC1B;AAAA,IACJ,WAAWO;AAAA,IACX,OAAAC;AAAA,IACA,aAAAC;AAAA,IACA,cAAcC;AAAA,IACd,mBAAmBC;AAAA,IACnB,aAAaC;AAAA,EACX,IAAApB,GAEEqB,IAAsBC,EAAuB,IAAI,GACjDC,IAAsBD,EAAuB,IAAI,GACjD,EAAE,aAAaE,GAAoB,aAAaC,MACpDC,EAA2BL,CAAmB,GAC1C,EAAE,aAAaM,GAAoB,aAAaC,MACpDF,EAA2BH,CAAmB,GAE1C;AAAA,IACJ,WAAWM;AAAA,IACX,YAAYC;AAAA,IACZ,YAAYC;AAAA,IACZ,cAAcC;AAAA,IACd,WAAWC;AAAA,EACT,IAAAhB,GACEiB,IAAYrB,MAAa,WAEzBsB,IAAqBC,EAAY,MAAM;AAC3C,QAAIL,GAAW;AACT,UAAA,OAAO5B,KAAiB;AACpB,cAAA,IAAI,MAAM,6BAA6B;AAG/C,UAAI,CAACe;AACG,cAAA,IAAI,MAAM,kDAAkD;AAEpE,MAAAf,EAAaH,GAAUY,CAAe;AAEtC;AAAA,IAC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AAAA,IAEDF,KACC,gBAAA2C,EAACS,IAAA,EAAqB,aAAY,WAChC,UAAA,gBAAAT,EAACU,IAAA,EAAoB,UAAU,GAAG,SAAS,GACzC,UAAC,gBAAAV,EAAAM,GAAA,EAAa,UAAS,WAAU,aAAY,0BAAyB,UAAS,UAC7E,UAAA,gBAAAN,EAACW,IAAS,EAAA,UAAU,GAAG,SAAS,EAAG,CAAA,EACrC,CAAA,EACF,CAAA,GACF;AAAA,EAEJ,EAAA,CAAA;AAEJ,GAEeC,KAAAC,EAAKhE,EAAY;"}
|
@@ -0,0 +1,51 @@
|
|
1
|
+
import i, { css as s } from "styled-components";
|
2
|
+
const o = i.div`
|
3
|
+
position: absolute;
|
4
|
+
z-index: 1;
|
5
|
+
overflow: hidden;
|
6
|
+
`, d = i(o)(
|
7
|
+
({ $borderWidth: t }) => `
|
8
|
+
top: 0;
|
9
|
+
left: 0;
|
10
|
+
width: 100%;
|
11
|
+
height: ${t}px;
|
12
|
+
`
|
13
|
+
), c = i(o)(
|
14
|
+
({ $borderWidth: t }) => `
|
15
|
+
bottom: 0;
|
16
|
+
left: 0;
|
17
|
+
width: 100%;
|
18
|
+
height: ${t}px;
|
19
|
+
`
|
20
|
+
), l = i(o)(
|
21
|
+
({ $borderWidth: t }) => `
|
22
|
+
top: 0;
|
23
|
+
right: 0;
|
24
|
+
width: ${t}px;
|
25
|
+
height: 100%;
|
26
|
+
`
|
27
|
+
), $ = i(o)(
|
28
|
+
({ $borderWidth: t }) => `
|
29
|
+
top: 0;
|
30
|
+
left: 0;
|
31
|
+
width: ${t}px;
|
32
|
+
height: 100%;
|
33
|
+
`
|
34
|
+
), g = i.div(
|
35
|
+
({ theme: t, $width: n, $height: e, $borderColor: h, $animationDuration: p, $keyframes: r }) => s`
|
36
|
+
position: relative;
|
37
|
+
width: ${n}px;
|
38
|
+
height: ${e}px;
|
39
|
+
background-color: ${t.colors[h]};
|
40
|
+
opacity: 0;
|
41
|
+
animation: ${r} ${p}s linear infinite;
|
42
|
+
`
|
43
|
+
);
|
44
|
+
export {
|
45
|
+
c as BottomLineContainer,
|
46
|
+
$ as LeftLineContainer,
|
47
|
+
g as Line,
|
48
|
+
l as RightLineContainer,
|
49
|
+
d as TopLineContainer
|
50
|
+
};
|
51
|
+
//# sourceMappingURL=border-path-animation-styled.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"border-path-animation-styled.js","sources":["../../../../src/features/ui/border-path-animation/border-path-animation-styled.tsx"],"sourcesContent":["import type { TColorNames } from '../types';\nimport type { keyframes } from 'styled-components';\n\nimport styled, { css } from 'styled-components';\n\nconst LineContainer = styled.div`\n position: absolute;\n z-index: 1;\n overflow: hidden;\n`;\n\nexport const TopLineContainer = styled(LineContainer)<{\n $borderWidth: number;\n}>(\n ({ $borderWidth }) => `\n top: 0;\n left: 0;\n width: 100%;\n height: ${$borderWidth}px;\n`,\n);\n\nexport const BottomLineContainer = styled(LineContainer)<{\n $borderWidth: number;\n}>(\n ({ $borderWidth }) => `\n bottom: 0;\n left: 0;\n width: 100%;\n height: ${$borderWidth}px;\n`,\n);\n\nexport const RightLineContainer = styled(LineContainer)<{\n $borderWidth: number;\n}>(\n ({ $borderWidth }) => `\n top: 0;\n right: 0;\n width: ${$borderWidth}px;\n height: 100%;\n`,\n);\n\nexport const LeftLineContainer = styled(LineContainer)<{\n $borderWidth: number;\n}>(\n ({ $borderWidth }) => `\n top: 0;\n left: 0;\n width: ${$borderWidth}px;\n height: 100%;\n`,\n);\n\nexport const Line = styled.div<{\n $borderColor: TColorNames;\n $animationDuration: number;\n $keyframes: ReturnType<typeof keyframes>;\n $width: number;\n $height: number;\n}>(\n ({ theme, $width, $height, $borderColor, $animationDuration, $keyframes }) => css`\n position: relative;\n width: ${$width}px;\n height: ${$height}px;\n background-color: ${theme.colors[$borderColor]};\n opacity: 0;\n animation: ${$keyframes} ${$animationDuration}s linear infinite;\n `,\n);\n"],"names":["LineContainer","styled","TopLineContainer","$borderWidth","BottomLineContainer","RightLineContainer","LeftLineContainer","Line","theme","$width","$height","$borderColor","$animationDuration","$keyframes","css"],"mappings":";AAKA,MAAMA,IAAgBC,EAAO;AAAA;AAAA;AAAA;AAAA,GAMhBC,IAAmBD,EAAOD,CAAa;AAAA,EAGlD,CAAC,EAAE,cAAAG,EAAA,MAAmB;AAAA;AAAA;AAAA;AAAA,YAIZA,CAAY;AAAA;AAExB,GAEaC,IAAsBH,EAAOD,CAAa;AAAA,EAGrD,CAAC,EAAE,cAAAG,EAAA,MAAmB;AAAA;AAAA;AAAA;AAAA,YAIZA,CAAY;AAAA;AAExB,GAEaE,IAAqBJ,EAAOD,CAAa;AAAA,EAGpD,CAAC,EAAE,cAAAG,EAAA,MAAmB;AAAA;AAAA;AAAA,WAGbA,CAAY;AAAA;AAAA;AAGvB,GAEaG,IAAoBL,EAAOD,CAAa;AAAA,EAGnD,CAAC,EAAE,cAAAG,EAAA,MAAmB;AAAA;AAAA;AAAA,WAGbA,CAAY;AAAA;AAAA;AAGvB,GAEaI,IAAON,EAAO;AAAA,EAOzB,CAAC,EAAE,OAAAO,GAAO,QAAAC,GAAQ,SAAAC,GAAS,cAAAC,GAAc,oBAAAC,GAAoB,YAAAC,EAAiB,MAAAC;AAAA;AAAA,aAEnEL,CAAM;AAAA,cACLC,CAAO;AAAA,wBACGF,EAAM,OAAOG,CAAY,CAAC;AAAA;AAAA,iBAEjCE,CAAU,IAAID,CAAkB;AAAA;AAEjD;"}
|
@@ -0,0 +1,108 @@
|
|
1
|
+
import { jsxs as p, Fragment as g, jsx as s } from "react/jsx-runtime";
|
2
|
+
import { memo as b, useState as d, useMemo as l, useRef as u, useLayoutEffect as C } from "react";
|
3
|
+
import { keyframes as L } from "styled-components";
|
4
|
+
import { TopLineContainer as k, Line as c, RightLineContainer as W, BottomLineContainer as R, LeftLineContainer as D } from "./border-path-animation-styled.js";
|
5
|
+
const F = (i, r) => {
|
6
|
+
const t = (i + r) * 2, o = i, e = r, y = i / t, n = (i + r) / t, a = (i + r + i) / t;
|
7
|
+
return {
|
8
|
+
top: [
|
9
|
+
[0, { x: 0, y: 0, o: 1 }],
|
10
|
+
[y, { x: o, y: 0, o: 1 }],
|
11
|
+
[y + 1e-3, { x: o, y: 0, o: 0 }],
|
12
|
+
[n - 1e-3, { x: -o, y: 0, o: 0 }],
|
13
|
+
[n, { x: -o, y: 0, o: 1 }],
|
14
|
+
[a, { x: 0, y: 0, o: 1 }],
|
15
|
+
[1, { x: 0, y: 0, o: 1 }]
|
16
|
+
],
|
17
|
+
right: [
|
18
|
+
[0, { x: 0, y: 0, o: 1 }],
|
19
|
+
[y, { x: 0, y: 0, o: 1 }],
|
20
|
+
[n, { x: 0, y: e, o: 1 }],
|
21
|
+
[n + 1e-3, { x: 0, y: e, o: 0 }],
|
22
|
+
[a - 1e-3, { x: 0, y: -e, o: 0 }],
|
23
|
+
[a, { x: 0, y: -e, o: 1 }],
|
24
|
+
[1, { x: 0, y: 0, o: 1 }]
|
25
|
+
],
|
26
|
+
bottom: [
|
27
|
+
[0, { x: o, y: 0, o: 1 }],
|
28
|
+
[y, { x: 0, y: 0, o: 1 }],
|
29
|
+
[n, { x: 0, y: 0, o: 1 }],
|
30
|
+
[a, { x: -o, y: 0, o: 1 }],
|
31
|
+
[a + 1e-3, { x: -o, y: 0, o: 0 }],
|
32
|
+
[a + 2e-3, { x: o, y: 0, o: 0 }],
|
33
|
+
[1, { x: o, y: 0, o: 1 }]
|
34
|
+
],
|
35
|
+
left: [
|
36
|
+
[0, { x: 0, y: e, o: 1 }],
|
37
|
+
[y, { x: 0, y: e, o: 1 }],
|
38
|
+
[n, { x: 0, y: 0, o: 1 }],
|
39
|
+
[a, { x: 0, y: 0, o: 1 }],
|
40
|
+
[1, { x: 0, y: -e, o: 1 }]
|
41
|
+
]
|
42
|
+
};
|
43
|
+
}, $ = (i) => L`
|
44
|
+
${i.map(
|
45
|
+
([r, { x: t, y: o, o: e }]) => `${r * 100}% {
|
46
|
+
transform: translate(${t}px, ${o}px);
|
47
|
+
opacity: ${e};
|
48
|
+
}`
|
49
|
+
).join(" ")}
|
50
|
+
`, K = b((i) => {
|
51
|
+
const { animationDuration: r = 6, borderWidth: t = 1, borderColor: o = "YELLOW_3" } = i, [e, y] = d(1), [n, a] = d(1), m = l(() => F(e, n), [e, n]), x = l(
|
52
|
+
() => ({
|
53
|
+
top: $(m.top),
|
54
|
+
right: $(m.right),
|
55
|
+
bottom: $(m.bottom),
|
56
|
+
left: $(m.left)
|
57
|
+
}),
|
58
|
+
[m]
|
59
|
+
), f = u(null), h = u(null);
|
60
|
+
return C(() => {
|
61
|
+
f.current && y(f.current.getBoundingClientRect().width), h.current && a(h.current.getBoundingClientRect().height);
|
62
|
+
}, []), /* @__PURE__ */ p(g, { children: [
|
63
|
+
/* @__PURE__ */ s(k, { className: "top-line", ref: f, $borderWidth: t, children: /* @__PURE__ */ s(
|
64
|
+
c,
|
65
|
+
{
|
66
|
+
$borderColor: o,
|
67
|
+
$width: e,
|
68
|
+
$height: t,
|
69
|
+
$animationDuration: r,
|
70
|
+
$keyframes: x.top
|
71
|
+
}
|
72
|
+
) }),
|
73
|
+
/* @__PURE__ */ s(W, { ref: h, $borderWidth: t, children: /* @__PURE__ */ s(
|
74
|
+
c,
|
75
|
+
{
|
76
|
+
$width: t,
|
77
|
+
$height: n,
|
78
|
+
$borderColor: o,
|
79
|
+
$animationDuration: r,
|
80
|
+
$keyframes: x.right
|
81
|
+
}
|
82
|
+
) }),
|
83
|
+
/* @__PURE__ */ s(R, { $borderWidth: t, children: /* @__PURE__ */ s(
|
84
|
+
c,
|
85
|
+
{
|
86
|
+
$borderColor: o,
|
87
|
+
$width: e,
|
88
|
+
$height: t,
|
89
|
+
$animationDuration: r,
|
90
|
+
$keyframes: x.bottom
|
91
|
+
}
|
92
|
+
) }),
|
93
|
+
/* @__PURE__ */ s(D, { $borderWidth: t, children: /* @__PURE__ */ s(
|
94
|
+
c,
|
95
|
+
{
|
96
|
+
$width: t,
|
97
|
+
$height: n,
|
98
|
+
$borderColor: o,
|
99
|
+
$animationDuration: r,
|
100
|
+
$keyframes: x.left
|
101
|
+
}
|
102
|
+
) })
|
103
|
+
] });
|
104
|
+
});
|
105
|
+
export {
|
106
|
+
K as default
|
107
|
+
};
|
108
|
+
//# sourceMappingURL=border-path-animation.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"border-path-animation.js","sources":["../../../../src/features/ui/border-path-animation/border-path-animation.tsx"],"sourcesContent":["import type {\n IBorderPathAnimationProps,\n IGetKeyFrames,\n IGetKeyFramesConfig,\n} from './border-path-animation-types';\nimport type { FC } from 'react';\n\nimport { memo, useLayoutEffect, useMemo, useRef, useState } from 'react';\nimport { keyframes } from 'styled-components';\n\nimport * as Styled from './border-path-animation-styled';\n\nconst getKeyFramesConfig: IGetKeyFramesConfig = (width, height) => {\n const p = (width + height) * 2; // perimeter\n const w = width;\n const h = height;\n const bp1 = width / p;\n const bp2 = (width + height) / p;\n const bp3 = (width + height + width) / p;\n\n return {\n top: [\n [0, { x: 0, y: 0, o: 1 }],\n [bp1, { x: w, y: 0, o: 1 }],\n\n [bp1 + 0.001, { x: w, y: 0, o: 0 }],\n [bp2 - 0.001, { x: -w, y: 0, o: 0 }],\n\n [bp2, { x: -w, y: 0, o: 1 }],\n [bp3, { x: 0, y: 0, o: 1 }],\n [1, { x: 0, y: 0, o: 1 }],\n ],\n right: [\n [0, { x: 0, y: 0, o: 1 }],\n [bp1, { x: 0, y: 0, o: 1 }],\n [bp2, { x: 0, y: h, o: 1 }],\n\n [bp2 + 0.001, { x: 0, y: h, o: 0 }],\n [bp3 - 0.001, { x: 0, y: -h, o: 0 }],\n\n [bp3, { x: 0, y: -h, o: 1 }],\n [1, { x: 0, y: 0, o: 1 }],\n ],\n bottom: [\n [0, { x: w, y: 0, o: 1 }],\n [bp1, { x: 0, y: 0, o: 1 }],\n [bp2, { x: 0, y: 0, o: 1 }],\n [bp3, { x: -w, y: 0, o: 1 }],\n\n [bp3 + 0.001, { x: -w, y: 0, o: 0 }],\n [bp3 + 0.002, { x: w, y: 0, o: 0 }],\n [1, { x: w, y: 0, o: 1 }],\n ],\n left: [\n [0, { x: 0, y: h, o: 1 }],\n [bp1, { x: 0, y: h, o: 1 }],\n [bp2, { x: 0, y: 0, o: 1 }],\n [bp3, { x: 0, y: 0, o: 1 }],\n [1, { x: 0, y: -h, o: 1 }],\n ],\n };\n};\n\nconst getKeyFrames: IGetKeyFrames = config => {\n return keyframes`\n ${config\n .map(\n ([percentage, { x, y, o }]) => `${percentage * 100}% {\n transform: translate(${x}px, ${y}px);\n opacity: ${o};\n }`,\n )\n .join(' ')}\n `;\n};\n\nconst BorderPathAnimation: FC<IBorderPathAnimationProps> = memo(props => {\n const { animationDuration = 6, borderWidth = 1, borderColor = 'YELLOW_3' } = props;\n const [width, setWidth] = useState(1);\n const [height, setHeight] = useState(1);\n const keyFramesConfig = useMemo(() => getKeyFramesConfig(width, height), [width, height]);\n const keyFrames = useMemo(\n () => ({\n top: getKeyFrames(keyFramesConfig.top),\n right: getKeyFrames(keyFramesConfig.right),\n bottom: getKeyFrames(keyFramesConfig.bottom),\n left: getKeyFrames(keyFramesConfig.left),\n }),\n [keyFramesConfig],\n );\n const topRef = useRef<HTMLDivElement>(null);\n const rightRef = useRef<HTMLDivElement>(null);\n\n useLayoutEffect(() => {\n if (topRef.current) {\n setWidth(topRef.current.getBoundingClientRect().width);\n }\n\n if (rightRef.current) {\n setHeight(rightRef.current.getBoundingClientRect().height);\n }\n }, []);\n\n return (\n <>\n <Styled.TopLineContainer className=\"top-line\" ref={topRef} $borderWidth={borderWidth}>\n <Styled.Line\n $borderColor={borderColor}\n $width={width}\n $height={borderWidth}\n $animationDuration={animationDuration}\n $keyframes={keyFrames.top}\n />\n </Styled.TopLineContainer>\n <Styled.RightLineContainer ref={rightRef} $borderWidth={borderWidth}>\n <Styled.Line\n $width={borderWidth}\n $height={height}\n $borderColor={borderColor}\n $animationDuration={animationDuration}\n $keyframes={keyFrames.right}\n />\n </Styled.RightLineContainer>\n <Styled.BottomLineContainer $borderWidth={borderWidth}>\n <Styled.Line\n $borderColor={borderColor}\n $width={width}\n $height={borderWidth}\n $animationDuration={animationDuration}\n $keyframes={keyFrames.bottom}\n />\n </Styled.BottomLineContainer>\n <Styled.LeftLineContainer $borderWidth={borderWidth}>\n <Styled.Line\n $width={borderWidth}\n $height={height}\n $borderColor={borderColor}\n $animationDuration={animationDuration}\n $keyframes={keyFrames.left}\n />\n </Styled.LeftLineContainer>\n </>\n );\n});\n\nexport default BorderPathAnimation;\n"],"names":["getKeyFramesConfig","width","height","p","w","h","bp1","bp2","bp3","getKeyFrames","config","keyframes","percentage","x","y","o","BorderPathAnimation","memo","props","animationDuration","borderWidth","borderColor","setWidth","useState","setHeight","keyFramesConfig","useMemo","keyFrames","topRef","useRef","rightRef","useLayoutEffect","jsxs","Fragment","jsx","Styled.TopLineContainer","Styled.Line","Styled.RightLineContainer","Styled.BottomLineContainer","Styled.LeftLineContainer"],"mappings":";;;;AAYA,MAAMA,IAA0C,CAACC,GAAOC,MAAW;AAC3D,QAAAC,KAAKF,IAAQC,KAAU,GACvBE,IAAIH,GACJI,IAAIH,GACJI,IAAML,IAAQE,GACdI,KAAON,IAAQC,KAAUC,GACzBK,KAAOP,IAAQC,IAASD,KAASE;AAEhC,SAAA;AAAA,IACL,KAAK;AAAA,MACH,CAAC,GAAG,EAAE,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG;AAAA,MACxB,CAACG,GAAK,EAAE,GAAGF,GAAG,GAAG,GAAG,GAAG,GAAG;AAAA,MAE1B,CAACE,IAAM,MAAO,EAAE,GAAGF,GAAG,GAAG,GAAG,GAAG,GAAG;AAAA,MAClC,CAACG,IAAM,MAAO,EAAE,GAAG,CAACH,GAAG,GAAG,GAAG,GAAG,GAAG;AAAA,MAEnC,CAACG,GAAK,EAAE,GAAG,CAACH,GAAG,GAAG,GAAG,GAAG,GAAG;AAAA,MAC3B,CAACI,GAAK,EAAE,GAA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