@cuemath/leap 2.8.61-as17 → 2.8.61-as3

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.
Files changed (59) hide show
  1. package/dist/assets/line-icons/icons/chevron-left.js.map +1 -1
  2. package/dist/assets/line-icons/icons/recap.js +3 -3
  3. package/dist/assets/line-icons/icons/recap.js.map +1 -1
  4. package/dist/assets/lottie/lottie.js +1 -9
  5. package/dist/assets/lottie/lottie.js.map +1 -1
  6. package/dist/features/chapters/chapters-list/chapter-item/chapter-item-styled.js +19 -20
  7. package/dist/features/chapters/chapters-list/chapter-item/chapter-item-styled.js.map +1 -1
  8. package/dist/features/chapters-v2/chapter-details/block-sections/block-section-view.js +25 -25
  9. package/dist/features/chapters-v2/chapter-details/block-sections/block-section-view.js.map +1 -1
  10. package/dist/features/chapters-v2/chapter-details/block-sections/block-sections.js +28 -32
  11. package/dist/features/chapters-v2/chapter-details/block-sections/block-sections.js.map +1 -1
  12. package/dist/features/chapters-v2/comps/node-card/student-actions/student-actions.js +78 -85
  13. package/dist/features/chapters-v2/comps/node-card/student-actions/student-actions.js.map +1 -1
  14. package/dist/features/chapters-v2/comps/node-card/teacher-actions/teacher-actions.js +90 -98
  15. package/dist/features/chapters-v2/comps/node-card/teacher-actions/teacher-actions.js.map +1 -1
  16. package/dist/features/chapters-v2/constants/node-constants.js +1 -0
  17. package/dist/features/chapters-v2/constants/node-constants.js.map +1 -1
  18. package/dist/features/chapters-v2/utils/node-card-utils.js +39 -77
  19. package/dist/features/chapters-v2/utils/node-card-utils.js.map +1 -1
  20. package/dist/features/communication/pub-sub/constants.js +2 -5
  21. package/dist/features/communication/pub-sub/constants.js.map +1 -1
  22. package/dist/features/homework/card-menu-options.js +44 -34
  23. package/dist/features/homework/card-menu-options.js.map +1 -1
  24. package/dist/features/homework/homework-card.js +227 -157
  25. package/dist/features/homework/homework-card.js.map +1 -1
  26. package/dist/features/homework/hw-card-list/api/get-homeworks.js +1 -1
  27. package/dist/features/homework/hw-card-list/api/get-homeworks.js.map +1 -1
  28. package/dist/features/homework/hw-card-list/hw-card-list.js +104 -177
  29. package/dist/features/homework/hw-card-list/hw-card-list.js.map +1 -1
  30. package/dist/features/homework/styles.js +31 -36
  31. package/dist/features/homework/styles.js.map +1 -1
  32. package/dist/features/milestone/milestone-list-container/milestone-list/milestone-widget/milestone-info.js +49 -48
  33. package/dist/features/milestone/milestone-list-container/milestone-list/milestone-widget/milestone-info.js.map +1 -1
  34. package/dist/features/milestone/milestone-list-container/milestone-list/milestone-widget/milestone-tabs/milestone-tabs.js +35 -36
  35. package/dist/features/milestone/milestone-list-container/milestone-list/milestone-widget/milestone-tabs/milestone-tabs.js.map +1 -1
  36. package/dist/features/milestone/milestone-tests/test-list-v2/test-list-view.js +38 -40
  37. package/dist/features/milestone/milestone-tests/test-list-v2/test-list-view.js.map +1 -1
  38. package/dist/features/sheet-v2/resource-list/resource-list.js +36 -25
  39. package/dist/features/sheet-v2/resource-list/resource-list.js.map +1 -1
  40. package/dist/index.d.ts +1 -36
  41. package/dist/index.js +379 -381
  42. package/dist/index.js.map +1 -1
  43. package/package.json +1 -1
  44. package/dist/assets/line-icons/icons/closed-eye.js +0 -23
  45. package/dist/assets/line-icons/icons/closed-eye.js.map +0 -1
  46. package/dist/features/homework/card-title.js +0 -21
  47. package/dist/features/homework/card-title.js.map +0 -1
  48. package/dist/features/homework/homework-card-view.js +0 -133
  49. package/dist/features/homework/homework-card-view.js.map +0 -1
  50. package/dist/features/homework/hw-card-list/hw-card-list-styled.js +0 -71
  51. package/dist/features/homework/hw-card-list/hw-card-list-styled.js.map +0 -1
  52. package/dist/static/competitive-arena.b9c40801.json +0 -1
  53. package/dist/static/learn.71b13323.json +0 -1
  54. package/dist/static/practice.158dd488.json +0 -1
  55. package/dist/static/project.eb665827.json +0 -1
  56. package/dist/static/puzzle.b298c7e4.json +0 -1
  57. package/dist/static/recap.0dd2c1e2.json +0 -1
  58. package/dist/static/test.803d6036.json +0 -1
  59. package/dist/static/video.b41451e2.json +0 -1
