@cuemath/leap 3.5.29 → 3.5.30-as10
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 +22 -0
- package/dist/assets/illustrations/illustrations.js.map +1 -1
- package/dist/assets/images/images.js +8 -0
- package/dist/assets/images/images.js.map +1 -1
- package/dist/assets/line-icons/icons/carat-right.js +26 -0
- package/dist/assets/line-icons/icons/carat-right.js.map +1 -0
- package/dist/assets/line-icons/icons/dots-icon.js +21 -0
- package/dist/assets/line-icons/icons/dots-icon.js.map +1 -0
- package/dist/assets/line-icons/icons/pause-icon.js +24 -0
- package/dist/assets/line-icons/icons/pause-icon.js.map +1 -0
- package/dist/features/chapters/chapters-list/chapter-item/chapter-circular-progress/chapter-circular-progress.js +82 -0
- package/dist/features/chapters/chapters-list/chapter-item/chapter-circular-progress/chapter-circular-progress.js.map +1 -0
- package/dist/features/chapters/chapters-list/chapter-item/chapter-circular-progress/chapter-circular-progress.styled.js +77 -0
- package/dist/features/chapters/chapters-list/chapter-item/chapter-circular-progress/chapter-circular-progress.styled.js.map +1 -0
- package/dist/features/chapters/chapters-list/chapter-item/chapter-item-styled.js +18 -91
- package/dist/features/chapters/chapters-list/chapter-item/chapter-item-styled.js.map +1 -1
- package/dist/features/chapters/chapters-list/chapter-item/chapter-item.js +42 -58
- package/dist/features/chapters/chapters-list/chapter-item/chapter-item.js.map +1 -1
- package/dist/features/circle-games/game-launcher/comps/carousel/carousel-styled.js +16 -32
- package/dist/features/circle-games/game-launcher/comps/carousel/carousel-styled.js.map +1 -1
- package/dist/features/circle-games/game-launcher/comps/carousel/carousel.js +88 -87
- package/dist/features/circle-games/game-launcher/comps/carousel/carousel.js.map +1 -1
- package/dist/features/circle-games/game-launcher/hooks/use-game-launcher-journey/use-game-launcher-journey.js +35 -35
- package/dist/features/circle-games/game-launcher/hooks/use-game-launcher-journey/use-game-launcher-journey.js.map +1 -1
- package/dist/features/homework/card-title.js +8 -8
- package/dist/features/homework/card-title.js.map +1 -1
- package/dist/features/parent-dashboard/comps/compact-header/compact-header.js +5 -5
- package/dist/features/parent-dashboard/comps/compact-header/compact-header.js.map +1 -1
- package/dist/features/timeline/monthly-report/api/use-monthly-report-get.js +13 -0
- package/dist/features/timeline/monthly-report/api/use-monthly-report-get.js.map +1 -0
- package/dist/features/timeline/monthly-report/comps/achievements/achievements.js +60 -0
- package/dist/features/timeline/monthly-report/comps/achievements/achievements.js.map +1 -0
- package/dist/features/timeline/monthly-report/comps/achievements/achievements.styled.js +15 -0
- package/dist/features/timeline/monthly-report/comps/achievements/achievements.styled.js.map +1 -0
- package/dist/features/timeline/monthly-report/comps/activities/activities-card/activities-card.js +128 -0
- package/dist/features/timeline/monthly-report/comps/activities/activities-card/activities-card.js.map +1 -0
- package/dist/features/timeline/monthly-report/comps/activities/activities-card/activities-card.styled.js +53 -0
- package/dist/features/timeline/monthly-report/comps/activities/activities-card/activities-card.styled.js.map +1 -0
- package/dist/features/timeline/monthly-report/comps/activities/activities-card-puzzles/activities-card-puzzles.js +120 -0
- package/dist/features/timeline/monthly-report/comps/activities/activities-card-puzzles/activities-card-puzzles.js.map +1 -0
- package/dist/features/timeline/monthly-report/comps/activities/activities-card-puzzles/activities-card-puzzles.styled.js +58 -0
- package/dist/features/timeline/monthly-report/comps/activities/activities-card-puzzles/activities-card-puzzles.styled.js.map +1 -0
- package/dist/features/timeline/monthly-report/comps/activities/activities.js +27 -0
- package/dist/features/timeline/monthly-report/comps/activities/activities.js.map +1 -0
- package/dist/features/timeline/monthly-report/comps/activities/constants.js +95 -0
- package/dist/features/timeline/monthly-report/comps/activities/constants.js.map +1 -0
- package/dist/features/timeline/monthly-report/comps/activities/utils.js +15 -0
- package/dist/features/timeline/monthly-report/comps/activities/utils.js.map +1 -0
- package/dist/features/timeline/monthly-report/comps/attendance/attendance-constants.js +29 -0
- package/dist/features/timeline/monthly-report/comps/attendance/attendance-constants.js.map +1 -0
- package/dist/features/timeline/monthly-report/comps/attendance/attendance-utils.js +94 -0
- package/dist/features/timeline/monthly-report/comps/attendance/attendance-utils.js.map +1 -0
- package/dist/features/timeline/monthly-report/comps/attendance/attendance.js +44 -0
- package/dist/features/timeline/monthly-report/comps/attendance/attendance.js.map +1 -0
- package/dist/features/timeline/monthly-report/comps/attendance/attendance.styled.js +39 -0
- package/dist/features/timeline/monthly-report/comps/attendance/attendance.styled.js.map +1 -0
- package/dist/features/timeline/monthly-report/comps/attendance/attendence-view.js +52 -0
- package/dist/features/timeline/monthly-report/comps/attendance/attendence-view.js.map +1 -0
- package/dist/features/timeline/monthly-report/comps/feedback/feedback-styled.js +9 -0
- package/dist/features/timeline/monthly-report/comps/feedback/feedback-styled.js.map +1 -0
- package/dist/features/timeline/monthly-report/comps/feedback/feedback.js +94 -0
- package/dist/features/timeline/monthly-report/comps/feedback/feedback.js.map +1 -0
- package/dist/features/timeline/monthly-report/comps/goals/goals-card/goal-chapter-card.js +48 -0
- package/dist/features/timeline/monthly-report/comps/goals/goals-card/goal-chapter-card.js.map +1 -0
- package/dist/features/timeline/monthly-report/comps/goals/goals-card/goals-card-styled.js +28 -0
- package/dist/features/timeline/monthly-report/comps/goals/goals-card/goals-card-styled.js.map +1 -0
- package/dist/features/timeline/monthly-report/comps/goals/goals-card/goals-card.js +113 -0
- package/dist/features/timeline/monthly-report/comps/goals/goals-card/goals-card.js.map +1 -0
- package/dist/features/timeline/monthly-report/comps/goals/goals-constants.js +30 -0
- package/dist/features/timeline/monthly-report/comps/goals/goals-constants.js.map +1 -0
- package/dist/features/timeline/monthly-report/comps/goals/goals.js +22 -0
- package/dist/features/timeline/monthly-report/comps/goals/goals.js.map +1 -0
- package/dist/features/timeline/monthly-report/monthly-report-styled.js +14 -0
- package/dist/features/timeline/monthly-report/monthly-report-styled.js.map +1 -0
- package/dist/features/timeline/monthly-report/monthly-report-types.js +5 -0
- package/dist/features/timeline/monthly-report/monthly-report-types.js.map +1 -0
- package/dist/features/timeline/monthly-report/monthly-report.js +69 -0
- package/dist/features/timeline/monthly-report/monthly-report.js.map +1 -0
- package/dist/features/timeline/monthly-timeline/api/use-monthly-timeline-get.js +10 -0
- package/dist/features/timeline/monthly-timeline/api/use-monthly-timeline-get.js.map +1 -0
- package/dist/features/timeline/monthly-timeline/comps/monthly-card/monthly-card.js +87 -0
- package/dist/features/timeline/monthly-timeline/comps/monthly-card/monthly-card.js.map +1 -0
- package/dist/features/timeline/monthly-timeline/comps/monthly-card/monthly-card.styled.js +9 -0
- package/dist/features/timeline/monthly-timeline/comps/monthly-card/monthly-card.styled.js.map +1 -0
- package/dist/features/timeline/monthly-timeline/constants.js +41 -0
- package/dist/features/timeline/monthly-timeline/constants.js.map +1 -0
- package/dist/features/timeline/monthly-timeline/monthly-timeline-styled.js +9 -0
- package/dist/features/timeline/monthly-timeline/monthly-timeline-styled.js.map +1 -0
- package/dist/features/timeline/monthly-timeline/monthly-timeline-types.js +6 -0
- package/dist/features/timeline/monthly-timeline/monthly-timeline-types.js.map +1 -0
- package/dist/features/timeline/monthly-timeline/monthly-timeline-view.js +28 -0
- package/dist/features/timeline/monthly-timeline/monthly-timeline-view.js.map +1 -0
- package/dist/features/timeline/monthly-timeline/monthly-timeline.js +56 -0
- package/dist/features/timeline/monthly-timeline/monthly-timeline.js.map +1 -0
- package/dist/features/timeline/ptm-report/api/use-ptm-report-get.js +9 -0
- package/dist/features/timeline/ptm-report/api/use-ptm-report-get.js.map +1 -0
- package/dist/features/timeline/ptm-report/comps/key-need/key-need-styled.js +9 -0
- package/dist/features/timeline/ptm-report/comps/key-need/key-need-styled.js.map +1 -0
- package/dist/features/timeline/ptm-report/comps/key-need/key-need.js +35 -0
- package/dist/features/timeline/ptm-report/comps/key-need/key-need.js.map +1 -0
- package/dist/features/timeline/ptm-report/comps/parent-support/parent-support.js +53 -0
- package/dist/features/timeline/ptm-report/comps/parent-support/parent-support.js.map +1 -0
- package/dist/features/timeline/ptm-report/comps/real-world-projects/real-world-projects-styled.js +19 -0
- package/dist/features/timeline/ptm-report/comps/real-world-projects/real-world-projects-styled.js.map +1 -0
- package/dist/features/timeline/ptm-report/comps/real-world-projects/real-world-projects.js +50 -0
- package/dist/features/timeline/ptm-report/comps/real-world-projects/real-world-projects.js.map +1 -0
- package/dist/features/timeline/ptm-report/comps/report-card/report-card-styled.js +9 -0
- package/dist/features/timeline/ptm-report/comps/report-card/report-card-styled.js.map +1 -0
- package/dist/features/timeline/ptm-report/comps/report-card/report-card.js +22 -0
- package/dist/features/timeline/ptm-report/comps/report-card/report-card.js.map +1 -0
- package/dist/features/timeline/ptm-report/comps/school-support/school-support-styled.js +9 -0
- package/dist/features/timeline/ptm-report/comps/school-support/school-support-styled.js.map +1 -0
- package/dist/features/timeline/ptm-report/comps/school-support/school-support.js +84 -0
- package/dist/features/timeline/ptm-report/comps/school-support/school-support.js.map +1 -0
- package/dist/features/timeline/ptm-report/comps/strategies/strategies-constant.js +11 -0
- package/dist/features/timeline/ptm-report/comps/strategies/strategies-constant.js.map +1 -0
- package/dist/features/timeline/ptm-report/comps/strategies/strategies.js +36 -0
- package/dist/features/timeline/ptm-report/comps/strategies/strategies.js.map +1 -0
- package/dist/features/timeline/ptm-report/comps/strategy-card/strategy-card-styled.js +55 -0
- package/dist/features/timeline/ptm-report/comps/strategy-card/strategy-card-styled.js.map +1 -0
- package/dist/features/timeline/ptm-report/comps/strategy-card/strategy-card.js +35 -0
- package/dist/features/timeline/ptm-report/comps/strategy-card/strategy-card.js.map +1 -0
- package/dist/features/timeline/ptm-report/comps/student-info/student-info-styled.js +21 -0
- package/dist/features/timeline/ptm-report/comps/student-info/student-info-styled.js.map +1 -0
- package/dist/features/timeline/ptm-report/comps/student-info/student-info.js +21 -0
- package/dist/features/timeline/ptm-report/comps/student-info/student-info.js.map +1 -0
- package/dist/features/timeline/ptm-report/comps/support-card/support-card-styled.js +9 -0
- package/dist/features/timeline/ptm-report/comps/support-card/support-card-styled.js.map +1 -0
- package/dist/features/timeline/ptm-report/comps/support-card/support-card.js +30 -0
- package/dist/features/timeline/ptm-report/comps/support-card/support-card.js.map +1 -0
- package/dist/features/timeline/ptm-report/comps/teacher-observations/teacher-observations-constant.js +9 -0
- package/dist/features/timeline/ptm-report/comps/teacher-observations/teacher-observations-constant.js.map +1 -0
- package/dist/features/timeline/ptm-report/comps/teacher-observations/teacher-observations.js +56 -0
- package/dist/features/timeline/ptm-report/comps/teacher-observations/teacher-observations.js.map +1 -0
- package/dist/features/timeline/ptm-report/comps/upcoming-chapters/upcoming-chapters.js +15 -0
- package/dist/features/timeline/ptm-report/comps/upcoming-chapters/upcoming-chapters.js.map +1 -0
- package/dist/features/timeline/ptm-report/ptm-report-constants.js +16 -0
- package/dist/features/timeline/ptm-report/ptm-report-constants.js.map +1 -0
- package/dist/features/timeline/ptm-report/ptm-report-helpers.js +8 -0
- package/dist/features/timeline/ptm-report/ptm-report-helpers.js.map +1 -0
- package/dist/features/timeline/ptm-report/ptm-report-styled.js +11 -0
- package/dist/features/timeline/ptm-report/ptm-report-styled.js.map +1 -0
- package/dist/features/timeline/ptm-report/ptm-report-types.js +5 -0
- package/dist/features/timeline/ptm-report/ptm-report-types.js.map +1 -0
- package/dist/features/timeline/ptm-report/ptm-report.js +113 -0
- package/dist/features/timeline/ptm-report/ptm-report.js.map +1 -0
- package/dist/features/timeline/timeline-tabs/timeline-tabs-types.js +5 -0
- package/dist/features/timeline/timeline-tabs/timeline-tabs-types.js.map +1 -0
- package/dist/features/timeline/timeline-tabs/timeline-tabs.js +41 -0
- package/dist/features/timeline/timeline-tabs/timeline-tabs.js.map +1 -0
- package/dist/features/timeline/timeline-tabs/timeline-tabs.styled.js +37 -0
- package/dist/features/timeline/timeline-tabs/timeline-tabs.styled.js.map +1 -0
- package/dist/features/ui/animated-arc/animated-arc-styled.js +7 -7
- package/dist/features/ui/animated-arc/animated-arc-styled.js.map +1 -1
- package/dist/features/ui/animated-arc/animated-arc.js +37 -26
- package/dist/features/ui/animated-arc/animated-arc.js.map +1 -1
- package/dist/features/ui/linear-progress-bar/linear-progress-bar.js +39 -0
- package/dist/features/ui/linear-progress-bar/linear-progress-bar.js.map +1 -0
- package/dist/features/ui/linear-progress-bar/linear-progress-bar.styled.js +23 -0
- package/dist/features/ui/linear-progress-bar/linear-progress-bar.styled.js.map +1 -0
- package/dist/features/ui/swipable-carousel/swipable-carousel-styled.js +57 -0
- package/dist/features/ui/swipable-carousel/swipable-carousel-styled.js.map +1 -0
- package/dist/features/ui/swipable-carousel/swipable-carousel.js +132 -0
- package/dist/features/ui/swipable-carousel/swipable-carousel.js.map +1 -0
- package/dist/features/ui/swipeable-component/swipeable-component-styled.js.map +1 -0
- package/dist/features/ui/swipeable-component/swipeable-component.js +27 -0
- package/dist/features/ui/swipeable-component/swipeable-component.js.map +1 -0
- package/dist/features/ui/theme/text.js +14 -0
- package/dist/features/ui/theme/text.js.map +1 -1
- package/dist/index.d.ts +231 -25
- package/dist/index.js +588 -568
- package/dist/index.js.map +1 -1
- package/dist/static/2021.0683b580.png +0 -0
- package/dist/static/2022.d34ad7a5.png +0 -0
- package/dist/static/2023.fce87149.png +0 -0
- package/dist/static/2024.a275ee85.png +0 -0
- package/dist/static/2025.677cc187.png +0 -0
- package/dist/static/2026.63763214.png +0 -0
- package/dist/static/2027.b82dc039.png +0 -0
- package/dist/static/2028.580b8cc0.png +0 -0
- package/dist/static/coding-report-icon.91a1e900.svg +1 -0
- package/dist/static/elp-icon.d45b457d.svg +1 -0
- package/dist/static/english-icon.50c2e005.svg +1 -0
- package/dist/static/focus-blue.664be268.svg +1 -0
- package/dist/static/full-report.00112c74.svg +1 -0
- package/dist/static/key.fa0b4c98.svg +1 -0
- package/dist/static/live-session-blue.ec7fa85f.svg +1 -0
- package/dist/static/math-fit-grey.c32f37b3.svg +1 -0
- package/dist/static/no-report.4158fad3.svg +1 -0
- package/dist/static/opened-book-green.faacda34.svg +1 -0
- package/dist/static/percentage-pattern-yellow.6a25e820.svg +1 -0
- package/dist/static/pi-orange.132b108d.svg +1 -0
- package/dist/static/ptm-report-icon.5089218f.svg +1 -0
- package/dist/static/puzzle-purple.60ff4884.svg +1 -0
- package/dist/static/question-mark-yellow.1925aa04.svg +1 -0
- package/dist/static/renewal-blue.1ab3b2d4.svg +1 -0
- package/dist/static/sat-report-icon.4331be86.svg +1 -0
- package/dist/static/science-report-icon.a0014c40.svg +1 -0
- package/dist/static/thumbs-up-green.6a03b9d2.svg +1 -0
- package/dist/static/thumps-down.a1192a62.svg +1 -0
- package/dist/static/thumps-up.caa35a98.svg +1 -0
- package/dist/static/time-purple.ab1a458d.svg +1 -0
- package/package.json +3 -2
- package/dist/features/auth/comps/linear-progress-bar/linear-progress-bar-styled.js +0 -12
- package/dist/features/auth/comps/linear-progress-bar/linear-progress-bar-styled.js.map +0 -1
- package/dist/features/auth/comps/linear-progress-bar/linear-progress-bar.js +0 -34
- package/dist/features/auth/comps/linear-progress-bar/linear-progress-bar.js.map +0 -1
- package/dist/features/circle-games/game-launcher/comps/swipable-component/swipeable-component-styled.js.map +0 -1
- package/dist/features/circle-games/game-launcher/comps/swipable-component/swipeable-component.js +0 -26
- package/dist/features/circle-games/game-launcher/comps/swipable-component/swipeable-component.js.map +0 -1
- /package/dist/features/{circle-games/game-launcher/comps/swipable-component → ui/swipeable-component}/swipeable-component-styled.js +0 -0
|
@@ -1,107 +1,108 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { memo as
|
|
3
|
-
import
|
|
4
|
-
import { useCircleSounds as
|
|
5
|
-
import {
|
|
6
|
-
import N from "../swipable-component/swipeable-component.js";
|
|
1
|
+
import { jsx as o, jsxs as j } from "react/jsx-runtime";
|
|
2
|
+
import { memo as x, forwardRef as A, useRef as S, useState as E, useCallback as u, useMemo as v, createRef as D, useImperativeHandle as F, useEffect as p } from "react";
|
|
3
|
+
import f from "../../../../ui/hooks/use-click-handler.js";
|
|
4
|
+
import { useCircleSounds as H } from "../../../hooks/use-circle-sounds/use-circle-sounds.js";
|
|
5
|
+
import { CarouselItemContainer as K, ExtendedFlexView as V, CarouselIdicatorContainer as W, AllGreenTickLottieWrapper as N } from "./carousel-styled.js";
|
|
7
6
|
import { CarouselIndicator as U } from "./carousel-indicator/carousel-indicator.js";
|
|
8
7
|
import Y from "../../../../ui/lottie-animation/lottie-animation.js";
|
|
9
8
|
import { LOTTIE as q } from "../../../../../assets/lottie/lottie.js";
|
|
10
9
|
import { allGreenTickLottienAimationSettings as z } from "./constants.js";
|
|
11
10
|
import { CircleSoundKey as B } from "../../../hooks/use-circle-sounds/use-circle-sounds-enums.js";
|
|
12
|
-
|
|
11
|
+
import G from "../../../../ui/swipable-carousel/swipable-carousel.js";
|
|
12
|
+
const J = ({
|
|
13
13
|
items: t,
|
|
14
|
-
defaultIndex:
|
|
15
|
-
analyticsSwipeLeft:
|
|
16
|
-
analyticsSwipeRight:
|
|
14
|
+
defaultIndex: n = 0,
|
|
15
|
+
analyticsSwipeLeft: m,
|
|
16
|
+
analyticsSwipeRight: C,
|
|
17
17
|
analyticsIndicatorClick: d,
|
|
18
|
-
playAllGreenTickAnimation:
|
|
18
|
+
playAllGreenTickAnimation: y,
|
|
19
19
|
onAllGreenTickAnimationComplete: a
|
|
20
|
-
},
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
analyticsLabel: p.analyticsLabel,
|
|
30
|
-
analyticsProps: p.analyticsProps
|
|
31
|
-
},
|
|
32
|
-
() => o((e) => e >= t.length - 1 ? e : e + 1)
|
|
33
|
-
), { handleClick: h } = u({
|
|
20
|
+
}, w) => {
|
|
21
|
+
var P;
|
|
22
|
+
const { playSwipeSound: L, play: I } = H(), s = S(!0), c = S(null), [i, l] = E(((P = c.current) == null ? void 0 : P.currentIndex) ?? n), [R, h] = E(!1), { handleClick: O } = f({
|
|
23
|
+
analyticsLabel: C.analyticsLabel,
|
|
24
|
+
analyticsProps: C.analyticsProps
|
|
25
|
+
}), { handleClick: _ } = f({
|
|
26
|
+
analyticsLabel: m.analyticsLabel,
|
|
27
|
+
analyticsProps: m.analyticsProps
|
|
28
|
+
}), { handleClick: T } = f({
|
|
34
29
|
analyticsLabel: d.analyticsLabel,
|
|
35
30
|
analyticsProps: d.analyticsProps
|
|
36
|
-
}),
|
|
37
|
-
|
|
38
|
-
}, [a]),
|
|
31
|
+
}), k = u(() => {
|
|
32
|
+
h(!1), a == null || a();
|
|
33
|
+
}, [a]), M = v(
|
|
39
34
|
() => ({
|
|
40
35
|
name: "complete",
|
|
41
|
-
callback:
|
|
36
|
+
callback: k
|
|
42
37
|
}),
|
|
43
|
-
[
|
|
44
|
-
),
|
|
38
|
+
[k]
|
|
39
|
+
), b = v(() => t.map(() => D()), [t]), g = u(
|
|
40
|
+
(e) => {
|
|
41
|
+
var r;
|
|
42
|
+
e < 0 || e >= t.length || e === i || ((r = c.current) == null || r.goToIndex(e), l(e));
|
|
43
|
+
},
|
|
44
|
+
[i, t.length]
|
|
45
|
+
), $ = u(
|
|
45
46
|
(e) => {
|
|
46
|
-
|
|
47
|
+
L(), T(), l(e), g(e);
|
|
47
48
|
},
|
|
48
|
-
[
|
|
49
|
+
[T, L]
|
|
49
50
|
);
|
|
50
|
-
return
|
|
51
|
-
indicatorRefs:
|
|
52
|
-
currentIndex:
|
|
53
|
-
goToIndex:
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
})
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
}, [i]), c(() => {
|
|
51
|
+
return F(w, () => ({
|
|
52
|
+
indicatorRefs: b,
|
|
53
|
+
currentIndex: i,
|
|
54
|
+
goToIndex: g
|
|
55
|
+
})), p(() => {
|
|
56
|
+
s.current && (s.current = !1);
|
|
57
|
+
}, []), p(() => {
|
|
58
|
+
var e;
|
|
59
|
+
l(((e = c.current) == null ? void 0 : e.currentIndex) ?? n);
|
|
60
|
+
}, [n]), p(() => {
|
|
61
61
|
const e = t.every((r) => r.indicatorType === "green-tick");
|
|
62
|
-
|
|
63
|
-
}, [
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
62
|
+
y && e && (I(B.ALL_ACTIVITIES_COMPLETE), h(!0));
|
|
63
|
+
}, [y, I, t]), /* @__PURE__ */ o(
|
|
64
|
+
G,
|
|
65
|
+
{
|
|
66
|
+
ref: c,
|
|
67
|
+
items: t.map((e, r) => /* @__PURE__ */ o(K, { children: e.element }, r)),
|
|
68
|
+
defaultIndex: n,
|
|
69
|
+
transitionDuration: s.current ? 0 : 300,
|
|
70
|
+
onSwipeLeft: _,
|
|
71
|
+
onSwipeRight: O,
|
|
72
|
+
children: t.length > 1 && /* @__PURE__ */ o(
|
|
73
|
+
V,
|
|
74
|
+
{
|
|
75
|
+
$flexDirection: "row",
|
|
76
|
+
$alignItems: "center",
|
|
77
|
+
$justifyContent: "center",
|
|
78
|
+
$position: "absolute",
|
|
79
|
+
children: /* @__PURE__ */ j(W, { children: [
|
|
80
|
+
R && /* @__PURE__ */ o(N, { children: /* @__PURE__ */ o(
|
|
81
|
+
Y,
|
|
82
|
+
{
|
|
83
|
+
src: q.DAILY_WORK_OUT_COMPLETE,
|
|
84
|
+
settings: z,
|
|
85
|
+
eventListener: M
|
|
86
|
+
}
|
|
87
|
+
) }),
|
|
88
|
+
t.map((e, r) => /* @__PURE__ */ o(
|
|
89
|
+
U,
|
|
90
|
+
{
|
|
91
|
+
ref: b[r],
|
|
92
|
+
indicatorType: e.indicatorType,
|
|
93
|
+
isActive: r === i,
|
|
94
|
+
textToShowInsideIndicator: (r + 1).toString(),
|
|
95
|
+
onClick: () => $(r)
|
|
96
|
+
},
|
|
97
|
+
r
|
|
98
|
+
))
|
|
99
|
+
] })
|
|
100
|
+
}
|
|
101
|
+
)
|
|
102
|
+
}
|
|
103
|
+
);
|
|
104
|
+
}, se = x(A(J));
|
|
104
105
|
export {
|
|
105
|
-
|
|
106
|
+
se as Carousel
|
|
106
107
|
};
|
|
107
108
|
//# sourceMappingURL=carousel.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"carousel.js","sources":["../../../../../../src/features/circle-games/game-launcher/comps/carousel/carousel.tsx"],"sourcesContent":["import {\n type ForwardRefRenderFunction,\n memo,\n useCallback,\n useEffect,\n useMemo,\n useRef,\n useState,\n forwardRef,\n useImperativeHandle,\n createRef,\n} from 'react';\nimport { type AnimationEventName } from 'lottie-web';\n\nimport useClickHandler from '../../../../ui/hooks/use-click-handler';\nimport { useCircleSounds } from '../../../hooks/use-circle-sounds/use-circle-sounds';\nimport * as Styled from './carousel-styled';\nimport type { ICarouselProps, ICarouselRefs } from './carousel-types';\nimport
|
|
1
|
+
{"version":3,"file":"carousel.js","sources":["../../../../../../src/features/circle-games/game-launcher/comps/carousel/carousel.tsx"],"sourcesContent":["import {\n type ForwardRefRenderFunction,\n memo,\n useCallback,\n useEffect,\n useMemo,\n useRef,\n useState,\n forwardRef,\n useImperativeHandle,\n createRef,\n} from 'react';\nimport { type AnimationEventName } from 'lottie-web';\n\nimport useClickHandler from '../../../../ui/hooks/use-click-handler';\nimport { useCircleSounds } from '../../../hooks/use-circle-sounds/use-circle-sounds';\nimport * as Styled from './carousel-styled';\nimport type { ICarouselProps, ICarouselRefs } from './carousel-types';\nimport { CarouselIndicator } from './carousel-indicator/carousel-indicator';\nimport LottieAnimation from '../../../../ui/lottie-animation/lottie-animation';\nimport { LOTTIE } from '../../../../../assets/lottie/lottie';\nimport { allGreenTickLottienAimationSettings } from './constants';\nimport { CircleSoundKey } from '../../../hooks/use-circle-sounds/use-circle-sounds-enums';\nimport type { ISwipableCarouselRefs } from '../../../../ui/swipable-carousel/swipable-carousel-types';\nimport SwipableCarousel from '../../../../ui/swipable-carousel/swipable-carousel';\n\nconst CarouselComponent: ForwardRefRenderFunction<ICarouselRefs, ICarouselProps> = (\n {\n items,\n defaultIndex = 0,\n analyticsSwipeLeft,\n analyticsSwipeRight,\n analyticsIndicatorClick,\n playAllGreenTickAnimation,\n onAllGreenTickAnimationComplete,\n },\n ref,\n) => {\n const { playSwipeSound, play } = useCircleSounds();\n const isFirstMount = useRef(true);\n const carousalRef = useRef<ISwipableCarouselRefs>(null);\n const [currIndex, setCurrIndex] = useState(carousalRef.current?.currentIndex ?? defaultIndex);\n const [playAllGreenTickAnimationLottie, setPlayAllGreenTickAnimationLottie] = useState(false);\n\n const { handleClick: handlePrevClick } = useClickHandler({\n analyticsLabel: analyticsSwipeRight.analyticsLabel,\n analyticsProps: analyticsSwipeRight.analyticsProps,\n });\n\n const { handleClick: handleNextClick } = useClickHandler({\n analyticsLabel: analyticsSwipeLeft.analyticsLabel,\n analyticsProps: analyticsSwipeLeft.analyticsProps,\n });\n\n const { handleClick: handleItemClick } = useClickHandler({\n analyticsLabel: analyticsIndicatorClick.analyticsLabel,\n analyticsProps: analyticsIndicatorClick.analyticsProps,\n });\n\n const onAllGreenTickLottieAnimationComplete = useCallback(() => {\n setPlayAllGreenTickAnimationLottie(false);\n onAllGreenTickAnimationComplete?.();\n }, [onAllGreenTickAnimationComplete]);\n\n const allGreenTickAnimationEvent = useMemo(\n () => ({\n name: 'complete' as AnimationEventName,\n callback: onAllGreenTickLottieAnimationComplete,\n }),\n [onAllGreenTickLottieAnimationComplete],\n );\n\n const indicatorRefs = useMemo(() => items.map(() => createRef<HTMLDivElement>()), [items]);\n\n const goToIndex = useCallback(\n (index: number) => {\n if (index < 0 || index >= items.length || index === currIndex) return;\n carousalRef.current?.goToIndex(index);\n setCurrIndex(index);\n },\n [currIndex, items.length],\n );\n\n const handleCarouselIndicatorClick = useCallback(\n (index: number) => {\n playSwipeSound();\n handleItemClick();\n setCurrIndex(index);\n goToIndex(index);\n },\n [handleItemClick, playSwipeSound],\n );\n\n useImperativeHandle(ref, () => ({\n indicatorRefs,\n currentIndex: currIndex,\n goToIndex,\n }));\n\n useEffect(() => {\n if (isFirstMount.current) {\n isFirstMount.current = false;\n }\n }, []);\n\n useEffect(() => {\n setCurrIndex(carousalRef.current?.currentIndex ?? defaultIndex);\n }, [defaultIndex]);\n\n useEffect(() => {\n const playAnimation = items.every(item => item.indicatorType === 'green-tick');\n\n if (playAllGreenTickAnimation && playAnimation) {\n play(CircleSoundKey.ALL_ACTIVITIES_COMPLETE);\n setPlayAllGreenTickAnimationLottie(true);\n }\n }, [playAllGreenTickAnimation, play, items]);\n\n return (\n <SwipableCarousel\n ref={carousalRef}\n items={items.map((item, index) => (\n <Styled.CarouselItemContainer key={index}>{item.element}</Styled.CarouselItemContainer>\n ))}\n defaultIndex={defaultIndex}\n transitionDuration={isFirstMount.current ? 0 : 300}\n onSwipeLeft={handleNextClick}\n onSwipeRight={handlePrevClick}\n >\n {items.length > 1 && (\n <Styled.ExtendedFlexView\n $flexDirection=\"row\"\n $alignItems=\"center\"\n $justifyContent=\"center\"\n $position=\"absolute\"\n >\n <Styled.CarouselIdicatorContainer>\n {playAllGreenTickAnimationLottie && (\n <Styled.AllGreenTickLottieWrapper>\n <LottieAnimation\n src={LOTTIE.DAILY_WORK_OUT_COMPLETE}\n settings={allGreenTickLottienAimationSettings}\n eventListener={allGreenTickAnimationEvent}\n />\n </Styled.AllGreenTickLottieWrapper>\n )}\n {items.map((item, index) => (\n <CarouselIndicator\n ref={indicatorRefs[index]}\n key={index}\n indicatorType={item.indicatorType}\n isActive={index === currIndex}\n textToShowInsideIndicator={(index + 1).toString()}\n onClick={() => handleCarouselIndicatorClick(index)}\n />\n ))}\n </Styled.CarouselIdicatorContainer>\n </Styled.ExtendedFlexView>\n )}\n </SwipableCarousel>\n );\n};\n\nexport const Carousel = memo(forwardRef(CarouselComponent));\n"],"names":["CarouselComponent","items","defaultIndex","analyticsSwipeLeft","analyticsSwipeRight","analyticsIndicatorClick","playAllGreenTickAnimation","onAllGreenTickAnimationComplete","ref","playSwipeSound","play","useCircleSounds","isFirstMount","useRef","carousalRef","currIndex","setCurrIndex","useState","_a","playAllGreenTickAnimationLottie","setPlayAllGreenTickAnimationLottie","handlePrevClick","useClickHandler","handleNextClick","handleItemClick","onAllGreenTickLottieAnimationComplete","useCallback","allGreenTickAnimationEvent","useMemo","indicatorRefs","createRef","goToIndex","index","handleCarouselIndicatorClick","useImperativeHandle","useEffect","playAnimation","item","CircleSoundKey","jsx","SwipableCarousel","Styled.CarouselItemContainer","Styled.ExtendedFlexView","jsxs","Styled.CarouselIdicatorContainer","Styled.AllGreenTickLottieWrapper","LottieAnimation","LOTTIE","allGreenTickLottienAimationSettings","CarouselIndicator","Carousel","memo","forwardRef"],"mappings":";;;;;;;;;;;AA0BA,MAAMA,IAA6E,CACjF;AAAA,EACE,OAAAC;AAAA,EACA,cAAAC,IAAe;AAAA,EACf,oBAAAC;AAAA,EACA,qBAAAC;AAAA,EACA,yBAAAC;AAAA,EACA,2BAAAC;AAAA,EACA,iCAAAC;AACF,GACAC,MACG;;AACH,QAAM,EAAE,gBAAAC,GAAgB,MAAAC,EAAK,IAAIC,EAAgB,GAC3CC,IAAeC,EAAO,EAAI,GAC1BC,IAAcD,EAA8B,IAAI,GAChD,CAACE,GAAWC,CAAY,IAAIC,IAASC,IAAAJ,EAAY,YAAZ,gBAAAI,EAAqB,iBAAgBhB,CAAY,GACtF,CAACiB,GAAiCC,CAAkC,IAAIH,EAAS,EAAK,GAEtF,EAAE,aAAaI,EAAgB,IA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AChD,SAAS,MAAMC,EAA6BD,CAAK;AAAA,cAAA;AAAA,cAJ5CA;AAAA,YAAA,CAMR;AAAA,UAAA,GACH;AAAA,QAAA;AAAA,MACF;AAAA,IAAA;AAAA,EAAA;AAIR,GAEakB,KAAWC,EAAKC,EAAWpD,CAAiB,CAAC;"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { jsx as
|
|
1
|
+
import { jsx as n } from "react/jsx-runtime";
|
|
2
2
|
import { useRef as N, useCallback as f, useMemo as J, useEffect as X } from "react";
|
|
3
3
|
import { useTheme as $ } from "styled-components";
|
|
4
4
|
import { PLATFORM_EVENTS_STUDENT as B } from "../../../../analytics-events/platform-events-student.js";
|
|
@@ -9,35 +9,35 @@ import A from "../../../../ui/text/text.js";
|
|
|
9
9
|
import { EDeviceType as Q } from "../../../../ui/theme/constants.js";
|
|
10
10
|
import { CIRCLE_ONBOARDING_ANALYTICS_STEPS as S } from "../../../enum/circle-onboarding-steps.js";
|
|
11
11
|
import { CircularGameCard as D } from "../../comps/circular-game-card/circular-game-card.js";
|
|
12
|
-
import j from "
|
|
12
|
+
import j from "../../../../ui/swipeable-component/swipeable-component.js";
|
|
13
13
|
import { SHOW_NUDGE_AFTER_MS as V, SLIDE_TO_LESSON_MS as ee } from "./constants.js";
|
|
14
|
-
import { SwipableArea as
|
|
15
|
-
import { CarouselIndicator as
|
|
16
|
-
import { ProjectType as
|
|
14
|
+
import { SwipableArea as re } from "./use-game-launcher-journey-style.js";
|
|
15
|
+
import { CarouselIndicator as te } from "../../comps/carousel/carousel-indicator/carousel-indicator.js";
|
|
16
|
+
import { ProjectType as i } from "../../../games/web-view/enums/project-type-enum.js";
|
|
17
17
|
const Se = ({
|
|
18
18
|
carouselRefs: o,
|
|
19
19
|
onSegmentClick: d,
|
|
20
20
|
onJourneyComplete: a
|
|
21
21
|
}) => {
|
|
22
22
|
const { device: W } = $(), l = W <= Q.TABLET, L = N([]), c = N(null), C = N(null), { nextCoachmark: u, setJourney: _, endJourney: h } = K(), { onEvent: p } = q(), E = f(
|
|
23
|
-
(
|
|
23
|
+
(t) => {
|
|
24
24
|
p(B.ONBOARDING_STEP_COMPLETED, {
|
|
25
|
-
step:
|
|
25
|
+
step: t
|
|
26
26
|
});
|
|
27
27
|
},
|
|
28
28
|
[p]
|
|
29
29
|
), O = f(
|
|
30
|
-
(
|
|
31
|
-
d(
|
|
30
|
+
(t, e) => {
|
|
31
|
+
d(t, i.PUZZLE), E(S.PUZZLE_ACTIVITY), h(e), a(e);
|
|
32
32
|
},
|
|
33
33
|
[h, a, d, E]
|
|
34
34
|
), y = f(
|
|
35
|
-
(
|
|
36
|
-
d(
|
|
35
|
+
(t, e) => {
|
|
36
|
+
d(t, i.LESSON), E(S.SKILL_ACTIVITY), h(e), a(e);
|
|
37
37
|
},
|
|
38
38
|
[h, a, d, E]
|
|
39
39
|
), R = f(
|
|
40
|
-
(
|
|
40
|
+
(t, e) => {
|
|
41
41
|
var G, w, x, P, U, Y, Z, k, H, M, z;
|
|
42
42
|
const T = (G = o.current) == null ? void 0 : G.indicatorRefs, s = ((x = (w = c.current) == null ? void 0 : w.circularCardWrapperRef.current) == null ? void 0 : x.getBoundingClientRect()) || {
|
|
43
43
|
height: 0,
|
|
@@ -49,56 +49,56 @@ const Se = ({
|
|
|
49
49
|
(P = e == null ? void 0 : e.games) != null && P.data.length && ((U = e == null ? void 0 : e.puzzles) != null && U.data.length) && g.push(
|
|
50
50
|
{
|
|
51
51
|
projectData: e.games.data[0],
|
|
52
|
-
type:
|
|
52
|
+
type: i.GAME
|
|
53
53
|
},
|
|
54
54
|
{
|
|
55
55
|
projectData: e.puzzles.data[0],
|
|
56
|
-
type:
|
|
56
|
+
type: i.PUZZLE
|
|
57
57
|
}
|
|
58
58
|
), (Y = e == null ? void 0 : e.lessons) != null && Y.data.length && g.push(
|
|
59
|
-
{ projectData: e.lessons.data[0], type:
|
|
60
|
-
{ projectData: e.lessons.data[1], type:
|
|
59
|
+
{ projectData: e.lessons.data[0], type: i.LESSON },
|
|
60
|
+
{ projectData: e.lessons.data[1], type: i.LESSON }
|
|
61
61
|
);
|
|
62
|
-
const
|
|
62
|
+
const r = g[1];
|
|
63
63
|
p(B.ONBOARDING_STEP_VIEWED, {
|
|
64
|
-
step: ((Z = g[0]) == null ? void 0 : Z.type) ===
|
|
64
|
+
step: ((Z = g[0]) == null ? void 0 : Z.type) === i.LESSON ? S.SKILL_ACTIVITY : S.GAMES_ACTIVITY
|
|
65
65
|
});
|
|
66
66
|
const F = [
|
|
67
67
|
l ? {
|
|
68
68
|
originalElementToHighlightRef: c.current.circularCardWrapperRef,
|
|
69
69
|
type: I.NUDGE,
|
|
70
|
-
elementToHighlight: /* @__PURE__ */
|
|
70
|
+
elementToHighlight: /* @__PURE__ */ n(
|
|
71
71
|
j,
|
|
72
72
|
{
|
|
73
73
|
onSwipeLeft: () => {
|
|
74
74
|
var m;
|
|
75
|
-
(m = o.current) == null || m.goToIndex(1), u(
|
|
75
|
+
(m = o.current) == null || m.goToIndex(1), u(t, !1, V);
|
|
76
76
|
},
|
|
77
|
-
children: /* @__PURE__ */
|
|
77
|
+
children: /* @__PURE__ */ n(re, {})
|
|
78
78
|
}
|
|
79
79
|
),
|
|
80
80
|
indicator: {
|
|
81
81
|
nudge: "swipe",
|
|
82
|
-
content: /* @__PURE__ */
|
|
82
|
+
content: /* @__PURE__ */ n(A, { $renderAs: "ab2-bold", children: "Swipe to explore" }),
|
|
83
83
|
nudgePointerX: s.width / 2 - 30,
|
|
84
84
|
nudgePointerY: s.height / 2
|
|
85
85
|
}
|
|
86
86
|
} : {
|
|
87
87
|
originalElementToHighlightRef: T[1],
|
|
88
88
|
type: I.NUDGE,
|
|
89
|
-
elementToHighlight: /* @__PURE__ */
|
|
90
|
-
|
|
89
|
+
elementToHighlight: /* @__PURE__ */ n(
|
|
90
|
+
te,
|
|
91
91
|
{
|
|
92
92
|
textToShowInsideIndicator: "2",
|
|
93
93
|
onClick: () => {
|
|
94
94
|
var m;
|
|
95
|
-
(m = o.current) == null || m.goToIndex(1), u(
|
|
95
|
+
(m = o.current) == null || m.goToIndex(1), u(t, !1, V);
|
|
96
96
|
}
|
|
97
97
|
}
|
|
98
98
|
),
|
|
99
99
|
indicator: {
|
|
100
100
|
nudge: "click",
|
|
101
|
-
content: /* @__PURE__ */
|
|
101
|
+
content: /* @__PURE__ */ n(A, { $renderAs: "ab1-bold", children: "Click to proceed" }),
|
|
102
102
|
nudgePointerX: 0,
|
|
103
103
|
nudgePointerY: 0
|
|
104
104
|
}
|
|
@@ -106,32 +106,32 @@ const Se = ({
|
|
|
106
106
|
{
|
|
107
107
|
originalElementToHighlightRef: C.current.circularCardWrapperRef,
|
|
108
108
|
type: I.NUDGE,
|
|
109
|
-
elementToHighlight: /* @__PURE__ */
|
|
109
|
+
elementToHighlight: /* @__PURE__ */ n(
|
|
110
110
|
D,
|
|
111
111
|
{
|
|
112
112
|
label: "",
|
|
113
113
|
data: {
|
|
114
|
-
card: ((k =
|
|
115
|
-
name: ((H =
|
|
114
|
+
card: ((k = r == null ? void 0 : r.projectData) == null ? void 0 : k.cardLottie) ?? "",
|
|
115
|
+
name: ((H = r == null ? void 0 : r.projectData) == null ? void 0 : H.name) ?? "",
|
|
116
116
|
isCompleted: !1,
|
|
117
|
-
displayNameImage: (M =
|
|
117
|
+
displayNameImage: (M = r == null ? void 0 : r.projectData) == null ? void 0 : M.displayNameImage,
|
|
118
118
|
onPress: () => {
|
|
119
|
-
(
|
|
119
|
+
(r == null ? void 0 : r.type) === i.LESSON && y(r.projectData, t), (r == null ? void 0 : r.type) === i.PUZZLE && O(r.projectData, t);
|
|
120
120
|
}
|
|
121
121
|
}
|
|
122
122
|
}
|
|
123
123
|
),
|
|
124
124
|
indicator: {
|
|
125
125
|
nudge: "click",
|
|
126
|
-
content: /* @__PURE__ */
|
|
126
|
+
content: /* @__PURE__ */ n(A, { $renderAs: l ? "ab2-bold" : "ab1-bold", children: l ? "Tap to start" : " Click to start" }),
|
|
127
127
|
nudgePointerX: l ? s.width / 2 : s.width / 1.3,
|
|
128
128
|
nudgePointerY: l ? s.height / 2 : s.height / 1.3
|
|
129
129
|
}
|
|
130
130
|
}
|
|
131
131
|
];
|
|
132
|
-
_(
|
|
132
|
+
_(t, F), (z = o.current) == null || z.goToIndex(0);
|
|
133
133
|
const b = setTimeout(() => {
|
|
134
|
-
clearTimeout(b), u(
|
|
134
|
+
clearTimeout(b), u(t);
|
|
135
135
|
}, ee);
|
|
136
136
|
L.current.push(b);
|
|
137
137
|
},
|
|
@@ -153,7 +153,7 @@ const Se = ({
|
|
|
153
153
|
[R]
|
|
154
154
|
);
|
|
155
155
|
return X(() => () => {
|
|
156
|
-
L.current.forEach((
|
|
156
|
+
L.current.forEach((t) => clearTimeout(t)), L.current = [];
|
|
157
157
|
}, [o]), v;
|
|
158
158
|
};
|
|
159
159
|
export {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-game-launcher-journey.js","sources":["../../../../../../src/features/circle-games/game-launcher/hooks/use-game-launcher-journey/use-game-launcher-journey.tsx"],"sourcesContent":["import { useCallback, useEffect, useMemo, useRef } from 'react';\nimport { useTheme } from 'styled-components';\n\nimport {\n PLATFORM_EVENTS_STUDENT as AnalyticsLabel,\n PLATFORM_EVENTS_STUDENT,\n} from '../../../../analytics-events/platform-events-student';\nimport { type JOURNEY_ID_STUDENT } from '../../../../journey/journey-id/journey-id-student';\nimport { IndicatorType } from '../../../../journey/use-journey/constants';\nimport type { TCoachmarkJourneyProps } from '../../../../journey/use-journey/journey-context-types';\nimport { useJourney } from '../../../../journey/use-journey/use-journey';\nimport { useUIContext } from '../../../../ui/context/context';\nimport type { INudgeProps } from '../../../../ui/nudge/nudge-types';\nimport Text from '../../../../ui/text/text';\nimport { EDeviceType } from '../../../../ui/theme/constants';\nimport { CIRCLE_ONBOARDING_ANALYTICS_STEPS as ActionEvent } from '../../../enum/circle-onboarding-steps';\nimport { ProjectType } from '../../../games/web-view/enums';\nimport { CircularGameCard } from '../../comps/circular-game-card/circular-game-card';\nimport { type ICircularGameCardRefs } from '../../comps/circular-game-card/circular-game-card-types';\nimport SwipeableCard from '../../comps/swipable-component/swipeable-component';\nimport type {\n Lesson,\n Puzzle,\n} from '../../dal/use-get-circle-home-details-dal/use-get-circle-home-dal-types';\nimport { type IProjectData } from '../../game-launcher-types';\nimport { SHOW_NUDGE_AFTER_MS, SLIDE_TO_LESSON_MS } from './constants';\nimport type { IUseGameLauncherJourneyProps } from './use-game-launcher-journey-types';\nimport { SwipableArea } from './use-game-launcher-journey-style';\nimport { CarouselIndicator } from '../../comps/carousel/carousel-indicator/carousel-indicator';\n\nexport const useGameLauncherJourney = ({\n carouselRefs,\n onSegmentClick,\n onJourneyComplete,\n}: IUseGameLauncherJourneyProps) => {\n const { device } = useTheme();\n const isCompact = device <= EDeviceType.TABLET;\n\n const timerRefs = useRef<ReturnType<typeof setTimeout>[]>([]);\n\n const firstCardRefs = useRef<ICircularGameCardRefs>(null);\n const secondCardRefs = useRef<ICircularGameCardRefs>(null);\n const { nextCoachmark, setJourney, endJourney } = useJourney();\n const { onEvent: trackAnalytics } = useUIContext();\n\n const trackEventCompleted = useCallback(\n (step: ActionEvent) => {\n trackAnalytics(AnalyticsLabel.ONBOARDING_STEP_COMPLETED, {\n step,\n });\n },\n [trackAnalytics],\n );\n\n const handleEndJourneyForPuzzle = useCallback(\n (puzzlesData: Puzzle, journeyId: JOURNEY_ID_STUDENT) => {\n onSegmentClick(puzzlesData, ProjectType.PUZZLE);\n trackEventCompleted(ActionEvent.PUZZLE_ACTIVITY);\n endJourney(journeyId);\n onJourneyComplete(journeyId);\n },\n [endJourney, onJourneyComplete, onSegmentClick, trackEventCompleted],\n );\n\n const handleEndJourneyForLesson = useCallback(\n (lessonsData: Lesson, journeyId: JOURNEY_ID_STUDENT) => {\n onSegmentClick(lessonsData, ProjectType.LESSON);\n trackEventCompleted(ActionEvent.SKILL_ACTIVITY);\n endJourney(journeyId);\n onJourneyComplete(journeyId);\n },\n [endJourney, onJourneyComplete, onSegmentClick, trackEventCompleted],\n );\n\n const startJourney = useCallback(\n (journeyId: JOURNEY_ID_STUDENT, projectData?: IProjectData) => {\n const paginationList = carouselRefs.current?.indicatorRefs;\n\n const launcherDims =\n firstCardRefs.current?.circularCardWrapperRef.current?.getBoundingClientRect() || {\n height: 0,\n width: 0,\n };\n\n // Exit early if required refs or data are missing\n if (paginationList?.length < 2 || !secondCardRefs.current || !firstCardRefs.current) {\n return;\n }\n\n // prepare journey projects based on the data available as\n // games and puzzles are not aviailbale for K-1\n const journeyProjectsData = [];\n\n if (projectData?.games?.data.length && projectData?.puzzles?.data.length) {\n journeyProjectsData.push(\n {\n projectData: projectData.games.data[0],\n type: ProjectType.GAME,\n },\n {\n projectData: projectData.puzzles.data[0],\n type: ProjectType.PUZZLE,\n },\n );\n }\n\n if (projectData?.lessons?.data.length) {\n journeyProjectsData.push(\n { projectData: projectData.lessons.data[0], type: ProjectType.LESSON },\n { projectData: projectData.lessons.data[1], type: ProjectType.LESSON },\n );\n }\n\n const secondProjectData = journeyProjectsData[1];\n\n trackAnalytics(PLATFORM_EVENTS_STUDENT.ONBOARDING_STEP_VIEWED, {\n step:\n journeyProjectsData[0]?.type === ProjectType.LESSON\n ? ActionEvent.SKILL_ACTIVITY\n : ActionEvent.GAMES_ACTIVITY,\n });\n\n const coachmarks: TCoachmarkJourneyProps[] = [\n isCompact\n ? {\n originalElementToHighlightRef: firstCardRefs.current.circularCardWrapperRef,\n type: IndicatorType.NUDGE,\n elementToHighlight: (\n <SwipeableCard\n onSwipeLeft={() => {\n carouselRefs.current?.goToIndex(1);\n nextCoachmark(journeyId, false, SHOW_NUDGE_AFTER_MS);\n }}\n >\n <SwipableArea />\n </SwipeableCard>\n ),\n indicator: {\n nudge: 'swipe',\n content: <Text $renderAs=\"ab2-bold\">Swipe to explore</Text>,\n nudgePointerX: launcherDims.width / 2 - 30,\n nudgePointerY: launcherDims.height / 2,\n } as INudgeProps,\n }\n : {\n originalElementToHighlightRef: paginationList[1] as React.RefObject<HTMLDivElement>,\n type: IndicatorType.NUDGE,\n elementToHighlight: (\n <CarouselIndicator\n textToShowInsideIndicator=\"2\"\n onClick={() => {\n carouselRefs.current?.goToIndex(1);\n nextCoachmark(journeyId, false, SHOW_NUDGE_AFTER_MS);\n }}\n />\n ),\n indicator: {\n nudge: 'click',\n content: <Text $renderAs=\"ab1-bold\">Click to proceed</Text>,\n nudgePointerX: 0,\n nudgePointerY: 0,\n } as INudgeProps,\n },\n {\n originalElementToHighlightRef: secondCardRefs.current.circularCardWrapperRef,\n type: IndicatorType.NUDGE,\n elementToHighlight: (\n <CircularGameCard\n label=\"\"\n data={{\n card: secondProjectData?.projectData?.cardLottie ?? '',\n name: secondProjectData?.projectData?.name ?? '',\n isCompleted: false,\n displayNameImage: secondProjectData?.projectData?.displayNameImage,\n onPress: () => {\n if (secondProjectData?.type === ProjectType.LESSON) {\n handleEndJourneyForLesson(secondProjectData.projectData as Lesson, journeyId);\n }\n\n if (secondProjectData?.type === ProjectType.PUZZLE) {\n handleEndJourneyForPuzzle(secondProjectData.projectData as Puzzle, journeyId);\n }\n },\n }}\n />\n ),\n indicator: {\n nudge: 'click',\n content: (\n <Text $renderAs={isCompact ? 'ab2-bold' : 'ab1-bold'}>\n {isCompact ? 'Tap to start' : ' Click to start'}\n </Text>\n ),\n nudgePointerX: isCompact ? launcherDims.width / 2 : launcherDims.width / 1.3,\n nudgePointerY: isCompact ? launcherDims.height / 2 : launcherDims.height / 1.3,\n } as INudgeProps,\n },\n ];\n\n setJourney(journeyId, coachmarks);\n carouselRefs.current?.goToIndex(0);\n const delayBeforeStart = setTimeout(() => {\n clearTimeout(delayBeforeStart);\n nextCoachmark(journeyId);\n }, SLIDE_TO_LESSON_MS);\n\n timerRefs.current.push(delayBeforeStart);\n },\n [\n carouselRefs,\n trackAnalytics,\n isCompact,\n setJourney,\n nextCoachmark,\n handleEndJourneyForLesson,\n handleEndJourneyForPuzzle,\n ],\n );\n\n const data = useMemo(\n () => ({\n firstCardRefs,\n secondCardRefs,\n startJourney,\n }),\n [startJourney],\n );\n\n // Cleanup on unmount\n useEffect(() => {\n return () => {\n timerRefs.current.forEach(timer => clearTimeout(timer));\n timerRefs.current = [];\n };\n }, [carouselRefs]);\n\n return data;\n};\n"],"names":["useGameLauncherJourney","carouselRefs","onSegmentClick","onJourneyComplete","device","useTheme","isCompact","EDeviceType","timerRefs","useRef","firstCardRefs","secondCardRefs","nextCoachmark","setJourney","endJourney","useJourney","trackAnalytics","useUIContext","trackEventCompleted","useCallback","step","AnalyticsLabel","handleEndJourneyForPuzzle","puzzlesData","journeyId","ProjectType","ActionEvent","handleEndJourneyForLesson","lessonsData","startJourney","projectData","paginationList","_a","launcherDims","_c","_b","journeyProjectsData","_d","_e","_f","secondProjectData","PLATFORM_EVENTS_STUDENT","_g","coachmarks","IndicatorType","jsx","SwipeableCard","SHOW_NUDGE_AFTER_MS","SwipableArea","Text","CarouselIndicator","CircularGameCard","_h","_i","_j","_k","delayBeforeStart","SLIDE_TO_LESSON_MS","data","useMemo","useEffect","timer"],"mappings":";;;;;;;;;;;;;;;;AA8BO,MAAMA,KAAyB,CAAC;AAAA,EACrC,cAAAC;AAAA,EACA,gBAAAC;AAAA,EACA,mBAAAC;AACF,MAAoC;AAC5B,QAAA,EAAE,QAAAC,MAAWC,KACbC,IAAYF,KAAUG,EAAY,QAElCC,IAAYC,EAAwC,CAAA,CAAE,GAEtDC,IAAgBD,EAA8B,IAAI,GAClDE,IAAiBF,EAA8B,IAAI,GACnD,EAAE,eAAAG,GAAe,YAAAC,GAAY,YAAAC,MAAeC,EAAW,GACvD,EAAE,SAASC,EAAe,IAAIC,EAAa,GAE3CC,IAAsBC;AAAA,IAC1B,CAACC,MAAsB;AACrB,MAAAJ,EAAeK,EAAe,2BAA2B;AAAA,QACvD,MAAAD;AAAA,MAAA,CACD;AAAA,IACH;AAAA,IACA,CAACJ,CAAc;AAAA,EAAA,GAGXM,IAA4BH;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AAA,SACtBiC,EAAkB;AAEX,MAAAjD,EAAA,QAAQ,KAAKgD,CAAgB;AAAA,IACzC;AAAA,IACA;AAAA,MACEvD;AAAA,MACAe;AAAA,MACAV;AAAA,MACAO;AAAA,MACAD;AAAA,MACAe;AAAA,MACAL;AAAA,IACF;AAAA,EAAA,GAGIoC,IAAOC;AAAA,IACX,OAAO;AAAA,MACL,eAAAjD;AAAA,MACA,gBAAAC;AAAA,MACA,cAAAkB;AAAA,IAAA;AAAA,IAEF,CAACA,CAAY;AAAA,EAAA;AAIf,SAAA+B,EAAU,MACD,MAAM;AACX,IAAApD,EAAU,QAAQ,QAAQ,CAASqD,MAAA,aAAaA,CAAK,CAAC,GACtDrD,EAAU,UAAU;EAAC,GAEtB,CAACP,CAAY,CAAC,GAEVyD;AACT;"}
|
|
1
|
+
{"version":3,"file":"use-game-launcher-journey.js","sources":["../../../../../../src/features/circle-games/game-launcher/hooks/use-game-launcher-journey/use-game-launcher-journey.tsx"],"sourcesContent":["import { useCallback, useEffect, useMemo, useRef } from 'react';\nimport { useTheme } from 'styled-components';\n\nimport {\n PLATFORM_EVENTS_STUDENT as AnalyticsLabel,\n PLATFORM_EVENTS_STUDENT,\n} from '../../../../analytics-events/platform-events-student';\nimport { type JOURNEY_ID_STUDENT } from '../../../../journey/journey-id/journey-id-student';\nimport { IndicatorType } from '../../../../journey/use-journey/constants';\nimport type { TCoachmarkJourneyProps } from '../../../../journey/use-journey/journey-context-types';\nimport { useJourney } from '../../../../journey/use-journey/use-journey';\nimport { useUIContext } from '../../../../ui/context/context';\nimport type { INudgeProps } from '../../../../ui/nudge/nudge-types';\nimport Text from '../../../../ui/text/text';\nimport { EDeviceType } from '../../../../ui/theme/constants';\nimport { CIRCLE_ONBOARDING_ANALYTICS_STEPS as ActionEvent } from '../../../enum/circle-onboarding-steps';\nimport { ProjectType } from '../../../games/web-view/enums';\nimport { CircularGameCard } from '../../comps/circular-game-card/circular-game-card';\nimport { type ICircularGameCardRefs } from '../../comps/circular-game-card/circular-game-card-types';\nimport SwipeableCard from '../../../../ui/swipeable-component/swipeable-component';\nimport type {\n Lesson,\n Puzzle,\n} from '../../dal/use-get-circle-home-details-dal/use-get-circle-home-dal-types';\nimport { type IProjectData } from '../../game-launcher-types';\nimport { SHOW_NUDGE_AFTER_MS, SLIDE_TO_LESSON_MS } from './constants';\nimport type { IUseGameLauncherJourneyProps } from './use-game-launcher-journey-types';\nimport { SwipableArea } from './use-game-launcher-journey-style';\nimport { CarouselIndicator } from '../../comps/carousel/carousel-indicator/carousel-indicator';\n\nexport const useGameLauncherJourney = ({\n carouselRefs,\n onSegmentClick,\n onJourneyComplete,\n}: IUseGameLauncherJourneyProps) => {\n const { device } = useTheme();\n const isCompact = device <= EDeviceType.TABLET;\n\n const timerRefs = useRef<ReturnType<typeof setTimeout>[]>([]);\n\n const firstCardRefs = useRef<ICircularGameCardRefs>(null);\n const secondCardRefs = useRef<ICircularGameCardRefs>(null);\n const { nextCoachmark, setJourney, endJourney } = useJourney();\n const { onEvent: trackAnalytics } = useUIContext();\n\n const trackEventCompleted = useCallback(\n (step: ActionEvent) => {\n trackAnalytics(AnalyticsLabel.ONBOARDING_STEP_COMPLETED, {\n step,\n });\n },\n [trackAnalytics],\n );\n\n const handleEndJourneyForPuzzle = useCallback(\n (puzzlesData: Puzzle, journeyId: JOURNEY_ID_STUDENT) => {\n onSegmentClick(puzzlesData, ProjectType.PUZZLE);\n trackEventCompleted(ActionEvent.PUZZLE_ACTIVITY);\n endJourney(journeyId);\n onJourneyComplete(journeyId);\n },\n [endJourney, onJourneyComplete, onSegmentClick, trackEventCompleted],\n );\n\n const handleEndJourneyForLesson = useCallback(\n (lessonsData: Lesson, journeyId: JOURNEY_ID_STUDENT) => {\n onSegmentClick(lessonsData, ProjectType.LESSON);\n trackEventCompleted(ActionEvent.SKILL_ACTIVITY);\n endJourney(journeyId);\n onJourneyComplete(journeyId);\n },\n [endJourney, onJourneyComplete, onSegmentClick, trackEventCompleted],\n );\n\n const startJourney = useCallback(\n (journeyId: JOURNEY_ID_STUDENT, projectData?: IProjectData) => {\n const paginationList = carouselRefs.current?.indicatorRefs;\n\n const launcherDims =\n firstCardRefs.current?.circularCardWrapperRef.current?.getBoundingClientRect() || {\n height: 0,\n width: 0,\n };\n\n // Exit early if required refs or data are missing\n if (paginationList?.length < 2 || !secondCardRefs.current || !firstCardRefs.current) {\n return;\n }\n\n // prepare journey projects based on the data available as\n // games and puzzles are not aviailbale for K-1\n const journeyProjectsData = [];\n\n if (projectData?.games?.data.length && projectData?.puzzles?.data.length) {\n journeyProjectsData.push(\n {\n projectData: projectData.games.data[0],\n type: ProjectType.GAME,\n },\n {\n projectData: projectData.puzzles.data[0],\n type: ProjectType.PUZZLE,\n },\n );\n }\n\n if (projectData?.lessons?.data.length) {\n journeyProjectsData.push(\n { projectData: projectData.lessons.data[0], type: ProjectType.LESSON },\n { projectData: projectData.lessons.data[1], type: ProjectType.LESSON },\n );\n }\n\n const secondProjectData = journeyProjectsData[1];\n\n trackAnalytics(PLATFORM_EVENTS_STUDENT.ONBOARDING_STEP_VIEWED, {\n step:\n journeyProjectsData[0]?.type === ProjectType.LESSON\n ? ActionEvent.SKILL_ACTIVITY\n : ActionEvent.GAMES_ACTIVITY,\n });\n\n const coachmarks: TCoachmarkJourneyProps[] = [\n isCompact\n ? {\n originalElementToHighlightRef: firstCardRefs.current.circularCardWrapperRef,\n type: IndicatorType.NUDGE,\n elementToHighlight: (\n <SwipeableCard\n onSwipeLeft={() => {\n carouselRefs.current?.goToIndex(1);\n nextCoachmark(journeyId, false, SHOW_NUDGE_AFTER_MS);\n }}\n >\n <SwipableArea />\n </SwipeableCard>\n ),\n indicator: {\n nudge: 'swipe',\n content: <Text $renderAs=\"ab2-bold\">Swipe to explore</Text>,\n nudgePointerX: launcherDims.width / 2 - 30,\n nudgePointerY: launcherDims.height / 2,\n } as INudgeProps,\n }\n : {\n originalElementToHighlightRef: paginationList[1] as React.RefObject<HTMLDivElement>,\n type: IndicatorType.NUDGE,\n elementToHighlight: (\n <CarouselIndicator\n textToShowInsideIndicator=\"2\"\n onClick={() => {\n carouselRefs.current?.goToIndex(1);\n nextCoachmark(journeyId, false, SHOW_NUDGE_AFTER_MS);\n }}\n />\n ),\n indicator: {\n nudge: 'click',\n content: <Text $renderAs=\"ab1-bold\">Click to proceed</Text>,\n nudgePointerX: 0,\n nudgePointerY: 0,\n } as INudgeProps,\n },\n {\n originalElementToHighlightRef: secondCardRefs.current.circularCardWrapperRef,\n type: IndicatorType.NUDGE,\n elementToHighlight: (\n <CircularGameCard\n label=\"\"\n data={{\n card: secondProjectData?.projectData?.cardLottie ?? '',\n name: secondProjectData?.projectData?.name ?? '',\n isCompleted: false,\n displayNameImage: secondProjectData?.projectData?.displayNameImage,\n onPress: () => {\n if (secondProjectData?.type === ProjectType.LESSON) {\n handleEndJourneyForLesson(secondProjectData.projectData as Lesson, journeyId);\n }\n\n if (secondProjectData?.type === ProjectType.PUZZLE) {\n handleEndJourneyForPuzzle(secondProjectData.projectData as Puzzle, journeyId);\n }\n },\n }}\n />\n ),\n indicator: {\n nudge: 'click',\n content: (\n <Text $renderAs={isCompact ? 'ab2-bold' : 'ab1-bold'}>\n {isCompact ? 'Tap to start' : ' Click to start'}\n </Text>\n ),\n nudgePointerX: isCompact ? launcherDims.width / 2 : launcherDims.width / 1.3,\n nudgePointerY: isCompact ? launcherDims.height / 2 : launcherDims.height / 1.3,\n } as INudgeProps,\n },\n ];\n\n setJourney(journeyId, coachmarks);\n carouselRefs.current?.goToIndex(0);\n const delayBeforeStart = setTimeout(() => {\n clearTimeout(delayBeforeStart);\n nextCoachmark(journeyId);\n }, SLIDE_TO_LESSON_MS);\n\n timerRefs.current.push(delayBeforeStart);\n },\n [\n carouselRefs,\n trackAnalytics,\n isCompact,\n setJourney,\n nextCoachmark,\n handleEndJourneyForLesson,\n handleEndJourneyForPuzzle,\n ],\n );\n\n const data = useMemo(\n () => ({\n firstCardRefs,\n secondCardRefs,\n startJourney,\n }),\n [startJourney],\n );\n\n // Cleanup on unmount\n useEffect(() => {\n return () => {\n timerRefs.current.forEach(timer => clearTimeout(timer));\n timerRefs.current = [];\n };\n }, [carouselRefs]);\n\n return data;\n};\n"],"names":["useGameLauncherJourney","carouselRefs","onSegmentClick","onJourneyComplete","device","useTheme","isCompact","EDeviceType","timerRefs","useRef","firstCardRefs","secondCardRefs","nextCoachmark","setJourney","endJourney","useJourney","trackAnalytics","useUIContext","trackEventCompleted","useCallback","step","AnalyticsLabel","handleEndJourneyForPuzzle","puzzlesData","journeyId","ProjectType","ActionEvent","handleEndJourneyForLesson","lessonsData","startJourney","projectData","paginationList","_a","launcherDims","_c","_b","journeyProjectsData","_d","_e","_f","secondProjectData","PLATFORM_EVENTS_STUDENT","_g","coachmarks","IndicatorType","jsx","SwipeableCard","SHOW_NUDGE_AFTER_MS","SwipableArea","Text","CarouselIndicator","CircularGameCard","_h","_i","_j","_k","delayBeforeStart","SLIDE_TO_LESSON_MS","data","useMemo","useEffect","timer"],"mappings":";;;;;;;;;;;;;;;;AA8BO,MAAMA,KAAyB,CAAC;AAAA,EACrC,cAAAC;AAAA,EACA,gBAAAC;AAAA,EACA,mBAAAC;AACF,MAAoC;AAC5B,QAAA,EAAE,QAAAC,MAAWC,KACbC,IAAYF,KAAUG,EAAY,QAElCC,IAAYC,EAAwC,CAAA,CAAE,GAEtDC,IAAgBD,EAA8B,IAAI,GAClDE,IAAiBF,EAA8B,IAAI,GACnD,EAAE,eAAAG,GAAe,YAAAC,GAAY,YAAAC,MAAeC,EAAW,GACvD,EAAE,SAASC,EAAe,IAAIC,EAAa,GAE3CC,IAAsBC;AAAA,IAC1B,CAACC,MAAsB;AACrB,MAAAJ,EAAeK,EAAe,2BAA2B;AAAA,QACvD,MAAAD;AAAA,MAAA,CACD;AAAA,IACH;AAAA,IACA,CAACJ,CAAc;AAAA,EAAA,GAGXM,IAA4BH;AAAA,IAChC,CAACI,GAAqBC,MAAkC;AACvC,MAAAtB,EAAAqB,GA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gB;AAAA,IACzC;AAAA,IACA;AAAA,MACEvD;AAAA,MACAe;AAAA,MACAV;AAAA,MACAO;AAAA,MACAD;AAAA,MACAe;AAAA,MACAL;AAAA,IACF;AAAA,EAAA,GAGIoC,IAAOC;AAAA,IACX,OAAO;AAAA,MACL,eAAAjD;AAAA,MACA,gBAAAC;AAAA,MACA,cAAAkB;AAAA,IAAA;AAAA,IAEF,CAACA,CAAY;AAAA,EAAA;AAIf,SAAA+B,EAAU,MACD,MAAM;AACX,IAAApD,EAAU,QAAQ,QAAQ,CAASqD,MAAA,aAAaA,CAAK,CAAC,GACtDrD,EAAU,UAAU;EAAC,GAEtB,CAACP,CAAY,CAAC,GAEVyD;AACT;"}
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { jsx as t, jsxs as o } from "react/jsx-runtime";
|
|
2
2
|
import { memo as a } from "react";
|
|
3
3
|
import c from "../ui/layout/flex-view.js";
|
|
4
|
-
import
|
|
5
|
-
const
|
|
6
|
-
/* @__PURE__ */ t(c, { $background: "BLACK_T_60", $width: "fit-content", $gutterX: 0.25, children: /* @__PURE__ */ t(
|
|
7
|
-
/* @__PURE__ */ t(
|
|
4
|
+
import n from "../ui/text/text.js";
|
|
5
|
+
const i = ({ label: r, title: l }) => /* @__PURE__ */ o(c, { children: [
|
|
6
|
+
/* @__PURE__ */ t(c, { $background: "BLACK_T_60", $width: "fit-content", $gutterX: 0.25, children: /* @__PURE__ */ t(n, { $color: "WHITE", $renderAs: "ac4-black", children: r }) }),
|
|
7
|
+
/* @__PURE__ */ t(n, { $renderAs: "ac4-black", children: l })
|
|
8
8
|
] }), m = ({
|
|
9
9
|
cardHeader: r,
|
|
10
|
-
nodeType:
|
|
11
|
-
courseType:
|
|
12
|
-
}) =>
|
|
10
|
+
nodeType: l,
|
|
11
|
+
courseType: e
|
|
12
|
+
}) => l === "MASTERY" ? /* @__PURE__ */ t(i, { label: "Smart", title: "Practice" }) : e && e === "REMEDIAL" ? /* @__PURE__ */ t(i, { label: "EXTRA", title: r }) : e && e === "EXAM" ? /* @__PURE__ */ t(i, { label: "CUSTOM", title: r }) : /* @__PURE__ */ t(n, { $renderAs: "ac4-black", children: r }), $ = a(m);
|
|
13
13
|
export {
|
|
14
|
-
|
|
14
|
+
$ as default
|
|
15
15
|
};
|
|
16
16
|
//# sourceMappingURL=card-title.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"card-title.js","sources":["../../../src/features/homework/card-title.tsx"],"sourcesContent":["import { memo } from 'react';\n\nimport type { TCourseType, TNodeTypes } from '../chapters-v2/comps/node-card/node-card-types';\nimport FlexView from '../ui/layout/flex-view';\nimport Text from '../ui/text/text';\n\nconst LabelledTitle = ({ label, title }: { label: string; title: string }) => (\n <FlexView>\n <FlexView $background=\"BLACK_T_60\" $width=\"fit-content\" $gutterX={0.25}>\n <Text $color=\"WHITE\" $renderAs=\"ac4-black\">\n {label}\n </Text>\n </FlexView>\n <Text $renderAs=\"ac4-black\">{title}</Text>\n </FlexView>\n);\n\nconst CardTitle = ({\n cardHeader,\n nodeType,\n courseType,\n}: {\n cardHeader: string;\n nodeType: TNodeTypes;\n courseType
|
|
1
|
+
{"version":3,"file":"card-title.js","sources":["../../../src/features/homework/card-title.tsx"],"sourcesContent":["import { memo } from 'react';\n\nimport type { TCourseType, TNodeTypes } from '../chapters-v2/comps/node-card/node-card-types';\nimport FlexView from '../ui/layout/flex-view';\nimport Text from '../ui/text/text';\n\nconst LabelledTitle = ({ label, title }: { label: string; title: string }) => (\n <FlexView>\n <FlexView $background=\"BLACK_T_60\" $width=\"fit-content\" $gutterX={0.25}>\n <Text $color=\"WHITE\" $renderAs=\"ac4-black\">\n {label}\n </Text>\n </FlexView>\n <Text $renderAs=\"ac4-black\">{title}</Text>\n </FlexView>\n);\n\nconst CardTitle = ({\n cardHeader,\n nodeType,\n courseType,\n}: {\n cardHeader: string;\n nodeType: TNodeTypes;\n courseType?: TCourseType;\n}) => {\n if (nodeType === 'MASTERY') {\n return <LabelledTitle label=\"Smart\" title=\"Practice\" />;\n }\n\n if (courseType && courseType === 'REMEDIAL') {\n return <LabelledTitle label=\"EXTRA\" title={cardHeader} />;\n }\n\n if (courseType && courseType === 'EXAM') {\n return <LabelledTitle label=\"CUSTOM\" title={cardHeader} />;\n }\n\n return <Text $renderAs=\"ac4-black\">{cardHeader}</Text>;\n};\n\nexport default memo(CardTitle);\n"],"names":["LabelledTitle","label","title","FlexView","jsx","Text","CardTitle","cardHeader","nodeType","courseType","CardTitle$1","memo"],"mappings":";;;;AAMA,MAAMA,IAAgB,CAAC,EAAE,OAAAC,GAAO,OAAAC,EAAM,wBACnCC,GACC,EAAA,UAAA;AAAA,EAAA,gBAAAC,EAACD,GAAS,EAAA,aAAY,cAAa,QAAO,eAAc,UAAU,MAChE,UAAC,gBAAAC,EAAAC,GAAA,EAAK,QAAO,SAAQ,WAAU,aAC5B,YACH,CAAA,GACF;AAAA,EACC,gBAAAD,EAAAC,GAAA,EAAK,WAAU,aAAa,UAAMH,GAAA;AAAA,EACrC,CAAA,GAGII,IAAY,CAAC;AAAA,EACjB,YAAAC;AAAA,EACA,UAAAC;AAAA,EACA,YAAAC;AACF,MAKMD,MAAa,YACP,gBAAAJ,EAAAJ,GAAA,EAAc,OAAM,SAAQ,OAAM,WAAW,CAAA,IAGnDS,KAAcA,MAAe,aACvB,gBAAAL,EAAAJ,GAAA,EAAc,OAAM,SAAQ,OAAOO,EAAY,CAAA,IAGrDE,KAAcA,MAAe,SACvB,gBAAAL,EAAAJ,GAAA,EAAc,OAAM,UAAS,OAAOO,EAAY,CAAA,IAGlD,gBAAAH,EAAAC,GAAA,EAAK,WAAU,aAAa,UAAWE,EAAA,CAAA,GAGlCG,IAAAC,EAAKL,CAAS;"}
|
|
@@ -2,12 +2,12 @@ import { jsxs as a, jsx as e } from "react/jsx-runtime";
|
|
|
2
2
|
import { memo as f } from "react";
|
|
3
3
|
import { useTheme as p } from "styled-components";
|
|
4
4
|
import { ILLUSTRATIONS as s } from "../../../../assets/illustrations/illustrations.js";
|
|
5
|
-
import l from "../../../
|
|
6
|
-
import d from "../../../ui/image/image.js";
|
|
5
|
+
import l from "../../../ui/image/image.js";
|
|
7
6
|
import t from "../../../ui/layout/flex-view.js";
|
|
8
|
-
import { EDeviceType as
|
|
7
|
+
import { EDeviceType as d } from "../../../ui/theme/constants.js";
|
|
8
|
+
import u from "../../../ui/linear-progress-bar/linear-progress-bar.js";
|
|
9
9
|
const T = ({ progressPercentage: r, showProgress: o, HeaderAvatar: m }) => {
|
|
10
|
-
const { device: i } = p(), n = i <=
|
|
10
|
+
const { device: i } = p(), n = i <= d.TABLET, c = o && r;
|
|
11
11
|
return n ? /* @__PURE__ */ a(
|
|
12
12
|
t,
|
|
13
13
|
{
|
|
@@ -19,7 +19,7 @@ const T = ({ progressPercentage: r, showProgress: o, HeaderAvatar: m }) => {
|
|
|
19
19
|
$flexColumnGapX: c ? 1 : 0,
|
|
20
20
|
children: [
|
|
21
21
|
m,
|
|
22
|
-
o && r ? /* @__PURE__ */ e(
|
|
22
|
+
o && r ? /* @__PURE__ */ e(u, { percentage: r, borderRadius: 8 }) : /* @__PURE__ */ e(t, { $flex: 1, $justifyContent: "center", $alignItems: "center", children: /* @__PURE__ */ e(l, { width: 90, src: s.CIRCLE_CUEMATH_LOGO_WHITE }) })
|
|
23
23
|
]
|
|
24
24
|
}
|
|
25
25
|
) : null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compact-header.js","sources":["../../../../../src/features/parent-dashboard/comps/compact-header/compact-header.tsx"],"sourcesContent":["import { memo } from 'react';\nimport { useTheme } from 'styled-components';\n\nimport { ILLUSTRATIONS } from '../../../../assets/illustrations/illustrations';\nimport
|
|
1
|
+
{"version":3,"file":"compact-header.js","sources":["../../../../../src/features/parent-dashboard/comps/compact-header/compact-header.tsx"],"sourcesContent":["import { memo } from 'react';\nimport { useTheme } from 'styled-components';\n\nimport { ILLUSTRATIONS } from '../../../../assets/illustrations/illustrations';\nimport Image from '../../../ui/image/image';\nimport FlexView from '../../../ui/layout/flex-view';\nimport { EDeviceType } from '../../../ui/theme/constants';\nimport type { ICompactHeaderProps } from './compact-header-types';\nimport LinearProgressBar from '../../../ui/linear-progress-bar/linear-progress-bar';\n\nconst CompactHeader = ({ progressPercentage, showProgress, HeaderAvatar }: ICompactHeaderProps) => {\n const { device } = useTheme();\n const isCompact = device <= EDeviceType.TABLET;\n const showProgressBar = showProgress && progressPercentage;\n\n if (!isCompact) return null;\n\n return (\n <FlexView\n $gutterX={1}\n $gapX={1}\n $flexDirection=\"row\"\n $alignItems=\"center\"\n $background=\"WHITE_T_05\"\n $flexColumnGapX={showProgressBar ? 1 : 0}\n >\n {HeaderAvatar}\n {showProgress && progressPercentage ? (\n <LinearProgressBar percentage={progressPercentage} borderRadius={8} />\n ) : (\n <FlexView $flex={1} $justifyContent=\"center\" $alignItems=\"center\">\n <Image width={90} src={ILLUSTRATIONS.CIRCLE_CUEMATH_LOGO_WHITE} />\n </FlexView>\n )}\n </FlexView>\n );\n};\n\nexport default memo(CompactHeader);\n"],"names":["CompactHeader","progressPercentage","showProgress","HeaderAvatar","device","useTheme","isCompact","EDeviceType","showProgressBar","jsxs","FlexView","jsx","LinearProgressBar","Image","ILLUSTRATIONS","CompactHeader$1","memo"],"mappings":";;;;;;;;AAUA,MAAMA,IAAgB,CAAC,EAAE,oBAAAC,GAAoB,cAAAC,GAAc,cAAAC,QAAwC;AAC3F,QAAA,EAAE,QAAAC,MAAWC,KACbC,IAAYF,KAAUG,EAAY,QAClCC,IAAkBN,KAAgBD;AAEpC,SAACK,IAGH,gBAAAG;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,UAAU;AAAA,MACV,OAAO;AAAA,MACP,gBAAe;AAAA,MACf,aAAY;AAAA,MACZ,aAAY;AAAA,MACZ,iBAAiBF,IAAkB,IAAI;AAAA,MAEtC,UAAA;AAAA,QAAAL;AAAA,QACAD,KAAgBD,IACf,gBAAAU,EAACC,GAAkB,EAAA,YAAYX,GAAoB,cAAc,EAAA,CAAG,IAEpE,gBAAAU,EAACD,GAAS,EAAA,OAAO,GAAG,iBAAgB,UAAS,aAAY,UACvD,UAAC,gBAAAC,EAAAE,GAAA,EAAM,OAAO,IAAI,KAAKC,EAAc,0BAAA,CAA2B,EAClE,CAAA;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA,IAjBiB;AAqBzB,GAEeC,IAAAC,EAAKhB,CAAa;"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { createGetAPI as r, createPatchAPI as o } from "@cuemath/rest-api";
|
|
2
|
+
import { BASE_URL_V1 as e } from "../../../../constants/api.js";
|
|
3
|
+
const { useGet: p, invalidate: a } = r({
|
|
4
|
+
getURL: (t) => `${e}/monthly-progress-reports/${t}`
|
|
5
|
+
}), { usePatch: h } = o({
|
|
6
|
+
getURL: (t) => `${e}/monthly-progress-reports/${t}`
|
|
7
|
+
});
|
|
8
|
+
export {
|
|
9
|
+
a as invalidateMonthlyReport,
|
|
10
|
+
p as useMonthlyReportGet,
|
|
11
|
+
h as useMonthlyReportPatch
|
|
12
|
+
};
|
|
13
|
+
//# sourceMappingURL=use-monthly-report-get.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-monthly-report-get.js","sources":["../../../../../src/features/timeline/monthly-report/api/use-monthly-report-get.ts"],"sourcesContent":["import { createGetAPI, createPatchAPI } from '@cuemath/rest-api';\n\nimport { BASE_URL_V1 } from '../../../../constants/api';\nimport { type IMonthlyReportResponse } from '../monthly-report-types';\n\nconst { useGet: useMonthlyReportGet, invalidate: invalidateMonthlyReport } =\n createGetAPI<IMonthlyReportResponse>({\n getURL: (reportId: string) => {\n return `${BASE_URL_V1}/monthly-progress-reports/${reportId}`;\n },\n });\n\nconst { usePatch: useMonthlyReportPatch } = createPatchAPI<\n IMonthlyReportResponse,\n { feedback: string }\n>({\n getURL: (reportId: string) => {\n return `${BASE_URL_V1}/monthly-progress-reports/${reportId}`;\n },\n});\n\nexport { useMonthlyReportGet, useMonthlyReportPatch, invalidateMonthlyReport };\n"],"names":["useMonthlyReportGet","invalidateMonthlyReport","createGetAPI","reportId","BASE_URL_V1","useMonthlyReportPatch","createPatchAPI"],"mappings":";;AAKA,MAAM,EAAE,QAAQA,GAAqB,YAAYC,EAAA,IAC/CC,EAAqC;AAAA,EACnC,QAAQ,CAACC,MACA,GAAGC,CAAW,6BAA6BD,CAAQ;AAE9D,CAAC,GAEG,EAAE,UAAUE,EAAsB,IAAIC,EAG1C;AAAA,EACA,QAAQ,CAACH,MACA,GAAGC,CAAW,6BAA6BD,CAAQ;AAE9D,CAAC;"}
|