@cuemath/leap 2.8.22 → 2.8.24-hg1
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/images/images.js +0 -12
- package/dist/assets/images/images.js.map +1 -1
- package/dist/assets/lotties/circle/tables/advance-mode-segment-lottie.json.js +4370 -0
- package/dist/assets/lotties/circle/tables/advance-mode-segment-lottie.json.js.map +1 -0
- package/dist/assets/lotties/circle/tables/infinite-button-bg.json.js +1552 -0
- package/dist/assets/lotties/circle/tables/infinite-button-bg.json.js.map +1 -0
- package/dist/assets/lotties/circle/tables/infinite-button-symbol.json.js +1795 -0
- package/dist/assets/lotties/circle/tables/infinite-button-symbol.json.js.map +1 -0
- package/dist/assets/lotties/circle/tables/random-mode-segment-lottie.json.js +9661 -0
- package/dist/assets/lotties/circle/tables/random-mode-segment-lottie.json.js.map +1 -0
- package/dist/assets/lotties/circle/tables/sequence-mode-segment-lottie.json.js +8630 -0
- package/dist/assets/lotties/circle/tables/sequence-mode-segment-lottie.json.js.map +1 -0
- package/dist/assets/lotties/circle/tables/table-mode-reveal.json.js +9076 -0
- package/dist/assets/lotties/circle/tables/table-mode-reveal.json.js.map +1 -0
- package/dist/features/chapters/chapter/chapter.js +43 -45
- package/dist/features/chapters/chapter/chapter.js.map +1 -1
- package/dist/features/chapters/chapter/comps/core-lessons/core-lessons.js +21 -23
- package/dist/features/chapters/chapter/comps/core-lessons/core-lessons.js.map +1 -1
- package/dist/features/circle-games/game-launcher/comps/card-container/card-container-styled.js +53 -0
- package/dist/features/circle-games/game-launcher/comps/card-container/card-container-styled.js.map +1 -0
- package/dist/features/circle-games/game-launcher/comps/card-container/card-container.js +24 -0
- package/dist/features/circle-games/game-launcher/comps/card-container/card-container.js.map +1 -0
- package/dist/features/circle-games/game-launcher/comps/card-container/constants.js +7 -0
- package/dist/features/circle-games/game-launcher/comps/card-container/constants.js.map +1 -0
- package/dist/features/circle-games/game-launcher/comps/segmented-game-card/constants.js +6 -6
- package/dist/features/circle-games/game-launcher/comps/segmented-game-card/constants.js.map +1 -1
- package/dist/features/circle-games/game-launcher/comps/segmented-game-card/segmented-game-card-styled.js +29 -73
- package/dist/features/circle-games/game-launcher/comps/segmented-game-card/segmented-game-card-styled.js.map +1 -1
- package/dist/features/circle-games/game-launcher/comps/segmented-game-card/segmented-game-card.js +83 -81
- package/dist/features/circle-games/game-launcher/comps/segmented-game-card/segmented-game-card.js.map +1 -1
- package/dist/features/circle-games/game-launcher/comps/tables-card/constants.js +20 -0
- package/dist/features/circle-games/game-launcher/comps/tables-card/constants.js.map +1 -0
- package/dist/features/circle-games/game-launcher/comps/tables-card/table-mode/table-mode-styled.js +24 -0
- package/dist/features/circle-games/game-launcher/comps/tables-card/table-mode/table-mode-styled.js.map +1 -0
- package/dist/features/circle-games/game-launcher/comps/tables-card/table-mode/table-mode.js +83 -0
- package/dist/features/circle-games/game-launcher/comps/tables-card/table-mode/table-mode.js.map +1 -0
- package/dist/features/circle-games/game-launcher/comps/tables-card/tables-card-styled.js +161 -0
- package/dist/features/circle-games/game-launcher/comps/tables-card/tables-card-styled.js.map +1 -0
- package/dist/features/circle-games/game-launcher/comps/tables-card/tables-card.js +223 -0
- package/dist/features/circle-games/game-launcher/comps/tables-card/tables-card.js.map +1 -0
- package/dist/features/circle-games/game-launcher/dal/use-get-circle-home-details-dal/use-get-circle-home-details-dal.js +25 -15
- package/dist/features/circle-games/game-launcher/dal/use-get-circle-home-details-dal/use-get-circle-home-details-dal.js.map +1 -1
- package/dist/features/circle-games/game-launcher/game-launcher-styled.js +6 -5
- package/dist/features/circle-games/game-launcher/game-launcher-styled.js.map +1 -1
- package/dist/features/circle-games/game-launcher/game-launcher.js +123 -82
- package/dist/features/circle-games/game-launcher/game-launcher.js.map +1 -1
- package/dist/features/circle-games/games/web-view/enums/project-type-enum.js +1 -1
- package/dist/features/circle-games/games/web-view/enums/project-type-enum.js.map +1 -1
- package/dist/features/circle-games/games/web-view/web-view-types.js.map +1 -1
- package/dist/features/circle-games/games/web-view/web-view.js +70 -83
- package/dist/features/circle-games/games/web-view/web-view.js.map +1 -1
- package/dist/features/milestone/constants.js +18 -53
- package/dist/features/milestone/constants.js.map +1 -1
- package/dist/features/milestone/create/comps/chapters-selection-step/chapters-selection-step-styled.js +4 -16
- package/dist/features/milestone/create/comps/chapters-selection-step/chapters-selection-step-styled.js.map +1 -1
- package/dist/features/milestone/create/milestone-create-constants.js.map +1 -1
- package/dist/features/milestone/create/milestone-create-container.js +47 -56
- package/dist/features/milestone/create/milestone-create-container.js.map +1 -1
- package/dist/features/milestone/create/milestone-create-helpers.js +113 -132
- package/dist/features/milestone/create/milestone-create-helpers.js.map +1 -1
- package/dist/features/milestone/create/milestone-create-hooks.js +90 -92
- package/dist/features/milestone/create/milestone-create-hooks.js.map +1 -1
- package/dist/features/milestone/create/milestone-create-styled.js +20 -34
- package/dist/features/milestone/create/milestone-create-styled.js.map +1 -1
- package/dist/features/milestone/create/milestone-create.js +53 -72
- package/dist/features/milestone/create/milestone-create.js.map +1 -1
- package/dist/features/milestone/create/submit-modal/use-submit-milestone.js +46 -53
- package/dist/features/milestone/create/submit-modal/use-submit-milestone.js.map +1 -1
- package/dist/features/milestone/create/utils/index.js.map +1 -1
- package/dist/features/milestone/edit/comps/delete-milestone/styled.js +8 -11
- package/dist/features/milestone/edit/comps/delete-milestone/styled.js.map +1 -1
- package/dist/features/milestone/edit/comps/edit-milestone-modal/edit-milestone.js +82 -79
- package/dist/features/milestone/edit/comps/edit-milestone-modal/edit-milestone.js.map +1 -1
- package/dist/features/milestone/edit/comps/edit-milestone-modal/index.js +112 -136
- package/dist/features/milestone/edit/comps/edit-milestone-modal/index.js.map +1 -1
- package/dist/features/milestone/{drafts/goal-edit → edit/goal-drafts}/goal-draft-edit-container.js +22 -24
- package/dist/features/milestone/edit/goal-drafts/goal-draft-edit-container.js.map +1 -0
- package/dist/features/milestone/edit/goal-drafts/goal-draft-edit-helpers.js +17 -0
- package/dist/features/milestone/edit/goal-drafts/goal-draft-edit-helpers.js.map +1 -0
- package/dist/features/milestone/edit/goal-edit-helpers.js +5 -6
- package/dist/features/milestone/edit/goal-edit-helpers.js.map +1 -1
- package/dist/features/milestone/edit/milestone-edit-helpers.js +16 -17
- package/dist/features/milestone/edit/milestone-edit-helpers.js.map +1 -1
- package/dist/features/milestone/milestone-list-container/milestone-list/milestone-list.js +46 -48
- package/dist/features/milestone/milestone-list-container/milestone-list/milestone-list.js.map +1 -1
- package/dist/features/milestone/milestone-list-container/milestone-list-container.js +58 -60
- package/dist/features/milestone/milestone-list-container/milestone-list-container.js.map +1 -1
- package/dist/features/milestone/outcome/comps/past-milestone/past-milestone-container.js +39 -41
- package/dist/features/milestone/outcome/comps/past-milestone/past-milestone-container.js.map +1 -1
- package/dist/features/post-game-stats/accuracy/accuracy-styled.js +17 -16
- package/dist/features/post-game-stats/accuracy/accuracy-styled.js.map +1 -1
- package/dist/features/post-game-stats/clock/clock-styled.js +11 -10
- package/dist/features/post-game-stats/clock/clock-styled.js.map +1 -1
- package/dist/features/post-game-stats/points/points-styled.js +7 -6
- package/dist/features/post-game-stats/points/points-styled.js.map +1 -1
- package/dist/features/post-game-stats/post-game-stats-styled.js +1 -1
- package/dist/features/post-game-stats/post-game-stats-styled.js.map +1 -1
- package/dist/features/post-game-stats/streak/streak-styled.js +18 -17
- package/dist/features/post-game-stats/streak/streak-styled.js.map +1 -1
- package/dist/features/trial-session/comps/trial-circle-game/constants.js.map +1 -1
- package/dist/features/trial-session/comps/trial-circle-game/trial-circle-game.js.map +1 -1
- package/dist/index.d.ts +79 -234
- package/dist/index.js +318 -337
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/dist/constants/urls.js +0 -5
- package/dist/constants/urls.js.map +0 -1
- package/dist/features/circle-games/games/web-view/enums/project-ids-enum.js +0 -14
- package/dist/features/circle-games/games/web-view/enums/project-ids-enum.js.map +0 -1
- package/dist/features/milestone/drafts/create/draft-create-container.js +0 -54
- package/dist/features/milestone/drafts/create/draft-create-container.js.map +0 -1
- package/dist/features/milestone/drafts/edit/draft-edit-container.js +0 -77
- package/dist/features/milestone/drafts/edit/draft-edit-container.js.map +0 -1
- package/dist/features/milestone/drafts/edit/draft-edit-helpers.js +0 -69
- package/dist/features/milestone/drafts/edit/draft-edit-helpers.js.map +0 -1
- package/dist/features/milestone/drafts/goal-edit/goal-draft-edit-container.js.map +0 -1
- package/dist/features/milestone/drafts/review/draft-review-container.js +0 -76
- package/dist/features/milestone/drafts/review/draft-review-container.js.map +0 -1
- package/dist/features/milestone/edit/comps/delete-milestone/add-remove-nudge.js +0 -48
- package/dist/features/milestone/edit/comps/delete-milestone/add-remove-nudge.js.map +0 -1
- package/dist/features/milestone/edit/comps/edit-milestone-modal/edit-milestone-modal-styled.js +0 -23
- package/dist/features/milestone/edit/comps/edit-milestone-modal/edit-milestone-modal-styled.js.map +0 -1
- package/dist/features/milestone/edit/comps/edit-milestone-modal/share-screen.js +0 -68
- package/dist/features/milestone/edit/comps/edit-milestone-modal/share-screen.js.map +0 -1
- package/dist/features/milestone/help-modals/index.js +0 -22
- package/dist/features/milestone/help-modals/index.js.map +0 -1
- package/dist/features/milestone/help-modals/milestone-lesson.js +0 -17
- package/dist/features/milestone/help-modals/milestone-lesson.js.map +0 -1
- package/dist/features/milestone/help-modals/milestone-list.js +0 -17
- package/dist/features/milestone/help-modals/milestone-list.js.map +0 -1
- package/dist/features/milestone/help-modals/utils.js +0 -20
- package/dist/features/milestone/help-modals/utils.js.map +0 -1
- package/dist/features/milestone/intro-modal/index.js +0 -24
- package/dist/features/milestone/intro-modal/index.js.map +0 -1
- package/dist/features/notifications/api/notification.js +0 -13
- package/dist/features/notifications/api/notification.js.map +0 -1
- package/dist/features/notifications/use-student-journey.js +0 -20
- package/dist/features/notifications/use-student-journey.js.map +0 -1
- package/dist/features/sheets/constants/lessons.js +0 -28
- package/dist/features/sheets/constants/lessons.js.map +0 -1
- package/dist/features/ui/modals/info-modal/index.js +0 -117
- package/dist/features/ui/modals/info-modal/index.js.map +0 -1
- package/dist/static/goal_creation_helper.d45e4d58.png +0 -0
- package/dist/static/help_banner1.ddb0ef0f.png +0 -0
- package/dist/static/help_banner2.40979ed0.png +0 -0
- package/dist/static/help_banner3.532099c7.png +0 -0
- package/dist/static/help_banner4.90a6fd4d.png +0 -0
- package/dist/static/help_banner5.2a9efb39.png +0 -0
- package/dist/static/help_banner6.94fe9589.png +0 -0
- package/dist/static/milestone_intro_slide1.1537493e.png +0 -0
- package/dist/static/milestone_intro_slide2.b791c159.png +0 -0
- package/dist/static/milestone_intro_slide3.f7d63a11.png +0 -0
- package/dist/static/milestone_intro_slide4.f8da4e46.png +0 -0
- package/dist/static/milestone_intro_slide5.ea5d12d2.png +0 -0
@@ -1,122 +1,163 @@
|
|
1
|
-
import { jsx as
|
2
|
-
import
|
3
|
-
import { memo as
|
4
|
-
import { CircularLoader as
|
5
|
-
import { useCircleSounds as
|
6
|
-
import {
|
7
|
-
import {
|
8
|
-
import {
|
9
|
-
import {
|
10
|
-
import {
|
11
|
-
import {
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
1
|
+
import { jsx as n } from "react/jsx-runtime";
|
2
|
+
import B from "lottie-web";
|
3
|
+
import { memo as D, useState as K, useRef as J, useCallback as t, useMemo as I, useEffect as V } from "react";
|
4
|
+
import { CircularLoader as Y } from "../../ui/loader/circular-loader/circular-loader.js";
|
5
|
+
import { useCircleSounds as w } from "../hooks/use-circle-sounds/use-circle-sounds.js";
|
6
|
+
import { CircleSoundKey as i } from "../hooks/use-circle-sounds/use-circle-sounds-enums.js";
|
7
|
+
import { Carousel as _ } from "./comps/carousel/carousel.js";
|
8
|
+
import { SegmentedGameCard as a } from "./comps/segmented-game-card/segmented-game-card.js";
|
9
|
+
import { TablesCard as U } from "./comps/tables-card/tables-card.js";
|
10
|
+
import { GAME_LAUNCHER_ANALYTICS_EVENTS as R } from "./game-launcher-analytics-events.js";
|
11
|
+
import { SleepyBoiLottyContainer as Z } from "./game-launcher-styled.js";
|
12
|
+
import { useGameLauncherJourney as H } from "./use-game-launcher-journey/use-game-launcher-journey.js";
|
13
|
+
import { ProjectType as m } from "../games/web-view/enums/project-type-enum.js";
|
14
|
+
const O = () => import("../../../assets/lotties/circle/sleepy-boi-lottie.json.js"), ne = D(
|
15
|
+
({ onSegmentClick: r, onJourneyComplete: T, journeyId: u, data: e, isLoading: g, defaultIndex: h = 0 }) => {
|
16
|
+
const [G, v] = K(h), c = J(null), { playSwipSound: f, play: o } = w(), {
|
17
|
+
gameRefs: p,
|
18
|
+
lessonRefs: C,
|
19
|
+
puzzleRefs: y,
|
20
|
+
startJourney: L,
|
21
|
+
carouselNextBtnRef: A,
|
22
|
+
isJourneyInProgress: b
|
23
|
+
} = H({
|
24
|
+
setCarouselIndex: v,
|
25
|
+
onSegmentClick: r,
|
26
|
+
onJourneyComplete: T
|
27
|
+
}), P = t(
|
28
|
+
(s) => {
|
29
|
+
o(i.GAME_CARD_CLICK), r(s, m.TABLE);
|
30
|
+
},
|
31
|
+
[r, o]
|
32
|
+
), E = t(
|
33
|
+
(s) => {
|
34
|
+
s.status !== "completed" && (o(i.GAME_CARD_CLICK), r(s, m.LESSON));
|
35
|
+
},
|
36
|
+
[r, o]
|
37
|
+
), z = t(
|
38
|
+
(s) => {
|
39
|
+
o(i.GAME_CARD_CLICK), r(s, m.GAME);
|
40
|
+
},
|
41
|
+
[r, o]
|
42
|
+
), x = t(
|
43
|
+
(s) => {
|
44
|
+
o(i.GAME_CARD_CLICK), r(s, m.PUZZLE);
|
45
|
+
},
|
46
|
+
[r, o]
|
47
|
+
), M = I(() => {
|
48
|
+
let s = [];
|
49
|
+
return e && (e.lessons && (s = [
|
50
|
+
...s,
|
51
|
+
/* @__PURE__ */ n(
|
52
|
+
a,
|
31
53
|
{
|
32
|
-
ref:
|
54
|
+
ref: C,
|
33
55
|
label: e.lessons.label,
|
34
|
-
value: e.lessons.data.filter((
|
56
|
+
value: e.lessons.data.filter((l) => l.status === "completed").length,
|
35
57
|
maxValue: e.lessons.data.length,
|
36
58
|
initialValue: e.lessons.initialProgressValue,
|
37
|
-
data: e == null ? void 0 : e.lessons.data.map((
|
38
|
-
card:
|
39
|
-
name:
|
40
|
-
isCompleted:
|
41
|
-
onPress: () =>
|
59
|
+
data: e == null ? void 0 : e.lessons.data.map((l) => ({
|
60
|
+
card: l.cardLottie,
|
61
|
+
name: l.name,
|
62
|
+
isCompleted: l.status === "completed",
|
63
|
+
onPress: () => E(l)
|
42
64
|
}))
|
43
65
|
}
|
44
66
|
)
|
45
|
-
]),
|
46
|
-
...
|
47
|
-
/* @__PURE__ */
|
48
|
-
|
67
|
+
]), s = [
|
68
|
+
...s,
|
69
|
+
/* @__PURE__ */ n(
|
70
|
+
a,
|
49
71
|
{
|
50
|
-
ref:
|
72
|
+
ref: p,
|
51
73
|
label: e.games.label,
|
52
|
-
value: e.games.data.filter((
|
74
|
+
value: e.games.data.filter((l) => l.isPlayed).length,
|
53
75
|
maxValue: e.games.data.length,
|
54
76
|
initialValue: e.games.initialProgressValue,
|
55
|
-
data: e.games.data.map((
|
56
|
-
card:
|
57
|
-
name:
|
77
|
+
data: e.games.data.map((l) => ({
|
78
|
+
card: l.cardLottie,
|
79
|
+
name: l.name,
|
58
80
|
isCompleted: !1,
|
59
|
-
onPress: () =>
|
81
|
+
onPress: () => z(l)
|
60
82
|
}))
|
61
83
|
}
|
62
84
|
),
|
63
|
-
/* @__PURE__ */
|
64
|
-
|
85
|
+
/* @__PURE__ */ n(
|
86
|
+
a,
|
65
87
|
{
|
66
|
-
ref:
|
88
|
+
ref: y,
|
67
89
|
label: e.puzzles.label,
|
68
|
-
value: e.puzzles.data.filter((
|
90
|
+
value: e.puzzles.data.filter((l) => l.solved).length,
|
69
91
|
maxValue: e.puzzles.data.length,
|
70
92
|
initialValue: e.puzzles.initialProgressValue,
|
71
|
-
data: e.puzzles.data.map((
|
72
|
-
card:
|
73
|
-
name:
|
74
|
-
isCompleted:
|
75
|
-
onPress: () =>
|
93
|
+
data: e.puzzles.data.map((l) => ({
|
94
|
+
card: l.cardLottie,
|
95
|
+
name: l.name,
|
96
|
+
isCompleted: l.solved,
|
97
|
+
onPress: () => x(l)
|
76
98
|
}))
|
77
99
|
}
|
78
100
|
)
|
79
|
-
]
|
80
|
-
|
81
|
-
|
101
|
+
], e.tables && (s = [
|
102
|
+
...s,
|
103
|
+
/* @__PURE__ */ n(
|
104
|
+
U,
|
105
|
+
{
|
106
|
+
label: e.tables.label,
|
107
|
+
data: e.tables.data,
|
108
|
+
onPress: P
|
109
|
+
}
|
110
|
+
)
|
111
|
+
])), s;
|
112
|
+
}, [
|
113
|
+
e,
|
114
|
+
p,
|
115
|
+
C,
|
116
|
+
y,
|
117
|
+
E,
|
118
|
+
P,
|
119
|
+
x,
|
120
|
+
z
|
121
|
+
]), N = I(
|
122
|
+
() => [/* @__PURE__ */ n(Z, { ref: c })],
|
82
123
|
[]
|
83
124
|
);
|
84
|
-
return
|
85
|
-
let
|
125
|
+
return V(() => {
|
126
|
+
let s = null;
|
86
127
|
return (async () => {
|
87
|
-
const
|
88
|
-
|
89
|
-
container:
|
90
|
-
animationData:
|
128
|
+
const S = (await O()).default;
|
129
|
+
s = B.loadAnimation({
|
130
|
+
container: c.current,
|
131
|
+
animationData: S,
|
91
132
|
autoplay: !0,
|
92
133
|
loop: !0,
|
93
134
|
renderer: "canvas"
|
94
135
|
});
|
95
136
|
})(), () => {
|
96
|
-
|
137
|
+
s == null || s.destroy();
|
97
138
|
};
|
98
|
-
}, []),
|
99
|
-
e != null && e.puzzles &&
|
100
|
-
}, [e == null ? void 0 : e.lessons, e == null ? void 0 : e.puzzles,
|
101
|
-
|
139
|
+
}, []), V(() => {
|
140
|
+
e != null && e.puzzles && u && b && L(e == null ? void 0 : e.puzzles, !!(e != null && e.lessons), u);
|
141
|
+
}, [e == null ? void 0 : e.lessons, e == null ? void 0 : e.puzzles, b, u, L]), g ? /* @__PURE__ */ n(Y, {}) : e ? /* @__PURE__ */ n(
|
142
|
+
_,
|
102
143
|
{
|
103
|
-
ref:
|
104
|
-
items:
|
105
|
-
defaultIndex:
|
106
|
-
onNext:
|
107
|
-
onPrev:
|
144
|
+
ref: A,
|
145
|
+
items: M,
|
146
|
+
defaultIndex: G,
|
147
|
+
onNext: f,
|
148
|
+
onPrev: f,
|
108
149
|
analyticsNext: {
|
109
|
-
analyticsLabel:
|
150
|
+
analyticsLabel: R.NEXT_ACTIVITY
|
110
151
|
},
|
111
152
|
analyticsPrev: {
|
112
|
-
analyticsLabel:
|
153
|
+
analyticsLabel: R.PREV_ACTIVITY
|
113
154
|
}
|
114
155
|
}
|
115
|
-
) : /* @__PURE__ */
|
116
|
-
|
156
|
+
) : /* @__PURE__ */ n(
|
157
|
+
_,
|
117
158
|
{
|
118
|
-
ref:
|
119
|
-
items:
|
159
|
+
ref: A,
|
160
|
+
items: N,
|
120
161
|
analyticsNext: {
|
121
162
|
analyticsLabel: ""
|
122
163
|
},
|
@@ -128,6 +169,6 @@ const J = () => import("../../../assets/lotties/circle/sleepy-boi-lottie.json.js
|
|
128
169
|
}
|
129
170
|
);
|
130
171
|
export {
|
131
|
-
|
172
|
+
ne as GameLauncher
|
132
173
|
};
|
133
174
|
//# sourceMappingURL=game-launcher.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"game-launcher.js","sources":["../../../../src/features/circle-games/game-launcher/game-launcher.tsx"],"sourcesContent":["import type { IGameLauncherProps } from './game-launcher-types';\nimport type { AnimationItem } from 'lottie-web';\nimport type { FC, ReactNode } from 'react';\n\nimport Lottie from 'lottie-web';\nimport { memo, useEffect, useMemo, useRef, useState } from 'react';\n\nimport { CircularLoader } from '../../ui/loader/circular-loader/circular-loader';\nimport { ProjectType } from '../games/web-view/enums';\nimport { useCircleSounds } from '../hooks/use-circle-sounds/use-circle-sounds';\nimport { Carousel } from './comps/carousel/carousel';\nimport { SegmentedGameCard } from './comps/segmented-game-card/segmented-game-card';\nimport { GAME_LAUNCHER_ANALYTICS_EVENTS } from './game-launcher-analytics-events';\nimport * as Styled from './game-launcher-styled';\nimport { useGameLauncherJourney } from './use-game-launcher-journey/use-game-launcher-journey';\n\nconst sleepyBoi = () => import('../../../assets/lotties/circle/sleepy-boi-lottie.json');\n\nexport const GameLauncher: FC<IGameLauncherProps> = memo(\n ({ onSegmentClick, onJourneyComplete, journeyId, data, isLoading, defaultIndex = 0 }) => {\n const [currentIndex, setCurrentIndex] = useState(defaultIndex);\n\n const lottieContainerRef = useRef<HTMLDivElement>(null);\n const { playSwipSound } = useCircleSounds();\n\n const {\n gameRefs,\n lessonRefs,\n puzzleRefs,\n startJourney,\n carouselNextBtnRef,\n isJourneyInProgress,\n } = useGameLauncherJourney({\n setCarouselIndex: setCurrentIndex,\n onSegmentClick,\n onJourneyComplete,\n });\n\n const items = useMemo(() => {\n let itemTypes: ReactNode[] = [];\n\n if (data) {\n if (data.lessons) {\n itemTypes = [\n ...itemTypes,\n <SegmentedGameCard\n ref={lessonRefs}\n label={data.lessons.label}\n value={data.lessons.data.filter(lesson => lesson.status === 'completed').length}\n maxValue={data.lessons.data.length}\n initialValue={data.lessons.initialProgressValue}\n data={data?.lessons.data.map(lesson => ({\n card: lesson.cardLottie,\n name: lesson.name,\n isCompleted: lesson.status === 'completed',\n onPress: () =>\n lesson.status === 'completed'\n ? undefined\n : onSegmentClick(lesson, ProjectType.LESSON),\n }))}\n />,\n ];\n }\n\n itemTypes = [\n ...itemTypes,\n <SegmentedGameCard\n ref={gameRefs}\n label={data.games.label}\n value={data.games.data.filter(game => game.isPlayed).length}\n maxValue={data.games.data.length}\n initialValue={data.games.initialProgressValue}\n data={data.games.data.map(game => ({\n card: game.cardLottie,\n name: game.name,\n isCompleted: false,\n onPress: () => onSegmentClick(game, ProjectType.GAME),\n }))}\n />,\n <SegmentedGameCard\n ref={puzzleRefs}\n label={data.puzzles.label}\n value={data.puzzles.data.filter(puzzle => puzzle.solved).length}\n maxValue={data.puzzles.data.length}\n initialValue={data.puzzles.initialProgressValue}\n data={data.puzzles.data.map(puzzle => ({\n card: puzzle.cardLottie,\n name: puzzle.name,\n isCompleted: puzzle.solved,\n onPress: () => onSegmentClick(puzzle, ProjectType.PUZZLE),\n }))}\n />,\n ];\n }\n\n return itemTypes;\n }, [data, gameRefs, lessonRefs, onSegmentClick, puzzleRefs]);\n\n const sleepyBoiItem = useMemo(\n () => [<Styled.SleepyBoiLottyContainer ref={lottieContainerRef} />],\n [],\n );\n\n useEffect(() => {\n let animation: AnimationItem | null = null;\n const loadAnimation = async () => {\n const animationModule = await sleepyBoi();\n\n const animationData = animationModule.default;\n\n animation = Lottie.loadAnimation({\n container: lottieContainerRef.current as Element,\n animationData: animationData,\n autoplay: true,\n loop: true,\n renderer: 'canvas',\n });\n };\n\n loadAnimation();\n\n return () => {\n animation?.destroy();\n };\n }, []);\n\n // Start game launcher journey when the data for puzzles is available\n useEffect(() => {\n if (data?.puzzles && journeyId && isJourneyInProgress) {\n startJourney(data?.puzzles, !!data?.lessons, journeyId);\n }\n }, [data?.lessons, data?.puzzles, isJourneyInProgress, journeyId, startJourney]);\n\n if (isLoading) {\n return <CircularLoader />;\n }\n\n if (!data) {\n return (\n <Carousel\n ref={carouselNextBtnRef}\n items={sleepyBoiItem}\n analyticsNext={{\n analyticsLabel: '',\n }}\n analyticsPrev={{\n analyticsLabel: '',\n }}\n />\n );\n }\n\n return (\n <Carousel\n ref={carouselNextBtnRef}\n items={items}\n defaultIndex={currentIndex}\n onNext={playSwipSound}\n onPrev={playSwipSound}\n analyticsNext={{\n analyticsLabel: GAME_LAUNCHER_ANALYTICS_EVENTS.NEXT_ACTIVITY,\n }}\n analyticsPrev={{\n analyticsLabel: GAME_LAUNCHER_ANALYTICS_EVENTS.PREV_ACTIVITY,\n }}\n />\n );\n },\n);\n"],"names":["sleepyBoi","GameLauncher","memo","onSegmentClick","onJourneyComplete","journeyId","data","isLoading","defaultIndex","currentIndex","setCurrentIndex","useState","lottieContainerRef","useRef","playSwipSound","useCircleSounds","gameRefs","lessonRefs","puzzleRefs","startJourney","carouselNextBtnRef","isJourneyInProgress","useGameLauncherJourney","items","useMemo","itemTypes","jsx","SegmentedGameCard","lesson","ProjectType","game","puzzle","sleepyBoiItem","Styled.SleepyBoiLottyContainer","useEffect","animation","animationData","Lottie","CircularLoader","Carousel","GAME_LAUNCHER_ANALYTICS_EVENTS"],"mappings":";;;;;;;;;;;AAgBA,MAAMA,IAAY,MAAM,OAAO,0DAAuD,GAEzEC,IAAuCC;AAAA,EAClD,CAAC,EAAE,gBAAAC,GAAgB,mBAAAC,GAAmB,WAAAC,GAAW,MAAAC,GAAM,WAAAC,GAAW,cAAAC,IAAe,QAAQ;AACvF,UAAM,CAACC,GAAcC,CAAe,IAAIC,EAASH,CAAY,GAEvDI,IAAqBC,EAAuB,IAAI,GAChD,EAAE,eAAAC,MAAkBC,KAEpB;AAAA,MACJ,UAAAC;AAAA,MACA,YAAAC;AAAA,MACA,YAAAC;AAAA,MACA,cAAAC;AAAA,MACA,oBAAAC;AAAA,MACA,qBAAAC;AAAA,QACEC,EAAuB;AAAA,MACzB,kBAAkBZ;AAAA,MAClB,gBAAAP;AAAA,MACA,mBAAAC;AAAA,IAAA,CACD,GAEKmB,IAAQC,EAAQ,MAAM;AAC1B,UAAIC,IAAyB,CAAA;AAE7B,aAAInB,MACEA,EAAK,YACKmB,IAAA;AAAA,QACV,GAAGA;AAAA,QACH,gBAAAC;AAAA,UAACC;AAAA,UAAA;AAAA,YACC,KAAKV;AAAA,YACL,OAAOX,EAAK,QAAQ;AAAA,YACpB,OAAOA,EAAK,QAAQ,KAAK,OAAO,CAAUsB,MAAAA,EAAO,WAAW,WAAW,EAAE;AAAA,YACzE,UAAUtB,EAAK,QAAQ,KAAK;AA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QACC,KAAKnB;AAAA,QACL,OAAOY;AAAA,QACP,eAAe;AAAA,UACb,gBAAgB;AAAA,QAClB;AAAA,QACA,eAAe;AAAA,UACb,gBAAgB;AAAA,QAClB;AAAA,MAAA;AAAA,IAAA;AAAA,EAoBR;AACF;"}
|
1
|
+
{"version":3,"file":"game-launcher.js","sources":["../../../../src/features/circle-games/game-launcher/game-launcher.tsx"],"sourcesContent":["import type { ITableDetails } from './comps/tables-card/tables-card-types';\nimport type {\n Game,\n Lesson,\n Puzzle,\n} from './dal/use-get-circle-home-details-dal/use-get-circle-home-dal-types';\nimport type { IGameLauncherProps } from './game-launcher-types';\nimport type { AnimationItem } from 'lottie-web';\nimport type { FC, ReactNode } from 'react';\n\nimport Lottie from 'lottie-web';\nimport { memo, useCallback, useEffect, useMemo, useRef, useState } from 'react';\n\nimport { CircularLoader } from '../../ui/loader/circular-loader/circular-loader';\nimport { ProjectType } from '../games/web-view/enums';\nimport { useCircleSounds } from '../hooks/use-circle-sounds/use-circle-sounds';\nimport { CircleSoundKey } from '../hooks/use-circle-sounds/use-circle-sounds-enums';\nimport { Carousel } from './comps/carousel/carousel';\nimport { SegmentedGameCard } from './comps/segmented-game-card/segmented-game-card';\nimport { TablesCard } from './comps/tables-card/tables-card';\nimport { GAME_LAUNCHER_ANALYTICS_EVENTS } from './game-launcher-analytics-events';\nimport * as Styled from './game-launcher-styled';\nimport { useGameLauncherJourney } from './use-game-launcher-journey/use-game-launcher-journey';\n\nconst sleepyBoi = () => import('../../../assets/lotties/circle/sleepy-boi-lottie.json');\n\nexport const GameLauncher: FC<IGameLauncherProps> = memo(\n ({ onSegmentClick, onJourneyComplete, journeyId, data, isLoading, defaultIndex = 0 }) => {\n const [currentIndex, setCurrentIndex] = useState(defaultIndex);\n\n const lottieContainerRef = useRef<HTMLDivElement>(null);\n const { playSwipSound, play } = useCircleSounds();\n const {\n gameRefs,\n lessonRefs,\n puzzleRefs,\n startJourney,\n carouselNextBtnRef,\n isJourneyInProgress,\n } = useGameLauncherJourney({\n setCarouselIndex: setCurrentIndex,\n onSegmentClick,\n onJourneyComplete,\n });\n\n const onTableSegmentClick = useCallback(\n (table: ITableDetails) => {\n play(CircleSoundKey.GAME_CARD_CLICK);\n onSegmentClick(table, ProjectType.TABLE);\n },\n [onSegmentClick, play],\n );\n\n const handleLessonSegmentClick = useCallback(\n (lesson: Lesson) => {\n if (lesson.status !== 'completed') {\n play(CircleSoundKey.GAME_CARD_CLICK);\n onSegmentClick(lesson, ProjectType.LESSON);\n }\n },\n [onSegmentClick, play],\n );\n\n const handleGameSegmentClick = useCallback(\n (game: Game) => {\n play(CircleSoundKey.GAME_CARD_CLICK);\n onSegmentClick(game, ProjectType.GAME);\n },\n [onSegmentClick, play],\n );\n\n const handlePuzzleSegmentClick = useCallback(\n (puzzle: Puzzle) => {\n play(CircleSoundKey.GAME_CARD_CLICK);\n onSegmentClick(puzzle, ProjectType.PUZZLE);\n },\n [onSegmentClick, play],\n );\n\n const items = useMemo(() => {\n let itemTypes: ReactNode[] = [];\n\n if (data) {\n if (data.lessons) {\n itemTypes = [\n ...itemTypes,\n <SegmentedGameCard\n ref={lessonRefs}\n label={data.lessons.label}\n value={data.lessons.data.filter(lesson => lesson.status === 'completed').length}\n maxValue={data.lessons.data.length}\n initialValue={data.lessons.initialProgressValue}\n data={data?.lessons.data.map(lesson => ({\n card: lesson.cardLottie,\n name: lesson.name,\n isCompleted: lesson.status === 'completed',\n onPress: () => handleLessonSegmentClick(lesson),\n }))}\n />,\n ];\n }\n\n itemTypes = [\n ...itemTypes,\n <SegmentedGameCard\n ref={gameRefs}\n label={data.games.label}\n value={data.games.data.filter(game => game.isPlayed).length}\n maxValue={data.games.data.length}\n initialValue={data.games.initialProgressValue}\n data={data.games.data.map(game => ({\n card: game.cardLottie,\n name: game.name,\n isCompleted: false,\n onPress: () => handleGameSegmentClick(game),\n }))}\n />,\n <SegmentedGameCard\n ref={puzzleRefs}\n label={data.puzzles.label}\n value={data.puzzles.data.filter(puzzle => puzzle.solved).length}\n maxValue={data.puzzles.data.length}\n initialValue={data.puzzles.initialProgressValue}\n data={data.puzzles.data.map(puzzle => ({\n card: puzzle.cardLottie,\n name: puzzle.name,\n isCompleted: puzzle.solved,\n onPress: () => handlePuzzleSegmentClick(puzzle),\n }))}\n />,\n ];\n\n if (data.tables) {\n itemTypes = [\n ...itemTypes,\n <TablesCard\n label={data.tables.label}\n data={data.tables.data}\n onPress={onTableSegmentClick}\n />,\n ];\n }\n }\n\n return itemTypes;\n }, [\n data,\n gameRefs,\n lessonRefs,\n puzzleRefs,\n handleLessonSegmentClick,\n onTableSegmentClick,\n handlePuzzleSegmentClick,\n handleGameSegmentClick,\n ]);\n\n const sleepyBoiItem = useMemo(\n () => [<Styled.SleepyBoiLottyContainer ref={lottieContainerRef} />],\n [],\n );\n\n useEffect(() => {\n let animation: AnimationItem | null = null;\n const loadAnimation = async () => {\n const animationModule = await sleepyBoi();\n\n const animationData = animationModule.default;\n\n animation = Lottie.loadAnimation({\n container: lottieContainerRef.current as Element,\n animationData: animationData,\n autoplay: true,\n loop: true,\n renderer: 'canvas',\n });\n };\n\n loadAnimation();\n\n return () => {\n animation?.destroy();\n };\n }, []);\n\n // Start game launcher journey when the data for puzzles is available\n useEffect(() => {\n if (data?.puzzles && journeyId && isJourneyInProgress) {\n startJourney(data?.puzzles, !!data?.lessons, journeyId);\n }\n }, [data?.lessons, data?.puzzles, isJourneyInProgress, journeyId, startJourney]);\n\n if (isLoading) {\n return <CircularLoader />;\n }\n\n if (!data) {\n return (\n <Carousel\n ref={carouselNextBtnRef}\n items={sleepyBoiItem}\n analyticsNext={{\n analyticsLabel: '',\n }}\n analyticsPrev={{\n analyticsLabel: '',\n }}\n />\n );\n }\n\n return (\n <Carousel\n ref={carouselNextBtnRef}\n items={items}\n defaultIndex={currentIndex}\n onNext={playSwipSound}\n onPrev={playSwipSound}\n analyticsNext={{\n analyticsLabel: GAME_LAUNCHER_ANALYTICS_EVENTS.NEXT_ACTIVITY,\n }}\n analyticsPrev={{\n analyticsLabel: GAME_LAUNCHER_ANALYTICS_EVENTS.PREV_ACTIVITY,\n }}\n />\n );\n },\n);\n"],"names":["sleepyBoi","GameLauncher","memo","onSegmentClick","onJourneyComplete","journeyId","data","isLoading","defaultIndex","currentIndex","setCurrentIndex","useState","lottieContainerRef","useRef","playSwipSound","play","useCircleSounds","gameRefs","lessonRefs","puzzleRefs","startJourney","carouselNextBtnRef","isJourneyInProgress","useGameLauncherJourney","onTableSegmentClick","useCallback","table","CircleSoundKey","ProjectType","handleLessonSegmentClick","lesson","handleGameSegmentClick","game","handlePuzzleSegmentClick","puzzle","items","useMemo","itemTypes","jsx","SegmentedGameCard","TablesCard","sleepyBoiItem","Styled.SleepyBoiLottyContainer","useEffect","animation","animationData","Lottie","CircularLoader","Carousel","GAME_LAUNCHER_ANALYTICS_EVENTS"],"mappings":";;;;;;;;;;;;;AAwBA,MAAMA,IAAY,MAAM,OAAO,0DAAuD,GAEzEC,KAAuCC;AAAA,EAClD,CAAC,EAAE,gBAAAC,GAAgB,mBAAAC,GAAmB,WAAAC,GAAW,MAAAC,GAAM,WAAAC,GAAW,cAAAC,IAAe,QAAQ;AACvF,UAAM,CAACC,GAAcC,CAAe,IAAIC,EAASH,CAAY,GAEvDI,IAAqBC,EAAuB,IAAI,GAChD,EAAE,eAAAC,GAAe,MAAAC,EAAK,IAAIC,EAAgB,GAC1C;AAAA,MACJ,UAAAC;AAAA,MACA,YAAAC;AAAA,MACA,YAAAC;AAAA,MACA,cAAAC;AAAA,MACA,oBAAAC;AAAA,MACA,qBAAAC;AAAA,QACEC,EAAuB;AAAA,MACzB,kBAAkBb;AAAA,MAClB,gBAAAP;AAAA,MACA,mBAAAC;AAAA,IAAA,CACD,GAEKoB,IAAsBC;AAAA,MAC1B,CAACC,MAAyB;AACxB,QAAAX,EAAKY,EAAe,eAAe,GACpBxB,EAAAuB,GAAOE,EAAY,KAAK;AAAA,MACzC;AAAA,MACA,CAACzB,GAAgBY,CA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MAAA;AAAA,IAAA;AAAA,EAoBR;AACF;"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"project-type-enum.js","sources":["../../../../../../src/features/circle-games/games/web-view/enums/project-type-enum.ts"],"sourcesContent":["export enum ProjectType {\n GAME = 'game',\n PUZZLE = 'puzzle',\n LESSON = 'lesson',\n}\n"],"names":["ProjectType"],"mappings":"AAAY,IAAAA,sBAAAA,OACVA,EAAA,OAAO,QACPA,EAAA,SAAS,UACTA,EAAA,SAAS,
|
1
|
+
{"version":3,"file":"project-type-enum.js","sources":["../../../../../../src/features/circle-games/games/web-view/enums/project-type-enum.ts"],"sourcesContent":["export enum ProjectType {\n GAME = 'game',\n PUZZLE = 'puzzle',\n LESSON = 'lesson',\n TABLE = 'table',\n}\n"],"names":["ProjectType"],"mappings":"AAAY,IAAAA,sBAAAA,OACVA,EAAA,OAAO,QACPA,EAAA,SAAS,UACTA,EAAA,SAAS,UACTA,EAAA,QAAQ,SAJEA,IAAAA,KAAA,CAAA,CAAA;"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"web-view-types.js","sources":["../../../../../src/features/circle-games/games/web-view/web-view-types.ts"],"sourcesContent":["import type { IAvatarLayer } from '../../../ui/avatar/avatar-types';\nimport type { TUserTypes } from '../../../ui/types';\nimport type {
|
1
|
+
{"version":3,"file":"web-view-types.js","sources":["../../../../../src/features/circle-games/games/web-view/web-view-types.ts"],"sourcesContent":["import type { IAvatarLayer } from '../../../ui/avatar/avatar-types';\nimport type { TUserTypes } from '../../../ui/types';\nimport type { WebViewEvent, ProjectOutcome, ProjectType } from './enums';\nimport type { WEBVIEW_ANALYTICS_EVENTS } from './web-view-analytics-events';\nimport type { IframeHTMLAttributes } from 'react';\n\nexport interface IPlayer {\n id: string;\n username: string;\n grade?: string;\n avatar?: IAvatarLayer[] | null;\n playerType: TUserTypes;\n}\n\ninterface ISyncableWebGameProps {\n joinByRoomId?: string;\n enableSync?: boolean; // applicable for all except multiplayer games and tables\n}\n\ninterface IBaseWebGameProps {\n projectId: string;\n variant: string;\n projectType: ProjectType;\n enableCloseButton?: boolean;\n}\n\nexport interface IMultiplayerWebGameProps extends IBaseWebGameProps, ISyncableWebGameProps {\n enablePlayerTurnIndicators?: boolean;\n}\n\nexport interface IPuzzleWebGameProps extends IBaseWebGameProps, ISyncableWebGameProps {\n question: string;\n askHintPermission?: boolean;\n}\n\nexport interface ILessonWebGameProps extends IBaseWebGameProps, ISyncableWebGameProps {\n miniGameIdentifier: string;\n sessionId: string;\n targetQuestions: number;\n}\n\nexport interface ITableWebGameProps extends IBaseWebGameProps {\n tableNumber: number;\n infiniteModeHighScore?: number;\n}\n\nexport interface IVibrationPattern {\n pattern: number[] | number;\n}\n\nexport enum IStatsToAwardErrorCode {\n DEFAULT = 'default',\n SUCCESS = 'success',\n FAIL = 'fail',\n}\n\nexport interface IPlayerStats {\n points: number;\n accuracy: number;\n timeSpent: number;\n streakDays: number;\n streakStatusToday: 'pending' | 'completed';\n errorCode: IStatsToAwardErrorCode;\n outcome: ProjectOutcome;\n value: string;\n}\n\nexport interface IInfoMessage {\n message: string;\n position: 'top' | 'bottom';\n}\n\nexport interface ITrackEvent {\n eventName: typeof WEBVIEW_ANALYTICS_EVENTS;\n properties: Record<string, unknown>;\n}\n\nexport interface IWebViewProps extends IframeHTMLAttributes<HTMLIFrameElement> {\n baseUrl: string;\n projectDetails:\n | IMultiplayerWebGameProps\n | IPuzzleWebGameProps\n | ILessonWebGameProps\n | ITableWebGameProps;\n playerDetails: IPlayer;\n onBack?: () => void;\n onGameLoad?: () => void;\n onGamePlayFinish?: (playerStats: IPlayerStats) => void;\n handleInfoMessage?: (infoMessage: IInfoMessage) => void;\n}\n\nexport interface IMessageProps {\n event: `${WebViewEvent}`;\n payload: IVibrationPattern | IPlayerStats | IInfoMessage | null;\n}\n"],"names":["IStatsToAwardErrorCode"],"mappings":"AAkDY,IAAAA,sBAAAA,OACVA,EAAA,UAAU,WACVA,EAAA,UAAU,WACVA,EAAA,OAAO,QAHGA,IAAAA,KAAA,CAAA,CAAA;"}
|
@@ -1,113 +1,100 @@
|
|
1
|
-
import { jsx as
|
2
|
-
import { forwardRef as
|
3
|
-
import { useUIContext as
|
4
|
-
import { ALLOWED_ORIGIN as
|
5
|
-
import { ProjectType as
|
6
|
-
import { WebViewEvent as
|
7
|
-
const
|
1
|
+
import { jsx as M } from "react/jsx-runtime";
|
2
|
+
import { forwardRef as P, useRef as G, useMemo as S, useCallback as T, useImperativeHandle as W, useEffect as V } from "react";
|
3
|
+
import { useUIContext as $ } from "../../../ui/context/context.js";
|
4
|
+
import { ALLOWED_ORIGIN as _ } from "./constants.js";
|
5
|
+
import { ProjectType as s } from "./enums/project-type-enum.js";
|
6
|
+
import { WebViewEvent as o } from "./enums/web-view-events-enum.js";
|
7
|
+
const z = P((N, C) => {
|
8
8
|
const {
|
9
|
-
baseUrl:
|
10
|
-
projectDetails:
|
11
|
-
playerDetails:
|
9
|
+
baseUrl: I,
|
10
|
+
projectDetails: y,
|
11
|
+
playerDetails: v,
|
12
12
|
onGameLoad: a,
|
13
13
|
onGamePlayFinish: c,
|
14
|
-
handleInfoMessage:
|
15
|
-
onBack:
|
16
|
-
...
|
17
|
-
} = N,
|
18
|
-
let
|
19
|
-
const { onEvent:
|
20
|
-
|
21
|
-
const m =
|
22
|
-
const {
|
23
|
-
enableCloseButton: r = !0,
|
24
|
-
enablePlayerTurnIndicators: s = !1,
|
25
|
-
enableSync: t = !1,
|
26
|
-
joinByRoomId: E = ""
|
27
|
-
} = o;
|
14
|
+
handleInfoMessage: p,
|
15
|
+
onBack: f,
|
16
|
+
...L
|
17
|
+
} = N, l = G(null), w = S(() => v, [v]), t = S(() => y, [y]);
|
18
|
+
let A = "";
|
19
|
+
const { onEvent: O } = $();
|
20
|
+
t.projectType === s.LESSON && (A = t.miniGameIdentifier);
|
21
|
+
const m = T(() => {
|
22
|
+
const { enableCloseButton: n = !0 } = t;
|
28
23
|
let e = {
|
29
|
-
|
30
|
-
enableCloseButton: r,
|
31
|
-
enablePlayerTurnIndicators: s,
|
32
|
-
enableSync: t
|
24
|
+
enableCloseButton: n
|
33
25
|
};
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
e
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
return e;
|
52
|
-
}, [o]), d = A(() => {
|
53
|
-
var s, t;
|
54
|
-
const r = m();
|
55
|
-
(t = (s = p.current) == null ? void 0 : s.contentWindow) == null || t.postMessage(
|
26
|
+
return t.projectType === s.GAME && (e = {
|
27
|
+
...e,
|
28
|
+
...t
|
29
|
+
}), t.projectType === s.PUZZLE && (e = {
|
30
|
+
...e,
|
31
|
+
...t
|
32
|
+
}), t.projectType === s.LESSON && (e = {
|
33
|
+
...e,
|
34
|
+
...t
|
35
|
+
}), t.projectType === s.TABLE && (e = {
|
36
|
+
...e,
|
37
|
+
...t
|
38
|
+
}), e;
|
39
|
+
}, [t]), E = T(() => {
|
40
|
+
var e, r;
|
41
|
+
const n = m();
|
42
|
+
(r = (e = l.current) == null ? void 0 : e.contentWindow) == null || r.postMessage(
|
56
43
|
JSON.stringify({
|
57
|
-
event:
|
58
|
-
payload:
|
44
|
+
event: o.GAME_DATA,
|
45
|
+
payload: n
|
59
46
|
}),
|
60
|
-
|
47
|
+
_
|
61
48
|
);
|
62
|
-
}, [m]),
|
63
|
-
var
|
64
|
-
const
|
65
|
-
(
|
49
|
+
}, [m]), g = T(() => {
|
50
|
+
var e, r;
|
51
|
+
const n = m();
|
52
|
+
(r = (e = l.current) == null ? void 0 : e.contentWindow) == null || r.postMessage(
|
66
53
|
JSON.stringify({
|
67
|
-
event:
|
54
|
+
event: o.SET_CONFIG,
|
68
55
|
payload: {
|
69
|
-
user:
|
70
|
-
projectConfig:
|
56
|
+
user: w,
|
57
|
+
projectConfig: n
|
71
58
|
}
|
72
59
|
}),
|
73
|
-
|
60
|
+
_
|
74
61
|
);
|
75
|
-
}, [
|
76
|
-
return W(C, () =>
|
77
|
-
const
|
78
|
-
var
|
79
|
-
const
|
80
|
-
if (
|
81
|
-
const { pattern:
|
82
|
-
(D = (
|
62
|
+
}, [w, m]);
|
63
|
+
return W(C, () => l.current, []), V(() => {
|
64
|
+
const n = (e) => {
|
65
|
+
var j, D;
|
66
|
+
const r = e.data, R = typeof r == "string" ? JSON.parse(r) : r, { event: i, payload: d = null } = R;
|
67
|
+
if (i === o.VIBRATE) {
|
68
|
+
const { pattern: u } = d;
|
69
|
+
(D = (j = window.navigator).vibrate) == null || D.call(j, u);
|
83
70
|
}
|
84
|
-
if (
|
85
|
-
const { eventName:
|
86
|
-
|
71
|
+
if (i === o.GAME_BACK && (f == null || f()), i === o.HIDE_LOADER && (a == null || a()), i === o.LOAD_DATA_FROM_APP && (E == null || E()), i === o.GET_CONFIG && g(), i === o.UPDATE_STATS && (c == null || c(d)), i === o.SHOW_SNACKBAR && (p == null || p(d)), i === o.TRACK_EVENT) {
|
72
|
+
const { eventName: u, properties: b } = d;
|
73
|
+
O(u, b);
|
87
74
|
}
|
88
75
|
};
|
89
|
-
return window.addEventListener("message",
|
90
|
-
window.removeEventListener("message",
|
76
|
+
return window.addEventListener("message", n), () => {
|
77
|
+
window.removeEventListener("message", n);
|
91
78
|
};
|
92
79
|
}, [
|
80
|
+
p,
|
93
81
|
f,
|
94
|
-
l,
|
95
82
|
c,
|
96
83
|
a,
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
]), /* @__PURE__ */
|
84
|
+
g,
|
85
|
+
E,
|
86
|
+
O
|
87
|
+
]), /* @__PURE__ */ M(
|
101
88
|
"iframe",
|
102
89
|
{
|
103
|
-
...
|
104
|
-
ref:
|
105
|
-
src: `${
|
90
|
+
...L,
|
91
|
+
ref: l,
|
92
|
+
src: `${I}/play-game/${t.projectId}/${t.variant}${A ? `/${A}` : ""}?version=2`,
|
106
93
|
allow: "autoplay"
|
107
94
|
}
|
108
95
|
);
|
109
96
|
});
|
110
97
|
export {
|
111
|
-
|
98
|
+
z as WebView
|
112
99
|
};
|
113
100
|
//# sourceMappingURL=web-view.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"web-view.js","sources":["../../../../../src/features/circle-games/games/web-view/web-view.tsx"],"sourcesContent":["import type {\n IInfoMessage,\n ILessonWebGameProps,\n IMessageProps,\n IMultiplayerWebGameProps,\n IPlayerStats,\n IPuzzleWebGameProps,\n IVibrationPattern,\n IWebViewProps,\n} from './web-view-types';\nimport type { ForwardedRef } from 'react';\n\nimport { forwardRef, useCallback, useEffect, useImperativeHandle, useMemo, useRef } from 'react';\n\nimport { useUIContext } from '../../../ui/context/context';\nimport { ALLOWED_ORIGIN } from './constants';\nimport { ProjectType, WebViewEvent } from './enums';\n\nexport const WebView = forwardRef((props: IWebViewProps, ref: ForwardedRef<HTMLIFrameElement>) => {\n const {\n baseUrl,\n projectDetails,\n playerDetails,\n onGameLoad,\n onGamePlayFinish,\n handleInfoMessage,\n onBack,\n ...rest\n } = props;\n const webViewRef = useRef<HTMLIFrameElement>(null);\n const memoizedPlayerDetails = useMemo(() => playerDetails, [playerDetails]);\n const memoizedProjectDetails = useMemo(() => projectDetails, [projectDetails]);\n\n let miniGameIdentifier = '';\n const { onEvent: trackEvent } = useUIContext();\n\n if (memoizedProjectDetails.projectType === ProjectType.LESSON) {\n miniGameIdentifier = (memoizedProjectDetails as ILessonWebGameProps).miniGameIdentifier;\n }\n\n const getProjectDetails = useCallback(() => {\n const {
|
1
|
+
{"version":3,"file":"web-view.js","sources":["../../../../../src/features/circle-games/games/web-view/web-view.tsx"],"sourcesContent":["import type {\n IInfoMessage,\n ILessonWebGameProps,\n IMessageProps,\n IMultiplayerWebGameProps,\n IPlayerStats,\n IPuzzleWebGameProps,\n ITableWebGameProps,\n IVibrationPattern,\n IWebViewProps,\n} from './web-view-types';\nimport type { ForwardedRef } from 'react';\n\nimport { forwardRef, useCallback, useEffect, useImperativeHandle, useMemo, useRef } from 'react';\n\nimport { useUIContext } from '../../../ui/context/context';\nimport { ALLOWED_ORIGIN } from './constants';\nimport { ProjectType, WebViewEvent } from './enums';\n\nexport const WebView = forwardRef((props: IWebViewProps, ref: ForwardedRef<HTMLIFrameElement>) => {\n const {\n baseUrl,\n projectDetails,\n playerDetails,\n onGameLoad,\n onGamePlayFinish,\n handleInfoMessage,\n onBack,\n ...rest\n } = props;\n const webViewRef = useRef<HTMLIFrameElement>(null);\n const memoizedPlayerDetails = useMemo(() => playerDetails, [playerDetails]);\n const memoizedProjectDetails = useMemo(() => projectDetails, [projectDetails]);\n\n let miniGameIdentifier = '';\n const { onEvent: trackEvent } = useUIContext();\n\n if (memoizedProjectDetails.projectType === ProjectType.LESSON) {\n miniGameIdentifier = (memoizedProjectDetails as ILessonWebGameProps).miniGameIdentifier;\n }\n\n const getProjectDetails = useCallback(() => {\n const { enableCloseButton = true } = memoizedProjectDetails;\n\n let payload = {\n enableCloseButton,\n } as IMultiplayerWebGameProps | IPuzzleWebGameProps | ILessonWebGameProps;\n\n if (memoizedProjectDetails.projectType === ProjectType.GAME) {\n payload = {\n ...payload,\n ...memoizedProjectDetails,\n } as IMultiplayerWebGameProps;\n }\n\n if (memoizedProjectDetails.projectType === ProjectType.PUZZLE) {\n payload = {\n ...payload,\n ...memoizedProjectDetails,\n } as IPuzzleWebGameProps;\n }\n\n if (memoizedProjectDetails.projectType === ProjectType.LESSON) {\n payload = {\n ...payload,\n ...memoizedProjectDetails,\n } as ILessonWebGameProps;\n }\n\n if (memoizedProjectDetails.projectType === ProjectType.TABLE) {\n payload = {\n ...payload,\n ...memoizedProjectDetails,\n } as ITableWebGameProps;\n }\n\n return payload;\n }, [memoizedProjectDetails]);\n\n const sendGamesData = useCallback(() => {\n const payload = getProjectDetails();\n\n webViewRef.current?.contentWindow?.postMessage(\n JSON.stringify({\n event: WebViewEvent.GAME_DATA,\n payload,\n }),\n ALLOWED_ORIGIN,\n );\n }, [getProjectDetails]);\n\n const setConfig = useCallback(() => {\n const projectConfig = getProjectDetails();\n\n webViewRef.current?.contentWindow?.postMessage(\n JSON.stringify({\n event: WebViewEvent.SET_CONFIG,\n payload: {\n user: memoizedPlayerDetails,\n projectConfig,\n },\n }),\n ALLOWED_ORIGIN,\n );\n }, [memoizedPlayerDetails, getProjectDetails]);\n\n useImperativeHandle(ref, () => webViewRef.current as HTMLIFrameElement, []);\n\n useEffect(() => {\n const handleMessage = (e: MessageEvent) => {\n const data: string = e.data;\n const parsedData = typeof data === 'string' ? JSON.parse(data) : (data as IMessageProps);\n\n const { event, payload = null } = parsedData;\n\n if (event === WebViewEvent.VIBRATE) {\n const { pattern } = payload as IVibrationPattern;\n\n window.navigator.vibrate?.(pattern);\n }\n\n if (event === WebViewEvent.GAME_BACK) {\n onBack?.();\n }\n\n if (event === WebViewEvent.HIDE_LOADER) {\n onGameLoad?.();\n }\n\n if (event === WebViewEvent.LOAD_DATA_FROM_APP) {\n sendGamesData?.();\n }\n\n if (event === WebViewEvent.GET_CONFIG) {\n setConfig();\n }\n\n if (event === WebViewEvent.UPDATE_STATS) {\n onGamePlayFinish?.(payload as IPlayerStats);\n }\n\n if (event === WebViewEvent.SHOW_SNACKBAR) {\n handleInfoMessage?.(payload as IInfoMessage);\n }\n\n if (event === WebViewEvent.TRACK_EVENT) {\n const { eventName, properties } = payload;\n\n trackEvent(eventName, properties);\n }\n };\n\n window.addEventListener('message', handleMessage);\n\n return () => {\n window.removeEventListener('message', handleMessage);\n };\n }, [\n handleInfoMessage,\n onBack,\n onGamePlayFinish,\n onGameLoad,\n setConfig,\n sendGamesData,\n trackEvent,\n ]);\n\n return (\n <iframe\n {...rest}\n ref={webViewRef}\n src={`${baseUrl}/play-game/${memoizedProjectDetails.projectId}/${\n memoizedProjectDetails.variant\n }${miniGameIdentifier ? `/${miniGameIdentifier}` : ''}?version=2`}\n allow=\"autoplay\"\n />\n );\n});\n"],"names":["WebView","forwardRef","props","ref","baseUrl","projectDetails","playerDetails","onGameLoad","onGamePlayFinish","handleInfoMessage","onBack","rest","webViewRef","useRef","memoizedPlayerDetails","useMemo","memoizedProjectDetails","miniGameIdentifier","trackEvent","useUIContext","ProjectType","getProjectDetails","useCallback","enableCloseButton","payload","sendGamesData","_b","_a","WebViewEvent","ALLOWED_ORIGIN","setConfig","projectConfig","useImperativeHandle","useEffect","handleMessage","data","parsedData","event","pattern","eventName","properties","jsx"],"mappings":";;;;;;AAmBO,MAAMA,IAAUC,EAAW,CAACC,GAAsBC,MAAyC;AAC1F,QAAA;AAAA,IACJ,SAAAC;AAAA,IACA,gBAAAC;AAAA,IACA,eAAAC;AAAA,IACA,YAAAC;AAAA,IACA,kBAAAC;AAAA,IACA,mBAAAC;AAAA,IACA,QAAAC;AAAA,IACA,GAAGC;AAAA,EACD,IAAAT,GACEU,IAAaC,EAA0B,IAAI,GAC3CC,IAAwBC,EAAQ,MAAMT,GAAe,CAACA,CAAa,CAAC,GACpEU,IAAyBD,EAAQ,MAAMV,GAAgB,CAACA,CAAc,CAAC;AAE7E,MAAIY,IAAqB;AACzB,QAAM,EAAE,SAASC,EAAW,IAAIC,EAAa;AAEzC,EAAAH,EAAuB,gBAAgBI,EAAY,WACrDH,IAAsBD,EAA+C;AAGjE,QAAAK,IAAoBC,EAAY,MAAM;AACpC,UAAA,EAAE,mBAAAC,IAAoB,GAAS,IAAAP;AAErC,QAAIQ,IAAU;AAAA,MACZ,mBAAAD;AAAA,IAAA;AAGE,WAAAP,EAAuB,gBAAgBI,EAAY,SAC3CI,IAAA;AAAA,MACR,GAAGA;AAAA,MACH,GAAGR;AAAA,IAAA,IAIHA,EAAuB,gBAAgBI,EAAY,WAC3CI,IAAA;AAAA,MACR,GAAGA;AAAA,MACH,GAAGR;AAAA,IAAA,IAIHA,EAAuB,gBAAgBI,EAAY,WAC3CI,IAAA;AAAA,MACR,GAAGA;AAAA,MACH,GAAGR;AAAA,IAAA,IAIHA,EAAuB,gBAAgBI,E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