@cuemath/leap 2.8.24-hg1 → 2.8.24-link1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/features/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 +73 -29
- 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 +81 -83
- 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/dal/use-get-circle-home-details-dal/use-get-circle-home-details-dal.js +15 -25
- 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 +5 -6
- package/dist/features/circle-games/game-launcher/game-launcher-styled.js.map +1 -1
- package/dist/features/circle-games/game-launcher/game-launcher.js +82 -123
- package/dist/features/circle-games/game-launcher/game-launcher.js.map +1 -1
- package/dist/features/circle-games/games/web-view/enums/project-ids-enum.js +14 -0
- package/dist/features/circle-games/games/web-view/enums/project-ids-enum.js.map +1 -0
- 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 +83 -70
- package/dist/features/circle-games/games/web-view/web-view.js.map +1 -1
- package/dist/features/post-game-stats/accuracy/accuracy-styled.js +16 -17
- package/dist/features/post-game-stats/accuracy/accuracy-styled.js.map +1 -1
- package/dist/features/post-game-stats/clock/clock-styled.js +10 -11
- package/dist/features/post-game-stats/clock/clock-styled.js.map +1 -1
- package/dist/features/post-game-stats/points/points-styled.js +6 -7
- 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 +17 -18
- 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/features/trial-session/trial-session-view.js +85 -75
- package/dist/features/trial-session/trial-session-view.js.map +1 -1
- package/dist/features/worksheet/worksheet/worksheet-question/worksheet-question-styled.js +4 -0
- package/dist/features/worksheet/worksheet/worksheet-question/worksheet-question-styled.js.map +1 -1
- package/dist/index.d.ts +109 -72
- package/dist/index.js +208 -203
- package/package.json +1 -1
- package/dist/assets/lotties/circle/tables/advance-mode-segment-lottie.json.js +0 -4370
- package/dist/assets/lotties/circle/tables/advance-mode-segment-lottie.json.js.map +0 -1
- package/dist/assets/lotties/circle/tables/infinite-button-bg.json.js +0 -1552
- package/dist/assets/lotties/circle/tables/infinite-button-bg.json.js.map +0 -1
- package/dist/assets/lotties/circle/tables/infinite-button-symbol.json.js +0 -1795
- package/dist/assets/lotties/circle/tables/infinite-button-symbol.json.js.map +0 -1
- package/dist/assets/lotties/circle/tables/random-mode-segment-lottie.json.js +0 -9661
- package/dist/assets/lotties/circle/tables/random-mode-segment-lottie.json.js.map +0 -1
- package/dist/assets/lotties/circle/tables/sequence-mode-segment-lottie.json.js +0 -8630
- package/dist/assets/lotties/circle/tables/sequence-mode-segment-lottie.json.js.map +0 -1
- package/dist/assets/lotties/circle/tables/table-mode-reveal.json.js +0 -9076
- package/dist/assets/lotties/circle/tables/table-mode-reveal.json.js.map +0 -1
- package/dist/features/circle-games/game-launcher/comps/card-container/card-container-styled.js +0 -53
- package/dist/features/circle-games/game-launcher/comps/card-container/card-container-styled.js.map +0 -1
- package/dist/features/circle-games/game-launcher/comps/card-container/card-container.js +0 -24
- package/dist/features/circle-games/game-launcher/comps/card-container/card-container.js.map +0 -1
- package/dist/features/circle-games/game-launcher/comps/card-container/constants.js +0 -7
- package/dist/features/circle-games/game-launcher/comps/card-container/constants.js.map +0 -1
- package/dist/features/circle-games/game-launcher/comps/tables-card/constants.js +0 -20
- package/dist/features/circle-games/game-launcher/comps/tables-card/constants.js.map +0 -1
- package/dist/features/circle-games/game-launcher/comps/tables-card/table-mode/table-mode-styled.js +0 -24
- package/dist/features/circle-games/game-launcher/comps/tables-card/table-mode/table-mode-styled.js.map +0 -1
- package/dist/features/circle-games/game-launcher/comps/tables-card/table-mode/table-mode.js +0 -83
- package/dist/features/circle-games/game-launcher/comps/tables-card/table-mode/table-mode.js.map +0 -1
- package/dist/features/circle-games/game-launcher/comps/tables-card/tables-card-styled.js +0 -161
- package/dist/features/circle-games/game-launcher/comps/tables-card/tables-card-styled.js.map +0 -1
- package/dist/features/circle-games/game-launcher/comps/tables-card/tables-card.js +0 -223
- package/dist/features/circle-games/game-launcher/comps/tables-card/tables-card.js.map +0 -1
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"game-launcher-styled.js","sources":["../../../../src/features/circle-games/game-launcher/game-launcher-styled.tsx"],"sourcesContent":["import styled from 'styled-components';\n\nimport {
|
1
|
+
{"version":3,"file":"game-launcher-styled.js","sources":["../../../../src/features/circle-games/game-launcher/game-launcher-styled.tsx"],"sourcesContent":["import styled from 'styled-components';\n\nimport {\n GAME_LAUNCHER_SIZE,\n GAME_LAUNCHER_ASSET_PADDING,\n} from './comps/segmented-game-card/constants';\n\nexport const SleepyBoiLottyContainer = styled.div`\n height: ${GAME_LAUNCHER_SIZE + GAME_LAUNCHER_ASSET_PADDING}px;\n width: ${GAME_LAUNCHER_SIZE + GAME_LAUNCHER_ASSET_PADDING}px;\n`;\n"],"names":["SleepyBoiLottyContainer","styled","GAME_LAUNCHER_SIZE","GAME_LAUNCHER_ASSET_PADDING"],"mappings":";;AAOO,MAAMA,IAA0BC,EAAO;AAAA,YAClCC,IAAqBC,CAA2B;AAAA,WACjDD,IAAqBC,CAA2B;AAAA;"}
|
@@ -1,163 +1,122 @@
|
|
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
|
-
const
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
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,
|
1
|
+
import { jsx as r } from "react/jsx-runtime";
|
2
|
+
import T from "lottie-web";
|
3
|
+
import { memo as h, useState as R, useRef as S, useMemo as P, useEffect as x } from "react";
|
4
|
+
import { CircularLoader as G } from "../../ui/loader/circular-loader/circular-loader.js";
|
5
|
+
import { useCircleSounds as M } from "../hooks/use-circle-sounds/use-circle-sounds.js";
|
6
|
+
import { Carousel as V } from "./comps/carousel/carousel.js";
|
7
|
+
import { SegmentedGameCard as i } from "./comps/segmented-game-card/segmented-game-card.js";
|
8
|
+
import { GAME_LAUNCHER_ANALYTICS_EVENTS as z } from "./game-launcher-analytics-events.js";
|
9
|
+
import { SleepyBoiLottyContainer as _ } from "./game-launcher-styled.js";
|
10
|
+
import { useGameLauncherJourney as B } from "./use-game-launcher-journey/use-game-launcher-journey.js";
|
11
|
+
import { ProjectType as t } from "../games/web-view/enums/project-type-enum.js";
|
12
|
+
const J = () => import("../../../assets/lotties/circle/sleepy-boi-lottie.json.js"), Q = h(
|
13
|
+
({ onSegmentClick: o, onJourneyComplete: g, journeyId: n, data: e, isLoading: C, defaultIndex: b = 0 }) => {
|
14
|
+
const [v, A] = R(b), m = S(null), { playSwipSound: u } = M(), {
|
15
|
+
gameRefs: a,
|
16
|
+
lessonRefs: p,
|
17
|
+
puzzleRefs: c,
|
18
|
+
startJourney: f,
|
19
|
+
carouselNextBtnRef: y,
|
20
|
+
isJourneyInProgress: L
|
21
|
+
} = B({
|
22
|
+
setCarouselIndex: A,
|
23
|
+
onSegmentClick: o,
|
24
|
+
onJourneyComplete: g
|
25
|
+
}), E = P(() => {
|
26
|
+
let l = [];
|
27
|
+
return e && (e.lessons && (l = [
|
28
|
+
...l,
|
29
|
+
/* @__PURE__ */ r(
|
30
|
+
i,
|
53
31
|
{
|
54
|
-
ref:
|
32
|
+
ref: p,
|
55
33
|
label: e.lessons.label,
|
56
|
-
value: e.lessons.data.filter((
|
34
|
+
value: e.lessons.data.filter((s) => s.status === "completed").length,
|
57
35
|
maxValue: e.lessons.data.length,
|
58
36
|
initialValue: e.lessons.initialProgressValue,
|
59
|
-
data: e == null ? void 0 : e.lessons.data.map((
|
60
|
-
card:
|
61
|
-
name:
|
62
|
-
isCompleted:
|
63
|
-
onPress: () =>
|
37
|
+
data: e == null ? void 0 : e.lessons.data.map((s) => ({
|
38
|
+
card: s.cardLottie,
|
39
|
+
name: s.name,
|
40
|
+
isCompleted: s.status === "completed",
|
41
|
+
onPress: () => s.status === "completed" ? void 0 : o(s, t.LESSON)
|
64
42
|
}))
|
65
43
|
}
|
66
44
|
)
|
67
|
-
]),
|
68
|
-
...
|
69
|
-
/* @__PURE__ */
|
70
|
-
|
45
|
+
]), l = [
|
46
|
+
...l,
|
47
|
+
/* @__PURE__ */ r(
|
48
|
+
i,
|
71
49
|
{
|
72
|
-
ref:
|
50
|
+
ref: a,
|
73
51
|
label: e.games.label,
|
74
|
-
value: e.games.data.filter((
|
52
|
+
value: e.games.data.filter((s) => s.isPlayed).length,
|
75
53
|
maxValue: e.games.data.length,
|
76
54
|
initialValue: e.games.initialProgressValue,
|
77
|
-
data: e.games.data.map((
|
78
|
-
card:
|
79
|
-
name:
|
55
|
+
data: e.games.data.map((s) => ({
|
56
|
+
card: s.cardLottie,
|
57
|
+
name: s.name,
|
80
58
|
isCompleted: !1,
|
81
|
-
onPress: () =>
|
59
|
+
onPress: () => o(s, t.GAME)
|
82
60
|
}))
|
83
61
|
}
|
84
62
|
),
|
85
|
-
/* @__PURE__ */
|
86
|
-
|
63
|
+
/* @__PURE__ */ r(
|
64
|
+
i,
|
87
65
|
{
|
88
|
-
ref:
|
66
|
+
ref: c,
|
89
67
|
label: e.puzzles.label,
|
90
|
-
value: e.puzzles.data.filter((
|
68
|
+
value: e.puzzles.data.filter((s) => s.solved).length,
|
91
69
|
maxValue: e.puzzles.data.length,
|
92
70
|
initialValue: e.puzzles.initialProgressValue,
|
93
|
-
data: e.puzzles.data.map((
|
94
|
-
card:
|
95
|
-
name:
|
96
|
-
isCompleted:
|
97
|
-
onPress: () =>
|
71
|
+
data: e.puzzles.data.map((s) => ({
|
72
|
+
card: s.cardLottie,
|
73
|
+
name: s.name,
|
74
|
+
isCompleted: s.solved,
|
75
|
+
onPress: () => o(s, t.PUZZLE)
|
98
76
|
}))
|
99
77
|
}
|
100
78
|
)
|
101
|
-
],
|
102
|
-
|
103
|
-
|
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 })],
|
79
|
+
]), l;
|
80
|
+
}, [e, a, p, o, c]), I = P(
|
81
|
+
() => [/* @__PURE__ */ r(_, { ref: m })],
|
123
82
|
[]
|
124
83
|
);
|
125
|
-
return
|
126
|
-
let
|
84
|
+
return x(() => {
|
85
|
+
let l = null;
|
127
86
|
return (async () => {
|
128
|
-
const
|
129
|
-
|
130
|
-
container:
|
131
|
-
animationData:
|
87
|
+
const N = (await J()).default;
|
88
|
+
l = T.loadAnimation({
|
89
|
+
container: m.current,
|
90
|
+
animationData: N,
|
132
91
|
autoplay: !0,
|
133
92
|
loop: !0,
|
134
93
|
renderer: "canvas"
|
135
94
|
});
|
136
95
|
})(), () => {
|
137
|
-
|
96
|
+
l == null || l.destroy();
|
138
97
|
};
|
139
|
-
}, []),
|
140
|
-
e != null && e.puzzles &&
|
141
|
-
}, [e == null ? void 0 : e.lessons, e == null ? void 0 : e.puzzles,
|
142
|
-
|
98
|
+
}, []), x(() => {
|
99
|
+
e != null && e.puzzles && n && L && f(e == null ? void 0 : e.puzzles, !!(e != null && e.lessons), n);
|
100
|
+
}, [e == null ? void 0 : e.lessons, e == null ? void 0 : e.puzzles, L, n, f]), C ? /* @__PURE__ */ r(G, {}) : e ? /* @__PURE__ */ r(
|
101
|
+
V,
|
143
102
|
{
|
144
|
-
ref:
|
145
|
-
items:
|
146
|
-
defaultIndex:
|
147
|
-
onNext:
|
148
|
-
onPrev:
|
103
|
+
ref: y,
|
104
|
+
items: E,
|
105
|
+
defaultIndex: v,
|
106
|
+
onNext: u,
|
107
|
+
onPrev: u,
|
149
108
|
analyticsNext: {
|
150
|
-
analyticsLabel:
|
109
|
+
analyticsLabel: z.NEXT_ACTIVITY
|
151
110
|
},
|
152
111
|
analyticsPrev: {
|
153
|
-
analyticsLabel:
|
112
|
+
analyticsLabel: z.PREV_ACTIVITY
|
154
113
|
}
|
155
114
|
}
|
156
|
-
) : /* @__PURE__ */
|
157
|
-
|
115
|
+
) : /* @__PURE__ */ r(
|
116
|
+
V,
|
158
117
|
{
|
159
|
-
ref:
|
160
|
-
items:
|
118
|
+
ref: y,
|
119
|
+
items: I,
|
161
120
|
analyticsNext: {
|
162
121
|
analyticsLabel: ""
|
163
122
|
},
|
@@ -169,6 +128,6 @@ const O = () => import("../../../assets/lotties/circle/sleepy-boi-lottie.json.js
|
|
169
128
|
}
|
170
129
|
);
|
171
130
|
export {
|
172
|
-
|
131
|
+
Q as GameLauncher
|
173
132
|
};
|
174
133
|
//# 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 { 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,I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,OAAAc;AAAA,QACA,cAAc1B;AAAA,QACd,QAAQK;AAAA,QACR,QAAQA;AAAA,QACR,eAAe;AAAA,UACb,gBAAgBmC,EAA+B;AAAA,QACjD;AAAA,QACA,eAAe;AAAA,UACb,gBAAgBA,EAA+B;AAAA,QACjD;AAAA,MAAA;AAAA,IAAA,IAzBA,gBAAAX;AAAA,MAACU;AAAA,MAAA;AAAA,QACC,KAAK3B;AAAA,QACL,OAAOoB;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 { 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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I,MAAM;AACX,QAAAD,KAAA,QAAAA,EAAW;AAAA,MAAQ;AAAA,IAEvB,GAAG,CAAE,CAAA,GAGLD,EAAU,MAAM;AACV,MAAA5B,KAAA,QAAAA,EAAM,WAAWD,KAAagB,KAChCF,EAAab,KAAA,gBAAAA,EAAM,SAAS,CAAC,EAACA,KAAA,QAAAA,EAAM,UAASD,CAAS;AAAA,IACxD,GACC,CAACC,KAAA,gBAAAA,EAAM,SAASA,KAAA,gBAAAA,EAAM,SAASe,GAAqBhB,GAAWc,CAAY,CAAC,GAE3EZ,sBACM+B,GAAe,CAAA,CAAA,IAGpBhC,IAgBH,gBAAAoB;AAAA,MAACa;AAAA,MAAA;AAAA,QACC,KAAKnB;AAAA,QACL,OAAAG;AAAA,QACA,cAAcd;AAAA,QACd,QAAQK;AAAA,QACR,QAAQA;AAAA,QACR,eAAe;AAAA,UACb,gBAAgB0B,EAA+B;AAAA,QACjD;AAAA,QACA,eAAe;AAAA,UACb,gBAAgBA,EAA+B;AAAA,QACjD;AAAA,MAAA;AAAA,IAAA,IAzBA,gBAAAd;AAAA,MAACa;AAAA,MAAA;AAAA,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;"}
|
@@ -0,0 +1,14 @@
|
|
1
|
+
var t = /* @__PURE__ */ ((r) => (r.CHESS_MOVES = "chess-moves", r.NO_ATTACK = "no-attack", r.TROMINOS = "trominos", r.NIMS_GAME = "nims-game", r.TRANSFORMATION = "transformation", r.LIGHTS_ON_OR_OFF = "lights-on-or-off", r.LIQUID_WARS = "liquid-wars", r.HACKENBUSH = "hackenbush", r.SQUARE_IT = "square-it", r.CLASH_OF_COLOURS = "clash-of-colours", r.REACH = "reach", r))(t || {}), A = /* @__PURE__ */ ((r) => (r.CUT_THE_STRIP = "cut-the-strip", r.ONE_LINE_WONDER = "one-line-wonder", r.FLIP_IT_UP = "flip-it-up", r.CARS_IN_CHAOS = "cars-in-chaos", r.REFLEKT = "reflekt", r.MATCHSTICKS = "matchsticks", r.NO_CROSS = "no-cross", r.DISSECTION = "dissection", r))(A || {}), E = /* @__PURE__ */ ((r) => (r.SNAKE = "snake", r.BASKETBALL = "basketball", r.REARRANGE = "rearrange", r.CAR_RACE = "car-race", r.DROP_ME = "drop-me", r.WARZONE = "warzone", r.SLOT_MACHINE = "slot-machine", r.SLING_SHOT = "sling-shot", r.CLOCK = "clock", r.MINING = "mining", r.SHADING_AREA = "shading-area", r.MAGIC_HAT = "magic-hat", r.PUZZLE = "puzzle", r.BALANCE = "balance", r))(E || {}), S = /* @__PURE__ */ ((r) => (r.ANGLES = "angles", r.FRACTIONS = "fractions", r.TIME = "time", r.ADDITION_SUBTRACTION = "addition-subtraction", r.MULTIPLICATION_DIVISION = "multiplication-division", r.PERCENTAGES = "percentages", r.INTEGERS = "integers", r.RATIOS = "ratios", r))(S || {});
|
2
|
+
const N = {
|
3
|
+
...t,
|
4
|
+
...A,
|
5
|
+
...S
|
6
|
+
};
|
7
|
+
export {
|
8
|
+
t as GameId,
|
9
|
+
S as LessonId,
|
10
|
+
E as MiniGameId,
|
11
|
+
N as ProjectId,
|
12
|
+
A as PuzzleId
|
13
|
+
};
|
14
|
+
//# sourceMappingURL=project-ids-enum.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"project-ids-enum.js","sources":["../../../../../../src/features/circle-games/games/web-view/enums/project-ids-enum.ts"],"sourcesContent":["// 1v1 game ids\nexport enum GameId {\n CHESS_MOVES = 'chess-moves',\n NO_ATTACK = 'no-attack',\n TROMINOS = 'trominos',\n NIMS_GAME = 'nims-game',\n TRANSFORMATION = 'transformation',\n LIGHTS_ON_OR_OFF = 'lights-on-or-off',\n LIQUID_WARS = 'liquid-wars',\n HACKENBUSH = 'hackenbush',\n SQUARE_IT = 'square-it',\n CLASH_OF_COLOURS = 'clash-of-colours',\n REACH = 'reach',\n}\n\n// puzzle game ids\nexport enum PuzzleId {\n CUT_THE_STRIP = 'cut-the-strip',\n ONE_LINE_WONDER = 'one-line-wonder',\n FLIP_IT_UP = 'flip-it-up',\n CARS_IN_CHAOS = 'cars-in-chaos',\n REFLEKT = 'reflekt',\n MATCHSTICKS = 'matchsticks',\n NO_CROSS = 'no-cross',\n DISSECTION = 'dissection',\n}\n\n// Mini Game ids\nexport enum MiniGameId {\n SNAKE = 'snake',\n BASKETBALL = 'basketball',\n REARRANGE = 'rearrange',\n CAR_RACE = 'car-race',\n DROP_ME = 'drop-me',\n WARZONE = 'warzone',\n SLOT_MACHINE = 'slot-machine',\n SLING_SHOT = 'sling-shot',\n CLOCK = 'clock',\n MINING = 'mining',\n SHADING_AREA = 'shading-area',\n MAGIC_HAT = 'magic-hat',\n PUZZLE = 'puzzle',\n BALANCE = 'balance',\n}\n\n// lesson ids\nexport enum LessonId {\n ANGLES = 'angles',\n FRACTIONS = 'fractions',\n TIME = 'time',\n ADDITION_SUBTRACTION = 'addition-subtraction',\n MULTIPLICATION_DIVISION = 'multiplication-division',\n PERCENTAGES = 'percentages',\n INTEGERS = 'integers',\n RATIOS = 'ratios',\n}\n\n// each category of games is called as Project\nexport const ProjectId = {\n ...GameId,\n ...PuzzleId,\n ...LessonId,\n} as const;\n"],"names":["GameId","PuzzleId","MiniGameId","LessonId","ProjectId"],"mappings":"AACY,IAAAA,sBAAAA,OACVA,EAAA,cAAc,eACdA,EAAA,YAAY,aACZA,EAAA,WAAW,YACXA,EAAA,YAAY,aACZA,EAAA,iBAAiB,kBACjBA,EAAA,mBAAmB,oBACnBA,EAAA,cAAc,eACdA,EAAA,aAAa,cACbA,EAAA,YAAY,aACZA,EAAA,mBAAmB,oBACnBA,EAAA,QAAQ,SAXEA,IAAAA,KAAA,CAAA,CAAA,GAeAC,sBAAAA,OACVA,EAAA,gBAAgB,iBAChBA,EAAA,kBAAkB,mBAClBA,EAAA,aAAa,cACbA,EAAA,gBAAgB,iBAChBA,EAAA,UAAU,WACVA,EAAA,cAAc,eACdA,EAAA,WAAW,YACXA,EAAA,aAAa,cARHA,IAAAA,KAAA,CAAA,CAAA,GAYAC,sBAAAA,OACVA,EAAA,QAAQ,SACRA,EAAA,aAAa,cACbA,EAAA,YAAY,aACZA,EAAA,WAAW,YACXA,EAAA,UAAU,WACVA,EAAA,UAAU,WACVA,EAAA,eAAe,gBACfA,EAAA,aAAa,cACbA,EAAA,QAAQ,SACRA,EAAA,SAAS,UACTA,EAAA,eAAe,gBACfA,EAAA,YAAY,aACZA,EAAA,SAAS,UACTA,EAAA,UAAU,WAdAA,IAAAA,KAAA,CAAA,CAAA,GAkBAC,sBAAAA,OACVA,EAAA,SAAS,UACTA,EAAA,YAAY,aACZA,EAAA,OAAO,QACPA,EAAA,uBAAuB,wBACvBA,EAAA,0BAA0B,2BAC1BA,EAAA,cAAc,eACdA,EAAA,WAAW,YACXA,EAAA,SAAS,UARCA,IAAAA,KAAA,CAAA,CAAA;AAYL,MAAMC,IAAY;AAAA,EACvB,GAAGJ;AAAA,EACH,GAAGC;AAAA,EACH,GAAGE;AACL;"}
|
@@ -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
|
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,UAHCA,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 {\n GameId,\n PuzzleId,\n LessonId,\n MiniGameId,\n WebViewEvent,\n ProjectOutcome,\n ProjectType,\n} from './enums';\nimport type { WEBVIEW_ANALYTICS_EVENTS } from './web-view-analytics-events';\nimport type { IframeHTMLAttributes } from 'react';\n\nexport type TProject = GameId | PuzzleId | LessonId;\n\nexport interface IPlayer {\n id: string;\n username: string;\n grade?: string;\n avatar?: IAvatarLayer[] | null;\n playerType: TUserTypes;\n}\n\ninterface IBaseWebGameProps<T> {\n projectId: T;\n variant: string;\n projectType: ProjectType;\n joinByRoomId?: string;\n enableSync?: boolean; // applicable for all except multiplayer games\n enablePlayerTurnIndicators?: boolean;\n enableCloseButton?: boolean;\n}\n\nexport interface IMultiplayerWebGameProps extends IBaseWebGameProps<GameId> {}\n\nexport interface IPuzzleWebGameProps extends IBaseWebGameProps<PuzzleId> {\n question: string;\n askHintPermission?: boolean;\n}\n\nexport interface ILessonWebGameProps extends IBaseWebGameProps<LessonId> {\n miniGameIdentifier: MiniGameId;\n sessionId: string;\n targetQuestions: 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: IMultiplayerWebGameProps | IPuzzleWebGameProps | ILessonWebGameProps;\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":"AAmDY,IAAAA,sBAAAA,OACVA,EAAA,UAAU,WACVA,EAAA,UAAU,WACVA,EAAA,OAAO,QAHGA,IAAAA,KAAA,CAAA,CAAA;"}
|
@@ -1,100 +1,113 @@
|
|
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 L } from "react/jsx-runtime";
|
2
|
+
import { forwardRef as G, useRef as M, useMemo as _, useCallback as A, useImperativeHandle as W, useEffect as H } from "react";
|
3
|
+
import { useUIContext as V } from "../../../ui/context/context.js";
|
4
|
+
import { ALLOWED_ORIGIN as j } from "./constants.js";
|
5
|
+
import { ProjectType as I } from "./enums/project-type-enum.js";
|
6
|
+
import { WebViewEvent as i } from "./enums/web-view-events-enum.js";
|
7
|
+
const K = G((N, C) => {
|
8
8
|
const {
|
9
|
-
baseUrl:
|
10
|
-
projectDetails:
|
11
|
-
playerDetails:
|
9
|
+
baseUrl: P,
|
10
|
+
projectDetails: v,
|
11
|
+
playerDetails: T,
|
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 {
|
14
|
+
handleInfoMessage: f,
|
15
|
+
onBack: l,
|
16
|
+
...R
|
17
|
+
} = N, p = M(null), g = _(() => T, [T]), o = _(() => v, [v]);
|
18
|
+
let u = "";
|
19
|
+
const { onEvent: w } = V();
|
20
|
+
o.projectType === I.LESSON && (u = o.miniGameIdentifier);
|
21
|
+
const m = A(() => {
|
22
|
+
const {
|
23
|
+
enableCloseButton: r = !0,
|
24
|
+
enablePlayerTurnIndicators: s = !1,
|
25
|
+
enableSync: t = !1,
|
26
|
+
joinByRoomId: E = ""
|
27
|
+
} = o;
|
23
28
|
let e = {
|
24
|
-
|
29
|
+
joinByRoomId: E,
|
30
|
+
enableCloseButton: r,
|
31
|
+
enablePlayerTurnIndicators: s,
|
32
|
+
enableSync: t
|
25
33
|
};
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
34
|
+
if (o.projectType === I.PUZZLE) {
|
35
|
+
const n = o;
|
36
|
+
e = {
|
37
|
+
...e,
|
38
|
+
question: n.question,
|
39
|
+
askHintPermission: n.askHintPermission
|
40
|
+
};
|
41
|
+
}
|
42
|
+
if (o.projectType === I.LESSON) {
|
43
|
+
const n = o;
|
44
|
+
e = {
|
45
|
+
...e,
|
46
|
+
miniGameIdentifier: n.miniGameIdentifier,
|
47
|
+
sessionId: n.sessionId,
|
48
|
+
targetQuestions: n.targetQuestions
|
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(
|
43
56
|
JSON.stringify({
|
44
|
-
event:
|
45
|
-
payload:
|
57
|
+
event: i.GAME_DATA,
|
58
|
+
payload: r
|
46
59
|
}),
|
47
|
-
|
60
|
+
j
|
48
61
|
);
|
49
|
-
}, [m]),
|
50
|
-
var
|
51
|
-
const
|
52
|
-
(
|
62
|
+
}, [m]), O = A(() => {
|
63
|
+
var s, t;
|
64
|
+
const r = m();
|
65
|
+
(t = (s = p.current) == null ? void 0 : s.contentWindow) == null || t.postMessage(
|
53
66
|
JSON.stringify({
|
54
|
-
event:
|
67
|
+
event: i.SET_CONFIG,
|
55
68
|
payload: {
|
56
|
-
user:
|
57
|
-
projectConfig:
|
69
|
+
user: g,
|
70
|
+
projectConfig: r
|
58
71
|
}
|
59
72
|
}),
|
60
|
-
|
73
|
+
j
|
61
74
|
);
|
62
|
-
}, [
|
63
|
-
return W(C, () =>
|
64
|
-
const
|
65
|
-
var
|
66
|
-
const
|
67
|
-
if (
|
68
|
-
const { pattern:
|
69
|
-
(D = (
|
75
|
+
}, [g, m]);
|
76
|
+
return W(C, () => p.current, []), H(() => {
|
77
|
+
const r = (s) => {
|
78
|
+
var S, D;
|
79
|
+
const t = s.data, E = typeof t == "string" ? JSON.parse(t) : t, { event: e, payload: n = null } = E;
|
80
|
+
if (e === i.VIBRATE) {
|
81
|
+
const { pattern: y } = n;
|
82
|
+
(D = (S = window.navigator).vibrate) == null || D.call(S, y);
|
70
83
|
}
|
71
|
-
if (
|
72
|
-
const { eventName:
|
73
|
-
|
84
|
+
if (e === i.GAME_BACK && (l == null || l()), e === i.HIDE_LOADER && (a == null || a()), e === i.LOAD_DATA_FROM_APP && (d == null || d()), e === i.GET_CONFIG && O(), e === i.UPDATE_STATS && (c == null || c(n)), e === i.SHOW_SNACKBAR && (f == null || f(n)), e === i.TRACK_EVENT) {
|
85
|
+
const { eventName: y, properties: b } = n;
|
86
|
+
w(y, b);
|
74
87
|
}
|
75
88
|
};
|
76
|
-
return window.addEventListener("message",
|
77
|
-
window.removeEventListener("message",
|
89
|
+
return window.addEventListener("message", r), () => {
|
90
|
+
window.removeEventListener("message", r);
|
78
91
|
};
|
79
92
|
}, [
|
80
|
-
p,
|
81
93
|
f,
|
94
|
+
l,
|
82
95
|
c,
|
83
96
|
a,
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
]), /* @__PURE__ */
|
97
|
+
O,
|
98
|
+
d,
|
99
|
+
w
|
100
|
+
]), /* @__PURE__ */ L(
|
88
101
|
"iframe",
|
89
102
|
{
|
90
|
-
...
|
91
|
-
ref:
|
92
|
-
src: `${
|
103
|
+
...R,
|
104
|
+
ref: p,
|
105
|
+
src: `${P}/play-game/${o.projectId}/${o.variant}${u ? `/${u}` : ""}?version=2`,
|
93
106
|
allow: "autoplay"
|
94
107
|
}
|
95
108
|
);
|
96
109
|
});
|
97
110
|
export {
|
98
|
-
|
111
|
+
K as WebView
|
99
112
|
};
|
100
113
|
//# 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
|
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 {\n enableCloseButton = true,\n enablePlayerTurnIndicators = false,\n enableSync = false,\n joinByRoomId = '',\n } = memoizedProjectDetails;\n\n let payload = {\n joinByRoomId,\n enableCloseButton,\n enablePlayerTurnIndicators,\n enableSync,\n } as IMultiplayerWebGameProps | IPuzzleWebGameProps | ILessonWebGameProps;\n\n if (memoizedProjectDetails.projectType === ProjectType.PUZZLE) {\n const details = memoizedProjectDetails as IPuzzleWebGameProps;\n\n payload = {\n ...payload,\n question: details.question,\n askHintPermission: details.askHintPermission,\n } as IPuzzleWebGameProps;\n }\n\n if (memoizedProjectDetails.projectType === ProjectType.LESSON) {\n const details = memoizedProjectDetails as ILessonWebGameProps;\n\n payload = {\n ...payload,\n miniGameIdentifier: details.miniGameIdentifier,\n sessionId: details.sessionId,\n targetQuestions: details.targetQuestions,\n } as ILessonWebGameProps;\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","enablePlayerTurnIndicators","enableSync","joinByRoomId","payload","details","sendGamesData","_b","_a","WebViewEvent","ALLOWED_ORIGIN","setConfig","projectConfig","useImperativeHandle","useEffect","handleMessage","e","data","parsedData","event","pattern","eventName","properties","jsx"],"mappings":";;;;;;AAkBO,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;AAAA,MACJ,mBAAAC,IAAoB;AAAA,MACpB,4BAAAC,IAA6B;AAAA,MAC7B,YAAAC,IAAa;AAAA,MACb,cAAAC,IAAe;AAAA,IACb,IAAAV;AAEJ,QAAIW,IAAU;AAAA,MACZ,cAAAD;AAAA,MACA,mBAAAH;AAAA,MACA,4BAAAC;AAAA,MACA,YAAAC;AAAA,IAAA;AAGE,QAAAT,EAAuB,gBAAgBI,EAAY,QAAQ;AAC7D,YAAMQ,IAAUZ;AAEN,MAAAW,IAAA;AAAA,QACR,GAAGA;AAAA,QACH,UAAUC,EAAQ;AAAA,QAClB,mBAAmBA,EAAQ;AAAA,MAAA;AAAA,IAE/B;AAEI,QAAAZ,EAAuB,gBAAgBI,EAAY,QAAQ;AAC7D,YAAMQ,IAAUZ;AAEN,MAAAW,IAAA;AAAA,QACR,GAAGA;AAAA,QACH,oBAAoBC,EAAQ;A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