@cuemath/leap 3.2.17-pzd-0.1 → 3.2.18-mb
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/assets/illustrations/illustrations.js +5 -6
- package/dist/assets/illustrations/illustrations.js.map +1 -1
- package/dist/assets/lottie/lottie.js +1 -6
- package/dist/assets/lottie/lottie.js.map +1 -1
- package/dist/features/analytics-events/platform-events-student.js +1 -2
- package/dist/features/analytics-events/platform-events-student.js.map +1 -1
- package/dist/features/analytics-events/platform-events-teacher.js +4 -6
- package/dist/features/analytics-events/platform-events-teacher.js.map +1 -1
- package/dist/features/analytics-events/whitelist-events.js +8 -10
- package/dist/features/analytics-events/whitelist-events.js.map +1 -1
- package/dist/features/auth/account-selector/account-selector.js +25 -26
- package/dist/features/auth/account-selector/account-selector.js.map +1 -1
- package/dist/features/auth/comps/auth-page-layout/auth-page-layout.js +14 -15
- package/dist/features/auth/comps/auth-page-layout/auth-page-layout.js.map +1 -1
- package/dist/features/auth/comps/user-list/user-item/user-item.js +31 -30
- package/dist/features/auth/comps/user-list/user-item/user-item.js.map +1 -1
- package/dist/features/auth/comps/user-list/user-list.js +34 -35
- package/dist/features/auth/comps/user-list/user-list.js.map +1 -1
- package/dist/features/auth/forgot-password/forgot-password-styled.js +15 -14
- package/dist/features/auth/forgot-password/forgot-password-styled.js.map +1 -1
- package/dist/features/auth/login/identifier-otp-form/identifier-otp-form-styled.js +7 -6
- package/dist/features/auth/login/identifier-otp-form/identifier-otp-form-styled.js.map +1 -1
- package/dist/features/auth/login/login-styled.js +9 -8
- package/dist/features/auth/login/login-styled.js.map +1 -1
- package/dist/features/chapters-v2/utils/node-card-utils.js +9 -9
- package/dist/features/chapters-v2/utils/node-card-utils.js.map +1 -1
- package/dist/features/circle-games/game-launcher/comps/tables-card/tables-card-styled.js +4 -4
- package/dist/features/circle-games/game-launcher/comps/tables-card/tables-card-styled.js.map +1 -1
- package/dist/features/circle-games/game-launcher/comps/tables-card/tables-card.js +85 -85
- package/dist/features/circle-games/game-launcher/comps/tables-card/tables-card.js.map +1 -1
- package/dist/features/circle-games/game-launcher/hooks/use-game-launcher-journey/use-game-launcher-journey.js +98 -121
- package/dist/features/circle-games/game-launcher/hooks/use-game-launcher-journey/use-game-launcher-journey.js.map +1 -1
- package/dist/features/circle-games/game-launcher/hooks/use-table-infinite-launcher-journey/use-table-infinite-launcher-journey.js +28 -29
- package/dist/features/circle-games/game-launcher/hooks/use-table-infinite-launcher-journey/use-table-infinite-launcher-journey.js.map +1 -1
- package/dist/features/circle-games/game-launcher/hooks/use-table-launcher-journey/use-table-launcher-journey.js +42 -43
- package/dist/features/circle-games/game-launcher/hooks/use-table-launcher-journey/use-table-launcher-journey.js.map +1 -1
- package/dist/features/circle-games/games/tutorial/tutorial.js +35 -43
- package/dist/features/circle-games/games/tutorial/tutorial.js.map +1 -1
- package/dist/features/circle-games/sign-up/comp/grade-input/grade-input-styled.js +2 -2
- package/dist/features/circle-games/sign-up/comp/grade-input/grade-input-styled.js.map +1 -1
- package/dist/features/circle-games/sign-up/comp/grade-input/grade-input.js +1 -1
- package/dist/features/circle-games/sign-up/comp/grade-input/grade-input.js.map +1 -1
- package/dist/features/circle-games/sign-up/comp/username-input/username-input.js +24 -26
- package/dist/features/circle-games/sign-up/comp/username-input/username-input.js.map +1 -1
- package/dist/features/circle-games/sign-up/constants.js +1 -3
- package/dist/features/circle-games/sign-up/constants.js.map +1 -1
- package/dist/features/communication/pub-sub/constants.js +4 -7
- package/dist/features/communication/pub-sub/constants.js.map +1 -1
- package/dist/features/cue-canvas/hooks/use-canvas-sync-broker.js +42 -42
- package/dist/features/cue-canvas/hooks/use-canvas-sync-broker.js.map +1 -1
- package/dist/features/homework/homework-card-view.js +97 -85
- package/dist/features/homework/homework-card-view.js.map +1 -1
- package/dist/features/homework/homework-card.js +42 -44
- package/dist/features/homework/homework-card.js.map +1 -1
- package/dist/features/homework/hw-card-list/hw-card-list-view.js +29 -31
- package/dist/features/homework/hw-card-list/hw-card-list-view.js.map +1 -1
- package/dist/features/homework/hw-card-list/hw-card-list.js +48 -54
- package/dist/features/homework/hw-card-list/hw-card-list.js.map +1 -1
- package/dist/features/homework/utils.js +27 -33
- package/dist/features/homework/utils.js.map +1 -1
- package/dist/features/hooks/use-viewport/use-viewport.js +22 -0
- package/dist/features/hooks/use-viewport/use-viewport.js.map +1 -0
- package/dist/features/journey/comps/coachmark/coachmark.js +27 -29
- package/dist/features/journey/comps/coachmark/coachmark.js.map +1 -1
- package/dist/features/journey/hooks/use-home-page-journey/tooltip-item.js +11 -17
- package/dist/features/journey/hooks/use-home-page-journey/tooltip-item.js.map +1 -1
- package/dist/features/journey/journey-id/journey-id-student.js +2 -2
- package/dist/features/journey/journey-id/journey-id-student.js.map +1 -1
- package/dist/features/journey/journey-id/journey-id-teacher.js +2 -2
- package/dist/features/journey/journey-id/journey-id-teacher.js.map +1 -1
- package/dist/features/journey/use-journey/journey-context-provider.js +72 -73
- package/dist/features/journey/use-journey/journey-context-provider.js.map +1 -1
- package/dist/features/journey/use-journey/journey-styled.js +4 -6
- package/dist/features/journey/use-journey/journey-styled.js.map +1 -1
- package/dist/features/puzzles/comps/puzzle-card-styled.js +69 -24
- package/dist/features/puzzles/comps/puzzle-card-styled.js.map +1 -1
- package/dist/features/puzzles/comps/puzzle-card.js +30 -79
- package/dist/features/puzzles/comps/puzzle-card.js.map +1 -1
- package/dist/features/puzzles/puzzle-container/puzzle-container-styled.js +25 -55
- package/dist/features/puzzles/puzzle-container/puzzle-container-styled.js.map +1 -1
- package/dist/features/puzzles/puzzle-container/puzzle-container.js +107 -100
- package/dist/features/puzzles/puzzle-container/puzzle-container.js.map +1 -1
- package/dist/features/puzzles/puzzle-feedback-celebration/puzzle-feedback-celebration.js +1 -1
- package/dist/features/puzzles/puzzle-feedback-celebration/puzzle-feedback-celebration.js.map +1 -1
- package/dist/features/puzzles/utils/puzzle-pattern.js +13 -28
- package/dist/features/puzzles/utils/puzzle-pattern.js.map +1 -1
- package/dist/features/stickers/sticker-data.js +234 -0
- package/dist/features/stickers/sticker-data.js.map +1 -0
- package/dist/features/{ui/sticker-grid/sticker-grid-styles.js → stickers/sticker-selector/sticker-selector-styles.js} +4 -3
- package/dist/features/stickers/sticker-selector/sticker-selector-styles.js.map +1 -0
- package/dist/features/stickers/sticker-selector/sticker-selector.js +25 -0
- package/dist/features/stickers/sticker-selector/sticker-selector.js.map +1 -0
- package/dist/features/stickers/sticker-selector/sticker.js +57 -0
- package/dist/features/stickers/sticker-selector/sticker.js.map +1 -0
- package/dist/features/{ui/stickers/stickers-effects.js → stickers/stickers-effects/effects.js} +6 -6
- package/dist/features/stickers/stickers-effects/effects.js.map +1 -0
- package/dist/features/{ui/stickers/stickers-styled.js → stickers/stickers-effects/stickers-effects-styled.js} +2 -2
- package/dist/features/stickers/stickers-effects/stickers-effects-styled.js.map +1 -0
- package/dist/features/stickers/stickers-effects/stickers-effects-utils.js +93 -0
- package/dist/features/stickers/stickers-effects/stickers-effects-utils.js.map +1 -0
- package/dist/features/stickers/stickers-effects/stickers-effects.js +39 -0
- package/dist/features/stickers/stickers-effects/stickers-effects.js.map +1 -0
- package/dist/features/ui/arrow-tooltip/arrow-tooltip-styled.js +60 -12
- package/dist/features/ui/arrow-tooltip/arrow-tooltip-styled.js.map +1 -1
- package/dist/features/ui/arrow-tooltip/arrow-tooltip.js +77 -72
- package/dist/features/ui/arrow-tooltip/arrow-tooltip.js.map +1 -1
- package/dist/features/ui/error/error.js +27 -65
- package/dist/features/ui/error/error.js.map +1 -1
- package/dist/features/ui/lottie-animation/lottie-animation.js +29 -25
- package/dist/features/ui/lottie-animation/lottie-animation.js.map +1 -1
- package/dist/features/ui/modals/modal-styled.js +58 -34
- package/dist/features/ui/modals/modal-styled.js.map +1 -1
- package/dist/features/ui/modals/modal.js +14 -40
- package/dist/features/ui/modals/modal.js.map +1 -1
- package/dist/features/ui/nudge/nudge-styled.js +7 -14
- package/dist/features/ui/nudge/nudge-styled.js.map +1 -1
- package/dist/features/ui/nudge/nudge.js +12 -13
- package/dist/features/ui/nudge/nudge.js.map +1 -1
- package/dist/features/ui/streak-icon/streak-icon-styled.js +13 -13
- package/dist/features/ui/streak-icon/streak-icon-styled.js.map +1 -1
- package/dist/features/ui/streak-icon/streak-icon.js +15 -17
- package/dist/features/ui/streak-icon/streak-icon.js.map +1 -1
- package/dist/features/ui/text/text.js +36 -40
- package/dist/features/ui/text/text.js.map +1 -1
- package/dist/features/ui/theme/constants.js +2 -4
- package/dist/features/ui/theme/constants.js.map +1 -1
- package/dist/features/ui/theme/get-device.js +3 -3
- package/dist/features/ui/theme/get-device.js.map +1 -1
- package/dist/features/worksheet/worksheet/constants.js +13 -12
- package/dist/features/worksheet/worksheet/constants.js.map +1 -1
- package/dist/features/worksheet/worksheet/worksheet-helpers.js +19 -20
- package/dist/features/worksheet/worksheet/worksheet-helpers.js.map +1 -1
- package/dist/features/worksheet/worksheet/worksheet-question/learnosity-question.js +25 -29
- package/dist/features/worksheet/worksheet/worksheet-question/learnosity-question.js.map +1 -1
- package/dist/features/worksheet/worksheet/worksheet-question/worksheet-question-styled.js +47 -101
- package/dist/features/worksheet/worksheet/worksheet-question/worksheet-question-styled.js.map +1 -1
- package/dist/features/worksheet/worksheet/worksheet-question/worksheet-question.js +255 -244
- package/dist/features/worksheet/worksheet/worksheet-question/worksheet-question.js.map +1 -1
- package/dist/features/worksheet/worksheet/worksheet-questions-controller/worksheet-questions-controller.js +207 -242
- package/dist/features/worksheet/worksheet/worksheet-questions-controller/worksheet-questions-controller.js.map +1 -1
- package/dist/features/worksheet/worksheet/worksheet-styled.js +36 -45
- package/dist/features/worksheet/worksheet/worksheet-styled.js.map +1 -1
- package/dist/features/worksheet/worksheet/worksheet-types.js.map +1 -1
- package/dist/features/worksheet/worksheet/worksheet.js +325 -321
- package/dist/features/worksheet/worksheet/worksheet.js.map +1 -1
- package/dist/features/worksheet/worksheet-preview/hooks/use-worksheet-layout.js +1 -1
- package/dist/features/worksheet/worksheet-preview/hooks/use-worksheet-layout.js.map +1 -1
- package/dist/features/worksheet/worksheet-preview/worksheet-preview.js +35 -44
- package/dist/features/worksheet/worksheet-preview/worksheet-preview.js.map +1 -1
- package/dist/index.d.ts +56 -152
- package/dist/index.js +539 -563
- package/dist/index.js.map +1 -1
- package/dist/static/nudge-tap.5cb30093.json +1057 -0
- package/dist/static/puzzle-pattern-blue.f4bea1ee.svg +1 -0
- package/dist/static/puzzle-pattern-green.c9f84bbc.svg +1 -0
- package/dist/static/puzzle-pattern-orange.3da09665.svg +1 -0
- package/dist/static/puzzle-pattern-purple.5fb5a319.svg +1 -0
- package/dist/static/puzzle-pattern-yellow.aadbf457.svg +1 -0
- package/package.json +1 -1
- package/dist/assets/line-icons/icons/cue-board-filled.js +0 -33
- package/dist/assets/line-icons/icons/cue-board-filled.js.map +0 -1
- package/dist/assets/line-icons/icons/cue-board.js +0 -23
- package/dist/assets/line-icons/icons/cue-board.js.map +0 -1
- package/dist/assets/line-icons/icons/hint-fill.js +0 -35
- package/dist/assets/line-icons/icons/hint-fill.js.map +0 -1
- package/dist/assets/line-icons/icons/screen-grab-filled.js +0 -35
- package/dist/assets/line-icons/icons/screen-grab-filled.js.map +0 -1
- package/dist/assets/line-icons/icons/screen-grab.js +0 -23
- package/dist/assets/line-icons/icons/screen-grab.js.map +0 -1
- package/dist/assets/line-icons/icons/sticker-filled.js +0 -64
- package/dist/assets/line-icons/icons/sticker-filled.js.map +0 -1
- package/dist/assets/line-icons/icons/sticker.js +0 -46
- package/dist/assets/line-icons/icons/sticker.js.map +0 -1
- package/dist/features/journey/hooks/use-puzzles-journey/use-puzzle-assigned.js +0 -72
- package/dist/features/journey/hooks/use-puzzles-journey/use-puzzle-assigned.js.map +0 -1
- package/dist/features/journey/hooks/use-puzzles-journey/use-puzzle-attempt-journey.js +0 -59
- package/dist/features/journey/hooks/use-puzzles-journey/use-puzzle-attempt-journey.js.map +0 -1
- package/dist/features/journey/hooks/use-puzzles-journey/use-puzzle-dashboard-journey.js +0 -63
- package/dist/features/journey/hooks/use-puzzles-journey/use-puzzle-dashboard-journey.js.map +0 -1
- package/dist/features/journey/hooks/use-puzzles-journey/use-puzzle-intro-journey.js +0 -67
- package/dist/features/journey/hooks/use-puzzles-journey/use-puzzle-intro-journey.js.map +0 -1
- package/dist/features/journey/hooks/use-puzzles-journey/use-puzzle-progress-journey.js +0 -70
- package/dist/features/journey/hooks/use-puzzles-journey/use-puzzle-progress-journey.js.map +0 -1
- package/dist/features/journey/hooks/use-puzzles-journey/use-puzzle-review-journey.js +0 -59
- package/dist/features/journey/hooks/use-puzzles-journey/use-puzzle-review-journey.js.map +0 -1
- package/dist/features/journey/hooks/use-puzzles-journey/use-puzzle-unassign-journey.js +0 -59
- package/dist/features/journey/hooks/use-puzzles-journey/use-puzzle-unassign-journey.js.map +0 -1
- package/dist/features/journey/hooks/use-puzzles-journey/use-teacher-puzzle-assigned-journey.js +0 -70
- package/dist/features/journey/hooks/use-puzzles-journey/use-teacher-puzzle-assigned-journey.js.map +0 -1
- package/dist/features/puzzles/api/puzzle-dashboard.js +0 -10
- package/dist/features/puzzles/api/puzzle-dashboard.js.map +0 -1
- package/dist/features/puzzles/app/puzzle-app-styled.js +0 -85
- package/dist/features/puzzles/app/puzzle-app-styled.js.map +0 -1
- package/dist/features/puzzles/app/puzzle-app-view.js +0 -120
- package/dist/features/puzzles/app/puzzle-app-view.js.map +0 -1
- package/dist/features/puzzles/app/puzzle-app.js +0 -62
- package/dist/features/puzzles/app/puzzle-app.js.map +0 -1
- package/dist/features/puzzles/constants/puzzle-container.js +0 -8
- package/dist/features/puzzles/constants/puzzle-container.js.map +0 -1
- package/dist/features/puzzles/puzzle-analytics-events.js +0 -11
- package/dist/features/puzzles/puzzle-analytics-events.js.map +0 -1
- package/dist/features/puzzles/puzzle-container/puzzle-container-view.js +0 -55
- package/dist/features/puzzles/puzzle-container/puzzle-container-view.js.map +0 -1
- package/dist/features/puzzles/puzzle-dashboard/puzzle-dashboard-styled.js +0 -37
- package/dist/features/puzzles/puzzle-dashboard/puzzle-dashboard-styled.js.map +0 -1
- package/dist/features/puzzles/puzzle-dashboard/puzzle-dashboard.js +0 -110
- package/dist/features/puzzles/puzzle-dashboard/puzzle-dashboard.js.map +0 -1
- package/dist/features/ui/arrow-tooltip/arrow-tooltip-constants.js +0 -6
- package/dist/features/ui/arrow-tooltip/arrow-tooltip-constants.js.map +0 -1
- package/dist/features/ui/arrow-tooltip/comps/tooltip-body-styled.js +0 -63
- package/dist/features/ui/arrow-tooltip/comps/tooltip-body-styled.js.map +0 -1
- package/dist/features/ui/arrow-tooltip/comps/tooltip-body.js +0 -21
- package/dist/features/ui/arrow-tooltip/comps/tooltip-body.js.map +0 -1
- package/dist/features/ui/sticker-grid/sticker-grid-styles.js.map +0 -1
- package/dist/features/ui/sticker-grid/sticker-grid.js +0 -24
- package/dist/features/ui/sticker-grid/sticker-grid.js.map +0 -1
- package/dist/features/ui/sticker-grid/sticker.js +0 -57
- package/dist/features/ui/sticker-grid/sticker.js.map +0 -1
- package/dist/features/ui/stickers/constants.js +0 -6
- package/dist/features/ui/stickers/constants.js.map +0 -1
- package/dist/features/ui/stickers/stickers-effects.js.map +0 -1
- package/dist/features/ui/stickers/stickers-styled.js.map +0 -1
- package/dist/features/ui/stickers/stickers-utils.js +0 -91
- package/dist/features/ui/stickers/stickers-utils.js.map +0 -1
- package/dist/features/ui/stickers/stickers.js +0 -40
- package/dist/features/ui/stickers/stickers.js.map +0 -1
- package/dist/features/worksheet/worksheet/hooks/use-worksheet-journey.js +0 -28
- package/dist/features/worksheet/worksheet/hooks/use-worksheet-journey.js.map +0 -1
- package/dist/static/nudge-tap.0591aef4.json +0 -1
- package/dist/static/puzzle-blue-lottie.7017e2e8.json +0 -1
- package/dist/static/puzzle-blue-lottie.bf64ebc5.json +0 -12760
- package/dist/static/puzzle-dashboard-banner.b7956519.svg +0 -1
- package/dist/static/puzzle-green-lottie.1da90698.json +0 -1
- package/dist/static/puzzle-orange-lottie.cfcf3724.json +0 -1
- package/dist/static/puzzle-pattern-blue.abff0164.svg +0 -1
- package/dist/static/puzzle-pattern-green.b8ba1840.svg +0 -1
- package/dist/static/puzzle-pattern-orange.3f5a17ff.svg +0 -1
- package/dist/static/puzzle-pattern-purple.14b09759.svg +0 -1
- package/dist/static/puzzle-pattern-yellow.50917fab.svg +0 -1
- package/dist/static/puzzle-purple-lottie.e70de110.json +0 -9860
- package/dist/static/puzzle-yellow-lottie.275b5cf4.json +0 -1
@@ -1,84 +1,35 @@
|
|
1
|
-
import { jsx as
|
2
|
-
import { memo as
|
3
|
-
import
|
4
|
-
|
5
|
-
import A from "../../ui/layout/flex-view.js";
|
6
|
-
import Z from "../../ui/lottie-animation/lottie-animation.js";
|
7
|
-
import { PUZZLE_ANALYTICS_EVENTS as k } from "../puzzle-analytics-events.js";
|
8
|
-
import { getPuzzleStickerLottie as x } from "../utils/puzzle-feedback-celebration.js";
|
9
|
-
import { PuzzleWrapper as M, Title as j, StickerWrapper as v } from "./puzzle-card-styled.js";
|
10
|
-
const R = {
|
11
|
-
autoplay: !1,
|
12
|
-
loop: !0,
|
13
|
-
renderer: "canvas"
|
14
|
-
}, G = P(
|
1
|
+
import { jsx as h } from "react/jsx-runtime";
|
2
|
+
import { memo as p } from "react";
|
3
|
+
import { PuzzleWrapper as s } from "./puzzle-card-styled.js";
|
4
|
+
const c = p(
|
15
5
|
({
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
width:
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
e
|
39
|
-
}
|
40
|
-
|
41
|
-
e && ((t = l.current) == null || t.stop());
|
42
|
-
}, [e]);
|
43
|
-
return /* @__PURE__ */ i(
|
44
|
-
S,
|
45
|
-
{
|
46
|
-
label: "",
|
47
|
-
analyticsLabel: k.PUZZLE_VIEWED,
|
48
|
-
analyticsProps: L,
|
49
|
-
onClick: g,
|
50
|
-
children: /* @__PURE__ */ f(
|
51
|
-
M,
|
52
|
-
{
|
53
|
-
$width: z,
|
54
|
-
$height: $,
|
55
|
-
$justifyContent: "center",
|
56
|
-
$alignItems: "center",
|
57
|
-
$imageHue: c,
|
58
|
-
$background: `${c}_2`,
|
59
|
-
onMouseEnter: E,
|
60
|
-
onMouseLeave: d,
|
61
|
-
children: [
|
62
|
-
/* @__PURE__ */ f(A, { $justifyContent: "center", $alignItems: "center", $flexGap: 12, children: [
|
63
|
-
/* @__PURE__ */ i(b, { src: u ?? "", width: 68, height: 68, withLoader: !1, alt: "Puzzle" }),
|
64
|
-
/* @__PURE__ */ i(j, { $renderAs: "ab3", $align: "center", $width: "80%", children: h })
|
65
|
-
] }),
|
66
|
-
e && /* @__PURE__ */ i(v, { $widthX: 2.5, $heightX: 2.5, children: /* @__PURE__ */ i(
|
67
|
-
Z,
|
68
|
-
{
|
69
|
-
src: e,
|
70
|
-
ref: l,
|
71
|
-
settings: R
|
72
|
-
}
|
73
|
-
) })
|
74
|
-
]
|
75
|
-
}
|
76
|
-
)
|
77
|
-
}
|
78
|
-
);
|
79
|
-
}
|
6
|
+
children: e,
|
7
|
+
imageHue: t,
|
8
|
+
onAnimationEnd: r,
|
9
|
+
animationPhase: o,
|
10
|
+
width: i,
|
11
|
+
widthX: m,
|
12
|
+
height: n,
|
13
|
+
heightX: $,
|
14
|
+
backgroundColor: a
|
15
|
+
}) => /* @__PURE__ */ h(
|
16
|
+
s,
|
17
|
+
{
|
18
|
+
$animationPhase: o,
|
19
|
+
onAnimationEnd: r,
|
20
|
+
$width: i,
|
21
|
+
$height: n,
|
22
|
+
$widthX: m,
|
23
|
+
$heightX: $,
|
24
|
+
$alignItems: "center",
|
25
|
+
$justifyContent: "center",
|
26
|
+
$imageHue: t,
|
27
|
+
$background: a ?? `${t}_6`,
|
28
|
+
children: e
|
29
|
+
}
|
30
|
+
)
|
80
31
|
);
|
81
32
|
export {
|
82
|
-
|
33
|
+
c as default
|
83
34
|
};
|
84
35
|
//# sourceMappingURL=puzzle-card.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"puzzle-card.js","sources":["../../../../src/features/puzzles/comps/puzzle-card.tsx"],"sourcesContent":["import type {
|
1
|
+
{"version":3,"file":"puzzle-card.js","sources":["../../../../src/features/puzzles/comps/puzzle-card.tsx"],"sourcesContent":["import type { IPuzzleCardProps } from './puzzle-card-types';\nimport type { FC } from 'react';\n\nimport { memo } from 'react';\n\nimport * as Styled from './puzzle-card-styled';\n\nconst PuzzleCard: FC<IPuzzleCardProps> = memo(\n ({\n children,\n imageHue,\n onAnimationEnd,\n animationPhase,\n width,\n widthX,\n height,\n heightX,\n backgroundColor,\n }) => {\n return (\n <Styled.PuzzleWrapper\n $animationPhase={animationPhase}\n onAnimationEnd={onAnimationEnd}\n $width={width}\n $height={height}\n $widthX={widthX}\n $heightX={heightX}\n $alignItems=\"center\"\n $justifyContent=\"center\"\n $imageHue={imageHue}\n $background={backgroundColor ?? `${imageHue}_6`}\n >\n {children}\n </Styled.PuzzleWrapper>\n );\n },\n);\n\nexport default PuzzleCard;\n"],"names":["PuzzleCard","memo","children","imageHue","onAnimationEnd","animationPhase","width","widthX","height","heightX","backgroundColor","jsx","Styled.PuzzleWrapper"],"mappings":";;;AAOA,MAAMA,IAAmCC;AAAA,EACvC,CAAC;AAAA,IACC,UAAAC;AAAA,IACA,UAAAC;AAAA,IACA,gBAAAC;AAAA,IACA,gBAAAC;AAAA,IACA,OAAAC;AAAA,IACA,QAAAC;AAAA,IACA,QAAAC;AAAA,IACA,SAAAC;AAAA,IACA,iBAAAC;AAAA,EAAA,MAGE,gBAAAC;AAAA,IAACC;AAAAA,IAAA;AAAA,MACC,iBAAiBP;AAAA,MACjB,gBAAAD;AAAA,MACA,QAAQE;AAAA,MACR,SAASE;AAAA,MACT,SAASD;AAAA,MACT,UAAUE;AAAA,MACV,aAAY;AAAA,MACZ,iBAAgB;AAAA,MAChB,WAAWN;AAAA,MACX,aAAaO,KAAmB,GAAGP,CAAQ;AAAA,MAE1C,UAAAD;AAAA,IAAA;AAAA,EAAA;AAIT;"}
|
@@ -1,77 +1,47 @@
|
|
1
|
-
import
|
2
|
-
import
|
3
|
-
|
4
|
-
|
5
|
-
const { colors: i, layout: n } = t;
|
6
|
-
return `
|
7
|
-
cursor: pointer;
|
8
|
-
width: ${n.gutter * 15.9375}px;
|
9
|
-
height: ${n.gutter * 19.125}px;
|
10
|
-
position: relative;
|
11
|
-
left: ${o ? "0" : "50px"};
|
12
|
-
top: ${o ? "0" : "50px"};
|
1
|
+
import o from "styled-components";
|
2
|
+
import t from "../../ui/layout/flex-view.js";
|
3
|
+
const p = o(t)`
|
4
|
+
cursor: pointer;
|
13
5
|
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
const { colors: n, layout: p } = t;
|
6
|
+
&:hover {
|
7
|
+
outline: 2px solid ${({ theme: e }) => e.colors.BLACK_1};
|
8
|
+
}
|
9
|
+
`, l = o(t)(({ theme: e, $disabled: n }) => {
|
10
|
+
const { colors: r } = e;
|
20
11
|
return `
|
21
|
-
cursor: pointer;
|
22
|
-
width: ${p.gutter * 15.9375}px;
|
23
12
|
position: absolute;
|
24
|
-
|
25
|
-
|
13
|
+
bottom: -48px;
|
14
|
+
cursor: pointer;
|
15
|
+
z-index: -1;
|
26
16
|
|
27
|
-
${
|
28
|
-
background: ${
|
29
|
-
border: 2px solid ${
|
17
|
+
${n && `
|
18
|
+
background: ${r.WHITE_4};
|
19
|
+
border: 2px solid ${r.WHITE_5};
|
30
20
|
border-top: 0;
|
31
21
|
pointer-events: none;
|
32
22
|
`}
|
33
23
|
`;
|
34
|
-
})
|
35
|
-
e(r)`
|
24
|
+
}), c = o(t)`
|
36
25
|
position: relative;
|
37
26
|
top: -8px;
|
38
27
|
height: 100%;
|
39
28
|
width: 100%;
|
40
|
-
|
41
|
-
e(r)`
|
29
|
+
`, u = o(t)`
|
42
30
|
border-radius: 50%;
|
43
|
-
|
44
|
-
const d = e(r)`
|
31
|
+
`, a = o(t)`
|
45
32
|
position: relative;
|
46
33
|
transition: height 0.3s ease-out;
|
47
|
-
`,
|
34
|
+
`, d = o(t)`
|
48
35
|
position: absolute;
|
49
36
|
top: 0;
|
50
37
|
right: 0;
|
51
|
-
`, h = e(r)(({ $visible: t, theme: o }) => {
|
52
|
-
const { layout: i } = o;
|
53
|
-
return `
|
54
|
-
width: ${i.gutter * 22.1875}px;
|
55
|
-
height: ${i.gutter * 26}px;
|
56
|
-
left: 0;
|
57
|
-
opacity: ${t ? 1 : 0};
|
58
|
-
pointer-events: ${t ? "auto" : "none"};
|
59
|
-
transition: opacity 0.2s ease-out;
|
60
|
-
`;
|
61
|
-
}), $ = e(r)`
|
62
|
-
position: relative;
|
63
|
-
|
64
|
-
box-shadow: inset 0px 0px 0px 4px ${({ theme: t, $imageHue: o }) => t.colors[`${o}_4`]};
|
65
|
-
|
66
|
-
background-image: ${({ $imageHue: t }) => `url(${s(t)})`};
|
67
|
-
background-size: cover;
|
68
38
|
`;
|
69
39
|
export {
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
40
|
+
d as AssignedTag,
|
41
|
+
u as CheckMarkIcon,
|
42
|
+
l as PuzzleButton,
|
43
|
+
a as PuzzleContainer,
|
44
|
+
p as PuzzleContent,
|
45
|
+
c as PuzzleText
|
76
46
|
};
|
77
47
|
//# sourceMappingURL=puzzle-container-styled.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"puzzle-container-styled.js","sources":["../../../../src/features/puzzles/puzzle-container/puzzle-container-styled.tsx"],"sourcesContent":["import
|
1
|
+
{"version":3,"file":"puzzle-container-styled.js","sources":["../../../../src/features/puzzles/puzzle-container/puzzle-container-styled.tsx"],"sourcesContent":["import styled from 'styled-components';\n\nimport FlexView from '../../ui/layout/flex-view';\n\nconst PuzzleContent = styled(FlexView)`\n cursor: pointer;\n\n &:hover {\n outline: 2px solid ${({ theme }) => theme.colors.BLACK_1};\n }\n`;\n\ninterface IPuzzleButton {\n $disabled?: boolean;\n}\n\nconst PuzzleButton = styled(FlexView)<IPuzzleButton>(({ theme, $disabled }) => {\n const { colors } = theme;\n\n return `\n position: absolute;\n bottom: -48px;\n cursor: pointer;\n z-index: -1;\n \n ${\n $disabled &&\n `\n background: ${colors.WHITE_4};\n border: 2px solid ${colors.WHITE_5};\n border-top: 0;\n pointer-events: none;\n `\n }\n `;\n});\n\nconst PuzzleText = styled(FlexView)`\n position: relative;\n top: -8px;\n height: 100%;\n width: 100%;\n`;\n\nconst CheckMarkIcon = styled(FlexView)`\n border-radius: 50%;\n`;\n\nconst PuzzleContainer = styled(FlexView)`\n position: relative;\n transition: height 0.3s ease-out;\n`;\n\nconst AssignedTag = styled(FlexView)`\n position: absolute;\n top: 0;\n right: 0;\n`;\n\nexport { PuzzleContainer, PuzzleContent, PuzzleButton, PuzzleText, CheckMarkIcon, AssignedTag };\n"],"names":["PuzzleContent","styled","FlexView","theme","PuzzleButton","$disabled","colors","PuzzleText","CheckMarkIcon","PuzzleContainer","AssignedTag"],"mappings":";;AAIM,MAAAA,IAAgBC,EAAOC,CAAQ;AAAA;AAAA;AAAA;AAAA,yBAIZ,CAAC,EAAE,OAAAC,EAAA,MAAYA,EAAM,OAAO,OAAO;AAAA;AAAA,GAQtDC,IAAeH,EAAOC,CAAQ,EAAiB,CAAC,EAAE,OAAAC,GAAO,WAAAE,QAAgB;AACvE,QAAA,EAAE,QAAAC,EAAW,IAAAH;AAEZ,SAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,MAOHE,KACA;AAAA,oBACcC,EAAO,OAAO;AAAA,0BACRA,EAAO,OAAO;AAAA;AAAA;AAAA,KAIpC;AAAA;AAEJ,CAAC,GAEKC,IAAaN,EAAOC,CAAQ;AAAA;AAAA;AAAA;AAAA;AAAA,GAO5BM,IAAgBP,EAAOC,CAAQ;AAAA;AAAA,GAI/BO,IAAkBR,EAAOC,CAAQ;AAAA;AAAA;AAAA,GAKjCQ,IAAcT,EAAOC,CAAQ;AAAA;AAAA;AAAA;AAAA;"}
|
@@ -1,120 +1,127 @@
|
|
1
|
-
import { jsx as
|
2
|
-
import { memo as
|
3
|
-
import
|
4
|
-
import
|
5
|
-
import
|
6
|
-
import {
|
7
|
-
import
|
8
|
-
import { PuzzleContainer as
|
9
|
-
|
10
|
-
const W = {
|
11
|
-
loop: !1,
|
12
|
-
renderer: "svg",
|
13
|
-
autoPlay: !1
|
14
|
-
}, X = Z(
|
1
|
+
import { jsx as i, jsxs as l, Fragment as w } from "react/jsx-runtime";
|
2
|
+
import { memo as X, useState as z, useRef as j, useEffect as C, useCallback as c } from "react";
|
3
|
+
import L from "../../../assets/line-icons/icons/check2.js";
|
4
|
+
import O from "../../ui/image/image.js";
|
5
|
+
import r from "../../ui/text/text.js";
|
6
|
+
import { usePostPuzzleToAssign as B } from "../api/puzzle-assign.js";
|
7
|
+
import D from "../comps/puzzle-card.js";
|
8
|
+
import { PuzzleContainer as W, PuzzleContent as G, AssignedTag as K, PuzzleButton as S, PuzzleText as U, CheckMarkIcon as H } from "./puzzle-container-styled.js";
|
9
|
+
const N = 1500, M = X(
|
15
10
|
({
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
11
|
+
userType: A,
|
12
|
+
triggerReveal: o = !1,
|
13
|
+
onFullyHidden: s,
|
14
|
+
onPuzzleClick: d,
|
15
|
+
puzzleData: p,
|
16
|
+
courseStream: g,
|
17
|
+
studentId: u
|
22
18
|
}) => {
|
23
19
|
const {
|
24
|
-
image_hue:
|
25
|
-
image_url:
|
26
|
-
assigned:
|
27
|
-
title:
|
28
|
-
id:
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
} = $, [I, a] = j(s), r = k(null), w = u(() => D(i), [i]), R = u(
|
33
|
-
() => ({
|
34
|
-
node_id: A,
|
35
|
-
node_type: "PUZZLE_CARD",
|
36
|
-
student_elo_rating: h,
|
37
|
-
current_elo_rating: _
|
38
|
-
}),
|
39
|
-
[A, h, _]
|
40
|
-
), { post: C, isProcessing: b } = y({
|
41
|
-
onComplete: (e) => {
|
42
|
-
var t;
|
43
|
-
e ? a(!0) : ((t = r.current) == null || t.playSegments(c.REVEAL_ASSIGNED, !1), a(!1));
|
20
|
+
image_hue: m,
|
21
|
+
image_url: b,
|
22
|
+
assigned: e,
|
23
|
+
title: I,
|
24
|
+
id: h
|
25
|
+
} = p, [n, t] = z("hidden"), [f, P] = z(!1), a = j(null), { post: $, isProcessing: k } = B({
|
26
|
+
onComplete: (x) => {
|
27
|
+
x ? t("visible") : n === "visible" && t("assigning");
|
44
28
|
}
|
45
29
|
});
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
30
|
+
C(() => {
|
31
|
+
e || (o ? f ? t("assigned") : n === "hidden" && t("movingIn") : n !== "hidden" && n !== "movingOut" && t("movingOut"));
|
32
|
+
}, [o, f, e]), C(() => (n === "assigned" && !e && (a.current = setTimeout(() => {
|
33
|
+
t("movingOut");
|
34
|
+
}, N)), () => {
|
35
|
+
a.current && clearTimeout(a.current);
|
36
|
+
}), [n, e]);
|
37
|
+
const T = c(() => {
|
38
|
+
switch (n) {
|
39
|
+
case "movingIn":
|
40
|
+
t("revealing");
|
41
|
+
break;
|
42
|
+
case "revealing":
|
43
|
+
t("visible");
|
44
|
+
break;
|
45
|
+
case "assigning":
|
46
|
+
t("assigned"), P(!0);
|
47
|
+
break;
|
48
|
+
case "movingOut":
|
49
|
+
t("hidden"), s == null || s();
|
50
|
+
break;
|
51
|
+
}
|
52
|
+
}, [n, s]), v = c(() => {
|
53
|
+
e || $(
|
52
54
|
{
|
53
|
-
puzzle_id:
|
55
|
+
puzzle_id: h
|
54
56
|
},
|
55
57
|
{
|
56
|
-
studentId:
|
57
|
-
courseStream:
|
58
|
+
studentId: u,
|
59
|
+
courseStream: g
|
58
60
|
}
|
59
61
|
);
|
60
|
-
}, [
|
61
|
-
|
62
|
-
}, [
|
63
|
-
|
64
|
-
|
65
|
-
}, []), N = u(
|
66
|
-
() => ({
|
67
|
-
name: "enterFrame",
|
68
|
-
callback: (e) => {
|
69
|
-
const { currentTime: t } = e;
|
70
|
-
t === 49 && a(!0), t === 101 && (o == null || o());
|
71
|
-
}
|
72
|
-
}),
|
73
|
-
[o]
|
74
|
-
);
|
75
|
-
return l ? s ? /* @__PURE__ */ n(E, { $justifyContent: "center", children: /* @__PURE__ */ n(
|
76
|
-
G,
|
77
|
-
{
|
78
|
-
$imageHue: i,
|
79
|
-
$background: `${i}_2`,
|
80
|
-
$widthX: 15.9375,
|
81
|
-
children: /* @__PURE__ */ n(
|
82
|
-
S,
|
83
|
-
{
|
84
|
-
imageUrl: g,
|
85
|
-
handleOnPuzzleClick: L,
|
86
|
-
title: d,
|
87
|
-
assigned: !0
|
88
|
-
}
|
89
|
-
)
|
90
|
-
}
|
91
|
-
) }) : /* @__PURE__ */ n(E, { children: /* @__PURE__ */ T(U, { $heightX: 26, children: [
|
92
|
-
/* @__PURE__ */ n(
|
93
|
-
v,
|
62
|
+
}, [g, e, $, h, u]), _ = c(() => {
|
63
|
+
d();
|
64
|
+
}, [d]), E = () => n === "visible" || e ? /* @__PURE__ */ l(w, { children: [
|
65
|
+
/* @__PURE__ */ l(
|
66
|
+
G,
|
94
67
|
{
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
68
|
+
$justifyContent: "center",
|
69
|
+
$alignItems: "center",
|
70
|
+
$width: "100%",
|
71
|
+
$height: "100%",
|
72
|
+
onClick: _,
|
73
|
+
title: "Click to preview",
|
74
|
+
$flexGapX: 1.5,
|
75
|
+
children: [
|
76
|
+
/* @__PURE__ */ i(O, { width: 136, height: 136, src: b, withLoader: !1, alt: "Puzzle" }),
|
77
|
+
/* @__PURE__ */ i(r, { $renderAs: "h4", children: I }),
|
78
|
+
e && /* @__PURE__ */ i(K, { $gap: 4, $gutter: 8, $background: "BLACK_1", children: /* @__PURE__ */ i(r, { $renderAs: "ac4", $color: "WHITE_1", children: "Assigned" }) })
|
79
|
+
]
|
101
80
|
}
|
102
81
|
),
|
103
|
-
|
82
|
+
A === "TEACHER" && /* @__PURE__ */ i(
|
104
83
|
S,
|
105
84
|
{
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
85
|
+
$background: "BLACK_1",
|
86
|
+
$widthX: 15.75,
|
87
|
+
$alignItems: "center",
|
88
|
+
$justifyContent: "center",
|
89
|
+
$gapX: 0.75,
|
90
|
+
$gutterX: 1,
|
91
|
+
onClick: v,
|
92
|
+
$disabled: e || k,
|
93
|
+
children: /* @__PURE__ */ i(r, { $renderAs: "ub1-bold", $color: e ? "BLACK_T_38" : "WHITE_1", children: e ? "Discuss in next class" : "Assign" })
|
112
94
|
}
|
113
|
-
)
|
114
|
-
] })
|
95
|
+
)
|
96
|
+
] }) : n === "assigned" ? /* @__PURE__ */ l(U, { $alignItems: "center", $justifyContent: "center", $flexGap: 8, children: [
|
97
|
+
/* @__PURE__ */ i(
|
98
|
+
H,
|
99
|
+
{
|
100
|
+
$widthX: 2.5,
|
101
|
+
$heightX: 2.5,
|
102
|
+
$background: "WHITE",
|
103
|
+
$alignItems: "center",
|
104
|
+
$justifyContent: "center",
|
105
|
+
children: /* @__PURE__ */ i(L, {})
|
106
|
+
}
|
107
|
+
),
|
108
|
+
/* @__PURE__ */ i(r, { $renderAs: "ab1-bold", $align: "center", $color: "WHITE", children: "Puzzle assigned" })
|
109
|
+
] }) : null;
|
110
|
+
return n === "hidden" && !o ? null : /* @__PURE__ */ i(W, { children: /* @__PURE__ */ i(
|
111
|
+
D,
|
112
|
+
{
|
113
|
+
animationPhase: e ? void 0 : n,
|
114
|
+
onAnimationEnd: T,
|
115
|
+
imageHue: m ?? "BLUE",
|
116
|
+
heightX: 19,
|
117
|
+
widthX: 15.75,
|
118
|
+
backgroundColor: e ? `${m}_2` : void 0,
|
119
|
+
children: E()
|
120
|
+
}
|
121
|
+
) });
|
115
122
|
}
|
116
|
-
),
|
123
|
+
), F = M;
|
117
124
|
export {
|
118
|
-
|
125
|
+
F as default
|
119
126
|
};
|
120
127
|
//# sourceMappingURL=puzzle-container.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"puzzle-container.js","sources":["../../../../src/features/puzzles/puzzle-container/puzzle-container.tsx"],"sourcesContent":["import type { ILottieAnimationRef } from '../../ui/lottie-animation/types';\nimport type { IPuzzleCardContainerProps } from './puzzle-container-types';\nimport type { AnimationEventName, BMEnterFrameEvent } from 'lottie-web';\nimport type { FC } from 'react';\n\nimport { useState, useCallback, useEffect, useRef, memo, useMemo } from 'react';\n\nimport FlexView from '../../ui/layout/flex-view';\nimport LottieAnimation from '../../ui/lottie-animation/lottie-animation';\nimport { usePostPuzzleToAssign } from '../api/puzzle-assign';\nimport { PUZZLE_ASSIGN_ANIMATION } from '../constants/puzzle-container';\nimport { getPuzzleCardLottie } from '../utils/puzzle-pattern';\nimport * as Styled from './puzzle-container-styled';\nimport PuzzleAssigned from './puzzle-container-view';\n\nconst modeRevealAnimationSettings = {\n loop: false,\n renderer: 'svg',\n autoPlay: false,\n};\n\nconst PuzzleCardContainer: FC<IPuzzleCardContainerProps> = memo(\n ({\n triggerReveal = false,\n onFullyHidden,\n onPuzzleClick,\n puzzleData,\n courseStream,\n studentId,\n }) => {\n const {\n image_hue: imageHue,\n image_url: imageUrl,\n assigned: externalAssigned,\n title,\n id: puzzleId,\n node_id: nodeId,\n student_elo_rating,\n current_elo_rating,\n } = puzzleData;\n\n const [showPuzzleInfo, setShowPuzzleInfo] = useState(externalAssigned);\n\n const assignLottieRef = useRef<ILottieAnimationRef | null>(null);\n const puzzleLottieSrc = useMemo(() => getPuzzleCardLottie(imageHue), [imageHue]);\n\n const analyticsProps = useMemo(\n () => ({\n node_id: nodeId,\n node_type: 'PUZZLE_CARD',\n student_elo_rating,\n current_elo_rating,\n }),\n [nodeId, student_elo_rating, current_elo_rating],\n );\n\n const { post: postPuzzleToAssign, isProcessing } = usePostPuzzleToAssign({\n onComplete: (error: string | null) => {\n if (error) {\n // Handle error (e.g., show a notification)\n setShowPuzzleInfo(true);\n } else {\n assignLottieRef.current?.playSegments(PUZZLE_ASSIGN_ANIMATION.REVEAL_ASSIGNED, false);\n\n setShowPuzzleInfo(false);\n }\n },\n });\n\n useEffect(() => {\n if (!externalAssigned) {\n if (triggerReveal) {\n assignLottieRef.current?.playSegments(PUZZLE_ASSIGN_ANIMATION.REVEAL, true);\n } else {\n assignLottieRef.current?.stop();\n setShowPuzzleInfo(false);\n }\n }\n }, [externalAssigned, triggerReveal]);\n\n const handleAssign = useCallback(() => {\n if (externalAssigned) return;\n\n postPuzzleToAssign(\n {\n puzzle_id: puzzleId,\n },\n {\n studentId,\n courseStream,\n },\n );\n }, [courseStream, externalAssigned, postPuzzleToAssign, puzzleId, studentId]);\n\n const handleOnPuzzleClick = useCallback(() => {\n onPuzzleClick();\n }, [onPuzzleClick]);\n\n const showPuzzleLottie = useCallback(() => {\n assignLottieRef.current?.playSegments(PUZZLE_ASSIGN_ANIMATION.REVEAL, true);\n }, []);\n\n const onAnimationFinish = useMemo(\n () => ({\n name: 'enterFrame' as AnimationEventName,\n callback: (event: BMEnterFrameEvent) => {\n const { currentTime } = event;\n\n if (currentTime === 49) {\n setShowPuzzleInfo(true);\n }\n\n if (currentTime === 101) {\n onFullyHidden?.();\n }\n },\n }),\n [onFullyHidden],\n );\n\n if (!triggerReveal) {\n return null;\n }\n\n if (externalAssigned) {\n return (\n <Styled.PuzzleContainer $justifyContent=\"center\">\n <Styled.PuzzleAssignedWrapper\n $imageHue={imageHue}\n $background={`${imageHue}_2`}\n $widthX={15.9375}\n >\n <PuzzleAssigned\n imageUrl={imageUrl}\n handleOnPuzzleClick={handleOnPuzzleClick}\n title={title}\n assigned\n />\n </Styled.PuzzleAssignedWrapper>\n </Styled.PuzzleContainer>\n );\n }\n\n return (\n <Styled.PuzzleContainer>\n <FlexView $heightX={26}>\n <LottieAnimation\n src={puzzleLottieSrc}\n ref={assignLottieRef}\n settings={modeRevealAnimationSettings}\n onRender={showPuzzleLottie}\n eventListener={onAnimationFinish}\n animateOnIntersect\n />\n\n <Styled.PuzzleContentWrapper $visible={showPuzzleInfo} $position=\"absolute\">\n <PuzzleAssigned\n imageUrl={imageUrl}\n title={title}\n handleOnPuzzleClick={handleOnPuzzleClick}\n handleAssign={handleAssign}\n assigning={isProcessing}\n analyticsProps={analyticsProps}\n />\n </Styled.PuzzleContentWrapper>\n </FlexView>\n </Styled.PuzzleContainer>\n );\n },\n);\n\nexport default PuzzleCardContainer;\n"],"names":["modeRevealAnimationSettings","PuzzleCardContainer","memo","triggerReveal","onFullyHidden","onPuzzleClick","puzzleData","courseStream","studentId","imageHue","imageUrl","externalAssigned","title","puzzleId","nodeId","student_elo_rating","current_elo_rating","showPuzzleInfo","setShowPuzzleInfo","useState","assignLottieRef","useRef","puzzleLottieSrc","useMemo","getPuzzleCardLottie","analyticsProps","postPuzzleToAssign","isProcessing","usePostPuzzleToAssign","error","_a","PUZZLE_ASSIGN_ANIMATION","useEffect","_b","handleAssign","useCallback","handleOnPuzzleClick","showPuzzleLottie","onAnimationFinish","event","currentTime","jsx","Styled.PuzzleContainer","Styled.PuzzleAssignedWrapper","PuzzleAssigned","jsxs","FlexView","LottieAnimation","Styled.PuzzleContentWrapper","PuzzleCardContainer$1"],"mappings":";;;;;;;;;AAeA,MAAMA,IAA8B;AAAA,EAClC,MAAM;AAAA,EACN,UAAU;AAAA,EACV,UAAU;AACZ,GAEMC,IAAqDC;AAAA,EACzD,CAAC;AAAA,IACC,eAAAC,IAAgB;AAAA,IAChB,eAAAC;AAAA,IACA,eAAAC;AAAA,IACA,YAAAC;AAAA,IACA,cAAAC;AAAA,IACA,WAAA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UACA,cAAAF;AAAA,UACA,WAAWP;AAAA,UACX,gBAAAF;AAAA,QAAA;AAAA,MAAA,GAEJ;AAAA,IAAA,EACF,CAAA,EACF,CAAA,IA7CO;AAAA,EA+CX;AACF,GAEAwB,KAAehD;"}
|
1
|
+
{"version":3,"file":"puzzle-container.js","sources":["../../../../src/features/puzzles/puzzle-container/puzzle-container.tsx"],"sourcesContent":["import type { TPuzzleCardAnimationPhases } from '../comps/puzzle-card-types';\nimport type { IPuzzleCardContainerProps } from './puzzle-container-types';\nimport type { FC } from 'react';\n\nimport { useState, useCallback, useEffect, useRef, memo } from 'react';\n\nimport Check2Icon from '../../../assets/line-icons/icons/check2';\nimport Image from '../../ui/image/image';\nimport Text from '../../ui/text/text';\nimport { usePostPuzzleToAssign } from '../api/puzzle-assign';\nimport PuzzleCard from '../comps/puzzle-card';\nimport * as Styled from './puzzle-container-styled';\n\nconst ASSIGNED_DISPLAY_DURATION = 1500; // ms\n\nconst PuzzleCardContainer: FC<IPuzzleCardContainerProps> = memo(\n ({\n userType,\n triggerReveal = false,\n onFullyHidden,\n onPuzzleClick,\n puzzleData,\n courseStream,\n studentId,\n }) => {\n const {\n image_hue: imageHue,\n image_url: imageUrl,\n assigned: externalAssigned,\n title,\n id: puzzleId,\n } = puzzleData;\n\n const [animationPhase, setAnimationPhase] = useState<TPuzzleCardAnimationPhases>('hidden');\n const [isAssigned, setIsAssigned] = useState(false);\n\n const assignedTimer = useRef<NodeJS.Timeout | null>(null);\n\n const { post: postPuzzleToAssign, isProcessing } = usePostPuzzleToAssign({\n onComplete: (error: string | null) => {\n if (error) {\n // Handle error (e.g., show a notification)\n setAnimationPhase('visible'); // Reset to visible if assignment fails\n } else {\n if (animationPhase === 'visible') {\n setAnimationPhase('assigning');\n }\n }\n },\n });\n\n // Main trigger to start or hide the card\n useEffect(() => {\n if (!externalAssigned) {\n if (triggerReveal) {\n if (isAssigned) {\n setAnimationPhase('assigned'); // Already assigned, show statically\n } else if (animationPhase === 'hidden') {\n setAnimationPhase('movingIn'); // Start the animation sequence\n }\n } else {\n // If trigger is removed, start hiding (unless already hidden/hiding)\n if (animationPhase !== 'hidden' && animationPhase !== 'movingOut') {\n setAnimationPhase('movingOut');\n }\n }\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [triggerReveal, isAssigned, externalAssigned]);\n\n // Timer to auto-hide after the 'assigned' phase\n useEffect(() => {\n if (animationPhase === 'assigned' && !externalAssigned) {\n assignedTimer.current = setTimeout(() => {\n setAnimationPhase('movingOut');\n }, ASSIGNED_DISPLAY_DURATION);\n }\n\n return () => {\n if (assignedTimer.current) clearTimeout(assignedTimer.current);\n };\n }, [animationPhase, externalAssigned]);\n\n // State machine for animations\n const handleAnimationEnd = useCallback(() => {\n switch (animationPhase) {\n case 'movingIn':\n setAnimationPhase('revealing');\n break;\n case 'revealing':\n setAnimationPhase('visible');\n break;\n case 'assigning':\n setAnimationPhase('assigned');\n setIsAssigned(true);\n break;\n case 'movingOut':\n setAnimationPhase('hidden');\n onFullyHidden?.();\n break;\n default:\n break;\n }\n }, [animationPhase, onFullyHidden]);\n\n const handleAssign = useCallback(() => {\n if (externalAssigned) return; // Do nothing if already assigned\n\n postPuzzleToAssign(\n {\n puzzle_id: puzzleId,\n },\n {\n studentId,\n courseStream,\n },\n );\n }, [courseStream, externalAssigned, postPuzzleToAssign, puzzleId, studentId]);\n\n const handleOnPuzzleClick = useCallback(() => {\n onPuzzleClick();\n }, [onPuzzleClick]);\n\n // Render content only during specific phases\n const renderContent = () => {\n if (animationPhase === 'visible' || externalAssigned) {\n return (\n <>\n <Styled.PuzzleContent\n $justifyContent=\"center\"\n $alignItems=\"center\"\n $width=\"100%\"\n $height=\"100%\"\n onClick={handleOnPuzzleClick}\n title=\"Click to preview\"\n $flexGapX={1.5}\n >\n <Image width={136} height={136} src={imageUrl} withLoader={false} alt=\"Puzzle\" />\n <Text $renderAs=\"h4\">{title}</Text>\n\n {externalAssigned && (\n <Styled.AssignedTag $gap={4} $gutter={8} $background=\"BLACK_1\">\n <Text $renderAs=\"ac4\" $color=\"WHITE_1\">\n Assigned\n </Text>\n </Styled.AssignedTag>\n )}\n </Styled.PuzzleContent>\n\n {userType === 'TEACHER' && (\n <Styled.PuzzleButton\n $background=\"BLACK_1\"\n $widthX={15.75}\n $alignItems=\"center\"\n $justifyContent=\"center\"\n $gapX={0.75}\n $gutterX={1}\n onClick={handleAssign}\n $disabled={externalAssigned || isProcessing}\n >\n <Text $renderAs=\"ub1-bold\" $color={externalAssigned ? 'BLACK_T_38' : 'WHITE_1'}>\n {externalAssigned ? 'Discuss in next class' : 'Assign'}\n </Text>\n </Styled.PuzzleButton>\n )}\n </>\n );\n }\n\n if (animationPhase === 'assigned') {\n return (\n <Styled.PuzzleText $alignItems=\"center\" $justifyContent=\"center\" $flexGap={8}>\n <Styled.CheckMarkIcon\n $widthX={2.5}\n $heightX={2.5}\n $background=\"WHITE\"\n $alignItems=\"center\"\n $justifyContent=\"center\"\n >\n <Check2Icon />\n </Styled.CheckMarkIcon>\n\n <Text $renderAs=\"ab1-bold\" $align=\"center\" $color=\"WHITE\">\n Puzzle assigned\n </Text>\n </Styled.PuzzleText>\n );\n }\n\n // No content during animations\n return null;\n };\n\n if (animationPhase === 'hidden' && !triggerReveal) {\n return null;\n }\n\n return (\n <Styled.PuzzleContainer>\n <PuzzleCard\n animationPhase={!externalAssigned ? animationPhase : undefined}\n onAnimationEnd={handleAnimationEnd}\n imageHue={imageHue ?? 'BLUE'}\n heightX={19}\n widthX={15.75}\n backgroundColor={externalAssigned ? `${imageHue}_2` : undefined}\n >\n {renderContent()}\n </PuzzleCard>\n </Styled.PuzzleContainer>\n );\n },\n);\n\nexport default PuzzleCardContainer;\n"],"names":["ASSIGNED_DISPLAY_DURATION","PuzzleCardContainer","memo","userType","triggerReveal","onFullyHidden","onPuzzleClick","puzzleData","courseStream","studentId","imageHue","imageUrl","externalAssigned","title","puzzleId","animationPhase","setAnimationPhase","useState","isAssigned","setIsAssigned","assignedTimer","useRef","postPuzzleToAssign","isProcessing","usePostPuzzleToAssign","error","useEffect","handleAnimationEnd","useCallback","handleAssign","handleOnPuzzleClick","renderContent","jsxs","Fragment","Styled.PuzzleContent","jsx","Image","Text","Styled.AssignedTag","Styled.PuzzleButton","Styled.PuzzleText","Styled.CheckMarkIcon","Check2Icon","Styled.PuzzleContainer","PuzzleCard","PuzzleCardContainer$1"],"mappings":";;;;;;;;AAaA,MAAMA,IAA4B,MAE5BC,IAAqDC;AAAA,EACzD,CAAC;AAAA,IACC,UAAAC;AAAA,IACA,eAAAC,IAAgB;AAAA,IAChB,eAAAC;AAAA,IACA,eAAAC;AAAA,IACA,YAAAC;AAAA,IACA,cAAAC;AAAA,IACA,WAAAC;AAAA,EAAA,MACI;AACE,UAAA;AAAA,MACJ,WAAWC;AAAA,MACX,WAAWC;AAAA,MACX,UAAUC;AAAA,MACV,OAAAC;AAAA,MACA,IAAIC;AAAA,IACF,IAAAP,GAEE,CAACQ,GAAgBC,CAAiB,IAAIC,EAAqC,QAAQ,GACnF,CAACC,GAAYC,CAAa,IAAIF,EAAS,EAAK,GAE5CG,IAAgBC,EAA8B,IAAI,GAElD,EAAE,MAAMC,GAAoB,cAAAC,EAAA,IAAiBC,EAAsB;AAAA,MACvE,YAAY,CAACC,MAAyB;AACpC,QAAIA,IAEFT,EAAkB,SAAS,IAEvBD,MAAmB,aACrBC,EAAkB,WAAW;AAAA,MAGnC;AAAA,IAAA,CACD;AAGD,IAAAU,EAAU,MAAM;AACd,MAAKd,MACCR,IACEc,IACFF,EAAkB,UAAU,IACnBD,MAAmB,YAC5BC,EAAkB,UAAU,IAI1BD,MAAmB,YAAYA,MAAmB,eACpDC,EAAkB,WAAW;AAAA,IAKlC,GAAA,CAACZ,GAAec,GAAYN,CAAgB,CAAC,GAGhDc,EAAU,OACJX,MAAmB,cAAc,CAACH,MACtBQ,EAAA,UAAU,WAAW,MAAM;AACvC,MAAAJ,EAAkB,WAAW;AAAA,OAC5BhB,CAAyB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QAErD,UAAcqB,EAAA;AAAA,MAAA;AAAA,IAEnB,EAAA,CAAA;AAAA,EAEJ;AACF,GAEAc,IAAe5C;"}
|
package/dist/features/puzzles/puzzle-feedback-celebration/puzzle-feedback-celebration.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"puzzle-feedback-celebration.js","sources":["../../../../src/features/puzzles/puzzle-feedback-celebration/puzzle-feedback-celebration.tsx"],"sourcesContent":["import type { IPuzzleFeedbackCelebration } from './puzzle-feedback-celebration-types';\nimport type { FC } from 'react';\n\nimport { useCallback, useEffect, useState } from 'react';\n\nimport CrossIcon from '../../../assets/line-icons/icons/cross';\nimport IconButton from '../../ui/buttons/icon-button/icon-button';\nimport FlexView from '../../ui/layout/flex-view';\nimport LottieAnimation from '../../ui/lottie-animation/lottie-animation';\nimport useModalActions from '../../ui/modals/use-modal-actions';\nimport useModalParams from '../../ui/modals/use-modal-params';\nimport { getPuzzleStickerLottie } from '../utils/puzzle-feedback-celebration';\nimport * as Styled from './puzzle-feedback-celebration-styled';\n\nconst puzzleStickerLottieSettings = {\n autoplay: true,\n loop: true,\n renderer: 'canvas',\n};\n\nconst PuzzleFeedbackCelebration: FC = () => {\n const { closeModal } = useModalActions();\n const { feedbackComments, rewards, onCloseModal } = useModalParams<IPuzzleFeedbackCelebration>();\n\n const [showHeader, setShowHeader] = useState(false);\n const [showLottie, setShowLottie] = useState(false);\n const [showText, setShowText] = useState(false);\n const [showButton, setShowButton] = useState(false);\n\n const { sticker } = rewards[0] || {};\n\n const stickerLottie = sticker ? getPuzzleStickerLottie(sticker) : undefined;\n\n const handleCloseModal = useCallback(() => {\n onCloseModal?.();\n closeModal();\n }, [closeModal, onCloseModal]);\n\n useEffect(() => {\n // Sequence: Header -> Lottie -> Text -> Button\n const headerTimer = setTimeout(() => {\n setShowHeader(true);\n }, 100);\n\n const lottieTimer = setTimeout(() => {\n setShowLottie(true);\n }, 400);\n\n const textTimer = setTimeout(() => {\n setShowText(true);\n }, 1000);\n\n const buttonTimer = setTimeout(() => {\n setShowButton(true);\n }, 1500);\n\n // Close modal after 4000ms\n const closeModalTimer = setTimeout(() => {\n handleCloseModal();\n }, 5500);\n\n return () => {\n clearTimeout(headerTimer);\n clearTimeout(lottieTimer);\n clearTimeout(textTimer);\n clearTimeout(buttonTimer);\n clearTimeout(closeModalTimer);\n };\n }, [handleCloseModal]);\n\n return (\n <FlexView $justifyContent=\"center\" $alignItems=\"center\" $width=\"100%\">\n <Styled.PuzzleFeedbackModalWrapper $flexGapX={2.5} $widthX={33.5} $alignItems=\"center\">\n <Styled.ShimmerText $renderAs=\"ac2-black\" $show={showHeader}>\n Puzzle Reviewed\n </Styled.ShimmerText>\n\n <Styled.LottieContainer $widthX={12.5} $heightX={12.5} $show={showLottie}>\n {stickerLottie && (\n <LottieAnimation\n width={200}\n height={200}\n src={stickerLottie}\n settings={puzzleStickerLottieSettings}\n />\n )}\n </Styled.LottieContainer>\n\n <Styled.FeedbackText\n $width=\"80%\"\n $renderAs=\"
|
1
|
+
{"version":3,"file":"puzzle-feedback-celebration.js","sources":["../../../../src/features/puzzles/puzzle-feedback-celebration/puzzle-feedback-celebration.tsx"],"sourcesContent":["import type { IPuzzleFeedbackCelebration } from './puzzle-feedback-celebration-types';\nimport type { FC } from 'react';\n\nimport { useCallback, useEffect, useState } from 'react';\n\nimport CrossIcon from '../../../assets/line-icons/icons/cross';\nimport IconButton from '../../ui/buttons/icon-button/icon-button';\nimport FlexView from '../../ui/layout/flex-view';\nimport LottieAnimation from '../../ui/lottie-animation/lottie-animation';\nimport useModalActions from '../../ui/modals/use-modal-actions';\nimport useModalParams from '../../ui/modals/use-modal-params';\nimport { getPuzzleStickerLottie } from '../utils/puzzle-feedback-celebration';\nimport * as Styled from './puzzle-feedback-celebration-styled';\n\nconst puzzleStickerLottieSettings = {\n autoplay: true,\n loop: true,\n renderer: 'canvas',\n};\n\nconst PuzzleFeedbackCelebration: FC = () => {\n const { closeModal } = useModalActions();\n const { feedbackComments, rewards, onCloseModal } = useModalParams<IPuzzleFeedbackCelebration>();\n\n const [showHeader, setShowHeader] = useState(false);\n const [showLottie, setShowLottie] = useState(false);\n const [showText, setShowText] = useState(false);\n const [showButton, setShowButton] = useState(false);\n\n const { sticker } = rewards[0] || {};\n\n const stickerLottie = sticker ? getPuzzleStickerLottie(sticker) : undefined;\n\n const handleCloseModal = useCallback(() => {\n onCloseModal?.();\n closeModal();\n }, [closeModal, onCloseModal]);\n\n useEffect(() => {\n // Sequence: Header -> Lottie -> Text -> Button\n const headerTimer = setTimeout(() => {\n setShowHeader(true);\n }, 100);\n\n const lottieTimer = setTimeout(() => {\n setShowLottie(true);\n }, 400);\n\n const textTimer = setTimeout(() => {\n setShowText(true);\n }, 1000);\n\n const buttonTimer = setTimeout(() => {\n setShowButton(true);\n }, 1500);\n\n // Close modal after 4000ms\n const closeModalTimer = setTimeout(() => {\n handleCloseModal();\n }, 5500);\n\n return () => {\n clearTimeout(headerTimer);\n clearTimeout(lottieTimer);\n clearTimeout(textTimer);\n clearTimeout(buttonTimer);\n clearTimeout(closeModalTimer);\n };\n }, [handleCloseModal]);\n\n return (\n <FlexView $justifyContent=\"center\" $alignItems=\"center\" $width=\"100%\">\n <Styled.PuzzleFeedbackModalWrapper $flexGapX={2.5} $widthX={33.5} $alignItems=\"center\">\n <Styled.ShimmerText $renderAs=\"ac2-black\" $show={showHeader}>\n Puzzle Reviewed\n </Styled.ShimmerText>\n\n <Styled.LottieContainer $widthX={12.5} $heightX={12.5} $show={showLottie}>\n {stickerLottie && (\n <LottieAnimation\n width={200}\n height={200}\n src={stickerLottie}\n settings={puzzleStickerLottieSettings}\n />\n )}\n </Styled.LottieContainer>\n\n <Styled.FeedbackText\n $width=\"80%\"\n $renderAs=\"ah3\"\n $color=\"WHITE_1\"\n $align=\"center\"\n $show={showText}\n >\n {feedbackComments}\n </Styled.FeedbackText>\n\n <Styled.CloseButtonWrapper $show={showButton}>\n <IconButton\n renderAs=\"secondary\"\n Icon={CrossIcon}\n size=\"small\"\n analyticsLabel=\"close_puzzle_feedback_modal\"\n onClick={handleCloseModal}\n />\n </Styled.CloseButtonWrapper>\n </Styled.PuzzleFeedbackModalWrapper>\n </FlexView>\n );\n};\n\nexport default PuzzleFeedbackCelebration;\n"],"names":["puzzleStickerLottieSettings","PuzzleFeedbackCelebration","closeModal","useModalActions","feedbackComments","rewards","onCloseModal","useModalParams","showHeader","setShowHeader","useState","showLottie","setShowLottie","showText","setShowText","showButton","setShowButton","sticker","stickerLottie","getPuzzleStickerLottie","handleCloseModal","useCallback","useEffect","headerTimer","lottieTimer","textTimer","buttonTimer","closeModalTimer","FlexView","jsxs","Styled.PuzzleFeedbackModalWrapper","jsx","Styled.ShimmerText","Styled.LottieContainer","LottieAnimation","Styled.FeedbackText","Styled.CloseButtonWrapper","IconButton","CrossIcon","PuzzleFeedbackCelebration$1"],"mappings":";;;;;;;;;;AAcA,MAAMA,IAA8B;AAAA,EAClC,UAAU;AAAA,EACV,MAAM;AAAA,EACN,UAAU;AACZ,GAEMC,IAAgC,MAAM;AACpC,QAAA,EAAE,YAAAC,MAAeC,KACjB,EAAE,kBAAAC,GAAkB,SAAAC,GAAS,cAAAC,MAAiBC,EAA2C,GAEzF,CAACC,GAAYC,CAAa,IAAIC,EAAS,EAAK,GAC5C,CAACC,GAAYC,CAAa,IAAIF,EAAS,EAAK,GAC5C,CAACG,GAAUC,CAAW,IAAIJ,EAAS,EAAK,GACxC,CAACK,GAAYC,CAAa,IAAIN,EAAS,EAAK,GAE5C,EAAE,SAAAO,EAAQ,IAAIZ,EAAQ,CAAC,KAAK,CAAA,GAE5Ba,IAAgBD,IAAUE,EAAuBF,CAAO,IAAI,QAE5DG,IAAmBC,EAAY,MAAM;AAC1B,IAAAf,KAAA,QAAAA,KACJJ;EAAA,GACV,CAACA,GAAYI,CAAY,CAAC;AAE7B,SAAAgB,EAAU,MAAM;AAER,UAAAC,IAAc,WAAW,MAAM;AACnC,MAAAd,EAAc,EAAI;AAAA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