@cuemath/leap 3.0.4-rj-4 → 3.0.5-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/teacher-actions/teacher-actions.js +25 -25
- package/dist/features/chapters-v2/comps/node-card/teacher-actions/teacher-actions.js.map +1 -1
- package/dist/features/circle-games/games/tutorial/tutorial-styled.js +19 -20
- package/dist/features/circle-games/games/tutorial/tutorial-styled.js.map +1 -1
- package/dist/features/circle-games/games/tutorial/tutorial.js +33 -38
- package/dist/features/circle-games/games/tutorial/tutorial.js.map +1 -1
- package/dist/features/circle-games/{comps → leaderboard/comps}/info-bar/info-bar-styled.js +1 -1
- package/dist/features/circle-games/leaderboard/comps/info-bar/info-bar-styled.js.map +1 -0
- package/dist/features/circle-games/leaderboard/comps/info-bar/info-bar.js.map +1 -0
- package/dist/features/circle-games/leaderboard/comps/streak-reduction-infobar/streak-reduction-infobar.js +1 -1
- package/dist/features/circle-games/leaderboard/comps/streak-reduction-infobar/streak-reduction-infobar.js.map +1 -1
- package/dist/features/milestone/milestone-tests/tests-creation/test-stages/chapter-selection/chapter-item/chapter-item.js +31 -26
- package/dist/features/milestone/milestone-tests/tests-creation/test-stages/chapter-selection/chapter-item/chapter-item.js.map +1 -1
- package/dist/index.d.ts +2 -2
- package/package.json +1 -1
- package/dist/features/circle-games/comps/info-bar/info-bar-styled.js.map +0 -1
- package/dist/features/circle-games/comps/info-bar/info-bar.js.map +0 -1
- /package/dist/features/circle-games/{comps → leaderboard/comps}/info-bar/info-bar.js +0 -0
@@ -1,9 +1,9 @@
|
|
1
1
|
import { jsxs as o, jsx as e } from "react/jsx-runtime";
|
2
|
-
import { memo as U, useRef as
|
2
|
+
import { memo as U, useRef as S, useCallback as $ } from "react";
|
3
3
|
import Y from "../../../../../assets/line-icons/icons/check2.js";
|
4
4
|
import q from "../../../../../assets/line-icons/icons/eye2.js";
|
5
5
|
import J from "../../../../../assets/line-icons/icons/home2.js";
|
6
|
-
import
|
6
|
+
import O from "../../../../../assets/line-icons/icons/more-vertical.js";
|
7
7
|
import N from "../../../../ui/arrow-tooltip/arrow-tooltip.js";
|
8
8
|
import Q from "../../../../ui/border-path-animation/border-path-animation.js";
|
9
9
|
import V from "../../../../ui/hooks/use-context-menu-click-handler.js";
|
@@ -14,36 +14,36 @@ import { BLOCK_TYPE as re } from "../../../constants/block-constants.js";
|
|
14
14
|
import { NODE_CARD_STATES as C, TEACHER_MENU_LABELS as te } from "../../../constants/node-constants.js";
|
15
15
|
import { getNodeTypeBasedBgImage as ne } from "../../../utils/index.js";
|
16
16
|
import { getNodeCardBasedIcon as oe } from "../../../utils/node-card-utils.js";
|
17
|
-
import { NodeCardContainer as ie, NodeCardInfoWrapper as ae, IconWrapper as ce, StyledImportantIcon as se, NodeKebabMenuWrapper as
|
17
|
+
import { NodeCardContainer as ie, NodeCardInfoWrapper as ae, IconWrapper as ce, StyledImportantIcon as se, NodeKebabMenuWrapper as T, NodeCardContentWrapper as le, NodeCardTitle as de, NodeMenuOptionsWrapper as me } from "../node-card-styled.js";
|
18
18
|
import pe from "../node-card-tags.js";
|
19
19
|
import he from "../node-menu-options/node-menu-options.js";
|
20
20
|
const fe = { renderer: "canvas", autoplay: !1 }, { ASSIGN_AS_HW: ue, REVIEW: $e, VIEW: Ce, MARK_AS_DONE: _e } = te, Re = U(
|
21
21
|
({
|
22
22
|
nodeData: t,
|
23
23
|
imageHue: A,
|
24
|
-
blockType:
|
24
|
+
blockType: y,
|
25
25
|
isSkipped: _,
|
26
26
|
onNodeAttemptLocationChange: i,
|
27
27
|
onNodeMarkAsDone: a,
|
28
28
|
onNodeView: c,
|
29
29
|
onNodeReview: s
|
30
30
|
}) => {
|
31
|
-
const d =
|
32
|
-
accuracy:
|
33
|
-
attempt_location:
|
31
|
+
const d = S(null), { menuVisible: w, onMenuClick: I } = V(d), {
|
32
|
+
accuracy: W,
|
33
|
+
attempt_location: x,
|
34
34
|
node_type: m,
|
35
|
-
card_header:
|
36
|
-
title:
|
35
|
+
card_header: B,
|
36
|
+
title: L,
|
37
37
|
state: l,
|
38
38
|
is_optional: b,
|
39
39
|
sheet_statement: g,
|
40
|
-
permissions:
|
40
|
+
permissions: M,
|
41
41
|
user_attempt_id: p
|
42
|
-
} = t, { lottie:
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
} =
|
42
|
+
} = t, { lottie: H } = oe(m), h = S(null), {
|
43
|
+
can_mark_familiar: K,
|
44
|
+
can_review: f,
|
45
|
+
can_assign_as_homework: G
|
46
|
+
} = M, E = y === re.GOAL, n = l === C.LOCKED, R = l === C.NOT_STARTED, j = l === C.IN_PROGRESS, v = x === "INCLASS", k = !b && (j || R), P = ne(m), u = $(
|
47
47
|
(r) => {
|
48
48
|
switch (r) {
|
49
49
|
case "node-card-view":
|
@@ -86,14 +86,14 @@ const fe = { renderer: "canvas", autoplay: !1 }, { ASSIGN_AS_HW: ue, REVIEW: $e,
|
|
86
86
|
id: "node-card-assign-as-hw",
|
87
87
|
label: ue,
|
88
88
|
icon: J,
|
89
|
-
disabled: !G
|
89
|
+
disabled: !G,
|
90
90
|
onClick: u
|
91
91
|
},
|
92
92
|
{
|
93
93
|
id: "node-card-mark-as-done",
|
94
94
|
label: _e,
|
95
95
|
icon: Y,
|
96
|
-
disabled: !
|
96
|
+
disabled: !K,
|
97
97
|
onClick: u
|
98
98
|
}
|
99
99
|
];
|
@@ -140,22 +140,22 @@ const fe = { renderer: "canvas", autoplay: !1 }, { ASSIGN_AS_HW: ue, REVIEW: $e,
|
|
140
140
|
$justifyContent: "center",
|
141
141
|
$opacity: n ? 0.5 : 1,
|
142
142
|
children: [
|
143
|
-
/* @__PURE__ */ e(D, { src:
|
143
|
+
/* @__PURE__ */ e(D, { src: H, ref: h, settings: fe }),
|
144
144
|
!b && /* @__PURE__ */ e(se, {})
|
145
145
|
]
|
146
146
|
}
|
147
147
|
),
|
148
148
|
/* @__PURE__ */ o(ee, { $renderAs: "ac4-black", $color: "BLACK", $opacity: n ? 0.5 : 1, children: [
|
149
|
-
|
149
|
+
B,
|
150
150
|
" ",
|
151
|
-
|
151
|
+
v && "• CW"
|
152
152
|
] }),
|
153
|
-
/* @__PURE__ */ e(Z, { className: "context-menu", children: E && /* @__PURE__ */ e(
|
153
|
+
/* @__PURE__ */ e(Z, { className: "context-menu", children: E && /* @__PURE__ */ e(T, { ref: d, onClick: I, children: /* @__PURE__ */ e(O, { width: 16, height: 16 }) }) }),
|
154
154
|
k && !_ && /* @__PURE__ */ e(Q, { borderColor: "BLACK_1", borderWidth: 1 })
|
155
155
|
]
|
156
156
|
}
|
157
157
|
),
|
158
|
-
/* @__PURE__ */ e(pe, { nodeType: m, state: l, accuracy:
|
158
|
+
/* @__PURE__ */ e(pe, { nodeType: m, state: l, accuracy: W }),
|
159
159
|
!E && /* @__PURE__ */ o(
|
160
160
|
le,
|
161
161
|
{
|
@@ -172,17 +172,17 @@ const fe = { renderer: "canvas", autoplay: !1 }, { ASSIGN_AS_HW: ue, REVIEW: $e,
|
|
172
172
|
$renderAs: "ab3",
|
173
173
|
$color: "BLACK_1",
|
174
174
|
$opacity: n ? 0.5 : 1,
|
175
|
-
children:
|
175
|
+
children: L
|
176
176
|
}
|
177
177
|
),
|
178
|
-
/* @__PURE__ */ e(
|
178
|
+
/* @__PURE__ */ e(T, { ref: d, onClick: I, children: /* @__PURE__ */ e(O, { width: 16, height: 16 }) })
|
179
179
|
]
|
180
180
|
}
|
181
181
|
)
|
182
182
|
]
|
183
183
|
}
|
184
184
|
),
|
185
|
-
/* @__PURE__ */ e(me, { $visible:
|
185
|
+
/* @__PURE__ */ e(me, { $visible: w, children: /* @__PURE__ */ e(he, { options: z }) })
|
186
186
|
]
|
187
187
|
}
|
188
188
|
);
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"teacher-actions.js","sources":["../../../../../../src/features/chapters-v2/comps/node-card/teacher-actions/teacher-actions.tsx"],"sourcesContent":["import type { ILottieAnimationRef } from '../../../../ui/lottie-animation/types';\nimport type { INodeCardProps } from '../node-card-types';\nimport type { INodeMenuOption } from '../node-menu-options/node-menu-options-types';\nimport type { FC } from 'react';\n\nimport { memo, useCallback, useRef } from 'react';\n\nimport Check2Icon from '../../../../../assets/line-icons/icons/check2';\nimport Eye2Icon from '../../../../../assets/line-icons/icons/eye2';\nimport Home2Icon from '../../../../../assets/line-icons/icons/home2';\nimport MoreVerticalIcon from '../../../../../assets/line-icons/icons/more-vertical';\nimport ArrowTooltip from '../../../../ui/arrow-tooltip/arrow-tooltip';\nimport BorderPathAnimation from '../../../../ui/border-path-animation/border-path-animation';\nimport useContextMenuClickHandler from '../../../../ui/hooks/use-context-menu-click-handler';\nimport FlexView from '../../../../ui/layout/flex-view';\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, TEACHER_MENU_LABELS } from '../../../constants/node-constants';\nimport { getNodeTypeBasedBgImage } from '../../../utils';\nimport { getNodeCardBasedIcon } from '../../../utils/node-card-utils';\nimport * as Styled from '../node-card-styled';\nimport NodeCardTags from '../node-card-tags';\nimport NodeMenuOptions from '../node-menu-options/node-menu-options';\n\nconst renderSettings = { renderer: 'canvas', autoplay: false };\nconst { ASSIGN_AS_HW, REVIEW, VIEW, MARK_AS_DONE } = TEACHER_MENU_LABELS;\n\nconst TeacherActions: FC<Omit<INodeCardProps, 'userType'>> = memo(\n ({\n nodeData,\n imageHue,\n blockType,\n isSkipped,\n onNodeAttemptLocationChange,\n onNodeMarkAsDone,\n onNodeView,\n onNodeReview,\n }) => {\n const containerRef = useRef<HTMLDivElement>(null);\n const { menuVisible, onMenuClick } = useContextMenuClickHandler(containerRef);\n\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 user_attempt_id: userAttemptId,\n } = nodeData;\n\n const { lottie: nodeCardLottie } = getNodeCardBasedIcon(nodeType);\n const animationRef = useRef<ILottieAnimationRef | null>(null);\n\n const {\n can_change_attempt_location: canChangeAttemptLocation,\n can_mark_familiar: canMarkFamiliar,\n can_review: canReview,\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\n const showCardAnimation = !isOptional && (sheetInProgress || sheetNotStarted);\n\n const nodeBgImage = getNodeTypeBasedBgImage(nodeType);\n\n const handleOnMenuOptionClick = useCallback(\n (optionId: string) => {\n switch (optionId) {\n case 'node-card-view':\n if (canReview && userAttemptId) {\n onNodeReview?.(nodeData);\n } else {\n onNodeView?.(nodeData);\n }\n\n return;\n\n case 'node-card-assign-as-hw':\n onNodeAttemptLocationChange?.(nodeData);\n\n return;\n\n case 'node-card-mark-as-done':\n onNodeMarkAsDone?.(nodeData);\n\n return;\n default:\n throw new Error(`No callback function for ${optionId}`);\n }\n },\n [\n canReview,\n nodeData,\n onNodeAttemptLocationChange,\n onNodeMarkAsDone,\n onNodeReview,\n onNodeView,\n userAttemptId,\n ],\n );\n\n const handleOnMouseEnter = useCallback(() => {\n if (sheetLocked) return;\n animationRef.current?.play();\n }, [sheetLocked]);\n\n const handleOnMouseLeave = useCallback(() => {\n animationRef.current?.stop();\n }, []);\n\n const menuOptions: INodeMenuOption[] = [\n {\n id: 'node-card-view',\n label: canReview && userAttemptId ? REVIEW : VIEW,\n icon: Eye2Icon,\n disabled: false,\n onClick: handleOnMenuOptionClick,\n },\n {\n id: 'node-card-assign-as-hw',\n label: ASSIGN_AS_HW,\n icon: Home2Icon,\n disabled: !canChangeAttemptLocation || !inClassSheet,\n onClick: handleOnMenuOptionClick,\n },\n {\n id: 'node-card-mark-as-done',\n label: MARK_AS_DONE,\n icon: Check2Icon,\n disabled: !canMarkFamiliar,\n onClick: handleOnMenuOptionClick,\n },\n ];\n\n return (\n <Styled.NodeCardContainer\n $showOutline={!showCardAnimation}\n $isSheetLocked={sheetLocked}\n $background={`${imageHue}_2`}\n $disabled={Boolean(isSkipped)}\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 $width=\"100%\"\n $heightX={3.5}\n $bgImage={nodeBgImage}\n $gutterX={0.78125}\n $flexGap={8.5}\n onMouseEnter={handleOnMouseEnter}\n onMouseLeave={handleOnMouseLeave}\n >\n <Styled.IconWrapper\n $width={31}\n $height={31}\n $background=\"WHITE_1\"\n $position=\"relative\"\n $alignItems=\"center\"\n $justifyContent=\"center\"\n $opacity={sheetLocked ? 0.5 : 1}\n >\n <LottieAnimation src={nodeCardLottie} ref={animationRef} settings={renderSettings} />\n {!isOptional && <Styled.StyledImportantIcon />}\n </Styled.IconWrapper>\n\n <Text $renderAs=\"ac4-black\" $color=\"BLACK\" $opacity={sheetLocked ? 0.5 : 1}>\n {cardHeader} {inClassSheet && `• CW`}\n </Text>\n\n <FlexView className=\"context-menu\">\n {isGoalBlock && (\n <Styled.NodeKebabMenuWrapper ref={containerRef} onClick={onMenuClick}>\n <MoreVerticalIcon width={16} height={16} />\n </Styled.NodeKebabMenuWrapper>\n )}\n </FlexView>\n\n {showCardAnimation && !isSkipped && (\n <BorderPathAnimation borderColor=\"BLACK_1\" borderWidth={1} />\n )}\n </Styled.NodeCardInfoWrapper>\n\n <NodeCardTags nodeType={nodeType} state={state} accuracy={accuracy} />\n\n {!isGoalBlock && (\n <Styled.NodeCardContentWrapper\n $flexDirection=\"row\"\n $alignItems=\"center\"\n $background=\"WHITE_1\"\n $flexGap={8}\n $heightX={4}\n $justifyContent=\"space-between\"\n >\n <Styled.NodeCardTitle\n $renderAs=\"ab3\"\n $color=\"BLACK_1\"\n $opacity={sheetLocked ? 0.5 : 1}\n >\n {title}\n </Styled.NodeCardTitle>\n\n <Styled.NodeKebabMenuWrapper ref={containerRef} onClick={onMenuClick}>\n <MoreVerticalIcon width={16} height={16} />\n </Styled.NodeKebabMenuWrapper>\n </Styled.NodeCardContentWrapper>\n )}\n </ArrowTooltip>\n\n <Styled.NodeMenuOptionsWrapper $visible={menuVisible}>\n <NodeMenuOptions options={menuOptions} />\n </Styled.NodeMenuOptionsWrapper>\n </Styled.NodeCardContainer>\n );\n },\n);\n\nexport default TeacherActions;\n"],"names":["renderSettings","ASSIGN_AS_HW","REVIEW","VIEW","MARK_AS_DONE","TEACHER_MENU_LABELS","TeacherActions","memo","nodeData","imageHue","blockType","isSkipped","onNodeAttemptLocationChange","onNodeMarkAsDone","onNodeView","onNodeReview","containerRef","useRef","menuVisible","onMenuClick","useContextMenuClickHandler","accuracy","attemptLocation","nodeType","cardHeader","title","state","isOptional","sheetStatement","permissions","userAttemptId","nodeCardLottie","getNodeCardBasedIcon","animationRef","canChangeAttemptLocation","canMarkFamiliar","canReview","isGoalBlock","BLOCK_TYPE","sheetLocked","NODE_CARD_STATES","sheetNotStarted","sheetInProgress","inClassSheet","showCardAnimation","nodeBgImage","getNodeTypeBasedBgImage","handleOnMenuOptionClick","useCallback","optionId","handleOnMouseEnter","_a","handleOnMouseLeave","menuOptions","Eye2Icon","Home2Icon","Check2Icon","jsxs","Styled.NodeCardContainer","ArrowTooltip","Styled.NodeCardInfoWrapper","Styled.IconWrapper","jsx","LottieAnimation","Styled.StyledImportantIcon","Text","FlexView","Styled.NodeKebabMenuWrapper","MoreVerticalIcon","BorderPathAnimation","NodeCardTags","Styled.NodeCardContentWrapper","Styled.NodeCardTitle","Styled.NodeMenuOptionsWrapper","NodeMenuOptions"],"mappings":";;;;;;;;;;;;;;;;;;;AAyBA,MAAM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,gBAEnE,CAACgB,KACA,gBAAAoB;AAAA,kBAACc;AAAAA,kBAAA;AAAA,oBACC,gBAAe;AAAA,oBACf,aAAY;AAAA,oBACZ,aAAY;AAAA,oBACZ,UAAU;AAAA,oBACV,UAAU;AAAA,oBACV,iBAAgB;AAAA,oBAEhB,UAAA;AAAA,sBAAA,gBAAAT;AAAA,wBAACU;AAAAA,wBAAA;AAAA,0BACC,WAAU;AAAA,0BACV,QAAO;AAAA,0BACP,UAAUjC,IAAc,MAAM;AAAA,0BAE7B,UAAAd;AAAA,wBAAA;AAAA,sBACH;AAAA,sBAEC,gBAAAqC,EAAAK,GAAA,EAA4B,KAAKnD,GAAc,SAASG,GACvD,UAAA,gBAAA2C,EAACM,GAAiB,EAAA,OAAO,IAAI,QAAQ,GAAI,CAAA,GAC3C;AAAA,oBAAA;AAAA,kBAAA;AAAA,gBACF;AAAA,cAAA;AAAA,YAAA;AAAA,UAEJ;AAAA,UAEA,gBAAAN,EAACW,IAAA,EAA8B,UAAUvD,GACvC,UAAC,gBAAA4C,EAAAY,IAAA,EAAgB,SAASrB,EAAA,CAAa,EACzC,CAAA;AAAA,QAAA;AAAA,MAAA;AAAA,IAAA;AAAA,EAGN;AACF;"}
|
1
|
+
{"version":3,"file":"teacher-actions.js","sources":["../../../../../../src/features/chapters-v2/comps/node-card/teacher-actions/teacher-actions.tsx"],"sourcesContent":["import type { ILottieAnimationRef } from '../../../../ui/lottie-animation/types';\nimport type { INodeCardProps } from '../node-card-types';\nimport type { INodeMenuOption } from '../node-menu-options/node-menu-options-types';\nimport type { FC } from 'react';\n\nimport { memo, useCallback, useRef } from 'react';\n\nimport Check2Icon from '../../../../../assets/line-icons/icons/check2';\nimport Eye2Icon from '../../../../../assets/line-icons/icons/eye2';\nimport Home2Icon from '../../../../../assets/line-icons/icons/home2';\nimport MoreVerticalIcon from '../../../../../assets/line-icons/icons/more-vertical';\nimport ArrowTooltip from '../../../../ui/arrow-tooltip/arrow-tooltip';\nimport BorderPathAnimation from '../../../../ui/border-path-animation/border-path-animation';\nimport useContextMenuClickHandler from '../../../../ui/hooks/use-context-menu-click-handler';\nimport FlexView from '../../../../ui/layout/flex-view';\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, TEACHER_MENU_LABELS } from '../../../constants/node-constants';\nimport { getNodeTypeBasedBgImage } from '../../../utils';\nimport { getNodeCardBasedIcon } from '../../../utils/node-card-utils';\nimport * as Styled from '../node-card-styled';\nimport NodeCardTags from '../node-card-tags';\nimport NodeMenuOptions from '../node-menu-options/node-menu-options';\n\nconst renderSettings = { renderer: 'canvas', autoplay: false };\nconst { ASSIGN_AS_HW, REVIEW, VIEW, MARK_AS_DONE } = TEACHER_MENU_LABELS;\n\nconst TeacherActions: FC<Omit<INodeCardProps, 'userType'>> = memo(\n ({\n nodeData,\n imageHue,\n blockType,\n isSkipped,\n onNodeAttemptLocationChange,\n onNodeMarkAsDone,\n onNodeView,\n onNodeReview,\n }) => {\n const containerRef = useRef<HTMLDivElement>(null);\n const { menuVisible, onMenuClick } = useContextMenuClickHandler(containerRef);\n\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 user_attempt_id: userAttemptId,\n } = nodeData;\n\n const { lottie: nodeCardLottie } = getNodeCardBasedIcon(nodeType);\n const animationRef = useRef<ILottieAnimationRef | null>(null);\n\n const {\n can_mark_familiar: canMarkFamiliar,\n can_review: canReview,\n can_assign_as_homework: canAssignAsHw,\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\n const showCardAnimation = !isOptional && (sheetInProgress || sheetNotStarted);\n\n const nodeBgImage = getNodeTypeBasedBgImage(nodeType);\n\n const handleOnMenuOptionClick = useCallback(\n (optionId: string) => {\n switch (optionId) {\n case 'node-card-view':\n if (canReview && userAttemptId) {\n onNodeReview?.(nodeData);\n } else {\n onNodeView?.(nodeData);\n }\n\n return;\n\n case 'node-card-assign-as-hw':\n onNodeAttemptLocationChange?.(nodeData);\n\n return;\n\n case 'node-card-mark-as-done':\n onNodeMarkAsDone?.(nodeData);\n\n return;\n default:\n throw new Error(`No callback function for ${optionId}`);\n }\n },\n [\n canReview,\n nodeData,\n onNodeAttemptLocationChange,\n onNodeMarkAsDone,\n onNodeReview,\n onNodeView,\n userAttemptId,\n ],\n );\n\n const handleOnMouseEnter = useCallback(() => {\n if (sheetLocked) return;\n animationRef.current?.play();\n }, [sheetLocked]);\n\n const handleOnMouseLeave = useCallback(() => {\n animationRef.current?.stop();\n }, []);\n\n const menuOptions: INodeMenuOption[] = [\n {\n id: 'node-card-view',\n label: canReview && userAttemptId ? REVIEW : VIEW,\n icon: Eye2Icon,\n disabled: false,\n onClick: handleOnMenuOptionClick,\n },\n {\n id: 'node-card-assign-as-hw',\n label: ASSIGN_AS_HW,\n icon: Home2Icon,\n disabled: !canAssignAsHw,\n onClick: handleOnMenuOptionClick,\n },\n {\n id: 'node-card-mark-as-done',\n label: MARK_AS_DONE,\n icon: Check2Icon,\n disabled: !canMarkFamiliar,\n onClick: handleOnMenuOptionClick,\n },\n ];\n\n return (\n <Styled.NodeCardContainer\n $showOutline={!showCardAnimation}\n $isSheetLocked={sheetLocked}\n $background={`${imageHue}_2`}\n $disabled={Boolean(isSkipped)}\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 $width=\"100%\"\n $heightX={3.5}\n $bgImage={nodeBgImage}\n $gutterX={0.78125}\n $flexGap={8.5}\n onMouseEnter={handleOnMouseEnter}\n onMouseLeave={handleOnMouseLeave}\n >\n <Styled.IconWrapper\n $width={31}\n $height={31}\n $background=\"WHITE_1\"\n $position=\"relative\"\n $alignItems=\"center\"\n $justifyContent=\"center\"\n $opacity={sheetLocked ? 0.5 : 1}\n >\n <LottieAnimation src={nodeCardLottie} ref={animationRef} settings={renderSettings} />\n {!isOptional && <Styled.StyledImportantIcon />}\n </Styled.IconWrapper>\n\n <Text $renderAs=\"ac4-black\" $color=\"BLACK\" $opacity={sheetLocked ? 0.5 : 1}>\n {cardHeader} {inClassSheet && `• CW`}\n </Text>\n\n <FlexView className=\"context-menu\">\n {isGoalBlock && (\n <Styled.NodeKebabMenuWrapper ref={containerRef} onClick={onMenuClick}>\n <MoreVerticalIcon width={16} height={16} />\n </Styled.NodeKebabMenuWrapper>\n )}\n </FlexView>\n\n {showCardAnimation && !isSkipped && (\n <BorderPathAnimation borderColor=\"BLACK_1\" borderWidth={1} />\n )}\n </Styled.NodeCardInfoWrapper>\n\n <NodeCardTags nodeType={nodeType} state={state} accuracy={accuracy} />\n\n {!isGoalBlock && (\n <Styled.NodeCardContentWrapper\n $flexDirection=\"row\"\n $alignItems=\"center\"\n $background=\"WHITE_1\"\n $flexGap={8}\n $heightX={4}\n $justifyContent=\"space-between\"\n >\n <Styled.NodeCardTitle\n $renderAs=\"ab3\"\n $color=\"BLACK_1\"\n $opacity={sheetLocked ? 0.5 : 1}\n >\n {title}\n </Styled.NodeCardTitle>\n\n <Styled.NodeKebabMenuWrapper ref={containerRef} onClick={onMenuClick}>\n <MoreVerticalIcon width={16} height={16} />\n </Styled.NodeKebabMenuWrapper>\n </Styled.NodeCardContentWrapper>\n )}\n </ArrowTooltip>\n\n <Styled.NodeMenuOptionsWrapper $visible={menuVisible}>\n <NodeMenuOptions options={menuOptions} />\n </Styled.NodeMenuOptionsWrapper>\n </Styled.NodeCardContainer>\n );\n },\n);\n\nexport default TeacherActions;\n"],"names":["renderSettings","ASSIGN_AS_HW","REVIEW","VIEW","MARK_AS_DONE","TEACHER_MENU_LABELS","TeacherActions","memo","nodeData","imageHue","blockType","isSkipped","onNodeAttemptLocationChange","onNodeMarkAsDone","onNodeView","onNodeReview","containerRef","useRef","menuVisible","onMenuClick","useContextMenuClickHandler","accuracy","attemptLocation","nodeType","cardHeader","title","state","isOptional","sheetStatement","permissions","userAttemptId","nodeCardLottie","getNodeCardBasedIcon","animationRef","canMarkFamiliar","canReview","canAssignAsHw","isGoalBlock","BLOCK_TYPE","sheetLocked","NODE_CARD_STATES","sheetNotStarted","sheetInProgress","inClassSheet","showCardAnimation","nodeBgImage","getNodeTypeBasedBgImage","handleOnMenuOptionClick","useCallback","optionId","handleOnMouseEnter","_a","handleOnMouseLeave","menuOptions","Eye2Icon","Home2Icon","Check2Icon","jsxs","Styled.NodeCardContainer","ArrowTooltip","Styled.NodeCardInfoWrapper","Styled.IconWrapper","jsx","LottieAnimation","Styled.StyledImportantIcon","Text","FlexView","Styled.NodeKebabMenuWrapper","MoreVerticalIcon","BorderPathAnimation","NodeCardTags","Styled.NodeCardContentWrapper","Styled.NodeCardTitle","Styled.NodeMenuOptionsWrapper","NodeMenuOptions"],"mappings":";;;;;;;;;;;;;;;;;;;AAyBA,MAAMA,KAAiB,EAAE,UAAU,UAAU,UAAU,GAAM,GACvD,EAAE,cAAAC,IAAc,QAAAC,IAAQ,MAAAC,IAAM,cAAAC,OAAiBC,IAE/CC,KAAuDC;AAAA,EAC3D,CAAC;AAAA,IACC,UAAAC;AAAA,IACA,UAAAC;AAAA,IACA,WAAAC;AAAA,IACA,WAAAC;AAAA,IACA,6BAAAC;AAAA,IACA,kBAAAC;AAAA,IACA,YAAAC;AAAA,IACA,cAAAC;AAAA,EAAA,MACI;AACE,UAAAC,IAAeC,EAAuB,IAAI,GAC1C,EAAE,aAAAC,GAAa,aAAAC,EAAY,IAAIC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KAAKnD,GAAc,SAASG,GACvD,UAAA,gBAAA2C,EAACM,GAAiB,EAAA,OAAO,IAAI,QAAQ,GAAI,CAAA,GAC3C;AAAA,oBAAA;AAAA,kBAAA;AAAA,gBACF;AAAA,cAAA;AAAA,YAAA;AAAA,UAEJ;AAAA,UAEA,gBAAAN,EAACW,IAAA,EAA8B,UAAUvD,GACvC,UAAC,gBAAA4C,EAAAY,IAAA,EAAgB,SAASrB,EAAA,CAAa,EACzC,CAAA;AAAA,QAAA;AAAA,MAAA;AAAA,IAAA;AAAA,EAGN;AACF;"}
|
@@ -1,7 +1,6 @@
|
|
1
1
|
import o from "styled-components";
|
2
|
-
import {
|
3
|
-
|
4
|
-
const s = o.div`
|
2
|
+
import { HEADER_HEIGHT as t } from "./constants.js";
|
3
|
+
const n = o.div`
|
5
4
|
display: flex;
|
6
5
|
flex-direction: column;
|
7
6
|
height: 100%;
|
@@ -9,15 +8,15 @@ const s = o.div`
|
|
9
8
|
background: ${({ theme: i }) => i.colors.BLACK_1};
|
10
9
|
position: relative;
|
11
10
|
width: inherit;
|
12
|
-
`,
|
13
|
-
height: ${
|
11
|
+
`, d = o.div`
|
12
|
+
height: ${t}px;
|
14
13
|
padding-top: ${(window.ReactNativeTopInset || 0) + 24}px;
|
15
14
|
width: 100%;
|
16
15
|
background: ${({ theme: i }) => i.colors.WHITE_T_03};
|
17
16
|
backdrop-filter: blur(40px);
|
18
17
|
position: relative;
|
19
18
|
flex-shrink: 0;
|
20
|
-
`,
|
19
|
+
`, s = o.div`
|
21
20
|
position: absolute;
|
22
21
|
right: 16px;
|
23
22
|
top: ${(window.ReactNativeTopInset || 0) + 22}px;
|
@@ -26,13 +25,13 @@ const s = o.div`
|
|
26
25
|
background: ${({ theme: i }) => i.colors.BLACK_4};
|
27
26
|
cursor: pointer;
|
28
27
|
}
|
29
|
-
`,
|
28
|
+
`, a = o.div`
|
30
29
|
display: flex;
|
31
30
|
flex-direction: column;
|
32
31
|
/* overflow: hidden; */
|
33
32
|
flex-grow: 1;
|
34
33
|
position: relative;
|
35
|
-
`,
|
34
|
+
`, p = o.div`
|
36
35
|
width: 100%;
|
37
36
|
position: absolute;
|
38
37
|
top: 0;
|
@@ -40,20 +39,20 @@ const s = o.div`
|
|
40
39
|
bottom: 0;
|
41
40
|
right: 0;
|
42
41
|
& video {
|
43
|
-
height:
|
42
|
+
height: 100%;
|
44
43
|
width: 100%;
|
45
44
|
}
|
46
|
-
`,
|
45
|
+
`, l = o.div`
|
47
46
|
height: 40px;
|
48
47
|
width: 100%;
|
49
48
|
position: relative;
|
50
49
|
display: flex;
|
51
|
-
`,
|
50
|
+
`, h = o.div`
|
52
51
|
height: 2px;
|
53
52
|
position: relative;
|
54
53
|
width: 100%;
|
55
54
|
z-index: 1;
|
56
|
-
`,
|
55
|
+
`, c = o.div`
|
57
56
|
height: inherit;
|
58
57
|
background: ${({ theme: i }) => i.colors.WHITE};
|
59
58
|
position: absolute;
|
@@ -62,13 +61,13 @@ const s = o.div`
|
|
62
61
|
transition: width 0.4s linear;
|
63
62
|
`;
|
64
63
|
export {
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
64
|
+
a as GameTutorialContainer,
|
65
|
+
d as GameTutorialHeader,
|
66
|
+
n as GameTutorialWrapper,
|
67
|
+
s as HeaderIconContainer,
|
68
|
+
p as VideoContainer,
|
69
|
+
c as VideoProgress,
|
70
|
+
h as VideoProgressContainer,
|
71
|
+
l as VideoProgressWrapper
|
73
72
|
};
|
74
73
|
//# sourceMappingURL=tutorial-styled.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"tutorial-styled.js","sources":["../../../../../src/features/circle-games/games/tutorial/tutorial-styled.tsx"],"sourcesContent":["import styled from 'styled-components';\n\nimport {
|
1
|
+
{"version":3,"file":"tutorial-styled.js","sources":["../../../../../src/features/circle-games/games/tutorial/tutorial-styled.tsx"],"sourcesContent":["import styled from 'styled-components';\n\nimport { HEADER_HEIGHT } from './constants';\n\nexport const GameTutorialWrapper = styled.div`\n display: flex;\n flex-direction: column;\n height: 100%;\n min-height: 250px;\n background: ${({ theme }) => theme.colors.BLACK_1};\n position: relative;\n width: inherit;\n`;\n\nexport const GameTutorialHeader = styled.div`\n height: ${HEADER_HEIGHT}px;\n padding-top: ${(window.ReactNativeTopInset || 0) + 24}px;\n width: 100%;\n background: ${({ theme }) => theme.colors.WHITE_T_03};\n backdrop-filter: blur(40px);\n position: relative;\n flex-shrink: 0;\n`;\n\nexport const HeaderIconContainer = styled.div`\n position: absolute;\n right: 16px;\n top: ${(window.ReactNativeTopInset || 0) + 22}px;\n z-index: 1;\n &:hover {\n background: ${({ theme }) => theme.colors.BLACK_4};\n cursor: pointer;\n }\n`;\n\nexport const GameTutorialContainer = styled.div`\n display: flex;\n flex-direction: column;\n /* overflow: hidden; */\n flex-grow: 1;\n position: relative;\n`;\n\nexport const VideoContainer = styled.div`\n width: 100%;\n position: absolute;\n top: 0;\n left: 0;\n bottom: 0;\n right: 0;\n & video {\n height: 100%;\n width: 100%;\n }\n`;\n\nexport const VideoProgressWrapper = styled.div`\n height: 40px;\n width: 100%;\n position: relative;\n display: flex;\n`;\n\nexport const VideoProgressContainer = styled.div`\n height: 2px;\n position: relative;\n width: 100%;\n z-index: 1;\n`;\n\nexport const VideoProgress = styled.div<{ $width: number }>`\n height: inherit;\n background: ${({ theme }) => theme.colors.WHITE};\n position: absolute;\n z-index: 2;\n width: ${({ $width }) => $width || 0}%;\n transition: width 0.4s linear;\n`;\n"],"names":["GameTutorialWrapper","styled","theme","GameTutorialHeader","HEADER_HEIGHT","HeaderIconContainer","GameTutorialContainer","VideoContainer","VideoProgressWrapper","VideoProgressContainer","VideoProgress","$width"],"mappings":";;AAIO,MAAMA,IAAsBC,EAAO;AAAA;AAAA;AAAA;AAAA;AAAA,gBAK1B,CAAC,EAAE,OAAAC,EAAA,MAAYA,EAAM,OAAO,OAAO;AAAA;AAAA;AAAA,GAKtCC,IAAqBF,EAAO;AAAA,YAC7BG,CAAa;AAAA,kBACP,OAAO,uBAAuB,KAAK,EAAE;AAAA;AAAA,gBAEvC,CAAC,EAAE,OAAAF,EAAA,MAAYA,EAAM,OAAO,UAAU;AAAA;AAAA;AAAA;AAAA,GAMzCG,IAAsBJ,EAAO;AAAA;AAAA;AAAA,UAGhC,OAAO,uBAAuB,KAAK,EAAE;AAAA;AAAA;AAAA,kBAG7B,CAAC,EAAE,OAAAC,EAAA,MAAYA,EAAM,OAAO,OAAO;AAAA;AAAA;AAAA,GAKxCI,IAAwBL,EAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,GAQ/BM,IAAiBN,EAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,GAaxBO,IAAuBP,EAAO;AAAA;AAAA;AAAA;AAAA;AAAA,GAO9BQ,IAAyBR,EAAO;AAAA;AAAA;AAAA;AAAA;AAAA,GAOhCS,IAAgBT,EAAO;AAAA;AAAA,gBAEpB,CAAC,EAAE,OAAAC,EAAA,MAAYA,EAAM,OAAO,KAAK;AAAA;AAAA;AAAA,WAGtC,CAAC,EAAE,QAAAS,QAAaA,KAAU,CAAC;AAAA;AAAA;"}
|
@@ -1,49 +1,44 @@
|
|
1
|
-
import { jsxs as
|
2
|
-
import { useState as
|
3
|
-
import
|
4
|
-
import
|
5
|
-
import {
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
onCross: t,
|
1
|
+
import { jsxs as a, jsx as r } from "react/jsx-runtime";
|
2
|
+
import { useState as l, useRef as f, useCallback as h } from "react";
|
3
|
+
import g from "../../../../assets/line-icons/icons/cross.js";
|
4
|
+
import C from "../../../ui/text/text.js";
|
5
|
+
import { GameTutorialWrapper as I, GameTutorialHeader as V, HeaderIconContainer as x, GameTutorialContainer as T, VideoContainer as $, VideoProgressWrapper as G, VideoProgressContainer as H, VideoProgress as P } from "./tutorial-styled.js";
|
6
|
+
const E = ({
|
7
|
+
src: d,
|
8
|
+
title: t,
|
9
|
+
onCross: o,
|
11
10
|
showProgress: m = !0,
|
12
|
-
onTutorialPlayedOnce: e
|
13
|
-
isJourneyActive: n
|
11
|
+
onTutorialPlayedOnce: e
|
14
12
|
}) => {
|
15
|
-
const [
|
16
|
-
(
|
17
|
-
const c = (
|
18
|
-
c >= 90 && !
|
13
|
+
const [i, u] = l(0), s = f(!1), p = h(
|
14
|
+
(n) => {
|
15
|
+
const c = (n.target.currentTime || 0) / (n.target.duration || 1) * 100;
|
16
|
+
c >= 90 && !s.current && (s.current = !0, e == null || e()), u(c);
|
19
17
|
},
|
20
18
|
[e]
|
21
19
|
);
|
22
|
-
return /* @__PURE__ */
|
23
|
-
(
|
24
|
-
|
25
|
-
|
20
|
+
return /* @__PURE__ */ a(I, { children: [
|
21
|
+
(t || o) && /* @__PURE__ */ a(V, { children: [
|
22
|
+
t && /* @__PURE__ */ r(C, { $renderAs: "ac3", $color: "WHITE", $align: "center", children: t }),
|
23
|
+
o && /* @__PURE__ */ r(x, { children: /* @__PURE__ */ r(g, { color: "#fff", onClick: o }) })
|
26
24
|
] }),
|
27
|
-
/* @__PURE__ */ r(
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
)
|
42
|
-
] }) }),
|
43
|
-
m && /* @__PURE__ */ r(E, { children: /* @__PURE__ */ r(H, { children: s > 0 && /* @__PURE__ */ r(W, { $width: s }) }) })
|
25
|
+
/* @__PURE__ */ r(T, { children: /* @__PURE__ */ r($, { children: /* @__PURE__ */ r(
|
26
|
+
"video",
|
27
|
+
{
|
28
|
+
loop: !0,
|
29
|
+
autoPlay: !0,
|
30
|
+
muted: !0,
|
31
|
+
src: d,
|
32
|
+
onTimeUpdate: p,
|
33
|
+
disablePictureInPicture: !0,
|
34
|
+
itemType: "video/mp4",
|
35
|
+
playsInline: !0
|
36
|
+
}
|
37
|
+
) }) }),
|
38
|
+
m && /* @__PURE__ */ r(G, { children: /* @__PURE__ */ r(H, { children: i > 0 && /* @__PURE__ */ r(P, { $width: i }) }) })
|
44
39
|
] });
|
45
40
|
};
|
46
41
|
export {
|
47
|
-
|
42
|
+
E as Tutorial
|
48
43
|
};
|
49
44
|
//# sourceMappingURL=tutorial.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"tutorial.js","sources":["../../../../../src/features/circle-games/games/tutorial/tutorial.tsx"],"sourcesContent":["import type { ITutorialProps } from './tutorial-types';\nimport type { ChangeEvent } from 'react';\n\nimport { useCallback, useRef, useState } from 'react';\n\nimport CrossIcon from '../../../../assets/line-icons/icons/cross';\nimport Text from '../../../ui/text/text';\nimport
|
1
|
+
{"version":3,"file":"tutorial.js","sources":["../../../../../src/features/circle-games/games/tutorial/tutorial.tsx"],"sourcesContent":["import type { ITutorialProps } from './tutorial-types';\nimport type { ChangeEvent } from 'react';\n\nimport { useCallback, useRef, useState } from 'react';\n\nimport CrossIcon from '../../../../assets/line-icons/icons/cross';\nimport Text from '../../../ui/text/text';\nimport * as Styled from './tutorial-styled';\n\nexport const Tutorial = ({\n src,\n title,\n onCross,\n showProgress = true,\n onTutorialPlayedOnce,\n}: ITutorialProps) => {\n const [progress, setProgress] = useState(0);\n const hasVideoEnded = useRef(false);\n\n const onProgress = useCallback(\n (e: ChangeEvent<HTMLVideoElement>) => {\n const p = ((e.target.currentTime || 0) / (e.target.duration || 1)) * 100;\n\n if (p >= 90 && !hasVideoEnded.current) {\n hasVideoEnded.current = true;\n onTutorialPlayedOnce?.();\n }\n\n setProgress(p);\n },\n [onTutorialPlayedOnce],\n );\n\n return (\n <Styled.GameTutorialWrapper>\n {(title || onCross) && (\n <Styled.GameTutorialHeader>\n {title && (\n <Text $renderAs=\"ac3\" $color=\"WHITE\" $align=\"center\">\n {title}\n </Text>\n )}\n {onCross && (\n <Styled.HeaderIconContainer>\n <CrossIcon color=\"#fff\" onClick={onCross} />\n </Styled.HeaderIconContainer>\n )}\n </Styled.GameTutorialHeader>\n )}\n\n <Styled.GameTutorialContainer>\n <Styled.VideoContainer>\n <video\n loop={true}\n autoPlay={true}\n muted={true}\n src={src}\n onTimeUpdate={onProgress}\n disablePictureInPicture={true}\n itemType=\"video/mp4\"\n playsInline\n />\n </Styled.VideoContainer>\n </Styled.GameTutorialContainer>\n\n {showProgress && (\n <Styled.VideoProgressWrapper>\n <Styled.VideoProgressContainer>\n {progress > 0 && <Styled.VideoProgress $width={progress} />}\n </Styled.VideoProgressContainer>\n </Styled.VideoProgressWrapper>\n )}\n </Styled.GameTutorialWrapper>\n );\n};\n"],"names":["Tutorial","src","title","onCross","showProgress","onTutorialPlayedOnce","progress","setProgress","useState","hasVideoEnded","useRef","onProgress","useCallback","e","p","jsxs","Styled.GameTutorialWrapper","Styled.GameTutorialHeader","jsx","Text","Styled.HeaderIconContainer","CrossIcon","Styled.GameTutorialContainer","Styled.VideoContainer","Styled.VideoProgressWrapper","Styled.VideoProgressContainer","Styled.VideoProgress"],"mappings":";;;;;AASO,MAAMA,IAAW,CAAC;AAAA,EACvB,KAAAC;AAAA,EACA,OAAAC;AAAA,EACA,SAAAC;AAAA,EACA,cAAAC,IAAe;AAAA,EACf,sBAAAC;AACF,MAAsB;AACpB,QAAM,CAACC,GAAUC,CAAW,IAAIC,EAAS,CAAC,GACpCC,IAAgBC,EAAO,EAAK,GAE5BC,IAAaC;AAAA,IACjB,CAACC,MAAqC;AAC9B,YAAAC,KAAMD,EAAE,OAAO,eAAe,MAAMA,EAAE,OAAO,YAAY,KAAM;AAErE,MAAIC,KAAK,MAAM,CAACL,EAAc,YAC5BA,EAAc,UAAU,IACDJ,KAAA,QAAAA,MAGzBE,EAAYO,CAAC;AAAA,IACf;AAAA,IACA,CAACT,CAAoB;AAAA,EAAA;AAIrB,SAAA,gBAAAU,EAACC,GAAA,EACG,UAAA;AAAA,KAAAd,KAASC,MACT,gBAAAY,EAACE,GAAA,EACE,UAAA;AAAA,MACCf,KAAA,gBAAAgB,EAACC,KAAK,WAAU,OAAM,QAAO,SAAQ,QAAO,UACzC,UACHjB,EAAA,CAAA;AAAA,MAEDC,KACE,gBAAAe,EAAAE,GAAA,EACC,UAAC,gBAAAF,EAAAG,GAAA,EAAU,OAAM,QAAO,SAASlB,EAAA,CAAS,EAC5C,CAAA;AAAA,IAAA,GAEJ;AAAA,sBAGDmB,GAAA,EACC,UAAC,gBAAAJ,EAAAK,GAAA,EACC,UAAA,gBAAAL;AAAA,MAAC;AAAA,MAAA;AAAA,QACC,MAAM;AAAA,QACN,UAAU;AAAA,QACV,OAAO;AAAA,QACP,KAAAjB;AAAA,QACA,cAAcU;AAAA,QACd,yBAAyB;AAAA,QACzB,UAAS;AAAA,QACT,aAAW;AAAA,MAAA;AAAA,OAEf,EACF,CAAA;AAAA,IAECP,KACE,gBAAAc,EAAAM,GAAA,EACC,UAAA,gBAAAN,EAACO,GAAA,EACE,UAAWnB,IAAA,uBAAMoB,GAAA,EAAqB,QAAQpB,EAAU,CAAA,EAC3D,CAAA,GACF;AAAA,EAEJ,EAAA,CAAA;AAEJ;"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"info-bar-styled.js","sources":["../../../../../../src/features/circle-games/leaderboard/comps/info-bar/info-bar-styled.tsx"],"sourcesContent":["import styled from 'styled-components';\n\nimport FlexView from '../../../../ui/layout/flex-view';\n\nexport const InfoBarWrapper = styled(FlexView)`\n padding: 16px;\n margin: 16px;\n border-width: 1px;\n border-style: solid;\n`;\n"],"names":["InfoBarWrapper","styled","FlexView"],"mappings":";;AAIa,MAAAA,IAAiBC,EAAOC,CAAQ;AAAA;AAAA;AAAA;AAAA;AAAA;"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"info-bar.js","sources":["../../../../../../src/features/circle-games/leaderboard/comps/info-bar/info-bar.tsx"],"sourcesContent":["import type { TColorNames, THueNames } from '../../../../ui/types';\nimport type { IInfoBarProps } from './info-bar-types';\n\nimport { useMemo } from 'react';\n\nimport * as Styled from './info-bar-styled';\n\nconst computeColorsFromHue = (\n hue: THueNames,\n): { backgroundColor: TColorNames; borderColor: TColorNames } => {\n return { backgroundColor: `${hue}_6`, borderColor: `${hue}_4` };\n};\n\nexport const InfoBar: React.FC<IInfoBarProps> = ({ children, hue }) => {\n const { backgroundColor, borderColor } = useMemo(() => computeColorsFromHue(hue), [hue]);\n\n return (\n <Styled.InfoBarWrapper $background={backgroundColor} $borderColor={borderColor}>\n {children}\n </Styled.InfoBarWrapper>\n );\n};\n"],"names":["computeColorsFromHue","hue","InfoBar","children","backgroundColor","borderColor","useMemo","jsx","Styled.InfoBarWrapper"],"mappings":";;;AAOA,MAAMA,IAAuB,CAC3BC,OAEO,EAAE,iBAAiB,GAAGA,CAAG,MAAM,aAAa,GAAGA,CAAG,SAG9CC,IAAmC,CAAC,EAAE,UAAAC,GAAU,KAAAF,QAAU;AAC/D,QAAA,EAAE,iBAAAG,GAAiB,aAAAC,EAAA,IAAgBC,EAAQ,MAAMN,EAAqBC,CAAG,GAAG,CAACA,CAAG,CAAC;AAGrF,SAAA,gBAAAM,EAACC,GAAA,EAAsB,aAAaJ,GAAiB,cAAcC,GAChE,UAAAF,EACH,CAAA;AAEJ;"}
|
@@ -3,8 +3,8 @@ import { useState as u, useCallback as h } from "react";
|
|
3
3
|
import I from "../../../../../assets/line-icons/icons/cross.js";
|
4
4
|
import i from "../../../../ui/layout/flex-view.js";
|
5
5
|
import o from "../../../../ui/text/text.js";
|
6
|
-
import { InfoBar as k } from "../../../comps/info-bar/info-bar.js";
|
7
6
|
import { StreakReductionLocalStorageUtil as c } from "../../../utils/streak-reduction-localstorage-util.js";
|
7
|
+
import { InfoBar as k } from "../info-bar/info-bar.js";
|
8
8
|
import { STREAK_REDUCTION_LEADERBOARD_INFOBAR_TIMESTAMP as a } from "./streak-reduction-infobar-constants.js";
|
9
9
|
const T = ({
|
10
10
|
startTimestampToday: e,
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"streak-reduction-infobar.js","sources":["../../../../../../src/features/circle-games/leaderboard/comps/streak-reduction-infobar/streak-reduction-infobar.tsx"],"sourcesContent":["import type { IStreakReductionLeaderboard } from './streak-reduction-infobar-types';\n\nimport { useCallback, useState } from 'react';\n\nimport CrossIcon from '../../../../../assets/line-icons/icons/cross';\nimport FlexView from '../../../../ui/layout/flex-view';\nimport Text from '../../../../ui/text/text';\nimport {
|
1
|
+
{"version":3,"file":"streak-reduction-infobar.js","sources":["../../../../../../src/features/circle-games/leaderboard/comps/streak-reduction-infobar/streak-reduction-infobar.tsx"],"sourcesContent":["import type { IStreakReductionLeaderboard } from './streak-reduction-infobar-types';\n\nimport { useCallback, useState } from 'react';\n\nimport CrossIcon from '../../../../../assets/line-icons/icons/cross';\nimport FlexView from '../../../../ui/layout/flex-view';\nimport Text from '../../../../ui/text/text';\nimport { StreakReductionLocalStorageUtil } from '../../../utils/streak-reduction-localstorage-util';\nimport { InfoBar } from '../info-bar/info-bar';\nimport { STREAK_REDUCTION_LEADERBOARD_INFOBAR_TIMESTAMP } from './streak-reduction-infobar-constants';\n\nexport const StreakReductionInfoBar = ({\n startTimestampToday,\n streakReduction,\n}: IStreakReductionLeaderboard) => {\n const [showInfoBar, setShowInfoBar] = useState(\n StreakReductionLocalStorageUtil.showStreakReduction(\n STREAK_REDUCTION_LEADERBOARD_INFOBAR_TIMESTAMP,\n startTimestampToday,\n ),\n );\n\n const hasStreakReduced = streakReduction > 0;\n\n const onInfoBarClose = useCallback(() => {\n StreakReductionLocalStorageUtil.markStreakReductionDismissed(\n STREAK_REDUCTION_LEADERBOARD_INFOBAR_TIMESTAMP,\n startTimestampToday,\n );\n setShowInfoBar(false);\n }, [startTimestampToday]);\n\n if (!showInfoBar) {\n return null;\n }\n\n return (\n <InfoBar\n children={\n <FlexView $flexDirection=\"row\" $alignItems=\"center\" $justifyContent=\"space-between\">\n <FlexView>\n {hasStreakReduced ? (\n <>\n <Text $renderAs=\"ab2\" $color=\"WHITE_T_87\">\n Keep building your streak by completing an activity each day.\n </Text>\n <Text $renderAs=\"ab2\" $color=\"WHITE_T_87\">\n For each day missed, your streak reduces by 1.\n </Text>\n </>\n ) : (\n <Text $renderAs=\"ab2\" $color=\"WHITE_T_87\">\n Streak saved for the day! Come back tomorrow to keep increasing it.\n </Text>\n )}\n </FlexView>\n\n <CrossIcon cursor={'pointer'} color=\"WHITE\" onClick={onInfoBarClose} />\n </FlexView>\n }\n hue={hasStreakReduced ? 'YELLOW' : 'GREEN'}\n />\n );\n};\n"],"names":["StreakReductionInfoBar","startTimestampToday","streakReduction","showInfoBar","setShowInfoBar","useState","StreakReductionLocalStorageUtil","STREAK_REDUCTION_LEADERBOARD_INFOBAR_TIMESTAMP","hasStreakReduced","onInfoBarClose","useCallback","jsx","InfoBar","FlexView","jsxs","Fragment","Text","CrossIcon"],"mappings":";;;;;;;;AAWO,MAAMA,IAAyB,CAAC;AAAA,EACrC,qBAAAC;AAAA,EACA,iBAAAC;AACF,MAAmC;AAC3B,QAAA,CAACC,GAAaC,CAAc,IAAIC;AAAA,IACpCC,EAAgC;AAAA,MAC9BC;AAAA,MACAN;AAAA,IACF;AAAA,EAAA,GAGIO,IAAmBN,IAAkB,GAErCO,IAAiBC,EAAY,MAAM;AACP,IAAAJ,EAAA;AAAA,MAC9BC;AAAA,MACAN;AAAA,IAAA,GAEFG,EAAe,EAAK;AAAA,EAAA,GACnB,CAACH,CAAmB,CAAC;AAExB,SAAKE,IAKH,gBAAAQ;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,4BACGC,GAAS,EAAA,gBAAe,OAAM,aAAY,UAAS,iBAAgB,iBAClE,UAAA;AAAA,QAAC,gBAAAF,EAAAE,GAAA,EACE,cAEG,gBAAAC,EAAAC,GAAA,EAAA,UAAA;AAAA,UAAA,gBAAAJ,EAACK,GAAK,EAAA,WAAU,OAAM,QAAO,cAAa,UAE1C,iEAAA;AAAA,4BACCA,GAAK,EAAA,WAAU,OAAM,QAAO,cAAa,UAE1C,kDAAA;AAAA,QACF,EAAA,CAAA,sBAECA,GAAK,EAAA,WAAU,OAAM,QAAO,cAAa,iFAE1C,EAEJ,CAAA;AAAA,0BAECC,GAAU,EAAA,QAAQ,WAAW,OAAM,SAAQ,SAASR,GAAgB;AAAA,MAAA,GACvE;AAAA,MAEF,KAAKD,IAAmB,WAAW;AAAA,IAAA;AAAA,EAAA,IA3B9B;AA8BX;"}
|
@@ -1,30 +1,35 @@
|
|
1
|
-
import { jsx as r, jsxs as
|
2
|
-
import { memo as
|
3
|
-
import
|
4
|
-
import u from "../../../../../../ui/
|
5
|
-
import
|
6
|
-
import
|
7
|
-
|
1
|
+
import { jsx as r, jsxs as b } from "react/jsx-runtime";
|
2
|
+
import { memo as $, useCallback as T } from "react";
|
3
|
+
import { NODE_TYPE as l } from "../../../../../../sheets/constants/sheet.js";
|
4
|
+
import u from "../../../../../../ui/arrow-tooltip/arrow-tooltip.js";
|
5
|
+
import f from "../../../../../../ui/image/image.js";
|
6
|
+
import C from "../../../../../../ui/layout/flex-view.js";
|
7
|
+
import { ChapterItemWrapper as E, StyledText as g } from "./chapter-item-styled.js";
|
8
|
+
const y = $(({ chapter: m, selected: t, onChapterSelection: o }) => {
|
8
9
|
const {
|
9
|
-
image_url:
|
10
|
-
name:
|
11
|
-
id:
|
12
|
-
|
13
|
-
item_bank_enabled:
|
14
|
-
} =
|
10
|
+
image_url: s,
|
11
|
+
name: i,
|
12
|
+
id: a,
|
13
|
+
blocks: d,
|
14
|
+
item_bank_enabled: p
|
15
|
+
} = m, h = d.some(
|
16
|
+
(_) => _.sheets.some(
|
17
|
+
(n) => n.node_type === l.ASSESSMENT || n.node_type === l.CHAPTER_ASSESSMENT
|
18
|
+
)
|
19
|
+
), e = !p && !h, c = T(() => {
|
15
20
|
if (e) return null;
|
16
|
-
o(
|
17
|
-
}, [o,
|
21
|
+
o(a);
|
22
|
+
}, [o, a, e]);
|
18
23
|
return /* @__PURE__ */ r(
|
19
|
-
|
24
|
+
u,
|
20
25
|
{
|
21
26
|
position: "bottom",
|
22
27
|
renderAs: "primary",
|
23
28
|
tooltipItem: "Chapter unavailable for test creation",
|
24
29
|
hidden: !e,
|
25
30
|
widthX: 9.5,
|
26
|
-
children: /* @__PURE__ */
|
27
|
-
|
31
|
+
children: /* @__PURE__ */ b(
|
32
|
+
E,
|
28
33
|
{
|
29
34
|
$widthX: 9.5,
|
30
35
|
$heightX: 8.875,
|
@@ -36,13 +41,13 @@ const k = c(({ chapter: l, selected: t, onChapterSelection: o }) => {
|
|
36
41
|
$disabled: e,
|
37
42
|
$borderColor: t ? "BLACK_T_87" : "WHITE_5",
|
38
43
|
$background: t ? "WHITE_3" : "WHITE_1",
|
39
|
-
onClick:
|
44
|
+
onClick: c,
|
40
45
|
children: [
|
41
|
-
/* @__PURE__ */ r(
|
42
|
-
|
46
|
+
/* @__PURE__ */ r(C, { $position: "relative", children: /* @__PURE__ */ r(
|
47
|
+
f,
|
43
48
|
{
|
44
|
-
src:
|
45
|
-
alt:
|
49
|
+
src: s || "",
|
50
|
+
alt: i,
|
46
51
|
withLoader: !0,
|
47
52
|
width: 56,
|
48
53
|
height: 56,
|
@@ -50,12 +55,12 @@ const k = c(({ chapter: l, selected: t, onChapterSelection: o }) => {
|
|
50
55
|
}
|
51
56
|
) }),
|
52
57
|
/* @__PURE__ */ r(
|
53
|
-
|
58
|
+
g,
|
54
59
|
{
|
55
60
|
$renderAs: t ? "ab3-bold" : "ab3",
|
56
61
|
$align: "center",
|
57
62
|
$color: e ? "BLACK_T_38" : "BLACK_T_87",
|
58
|
-
children:
|
63
|
+
children: i
|
59
64
|
}
|
60
65
|
)
|
61
66
|
]
|
@@ -65,6 +70,6 @@ const k = c(({ chapter: l, selected: t, onChapterSelection: o }) => {
|
|
65
70
|
);
|
66
71
|
});
|
67
72
|
export {
|
68
|
-
|
73
|
+
y as default
|
69
74
|
};
|
70
75
|
//# sourceMappingURL=chapter-item.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"chapter-item.js","sources":["../../../../../../../../src/features/milestone/milestone-tests/tests-creation/test-stages/chapter-selection/chapter-item/chapter-item.tsx"],"sourcesContent":["import type { IChapterItem } from './chapter-item-types';\nimport type { FC } from 'react';\n\nimport { useCallback, memo } from 'react';\n\nimport ArrowTooltip from '../../../../../../ui/arrow-tooltip/arrow-tooltip';\nimport Image from '../../../../../../ui/image/image';\nimport FlexView from '../../../../../../ui/layout/flex-view';\nimport * as Styled from './chapter-item-styled';\n\nconst ChapterItem: FC<IChapterItem> = memo(({ chapter, selected, onChapterSelection }) => {\n const {\n image_url: imageUrl,\n name,\n id: userChapterId,\n
|
1
|
+
{"version":3,"file":"chapter-item.js","sources":["../../../../../../../../src/features/milestone/milestone-tests/tests-creation/test-stages/chapter-selection/chapter-item/chapter-item.tsx"],"sourcesContent":["import type { IChapterItem } from './chapter-item-types';\nimport type { FC } from 'react';\n\nimport { useCallback, memo } from 'react';\n\nimport { NODE_TYPE } from '../../../../../../sheets/constants/sheet';\nimport ArrowTooltip from '../../../../../../ui/arrow-tooltip/arrow-tooltip';\nimport Image from '../../../../../../ui/image/image';\nimport FlexView from '../../../../../../ui/layout/flex-view';\nimport * as Styled from './chapter-item-styled';\n\nconst ChapterItem: FC<IChapterItem> = memo(({ chapter, selected, onChapterSelection }) => {\n const {\n image_url: imageUrl,\n name,\n id: userChapterId,\n blocks,\n item_bank_enabled: itemBankEnabled,\n } = chapter;\n const hasTestSheets = blocks.some(block =>\n block.sheets.some(\n sheet =>\n sheet.node_type === NODE_TYPE.ASSESSMENT ||\n sheet.node_type === NODE_TYPE.CHAPTER_ASSESSMENT,\n ),\n );\n\n const isDisabled = !itemBankEnabled && !hasTestSheets;\n\n const handleOnChapterSelection = useCallback(() => {\n if (isDisabled) return null;\n\n onChapterSelection(userChapterId);\n }, [onChapterSelection, userChapterId, isDisabled]);\n\n return (\n <ArrowTooltip\n position=\"bottom\"\n renderAs=\"primary\"\n tooltipItem=\"Chapter unavailable for test creation\"\n hidden={!isDisabled}\n widthX={9.5}\n >\n <Styled.ChapterItemWrapper\n $widthX={9.5}\n $heightX={8.875}\n $gapX={1}\n $gutterX={1}\n $flexGap={12}\n $position=\"relative\"\n $alignItems=\"center\"\n $disabled={isDisabled}\n $borderColor={selected ? 'BLACK_T_87' : 'WHITE_5'}\n $background={selected ? 'WHITE_3' : 'WHITE_1'}\n onClick={handleOnChapterSelection}\n >\n <FlexView $position=\"relative\">\n <Image\n src={imageUrl || ''}\n alt={name}\n withLoader\n width={56}\n height={56}\n borderRadius={50}\n />\n </FlexView>\n <Styled.StyledText\n $renderAs={selected ? 'ab3-bold' : 'ab3'}\n $align=\"center\"\n $color={isDisabled ? 'BLACK_T_38' : 'BLACK_T_87'}\n >\n {name}\n </Styled.StyledText>\n </Styled.ChapterItemWrapper>\n </ArrowTooltip>\n );\n});\n\nexport default ChapterItem;\n"],"names":["ChapterItem","memo","chapter","selected","onChapterSelection","imageUrl","name","userChapterId","blocks","itemBankEnabled","hasTestSheets","block","sheet","NODE_TYPE","isDisabled","handleOnChapterSelection","useCallback","jsx","ArrowTooltip","jsxs","Styled.ChapterItemWrapper","FlexView","Image","Styled.StyledText"],"mappings":";;;;;;;AAWA,MAAMA,IAAgCC,EAAK,CAAC,EAAE,SAAAC,GAAS,UAAAC,GAAU,oBAAAC,QAAyB;AAClF,QAAA;AAAA,IACJ,WAAWC;AAAA,IACX,MAAAC;AAAA,IACA,IAAIC;AAAA,IACJ,QAAAC;AAAA,IACA,mBAAmBC;AAAA,EACjB,IAAAP,GACEQ,IAAgBF,EAAO;AAAA,IAAK,CAAAG,MAChCA,EAAM,OAAO;AAAA,MACX,OACEC,EAAM,cAAcC,EAAU,cAC9BD,EAAM,cAAcC,EAAU;AAAA,IAClC;AAAA,EAAA,GAGIC,IAAa,CAACL,KAAmB,CAACC,GAElCK,IAA2BC,EAAY,MAAM;AACjD,QAAIF,EAAmB,QAAA;AAEvB,IAAAV,EAAmBG,CAAa;AAAA,EAC/B,GAAA,CAACH,GAAoBG,GAAeO,CAAU,CAAC;AAGhD,SAAA,gBAAAG;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,UAAS;AAAA,MACT,UAAS;AAAA,MACT,aAAY;AAAA,MACZ,QAAQ,CAACJ;AAAA,MACT,QAAQ;AAAA,MAER,UAAA,gBAAAK;AAAA,QAACC;AAAAA,QAAA;AAAA,UACC,SAAS;AAAA,UACT,UAAU;AAAA,UACV,OAAO;AAAA,UACP,UAAU;AAAA,UACV,UAAU;AAAA,UACV,WAAU;AAAA,UACV,aAAY;AAAA,UACZ,WAAWN;AAAA,UACX,cAAcX,IAAW,eAAe;AAAA,UACxC,aAAaA,IAAW,YAAY;AAAA,UACpC,SAASY;AAAA,UAET,UAAA;AAAA,YAAC,gBAAAE,EAAAI,GAAA,EAAS,WAAU,YAClB,UAAA,gBAAAJ;AAAA,cAACK;AAAA,cAAA;AAAA,gBACC,KAAKjB,KAAY;AAAA,gBACjB,KAAKC;AAAA,gBACL,YAAU;AAAA,gBACV,OAAO;AAAA,gBACP,QAAQ;AAAA,gBACR,cAAc;AAAA,cAAA;AAAA,YAAA,GAElB;AAAA,YACA,gBAAAW;AAAA,cAACM;AAAAA,cAAA;AAAA,gBACC,WAAWpB,IAAW,aAAa;AAAA,gBACnC,QAAO;AAAA,gBACP,QAAQW,IAAa,eAAe;AAAA,gBAEnC,UAAAR;AAAA,cAAA;AAAA,YACH;AAAA,UAAA;AAAA,QAAA;AAAA,MACF;AAAA,IAAA;AAAA,EAAA;AAGN,CAAC;"}
|
package/dist/index.d.ts
CHANGED
@@ -2258,6 +2258,7 @@ declare interface INodePermissions {
|
|
2258
2258
|
can_reset: boolean;
|
2259
2259
|
can_resume: boolean;
|
2260
2260
|
can_review: boolean;
|
2261
|
+
can_assign_as_homework: boolean;
|
2261
2262
|
can_start: boolean;
|
2262
2263
|
can_teacher_review: boolean;
|
2263
2264
|
can_unassign: boolean;
|
@@ -3214,7 +3215,6 @@ export declare interface ITutorialProps {
|
|
3214
3215
|
onCross?: () => void;
|
3215
3216
|
showProgress?: boolean;
|
3216
3217
|
onTutorialPlayedOnce?: () => void;
|
3217
|
-
isJourneyActive?: boolean;
|
3218
3218
|
}
|
3219
3219
|
|
3220
3220
|
declare interface IUpdateImages {
|
@@ -5286,7 +5286,7 @@ declare type TUserProgram = {
|
|
5286
5286
|
|
5287
5287
|
export declare type TUserTypes = 'TEACHER' | 'STUDENT';
|
5288
5288
|
|
5289
|
-
export declare const Tutorial: ({ src, title, onCross, showProgress, onTutorialPlayedOnce,
|
5289
|
+
export declare const Tutorial: ({ src, title, onCross, showProgress, onTutorialPlayedOnce, }: ITutorialProps) => JSX_2.Element;
|
5290
5290
|
|
5291
5291
|
export declare const TutoringIcon: React_2.FC<React_2.SVGProps<SVGSVGElement>>;
|
5292
5292
|
|
package/package.json
CHANGED
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"info-bar-styled.js","sources":["../../../../../src/features/circle-games/comps/info-bar/info-bar-styled.tsx"],"sourcesContent":["import styled from 'styled-components';\n\nimport FlexView from '../../../ui/layout/flex-view';\n\nexport const InfoBarWrapper = styled(FlexView)`\n padding: 16px;\n margin: 16px;\n border-width: 1px;\n border-style: solid;\n`;\n"],"names":["InfoBarWrapper","styled","FlexView"],"mappings":";;AAIa,MAAAA,IAAiBC,EAAOC,CAAQ;AAAA;AAAA;AAAA;AAAA;AAAA;"}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"info-bar.js","sources":["../../../../../src/features/circle-games/comps/info-bar/info-bar.tsx"],"sourcesContent":["import type { TColorNames, THueNames } from '../../../ui/types';\nimport type { IInfoBarProps } from './info-bar-types';\n\nimport { useMemo } from 'react';\n\nimport * as Styled from './info-bar-styled';\n\nconst computeColorsFromHue = (\n hue: THueNames,\n): { backgroundColor: TColorNames; borderColor: TColorNames } => {\n return { backgroundColor: `${hue}_6`, borderColor: `${hue}_4` };\n};\n\nexport const InfoBar: React.FC<IInfoBarProps> = ({ children, hue }) => {\n const { backgroundColor, borderColor } = useMemo(() => computeColorsFromHue(hue), [hue]);\n\n return (\n <Styled.InfoBarWrapper $background={backgroundColor} $borderColor={borderColor}>\n {children}\n </Styled.InfoBarWrapper>\n );\n};\n"],"names":["computeColorsFromHue","hue","InfoBar","children","backgroundColor","borderColor","useMemo","jsx","Styled.InfoBarWrapper"],"mappings":";;;AAOA,MAAMA,IAAuB,CAC3BC,OAEO,EAAE,iBAAiB,GAAGA,CAAG,MAAM,aAAa,GAAGA,CAAG,SAG9CC,IAAmC,CAAC,EAAE,UAAAC,GAAU,KAAAF,QAAU;AAC/D,QAAA,EAAE,iBAAAG,GAAiB,aAAAC,EAAA,IAAgBC,EAAQ,MAAMN,EAAqBC,CAAG,GAAG,CAACA,CAAG,CAAC;AAGrF,SAAA,gBAAAM,EAACC,GAAA,EAAsB,aAAaJ,GAAiB,cAAcC,GAChE,UAAAF,EACH,CAAA;AAEJ;"}
|
File without changes
|