@@ -1,114 +1,107 @@
1
- import { jsx as e, jsxs as d, Fragment as F } from "react/jsx-runtime";
2
- import { memo as Y, useState as Z, useCallback as m } from "react";
3
- import q from "../../../../../assets/line-icons/icons/eye2.js";
4
- import J from "../../../../../assets/line-icons/icons/redo.js";
5
- import Q from "../../../../ui/arrow-tooltip/arrow-tooltip.js";
6
- import U from "../../../../ui/context-menu/context-menu.js";
7
- import V from "../../../../ui/lottie-animation/lottie-animation.js";
8
- import ee from "../../../../ui/text/text.js";
9
- import { BLOCK_TYPE as te } from "../../../constants/block-constants.js";
10
- import { NODE_CARD_STATES as f } from "../../../constants/node-constants.js";
11
- import { getNodeTypeBasedBgImage as oe } from "../../../utils/index.js";
12
- import { getNodeCardBasedIcon as re } from "../../../utils/node-card-utils.js";
13
- import ne from "../border-path-animation.js";
14
- import { NodeCardContainer as ae, NodeCardInfoWrapper as ie, IconWrapper as ce, StyledImportantIcon as se, NodeCardContentWrapper as de, NodeCardTitle as me } from "../node-card-styled.js";
15
- import le from "../node-card-tags.js";
16
- import pe from "../node-menu-options/node-menu-options.js";
17
- const we = Y((L) => {
1
+ import { jsx as e, jsxs as d, Fragment as M } from "react/jsx-runtime";
2
+ import { memo as P, useCallback as T } from "react";
3
+ import X from "../../../../../assets/line-icons/icons/eye2.js";
4
+ import j from "../../../../../assets/line-icons/icons/redo.js";
5
+ import z from "../../../../ui/arrow-tooltip/arrow-tooltip.js";
6
+ import F from "../../../../ui/context-menu/context-menu.js";
7
+ import Y from "../../../../ui/text/text.js";
8
+ import { BLOCK_TYPE as Z } from "../../../constants/block-constants.js";
9
+ import { NODE_CARD_STATES as h } from "../../../constants/node-constants.js";
10
+ import { getNodeTypeBasedBgImage as q } from "../../../utils/index.js";
11
+ import { getNodeCardBasedIcon as J } from "../../../utils/node-card-utils.js";
12
+ import Q from "../border-path-animation.js";
13
+ import { NodeCardContainer as U, NodeCardInfoWrapper as V, IconWrapper as ee, StyledImportantIcon as te, NodeCardContentWrapper as oe, NodeCardTitle as re } from "../node-card-styled.js";
14
+ import ne from "../node-card-tags.js";
15
+ import ae from "../node-menu-options/node-menu-options.js";
16
+ const ke = P((A) => {
18
17
  const {
19
18
  nodeData: t,
20
19
  imageHue: S,
21
- blockType: T,
22
- onNodeAttempt: n,
23
- onNodeReattempt: a,
24
- onNodeReview: i,
25
- onNodeView: o
26
- } = L, {
20
+ blockType: w,
21
+ onNodeAttempt: r,
22
+ onNodeReattempt: n,
23
+ onNodeReview: a,
24
+ onNodeView: i
25
+ } = A, {
27
26
  accuracy: E,
28
- attempt_location: w,
29
- node_type: l,
27
+ attempt_location: N,
28
+ node_type: s,
30
29
  card_header: y,
31
- title: N,
30
+ title: x,
32
31
  state: c,
33
- is_optional: C,
34
- sheet_statement: $,
35
- permissions: R,
36
- marked_as_completed: s
32
+ is_optional: f,
33
+ sheet_statement: u,
34
+ permissions: B,
35
+ marked_as_completed: C
37
36
  } = t, {
38
- can_review: g,
39
- can_start: p,
40
- can_resume: h,
41
- can_reset: I
42
- } = R, _ = T === te.GOAL, r = c === f.LOCKED, x = c === f.NOT_STARTED, B = c === f.IN_PROGRESS, v = w === "INCLASS", M = !$ || !_, W = p || h, O = !C && (B || x), u = !W && (I || g), [D, k] = Z(!1), H = oe(l), { icon: G, lottie: K } = re(l), b = m(
43
- (A) => {
44
- switch (A) {
37
+ can_review: $,
38
+ can_start: m,
39
+ can_resume: l,
40
+ can_reset: g
41
+ } = B, I = w === Z.GOAL, o = c === h.LOCKED, L = c === h.NOT_STARTED, R = c === h.IN_PROGRESS, W = N === "INCLASS", v = !u || !I, D = m || l, _ = !f && (R || L), p = !D && (g || $), H = q(s), k = J(s), O = T(
42
+ (b) => {
43
+ switch (b) {
45
44
  case "node-card-review":
46
- s ? o == null || o(t) : i == null || i(t);
45
+ a == null || a(t);
47
46
  return;
48
47
  case "node-card-reattempt":
49
- a == null || a(t);
48
+ n == null || n(t);
50
49
  return;
51
50
  default:
52
- throw new Error(`No callback function for ${A}`);
51
+ throw new Error(`No callback function for ${b}`);
53
52
  }
54
53
  },
55
- [t, a, i, o, s]
56
- ), P = m(() => {
57
- u || r || (p || h ? n == null || n(t) : s && (o == null || o(t)));
54
+ [t, n, a]
55
+ ), G = T(() => {
56
+ p || o || (m || l ? r == null || r(t) : C && (i == null || i(t)));
58
57
  }, [
59
- h,
60
- p,
58
+ l,
59
+ m,
61
60
  t,
62
- n,
63
- o,
64
- u,
65
61
  r,
66
- s
67
- ]), X = m(() => {
68
- k(!0);
69
- }, []), j = m(() => {
70
- k(!1);
71
- }, []), z = [
62
+ i,
63
+ p,
64
+ o,
65
+ C
66
+ ]), K = [
72
67
  {
73
68
  id: "node-card-review",
74
69
  label: "Review",
75
- icon: q,
76
- disabled: !g,
77
- onClick: b
70
+ icon: X,
71
+ disabled: !$,
72
+ onClick: O
78
73
  },
79
74
  {
80
75
  id: "node-card-reattempt",
81
76
  label: "Reattempt",
82
- icon: J,
83
- disabled: !I,
84
- onClick: b
77
+ icon: j,
78
+ disabled: !g,
79
+ onClick: O
85
80
  }
86
81
  ];
87
82
  return /* @__PURE__ */ e(
88
- U,
83
+ F,
89
84
  {
90
85
  targetElement: /* @__PURE__ */ e(
91
- ae,
86
+ U,
92
87
  {
93
- $showOutline: !O,
88
+ $showOutline: !_,
94
89
  $background: `${S}_2`,
95
- $disabled: r,
96
- onClick: P,
97
- onMouseEnter: X,
98
- onMouseLeave: j,
90
+ $disabled: o,
91
+ onClick: G,
99
92
  children: /* @__PURE__ */ d(
100
- Q,
93
+ z,
101
94
  {
102
95
  renderAs: "primary",
103
- tooltipItem: $,
96
+ tooltipItem: u,
104
97
  position: "bottom",
105
98
  zIndex: 5,
106
- hidden: M,
99
+ hidden: v,
107
100
  parentWidth: "100%",
108
101
  widthX: 11.25,
109
102
  children: [
110
103
  /* @__PURE__ */ d(
111
- ie,
104
+ V,
112
105
  {
113
106
  $flexDirection: "row",
114
107
  $alignItems: "center",
@@ -116,10 +109,10 @@ const we = Y((L) => {
116
109
  $bgImage: H,
117
110
  $gutterX: 0.78125,
118
111
  $flexGap: 8.5,
119
- $opacity: r ? 0.5 : 1,
112
+ $opacity: o ? 0.5 : 1,
120
113
  children: [
121
114
  /* @__PURE__ */ d(
122
- ce,
115
+ ee,
123
116
  {
124
117
  $width: 31,
125
118
  $height: 31,
@@ -128,28 +121,28 @@ const we = Y((L) => {
128
121
  $alignItems: "center",
129
122
  $justifyContent: "center",
130
123
  children: [
131
- D ? /* @__PURE__ */ e(V, { src: K }) : /* @__PURE__ */ e(G, { width: 20, height: 20 }),
132
- !C && /* @__PURE__ */ e(se, {})
124
+ k && /* @__PURE__ */ e(k, { width: 20, height: 20 }),
125
+ !f && /* @__PURE__ */ e(te, {})
133
126
  ]
134
127
  }
135
128
  ),
136
- /* @__PURE__ */ d(ee, { $renderAs: "ac4-black", $color: "BLACK", children: [
129
+ /* @__PURE__ */ d(Y, { $renderAs: "ac4-black", $color: "BLACK", children: [
137
130
  y,
138
131
  " ",
139
- v && ". CW"
132
+ W && ". CW"
140
133
  ] }),
141
- O && /* @__PURE__ */ e(ne, {})
134
+ _ && /* @__PURE__ */ e(Q, {})
142
135
  ]
143
136
  }
144
137
  ),
145
- /* @__PURE__ */ e(le, { nodeType: l, state: c, accuracy: E }),
146
- !_ && /* @__PURE__ */ e(de, { $background: "WHITE_1", $heightX: 4, children: /* @__PURE__ */ e(
147
- me,
138
+ /* @__PURE__ */ e(ne, { nodeType: s, state: c, accuracy: E }),
139
+ !I && /* @__PURE__ */ e(oe, { $background: "WHITE_1", $heightX: 4, children: /* @__PURE__ */ e(
140
+ re,
148
141
  {
149
142
  $renderAs: "ab3",
150
143
  $color: "BLACK_1",
151
- $opacity: r ? 0.5 : 1,
152
- children: N
144
+ $opacity: o ? 0.5 : 1,
145
+ children: x
153
146
  }
154
147
  ) })
155
148
  ]
@@ -161,11 +154,11 @@ const we = Y((L) => {
161
154
  menuWidth: "100%",
162
155
  menuZIndex: 6,
163
156
  menuOffset: 2,
164
- menuElement: /* @__PURE__ */ e(F, { children: u ? /* @__PURE__ */ e(pe, { options: z }) : void 0 })
157
+ menuElement: /* @__PURE__ */ e(M, { children: p ? /* @__PURE__ */ e(ae, { options: K }) : void 0 })
165
158
  }
166
159
  );
167
160
  });
168
161
  export {
169
- we as default
162
+ ke as default
170
163
  };
171
164
  //# 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,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,E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AoC,EAAAQ,IAAA,EAA2B;AAAA,0BAAA;AAAA,wBAAA;AAAA,sBAC9C;AAAA,sBAEC,gBAAAL,EAAAM,IAAA,EAAK,WAAU,aAAY,QAAO,SAChC,UAAA;AAAA,wBAAAhD;AAAA,wBAAW;AAAA,wBAAEiB,KAAgB;AAAA,sBAAA,GAChC;AAAA,sBAECG,uBAAsB6B,IAAoB,EAAA;AAAA,oBAAA;AAAA,kBAAA;AAAA,gBAC7C;AAAA,gBAEC,gBAAAV,EAAAW,IAAA,EAAa,UAAAnD,GAAoB,OAAAG,GAAc,UAAAL,EAAoB,CAAA;AAAA,gBAEnE,CAACc,KACC,gBAAA4B,EAAAY,IAAA,EAA8B,aAAY,WAAU,UAAU,GAC7D,UAAA,gBAAAZ;AAAA,kBAACa;AAAAA,kBAAA;AAAA,oBACC,WAAU;AAAA,oBACV,QAAO;AAAA,oBACP,UAAUvC,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,UAAgBoB,IAAA,gBAAAkB,EAACc,MAAgB,SAASjB,EAAa,CAAA,IAAK,OAAU,CAAA;AAAA,IAAA;AAAA,EAAA;AAG5F,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, 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 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 nodeBgImage = getNodeTypeBasedBgImage(nodeType);\n const NodeCardIcon = getNodeCardBasedIcon(nodeType);\n\n const handleOnMenuOptionClick = useCallback(\n (optionId: string) => {\n switch (optionId) {\n case 'node-card-review':\n 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],\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 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 >\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 {NodeCardIcon && <NodeCardIcon width={20} height={20} />}\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","nodeBgImage","getNodeTypeBasedBgImage","NodeCardIcon","getNodeCardBasedIcon","handleOnMenuOptionClick","useCallback","optionId","handleOnNodeCardClick","menuOptions","Eye2Icon","RedoIcon","jsx","ContextMenu","Styled.NodeCardContainer","jsxs","ArrowTooltip","Styled.NodeCardInfoWrapper","Styled.IconWrapper","Styled.StyledImportantIcon","Text","BorderPathAnimation","NodeCardTags","Styled.NodeCardContentWrapper","Styled.NodeCardTitle","NodeMenuOptions"],"mappings":";;;;;;;;;;;;;;;AAmBM,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,I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AA,wBAAEiB,KAAgB;AAAA,sBAAA,GAChC;AAAA,sBAECG,uBAAsBsB,GAAoB,EAAA;AAAA,oBAAA;AAAA,kBAAA;AAAA,gBAC7C;AAAA,gBAEC,gBAAAT,EAAAU,IAAA,EAAa,UAAA5C,GAAoB,OAAAG,GAAc,UAAAL,EAAoB,CAAA;AAAA,gBAEnE,CAACc,KACC,gBAAAsB,EAAAW,IAAA,EAA8B,aAAY,WAAU,UAAU,GAC7D,UAAA,gBAAAX;AAAA,kBAACY;AAAAA,kBAAA;AAAA,oBACC,WAAU;AAAA,oBACV,QAAO;AAAA,oBACP,UAAUhC,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,UAAgBoB,IAAA,gBAAAY,EAACa,MAAgB,SAAShB,EAAa,CAAA,IAAK,OAAU,CAAA;AAAA,IAAA;AAAA,EAAA;AAG5F,CAAC;"}
@@ -1,134 +1,126 @@
1
- import { jsxs as r, jsx as e } from "react/jsx-runtime";
2
- import { memo as Y, useState as q, useRef as J, useCallback as u } from "react";
3
- import Q from "../../../../../assets/line-icons/icons/check2.js";
4
- import V from "../../../../../assets/line-icons/icons/eye2.js";
5
- import Z from "../../../../../assets/line-icons/icons/home2.js";
6
- import O from "../../../../../assets/line-icons/icons/more-vertical.js";
7
- import D from "../../../../ui/arrow-tooltip/arrow-tooltip.js";
8
- import ee from "../../../../ui/hooks/use-context-menu-click-handler.js";
9
- import te from "../../../../ui/layout/flex-view.js";
10
- import re from "../../../../ui/lottie-animation/lottie-animation.js";
11
- import oe from "../../../../ui/text/text.js";
12
- import { BLOCK_TYPE as ie } from "../../../constants/block-constants.js";
13
- import { NODE_CARD_STATES as $, TEACHER_MENU_LABELS as ne } from "../../../constants/node-constants.js";
14
- import { getNodeTypeBasedBgImage as ce } from "../../../utils/index.js";
15
- import { getNodeCardBasedIcon as ae } from "../../../utils/node-card-utils.js";
16
- import se from "../border-path-animation.js";
17
- import { NodeCardContainer as le, NodeCardInfoWrapper as de, IconWrapper as me, StyledImportantIcon as pe, NodeKebabMenuWrapper as T, NodeCardContentWrapper as he, NodeCardTitle as fe, NodeMenuOptionsWrapper as ue } from "../node-card-styled.js";
18
- import $e from "../node-card-tags.js";
19
- import Ce from "../node-menu-options/node-menu-options.js";
20
- const { ASSIGN_AS_HW: _e, REVIEW: Ie, VIEW: ge, MARK_AS_DONE: be } = ne, Xe = Y(
1
+ import { jsxs as t, jsx as e } from "react/jsx-runtime";
2
+ import { memo as P, useRef as X, useCallback as F } from "react";
3
+ import v from "../../../../../assets/line-icons/icons/book2.js";
4
+ import z from "../../../../../assets/line-icons/icons/check2.js";
5
+ import N from "../../../../../assets/line-icons/icons/eye2.js";
6
+ import U from "../../../../../assets/line-icons/icons/home2.js";
7
+ import T from "../../../../../assets/line-icons/icons/more-vertical.js";
8
+ import V from "../../../../ui/arrow-tooltip/arrow-tooltip.js";
9
+ import Y from "../../../../ui/hooks/use-context-menu-click-handler.js";
10
+ import q from "../../../../ui/layout/flex-view.js";
11
+ import J from "../../../../ui/text/text.js";
12
+ import { BLOCK_TYPE as Q } from "../../../constants/block-constants.js";
13
+ import { NODE_CARD_STATES as $, TEACHER_MENU_LABELS as Z } from "../../../constants/node-constants.js";
14
+ import { getNodeTypeBasedBgImage as D } from "../../../utils/index.js";
15
+ import { getNodeCardBasedIcon as ee } from "../../../utils/node-card-utils.js";
16
+ import re from "../border-path-animation.js";
17
+ import { NodeCardContainer as te, NodeCardInfoWrapper as ie, IconWrapper as oe, StyledImportantIcon as ne, NodeKebabMenuWrapper as k, NodeCardContentWrapper as ce, NodeCardTitle as ae, NodeMenuOptionsWrapper as se } from "../node-card-styled.js";
18
+ import le from "../node-card-tags.js";
19
+ import de from "../node-menu-options/node-menu-options.js";
20
+ const { ASSIGN_AS_HW: me, REVERT_TO_CW: pe, REVIEW: he, VIEW: fe, MARK_AS_DONE: $e } = Z, Re = P(
21
21
  ({
22
- nodeData: t,
23
- imageHue: A,
24
- blockType: L,
22
+ nodeData: r,
23
+ imageHue: S,
24
+ blockType: O,
25
25
  isSkipped: C,
26
26
  onNodeAttemptLocationChange: o,
27
- onNodeMarkAsDone: i,
28
- onNodeView: n,
29
- onNodeReview: c
27
+ onNodeMarkAsDone: n,
28
+ onNodeView: c,
29
+ onNodeReview: a
30
30
  }) => {
31
- const [w, _] = q(!1), l = J(null), { menuVisible: x, onMenuClick: I } = ee(l), {
32
- accuracy: y,
33
- attempt_location: W,
31
+ const l = X(null), { menuVisible: W, onMenuClick: u } = Y(l), {
32
+ accuracy: w,
33
+ attempt_location: x,
34
34
  node_type: d,
35
- card_header: B,
36
- title: M,
37
- state: a,
38
- is_optional: g,
39
- sheet_statement: b,
40
- permissions: H,
41
- user_attempt_id: m
42
- } = t, {
43
- can_change_attempt_location: G,
44
- can_mark_familiar: K,
45
- can_review: p
46
- } = H, h = L === ie.GOAL, s = a === $.LOCKED, R = a === $.NOT_STARTED, j = a === $.IN_PROGRESS, E = W === "INCLASS", P = !b || !h, S = !g && (j || R), X = ce(d), { icon: v, lottie: F } = ae(d), f = u(
47
- (k) => {
48
- switch (k) {
35
+ card_header: y,
36
+ title: B,
37
+ state: s,
38
+ is_optional: _,
39
+ sheet_statement: I,
40
+ permissions: A
41
+ } = r, {
42
+ can_change_attempt_location: H,
43
+ can_mark_familiar: L,
44
+ can_review: m
45
+ } = A, p = O === Q.GOAL, i = s === $.LOCKED, R = s === $.NOT_STARTED, G = s === $.IN_PROGRESS, h = x === "INCLASS", K = !I || !p || i, g = !_ && (G || R), M = D(d), b = ee(d), f = F(
46
+ (E) => {
47
+ switch (E) {
49
48
  case "node-card-view":
50
- p && m ? c == null || c(t) : n == null || n(t);
49
+ m ? a == null || a(r) : c == null || c(r);
51
50
  return;
52
51
  case "node-card-assign-as-hw":
53
- o == null || o(t);
52
+ o == null || o(r);
54
53
  return;
55
54
  case "node-card-mark-as-done":
56
- i == null || i(t);
55
+ n == null || n(r);
57
56
  return;
58
57
  default:
59
- throw new Error(`No callback function for ${k}`);
58
+ throw new Error(`No callback function for ${E}`);
60
59
  }
61
60
  },
62
61
  [
63
- p,
64
- t,
62
+ m,
63
+ r,
65
64
  o,
66
- i,
67
- c,
68
65
  n,
69
- m
66
+ a,
67
+ c
70
68
  ]
71
- ), z = u(() => {
72
- _(!0);
73
- }, []), N = u(() => {
74
- _(!1);
75
- }, []), U = [
69
+ ), j = [
76
70
  {
77
71
  id: "node-card-view",
78
- label: p && m ? Ie : ge,
79
- icon: V,
72
+ label: m ? he : fe,
73
+ icon: N,
80
74
  disabled: !1,
81
75
  onClick: f
82
76
  },
83
77
  {
84
78
  id: "node-card-assign-as-hw",
85
- label: _e,
86
- icon: Z,
87
- disabled: !G || !E,
79
+ label: h ? me : pe,
80
+ icon: h ? U : v,
81
+ disabled: !H,
88
82
  onClick: f
89
83
  },
90
84
  {
91
85
  id: "node-card-mark-as-done",
92
- label: be,
93
- icon: Q,
94
- disabled: !K,
86
+ label: $e,
87
+ icon: z,
88
+ disabled: !L,
95
89
  onClick: f
96
90
  }
97
91
  ];
98
- return /* @__PURE__ */ r(
99
- le,
92
+ return /* @__PURE__ */ t(
93
+ te,
100
94
  {
101
- $showOutline: !S,
102
- $isSheetLocked: s,
103
- $background: `${A}_2`,
95
+ $showOutline: !g,
96
+ $isSheetLocked: i,
97
+ $background: `${S}_2`,
104
98
  $disabled: !!C,
105
- onMouseEnter: z,
106
- onMouseLeave: N,
107
99
  children: [
108
- /* @__PURE__ */ r(
109
- D,
100
+ /* @__PURE__ */ t(
101
+ V,
110
102
  {
111
103
  renderAs: "primary",
112
- tooltipItem: b,
104
+ tooltipItem: I,
113
105
  position: "bottom",
114
106
  zIndex: 5,
115
- hidden: P,
107
+ hidden: K,
116
108
  parentWidth: "100%",
117
109
  widthX: 11.25,
118
110
  children: [
119
- /* @__PURE__ */ r(
120
- de,
111
+ /* @__PURE__ */ t(
112
+ ie,
121
113
  {
122
114
  $flexDirection: "row",
123
115
  $alignItems: "center",
124
116
  $width: "100%",
125
117
  $heightX: 3.5,
126
- $bgImage: X,
118
+ $bgImage: M,
127
119
  $gutterX: 0.78125,
128
120
  $flexGap: 8.5,
129
121
  children: [
130
- /* @__PURE__ */ r(
131
- me,
122
+ /* @__PURE__ */ t(
123
+ oe,
132
124
  {
133
125
  $width: 31,
134
126
  $height: 31,
@@ -136,26 +128,26 @@ const { ASSIGN_AS_HW: _e, REVIEW: Ie, VIEW: ge, MARK_AS_DONE: be } = ne, Xe = Y(
136
128
  $position: "relative",
137
129
  $alignItems: "center",
138
130
  $justifyContent: "center",
139
- $opacity: s ? 0.5 : 1,
131
+ $opacity: i ? 0.5 : 1,
140
132
  children: [
141
- w ? /* @__PURE__ */ e(re, { src: F }) : /* @__PURE__ */ e(v, { width: 20, height: 20 }),
142
- !g && /* @__PURE__ */ e(pe, {})
133
+ b && /* @__PURE__ */ e(b, { width: 20, height: 20 }),
134
+ !_ && /* @__PURE__ */ e(ne, {})
143
135
  ]
144
136
  }
145
137
  ),
146
- /* @__PURE__ */ r(oe, { $renderAs: "ac4-black", $color: "BLACK", $opacity: s ? 0.5 : 1, children: [
147
- B,
138
+ /* @__PURE__ */ t(J, { $renderAs: "ac4-black", $color: "BLACK", $opacity: i ? 0.5 : 1, children: [
139
+ y,
148
140
  " ",
149
- E && ". CW"
141
+ h && ". CW"
150
142
  ] }),
151
- /* @__PURE__ */ e(te, { className: "context-menu", children: h && /* @__PURE__ */ e(T, { ref: l, onClick: I, children: /* @__PURE__ */ e(O, { width: 16, height: 16 }) }) }),
152
- S && !C && /* @__PURE__ */ e(se, {})
143
+ /* @__PURE__ */ e(q, { className: "context-menu", children: p && /* @__PURE__ */ e(k, { ref: l, onClick: u, children: /* @__PURE__ */ e(T, { width: 16, height: 16 }) }) }),
144
+ g && !C && /* @__PURE__ */ e(re, {})
153
145
  ]
154
146
  }
155
147
  ),
156
- /* @__PURE__ */ e($e, { nodeType: d, state: a, accuracy: y }),
157
- !h && /* @__PURE__ */ r(
158
- he,
148
+ /* @__PURE__ */ e(le, { nodeType: d, state: s, accuracy: w }),
149
+ !p && /* @__PURE__ */ t(
150
+ ce,
159
151
  {
160
152
  $flexDirection: "row",
161
153
  $alignItems: "center",
@@ -165,28 +157,28 @@ const { ASSIGN_AS_HW: _e, REVIEW: Ie, VIEW: ge, MARK_AS_DONE: be } = ne, Xe = Y(
165
157
  $justifyContent: "space-between",
166
158
  children: [
167
159
  /* @__PURE__ */ e(
168
- fe,
160
+ ae,
169
161
  {
170
162
  $renderAs: "ab3",
171
163
  $color: "BLACK_1",
172
- $opacity: s ? 0.5 : 1,
173
- children: M
164
+ $opacity: i ? 0.5 : 1,
165
+ children: B
174
166
  }
175
167
  ),
176
- /* @__PURE__ */ e(T, { ref: l, onClick: I, children: /* @__PURE__ */ e(O, { width: 16, height: 16 }) })
168
+ /* @__PURE__ */ e(k, { ref: l, onClick: u, children: /* @__PURE__ */ e(T, { width: 16, height: 16 }) })
177
169
  ]
178
170
  }
179
171
  )
180
172
  ]
181
173
  }
182
174
  ),
183
- /* @__PURE__ */ e(ue, { $visible: x, children: /* @__PURE__ */ e(Ce, { options: U }) })
175
+ /* @__PURE__ */ e(se, { $visible: W, children: /* @__PURE__ */ e(de, { options: j }) })
184
176
  ]
185
177
  }
186
178
  );
187
179
  }
188
180
  );
189
181
  export {
190
- Xe as default
182
+ Re as default
191
183
  };
192
184
  //# sourceMappingURL=teacher-actions.js.map